text:
namespace blink {

// Suppress warning: global constructors, because struct WrapperTypeInfo is trivial
// and does not depend on another global objects.
#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
const WrapperTypeInfo V8TestInterfaceCheckSecurity::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceCheckSecurity::domTemplate, V8TestInterfaceCheckSecurity::refObject, V8TestInterfaceCheckSecurity::derefObject, V8TestInterfaceCheckSecurity::trace, 0, 0, V8TestInterfaceCheckSecurity::preparePrototypeObject, V8TestInterfaceCheckSecurity::installConditionallyEnabledProperties, "TestInterfaceCheckSecurity", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::NotInheritFromEventTarget, WrapperTypeInfo::Independent, WrapperTypeInfo::RefCountedObject };
#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
#pragma clang diagnostic pop
#endif

// This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfaceCheckSecurity.h.
// For details, see the comment of DEFINE_WRAPPERTYPEINFO in
// bindings/core/v8/ScriptWrappable.h.
const WrapperTypeInfo& TestInterfaceCheckSecurity::s_wrapperTypeInfo = V8TestInterfaceCheckSecurity::wrapperTypeInfo;

namespace TestInterfaceCheckSecurityV8Internal {

template<class CallbackInfo>
static bool TestInterfaceCheckSecurityCreateDataProperty(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const CallbackInfo& info)
{
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info.Holder());
    v8::String::Utf8Value attributeName(name);
    ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
    if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->frame(), exceptionState)) {
        exceptionState.throwIfNeeded();
        return false;
    }
    ASSERT(info.This()->IsObject());
    return v8CallBoolean(v8::Local<v8::Object>::Cast(info.This())->CreateDataProperty(info.GetIsolate()->GetCurrentContext(), name, v8Value));
}

static void readonlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Object> holder = info.Holder();
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
    ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate());
    if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->frame(), exceptionState)) {
        v8SetReturnValueNull(info);
        exceptionState.throwIfNeeded();
        return;
    }
    v8SetReturnValueInt(info, impl->readonlyLongAttribute());
}

static void readonlyLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
    TestInterfaceCheckSecurityV8Internal::readonlyLongAttributeAttributeGetter(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void longAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Object> holder = info.Holder();
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
    ExceptionState exceptionState(ExceptionState::GetterContext, "longAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate());
    if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->frame(), exceptionState)) {
        v8SetReturnValueNull(info);
        exceptionState.throwIfNeeded();
        return;
    }
    v8SetReturnValueInt(info, impl->longAttribute());
}

static void longAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
    TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetter(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void longAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Object> holder = info.Holder();
    ExceptionState exceptionState(ExceptionState::SetterContext, "longAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate());
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
    if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->frame(), exceptionState)) {
        v8SetReturnValue(info, v8Value);
        exceptionState.throwIfNeeded();
        return;
    }
    int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
    if (exceptionState.throwIfNeeded())
        return;
    impl->setLongAttribute(cppValue);
}

static void longAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Value> v8Value = info[0];
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
    TestInterfaceCheckSecurityV8Internal::longAttributeAttributeSetter(v8Value, info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Object> holder = info.Holder();
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
    v8SetReturnValueInt(info, impl->doNotCheckSecurityLongAttribute());
}

static void doNotCheckSecurityLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeGetter(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Object> holder = info.Holder();
    ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecurityLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate());
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
    int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
    if (exceptionState.throwIfNeeded())
        return;
    impl->setDoNotCheckSecurityLongAttribute(cppValue);
}

static void doNotCheckSecurityLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Value> v8Value = info[0];
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeSetter(v8Value, info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityReadonlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Object> holder = info.Holder();
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
    v8SetReturnValueInt(info, impl->doNotCheckSecurityReadonlyLongAttribute());
}

static void doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadonlyLongAttributeAttributeGetter(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityOnSetterLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Object> holder = info.Holder();
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
    v8SetReturnValueInt(info, impl->doNotCheckSecurityOnSetterLongAttribute());
}

static void doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeGetter(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Object> holder = info.Holder();
    ExceptionState exceptionState(ExceptionState::SetterContext, "doNotCheckSecurityOnSetterLongAttribute", "TestInterfaceCheckSecurity", holder, info.GetIsolate());
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
    int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exceptionState);
    if (exceptionState.throwIfNeeded())
        return;
    impl->setDoNotCheckSecurityOnSetterLongAttribute(cppValue);
}

static void doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Value> v8Value = info[0];
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSetter(v8Value, info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Object> holder = info.Holder();
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
    v8SetReturnValueInt(info, impl->doNotCheckSecurityReplaceableReadonlyLongAttribute());
}

static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetter(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "doNotCheckSecurityReplaceableReadonlyLongAttribute");
    TestInterfaceCheckSecurityCreateDataProperty(propertyName, v8Value, info);
}

static void doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    v8::Local<v8::Value> v8Value = info[0];
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetter(v8Value, info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType type, v8::Local<v8::Value>)
{
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(host);
    return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), impl->frame(), DoNotReportSecurityError);
}

bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
{
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(host);
    return BindingSecurity::shouldAllowAccessToFrame(v8::Isolate::GetCurrent(), impl->frame(), DoNotReportSecurityError);
}

static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethod", "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info.Holder());
    if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->frame(), exceptionState)) {
        exceptionState.throwIfNeeded();
        return;
    }
    impl->voidMethod();
}

static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
    TestInterfaceCheckSecurityV8Internal::voidMethodMethod(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info.Holder());
    impl->doNotCheckSecurityVoidMethod();
}

static void doNotCheckSecurityVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethod(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
    static int domTemplateKey; // This address is used for a key to look up the dom template.
    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
    v8::Local<v8::FunctionTemplate> domTemplate = data->domTemplate(&domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0);

    // It is unsafe to use info.Holder() because OriginSafeMethodGetter is called
    // back without checking the type of info.Holder().
    v8::Local<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceInPrototypeChain(info.This(), info.GetIsolate());
    if (holder.IsEmpty()) {
        v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
        return;
    }
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
    if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->frame(), DoNotReportSecurityError)) {
        v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
        return;
    }

    v8::Local<v8::Value> hiddenValue = v8::Local<v8::Object>::Cast(info.This())->GetHiddenValue(v8AtomicString(info.GetIsolate(), "doNotCheckSecurityVoidMethod"));
    if (!hiddenValue.IsEmpty()) {
        v8SetReturnValue(info, hiddenValue);
        return;
    }

    v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
}

static void doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOriginSafeMethodGetter(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityDoNotCheckSignatureVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info.Holder());
    impl->doNotCheckSecurityDoNotCheckSignatureVoidMethod();
}

static void doNotCheckSecurityDoNotCheckSignatureVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureVoidMethodMethod(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
    static int domTemplateKey; // This address is used for a key to look up the dom template.
    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
    v8::Local<v8::FunctionTemplate> domTemplate = data->domTemplate(&domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0);

    // It is unsafe to use info.Holder() because OriginSafeMethodGetter is called
    // back without checking the type of info.Holder().
    v8::Local<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceInPrototypeChain(info.This(), info.GetIsolate());
    if (holder.IsEmpty()) {
        v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
        return;
    }
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
    if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->frame(), DoNotReportSecurityError)) {
        v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
        return;
    }

    v8::Local<v8::Value> hiddenValue = v8::Local<v8::Object>::Cast(info.This())->GetHiddenValue(v8AtomicString(info.GetIsolate(), "doNotCheckSecurityDoNotCheckSignatureVoidMethod"));
    if (!hiddenValue.IsEmpty()) {
        v8SetReturnValue(info, hiddenValue);
        return;
    }

    v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
}

static void doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGetter(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityPerWorldBindingsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info.Holder());
    impl->doNotCheckSecurityPerWorldBindingsVoidMethod();
}

static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethod(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
    static int domTemplateKey; // This address is used for a key to look up the dom template.
    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
    v8::Local<v8::FunctionTemplate> domTemplate = data->domTemplate(&domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0);

    // It is unsafe to use info.Holder() because OriginSafeMethodGetter is called
    // back without checking the type of info.Holder().
    v8::Local<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceInPrototypeChain(info.This(), info.GetIsolate());
    if (holder.IsEmpty()) {
        v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
        return;
    }
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
    if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->frame(), DoNotReportSecurityError)) {
        v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
        return;
    }

    v8::Local<v8::Value> hiddenValue = v8::Local<v8::Object>::Cast(info.This())->GetHiddenValue(v8AtomicString(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod"));
    if (!hiddenValue.IsEmpty()) {
        v8SetReturnValue(info, hiddenValue);
        return;
    }

    v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
}

static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetter(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info.Holder());
    impl->doNotCheckSecurityPerWorldBindingsVoidMethod();
}

