text:
package org.hawkular.client.test.alerts;

import java.util.Arrays;
import java.util.List;

import org.hawkular.client.core.ClientResponse;
import org.hawkular.client.test.BaseTest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
import org.testng.annotations.Test;

@Test(groups = {"alerts", "alerts-plugins"})
public class PluginsTest extends BaseTest {

    private static final Logger LOG = LoggerFactory.getLogger(PluginsTest.class);

    public static final String EMAIL_PLUGIN_NAME = "email";
    public static final String EMAIL_PLUGIN_PROPERTY_TO = "to";
    public static final String EMAIL_PLUGIN_PROPERTY_FROM = "from";
    private static final List<String> emailProperties =
        Arrays.asList("cc", "from", "from-name", "template.hawkular.url", "template.html", "template.plain", "to");

    @Test
    public void findActionPlugins() {
        LOG.info("Testing with Plugin == {}", EMAIL_PLUGIN_NAME);

        ClientResponse<List<String>> response = client()
            .alerts()
            .plugins()
            .findActionPlugins();

        Assert.assertTrue(response.isSuccess());
        Assert.assertTrue(response.getEntity().size() > 0);
        Assert.assertTrue(response.getEntity().contains(EMAIL_PLUGIN_NAME));
    }

    @Test(dependsOnMethods = "findActionPlugins")
    public void getActionPlugin() {
        ClientResponse<List<String>> response = client()
            .alerts()
            .plugins()
            .getActionPlugin(EMAIL_PLUGIN_NAME);

        Assert.assertTrue(response.isSuccess());
        Assert.assertTrue(response.getEntity().size() > 0);
        Assert.assertEquals(response.getEntity(), emailProperties);
    }
}


text:
// @Generated by gentest/gentest.rb from
// gentest/fixtures/YGSizeOverflowTest.html

#include <gtest/gtest.h>
#include <yoga/Yoga.h>

TEST(YogaTest, nested_overflowing_child) {
  const YGConfigRef config = YGConfigNew();

  const YGNodeRef root = YGNodeNewWithConfig(config);
  YGNodeStyleSetWidth(root, 100);
  YGNodeStyleSetHeight(root, 100);

  const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
  YGNodeInsertChild(root, root_child0, 0);

  const YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
  YGNodeStyleSetWidth(root_child0_child0, 200);
  YGNodeStyleSetHeight(root_child0_child0, 200);
  YGNodeInsertChild(root_child0, root_child0_child0, 0);
  YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root));

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0));
  ASSERT_FLOAT_EQ(200, YGNodeLayoutGetHeight(root_child0));

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0));
  ASSERT_FLOAT_EQ(200, YGNodeLayoutGetWidth(root_child0_child0));
  ASSERT_FLOAT_EQ(200, YGNodeLayoutGetHeight(root_child0_child0));

  YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL);

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root));

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0));
  ASSERT_FLOAT_EQ(200, YGNodeLayoutGetHeight(root_child0));

  ASSERT_FLOAT_EQ(-100, YGNodeLayoutGetLeft(root_child0_child0));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0));
  ASSERT_FLOAT_EQ(200, YGNodeLayoutGetWidth(root_child0_child0));
  ASSERT_FLOAT_EQ(200, YGNodeLayoutGetHeight(root_child0_child0));

  YGNodeFreeRecursive(root);

  YGConfigFree(config);
}

TEST(YogaTest, nested_overflowing_child_in_constraint_parent) {
  const YGConfigRef config = YGConfigNew();

  const YGNodeRef root = YGNodeNewWithConfig(config);
  YGNodeStyleSetWidth(root, 100);
  YGNodeStyleSetHeight(root, 100);

  const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
  YGNodeStyleSetWidth(root_child0, 100);
  YGNodeStyleSetHeight(root_child0, 100);
  YGNodeInsertChild(root, root_child0, 0);

  const YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
  YGNodeStyleSetWidth(root_child0_child0, 200);
  YGNodeStyleSetHeight(root_child0_child0, 200);
  YGNodeInsertChild(root_child0, root_child0_child0, 0);
  YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root));

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child0));

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0));
  ASSERT_FLOAT_EQ(200, YGNodeLayoutGetWidth(root_child0_child0));
  ASSERT_FLOAT_EQ(200, YGNodeLayoutGetHeight(root_child0_child0));

  YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL);

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root));

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root_child0));

  ASSERT_FLOAT_EQ(-100, YGNodeLayoutGetLeft(root_child0_child0));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0));
  ASSERT_FLOAT_EQ(200, YGNodeLayoutGetWidth(root_child0_child0));
  ASSERT_FLOAT_EQ(200, YGNodeLayoutGetHeight(root_child0_child0));

  YGNodeFreeRecursive(root);

  YGConfigFree(config);
}

TEST(YogaTest, parent_wrap_child_size_overflowing_parent) {
  const YGConfigRef config = YGConfigNew();

  const YGNodeRef root = YGNodeNewWithConfig(config);
  YGNodeStyleSetWidth(root, 100);
  YGNodeStyleSetHeight(root, 100);

  const YGNodeRef root_child0 = YGNodeNewWithConfig(config);
  YGNodeStyleSetWidth(root_child0, 100);
  YGNodeInsertChild(root, root_child0, 0);

  const YGNodeRef root_child0_child0 = YGNodeNewWithConfig(config);
  YGNodeStyleSetWidth(root_child0_child0, 100);
  YGNodeStyleSetHeight(root_child0_child0, 200);
  YGNodeInsertChild(root_child0, root_child0_child0, 0);
  YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root));

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0));
  ASSERT_FLOAT_EQ(200, YGNodeLayoutGetHeight(root_child0));

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0_child0));
  ASSERT_FLOAT_EQ(200, YGNodeLayoutGetHeight(root_child0_child0));

  YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionRTL);

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetHeight(root));

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0));
  ASSERT_FLOAT_EQ(200, YGNodeLayoutGetHeight(root_child0));

  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetLeft(root_child0_child0));
  ASSERT_FLOAT_EQ(0, YGNodeLayoutGetTop(root_child0_child0));
  ASSERT_FLOAT_EQ(100, YGNodeLayoutGetWidth(root_child0_child0));
  ASSERT_FLOAT_EQ(200, YGNodeLayoutGetHeight(root_child0_child0));

  YGNodeFreeRecursive(root);

  YGConfigFree(config);
}

redpajama_set_name: RedPajamaGithub


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Reflection;
using System.Diagnostics;
using System.ComponentModel;
using System.Windows.Markup;

#if SILVERLIGHTXAML
using MS.Internal.Xaml.MS.Impl;
#else
using System.Xaml.MS.Impl;
#endif

