text:
namespace mtao::opengl {

    template <>
        void Drawable<Shaders::Flat2D>::gui(const std::string& name_) {

            std::string name = name_;
            if(name.empty()) {
                name = "Flat Shader";
            }
            if(ImGui::TreeNode(name.c_str())) {
                ImGui::Checkbox("Visible", &visible);
                ImGui::ColorEdit4("Color", _data.color.data());
                ImGui::TreePop();
            }
        }

    template <>
        void Drawable<Shaders::VertexColor2D>::gui(const std::string& name_) {
            std::string name = name_;
            if(name.empty()) {
                name = "Vertex Color Shader";
            }
            if(ImGui::TreeNode(name.c_str())) {
                ImGui::Checkbox("Visible", &visible);
                ImGui::TreePop();
            }
        }
    template <>
        void Drawable<Shaders::Flat2D>::set_buffers() {
            _mesh.addVertexBuffer(_mesh.vertex_buffer, 0, Shaders::Flat2D::Position{});
            _shader.setColor(_data.color);
            if(_shader.flags() & Shaders::Flat2D::Flag::AlphaMask) {
                _shader.setAlphaMask(_data.alpha_mask);
            }
        }
    template <>
        void Drawable<Shaders::VertexColor2D>::set_buffers() {
            _mesh.addVertexBuffer(_mesh.vertex_buffer, 0, Shaders::VertexColor2D::Position{});
            _mesh.addVertexBuffer(_mesh.color_buffer, 0, Shaders::VertexColor2D::Color4{});
        }

    template <>
        void Drawable<Shaders::Flat3D>::gui(const std::string& name_) {
            std::string name = name_;
            if(name.empty()) {
                name = "Flat Shader";
            }
            if(ImGui::TreeNode(name.c_str())) {
                ImGui::Checkbox("Visible", &visible);
                ImGui::ColorEdit4("Color", _data.color.data());
                ImGui::TreePop();
            }
        }
    template <>
        void Drawable<Shaders::VertexColor3D>::gui(const std::string& name_) {
            std::string name = name_;
            if(name.empty()) {
                name = "Vertex Color Shader";
            }
            if(ImGui::TreeNode(name.c_str())) {
                ImGui::Checkbox("Visible", &visible);
                ImGui::TreePop();
            }
        }
    template <>
        void Drawable<Shaders::Phong>::gui(const std::string& name_) {
            std::string name = name_;
            if(name.empty()) {
                name = "Phong Shader";
            }
            if(ImGui::TreeNode(name.c_str())) {
                ImGui::Checkbox("Visible", &visible);
                ImGui::ColorEdit4("Ambient Color", _data.ambient_color.data());
                if(_shader.flags() & Magnum::Shaders::Phong::Flag::VertexColor) {
                    ImGui::Text("Vertex Color Mode Specifies Diffuse");
                } else {
                ImGui::ColorEdit4("Diffuse Color", _data.diffuse_color.data());
                }
                ImGui::ColorEdit4("Specular Color", _data.specular_color.data());

                ImGui::SliderFloat("Shininess", &_data.shininess, 0., 100.);
                {
                    ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_None;
                    if(ImGui::BeginTabBar("Lights", tab_bar_flags)) {
                        for(size_t i = 0; i < _data.light_positions.size(); ++i) {

                            std::stringstream ss;
                            ss << i;
                            if(ImGui::BeginTabItem(ss.str().c_str())) {
                                ImGui::SliderFloat3("Light Position", _data.light_positions[i].data(),-100.,100.);
                                ImGui::ColorEdit4("Light Color", _data.light_colors[i].data());
                                ImGui::EndTabItem();
                            }
                        }
                        ImGui::EndTabBar();
                    }
                }
                ImGui::TreePop();
            }
            //if(_shader.flags() & Shaders::Phong::Flag::AlphaMask) {
            //    _shader.setAlphaMask(_data.alpha_mask);
            //}
        }
    template <>
        void Drawable<Shaders::MeshVisualizer>::gui(const std::string& name_) {
            std::string name = name_;
            if(name.empty()) {
                name = "Mesh Visualizer Shader";
            }
            if(ImGui::TreeNode(name.c_str())) {
                ImGui::Checkbox("Visible", &visible);
                ImGui::ColorEdit4("Color", _data.color.data());
                ImGui::ColorEdit4("Wireframe Color", _data.wireframe_color.data());
                ImGui::SliderFloat("Wireframe Width", &_data.wireframe_width,0.,10.);
                ImGui::SliderFloat("Smoothness", &_data.smoothness,0.,10.);
                ImGui::TreePop();
            }
        }
    template <>
        void Drawable<Shaders::Flat3D>::set_buffers() {
            _mesh.addVertexBuffer(_mesh.vertex_buffer, 0, Shaders::Flat3D::Position{});
            _shader.setColor(_data.color);
            if(_shader.flags() & Shaders::Flat3D::Flag::AlphaMask) {
                _shader.setAlphaMask(_data.alpha_mask);
            }
        }
    template <>
        void Drawable<Shaders::VertexColor3D>::set_buffers() {
            _mesh.addVertexBuffer(_mesh.vertex_buffer, 0, Shaders::VertexColor3D::Position{});
            _mesh.addVertexBuffer(_mesh.color_buffer, 0, Shaders::VertexColor3D::Color4{});
        }
    template <>
        void Drawable<Shaders::Phong>::set_buffers() {
            _mesh.addVertexBuffer(_mesh.vertex_buffer, 0, Shaders::Phong::Position{});
            _mesh.addVertexBuffer(_mesh.normal_buffer, 0, Shaders::Phong::Normal{});
            _shader.setShininess(_data.shininess)
                .setLightPositions(_data.light_positions)
                .setLightColors(_data.light_colors);
            if(_shader.flags() & Shaders::Phong::Flag::AlphaMask) {
                _shader.setAlphaMask(_data.alpha_mask);
            }
            if(_shader.flags() & Shaders::Phong::Flag::VertexColor) {
                _mesh.addVertexBuffer(_mesh.color_buffer, 0, Shaders::Phong::Color4{});
                _shader
                .setAmbientColor(_data.ambient_color)
                .setSpecularColor(_data.specular_color);
            } else {

                _shader.setDiffuseColor(_data.diffuse_color)
                .setAmbientColor(_data.ambient_color)
                .setSpecularColor(_data.specular_color);
            }
        }
    template <>
        void Drawable<Shaders::MeshVisualizer>::set_buffers() {
            _mesh.addVertexBuffer(_mesh.vertex_buffer, 0, Shaders::MeshVisualizer::Position{});
            _shader.setColor(_data.color);
            if(_shader.flags() & Magnum::Shaders::MeshVisualizer::Flag::Wireframe) {
                _shader
                .setWireframeColor(_data.wireframe_color)
                .setWireframeWidth(_data.wireframe_width)
                .setSmoothness(_data.smoothness);
            }

            if(_data.viewport_size) {
                _shader.setViewportSize(*_data.viewport_size);
            } else {
                _shader.setViewportSize(Magnum::Vector2{GL::defaultFramebuffer.viewport().size()});
            }
        }
    template <>
        void Drawable<Shaders::Phong>::set_matrices(const Matrix4& transformationMatrix, SceneGraph::Camera3D& camera) {
            _shader.setTransformationMatrix(transformationMatrix)
                .setNormalMatrix(transformationMatrix.rotationScaling())
                .setProjectionMatrix(camera.projectionMatrix());
        }
    template <>
            bool Drawable<Shaders::VertexColor2D>::lint_buffers()  {
                bool ret = lint_vertex();
                if(edge_primitive) { ret &= lint_edge(); }
                if(triangle_primitive) { ret &= lint_triangle(); }
                ret &= lint_color();
                return ret;
            }
    template <>
            bool Drawable<Shaders::VertexColor3D>::lint_buffers()  {
                bool ret = lint_vertex();
                if(edge_primitive) { ret &= lint_edge(); }
                if(triangle_primitive) { ret &= lint_triangle(); }
                ret &= lint_color();
                return ret;
            }
    template <>
            bool Drawable<Shaders::Phong>::lint_buffers()  {
                bool ret = lint_vertex();
                if(edge_primitive) { ret &= lint_edge(); }
                if(triangle_primitive) { ret &= lint_triangle(); }
                ret &= lint_normal();
                return ret;
            }
}


text:
require "spec_helper"
require "hamster/list"

describe Hamster::List do
  describe "#<<" do
    it "adds an item onto the end of a list" do
      list = Hamster.list("a", "b")
      (list << "c").should eql(Hamster.list("a", "b", "c"))
      list.should eql(Hamster.list("a", "b"))
    end

    context "on an empty list" do
      it "returns a list with one item" do
        list = Hamster.list
        (list << "c").should eql(Hamster.list("c"))
        list.should eql(Hamster.list)
      end
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
'use strict';

describe('angularUserSettings.storage service', function() {

  var storage;

  beforeEach(module('angularUserSettings'));

  beforeEach(inject(function(_$injector_){
    storage = _$injector_.get('angularUserSettings.storage');
  }));

  it('should exist', function() {
    expect(storage).to.be.an('object');
  });

});


text:
import {HuntRunnerArgs} from '../api/api_interfaces';
import {SafetyLimits} from '../models/hunt';
import {assertNumber} from '../preconditions';

const TWO_WEEKS = 2 * 7 * 24 * 60 * 60;

/** Constructs a SafetyLimits from the HuntRunnerArgs */
export function translateSafetyLimits(args: HuntRunnerArgs): SafetyLimits {
  assertNumber(args.clientRate);

  return {
    clientRate: args.clientRate,
    crashLimit: BigInt(args.crashLimit ?? '0'),
    avgResultsPerClientLimit: BigInt(args.avgResultsPerClientLimit ?? '0'),
    avgCpuSecondsPerClientLimit:
        BigInt(args.avgCpuSecondsPerClientLimit ?? '0'),
    avgNetworkBytesPerClientLimit:
        BigInt(args.avgNetworkBytesPerClientLimit ?? '0'),
    cpuLimit: BigInt(args.cpuLimit ?? '0'),
    expiryTime: BigInt(args.expiryTime ?? TWO_WEEKS),
    networkBytesLimit: BigInt(args.networkBytesLimit ?? '0'),
  };
}


text:
describe Conversions do
  describe 'Coordinates' do
    it 'converts symbols' do
      expect(Coordinates(:a1)).to be_a_kind_of(Coordinates)
    end
    it 'converts arrays of integers' do
      @coordinates = Coordinates([6, 0])
      expect(@coordinates).to be_a_kind_of(Coordinates)
      expect(@coordinates.row).to eq Row(0)
      expect(@coordinates.column).to eq Column(6)
    end
  end
end


text:
package se.litsec.eidas.opensaml.metadata.impl;

import java.security.cert.CertificateEncodingException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import javax.xml.namespace.QName;

import org.opensaml.core.xml.XMLObject;
import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.core.xml.util.AttributeMap;
import org.opensaml.core.xml.util.XMLObjectChildrenList;
import org.opensaml.saml.common.AbstractSAMLObject;
import org.opensaml.xmlsec.signature.KeyInfo;
import org.opensaml.xmlsec.signature.X509Data;
import org.opensaml.xmlsec.signature.impl.KeyInfoBuilder;
import org.opensaml.xmlsec.signature.impl.X509CertificateBuilder;
import org.opensaml.xmlsec.signature.impl.X509DataBuilder;

import net.shibboleth.utilities.java.support.codec.Base64Support;
import se.litsec.eidas.opensaml.metadata.Endpoint;
import se.litsec.eidas.opensaml.metadata.MetadataLocation;

/**
 * Implementation class for {@link MetadataLocation}.
 *
 * @author Martin Lindström (martin.lindstrom@litsec.se)
 */
public class MetadataLocationImpl extends AbstractSAMLObject implements MetadataLocation {

  /** Endpoint children. */
  private final XMLObjectChildrenList<Endpoint> endpoints;

  /** Key info (certificate). */
  private KeyInfo keyInfo;

  /** The location attribute. */
  private String location;

  /** "anyAttribute" attributes */
  private final AttributeMap unknownAttributes;

