text:
<?xml version="1.0" encoding="UTF-8"?>

<document>

  <properties>
    <title>Commons SCXML Changes</title>
    <author email="rahul@apache.org">Rahul Akolkar</author>
  </properties>

The latest release of Commons SCXML is version 0.8.

If you are interested in helping the project, join us on the
            commons-dev mailing list

    <release version="2.0" date="In SVN trunk"
      description="Latest unreleased code">

      <action dev="woonsan" type="fix" issue="SCXML-233">
        [07-12-2015] SCInstance becomes not serialzable after triggering event.
      </action>

      <action dev="woonsan" type="fix" issue="SCXML-234">
        [07-12-2015] Unit test (ScriptTest) fails on Java 1.8 due to new JS Engine.
      </action>

      <action dev="ate" type="fix" issue="SCXML-194">
        [03-01-2014] Drop outdated, incomplete, broken or no longer supported features for SCXML 2.0.
      </action>

      <action dev="ate" type="fix" issue="SCXML-206">
        [09-07-2014] Specification mismatch: event-less transitions are triggered by named events.
      </action>

      <action dev="ate" type="add" issue="SCXML-187">
        [01-27-2014] Add support for initial SCXML script (SCXML spec 3.2.2: <scxml> children).
      </action>

      <action dev="ate" type="add" issue="SCXML-191">
        [01-27-2014] Support foreach element.
      </action>

      <action dev="ate" type="add" issue="SCXML-190">
        [01-27-2014] Check and enforce required scxml element attributes as defined by the specification.
      </action>

      <action dev="ate" type="add" issue="SCXML-186">
        [04-03-2014] Groovy expression evaluator.
      </action>

      <action dev="ate" type="add" issue="SCXML-200">
        [04-03-2014] Normalize and complete the SCXML object model and parsing.
      </action>

      <action dev="ate" type="add" issue="SCXML-199">
        [03-17-2014] Map the <scxml> initial attribute to an initial Transition instead of a (single) TransitionTarget.
      </action>

      <action dev="ate" type="add" issue="SCXML-198">
        [03-17-2014] <history> elements (now) requires a <transition> child element with a default target configuration.
      </action>

      <action dev="ate" type="add" issue="SCXML-197">
        [04-03-2014] Better separation of concern between SCXMLExecutor and SCInstance and introducing a new SCXMLExecutionContext.
      </action>

      <action dev="ate" type="add" issue="SCXML-196">
        [04-03-2014] Redefine SCXMLSemantics to align with the Algorithm for SCXML Interpretation as described in the SCXML specification.
      </action>

      <action dev="ate" type="add" issue="SCXML-182">
        [04-03-2014] Support error event raising to comply the spec "3.12.2 Errors".
      </action>

      <action dev="woonsan" type="fix" issue="SCXML-178">
        [11-28-2013] Initial state ID attribute in SCXML element shouldn't be mandatory.
      </action>

      <action dev="woonsan" type="fix" issue="SCXML-180">
        [12-04-2013] Prevent NPEs for possible null value returned from Evaluator.eval* methods.
      </action>

      <action dev="ate" type="add" issue="SCXML-183">
        [12-05-2013] Expose JexlEngine strict/silent mode settings through the JexlEvaluator for easier customization.
      </action>

      <action dev="ate" type="add" issue="SCXML-170">
        [10-15-2013] Move to new package and artifact org.apache.commons.scxml2 and version 2.0.
      </action>

      <action dev="ate" type="fix" issue="SCXML-168">
        [10-14-2013] Test failure in SCXMLWriterTest using Java 7.
      </action>

      <action dev="dbrosius" type="fix" issue="SCXML-171">
        [10-16-2013] Upgrade JUnit dependency to 4.11.
      </action>

      <action dev="woonsan" type="fix" issue="SCXML-167" due-to="Maikel Linke">
        [11-28-2013] SimpleScheduler removes wrong Timer.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-161">
        [06-06-2011] transition leaving a child state of parallel.
      </action>

      <action dev="ate" type="add" issue="SCXML-224">
        [01-02-2015] Improve SCXML state configuration handling and optional validation.
      </action>

      <action dev="ate" type="add" issue="SCXML-222">
        [11-14-2014] Add support for executing the SCXML IRP test cases.
      </action>

      <action dev="ate" type="add" issue="SCXML-214">
        [11-14-2014] Replace JAXP xpath expression evaluation with Commons JXPath.
      </action>

      <action dev="ate" type="add" issue="SCXML-213">
        [11-14-2014] Fixing the datamodel handling - reimplement xpath processing, the Data() function and the <assign> action.
      </action>

      <action dev="ate" type="add" issue="SCXML-210">
        [10-10-2014] Align <send> action attributes support with the latest SCXML specification.
      </action>

      <action dev="ate" type="fix" issue="SCXML-209">
        [10-08-2014] Incomplete legal state configuration validation in ModelUpdater.
      </action>

      <action dev="ate" type="add" issue="SCXML-212">
        [10-11-2014] Add support for SCXML datamodel type and default Evaluator instantiation.
      </action>

      <action dev="ate" type="fix" issue="SCXML-211">
        [10-11-2014] Bug in current SCXML specification for addDescendantStatesToEnter algorithm can lead to illegal configurations.
      </action>

      <action dev="ate" type="add" issue="SCXML-72">
        [10-17-2013] Rewrite the IO package for version 2.0.
      </action>

      <action dev="ate" type="fix" issue="SCXML-99">
        [03-30-2014] Support read-only system variables.
      </action>

      <action dev="woonsan" type="fix" issue="SCXML-100">
        [01-02-2014] Support _event variable.
      </action>

      <action dev="sebb" type="fix" issue="SCXML-91">
        [01-07-2009] Test case bugs.
      </action>

      <action dev="woonsan" type="fix" issue="SCXML-227" due-to="Michael Goerlich">
        [04-08-2015] Cancel doesn't work.
      </action>

      <action dev="rahul" type="add" issue="SCXML-109">
        [07-16-2009] Attribute targettype of send and invoke elements changed to type in SCXML Working Draft (7 May 2009).
      </action>

      <action dev="ate" type="fix" issue="SCXML-203">
        [04-21-2014] Calculation of states to be entered can be depending on states to be exited and thereby also their possible history.
      </action>

      <action dev="ate" type="fix" issue="SCXML-202">
        [04-18-2014] State machine running status must be kept and maintained by SCInstance across serialization and deserialization.
      </action>

      <action dev="woonsan" type="add" issue="SCXML-179">
        [12-03-2013] Leave more context (location) information when failing to execute JEXL scripts.
      </action>

      <action dev="woonsan" type="add" issue="SCXML-172">
        [10-16-2013] Improve CustomActionTest not to depend on test method execution order.
      </action>

      <action dev="woonsan" type="fix" issue="SCXML-160">
        [11-08-2013] Cast to State in TransitionTargetComparator.
      </action>

      <action dev="woonsan" type="add" issue="SCXML-225" due-to="Franck Foutou">
        [02-13-2015] Preserve order in <send> namelist attribute values.
      </action>

      <action dev="ate" type="add" issue="SCXML-221">
        [11-15-2014] Add "null" datamodel support as required by the SCXML specification.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-104" due-to="Jorge Vila Forcén">
        [01-09-2009] AbstractStateMachine log error.
      </action>

      <action dev="sebb" type="fix" issue="SCXML-103">
        [01-06-2009] Remove any catch (Throwable t) occurences.
      </action>

      <action dev="ate" type="fix" issue="SCXML-193">
        [02-15-2014] Drop non-functional exit element.
      </action>

      <action dev="woonsan" type="fix" issue="SCXML-177">
        [12-05-2013] Correct error/warning messages in SCXML reading to be up-to-date.
      </action>

      <action dev="woonsan" type="add" issue="SCXML-114" due-to="Henri Biestro">
        [11-01-2013] Support for JEXL2 Evaluator.
      </action>

    </release>

    <release version="1.0" date="In SVN branch"
     description="Latest unreleased code">

     <action dev="rahul" type="add" issue="SCXML-68" due-to="Tony Seebregts">
       [03-07-2008] Enable JavaScript as one of the pluggable ELs in SCXML
       documents.
     </action>

    </release>

    <release version="0.9" date="December 2008"
     description="Latest release">

     <action dev="rahul" type="fix">
       [11-21-2008] Added clirr plugin report, cleaned up some checkstyle
       errors.
     </action>

     <action dev="rahul" type="add" issue="SCXML-86">
       [11-21-2008] Support "initial" attribute of <state>.
     </action>

     <action dev="rahul" type="fix" issue="SCXML-88">
       [11-21-2008] SCXMLSerializer does not serialize custom namespace
       declarations.
     </action>

     <action dev="rahul" type="fix" issue="SCXML-88">
       [11-21-2008] SCXMLSerializer does not serialize custom namespace
       declarations.
     </action>

     <action dev="rahul" type="fix">
       [11-21-2008] Change "appLog" name to be derived from
       "SCXMLSemantics.class" rather than the arbitrary "scxml.app.log"
     </action>

     <action dev="rahul" type="fix" issue="SCXML-90">
       [11-21-2008] "event" attribute of <send> is not evaluated
     </action>

     <action dev="rahul" type="add">
       [11-19-2008] Support executable content in <transition>
       child of <initial>
     </action>

     <action dev="rahul" type="add" issue="SCXML-81">
       [11-19-2008] Support for <onentry> and <onexit> children
       for <parallel> states.
     </action>

     <action dev="rahul" type="add" issue="SCXML-82">
       [11-18-2008] Support for <transition> children for
       <parallel> states.
     </action>

     <action dev="rahul" type="fix" issue="SCXML-89" due-to="Joel Truher">
       [11-14-2008] <assign> doesn't remove all existing children
       from location.
     </action>

     <action dev="rahul" type="add" issue="SCXML-80">
       [11-14-2008] SCXMLParser should throw an exception for parsing
       failures on bad URIs in <state>'s "src" attribute.
     </action>

     <action dev="rahul" type="fix" issue="SCXML-87" due-to="Roger Hoover">
       [11-13-2008] Delayed events not passing payload.
     </action>

     <action dev="rahul" type="fix" issue="SCXML-85">
       [11-13-2008] Added Softwaredemo to "Who is using it?"
     </action>

     <action dev="rahul" type="fix" issue="SCXML-84" due-to="Jakob Sachse">
       [10-03-2008] Added a tutorial about using Commons SCXML on
       Google Android.
     </action>

     <action dev="rahul" type="fix" issue="SCXML-83" due-to="Ingmar Kliche">
       [08-01-2008] Improvements in <send> serialization.
     </action>

     <action dev="rahul" type="fix" issue="SCXML-79">
       [07-30-2008] Stop rendering non-standard "parentid" attribute during
       serialization.
     </action>

     <action dev="rahul" type="fix">
       [07-28-2008] Update datamodel section of the guide to stress namespace
       awareness of document.
     </action>

     <action dev="rahul" type="fix">
       [07-28-2008] <var> and <exit> should be serialized in the
       Commons SCXML namespace.
     </action>

     <action dev="rahul" type="fix" issue="SCXML-78" due-to="Daniel Schwager">
       [07-28-2008] SCXMLListeners will not processed in defined order.
     </action>

     <action dev="rahul" type="fix" issue="SCXML-77" due-to="Edzard Hoefig">
       [07-28-2008] Correct semantics for <param> with only the "name"
       attribute specified.
     </action>

     <action dev="rahul" type="fix" issue="SCXML-76" due-to="Ingmar Kliche">
       [07-28-2008] Serialization of expressions may produce invalid XML.
     </action>

     <action dev="rahul" type="add" issue="SCXML-75" due-to="Daniel Schwager">
       [07-11-2008] Make TriggerEvent class Serializable.
     </action>

     <action dev="rahul" type="add" issue="SCXML-74" due-to="Edzard Hoefig">
       [07-11-2008] <data> should support the "id" attribute.
     </action>

     <action dev="rahul" type="fix" issue="SCXML-73" due-to="Elaine Wong">
       [06-17-2008] The "delay" attribute of the <send> element
       should be a value expression.
     </action>

     <action dev="rahul" type="add">
       [06-17-2008] Support the "initial" attribute of the <scxml>
       element, added in the 4th Working Draft.
     </action>

    </release>

    <release version="0.8" date="May 2008"
     description="Release">

     <action dev="rahul" type="add" issue="SCXML-64">
       [05-03-2008] Better error reporting for ignored or misplaced elements
       by parser (SCXMLParser class).
     </action>

     <action dev="rahul" type="add" issue="SCXML-62">
       [04-25-2008] Enhancement request for supporting fragment URLs in
       <state> element's src attribute.
     </action>

     <action dev="rahul" type="fix" issue="SCXML-67" due-to="SeongSoo Park">
       [02-09-2008] Process <parallel> child of <state> correctly.
     </action>

     <action dev="rahul" type="fix" issue="SCXML-66">
       [01-26-2008] Improve first-hit performance for following transitions
       by working out the paths at parse-time.
     </action>

     <action dev="rahul" type="update">
       [01-03-2008] Clarify via Javadocs that the SCXMLParser assumes the
       input to be a well-formed and correct SCXML document.
     </action>

     <action dev="rahul" type="add" due-to="Ross Yakulis">
       [01-03-2008] Added tests for SCXML-64.
     </action>

     <action dev="rahul" type="add">
       [01-03-2008] Add the issues test package for tracking tests tied to
       the Commons issue tracker.
     </action>

     <action dev="rahul" type="update">
       [01-03-2008] Improve serialization of <transition> elements.
     </action>

     <action dev="rahul" type="add">
       [01-03-2008] Add assertPostTriggerState() methods to SCXMLTestHelper.
     </action>

     <action dev="rahul" type="update" due-to="Sebastian Bazley">
       [12-20-2007] Minor site updates: add a prominent download link, and
       update a few remaining Jakarta references.
     </action>

    </release>

    <release version="0.7" date="December 2007"
     description="Release">

     <action dev="rahul" type="add">
       [12-12-2007] Add experimental Maven2 pom.xml to source distro.
     </action>

     <action dev="rahul" type="update">
       [12-12-2007] Update JUnit dependency version to 3.8.2.
     </action>

     <action dev="rahul" type="update">
       [12-08-2007] AbstractStateMachine and SimpleSCXMLListener classes
       switched to the new SCXMLParser.
      </action>

      <action dev="rahul" type="update">
       [12-06-2007] Recommended version of Commons Logging has been upgraded
       to v1.1.1.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-53">
       [12-06-2007] Wild card event name handling on transitions made in
       line with WD.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-61">
       [12-04-2007] Clarify via class Javadoc interaction model between
       Invokers and parent executor.
      </action>

      <action dev="rahul" type="add" issue="SCXML-55">
       [12-04-2007] Add support for the <event> tag.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-58">
       [12-04-2007] Object model not stateless due to State class. Store the
       completion status for composite states along with other instance
       information in the executor.
      </action>

      <action dev="rahul" type="fix">
       [12-04-2007] Deprecate SCXMLDigester class in favor of the new
       SCXMLParser class. The new class supports newer Working Drafts and has
       better naming.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-60" due-to="Andy Bailey">
       [12-03-2007] Fix possible race condition in AsyncTrigger class.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-54" due-to="Mike Tillberg">
       [12-03-2007] Events from custom actions missing payload. Also fix
       test classes to safely create contexts.
      </action>

      <action dev="rahul" type="fix">
       [12-03-2007] Skip serialization tests if necessary directory cannot
       be created.
      </action>

      <action dev="rahul" type="add">
       [11-30-2007] Support nested invokes when using SimpleSCXMLInvoker
       class.
      </action>

      <action dev="niallp" type="add" due-to="Niall Pemberton">
       [11-16-2007] Update Maven 2 build to include source and binary
       assemblies and site resources.
      </action>

      <action dev="rahul" type="fix">
       [08-20-2007] Apply per region document order filter for transition
       conflict resolution. See SCXML-52 for part of discussion.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-49">
       [08-06-2007] SimpleSCXMLInvoker may miss transition to final state.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-52" due-to="Ingmar Kliche">
       [08-01-2007] Fix conflict resolution for conditionless stay transitions.
       class.
      </action>

      <action dev="rahul" type="fix">
       [07-30-2007] Various changes related to the Commons TLP move.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-51">
       [07-27-2007] Delete existing child nodes before adding new ones
       when using <assign> to supply new values to <data> nodes.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-48" due-to="Michael Heuer">
       [06-26-2007] Fixed subclassing behavior for AbstractStateMachine
       class.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-44">
       [06-15-2007] Better names for getter and setter of the boolean
       property State#isFinal. Previous names deprecated.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-46" due-to="Michael Heuer">
       [06-15-2007] Added a SCXMLListener abstract adapter class.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-41">
       [06-15-2007] Added information about failing expression to
       evaluation error messages.
      </action>

      <action dev="bayard" type="remove" due-to="Henri Yandell">
       [06-14-2007] Remove KEYS file, in favor of one file for all of Commons.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-45">
       [05-29-2007] Payload of events sent to current scxml session using
       <send> tag are now injected into engine. Commons SCXML adds
       the special _eventdatamap variable for storing payloads
       for derived events.
      </action>

      <action dev="rahul" type="update">
       [04-25-2007] Replace deprecated API usage, with current ones.
      </action>

      <action dev="rahul" type="update">
       [04-25-2007] The test package switched to using SCXMLParser class.
      </action>

      <action dev="rahul" type="update">
       [04-25-2007] Added support for <final> to SCXMLParser class.
      </action>

      <action dev="rahul" type="add">
       [04-25-2007] Add a Commons SCXML namespace to support implementation
       specific actions. Moved <var> and <exit> actions to
       this implementation specific namespace.
      </action>

      <action dev="rahul" type="add">
       [03-24-2007] New set of tests matching vocabulary in latest Working
       Draft, for testing the new SCXMLParser class.
      </action>

      <action dev="rahul" type="update">
       [03-24-2007] Deprecate various method in the model package (primarily
       SCXML, State and Parallel classes) based on changes brought on by the
       latest WDs.
      </action>

      <action dev="rahul" type="add">
       [03-22-2007] Add new parser (org.apache.commons.scxml.io.SCXMLParser)
       to support latest WD and improve naming.
      </action>

      <action dev="rahul" type="add">
       [03-12-2007] The regions of a parallel are entered in document
       order. This is implementation-specific behavior and users should
       not rely on it.
      </action>

      <action dev="rahul" type="add">
       [03-12-2007] Added tests for conflict resolution based on document
       order and for multiple transition targets.
      </action>

      <action dev="rahul" type="fix">
       [03-12-2007] Deprecated various methods in Transition class that
       refer to a singular target.
      </action>

      <action dev="rahul" type="add">
       [03-12-2007] Implement ability to support multiple transition targets
       (space separated list of state IDs). IDs must no longer contain
       whitespace.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-30">
       [03-12-2007] Better handling of parent-child relationships (part 1).
      </action>

      <action dev="rahul" type="fix">
       [03-12-2007] Deprecated State#getTransitions() in favor of
       State#getTransitionsList().
      </action>

      <action dev="rahul" type="add">
       [03-09-2007] Implement document order priority for transitions.
      </action>

      <action dev="rahul" type="fix">
       [12-18-2006] SCXMLExecutor#logState() now uses debug level to reduce noise
       at console.
      </action>

    </release>

    <release version="0.6" date="December 2006"
     description="Release">

      <action dev="rahul" type="fix" issue="SCXML-16" due-to="Sitthichai Rernglertpricha">
       [12-12-2006] target and type attributes of <send> element
       are now evaluated as expressions.
      </action>

      <action dev="rahul" type="fix">
       [12-12-2006] Set tests to warn, but not fail, if the DOM L2
       implementation in use is not serializable.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-32">
       [12-07-2006] Update Commons Logging to version 1.1.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-32">
       [12-07-2006] Update Commons JEXL to version 1.1.
      </action>

      <action dev="rahul" type="add" issue="SCXML-33">
       [12-07-2006] Improved processing of namespace prefixes in
       deferred evaluation of XPath expressions.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-32">
       [12-06-2006] Update Commons Digester to version 1.8.
      </action>

      <action dev="rahul" type="add" issue="SCXML-31" due-to="Nestor Urquiza">
       [11-22-2006] Logging for <var> and <assign>.
      </action>

      <action dev="rahul" type="add">
       [11-08-2006] Add project DOAP file.
      </action>

      <action dev="rahul" type="add">
       [11-07-2006] Add a test case to demonstrate adding a custom
       action with the same local name as one of the standard SCXML
       actions (but a different namespace).
      </action>

      <action dev="rahul" type="add">
       [11-04-2006] Add tests to ensure white box behavior of the
       <state> element's src attribute.
      </action>

      <action dev="rahul" type="fix">
       [10-23-2006] Up to date versions for the usecases blurbs
       for the website. Update image on site front page.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-29">
       [10-17-2006] Added serial version UIDs.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-21">
       [10-17-2006] New EventDispatcher implementation (SimpleScheduler)
       that provides the ability to deal with delayed events for the
       "scxml" <send> type.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-2">
       [10-11-2006] Some thread-safety improvements for
       SCXMLExecutor instances.
      </action>

      <action dev="rahul" type="fix">
       [10-11-2006] Update to new ASLv2 license headers for source files.
      </action>

      <action dev="rahul" type="add" issues="SCXML-20">
       [10-05-2006] The Commons SCXML object model as well as the
       SCXMLExecutor instances are now serializable.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-25">
       [10-02-2006] Deprecate ErrorReporter fields, add ErrorConstants
       class for default Commons SCXML semantics.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-23">
       [09-29-2006] Begin the deprecation process for custom digester
       rules in the io package.
      </action>

      <action dev="rahul" type="fix">
       [09-21-2006] SCXML elements have to be defined in the following
       namespace (case sensitive): http://www.w3.org/2005/07/scxml
      </action>

      <action dev="rahul" type="fix" issue="SCXML-14" due-to="Sitthichai Rernglertpricha">
       [08-07-2006] Allow the target of a transition to be omitted.
      </action>

      <action dev="rahul" type="fix">
       [07-28-2006] Updated website to reflect 0.5 release.
      </action>

    </release>

    <release version="0.5" date="July 2006"
     description="First release">

      <action dev="rahul" type="fix" issue="SCXML-13">
       [07-19-2006] SCXML doesn't compile using (Sun) JDK 1.5.
       actions.
      </action>

      <action dev="rahul" type="add" issue="SCXML-3">
       [07-19-2006] Add src attribute processing for assign tag.
      </action>

      <action dev="rahul" type="add">
       [06-19-2006] Added invoke, param and finalize processing. These
       SCXML elements were added in the January 2006 Working Draft.
      </action>

      <action dev="rahul" type="fix">
       [05-17-2006] Reflect use of JIRA as the issue tracker for
       Commons SCXML. Bugzilla should no longer be used.
      </action>

      <action dev="rahul" type="add">
       [05-17-2006] Added examples of shallow and deep history.
      </action>

      <action dev="rahul" type="fix" issue="SCXML-8">
       [05-17-2006] External document digester now processes custom
       actions.
      </action>

      <action dev="rahul" type="add">
       [05-04-2006] Added section on custom semantics to user guide.
      </action>

      <action dev="rahul" type="add" issue="SCXML-4">
       [05-04-2006] Added explicit Instructions on core-engine.html
       from user guide.
      </action>

      <action dev="rahul" type="add" issue="SCXML-10">
       [05-04-2006] Added datamodel explanation and examples to user
       guide.
      </action>

      <action dev="rahul" type="add">
       [05-04-2006] Added documentation blurb on common interaction
       patterns using the Commons SCXML library (the "glue" or "bridge"
       code).
      </action>

      <action dev="rahul" type="fix">
       [04-24-2006] Commons SCXML has graduated from Commons Sandbox,
       updated repository to reflect move to Commons Proper.
      </action>

      <action dev="rahul" type="add">
       [04-20-2006] Added documentation on "_eventdata" and method
       invocation in expression languages used.
      </action>

      <action dev="rahul" type="add">
       [04-20-2006] Allow SCXML documents using EL to define arbitrary EL
       functions by providing a FunctionMapper to the ELEvaluator.
      </action>

      <action dev="rahul" type="add" issue="SCXML-11">
       [04-20-2006] Provide access to SCXMLExecutor's root context.
      </action>

      <action dev="rahul" type="add">
       [04-03-2006] Added support for the wildcard (*) event.
      </action>

      <action dev="rahul" type="add">
       [04-03-2006] Added _eventdata support. The payload of a triggered
       event is available under the special variable named _eventdata.
      </action>

      <action dev="rahul" type="fix">
       [03-28-2006] Unnamed trigger events are now correctly processed
       (they do not match any event name).
      </action>

      <action dev="rahul" type="add">
       [03-23-2006] Initial cut at supporting the datamodel section from
       the January 06 Working Draft.
      </action>

      <action dev="rahul" type="add">
       [03-06-2006] Added a FAQ page for the Commons SCXML website.
       Added a section on SCXML Contexts and Evaluators (plugging in an
       expression language) to the online "guide".
      </action>

      <action dev="rahul" type="add">
       [03-03-2006] Add support for "target" attribute of "transition"
       element per the latest (Jan 06) WD.
      </action>

      <action dev="rahul" type="add" due-to="Wendy Smoak">
       [03-03-2006] Added a Maven2 POM.
      </action>

      <action dev="rahul" type="add" issue="SCXML-7">
       [03-01-2006] A new usecase for a stand-alone application
       modeling a stopwatch.
       <dueto name="Stephen Colebourne"/>
       <dueto name="Tim O'Brien"/>
      </action>

      <action dev="rahul" type="add">
       [02-28-2006] AbstractStateMachine class added that demonstrates
       one approach for providing the base functionality needed by
       standalone classes representing stateful entities, whose
       behaviors are defined via SCXML documents.
      </action>

      <action dev="rahul" type="add">
       [02-27-2006] Improve Commons SCXML website "guide". Added a
       section on SCXML documents, and another on custom actions.
      </action>

      <action dev="rahul" type="add">
       [02-25-2006] Added easier support for custom actions. Provide
       a "hello world" example using a custom action.
      </action>

      <action dev="rahul" type="fix">
       [02-25-2006] Refactor processing of actions (they now contain
       an "execute" method).
      </action>

      <action dev="rahul" type="add">
       [02-24-2006] Define ExternalContent interface to mark elements
       that may contain "body content" (in external namespaces), for
       example, the SCXML "send" element.
      </action>

      <action dev="rahul" type="fix">
       [02-22-2006] Minor Javadoc fixes and additions.
      </action>

      <action dev="rahul" type="add">
       [02-09-2006] Basic test cases for SCXML document execution
       when using JEXL as the expression language.
      </action>

      <action dev="rahul" type="fix" due-to="sungchan">
       [02-09-2006] JexlEvaluator was still assuming a flat context
       (which was changed on 02-05-2006, see change item below).
      </action>

      <action dev="rahul" type="add" issue="SCXML-1" due-to="Peter Costa">
       [02-05-2006] Numerous JUnit test cases added. Start publishing
       cobertura report.
      </action>

      <action dev="rahul" type="update">
       [02-05-2006] Contexts are now created per State, but only as and
       when needed. The

       commit message for r374981 has the details.
      </action>

      <action dev="rahul" type="update" issue="SCXML-6" due-to="Tim O'Brien">
       [02-05-2006] The Commons SCXML object model is now decoupled from
       the SCXML execution engine instance. The Commons SCXML object model
       is now stateless. For example (incomplete list):

