text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>org.wso2.charon</groupId>
        <artifactId>charon-parent</artifactId>
        <version>2.0.0-wso2v1-SNAPSHOT</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>org.wso2.charon</groupId>
    <artifactId>org.wso2.charon.utils</artifactId>
    <packaging>jar</packaging>
    <name>WSO2 Charon - Utils</name>
    <description>WSO2 Charon - SCIM Implementation</description>
    <url>http://wso2.com</url>

    <repositories>
        <repository>
            <id>central</id>
            <name>Maven Repository Switchboard</name>
            <url>http://repo1.maven.org/maven2</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.wso2.charon</groupId>
            <artifactId>org.wso2.charon.core</artifactId>
            <version>${charon.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ws.commons.axiom</groupId>
            <artifactId>axiom-api</artifactId>
            <version>1.2.9</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <properties>
        <charon.core.version>${charon.version}</charon.core.version>
    </properties>
</project>


text:
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

import sys
import copy

from ansible import constants as C
from ansible.module_utils._text import to_text
from ansible.module_utils.connection import Connection
from ansible.utils.display import Display

try:
    from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import load_provider
    from ansible_collections.ansible.netcommon.plugins.action.network import ActionModule as ActionNetworkModule
except ImportError:
    from ansible.module_utils.network.common.utils import load_provider
    from ansible.plugins.action.network import ActionModule as ActionNetworkModule

from ansible_collections.f5networks.f5_modules.plugins.module_utils.common import f5_provider_spec

display = Display()

class ActionModule(ActionNetworkModule):

    def run(self, tmp=None, task_vars=None):
        socket_path = None
        transport = 'rest'

        if self._play_context.connection == 'network_cli':
            provider = self._task.args.get('provider', {})
            if any(provider.values()):
                display.warning("'provider' is unnecessary when using 'network_cli' and will be ignored")
        elif self._play_context.connection == 'local':
            provider = load_provider(f5_provider_spec, self._task.args)
            transport = provider['transport'] or transport

            display.vvvv('connection transport is %s' % transport, self._play_context.remote_addr)

            if transport == 'cli':
                pc = copy.deepcopy(self._play_context)
                pc.connection = 'network_cli'
                pc.network_os = 'bigiq'
                pc.remote_addr = provider.get('server', self._play_context.remote_addr)
                pc.port = int(provider['server_port'] or self._play_context.port or 22)
                pc.remote_user = provider.get('user', self._play_context.connection_user)
                pc.password = provider.get('password', self._play_context.password)
                pc.private_key_file = provider['ssh_keyfile'] or self._play_context.private_key_file
                command_timeout = int(provider['timeout'] or C.PERSISTENT_COMMAND_TIMEOUT)

                display.vvv('using connection plugin %s' % pc.connection, pc.remote_addr)
                connection = self._shared_loader_obj.connection_loader.get('persistent', pc, sys.stdin)
                connection.set_options(direct={'persistent_command_timeout': command_timeout})
                socket_path = connection.run()
                display.vvvv('socket_path: %s' % socket_path, pc.remote_addr)
                if not socket_path:
                    return {'failed': True,
                            'msg': 'Unable to open shell. Please see: '
                                   'https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell'}

                task_vars['ansible_socket'] = socket_path

        if (self._play_context.connection == 'local' and transport == 'cli') or self._play_context.connection == 'network_cli':
            # make sure we are in the right cli context which should be
            # enable mode and not config module
            if socket_path is None:
                socket_path = self._connection.socket_path
            conn = Connection(socket_path)
            out = conn.get_prompt()
            while '(config' in to_text(out, errors='surrogate_then_replace').strip():
                display.vvvv('wrong context, sending exit to device', self._play_context.remote_addr)
                conn.send_command('exit')
                out = conn.get_prompt()

        result = super(ActionModule, self).run(tmp, task_vars)
        return result

redpajama_set_name: RedPajamaGithub


text:
FactoryGirl.define do
  factory :comment do
    association :article, :factory => :article
    body "Comment body"
    ip   "192.168.0.1"
    email "jake@home.com"
  end

  factory :invalid_comment, parent: :comment do |f|
    f.title nil
  end
end


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">

    <title>README.rdoc</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../../../../../../../../../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../../../../../../../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../../../../../../../../../css/github.css" type="text/css" media="screen" />

            Ruby on Rails 4.0.2

            README.rdoc

                ../../../../usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.0.2/README.rdoc

Last modified: 2014-01-03 14:27:28 +0800

Active Support – Utility classes and Ruby extensions from Rails

Active Support is a collection of utility classes and standard library
extensions that were found useful for the Rails framework. These additions
reside in this package so they can be loaded as needed in Ruby projects
outside of Rails.

Download and installation

The latest version of Active Support can be installed with RubyGems:

% [sudo] gem install activesupport

Source code can be downloaded as part of the Rails project on GitHub:

github.com/rails/rails/tree/4-0-stable/activesupport

License

Active Support is released under the MIT license:

www.opensource.org/licenses/MIT

Support

API documentation is at:

api.rubyonrails.org

Bug reports and feature requests can be filed with the rest for the Ruby on
Rails project here:

github.com/rails/rails/issues


text:
import traceback

from cloudshell.cp.core.models import DeployAppResult
from cloudshell.cp.core.utils import convert_to_bool

from cloudshell.cp.vcenter.models.VCenterDeployVMFromLinkedCloneResourceModel import \
    VCenterDeployVMFromLinkedCloneResourceModel
from cloudshell.cp.vcenter.models.vCenterCloneVMFromVMResourceModel import vCenterCloneVMFromVMResourceModel
from cloudshell.cp.vcenter.models.vCenterVMFromImageResourceModel import vCenterVMFromImageResourceModel
from cloudshell.cp.vcenter.models.vCenterVMFromTemplateResourceModel import vCenterVMFromTemplateResourceModel
from cloudshell.cp.vcenter.vm.ovf_image_params import OvfImageParams
from cloudshell.cp.vcenter.vm.vcenter_details_factory import VCenterDetailsFactory
from cloudshell.cp.vcenter.common.vcenter.vm_location import VMLocation
from cloudshell.cp.vcenter.common.cloud_shell.conn_details_retriever import ResourceConnectionDetailsRetriever
from cloudshell.cp.core.models import  VmDetailsProperty

class VirtualMachineDeployer(object):
    def __init__(self, pv_service, name_generator, ovf_service, resource_model_parser, vm_details_provider):
        """

        :param pv_service:
        :type pv_service: cloudshell.cp.vcenter.common.vcenter.vmomi_service.pyVmomiService
        :param name_generator:
        :param ovf_service:
        :type ovf_service: cloudshell.cp.vcenter.common.vcenter.ovf_service.OvfImageDeployerService
        :type resource_model_parser: ResourceModelParser
        :param vm_details_provider:
        :type vm_details_provider: cloudshell.cp.vcenter.vm.vm_details_provider.VmDetailsProvider
        :return:
        """
        self.pv_service = pv_service
        self.name_generator = name_generator
        self.ovf_service = ovf_service  # type common.vcenter.ovf_service.OvfImageDeployerService
        self.resource_model_parser = resource_model_parser  # type ResourceModelParser
        self.vm_details_provider = vm_details_provider

    def deploy_from_linked_clone(self, si, logger, data_holder, vcenter_data_model, reservation_id,
                                 cancellation_context):
        """
        deploy Cloned VM From VM Command, will deploy vm from a snapshot

        :param cancellation_context:
        :param si:
        :param logger:
        :param data_holder:
        :param vcenter_data_model:
        :param str reservation_id:
        :rtype DeployAppResult:
        :return:
        """

        template_resource_model = data_holder.template_resource_model

        return self._deploy_a_clone(si=si,
                                    logger=logger,
                                    app_name=data_holder.app_name,
                                    template_name=template_resource_model.vcenter_vm,
                                    other_params=template_resource_model,
                                    vcenter_data_model=vcenter_data_model,
                                    reservation_id=reservation_id,
                                    cancellation_context=cancellation_context,
                                    snapshot=template_resource_model.vcenter_vm_snapshot)

    def deploy_clone_from_vm(self, si, logger, data_holder, vcenter_data_model, reservation_id, cancellation_context):
        """
        deploy Cloned VM From VM Command, will deploy vm from another vm

        :param cancellation_context:
        :param reservation_id:
        :param si:
        :param logger:
        :type data_holder:
        :type vcenter_data_model:
        :rtype DeployAppResult:
        :return:
        """
        template_resource_model = data_holder.template_resource_model
        return self._deploy_a_clone(si,
                                    logger,
                                    data_holder.app_name,
                                    template_resource_model.vcenter_vm,
                                    template_resource_model,
                                    vcenter_data_model,
                                    reservation_id,
                                    cancellation_context)

    def deploy_from_template(self, si, logger, data_holder, vcenter_data_model, reservation_id, cancellation_context):
        """
        :param cancellation_context:
        :param reservation_id:
        :param si:
        :param logger:
        :type data_holder: DeployFromTemplateDetails
        :type vcenter_data_model
        :rtype DeployAppResult:
        :return:
        """
        template_resource_model = data_holder.template_resource_model
        return self._deploy_a_clone(si,
                                    logger,
                                    data_holder.app_name,
                                    template_resource_model.vcenter_template,
                                    template_resource_model,
                                    vcenter_data_model,
                                    reservation_id,
                                    cancellation_context)

    def _deploy_a_clone(self, si, logger, app_name, template_name, other_params, vcenter_data_model, reservation_id,
                        cancellation_context,
                        snapshot=''):
        """
        :rtype DeployAppResult:
        """
        # generate unique name
        vm_name = self.name_generator(app_name, reservation_id)

        VCenterDetailsFactory.set_deplyment_vcenter_params(
            vcenter_resource_model=vcenter_data_model, deploy_params=other_params)

        template_name = VMLocation.combine([other_params.default_datacenter,
                                            template_name])

        params = self.pv_service.CloneVmParameters(si=si,
                                                   template_name=template_name,
                                                   vm_name=vm_name,
                                                   vm_folder=other_params.vm_location,
                                                   datastore_name=other_params.vm_storage,
                                                   cluster_name=other_params.vm_cluster,
                                                   resource_pool=other_params.vm_resource_pool,
                                                   power_on=False,
                                                   snapshot=snapshot)

        if cancellation_context.is_cancelled:
            raise Exception("Action 'Clone VM' was cancelled.")

        clone_vm_result = self.pv_service.clone_vm(clone_params=params, logger=logger,
                                                   cancellation_context=cancellation_context)
        if clone_vm_result.error:
            raise Exception(clone_vm_result.error)

        # remove a new created vm due to cancellation
        if cancellation_context.is_cancelled:
            self.pv_service.destroy_vm(vm=clone_vm_result.vm, logger=logger)
            raise Exception("Action 'Clone VM' was cancelled.")

        vm_details_data = self._safely_get_vm_details(clone_vm_result.vm, vm_name, vcenter_data_model, other_params,
                                                      logger)

        return DeployAppResult(vmName=vm_name,
                               vmUuid=clone_vm_result.vm.summary.config.uuid,
                               vmDetailsData=vm_details_data,
                               deployedAppAdditionalData={'ip_regex': other_params.ip_regex,
                                                          'refresh_ip_timeout': other_params.refresh_ip_timeout,
                                                          'auto_power_off': convert_to_bool(other_params.auto_power_off),
                                                          'auto_delete': convert_to_bool(other_params.auto_delete)})

    def deploy_from_image(self, si, logger, session, vcenter_data_model, data_holder, resource_context, reservation_id,
                          cancellation_context):
        vm_name = self.name_generator(data_holder.app_name, reservation_id)

        connection_details = ResourceConnectionDetailsRetriever.get_connection_details(session=session,
                                                                                vcenter_resource_model=vcenter_data_model,
                                                                                resource_context=resource_context)

        VCenterDetailsFactory.set_deplyment_vcenter_params(vcenter_resource_model=vcenter_data_model,
                                                           deploy_params=data_holder.image_params)

        image_params = self._get_deploy_image_params(data_holder.image_params, connection_details, vm_name)

        if cancellation_context.is_cancelled:
            raise Exception("Action 'Deploy from image' was cancelled.")

        res = self.ovf_service.deploy_image(vcenter_data_model, image_params, logger)
        if res:
            vm_path = image_params.datacenter + '/' + \
                      image_params.vm_folder if hasattr(image_params, 'vm_folder') and image_params.vm_folder else ''
            vm = self.pv_service.find_vm_by_name(si, vm_path, vm_name)
            if vm:
                # remove a new created vm due to cancellation
                if cancellation_context.is_cancelled:
                    self.pv_service.destroy_vm(vm=vm, logger=logger)
                    raise Exception("Action 'Deploy from image' was cancelled.")

                vm_details_data = self._safely_get_vm_details(vm, vm_name, vcenter_data_model, data_holder.image_params,
                                                              logger)

                additional_data = {'ip_regex': data_holder.image_params.ip_regex,
                                   'refresh_ip_timeout': data_holder.image_params.refresh_ip_timeout,
                                   'auto_power_off': convert_to_bool(data_holder.image_params.auto_power_off),
                                   'auto_delete': convert_to_bool(data_holder.image_params.auto_delete)}

                return DeployAppResult(vmName=vm_name,
                                       vmUuid=vm.config.uuid,
                                       vmDetailsData=vm_details_data,
                                       deployedAppAdditionalData=additional_data)

            raise Exception('the deployed vm from image({0}/{1}) could not be found'.format(vm_path, vm_name))
        raise Exception('failed deploying image')

    def _safely_get_vm_details(self, vm, vm_name, vcenter_model, deploy_model, logger):
        data = None
        try:
            data = self.vm_details_provider.create(
                vm=vm,
                name=vm_name,
                reserved_networks=vcenter_model.reserved_networks,
                ip_regex=deploy_model.ip_regex,
                deployment_details_provider=DeploymentDetailsProviderFromTemplateModel(deploy_model),
                wait_for_ip = deploy_model.wait_for_ip,
                logger=logger)
        except Exception:
            logger.error("Error getting vm details for '{0}': {1}".format(vm_name, traceback.format_exc()))
        return data

    @staticmethod
    def _get_deploy_image_params(data_holder, host_info, vm_name):
        """
        :type data_holder: models.vCenterVMFromImageResourceModel.vCenterVMFromImageResourceModel
        """
        image_params = OvfImageParams()
        if hasattr(data_holder, 'vcenter_image_arguments') and data_holder.vcenter_image_arguments:
            image_params.user_arguments = data_holder.vcenter_image_arguments
        if hasattr(data_holder, 'vm_location') and data_holder.vm_location:
            image_params.vm_folder = data_holder.vm_location.replace(data_holder.default_datacenter + '/', '')
        image_params.cluster = data_holder.vm_cluster
        image_params.resource_pool = data_holder.vm_resource_pool
        image_params.connectivity = host_info
        image_params.vm_name = vm_name
        image_params.datastore = data_holder.vm_storage
        image_params.datacenter = data_holder.default_datacenter
        image_params.image_url = data_holder.vcenter_image
        image_params.power_on = False
        image_params.vcenter_name = data_holder.vcenter_name
        return image_params

class DeploymentDetailsProviderFromTemplateModel(object):
    def __init__(self, template_resource_model):
        self.model = template_resource_model

    def get_details(self):
        """
        :rtype list[VmDataField]
        """
        data = []
        if isinstance(self.model, vCenterCloneVMFromVMResourceModel):
            data.append(VmDetailsProperty(key='Cloned VM Name', value=self.model.vcenter_vm))

        if isinstance(self.model, VCenterDeployVMFromLinkedCloneResourceModel):
            template = self.model.vcenter_vm
            snapshot = self.model.vcenter_vm_snapshot
            data.append(VmDetailsProperty(key='Cloned VM Name',value= '{0} (snapshot: {1})'.format(template, snapshot)))

        if isinstance(self.model, vCenterVMFromImageResourceModel):
            data.append(VmDetailsProperty(key='Base Image Name', value=self.model.vcenter_image.split('/')[-1]))

        if isinstance(self.model, vCenterVMFromTemplateResourceModel):
            data.append(VmDetailsProperty(key='Template Name', value=self.model.vcenter_template))

        return data


text:
using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using nzy3D.Maths;

namespace nzy3D.Plot3D.Builder.Delaunay
{

	public class DelaunayCoordinateValidator : ICoordinateValidator
	{

		private float[] _x;
		private float[] _y;

		private float[,] _z_as_fxy;
		public DelaunayCoordinateValidator(Coordinates coords)
		{
			if (coords == null) {
				throw new ArgumentException("Function call with illegal value 'Nothing' for parameter coords.", "coords");
			}
			if (coords.x == null) {
				throw new ArgumentException("Illegal result value 'Nothing' on x property of parameter coords.", "coords");
			}
			if (coords.y == null) {
				throw new ArgumentException("Illegal result value 'Nothing' on y property of parameter coords.", "coords");
			}
			if (coords.z == null) {
				throw new ArgumentException("Illegal result value 'Nothing' on z property of parameter coords.", "coords");
			}
			if (coords.x.Length != coords.y.Length) {
				throw new ArgumentException("Parameter coords has different x size (" + coords.x.Length + ") than y size (" + coords.y.Length + ")", "coords");
			}
			if (coords.x.Length != coords.z.Length) {
				throw new ArgumentException("Parameter coords has different x size (" + coords.x.Length + ") than z size (" + coords.z.Length + ")", "coords");
			}
			_x = coords.x;
			_y = coords.y;
			_z_as_fxy = setData(coords.z);
		}

		internal float[,] setData(float[] z)
		{
			int length = z.Length;
			float[,] z_as_fxy = new float[length, length];
			for (int p = 0; p <= length - 1; p++) {
				z_as_fxy[p, p] = z[p];
			}
			return z_as_fxy;
		}

		public float[,] get_Z_as_fxy()
		{
			return _z_as_fxy;
		}

		public float[] getX()
		{
			return _x;
		}

		public float[] getY()
		{
			return _y;
		}
	}

}

//=======================================================
//Service provided by Telerik (www.telerik.com)
//Conversion powered by NRefactory.
//Twitter: @telerik
//Facebook: facebook.com/telerik
//=======================================================


text:
import React, { Children, forwardRef, useCallback, useState } from 'react';
import { AccordionPropTypes } from './propTypes';
import { Box } from '../Box';

import { AccordionContext } from './AccordionContext';

const activeAsArray = (active) =>
  typeof active === 'number' ? [active] : active;

const Accordion = forwardRef(
  (
    { activeIndex, animate = true, children, multiple, onActive, ...rest },
    ref,
  ) => {
    const [activeIndexes, setActiveIndexes] = useState([]);
    const [stateActiveIndex, setStateActiveIndex] = useState();

    // Derived state from props
    // https://reactjs.org/docs/hooks-faq.html#how-do-i-implement-getderivedstatefromprops
    const derivedActiveIndexes = activeAsArray(activeIndex) || [];
    if (
      (typeof activeIndex !== 'undefined' ||
        activeIndex !== stateActiveIndex) &&
      derivedActiveIndexes.join() !== activeIndexes.join()
    ) {
      setActiveIndexes(derivedActiveIndexes);
      setStateActiveIndex(activeIndex);
    }

    const getAccordionContext = useCallback(
      (index) => {
        const onPanelChange = (nextIndex) => {
          let nextActiveIndexes = [...(activeIndexes || [])];

          const nextActiveIndex = nextActiveIndexes.indexOf(nextIndex);
          if (nextActiveIndex > -1) {
            nextActiveIndexes.splice(nextActiveIndex, 1);
          } else if (multiple) {
            nextActiveIndexes.push(nextIndex);
          } else {
            nextActiveIndexes = [nextIndex];
          }

          setActiveIndexes(nextActiveIndexes);
          if (onActive) {
            onActive(nextActiveIndexes);
          }
        };

        return {
          active: activeIndexes.indexOf(index) > -1,
          animate,
          onPanelChange: () => onPanelChange(index),
        };
      },
      [activeIndexes, animate, multiple, onActive],
    );

    return (
      <Box ref={ref} role="tablist" {...rest}>
        {Children.toArray(children)
          .filter((child) => child)
          .map((child, index) => (
            <AccordionContext.Provider
              // eslint-disable-next-line react/no-array-index-key
              key={index}
              value={getAccordionContext(index)}
            >
              {child}
            </AccordionContext.Provider>
          ))}
      </Box>
    );
  },
);

Accordion.propTypes = AccordionPropTypes;

export { Accordion };


text:
package org.kie.perf.scenario;

public interface IPerfTest {

    /**
     * Shouldn't contain MetricRegistry metrics = SharedMetricRegistry.getInstance();
     * For initialization of metrics use initMetrics.
     */
    public void init();

    public void initMetrics();

    public void execute();

    public void close();

}


text:
import {
    domainHost,
    WrapChain,
    createDomainComponent,
    IExtender
} from './index';

export function domain<TExternalProps, TDomain>(nameGetter: (props: TExternalProps) => string, domainGetter: (props: TExternalProps) => TDomain) {
    return {
      host: domainHost(nameGetter, domainGetter),
      use: <TChainInternalProps, TChainExternalProps>(chainGetter: (domain: TDomain) => WrapChain<TChainInternalProps, any, TChainExternalProps>) => ({
        component:  <TProps extends Partial<TChainInternalProps>>(ComponentToWrap: React.ComponentType<TProps>) => createDomainComponent({
          ComponentToWrap,
          chainGetter
        })
      }),
    };
  }


text:
<!DOCTYPE html>
<html lang="de">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Simple Map Example</title>

    <!-- Core CSS -->
    <link href="../../libs/bootstrap/bootstrap.css" rel="stylesheet">
    <link href="../../libs/ol3/ol3.css" rel="stylesheet">

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body ng-app="example">
    <!-- map -->
    <div anol-map style="width:600px; height: 400px; border: 1px solid black;">
    </div>

    <!-- Remove libs when build dist -->
    <script type="text/javascript" src="../../libs/jquery/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="../../libs/angular/angular-debug.js"></script>
    <script type="text/javascript" src="../../libs/ol3/ol3-debug.js"></script>
    <script type="text/javascript" src="../../build/anol.js"></script>

    <script type="text/javascript">
      angular.module('example', ['anol', 'anol.map'])
      .config(['MapServiceProvider', 'LayersFactoryProvider', 'LayersServiceProvider',
        function(MapServiceProvider, LayersFactoryProvider, LayersServiceProvider) {
          MapServiceProvider.addView(new ol.View({
            center: [914764, 7011016],
            zoom: 18
          }));

          var wms = LayersFactoryProvider.newSingleTileWMS({
            url: 'http://maps.omniscale.net/wms/demo/default/service?',
            params: {
              'LAYERS': 'osm',
              'SRS': 'EPSG:3857'
            }
          });
          LayersServiceProvider.setLayers([wms]);
      }]);
    </script>
  </body>
</html>


text:
using System;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading;
using MoonSharp.Interpreter.Diagnostics;
using MoonSharp.Interpreter.Interop.BasicDescriptors;
using MoonSharp.Interpreter.Interop.Converters;

namespace MoonSharp.Interpreter.Interop
{
    /// <summary>
    ///     Class providing easier marshalling of CLR fields
    /// </summary>
    public class FieldMemberDescriptor : IMemberDescriptor, IOptimizableDescriptor
    {
        private readonly object m_ConstValue;
        private Func<object, object> m_OptimizedGetter;

        /// <summary>
        ///     Initializes a new instance of the <see cref="PropertyMemberDescriptor" /> class.
        /// </summary>
        /// <param name="fi">The FieldInfo.</param>
        /// <param name="accessMode">The <see cref="InteropAccessMode" /> </param>
        public FieldMemberDescriptor(FieldInfo fi, InteropAccessMode accessMode)
        {
            if (Script.GlobalOptions.Platform.IsRunningOnAOT())
                accessMode = InteropAccessMode.Reflection;

            FieldInfo = fi;
            AccessMode = accessMode;
            Name = fi.Name;
            IsStatic = FieldInfo.IsStatic;

            if (FieldInfo.IsLiteral)
            {
                IsConst = true;
                m_ConstValue = FieldInfo.GetValue(null);
            }
            else
            {
                IsReadonly = FieldInfo.IsInitOnly;
            }

            if (AccessMode == InteropAccessMode.Preoptimized)
            {
                OptimizeGetter();
            }
        }

        /// <summary>
        ///     Gets the FieldInfo got by reflection
        /// </summary>
        public FieldInfo FieldInfo { get; }

        /// <summary>
        ///     Gets the <see cref="InteropAccessMode" />
        /// </summary>
        public InteropAccessMode AccessMode { get; }

        /// <summary>
        ///     Gets a value indicating whether this instance is a constant
        /// </summary>
        public bool IsConst { get; }

        /// <summary>
        ///     Gets a value indicating whether this instance is readonly
        /// </summary>
        public bool IsReadonly { get; }

        /// <summary>
        ///     Gets a value indicating whether the described property is static.
        /// </summary>
        public bool IsStatic { get; }

        /// <summary>
        ///     Gets the name of the property
        /// </summary>
        public string Name { get; }

        /// <summary>
        ///     Gets the value of the property
        /// </summary>
        /// <param name="script">The script.</param>
        /// <param name="obj">The object.</param>
        /// <returns></returns>
        public DynValue GetValue(Script script, object obj)
        {
            this.CheckAccess(MemberDescriptorAccess.CanRead, obj);

            // optimization+workaround of Unity bug..
            if (IsConst)
                return ClrToScriptConversions.ObjectToDynValue(script, m_ConstValue);

            if (AccessMode == InteropAccessMode.LazyOptimized && m_OptimizedGetter == null)
                OptimizeGetter();

            object result = null;

            if (m_OptimizedGetter != null)
                result = m_OptimizedGetter(obj);
            else
                result = FieldInfo.GetValue(obj);

            return ClrToScriptConversions.ObjectToDynValue(script, result);
        }

        /// <summary>
        ///     Sets the value of the property
        /// </summary>
        /// <param name="script">The script.</param>
        /// <param name="obj">The object.</param>
        /// <param name="v">The value to set.</param>
        public void SetValue(Script script, object obj, DynValue v)
        {
            this.CheckAccess(MemberDescriptorAccess.CanWrite, obj);

            if (IsReadonly || IsConst)
                throw new ScriptRuntimeException("userdata field '{0}.{1}' cannot be written to.",
                    FieldInfo.DeclaringType.Name, Name);

            var value = ScriptToClrConversions.DynValueToObjectOfType(v, FieldInfo.FieldType, null, false);

            try
            {
                if (value is double)
                    value = NumericConversions.DoubleToType(FieldInfo.FieldType, (double) value);

                FieldInfo.SetValue(IsStatic ? null : obj, value);
            }
            catch (ArgumentException)
            {
                // non-optimized setters fall here
                throw ScriptRuntimeException.UserDataArgumentTypeMismatch(v.Type, FieldInfo.FieldType);
            }
            catch (InvalidCastException)
            {
                // optimized setters fall here
                throw ScriptRuntimeException.UserDataArgumentTypeMismatch(v.Type, FieldInfo.FieldType);
            }
#if !PCL
            catch (FieldAccessException ex)
            {
                throw new ScriptRuntimeException(ex);
            }
#endif
        }

        /// <summary>
        ///     Gets the types of access supported by this member
        /// </summary>
        public MemberDescriptorAccess MemberAccess
        {
            get
            {
                if (IsReadonly || IsConst)
                    return MemberDescriptorAccess.CanRead;
                return MemberDescriptorAccess.CanRead | MemberDescriptorAccess.CanWrite;
            }
        }

        void IOptimizableDescriptor.Optimize()
        {
            if (m_OptimizedGetter == null)
                OptimizeGetter();
        }

        /// <summary>
        ///     Tries to create a new StandardUserDataFieldDescriptor, returning <c>null</c> in case the field is not
        ///     visible to script code.
        /// </summary>
        /// <param name="fi">The FieldInfo.</param>
        /// <param name="accessMode">The <see cref="InteropAccessMode" /></param>
        /// <returns>A new StandardUserDataFieldDescriptor or null.</returns>
        public static FieldMemberDescriptor TryCreateIfVisible(FieldInfo fi, InteropAccessMode accessMode)
        {
            if (fi.GetVisibilityFromAttributes() ?? fi.IsPublic)
                return new FieldMemberDescriptor(fi, accessMode);

            return null;
        }

        internal void OptimizeGetter()
        {
            if (IsConst)
                return;

            using (PerformanceStatistics.StartGlobalStopwatch(PerformanceCounter.AdaptersCompilation))
            {
                if (IsStatic)
                {
                    var paramExp = Expression.Parameter(typeof (object), "dummy");
                    var propAccess = Expression.Field(null, FieldInfo);
                    var castPropAccess = Expression.Convert(propAccess, typeof (object));
                    var lambda = Expression.Lambda<Func<object, object>>(castPropAccess, paramExp);
                    Interlocked.Exchange(ref m_OptimizedGetter, lambda.Compile());
                }
                else
                {
                    var paramExp = Expression.Parameter(typeof (object), "obj");
                    var castParamExp = Expression.Convert(paramExp, FieldInfo.DeclaringType);
                    var propAccess = Expression.Field(castParamExp, FieldInfo);
                    var castPropAccess = Expression.Convert(propAccess, typeof (object));
                    var lambda = Expression.Lambda<Func<object, object>>(castPropAccess, paramExp);
                    Interlocked.Exchange(ref m_OptimizedGetter, lambda.Compile());
                }
            }
        }
    }
}


text:
package org.sakaiproject.tags.impl.job;

import java.io.File;
import java.io.InputStream;
import java.io.FileInputStream;

import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamReader;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stax.StAXSource;
import javax.xml.transform.dom.DOMResult;
import javax.xml.stream.XMLStreamException;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.w3c.dom.Node;
import org.w3c.dom.Element;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;

import org.sakaiproject.component.api.ServerConfigurationService;
import org.sakaiproject.email.api.EmailService;

/**
 * A quartz job to synchronize the TAGS with an
 * xml file available in sakai home.
 *
 *
 */
@Slf4j
public class MeshTagsSyncJob extends TagSynchronizer implements Job {

	private String pathToXml;
	private ServerConfigurationService serverConfigurationService;
	private EmailService emailService;
	private int counterSuccess=0;
	private int counterTotal=0;
	private String lastSuccessfulLabel = "";

	/**
	 * {@inheritDoc}
	 */
	public InputStream getTagsXmlInputStream() {
		pathToXml = serverConfigurationService.getSakaiHomePath() + serverConfigurationService.getString("tags.meshcollectionfile","tags/mesh.xml");
		log.debug(pathToXml);
		File xmlFile = new File(pathToXml);
		InputStream targetStream = null;
				try {
					targetStream=new FileInputStream(xmlFile);
				} catch (Exception e){
					log.warn("The Mesh file can't be found in the specified route: " + pathToXml);
				}
		return targetStream;
	}

	/**
	 * {@inheritDoc}
	 */
	public void execute(JobExecutionContext arg0) throws JobExecutionException {
		syncAllTags();
	}

	public synchronized void syncAllTags() {

		long start = System.currentTimeMillis();

		if(log.isInfoEnabled()) {
			log.info("Starting MESH Tag Collection synchronization");
		}
		try{
			XMLInputFactory factory = XMLInputFactory.newInstance();
			XMLStreamReader xsr = factory.createXMLStreamReader(getTagsXmlInputStream());
			xsr.next();
			xsr.nextTag();
			TransformerFactory tf = TransformerFactory.newInstance();
			Transformer t = tf.newTransformer();

			while (xsr.nextTag() == XMLStreamConstants.START_ELEMENT) {
				DOMResult result = new DOMResult();
				t.transform(new StAXSource(xsr), result);

				Node nNode = result.getNode();
				Element element = ((Document)nNode).getDocumentElement();
				String tagLabel="undefined";
				counterTotal++;

				try {
					Element descriptorName = (Element) element.getElementsByTagName("DescriptorName").item(0);
					tagLabel =	getString("String",descriptorName);
					String externalId = getString("DescriptorUI",element);
					String description = getString("Annotation",element);
					long externalCreationDate = xmlDateToMs(element.getElementsByTagName("DateCreated").item(0),externalId);
					long lastUpdateDateInExternalSystem = xmlDateToMs(element.getElementsByTagName("DateRevised").item(0),externalId);
					String externalHierarchyCode = xmlTreeToString(element.getElementsByTagName("TreeNumberList").item(0),externalId);
					String externalType = element.getAttribute("DescriptorClass");
					String alternativeLabels = xmlToAlternativeLabels(element.getElementsByTagName("ConceptList").item(0), externalId);
					updateOrCreateTagWithExternalSourceName(externalId, "MESH",  tagLabel,  description,
							alternativeLabels,  externalCreationDate, lastUpdateDateInExternalSystem,  null,
							externalHierarchyCode,  externalType,  null);
					counterSuccess++;
					lastSuccessfulLabel=tagLabel;
				} catch (Exception e) {
					log.warn("Mesh XML can't be processed for this Label: " + tagLabel + ". If the value is undefined, then, the previous successful label was: " + lastSuccessfulLabel,e);
					sendStatusMail(2,e.getMessage());
				}
				if(counterTotal%1000==0){
					log.info(counterSuccess + "/" + counterTotal + " labels processed correctly... and still processing. " + (counterTotal - counterSuccess) + " errors by the moment");
				}

			} // end while
			xsr.close();
			updateTagCollectionSynchronization("MESH",0L);
			deleteTagsOlderThanDateFromCollection("MESH",start);
			sendStatusMail(1,"Imported from MESH finished. Num of labels processed successfully " + counterSuccess + "of" + counterTotal);
		} catch (XMLStreamException ex) {
			log.warn("Mesh XML can't be processed",ex);
		} catch (Exception e){
			log.warn("Mesh XML can't be processed",e);
			sendStatusMail(2,e.getMessage());
		}

		if(log.isInfoEnabled()) {
			log.info("Finished Mesh Tags synchronization in " + (System.currentTimeMillis()-start) + " ms");
		}
		counterTotal=0;
		counterSuccess=0;
		lastSuccessfulLabel="";
	}

	//These are particulars for mesh format
	private String xmlTreeToString(Node nNode, String externalId) {
		Element element = (Element) nNode;
		String treeNumberList = "";
		boolean first = true;
		try {
			NodeList treeNumber = element.getElementsByTagName("TreeNumber");
			for (int i = 0; i < treeNumber.getLength(); i++) {
				Node childElement = (Node) treeNumber.item(i);
				if (!first) {
					treeNumberList += ", ";
				}
				treeNumberList += childElement.getTextContent();
				first = false;
			}
			return treeNumberList;
		}catch (Exception e){
			log.debug("Treenumber Mesh XML can't be processed in:" + externalId,e);
			return null;
		}
	}

	private String xmlToAlternativeLabels(Node nNode, String externalId) {
        //Procesing the dates
		Element element = (Element) nNode;
		String alternativeLabelsList = "";

		try {
			NodeList concept = element.getElementsByTagName("Concept");
			for (int i = 0; i < concept.getLength(); i++) {
				Element conceptNode = (Element) concept.item(i);
				Element conceptName = (Element) conceptNode.getElementsByTagName("ConceptName").item(0);
				alternativeLabelsList += "Concept: " + getString("String",conceptName)+"\r\n";
				String scope = getString("ScopeNote",conceptNode);
				if (scope != null) {
					scope = "Scope Note: " + scope + "\r\n";
					alternativeLabelsList += scope;
				}
				boolean first = true;
				//Element termList = (Element) conceptNode.getElementsByTagName("TermList").item(0);
				NodeList term = element.getElementsByTagName("Term");
				for (int j = 0; j < term.getLength(); j++) {
					Element termNode = (Element) term.item(j);
					if (!first) {
						alternativeLabelsList += ", ";
					}else{
						alternativeLabelsList += "Terms: ";
					}
					alternativeLabelsList += getString("String",termNode);
					first = false;
				}
				alternativeLabelsList +="\r\n\r\n";
			}
			return alternativeLabelsList;
		}catch (Exception e){
			log.warn("AlternativeLabels in Mesh XML can't be processed at" +  externalId,e);
			return null;
		}
	}

	protected void sendStatusMail(int status,String extraInfo){

		String body;
		String subject;
		String from;
		String emailAddr= serverConfigurationService.getString("tags.import_job_email",serverConfigurationService.getString("portal.error.email"));

		if (StringUtils.isNotBlank(emailAddr)) {

			if (status == 1){
				body="The Mesh Tag XML import job has been successful";
				subject = "Mesh Tag XML import job success";
			}else{
				body="The Mesh Tag XML import jab had and error. look at the Sakai log for more information";
				subject = "Mesh Tag XML import job error";
			}

			from= "no-reply@" + serverConfigurationService.getServerName();

			if (emailService != null) {
				emailService.send(from, emailAddr, subject, body + "\n" + extraInfo, emailAddr, null, null);
			} else {
				log.error("Could not send email, no emailService");
			}
		}
	}

	/**
	 * @param serverConfigurationService The ServerConfigurationService.
	 */
	public void setServerConfigurationService(ServerConfigurationService serverConfigurationService)
	{
		this.serverConfigurationService = serverConfigurationService;
	}

	public void setEmailService(EmailService emailService) {

		this.emailService = emailService;

	}

	public void init() {
		if(log.isInfoEnabled()) log.info("init()");
	}

	public void destroy() {
		if(log.isInfoEnabled()) log.info("destroy()");
	}

}


text:
"use strict"

var o = require("../../ospec/ospec")
var browserMock = require("../../test-utils/browserMock")
var callAsync = require("../../test-utils/callAsync")
o.spec("browserMock", function() {

	var $window
	o.beforeEach(function() {
		$window = browserMock()
	})

	o("Mocks DOM, pushState and XHR", function() {
		o($window.location).notEquals(undefined)
		o($window.document).notEquals(undefined)
		o($window.XMLHttpRequest).notEquals(undefined)
	})
	o("$window.onhashchange can be reached from the pushStateMock functions", function(done) {
		$window.onhashchange = o.spy()
		$window.location.hash = '#a'

		callAsync(function(){
			o($window.onhashchange.callCount).equals(1)
			done()
		})
	})
	o("$window.onpopstate can be reached from the pushStateMock functions", function() {
		$window.onpopstate = o.spy()
		$window.history.pushState(null, null, "#a")
		$window.history.back()

		o($window.onpopstate.callCount).equals(1)
	})
	o("$window.onunload can be reached from the pushStateMock functions", function() {
		$window.onunload = o.spy()
		$window.location.href = '/a'

		o($window.onunload.callCount).equals(1)
	})
})


text:
SYNONYM

#### According to
GRIN Taxonomy for Plants

#### Published in
Bot. Mag. (Tokyo) 74:269. 1961

#### Original name
null

### Remarks
null


text:
#ifndef GL_SCREENSHOT_PLUGIN_H
#define GL_SCREENSHOT_PLUGIN_H

#include <KrisLibrary/utils/stringutils.h>
#include <KrisLibrary/Timer.h>
#include <string>
#include <KrisLibrary/GLdraw/GLScreenshot.h>
#include <KrisLibrary/math/math.h>
#include <stdio.h>

/** @ingroup GLDraw
 * @brief A plugin class that "automatically" saves a movie to disk in the form of
 * PPM screenshots.
 *
 * To save the screenshots, set #saveMovie to true and call MovieUpdate() during your
 * idle loop.
 *
 * By default, the frame rate is 30fps and the screenshot file format is image[xxxx].ppm
 * where [xxxx] is the frame number.  To change the fps, set #frameTime to 1.0/fps.
 * To use another file format, set #screenshotFile to the desired name of the initial
 * frame.  The program will automatically increment the digits in #screenshotFile,
 * keeping the same number of leading zeroes if possible.
 */

class GLScreenshotPlugin
{
public:
  std::string screenshotFile;
  bool saveMovie;
  double lastScreenshotTime;
  double frameTime;
  Timer timer;
  int verbose;
  bool stop_encode; //encodes automatically when recording ends
  std::string moviefile;
  std::string video_encoding_command;

  GLScreenshotPlugin()
  {
    saveMovie = false;
    lastScreenshotTime = -1;
    frameTime = 1.000/30.0;
    screenshotFile = "image0000.ppm";
    verbose = 1;
    moviefile="klampt_record.mp4";
    video_encoding_command = "ffmpeg -y -c:v libx264 -vf fps=30 -pix_fmt yuv420p -crf 18 -i image%04d.ppm";
    stop_encode=true;
  }

  virtual ~GLScreenshotPlugin() {}

  void SaveScreenshot()
  {
    const char* screenshotFilec=screenshotFile.c_str();
    bool res=GLSaveScreenshotPPM(screenshotFilec);
    if(!res) printf("Error saving screenshot to %s\n",screenshotFile.c_str());
    if(verbose) printf("Screenshot saved to %s\n",screenshotFile.c_str());
  }

  void StartMovie()
  {
    saveMovie = true;
    lastScreenshotTime = -1;
    timer.Reset();
  }

  void EncodeMovie(){
      //TODO add native support
      //http://ffmpeg.org/doxygen/trunk/api-example_8c-source.html
      //temporarily using system calls

  #ifdef WIN32
      system((video_encoding_command + " " + moviefile + " & del image*.ppm").c_str());
      return;
  #else
      system((video_encoding_command + " " + moviefile + ";rm image*.ppm").c_str());
      //system(("avconv -y -f image2 -i image%04d.ppm " + moviefile + ";rm image*.ppm").c_str());
  #endif
      screenshotFile = "image0000.ppm";
  }

  void StopMovie()
  {
    saveMovie = false;
    if(stop_encode)
      EncodeMovie();
  }

  void ToggleMovie()
  {
    if(saveMovie)
      StopMovie();
    else StartMovie();
  }

  //call this if you want a real-time movie
  void MovieUpdate()
  {
    this->MovieUpdate(timer.ElapsedTime());
  }

  //call this if you want to control movie time
  void MovieUpdate(double t)
  {
    if(saveMovie) {
      if(t >= lastScreenshotTime + frameTime) {
	printf("Time %g last %g, Saving %d screenshots\n",t,lastScreenshotTime,(int)Math::Floor((t-lastScreenshotTime)/frameTime));
	while(lastScreenshotTime+frameTime < t) {
	  SaveScreenshot();
	  IncrementStringDigits(screenshotFile);
    if(lastScreenshotTime < 0)
      lastScreenshotTime = t;
    else
  	  lastScreenshotTime += frameTime;
	}
      }
    }
  }
};

#endif


text:
package main

import "testing"

func TestOne(t *testing.T) {
	result := Reverse("teststring")
	if result != "gnirtstset" {
		t.Error("Was expecting gnirtstset, got ", result)
	}
}

func TestTwo(t *testing.T) {
	result := Reverse("itworks")
	if result != "skrowti" {
		t.Error("Was expecting skrowti, got ", result)
	}
}


text:
module Beetil
  require File.expand_path('../beetil/version', __FILE__) unless const_defined? 'VERSION'
  autoload :RequestToken, File.expand_path('../beetil/request_token', __FILE__)

  module_function

  def request_authorization(organisation)
    Beetil::RequestToken.new(organisation)
  end

end


text:
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        Toggle navigation

      </button>
      <a class="navbar-brand" href="<?php echo home_url(); ?>/"><?php bloginfo('name'); ?>
      <?php
        if (has_nav_menu('share_links')) :
          wp_nav_menu(array('theme_location' => 'share_links', 'menu_class' => 'nav navbar-nav navbar-right navbar-icons pull-right'));
        endif;
      ?>

      <?php
        if (has_nav_menu('primary_navigation')) :
          wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => 'nav navbar-nav'));
        endif;
      ?>