  private static final QName suspendQname = new QName("Suspend");

  /**
   * Constructor.
   *
   * @param namespaceURI
   *          the namespace the element is in
   * @param elementLocalName
   *          the local name of the XML element this Object represents
   * @param namespacePrefix
   *          the prefix for the given namespace
   */
  public MetadataLocationImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
    super(namespaceURI, elementLocalName, namespacePrefix);
    this.endpoints = new XMLObjectChildrenList<Endpoint>(this);
    this.unknownAttributes = new AttributeMap(this);
  }

  /** {@inheritDoc} */
  @Override
  public List<XMLObject> getOrderedChildren() {
    ArrayList<XMLObject> children = new ArrayList<XMLObject>();
    children.addAll(this.endpoints);
    if (this.keyInfo != null) {
      children.add(this.keyInfo);
    }
    return Collections.unmodifiableList(children);
  }

  /** {@inheritDoc} */
  @Override
  public List<Endpoint> getEndpoints() {
    return this.endpoints;
  }

  /** {@inheritDoc} */
  @Override
  public KeyInfo getKeyInfo() {
    return this.keyInfo;
  }

  /** {@inheritDoc} */
  @Override
  public void setKeyInfo(KeyInfo keyInfo) {
    this.keyInfo = this.prepareForAssignment(this.keyInfo, keyInfo);
  }

  /** {@inheritDoc} */
  @Override
  public void setX509Certificate(X509Certificate certificate) {

    String encoding;
    try {
      encoding = Base64Support.encode(certificate.getEncoded(), true);
    }
    catch (CertificateEncodingException e) {
      throw new SecurityException("Failed to get certificate encoding", e);
    }
    org.opensaml.xmlsec.signature.X509Certificate cert = (new X509CertificateBuilder()).buildObject();
    cert.setValue(encoding);

    X509Data x509data = (new X509DataBuilder()).buildObject();
    x509data.getX509Certificates().add(cert);

    KeyInfo keyInfo = (new KeyInfoBuilder()).buildObject();
    keyInfo.getX509Datas().add(x509data);

    this.setKeyInfo(keyInfo);
  }

  /** {@inheritDoc} */
  @Override
  public String getLocation() {
    return this.location;
  }

  /** {@inheritDoc} */
  @Override
  public void setLocation(String location) {
    this.location = this.prepareForAssignment(this.location, location);
  }

  /** {@inheritDoc} */
  @Override
  public boolean getSuspend() {
    String v = this.unknownAttributes.getOrDefault(suspendQname, XSBooleanValue.toString(false, false));
    return XSBooleanValue.valueOf(v).getValue();
  }

  /** {@inheritDoc} */
  @Override
  public void setSuspend(boolean suspendFlag) {
    this.unknownAttributes.put(suspendQname, XSBooleanValue.toString(suspendFlag, false));
  }

  @Override
  public AttributeMap getUnknownAttributes() {
    return this.unknownAttributes;
  }

}


text:
<?php

namespace ATPViz\DataSource;

class DatabaseQuery extends AbstractDataSource
{
	public function getData()
	{
		$options = $this->getOptions();

		$db = $this->get($options['adapter']);
		$results = $db->query($options['query'])->execute();

		$indVar = isset($options['indVar']) ? $options['indVar'] : null;

		$rows = array();
		foreach($results as $row)
		{
			if(is_null($indVar))
			{
				$rows[] = $row;
			}
			else
			{
				$var = $row[$indVar];
				unset($row[$indVar]);
				$rows[$var] = $row;
			}
		}

		if(!isset($options['columns']))
		{
			throw new \Exception("Chart column definitions not set");
		}

		return array(
			'columns' => $options['columns'],
			'data' => $rows
		);
	}

}


text:
#include "testing/gunit.h"

#include <boost/asio.hpp>
#include <boost/bind.hpp>

#include "base/util.h"
#include "base/parse_object.h"
#include "base/contrail_ports.h"
#include "base/test/task_test_util.h"
#include "io/test/event_manager_test.h"

#include <sandesh/sandesh_types.h>
#include <sandesh/sandesh_constants.h>
#include <sandesh/sandesh_http.h>
#include <sandesh/sandesh.h>

#include "../viz_collector.h"
#include "../ruleeng.h"

#include "test/viz_collector_test_types.h"
#include "test/vizd_test_types.h"

#include "cdb_if_mock.h"
#include "OpServerProxyMock.h"
#include "viz_constants.h"

using namespace std;

using ::testing::Return;
using ::testing::Field;
using ::testing::AnyOf;
using ::testing::AnyNumber;
using ::testing::_;
using ::testing::Eq;
using ::testing::ElementsAre;

string sourcehost = "127.0.0.1";
string collector_server = "127.0.0.1";
short collector_port = 8180; //random server port

#define WAIT_FOR(Cond)                  \
do {                                    \
    for (int i = 0; i < 10000; i++) {  \
        if (Cond) break;                \
        usleep(1000);                   \
    }                                   \
    EXPECT_TRUE(Cond);                  \
} while (0)

class GeneratorTest {
public:
    GeneratorTest() :
        evm_(new EventManager()),
        thread_(new ServerThread(evm_.get())) {
        Sandesh::InitGenerator("GeneratorTest", sourcehost, "Test", "Test", evm_.get(),
                collector_server, collector_port, 0, NULL, true);

        thread_->Start();

        WAIT_FOR(Sandesh::SendReady());
    }

    ~GeneratorTest() {
        task_util::WaitForIdle();
        evm_->Shutdown();
        if (thread_.get() != NULL) {
            thread_->Join();
        }
        task_util::WaitForIdle();
    }

    void Shutdown() {
        task_util::WaitForIdle();
        Sandesh::Uninit();
    }

    void SendMessageAsync() {
        SANDESH_ASYNC_TEST1_SEND(100, "sat1string100");
        SANDESH_ASYNC_TEST1_SEND(101, "sat1string101");
        SANDESH_ASYNC_TEST1_SEND(102, "sat1string102");
    }

    void SendMessageUVETrace() {
        UveVirtualNetworkConfig uvevn;
        uvevn.set_name("abc-corp:vn02");
        uvevn.set_total_interfaces(10);
        uvevn.set_total_virtual_machines(5);
        uvevn.set_total_acl_rules(60);

        std::vector<std::string> vcn;
        uvevn.set_connected_networks(vcn);
        UveVirtualNetworkConfigTrace::Send(uvevn);

        UveVirtualNetworkAgent uvena;
        uvena.set_name("abc-corp:vn02");
        uvena.set_in_tpkts(40);
        uvena.set_total_acl_rules(55);

        std::vector<UveInterVnStats> vvn;
        UveInterVnStats vnstat;
        vnstat.set_other_vn("abc-corp:map-reduce-02");
        vnstat.set_tpkts(10);
        vnstat.set_bytes(1200);
        vvn.push_back(vnstat);

        uvena.set_in_stats(vvn);
        UveVirtualNetworkAgentTrace::Send(uvena);
    }

    std::auto_ptr<EventManager> evm_;
    std::auto_ptr<ServerThread> thread_;
};

class VizdTest : public ::testing::Test {
public:
    VizdTest() {
        evm_.reset(new EventManager());
        thread_.reset(new ServerThread(evm_.get()));

        osp_mock_ = (new OpServerProxyMock(evm_.get()));
        dbif_mock_ = (new CdbIfMock(evm_.get()->io_service(), boost::bind(&VizdTest::DbErrorHandlerFn, this)));
        DbHandler *db_handler(new DbHandler(dbif_mock_));
        Ruleeng *ruleeng(new Ruleeng(db_handler, osp_mock_));
        collector_ = new Collector(evm_.get(), collector_port, db_handler, ruleeng);

        analytics_.reset(new VizCollector(evm_.get(), db_handler, ruleeng,
                         collector_, osp_mock_));

        thread_->Start();
    }

    ~VizdTest() {
        task_util::WaitForIdle();
        WAIT_FOR(!analytics_->GetCollector()->HasSessions());
        task_util::WaitForIdle();
        evm_->Shutdown();
        if (thread_.get() != NULL) {
            thread_->Join();
        }
        task_util::WaitForIdle();
    }

    void DbErrorHandlerFn() {
        assert(0);
    }

    CdbIfMock *dbif_mock() {
        return dbif_mock_;
    }

    OpServerProxyMock *osp_mock() {
        return osp_mock_;
    }

    virtual void SetUp() {
    }

    virtual void TearDown() {
        analytics_->Shutdown();
        task_util::WaitForIdle();

        if (collector_) {
            TcpServerManager::DeleteServer(collector_);
            collector_ = NULL;
        }

        Sandesh::Uninit();
        task_util::WaitForIdle();
    }

    std::auto_ptr<ServerThread> thread_;
    std::auto_ptr<EventManager> evm_;
    CdbIfMock *dbif_mock_;
    OpServerProxyMock *osp_mock_;
    std::auto_ptr<VizCollector> analytics_;
    Collector *collector_;
};