A "SCXML" object no longer contains a root "Context"

A "State" no longer contains a "Context"

A "Transition" no longer contains a list of "SCXMLListeners"
              attached

A "History" no longer contains the last known configuration.

        The advantage of this decoupling is that the SCXML document can be
        parsed once and reused across multiple execution instances,
        concurrently or otherwise.
      </action>

      <action dev="rahul" type="update">
       [01-22-2006] Package reorganization. Mostly out of discussions on
       the dev list, three new packages were introduced:

A "test" package for the command line testing utility
              classes

An "io" package for classes related to reading and writing
              SCXML documents

A "servlet" environment package for the classes that
              depend on the servlet API for Commons SCXML usecases in
              servlet containers.

      </action>

      <action dev="rahul" type="update">
       [01-11-2006] Various website and documentation improvements.
      </action>

      <action dev="rahul" type="update">
       [01-08-2006] Improve dependencies webpage by providing URLs for each.
       Improve navigation by providing "quick links".
      </action>

      <action dev="rahul" type="add">
       [01-08-2006] Added JEXL support for SCXML documents.
      </action>

      <action dev="rahul" type="update">
       [01-07-2006] SCXML serialization bits available in a utility class.
      </action>

      <action dev="rahul" type="update">
       [12-21-2005] SCXML digester instances are now available for further
       customization of the default digester ruleset.
      </action>

      <action dev="rahul" type="update">
       [12-21-2005] The static digest() methods of the SCXMLDigester class
       now throw the same exceptions as the underlying ones from
       Digester#parse().
      </action>

      <action dev="rahul" type="add">
       [12-10-2005] Make digester namespace aware, and capture arbitrary namespace
       children of SCXML <send> element.
      </action>

      <action dev="rahul" type="update">
       [11-17-2005] Site overhaul according to recent discussions on the
       commons-dev mailing list.
      </action>

      <action dev="rahul" type="update">
       [10-18-2005] Decouple SCXML engine from the SCXML execution semantics;
       make SCXML semantics pluggable.
      </action>

      <action dev="rahul" type="add">
       [10-18-2005] Added UML state machine diagrams to the usecases section
       of the website.
      </action>

      <action dev="rahul" type="add">
       [10-14-2005] Added documentation on usecases to website:

Usecase 1: To configure instances of the RDC group container.

Usecase 2: To describe Shale dialogs.

      </action>

      <action dev="rahul" type="add">
       [10-14-2005] Added API notes to website:

SCXML digester

SCXML engine

Firing events on an SCXML engine

Standalone testing

Fun with EL

      </action>

      <action dev="rahul" type="add">
       [10-14-2005] Updated dependency information to indicate purpose of
       dependency (core, test, usecases etc.).
      </action>

      <action dev="rahul" type="add">
       [10-14-2005] Added Commons look and feel (navigation bar) to website.
      </action>

      <action dev="rahul" type="add">
       [10-10-2005] Added second usecase for Commons SCXML (within ASF projects).
       Demonstrated the use of SCXML documents for describing Shale dialogs.
      </action>

      <action dev="rahul" type="add">
       [10-09-2005] Add a faces package for JSF-based environments (env.faces)
      </action>

      <action dev="rahul" type="update">
       [10-09-2005] Updated ant build file to include MyFaces dependency
       (usecases only).
      </action>

      <action dev="rahul" type="add">
       [10-08-2005] Out of the box "simple" interface implementations.

Added simple loggers that implement ErrorHandler, ErrorReporter
        and SCXMLListener.

Added a SimpleContext that wraps a variables (name to value) Map.

      </action>

      <action dev="rahul" type="fix">
       [10-08-2005] VariableResolver#resolveVariable() should return null if variable
       is not found instead of throwing an exception (in ELEvaluator.java)
      </action>

      <action dev="rahul" type="update">
        [09-29-2005] The scxml.env package has a new child jsp package, to distribute
        the current contents of the env package such that each supported environment
        can get its own package in the source.
      </action>

      <action dev="rahul" type="update">
        [09-29-2005] Enhanced the Standalone testing functionality to enable:

Value change events on the current Context.

Dummy events to re-evaluate conditionals on event-less transitions.

      </action>

      <action dev="rahul" type="update" due-to="Jaroslav Gergic">
        [09-15-2005] Now handling outgoing transitions from a Parallel
        (Section 3.4 SCXML WD).
      </action>

      <action dev="rahul" type="fix">
        [09-15-2005] Minor Javadoc tweaks.
      </action>

      <action dev="rahul" type="update">
        [09-15-2005] "Microwave" test samples reset timer on leaving "cooking"
        state so state machines can be re-run many times (without a "reset")
      </action>

      <action dev="rahul" type="update">
        [09-08-2005] Updated Commons SCXML logo.
      </action>

      <action dev="rahul" type="update">
        [08-27-2005] Use a customized set of checkstyle rules. These are the Sun checks
        with three changes as discussed on the dev list:

Use a regexp header check for ASL

Disable 'hide a field' check (lot of noise from setters)

Disable 'method design for extension' check

      </action>

      <action dev="rahul" type="fix">
        [08-27-2005] Six minor code changes based on FindBugs reports.
      </action>

      <action dev="rahul" type="update">
        [08-25-2005] Switch to new ant build file that will work better for the
        Commons nightlies.
      </action>

      <action dev="rahul" type="fix">
        [08-24-2005] RootContext (used in the JSP environment) should override
        ELContext#has(String) method.
      </action>

      <action dev="rahul" type="update">
        [08-24-2005] Enhanced couple of samples used by the test cases.
      </action>

      <action dev="rahul" type="add">
        [08-23-2005] Added JUnit Test Framework.
      </action>

      <action dev="rahul" type="fix">
        [08-23-2005] Upgraded Digester version in project dependencies to 1.7.
      </action>

      <action dev="rahul" type="add">
        [08-23-2005] Added BeanUtils 1.7.0 dependency as needed by Digester.
      </action>

      <action dev="rahul" type="fix">
        [08-20-2005] Corrected year of inception in License.
      </action>

      <action dev="rahul" type="fix">
        [08-20-2005] Corrected some 1500+ checkstyle errors.
      </action>

      <action dev="rahul" type="add">
        [08-20-2005] This changes document added.
      </action>

      <action dev="rahul" type="add">
        [08-17-2005] Initial SCXML codebase copied from the RDC Taglib codebase
        (part of Jakarta Taglibs Proper).
      </action>

      <action dev="rahul" type="add">
        [08-17-2005] Initial build artifacts, STATUS and PROPOSAL documents.
      </action>

    </release>

</document>


text:
/***
 *
 * fixtures.js
 *
 * Seed initial data
 *
 */

CV.History.seedData = function () {

    try {

        LogWrapper.log(CV.History.collectionName + " reseeding...");

        CV.History.collection.remove({});

        CV.History.collection.insert(
            {
                icon: "fa-group",
                where: "Emaratech",
                when: "August 2014 - Now",
                what: "Chief of Software"
            });

        CV.History.collection.insert(
            {
                icon: "fa-tasks",
                where: "AppRiver LLC",
                when: "February 2005 - August 2014",
                what: "VP of Product Management"
            });

        CV.History.collection.insert(
            {
                icon: "fa-laptop",
                where: "Allzero LLC",
                when: "June 2004 - February 2005",
                what: "Principal Consultant / Owner"
            });

        CV.History.collection.insert(
            {
                icon: "fa-exchange",
                where: "American City Business Journals",
                when: "June 2000 - June 2004",
                what: "Network Engineer"
            });

        LogWrapper.log(CV.History.collectionName + " reseeding completed.");
    }
    catch (ex) {
        LogWrapper.logError(ex.message, ex)
    }

};

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Antlr4.Runtime;
using Antlr4.Runtime.Tree;
using CQL.ELM.Model;

namespace CQL.Translation
{
    public class Translator
    {
        public Library TranslateLibrary(string source)
        {
			var inputStream = new AntlrInputStream(source);
			var lexer = new cqlLexer(inputStream);
            var tokenStream = new CommonTokenStream(lexer);
            var parser = new cqlParser(tokenStream);
            var parseTree = parser.logic();
            var visitor = new cqlTranslationVisitor();
            return visitor.Visit(parseTree) as Library;
        }
    }
}


text:
"""TaskReschedule tracks rescheduled task instances."""
from sqlalchemy import Column, ForeignKeyConstraint, Index, Integer, String, asc

from airflow.models.base import ID_LEN, Base
from airflow.utils.db import provide_session
from airflow.utils.sqlalchemy import UtcDateTime

class TaskReschedule(Base):
    """
    TaskReschedule tracks rescheduled task instances.
    """

    __tablename__ = "task_reschedule"

    id = Column(Integer, primary_key=True)
    task_id = Column(String(ID_LEN), nullable=False)
    dag_id = Column(String(ID_LEN), nullable=False)
    execution_date = Column(UtcDateTime, nullable=False)
    try_number = Column(Integer, nullable=False)
    start_date = Column(UtcDateTime, nullable=False)
    end_date = Column(UtcDateTime, nullable=False)
    duration = Column(Integer, nullable=False)
    reschedule_date = Column(UtcDateTime, nullable=False)

    __table_args__ = (
        Index('idx_task_reschedule_dag_task_date', dag_id, task_id, execution_date,
              unique=False),
        ForeignKeyConstraint([task_id, dag_id, execution_date],
                             ['task_instance.task_id', 'task_instance.dag_id',
                              'task_instance.execution_date'],
                             name='task_reschedule_dag_task_date_fkey',
                             ondelete='CASCADE')
    )

    def __init__(self, task, execution_date, try_number, start_date, end_date,
                 reschedule_date):
        self.dag_id = task.dag_id
        self.task_id = task.task_id
        self.execution_date = execution_date
        self.try_number = try_number
        self.start_date = start_date
        self.end_date = end_date
        self.reschedule_date = reschedule_date
        self.duration = (self.end_date - self.start_date).total_seconds()

    @staticmethod
    @provide_session
    def find_for_task_instance(task_instance, session):
        """
        Returns all task reschedules for the task instance and try number,
        in ascending order.

        :param task_instance: the task instance to find task reschedules for
        :type task_instance: airflow.models.TaskInstance
        """
        TR = TaskReschedule
        return (
            session
            .query(TR)
            .filter(TR.dag_id == task_instance.dag_id,
                    TR.task_id == task_instance.task_id,
                    TR.execution_date == task_instance.execution_date,
                    TR.try_number == task_instance.try_number)
            .order_by(asc(TR.id))
            .all()
        )


text:
// (C) Copyright 2015 Moodle Pty Ltd.
//
// 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.

import { Component, OnInit, OnDestroy, ViewChild, ElementRef } from '@angular/core';
import { IonicPage, NavParams, NavController } from 'ionic-angular';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { TranslateService } from '@ngx-translate/core';
import { CoreEventsProvider } from '@providers/events';
import { CoreSitesProvider } from '@providers/sites';
import { CoreSyncProvider } from '@providers/sync';
import { CoreDomUtilsProvider } from '@providers/utils/dom';
import { CoreTextUtilsProvider } from '@providers/utils/text';
import { CoreCourseProvider } from '@core/course/providers/course';
import { CoreUserProvider } from '@core/user/providers/user';
import { CoreGradesHelperProvider } from '@core/grades/providers/helper';
import { AddonModWorkshopProvider } from '../../providers/workshop';
import { AddonModWorkshopHelperProvider } from '../../providers/helper';
import { AddonModWorkshopOfflineProvider } from '../../providers/offline';
import { AddonModWorkshopSyncProvider } from '../../providers/sync';

