text:
#include "qstate.h"

#ifndef QT_NO_STATEMACHINE

#include "qstate_p.h"
#include "qhistorystate.h"
#include "qhistorystate_p.h"
#include "qabstracttransition.h"
#include "qabstracttransition_p.h"
#include "qsignaltransition.h"
#include "qstatemachine.h"
#include "qstatemachine_p.h"

QT_BEGIN_NAMESPACE

/*!
  \class QState
  \inmodule QtCore

  \brief The QState class provides a general-purpose state for QStateMachine.

  \since 4.6
  \ingroup statemachine

  QState objects can have child states, and can have transitions to other
  states. QState is part of \l{The State Machine Framework}.

  The addTransition() function adds a transition. The removeTransition()
  function removes a transition. The transitions() function returns the
  state's outgoing transitions.

  The assignProperty() function is used for defining property assignments that
  should be performed when a state is entered.

  Top-level states must be passed a QStateMachine object as their parent
  state, or added to a state machine using QStateMachine::addState().

  \section1 States with Child States

  The childMode property determines how child states are treated. For
  non-parallel state groups, the setInitialState() function must be called to
  set the initial state. The child states are mutually exclusive states, and
  the state machine needs to know which child state to enter when the parent
  state is the target of a transition.

  The state emits the QState::finished() signal when a final child state
  (QFinalState) is entered.

  The setErrorState() sets the state's error state. The error state is the
  state that the state machine will transition to if an error is detected when
  attempting to enter the state (e.g. because no initial state has been set).

*/

/*!
    \property QState::initialState

    \brief the initial state of this state (one of its child states)
*/

/*!
    \property QState::errorState

    \brief the error state of this state
*/

/*!
    \property QState::childMode

    \brief the child mode of this state

    The default value of this property is QState::ExclusiveStates.
*/

/*!
  \enum QState::ChildMode

  This enum specifies how a state's child states are treated.

  \value ExclusiveStates The child states are mutually exclusive and an
  initial state must be set by calling QState::setInitialState().

  \value ParallelStates The child states are parallel. When the parent state
  is entered, all its child states are entered in parallel.
*/

/*!
   \enum QState::RestorePolicy

   This enum specifies the restore policy type. The restore policy
   takes effect when the machine enters a state which sets one or more
   properties. If the restore policy is set to RestoreProperties,
   the state machine will save the original value of the property before the
   new value is set.

   Later, when the machine either enters a state which does not set
   a value for the given property, the property will automatically be restored
   to its initial value.

   Only one initial value will be saved for any given property. If a value for a property has
   already been saved by the state machine, it will not be overwritten until the property has been
   successfully restored.

   \value DontRestoreProperties The state machine should not save the initial values of properties
          and restore them later.
   \value RestoreProperties The state machine should save the initial values of properties
          and restore them later.

   \sa QStateMachine::globalRestorePolicy, QState::assignProperty()
*/

QStatePrivate::QStatePrivate()
    : QAbstractStatePrivate(StandardState),
      errorState(0), initialState(0), childMode(QState::ExclusiveStates),
      childStatesListNeedsRefresh(true), transitionsListNeedsRefresh(true)
{
}

QStatePrivate::~QStatePrivate()
{
}

void QStatePrivate::emitFinished()
{
    Q_Q(QState);
    emit q->finished(QState::QPrivateSignal());
}

void QStatePrivate::emitPropertiesAssigned()
{
    Q_Q(QState);
    emit q->propertiesAssigned(QState::QPrivateSignal());
}

/*!
  Constructs a new state with the given \a parent state.
*/
QState::QState(QState *parent)
    : QAbstractState(*new QStatePrivate, parent)
{
}

/*!
  Constructs a new state with the given \a childMode and the given \a parent
  state.
*/
QState::QState(ChildMode childMode, QState *parent)
    : QAbstractState(*new QStatePrivate, parent)
{
    Q_D(QState);
    d->childMode = childMode;
}

/*!
  \internal
*/
QState::QState(QStatePrivate &dd, QState *parent)
    : QAbstractState(dd, parent)
{
}

/*!
  Destroys this state.
*/
QState::~QState()
{
}

QList<QAbstractState*> QStatePrivate::childStates() const
{
    if (childStatesListNeedsRefresh) {
        childStatesList.clear();
        QList<QObject*>::const_iterator it;
        for (it = children.constBegin(); it != children.constEnd(); ++it) {
            QAbstractState *s = qobject_cast<QAbstractState*>(*it);
            if (!s || qobject_cast<QHistoryState*>(s))
                continue;
            childStatesList.append(s);
        }
        childStatesListNeedsRefresh = false;
    }
    return childStatesList;
}

QList<QHistoryState*> QStatePrivate::historyStates() const
{
    QList<QHistoryState*> result;
    QList<QObject*>::const_iterator it;
    for (it = children.constBegin(); it != children.constEnd(); ++it) {
        QHistoryState *h = qobject_cast<QHistoryState*>(*it);
        if (h)
            result.append(h);
    }
    return result;
}

QList<QAbstractTransition*> QStatePrivate::transitions() const
{
    if (transitionsListNeedsRefresh) {
        transitionsList.clear();
        QList<QObject*>::const_iterator it;
        for (it = children.constBegin(); it != children.constEnd(); ++it) {
            QAbstractTransition *t = qobject_cast<QAbstractTransition*>(*it);
            if (t)
                transitionsList.append(t);
        }
        transitionsListNeedsRefresh = false;
    }
    return transitionsList;
}

#ifndef QT_NO_PROPERTIES

/*!
  Instructs this state to set the property with the given \a name of the given
  \a object to the given \a value when the state is entered.

  \sa propertiesAssigned()
*/
void QState::assignProperty(QObject *object, const char *name,
                            const QVariant &value)
{
    Q_D(QState);
    if (!object) {
        qWarning("QState::assignProperty: cannot assign property '%s' of null object", name);
        return;
    }
    for (int i = 0; i < d->propertyAssignments.size(); ++i) {
        QPropertyAssignment &assn = d->propertyAssignments[i];
        if (assn.hasTarget(object, name)) {
            assn.value = value;
            return;
        }
    }
    d->propertyAssignments.append(QPropertyAssignment(object, name, value));
}

#endif // QT_NO_PROPERTIES

/*!
  Returns this state's error state.

  \sa QStateMachine::error()
*/
QAbstractState *QState::errorState() const
{
    Q_D(const QState);
    return d->errorState;
}

/*!
  Sets this state's error state to be the given \a state. If the error state
  is not set, or if it is set to 0, the state will inherit its parent's error
  state recursively. If no error state is set for the state itself or any of
  its ancestors, an error will cause the machine to stop executing and an error
  will be printed to the console.
*/
void QState::setErrorState(QAbstractState *state)
{
    Q_D(QState);
    if (state != 0 && qobject_cast<QStateMachine*>(state)) {
        qWarning("QStateMachine::setErrorState: root state cannot be error state");
        return;
    }
    if (state != 0 && (!state->machine() || ((state->machine() != machine()) && !qobject_cast<QStateMachine*>(this)))) {
        qWarning("QState::setErrorState: error state cannot belong "
                 "to a different state machine");
        return;
    }

    d->errorState = state;
}

/*!
  Adds the given \a transition. The transition has this state as the source.
  This state takes ownership of the transition.
*/
void QState::addTransition(QAbstractTransition *transition)
{
    Q_D(QState);
    if (!transition) {
        qWarning("QState::addTransition: cannot add null transition");
        return ;
    }

    transition->setParent(this);
    const QList<QPointer<QAbstractState> > &targets = QAbstractTransitionPrivate::get(transition)->targetStates;
    for (int i = 0; i < targets.size(); ++i) {
        QAbstractState *t = targets.at(i).data();
        if (!t) {
            qWarning("QState::addTransition: cannot add transition to null state");
            return ;
        }
        if ((QAbstractStatePrivate::get(t)->machine() != d->machine())
            && QAbstractStatePrivate::get(t)->machine() && d->machine()) {
            qWarning("QState::addTransition: cannot add transition "
                     "to a state in a different state machine");
            return ;
        }
    }
    if (QStateMachine *mach = machine())
        QStateMachinePrivate::get(mach)->maybeRegisterTransition(transition);
}

/*!
  Adds a transition associated with the given \a signal of the given \a sender
  object, and returns the new QSignalTransition object. The transition has
  this state as the source, and the given \a target as the target state.
*/
QSignalTransition *QState::addTransition(const QObject *sender, const char *signal,
                                         QAbstractState *target)
{
    if (!sender) {
        qWarning("QState::addTransition: sender cannot be null");
        return 0;
    }
    if (!signal) {
        qWarning("QState::addTransition: signal cannot be null");
        return 0;
    }
    if (!target) {
        qWarning("QState::addTransition: cannot add transition to null state");
        return 0;
    }
    int offset = (*signal == '0'+QSIGNAL_CODE) ? 1 : 0;
    const QMetaObject *meta = sender->metaObject();
    if (meta->indexOfSignal(signal+offset) == -1) {
        if (meta->indexOfSignal(QMetaObject::normalizedSignature(signal+offset)) == -1) {
            qWarning("QState::addTransition: no such signal %s::%s",
                     meta->className(), signal+offset);
            return 0;
        }
    }
    QSignalTransition *trans = new QSignalTransition(sender, signal);
    trans->setTargetState(target);
    addTransition(trans);
    return trans;
}

namespace {

// ### Make public?
class UnconditionalTransition : public QAbstractTransition
{
public:
    UnconditionalTransition(QAbstractState *target)
        : QAbstractTransition()
    { setTargetState(target); }
protected:
    void onTransition(QEvent *) {}
    bool eventTest(QEvent *) { return true; }
};

} // namespace

/*!
  Adds an unconditional transition from this state to the given \a target
  state, and returns then new transition object.
*/
QAbstractTransition *QState::addTransition(QAbstractState *target)
{
    if (!target) {
        qWarning("QState::addTransition: cannot add transition to null state");
        return 0;
    }
    UnconditionalTransition *trans = new UnconditionalTransition(target);
    addTransition(trans);
    return trans;
}

/*!
  Removes the given \a transition from this state.  The state releases
  ownership of the transition.

  \sa addTransition()
*/
void QState::removeTransition(QAbstractTransition *transition)
{
    Q_D(QState);
    if (!transition) {
        qWarning("QState::removeTransition: cannot remove null transition");
        return;
    }
    if (transition->sourceState() != this) {
        qWarning("QState::removeTransition: transition %p's source state (%p)"
                 " is different from this state (%p)",
                 transition, transition->sourceState(), this);
        return;
    }
    QStateMachinePrivate *mach = QStateMachinePrivate::get(d->machine());
    if (mach)
        mach->unregisterTransition(transition);
    transition->setParent(0);
}