text:
@interface PodsDummy_Pods_DIImageView_Example : NSObject
@end
@implementation PodsDummy_Pods_DIImageView_Example
@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <url>
    <loc>https://www.studiomotio.com</loc>
    <xhtml:link rel="alternate" hreflang="fr" href="https://www.studiomotio.com"/>
    <xhtml:link rel="alternate" hreflang="en" href="https://www.studiomotio.com/en"/>
    <priority>1.00</priority>
    <lastmod>2018-04-05</lastmod>
    <changefreq>daily</changefreq>
  </url>
  <url>
    <loc>https://www.studiomotio.com/le-studio</loc>
    <xhtml:link rel="alternate" hreflang="fr" href="https://www.studiomotio.com/le-studio"/>
    <xhtml:link rel="alternate" hreflang="en" href="https://www.studiomotio.com/en/the-studio"/>
    <priority>0.8</priority>
    <lastmod>2018-04-05</lastmod>
    <changefreq>daily</changefreq>
  </url>
  <url>
    <loc>https://www.studiomotio.com/nos-services</loc>
    <xhtml:link rel="alternate" hreflang="fr" href="https://www.studiomotio.com/nos-services"/>
    <xhtml:link rel="alternate" hreflang="en" href="https://www.studiomotio.com/en/our-services"/>
    <priority>0.8</priority>
    <lastmod>2018-04-05</lastmod>
    <changefreq>daily</changefreq>
  </url>
  <url>
    <loc>https://www.studiomotio.com/contact</loc>
    <xhtml:link rel="alternate" hreflang="fr" href="https://www.studiomotio.com/contact"/>
    <xhtml:link rel="alternate" hreflang="en" href="https://www.studiomotio.com/en/contact"/>
    <priority>0.8</priority>
    <lastmod>2018-04-05</lastmod>
    <changefreq>daily</changefreq>
  </url>
  <url>
    <loc>https://www.studiomotio.com/mentions-legales</loc>
    <xhtml:link rel="alternate" hreflang="fr" href="https://www.studiomotio.com/mentions-legales"/>
    <xhtml:link rel="alternate" hreflang="en" href="https://www.studiomotio.com/en/legal-notices"/>
    <priority>0.5</priority>
    <lastmod>2018-04-05</lastmod>
    <changefreq>daily</changefreq>
  </url>