/**
 * Page that displays a workshop assessment.
 */
@IonicPage({ segment: 'addon-mod-workshop-assessment' })
@Component({
    selector: 'page-addon-mod-workshop-assessment-page',
    templateUrl: 'assessment.html',
})
export class AddonModWorkshopAssessmentPage implements OnInit, OnDestroy {

    @ViewChild('evaluateFormEl') formElement: ElementRef;

    assessment: any;
    submission: any;
    profile: any;
    courseId: number;
    access: any;
    assessmentId: number;
    evaluating = false;
    loaded = false;
    showGrade: any;
    evaluateForm: FormGroup;
    maxGrade: number;
    workshop: any;
    strategy: any;
    title: string;
    evaluate = {
        text: '',
        grade: -1,
        weight: 1
    };
    weights = [];
    evaluateByProfile: any;
    evaluationGrades: any;

    protected workshopId: number;
    protected originalEvaluation: any = {};
    protected hasOffline = false;
    protected syncObserver: any;
    protected isDestroyed = false;
    protected siteId: string;
    protected currentUserId: number;
    protected forceLeave = false;

    constructor(navParams: NavParams, sitesProvider: CoreSitesProvider, protected courseProvider: CoreCourseProvider,
            protected workshopProvider: AddonModWorkshopProvider, protected workshopOffline: AddonModWorkshopOfflineProvider,
            protected workshopHelper: AddonModWorkshopHelperProvider, protected navCtrl: NavController,
            protected syncProvider: CoreSyncProvider, protected textUtils: CoreTextUtilsProvider, protected fb: FormBuilder,
            protected translate: TranslateService, protected eventsProvider: CoreEventsProvider,
            protected domUtils: CoreDomUtilsProvider, protected gradesHelper: CoreGradesHelperProvider,
            protected userProvider: CoreUserProvider) {

        this.assessment = navParams.get('assessment');
        this.submission = navParams.get('submission') || {};
        this.profile = navParams.get('profile');
        this.courseId = navParams.get('courseId');

        this.assessmentId = this.assessment.assessmentid || this.assessment.id;
        this.workshopId = this.submission.workshopid || null;
        this.siteId = sitesProvider.getCurrentSiteId();
        this.currentUserId = sitesProvider.getCurrentSiteUserId();

        this.showGrade = this.workshopHelper.showGrade;

        this.evaluateForm = new FormGroup({});
        this.evaluateForm.addControl('weight', this.fb.control('', Validators.required));
        this.evaluateForm.addControl('grade', this.fb.control(''));
        this.evaluateForm.addControl('text', this.fb.control(''));

        // Refresh workshop on sync.
        this.syncObserver = this.eventsProvider.on(AddonModWorkshopSyncProvider.AUTO_SYNCED, (data) => {
            // Update just when all database is synced.
            if (this.workshopId === data.workshopId) {
                this.loaded = false;
                this.refreshAllData();
            }
        }, this.siteId);
    }

    /**
     * Component being initialized.
     */
    ngOnInit(): void {
        this.fetchAssessmentData();
    }

    /**
     * Check if we can leave the page or not.
     *
     * @return Resolved if we can leave it, rejected if not.
     */
    async ionViewCanLeave(): Promise<void> {
        if (this.forceLeave || !this.evaluating) {
            return;
        }

        if (!this.hasEvaluationChanged()) {
            return;
        }

        // Show confirmation if some data has been modified.
        await this.domUtils.showConfirm(this.translate.instant('core.confirmcanceledit'));

        this.domUtils.triggerFormCancelledEvent(this.formElement, this.siteId);
    }

    /**
     * Fetch the assessment data.
     *
     * @return Resolved when done.
     */
    protected fetchAssessmentData(): Promise<void> {
        return this.workshopProvider.getWorkshopById(this.courseId, this.workshopId).then((workshopData) => {
            this.workshop = workshopData;
            this.title = this.workshop.name;
            this.strategy = this.workshop.strategy;

            return this.courseProvider.getModuleBasicGradeInfo(workshopData.coursemodule);
        }).then((gradeInfo) => {
            this.maxGrade = gradeInfo.grade;

            return this.workshopProvider.getWorkshopAccessInformation(this.workshopId);
        }).then((accessData) => {
            this.access = accessData;

            // Load Weights selector.
            if (this.assessmentId && (accessData.canallocate || accessData.canoverridegrades)) {
                if (!this.isDestroyed) {
                    // Block the workshop.
                    this.syncProvider.blockOperation(AddonModWorkshopProvider.COMPONENT, this.workshopId);
                }

                this.evaluating = true;
            } else {
                this.evaluating = false;
            }

            if (this.evaluating || this.workshop.phase == AddonModWorkshopProvider.PHASE_CLOSED) {
                // Get all info of the assessment.
                return this.workshopHelper.getReviewerAssessmentById(this.workshopId, this.assessmentId,
                        this.profile && this.profile.id).then((assessment) => {
                    let defaultGrade, promise;

                    this.assessment = this.workshopHelper.realGradeValue(this.workshop, assessment);
                    this.evaluate.text = this.assessment.feedbackreviewer || '';
                    this.evaluate.weight = this.assessment.weight;

                    if (this.evaluating) {
                        if (accessData.canallocate) {
                            this.weights = [];
                            for (let i = 16; i >= 0; i--) {
                                this.weights[i] = i;
                            }
                        }

                        if (accessData.canoverridegrades) {
                            defaultGrade = this.translate.instant('addon.mod_workshop.notoverridden');
                            promise = this.gradesHelper.makeGradesMenu(this.workshop.gradinggrade, undefined, defaultGrade, -1)
                                    .then((grades) => {
                                this.evaluationGrades = grades;
                            });
                        } else {
                            promise = Promise.resolve();
                        }

                        return promise.then(() => {
                            return this.workshopOffline.getEvaluateAssessment(this.workshopId, this.assessmentId)
                                    .then((offlineAssess) => {
                                this.hasOffline = true;
                                this.evaluate.weight = offlineAssess.weight;
                                if (accessData.canoverridegrades) {
                                    this.evaluate.text = offlineAssess.feedbacktext || '';
                                    this.evaluate.grade = offlineAssess.gradinggradeover || -1;
                                }
                            }).catch(() => {
                                this.hasOffline = false;
                                // No offline, load online.
                                if (accessData.canoverridegrades) {
                                    this.evaluate.text = this.assessment.feedbackreviewer || '';
                                    this.evaluate.grade = this.assessment.gradinggradeover || -1;
                                }
                            });
                        }).finally(() => {
                            this.originalEvaluation.weight = this.evaluate.weight;
                            if (accessData.canoverridegrades) {
                                this.originalEvaluation.text = this.evaluate.text;
                                this.originalEvaluation.grade = this.evaluate.grade;
                            }

                            this.evaluateForm.controls['weight'].setValue(this.evaluate.weight);
                            if (accessData.canoverridegrades) {
                                this.evaluateForm.controls['grade'].setValue(this.evaluate.grade);
                                this.evaluateForm.controls['text'].setValue(this.evaluate.text);
                            }
                        });

                    } else if (this.workshop.phase == AddonModWorkshopProvider.PHASE_CLOSED && this.assessment.gradinggradeoverby) {
                        return this.userProvider.getProfile(this.assessment.gradinggradeoverby, this.courseId, true)
                                .then((profile) => {
                            this.evaluateByProfile = profile;
                        });
                    }
                });
            }
        }).catch((message) => {
            this.domUtils.showErrorModalDefault(message, 'mm.course.errorgetmodule', true);
        }).finally(() => {
            this.loaded = true;
        });
    }

    /**
     * Force leaving the page, without checking for changes.
     */
    protected forceLeavePage(): void {
        this.forceLeave = true;
        this.navCtrl.pop();
    }

    /**
     * Check if data has changed.
     *
     * @return True if changed, false otherwise.
     */
    protected hasEvaluationChanged(): boolean {
        if (!this.loaded || !this.evaluating) {
            return false;
        }

        const inputData = this.evaluateForm.value;

        if (this.originalEvaluation.weight != inputData.weight) {
            return true;
        }

        if (this.access && this.access.canoverridegrades) {
            if (this.originalEvaluation.text != inputData.text) {
                return true;
            }

            if (this.originalEvaluation.grade != inputData.grade) {
                return true;
            }
        }

        return false;
    }

    /**
     * Convenience function to refresh all the data.
     *
     * @return Resolved when done.
     */
    protected refreshAllData(): Promise<any> {
        const promises = [];

        promises.push(this.workshopProvider.invalidateWorkshopData(this.courseId));
        promises.push(this.workshopProvider.invalidateWorkshopAccessInformationData(this.workshopId));
        promises.push(this.workshopProvider.invalidateReviewerAssesmentsData(this.workshopId));

        if (this.assessmentId) {
            promises.push(this.workshopProvider.invalidateAssessmentFormData(this.workshopId, this.assessmentId));
            promises.push(this.workshopProvider.invalidateAssessmentData(this.workshopId, this.assessmentId));
        }

        return Promise.all(promises).finally(() => {
            this.eventsProvider.trigger(AddonModWorkshopProvider.ASSESSMENT_INVALIDATED, this.siteId);

            return this.fetchAssessmentData();
        });
    }

    /**
     * Pull to refresh.
     *
     * @param refresher Refresher.
     */
    refreshAssessment(refresher: any): void {
        if (this.loaded) {
            this.refreshAllData().finally(() => {
                refresher.complete();
            });
        }
    }