/*!
  \since 4.7

  Returns this state's outgoing transitions (i.e. transitions where
  this state is the \l{QAbstractTransition::sourceState()}{source
  state}), or an empty list if this state has no outgoing transitions.

  \sa addTransition()
*/
QList<QAbstractTransition*> QState::transitions() const
{
    Q_D(const QState);
    return d->transitions();
}

/*!
  \reimp
*/
void QState::onEntry(QEvent *event)
{
    Q_UNUSED(event);
}

/*!
  \reimp
*/
void QState::onExit(QEvent *event)
{
    Q_UNUSED(event);
}

/*!
  Returns this state's initial state, or 0 if the state has no initial state.
*/
QAbstractState *QState::initialState() const
{
    Q_D(const QState);
    return d->initialState;
}

/*!
  Sets this state's initial state to be the given \a state.
  \a state has to be a child of this state.
*/
void QState::setInitialState(QAbstractState *state)
{
    Q_D(QState);
    if (d->childMode == QState::ParallelStates) {
        qWarning("QState::setInitialState: ignoring attempt to set initial state "
                 "of parallel state group %p", this);
        return;
    }
    if (state && (state->parentState() != this)) {
        qWarning("QState::setInitialState: state %p is not a child of this state (%p)",
                 state, this);
        return;
    }
    d->initialState = state;
}

/*!
  Returns the child mode of this state.
*/
QState::ChildMode QState::childMode() const
{
    Q_D(const QState);
    return d->childMode;
}

/*!
  Sets the child \a mode of this state.
*/
void QState::setChildMode(ChildMode mode)
{
    Q_D(QState);
    d->childMode = mode;
}

/*!
  \reimp
*/
bool QState::event(QEvent *e)
{
    Q_D(QState);
    if ((e->type() == QEvent::ChildAdded) || (e->type() == QEvent::ChildRemoved)) {
        d->childStatesListNeedsRefresh = true;
        d->transitionsListNeedsRefresh = true;
        if ((e->type() == QEvent::ChildRemoved) && (static_cast<QChildEvent *>(e)->child() == d->initialState))
            d->initialState = 0;
    }
    return QAbstractState::event(e);
}

/*!
  \fn QState::finished()

  This signal is emitted when a final child state of this state is entered.

  \sa QFinalState
*/

/*!
  \fn QState::propertiesAssigned()

  This signal is emitted when all properties have been assigned their final value. If the state
  assigns a value to one or more properties for which an animation exists (either set on the
  transition or as a default animation on the state machine), then the signal will not be emitted
  until all such animations have finished playing.

  If there are no relevant animations, or no property assignments defined for the state, then
  the signal will be emitted immediately before the state is entered.

  \sa QState::assignProperty(), QAbstractTransition::addAnimation()
*/

QT_END_NAMESPACE

#endif //QT_NO_STATEMACHINE


text:
package org.onosproject.openflow.controller.driver;

/**
 * Thrown when IOFSwitch.startDriverHandshake() is called more than once.
 *
 */
public class SwitchDriverSubHandshakeAlreadyStarted extends
    SwitchDriverSubHandshakeException {
    private static final long serialVersionUID = -5491845708752443501L;

    public SwitchDriverSubHandshakeAlreadyStarted() {
        super();
    }
}

redpajama_set_name: RedPajamaGithub


text:
import BaseConfigurator from './BaseConfigurator';
import TriggerConfigurator from './TriggerConfigurator';

export default class AsyncActionConfigurator extends BaseConfigurator {
  constructor(parent, action) {
    super(parent);
    this.config = {
      action,
      successTrigger: new TriggerConfigurator(this),
      failureTrigger: new TriggerConfigurator(this),
    };
  }

  onSuccess() {
    return this.config.successTrigger;
  }

  onFailure() {
    return this.config.failureTrigger;
  }
}


text:
package chapter06trees;

public class BinaryTreeNode {
	public int data;
	public BinaryTreeNode left;
	public BinaryTreeNode right;

	public BinaryTreeNode(int data){
		this.data = data;
		left = null;
		right = null;
	}
	public BinaryTreeNode(int data, BinaryTreeNode left, BinaryTreeNode right){
		this.data = data;
		this.left = left;
		this.right = right;
	}
	public int getData() {
		return data;
	}
	public void setData(int data) {
		this.data = data;
	}
	public BinaryTreeNode getLeft() {
		return left;
	}
	public void setLeft(BinaryTreeNode left) {
		this.left = left;
	}
	public BinaryTreeNode getRight() {
		return right;
	}
	public void setRight(BinaryTreeNode right) {
		this.right = right;
	}
	// Sets the data stored in this node.
	public String toString1(){
		return Integer.toString(data);
	}
	// Sets the data in this BinaryTreeNode node.
	public void setValue(int data) {
		this.data = data;
	}

	// Tests whether this node is a leaf node.
	public boolean isLeaf() {
		return left == null && right == null;
	}

	// Tests whether the root argument contains within itself the data argument.
	public static boolean findInBT(BinaryTreeNode root, int  data) {
		if (root == null)
		    return false;
		if (root.getData() == data)
		    return true;
		return findInBT(root.getLeft(), data)  || findInBT(root.getRight(), data);
	}
	// Returns a String representation of this BinaryTreeNode.
	public String toString() {
		if (isLeaf()) {
			return this.toString();
		}
		else {
			    String root, left = "null", right = "null";
			    root = this.toString();
			    if (getLeft() != null) {
					left = getLeft().toString();
			    }
			    if (getRight() != null) {
					right = getRight().toString();
			    }
			    return root + " (" + left + ", " + right + ")";
		}
	}

	// Computes a hash code for the complete binary tree rooted at this BinaryTreeNode node.
	public int hashCode() {
		int result = this.hashCode();
		if (left != null) {
			result += 3 * left.hashCode();
		}
		if (right != null) {
			result += 7 * right.hashCode();
		}
		return result;
	}

	// Returns the total number of nodes in this binary tree (include the root in the count).
	public int numberOfNodes() {
		int leftCount = this.left == null ? 0 : left.numberOfNodes();
		int rightCount = this.right == null ? 0 : right.numberOfNodes();
		return 1 + leftCount + rightCount;
	}

	// Returns a new BinaryTreeNode equal to (but not the same as) this binary tree.
	// Every node in this new BinaryTreeNode will be created by the copy method; values
	// will be identical (==) to values in the given binary tree.
	public BinaryTreeNode copy() {
		BinaryTreeNode left =  null, right = null;
		if (this.left != null) {
			left = this.left.copy();
		}
		if (this.right != null) {
			right = this.right.copy();
		}
		return new BinaryTreeNode(this.data, left, right);
	}

	// Returns a new binary tree which is the mirror image of the binary tree whose
	// root is at this binary tree. That is, for every node in the new binary tree,
	// its children are in reverse order (left child becomes right child, right
	// child becomes left child).
	public BinaryTreeNode reverse() {
		BinaryTreeNode left =  null, right = null;
		if (this.left != null) {
			left = this.left.reverse();
		}
		if (this.right != null) {
			right = this.right.reverse();
		}
		return new BinaryTreeNode(this.data, right, left);
	}

	// Rearranges the binary tree rooted at this binary tree to be the mirror image
	// of its original structure. No new BinaryTreeNode nodes are created in this
	// process.
	public void reverseInPlace() {
		if (this.left != null) {
			left.reverseInPlace();
		}
		if (this.right != null) {
			right.reverseInPlace();
		}
		BinaryTreeNode temp = this.left;
		this.setLeft(this.right);
		this.setRight(temp);
	}
}


text:
// This code is auto-generated, do not modify

namespace Ds3.Models
{
    public enum TapeDriveState
    {
        OFFLINE,
        NORMAL,
        ERROR,
        NOT_COMPATIBLE_IN_PARTITION_DUE_TO_NEWER_TAPE_DRIVES
    }
}


text:
#if NET_3_0
#region License

#endregion

using System.Text;
using System.Collections.Generic;

using NUnit.Framework;

namespace Spring.Http.Converters.Xml
{
    /// <summary>
    /// Unit tests for the DataContractHttpMessageConverter class.
    /// </summary>
    /// <author>Bruno Baia</author>
    [TestFixture]
    public class DataContractHttpMessageConverterTests
    {
        private DataContractHttpMessageConverter converter;

	    [SetUp]
	    public void SetUp()
        {
            converter = new DataContractHttpMessageConverter();
	    }

        [Test]
        public void CanRead()
        {
            Assert.IsTrue(converter.CanRead(typeof(DataContractClass), new MediaType("application", "xml")));
            Assert.IsTrue(converter.CanRead(typeof(DataContractClass), new MediaType("text", "xml")));
            Assert.IsTrue(converter.CanRead(typeof(DataContractClass), new MediaType("application", "soap+xml"))); // application/*+xml
            Assert.IsFalse(converter.CanRead(typeof(DataContractClass), new MediaType("text", "plain")));
            Assert.IsTrue(converter.CanRead(typeof(CollectionDataContractClass), new MediaType("application", "xml")));
        }

        [Test]
        public void CanWrite()
        {
            Assert.IsTrue(converter.CanWrite(typeof(DataContractClass), new MediaType("application", "xml")));
            Assert.IsTrue(converter.CanWrite(typeof(DataContractClass), new MediaType("text", "xml")));
            Assert.IsTrue(converter.CanWrite(typeof(DataContractClass), new MediaType("application", "soap+xml"))); // application/*+xml
            Assert.IsFalse(converter.CanWrite(typeof(DataContractClass), new MediaType("text", "plain")));
            Assert.IsTrue(converter.CanWrite(typeof(CollectionDataContractClass), new MediaType("application", "xml")));
        }

        [Test]
        public void Read()
        {
            string body = @"<?xml version='1.0' encoding='UTF-8' ?>
                <DataContractHttpMessageConverterTests.DataContractClass xmlns='http://schemas.datacontract.org/2004/07/Spring.Http.Converters.Xml' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'>
                    <ID>1</ID><Name>Bruno Baïa</Name>
                </DataContractHttpMessageConverterTests.DataContractClass>";

            MockHttpInputMessage message = new MockHttpInputMessage(body, Encoding.UTF8);

            DataContractClass result = converter.Read<DataContractClass>(message);
            Assert.IsNotNull(result, "Invalid result");
            Assert.AreEqual("1", result.ID, "Invalid result");
            Assert.AreEqual("Bruno Baïa", result.Name, "Invalid result");
        }