TEST_F(VizdTest, MessagesTest) {
    EXPECT_CALL(*dbif_mock(),
            Db_Init())
        .Times(1)
        .WillOnce(Return(true));

    EXPECT_CALL(*dbif_mock(),
            Db_AddSetTablespace(g_viz_constants.COLLECTOR_KEYSPACE))
        .Times(1)
        .WillOnce(Return(true));

    EXPECT_CALL(*dbif_mock(),
            Db_GetColumnFamilies(::testing::_, ::testing::_))
        .Times(1)
        .WillOnce(Return());

    EXPECT_CALL(*dbif_mock(),
            Db_GetRangeSlices(::testing::_, ::testing::_, ::testing::_, ::testing::_))
        .Times(1)
        .WillOnce(Return(true));

    EXPECT_CALL(*dbif_mock(),
            Db_AddColumnfamily(::testing::_))
        .Times(AnyNumber())
        .WillRepeatedly(Return(true));

    analytics_->Init();

    //SANDESH_ASYNC_TEST1_SEND(100, "sat1string100");
    //SANDESH_ASYNC_TEST1_SEND(101, "sat1string101");
    //SANDESH_ASYNC_TEST1_SEND(102, "sat1string102");
    std::string temp_str0(sizeof(uint32_t), 0);
    put_value((uint8_t *)temp_str0.c_str(), sizeof(uint32_t), 1);

    EXPECT_CALL(*dbif_mock(),
            Db_AddColumn(AllOf(Field(&GenDb::Column::cfname_, g_viz_constants.COLLECTOR_GLOBAL_TABLE),
                Field(&GenDb::Column::columns_,
                    ElementsAre(
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.SOURCE),
                            Field(&GenDb::ColElement::elem_value, "127.0.0.1")),
                        ::testing::_, //NAMESPACE
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.MODULE),
                            Field(&GenDb::ColElement::elem_value, "GeneratorTest")),
                        ::testing::_, //TIMESTAMP
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.MESSAGE_TYPE),
                            Field(&GenDb::ColElement::elem_value, "SandeshAsyncTest1")),
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.SEQUENCE_NUM),
                            Field(&GenDb::ColElement::elem_value, temp_str0)),
                        ::testing::_, ::testing::_, ::testing::_)))))
        .Times(1)
        .WillOnce(Return(true));

    std::string temp_str1(sizeof(uint32_t), 0);
    put_value((uint8_t *)temp_str1.c_str(), sizeof(uint32_t), 2);
    EXPECT_CALL(*dbif_mock(),
            Db_AddColumn(AllOf(Field(&GenDb::Column::cfname_, g_viz_constants.COLLECTOR_GLOBAL_TABLE),
                Field(&GenDb::Column::columns_,
                    ElementsAre(
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.SOURCE),
                            Field(&GenDb::ColElement::elem_value, "127.0.0.1")),
                        ::testing::_, //NAMESPACE
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.MODULE),
                            Field(&GenDb::ColElement::elem_value, "GeneratorTest")),
                        ::testing::_, //TIMESTAMP
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.MESSAGE_TYPE),
                            Field(&GenDb::ColElement::elem_value, "SandeshAsyncTest1")),
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.SEQUENCE_NUM),
                            Field(&GenDb::ColElement::elem_value, temp_str1)),
                        ::testing::_, ::testing::_, ::testing::_)))))
        .Times(1)
        .WillOnce(Return(true));

    std::string temp_str2(sizeof(uint32_t), 0);
    put_value((uint8_t *)temp_str2.c_str(), sizeof(uint32_t), 3);
    EXPECT_CALL(*dbif_mock(),
            Db_AddColumn(AllOf(Field(&GenDb::Column::cfname_, g_viz_constants.COLLECTOR_GLOBAL_TABLE),
                Field(&GenDb::Column::columns_,
                    ElementsAre(
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.SOURCE),
                            Field(&GenDb::ColElement::elem_value, "127.0.0.1")),
                        ::testing::_, //NAMESPACE
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.MODULE),
                            Field(&GenDb::ColElement::elem_value, "GeneratorTest")),
                        ::testing::_, //TIMESTAMP
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.MESSAGE_TYPE),
                            Field(&GenDb::ColElement::elem_value, "SandeshAsyncTest1")),
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.SEQUENCE_NUM),
                            Field(&GenDb::ColElement::elem_value, temp_str2)),
                        ::testing::_, ::testing::_, ::testing::_)))))
        .Times(1)
        .WillOnce(Return(true));

    // instantiate a new generator
    GeneratorTest gentest;
    gentest.SendMessageAsync();

    EXPECT_CALL(*dbif_mock(),
            Db_AddColumn(AllOf(Field(&GenDb::Column::cfname_, g_viz_constants.COLLECTOR_GLOBAL_TABLE),
                Field(&GenDb::Column::columns_,
                    ElementsAre(
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.SOURCE),
                            Field(&GenDb::ColElement::elem_value, "127.0.0.1")),
                        ::testing::_, //NAMESPACE
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.MODULE),
                            Field(&GenDb::ColElement::elem_value, "GeneratorTest")),
                        ::testing::_, //TIMESTAMP
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.MESSAGE_TYPE),
                            Field(&GenDb::ColElement::elem_value, "UveVirtualNetworkConfigTrace")),
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.SEQUENCE_NUM),
                            Field(&GenDb::ColElement::elem_value, temp_str0)),
                        ::testing::_, ::testing::_, ::testing::_)))))
        .Times(1)
        .WillOnce(Return(true));

    EXPECT_CALL(*dbif_mock(),
            Db_AddColumn(AllOf(Field(&GenDb::Column::cfname_, g_viz_constants.COLLECTOR_GLOBAL_TABLE),
                Field(&GenDb::Column::columns_,
                    ElementsAre(
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.SOURCE),
                            Field(&GenDb::ColElement::elem_value, "127.0.0.1")),
                        ::testing::_, //NAMESPACE
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.MODULE),
                            Field(&GenDb::ColElement::elem_value, "GeneratorTest")),
                        ::testing::_, //TIMESTAMP
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.MESSAGE_TYPE),
                            Field(&GenDb::ColElement::elem_value, "UveVirtualNetworkAgentTrace")),
                        AllOf(Field(&GenDb::ColElement::elem_name, g_viz_constants.SEQUENCE_NUM),
                            Field(&GenDb::ColElement::elem_value, temp_str0)),
                        ::testing::_, ::testing::_, ::testing::_)))))
        .Times(1)
        .WillOnce(Return(true));

    // this includes all calls
    EXPECT_CALL(*dbif_mock(),
            Db_AddColumn(Field(&GenDb::Column::cfname_,
                    g_viz_constants.MESSAGE_TABLE_SOURCE)))
        .Times(5)
        .WillRepeatedly(Return(true));

    EXPECT_CALL(*dbif_mock(),
            Db_AddColumn(Field(&GenDb::Column::cfname_,
                    g_viz_constants.MESSAGE_TABLE_MODULE_ID)))
        .Times(5)
        .WillRepeatedly(Return(true));

    EXPECT_CALL(*dbif_mock(),
            Db_AddColumn(Field(&GenDb::Column::cfname_,
                    g_viz_constants.MESSAGE_TABLE_MESSAGE_TYPE)))
        .Times(5)
        .WillRepeatedly(Return(true));

    EXPECT_CALL(*dbif_mock(),
            Db_AddColumn(Field(&GenDb::Column::cfname_, "ObjectVNTable")))
        .Times(2)
        .WillRepeatedly(Return(true));

    EXPECT_CALL(*osp_mock(),
            UVEUpdate("UveVirtualNetworkConfig", "total_interfaces",
                      "127.0.0.1", "GeneratorTest",
                      "abc-corp:vn02", ::testing::_, ::testing::_,
                      ::testing::_, ::testing::_, ::testing::_))
        .Times(1)
        .WillOnce(Return(true));

    EXPECT_CALL(*osp_mock(),
            UVEUpdate("UveVirtualNetworkConfig", "total_virtual_machines",
                      "127.0.0.1", "GeneratorTest",
                      "abc-corp:vn02", ::testing::_, ::testing::_,
                      ::testing::_, ::testing::_, ::testing::_))
        .Times(1)
        .WillOnce(Return(true));

    EXPECT_CALL(*osp_mock(),
            UVEUpdate("UveVirtualNetworkConfig", "connected_networks",
                      "127.0.0.1", "GeneratorTest",
                      "abc-corp:vn02", ::testing::_, ::testing::_,
                      ::testing::_, ::testing::_, ::testing::_))
        .Times(1)
        .WillOnce(Return(true));

    EXPECT_CALL(*osp_mock(),
            UVEUpdate("UveVirtualNetworkConfig", "total_acl_rules",
                      "127.0.0.1", "GeneratorTest",
                      "abc-corp:vn02", ::testing::_, ::testing::_,
                      ::testing::_, ::testing::_, ::testing::_))
        .Times(1)
        .WillOnce(Return(true));

    EXPECT_CALL(*osp_mock(),
            UVEUpdate("UveVirtualNetworkAgent", "in_tpkts",
                      "127.0.0.1", "GeneratorTest",
                      "abc-corp:vn02", ::testing::_, ::testing::_,
                      ::testing::_, ::testing::_, ::testing::_))
        .Times(1)
        .WillOnce(Return(true));

    EXPECT_CALL(*osp_mock(),
            UVEUpdate("UveVirtualNetworkAgent", "in_stats",
                      "127.0.0.1", "GeneratorTest",
                      "abc-corp:vn02", ::testing::_, ::testing::_,
                      ::testing::_, ::testing::_, ::testing::_))
        .Times(1)
        .WillOnce(Return(true));

    EXPECT_CALL(*osp_mock(),
            UVEUpdate("UveVirtualNetworkAgent", "total_acl_rules",
                      "127.0.0.1", "GeneratorTest",
                      "abc-corp:vn02", ::testing::_, ::testing::_,
                      ::testing::_, ::testing::_, ::testing::_))
        .Times(1)
        .WillOnce(Return(true));

    EXPECT_CALL(*osp_mock(),
            UVENotif("UveVirtualNetworkAgent",
                      "127.0.0.1", "GeneratorTest",
                      "abc-corp:vn02"));
        .Times(1)
        .WillOnce(Return(true));

    gentest.SendMessageUVETrace();

    //last test shutdown generator
    gentest.Shutdown();
}

int main(int argc, char **argv) {
    LoggingInit();
    ::testing::InitGoogleTest(&argc, argv);

    return RUN_ALL_TESTS();
}


text:
package com.lateralthoughts.points.services

import java.util.UUID

import com.lateralthoughts.points.model.{ApplicationError, DatabaseError, RecordNotFound}
import com.lateralthoughts.points.repositories.Repository

import scala.util.{Failure, Success}

trait Service[T] {

  val repository: Repository[T]

  def retrieveAll(): Either[ApplicationError, List[T]] = repository.retrieve() match {
    case Success(elements) => Right(elements)
    case Failure(exception) => Left(ApplicationError(DatabaseError, exception.getMessage))
  }

  def retrieve(id: UUID): Either[ApplicationError, T] = repository.retrieve(id) match {
    case None => Left(ApplicationError(RecordNotFound, s"No element with id $id found"))
    case Some(rewardingAction) => Right(rewardingAction)
  }

  def delete(id: UUID): Either[ApplicationError, String] = repository.delete(id) match {
    case Success(message) => Right(message)
    case Failure(exception) => Left(ApplicationError(DatabaseError, exception.getMessage))
  }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- File created by the Android Action Bar Style Generator

     Copyright (C) 2011 The Android Open Source Project
     Copyright (C) 2012 readyState Software Ltd

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<resources>

    <style name="Theme.Edit_actionbar" parent="@style/Theme.AppCompat.Light.DarkActionBar">
        <item name="android:actionBarItemBackground">@drawable/selectable_background_edit_actionbar</item>
        <item name="android:popupMenuStyle">@style/PopupMenu.Edit_actionbar</item>
        <item name="android:dropDownListViewStyle">@style/DropDownListView.Edit_actionbar</item>
        <item name="android:actionBarTabStyle">@style/ActionBarTabStyle.Edit_actionbar</item>
        <item name="android:actionDropDownStyle">@style/DropDownNav.Edit_actionbar</item>
        <item name="android:actionBarStyle">@style/ActionBar.Solid.Edit_actionbar</item>
        <item name="android:actionModeBackground">@drawable/cab_background_top_edit_actionbar</item>
        <item name="android:actionModeSplitBackground">@drawable/cab_background_bottom_edit_actionbar</item>
        <item name="android:actionModeCloseButtonStyle">@style/ActionButton.CloseMode.Edit_actionbar</item>

                <!-- Light.DarkActionBar specific -->
        <item name="android:actionBarWidgetTheme">@style/Theme.Edit_actionbar.Widget</item>

    </style>

    <style name="ActionBar.Solid.Edit_actionbar" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
        <item name="android:background">@drawable/ab_solid_edit_actionbar</item>
        <item name="android:backgroundStacked">@drawable/ab_stacked_solid_edit_actionbar</item>
        <item name="android:backgroundSplit">@drawable/ab_bottom_solid_edit_actionbar</item>
        <item name="android:progressBarStyle">@style/ProgressBar.Edit_actionbar</item>
    </style>

    <style name="ActionBar.Transparent.Edit_actionbar" parent="@style/Widget.AppCompat.ActionBar">
        <item name="android:background">@drawable/ab_transparent_edit_actionbar</item>
        <item name="android:progressBarStyle">@style/ProgressBar.Edit_actionbar</item>
    </style>

    <!-- this style is only referenced in a Light.DarkActionBar based theme -->
    <style name="Theme.Edit_actionbar.Widget" parent="@style/Theme.AppCompat">
        <item name="android:popupMenuStyle">@style/PopupMenu.Edit_actionbar</item>
        <item name="android:dropDownListViewStyle">@style/DropDownListView.Edit_actionbar</item>
    </style>

</resources>


text:
<?php

namespace conquer\datatables\assets;

use yii\web\AssetBundle;

/**
 * Class DatatablesFixedColumnsBsAsset
 * @package conquer\datatables\assets
 */
class DatatablesFixedColumnsBsAsset extends AssetBundle
{
    public $sourcePath = '@bower/datatables.net-fixedcolumns-bs';

    public $css = [
        'css/fixedColumns.bootstrap.min.css',
    ];

    public $depends = [
        'conquer\datatables\assets\DatatablesFixedColumnsAsset',
        'conquer\datatables\assets\DatatablesBsAsset',
    ];
}


text:
<?php
return array(
    // config array
);


text:
package com.ipharmacare.iss.core.cluster;

import org.apache.mina.core.session.IoSession;

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

public class NodeGroup {

    private List<IoSession> sessions = new ArrayList<IoSession>();

    private int current = 0;

    /**
     * 添加节点至节点组
     *
     * @param session
     */
    public void addNode(IoSession session) {
        synchronized (sessions) {
            sessions.add(session);
        }
    }

    /**
     * 获取节点组中节点的数量
     *
     * @return
     */
    public int getNodeCount() {
        return sessions.size();
    }

    private void next() {
        current++;
        if (current >= sessions.size()) {
            current -= (sessions.size());
        }
    }