</urlset>


text:
/*growingInput*/
function gFocusFunc(event) {
    var firingInputText = event.getSource();
    var sourceId = event.getSource().getClientId();
    var inputId = firingInputText.getProperty('inputId');
    var promptId = firingInputText.getProperty('promptId');
    var realPromptId = sourceId.replace(inputId, promptId);
    var prompt = $('span[id*=' + realPromptId + ']')
    var realInputId = realPromptId.replace(promptId, inputId);
    realInputId = realInputId+'::content';
    var firingInputText1 = $('textarea[id*=' + realInputId + ']');

    if (firingInputText1.val() == '') {
        prompt.removeClass('PromptedTextLabelUnfocused').addClass('PromptedTextLabelFocused');
    }

}

function gLabelFocusFunc(event) {
    var firingInputText = event.getSource();
    firingInputText.className = 'PromptedTextLabelFocused';

}

function gBlurFunc(event) {
    var firingInputText = event.getSource();
    var sourceId = event.getSource().getClientId();
    var inputId = firingInputText.getProperty('inputId');
    var promptId = firingInputText.getProperty('promptId');
    var realPromptId = sourceId.replace(inputId, promptId);
    var prompt = $('span[id*=' + realPromptId + ']')
    var realInputId = realPromptId.replace(promptId, inputId);
    realInputId = realInputId+'::content';
    var firingInputText1 = $('textarea[id*=' + realInputId + ']');
    if (firingInputText1.val() == '') {
        prompt.removeClass('PromptedTextLabelFocused').addClass('PromptedTextLabelUnfocused');
    }
    var ximageId = firingInputText.getProperty('ximageId');
    var realXimageId = sourceId.replace(inputId, ximageId);
    var ximage = firingInputText.findComponent(realXimageId);
    if (firingInputText1.val() == '') {
        ximage.setSource('/images/xempty.png');
    }
}

  function findId(obj){
    var objString = obj.toString();
    var objId = objString.substring(objString.indexOf('id=',0)+3);
    return objId;
  }

    //var inputTextGrowingOriginalHeight;
    function mosInputTextGrowingFocus(event){
        /*var firingInputText=event.getSource();
        var localId = firingInputText.getClientId();
        var maxHeight = firingInputText.getProperty('maxHeight');
        var minHeight = firingInputText.getProperty('minHeight');
        var inputTextObj = document.getElementById(localId+'::content');
        inputTextGrowingOriginalHeight = parseInt(inputTextObj.style.height);
        if(isNaN(inputTextGrowingOriginalHeight)) {
          inputTextGrowingOriginalHeight = inputTextObj.clientHeight;
        }
        grow(inputTextObj, minHeight, maxHeight,firingInputText);*/
    }

    function mosInputTextGrowingBlurFunc(event){/*
        var firingInputText = event.getSource();
        var localId = firingInputText.getClientId();
        var inputTextObj = document.getElementById(localId+'::content');
        var minHeight = firingInputText.getProperty('minHeight');
        if (inputTextObj.value == "") {
            inputTextObj.style.height = minHeight+'px';
        } */
    }
    function mosInputTextGrowingKeyDown(event){
        var firingInputText=event.getSource();
        var localId = firingInputText.getClientId();
        var counterStart = firingInputText.getProperty('counterStart');
        var maxHeight = firingInputText.getProperty('maxHeight');
        var minHeight = firingInputText.getProperty('minHeight');
        var rows = (firingInputText.getRows()< 2?2:firingInputText.getRows());
        var maxLength = firingInputText.getProperty('maximumLength');
        var inputTextObj = $(document.getElementById(localId+'::content'));
        grow(inputTextObj, minHeight, maxHeight,firingInputText);
        toCount(inputTextObj,'{CHAR}',maxLength,rows,maxLength,counterStart,firingInputText);
    }

    function growOnResize(event){
        var firingDialog=event.getSource();
        var inputId = firingDialog.getProperty('inputId');
        var intxtgrwId = firingDialog.getProperty('intxtgrwId');
        var maxHeight = firingDialog.getProperty('maxHeight');
        var minHeight = firingDialog.getProperty('minHeight');
        var inputRealId = intxtgrwId+':'+inputId;
        var txtArea = $('textarea[id$="'+inputRealId+'::content"]');
        var txtAreaId = txtArea.attr('id');
        var firingInputText = AdfPage.PAGE.findComponent(inputRealId);
        grow(txtArea, minHeight, maxHeight, firingInputText);
        var someThingElse = 'som';
    }

    function grow(txtArea, minHeight, maxHeight, firingInputText) {
      var sizeToPopup = firingInputText.getProperty('sizeToPopup');
      var sizeToPopupHeightOffset = firingInputText.getProperty('sizeToPopupHeightOffset');
      var sizeToPopupWidthOffset = firingInputText.getProperty('sizeToPopupWidthOffset');
      var firingInputTextId = firingInputText.getClientId();
      //var label = $('label[for='+firingInputTextId+'::content]')
      //var labelp = label.closest('td');
      //var parentTableHeight = txtArea.closest('div');
      var parentTableHeight = null;
      var parentDivWidth = null;
      var parentHeight = null;
      var parentWidth = null;
      if (sizeToPopup){
          parentTableHeight = txtArea.closest('div[id$=mosPopupId::content]');
          parentDivWidth = txtArea.closest('div[id$=mosPopupId::content]');
          //var labelpWidth = labelp[0].clientWidth;
          parentHeight = parentTableHeight[0].clientHeight;
          parentWidth = parentDivWidth[0].clientWidth;
      }
      //var labelWidth = ((parentWidth-labelpWidth)-35);
      if (!document.all) {
        //txtArea.style.height = '0px';
        txtArea.height(0);
      }
      //var h = txtArea.scrollHeight + 12;
      var h = txtArea[0].scrollHeight + 12;
      if(h < minHeight) {
        h = minHeight;
      } else if(h > maxHeight) {
        h = maxHeight;
      }
      if (sizeToPopup && h > (parentHeight-sizeToPopupHeightOffset)){
        h = parentHeight-sizeToPopupHeightOffset;
      }

      //txtArea.style.height = h+'px';
      txtArea.height(h+'px');
      if (sizeToPopup){
          txtArea.width(parentWidth-sizeToPopupWidthOffset);
          //if (lablep){
          //labelp.width = '1%';}
          //txtArea[0].parentNode.width('100%');
      }
      var th = h+10;
      var currentStyle = firingInputText.getInlineStyle();
      firingInputText.setInlineStyle(currentStyle+';height:'+th+'px;display: inline-block;');
      if (sizeToPopup){
        firingInputText.setInlineStyle(currentStyle+';width:'+parentWidth-sizeToPopupWidthOffset+'px');
      }
    }

    function toCount(entranceObja,text,characters,rows,maxLength,counterStart,firingInputText) {
        var sizeToPopup = firingInputText.getProperty('sizeToPopup');
        var entranceObj = document.getElementById(entranceObja[0].id);
        var length=characters - getUTF8Length(entranceObj.value);
        var oNewDiv;
        var isNew = true;
        for (var i = 0;i < entranceObj.parentNode.childNodes.length;i++){
            if (entranceObj.parentNode.childNodes[i].nodeName == "SPAN"){
                isNew = false;
                continue;
            }
        }
        if (isNew) {
            oNewDiv = document.createElement("span");
            oNewDiv.setAttribute('style','position:absolute;top: 0;');
            oNewDiv.setAttribute('title', firingInputText.getProperty('counterDesc'));
            if (sizeToPopup){
                oNewDiv.setAttribute('style','position:absolute;top: 0;right:-30px;');
            }
            var parentTable = entranceObja.closest('table');
            parentTable.css("position","relative");
            entranceObj.parentNode.setAttribute('nowrap','nowrap')
            entranceObj.parentNode.appendChild(oNewDiv);

        } else {
            for (var j = 0;j < entranceObj.parentNode.childNodes.length;j++){
                if (entranceObj.parentNode.childNodes[j].nodeName == "SPAN"){
                    oNewDiv = entranceObj.parentNode.childNodes[j];
                    continue;
                }
            }
        }
        if(length <= 0) {
          length=0;
          text='<span style=color:red> '+text+' </span>';
          subcharacters = characters - entranceObj.value.length;
          if (subcharacters == 0){subcharacters = characters;}
          entranceObj.value=entranceObj.value.substr(0,subcharacters);
        }
        if(counterStart == maxLength || (maxLength - length) > counterStart){
          oNewDiv.style.visibility = "visible";
          oNewDiv.innerHTML = text.replace('{CHAR}',length);
        } else {
          oNewDiv.style.visibility = "hidden";
        }
        if(maxLength == length){
          oNewDiv.style.visibility = "hidden";
        }

    }

    function getUTF8Length(string) {
    var utf8length = 0;
    for (var n = 0; n < string.length; n++) {
        var c = string.charCodeAt(n);
        if (c < 128) {
            utf8length++;
        }
        else if((c > 127) && (c < 2048)) {
            utf8length = utf8length+2;
        }
        else {
            utf8length = utf8length+3;
        }
     }
     return utf8length;
     }

    function showToolTip(event){
        event.cancel();
        var source = event.getSource();
        var popupId = ('mitg1:noteWindow');
        var popup = AdfPage.PAGE.findComponentByAbsoluteId(popupId);
        if (!popup.isPopupVisible()) {
            var hints = {
            };
            hints[AdfRichPopup.HINT_LAUNCH_ID] = source.getClientId();
            hints[AdfRichPopup.HINT_ALIGN] = AdfRichPopup.ALIGN_BEFORE_END;
            popup.show(hints);
        }
    }
    function hideToolTip(event){
        var dialog = event.getSource();
        var popup = dialog.findComponent('noteWindow');
        popup.hide();
        event.cancel();
    }