        [Test]
        public void Write()
        {
            string expectedBody = "<DataContractHttpMessageConverterTests.DataContractClass xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns=\"http://schemas.datacontract.org/2004/07/Spring.Http.Converters.Xml\"><ID>1</ID><Name>Bruno Baïa</Name></DataContractHttpMessageConverterTests.DataContractClass>";
            DataContractClass body = new DataContractClass("1", "Bruno Baïa");

            MockHttpOutputMessage message = new MockHttpOutputMessage();

            converter.Write(body, null, message);

            Assert.AreEqual(expectedBody, message.GetBodyAsString(Encoding.UTF8), "Invalid result");
            Assert.AreEqual(new MediaType("application", "xml"), message.Headers.ContentType, "Invalid content-type");
            //Assert.IsTrue(message.Headers.ContentLength > -1, "Invalid content-length");
        }

        #region Test classes

        //[DataContract]
        public class DataContractClass
        {
            //[DataMember]
            public string ID { get; set; }

            //[DataMember]
            public string Name { get; set; }

            public DataContractClass()
            {
            }

            public DataContractClass(string id, string name)
            {
                this.ID = id;
                this.Name = name;
            }
        }

        //[CollectionDataContract]
        public class CollectionDataContractClass : List<string>
        {
            public CollectionDataContractClass()
                : base()
            {
            }
        }

        #endregion
    }
}
#endif


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
null

#### Original name
Boletus aurantiacus var. alba Kunc

### Remarks
null


text:
using Mecury.Common.Settings;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnitedSolution;using UnityEngine;

namespace UnitedSolution
{
    public partial class SoundManager : SingletonBehaviour<SoundManager>
    {
        [Serializable]
        public class SfxPair
        {
            public string Name;
            public AudioSource Source;
        }

        public event Action<bool> OnSoundManager_SongMuteChanged;
        public event Action<bool> OnSoundManager_SfxMuteChanged;

        public event Action<float> OnSoundManager_SongVolumeChanged;
        public event Action<float> OnSoundManager_SfxVolumeChanged;

        public AudioSource SongAudioSource;
        public List<SfxPair> SfxAudioSources;
        public AudioClip[] Songs;
        public AudioClip[] SfxEffects;

        protected bool isSongMuted = false, isSfxMuted = false;
        public bool IsSongMuted
        {
            get
            {
                return isSongMuted;
            }
        }
        public bool IsSfxMuted
        {
            get
            {
                return isSfxMuted;
            }
        }

        protected bool isApplicationFocus = true;
        public string defaultBackgroundMusic;

        protected override void Awake()
        {
            base.Awake();
            Initialize();
            if(string.IsNullOrEmpty(defaultBackgroundMusic))
            {
                PlaySong(defaultBackgroundMusic);
            }
        }

        /// <summary>
        /// Need call before calling Initialize
        /// </summary>
        [ContextMenu("Load all songs and effects")]
        public void Load()
        {
            Clean();
            Songs = Resources.LoadAll<AudioClip>("Audio/BackgroundMusic");
            SongAudioSource = gameObject.AddComponent<AudioSource>();
            SongAudioSource.loop = true;
            SongAudioSource.clip = Songs.FirstOrDefault();
            SongAudioSource.playOnAwake = true;

            SfxEffects = Resources.LoadAll<AudioClip>("Audio/EffectSounds");
            AudioSource audioSource = null;
            SfxAudioSources = new List<SfxPair>();
            for (int i = 0; i < SfxEffects.Length; i++)
            {
                audioSource = gameObject.AddComponent<AudioSource>();
                audioSource.playOnAwake = false;
                audioSource.clip = SfxEffects[i];
                SfxAudioSources.Add(new SfxPair
                {
                    Name = SfxEffects[i].name,
                    Source = audioSource
                });
            }
        }
        public void Clean()
        {
            var audioSources = gameObject.GetComponents<AudioSource>();
            for (int index = 0; index < audioSources.Length; index++)
            {
                DestroyImmediate(audioSources[index]);
            }
            Array.Clear(audioSources, 0, audioSources.Length);
            audioSources = null;
        }

        protected virtual void Initialize()
        {
            float soundVolume = PlayerPrefs.GetFloat(SettingsKeyConstant.SOUND_VOLUME_PREF_KEY, 1f);
            SongAudioSource.volume = soundVolume;
            if (OnSoundManager_SongVolumeChanged != null)
            {
                OnSoundManager_SongVolumeChanged(soundVolume);
            }
            float sfxVolume = PlayerPrefs.GetFloat(SettingsKeyConstant.SFX_VOLUME_PREF_KEY, 1f);
            foreach (var pair in SfxAudioSources)
            {
                pair.Source.volume = sfxVolume;
            }
            if (OnSoundManager_SfxVolumeChanged != null)
            {
                OnSoundManager_SfxVolumeChanged(sfxVolume);
            }
        }

        public virtual void SetSongVolume(float volume)
        {
            PlayerPrefs.SetFloat(SettingsKeyConstant.SOUND_VOLUME_PREF_KEY, volume);
            PlayerPrefs.Save();
            SongAudioSource.volume = volume;
        }

        public virtual void SetSfxVolume(float volume)
        {
            PlayerPrefs.SetFloat(SettingsKeyConstant.SFX_VOLUME_PREF_KEY, volume);
            PlayerPrefs.Save();

            foreach (var pair in SfxAudioSources)
            {
                pair.Source.volume = volume;
            }
        }

        public virtual void PlaySong(string name)
        {
            var clip = Songs.FirstOrDefault(s => s.name.Equals(name));
            if (clip != null)
            {
                PlaySong(clip);
            }
        }

        public virtual void PlaySong(AudioClip clip)
        {
            SongAudioSource.clip = clip;
            SongAudioSource.Play();
        }

        public virtual void StopSong()
        {
            SongAudioSource.Stop();
        }

        /// <summary>
        /// Toggle mute song
        /// </summary>
        /// <param name="isMute"></param>
        /// <param name="willNotify">only set true if called inside SoundManager class</param>
        public virtual void ToggleMuteSong(bool isMute, bool willNotify = false)
        {
            isSongMuted = isMute;
            SongAudioSource.mute = isMute;

            if (willNotify && OnSoundManager_SongMuteChanged != null)
            {
                OnSoundManager_SongMuteChanged(isMute);
            }
        }

        public virtual void ToggleMuteSong()
        {
            ToggleMuteSong(!isSongMuted);
        }

        /// <summary>
        /// Toggle mute sfx
        /// </summary>
        /// <param name="isMute"></param>
        /// <param name="willNotify">only set true if called inside SoundManager class</param>
        public virtual void ToggleMuteSfx(bool isMute, bool willNotify = false)
        {
            isSfxMuted = isMute;
            foreach (var pair in SfxAudioSources)
            {
                pair.Source.mute = isMute;
            }

            if (willNotify && OnSoundManager_SfxMuteChanged != null)
            {
                OnSoundManager_SfxMuteChanged(isMute);
            }
        }

        public virtual void ToggleMuteSfx()
        {
            ToggleMuteSfx(!isSfxMuted);
        }

        public virtual void PlaySfx(string name, bool isLoop = false)
        {
            var pair = SfxAudioSources.FirstOrDefault(p => p.Name.Equals(name));
            if (pair != null)
            {
                pair.Source.Play();
                pair.Source.loop = isLoop;
            }
        }

        public virtual void PlaySfxInCoroutine(string name)
        {
            var pair = SfxAudioSources.FirstOrDefault(p => p.Name.Equals(name));
            if (pair != null && isApplicationFocus && !IsSfxMuted)
            {
                Run.Coroutine(PlaySfxInCoroutine(pair.Source), null);
            }
        }

        protected IEnumerator PlaySfxInCoroutine(AudioSource audioSource)
        {
            yield return null;

            var clip = audioSource.clip;
            var tmpSource = gameObject.AddComponent<AudioSource>();
            tmpSource.clip = clip;
            tmpSource.volume = audioSource.volume;
            tmpSource.Play();

            yield return new WaitForSeconds(clip.length);

            Destroy(tmpSource);
        }

        public virtual void StopSfx(string name)
        {
            var pair = SfxAudioSources.FirstOrDefault(p => p.Name.Equals(name));
            if (pair != null)
            {
                pair.Source.Stop();
                pair.Source.loop = false;
            }
        }

        public virtual void StopAllSfx()
        {
            foreach (var pair in SfxAudioSources)
            {
                pair.Source.Stop();
                pair.Source.loop = false;
            }
        }

        protected virtual void OnApplicationFocus(bool isFocus)
        {
            isApplicationFocus = isFocus;

            // Focus
            if (isFocus)
            {
                ToggleMuteSong(isSongMuted, true);

                ToggleMuteSfx(isSfxMuted, true);
            }
            // out of focus
            else
            {
                SongAudioSource.mute = true;

                foreach (var sfx in SfxAudioSources)
                {
                    sfx.Source.mute = true;
                }
            }
        }
    }
}


text:
// Copyright 2022 Google LLC
//
// 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.

/**
 * ForecastBreakdownTarget.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
 */

package com.google.api.ads.admanager.axis.v202202;

/**
 * Specifies inventory targeted by a breakdown entry.
 */
public class ForecastBreakdownTarget  implements java.io.Serializable {
    /* An optional name for this breakdown target, to be populated
     * in the corresponding
     *                 {@link ForecastBreakdownEntry#name} field. */
    private java.lang.String name;

    /* If specified, the targeting for this breakdown. */
    private com.google.api.ads.admanager.axis.v202202.Targeting targeting;

    /* If specified, restrict the breakdown to only inventory matching
     * this creative. */
    private com.google.api.ads.admanager.axis.v202202.CreativePlaceholder creative;

    public ForecastBreakdownTarget() {
    }

    public ForecastBreakdownTarget(
           java.lang.String name,
           com.google.api.ads.admanager.axis.v202202.Targeting targeting,
           com.google.api.ads.admanager.axis.v202202.CreativePlaceholder creative) {
           this.name = name;
           this.targeting = targeting;
           this.creative = creative;
    }

    @Override
    public String toString() {
        return com.google.common.base.MoreObjects.toStringHelper(this.getClass())
            .omitNullValues()
            .add("creative", getCreative())
            .add("name", getName())
            .add("targeting", getTargeting())
            .toString();
    }

    /**
     * Gets the name value for this ForecastBreakdownTarget.
     *
     * @return name   * An optional name for this breakdown target, to be populated
     * in the corresponding
     *                 {@link ForecastBreakdownEntry#name} field.
     */
    public java.lang.String getName() {
        return name;
    }

    /**
     * Sets the name value for this ForecastBreakdownTarget.
     *
     * @param name   * An optional name for this breakdown target, to be populated
     * in the corresponding
     *                 {@link ForecastBreakdownEntry#name} field.
     */
    public void setName(java.lang.String name) {
        this.name = name;
    }