    /**
     * Save the assessment evaluation.
     */
    saveEvaluation(): void {
        // Check if data has changed.
        if (this.hasEvaluationChanged()) {
            this.sendEvaluation().then(() => {
                this.forceLeavePage();
            });
        } else {
            // Nothing to save, just go back.
            this.forceLeavePage();
        }
    }

    /**
     * Sends the evaluation to be saved on the server.
     *
     * @return Resolved when done.
     */
    protected sendEvaluation(): Promise<any> {
        const modal = this.domUtils.showModalLoading('core.sending', true),
            inputData = this.evaluateForm.value;

        inputData.grade = inputData.grade >= 0 ? inputData.grade : '';
        // Add some HTML to the message if needed.
        inputData.text = this.textUtils.formatHtmlLines(inputData.text);

        // Try to send it to server.
        return this.workshopProvider.evaluateAssessment(this.workshopId, this.assessmentId, this.courseId, inputData.text,
                inputData.weight, inputData.grade).then((result) => {

            this.domUtils.triggerFormSubmittedEvent(this.formElement, !!result, this.siteId);

            const data = {
                workshopId: this.workshopId,
                assessmentId: this.assessmentId,
                userId: this.currentUserId
            };

            return this.workshopProvider.invalidateAssessmentData(this.workshopId, this.assessmentId).finally(() => {
                this.eventsProvider.trigger(AddonModWorkshopProvider.ASSESSMENT_SAVED, data, this.siteId);
            });
        }).catch((message) => {
            this.domUtils.showErrorModalDefault(message, 'Cannot save assessment evaluation');
        }).finally(() => {
            modal.dismiss();
        });
    }

    /**
     * Component being destroyed.
     */
    ngOnDestroy(): void {
        this.isDestroyed = true;

        this.syncObserver && this.syncObserver.off();
        // Restore original back functions.
        this.syncProvider.unblockOperation(AddonModWorkshopProvider.COMPONENT, this.workshopId);
    }
}


text:
import { Action, Middleware, compose } from "redux";
import { ProxyStore, ProxyStoreCreator, ProxyStoreEnhancer } from "./types";

export default function applyProxyMiddleware<S>(...middlewares: Middleware[]) {
  return (createProxyStore: ProxyStoreCreator) => (
    worker: Worker,
    preloadedState?: S,
    enhancer?: ProxyStoreEnhancer<S>
  ): ProxyStore<S> => {
    const store = createProxyStore(worker, preloadedState, enhancer);
    let dispatch = store.dispatch;
    let chain = [];

    const middlewareAPI = {
      getState: store.getState,
      dispatch: (action: Action) => dispatch(action),
    };
    chain = middlewares.map(middleware => middleware(middlewareAPI));
    dispatch = compose(...chain)(store.dispatch);

    return {
      ...store,
      dispatch,
    };
  };
}


text:
define(function(){
   return window;
});


text:
class ViewFrame;

class BINARYNINJAUIAPI ViewType
{
	QString m_name, m_longName;

public:
	ViewType(const QString& name, const QString& longName);
	virtual ~ViewType();

	const QString& getName() { return m_name; }
	const QString& getLongName() { return m_longName; }
	virtual int getPriority(BinaryViewRef data, const QString& filename) = 0;
	virtual QWidget* create(BinaryViewRef data, ViewFrame* viewFrame) = 0;

	virtual QString getDisplayName(BinaryViewTypeRef type);
	virtual QString getDisplayLongName(BinaryViewTypeRef type);

	static ViewType* getTypeByName(const QString& name);
	static const std::vector<ViewType*>& getTypes();

	static void registerViewType(ViewType* type);
};

class BINARYNINJAUIAPI ViewTypeContainer
{
public:
	std::vector<ViewType*> m_types;

	static ViewTypeContainer& GetViewTypeContainer();
};


text:
namespace GLIB.Utils
{

    using UnityEngine;
    using UnityEngine.UI;
    using System.Collections;
    using System;

    public class SlidingToggle : MonoBehaviour
    {

        public Slider Target;
        public float FillDuration = 0.8f;

        bool _isOn;
        bool _shouldSliderMove = false;
        float _timeSpan;
        bool _displayedError = false;

        public void SetValue(bool isOn) {

            _isOn = isOn;

            _timeSpan = 0;

            _shouldSliderMove = true;

        }

        // Use this for initialization
        void Start()
        {

        }

        // Update is called once per frame
        void Update()
        {

            try
            {

                if (_shouldSliderMove) {

                    float percent = _timeSpan / FillDuration;

                    Target.value = Mathf.Lerp(Target.value, _isOn ? Target.maxValue : Target.minValue, percent);

                    _timeSpan += Time.deltaTime;

                    if (percent >= 100) {
                        _shouldSliderMove = false;
                    }

                }

                _displayedError = false;

            }
            catch (Exception e)
            {
                if (!_displayedError)
                {
                    Debug.LogError("SlidingToggle => Unable to upate slider. Cause: "+e.Message+"\n"+e.StackTrace);
                    _displayedError = true;
                }
            }

        }

    }

}


text:
package com.ait.lienzo.client.core.event;

import com.google.gwt.event.shared.EventHandler;

public interface NodeTouchCancelHandler extends EventHandler
{
    void onNodeTouchCancel(NodeTouchCancelEvent event);
}


text:
<?php

namespace Log210\APIBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class Log210APIBundle extends Bundle
{

}


text:
'use strict';

var db = require('../database.js');
var mongoose = require('mongoose');

exports.create = function (req, res) {
	var suggestedCode = req.body.shortcode;
console.log(req.body);
	db.Shortcodes.findOne({code:suggestedCode}, function (err, result) {
		if (err){
			res.send(err,500);
		}else{
			if(result!=(undefined || null)){ //a code if found, then the user can not have this code
				res.send({message:'Code is Already Taken,try again'},200);
			}
			else{
				db.Shortcodes.create({code:suggestedCode}, function (err, shortcode) {
					if (err){
						res.send(err,500);
					}else{
						res.send({message:'Code Has been Created!',shortcodeId:shortcode._id},201);

					}

					// saved!
				});
			}
		}
		// saved!
	})
};


text:
<?xml version="1.0" encoding="UTF-8"?>

<configuration debug="true" scan="true" scanPeriod="30 seconds">

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
	<encoder>
		<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] [%file:%line] [%level] %msg%n</pattern>
	</encoder>
</appender>

<root level="ALL">
	<appender-ref ref="STDOUT" />
</root>

</configuration>


text:
package org.cagrid.dorian.service.idp;

import org.cagrid.dorian.model.exceptions.DorianInternalException;
import org.cagrid.dorian.model.exceptions.InvalidUserPropertyException;
import org.cagrid.dorian.model.idp.Application;
import org.cagrid.dorian.model.idp.ApplicationReview;
import org.cagrid.dorian.model.idp.LocalUserRole;
import org.cagrid.dorian.model.idp.LocalUserStatus;

/**
 * @author Stephen Langella
 * @author Scott Oster
 * @author Shannon Hastings
 * @version $Id: ArgumentManagerTable.java,v 1.2 2004/10/15 16:35:16 langella
 *          Exp $
 */
public class ManualRegistrationPolicy implements IdPRegistrationPolicy {

    public String getDescription() {
        return "This policy requires registering users, to be manually approved my an administrator";
    }

    public String getName() {
        return "Manual Registration";
    }

	public ApplicationReview register(Application a)
			throws DorianInternalException, InvalidUserPropertyException {
        ApplicationReview ar = new ApplicationReview();
        ar.setStatus(LocalUserStatus.PENDING);
        ar.setRole(LocalUserRole.NON_ADMINISTRATOR);
        ar.setMessage("Your application will be reviewed by an administrator.");
        return ar;
    }

}


text:
using System.Windows;

namespace Shannan.StrawMan.Controls
{
    internal class TextBoxHelper : DependencyObject
    {
        public static string GetWatermark(DependencyObject obj)
        {
            return (string)obj.GetValue(WatermarkProperty);
        }

        public static void SetWatermark(DependencyObject obj, string value)
        {
            obj.SetValue(WatermarkProperty, value);
        }

        public static readonly DependencyProperty WatermarkProperty = DependencyProperty.RegisterAttached("Watermark", typeof(string), typeof(TextBoxHelper), new UIPropertyMetadata(string.Empty));
    }
}


text:
layout: master
title:  "A Autêntica Estação"
categories: winter
author: Ruy Belo
contributor: Sara Campino
imgs: 2
year: 1970
---

É verão. Vou pela estrada de sintra
por sinal pouco misteriosa à luz do dia
ao volante de um carro que não é um chevrolet
e nesse ponto apenas se perdeu a profecia
Não há luar nem sou um pálido poeta
que finja fingir a sua mais profunda emoção
Chove uma chuva que me molha os olhos
e me leva a sentir saudades do inverno:
a luz o cheiro a intimidade o fogo
Quem me dera o inverno. Talvez lá faça sol
e eu sinta aflitivas saudades do verão:
uma estação na outra é a autêntica estação