/* promptedInput*/
function ptTypedInField(event) {
    var firingInputText = event.getSource();
    var sourceId = event.getSource().getClientId();
    var inputId = firingInputText.getProperty('inputId');
    var ximageId = firingInputText.getProperty('ximageId');
    var realXimageId = sourceId.replace(inputId, ximageId);
    var ximage = firingInputText.findComponent(realXimageId);
    var input = $('input[id*=' + sourceId + ']');
    if (input.val && input.val != '') {
        ximage.setSource('/images/xactive.png');
    }

}

function ptFocusFunc(event) {
    var firingInputText = event.getSource();
    var sourceId = event.getSource().getClientId();
    var inputId = firingInputText.getProperty('inputId');
    var promptId = firingInputText.getProperty('promptId');
    var realPromptId = sourceId.replace(inputId, promptId);
    var prompt = document.getElementById(realPromptId);
    /*var firingInputTextl = AdfPage.PAGE.findComponent(sourceId);*/

    var realInputId = realPromptId.replace(promptId, inputId);
    var firingInputText1 = $('input[id*=' + realInputId + ']');
    var val = firingInputText1.val();
    if (firingInputText1.val() == '') {
        prompt.className = 'PromptedTextLabelFocused';
    }

}

function ptLabelFocusFunc(event) {
    var prompObj = event.getSource();
    var inputId = prompObj.getProperty('inputId');
    var sourceId = event.getSource().getClientId();
    var realPromptId = sourceId.replace('opt', 'pnl');
    realPromptId = realPromptId.replace('opl', 'pnl');
    var realInputId = sourceId.replace('opt', inputId);
    realInputId = realInputId + '::content';
    var input = $('span[id*=' + realInputId + ']');
    input.focus();
    var prompt = $('span[id*=' + realPromptId + ']');
    prompt.removeClass('PromptedTextLabelUnfocused').addClass('PromptedTextLabelFocused');

}