    /**
     * 获取可用的节点
     *
     * @return
     */
    public IoSession getNode() {
        IoSession session = null;
        synchronized (sessions) {
            try {
                session = sessions.get(current);
                while (session.isClosing()) {
                    sessions.remove(current);
                    session = sessions.get(current);
                }
                next();
            } catch (Exception e) {
                current = 0;
                if (sessions.size() != 0) {
                    return sessions.get(current);
                } else {
                    return null;
                }
            }
        }
        return session;
    }

    public IoSession getNode(Long sessionid) {
        IoSession session = null;
        synchronized (sessions) {
            Iterator<IoSession> iterator = sessions.iterator();
            while (iterator.hasNext()) {
                IoSession s = iterator.next();
                if (!s.isClosing() && s.getId() == sessionid) {
                    session = s;
                }
            }
        }
        return session;
    }

    private void checkSession() {
        synchronized (sessions) {
            Iterator<IoSession> iterator = sessions.iterator();
            while (iterator.hasNext()) {
                IoSession session = iterator.next();
                if (session.isClosing()) {
                    iterator.remove();
                }
            }
        }
    }

    public List<IoSession> getNodes() {
        checkSession();
        return sessions;
    }
}


text:
Ext.define('Metadata.store.SettingsMenu',
{
    extend: 'Ext.data.TreeStore',
    autoLoad: true,
    model: 'Admin.model.Menu',
    rootVisible: false,
    root:
	{
	   expanded: true,
	   nodeType:'async'
	},
	proxy:
	{
            type:'ajax',
            url:'getMenu/settingsMenu',
            reader: {
            			type: 'json'
                    }
    }
});


text:
MXNET_ROOT=$(cd "$(dirname $0)/../../../.."; pwd)
CLASS_PATH=$MXNET_ROOT/scala-package/assembly/linux-x86_64-gpu/target/*:$MXNET_ROOT/scala-package/examples/target/*:$MXNET_ROOT/scala-package/examples/target/classes/lib/*

# which gpu card to use
GPU=0

# the mnist data path
# you can get the mnist data using the script core/scripts/get_mnist_data.sh
DATA_PATH=$1

java -Xmx4G -cp $CLASS_PATH \
	ml.dmlc.mxnetexamples.customop.ExampleCustomOpWithRtc \
	--data-path $DATA_PATH \
	--gpu $GPU


text:
#region Copyright & License
//
// Copyright 2001-2005 The Apache Software Foundation
//
// 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.
//
#endregion

// .NET Compact Framework 1.0 has no support for reading assembly attributes
#if !NETCF

using System;
using System.Reflection;

using log4net.Util;
using log4net.Repository;
using log4net.Core;

namespace log4net.Config
{
	/// <summary>
	/// Assembly level attribute to configure the <see cref="SecurityContextProvider"/>.
	/// </summary>
	/// <remarks>
	/// <para>
	/// This attribute may only be used at the assembly scope and can only
	/// be used once per assembly.
	/// </para>
	/// <para>
	/// Use this attribute to configure the <see cref="XmlConfigurator"/>
	/// without calling one of the <see cref="XmlConfigurator.Configure()"/>
	/// methods.
	/// </para>
	/// </remarks>
	/// <author>Nicko Cadell</author>
	[AttributeUsage(AttributeTargets.Assembly)]
	[Serializable]
	public sealed class SecurityContextProviderAttribute : ConfiguratorAttribute
	{
		#region Constructor

		/// <summary>
		/// Construct provider attribute with type specified
		/// </summary>
		/// <param name="providerType">the type of the provider to use</param>
		/// <remarks>
		/// <para>
		/// The provider specified must subclass the <see cref="SecurityContextProvider"/>
		/// class.
		/// </para>
		/// </remarks>
		public SecurityContextProviderAttribute(Type providerType) : base(100) /* configurator priority 100 to execute before the XmlConfigurator */
		{
			m_providerType = providerType;
		}

		#endregion

		#region Public Instance Properties

		/// <summary>
		/// Gets or sets the type of the provider to use.
		/// </summary>
		/// <value>
		/// the type of the provider to use.
		/// </value>
		/// <remarks>
		/// <para>
		/// The provider specified must subclass the <see cref="SecurityContextProvider"/>
		/// class.
		/// </para>
		/// </remarks>
		public Type ProviderType
		{
			get { return m_providerType; }
			set { m_providerType = value; }
		}

		#endregion Public Instance Properties

		#region Override ConfiguratorAttribute

		/// <summary>
		/// Configures the SecurityContextProvider
		/// </summary>
		/// <param name="sourceAssembly">The assembly that this attribute was defined on.</param>
		/// <param name="targetRepository">The repository to configure.</param>
		/// <remarks>
		/// <para>
		/// Creates a provider instance from the <see cref="ProviderType"/> specified.
		/// Sets this as the default security context provider <see cref="SecurityContextProvider.DefaultProvider"/>.
		/// </para>
		/// </remarks>
		override public void Configure(Assembly sourceAssembly, ILoggerRepository targetRepository)
		{
			if (m_providerType == null)
			{
				LogLog.Error("SecurityContextProviderAttribute: Attribute specified on assembly ["+sourceAssembly.FullName+"] with null ProviderType.");
			}
			else
			{
				LogLog.Debug("SecurityContextProviderAttribute: Creating provider of type ["+ m_providerType.FullName +"]");

				SecurityContextProvider provider = Activator.CreateInstance(m_providerType) as SecurityContextProvider;

				if (provider == null)
				{
					LogLog.Error("SecurityContextProviderAttribute: Failed to create SecurityContextProvider instance of type ["+m_providerType.Name+"].");
				}
				else
				{
					SecurityContextProvider.DefaultProvider = provider;
				}
			}
		}

		#endregion

		#region Private Instance Fields

		private Type m_providerType = null;

		#endregion Private Instance Fields
	}
}

#endif // !NETCF