    /**
     * Gets the targeting value for this ForecastBreakdownTarget.
     *
     * @return targeting   * If specified, the targeting for this breakdown.
     */
    public com.google.api.ads.admanager.axis.v202202.Targeting getTargeting() {
        return targeting;
    }

    /**
     * Sets the targeting value for this ForecastBreakdownTarget.
     *
     * @param targeting   * If specified, the targeting for this breakdown.
     */
    public void setTargeting(com.google.api.ads.admanager.axis.v202202.Targeting targeting) {
        this.targeting = targeting;
    }

    /**
     * Gets the creative value for this ForecastBreakdownTarget.
     *
     * @return creative   * If specified, restrict the breakdown to only inventory matching
     * this creative.
     */
    public com.google.api.ads.admanager.axis.v202202.CreativePlaceholder getCreative() {
        return creative;
    }

    /**
     * Sets the creative value for this ForecastBreakdownTarget.
     *
     * @param creative   * If specified, restrict the breakdown to only inventory matching
     * this creative.
     */
    public void setCreative(com.google.api.ads.admanager.axis.v202202.CreativePlaceholder creative) {
        this.creative = creative;
    }

    private java.lang.Object __equalsCalc = null;
    public synchronized boolean equals(java.lang.Object obj) {
        if (!(obj instanceof ForecastBreakdownTarget)) return false;
        ForecastBreakdownTarget other = (ForecastBreakdownTarget) obj;
        if (obj == null) return false;
        if (this == obj) return true;
        if (__equalsCalc != null) {
            return (__equalsCalc == obj);
        }
        __equalsCalc = obj;
        boolean _equals;
        _equals = true &&
            ((this.name==null && other.getName()==null) ||
             (this.name!=null &&
              this.name.equals(other.getName()))) &&
            ((this.targeting==null && other.getTargeting()==null) ||
             (this.targeting!=null &&
              this.targeting.equals(other.getTargeting()))) &&
            ((this.creative==null && other.getCreative()==null) ||
             (this.creative!=null &&
              this.creative.equals(other.getCreative())));
        __equalsCalc = null;
        return _equals;
    }

    private boolean __hashCodeCalc = false;
    public synchronized int hashCode() {
        if (__hashCodeCalc) {
            return 0;
        }
        __hashCodeCalc = true;
        int _hashCode = 1;
        if (getName() != null) {
            _hashCode += getName().hashCode();
        }
        if (getTargeting() != null) {
            _hashCode += getTargeting().hashCode();
        }
        if (getCreative() != null) {
            _hashCode += getCreative().hashCode();
        }
        __hashCodeCalc = false;
        return _hashCode;
    }

    // Type metadata
    private static org.apache.axis.description.TypeDesc typeDesc =
        new org.apache.axis.description.TypeDesc(ForecastBreakdownTarget.class, true);

    static {
        typeDesc.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202202", "ForecastBreakdownTarget"));
        org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("name");
        elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202202", "name"));
        elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("targeting");
        elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202202", "targeting"));
        elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202202", "Targeting"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
        elemField = new org.apache.axis.description.ElementDesc();
        elemField.setFieldName("creative");
        elemField.setXmlName(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202202", "creative"));
        elemField.setXmlType(new javax.xml.namespace.QName("https://www.google.com/apis/ads/publisher/v202202", "CreativePlaceholder"));
        elemField.setMinOccurs(0);
        elemField.setNillable(false);
        typeDesc.addFieldDesc(elemField);
    }

    /**
     * Return type metadata object
     */
    public static org.apache.axis.description.TypeDesc getTypeDesc() {
        return typeDesc;
    }

    /**
     * Get Custom Serializer
     */
    public static org.apache.axis.encoding.Serializer getSerializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanSerializer(
            _javaType, _xmlType, typeDesc);
    }

    /**
     * Get Custom Deserializer
     */
    public static org.apache.axis.encoding.Deserializer getDeserializer(
           java.lang.String mechType,
           java.lang.Class _javaType,
           javax.xml.namespace.QName _xmlType) {
        return
          new  org.apache.axis.encoding.ser.BeanDeserializer(
            _javaType, _xmlType, typeDesc);
    }

}


text:
require 'test_helper'
require 'generators/attachments/attachments_generator'

module Fl::Framework
  class AttachmentsGeneratorTest < Rails::Generators::TestCase
    tests AttachmentsGenerator
    destination Rails.root.join('tmp/generators')
    setup :prepare_destination

    # test "generator runs without errors" do
    #   assert_nothing_raised do
    #     run_generator ["arguments"]
    #   end
    # end
  end
end


text:
       Name
      <input style="height: 2em;" type=text width=50 name="attr_name" />

       Character Rank

      <input type=number style="height: 2em; width: 4em; margin-right: 3em;" name="attr_cr" value="1" />
       Race

?

        Each character gets 5 bonus points that they can add to their base stats (Strength, Dexterity, Power or Intelligence). However, at Rank 1 no stat can be higher than 7. If you choose Human you also get an additional +1 bonus to two stats of your choice. You cannot add them to the same stat.

      <select type=text style="width: 10em; margin-right: 3em; margin-top: -0.5em;" name="attr_race">
        <option value="0">---</option>
        <option value="1">Human</option>
        <option value="2">Elf</option>
        <option value="3">Dwarf</option>
        <option value="4">Half-Alv</option>
        <option value="5">Werecat</option>
        <option value="6">Wolf Fang</option>
        <option value="7">Fox Tail</option>
        <option value="8">Race of Ritual</option>
      </select>

      <input type="hidden" name="attr_raceSTRbonus" value="0">
      <input type="hidden" name="attr_raceDEXbonus" value="0">
      <input type="hidden" name="attr_racePOWbonus" value="0">
      <input type="hidden" name="attr_raceINTbonus" value="0">
      <input type="hidden" name="attr_raceHPbonus" value="0">
      <input type="hidden" name="attr_raceFateBonus" value="0">

       Class
      <select type=text style="width: 10em; margin-right: 3em;"  name="attr_class">
        <option value="0">---</option>
        <option value="1">Guardian</option>
        <option value="2">Samurai</option>
        <option value="3">Monk</option>
        <option value="4">Cleric</option>
        <option value="5">Druid</option>
        <option value="6">Kannagi</option>
        <option value="7">Assassin</option>
        <option value="8">Swashbuckler</option>
        <option value="9">Bard</option>
        <option value="10">Sorcerer</option>
        <option value="11">Summoner</option>
        <option value="12">Enchanter</option>
      </select>
      <input type="hidden" name="attr_classSTRbonus" value="0">
      <input type="hidden" name="attr_classDEXbonus" value="0">
      <input type="hidden" name="attr_classPOWbonus" value="0">
      <input type="hidden" name="attr_classINTbonus" value="0">
      <input type="hidden" name="attr_classHPbonus" value="0">
      <input type="hidden" name="attr_classHPmod" value="0">
      Subclass
      <input type=text style="height: 2em; width: 10em; margin-right: 3em;"  name="attr_subClass" />

        ---
        Bonus
        Total
        Modifier

        Strength
        <input type=number width=4 style='width: 4em;' name="attr_STR" value="0"/>
        <input type=number width=4 style='width: 3em;' name="attr_STRtotal" value=(((@{STR}+@{cr})-1)+@{classSTRbonus}+@{raceSTRbonus}) disabled="disabled"/>
        <input type=number width=4 style='width: 3em;' name="attr_STRmod" value=((@{STRtotal}-(@{STRtotal}%3))/3) disabled="disabled"/>

          <input style="margin-left: -1.5em;" type="radio" name="attr_modRadio" value="@{STRmod}" checked="true">
          Mark your highest stat. If it's a draw, pick whichever.

        Dexterity
        <input type=number width=4 style='width: 4em;' name="attr_DEX" value="0" />
        <input type=number width=4 style='width: 3em;' name="attr_DEXtotal" value=(((@{DEX}+@{cr})-1)+@{classDEXbonus}+@{raceDexBonus}) disabled="disabled"/>
        <input type=number width=4 style='width: 3em;' name="attr_DEXmod" value=((@{DEXtotal}-(@{DEXtotal}%3))/3) disabled="disabled"/>

          <input style="margin-left: -1.5em;" type="radio" name="attr_modRadio" value="@{DEXmod}">
        Mark your highest stat. If it's a draw, pick whichever.

        Power
        <input type=number width=4 style='width: 4em;' name="attr_POW" value="0" />
        <input type=number width=4 style='width: 3em;' name="attr_POWtotal" value=(((@{POW}+@{cr})-1)+@{classPOWbonus}+@{racePOWbonus}) disabled="disabled"/>
        <input type=number width=4 style='width: 3em;' name="attr_POWmod" value=((@{POWtotal}-(@{POWtotal}%3))/3) disabled="disabled"/>

        <input style="margin-left: -1.5em;" type="radio" name="attr_modRadio" value="@{POWmod}">
        Mark your highest stat. If it's a draw, pick whichever.

        Intelligence
        <input type=number width=4 style='width: 4em;' name="attr_INT" value="0" />
        <input type=number width=4 style='width: 3em;' name="attr_INTtotal" value=(((@{INT}+@{cr})-1)+@{classINTbonus}+@{raceINTbonus}) disabled="disabled"/>
        <input type=number width=4 style='width: 3em;' name="attr_INTmod" value=((@{INTtotal}-(@{INTtotal}%3))/3) disabled="disabled"/>

        <input style="margin-left: -1.5em;" type="radio" name="attr_modRadio" value="@{INTmod}">
        Mark your highest stat. If it's a draw, pick whichever.

            ---
           Bonus

            Initiative
            <input name="attr_initiativeBonus" type="text" width=4 style='width: 4em;' value="0">
            <button type=roll value="&{template:default} {{name=Initiative}} {{Roll=[[2d6+@{STRmod}+@{INTmod}+@{initiativeBonus} &{tracker}]]}}"></button>

            Evasion
            <input name="attr_evasionBonus" type="text" width=4 style='width: 4em;' value="0">
            <button type=roll value="&{template:default} {{name=Evasion}} {{Roll=[[1d6+@{penaltyDie}+@{DEXmod}+@{evasionBonus} ]]}}"></button>

            Resistance
            <input name="attr_resistanceBonus" type="text" width=4 style='width: 4em;' value="0">
            <button type=roll value="&{template:default} {{name=Resistance}} {{Roll=[[1d6+@{penaltyDie}+@{POWmod}+@{resistanceBonus} ]]}}"></button>

            Accuracy
            <input name="attr_accuracyBonus" type="text" width=4 style='width: 4em;' value="0">
            <button type=roll value="&{template:default} {{name=Accuracy}} {{Roll=[[1d6+@{penaltyDie}+@{accuracyBonus}+@{modRadio} ]]}}"></button>