function ptBlurFunc(event) {
    var firingInputText = event.getSource();
    var sourceId = event.getSource().getClientId();
    var inputId = firingInputText.getProperty('inputId');
    var promptId = firingInputText.getProperty('promptId');
    var realPromptId = sourceId.replace(inputId, promptId);
    var prompt = $('span[id*=' + realPromptId + ']');
    /*var prompt = document.getElementById(realPromptId);*/
    /*var firingInputTextl = AdfPage.PAGE.findComponent(sourceId);*/

    var realInputId = realPromptId.replace(promptId, inputId);
    var firingInputText1 = $('input[id*=' + realInputId + ']');

    if (firingInputText1.val() == '') {
        prompt.removeClass('PromptedTextLabelFocused').addClass('PromptedTextLabelUnfocused');
    }
    var ximageId = firingInputText.getProperty('ximageId');
    var realXimageId = sourceId.replace(inputId, ximageId);
    var ximage = firingInputText.findComponent(realXimageId);
    if (firingInputText1.val() == '') {
        ximage.setSource('/images/xempty.png');
    }
}

function ptClearField(event) {
    var xicon = event.getSource();
    var sourceId = event.getSource().getClientId()
    var inputId = xicon.getProperty('inputId');
    var realInputId = sourceId.replace(xicon.getId(), inputId);
    var adfInput = AdfPage.PAGE.findComponent(realInputId);
    realInputId = realInputId + '::content';
    var input = $('input[id*=' + realInputId + ']');

    adfInput.setValue('');
    input.val('');
    adfInput.setValid(true);
    xicon.setSource('/images/xclick.png');

}