text:
"""
    Nordigen Account Information Services API

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: 2.0 (v2)

    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

# import apis into sdk package
from nordigen.api.accounts_api import AccountsApi
from nordigen.api.agreements_api import AgreementsApi
from nordigen.api.institutions_api import InstitutionsApi
from nordigen.api.requisitions_api import RequisitionsApi
from nordigen.api.token_api import TokenApi
# import ApiClient
from nordigen.api_client import ApiClient
from nordigen.configuration import Configuration
# import models into sdk package
from nordigen.models.account_v2 import AccountV2
from nordigen.models.account_v2_status_enum import AccountV2StatusEnum
from nordigen.models.all_of_account_v2_status import AllOfAccountV2Status
from nordigen.models.all_of_requisition_v2_status import AllOfRequisitionV2Status
from nordigen.models.all_of_spectacular_requisition_v2_status import AllOfSpectacularRequisitionV2Status
from nordigen.models.aspsp import Aspsp
from nordigen.models.end_user_agreement import EndUserAgreement
from nordigen.models.enduser_acceptance_details import EnduserAcceptanceDetails
from nordigen.models.jwt_obtain_pair import JWTObtainPair
from nordigen.models.jwt_refresh import JWTRefresh
from nordigen.models.paginated_end_user_agreement_list import PaginatedEndUserAgreementList
from nordigen.models.paginated_requisition_v2_list import PaginatedRequisitionV2List
from nordigen.models.requisition_link_params import RequisitionLinkParams
from nordigen.models.requisition_links import RequisitionLinks
from nordigen.models.requisition_v2 import RequisitionV2
from nordigen.models.spectacular_jwt_obtain import SpectacularJWTObtain
from nordigen.models.spectacular_jwt_refresh import SpectacularJWTRefresh
from nordigen.models.spectacular_requisition_v2 import SpectacularRequisitionV2
from nordigen.models.status6e6_enum import Status6e6Enum


text:
<?xml version="1.0" encoding="UTF-8"?>
<Form xmlns="http://v8.1c.ru/8.3/xcf/logform" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:dcscor="http://v8.1c.ru/8.1/data-composition-system/core" xmlns:dcsset="http://v8.1c.ru/8.1/data-composition-system/settings" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<VerticalScroll>useIfNecessary</VerticalScroll>
	<CommandSet>
		<ExcludedCommand>UndoPosting</ExcludedCommand>
		<ExcludedCommand>Post</ExcludedCommand>
		<ExcludedCommand>Copy</ExcludedCommand>
		<ExcludedCommand>SetDeletionMark</ExcludedCommand>
		<ExcludedCommand>Delete</ExcludedCommand>
	</CommandSet>
	<AutoTime>CurrentOrLast</AutoTime>
	<UsePostingMode>Auto</UsePostingMode>
	<RepostOnWrite>true</RepostOnWrite>
	<AutoCommandBar name="ФормаКоманднаяПанель" id="-1"/>
	<Events>
		<Event name="OnCreateAtServer">ПриСозданииНаСервере</Event>
	</Events>
	<ChildItems>
		<UsualGroup name="ДатаНомер" id="17">
			<Title>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Дата номер</v8:content>
				</v8:item>
			</Title>
			<ToolTip>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Дата номер</v8:content>
				</v8:item>
			</ToolTip>
			<Group>Horizontal</Group>
			<Representation>None</Representation>
			<ShowTitle>false</ShowTitle>
			<ExtendedTooltip name="ДатаНомерExtendedTooltip" id="24"/>
			<ChildItems>
				<InputField name="Номер" id="1">
					<DataPath>Объект.Number</DataPath>
					<EditMode>EnterOnInput</EditMode>
					<ContextMenu name="НомерКонтекстноеМеню" id="2"/>
					<ExtendedTooltip name="НомерExtendedTooltip" id="25"/>
				</InputField>
				<InputField name="Дата" id="3">
					<DataPath>Объект.Date</DataPath>
					<ReadOnly>true</ReadOnly>
					<EditMode>EnterOnInput</EditMode>
					<ContextMenu name="ДатаКонтекстноеМеню" id="4"/>
					<ExtendedTooltip name="ДатаExtendedTooltip" id="26"/>
				</InputField>
			</ChildItems>
		</UsualGroup>
		<InputField name="Организация" id="11">
			<DataPath>Объект.Организация</DataPath>
			<ReadOnly>true</ReadOnly>
			<EditMode>EnterOnInput</EditMode>
			<ContextMenu name="ОрганизацияКонтекстноеМеню" id="12"/>
			<ExtendedTooltip name="ОрганизацияExtendedTooltip" id="27"/>
		</InputField>
		<UsualGroup name="ГруппаКассы" id="21">
			<Title>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Группа кассы</v8:content>
				</v8:item>
			</Title>
			<ToolTip>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Группа кассы</v8:content>
				</v8:item>
			</ToolTip>
			<Group>Horizontal</Group>
			<Representation>None</Representation>
			<ShowTitle>false</ShowTitle>
			<ExtendedTooltip name="ГруппаКассыExtendedTooltip" id="28"/>
			<ChildItems>
				<InputField name="КассаККМ" id="7">
					<DataPath>Объект.КассаККМ</DataPath>
					<ReadOnly>true</ReadOnly>
					<EditMode>EnterOnInput</EditMode>
					<ContextMenu name="КассаККМКонтекстноеМеню" id="8"/>
					<ExtendedTooltip name="КассаККМExtendedTooltip" id="29"/>
				</InputField>
			</ChildItems>
		</UsualGroup>
		<UsualGroup name="ГруппаСуммаДокумента" id="18">
			<Title>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Сумма документа</v8:content>
				</v8:item>
			</Title>
			<ToolTip>
				<v8:item>
					<v8:lang>ru</v8:lang>
					<v8:content>Сумма документа</v8:content>
				</v8:item>
			</ToolTip>
			<Group>Horizontal</Group>
			<Representation>None</Representation>
			<ShowTitle>false</ShowTitle>
			<ExtendedTooltip name="ГруппаСуммаДокументаExtendedTooltip" id="30"/>
			<ChildItems>
				<InputField name="СуммаДокумента" id="13">
					<DataPath>Объект.СуммаДокумента</DataPath>
					<ReadOnly>true</ReadOnly>
					<EditMode>EnterOnInput</EditMode>
					<ContextMenu name="СуммаДокументаКонтекстноеМеню" id="14"/>
					<ExtendedTooltip name="СуммаДокументаExtendedTooltip" id="31"/>
				</InputField>
				<LabelField name="Валюта" id="19">
					<DataPath>Объект.Валюта</DataPath>
					<TitleLocation>None</TitleLocation>
					<ContextMenu name="ВалютаКонтекстноеМеню" id="20"/>
					<ExtendedTooltip name="ВалютаExtendedTooltip" id="32"/>
				</LabelField>
			</ChildItems>
		</UsualGroup>
		<InputField name="Кассир" id="9">
			<DataPath>Объект.Кассир</DataPath>
			<EditMode>EnterOnInput</EditMode>
			<ContextMenu name="КассирКонтекстноеМеню" id="10"/>
			<ExtendedTooltip name="КассирExtendedTooltip" id="33"/>
		</InputField>
		<InputField name="Комментарий" id="22">
			<DataPath>Объект.Комментарий</DataPath>
			<ContextMenu name="КомментарийКонтекстноеМеню" id="23"/>
			<ExtendedTooltip name="КомментарийExtendedTooltip" id="34"/>
		</InputField>
	</ChildItems>
	<Attributes>
		<Attribute name="Объект" id="1">
			<Type>
				<v8:Type>cfg:DocumentObject.ВыемкаДенежныхСредствИзКассыККМ</v8:Type>
			</Type>
			<MainAttribute>true</MainAttribute>
			<SavedData>true</SavedData>
			<UseAlways>
				<Field>Объект.RegisterRecords</Field>
			</UseAlways>
		</Attribute>
	</Attributes>
</Form>


text:
package com.hackathon.speakers.data.play;

public class PlayFileRequest
{
    public String text;
}


text:
package org.apache.shindig.common;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Temporary package for use until we the jsr people release to maven central.
 * http://code.google.com/p/jsr-305/issues/detail?id=13
 *
 * This allows us to remove the jsr305 jar from findbugs which is LGPL and
 * moved from 'provided' to 'runtime' scope due to use by Guice.
 */

@Retention(RetentionPolicy.RUNTIME)
public @interface Nullable {
}


text:
<?php

//Grab the composer Autoloader
use Gnf\Tests\db\BaseTestTarget;

$autoloader = require __DIR__ . '/../vendor/autoload.php';

$autoloader->add('Gnf\Tests', __DIR__);
$autoloader->add('Gnf', __DIR__ . '/../lib/');

$base = new BaseTestTarget;


text:
import test from "ava"

import { fake } from "sinon"

import Lobby from "~/app/models/lobby"

test("starts empty", t => {
  const lobby = new Lobby()

  t.is(0, lobby.users.length)
})

test("accepts new users", async t => {
  const lobby = new Lobby()

  const user = { get: () => { return 0 } }

  t.falsy(await lobby.push(user))
  t.is(1, lobby.users.length)
})

test("prevents user joining twice", async t => {
  const lobby = new Lobby()
  const user = { get: () => { return 0 } }

  await lobby.push(user)

  t.falsy(await lobby.push(user))
  t.is(1, lobby.users.length)
})

test("creates a new game", async t => {
  const create = fake.returns({
    serializePrepare: fake(),
    serialize: fake()
  })
  const Game = { create }

  const lobby = new Lobby(Game)

  const user1 = { get: () => { return 0 } }
  const user2 = { get: () => { return 1 } }

  await lobby.push(user1)
  const game = await lobby.push(user2)

  t.truthy(game)
  t.true(create.called)
  t.is(0, lobby.users.length)
})


text:
using System.Reflection;
using System.Runtime.InteropServices;
using System.Security;

[assembly: AssemblyTitle("Contrib.CookiCuttr")]
[assembly: AssemblyDescription("CookieCuttr for Orchard")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Contrib.CookiCuttr")]
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: ComVisible(false)]

[assembly: Guid("C1D3E164-2105-4D48-9E05-FF5C7CD4839C")]

[assembly: AssemblyVersion("1.7.2.1")]
[assembly: AssemblyFileVersion("1.7.2.1")]


text:
class ConstraintMatrixSingularError : public std::runtime_error {
 public:
  ConstraintMatrixSingularError()
      : runtime_error("Constraint matrix is singular!"){}
};

DRAKESPLINEGENERATION_EXPORT PiecewisePolynomial<double> generateSpline(
    const SplineInformation& spline_information);

DRAKESPLINEGENERATION_EXPORT PiecewisePolynomial<double> nWaypointCubicSpline(
    const std::vector<double>& segment_times, double x0, double xd0, double xf,
    double xdf, const Eigen::Ref<const Eigen::VectorXd>& xi);


text:
const sortedMatrixSearch = (matrix, value, front, back) => {
  if (matrix === undefined) {
    return 'where is your matrix?';
  }
  const m = matrix.length;
  const n = matrix[0].length;

  if (front === undefined && back === undefined) {
    front = 0;
    back = m * n;
  }
  console.log(front, back);

  if (front > back) { return -1; }

  let mid = Math.floor((front + back) / 2);
  const row = Math.floor(mid / n);
  const col = mid % n;

  if (matrix[row][col] === value) {
    return [row, col];
  } else if (value < matrix[row][col]) {
    return sortedMatrixSearch(matrix, value, front, mid);
  } else {
    return sortedMatrixSearch(matrix, value, mid + 1, back);
  }
};

// sortedMatrixSearch can be called
console.log(sortedMatrixSearch() === 'where is your matrix?');

// sortedMatrixSearch finds existing values
console.log(JSON.stringify(sortedMatrixSearch([[1, 2], [3, 4]], 3)) === JSON.stringify([1, 0]));
console.log(JSON.stringify(sortedMatrixSearch([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 9)) === JSON.stringify([2, 2]));
console.log(JSON.stringify(sortedMatrixSearch([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 1)) === JSON.stringify([0, 0]));
console.log(JSON.stringify(sortedMatrixSearch([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 5)) === JSON.stringify([1, 1]));

// sortedMatrixSearch returns -1 for value greater than range
console.log(sortedMatrixSearch([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 100) === -1);

// sortedMatrixSearch returns -1 for value absent from range
console.log(sortedMatrixSearch([[1, 2, 3], [5, 6, 7], [8, 9, 10]], 4) === -1);

// sortedMatrixSearch returns -1 for value lower than range
console.log(sortedMatrixSearch([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 0) === -1);


text:
import Coachmark from '@pearson-components/coach-mark';
import CoachmarkApi from './CoachmarkApi';
import FeedbackApi from './FeedbackApi';
import NotificationApi from './NotificationApi';

export default class CoachmarkListener {

	constructor(config) {
		// String.startsWith pollyfill for Safari
		if (!String.prototype.startsWith) {
			String.prototype.startsWith = function(searchString, position) {
				position = position || 0;
				return this.substr(position, searchString.length) === searchString;
			};
		}

		// global vars
		this.localStorageKey = 'notifications.coachmark.stateObject';

		// APIs
		this.coachmarkApi = new CoachmarkApi(config);
		this.feedbackApi = new FeedbackApi(config);
		this.notificationApi = new NotificationApi(config);

	}

	setupListeners() {
		this._setupBackListener();
		this._setupNextListener();
		return this;
	}

	/**
	 * Entry point if details in local storage. Runs on each page load.
	 * If we placed details in local storage in order to keep state for a redirect to a new url,
	 * this function will read those values and launch a coachmark right were we left off.
	 * Otherwise, we return false and do nothing.
	 **/
	continueTourIfRedirected() {
		let state;
		try {
			state = localStorage.getItem(this.localStorageKey);
			localStorage.removeItem(this.localStorageKey);
		} catch (e) {
			this._handleError(e, true);
		}

		if (!state) {
			return false;
		}

		try {
			state = JSON.parse(state);
			this._getDisplayCoachmark(state, true);
			return true;
		} catch (e) {
			this._handleError(e);
		}
	}

	/**
	 * Entry point from user interaction with the UI,
	 * launches the first CM in the set contained in the triggering notification
	 **/
	launchTour(notification) {
		console.log('Entering launchTour with notification: ', notification);
		try {
			let cmIds = notification.message.cmIds;
			cmIds = cmIds ? cmIds.split(',') : null;
			cmIds = cmIds.map((param) => parseInt(param));

			const state = {
				userNotificationId: notification.id,
				cmIds: cmIds,
				index: 0,
				isVisited: {}
			};

			this._getDisplayCoachmark(state);

		} catch (e) {
			this._handleError(e);
		}
	}

	/**
	 * Sets up the back listener
	 **/
	_setupBackListener() {
		document.addEventListener('o-cm-previous-clicked', (event) => {
			try {
				const state = JSON.parse(event.data.id);
				if (state.index === 0) {
					return;
				}
				state.index--;
				this._getDisplayCoachmark(state);
			} catch (e) {
				this._handleError(e);
			}
		});
	}

	/**
	 * Sets up the next listener
	 **/
	_setupNextListener() {
		document.addEventListener('o-cm-next-clicked', (event) => {
			try {
				const state = JSON.parse(event.data.id);
				if (state.index + 1 === state.cmIds.length) {
					return;
				}
				state.index++;
				this._getDisplayCoachmark(state);
			} catch (e) {
				this._handleError(e);
			}
		});
	}

	/**
	 * Gets data from the API and displays a coachmark on the correct page
	 **/
	_getDisplayCoachmark(state, isAlreadyRedirected) {
		console.log('Entering _getDisplayCoachmark with state: ', state);
		const cmId = state.cmIds[state.index];

		this.coachmarkApi.getCoachmark(cmId)
			.then((coachmark) => {
				console.log('coachmarkApi returned: ', coachmark);
				// continueTourIfRedirected is the only thing setting this flag.
				// If it's set to true, it means we're trying to load a coach mark from a redirect
				// and we can bypass this check. This is meant to prevent a situation
				// where hitting back on a bad redirect always triggers the redirect again.
				if (!isAlreadyRedirected) {
					// Redirect if this coachmark ID is meant to display on a different page
					if (this._redirectIfNewUri(coachmark.uri, state)) {
						return;
					}
				}

				// Auto-populating options to simplify the coachmark payload
				const options = coachmark.options;
				options.id = JSON.stringify(state);
				if (state.cmIds.length > 1) {
					options.currentCM = parseInt(state.index) + 1;
					options.totalCM = state.cmIds.length;
				}

				// Display the coach mark
				console.log(`Display CM with element: ${coachmark.element}, options: ${options}`);
				new Coachmark({elementId:coachmark.element, opts:options}, () => {
					this.notificationApi.markAsRead(state.userNotificationId);
				});

				// Tick hit counter if first visit
				try {
					if (!state.isVisited[cmId]) {
						this.coachmarkApi.incrementViewCount(cmId);
						state.isVisited[cmId] = true;
					}
				} catch (e) {
					this._handleError(e, true);
				}

			}, (error) => {
				this._handleError(error);
			});
	}

	/**
	 * if the current uri and the uri passed in do not match,
	 * store state in local storage and redirect to the new uri
	 **/
	_redirectIfNewUri(uri, state) {
		if (!uri) {
			return false;
		}

		// if relative, change to absolute using current domain
		const currentUri = window.location.href;
		if (!uri.toLowerCase().startsWith('http')) {
			const arr = (currentUri).split('/');
			const domain = arr[0] + '//' + arr[2];
			uri = domain + (uri.startsWith('/') ? uri : ('/' + uri));
		}
		// If the target URI and current URI are the same, don't redirect
		if (uri === currentUri) {
			return false;
		}
		// Set local storage
		localStorage.setItem(this.localStorageKey, JSON.stringify(state));

		window.location.href = uri;
		return true;
	}

	_handleError(error, isSilentFailure) {
		//TODO: We should probably log back all errors

		console.log('Handled error: ', error);

		if (isSilentFailure) {
			return;
		}

		const options = {
			title: 'There seems to be a problem with this feature.',
			text: 'Try refreshing your browser or clearing your cache.',
			id: Date.now(),
			disableShadowing: true,
			disablePointer: true
		};
		new Coachmark({elementId:'notification-bell', opts:options}, ()=>{});
	}
}


text:
"""
`main` is the top level module where AppEngine gets access
to your Flask application.
"""

from app import create_app
from config import config
from os import environ

server_software_name = environ['SERVER_SOFTWARE']

if server_software_name.startswith('Development'):
    app_config = config['development']
else:
    app_config = config['production']

app = create_app(app_config)
# Note: We don't need to call run() since our application is
# embedded within the App Engine WSGI application server.


text:
import * as types from '../action/ActionTypes';

const deleteDataReducer = (state = [], action) {
  switch (action.type) {
    case types.DELETE_PEOPLE:
      return state;
    case types.DELETE_PERSON:
      return state;
    default:
      return state;
  }
}

export default deleteDataReducer;


text:
using mojo::ApplicationConnection;
using mojo::Gpu;
using mojo::NativeViewport;

namespace native_viewport {

class NativeViewportAppDelegate : public mojo::ApplicationDelegate,
                                  public mojo::InterfaceFactory<NativeViewport>,
                                  public mojo::InterfaceFactory<Gpu> {
 public:
  NativeViewportAppDelegate() : is_headless_(false) {}
  ~NativeViewportAppDelegate() override {}

 private:
  // mojo::ApplicationDelegate implementation.
  void Initialize(mojo::ApplicationImpl* application) override {
    tracing_.Initialize(application);

#if defined(OS_LINUX)
    // Apply the switch for kTouchEvents to CommandLine (if set). This allows
    // redirecting the mouse to a touch device on X for testing.
    base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
    const std::string touch_event_string("--" +
                                         std::string(switches::kTouchDevices));
    auto touch_iter = std::find(application->args().begin(),
                                application->args().end(),
                                touch_event_string);
    if (touch_iter != application->args().end() &&
        ++touch_iter != application->args().end()) {
      command_line->AppendSwitchASCII(touch_event_string, *touch_iter);
    }
#endif

    if (application->HasArg(mojo::kUseTestConfig))
      gfx::GLSurface::InitializeOneOffForTests();
    else
      gfx::GLSurface::InitializeOneOff();

    is_headless_ = application->HasArg(mojo::kUseHeadlessConfig);
  }

  bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
    connection->AddService<NativeViewport>(this);
    connection->AddService<Gpu>(this);
    return true;
  }

  // mojo::InterfaceFactory<NativeViewport> implementation.
  void Create(ApplicationConnection* connection,
              mojo::InterfaceRequest<NativeViewport> request) override {
    if (!gpu_state_.get())
      gpu_state_ = new gles2::GpuState;
    new NativeViewportImpl(is_headless_, gpu_state_, request.Pass());
  }

  // mojo::InterfaceFactory<Gpu> implementation.
  void Create(ApplicationConnection* connection,
              mojo::InterfaceRequest<Gpu> request) override {
    if (!gpu_state_.get())
      gpu_state_ = new gles2::GpuState;
    new gles2::GpuImpl(request.Pass(), gpu_state_);
  }

  scoped_refptr<gles2::GpuState> gpu_state_;
  bool is_headless_;
  mojo::TracingImpl tracing_;

  DISALLOW_COPY_AND_ASSIGN(NativeViewportAppDelegate);
};
}

MojoResult MojoMain(MojoHandle shell_handle) {
  mojo::ApplicationRunnerChromium runner(
      new native_viewport::NativeViewportAppDelegate);
  runner.set_message_loop_type(base::MessageLoop::TYPE_UI);
  return runner.Run(shell_handle);
}


text:
import { Chart, Facet, Coord, View, Tooltip, Legend, Axis, Point, FacetView } from '../../../packages/viser-react/src/index';
import * as React from 'react';
import { sourcedata } from './data'
const DataSet = require('@antv/data-set');
const { DataView } = DataSet;

const scale = [{
  dataKey: 'mean',
  sync: true
}, {
  dataKey: 'cut',
  sync: true,
}];

const views = (view, facet) => {
  const data = facet.data;
  const dv = new DataView();
  dv.source(data).transform({
    type: 'aggregate',
    fields: [ 'price' ],
    operations: [ 'mean' ],
    as: [ 'mean' ],
    groupBy: [ 'cut' ]
  });

  return {
    data: dv,
    series: {
      quickType: 'bar',
      position: 'cut*mean',
      color: 'cut',
    }
  }
}

export default class App extends React.Component {
  state = {
    data: [],
  };

  componentDidMount() {
    setTimeout(() => {
      this.setState({
        data: sourcedata
      });
    }, 500);
  }
  render() {
    return (
      <div>
        <Chart forceFit={true} height={600} data={this.state.data} scale={scale}>
          <Tooltip />
          <Legend />
          <Coord type="polar" />
          <Facet type="circle" fields={['clarity']} views={views} />
        </Chart>
      </div>
    );
  }
}


text:
Summary.

### Syntax
```c
void neat_free_ctx(struct neat_ctx *ctx);
```

### Parameters

- **ctx**: Pointer to the NEAT context to free.

### Return values

None.

### Remarks

If there are any flows still kept in this context, those will be freed and
closed as part of this operation.

### Examples

None.

### See also

- [neat_close](neat_close)
- [neat_init_ctx](neat_init_ctx.md)
- [neat_new_flow](neat_new_flow.md)


text:
module Bosh
  module Director
    module DeploymentPlan
      class DesiredInstance < Struct.new(:instance_group, :deployment, :az, :index)
        def inspect
          "<DesiredInstance az=#{self.az ? self.az.name : nil} index=#{self.index}>"
        end

        def availability_zone
          self.az.name unless self.az.nil?
        end
      end
    end
  end
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Ascomyces fulgens Cooke & Harkn.

### Remarks
null


text:
    #define INSCRIPTION_SIZE_TRACKER_ID std::uint32_t
#endif

namespace inscription
{
    typedef INSCRIPTION_SIZE_TRACKER_ID TrackerID;
}


text:
The referencesource repository contains sources from [Microsoft .NET Reference Source](http://referencesource.microsoft.com/)
that represent a subset of the .NET Framework.  This subset contains similar functionality to the class libraries that are being
developed in [.NET Core](https://github.com/dotnet/corefx).  We intend to consult the referencesource repository as we develop
.NET Core.  It is also for the community to leverage to enable more scenarios for .NET developers.

**Please note that the referencesource repository is read-only**. [See this blog post](http://blogs.msdn.com/b/dotnet/archive/2014/11/12/net-core-is-open-source.aspx) for the rationale.

Questions, bugs, and pull requests should be done through [.NET Core](https://github.com/dotnet/corefx).


text:
#region License

#endregion

#region Imports

using System;
using System.Collections;
using System.Reflection;
using System.Reflection.Emit;

using Spring.Util;

#endregion

namespace Spring.Aop.Framework.DynamicProxy
{
    /// <summary>
    /// <see cref="Spring.Proxy.IProxyMethodBuilder"/> implementation
    /// that delegates method calls to target object.
    /// </summary>
    /// <author>Aleksandar Seovic</author>
    /// <author>Bruno Baia</author>
    public class TargetAopProxyMethodBuilder : AbstractAopProxyMethodBuilder
    {
        #region Fields

        /// <summary>
        /// The local variable to store the target instance.
        /// </summary>
        protected LocalBuilder target;

        #endregion

        #region Constructor(s) / Destructor

        /// <summary>
        /// Creates a new instance of the method builder.
        /// </summary>
        /// <param name="typeBuilder">The type builder to use.</param>
        /// <param name="aopProxyGenerator">
        /// The <see cref="IAopProxyTypeGenerator"/> implementation to use.
        /// </param>
        /// <param name="explicitImplementation">
        /// <see langword="true"/> if the interface is to be
        /// implemented explicitly; otherwise <see langword="false"/>.
        /// </param>
        /// <param name="targetMethods">
        /// The dictionary to cache the list of target
        /// <see cref="System.Reflection.MethodInfo"/>s.
        /// </param>
        public TargetAopProxyMethodBuilder(TypeBuilder typeBuilder,
            IAopProxyTypeGenerator aopProxyGenerator, bool explicitImplementation, IDictionary targetMethods)
            : base(typeBuilder, aopProxyGenerator, explicitImplementation, targetMethods)
        {
        }

        #endregion

        #region Protected Methods

        /// <summary>
        /// Creates local variable declarations.
        /// </summary>
        /// <param name="il">The IL generator to use.</param>
        /// <param name="method">The method to proxy.</param>
        protected override void DeclareLocals(ILGenerator il, MethodInfo method)
        {
            base.DeclareLocals(il, method);
            target = il.DeclareLocal(typeof(object));

#if DEBUG
            target.SetLocalSymInfo("target");
#endif
        }

        /// <summary>
        /// Generates the IL instructions that pushes
        /// the target instance on which calls should be delegated to.
        /// </summary>
        /// <param name="il">The IL generator to use.</param>
        protected override void PushTarget(ILGenerator il)
        {
            il.Emit(OpCodes.Ldloc, target);
        }

        /// <summary>
        /// Generates method logic.
        /// </summary>
        /// <param name="il">The IL generator to use.</param>
        /// <param name="method">The method to proxy.</param>
        /// <param name="interfaceMethod">
        /// The interface definition of the method, if applicable.
        /// </param>
        protected override void GenerateMethodLogic(
            ILGenerator il, MethodInfo method, MethodInfo interfaceMethod)
        {
            PushAdvisedProxy(il);
            il.Emit(OpCodes.Ldfld, References.TargetSourceField);
            il.EmitCall(OpCodes.Callvirt, References.GetTargetMethod, null);
            il.Emit(OpCodes.Stloc, target);

            base.GenerateMethodLogic(il, method, interfaceMethod);

            PushAdvisedProxy(il);
            il.Emit(OpCodes.Ldfld, References.TargetSourceField);
            PushTarget(il);
            il.EmitCall(OpCodes.Callvirt, References.GetReleaseTargetMethod, null);
        }

        /// <summary>
        /// Calls proxied method directly.
        /// </summary>
        /// <param name="il">The IL generator to use.</param>
        /// <param name="method">The method to proxy.</param>
        /// <param name="interfaceMethod">
        /// The interface definition of the method, if applicable.
        /// </param>
        protected override void CallDirectProxiedMethod(
            ILGenerator il, MethodInfo method, MethodInfo interfaceMethod)
        {
            if (interfaceMethod != null)
                CallDirectTargetMethod(il, interfaceMethod);
            else
                CallDirectTargetMethod(il, method);
        }

        #endregion
    }
}


text:
package org.uiautomation.ios.context;

import org.uiautomation.ios.UIAModels.configuration.WorkingMode;
import org.uiautomation.ios.server.application.APPIOSApplication;

public class ApplicationContext {

  private WorkingMode mode = WorkingMode.Native;
  //private final WebViewContext viewContext;
  private final String bundleId;
  private APPIOSApplication application;

  public ApplicationContext(String bundleId) {
    this.bundleId = bundleId;
    //this.viewContext = new WebViewContext(bundleId);
  }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class WYDW_AppMain_AppList_BZ : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}


text:
FROM ubuntu:precise

# Upgrade package index
# install a few other useful packages plus Open Jdk 7
# Remove unneeded /var/lib/apt/lists/* after install to reduce the
# docker image size (by ~30MB)
RUN apt-get update && \
    apt-get install -y less openjdk-7-jre-headless net-tools vim-tiny sudo openssh-server && \
    rm -rf /var/lib/apt/lists/*

ENV SCALA_VERSION 2.11.7
ENV CDH_VERSION cdh4
ENV SCALA_HOME /opt/scala-$SCALA_VERSION
ENV SPARK_HOME /opt/spark
ENV PATH $SPARK_HOME:$SCALA_HOME/bin:$PATH

# Install Scala
ADD http://www.scala-lang.org/files/archive/scala-$SCALA_VERSION.tgz /
RUN (cd / && gunzip < scala-$SCALA_VERSION.tgz)|(cd /opt && tar -xvf -)
RUN rm /scala-$SCALA_VERSION.tgz


text:
package com.flowpowered.commons.hashing;

public class ByteShortByteHashed {
    /**
     * Creates a long key from 2 bytes and a short
     *
     * @param key1 a byte value
     * @param key2 a short value
     * @param key3 a byte value
     *
     * @return a long which is the concatenation of key1, key2 and key3
     */
    public static int key(int key1, int key2, int key3) {
        return (key1 & 0xFF) << 24 | (key3 & 0xFF) << 16 | key2 & 0xFFFF;
    }

    /**
     * Gets the first 8-bit integer value from a long key
     *
     * @param key to get from
     *
     * @return the first 8-bit integer value in the key
     */
    public static byte key1(int key) {
        return (byte) (key >> 24);
    }

    /**
     * Gets the second 16-bit integer value from a long key
     *
     * @param key to get from
     *
     * @return the second 16-bit integer value in the key
     */
    public static short key2(int key) {
        return (short) key;
    }

    /**
     * Gets the third 8-bit integer value from a long key
     *
     * @param key to get from
     *
     * @return the third 8-bit integer value in the key
     */
    public static byte key3(int key) {
        return (byte) (key >> 16);
    }
}


text:
<?php

/**
 * @file
 * Pantheon configuration file.
 *
 * IMPORTANT NOTE:
 * Do not modify this file. This file is maintained by Pantheon.
 *
 * Site-specific modifications belong in settings.php, not this file. This file
 * may change in future releases and modifications would cause conflicts when
 * attempting to apply upstream updates.
 */

/**
 * Version of Pantheon files.
 *
 * This is a monotonically-increasing sequence number that is
 * incremented whenever a change is made to any Pantheon file.
 * Not changed if Drupal core is updated without any change to
 * any Pantheon file.
 *
 * The Pantheon version is included in the git tag only if a
 * release is made that includes changes to Pantheon files, but
 * not to any Drupal files.
 */
if (!defined("PANTHEON_VERSION")) {
  define("PANTHEON_VERSION", "3");
}

/**
 * Determine whether this is a preproduction or production environment, and
 * then load the pantheon services.yml file.  This file should be named either
 * 'pantheon-production-services.yml' (for 'live' or 'test' environments)
 * 'pantheon-preproduction-services.yml' (for 'dev' or multidev environments).
 */
$pantheon_services_file = __DIR__ . '/services.pantheon.preproduction.yml';
if (
  isset($_ENV['PANTHEON_ENVIRONMENT']) &&
  ( ($_ENV['PANTHEON_ENVIRONMENT'] == 'live') || ($_ENV['PANTHEON_ENVIRONMENT'] == 'test') )
) {
  $pantheon_services_file = __DIR__ . '/services.pantheon.production.yml';
}

if (file_exists($pantheon_services_file)) {
  $settings['container_yamls'][] = $pantheon_services_file;
}

/**
 * Set the default location for the 'private' directory.  Note
 * that this location is protected when running on the Pantheon
 * environment, but may be exposed if you migrate your site to
 * another environment.
 */
$settings['file_private_path'] = 'sites/default/files/private';

// Check to see if we are serving an installer page.
$is_installer_url = (strpos($_SERVER['SCRIPT_NAME'], '/core/install.php') === 0);

/**
 * Add the Drupal 8 CMI Directory Information directly in settings.php to make sure
 * Drupal knows all about that.
 *
 * Issue: https://github.com/pantheon-systems/drops-8/issues/2
 *
 * IMPORTANT SECURITY NOTE:  The configuration paths set up
 * below are secure when running your site on Pantheon.  If you
 * migrate your site to another environment on the public internet,
 * you should relocate these locations. See "After Installation"
 * at https://www.drupal.org/node/2431247
 *
 */
if ($is_installer_url) {
  $config_directories = array(
    CONFIG_SYNC_DIRECTORY => 'sites/default/files',
  );
}
else {
  $config_directories = array(
    CONFIG_SYNC_DIRECTORY => 'sites/default/config',
  );
}

/**
 * Allow Drupal 8 to Cleanly Redirect to Install.php For New Sites.
 *
 * Issue: https://github.com/pantheon-systems/drops-8/issues/3
 *
 * c.f. https://github.com/pantheon-systems/drops-8/pull/53
 *
 */
if (
  isset($_ENV['PANTHEON_ENVIRONMENT']) &&
  !$is_installer_url &&
  (isset($_SERVER['PANTHEON_DATABASE_STATE']) && ($_SERVER['PANTHEON_DATABASE_STATE'] == 'empty')) &&
  (empty($GLOBALS['install_state'])) &&
  (php_sapi_name() != "cli")
) {
  include_once __DIR__ . '/../../core/includes/install.core.inc';
  include_once __DIR__ . '/../../core/includes/install.inc';
  install_goto('core/install.php');
}

/**
 * Override the $databases variable to pass the correct Database credentials
 * directly from Pantheon to Drupal.
 *
 * Issue: https://github.com/pantheon-systems/drops-8/issues/8
 *
 */
if (isset($_SERVER['PRESSFLOW_SETTINGS'])) {
  $pressflow_settings = json_decode($_SERVER['PRESSFLOW_SETTINGS'], TRUE);
  foreach ($pressflow_settings as $key => $value) {
    // One level of depth should be enough for $conf and $database.
    if ($key == 'conf') {
      foreach($value as $conf_key => $conf_value) {
        $conf[$conf_key] = $conf_value;
      }
    }
    elseif ($key == 'databases') {
      // Protect default configuration but allow the specification of
      // additional databases. Also, allows fun things with 'prefix' if they
      // want to try multisite.
      if (!isset($databases) || !is_array($databases)) {
        $databases = array();
      }
      $databases = array_replace_recursive($databases, $value);
    }
    else {
      $$key = $value;
    }
  }
}

/**
 * Handle Hash Salt Value from Drupal
 *
 * Issue: https://github.com/pantheon-systems/drops-8/issues/10
 *
 */
if (isset($_ENV['PANTHEON_ENVIRONMENT'])) {
  $settings['hash_salt'] = $_ENV['DRUPAL_HASH_SALT'];
}

/**
 * Define appropriate location for tmp directory
 *
 * Issue: https://github.com/pantheon-systems/drops-8/issues/114
 *
 */
if (isset($_ENV['PANTHEON_ENVIRONMENT'])) {
  $config['system.file']['path']['temporary'] = $_SERVER['HOME'] .'/tmp';
}

/**
 * The default list of directories that will be ignored by Drupal's file API.
 *
 * By default ignore node_modules and bower_components folders to avoid issues
 * with common frontend tools and recursive scanning of directories looking for
 * extensions.
 *
 * @see file_scan_directory()
 * @see \Drupal\Core\Extension\ExtensionDiscovery::scanDirectory()
 */
if (empty($settings['file_scan_ignore_directories'])) {
  $settings['file_scan_ignore_directories'] = [
    'node_modules',
    'bower_components',
  ];
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.4.1: http://docutils.sourceforge.net/" />
<title>Google Wave Client-Server Protocol Whitepaper</title>
<meta name="authors" content="Joe Gregorio" />

Google Wave Client-Server Protocol Whitepaper

<col class="docinfo-name" />
<col class="docinfo-content" />

Authors:
Joe Gregorio

Version:
2.0 - May 2010

This whitepaper is part of a series. All of the whitepapers
can be found on Google Wave Federation Protocol site.

Editorial Notes

To provide feedback on this draft join the wave-protocol
mailing list at
http://groups.google.com/group/wave-protocol

This current draft only covers a small subset of the functionality
that is required to build a full client. Future drafts
will expand to cover more functionality.

Introduction

This document describes the protocol by which a
wave client communicates with a wave server in order to
create, read, and modify waves. The protocol is defined in
terms of JSON messages exchanged over WebSockets.

Background

There is already a protocol being defined to handle the federation
of Waves, however it was designed as a server-to-server protocol and
is not well suited for clients.
What is needed is a lighter weight protocol that only captures
the needs of a client-server communication channel. The WebSockets protocol
was chosen because it provides the two-way communication
channel needed to efficiently handle wave messages, while being light weight
and targeted to browsers, which are considered a primary platform
for client developers.

Scope

This specification only covers the rudiments of the communication between
a client and a server. There are many things that are not covered by
this specification at this time, such as authentication, authorization,
how a client determines which server to talk to, or which port to use.
This protocol is a very simple client/server protocol implementation,
and does not reflect the Google Wave web client protocol
used in production today.

Data Model

It is important to understand the Wave Federation Protocol
and Conversation Model as a prerequisite to this specification.

Terminology

The following terminology is used by this specification:

wave - a collection of wavelets

wavelet - a collection of named documents and participants, and the domain of operational transformation

document - a structured wave document

wave message - a single message sent either from the client to the server or from the server to the client.

Wave messages do not include the WebSocket opening handshake messages.

Operation

This section assumes an elementary understanding of the theory of Operational
Transforms.

Protocol Version

In the current implementation the version of the protocol is carried in each
message and if the server does not understand the version sent it closes
the connection. Future revisions may have the client and server negotiate
for an agreed upon protocol version.

The version of the protocol used is 1.

Transport

The protocol begins when a Wave client connects with a Wave server.
The connection is handled by the WebSockets protocol. After the connection
is initiated Wave messages are sent between the client and
server encapsulated in WebSocket frames. Each message occupies
a single frame.

Transport Error Conditions

WebSocket Errors

TBD

Timeouts

TBD

Error recovery

TDB

Message Flow

There are two kinds of Wave requests, ProtocolOpenRequest
and ProtocolSubmitRequest. Communication begins when
a client sends a ProtocolOpenRequest to the server with the
id of a Wave it wishes to monitor and/or mutate. After opening
a wave the client may send ProtocolSubmitRequests
to the server to manipulate the wave. The server will
send ProtocolWaveletUpdates to the client as the server
representation of the wave changes.

Any error messages related to the opening of a wave
are sent back from the server in a ProtocolWaveletUpdate.

A client may send more than one ProtocolOpenRequest, one for
each wave that the client is interested in.

The client MUST send a ProtocolOpenRequest for each
wave that the client is interested in. A client MUST NOT
send mutations for a wave id that it has not issued a
ProtocolOpenRequest for. The client must
wait for the server to acknowledge the ProtocolOpenRequest
before sending ProtocolSubmitRequests for the given
wave as it needs to include the document hash with
each ProtocolSubmitRequest.

ProtocolOpenRequest

The ProtocolOpenRequest contains a wave id and
a wavelet_id_prefix. Those two determine the set of
wavelets that the client will be notified of changes
to.

The wavelet_id_prefix may be shortened to match
a larger subset of wavelets, with the empty string
matching all wavelets in the given wave.

The client can indicate if it supports snapshots when
it sends a ProtocolOpenRequest.

It also contains the protocol version number, which is
defined as 1, per the previous section on Protocol Version.

ProtocolWaveletUpdate

In response to a ProtocolOpenRequest the server may
send any number of ProtocolWaveletUpdate messages.
The ProtocolWaveletUpdate may contain a snapshot of
the current wave state or it will contain one or more
ProtocolWaveletDelta messages that represent deltas
to be applied to wavelets that the client is monitoring.
The inclusion of the snapshot is determined by the
server, it will only be sent on the first ProtocolWaveletUpdate,
and will only be sent if the client has indicated in its
ProtocolOpenRequest that it supports receiving snapshots.

ProtocolWaveletUpdate messages will only be sent for
wavelets that the client is an explicit participant in.

ProtocolSubmitRequest

This message contains a ProtocolWaveletDelta which the
client requests the server to apply to a wave. Only one
submit per wavelet may be outstanding at any one time.

The client specifies which version to apply the delta at,
and the client is expected to transform deltas pending
for submission against deltas received in
ProtocolWaveletUpdates from the server.

ProtocolWaveletDelta's are applied atomically and either
fully succeed, or the whole delta will fail.

ProtocolSubmitResponse

The ProtocolSubmitResponse acknowledges the ProtocolSubmitRequest
and if the delta was successfully applied it also supplies the
ProtocolHashedVersion of the wavelet after the delta, which
the client will need to successfully submit future deltas
to the wavelet.

Closing a wave

TBD

Specific Flows

Search

TBD

Creating a new wave

Creating a new wave is different from other flows
since neither the client nor the server have the wave
id. The client must generate a unique id for the wave
and send a ProtocolOpenRequest for that wave id.

Entropy and Wave ID Length

TBD

Serializing Protocol Buffers as JSON

There is no standard serialization of Protocol Buffers
into JSON. This section will define the serialization
that is used to construct Wave Messages from the protocol
buffers included in this specification.

Protocol buffer messages may be nested, so this serialization
algorithm must be applied recursively.

The root level message is emitted as a JSON object. Each
member of the message will be emitted as a key-value pair
in the JSON object. Each member's key name in
the JSON serialization is set to normalize(key), where
normalize is a function that takes in the protocol
buffer member key name and returns a JSON utf-8 string.

normalize()

TBD

Member value serialization

The serialization of a value for the key is dependent
on the type and modifiers of that member. If the member
is flagged as 'repeated' then the serialized
value will be a JSON array. The array will be filled
with the serialized values of the repeated members.

Modifiers

The following modifiers can be applied to message
values and they alter how the values are serialized.

repeated

For each repeated member value, serialize it as
JSON according to the following rules and add the serialization
to the JSON array.

required

Required parameters are always serialized into JSON.

optional

Optional parameters are only serialized if they appear in the
protocol buffer.

string

A string member of a protocol buffer message is serialized
as a JSON string.

int

An int32 or int64 member of a protocol buffer message
is serialized as a JSON number.

bool

A bool value is serialized as a JSON number with a value of
1 for true and 0 for false.

enum

An enum value is serialized as a JSON string for the enumeration's value.

bytes

A bytes value is hex encoded and serialized as a JSON string.

message

A protocol buffer message is serialized by recursively applying
the rules in this section.

Security

Securing the channel

TBD

Authenticating the client

TBD

Authorization

Authorization is covered in the Access Control Whitepaper.

Client-Server Protocol Buffers

While the client server protocol is implemented as JSON over WebSockets,
each Wave message is a JSON serialization of a protocol buffer. The
protocol buffer definitions are defined as:

TBD

Example Client-Server Flow

TBD

Appendix A - Open Source Implementation Notes

The current open source implementation of the
client-server protocol begins with the client
opening the wave "indexwave!indexwave". That
is currently an implementation detail and is not
documented.


text:
using namespace cimple;

static int __cimple_CIM_DiskDrive_Provider_proc(
    const Registration* registration,
    int operation,
    void* arg0,
    void* arg1,
    void* arg2,
    void* arg3,
    void* arg4,
    void* arg5,
    void* arg6,
    void* arg7)
{
    typedef CIM_DiskDrive Class;
    typedef CIM_DiskDrive_Provider Provider;

    if (operation != OPERATION_INVOKE_METHOD)
        return Instance_Provider_Proc_T<Provider>::proc(registration,
            operation, arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);

    Provider* provider = (Provider*)arg0;
    const Class* self = (const Class*)arg1;
    const char* meth_name = ((Instance*)arg2)->meta_class->name;

    if (strcasecmp(meth_name, "RequestStateChange") == 0)
    {
        typedef CIM_DiskDrive_RequestStateChange_method Method;
        Method* method = (Method*)arg2;
        return provider->RequestStateChange(
            self,
            method->RequestedState,
            method->Job,
            method->TimeoutPeriod,
            method->return_value);
    }

    if (strcasecmp(meth_name, "SetPowerState") == 0)
    {
        typedef CIM_DiskDrive_SetPowerState_method Method;
        Method* method = (Method*)arg2;
        return provider->SetPowerState(
            self,
            method->PowerState,
            method->Time,
            method->return_value);
    }

    if (strcasecmp(meth_name, "Reset") == 0)
    {
        typedef CIM_DiskDrive_Reset_method Method;
        Method* method = (Method*)arg2;
        return provider->Reset(
            self,
            method->return_value);
    }

    if (strcasecmp(meth_name, "EnableDevice") == 0)
    {
        typedef CIM_DiskDrive_EnableDevice_method Method;
        Method* method = (Method*)arg2;
        return provider->EnableDevice(
            self,
            method->Enabled,
            method->return_value);
    }

    if (strcasecmp(meth_name, "OnlineDevice") == 0)
    {
        typedef CIM_DiskDrive_OnlineDevice_method Method;
        Method* method = (Method*)arg2;
        return provider->OnlineDevice(
            self,
            method->Online,
            method->return_value);
    }

    if (strcasecmp(meth_name, "QuiesceDevice") == 0)
    {
        typedef CIM_DiskDrive_QuiesceDevice_method Method;
        Method* method = (Method*)arg2;
        return provider->QuiesceDevice(
            self,
            method->Quiesce,
            method->return_value);
    }

    if (strcasecmp(meth_name, "SaveProperties") == 0)
    {
        typedef CIM_DiskDrive_SaveProperties_method Method;
        Method* method = (Method*)arg2;
        return provider->SaveProperties(
            self,
            method->return_value);
    }

    if (strcasecmp(meth_name, "RestoreProperties") == 0)
    {
        typedef CIM_DiskDrive_RestoreProperties_method Method;
        Method* method = (Method*)arg2;
        return provider->RestoreProperties(
            self,
            method->return_value);
    }

    if (strcasecmp(meth_name, "LockMedia") == 0)
    {
        typedef CIM_DiskDrive_LockMedia_method Method;
        Method* method = (Method*)arg2;
        return provider->LockMedia(
            self,
            method->Lock,
            method->return_value);
    }

    return -1;
}

CIMPLE_MODULE(CIM_DiskDrive_Module);
CIMPLE_INSTANCE_PROVIDER(CIM_DiskDrive_Provider);

#ifdef CIMPLE_PEGASUS_MODULE
  CIMPLE_PEGASUS_PROVIDER_ENTRY_POINT;
# define __CIMPLE_FOUND_ENTRY_POINT
#endif

#ifdef CIMPLE_CMPI_MODULE
  CIMPLE_CMPI_INSTANCE_PROVIDER(CIM_DiskDrive_Provider);
# define __CIMPLE_FOUND_ENTRY_POINT
#endif

#ifdef CIMPLE_OPENWBEM_MODULE
  CIMPLE_OPENWBEM_PROVIDER(CIM_DiskDrive_Module);
# define __CIMPLE_FOUND_ENTRY_POINT
#endif

#ifndef __CIMPLE_FOUND_ENTRY_POINT
# error "No provider entry point found. Please define one of the following: CIMPLE_PEGASUS_MODULE, CIMPLE_CMPI_MODULE, CIMPLE_OPENWBEM_MODULE"
#endif


text:
import _root_.io.gatling.core.scenario.Simulation
import ch.qos.logback.classic.{Level, LoggerContext}
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import org.slf4j.LoggerFactory

import scala.concurrent.duration._

/**
 * Performance test for the Cluster entity.
 */
class ClusterGatlingTest extends Simulation {

    val context: LoggerContext = LoggerFactory.getILoggerFactory.asInstanceOf[LoggerContext]
    // Log all HTTP requests
    //context.getLogger("io.gatling.http").setLevel(Level.valueOf("TRACE"))
    // Log failed HTTP requests
    //context.getLogger("io.gatling.http").setLevel(Level.valueOf("DEBUG"))

    val baseURL = Option(System.getProperty("baseURL")) getOrElse """http://127.0.0.1:8080"""

    val httpConf = http
        .baseURL(baseURL)
        .inferHtmlResources()
        .acceptHeader("*/*")
        .acceptEncodingHeader("gzip, deflate")
        .acceptLanguageHeader("fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3")
        .connection("keep-alive")
        .userAgentHeader("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:33.0) Gecko/20100101 Firefox/33.0")

    val headers_http = Map(
        "Accept" -> """application/json"""
    )

    val headers_http_authentication = Map(
        "Content-Type" -> """application/x-www-form-urlencoded""",
        "Accept" -> """application/json"""
    )

    val headers_http_authenticated = Map(
        "Accept" -> """application/json""",
        "x-auth-token" -> "${x_auth_token}"
    )

    val scn = scenario("Test the Cluster entity")
        .exec(http("First unauthenticated request")
        .get("/api/account")
        .headers(headers_http)
        .check(status.is(401)))
        .pause(10)
        .exec(http("Authentication")
        .post("/api/authenticate")
        .headers(headers_http_authentication)
        .formParam("username", "admin")
        .formParam("password", "admin")
        .check(jsonPath("$.token").saveAs("x_auth_token")))
        .pause(1)
        .exec(http("Authenticated request")
        .get("/api/account")
        .headers(headers_http_authenticated)
        .check(status.is(200)))
        .pause(10)
        .repeat(2) {
            exec(http("Get all clusters")
            .get("/api/clusters")
            .headers(headers_http_authenticated)
            .check(status.is(200)))
            .pause(10 seconds, 20 seconds)
            .exec(http("Create new cluster")
            .put("/api/clusters")
            .headers(headers_http_authenticated)
            .body(StringBody("""{"id":null, "clustername":"SAMPLE_TEXT", "version":"SAMPLE_TEXT", "size":"0", "replication":"0", "blocksize":"0", "submitTime":"2020-01-01T00:00:00.000Z", "stopTime":"2020-01-01T00:00:00.000Z", "exitStatus":"0", "status":"SAMPLE_TEXT", "username":"SAMPLE_TEXT"}""")).asJSON
            .check(status.is(201))
            .check(headerRegex("Location", "(.*)").saveAs("new_cluster_url")))
            .pause(10)
            .repeat(5) {
                exec(http("Get created cluster")
                .get("${new_cluster_url}")
                .headers(headers_http_authenticated))
                .pause(10)
            }
            .exec(http("Delete created cluster")
            .delete("${new_cluster_url}")
            .headers(headers_http_authenticated))
            .pause(10)
        }

    val users = scenario("Users").exec(scn)

    setUp(
        users.inject(rampUsers(100) over (1 minutes))
    ).protocols(httpConf)
}