?

              If you want to add an Accuracy roll to a custom Skill Check simply include @{accuracy} in the Custom Check input. If you want to add a bonus to the accuracy that only applies to one Skill, you need to add it as a Custom Check with brackets, like this:
 [[ @{accuracy} +1 ]]

            <input type="hidden" name="attr_accuracy" value="[[1d6+@{penaltyDie}+@{accuracyBonus}+@{modRadio}]]">

Bonus     Current      Max

     HP

      <input name="attr_HPbonus" style="width: 4em;" type="number" value="0">
      <input name="attr_HP" style="width: 4em;" type="number" value="0">
      <input name="attr_HP_max" style="width: 4em;" type="number" disabled="disabled" value=@{classHPbonus}+(@{classHPmod}*(@{cr}-1))+@{raceHPbonus}+@{HPbonus}-@{fatigue}>

       Fate Points

      <input name="attr_fateBonus" style="width: 4em;" type="number" value="0">
      <input name="attr_fate" style="width: 4em;" type="number" value="0">
      <input name="attr_fate_max" style="width: 4em;" type="number" disabled="disabled" value=@{fateBonus}+@{raceFateBonus}>

Bonus     Total

        Physical Defense

        <input name="attr_PDEFbonus" style="width: 4em;" type="number" value="0">
        <input name="attr_PDEFtotal" style="width: 4em;" type="number" value=(@{STRmod}*2)+@{PDEFbonus} disabled="disabled">

        Magical Defense

        <input name="attr_MDEFbonus" style="width: 4em;" type="number" value="0">
        <input name="attr_MDEFtotal" style="width: 4em;" type="number" value=(@{INTmod}*2)+@{MDEFbonus} disabled="disabled">

Total

      Speed

      <input style="margin-bottom: 0.4em;" name="attr_speed" style="width: 3em;" type="number" placeholder="2">

      Attack Power

      <input name="attr_attack" style="width: 4em;" type="number" value="0">

?

  If you want to add your Attack Power to a damage roll, simply add @{attack} in the Damage/Healing input. For example: 2d6+@{attack}

      Magic Power

      <input name="attr_magic" style="width: 4em;" type="number" value="0">

?

  If you want to add your Magic Power to a damage or healing roll, simply add @{magic} in the Damage/Healing input. For example: 2d6+@{magic}

      Recovery

      <input name="attr_recovery" style="width: 3em;" type="number" value="0">

?

        If you want to add your Recovery to a healing roll, simply add @{recovery} in the Damage/Healing input. For example: 2d6+@{recovery}

      Hate

      <input name="attr_hate" style="width: 3em; margin-bottom: 0.4em;" type="number" value="0">

      Fatigue

      <input name="attr_fatigue" style="width: 3em;" type="number" value="0">

  Combat Skills

?

        Each Class starts with 3 "automatic" Skills listed in their respective categories in the Skill list. You also start with 3 Combat Skills and 1 General Skill from amongst the Archetype, Main Class, Race, and Common Skill lists. From CR 2-10 you can acquire or Rank up (increase SR) 2 Combat Skills and 1 General Skill after you gain a Character Rank. From CR 11, and above, you gain 1 Combat Skill and 1 General Skill.

  <fieldset class=repeating_cSkills>

    <button type=roll value="&{template:default} {{name=@{cName}}} @{cCostCB} @{cTimingCB} @{cTargetCB} @{cRangeCB} @{cLimitCB} @{cCheck} @{cAddCB} {{Effect=@{cEffect}}}"></button>
    <input type=text name=attr_cName placeholder="Name" style='width: 20em;height:1.5em;'>
    <input type="checkbox" name="cCondenseCB" class="cCondenseCB" checked="true" /> Condense

      <input type=number name=attr_SR value="1" style='margin-top: 1.5em; width: 100%; height:1.5em;'>

      SR

      <input style='margin-left: 2.5em;' type='checkbox' name='attr_ccostCB' value='{{Cost=@{cCost}}}' checked="true" />

      <input type=text name=attr_cCost placeholder="0 Hate" style='width: 100%; height:1.5em;'>

      Cost

      <input style='margin-left: 2em;' type='checkbox' name='attr_cTargetCB' value='{{Target=@{cTarget}}}' checked="true" />

      <input type=text name=attr_cTarget style='width: 5em;height:1.5em;'>

      Target

      <input style='margin-left: 2em;' type='checkbox' name='attr_cTimingCB' value='{{Timing=@{cTiming}}}' checked="true" />

      <input type=text name=attr_cTiming style='width: 5em;height:1.5em;'>

      Timing

      <input style='margin-left: 1.5em;' type='checkbox' name='attr_cRangeCB' value='{{Range=@{cRange}}}' checked="true" />

      <input type=text name=attr_cRange style='width: 4em;height:1.5em;'>

      Range

      <input style='margin-left: 2em;' type='checkbox' name='attr_cLimitCB' value='{{Limit=@{cLimit}}}' checked="true" />

      <input type=text name=attr_cLimit style='width: 6em;height:1.5em;'>

      Limit

      <select name=attr_cCheck style='width: 8em; height:2em; position: absolute;'>
      <option value="">None</option>
      <option value="{{Accuracy=[[1d6+@{penaltyDie}+@{accuracyBonus}+@{modRadio}]] vs. Evasion}}{{Damage=[[@{cDamage}]]}}">Acc vs Eva</option>
      <option value="{{Accuracy=[[1d6+@{penaltyDie}+@{accuracyBonus}+@{modRadio}]] vs. Resistance}}{{Damage=[[@{cDamage} ]]}}">Acc vs Res</option>
      <option value="{{Accuracy=[[1d6+@{penaltyDie}+@{accuracyBonus}+@{modRadio}]] vs. Evasion}}">Acc vs Eva (no damage)</option>
      <option value="{{Accuracy=[[1d6+@{penaltyDie}+@{accuracyBonus}+@{modRadio}]] vs. Resistance}}">Acc vs Res (no damage)</option>
      <option value="{{Check=Auto}} {{Damage=[[@{cDamage} ]]}}">Auto</option>
      <option value="{{Healing=[[@{cDamage} ]]}}">Healing</option>
      <option value="{{Check=[[@{cCustomCheck}]]}}">Custom</option>
      <option value="{{Check=[[@{cCustomCheck}]]}} {{Damage=[[@{cDamage} ]]}}">Custom w/ Damage</option>
    </select>

    <input type=text name=attr_cCustomCheck placeholder="Custom Check" style='margin-top: 0.7em; width: 8em;height:1.5em;'>

      Check

?

        You can substitute attributes such as Attack/Magic Power or the skill's SR into the roll by typing in @{attribute}. For example: @{SR}d6 + @{magic} In this example you roll a number of dice equal to the skill's SR and then add your Magic Power afterwards.

      <input type=text placeholder="0d6+0" name=attr_cDamage style='width: 11em; height:1.5em; margin-top: -1.2em;'>

      Damage / Healing

      <input style='margin-left: 4.5em;' type='checkbox' name='attr_cAddCB' value='{{Additional Properties=@{cAdd}}}' />

      <input type=text name=attr_cAdd placeholder="Training, Prep, etc." style='width: 10.5em;height:1.5em;'>

      Additional Properties

    <textarea name=attr_cEffect placeholder="Effect" style='width: 10em;height:5em;'></textarea>

  </fieldset>

  General Skills

  <fieldset class=repeating_generalSkills>

    <button type=roll value="&{template:default} {{name=@{gName}}} @{gCostCB} @{gTimingCB} @{gTargetCB} @{gRangeCB} @{gLimitCB} @{gCheck} @{gAddCB} {{Effect=@{gEffect}}}"></button>
    <input type=text name=attr_gName placeholder="Name" style='width: 20em;height:1.5em;'>
    <input type="checkbox" name="gCondenseCB" class="gCondenseCB" checked="true" /> Condense

      <input type=number name=attr_SR value="1" style='margin-top: 1.5em; width: 100%; height:1.5em;'>

      SR

      <input style='margin-left: 2.5em;' type='checkbox' name='attr_gcostCB' value='{{Cost=@{gCost}}}' checked="false" />

      <input type=text name=attr_gCost placeholder="0 Hate" style='width: 100%; height:1.5em;'>

      Cost

      <input style='margin-left: 2em;' type='checkbox' name='attr_gTargetCB' value='{{Target=@{gTarget}}}' checked="true" />

      <input type=text name=attr_gTarget style='width: 5em;height:1.5em;'>

      Target

      <input style='margin-left: 2em;' type='checkbox' name='attr_gTimingCB' value='{{Timing=@{gTiming}}}' checked="true" />

      <input type=text name=attr_gTiming style='width: 5em;height:1.5em;'>

      Timing

      <input style='margin-left: 1.5em;' type='checkbox' name='attr_gRangeCB' value='{{Range=@{gRange}}}' checked="false" />

      <input type=text name=attr_gRange style='width: 4em;height:1.5em;'>

      Range

      <input style='margin-left: 2em;' type='checkbox' name='attr_gLimitCB' value='{{Limit=@{gLimit}}}' checked="false" />

      <input type=text name=attr_gLimit style='width: 6em;height:1.5em;'>

      Limit

      <select name=attr_gCheck style='width: 8em; height:2em; position: absolute;'>
      <option value="">None</option>
      <option value="{{Accuracy=[[1d6+@{penaltyDie}+@{accuracyBonus}+@{modRadio}]] vs. Evasion}}{{Damage=[[@{gDamage}]]}}">Acc vs Eva</option>
      <option value="{{Accuracy=[[1d6+@{penaltyDie}+@{accuracyBonus}+@{modRadio}]] vs. Resistance}}{{Damage=[[@{gDamage} ]]}}">Acc vs Res</option>
      <option value="{{Accuracy=[[1d6+@{penaltyDie}+@{accuracyBonus}+@{modRadio}]] vs. Evasion}}">Acc vs Eva (no damage)</option>
      <option value="{{Accuracy=[[1d6+@{penaltyDie}+@{accuracyBonus}+@{modRadio}]] vs. Resistance}}">Acc vs Res (no damage)</option>
      <option value="{{Check=Auto}} {{Damage=[[@{gDamage} ]]}}">Auto</option>
      <option value="{{Healing=[[@{gDamage} ]]}}">Healing</option>
      <option value="{{Check=[[@{gCustomCheck}]]}}">Custom</option>
      <option value="{{Check=[[@{gCustomCheck}]]}} {{Damage=[[@{gDamage} ]]}}">Custom w/ Damage</option>
    </select>

      <input type=text name=attr_gCustomCheck placeholder="Custom Check" style='margin-top: 0.7em; width: 8em;height:1.5em;'>

      Check