function ptSetFocus(event) {
    var xicon = event.getSource();
    var sourceId = event.getSource().getClientId()
    var inputId = xicon.getProperty('inputId');
    var realInputId = sourceId.replace(xicon.getId(), inputId);
    realInputId = realInputId + '::content';
    var input = $('input[id*=' + realInputId + ']');
    input.focus();
    xicon.setSource('/images/xempty.png');
}

/* Generic */
function hoverXImage(event) {
    var xicon = event.getSource();
    if (xicon.getSource() != '/images/xempty.png') {
        xicon.setSource('/images/xhover.png');
    }
}

function unHoverXImage(event) {
    var xicon = event.getSource();
    if (xicon.getSource() != '/images/xempty.png') {
        xicon.setSource('/images/xactive.png');
    }
}

function clickXImage(event) {
    var xicon = event.getSource();
    xicon.setSource('/images/xclick.png');
}

/*multiSelect*/
function multiTypedInField(event) {
    var firingInputText = event.getSource()
    var sourceId = event.getSource().getClientId()
    var ximageId = sourceId.replace("msl_input", "ximage1");
    ximageId = ximageId.replace("::content", "");
    var ximage = AdfPage.PAGE.findComponent(ximageId);
    if (firingInputText.getValid() && (!firingInputText.getValue() || firingInputText.getValue() == '')) {
        ximage.setSource('/images/xactive.png');
    }
}