text:
"""Unit tests for elisp.manifest."""

import argparse
import io
import json
import pathlib
import unittest

from phst_rules_elisp.elisp import manifest

class ManifestTest(unittest.TestCase):
    """Unit tests for the manifest.add and manifest.write functions."""

    def test_add(self) -> None:
        """Unit test for manifest.add."""
        args = ['--foo']
        with manifest.add('wrap', args) as file:
            file.write('test')
        self.assertEqual(len(args), 3)
        self.assertEqual(args[0], '--foo')
        self.assertRegex(args[1], r'^--manifest=')
        self.assertEqual(args[2], '--')

    def test_write(self) -> None:
        """Unit test for manifest.write."""
        opts = argparse.Namespace()
        opts.load_directory = [pathlib.PurePath('load-dir')]
        opts.load_file = [pathlib.PurePath('load-file')]
        opts.data_file = [pathlib.PurePath('data-file')]
        opts.rule_tag = ['tag-1', 'tag-2 \t\n\r\f äα𝐴🐈\'\0\\"']
        with io.StringIO() as file:
            manifest.write(opts,
                           [pathlib.PurePath('in-1'), pathlib.PurePath('in-2')],
                           [pathlib.PurePath('out \t\n\r\f äα𝐴🐈\'\0\\"')],
                           file)
            self.assertDictEqual(
                json.loads(file.getvalue()),
                {
                    'root': 'RUNFILES_ROOT',
                    'loadPath': ['load-dir'],
                    'inputFiles': ['in-1', 'in-2', 'load-file', 'data-file'],
                    'outputFiles': ['out \t\n\r\f äα𝐴🐈\'\0\\"'],
                    'tags': ['tag-1', 'tag-2 \t\n\r\f äα𝐴🐈\'\0\\"'],
                })

if __name__ == '__main__':
    unittest.main()


text:
module Faker
  module Skill
    extend ModuleUtils
    extend self

    def tech_skill
      TECH_SKILLS.sample
    end

    def tech_skills(num = 3)
      TECH_SKILLS.random_pick(num)
    end

    def specialty
      "%s %s" % [SPECIALTY_START.sample, SPECIALTY_END.sample]
    end

    def specialties(num = 3)
      (1..num).map { specialty }
    end
  end
end


text:
class AddConfirmationFieldsToUsers < ActiveRecord::Migration
  def change
    add_column :users, :confirmed_at, :timestamp
    add_column :users, :confirmation_sent_at, :timestamp
    add_column :users, :confirmation_token, :string
    add_column :users, :unconfirmed_email, :string
  end
end