static void doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodForMainWorld(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
{
    static int domTemplateKey; // This address is used for a key to look up the dom template.
    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
    v8::Local<v8::FunctionTemplate> domTemplate = data->domTemplate(&domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodMethodCallbackForMainWorld, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0);

    // It is unsafe to use info.Holder() because OriginSafeMethodGetter is called
    // back without checking the type of info.Holder().
    v8::Local<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceInPrototypeChain(info.This(), info.GetIsolate());
    if (holder.IsEmpty()) {
        v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
        return;
    }
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
    if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->frame(), DoNotReportSecurityError)) {
        v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
        return;
    }

    v8::Local<v8::Value> hiddenValue = v8::Local<v8::Object>::Cast(info.This())->GetHiddenValue(v8AtomicString(info.GetIsolate(), "doNotCheckSecurityPerWorldBindingsVoidMethod"));
    if (!hiddenValue.IsEmpty()) {
        v8SetReturnValue(info, hiddenValue);
        return;
    }

    v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
}

static void doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterForMainWorld(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityUnforgeableVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(info.Holder());
    impl->doNotCheckSecurityUnforgeableVoidMethod();
}

static void doNotCheckSecurityUnforgeableVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodMethod(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
{
    static int domTemplateKey; // This address is used for a key to look up the dom template.
    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
    v8::Local<v8::FunctionTemplate> domTemplate = data->domTemplate(&domTemplateKey, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodMethodCallback, v8Undefined(), v8::Signature::New(info.GetIsolate(), V8TestInterfaceCheckSecurity::domTemplate(info.GetIsolate())), 0);

    // It is unsafe to use info.Holder() because OriginSafeMethodGetter is called
    // back without checking the type of info.Holder().
    v8::Local<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceInPrototypeChain(info.This(), info.GetIsolate());
    if (holder.IsEmpty()) {
        v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
        return;
    }
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
    if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->frame(), DoNotReportSecurityError)) {
        v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
        return;
    }

    v8::Local<v8::Value> hiddenValue = v8::Local<v8::Object>::Cast(info.This())->GetHiddenValue(v8AtomicString(info.GetIsolate(), "doNotCheckSecurityUnforgeableVoidMethod"));
    if (!hiddenValue.IsEmpty()) {
        v8SetReturnValue(info, hiddenValue);
        return;
    }

    v8SetReturnValue(info, domTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
}

static void doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter");
    TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetter(info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

static void TestInterfaceCheckSecurityOriginSafeMethodSetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
    v8::Local<v8::Object> holder = V8TestInterfaceCheckSecurity::findInstanceInPrototypeChain(info.This(), info.GetIsolate());
    if (holder.IsEmpty())
        return;
    TestInterfaceCheckSecurity* impl = V8TestInterfaceCheckSecurity::toImpl(holder);
    v8::String::Utf8Value attributeName(name);
    ExceptionState exceptionState(ExceptionState::SetterContext, *attributeName, "TestInterfaceCheckSecurity", info.Holder(), info.GetIsolate());
    if (!BindingSecurity::shouldAllowAccessToFrame(info.GetIsolate(), impl->frame(), exceptionState)) {
        exceptionState.throwIfNeeded();
        return;
    }

    V8HiddenValue::setHiddenValue(info.GetIsolate(), v8::Local<v8::Object>::Cast(info.This()), name.As<v8::String>(), v8Value);
}

static void TestInterfaceCheckSecurityOriginSafeMethodSetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
{
    TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter");
    TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetter(name, v8Value, info);
    TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}

} // namespace TestInterfaceCheckSecurityV8Internal

static const V8DOMConfiguration::AccessorConfiguration V8TestInterfaceCheckSecurityAccessors[] = {
    {"readonlyLongAttribute", TestInterfaceCheckSecurityV8Internal::readonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
    {"longAttribute", TestInterfaceCheckSecurityV8Internal::longAttributeAttributeGetterCallback, TestInterfaceCheckSecurityV8Internal::longAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
    {"doNotCheckSecurityLongAttribute", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeGetterCallback, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityLongAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
    {"doNotCheckSecurityReadonlyLongAttribute", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReadonlyLongAttributeAttributeGetterCallback, 0, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
    {"doNotCheckSecurityOnSetterLongAttribute", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeGetterCallback, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityOnSetterLongAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
    {"doNotCheckSecurityReplaceableReadonlyLongAttribute", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeGetterCallback, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityReplaceableReadonlyLongAttributeAttributeSetterCallback, 0, 0, 0, v8::DEFAULT, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
};

static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceCheckSecurityMethods[] = {
    {"voidMethod", TestInterfaceCheckSecurityV8Internal::voidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
};

static void installV8TestInterfaceCheckSecurityTemplate(v8::Local<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
{
    functionTemplate->ReadOnlyPrototype();

    v8::Local<v8::Signature> defaultSignature;
    defaultSignature = V8DOMConfiguration::installDOMClassTemplate(isolate, functionTemplate, "TestInterfaceCheckSecurity", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceCheckSecurity::internalFieldCount,
        0, 0,
        V8TestInterfaceCheckSecurityAccessors, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityAccessors),
        V8TestInterfaceCheckSecurityMethods, WTF_ARRAY_LENGTH(V8TestInterfaceCheckSecurityMethods));
    v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceTemplate();
    ALLOW_UNUSED_LOCAL(instanceTemplate);
    v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->PrototypeTemplate();
    ALLOW_UNUSED_LOCAL(prototypeTemplate);
    instanceTemplate->SetAccessCheckCallbacks(TestInterfaceCheckSecurityV8Internal::namedSecurityCheck, TestInterfaceCheckSecurityV8Internal::indexedSecurityCheck, v8::External::New(isolate, const_cast<WrapperTypeInfo*>(&V8TestInterfaceCheckSecurity::wrapperTypeInfo)));
    static const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityVoidMethodOriginSafeAttributeConfiguration = {
        "doNotCheckSecurityVoidMethod", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, 0, 0, &V8TestInterfaceCheckSecurity::wrapperTypeInfo, v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance,
    };
    V8DOMConfiguration::installAttribute(isolate, prototypeTemplate, v8::Local<v8::ObjectTemplate>(), doNotCheckSecurityVoidMethodOriginSafeAttributeConfiguration);
    static const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeAttributeConfiguration = {
        "doNotCheckSecurityDoNotCheckSignatureVoidMethod", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, 0, 0, &V8TestInterfaceCheckSecurity::wrapperTypeInfo, v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance,
    };
    V8DOMConfiguration::installAttribute(isolate, prototypeTemplate, v8::Local<v8::ObjectTemplate>(), doNotCheckSecurityDoNotCheckSignatureVoidMethodOriginSafeAttributeConfiguration);
    static const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeAttributeConfiguration = {
        "doNotCheckSecurityPerWorldBindingsVoidMethod", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallback, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallback, TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeMethodGetterCallbackForMainWorld, TestInterfaceCheckSecurityV8Internal::TestInterfaceCheckSecurityOriginSafeMethodSetterCallbackForMainWorld, &V8TestInterfaceCheckSecurity::wrapperTypeInfo, v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance,
    };
    V8DOMConfiguration::installAttribute(isolate, prototypeTemplate, v8::Local<v8::ObjectTemplate>(), doNotCheckSecurityPerWorldBindingsVoidMethodOriginSafeAttributeConfiguration);
    static const V8DOMConfiguration::AttributeConfiguration doNotCheckSecurityUnforgeableVoidMethodOriginSafeAttributeConfiguration = {
        "doNotCheckSecurityUnforgeableVoidMethod", TestInterfaceCheckSecurityV8Internal::doNotCheckSecurityUnforgeableVoidMethodOriginSafeMethodGetterCallback, 0, 0, 0, &V8TestInterfaceCheckSecurity::wrapperTypeInfo, v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly), V8DOMConfiguration::ExposedToAllScripts, V8DOMConfiguration::OnInstance,
    };
    V8DOMConfiguration::installAttribute(isolate, instanceTemplate, v8::Local<v8::ObjectTemplate>(), doNotCheckSecurityUnforgeableVoidMethodOriginSafeAttributeConfiguration);

    // Custom toString template
    functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
}

v8::Local<v8::FunctionTemplate> V8TestInterfaceCheckSecurity::domTemplate(v8::Isolate* isolate)
{
    return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestInterfaceCheckSecurityTemplate);
}

bool V8TestInterfaceCheckSecurity::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
{
    return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
}

v8::Local<v8::Object> V8TestInterfaceCheckSecurity::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate)
{
    return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
}

TestInterfaceCheckSecurity* V8TestInterfaceCheckSecurity::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value)
{
    return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value)) : 0;
}

void V8TestInterfaceCheckSecurity::refObject(ScriptWrappable* scriptWrappable)
{
    scriptWrappable->toImpl<TestInterfaceCheckSecurity>()->ref();
}

void V8TestInterfaceCheckSecurity::derefObject(ScriptWrappable* scriptWrappable)
{
    scriptWrappable->toImpl<TestInterfaceCheckSecurity>()->deref();
}

} // namespace blink


text:
function testPlotData(src,event)

plot(event.TimeStamps, event.Data(:,1))
 end

redpajama_set_name: RedPajamaGithub


text:
package selenium.mtg.pucatrade;

import org.junit.Test;
import selenium.framework.NavigationConstant;
import selenium.framework.WebDriverTest;
import selenium.mtg.pucatrade.pages.PucaTradeSearchPage;