function multiClearField(event) {
    var xicon = event.getSource();
    var sourceId = event.getSource().getClientId()
    var inputId = sourceId.replace("ximage1", "msl_input");
    inputId = inputId + '::content';
    var input = $('input[id*=' + inputId + ']')
    input.val('');
    xicon.setSource('/images/xclick.png');
}

function multiSetFocus(event) {
    var xicon = event.getSource();
    var sourceId = event.getSource().getClientId()
    var inputId = sourceId.replace("ximage1", "msl_input");
    inputId = inputId + '::content';
    var input = $('input[id*=' + inputId + ']')
    input.focus();
    xicon.setSource('/images/xempty.png');
}
multiFocusFunc = function (event) {
    var firingInputText = event.getSource()
    var sourceId = event.getSource().getClientId()
    var labelId = sourceId.replace("msl_input", "labelContainer");
    var label = $('span[id*=' + labelId + ']');
    if (!firingInputText.getValue() || firingInputText.getValue() == '') {
        label.removeClass('MultiPromptedTextLabelUnfocused').addClass('MultiPromptedTextLabelFocused');
    }
}
multiBlurFunc = function (event) {
    var firingInputText = event.getSource()
    var sourceId = event.getSource().getClientId()
    var labelId = sourceId.replace("msl_input", "labelContainer");
    var label = $('span[id*=' + labelId + ']')

    if (!label) {
        labelId = sourceId.replace("ssl_inputComboboxListOfValues", "labelContainer");
        label = $('span[id*=' + labelId + ']')
    }
    if (firingInputText.getValid() && (!firingInputText.getValue() || firingInputText.getValue() == '')) {
        label.removeClass('MultiPromptedTextLabelFocused').addClass('MultiPromptedTextLabelUnfocused');
    }
}

function detectEnterKey(event) {
    var inputText = event.getSource();
    var value = inputText.getSubmittedValue();
    if (event.getKeyCode() == AdfKeyStroke.ENTER_KEY) {
        /*notify server*/
        AdfCustomEvent.queue(inputText, "notifyServer",
        {
            element : value
        },
true);
    }
    typedInField(event);
}

function multiPopupOpened(event) {
    var inputText = event.getSource();/*notify server*/
    AdfCustomEvent.queue(inputText, "notifyServer", null, true);
}
/*singleSelect*/
singleFocusFunc = function (event) {
    var firingInputText = event.getSource()
    var sourceId = event.getSource().getClientId()
    var labelId = sourceId.replace("ssl_inputComboboxListOfValues", "labelContainer1");
    labelId = labelId.replace("ssl_clShowPopup", "labelContainer2");
    labelId = labelId.replace("ssl_input", "labelContainer2");
    var label = $('span[id*=' + labelId + ']')
    if (!firingInputText.getValue() || firingInputText.getValue() == '') {
        label.removeClass('Single1PromptedTextLabelUnfocused');
        label.removeClass('Single2PromptedTextLabelUnfocused');
        if (labelId.search("labelContainer1") > 0) {
            label.addClass('Single1PromptedTextLabelFocused');
        }
        else {
            label.addClass('Single2PromptedTextLabelFocused');
        }
    }
}
singleBlurFunc = function (event) {
    var firingInputText = event.getSource()
    var sourceId = event.getSource().getClientId()
    var labelId = sourceId.replace("ssl_inputComboboxListOfValues", "labelContainer1");
    labelId = labelId.replace("ssl_clShowPopup", "labelContainer2");
    labelId = labelId.replace("ssl_input", "labelContainer2");

    var label = $('span[id*=' + labelId + ']')

    if (!label) {
        labelId = sourceId.replace("ssl_inputComboboxListOfValues", "labelContainer2");
        label = $('span[id*=' + labelId + ']')
    }
    if (firingInputText.getValid() && (!firingInputText.getValue() || firingInputText.getValue() == '')) {
        label.removeClass('Single1PromptedTextLabelFocused');
        label.removeClass('Single2PromptedTextLabelFocused');
        if (labelId.search("labelContainer1") > 0) {
            label.addClass('Single1PromptedTextLabelUnfocused');
        }
        else {
            label.addClass('Single2PromptedTextLabelUnfocused');
        }
    }
}

function singleTypedInField(event) {
    var firingInputText = event.getSource()
    var sourceId = event.getSource().getClientId()
    var labelId = sourceId.replace("ssl_inputComboboxListOfValues", "labelContainer1");
    labelId = labelId.replace("ssl_clShowPopup", "labelContainer2");
    labelId = labelId.replace("ssl_input", "labelContainer2");
    var label = $('span[id*=' + labelId + ']')
    if (!label) {
        labelId = sourceId.replace("ssl_inputComboboxListOfValues", "labelContainer2");
        label = $('span[id*=' + labelId + ']')
    }
    if (firingInputText.getValue() && firingInputText.getValue() != '') {
        label.removeClass('Single1PromptedTextLabelUnfocused');
        label.removeClass('Single2PromptedTextLabelUnfocused');
        if (labelId.search("labelContainer1") > 0) {
            label.addClass('Single1PromptedTextLabelFocused');
        }
        else {
            label.addClass('Single2PromptedTextLabelFocused');
        }
    }
    var ximageId = sourceId.replace("ssl_inputComboboxListOfValues", "ximage1");
    ximageId = ximageId.replace("ssl_clShowPopup", "ximage2");
    ximageId = ximageId.replace("ssl_input", "ximage2");
    ximageId = ximageId.replace("::content", "");
    var ximage = AdfPage.PAGE.findComponent(ximageId);
    if (firingInputText.getValid() && (!firingInputText.getValue() || firingInputText.getValue() == '')) {
        ximage.setSource('/images/xactive.png');
    }
}

function singleClearField(event) {
    var xicon = event.getSource();
    var sourceId = event.getSource().getClientId()
    var inputId = sourceId.replace("ximage1", "ssl_inputComboboxListOfValues");
    inputId = inputId.replace("ximage2", "ssl_input");
    inputId = inputId + '::content';
    var input = $('input[id*=' + inputId + ']')
    input.val('');
    xicon.setSource('/images/xclick.png');
}

function singleSetFocus(event) {
    var xicon = event.getSource();
    var sourceId = event.getSource().getClientId()
    var inputId = sourceId.replace("ximage1", "ssl_inputComboboxListOfValues");
    inputId = inputId.replace("ximage2", "ssl_input");
    inputId = inputId + '::content';
    var input = $('input[id*=' + inputId + ']')
    input.focus();
    xicon.setSource('/images/xempty.png');
}


text:
let a: number

//// [downlevelLetConst9.js]
var a;


text:
package com.fincatto.nfe310.classes.lote.consulta;

import java.math.BigDecimal;

import org.junit.Assert;
import org.junit.Test;

import com.fincatto.nfe310.classes.NFAmbiente;
import com.fincatto.nfe310.classes.lote.consulta.NFLoteConsulta;

public class NFLoteConsultaTest {

    @Test
    public void deveGerarXMLDeAcordoComOPadraoEstabelecido() {
        final NFLoteConsulta consulta = new NFLoteConsulta();
        consulta.setAmbiente(NFAmbiente.HOMOLOGACAO);
        consulta.setRecibo("ItbDxsHiXUqeCEM");
        consulta.setVersao(new BigDecimal("2.00"));

        final String xmlEsperado = "<consReciNFe versao=\"2.00\" xmlns=\"http://www.portalfiscal.inf.br/nfe\"><tpAmb>2</tpAmb><nRec>ItbDxsHiXUqeCEM</nRec></consReciNFe>";
        Assert.assertEquals(xmlEsperado, consulta.toString());
    }
}