?

        You can substitute attributes such as Attack/Magic Power or the skill's SR into the roll by typing in @{attribute}. For example: @{SR}d6 + @{magic} In this example you roll a number of dice equal to the skill's SR and then add your Magic Power afterwards.

      <input type=text placeholder="0d6+0" name=attr_gDamage style='width: 11em; height:1.5em; margin-top: -1.2em;'>

      Damage / Healing

      <input style='margin-left: 4.5em;' type='checkbox' name='attr_gAddCB' value='{{Additional Properties=@{gAdd}}}' />

      <input type=text name=attr_gAdd placeholder="Training, Prep, etc." style='width: 10.5em;height:1.5em;'>

      Additional Properties

    <textarea name=attr_gEffect placeholder="Effect" style='width: 10em;height:5em;'></textarea>

  </fieldset>

    Equipment

    Hand

      <input style="width: 70%;" type="text" name="attr_hand1"><input type="checkBox" class="eCondenseCB" name="eCondenseCB" checked="true">
      <textarea class="hiddenDesc" name="attr_hand1Desc" placeholder="Description, Stats"></textarea>

    Hand

    <input style="width: 70%;" type="text" name="attr_hand2"><input type="checkBox" class="eCondenseCB" name="eCondenseCB" checked="true">
        <textarea class="hiddenDesc" name="attr_hand2Desc" placeholder="Description, Stats"></textarea>

    Armor

    <input style="width: 70%;" type="text" name="attr_armor"><input type="checkBox" class="eCondenseCB" name="eCondenseCB" checked="true">
    <textarea class="hiddenDesc" name="attr_armordesc" placeholder="Description, Stats"></textarea>

    Accessories

    <input style="width: 70%;" type="text" name="attr_accessory1"><input type="checkBox" class="eCondenseCB" name="eCondenseCB" checked="true">
    <textarea class="hiddenDesc" name="attr_accessory1Desc" placeholder="Description, Stats"></textarea>

    <input style="width: 70%;" type="text" name="attr_accessory2"><input type="checkBox" class="eCondenseCB" name="eCondenseCB" checked="true">
    <textarea class="hiddenDesc" name="attr_accessory2Desc" placeholder="Description, Stats"></textarea>

    <input style="width: 70%;" type="text" name="attr_accessory3"><input type="checkBox" class="eCondenseCB" name="eCondenseCB" checked="true">
    <textarea class="hiddenDesc" name="attr_accessory3Desc" placeholder="Description, Stats"></textarea>

    Bag

    <input style="width: 70%;" type="text" name="attr_bag"><input type="checkBox" class="eCondenseCB" name="eCondenseCB" checked="true">
    <textarea class="hiddenDesc" name="attr_bagdesc" placeholder="Description, Stats"></textarea>

    Gold

    <input style="width: 35%;" type="number" name="attr_gold">

    CurrentMax

    Inventory <input style="width: 3em; margin-left: 8.5em;" type="number" name="attr_inventoryCurrent" value="0"><input style="width: 3em; margin-left: 1em;" type="number" name="attr_inventoryMax" value="7">
    <textarea name="attr_equipment" class="notes" style="margin-top: 0.5em;"></textarea>

    Basic ChecksBonus

          Athletics

            <input name="attr_athleticsBonus" type="text" value="0" placeholder="0d6+0" style="width: 4em;">

          <button type=roll value="&{template:default} {{name=Athletics}} {{Roll=[[1d6+@{penaltyDie}+@{STRmod}+@{athleticsBonus}]]}}"></button>

          Endurance
          <input name="attr_enduranceBonus" type="text" value="0" placeholder="0d6+0" style="width: 4em;">
          <button type=roll value="&{template:default} {{name=Endurance}} {{Roll=[[1d6+@{penaltyDie}+@{STRmod}+@{enduranceBonus}]]}}"></button>

          Disable
          <input name="attr_disableBonus" type="text" value="0" placeholder="0d6+0" style="width: 4em;">
          <button type=roll value="&{template:default} {{name=Disable}} {{Roll=[[1d6+@{penaltyDie}+@{DEXmod}+@{disableBonus}]]}}"></button>

          Operate
          <input name="attr_operateBonus" type="text" value="0" placeholder="0d6+0" style="width: 4em;">
          <button type=roll value="&{template:default} {{name=Operate}} {{Roll=[[1d6+@{penaltyDie}+@{DEXmod}+@{operateBonus}]]}}"></button>

          Perception
          <input name="attr_perceptionBonus" type="text" value="0" placeholder="0d6+0" style="width: 4em;">
          <button type=roll value="&{template:default} {{name=Perception}} {{Roll=[[1d6+@{penaltyDie}+@{POWmod}+@{perceptionBonus}]]}}"></button>

          Negotiation
          <input name="attr_negotiationBonus" type="text" value="0" placeholder="0d6+0" style="width: 4em;">
          <button type=roll value="&{template:default} {{name=Negotiation}} {{Roll=[[1d6+@{penaltyDie}+@{POWmod}+@{negotiationBonus}]]}}"></button>

          Knowledge
          <input name="attr_knowledgeBonus" type="text" value="0" placeholder="0d6+0" style="width: 4em;">
          <button type=roll value="&{template:default} {{name=Knowledge}} {{Roll=[[1d6+@{penaltyDie}+@{INTmod}+@{knowledgeBonus}]]}}"></button>

          Analyze
          <input name="attr_analyzeBonus" type="text" value="0" placeholder="0d6+0" style="width: 4em;">
          <button type=roll value="&{template:default} {{name=Analyze}} {{Roll=[[1d6+@{penaltyDie}+@{INTmod}+@{analyzeBonus}]]}}"></button>

    <input type="checkbox" name="attr_penaltyDie" value="1d6" checked="true;"> Uncheck for -1D Penalty
        This affects all rolls that automatically start with 2d6, except for Initiative.
 Don't forget to re-check it!
You can also add this functionality to custom checks by replacing one d6 with @{penaltyDie}

    Notes

    <textarea name="attr_notes" class="notes"></textarea>

Log Horizon TRPG Sheet v0.1


text:
> Keep track of websites for their changes

Add website to list, check for changes easily. Simple as that!

## Try it out!

You can try out this project at:

http://jehna.github.io/website-change-checker

## License
The work is licensed under MIT license


text:
package com.amazonaws.services.iotwireless.model;

import javax.annotation.Generated;

/**
 *

 * The log level for a log message. The log levels can be disabled, or set to ERROR to display less verbose
 * logs containing only error information, or to INFO for more detailed logs.
 *

 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public enum LogLevel {

    INFO("INFO"),
    ERROR("ERROR"),
    DISABLED("DISABLED");

    private String value;

    private LogLevel(String value) {
        this.value = value;
    }

    @Override
    public String toString() {
        return this.value;
    }

    /**
     * Use this in place of valueOf.
     *
     * @param value
     *        real value
     * @return LogLevel corresponding to the value
     *
     * @throws IllegalArgumentException
     *         If the specified value does not map to one of the known values in this enum.
     */
    public static LogLevel fromValue(String value) {
        if (value == null || "".equals(value)) {
            throw new IllegalArgumentException("Value cannot be null or empty!");
        }

        for (LogLevel enumEntry : LogLevel.values()) {
            if (enumEntry.toString().equals(value)) {
                return enumEntry;
            }
        }

        throw new IllegalArgumentException("Cannot create enum from " + value + " value!");
    }
}


text:
'use strict';
var Reflux = require('reflux');

module.exports = function(api, resource) {
    var asyncChildren = {
        children: ['completed', 'failed'],
    };
    var Actions = Reflux.createActions({
        load: asyncChildren,
        create: asyncChildren,
        update: asyncChildren,
        sort: asyncChildren,
    });

    Actions.load.listen(function(o) {
        api[resource].get(o).then((res) => {
            this.completed({
                count: res.headers['total-count'],
                data: res.data
            });
        }).catch(this.failed);
    });

    Actions.create.listen(function(data) {
        api[resource].post(data).then((res) => {
            this.completed(res.data);
        }).catch(this.failed);
    });

    Actions.update.listen(function(data) {
        api[resource].put(data).then((res) => {
            this.completed(res.data);
        }).catch(this.failed);
    });

    Actions.sort.listen(function(o) {
        api[resource].get(o).then((res) => {
            this.completed({
                count: res.headers['total-count'],
                data: res.data
            });
        }).catch(this.failed);
    });

    return Actions;
};


text:
export function inert (x) {
  return JSON.parse(JSON.stringify(x))
}

export function toType (o) {
  return typeof o !== 'object'
    ? (typeof o === 'boolean' ? 'ValueString' : typeof o === 'number' ? 'ValueString' : 'ValueText')
    : Array.isArray(o) ? 'ValueArray' : o['@id'] && o['@id'].charAt(0) !== '_' ? 'ValueReference'
      : typeof o['@value'] !== 'undefined' ? 'ValueLiteral' : 'ValueObject'
}

/* HTTP */

export function getJSON (url) {
  return window.fetch(url, {
    redirect: 'follow',
    headers: {
      Accept: 'application/json'
    }
  })
  .then(checkStatus)
  .then(toJSON)
}

export function putJSON (data) {
  return window.fetch(data['@id'], {
    method: 'put',
    body: JSON.stringify(data),
    redirect: 'follow',
    headers: {
      Accept: 'application/json',
      Authorization: 'insecure'
    }
  })
  .then(toJSON)
}

export function checkStatus (response) {
  if (response.status < 400) {
    return response
  }
  var error = new Error(response.statusText)
  error.status = response.status
  error.response = response
  throw error
}

export function toJSON (response) {
  return response.json()
}


text:
package com.smallchill.core.toolbox.file;

import java.io.File;
import java.io.IOException;

import org.springframework.web.multipart.MultipartFile;

import com.smallchill.core.constant.Cst;
import com.smallchill.core.toolbox.kit.DateKit;

public class BladeFile {
	/**
	 * 上传文件在附件表中的id
	 */
	private Object fileId;

	/**
	 * 上传文件
	 */
	private MultipartFile file;

	/**
	 * 上传物理路径
	 */
	private String uploadPath;

	/**
	 * 上传虚拟路径
	 */
	private String uploadVirtualPath;

	/**
	 * 文件名
	 */
	private String fileName;

	/**
	 * 真实文件名
	 */
	private String originalFileName;

	/**
	 * 第三方获取url
	 */
	private String thirdUrl;

	public BladeFile() {

	}