text:
import { Injectable } from '@angular/core';
import { Router, CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { AngularFire } from 'angularfire2';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/first';

@Injectable()
export class AuthGuard implements CanActivate {

    constructor(private _af: AngularFire, private router: Router) { }

    canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {
        return this._af.auth.map((auth) =>  {
            if(auth == null) {
                this.router.navigate(['/login']);
                return false;
            } else {
                return true;
            }
        }).first()
    }
}


text:
<?php
/**
 *
 * @author Sani Iman Pribadi
 *
 */

    class PhpextjsControllerCode extends CCodeModel {

        public $controller;
        public $baseClass = 'Controller';
        public $actions = 'index';

        public function rules() {
            return array_merge(parent::rules(), array(
                array('controller, actions, baseClass', 'filter', 'filter' => 'trim'),
                array('controller, baseClass', 'required'),
                array('controller', 'match', 'pattern' => '/^\w+[\w+\\/]*$/', 'message' => '{attribute} should only contain word characters and slashes.'),
                array('actions', 'match', 'pattern' => '/^\w+[\w\s,]*$/', 'message' => '{attribute} should only contain word characters, spaces and commas.'),
                array('baseClass', 'match', 'pattern' => '/^[a-zA-Z_][\w\\\\]*$/', 'message' => '{attribute} should only contain word characters and backslashes.'),
                array('baseClass', 'validateReservedWord', 'skipOnError' => true),
                array('baseClass, actions', 'sticky'),
            ));
        }

        public function attributeLabels() {
            return array_merge(parent::attributeLabels(), array(
                'baseClass' => 'Base Class',
                'controller' => 'Controller ID',
                'actions' => 'Action IDs',
            ));
        }

        public function requiredTemplates() {
            return array(
                'controller.php',
                'view.php',
            );
        }

        public function successMessage() {
            $link = CHtml::link('try it now', Yii::app()->createUrl($this->controller), array('target' => '_blank'));
            return "The controller has been generated successfully. You may $link.";
        }

        public function prepare() {
            $this->files = array();
            $templatePath = $this->templatePath;

            $this->files[] = new CCodeFile(
                    //$this->controllerFile, $this->render($templatePath . '/controller.php')
                    Yii::getPathOfAlias('webroot' . '.' . 'app/controller/' . $this->controller) . '.js', $this->render($templatePath . DIRECTORY_SEPARATOR . 'controller.php')
            );
            /*
              foreach ($this->getActionIDs() as $action) {
              $this->files[] = new CCodeFile(
              $this->getViewFile($action), $this->render($templatePath . '/view.php', array('action' => $action))
              );
              }
             *
             */
        }

        public function getActionIDs() {
            $actions = preg_split('/[\s,]+/', $this->actions, -1, PREG_SPLIT_NO_EMPTY);
            $actions = array_unique($actions);
            sort($actions);
            return $actions;
        }

        public function getControllerClass() {
            if (($pos = strrpos($this->controller, '/')) !== false)
                return ucfirst(substr($this->controller, $pos + 1)) . 'Controller';
            else
                return ucfirst($this->controller) . 'Controller';
        }

        public function getModule() {
            if (($pos = strpos($this->controller, '/')) !== false) {
                $id = substr($this->controller, 0, $pos);
                if (($module = Yii::app()->getModule($id)) !== null)
                    return $module;
            }
            return Yii::app();
        }

        public function getControllerID() {
            if ($this->getModule() !== Yii::app())
                $id = substr($this->controller, strpos($this->controller, '/') + 1);
            else
                $id = $this->controller;
            if (($pos = strrpos($id, '/')) !== false)
                $id[$pos + 1] = strtolower($id[$pos + 1]);
            else
                $id[0] = strtolower($id[0]);
            return $id;
        }

        public function getUniqueControllerID() {
            $id = $this->controller;
            if (($pos = strrpos($id, '/')) !== false)
                $id[$pos + 1] = strtolower($id[$pos + 1]);
            else
                $id[0] = strtolower($id[0]);
            return $id;
        }

        public function getControllerFile() {
            $module = $this->getModule();
            $id = $this->getControllerID();
            if (($pos = strrpos($id, '/')) !== false)
                $id[$pos + 1] = strtoupper($id[$pos + 1]);
            else
                $id[0] = strtoupper($id[0]);
            return $module->getControllerPath() . '/' . $id . 'Controller.php';
        }

        public function getViewFile($action) {
            $module = $this->getModule();
            return $module->getViewPath() . '/' . $this->getControllerID() . '/' . $action . '.php';
        }

    }


text:
namespace swift {
// FIXME(ABI)#76 : does this declaration need SWIFT_RUNTIME_STDLIB_INTERFACE?
// _direct type metadata for Swift._EmptyArrayStorage
SWIFT_RUNTIME_STDLIB_INTERFACE
ClassMetadata CLASS_METADATA_SYM(s18_EmptyArrayStorage);

// _direct type metadata for Swift._RawNativeDictionaryStorage
SWIFT_RUNTIME_STDLIB_INTERFACE
ClassMetadata CLASS_METADATA_SYM(s27_RawNativeDictionaryStorage);

// _direct type metadata for Swift._RawNativeSetStorage
SWIFT_RUNTIME_STDLIB_INTERFACE
ClassMetadata CLASS_METADATA_SYM(s20_RawNativeSetStorage);
} // namespace swift

swift::_SwiftEmptyArrayStorage swift::_swiftEmptyArrayStorage = {
  // HeapObject header;
  {
    &CLASS_METADATA_SYM(s18_EmptyArrayStorage), // isa pointer
  },

  // _SwiftArrayBodyStorage body;
  {
    0, // int count;
    1  // unsigned int _capacityAndFlags; 1 means elementTypeIsBridgedVerbatim
  }
};

swift::_SwiftEmptyDictionaryStorage swift::_swiftEmptyDictionaryStorage = {
  // HeapObject header;
  {
    &CLASS_METADATA_SYM(s27_RawNativeDictionaryStorage), // isa pointer
  },

  // _SwiftDictionaryBodyStorage body;
  {
    // We set the capacity to 1 so that there's an empty hole to search.
    // Any insertion will lead to a real storage being allocated, because
    // Dictionary guarantees there's always another empty hole after insertion.
    1, // int capacity;
    0, // int count;

    // _SwiftUnsafeBitMap initializedEntries
    {
      &swift::_swiftEmptyDictionaryStorage.entries, // unsigned int* values;
      1 // int bitCount; (1 so there's something for iterators to read)
    },

    (void*)1, // void* keys; (non-null garbage)
    (void*)1  // void* values; (non-null garbage)
  },

  0 // int entries; (zero'd bits)
};

swift::_SwiftEmptySetStorage swift::_swiftEmptySetStorage = {
  // HeapObject header;
  {
    &CLASS_METADATA_SYM(s20_RawNativeSetStorage), // isa pointer
  },

  // _SwiftDictionaryBodyStorage body;
  {
    // We set the capacity to 1 so that there's an empty hole to search.
    // Any insertion will lead to a real storage being allocated, because
    // Dictionary guarantees there's always another empty hole after insertion.
    1, // int capacity;
    0, // int count;

    // _SwiftUnsafeBitMap initializedEntries
    {
      &swift::_swiftEmptySetStorage.entries, // unsigned int* values;
      1 // int bitCount; (1 so there's something for iterators to read)
    },

    (void*)1 // void* keys; (non-null garbage)
  },

  0 // int entries; (zero'd bits)
};

static __swift_uint64_t randomUInt64() {
  std::random_device randomDevice;
  std::mt19937_64 twisterEngine(randomDevice());
  std::uniform_int_distribution<__swift_uint64_t> distribution;
  return distribution(twisterEngine);
}

SWIFT_ALLOWED_RUNTIME_GLOBAL_CTOR_BEGIN
swift::_SwiftHashingSecretKey swift::_swift_stdlib_Hashing_secretKey = {
  randomUInt64(), randomUInt64()
};
SWIFT_ALLOWED_RUNTIME_GLOBAL_CTOR_END

__swift_uint64_t swift::_swift_stdlib_HashingDetail_fixedSeedOverride = 0;

namespace llvm { namespace hashing { namespace detail {
  // An extern variable expected by LLVM's hashing templates. We don't link any
  // LLVM libs into the runtime, so define this here.
  size_t fixed_seed_override = 0;
} // namespace detail
} // namespace hashing
} // namespace llvm


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

		<link href="browser.css" type="text/css" rel="stylesheet">

					<button style="WIDTH: 100%" type="button">

								/

					</button>


text:
namespace Microsoft.Data.OData.Atom
{
    #region Namespaces
    #endregion Namespaces

    /// <summary>
    /// OData ATOM serializer for collections.
    /// </summary>
    internal sealed class ODataAtomCollectionSerializer : ODataAtomPropertyAndValueSerializer
    {
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="atomOutputContext">The output context to write to.</param>
        internal ODataAtomCollectionSerializer(ODataAtomOutputContext atomOutputContext)
            : base(atomOutputContext)
        {
            DebugUtils.CheckNoExternalCallers();
        }
    }
}


text:
require 'spec_helper'

module ToXML
  class Address
    include HappyMapper

    tag 'address'

    attribute :location, String, on_save: :when_saving_location

    element :street, String
    element :postcode, String
    element :city, String

    element :housenumber, String

    attribute :modified, Boolean, read_only: true
    element :temporary, Boolean, read_only: true
    #
    # to_xml will default to the attr_accessor method and not the attribute,
    # allowing for that to be overwritten
    #
    remove_method :housenumber
    def housenumber
      "[#{@housenumber}]"
    end

    def when_saving_location(loc)
      "#{loc}-live"
    end

    #
    # Write a empty element even if this is not specified
    #
    element :description, String, state_when_nil: true

    #
    # Perform the on_save operation when saving
    #
    has_one :date_created, Time, on_save: ->(time) { Time.parse(time).strftime('%T %D') if time }

    #
    # Execute the method with the same name

    #
    # Write multiple elements and call on_save when saving
    #
    has_many :dates_updated, Time, on_save: lambda { |times|
      times.compact.map { |time| Time.parse(time).strftime('%T %D') } if times
    }

    #
    # Class composition
    #
    element :country, 'Country', tag: 'country'

    attribute :occupied, Boolean

    def initialize(parameters)
      parameters.each_pair do |property, value|
        send("#{property}=", value) if respond_to?("#{property}=")
      end
      @modified = @temporary = true
    end
  end

  #
  # Country is composed above the in Address class. Here is a demonstration
  # of how to_xml will handle class composition as well as utilizing the tag
  # value.
  #
  class Country
    include HappyMapper

    attribute :code, String, tag: 'countryCode'
    has_one :name, String, tag: 'countryName'
    has_one :description, 'Description', tag: 'description'

    #
    # This inner-class here is to demonstrate saving a text node
    # and optional attributes
    #
    class Description
      include HappyMapper
      content :description, String
      attribute :category, String, tag: 'category'
      attribute :rating, String, tag: 'rating', state_when_nil: true

      def initialize(desc, cat)
        @description = desc
        @category = cat
      end
    end

    def initialize(parameters)
      parameters.each_pair do |property, value|
        send("#{property}=", value) if respond_to?("#{property}=")
      end
    end
  end
end

RSpec.describe 'Saving #to_xml', type: :feature do
  let(:xml) do
    country_description = ToXML::Country::Description.new('A lovely country', 'positive')
    country = ToXML::Country.new(name: 'USA', code: 'us', empty_code: nil,
                                 description: country_description)

    address = ToXML::Address.new(street: 'Mockingbird Lane',
                                 location: 'Home',
                                 housenumber: '1313',
                                 postcode: '98103',
                                 city: 'Seattle',
                                 country: country,
                                 date_created: '2011-01-01 15:00:00',
                                 occupied: false)

    address.dates_updated = ['2011-01-01 16:01:00', '2011-01-02 11:30:01']

    Nokogiri::XML(address.to_xml).root
  end

  it 'saves elements' do
    elements = { 'street' => 'Mockingbird Lane', 'postcode' => '98103', 'city' => 'Seattle' }
    elements.each_pair do |property, value|
      expect(xml.xpath(property.to_s).text).to eq value
    end
  end

  it 'saves attributes' do
    expect(xml.xpath('country/description/@category').text).to eq 'positive'
  end

  it 'saves attributes that are Boolean and have a value of false' do
    expect(xml.xpath('@occupied').text).to eq 'false'
  end

  context "when an element has a 'read_only' parameter" do
    it 'does not save elements' do
      expect(xml.xpath('temporary')).to be_empty
    end
  end

  context "when an attribute has a 'read_only' parameter" do
    it 'does not save attributes' do
      expect(xml.xpath('@modified')).to be_empty
    end
  end

  context "when an element has a 'state_when_nil' parameter" do
    it 'saves an empty element' do
      nodeset = xml.xpath('description')
      aggregate_failures do
        expect(nodeset).not_to be_empty
        expect(nodeset.text).to eq ''
      end
    end
  end

  context "when an attribute has a 'state_when_nil' parameter" do
    it 'saves a non-empty attribute' do
      country_description = ToXML::Country::Description.new('A lovely country', 'positive')
      country_description.rating = 'good'
      xml = Nokogiri::XML(country_description.to_xml).root
      nodeset = xml.xpath('@rating')

      aggregate_failures do
        expect(nodeset).not_to be_empty
        expect(nodeset.text).to eq 'good'
      end
    end

    it 'saves an empty attribute' do
      country_description = ToXML::Country::Description.new('A lovely country', 'positive')
      xml = Nokogiri::XML(country_description.to_xml).root
      nodeset = xml.xpath('@rating')

      aggregate_failures do
        expect(nodeset).not_to be_empty
        expect(nodeset.text).to eq ''
      end
    end
  end

  context "when an element has a 'on_save' parameter" do
    context 'with a symbol which represents a function' do
      it 'saves the element with the result of the function' do
        expect(xml.xpath('housenumber').text).to eq '[1313]'
      end
    end

    context 'with a lambda' do
      it 'saves the result of the lambda' do
        expect(xml.xpath('date_created').text).to eq '15:00:00 01/01/11'
      end
    end
  end

  context "when a has_many has a 'on_save' parameter" do
    context 'with a lambda' do
      it 'saves the results' do
        dates_updated = xml.xpath('dates_updated')

        aggregate_failures do
          expect(dates_updated.length).to eq 2
          expect(dates_updated.first.text).to eq '16:01:00 01/01/11'
          expect(dates_updated.last.text).to eq '11:30:01 01/02/11'
        end
      end
    end
  end

  context "when an attribute has a 'on_save' parameter" do
    context 'with a symbol which represents a function' do
      it 'saves the result' do
        expect(xml.xpath('@location').text).to eq 'Home-live'
      end
    end
  end

  context 'when an element type is a HappyMapper subclass' do
    it 'saves attributes' do
      expect(xml.xpath('country/@countryCode').text).to eq 'us'
    end

    it 'saves elements with a specified tag' do
      expect(xml.xpath('country/countryName').text).to eq 'USA'
    end

    it 'saves elements with content' do
      expect(xml.xpath('country/description').text).to eq 'A lovely country'
    end
  end
end


text:
<?php

namespace Astrotomic\Backuplay\Exceptions;

use Exception;

/**
 * Class IsNoDirectoryException.
 */
class EntityIsNoDirectoryException extends Exception
{
    /**
     * IsNoDirectoryException constructor.
     * @param string $message
     * @param int $code
     * @param Exception|null $previous
     */
    public function __construct($message, $code = 0, Exception $previous = null)
    {
        $this->message = $message.' isn\'t a directory';
        parent::__construct($message, $code, $previous);
    }
}


text:
module.exports = {
	Field: require('../LocationField'),
	Filter: require('../LocationFilter'),
	readme: require('fs').readFileSync('./fields/types/location/Readme.md', 'utf8'),
	section: 'Text',
	spec: {
		label: 'Location',
		path: 'location',
		paths: {
			country: 'location.country',
			geo: 'location.geo',
			geo_lat: 'location.geo_lat',
			geo_lng: 'location.geo_lng',
			improve: 'location.improve',
			name: 'location.name',
			overwrite: 'location.overwrite',
			postcode: 'location.postcode',
			serialised: 'location.serialised',
			state: 'location.state',
			street1: 'location.street1',
			street2: 'location.street2',
			suburb: 'location.suburb',
		},
		value: {
			country: null,
			postcode: null,
			state: null,
			street1: null,
			suburb: null,
		},
	},
};


text:
package com.example.administrator.every_sample.bean;

/**
 * Created by Administrator on 2016/8/24.
 */
public class LoginBean{

    /**
     * code : 0
     * message : 成功
     * token_code : 415cd6f8dfc26f4ead46755fd6c8423e
     * redirect_url : http://localhost
     */

    int code;
    String message;
    String token_code;
    String redirect_url;

    public LoginBean(int code, String message, String token_code, String redirect_url) {
        this.code = code;
        this.message = message;
        this.token_code = token_code;
        this.redirect_url = redirect_url;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getToken_code() {
        return token_code;
    }

    public void setToken_code(String token_code) {
        this.token_code = token_code;
    }

    public String getRedirect_url() {
        return redirect_url;
    }

    public void setRedirect_url(String redirect_url) {
        this.redirect_url = redirect_url;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">

    <!-- Configuration setting -->
    <EditTextPreference
        android:key="@string/key_atlantis_configuration"
        android:title="@string/configuration"/>

    <!-- Enable/disable Atlantis setting -->
    <SwitchPreference
        android:defaultValue="false"
        android:dependency="@string/key_atlantis_configuration"
        android:key="@string/key_atlantis_enable"
        android:summary="@string/allows_atlantis_to_serve"
        android:title="@string/enable_atlantis"/>

    <!-- Enable/disable recording setting -->
    <SwitchPreference
        android:defaultValue="false"
        android:dependency="@string/key_atlantis_enable"
        android:key="@string/key_atlantis_record"
        android:summary="@string/allows_recording_missing_requests"
        android:title="@string/enable_recording"/>

    <!-- Enable/disable recording failures setting -->
    <SwitchPreference
        android:defaultValue="false"
        android:dependency="@string/key_atlantis_record"
        android:key="@string/key_atlantis_record_failures"
        android:summary="@string/allows_recording_missing_failures"
        android:title="@string/enable_recording_failures"/>

</PreferenceScreen>


text:
package main

import (
	"log"
)

type OutputStdout struct {
}

func (self *OutputStdout) Init(f map[string]string) error {
	return nil
}

func (self *OutputStdout) Run(runner OutputRunner) error {

	for {
		pack := <-runner.InChan()
		log.Println("stdout", pack.Msg)
		pack.Recycle()
	}

	return nil
}

func init() {
	RegisterOutput("stdout", func() interface{} {
		return new(OutputStdout)
	})
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Dicom.IO;

namespace Dicom {
	public abstract class DicomItem : IComparable<DicomItem>, IComparable {
		protected DicomItem(DicomTag tag) {
			Tag = tag;

			//DicomDictionaryEntry entry = DicomDictionary.Default[Tag];
			//if (entry != null && !entry.ValueRepresentations.Contains(ValueRepresentation))
			//	throw new DicomDataException("{0} is not a valid value representation for {1}", ValueRepresentation, Tag);
		}

		public DicomTag Tag {
			get;
			protected set;
		}

		public abstract DicomVR ValueRepresentation {
			get;
		}

		public int CompareTo(DicomItem other) {
			return Tag.CompareTo(other.Tag);
		}

		public int CompareTo(object obj) {
			if (obj == null)
				throw new ArgumentNullException("obj");
			if (!(obj is DicomItem))
				throw new ArgumentException("Passed non-DicomItem to comparer", "obj");
			return CompareTo(obj as DicomItem);
		}

		public override string ToString() {
			if (Tag.DictionaryEntry != null)
				return String.Format("{0} {1} {2}", Tag, ValueRepresentation, Tag.DictionaryEntry.Name);
			return String.Format("{0} {1} Unknown", Tag, ValueRepresentation);
		}
	}
}


text:
<?php

namespace flat\core\mappable\property;
interface ignore_cannot_set{}