public class PucaTradeTest extends WebDriverTest {

    @Test
    public void searchByCardName() {
        browseTo(NavigationConstant.MTG_PUCATRADE_SEARCH_PAGE);
        new PucaTradeSearchPage()
            .assertPageTitle("MTG Card Search | PucaTrade - Trade Magic: The Gathering Cards Online")
            .enterSearchTerm("elf")
            .assertResult(1, "Segovian Leviathan")
            ;
    }
}


text:
The vLineRails Example shows you how to create a Rails app that can be used with the low-level vLine API and also
used to launch the vLine Web Client that uses the users you provide.

## Before you begin

1. Sign up for a [vLine developer account] (https://vline.com/developer/).
1. Sign up for [Forward](https://forwardhq.com/) and install the gem: `gem install forward`.
1. Install ruby version 1.9.3 or newer.
1. Clone this repository.
1. Optional: [Install rvm](https://rvm.io/rvm/install/).

## Create your vLine Service

Create a service in the [vLine Developer Console](https://vline.com/developer/).

## Create your Rails app (Rails 3.x)

1. Change into the directory where you cloned this repository.

1. Install all dependencies:

        bundle install

1. Create an app directory and change into it:

        mkdir ../vline
        cd ../vline

    The following instructions walk you through creating the Rails app from scratch. If you'd rather use the
pre-generated one, you can skip to the [Configure your app](#configure-your-app) step. Make sure you have configured the values in `config/initializers/vline.rb`.

1. Create the new app:

        rails new vline-demo-app -m https://raw.github.com/RailsApps/rails-composer/f9d885977ad345dd90f07e6dcdac17407cf9b3a7/composer.rb -T

1. You will get several prompts. Choose the following:
    * `4) rails-3-bootstrap-devise-cancan`
    * `1) WEBrick (default)`
    * `1) Same as development`
    * `1) ERB`
    * `1) None`
    * `Set a robots.txt file to ban spiders:`: You choose
    * `Create a GitHub repository?`: You choose
    * `Use or create a project-specific rvm gemset?`: y

1. At the end of the setup, you should see `Your bundle is complete!`. If you get any error messages during this process, take a look at [this page](http://railsapps.github.com/rails-error-you-have-already-activated.html).

1. Change into the app directory:

        cd vline-demo-app

1. The email and password for the admin account is in `config/application.yml`. It is probably `user@example.com` and `changeme`.

1. Create some extra users by adding the following to the `db/seeds.rb` file:

        for i in 2..5
            user = User.find_or_create_by_email :name => "User #{i}", :email => "user#{i}@example.com", :password => 'changeme', :password_confirmation => 'changeme'
            puts 'user: ' << user.name
            user.add_role :user
        end

### Install vLineRails Plugin in your application

1. Add `gem "vline-rails"` to your `Gemfile` and run `bundle install` to install it.

1. Find your service in the [vLine Developer console](https://vline.com/developer/) and make note of the `Service ID` and `API Secret`.

1. Use the values from the last step to generate the vLine provider by running the following command:

        rails generate vline_provider --service-id=Your-Service-Id --provider-secret=Your-Service-API-Secret

    Make note of the `Client ID` and `Client Secret` output by the command.

1. Check your `config.ru` file and verify that it has:

        require 'rack/jsonp'
        use Rack::JSONP

### Add presence to your Rails app

1. At the top of `app/views/home/index.html.erb`, add the following, which includes vline.js:

        <% content_for :head do %>

        <% end %>

1. In the same file, replace:

User: <%=link_to user.name, user %>

    with

              User: <%= user.name %>,
              Presence: <span id="<%= user.id %>">offline,
              <%= vline_launch "Launch Web Client", user %>
              <span id="call-<%= user.id %>" style="display:none">
                , <a onclick="call('<%= user.id %>')" href="javascript:void(0)">Call

1. In the same file, add the following JavaScript at the bottom of the file:

1. In the home controller (`app/controllers/home_controller.rb`), force the user to login to see the page with:

        before_filter :authenticate_user!

    at the beginning of the class (`class HomeController < ApplicationController`)

    Also, add:

        require 'vline'

    to the top of the file.

## Configure your app

1. Make sure all dependencies are installed:

        bundle install

1. Prepare the database:

        rake db:migrate
        rake db:seed

1. Generate a secret token:

        rake secret

1. Add the generated token to `config/initializers/secret_token.rb`.

1. Start [Forward](https://forwardhq.com/) by running the following command in your app directory:

        forward 3000

    Make a note of the URL that it prints so that you can use it in the next steps.

1. Open up the [vLine Developer Console](https://vline.com/developer/) and choose `Service Settings`.

1. Click the `Edit` button and select `Custom OAuth` in the `Authorization` dropdown:
    * Add the `Client ID` and `Client Secret` from the `rails generate` command you previously ran.
    * Set the `Provider URL` to : `https://your-forward-url/_vline/api/v1/`
    * Set the `OAuth URL` to: `https://your-forward-url/_vline/api/v1/oauth/`

1. Further customization of the Web Client can be done by providing custom images in the `Web Client Settings`.

## Run your app

1. Run the rails server in your app directory (make sure Forward is still running):

        rails server

1. Go to [http://localhost:3000](http://localhost:3000) in your browser.
1. Log in as `user@example.com`.
1. Open up a Chrome incognito window.
1. Log in as `user2@example.com`.
1. You should see both "First User" and "User 2" online.
1. Click `Launch Web Client` to launch the Web Client for a specific user.
1. A `Call` link will show up next to online users and will initiate a call directly from the page.


text:
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
	<meta name="description" content="Donna Almendrala is a freelance cartoonist and designer. Check out her gallery of comics and illustraiton, online store, blog, and contact information." />
	<link href="stylesheets/styles.css" media="all" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="stylesheets/jquery.fancybox.css?v=2.0.4" type="text/css" media="screen" />
	<link rel="stylesheet" href="stylesheets/jquery.fancybox-buttons.css?v=2.0.4" type="text/css" media="screen" />
	<link rel="stylesheet" href="stylesheets/jquery.fancybox-thumbs.css?v=2.0.4" type="text/css" media="screen" />


text:
define(function(require) {
	'use strict';

	var Backbone = require('backbone');
	var L = require('leaflet');
	var _ = require('underscore');
	var HoleView = require('views/objects/hole');

	return HoleView.extend({
		hintText: function(params) {
			return 'Регион «' + params.data.caption + '»';
		},

		markerIcon: L.icon({
			iconUrl: '/img/objects/locationhole.svg',
			iconSize: [100, 100],
			iconAnchor: [14, 14]
		})
	});

});


text:
package sage.jep.function;

import sage.jep.*;

public class Subtract extends PostfixMathCommand
{
  public Subtract()
  {
    numberOfParameters = 2;
  }

  public void run(sage.Catbert.FastStack inStack)
      throws ParseException {

    Object param2 = inStack.pop();
    Object param1 = inStack.pop();

    inStack.push(sub(param1, param2));

    return;
  }

  public Object sub(Object param1, Object param2)
      throws ParseException {

    if (!(param1 instanceof Number))
    {
      try{
        param1 = new Long(param1.toString());
      }
      catch (Exception x)
      {
        try{
          param1 = new Double(param1.toString());
        }catch (Exception e){ throw new ParseException("Invalid parameter type"); }
      }
    }
    if (!(param2 instanceof Number))
    {
      try{
        param2 = new Long(param2.toString());
      }
      catch (Exception x)
      {
        try{
          param2 = new Double(param2.toString());
        }catch (Exception e){ throw new ParseException("Invalid parameter type"); }
      }
    }
    if (param1 instanceof Number && param2 instanceof Number)
    {
      Number n1 = (Number) param1;
      Number n2 = (Number) param2;
      if (param1 instanceof Double || param2 instanceof Double)
        return new Double(n1.doubleValue() - n2.doubleValue());
      else if (param1 instanceof Float || param2 instanceof Float)
        return new Float(n1.floatValue() - n2.floatValue());
      else if (param1 instanceof Long || param2 instanceof Long)
        return new Long(n1.longValue() - n2.longValue());
      else //if (param1 instanceof Integer && param2 instanceof Integer)
        return new Integer(n1.intValue() - n2.intValue());
    }

    throw new ParseException("Invalid parameter type");
  }

}


text:
export interface EstimatedPickup {
  /**
   * The local order time of the package.
   */
  order_time?: string;

  /**
   * Order cut off time. AfterShip will set 18:00:00 as the default value.
   */
  order_cutoff_time?: string;

  /**
   * Operating days in a week. Number refers to the weekday.
   * E.g., [1,2,3,4,5] means operating days are from Monday to Friday.
   * AfterShip will set [1,2,3,4,5] as the default value.
   */
  business_days?: number[];

  order_processing_time?: OrderProcessingTime;

  /**
   * The local pickup time of the package.
   */
  pickup_time?: string;
}

export interface OrderProcessingTime {
  /**
   * Processing time of an order, from being placed to being picked up.
   * Only support day as value now. AfterShip will set day as the default value.
   */
  unit?: string;

  /**
   * Processing time of an order, from being placed to being picked up.
   * AfterShip will set 0 as the default value.
   */
  value?: number;
}


text:
var fse = require('fs-extra');
var colors = require('colors');

function logError(message) {
    console.log(message.red);
}

module.exports = function(options) {
    const name = 'rollup-plugin-copy';
    options = options || {};

    return {
        name: name,
        ongenerate: function(object) {

            for (key in options) {
                const src = key;
                const dst = options[key];

                fse.copy(src, dst)
                .catch( (err) => {
                    logError(name + ' (' + src + ' -> ' + dst + ') ' + err.no + ' ' + err);
                });
            }

        }
    }
};


text:
chrome.app.runtime.onLaunched.addListener(function() {
  chrome.app.window.create('index.html',
    {
      "id": "mainWindow",
      "resizable": false,
      "innerBounds": { "width": 360, "height": 540 }
    });
});


text:
'use strict';

const R = require('ramda');

const compose = R.compose;

function IO(wrapper) {
  const unsafePerformIO = wrapper;

  return {
    map: function(f) {
      return IO(compose(f, unsafePerformIO));
    },
    unsafePerformIO: unsafePerformIO
  };
}

module.exports = IO;


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text.RegularExpressions;
using System.ComponentModel;

namespace DotNetProgrammersToolbox.RegexPatterns
{
    [DataObject]
    [Serializable]
    public class RegexOptionData
    {
        private RegexOptionItem[] _items = null;

        [DataObjectMethod(DataObjectMethodType.Select)]
        public RegexOptionItem[] GetData()
        {
            if (this._items == null)
                this._items = Enum.GetValues(typeof(RegexOptions)).OfType<RegexOptions>()
                    .Where(o => o != RegexOptions.None).Select(o => new RegexOptionItem(o)).ToArray();

            return this._items;
        }
    }
}


text:
/* Based on CSS found at http://wiki.mobileread.com/wiki/CSS_template */

/* Page Margin */
@page {
     margin-top:30px;
     margin-bottom:20px;
}

body {
     margin-right:30px;
     margin-left:30px;
     padding:0;
} /* Pixels are used for @page and body (for the ereaders that will recognize
 them) because pixels don't scale and if a reader increases the text size, we
 don't want the margins to blow up. Note that these values will produce
 extra-wide margins on the Kindle Fire, because the view for that ereader is
 narrow already. */

/* Images */
img {
     max-width:100%;
     oeb-column-number:1;
     display:inline-block;
}
.video {
     max-width:100%;
}
.noresize {
    width:auto;
    display:block;
}
div.figure {
     text-align:center;
     text-indent:0;
     margin-top:1em;
}
div.caption {
     font-family:Verdana, Geneva, sans-serif;
     font-size:small;
     text-align:center;
     text-indent:0;
     margin:1em 0;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
}
span.captioncredit {
     font-family:Verdana, Geneva, sans-serif;
     font-size:x-small;
     text-align:center;
     text-indent:0;
     margin:0;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
}
.centered-art {
     font-style:normal;
     font-weight:normal;
     text-align:center;
     margin:1em 0;
     text-indent:0;
}

/* Links */
a {
     font-style:italic;
     color:blue;
     text-decoration:none;
}

/* Spans */
span.emphasis {
     font-weight:normal;
     font-style:italic;
} /* Note that it is more semantic to use Text */

span.strong {
     font-weight:bold;
     font-style:normal;
} /* Note that it is more semantic to use Text */

span.strongemphasis {
     font-weight:bold;
     font-style:italic;
} /* Note that it is more semantic to use Text */

span.applebug {} /* Used to cure an Apple bug regarding centered text, might not be needed anymore */

/* Cover Page */
img.cover-image {
	max-width:100%;
	max-height:100%;
	display:block;
}

/* Title Page */
.header .titlepage {} /* head group for title page */

h1.title {
     font-family:Verdana, Geneva, sans-serif;
     font-size:x-large;
     text-align:center;
     font-weight:bold;
     color:[insert];
     margin-top:2em;
     text-indent:0;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
}

h1.sub {
     font-family:Verdana, Geneva, sans-serif;
     font-size:medium;
     text-align:center;
     font-weight:bold;
     font-style:italic;
     margin-top:1em;
     text-indent:0;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
}

h1.author {
     font-family:Verdana, Geneva, sans-serif;
     text-align:center;
     margin-top:4em;
     text-indent:0;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
}

/* Colophon */
p.colophon1 {
     font-family:Verdana, Geneva, sans-serif;
     font-size:small;
     text-align:center;
     margin-top:4em;
     text-indent:0;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
}

p.colophon2 {
     font-family:Verdana, Geneva, sans-serif;
     font-size:x-small;
     margin:0;
     text-indent:0;
     text-align:center;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
}

/* Table of Contents */
p.contents1 {
     text-align:center;
     margin-top:1em;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
}

p.contents2 {
     text-align:center;
     margin-top:.5em;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
}

/* Copyright Page */
p.copyright1 {
     font-size:x-small;
     margin-top:1em;
     text-align:center;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
}

p.copyright2 {
     font-size:x-small;
     margin:0;
     text-align:center;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
}

/* Market Copy */
p.marketingcopy {
     font-family:Verdana, Geneva, sans-serif;
     font-size:large;
     text-align:center;
     margin-left:2em;
}

/* Headings */
/* Base */
h1, h2, h3, h4, h5, h6 {
     page-break-after:avoid;
     -webkit-hyphenate-lines: 0 !important;
     -webkit-hyphens: none !important;
     adobe-hyphenate: none !important;
     -moz-hyphens: none !important;
     hyphens: none !important;
     hyphenate-lines: 0;
     color:#000; /*This color "black" will apply to all heads unless a color is applied to a class */
}

/* Parts or Chapters */
.header .chapter {} /* head group for chapter titles */

h2.num {
     font-family:Verdana, Geneva, sans-serif;
     text-align:left;
     text-indent:0;
     margin-top:4em;
}
h2.title {
     font-family:Verdana, Geneva, sans-serif;
     text-align:left;
     margin-bottom:2em;
     text-indent:0;
}
h2.titlecenter {
     font-family:Verdana, Geneva, sans-serif;
     text-align:center;
     margin-bottom:2em;
     text-indent:0;
}
h3.num {
     font-family:Verdana, Geneva, sans-serif;
     text-align:left;
     text-indent:0;
     margin-top:4em;
}
h3.title {
     font-family:Verdana, Geneva, sans-serif;
     text-align:left;
     margin-bottom:2em;
     text-indent:0;
}
h3.titlecenter {
     font-family:Verdana, Geneva, sans-serif;
     text-align:center;
     margin-bottom:2em;
     text-indent:0;
}

/* Text Headings */
/* Level 1 text head */
h4 {
     font-family:Verdana, Geneva, sans-serif;
     text-align:left;
     margin:1em 0 0 0;
     text-indent:2em;
}
/* Level 2 text head */
h5 {
     font-family:serif;
     text-align:left;
     font-weight:bold;
     font-style:italic;
     margin:1em 0 0 0;
     text-indent:2em;
}
/* Level 3 text head */
h6 {
     font-family:serif;
     text-align:left;
     font-weight:bold;
     font-style:italic;
     margin:1em 0 0 0;
     text-indent:2em;
}

/* Normal Text */
p {
     line-height:1.5em;
     text-align:justify;
     widows:2;
     orphans:2;
     margin:0;
     text-indent:0; /* This .Mobi7 hack is needed because that format automatically applies paragraph indents on all p classes */
     -webkit-hyphenate-before:3; /* These webit hyphenations settings will work for iBooks */
     hyphenate-before:3; /* These hyphenation settings are future-proofing for ereaders that might honor these values in the future */
     -webkit-hyphenate-after:3;
     hyphenate-after:3;
     -webkit-hyphenate-lines:2;
     hyphenate-lines:2;
}

p.first { text-indent:0;} /* First Paragraph not indented */

h2+p {text-indent:0;} /* alternate method, first paragraph after h2 will not intent */

p.first:first-letter, span.drop-cap {
	vertical-align:base-line;
	font-size:2em;
	line-height:1em;
	margin-right:.05em;
	font-weight :700;
} /* Initial Drop Cap in first paragrpah */

p.ind {
     text-indent:2em;
     margin:0;
}

p.indspace {
     text-indent:2em;
     margin-top:1em;
}

p.noind {

}

/* Page Break Woes */
div.keeptext {
     page-break-inside:avoid;
     margin:0 !important;
}

/* Centered */
p.center {
     text-align:center;
     text-indent:0;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
     margin:0;
}

/* Extract */
p.extractnormal {
     margin:1em 0 0 1em;
     text-indent:0;
     text-align:left;
}

p.extractcourier {
     font-family:"Courier New", Courier, monospace;
     text-indent:0;
     margin:1em 0 0 1em;
     text-align:left;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
}

p.handwriting {
     font-family:"BradleyHandITCTT-Bold", "Comic Sans MS", cursive;
     text-indent:0;
     margin:1em 0 0 1em;
     line-height: 1.5;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
}

/* Lists */
p.listhead {
     margin:1em 0 0 2em;
     font-weight:bold;
     font-style:normal;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
     page-break-after:avoid;
     text-align:left;
}

ol {
     margin:1em 0 1em 0;
}
ol.nospace {
     margin:0;
}
ul {
     margin:1em 0 1em 0;
}
ul.nospace {
     margin:0;
}
li {
     line-height:1.5em;
     orphans:2;
     widows:2;
     text-align:justify;
}

/* Sidebars */
.aside .sidebar {
     margin:1em 0 !important;
     padding:1em 0 !important;
     border:1px solid #178E7D;
     page-break-inside:avoid;
     background-color:[insert];
}
.aside .casestudy {
     margin:1em 0 !important;
     padding:1em 0 !important;
     border:1px solid black;
     background-color:[insert];
     page-break-inside:avoid;
}
p.sbh1 {
     font-family:Verdana, Geneva, sans-serif;
     font-size:small;
     text-align:left;
     font-weight:bold;
     font-style:normal;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
     margin:0 1em;
     color:[insert];
}
p.sbh2 {
     font-family:Verdana, Geneva, sans-serif;
     font-size:medium;
     text-align:left;
     font-weight:bold;
     font-style:italic;
     margin:0 1em 1em 1em;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
     color:[insert];
}
p.sbh3 {
     font-family:Verdana, Geneva, sans-serif;
     font-size:small;
     text-align:left;
     font-weight:bold;
     margin:1em 1em 0 1em;
     text-indent:2em;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
}
p.sbf {
     font-family:Verdana, Geneva, sans-serif;
     font-size:small;
     margin:0 1em;
}
p.sb {
     font-family:Verdana, Geneva, sans-serif;
     font-size:small;
     margin:0 1em;
     text-indent:2em;
}
p.sbextract {
     font-family:Verdana, Geneva, sans-serif;
     font-size:small;
     margin:1em;
}
li.sbol {
     font-family:Verdana, Geneva, sans-serif;
     font-size:small;
     margin:0 1em 0 0;
}
li.sbul {
     font-family:Verdana, Geneva, sans-serif;
     font-size:small;
     margin:0 1em 0 0;
}

/* Tables */
table {
     border-collapse:collapse;
     margin:1em 0 !important;
     page-break-inside:avoid;
     width:100%
}
td {
     font-family:Verdana, Geneva, sans-serif;
     font-size:small;
     text-indent:0;
     text-align:left;
     -webkit-hyphens:none;
     -moz-hyphens:none;
     hyphens:none;
     page-break-inside:avoid;
     border-bottom:1px solid [insert color];
     vertical-align:top;
     padding:5px !important;
}
td.tt {
     font-size:medium;
     font-weight:bold;
     text-align:center;
     border-bottom-style:none;
     color:[insert];
}
td.tch1 {
     font-weight:bold;
     text-align:center;
     vertical-align:bottom;
     background-color:[insert];
     border-bottom-style:none;
}
td.tch2 {
     font-weight:bold;
     font-style:italic;
     vertical-align:bottom;
}
td.tfn {
     font-size:x-small;
     border-bottom-style:none;
}

/* Recipes */
p.recipe-title {
     font-weight:bold;
     font-size:x-large;
     line-height:normal;
     text-align:center;
     margin:1em 0 0em 0 !important;
     text-indent:0;
     -webkit-hyphenate-lines:0;
     -webkit-hyphens:none;
     hyphens:none;
     page-break-before:always;
     color:[insert];
}
p.recipe-message {
     font-style:italic;
     text-align:center;
     margin-top:.5em;
     -webkit-hyphenate-lines:0;
     -webkit-hyphens:none;
     hyphens:none;
}
p.recipe-yield {
     font-weight:bold;
     text-align:center;
     margin-top:1em;
}
p.recipe-ing-head {
     font-weight:bold;
     text-align:center;
     margin-top:1.5em;
}
p.recipe-ingredients {
     text-align:center;
     -webkit-hyphenate-lines:0;
     -webkit-hyphens:none;
     hyphens:none;
     -webkit-hyphenate-lines:0;
     -webkit-hyphens:none;
     hyphens:none;
}
p.recipe-instructions {
     margin-top:1em;
     text-align:center;
}
ol.recipe {
     font-weight:bold;
     color:[insert];
     margin-top:1em;
}
/* this makes the recipe step number bold and a color for a little zip */
ol p.recipestep {
     line-height:1.5em;
     text-align:justify;
     widows:2;
     orphans:2;
     -webkit-hyphenate-before:3;
     hyphenate-before:3;
     -webkit-hyphenate-after:3;
     hyphenate-after:3;
     -webkit-hyphenate-lines:2;
     hyphenate-lines:2;
     color:[insert];
     margin-top:.5em;
}
div.recipesidebarbox {
     background-color:[insert];
     margin:0 0 2em 0 !important;
     padding:.5em !important;
     page-break-inside:avoid;
}
p.recipesidebarhead {
     font-family:Verdana, Geneva, sans-serif;
     font-weight:bold;
     font-size:small;
     margin:0 !important;
     text-align:left;
     -webkit-hyphenate-lines:0;
     -webkit-hyphens:none;
     hyphens:none;
     page-break-after:avoid;
}
p.recipesidebar {
     font-family:Verdana, Geneva, sans-serif;
     font-size:small;
}

/* Tables */
table.recipe {
     width:100%;
     margin:2em 0 0 0;
     page-break-inside:avoid;
}
th.recipe {
     font-family:Verdana, Geneva, sans-serif;
     font-size:x-small;
     line-height:normal;
     margin:0 !important;
     padding:.5em !important;
     text-align:left;
     font-weight:bold;
     -webkit-hyphenate-lines:0;
     -webkit-hyphens:none;
     hyphens:none;
     page-break-after:avoid;
     background-color:[insert];
}
td.recipestat {
     font-family:Verdana, Geneva, sans-serif;
     font-size:x-small;
     line-height:normal;
     margin:0;
     padding:.5em .5em 0 .5em !important;
     text-align:left;
     -webkit-hyphenate-lines:0;
     -webkit-hyphens:none;
     hyphens:none;
     width:auto;
}


text:
import gravity from "lib/loaders/legacy/gravity"
import Partner from "./partner"
import Artist from "./artist/index"
import numeral from "./fields/numeral"
import { IDFields } from "./object_identification"
import { GraphQLString, GraphQLObjectType, GraphQLNonNull, GraphQLBoolean } from "graphql"
import { connectionDefinitions, connectionFromArraySlice } from "graphql-relay"
import { getPagingParameters } from "relay-cursor-paging"
import { assign } from "lodash"

const counts = {
  type: new GraphQLObjectType({
    name: "PartnerArtistCounts",
    fields: {
      artworks: numeral(({ published_artworks_count }) => published_artworks_count),
      for_sale_artworks: numeral(({ published_for_sale_artworks_count }) => published_for_sale_artworks_count),
    },
  }),
  resolve: partner_artist => partner_artist,
}

const fields = () => {
  return {
    ...IDFields,
    artist: {
      type: Artist.type,
    },
    biography: {
      type: GraphQLString,
    },
    counts,
    is_display_on_partner_profile: {
      type: GraphQLBoolean,
      resolve: ({ display_on_partner_profile }) => display_on_partner_profile,
    },
    is_represented_by: {
      type: GraphQLBoolean,
      resolve: ({ represented_by }) => represented_by,
    },
    is_use_default_biography: {
      type: GraphQLBoolean,
    },
    partner: {
      type: Partner.type,
    },
    sortable_id: {
      type: GraphQLString,
    },
  }
}

export const PartnerArtistType = new GraphQLObjectType({
  name: "PartnerArtist",
  fields,
})

const PartnerArtist = {
  type: PartnerArtistType,
  description: "A PartnerArtist",
  args: {
    artist_id: {
      type: new GraphQLNonNull(GraphQLString),
      description: "The slug or ID of the Artist",
    },
    partner_id: {
      type: new GraphQLNonNull(GraphQLString),
      description: "The slug or ID of the Partner",
    },
  },
  resolve: (root, { partner_id, artist_id }) => gravity(`partner/${partner_id}/artist/${artist_id}`),
}

export default PartnerArtist

// The below can be used as the connection from an artist to its partners.
// The edge is the PartnerArtist relationship, with the node being the partner.
export const PartnerArtistConnection = connectionDefinitions({
  name: "PartnerArtist",
  edgeType: PartnerArtistType,
  nodeType: Partner.type,
  edgeFields: fields,
}).connectionType

export const partnersForArtist = (artist_id, options, loader) => {
  // Convert `after` cursors to page params
  const { limit: size, offset } = getPagingParameters(options)
  // Construct an object of all the params gravity will listen to
  const { represented_by, partner_category } = options
  const gravityArgs = { total_count: true, size, offset, artist_id, represented_by, partner_category }

  return loader(gravityArgs).then(({ body, headers }) => {
    const connection = connectionFromArraySlice(body, options, {
      arrayLength: headers["x-total-count"],
      sliceStart: offset,
    })

    // Inject the partner artist data into edges, and set the partner as the node.
    let newEdges = []
    connection.edges.forEach(edge => {
      const newEdge = assign(
        {
          ...edge.node,
        },
        {},
        edge
      )
      newEdge.node = edge.node.partner
      newEdges = newEdges.concat(newEdge)
    })
    connection.edges = newEdges

    return connection
  })
}


text:
#include "config.h"
#include "core/rendering/shapes/PolygonShape.h"

#include "core/platform/graphics/LayoutPoint.h"
#include "wtf/MathExtras.h"

namespace WebCore {

enum EdgeIntersectionType {
    Normal,
    VertexMinY,
    VertexMaxY,
    VertexYBoth
};

struct EdgeIntersection {
    const FloatPolygonEdge* edge;
    FloatPoint point;
    EdgeIntersectionType type;
};

static inline float leftSide(const FloatPoint& vertex1, const FloatPoint& vertex2, const FloatPoint& point)
{
    return ((point.x() - vertex1.x()) * (vertex2.y() - vertex1.y())) - ((vertex2.x() - vertex1.x()) * (point.y() - vertex1.y()));
}

static inline bool isReflexVertex(const FloatPoint& prevVertex, const FloatPoint& vertex, const FloatPoint& nextVertex)
{
    return leftSide(prevVertex, nextVertex, vertex) < 0;
}

static bool computeXIntersection(const FloatPolygonEdge* edgePointer, float y, EdgeIntersection& result)
{
    const FloatPolygonEdge& edge = *edgePointer;

    if (edge.minY() > y || edge.maxY() < y)
        return false;

    const FloatPoint& vertex1 = edge.vertex1();
    const FloatPoint& vertex2 = edge.vertex2();
    float dy = vertex2.y() - vertex1.y();

    float intersectionX;
    EdgeIntersectionType intersectionType;

    if (!dy) {
        intersectionType = VertexYBoth;
        intersectionX = edge.minX();
    } else if (y == edge.minY()) {
        intersectionType = VertexMinY;
        intersectionX = (vertex1.y() < vertex2.y()) ? vertex1.x() : vertex2.x();
    } else if (y == edge.maxY()) {
        intersectionType = VertexMaxY;
        intersectionX = (vertex1.y() > vertex2.y()) ? vertex1.x() : vertex2.x();
    } else {
        intersectionType = Normal;
        intersectionX = ((y - vertex1.y()) * (vertex2.x() - vertex1.x()) / dy) + vertex1.x();
    }

    result.edge = edgePointer;
    result.type = intersectionType;
    result.point.set(intersectionX, y);

    return true;
}

static inline FloatSize inwardEdgeNormal(const FloatPolygonEdge& edge)
{
    FloatSize edgeDelta = edge.vertex2() - edge.vertex1();
    if (!edgeDelta.width())
        return FloatSize((edgeDelta.height() > 0 ? -1 : 1), 0);
    if (!edgeDelta.height())
        return FloatSize(0, (edgeDelta.width() > 0 ? 1 : -1));
    float edgeLength = edgeDelta.diagonalLength();
    return FloatSize(-edgeDelta.height() / edgeLength, edgeDelta.width() / edgeLength);
}

static inline FloatSize outwardEdgeNormal(const FloatPolygonEdge& edge)
{
    return -inwardEdgeNormal(edge);
}

static inline void appendArc(Vector<FloatPoint>& vertices, const FloatPoint& arcCenter, float arcRadius, const FloatPoint& startArcVertex, const FloatPoint& endArcVertex, bool padding)
{
    float startAngle = atan2(startArcVertex.y() - arcCenter.y(), startArcVertex.x() - arcCenter.x());
    float endAngle = atan2(endArcVertex.y() - arcCenter.y(), endArcVertex.x() - arcCenter.x());
    const float twoPI = piFloat * 2;
    if (startAngle < 0)
        startAngle += twoPI;
    if (endAngle < 0)
        endAngle += twoPI;
    float angle = (startAngle > endAngle) ? (startAngle - endAngle) : (startAngle + twoPI - endAngle);
    const float arcSegmentCount = 6; // An even number so that one arc vertex will be eactly arcRadius from arcCenter.
    float arcSegmentAngle =  ((padding) ? -angle : twoPI - angle) / arcSegmentCount;

    vertices.append(startArcVertex);
    for (unsigned i = 1; i < arcSegmentCount; ++i) {
        float angle = startAngle + arcSegmentAngle * i;
        vertices.append(arcCenter + FloatPoint(cos(angle) * arcRadius, sin(angle) * arcRadius));
    }
    vertices.append(endArcVertex);
}

static inline void snapVerticesToLayoutUnitGrid(Vector<FloatPoint>& vertices)
{
    for (unsigned i = 0; i < vertices.size(); ++i)
        vertices[i] = flooredLayoutPoint(vertices[i]);
}

static inline PassOwnPtr<FloatPolygon> computeShapePaddingBounds(const FloatPolygon& polygon, float padding, WindRule fillRule)
{
    OwnPtr<Vector<FloatPoint> > paddedVertices = adoptPtr(new Vector<FloatPoint>());
    FloatPoint intersection;

    for (unsigned i = 0; i < polygon.numberOfEdges(); ++i) {
        const FloatPolygonEdge& thisEdge = polygon.edgeAt(i);
        const FloatPolygonEdge& prevEdge = thisEdge.previousEdge();
        OffsetPolygonEdge thisOffsetEdge(thisEdge, inwardEdgeNormal(thisEdge) * padding);
        OffsetPolygonEdge prevOffsetEdge(prevEdge, inwardEdgeNormal(prevEdge) * padding);

        if (prevOffsetEdge.intersection(thisOffsetEdge, intersection))
            paddedVertices->append(intersection);
        else if (isReflexVertex(prevEdge.vertex1(), thisEdge.vertex1(), thisEdge.vertex2()))
            appendArc(*paddedVertices, thisEdge.vertex1(), padding, prevOffsetEdge.vertex2(), thisOffsetEdge.vertex1(), true);
    }

    snapVerticesToLayoutUnitGrid(*paddedVertices);
    return adoptPtr(new FloatPolygon(paddedVertices.release(), fillRule));
}

static inline PassOwnPtr<FloatPolygon> computeShapeMarginBounds(const FloatPolygon& polygon, float margin, WindRule fillRule)
{
    OwnPtr<Vector<FloatPoint> > marginVertices = adoptPtr(new Vector<FloatPoint>());
    FloatPoint intersection;

    for (unsigned i = 0; i < polygon.numberOfEdges(); ++i) {
        const FloatPolygonEdge& thisEdge = polygon.edgeAt(i);
        const FloatPolygonEdge& prevEdge = thisEdge.previousEdge();
        OffsetPolygonEdge thisOffsetEdge(thisEdge, outwardEdgeNormal(thisEdge) * margin);
        OffsetPolygonEdge prevOffsetEdge(prevEdge, outwardEdgeNormal(prevEdge) * margin);

        if (prevOffsetEdge.intersection(thisOffsetEdge, intersection))
            marginVertices->append(intersection);
        else
            appendArc(*marginVertices, thisEdge.vertex1(), margin, prevOffsetEdge.vertex2(), thisOffsetEdge.vertex1(), false);
    }

    snapVerticesToLayoutUnitGrid(*marginVertices);
    return adoptPtr(new FloatPolygon(marginVertices.release(), fillRule));
}

const FloatPolygon& PolygonShape::shapePaddingBounds() const
{
    ASSERT(shapePadding() >= 0);
    if (!shapePadding())
        return m_polygon;

    if (!m_paddingBounds)
        m_paddingBounds = computeShapePaddingBounds(m_polygon, shapePadding(), m_polygon.fillRule());

    return *m_paddingBounds;
}

const FloatPolygon& PolygonShape::shapeMarginBounds() const
{
    ASSERT(shapeMargin() >= 0);
    if (!shapeMargin())
        return m_polygon;

    if (!m_marginBounds)
        m_marginBounds = computeShapeMarginBounds(m_polygon, shapeMargin(), m_polygon.fillRule());

    return *m_marginBounds;
}

static inline bool getVertexIntersectionVertices(const EdgeIntersection& intersection, FloatPoint& prevVertex, FloatPoint& thisVertex, FloatPoint& nextVertex)
{
    if (intersection.type != VertexMinY && intersection.type != VertexMaxY)
        return false;

    ASSERT(intersection.edge && intersection.edge->polygon());
    const FloatPolygon& polygon = *(intersection.edge->polygon());
    const FloatPolygonEdge& thisEdge = *(intersection.edge);

    if ((intersection.type == VertexMinY && (thisEdge.vertex1().y() < thisEdge.vertex2().y()))
        || (intersection.type == VertexMaxY && (thisEdge.vertex1().y() > thisEdge.vertex2().y()))) {
        prevVertex = polygon.vertexAt(thisEdge.previousEdge().vertexIndex1());
        thisVertex = polygon.vertexAt(thisEdge.vertexIndex1());
        nextVertex = polygon.vertexAt(thisEdge.vertexIndex2());
    } else {
        prevVertex = polygon.vertexAt(thisEdge.vertexIndex1());
        thisVertex = polygon.vertexAt(thisEdge.vertexIndex2());
        nextVertex = polygon.vertexAt(thisEdge.nextEdge().vertexIndex2());
    }

    return true;
}

static inline bool appendIntervalX(float x, bool inside, Vector<ShapeInterval>& result)
{
    if (!inside)
        result.append(ShapeInterval(x));
    else
        result[result.size() - 1].x2 = x;

    return !inside;
}

static bool compareEdgeIntersectionX(const EdgeIntersection& intersection1, const EdgeIntersection& intersection2)
{
    float x1 = intersection1.point.x();
    float x2 = intersection2.point.x();
    return (x1 == x2) ? intersection1.type < intersection2.type : x1 < x2;
}

static void computeXIntersections(const FloatPolygon& polygon, float y, bool isMinY, Vector<ShapeInterval>& result)
{
    Vector<const FloatPolygonEdge*> edges;
    if (!polygon.overlappingEdges(y, y, edges))
        return;

    Vector<EdgeIntersection> intersections;
    EdgeIntersection intersection;
    for (unsigned i = 0; i < edges.size(); ++i) {
        if (computeXIntersection(edges[i], y, intersection) && intersection.type != VertexYBoth)
            intersections.append(intersection);
    }

    if (intersections.size() < 2)
        return;

    std::sort(intersections.begin(), intersections.end(), WebCore::compareEdgeIntersectionX);

    unsigned index = 0;
    int windCount = 0;
    bool inside = false;

    while (index < intersections.size()) {
        const EdgeIntersection& thisIntersection = intersections[index];
        if (index + 1 < intersections.size()) {
            const EdgeIntersection& nextIntersection = intersections[index + 1];
            if ((thisIntersection.point.x() == nextIntersection.point.x()) && (thisIntersection.type == VertexMinY || thisIntersection.type == VertexMaxY)) {
                if (thisIntersection.type == nextIntersection.type) {
                    // Skip pairs of intersections whose types are VertexMaxY,VertexMaxY and VertexMinY,VertexMinY.
                    index += 2;
                } else {
                    // Replace pairs of intersections whose types are VertexMinY,VertexMaxY or VertexMaxY,VertexMinY with one intersection.
                    ++index;
                }
                continue;
            }
        }

        const FloatPolygonEdge& thisEdge = *thisIntersection.edge;
        bool evenOddCrossing = !windCount;

        if (polygon.fillRule() == RULE_EVENODD) {
            windCount += (thisEdge.vertex2().y() > thisEdge.vertex1().y()) ? 1 : -1;
            evenOddCrossing = evenOddCrossing || !windCount;
        }

        if (evenOddCrossing) {
            bool edgeCrossing = thisIntersection.type == Normal;
            if (!edgeCrossing) {
                FloatPoint prevVertex;
                FloatPoint thisVertex;
                FloatPoint nextVertex;

                if (getVertexIntersectionVertices(thisIntersection, prevVertex, thisVertex, nextVertex)) {
                    if (nextVertex.y() == y)
                        edgeCrossing = (isMinY) ? prevVertex.y() > y : prevVertex.y() < y;
                    else if (prevVertex.y() == y)
                        edgeCrossing = (isMinY) ? nextVertex.y() > y : nextVertex.y() < y;
                    else
                        edgeCrossing = true;
                }
            }
            if (edgeCrossing)
                inside = appendIntervalX(thisIntersection.point.x(), inside, result);
        }

        ++index;
    }
}

static void computeOverlappingEdgeXProjections(const FloatPolygon& polygon, float y1, float y2, Vector<ShapeInterval>& result)
{
    Vector<const FloatPolygonEdge*> edges;
    if (!polygon.overlappingEdges(y1, y2, edges))
        return;

    EdgeIntersection intersection;
    for (unsigned i = 0; i < edges.size(); ++i) {
        const FloatPolygonEdge *edge = edges[i];
        float x1;
        float x2;

        if (edge->minY() < y1) {
            computeXIntersection(edge, y1, intersection);
            x1 = intersection.point.x();
        } else {
            x1 = (edge->vertex1().y() < edge->vertex2().y()) ? edge->vertex1().x() : edge->vertex2().x();
        }

        if (edge->maxY() > y2) {
            computeXIntersection(edge, y2, intersection);
            x2 = intersection.point.x();
        } else {
            x2 = (edge->vertex1().y() > edge->vertex2().y()) ? edge->vertex1().x() : edge->vertex2().x();
        }

        if (x1 > x2)
            std::swap(x1, x2);

        if (x2 > x1)
            result.append(ShapeInterval(x1, x2));
    }

    sortShapeIntervals(result);
}

void PolygonShape::getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList& result) const
{
    const FloatPolygon& polygon = shapeMarginBounds();
    if (polygon.isEmpty())
        return;

    float y1 = logicalTop;
    float y2 = logicalTop + logicalHeight;

    Vector<ShapeInterval> y1XIntervals, y2XIntervals;
    computeXIntersections(polygon, y1, true, y1XIntervals);
    computeXIntersections(polygon, y2, false, y2XIntervals);

    Vector<ShapeInterval> mergedIntervals;
    mergeShapeIntervals(y1XIntervals, y2XIntervals, mergedIntervals);

    Vector<ShapeInterval> edgeIntervals;
    computeOverlappingEdgeXProjections(polygon, y1, y2, edgeIntervals);

    Vector<ShapeInterval> excludedIntervals;
    mergeShapeIntervals(mergedIntervals, edgeIntervals, excludedIntervals);

    for (unsigned i = 0; i < excludedIntervals.size(); ++i) {
        ShapeInterval interval = excludedIntervals[i];
        result.append(LineSegment(interval.x1, interval.x2));
    }
}

void PolygonShape::getIncludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalHeight, SegmentList& result) const
{
    const FloatPolygon& polygon = shapePaddingBounds();
    if (polygon.isEmpty())
        return;

    float y1 = logicalTop;
    float y2 = logicalTop + logicalHeight;

    Vector<ShapeInterval> y1XIntervals, y2XIntervals;
    computeXIntersections(polygon, y1, true, y1XIntervals);
    computeXIntersections(polygon, y2, false, y2XIntervals);

    Vector<ShapeInterval> commonIntervals;
    intersectShapeIntervals(y1XIntervals, y2XIntervals, commonIntervals);

    Vector<ShapeInterval> edgeIntervals;
    computeOverlappingEdgeXProjections(polygon, y1, y2, edgeIntervals);

    Vector<ShapeInterval> includedIntervals;
    subtractShapeIntervals(commonIntervals, edgeIntervals, includedIntervals);

    for (unsigned i = 0; i < includedIntervals.size(); ++i) {
        ShapeInterval interval = includedIntervals[i];
        result.append(LineSegment(interval.x1, interval.x2));
    }
}

static inline bool firstFitRectInPolygon(const FloatPolygon& polygon, const FloatRect& rect, unsigned offsetEdgeIndex1, unsigned offsetEdgeIndex2)
{
    Vector<const FloatPolygonEdge*> edges;
    if (!polygon.overlappingEdges(rect.y(), rect.maxY(), edges))
        return true;

    for (unsigned i = 0; i < edges.size(); ++i) {
        const FloatPolygonEdge* edge = edges[i];
        if (edge->edgeIndex() != offsetEdgeIndex1 && edge->edgeIndex() != offsetEdgeIndex2 && edge->overlapsRect(rect))
            return false;
    }

    return true;
}

static inline bool aboveOrToTheLeft(const FloatRect& r1, const FloatRect& r2)
{
    if (r1.y() < r2.y())
        return true;
    if (r1.y() == r2.y())
        return r1.x() < r2.x();
    return false;
}

bool PolygonShape::firstIncludedIntervalLogicalTop(LayoutUnit minLogicalIntervalTop, const LayoutSize& minLogicalIntervalSize, LayoutUnit& result) const
{
    float minIntervalTop = minLogicalIntervalTop;
    float minIntervalHeight = minLogicalIntervalSize.height();
    float minIntervalWidth = minLogicalIntervalSize.width();

    const FloatPolygon& polygon = shapePaddingBounds();
    const FloatRect boundingBox = polygon.boundingBox();
    if (minIntervalWidth > boundingBox.width())
        return false;

    float minY = std::max(boundingBox.y(), minIntervalTop);
    float maxY = minY + minIntervalHeight;

    if (maxY > boundingBox.maxY())
        return false;

    Vector<const FloatPolygonEdge*> edges;
    polygon.overlappingEdges(minIntervalTop, boundingBox.maxY(), edges);

    float dx = minIntervalWidth / 2;
    float dy = minIntervalHeight / 2;
    Vector<OffsetPolygonEdge> offsetEdges;

    for (unsigned i = 0; i < edges.size(); ++i) {
        const FloatPolygonEdge& edge = *(edges[i]);
        const FloatPoint& vertex0 = edge.previousEdge().vertex1();
        const FloatPoint& vertex1 = edge.vertex1();
        const FloatPoint& vertex2 = edge.vertex2();
        Vector<OffsetPolygonEdge> offsetEdgeBuffer;

        if (vertex2.y() > vertex1.y() ? vertex2.x() >= vertex1.x() : vertex1.x() >= vertex2.x()) {
            offsetEdgeBuffer.append(OffsetPolygonEdge(edge, FloatSize(dx, -dy)));
            offsetEdgeBuffer.append(OffsetPolygonEdge(edge, FloatSize(-dx, dy)));
        } else {
            offsetEdgeBuffer.append(OffsetPolygonEdge(edge, FloatSize(dx, dy)));
            offsetEdgeBuffer.append(OffsetPolygonEdge(edge, FloatSize(-dx, -dy)));
        }

        if (isReflexVertex(vertex0, vertex1, vertex2)) {
            if (vertex2.x() <= vertex1.x() && vertex0.x() <= vertex1.x())
                offsetEdgeBuffer.append(OffsetPolygonEdge(vertex1, FloatSize(dx, -dy), FloatSize(dx, dy)));
            else if (vertex2.x() >= vertex1.x() && vertex0.x() >= vertex1.x())
                offsetEdgeBuffer.append(OffsetPolygonEdge(vertex1, FloatSize(-dx, -dy), FloatSize(-dx, dy)));
            if (vertex2.y() <= vertex1.y() && vertex0.y() <= vertex1.y())
                offsetEdgeBuffer.append(OffsetPolygonEdge(vertex1, FloatSize(-dx, dy), FloatSize(dx, dy)));
            else if (vertex2.y() >= vertex1.y() && vertex0.y() >= vertex1.y())
                offsetEdgeBuffer.append(OffsetPolygonEdge(vertex1, FloatSize(-dx, -dy), FloatSize(dx, -dy)));
        }

        for (unsigned j = 0; j < offsetEdgeBuffer.size(); ++j) {
            if (offsetEdgeBuffer[j].maxY() >= minY)
                offsetEdges.append(offsetEdgeBuffer[j]);
        }
    }

    offsetEdges.append(OffsetPolygonEdge(polygon, minIntervalTop, FloatSize(0, dy)));

    FloatPoint offsetEdgesIntersection;
    FloatRect firstFitRect;
    bool firstFitFound = false;

    for (unsigned i = 0; i < offsetEdges.size() - 1; ++i) {
        for (unsigned j = i + 1; j < offsetEdges.size(); ++j) {
            if (offsetEdges[i].intersection(offsetEdges[j], offsetEdgesIntersection)) {
                FloatPoint potentialFirstFitLocation(offsetEdgesIntersection.x() - dx, offsetEdgesIntersection.y() - dy);
                FloatRect potentialFirstFitRect(potentialFirstFitLocation, minLogicalIntervalSize);
                if ((offsetEdges[i].basis() == OffsetPolygonEdge::LineTop
                    || offsetEdges[j].basis() == OffsetPolygonEdge::LineTop
                    || potentialFirstFitLocation.y() >= minIntervalTop)
                    && (!firstFitFound || aboveOrToTheLeft(potentialFirstFitRect, firstFitRect))
                    && polygon.contains(offsetEdgesIntersection)
                    && firstFitRectInPolygon(polygon, potentialFirstFitRect, offsetEdges[i].edgeIndex(), offsetEdges[j].edgeIndex())) {
                    firstFitFound = true;
                    firstFitRect = potentialFirstFitRect;
                }
            }
        }
    }

    if (firstFitFound)
        result = LayoutUnit::fromFloatCeil(firstFitRect.y());
    return firstFitFound;
}

} // namespace WebCore


text:
namespace T2.Exceptions
{
    using System;
    public abstract class Exam
    {
        public abstract ExamResult Check();
    }
}


text:
<?php
/**
 * Created by PhpStorm.
 * User: wyvern
 * Date: 16/7/1
 * Time: 上午10:31
 */

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;

return [
    'up' => function (Builder $schema) {
        $schema->table('users', function (Blueprint $table) {
            $table->string('create_from');
        });

        // Store slugs for existing discussions
        $schema->getConnection()->table('users')->chunk(100, function ($users) use ($schema) {
            foreach ($users as $user) {
                $schema->getConnection()->table('users')->where('id', $user->id)->update([
                    'create_from' => '来自社区账号系统'
                ]);
            }
        });
    },

    'down' => function (Builder $schema) {
        $schema->table('users', function (Blueprint $table) {
            $table->dropColumn('create_from');
        });
    }
];


text:
"use strict";

var fs = require('fs'),
  async = require('async'),
  ApplicationError = require('../error'),
  error, commands = [];

function doesFileExist(path) {
  return function(callback) {
    fs.stat(path, function(err, stats) {
      var paths = path.split('/');
      if (err) {
        error = 'The file "' + paths[paths.length - 1] + '" does not exist.';
        return callback(new ApplicationError.File(error));
      } else {
        if (!stats.isFile()) {
          error = '"' + paths[paths.length - 1] + '" is not a file.';
          return callback(new ApplicationError.File(error));
        } else {
          callback();
        }
      }
    });
  };
}

function doesFolderExist(path) {
  return function(callback) {
    fs.stat(path, function(err, stats) {
      var paths = path.split('/');
      if (err) {
        error = new ApplicationError.File('The folder "' + paths[paths.length - 1] + '" does not exist.');
        return callback(error);
      } else {
        if (!stats.isDirectory()) {
          error = new ApplicationError.File('"' + paths[paths.length - 1] + '" is not a folder.');
          return callback(error);
        } else {
          callback();
        }
      }
    });
  };
}

module.exports = {

  check: function() {
    commands = [];
    return this;
  },

  fileExist: function(path) {
    commands.push(doesFileExist(path));
    return this;
  },

  folderExist: function(path) {
    commands.push(doesFolderExist(path));
    return this;
  },

  exec: function(callback) {
    async.parallel(commands, function(err) {
      // clear commands
      commands = [];
      if (err) {
        return callback(error || new ApplicationError.File('Unhandled Exception.'));
      }
      callback();
    });
  }

};


text:
package org.zaproxy.addon.network.testutils;

import java.security.KeyStore;
import org.zaproxy.addon.network.ServerCertificatesOptions;
import org.zaproxy.addon.network.internal.cert.CertData;
import org.zaproxy.addon.network.internal.cert.CertificateUtils;
import org.zaproxy.addon.network.internal.cert.GenerationException;
import org.zaproxy.addon.network.internal.cert.ServerCertificateGenerator;
import org.zaproxy.addon.network.internal.cert.ServerCertificateService;

/**
 * A {@link ServerCertificateService} for tests.
 *
 * @see #createInstance()
 */
public class TestServerCertificateService implements ServerCertificateService {

    private final ServerCertificatesOptions serverCertificatesOptions;
    private ServerCertificateGenerator generator;

    public static TestServerCertificateService createInstance() {
        ServerCertificatesOptions serverCertificatesOptions = new ServerCertificatesOptions();
        KeyStore rootCa =
                CertificateUtils.createRootCaKeyStore(
                        serverCertificatesOptions.getRootCaCertConfig());
        TestServerCertificateService certificateService =
                new TestServerCertificateService(serverCertificatesOptions);
        certificateService.setRootCa(rootCa);
        return certificateService;
    }

    TestServerCertificateService(ServerCertificatesOptions serverCertificatesOptions) {
        this.serverCertificatesOptions = serverCertificatesOptions;
    }

    public void setRootCa(KeyStore keyStore) {
        generator = new ServerCertificateGenerator(keyStore, serverCertificatesOptions);
    }

    @Override
    public KeyStore createCertificate(CertData certData) throws GenerationException {
        if (generator == null) {
            throw new GenerationException("The root CA certificate was not set.");
        }
        return generator.generate(certData);
    }
}


text:
{% extends "base.html" %}
{% load staticfiles i18n %}

{% block menu %}
{% include 'common/menu.html' with contact_view='active' %}
{% endblock %}

{% block content %}

            {% include 'pages/messages.html' %}

Contact us.

                <form data-toggle="validator" role="form" action="{% url 'ui:feedback' %}" method="post">
                  {% csrf_token %}

                    Name
                    <input type="text" class="form-control" id="nameInput" name="name" placeholder="Name" required>

                    Email address
                    <input type="email" class="form-control" id="emailInput" name="email" placeholder="Email" data-error="Please enter a valid email." required>

                      <textarea class="form-control" rows="4" id="commentInput" name="comment" placeholder="Comment" required></textarea>

                  <button type="submit" class="btn btn-primary btn-large">send it</button>
                </form>

{% endblock %}

{% block additional_scripts %}

{% endblock %}


text:
package com.opensymphony.workflow.util;

import com.opensymphony.module.propertyset.PropertySet;

import com.opensymphony.user.*;

import com.opensymphony.workflow.*;

import java.util.Map;

/**
 * Simple utility class that uses OSUser to determine if the caller is in
 * the required argument "group".
 *
 * @author Pat Lightbody
 */
public class OSUserGroupCondition implements Condition {
    //~ Methods ////////////////////////////////////////////////////////////////

    public boolean passesCondition(Map transientVars, Map args, PropertySet ps) {
        try {
            WorkflowContext context = (WorkflowContext) transientVars.get("context");
            User user = UserManager.getInstance().getUser(context.getCaller());

            return user.inGroup((String) args.get("group"));
        } catch (EntityNotFoundException e) {
            return false;
        }
    }
}