	public BladeFile(MultipartFile file) {
		this.file = file;
		this.fileName = file.getName();
		this.originalFileName = file.getOriginalFilename();
		this.uploadPath = Cst.me().getUploadRealPath() + File.separator + DateKit.getDays() + File.separator + this.originalFileName;
		this.uploadVirtualPath = Cst.me().getUploadCtxPath().replace(Cst.me().getContextPath(), "") + File.separator + DateKit.getDays() + File.separator + this.originalFileName;
	}

	public BladeFile(MultipartFile file, String uploadPath) {
		this(file);
		if (null != uploadPath){
			this.uploadPath = uploadPath;
			this.uploadVirtualPath = null;
		}
	}

	public void transfer() {
		IFileProxy fileFactory = FileProxyManager.me().getDefaultFileProxyFactory();
		this.transfer(fileFactory);
	}

	public void transfer(IFileProxy fileFactory) {
		try {
			File file = new File(uploadPath);

			if(null != fileFactory){
				this.uploadPath = fileFactory.path(file);
				if(Cst.me().isRemoteMode()){
					this.uploadVirtualPath = null;
				} else{
					this.uploadVirtualPath = fileFactory.virtualPath(file).replace(Cst.me().getContextPath(), "");
				}
				file = fileFactory.rename(file);
			}

			File dir = file.getParentFile();
			if (!dir.exists()) {
				dir.mkdirs();
			}

			this.file.transferTo(file);

		} catch (IllegalStateException | IOException e) {
			e.printStackTrace();
		}
	}

	public Object getFileId() {
		if(null == this.fileId) {
			IFileProxy fileFactory = FileProxyManager.me().getDefaultFileProxyFactory();
			this.fileId = fileFactory.getFileId(this);
		}
		return fileId;
	}

	public Object getFileIdByQiniu() {
		if(null == this.fileId) {
			IFileProxy fileFactory = FileProxyManager.me().getDefaultFileProxyFactory();
			this.fileId = fileFactory.getFileIdByQiniu(this);
		}
		return fileId;
	}

	public void setFileId(Object fileId) {
		this.fileId = fileId;
	}

	public MultipartFile getFile() {
		return file;
	}

	public void setFile(MultipartFile file) {
		this.file = file;
	}

	public String getUploadPath() {
		return uploadPath;
	}

	public void setUploadPath(String uploadPath) {
		this.uploadPath = uploadPath;
	}

	public String getUploadVirtualPath() {
		return uploadVirtualPath;
	}

	public void setUploadVirtualPath(String uploadVirtualPath) {
		this.uploadVirtualPath = uploadVirtualPath;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getOriginalFileName() {
		return originalFileName;
	}

	public void setOriginalFileName(String originalFileName) {
		this.originalFileName = originalFileName;
	}

	public String getThirdUrl() {
		return thirdUrl;
	}

	public void setThirdUrl(String thirdUrl) {
		this.thirdUrl = thirdUrl;
	}
}


text:
import { Component, Input } from '@angular/core';

import { Program } from '../shared/program.model';
import { Category } from './../../shared/category.model';

@Component({
  selector: 'app-program-list',
  templateUrl: './program-list.component.html',
  styleUrls: ['./program-list.component.scss']
})
export class ProgramListComponent {
  @Input() category: Category[];
  @Input() programs: Program[];
}


text:
import React from 'react';
import {Provider} from 'react-redux';
import configureStore from '../store/configureStore';
import Home from '../components/Home';
import {renderDevTools} from '../utils/devTools';

const store = configureStore();

export default React.createClass({
  render() {
    return (
      <div>

        {/* <Home /> is your app entry point */}
        <Provider store={store}>
          <Home />
        </Provider>

        {/* only renders when running in DEV mode */
          renderDevTools(store)
        }
      </div>
    );
  }
});


text:
// Code generated by lister-gen. DO NOT EDIT.

package v1alpha1

import (
	v1alpha1 "kubedb.dev/apimachinery/apis/ops/v1alpha1"

	"k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/client-go/tools/cache"
)

// ElasticsearchOpsRequestLister helps list ElasticsearchOpsRequests.
// All objects returned here must be treated as read-only.
type ElasticsearchOpsRequestLister interface {
	// List lists all ElasticsearchOpsRequests in the indexer.
	// Objects returned here must be treated as read-only.
	List(selector labels.Selector) (ret []*v1alpha1.ElasticsearchOpsRequest, err error)
	// ElasticsearchOpsRequests returns an object that can list and get ElasticsearchOpsRequests.
	ElasticsearchOpsRequests(namespace string) ElasticsearchOpsRequestNamespaceLister
	ElasticsearchOpsRequestListerExpansion
}

// elasticsearchOpsRequestLister implements the ElasticsearchOpsRequestLister interface.
type elasticsearchOpsRequestLister struct {
	indexer cache.Indexer
}

// NewElasticsearchOpsRequestLister returns a new ElasticsearchOpsRequestLister.
func NewElasticsearchOpsRequestLister(indexer cache.Indexer) ElasticsearchOpsRequestLister {
	return &elasticsearchOpsRequestLister{indexer: indexer}
}

// List lists all ElasticsearchOpsRequests in the indexer.
func (s *elasticsearchOpsRequestLister) List(selector labels.Selector) (ret []*v1alpha1.ElasticsearchOpsRequest, err error) {
	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
		ret = append(ret, m.(*v1alpha1.ElasticsearchOpsRequest))
	})
	return ret, err
}

// ElasticsearchOpsRequests returns an object that can list and get ElasticsearchOpsRequests.
func (s *elasticsearchOpsRequestLister) ElasticsearchOpsRequests(namespace string) ElasticsearchOpsRequestNamespaceLister {
	return elasticsearchOpsRequestNamespaceLister{indexer: s.indexer, namespace: namespace}
}

// ElasticsearchOpsRequestNamespaceLister helps list and get ElasticsearchOpsRequests.
// All objects returned here must be treated as read-only.
type ElasticsearchOpsRequestNamespaceLister interface {
	// List lists all ElasticsearchOpsRequests in the indexer for a given namespace.
	// Objects returned here must be treated as read-only.
	List(selector labels.Selector) (ret []*v1alpha1.ElasticsearchOpsRequest, err error)
	// Get retrieves the ElasticsearchOpsRequest from the indexer for a given namespace and name.
	// Objects returned here must be treated as read-only.
	Get(name string) (*v1alpha1.ElasticsearchOpsRequest, error)
	ElasticsearchOpsRequestNamespaceListerExpansion
}

// elasticsearchOpsRequestNamespaceLister implements the ElasticsearchOpsRequestNamespaceLister
// interface.
type elasticsearchOpsRequestNamespaceLister struct {
	indexer   cache.Indexer
	namespace string
}

// List lists all ElasticsearchOpsRequests in the indexer for a given namespace.
func (s elasticsearchOpsRequestNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ElasticsearchOpsRequest, err error) {
	err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
		ret = append(ret, m.(*v1alpha1.ElasticsearchOpsRequest))
	})
	return ret, err
}

// Get retrieves the ElasticsearchOpsRequest from the indexer for a given namespace and name.
func (s elasticsearchOpsRequestNamespaceLister) Get(name string) (*v1alpha1.ElasticsearchOpsRequest, error) {
	obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
	if err != nil {
		return nil, err
	}
	if !exists {
		return nil, errors.NewNotFound(v1alpha1.Resource("elasticsearchopsrequest"), name)
	}
	return obj.(*v1alpha1.ElasticsearchOpsRequest), nil
}


text:
package org.schooldesk.core.services.impl.utils;

public class StupidPasswordGenerator implements IPasswordGenerator {
	@Override
	public String generate() {
		return "dummy";
	}
}


text:
package com.almasb.tutorial5;

import javafx.application.Application;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.Pane;
import javafx.scene.text.Text;
import javafx.stage.Stage;

public class Main extends Application {

    private SimpleIntegerProperty target = new SimpleIntegerProperty();

    private Parent createContent() {
        Pane root = new Pane();
        root.setPrefSize(800, 600);

        Dice dice1 = new Dice();
        Dice dice2 = new Dice();

        dice1.setTranslateX(100);
        dice1.setTranslateY(200);

        dice2.setTranslateX(300);
        dice2.setTranslateY(200);

        Button btn = new Button("New target");
        btn.setOnAction(event -> {
            target.set((int)(Math.random() * (Dice.MAX_VALUE * 2 + 1)));
        });

        btn.setTranslateX(400);
        btn.setTranslateY(200);

        SimpleBooleanProperty bool = new SimpleBooleanProperty();
        bool.bind(target.isEqualTo(dice1.valueProperty.add(dice2.valueProperty)));

        Text message = new Text();
        message.textProperty().bind(target.asString().concat(bool.asString()));

        message.setTranslateX(500);
        message.setTranslateY(200);

        root.getChildren().addAll(dice1, dice2, btn, message);
        return root;
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        Scene scene = new Scene(createContent());
        primaryStage.setTitle("Tutorial");
        primaryStage.setScene(scene);
        primaryStage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}


text:
require_relative 'fixtures'
module API
  include Spinach::DSL
  include WebMock::API
  include Spinach::Fixtures

  before do
    WebMock::Config.instance.query_values_notation = :flat_array

    stub_request(:any, /api.example.org*/).to_return(body: root_response, headers: { 'Content-Type' => 'application/hal+json' })
    stub_request(:get, 'api.example.org').to_return(body: root_response, headers: { 'Content-Type' => 'application/hal+json' })
    stub_request(:get, 'api.example.org/authors').to_return(body: authors_response, headers: { 'Content-Type' => 'application/hal+json' })
    stub_request(:get, 'api.example.org/posts').to_return(body: posts_response, headers: { 'Content-Type' => 'application/hal+json' })
    stub_request(:get, 'api.example.org/posts?page=2').to_return(body: posts_page2_response, headers: { 'Content-Type' => 'application/hal+json' })
    stub_request(:get, 'api.example.org/posts?page=3').to_return(body: posts_page3_response, headers: { 'Content-Type' => 'application/hal+json' })
    stub_request(:get, 'api.example.org/posts/1').to_return(body: post1_response, headers: { 'Content-Type' => 'application/hal+json' })
    stub_request(:get, 'api.example.org/posts/2').to_return(body: post2_response, headers: { 'Content-Type' => 'application/hal+json' })
    stub_request(:get, 'api.example.org/posts/3').to_return(body: post3_response, headers: { 'Content-Type' => 'application/hal+json' })
    stub_request(:get, 'api.example.org/page2').to_return(body: page2_response, headers: { 'Content-Type' => 'application/hal+json' })
    stub_request(:get, 'api.example.org/page3').to_return(body: page3_response, headers: { 'Content-Type' => 'application/hal+json' })
  end