#if SILVERLIGHTXAML
namespace MS.Internal.Xaml.Schema
#else
namespace System.Xaml.Schema
#endif
{
    [DebuggerDisplay("{Name}")]
    class ClrProperty : XamlProperty
    {
        public readonly PropertyInfo ClrBindingPropertyInfo;

        private readonly XamlType _declaringType;
        private readonly string _name;
        protected bool _isPublic;
        protected bool _isReadOnly;
        protected bool _isStatic;
        protected bool _isAttachable;
        protected bool _isEvent;

        private Type _systemTypeOfProperty;
        protected XamlType _xamlTypeOfProperty;
        private XamlTextSyntax _textSyntax;
        private XamlProperty _dependsOn;
        private XamlType _targetType;

        private int _cachedPropertyBits;
        private int _validPropertyBits;
        private int _nonBoolValidPropertyBits;

        protected ClrProperty(string name, XamlType declaringType)
        {
#if DEBUG
            if (declaringType == null)
            {
                throw new XamlInternalException("Asserting that the declaringType should never be null");
            }
#endif
            _name = name;
            _declaringType = declaringType;

            OtherInitialization();
        }

        public ClrProperty(string name, PropertyInfo pi, XamlType declaringType)
            : this(name, pi, declaringType, false)
        {
        }

        private ClrProperty(string name, PropertyInfo pi, XamlType declaringType, bool isStatic)
        {
            Debug.Assert(pi != null);
            Debug.Assert(pi.Name == name);
#if DEBUG
            if (declaringType == null)
            {
                throw new XamlInternalException("Asserting that the declaringType should never be null");
            }
#endif
            MethodInfo mi = pi.GetGetMethod(true);
            if (mi == null)
            {
                throw new XamlSchemaException(SR.Get(SRID.SetOnlyProperty, declaringType.Name, name));
            }

            _declaringType = declaringType;
            _name = pi.Name;
            _isPublic = mi.IsPublic;
            _isReadOnly = !pi.CanWrite;
            _isStatic = isStatic;
            ClrBindingPropertyInfo = pi;

            _isAttachable = false;
            _isEvent = false;

            OtherInitialization();
        }

        private void OtherInitialization()
        {
            _cachedPropertyBits = 0; // bit flags;
            _validPropertyBits = 0;  // bit flags
        }

        // ----- Protected Overrides -----

        public override string BoundName
        {
            get { return Name; }
        }

        public override bool IsImplicit { get { return false; } }
        public override bool IsUnknown { get { return false; } }

        public override IList<string> GetXamlNamespaces()
        {
            return DeclaringType.GetXamlNamespaces();
        }

        protected override string NameCore
        {
            get { return _name; }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        protected override bool IsPublicCore
        {
            get { return _isPublic; }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        protected override bool IsBrowsableCore
        {
            get
            {
                bool ret = CheckPropertyBit(BoolPropertyBits.IsBrowsable);
                return ret;
            }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        protected override XamlType DeclaringTypeCore
        {
            get { return _declaringType; }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        protected override XamlType TypeCore
        {
            get
            {
                if (_xamlTypeOfProperty == null)
                {
                    _xamlTypeOfProperty = LookupTypeOfProperty();
                }
                return _xamlTypeOfProperty;
            }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        protected override XamlTextSyntax TextSyntaxCore
        {
            get
            {
                if (_textSyntax == null)
                {
                    _textSyntax = LookupTextSyntax();
                }

                if (_textSyntax == XamlTextSyntax.NoSyntax)
                {
                    return null;
                }
                return _textSyntax;
            }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        protected override XamlProperty DependsOnCore
        {
            get
            {
                if (!CheckNonBoolValidBit(NonBoolPropertyValidBits.DependsOn))
                {
                    SetNonBoolValidBit(NonBoolPropertyValidBits.DependsOn);
                    _dependsOn = LookupDependsOn();
                }
                return _dependsOn;
            }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        protected override bool IsReadOnlyCore
        {
            get { return _isReadOnly; }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        protected override bool IsStaticCore
        {
            get { return _isStatic; }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        protected override bool IsAttachableCore
        {
            get { return _isAttachable; }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        protected override bool IsEventCore
        {
            get { return _isEvent; }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        protected override bool IsDirectiveCore
        {
            get { return false; }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        protected override XamlType TargetTypeCore
        {
            get
            {
                if (!CheckNonBoolValidBit(NonBoolPropertyValidBits.TargetType))
                {
                    SetNonBoolValidBit(NonBoolPropertyValidBits.TargetType);
                    _targetType = LookupTargetType();
                }
                return _targetType;
            }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        protected override AllowedMemberLocation AllowedLocationCore
        {
            get { return AllowedMemberLocation.Any; }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        protected override bool IsAmbientCore
        {
            get
            {
                bool ret = CheckPropertyBit(BoolPropertyBits.IsAmbient);
                return ret;
            }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        protected override bool IsObsoleteCore
        {
            get
            {
                bool ret = CheckPropertyBit(BoolPropertyBits.IsObsolete);
                return ret;
            }
            set { throw new InvalidOperationException(SR.Get(SRID.MustNotCallSetter)); }
        }

        // ==============================================

        public override string ToString()
        {
            return Name;
        }

        // ==============================================

        public XamlSchemaContext SchemaContext
        {
            get { return _declaringType.SchemaContext; }
        }

        // ==============================================

        internal Type ClrSystemTypeOfProperty
        {
            get
            {
                if (_systemTypeOfProperty == null)
                {
                    _systemTypeOfProperty = LookupSystemTypeOfProperty();
                }
                return _systemTypeOfProperty;
            }
        }

        // ==============================================

        protected virtual Type LookupSystemTypeOfProperty()
        {
            return ClrBindingPropertyInfo.PropertyType;
        }

        private object LookupCustomAttribute(Type attrType)
        {
            object[] objs = LookupCustomAttributes(attrType);
            if (objs.Length == 0)
            {
                return null;
            }
            if (objs.Length > 1)
            {
                string message = SR.Get(SRID.TooManyAttributes, DeclaringType.Name, Name, attrType.Name);
                throw new XamlSchemaException(message);
            }
            return objs[0];
        }

        protected virtual object[] LookupCustomAttributes(Type attrType)
        {
            return ClrBindingPropertyInfo.GetCustomAttributes(attrType, true);
        }

        // ==============================================

        private bool LookupIsBrowsable()
        {
            Object attr = LookupCustomAttribute(typeof(EditorBrowsableAttribute));
            if (null != attr)
            {
                EditorBrowsableAttribute eba = (EditorBrowsableAttribute)attr;
                if (eba.State == EditorBrowsableState.Never)
                    return false;
            }
            return true;
        }

        private bool LookupIsObsolete()
        {
            Object attr = LookupCustomAttribute(typeof(ObsoleteAttribute));
            if (null != attr)
            {
                return true;
            }
            return false;
        }

        // Value Types don't neccessary come from a declared namespace.  For example
        // "Double" or "String" or "Object".  So we create a XamlType w/o a namespace.
        private XamlType LookupTypeOfProperty()
        {
            XamlType xamlType = this.SchemaContext.GetXamlType(ClrSystemTypeOfProperty);
            return xamlType;
        }

        protected virtual XamlTextSyntax LookupTextSyntax()
        {
            // Look for a type converter on the Property.
            object[] objs = LookupCustomAttributes(typeof(TypeConverterAttribute));

            XamlTextSyntax representer;

            // If there were attributes on the Property then get that
            // TypeConverter, else look on the Type.
            if (objs.Length > 0)
            {
                TypeConverterAttribute[] tcAttrs = (TypeConverterAttribute[])objs;
                representer = ClrNamespace.GetOrCreateTextSyntaxFromAttributes(this.SchemaContext, tcAttrs);
            }
            else
            {
                XamlType xamlType = this.Type;
                representer = xamlType.TextSyntax;
            }
            if (representer == null)
            {
                representer = XamlTextSyntax.NoSyntax;
            }
            return representer;
        }

        private XamlProperty LookupDependsOn()
        {
            object obj = LookupCustomAttribute(typeof(DependsOnAttribute));
            if (obj == null)
            {
                return null;
            }
            else
            {
                string doPropertyName = ((DependsOnAttribute)obj).Name;
                XamlProperty xp = _declaringType.GetProperty(doPropertyName);
                if (xp != null)
                    return xp;
                else
                {
                    string err = SR.Get(SRID.UnknownAttributeProperty, typeof(DependsOnAttribute).Name, doPropertyName, _name);
                    throw new XamlSchemaException(err);
                }
            }
        }

        protected virtual XamlType LookupTargetType()
        {
            return null;
        }

        private bool LookupIsAmbient()
        {
            object obj = LookupCustomAttribute(typeof(AmbientAttribute));
            return (obj == null) ? false : true;
        }

        // ===========================

        private bool CheckPropertyBit(BoolPropertyBits propertyBit)
        {
            int bit = (int)propertyBit;
            if (0 != (_validPropertyBits & bit))
            {
                return 0 != (_cachedPropertyBits & bit);
            }

            bool isBitTrue = LookupPropertyBit(propertyBit);
            _validPropertyBits |= bit;
            if (isBitTrue)
                _cachedPropertyBits |= bit;

            return isBitTrue;
        }

        private bool LookupPropertyBit(BoolPropertyBits propertyBit)
        {
            bool bit;
            switch (propertyBit)
            {
            case BoolPropertyBits.IsAmbient:
                bit = LookupIsAmbient();
                break;

            case BoolPropertyBits.IsBrowsable:
                bit = LookupIsBrowsable();
                break;

            case BoolPropertyBits.IsObsolete:
                bit = LookupIsObsolete();
                break;

            default:
                throw new XamlInternalException(SR.Get(SRID.MissingLookPropertyBit));
            }
            return bit;
        }

        private bool CheckNonBoolValidBit(NonBoolPropertyValidBits propBit)
        {
            int bit = (int)propBit;
            bool result = (0 != (_nonBoolValidPropertyBits & bit));

            return result;
        }

        private void SetNonBoolValidBit(NonBoolPropertyValidBits propBit)
        {
            _nonBoolValidPropertyBits |= (int)propBit;
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2010 JBoss Inc

  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.
 -->
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
  xmlns:gwt='urn:import:com.google.gwt.user.client.ui' xmlns:guvnor='urn:import:org.drools.guvnor.client.util'>

  <gwt:HTMLPanel>
    <div style="margin-bottom:20px;">
      <guvnor:AddButton ui:field="addFactIcon" ></guvnor:AddButton>
      <guvnor:LazyStackPanel ui:field="factModelsPanel"></guvnor:LazyStackPanel>
    </div>
  </gwt:HTMLPanel>

</ui:UiBinder>


text:
{-# LANGUAGE MultiParamTypeClasses      #-}
{-# LANGUAGE TemplateHaskell            #-}

module SnapApp.Application where

import           Prelude hiding ((.))
import           Control.Category ((.))

import           Snap (SnapletInit, Snaplet, Handler,
                 addRoutes, nestSnaplet, serveSnaplet,
                 defaultConfig, makeSnaplet,
                 snapletValue, writeText,
                 makeLens, getL, modL, modify, method)

import           Snap.Snaplet.AcidState (Acid, HasAcid (getAcidStore))
import           Snap.Snaplet.Session

import           SnapApp.Models

------------------------------------------------------------------------------
-- App DataType
------------------------------------------------------------------------------

data App = App
    { _acid :: Snaplet (Acid ApplicationState)
	, _sess :: Snaplet SessionManager
    }

type AppHandler = Handler App App

makeLens ''App

-- | So we don't have to use with acid
instance HasAcid App ApplicationState where
    getAcidStore = getL (snapletValue . acid)


text:
package org.apache.hadoop.hive.metastore.api;

import com.facebook.swift.codec.ThriftConstructor;
import com.facebook.swift.codec.ThriftField;
import com.facebook.swift.codec.ThriftStruct;

@ThriftStruct("UnknownDBException")
public class UnknownDBException extends RuntimeException
{
    private static final long serialVersionUID = 1L;

    @ThriftConstructor
    public UnknownDBException(
                              @ThriftField(value = 1, name = "message") final String message)
    {
        this.message = message;
    }

    public UnknownDBException()
    {
    }

    private String message;

    @Override
    @ThriftField(value = 1, name = "message")
    public String getMessage()
    {
        return message;
    }

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


text:
import React from 'react';
import { render } from '@testing-library/react';
import QueryAutoRefresh, {
  isQueryRunning,
  shouldCheckForQueries,
} from 'src/SqlLab/components/QueryAutoRefresh';
import { successfulQuery, runningQuery } from 'src/SqlLab/fixtures';
import { QueryDictionary } from 'src/SqlLab/types';

// NOTE: The uses of @ts-ignore in this file is to enable testing of bad inputs to verify the
// function / component handles bad data elegantly
describe('QueryAutoRefresh', () => {
  const runningQueries: QueryDictionary = {};
  runningQueries[runningQuery.id] = runningQuery;

  const successfulQueries: QueryDictionary = {};
  successfulQueries[successfulQuery.id] = successfulQuery;

  const refreshQueries = jest.fn();

  const queriesLastUpdate = Date.now();

  it('isQueryRunning returns true for valid running query', () => {
    const running = isQueryRunning(runningQuery);
    expect(running).toBe(true);
  });

  it('isQueryRunning returns false for valid not-running query', () => {
    const running = isQueryRunning(successfulQuery);
    expect(running).toBe(false);
  });

  it('isQueryRunning returns false for invalid query', () => {
    // @ts-ignore
    let running = isQueryRunning(null);
    expect(running).toBe(false);
    // @ts-ignore
    running = isQueryRunning(undefined);
    expect(running).toBe(false);
    // @ts-ignore
    running = isQueryRunning('I Should Be An Object');
    expect(running).toBe(false);
    // @ts-ignore
    running = isQueryRunning({ state: { badFormat: true } });
    expect(running).toBe(false);
  });

  it('shouldCheckForQueries is true for valid running query', () => {
    expect(shouldCheckForQueries(runningQueries)).toBe(true);
  });

  it('shouldCheckForQueries is false for valid completed query', () => {
    expect(shouldCheckForQueries(successfulQueries)).toBe(false);
  });

  it('shouldCheckForQueries is false for invalid inputs', () => {
    // @ts-ignore
    expect(shouldCheckForQueries(null)).toBe(false);
    // @ts-ignore
    expect(shouldCheckForQueries(undefined)).toBe(false);
    expect(
      // @ts-ignore
      shouldCheckForQueries({
        // @ts-ignore
        '1234': null,
        // @ts-ignore
        '23425': 'hello world',
        // @ts-ignore
        '345': [],
        // @ts-ignore
        '57346': undefined,
      }),
    ).toBe(false);
  });

  it('Attempts to refresh when given pending query', () => {
    render(
      <QueryAutoRefresh
        queries={runningQueries}
        refreshQueries={refreshQueries}
        queriesLastUpdate={queriesLastUpdate}
      />,
    );
    setTimeout(() => {
      expect(refreshQueries).toHaveBeenCalled();
    }, 1000);
  });

  it('Does not fail and attempts to refresh when given pending query and invlaid query', () => {
    render(
      <QueryAutoRefresh
        // @ts-ignore
        queries={{ ...runningQueries, g324t: null }}
        refreshQueries={refreshQueries}
        queriesLastUpdate={queriesLastUpdate}
      />,
    );
    setTimeout(() => {
      expect(refreshQueries).toHaveBeenCalled();
    }, 1000);
  });

  it('Does NOT Attempt to refresh when given only completed queries', () => {
    render(
      <QueryAutoRefresh
        queries={successfulQueries}
        refreshQueries={refreshQueries}
        queriesLastUpdate={queriesLastUpdate}
      />,
    );
    setTimeout(() => {
      expect(refreshQueries).not.toHaveBeenCalled();
    }, 1000);
  });
});


text:
<!doctype html>

<link rel="stylesheet" type="text/css" href="{{url_for('crispr_app.static', filename='css/bootstrap.min.css')}}">
<link rel="stylesheet" type="text/css" href="{{url_for('crispr_app.static', filename='css/crispr_app.css')}}">

Crispr App Main Page

        Select column to filter
        <select name="columnSelect" id="columnSelect" class="form-control">
            <option value="">None</option>
            <option value="pos_bef_PAM">pos_bef_PAM</option>
            <option value="41_bef17">41_bef17</option>
            <option value="41_aft">41_aft</option>
            <option value="total41">total41</option>
            <option value="7_bef17">7_bef17</option>
            <option value="7_aft17">7_aft17</option>
            <option value="total7">total7</option>
            <option value="total">total</option>
        </select>

        Minimum value
        <input class="form-control" id="minInput" name="minValue" type="text" value="{{inputs.min}}"></input>

        Maximum value
        <input class="form-control" id="maxInput" name="maxValue" type="text" value="{{inputs.max}}"></input>

        Filter/Clear

        <button class="btn btn-default" type="button" onclick="updateFilter();">Filter</button>
        <button class="btn btn-default" type="button" onclick="clearFilter();">Clear</button>

    <button type="button" class="btn btn-info" onclick="downloadTable();">Download Filtered Table</button>

{% include 'page_controls.html' %}

Click on a column name to order the table by this column

{% include "table.html" %}

{% include 'page_controls.html' %}

{% include 'google-analytics.html' %}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics;

using Orleans;
using Orleans.Providers;
using Orleans.Streams;

namespace Orleankka
{
    using Utility;

    public struct StreamPath : IEquatable<StreamPath>
    {
        static readonly ICollection<IProviderConfiguration> providers =
                     new LinkedList<IProviderConfiguration>();

        internal static void Register(IEnumerable<IProviderConfiguration> providers)
        {
            Debug.Assert(StreamPath.providers.Count == 0);
            foreach (var each in providers)
                StreamPath.providers.Add(each);
        }

        internal static void Reset()
        {
            providers.Clear();
        }

        public static readonly StreamPath Empty = new StreamPath();

        public readonly Type Type;
        public readonly string Id;

        StreamPath(Type type, string id)
        {
            Type = type;
            Id = id;
        }

        public static StreamPath From(Type type, string id)
        {
            Requires.NotNull(type, nameof(type));
            Requires.NotNull(id, nameof(id));
            Requires.NotNullOrWhitespace(id, nameof(id));

            return new StreamPath(type, id);
        }

        internal IAsyncStream<object> Proxy()
        {
            foreach (var each in providers)
            {
                if (each.Type != Type.FullName)
                    continue;

                var provider = GrainClient.GetStreamProvider(each.Name);
                return provider.GetStream<object>(Guid.Empty, Id);
            }

            throw new InvalidOperationException($"Can't find stream provider of specified stream type: {Type}");
        }

        public bool Equals(StreamPath other)
        {
            return Type == other.Type && string.Equals(Id, other.Id);
        }

        public override bool Equals(object obj)
        {
            return !ReferenceEquals(null, obj) && (obj is StreamPath && Equals((StreamPath)obj));
        }

        public override int GetHashCode()
        {
            unchecked
            {
                return ((Type?.GetHashCode() ?? 0) * 397) ^ (Id?.GetHashCode() ?? 0);
            }
        }

        public static bool operator ==(StreamPath left, StreamPath right) => left.Equals(right);
        public static bool operator !=(StreamPath left, StreamPath right) => !left.Equals(right);
    }
}


text: CKEDITOR.plugins.setLang("showblocks","el",{toolbar:"Προβολή Περιοχών"});


text:
This ReadMe mirrors our [Github Wiki page](https://github.com/Chorus/chorus/wiki), which houses information for developers contributing to the OpenChorus project.

Browse to the [Wiki pages list](https://github.com/Chorus/chorus/wiki/_pages) to review what's available here.Key pages include:

1. [Contributing to Chorus](https://github.com/Chorus/chorus/wiki/Contributing-to-Chorus)
1. [Architecture Overview](https://github.com/Chorus/chorus/wiki/Architecture-Overview)
1. [Javascript Architecture](https://github.com/Chorus/chorus/wiki/Javascript-Architecture)
1. [Building a Package for Deployment](https://github.com/Chorus/chorus/wiki/Building-a-Package-for-Deployment)
1. [Getting started with Chorus development](https://github.com/Chorus/chorus/wiki/Getting-started-with-Chorus-development)
1. [New-Class-Walkthrough](https://github.com/Chorus/chorus/wiki/New-Class-Walkthrough)
1. [How to run Chorus tests](https://github.com/Chorus/chorus/wiki/How-to-run-Chorus-tests)
1. [Test Writing Guidelines](https://github.com/Chorus/chorus/wiki/Test-Writing-Guidelines)
1. [Code Style Guidelines](https://github.com/Chorus/chorus/wiki/Code-style)
1. [Troubleshooting and Environment Notes](https://github.com/Chorus/chorus/wiki/Troubleshooting-and-Environment-Notes)

Have a question? Reach us via the [development mailing list](https://groups.google.com/forum/?fromgroups#!forum/chorus-dev).

If you are interested in accessing the latest commercially released version of Chorus, please [email Alpine Data Labs](mailto:support@alpinenow.com).


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>about on 42</title>
    <link>https://42.teesh.net/categories/about/</link>
    <description>Recent content in about on 42</description>
    <generator>Hugo -- gohugo.io</generator>
    <copyright>© 2016 Copyright Shanmuhanathan Thiagaraja</copyright>
    <lastBuildDate>Thu, 01 Sep 2016 20:04:42 +0100</lastBuildDate>

	<atom:link href="https://42.teesh.net/categories/about/index.xml" rel="self" type="application/rss+xml" />

    <item>
      <title>About</title>
      <link>https://42.teesh.net/post/about/</link>
      <pubDate>Thu, 01 Sep 2016 20:04:42 +0100</pubDate>

      <guid>https://42.teesh.net/post/about/</guid>
      <description>Just Another Hacker!</description>
    </item>

  </channel>
</rss>


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Fl. antarct. 1:43. 1844

#### Original name
null

### Remarks
null


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Annls mycol. 18: 78 (1920)

#### Original name
Dothiora elliptica Fuckel, 1874

### Remarks
null


text:
"""Test flight path kata."""

import pytest

def test_parse_json_returns_something():
    """Test if function parsing json returns something."""
    from flight_paths import read_airports
    assert read_airports()

def test_parse_json_returns_graph():
    """Test if function parsing json returns a dictionary."""
    from flight_paths import read_airports
    assert isinstance(read_airports(), dict)

def test_flight_path_returns_formatted_string():
    """Test if flight_path returns a string."""
    from flight_paths import flight_path
    data = flight_path('Chicago', 'New York City')
    assert isinstance(data, str)

def test_flight_path_returns_right_cities():
    """Test if flight_path returns expected cities."""
    from flight_paths import flight_path
    data = flight_path('Chicago', 'New York City')
    assert 'Chicago' in data and 'New York City' in data


text:
class CleanUp < ActiveRecord::Migration
  def change
    drop_table :organizations
    drop_table :organization_memberships
    remove_reference :events, :sponsor, polymorphic: true

  end
end


text:
package edu.umd.cs.psl.model.atom;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import edu.umd.cs.psl.database.Database;
import edu.umd.cs.psl.database.DatabaseQuery;
import edu.umd.cs.psl.database.ResultList;
import edu.umd.cs.psl.model.argument.GroundTerm;
import edu.umd.cs.psl.model.argument.Variable;
import edu.umd.cs.psl.model.formula.Formula;
import edu.umd.cs.psl.model.predicate.Predicate;
import edu.umd.cs.psl.model.predicate.StandardPredicate;

/**
 * Implements the {@link AtomManager} with a twist: this AtomManager will only return
 * {@link RandomVariableAtom RandomVariableAtoms} that were persisted in the Database
 * at instantiation.
 * <p>
 * All other types of Atoms are returned normally.
 *
 * @author Eric Norris <enorris@cs.umd.edu>
 */
public class PersistedAtomManager implements AtomManager {

	/**
	 * This AtomManager's connection to a database.
	 */
	private final Database db;

	/**
	 * The set of all persisted RandomVariableAtoms at the time of this AtomManager's
	 * instantiation.
	 */
	private final Set<RandomVariableAtom> persistedCache;

	/**
	 * Constructs a PersistedAtomManager with a built-in set of all the database's
	 * persisted RandomVariableAtoms.
	 *
	 * @param db  the Database to query for all getAtom() calls.
	 */
	public PersistedAtomManager(Database db) {
		this.db = db;
		this.persistedCache = new HashSet<RandomVariableAtom>();

		buildPersistedAtomCache();
	}

	private void buildPersistedAtomCache() {
		// Iterate through all of the registered predicates in this database
		for (StandardPredicate predicate : db.getRegisteredPredicates()) {
			// Ignore any closed predicates, they will not return RandomVariableAtoms
			if (db.isClosed(predicate))
				continue;

			// Construct the query for this predicate
			Variable vars[] = new Variable[predicate.getArity()];
			for (int i = 0; i < vars.length; i++)
				vars[i] = new Variable("V" + String.valueOf(i));
			Formula queryFormula = new QueryAtom(predicate, vars);

			// Execute the query and interpret the results
			ResultList list = db.executeQuery(new DatabaseQuery(queryFormula));
			for (int i = 0; i < list.size(); i ++) {
				// Query the database for this specific atom
				GroundAtom atom = db.getAtom(predicate, list.get(i));

				// If this is a RandomVariableAtom, store it in our cache
				if (atom instanceof RandomVariableAtom)
					persistedCache.add((RandomVariableAtom)atom);
			}
		}
	}

	@Override
	public GroundAtom getAtom(Predicate p, GroundTerm... arguments) {
		GroundAtom atom = db.getAtom(p, arguments);
		if (atom instanceof RandomVariableAtom) {
			// Check if this is in our persisted atom cache
			if (persistedCache.contains(atom))
				return atom;
			else
				throw new IllegalArgumentException("Can only call getAtom() on persisted RandomVariableAtoms using a PersistedAtomManager. Cannot access " + atom);
		} else
			return atom;
	}

	@Override
	public ResultList executeQuery(DatabaseQuery query) {
		return db.executeQuery(query);
	}

	@Override
	public boolean isClosed(StandardPredicate predicate) {
		return db.isClosed(predicate);
	}

	public Iterable<RandomVariableAtom> getPersistedRVAtoms() {
		return Collections.unmodifiableSet(persistedCache);
	}

}


text:
<?php

namespace yiioverflow\filekit\tests;

use yii\di\Container;
use yii\helpers\ArrayHelper;
use Yii;

/**
 * This is the base class for all yii framework unit tests.
 */
abstract class TestCase extends \PHPUnit_Framework_TestCase
{
    protected function setUp()
    {
        $this->mockApplication();
        parent::setUp();
    }

    protected function tearDown()
    {
        parent::tearDown();
        $this->destroyApplication();
    }

    protected function mockApplication($config = [], $appClass = '\yii\web\Application')
    {
        new $appClass(ArrayHelper::merge([
            'id' => 'testapp',
            'basePath' => __DIR__,
            'vendorPath' => dirname(__DIR__) . '/vendor',
            'components' => [
                'request' => [
                    'cookieValidationKey' => 'MD44rEeFtNSeJ37sOzD954sI',
                    'scriptFile' => __DIR__ .'/index.php',
                    'scriptUrl' => '/index.php',
                ],
            ]
        ], $config));
    }

    /**
     * Destroys application in Yii::$app by setting it to null.
     */
    protected function destroyApplication()
    {
        Yii::$app = null;
        Yii::$container = new Container();
    }
}


text: {% load i18n %}


text:
namespace Snittlistan.Web.Infrastructure.Installers;

public enum DocumentStoreMode
{
    /// <summary>
    /// Run in-memory. Suitable for testing.
    /// </summary>
    InMemory,

    /// <summary>
    /// Run with standalone server. Used when debugging.
    /// </summary>
    Server
}


text:
package com.slack.api.model.dialog;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Represents a text
 * dialog element

 *

 * {@code Text} elements are single-line plain text fields.
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class DialogTextElement implements DialogElement {

    /**
     * Label displayed to user. Required. No more than 24 characters.
     */
    private String label;

    /**
     * Name of form element. Required. No more than 300 characters.
     */
    private String name;

    /**
     * Type of element.  For a text element, the type is always
     * {@code text} . It's required.
     *
     * @see Dialog form elements
     */
    private final String type = "text";

    /**
     * A default value for this field. Up to 500 characters.
     */
    String value;

    /**
     * A string displayed as needed to help guide users in completing the element.
     * 150 character maximum.
     */
    private String placeholder;

    /**
     * Provide {@code true} when the form element is not required. By default,
     * form elements are required.
     */
    boolean optional;

    /**
     * Maximum input length allowed for element. Up to 150 characters. Defaults to 150.
     */
    public int maxLength;

    /**
     * Minimum input length allowed for element.
     * Type {@code text}: Up to 150 characters. Defaults to 0.
     */
    int minLength;

    /**
     * Helpful text provided to assist users in answering a question. Up to 150 characters.
     */
    String hint;

    /**
     * Subtype for this text type element (e.g. Number)
     */
    DialogSubType subtype;
}


text:
<?php

namespace Aws\Test\Integ;

use Aws\DynamoDb\DynamoDbClient;
use Aws\DynamoDb\WriteRequestBatch;
use Aws\Exception\AwsException;
use Aws\Result;
use Aws\Sqs\SqsClient;
use Behat\Behat\Hook\Scope\AfterFeatureScope;
use Behat\Behat\Hook\Scope\BeforeFeatureScope;
use Behat\Behat\Tester\Exception\PendingException;
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Behat\Gherkin\Node\PyStringNode;
use Behat\Gherkin\Node\TableNode;
use PHPUnit\Framework\Assert;
use Yoast\PHPUnitPolyfills\TestCases\TestCase;

class BatchingContext extends TestCase implements
    Context,
    SnippetAcceptingContext
{
    use IntegUtils;

    private static $resource;

    /** @var DynamoDbClient|SqsClient */
    private $client;
    /** @var WriteRequestBatch */
    private $batch;
    /** @var int */
    private $flushCount;
    /** @var Result */
    private $response;

    /**
     * @Given I have a :service client
     */
    public function iHaveAClient($service)
    {
        $this->client = self::getSdk()->createClient($service);
    }

    /**
     * @BeforeFeature @dynamodb
     *
     * @param BeforeFeatureScope $scope
     */
    public static function setUpDynamoTable(BeforeFeatureScope $scope)
    {
        self::$resource = self::getResourcePrefix()
            . str_replace(' ', '-', strtolower($scope->getName()));

        $client = self::getSdk()->createDynamoDb();
        $client->createTable([
            'TableName' => self::$resource,
            'AttributeDefinitions' => [
                ['AttributeName' => 'id', 'AttributeType' => 'N']
            ],
            'KeySchema' => [
                ['AttributeName' => 'id', 'KeyType' => 'HASH']
            ],
            'ProvisionedThroughput' => [
                'ReadCapacityUnits'  => 1,
                'WriteCapacityUnits' => 1
            ]
        ]);

        $client->waitUntil('TableExists', ['TableName' => self::$resource]);
    }

    /**
     * @AfterFeature @dynamodb
     *
     * @param AfterFeatureScope $scope
     */
    public static function tearDownDynamoTable(AfterFeatureScope $scope)
    {
        self::getSdk()
            ->createDynamoDb()
            ->deleteTable(['TableName' => self::$resource]);

        self::$resource = null;
    }

    /**
     * @BeforeFeature @sqs
     *
     * @param BeforeFeatureScope $scope
     */
    public static function setUpQueue(BeforeFeatureScope $scope)
    {
        $sqs = self::getSdk()->createSqs();
        self::$resource = self::getResourcePrefix()
            . preg_replace('/\W/', '-', strtolower($scope->getName()));

        $sqs->createQueue(['QueueName' => self::$resource]);
        $sqs->waitUntil('QueueExists', ['QueueName' => self::$resource]);
    }

    /**
     * @AfterFeature @sqs
     *
     * @param AfterFeatureScope $scope
     */
    public static function tearDownQueue(AfterFeatureScope $scope)
    {
        $sqs = self::getSdk()
            ->createSqs();

        $sqs->deleteQueue([
            'QueueUrl' => $sqs->getQueueUrl([
                'QueueName' => self::$resource,
            ])['QueueUrl']
        ]);

        self::$resource = null;
    }

    /**
     * @When /^I create a WriteRequestBatch with a batch size of (\d+) and a pool size of (\d+)$/
     */
    public function iCreateAWriteRequestBatch($batchSize, $poolSize)
    {
        $this->batch = new WriteRequestBatch($this->client, [
            'table' => self::$resource,
            'batch_size' => $batchSize,
            'pool_size' => $poolSize,
            'before' => function () {
                $this->flushCount++;
            },
            'error' => function (AwsException $e) {
                trigger_error($e->getMessage(), E_USER_WARNING);
            }
        ]);
    }

    /**
     * @When /^I put (\d+) items in the batch$/
     */
    public function iPutItemsInTheBatch($itemCount)
    {
        for ($i = 0; $i < $itemCount; $i++) {
            $this->batch->put(['id' => ['N' => (string) $i]]);
        }
    }

    /**
     * @When I flush the batch
     */
    public function iFlushTheBatch()
    {
        $this->batch->flush();
    }

    /**
     * @Then /^(\d+) items should have been written$/
     */
    public function itemsShouldHaveBeenWritten($itemCount)
    {
        $actualItems = $this->client->getIterator('Scan', [
            'TableName' => self::$resource,
        ]);

        $this->assertSame((int) $itemCount, iterator_count($actualItems));
    }

    /**
     * @Then /^the batch should have been flushed at least (\d+) times$/
     */
    public function theBatchShouldHaveBeenFlushedTimes($flushCount)
    {
        $this->assertGreaterThanOrEqual((int) $flushCount, $this->flushCount);
    }

    /**
     * @Given /^I have put (\d+) messages in a queue$/
     */
    public function iHavePutMessagesInAQueue($messageCount)
    {
        $queueUrl = $this->client
            ->getQueueUrl(['QueueName' => self::$resource])['QueueUrl'];
        for ($i = 0; $i < $messageCount; $i++) {
            $this->client->sendMessage([
                'QueueUrl' => $queueUrl,
                'MessageBody' => json_encode(['testing' => 'testing']),
            ]);
        }
    }

    /**
     * @When /^I delete a batch of (\d+) messages$/
     */
    public function iDeleteABatchOfMessages($messageCount)
    {
        $queueUrl = $this->client
            ->getQueueUrl(['QueueName' => self::$resource])['QueueUrl'];
        $messages = [];
        while (count($messages) < $messageCount) {
            $result = $this->client->receiveMessage([
                'QueueUrl' => $queueUrl,
                'MaxNumberOfMessages' => $messageCount,
            ]);

            foreach ($result['Messages'] as $message) {
                $messages[$message['MessageId']] = [
                    'Id' => $message['MessageId'],
                    'ReceiptHandle' => $message['ReceiptHandle'],
                ];
            }
        }

        $this->response = $this->client
            ->deleteMessageBatch([
                'QueueUrl' => $queueUrl,
                'Entries' => array_values($messages),
            ]);
    }

    /**
     * @Then /^(\d+) messages should have been deleted from the queue$/
     */
    public function messagesShouldHaveBeenDeletedFromTheQueue($messageCount)
    {
        $failedCount = !empty($this->response['Failed'])
            ? count($this->response['Failed'])
            : 0;
        $successfulCount = !empty($this->response['Successful'])
            ? count($this->response['Successful'])
            : 0;

        $this->assertSame((int) $messageCount, $failedCount + $successfulCount);
    }
}


text:
using Machine.Specifications;
using PlainElastic.Net.Queries;
using PlainElastic.Net.Utils;

namespace PlainElastic.Net.Tests.Builders.Queries
{
    [Subject(typeof(HasChildQuery<,>))]
    class When_empty_HasChildQuery_built
    {
        Because of = () => result = new HasChildQuery<FieldsTestClass, AnotherTestClass>()
                                                .Type("childType")
                                                .Query(q => q)
                                                .Scope("query_scope")
                                                .Boost(5)
                                                .Custom("")
                                                .ToString();

        It should_return_empty_string = () =>
            result.ShouldBeEmpty();

        private static string result;
    }
}


text:
using Xunit;

namespace Stitcher.Samples.Tests
{
    [Collection(nameof(StitcherFixture))]
    public class UpdateCdnKeyTest
    {
        private StitcherFixture _fixture;
        private readonly UpdateCdnKeySample _updateSample;

        public UpdateCdnKeyTest(StitcherFixture fixture)
        {
            _fixture = fixture;
            _updateSample = new UpdateCdnKeySample();
        }

        [Fact]
        public void UpdatesCdnKey_CloudCdn()
        {
            var result = _updateSample.UpdateCdnKey(_fixture.ProjectId, _fixture.LocationId, _fixture.TestCloudCdnKeyId, _fixture.UpdateHostname, _fixture.CloudCdnKeyName, _fixture.UpdatedCloudCdnTokenKey, null);
            Assert.Equal(_fixture.TestCloudCdnKeyId, result.CdnKeyName.CdnKeyId);
            Assert.Equal(_fixture.UpdateHostname, result.Hostname);
        }

        [Fact]
        public void UpdatesCdnKey_Akamai()
        {
            var result = _updateSample.UpdateCdnKey(_fixture.ProjectId, _fixture.LocationId, _fixture.TestCloudCdnKeyId, _fixture.Hostname, null, null, _fixture.AkamaiTokenKey);
            Assert.Equal(_fixture.TestCloudCdnKeyId, result.CdnKeyName.CdnKeyId);
            Assert.Equal(_fixture.Hostname, result.Hostname);
        }
    }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.datalakeanalytics.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.JsonFlatten;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** The parameters that can be used to update an existing Data Lake Analytics account. */
@JsonFlatten
@Fluent
public class UpdateDataLakeAnalyticsAccountParameters {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(UpdateDataLakeAnalyticsAccountParameters.class);

    /*
     * The resource tags.
     */
    @JsonProperty(value = "tags")
    private Map<String, String> tags;

    /*
     * The list of Data Lake Store accounts associated with this account.
     */
    @JsonProperty(value = "properties.dataLakeStoreAccounts")
    private List<UpdateDataLakeStoreWithAccountParameters> dataLakeStoreAccounts;

    /*
     * The list of Azure Blob storage accounts associated with this account.
     */
    @JsonProperty(value = "properties.storageAccounts")
    private List<UpdateStorageAccountWithAccountParameters> storageAccounts;

    /*
     * The list of compute policies associated with this account.
     */
    @JsonProperty(value = "properties.computePolicies")
    private List<UpdateComputePolicyWithAccountParameters> computePolicies;

    /*
     * The list of firewall rules associated with this account.
     */
    @JsonProperty(value = "properties.firewallRules")
    private List<UpdateFirewallRuleWithAccountParameters> firewallRules;

    /*
     * The current state of the IP address firewall for this account. Disabling
     * the firewall does not remove existing rules, they will just be ignored
     * until the firewall is re-enabled.
     */
    @JsonProperty(value = "properties.firewallState")
    private FirewallState firewallState;

    /*
     * The current state of allowing or disallowing IPs originating within
     * Azure through the firewall. If the firewall is disabled, this is not
     * enforced.
     */
    @JsonProperty(value = "properties.firewallAllowAzureIps")
    private FirewallAllowAzureIpsState firewallAllowAzureIps;

    /*
     * The commitment tier to use for next month.
     */
    @JsonProperty(value = "properties.newTier")
    private TierType newTier;

    /*
     * The maximum supported jobs running under the account at the same time.
     */
    @JsonProperty(value = "properties.maxJobCount")
    private Integer maxJobCount;

    /*
     * The maximum supported degree of parallelism for this account.
     */
    @JsonProperty(value = "properties.maxDegreeOfParallelism")
    private Integer maxDegreeOfParallelism;

    /*
     * The maximum supported degree of parallelism per job for this account.
     */
    @JsonProperty(value = "properties.maxDegreeOfParallelismPerJob")
    private Integer maxDegreeOfParallelismPerJob;

    /*
     * The minimum supported priority per job for this account.
     */
    @JsonProperty(value = "properties.minPriorityPerJob")
    private Integer minPriorityPerJob;

    /*
     * The number of days that job metadata is retained.
     */
    @JsonProperty(value = "properties.queryStoreRetention")
    private Integer queryStoreRetention;

    /**
     * Get the tags property: The resource tags.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: The resource tags.
     *
     * @param tags the tags value to set.
     * @return the UpdateDataLakeAnalyticsAccountParameters object itself.
     */
    public UpdateDataLakeAnalyticsAccountParameters withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the dataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this account.
     *
     * @return the dataLakeStoreAccounts value.
     */
    public List<UpdateDataLakeStoreWithAccountParameters> dataLakeStoreAccounts() {
        return this.dataLakeStoreAccounts;
    }

    /**
     * Set the dataLakeStoreAccounts property: The list of Data Lake Store accounts associated with this account.
     *
     * @param dataLakeStoreAccounts the dataLakeStoreAccounts value to set.
     * @return the UpdateDataLakeAnalyticsAccountParameters object itself.
     */
    public UpdateDataLakeAnalyticsAccountParameters withDataLakeStoreAccounts(
        List<UpdateDataLakeStoreWithAccountParameters> dataLakeStoreAccounts) {
        this.dataLakeStoreAccounts = dataLakeStoreAccounts;
        return this;
    }

    /**
     * Get the storageAccounts property: The list of Azure Blob storage accounts associated with this account.
     *
     * @return the storageAccounts value.
     */
    public List<UpdateStorageAccountWithAccountParameters> storageAccounts() {
        return this.storageAccounts;
    }

    /**
     * Set the storageAccounts property: The list of Azure Blob storage accounts associated with this account.
     *
     * @param storageAccounts the storageAccounts value to set.
     * @return the UpdateDataLakeAnalyticsAccountParameters object itself.
     */
    public UpdateDataLakeAnalyticsAccountParameters withStorageAccounts(
        List<UpdateStorageAccountWithAccountParameters> storageAccounts) {
        this.storageAccounts = storageAccounts;
        return this;
    }

    /**
     * Get the computePolicies property: The list of compute policies associated with this account.
     *
     * @return the computePolicies value.
     */
    public List<UpdateComputePolicyWithAccountParameters> computePolicies() {
        return this.computePolicies;
    }

    /**
     * Set the computePolicies property: The list of compute policies associated with this account.
     *
     * @param computePolicies the computePolicies value to set.
     * @return the UpdateDataLakeAnalyticsAccountParameters object itself.
     */
    public UpdateDataLakeAnalyticsAccountParameters withComputePolicies(
        List<UpdateComputePolicyWithAccountParameters> computePolicies) {
        this.computePolicies = computePolicies;
        return this;
    }

    /**
     * Get the firewallRules property: The list of firewall rules associated with this account.
     *
     * @return the firewallRules value.
     */
    public List<UpdateFirewallRuleWithAccountParameters> firewallRules() {
        return this.firewallRules;
    }

    /**
     * Set the firewallRules property: The list of firewall rules associated with this account.
     *
     * @param firewallRules the firewallRules value to set.
     * @return the UpdateDataLakeAnalyticsAccountParameters object itself.
     */
    public UpdateDataLakeAnalyticsAccountParameters withFirewallRules(
        List<UpdateFirewallRuleWithAccountParameters> firewallRules) {
        this.firewallRules = firewallRules;
        return this;
    }

    /**
     * Get the firewallState property: The current state of the IP address firewall for this account. Disabling the
     * firewall does not remove existing rules, they will just be ignored until the firewall is re-enabled.
     *
     * @return the firewallState value.
     */
    public FirewallState firewallState() {
        return this.firewallState;
    }

    /**
     * Set the firewallState property: The current state of the IP address firewall for this account. Disabling the
     * firewall does not remove existing rules, they will just be ignored until the firewall is re-enabled.
     *
     * @param firewallState the firewallState value to set.
     * @return the UpdateDataLakeAnalyticsAccountParameters object itself.
     */
    public UpdateDataLakeAnalyticsAccountParameters withFirewallState(FirewallState firewallState) {
        this.firewallState = firewallState;
        return this;
    }

    /**
     * Get the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure
     * through the firewall. If the firewall is disabled, this is not enforced.
     *
     * @return the firewallAllowAzureIps value.
     */
    public FirewallAllowAzureIpsState firewallAllowAzureIps() {
        return this.firewallAllowAzureIps;
    }

    /**
     * Set the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure
     * through the firewall. If the firewall is disabled, this is not enforced.
     *
     * @param firewallAllowAzureIps the firewallAllowAzureIps value to set.
     * @return the UpdateDataLakeAnalyticsAccountParameters object itself.
     */
    public UpdateDataLakeAnalyticsAccountParameters withFirewallAllowAzureIps(
        FirewallAllowAzureIpsState firewallAllowAzureIps) {
        this.firewallAllowAzureIps = firewallAllowAzureIps;
        return this;
    }

    /**
     * Get the newTier property: The commitment tier to use for next month.
     *
     * @return the newTier value.
     */
    public TierType newTier() {
        return this.newTier;
    }

    /**
     * Set the newTier property: The commitment tier to use for next month.
     *
     * @param newTier the newTier value to set.
     * @return the UpdateDataLakeAnalyticsAccountParameters object itself.
     */
    public UpdateDataLakeAnalyticsAccountParameters withNewTier(TierType newTier) {
        this.newTier = newTier;
        return this;
    }

    /**
     * Get the maxJobCount property: The maximum supported jobs running under the account at the same time.
     *
     * @return the maxJobCount value.
     */
    public Integer maxJobCount() {
        return this.maxJobCount;
    }

    /**
     * Set the maxJobCount property: The maximum supported jobs running under the account at the same time.
     *
     * @param maxJobCount the maxJobCount value to set.
     * @return the UpdateDataLakeAnalyticsAccountParameters object itself.
     */
    public UpdateDataLakeAnalyticsAccountParameters withMaxJobCount(Integer maxJobCount) {
        this.maxJobCount = maxJobCount;
        return this;
    }

    /**
     * Get the maxDegreeOfParallelism property: The maximum supported degree of parallelism for this account.
     *
     * @return the maxDegreeOfParallelism value.
     */
    public Integer maxDegreeOfParallelism() {
        return this.maxDegreeOfParallelism;
    }

    /**
     * Set the maxDegreeOfParallelism property: The maximum supported degree of parallelism for this account.
     *
     * @param maxDegreeOfParallelism the maxDegreeOfParallelism value to set.
     * @return the UpdateDataLakeAnalyticsAccountParameters object itself.
     */
    public UpdateDataLakeAnalyticsAccountParameters withMaxDegreeOfParallelism(Integer maxDegreeOfParallelism) {
        this.maxDegreeOfParallelism = maxDegreeOfParallelism;
        return this;
    }

    /**
     * Get the maxDegreeOfParallelismPerJob property: The maximum supported degree of parallelism per job for this
     * account.
     *
     * @return the maxDegreeOfParallelismPerJob value.
     */
    public Integer maxDegreeOfParallelismPerJob() {
        return this.maxDegreeOfParallelismPerJob;
    }

    /**
     * Set the maxDegreeOfParallelismPerJob property: The maximum supported degree of parallelism per job for this
     * account.
     *
     * @param maxDegreeOfParallelismPerJob the maxDegreeOfParallelismPerJob value to set.
     * @return the UpdateDataLakeAnalyticsAccountParameters object itself.
     */
    public UpdateDataLakeAnalyticsAccountParameters withMaxDegreeOfParallelismPerJob(
        Integer maxDegreeOfParallelismPerJob) {
        this.maxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob;
        return this;
    }

    /**
     * Get the minPriorityPerJob property: The minimum supported priority per job for this account.
     *
     * @return the minPriorityPerJob value.
     */
    public Integer minPriorityPerJob() {
        return this.minPriorityPerJob;
    }

    /**
     * Set the minPriorityPerJob property: The minimum supported priority per job for this account.
     *
     * @param minPriorityPerJob the minPriorityPerJob value to set.
     * @return the UpdateDataLakeAnalyticsAccountParameters object itself.
     */
    public UpdateDataLakeAnalyticsAccountParameters withMinPriorityPerJob(Integer minPriorityPerJob) {
        this.minPriorityPerJob = minPriorityPerJob;
        return this;
    }

    /**
     * Get the queryStoreRetention property: The number of days that job metadata is retained.
     *
     * @return the queryStoreRetention value.
     */
    public Integer queryStoreRetention() {
        return this.queryStoreRetention;
    }

    /**
     * Set the queryStoreRetention property: The number of days that job metadata is retained.
     *
     * @param queryStoreRetention the queryStoreRetention value to set.
     * @return the UpdateDataLakeAnalyticsAccountParameters object itself.
     */
    public UpdateDataLakeAnalyticsAccountParameters withQueryStoreRetention(Integer queryStoreRetention) {
        this.queryStoreRetention = queryStoreRetention;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (dataLakeStoreAccounts() != null) {
            dataLakeStoreAccounts().forEach(e -> e.validate());
        }
        if (storageAccounts() != null) {
            storageAccounts().forEach(e -> e.validate());
        }
        if (computePolicies() != null) {
            computePolicies().forEach(e -> e.validate());
        }
        if (firewallRules() != null) {
            firewallRules().forEach(e -> e.validate());
        }
    }
}


text:
import java.io.File;
import java.util.ArrayList;
import java.util.Scanner;

// each node has a name and n vertices with weights and targets
// Each node could also have a current weight and previous to track graph traversal.

public class Main {

	public class Edge {
		private final int target;
		private final int weight;
		private final char direction; // debugging hint

		public Edge(int target, int weight, char direction){
			this.target = target;
			this.weight = weight;
			this.direction = direction;
		}

		public int getTarget(){
			return this.target;
		}

		public int getWeight() {
			return this.weight;
		}

		public char getDirection() {
			return direction;
		}
	}

	public class Node {
		private final String name;
		private final ArrayList<Edge> edges = new ArrayList<Edge>();
		private int sum = Integer.MAX_VALUE;
		private int prev = -1;
		private boolean visited = false;
		private final int weight;

		public Node(String name, int weight) {
			this.name = name;
			this.weight = weight;
		}

		public void addEdge(int dest, int weight, char direction) {
			edges.add(new Edge(dest,weight, direction));
		}

		public void addPrevious(int sum, int previous) {
			this.setSum(sum);
			this.setPrev(previous);
		}

		public String getName() {
			return name;
		}

		public int getSum() {
			return sum;
		}

		public void setSum(int sum) {
			this.sum = sum;
		}

		public int getPrev() {
			return prev;
		}

		public void setPrev(int prev) {
			this.prev = prev;
		}

		public ArrayList<Edge> getEdges() {
			return edges;
		}

		public int getWeight() {
			return weight;
		}

		public boolean isVisited() {
			return visited;
		}

		public void setVisited(boolean visited) {
			this.visited = visited;
		}
	}

	Node[] tree = null;

	public void addEdge(int src, int dest, int weight, char direction){
		tree[src].addEdge(dest, weight, direction);
	}

	public int getTimeAtPositionWithDimensions(int x, int M, int y, int N) {
		Node n = tree[y * (M - 1) + x];
		return n.sum;

	}
	public void dijkstra(boolean print) {
		tree[0].sum = tree[0].weight;
		tree[0].visited = true;
		for(int i = 0; i < tree.length; i++) {
			Node node = tree[i];
			Node minNode = node;
			int minDist = Integer.MAX_VALUE;
			for(int j = 0; j < tree.length; j++) {
				if( print) {
					System.out.printf("Node %d: weight = %d; sum = %d; prev = %d\n", i, node.getWeight(), node.getSum(), node.getPrev());
				} else {
					if(tree[j].sum < minDist && !tree[j].visited) {
						minNode = tree[j];
						minDist = minNode.sum;
					}
				}
			}
			dijkstraOnNode(minNode, i, print);
		}
	}

	public int dijkstraOnNode(Node node, int curr, boolean print) {
		ArrayList<Edge> edges = node.getEdges();
		for( int j = 0; j < edges.size(); j++) {
			Edge edge = edges.get(j);
			Node target = tree[edge.getTarget()];
			if( !print ) {
				int targetSum = target.getSum();
				if (node.sum + edge.weight + target.weight < targetSum) {
					target.setSum(node.sum + edge.weight + target.weight);
					target.setPrev(curr);
					if( edge.getTarget() < curr ) {// backtracking
						return edge.getTarget();
					}
				}
			} else {
				System.out.printf("  Edge %d: target = %d, direction = %c, weight = %d\n", j, edge.getTarget(), edge.getDirection(), edge.getWeight());
			}
		}
		node.visited = true;
		return curr;
	}

	public static void main(String[] args){
		Main graph = new Main();

		int M;
		int N;
		//File file = new File("/Users/dave/code/algorithms/codechef/nikhilsDungeon/sample2.txt");
		Scanner scanner = null;
		try {
            scanner = new Scanner(System.in);
        } catch (Exception e) {
        System.out.println(e);
        }

		M = scanner.nextInt(); // # of rows (ie y)
		N = scanner.nextInt(); // # of columns (ie x)
		graph.tree = new Node[N*M];

		for(int i = 0; i < M; i++) {
			for(int j = 0; j < N; j++) {
				int t = scanner.nextInt();
				graph.tree[i * N + j] = graph.new Node("", t);
			}
		}

		int locY = scanner.nextInt();
		int locX = scanner.nextInt();
		int time = scanner.nextInt();

		// M = 3; N = 4
		// 0,0 = 0; 0,1 = 1; 0,2 = 2; 0,3 = 3; 1,0 = 4;
		// 3,4 = 11 (last node x = 2, y = 3, m = 3; y * M + x = 11, target =
		for(int y = 0; y < M; y++) {
			for( int x = 0; x < N; x++) {
				// Add Edges in all 4 directions except where x == 0 or x == M - 1 or y == 0 or y == N - 1
				// left
				if( x > 0) {
					graph.addEdge(y * N + x,  y * N + x - 1,  0, 'L');
				}
				// up
				if( y > 0) {
					graph.addEdge(y * N + x,  (y - 1 )* N + x,  0, 'U');
				}
				// right
				if( x < N - 1) {
					graph.addEdge(y * N + x,  y * N + x + 1,  0, 'R');
				}
				// down
				if( y < M - 1) {
					graph.addEdge(y * N + x,  (y + 1 )* N + x,  0, 'D');
				}
			}
		}
		//graph.dijkstra(true);
		graph.dijkstra(false);
		//graph.dijkstra(true);
		int fastest = graph.getTimeAtPositionWithDimensions(locX - 1, M, locY - 1, N);
		if( fastest <= time){
			System.out.println("YES");
			System.out.println(time - fastest );
		} else {
			System.out.println("NO");
		}
	}
}


text:
<?php
/**
 * ManagingPSTNBlacklistApi
 * PHP version 5
 *
 * @category Class
 * @package  Voximplant
 * @author   http://github.com/swagger-api/swagger-codegen
 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
 * @link     https://github.com/swagger-api/swagger-codegen
 */

/**
 * Voximplant HTTP API
 *
 * Voximplant HTTP API description
 *
 * OpenAPI spec version: 1.0.0
 * Contact: info@voximplant.com
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 *
 * 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.
 */

/**
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen
 * Do not edit the class manually.
 */

namespace Voximplant\Api;

use \Voximplant\Configuration;
use \Voximplant\ApiClient;
use \Voximplant\ApiException;
use \Voximplant\ObjectSerializer;

/**
 * ManagingPSTNBlacklistApi Class Doc Comment
 *
 * @category Class
 * @package  Voximplant
 * @author   http://github.com/swagger-api/swagger-codegen
 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
 * @link     https://github.com/swagger-api/swagger-codegen
 */
class ManagingPSTNBlacklistApi
{

    /**
     * API Client
     *
     * @var \Voximplant\ApiClient instance of the ApiClient
     */
    protected $apiClient;

    /**
     * Constructor
     *
     * @param \Voximplant\ApiClient|null $apiClient The api client to use
     */
    public function __construct(\Voximplant\ApiClient $apiClient = null)
    {
        if ($apiClient == null) {
            $apiClient = new ApiClient();
            $apiClient->getConfig()->setHost('https://api.voximplant.com/platform_api/');
        }

        $this->apiClient = $apiClient;
    }

    /**
     * Get API client
     *
     * @return \Voximplant\ApiClient get the API client
     */
    public function getApiClient()
    {
        return $this->apiClient;
    }

    /**
     * Set the API client
     *
     * @param \Voximplant\ApiClient $apiClient set the API client
     *
     * @return ManagingPSTNBlacklistApi
     */
    public function setApiClient(\Voximplant\ApiClient $apiClient)
    {
        $this->apiClient = $apiClient;
        return $this;
    }

    /**
     * Operation addPstnBlackListItem
     *
     *
     *
     * @param string $pstn_blacklist_phone The phone number in format e164. (required)
     * @return \Voximplant\Model\AddPstnBlackListItemAPIResponse
     * @throws \Voximplant\ApiException on non-2xx response
     */
    public function addPstnBlackListItem($pstn_blacklist_phone)
    {
        list($response) = $this->addPstnBlackListItemWithHttpInfo($pstn_blacklist_phone);
        return $response;
    }

    /**
     * Operation addPstnBlackListItemWithHttpInfo
     *
     *
     *
     * @param string $pstn_blacklist_phone The phone number in format e164. (required)
     * @return Array of \Voximplant\Model\AddPstnBlackListItemAPIResponse, HTTP status code, HTTP response headers (array of strings)
     * @throws \Voximplant\ApiException on non-2xx response
     */
    public function addPstnBlackListItemWithHttpInfo($pstn_blacklist_phone)
    {
        // verify the required parameter 'pstn_blacklist_phone' is set
        if ($pstn_blacklist_phone === null) {
            throw new \InvalidArgumentException('Missing the required parameter $pstn_blacklist_phone when calling addPstnBlackListItem');
        }
        // parse inputs
        $resourcePath = "/AddPstnBlackListItem";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/x-www-form-urlencoded'));

        // default format to json
        $resourcePath = str_replace("{format}", "json", $resourcePath);

        // form params
        if ($pstn_blacklist_phone !== null) {
            $formParams['pstn_blacklist_phone'] = $this->apiClient->getSerializer()->toFormValue($pstn_blacklist_phone);
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
        if (strlen($apiKey) !== 0) {
            $queryParams['api_key'] = $apiKey;
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('account_name');
        if (strlen($apiKey) !== 0) {
            $queryParams['account_name'] = $apiKey;
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'POST',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Voximplant\Model\AddPstnBlackListItemAPIResponse',
                '/AddPstnBlackListItem'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Voximplant\Model\AddPstnBlackListItemAPIResponse', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Voximplant\Model\AddPstnBlackListItemAPIResponse', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation delPstnBlackListItem
     *
     *
     *
     * @param float $pstn_blacklist_id The PSTN black list item ID. (required)
     * @return \Voximplant\Model\ActivateCallerIDAPIResponse
     * @throws \Voximplant\ApiException on non-2xx response
     */
    public function delPstnBlackListItem($pstn_blacklist_id)
    {
        list($response) = $this->delPstnBlackListItemWithHttpInfo($pstn_blacklist_id);
        return $response;
    }

    /**
     * Operation delPstnBlackListItemWithHttpInfo
     *
     *
     *
     * @param float $pstn_blacklist_id The PSTN black list item ID. (required)
     * @return Array of \Voximplant\Model\ActivateCallerIDAPIResponse, HTTP status code, HTTP response headers (array of strings)
     * @throws \Voximplant\ApiException on non-2xx response
     */
    public function delPstnBlackListItemWithHttpInfo($pstn_blacklist_id)
    {
        // verify the required parameter 'pstn_blacklist_id' is set
        if ($pstn_blacklist_id === null) {
            throw new \InvalidArgumentException('Missing the required parameter $pstn_blacklist_id when calling delPstnBlackListItem');
        }
        // parse inputs
        $resourcePath = "/DelPstnBlackListItem";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/x-www-form-urlencoded'));

        // default format to json
        $resourcePath = str_replace("{format}", "json", $resourcePath);

        // form params
        if ($pstn_blacklist_id !== null) {
            $formParams['pstn_blacklist_id'] = $this->apiClient->getSerializer()->toFormValue($pstn_blacklist_id);
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
        if (strlen($apiKey) !== 0) {
            $queryParams['api_key'] = $apiKey;
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('account_name');
        if (strlen($apiKey) !== 0) {
            $queryParams['account_name'] = $apiKey;
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'POST',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Voximplant\Model\ActivateCallerIDAPIResponse',
                '/DelPstnBlackListItem'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Voximplant\Model\ActivateCallerIDAPIResponse', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Voximplant\Model\ActivateCallerIDAPIResponse', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation getPstnBlackList
     *
     *
     *
     * @param float $pstn_blacklist_id The PSTN black list item ID for filter. (optional)
     * @param string $pstn_blacklist_phone The phone number in format e164 for filter. (optional)
     * @param float $count The max returning record count. (optional)
     * @param float $offset The record count to omit. (optional)
     * @return \Voximplant\Model\GetPstnBlackListAPIResponse
     * @throws \Voximplant\ApiException on non-2xx response
     */
    public function getPstnBlackList($pstn_blacklist_id = null, $pstn_blacklist_phone = null, $count = null, $offset = null)
    {
        list($response) = $this->getPstnBlackListWithHttpInfo($pstn_blacklist_id, $pstn_blacklist_phone, $count, $offset);
        return $response;
    }

    /**
     * Operation getPstnBlackListWithHttpInfo
     *
     *
     *
     * @param float $pstn_blacklist_id The PSTN black list item ID for filter. (optional)
     * @param string $pstn_blacklist_phone The phone number in format e164 for filter. (optional)
     * @param float $count The max returning record count. (optional)
     * @param float $offset The record count to omit. (optional)
     * @return Array of \Voximplant\Model\GetPstnBlackListAPIResponse, HTTP status code, HTTP response headers (array of strings)
     * @throws \Voximplant\ApiException on non-2xx response
     */
    public function getPstnBlackListWithHttpInfo($pstn_blacklist_id = null, $pstn_blacklist_phone = null, $count = null, $offset = null)
    {
        // parse inputs
        $resourcePath = "/GetPstnBlackList";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/x-www-form-urlencoded'));

        // default format to json
        $resourcePath = str_replace("{format}", "json", $resourcePath);

        // form params
        if ($pstn_blacklist_id !== null) {
            $formParams['pstn_blacklist_id'] = $this->apiClient->getSerializer()->toFormValue($pstn_blacklist_id);
        }
        // form params
        if ($pstn_blacklist_phone !== null) {
            $formParams['pstn_blacklist_phone'] = $this->apiClient->getSerializer()->toFormValue($pstn_blacklist_phone);
        }
        // form params
        if ($count !== null) {
            $formParams['count'] = $this->apiClient->getSerializer()->toFormValue($count);
        }
        // form params
        if ($offset !== null) {
            $formParams['offset'] = $this->apiClient->getSerializer()->toFormValue($offset);
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
        if (strlen($apiKey) !== 0) {
            $queryParams['api_key'] = $apiKey;
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('account_name');
        if (strlen($apiKey) !== 0) {
            $queryParams['account_name'] = $apiKey;
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'POST',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Voximplant\Model\GetPstnBlackListAPIResponse',
                '/GetPstnBlackList'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Voximplant\Model\GetPstnBlackListAPIResponse', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Voximplant\Model\GetPstnBlackListAPIResponse', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

    /**
     * Operation setPstnBlackListItem
     *
     *
     *
     * @param float $pstn_blacklist_id The PSTN black list item ID. (required)
     * @param string $pstn_blacklist_phone The new phone number in format e164. (required)
     * @return \Voximplant\Model\ActivateCallerIDAPIResponse
     * @throws \Voximplant\ApiException on non-2xx response
     */
    public function setPstnBlackListItem($pstn_blacklist_id, $pstn_blacklist_phone)
    {
        list($response) = $this->setPstnBlackListItemWithHttpInfo($pstn_blacklist_id, $pstn_blacklist_phone);
        return $response;
    }

    /**
     * Operation setPstnBlackListItemWithHttpInfo
     *
     *
     *
     * @param float $pstn_blacklist_id The PSTN black list item ID. (required)
     * @param string $pstn_blacklist_phone The new phone number in format e164. (required)
     * @return Array of \Voximplant\Model\ActivateCallerIDAPIResponse, HTTP status code, HTTP response headers (array of strings)
     * @throws \Voximplant\ApiException on non-2xx response
     */
    public function setPstnBlackListItemWithHttpInfo($pstn_blacklist_id, $pstn_blacklist_phone)
    {
        // verify the required parameter 'pstn_blacklist_id' is set
        if ($pstn_blacklist_id === null) {
            throw new \InvalidArgumentException('Missing the required parameter $pstn_blacklist_id when calling setPstnBlackListItem');
        }
        // verify the required parameter 'pstn_blacklist_phone' is set
        if ($pstn_blacklist_phone === null) {
            throw new \InvalidArgumentException('Missing the required parameter $pstn_blacklist_phone when calling setPstnBlackListItem');
        }
        // parse inputs
        $resourcePath = "/SetPstnBlackListItem";
        $httpBody = '';
        $queryParams = array();
        $headerParams = array();
        $formParams = array();
        $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json'));
        if (!is_null($_header_accept)) {
            $headerParams['Accept'] = $_header_accept;
        }
        $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/x-www-form-urlencoded'));

        // default format to json
        $resourcePath = str_replace("{format}", "json", $resourcePath);

        // form params
        if ($pstn_blacklist_id !== null) {
            $formParams['pstn_blacklist_id'] = $this->apiClient->getSerializer()->toFormValue($pstn_blacklist_id);
        }
        // form params
        if ($pstn_blacklist_phone !== null) {
            $formParams['pstn_blacklist_phone'] = $this->apiClient->getSerializer()->toFormValue($pstn_blacklist_phone);
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            $httpBody = $_tempBody; // $_tempBody is the method argument, if present
        } elseif (count($formParams) > 0) {
            $httpBody = $formParams; // for HTTP post (form)
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('api_key');
        if (strlen($apiKey) !== 0) {
            $queryParams['api_key'] = $apiKey;
        }
        // this endpoint requires API key authentication
        $apiKey = $this->apiClient->getApiKeyWithPrefix('account_name');
        if (strlen($apiKey) !== 0) {
            $queryParams['account_name'] = $apiKey;
        }
        // make the API Call
        try {
            list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
                $resourcePath,
                'POST',
                $queryParams,
                $httpBody,
                $headerParams,
                '\Voximplant\Model\ActivateCallerIDAPIResponse',
                '/SetPstnBlackListItem'
            );

            return array($this->apiClient->getSerializer()->deserialize($response, '\Voximplant\Model\ActivateCallerIDAPIResponse', $httpHeader), $statusCode, $httpHeader);
        } catch (ApiException $e) {
            switch ($e->getCode()) {
                case 200:
                    $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Voximplant\Model\ActivateCallerIDAPIResponse', $e->getResponseHeaders());
                    $e->setResponseObject($data);
                    break;
            }

            throw $e;
        }
    }

}


text:
<component name="libraryTable">
  <library name="kotlinx-serialization-json" type="repository">
    <properties include-transitive-deps="false" maven-id="org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.3.3" />
    <CLASSES>
      <root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/kotlinx/kotlinx-serialization-json-jvm/1.3.3/kotlinx-serialization-json-jvm-1.3.3.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$MAVEN_REPOSITORY$/org/jetbrains/kotlinx/kotlinx-serialization-json-jvm/1.3.3/kotlinx-serialization-json-jvm-1.3.3-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
'use strict';

angular.module('shows.43n79w.comApp')
  .service('concertsService', ['$timeout', '$http', function concertsService($timeout, $http) {
    return {
      findAll: function () {
        var dfr = {
          successCallback: null,
          resolve: function (concerts) {
            dfr.successCallback(concerts);
          },
          success: function (successHandler) {
            dfr.successCallback = successHandler;
            return {
              error: function () {}
            };
          },
          error: function () {
          }
        };

        var xhr = $http.get('/json/shows.json');

        xhr.success(function (data /*, status, headers, config */) {
          var concerts = data.shows;
          for (var i = 0, length = concerts.length; i < length; i++) {
            concerts[i].date = new Date(concerts[i].date);
          }

          //console.log('concerts', concerts);
          dfr.resolve(concerts);
        });

        return dfr;
      },
      groupByDate: function (concerts) {
        var dates = {};
        for (var i = 0, length = concerts.length; i < length; i++) {
          var date = concerts[i].date.toISOString();

          if (! dates[date]) {
            dates[date] = [];
          }
          dates[date].push(concerts[i]);
        }

        return dates;
      },
      groupByVenues: function (concerts) {
        var venues = {};
        for (var i = 0, length = concerts.length; i < length; i++) {
          var venue = concerts[i].venue;

          if (! venues[venue]) {
            venues[venue] = [];
          }
          venues[venue].push(concerts[i]);
        }

        return venues;
      },
      sort: function (concerts, options) {
        var sortFn;
        if (options && options.sortBy) {
          switch (options.sortBy) {
          case 'date':
            sortFn = function (a, b) {
              return a.date - b.date;
            };
            break;
          default:
            sortFn = function (a, b) {
              if (a.artist < b.artist) {
                return -1;
              }
              else {
                return 1;
              }
              return 0;
            };
            break;
          }
        }
        concerts.sort(sortFn);
      }
    };
  }]);


text:
namespace _3DMath
{
	class Line;
	class LineSegment;
	class Vector;
	class AffineTransform;
	class LinearTransform;
}

class _3DMATH_API _3DMath::Line
{
public:

	Line( void );
	Line( const Vector& center, const Vector& normal );
	Line( const LineSegment& lineSegment );
	~Line( void );

	double ShortestDistance( const Vector& point ) const;
	void Reflect( Vector& vector ) const;
	void GetIdealCenter( Vector& point ) const;
	void Lerp( double lambda, Vector& point ) const;
	void Transform( const AffineTransform& affineTransform, const LinearTransform* normalTransform = nullptr );

	Vector center, normal;
};

// Line.h


text:
using namespace MI;

const wchar_t* MI::MI_RESULT_STRINGS[] =
{
    L"MI_RESULT_OK",
    L"MI_RESULT_FAILED",
    L"MI_RESULT_ACCESS_DENIED",
    L"MI_RESULT_INVALID_NAMESPACE",
    L"MI_RESULT_INVALID_PARAMETER",
    L"MI_RESULT_INVALID_CLASS",
    L"MI_RESULT_NOT_FOUND",
    L"MI_RESULT_NOT_SUPPORTED",
    L"MI_RESULT_CLASS_HAS_CHILDREN",
    L"MI_RESULT_CLASS_HAS_INSTANCES",
    L"MI_RESULT_INVALID_SUPERCLASS",
    L"MI_RESULT_ALREADY_EXISTS",
    L"MI_RESULT_NO_SUCH_PROPERTY",
    L"MI_RESULT_TYPE_MISMATCH",
    L"MI_RESULT_QUERY_LANGUAGE_NOT_SUPPORTED",
    L"MI_RESULT_INVALID_QUERY",
    L"MI_RESULT_METHOD_NOT_AVAILABLE",
    L"MI_RESULT_METHOD_NOT_FOUND",
    L"MI_RESULT_NAMESPACE_NOT_EMPTY",
    L"MI_RESULT_INVALID_ENUMERATION_CONTEXT",
    L"MI_RESULT_INVALID_OPERATION_TIMEOUT",
    L"MI_RESULT_PULL_HAS_BEEN_ABANDONED",
    L"MI_RESULT_PULL_CANNOT_BE_ABANDONED",
    L"MI_RESULT_FILTERED_ENUMERATION_NOT_SUPPORTED",
    L"MI_RESULT_CONTINUATION_ON_ERROR_NOT_SUPPORTED",
    L"MI_RESULT_SERVER_LIMITS_EXCEEDED",
    L"MI_RESULT_SERVER_IS_SHUTTING_DOWN"
};

const char* Exception::what() const
{
    return this->m_message.c_str();
}

void Exception::SetMessageFromWString(const std::wstring& message)
{
    // Convert to UTF8
    std::wstring_convert<std::codecvt_utf8<wchar_t>, wchar_t> cv;
    this->m_message = cv.to_bytes(message).c_str();
}

std::wstring MIException::MIResultToWString(MI_Result miResult) const
{

    if (miResult < sizeof(MI_RESULT_STRINGS) / sizeof(MI_RESULT_STRINGS[0]))
    {
        return MI_RESULT_STRINGS[miResult];
    }
    else
    {
        return L"Unknown MI_Result";
    }
}

MIException::MIException(MI_Result result, MI_Uint32 errorCode, const std::wstring& message) :
    m_result(result), m_errorCode(errorCode), Exception(message)
{
    if (!message.length())
    {
        this->SetMessageFromWString(this->MIResultToWString(this->m_result));
    }
}


text: Experimentala MV** lua framework for Fengari