text:
#include <inviwo/core/ports/portinspectorfactory.h>
#include <inviwo/core/common/inviwoapplication.h>

namespace inviwo {

PortInspector* PortInspectorFactory::createAndCache(const std::string& className) const {
    // Look in cache for an inactive port inspector.
    auto cit = cache_.find(className);
    if (cit != cache_.end()) {
        for (auto& elem : cit->second) {
            if (!elem->isActive()) return elem.get();
        }
    }

    // Create a new port inspector
    auto it = map_.find(className);
    if (it != map_.end()) {
        auto p = it->second->create();
        auto res = p.get();
        cache_[className].push_back(std::move(p));
        return res;
    }
    return nullptr;
}

void PortInspectorFactory::clearCache() {
    cache_.clear();
}

}  // namespace


text:
/*
links can be styled differently depending
on what state they are in.
*/

a{
    font-size: 24px;
}

/* LINK STATES */

/* unvisited link */
a:link {
    color: blanchedalmond;
}

/* visited link */
a:visited {
    color: indianred;
}

/* mouse over link */
a:hover {
    color: hotpink;
}

/* selected link */
a:active {
    color: cornflowerblue;
}


text:
package data.raw.decks.preco.c14;

import data.raw.decks.AbstractDeckTest;

public class PeerThroughTimeTest extends AbstractDeckTest
{

	@Override
	public String getDeckName()
	{
		return "Peer Through Time";
	}

	@Override
	public String getDeckExtensionCode()
	{
		return "C14";
	}

	@Override
	public void testDeckContents()
	{
		assertCommander("Teferi, Temporal Archmage");
		assertDeckContains(1, "Azure Mage");
		assertDeckContains(1, "Fathom Seer");
		assertDeckContains(1, "Fog Bank");
		assertDeckContains(1, "Willbender");
		assertDeckContains(1, "Dulcet Sirens");
		assertDeckContains(1, "Riptide Survivor");
		assertDeckContains(1, "Sea Gate Oracle");
		assertDeckContains(1, "Shaper Parasite");
		assertDeckContains(1, "Reef Worm");
		assertDeckContains(1, "Mulldrifter");
		assertDeckContains(1, "Ixidron");
		assertDeckContains(1, "Stitcher Geralf");
		assertDeckContains(1, "Stormsurge Kraken");
		assertDeckContains(1, "Steel Hellkite");
		assertDeckContains(1, "Brine Elemental");
		assertDeckContains(1, "Frost Titan");
		assertDeckContains(1, "Sphinx of Jwar Isle");
		assertDeckContains(1, "Sphinx of Magosi");
		assertDeckContains(1, "Phyrexian Ingester");
		assertDeckContains(1, "Sphinx of Uthuun");
		assertDeckContains(1, "Hoverguard Sweepers");
		assertDeckContains(1, "Lorthos, the Tidemaker");
		assertDeckContains(1, "Artisan of Kozilek");
		assertDeckContains(1, "Breaching Leviathan");
		assertDeckContains(1, "Deep-Sea Kraken");
		assertDeckContains(1, "Everflowing Chalice");
		assertDeckContains(1, "Tormod's Crypt");
		assertDeckContains(1, "Sol Ring");
		assertDeckContains(1, "Mind Stone");
		assertDeckContains(1, "Sapphire Medallion");
		assertDeckContains(1, "Sky Diamond");
		assertDeckContains(1, "Swiftfoot Boots");
		assertDeckContains(1, "Commander's Sphere");
		assertDeckContains(1, "Crown of Doom");
		assertDeckContains(1, "Unstable Obelisk");
		assertDeckContains(1, "Worn Powerstone");
		assertDeckContains(1, "Assault Suit");
		assertDeckContains(1, "Nevinyrral's Disk");
		assertDeckContains(1, "Thran Dynamo");
		assertDeckContains(1, "Ur-Golem's Eye");
		assertDeckContains(1, "Dreamstone Hedron");
		assertDeckContains(1, "Fool's Demise");
		assertDeckContains(1, "Infinite Reflection");
		assertDeckContains(1, "Well of Ideas");
		assertDeckContains(1, "Pongify");
		assertDeckContains(1, "Cyclonic Rift");
		assertDeckContains(1, "Into the Roil");
		assertDeckContains(1, "Turn to Frog");
		assertDeckContains(1, "Exclude");
		assertDeckContains(1, "Cackling Counterpart");
		assertDeckContains(1, "Domineering Will");
		assertDeckContains(1, "Dismiss");
		assertDeckContains(1, "Intellectual Offering");
		assertDeckContains(1, "Stroke of Genius");
		assertDeckContains(1, "Call to Mind");
		assertDeckContains(1, "Compulsive Research");
		assertDeckContains(1, "Concentrate");
		assertDeckContains(1, "Rite of Replication");
		assertDeckContains(1, "Rush of Knowledge");
		assertDeckContains(1, "Æther Gale");
		assertDeckContains(1, "Distorting Wake");
		assertDeckContains(1, "Coral Atoll");
		assertDeckContains(1, "Ghost Quarter");
		assertDeckContains(1, "Lonely Sandbar");
		assertDeckContains(1, "Myriad Landscape");
		assertDeckContains(1, "Remote Isle");
		assertDeckContains(1, "Tectonic Edge");
		assertDeckContains(1, "Zoetic Cavern");
		assertDeckContains(31, "Island");
	}

}


text:
Available here : [m.cloud.coveo.com](https://m.cloud.coveo.com)

# JsAdminMobile
### Coveo's mobile enabled cloud friendly administration console

**JsAdminMobile** allows mobile users to view most of the content available on Coveo's JsAdmin console.

#### Screenshots
![Screenshots](https://raw.githubusercontent.com/Coveo/JsAdminMobile/master/screenshot.png)
##### [More screenshots here](https://drive.google.com/folderview?id=0B2rBrydxhUyhflBXYUNIdEltMzVYV1FiTlhjVE4tV3RZeGU2dzRDcThCYnBJU25SQ21LSE0&usp=sharing)
#
#
#### Description
JsAdminMobile allows users to access most of the important information related to the available organizations in Coveo Search Platform. It is possible to list the data sources to crawl in the search engine and their recent activities. It is also possible to perform refresh and rebuild actions on the available sources. The app also allows users to perform basic search queries and then displays the results. The app allows to manage the users and the groups that have access to the console. Finally, the app allows users to list the available servers and nodes related to the existing organizations. It is possible to shut down or start a server. This app is only accessible internally at Coveo. At the moment, it only works with the development environment.

#### Development
This app was developped by [Simon Lacoursiere](https://github.com/lacoursieresimon) in a Hackathon at Coveo during his summer internship. The idea came up since there was no way at the time to access the Coveo search engine admin console with a mobile device. In 24 hour, a prototype was developped with basic functionalities. After the hackathon development, the app was developped full time to have a clean code base, a valid authentication system and some other interesting features that were missing from the original prototype.

#### Tools
JsAdminMobile has been developped using
* [Ionic Framework](http://ionicframework.com/)
* [Underscore.js](http://underscorejs.org/)

#### Steps to run the app locally
This app is a static website, so cloning it and accessing to the _index.html_ file in _./www_ should give you a functionnal app. However, if you want to access all the functionnalities the Ionic CLI gives you (you should!!), here are the steps to follow:
* Install [node.js](https://nodejs.org/)
* ``` $ npm install -g cordova ionic // installs the ionic node package```
* ```cd ``` at the root of the project
* ``` $ ionic serve -l // runs a localserver with a watch on file changes```

#### Contributors
* [Simon Lacoursière](https://github.com/lacoursieresimon)

#### Nice to have features
The following features are things that would be nice to have someday
* Versionning during the Jenkins task so that the Amazon S3 cache invalidates itself
* Minify the code to help with loading times
* Allow the "Accept invite to organization" feature
* Allow the creation of new organizations
* Integrate TypeScript


text: sudo apt-get install --only-upgrade libdbd-pg-perl=2.17.1-2+squeeze1 -y


text:
Python Auto Mock
================
``auto_mock`` is a module for mocking during unit testing.
It automatically replaces all variables and functions external to the unit with default values to help developers exclude external state in their unit tests.

Installation
------------
``pip install python-auto-mock``

Usage
-----

In the example we will be making use of myclass.py

``myclass.py``

.. code:: python

    X = 1
    Y = 2
    Z = 3

    class MyClass():
        def addition_with_globals(self):
            print(X)
            print(Y)
            print(X + Y)
            return X + Y

To test this class we will write a test script.

.. code:: python

    import auto_mock

    def test_my_class_addition():
        stubs = {
            'X' : 36,
            'Y' : 35,
        }

        with auto_mock.full_mock('myclass', 'MyClass.addition_with_globals', stubs) as addition_with_globals:
            if addition_with_globals() != 71:
                print("Addition is broken")

    def main():
        test_my_class_addition()

    main()

Done correctly this should print out

::

    36
    35
    71

``full_mock`` takes 3 non optional arguments.

1. The module name where the code is located.
2. The specific function or method that is being tested.
3. The dictionary of stubs/mocks that you would like to override the values with.

The stubs variable contains the names of the variables that are being mocked.
In this example we have ``X``, ``Y``, and ``Z`` as global variables.
We only use ``X`` and ``Y`` in this example, so they are the only variables that are in the stubs dictionary.

``full_mock`` returns the function or method that you are trying to test with the external variables mocked.
If the variable is not within the stubs then it is mocked with a default object.
Inside the with block you can test that the function does what it is supposed to do.