  def api
    @api ||= Hyperclient.new('http://api.example.org')
  end

  step 'I connect to the API' do
    api._links
  end

  after do
    WebMock.reset!
  end
end


text:
@class NSString;

@interface IBXMLDecoderStringElement : IBXMLDecoderAbstractObjectElement
{
    NSString *_value;
    BOOL _base64UTF8;
}

+ (id)elementName;
- (void).cxx_destruct;
- (id)interpretedObjectValue:(char *)arg1;
- (BOOL)acceptsData;
- (BOOL)interpretDataReturningError:(id *)arg1;
- (id)initWithAttributes:(const char **)arg1 stringTable:(id)arg2 error:(id *)arg3;
- (BOOL)requestInsertionIntoParent:(id)arg1 error:(id *)arg2;

@end


text:
package com.satalyst.powerbi.operations;

import com.google.gson.Gson;
import com.satalyst.powerbi.impl.model.DefaultDataset;
import com.satalyst.powerbi.model.Dataset;

import static com.satalyst.powerbi.operations.MapUtils.*;

import javax.ws.rs.core.UriBuilder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;

/**
 * @author Aidan Morgan
 */
public class ListDatasets extends AbstractGetOperation<List<Dataset>> {

    @Override
    public void buildUri(UriBuilder uri) {
        uri.path("myorg").path("datasets");
    }

    protected List<Dataset> parseJson(Gson parser, String value) {
        List<Dataset> result = new ArrayList<>();

        Map parsed = parser.fromJson(value, Map.class);

        List<Map> datasets = getList(parsed, "value");

        for (Map dataset : datasets) {
            result.add(new DefaultDataset(getString(dataset, "name"), UUID.fromString(getString(dataset, "id"))));
        }

        return result;
    }
}


text:
namespace parlex {
namespace detail {

abstract_syntax_semilattice::abstract_syntax_semilattice(match const root) : root(root) { }

bool abstract_syntax_semilattice::is_rooted() const {
	auto const i = permutations_of_matches.find(root);
	return i != permutations_of_matches.end() && !i->second.empty();
}

void abstract_syntax_semilattice::cut(std::set<match> const & matches) {
	std::map<match, std::set<match>> reversedDependencies;
	for (auto const & matchAndPermutations : permutations_of_matches) {
		for (auto const & permutation : matchAndPermutations.second) {
			for (auto const & m : permutation) {
				reversedDependencies[m].insert(matchAndPermutations.first);
			}
		}
	}
	std::queue<match> pending;
	for (auto const & m : matches) {
		pending.push(m);
	}
	while (!pending.empty()) {
		auto const m = pending.front();
		pending.pop();
		if (permutations_of_matches.erase(m) == 1) {
			for (auto const & n : reversedDependencies[m]) {
				std::set<permutation> newPermutations;
				for (auto const & p : permutations_of_matches[n]) {
					auto cutPermutation = false;
					for (auto const & o : p) {
						if (!(o < m) && !(m < o)) {
							cutPermutation = true;
							break;
						}
					}
					if (!cutPermutation) {
						newPermutations.insert(p);
					}
				}
				if (newPermutations.empty()) {
					pending.push(n);
				}
				else {
					permutations_of_matches[n].swap(newPermutations);
				}
			}
		}
	}
}

void abstract_syntax_semilattice::prune_detached() {
	std::set<match> unconnecteds;
	for (auto const & entry : permutations_of_matches) {
		unconnecteds.insert(entry.first);
	}
	std::queue<match> pending;
	unconnecteds.erase(root);
	pending.push(root);
	while (!pending.empty()) {
		auto const m = pending.front();
		pending.pop();
		for (auto const & permutation : permutations_of_matches[m]) {
			for (auto const & child : permutation) {
				if (unconnecteds.erase(child) > 0) {
					pending.push(child);
				}
			}
		}
	}
	for (auto const & unconnected : unconnecteds) {
		permutations_of_matches.erase(unconnected);
	}
}

std::string abstract_syntax_semilattice::to_dot(grammar const & g) const {
	std::string result = "digraph {\n";
	std::set<match> completed;
	for (auto const & entry : permutations_of_matches) {
		auto const i = entry.first;
		completed.insert(i);
		auto const & iRecognizer = g.get_recognizer(i.recognizer_index);
		auto const fromName = iRecognizer.name + ":" + std::to_string(i.document_position + 1) + ":" + std::to_string(i.consumed_character_count);
		for (auto const & j : entry.second) {
			for (match const & k : j) {
				auto const & kRecognizer = g.get_recognizer(k.recognizer_index);
				auto const toName = kRecognizer.name + ":" + std::to_string(k.document_position + 1) + ":" + std::to_string(k.consumed_character_count);
				result += "\t" + enquote(fromName) + " -> " + enquote(toName) + "\n";
			}
		}
	}
	result += "}";
	return result;
}

//std::string abstract_syntax_semilattice::to_concrete_dot(std::u32string const & document) {
//	std::string result = "digraph {\n";
//	std::set<match> completed;
//	for (auto const & entry : permutations_of_matches) {
//		auto const i = entry.first;
//		completed.insert(i);
//		auto const fromName = i.r.name + ":" + std::to_string(i.document_position + 1) + ":" + std::to_string(i.consumed_character_count) + "\n" + to_utf8(document.substr(i.document_position, i.consumed_character_count));
//		for (auto const & j : entry.second) {
//			for (match const & k : j) {
//				auto const toName = k.r.name + ":" + std::to_string(k.document_position + 1) + ":" + std::to_string(k.consumed_character_count) + "\n" + to_utf8(document.substr(k.document_position, k.consumed_character_count));
//				result += "\t" + enquote(fromName) + " -> " + enquote(toName) + "\n";
//			}
//		}
//	}
//	result += "}";
//	return result;
//}

uint64_t abstract_syntax_semilattice::variation_count() const {
	uint64_t result = 1;
	for (auto const & permutation : permutations_of_matches) {
		result *= permutation.second.size();
	}
	return result;
}

std::set<permutation> const & abstract_syntax_semilattice::lookup(match const & m) const
{
	auto const i = permutations_of_matches.find(m);
	if (i == permutations_of_matches.end()) {
		throw std::runtime_error("permutations not found");
	}
	return i->second;
}

std::vector<ast_node> abstract_syntax_semilattice::build_tree(match const & m) const {
	std::vector<ast_node> results;
	auto const i = permutations_of_matches.find(m);
	throw_assert(i != permutations_of_matches.end());
	auto const & ps = i->second;
	if (!ps.empty()) {
		auto const & p = *ps.begin();
		for (auto const & t : p) {
			results.emplace_back(t, build_tree(t), t.l);
		}
	}
	return results;
}

abstract_syntax_tree abstract_syntax_semilattice::tree() const {
	if (!is_rooted()) {
		throw std::runtime_error("The document could not be parsed.");
	}
	if (variation_count() > 1) {
		throw std::runtime_error("The document is ambiguous.");
	}
	return ast_node(root, build_tree(root), nullptr);
}

} // namespace detail
} // namespace parlex


text:
package com.autonomy.abc.selenium.find.filters;

import com.autonomy.abc.selenium.find.numericWidgets.NumericWidget;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

public class GraphFilterContainer extends FilterContainer {

    private final WebDriver driver;
    private final WebElement container;

    GraphFilterContainer(final WebElement element, final WebDriver webDriver) {
        super(element, webDriver);
        driver = webDriver;
        container = element;
    }

    public NumericWidget getChart(){
        return new NumericWidget(driver,container);
    }

    public WebElement graph(){
        return getContainer().findElement(By.cssSelector("div.collapse:nth-child(2)"));
    }

    //REFACTOR
    //gets the graph header
    @Override
    public WebElement filterCategory(){
        return getContainer().findElement(By.cssSelector(".collapsible-header h4 span"));
    }
}


text:
package spark_trial;

import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;

import java.util.ArrayList;
import java.util.List;

/**
 * SparkPi example used for testing.
 *
 * Based on https://github.com/apache/spark/blob/master/examples/src/main/java/org/apache/spark/examples/JavaSparkPi.java
 */
public class PiExample {
    public static void main(String... argv) {
        System.out.println("Solving Pi");

        JavaSparkContext sc = new JavaSparkContext("local[4]", "PiSample");

        int slices = sc.defaultParallelism();
        int n = 100000 * slices;
        List<Integer> l = new ArrayList<>(n);
        for (int i = 0; i < n; i++) {
            l.add(i);
        }

        JavaRDD<Integer> dataSet = sc.parallelize(l, slices);

        int count = dataSet.map(i -> {
            double x = Math.random() * 2 - 1;
            double y = Math.random() * 2 - 1;
            return (x * x + y * y < 1) ? 1 : 0;
        }).reduce((i1, i2) -> i1 + i2);

        double pi = 4.0 * (double)count / (double)n;
        System.out.println("Pi is roughly " + pi);
        sc.stop();
    }
}


text:
var mongojs = require('mongojs')

var db = mongojs(process.env.IP + '/oauth2orize_authorization_grant_example')

exports.db = function() {
    return db
}


text:
<?php

namespace Luchaninov\StandaloneParameterHandler;

use Composer\IO\ComposerIO;
use Incenteev\ParameterHandler\Processor;

class ScriptHandler
{
    public static function buildParameters()
    {
        $filename = __DIR__ . '/../../../../composer.json';
        if (!is_file($filename)) {
            throw new \InvalidArgumentException('Cannot find composer.json');
        }

        $composerData = json_decode(file_get_contents($filename), true);
        if (empty($composerData) || !is_array($composerData)) {
            throw new \InvalidArgumentException('Cannot decode composer.json');
        }
        if (!isset($composerData['extra'])) {
            throw new \InvalidArgumentException('composer.json doesn\'t contain "extras"');
        }

        $extras = $composerData['extra'];

        if (!isset($extras['incenteev-parameters'])) {
            throw new \InvalidArgumentException('The parameter handler needs to be configured through the extra.incenteev-parameters setting.');
        }

        $configs = $extras['incenteev-parameters'];

        if (!is_array($configs)) {
            throw new \InvalidArgumentException('The extra.incenteev-parameters setting must be an array or a configuration object.');
        }

        if (array_keys($configs) !== range(0, count($configs) - 1)) {
            $configs = array($configs);
        }

        $processor = new Processor(new ComposerIO());

        foreach ($configs as $config) {
            if (!is_array($config)) {
                throw new \InvalidArgumentException('The extra.incenteev-parameters setting must be an array of configuration objects.');
            }

            $processor->processFile($config);
        }
    }
}