text:
namespace Microsoft.Azure.Batch.Protocol.Models
{
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Specifies characteristics for a temporary 'auto pool'. The Batch
    /// service will create this auto pool when the job is submitted.
    /// </summary>
    public partial class AutoPoolSpecification
    {
        /// <summary>
        /// Initializes a new instance of the AutoPoolSpecification class.
        /// </summary>
        public AutoPoolSpecification()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the AutoPoolSpecification class.
        /// </summary>
        /// <param name="poolLifetimeOption">The minimum lifetime of created
        /// auto pools, and how multiple jobs on a schedule are assigned to
        /// pools.</param>
        /// <param name="autoPoolIdPrefix">A prefix to be added to the unique
        /// identifier when a pool is automatically created.</param>
        /// <param name="keepAlive">Whether to keep an auto pool alive after
        /// its lifetime expires.</param>
        /// <param name="pool">The pool specification for the auto
        /// pool.</param>
        public AutoPoolSpecification(PoolLifetimeOption poolLifetimeOption, string autoPoolIdPrefix = default(string), bool? keepAlive = default(bool?), PoolSpecification pool = default(PoolSpecification))
        {
            AutoPoolIdPrefix = autoPoolIdPrefix;
            PoolLifetimeOption = poolLifetimeOption;
            KeepAlive = keepAlive;
            Pool = pool;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets a prefix to be added to the unique identifier when a
        /// pool is automatically created.
        /// </summary>
        /// <remarks>
        /// The Batch service assigns each auto pool a unique identifier on
        /// creation. To distinguish between pools created for different
        /// purposes, you can specify this element to add a prefix to the ID
        /// that is assigned. The prefix can be up to 20 characters long.
        /// </remarks>
        [JsonProperty(PropertyName = "autoPoolIdPrefix")]
        public string AutoPoolIdPrefix { get; set; }

        /// <summary>
        /// Gets or sets the minimum lifetime of created auto pools, and how
        /// multiple jobs on a schedule are assigned to pools.
        /// </summary>
        /// <remarks>
        /// Possible values include: 'jobSchedule', 'job'
        /// </remarks>
        [JsonProperty(PropertyName = "poolLifetimeOption")]
        public PoolLifetimeOption PoolLifetimeOption { get; set; }

        /// <summary>
        /// Gets or sets whether to keep an auto pool alive after its lifetime
        /// expires.
        /// </summary>
        /// <remarks>
        /// If false, the Batch service deletes the pool once its lifetime (as
        /// determined by the poolLifetimeOption setting) expires; that is,
        /// when the job or job schedule completes. If true, the Batch service
        /// does not delete the pool automatically. It is up to the user to
        /// delete auto pools created with this option.
        /// </remarks>
        [JsonProperty(PropertyName = "keepAlive")]
        public bool? KeepAlive { get; set; }

        /// <summary>
        /// Gets or sets the pool specification for the auto pool.
        /// </summary>
        [JsonProperty(PropertyName = "pool")]
        public PoolSpecification Pool { get; set; }

    }
}


text:
/**
 *
 */
package de.arp.utils.cli;

/**
 * @author arp
 *
 */
public class ProcessResult {

	private int exitCode;
	private byte[] stdout;
	private byte[] stderr;

	/**
	 * @return the exitCode
	 */
	public int getExitCode() {
		return exitCode;
	}
	/**
	 * @param exitCode the exitCode to set
	 */
	public void setExitCode(int exitCode) {
		this.exitCode = exitCode;
	}
	/**
	 * @return the stdout
	 */
	public byte[] getStdout() {
		return stdout;
	}
	/**
	 * @param stdout the stdout to set
	 */
	public void setStdout(byte[] stdout) {
		this.stdout = stdout;
	}
	/**
	 * @return the stderr
	 */
	public byte[] getStderr() {
		return stderr;
	}
	/**
	 * @param stderr the stderr to set
	 */
	public void setStderr(byte[] stderr) {
		this.stderr = stderr;
	}
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return String.format("ProcessResult [exitCode=%s]", exitCode);
	}

}

redpajama_set_name: RedPajamaGithub


text:
import os
import argparse
from time import time, localtime, strftime, sleep

from benchcloud.drivers.dropbox_driver import DropboxDriver

def log(msg):
    millis = int(round(time() * 1000))
    timestamp = "[{}] {} |".format(millis, strftime("%d %b %Y %H:%M:%S", localtime()))
    whole_message = "{} {}".format(timestamp, msg)
    print whole_message

if __name__ == '__main__':
    arg_parser = argparse.ArgumentParser(
        description='Test if a file exists in Dropbox')
    arg_parser.add_argument('-rf', action='store', dest='remote_filename', default='/target_file',
                            help='Local file', required=False)
    results = arg_parser.parse_args()
    remote_filename = results.remote_filename
    local_filename = './downloaded_target_file'

    # delete old target file
    if os.path.isfile(local_filename):
        os.remove(local_filename)

    # Test if file exists
    dropbox = DropboxDriver()
    dropbox.connect()
    while True:
        log('Start to download file')
        dropbox.download(remote_filename=remote_filename, local_filename=local_filename)
        log('Operation finished!')
        if os.path.isfile(local_filename):
            break
        sleep(0.5)
    log('File downloaded successfully!')


text:
import {HashTable} from '../../utils/hashmap'
import Vector from '../../math/vector'
import Counters from '../counters'
import {findOutline, segmentsToPaths, reconstructSketchBounds} from '../craft/mesh/workbench'
import {Matrix3, AXIS} from '../../math/l3space'
import {arrFlatten1L, isCurveClass} from '../cad-utils'
import DPR from '../../utils/dpr'
import {SceneSolid, SceneFace} from './scene-object'

export class MeshSceneSolid extends SceneSolid {

  constructor(csg, type, id) {
    super(type, id);
    csg = csg.reTesselated().canonicalized();
    this.csg = csg;
    this.createGeometry();
  }

  createGeometry() {
    const geometry = new THREE.Geometry();
    geometry.dynamic = true;
    this.mesh = new THREE.Mesh(geometry, this.material);
    this.cadGroup.add(this.mesh);

    this.wires = HashTable.forEdge();
    this.curvedSurfaces = {};

    this.setupGeometry();
  }

  dropGeometry() {
    this.cadGroup.remove( this.mesh );
    this.mesh.geometry.dispose();
    for(let i = this.wireframeGroup.children.length-1; i >=0 ; i--){
      this.wireframeGroup.remove(this.wireframeGroup.children[i]);
    }
  }

  setupGeometry() {
    function threeV(v) {return new THREE.Vector3( v.x, v.y, v.z )}

    var off = 0;
    var groups = groupCSG(this.csg);
    var geom = this.mesh.geometry;
    for (var gIdx in groups)  {
      var group = groups[gIdx];
      if (group.shared.__tcad === undefined) group.shared.__tcad = {};
      var sceneFace = new MeshSceneFace(this, group);
      this.sceneFaces.push(sceneFace);
      for (var p = 0; p < group.polygons.length; ++p) {
        var poly = group.polygons[p];
        var vLength = poly.vertices.length;
        if (vLength < 3) continue;
        var firstVertex = poly.vertices[0];
        geom.vertices.push(threeV(firstVertex.pos));
        geom.vertices.push(threeV(poly.vertices[1].pos));
        var normal = threeV(poly.plane.normal);
        for (var i = 2; i < vLength; i++) {
          geom.vertices.push(threeV(poly.vertices[i].pos));

          var a = off;
          var b = i - 1 + off;
          var c = i + off;
          const face = sceneFace.createMeshFace(a, b, c);
          face.normal = normal;
          face.materialIndex = gIdx;
          geom.faces.push(face);
          //face.color.set(new THREE.Color().setRGB( Math.random(), Math.random(), Math.random()));
        }
        //view.setFaceColor(sceneFace, utils.isSmoothPiece(group.shared) ? 0xFF0000 : null);
        off = geom.vertices.length;
      }
      this.collectCurvedSurface(sceneFace);
      this.collectWires(sceneFace, group.polygons);
    }

    geom.mergeVertices();

    this.processWires();
  };

  collectCurvedSurface(face) {
    var derivedFrom = getDerivedFrom(face.csgGroup.shared);
    if (derivedFrom === null || !isCurveClass(derivedFrom._class)) return;
    var surfaces = this.curvedSurfaces[derivedFrom.id];
    if (surfaces === undefined) {
      surfaces = [];
      this.curvedSurfaces[derivedFrom.id] = surfaces;
    }
    surfaces.push(face);
    face.curvedSurfaces = surfaces;
  }

  collectWires(face, facePolygons) {

    function contains(planes, plane) {
      for (var j = 0; j < planes.length; j++) {
        if (planes[j].equals(plane)) {
          return true;
        }
      }
      return false;
    }

    const outline = findOutline(facePolygons);
    const paths = segmentsToPaths(outline);

    for (var i = 0; i < paths.length; i++) {
      var path = paths[i];
      var p, q, n = path.vertices.length;
      for (q = 0, p = n - 1; q < n; p = q++) {
        var edge = [path.vertices[p], path.vertices[q]];
        var data = this.wires.get(edge);

        if (data === null) {
          data = {
            sharedPlanes : [face.csgGroup.plane],
            sharedFaces : [face]
          };
          this.wires.put(edge, data);
        } else {
          if (!contains(data.sharedPlanes, face.csgGroup.plane)) {
            data.sharedPlanes.push(face.csgGroup.plane);
          }
          data.sharedFaces.push(face);
        }
      }
    }
  }

  processWires() {
    var solid = this;
    this.wires.entries(function(edge, data) {
      if (data.sharedPlanes.length > 1) {
        var plane0 = data.sharedPlanes[0];
        var plane1 = data.sharedPlanes[1];
        var angle = Math.acos(plane0.normal.dot(plane1.normal));
        if (angle < SMOOTH_LIMIT) {
          return;
        }
      }
      for (var i = 0; i < data.sharedFaces.length; ++i) {
        for (var j = i + 1; j < data.sharedFaces.length; ++j) {
          var face0 = data.sharedFaces[0];
          var face1 = data.sharedFaces[1];
          if (sameID(getDerivedID(face0.csgGroup.shared), getDerivedID(face1.csgGroup.shared))) {
            return;
          }
        }
      }

      solid.addLineToScene(edge[0], edge[1]);
    });
  }
}

function groupCSG(csg) {
  var csgPolygons = csg.toPolygons();
  var groups = {};
  for (var i = 0; i < csgPolygons.length; i++) {
    var p = csgPolygons[i];
    var tag = p.shared.getTag();
    if (groups[tag] === undefined) {
      groups[tag] = {
        tag : tag,
        polygons : [],
        shared : p.shared,
        plane : p.plane
      };
    }
    groups[tag].polygons.push(p);
  }
  return groups;
}

const SMOOTH_LIMIT = 10 * Math.PI / 180;

class MeshSceneFace extends SceneFace {
  constructor(solid, csgGroup) {
    super(solid, csgGroup.shared.__tcad.faceId);
    csgGroup.__face = this;
    csgGroup.shared.__tcad.faceId = this.id;

    this.csgGroup = csgGroup;
    this.curvedSurfaces = null;
  }

  normal() {
    return this.csgGroup.plane.normal;
  }

  depth() {
    return this.csgGroup.plane.w;
  }

  surface() {
    return this.csgGroup.plane;
  }

  getBounds() {
    return reconstructSketchBounds(this.solid.csg, this);
  }
}

function sameID(id1, id2) {
  if (id1 === null || id2 === null) {
    return false;
  }
  return id1 === id2;
}

function getDerivedID(shared) {
  return shared.__tcad && !!shared.__tcad.csgInfo && !!shared.__tcad.csgInfo.derivedFrom ? shared.__tcad.csgInfo.derivedFrom.id : null;
}

function getDerivedFrom(shared) {
  return shared.__tcad && !!shared.__tcad.csgInfo && !!shared.__tcad.csgInfo.derivedFrom ? shared.__tcad.csgInfo.derivedFrom : null;
}


text:
namespace ppapi_proxy {

namespace {

PP_Bool HandleInputEvent(PP_Instance instance, PP_Resource input_event) {
  DebugPrintf("PPP_InputEvent::HandleInputEvent: instance=%"NACL_PRId32", "
              "input_event = %"NACL_PRId32"\n",
              instance, input_event);

  PP_Var character_text = PP_MakeUndefined();
  InputEventData data;
  data.event_type = PPBInputEventInterface()->GetType(input_event);
  data.event_time_stamp = PPBInputEventInterface()->GetTimeStamp(input_event);
  data.event_modifiers = PPBInputEventInterface()->GetModifiers(input_event);

  switch (data.event_type) {
    // These events all use the PPB_MouseInputEvent interface.
    case PP_INPUTEVENT_TYPE_MOUSEDOWN:
    case PP_INPUTEVENT_TYPE_MOUSEUP:
    case PP_INPUTEVENT_TYPE_MOUSEENTER:
    case PP_INPUTEVENT_TYPE_MOUSELEAVE:
    case PP_INPUTEVENT_TYPE_MOUSEMOVE:
    case PP_INPUTEVENT_TYPE_CONTEXTMENU:
      data.mouse_button =
          PPBMouseInputEventInterface()->GetButton(input_event);
      data.mouse_position =
          PPBMouseInputEventInterface()->GetPosition(input_event);
      data.mouse_click_count =
          PPBMouseInputEventInterface()->GetClickCount(input_event);
      data.mouse_movement =
          PPBMouseInputEventInterface()->GetMovement(input_event);
      break;
    // This event uses the PPB_WheelInputEvent interface.
    case PP_INPUTEVENT_TYPE_WHEEL:
      data.wheel_delta =
          PPBWheelInputEventInterface()->GetDelta(input_event);
      data.wheel_ticks =
          PPBWheelInputEventInterface()->GetTicks(input_event);
      data.wheel_scroll_by_page =
          PPBWheelInputEventInterface()->GetScrollByPage(input_event);
      break;
    // These events all use the PPB_KeyInputEvent interface.
    case PP_INPUTEVENT_TYPE_RAWKEYDOWN:
    case PP_INPUTEVENT_TYPE_KEYDOWN:
    case PP_INPUTEVENT_TYPE_KEYUP:
    case PP_INPUTEVENT_TYPE_CHAR:
      data.key_code =
          PPBKeyboardInputEventInterface()->GetKeyCode(input_event);
      character_text =
          PPBKeyboardInputEventInterface()->GetCharacterText(input_event);
      break;
    case PP_INPUTEVENT_TYPE_UNDEFINED:
      return PP_FALSE;
    // TODO(nfullagar): Implement support for event types below.
    case PP_INPUTEVENT_TYPE_IME_COMPOSITION_START:
    case PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE:
    case PP_INPUTEVENT_TYPE_IME_COMPOSITION_END:
    case PP_INPUTEVENT_TYPE_IME_TEXT:
      DebugPrintf("   No implementation for event type %d\n",
          data.event_type);
      return PP_FALSE;
    case PP_INPUTEVENT_TYPE_TOUCHSTART:
    case PP_INPUTEVENT_TYPE_TOUCHMOVE:
    case PP_INPUTEVENT_TYPE_TOUCHEND:
    case PP_INPUTEVENT_TYPE_TOUCHCANCEL:
      DebugPrintf("   No implementation for event type %d\n",
          data.event_type);
      return PP_FALSE;
    // No default case; if any new types are added we should get a compile
    // warning.
  }
  // Now data and character_text have all the data we want to send to the
  // untrusted side.

  // character_text should either be undefined or a string type.
  DCHECK((character_text.type == PP_VARTYPE_UNDEFINED) ||
         (character_text.type == PP_VARTYPE_STRING));
  // Serialize the character_text Var.
  uint32_t text_size = 0;
  nacl::scoped_array<char> text_bytes(Serialize(&character_text, 1,
                                                &text_size));
  int32_t handled;
  NaClSrpcError srpc_result =
      PppInputEventRpcClient::PPP_InputEvent_HandleInputEvent(
          GetMainSrpcChannel(instance),
          instance,
          input_event,
          sizeof(data),
          reinterpret_cast<char*>(&data),
          text_size,
          text_bytes.get(),
          &handled);
  DebugPrintf("PPP_Instance::HandleInputEvent: %s\n",
              NaClSrpcErrorString(srpc_result));
  if (srpc_result != NACL_SRPC_RESULT_OK) {
    return PP_FALSE;
  }
  // The 'handled' int should only ever have a value matching one of PP_FALSE
  // or PP_TRUE. Otherwise, there's an error in the proxy.
  DCHECK((handled == static_cast<int32_t>(PP_FALSE) ||
         (handled == static_cast<int32_t>(PP_TRUE))));
  PP_Bool handled_bool = PP_FromBool(handled);
  return handled_bool;
}

}  // namespace

const PPP_InputEvent* BrowserInputEvent::GetInterface() {
  static const PPP_InputEvent input_event_interface = {
    HandleInputEvent
  };
  return &input_event_interface;
}

}  // namespace ppapi_proxy


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
        version="3.0"
        >

  <display-name>Castle java boilerplate</display-name>
</web-app>


text:
package com.Upwork.api.Routers;

import java.util.HashMap;

import com.Upwork.ClassPreamble;
import com.Upwork.api.OAuthClient;

import org.json.JSONException;
import org.json.JSONObject;

@ClassPreamble (
	author = "Maksym Novozhylov <mnovozhilov@upwork.com>",
	date = "6/3/2014",
	currentRevision = 1,
	lastModified = "24/5/2018",
	lastModifiedBy = "Maksym Novozhylov",
	reviewers = {"Yiota Tsakiri"}
)
public final class Workdiary {

	final static String ENTRY_POINT = "api";

	private OAuthClient oClient = null;

	public Workdiary(OAuthClient client) {
		oClient = client;
		oClient.setEntryPoint(ENTRY_POINT);
	}

	/**
     * Get Workdiary
     *
     * @param   company Company ID
     * @param   date Date
     * @param   params (Optional) Parameters
     * @throws	JSONException If error occurred
	 * @return	{@link JSONObject}
     */
    public JSONObject get(String company, String date, HashMap<String, String> params) throws JSONException {
        return oClient.get("/team/v3/workdiaries/companies/" + company + "/" + date, params);
    }

    /**
     * Get Work Diary by Contract
     *
     * @param   contract Contract ID
     * @param   date Date
     * @param   params (Optional) Parameters
     * @throws	JSONException If error occurred
	 * @return	{@link JSONObject}
     */
    public JSONObject getByContract(String contract, String date, HashMap<String, String> params) throws JSONException {
        return oClient.get("/team/v3/workdiaries/contracts/" + contract + "/" + date, params);
    }

}


text:
/*

 File name: exerc_2_3.c (or cpp)

 Date: 2017-01-24

 Group Number:  #nr 4

 Members of students contributed:

 Rafael Antonino Sauleo

 Filip Isakovski

 Maria-Bianca Cindroi

 Demonstration code: [<Examen code> <10550>]

 */

#include <stdio.h>
#include <stdlib.h>
#include <memory.h>

int main(int argc, char *argv[]) {

	char *string1 = argv[1];
	char *string2 = argv[2];
	int res=0, i=0, trigger=0;

	printf("String 1: %s\n", string1);

	printf("String 2: %s\n", string2);

	int str1length = 0;
	int str2length = 0;

	//Getting the lengths of the strings
	str1length = strlen(string1);
	str2length = strlen(string2);

	//Checking it our way
	if(str1length > str2length)
	{
		printf("Our result: The strings are different!\n");
	}
	else if(str1length < str2length)
	{
		printf("Our result: The strings are different!\n");
	}
	else
	{
		while(string1[i] != '\0')
		{
			if((string1[i] != string2[i]) && trigger == 0){
				trigger = 1;
			}
			i++;
		}

		if(trigger == 1)
		{
			printf("Our result: The strings are different!\n");
		}
		else
		{
			printf("Our result: The strings are identical!\n");
		}
	}

	//Checking with strcmp()
	res = strcmp(string1, string2);

	//Using result from strcmp()
	if(res == 0)
	{
		printf("strcmp result: The strings are identical!\n");
	}
	else
	{
		printf("strcmp result: The strings are different!\n");
	}

	return 0;
}


text:
<?php

namespace SystemConnector\MappingService;

use Assert\Assertion;
use Psr\Log\LoggerInterface;
use SystemConnector\DefinitionProvider\DefinitionProviderInterface;
use SystemConnector\DefinitionProvider\Struct\Definition;
use SystemConnector\MappingService\Struct\Mapping;
use SystemConnector\ServiceBus\QueryFactory\QueryFactoryInterface;
use SystemConnector\ServiceBus\QueryType;
use SystemConnector\ServiceBus\ServiceBusInterface;
use SystemConnector\TransferObject\TransferObjectInterface;
use SystemConnector\ValidatorService\ValidatorServiceInterface;

class MappingService implements MappingServiceInterface
{
    /**
     * @var QueryFactoryInterface
     */
    private $queryFactory;

    /**
     * @var ServiceBusInterface
     */
    private $serviceBus;

    /**
     * @var ValidatorServiceInterface
     */
    private $validator;

    /**
     * @var DefinitionProviderInterface
     */
    private $definitionProvider;

    /**
     * @var LoggerInterface
     */
    private $logger;

    public function __construct(
        QueryFactoryInterface $queryFactory,
        ServiceBusInterface $serviceBus,
        ValidatorServiceInterface $validator,
        DefinitionProviderInterface $definitionProvider,
        LoggerInterface $logger
    ) {
        $this->queryFactory = $queryFactory;
        $this->serviceBus = $serviceBus;
        $this->validator = $validator;
        $this->definitionProvider = $definitionProvider;
        $this->logger = $logger;
    }

    /**
     * {@inheritdoc}
     */
    public function getMappingInformation($objectType = null): array
    {
        Assertion::nullOrString($objectType);

        $definitions = $this->definitionProvider->getMappingDefinitions($objectType);

        if (empty($definitions)) {
            $this->logger->notice('No mappingdefinition found');
        }

        $result = [];

        foreach ($definitions as $definition) {
            $mapping = new Mapping();
            $mapping->setOriginAdapterName($definition->getOriginAdapterName());
            $mapping->setOriginTransferObjects($this->query($definition, $definition->getOriginAdapterName()));
            $mapping->setDestinationAdapterName($definition->getDestinationAdapterName());
            $mapping->setDestinationTransferObjects($this->query($definition, $definition->getDestinationAdapterName()));
            $mapping->setObjectType($definition->getObjectType());

            $this->validator->validate($mapping);

            $result[] = $mapping;
        }

        return $result;
    }

    /**
     * @param Definition $definition
     * @param string     $adapterName
     *
     * @return TransferObjectInterface[]
     */
    private function query(Definition $definition, $adapterName): array
    {
        $originQuery = $this->queryFactory->create(
            $adapterName,
            $definition->getObjectType(),
            QueryType::ALL
        );

        $objects = $this->serviceBus->handle($originQuery);

        if (empty($objects)) {
            $objects = [];
        }

        $result = [];
        foreach ($objects as $object) {
            if ($object->getType() !== $definition->getObjectType()) {
                continue;
            }

            $result[] = $object;
        }

        return $result;
    }
}


text:
ngCordova Demo App
=====================

This is a demo app for ngCordova to show how to use each plugin. Still a WIP

## Using this app:

Start off by adding a cordova platform:

```
cordova platform add ios / android
```


text:
@interface ABI10_0_0EXSegment ()

@property (nonatomic, strong) SEGAnalytics *instance;

@end

@implementation ABI10_0_0EXSegment

+ (NSString *)moduleName { return @"ExponentSegment"; }

ABI10_0_0RCT_EXPORT_METHOD(initializeIOS:(NSString *)writeKey)
{
  SEGAnalyticsConfiguration *configuration = [SEGAnalyticsConfiguration configurationWithWriteKey:writeKey];
  _instance = [[SEGAnalytics alloc] initWithConfiguration:configuration];
}

ABI10_0_0RCT_EXPORT_METHOD(initializeAndroid:(NSString *)writeKey)
{
  // NO-OP. Need this here because Segment has different keys for iOS and Android.
}

ABI10_0_0RCT_EXPORT_METHOD(identify:(NSString *)userId)
{
  if (_instance) {
    [_instance identify:userId];
  }
}

ABI10_0_0RCT_EXPORT_METHOD(identifyWithTraits:(NSString *)userId withTraits:(NSDictionary *)traits)
{
  if (_instance) {
    [_instance identify:userId traits:traits];
  }
}

ABI10_0_0RCT_EXPORT_METHOD(track:(NSString *)event)
{
  if (_instance) {
    [_instance track:event];
  }
}

ABI10_0_0RCT_EXPORT_METHOD(trackWithProperties:(NSString *)event withProperties:(NSDictionary *)properties)
{
  if (_instance) {
    [_instance track:event properties:properties];
  }
}

ABI10_0_0RCT_EXPORT_METHOD(flush)
{
  if (_instance) {
    [_instance flush];
  }
}

@end


text:
namespace Backend.Fx.Patterns.EventAggregation.Domain
{
    public interface IDomainEventHandler<in TDomainEvent> where TDomainEvent : IDomainEvent
    {
        void Handle(TDomainEvent domainEvent);
    }
}


text:
(function() {
    'use strict';
    angular
        .module('alerts')
        .factory('alertService', alertService);

    alertService.$inject = ['$ionicPopup', '$ionicLoading', 'ERROR_MESSAGES'];

    function alertService($ionicPopup, $ionicLoading, ERROR_MESSAGES) {
        var self = this;

        self.showLoading = function() {
            $ionicLoading.show();
        };

        self.hideLoading = function() {
            $ionicLoading.hide();
        };

        self.showAlert = function(title, message){
            var alertPopup = $ionicPopup.alert({
                title: title,
                template: message
            });
        };

        self.showGenericError = function() {
            self.showAlert("Erro", ERROR_MESSAGES.GENERIC);
        };

        self.showConfirmation = function(title, message, callback) {
            var cancelButton = { text: "Cancelar"};
            var confirmButton = {
                text: 'Confirmar',
                type: 'button-positive',
                onTap: function(answer) {
                    if (answer) {
                        callback();
                    }
                }
            };

            var confirmPopup = $ionicPopup.confirm({
                title: title,
                template: message,
                buttons: [cancelButton, confirmButton]
            });
        };

        return self;
    }
})();


text:
'use strict';

/**
 * Module dependencies.
 */
var should = require('should'),
	mongoose = require('mongoose'),
	User = mongoose.model('User'),
	Comments = mongoose.model('Comments');

/**
 * Globals
 */
var user, comments;

/**
 * Unit tests
 */
describe('Comments Model Unit Tests:', function() {
	beforeEach(function(done) {
		user = new User({
			firstName: 'Full',
			lastName: 'Name',
			displayName: 'Full Name',
			email: 'test@test.com',
			username: 'username',
			password: 'password'
		});

		user.save(function() {
			comments = new Comments({
				// Add model fields
				// ...
			});

			done();
		});
	});

	describe('Method Save', function() {
		it('should be able to save without problems', function(done) {
			return comments.save(function(err) {
				should.not.exist(err);
				done();
			});
		});
	});

	afterEach(function(done) {
		Comments.remove().exec();
		User.remove().exec();

		done();
	});
});


text:
package feign.hystrix;

import com.netflix.hystrix.HystrixCommand;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.util.Map;
import feign.Client;
import feign.Contract;
import feign.Feign;
import feign.InvocationHandlerFactory;
import feign.Logger;
import feign.Request;
import feign.RequestInterceptor;
import feign.ResponseMapper;
import feign.Retryer;
import feign.Target;
import feign.codec.Decoder;
import feign.codec.Encoder;
import feign.codec.ErrorDecoder;

/**
 * Allows Feign interfaces to return HystrixCommand or rx.Observable or rx.Single objects. Also
 * decorates normal Feign methods with circuit breakers, but calls {@link HystrixCommand#execute()}
 * directly.
 */
public final class HystrixFeign {

  public static Builder builder() {
    return new Builder();
  }

  public static final class Builder extends Feign.Builder {

    private Contract contract = new Contract.Default();
    private SetterFactory setterFactory = new SetterFactory.Default();

    /**
     * Allows you to override hystrix properties such as thread pools and command keys.
     */
    public Builder setterFactory(SetterFactory setterFactory) {
      this.setterFactory = setterFactory;
      return this;
    }

    /**
     * @see #target(Class, String, Object)
     */
    public <T> T target(Target<T> target, T fallback) {
      return build(fallback != null ? new FallbackFactory.Default<T>(fallback) : null)
          .newInstance(target);
    }

    /**
     * @see #target(Class, String, FallbackFactory)
     */
    public <T> T target(Target<T> target, FallbackFactory<? extends T> fallbackFactory) {
      return build(fallbackFactory).newInstance(target);
    }

    /**
     * Like {@link Feign#newInstance(Target)}, except with {@link HystrixCommand#getFallback()
     * fallback} support.
     *
     *

     * Fallbacks are known values, which you return when there's an error invoking an http method.
     * For example, you can return a cached result as opposed to raising an error to the caller. To
     * use this feature, pass a safe implementation of your target interface as the last parameter.
     *
     * Here's an example:
     *
     *

     * {@code
     *
     * // When dealing with fallbacks, it is less tedious to keep interfaces small.
     * interface GitHub {
     *   @RequestLine("GET /repos/{owner}/{repo}/contributors")
     *   List<String> contributors(@Param("owner") String owner, @Param("repo") String repo);
     * }
     *
     * // This instance will be invoked if there are errors of any kind.
     * GitHub fallback = (owner, repo) -> {
     *   if (owner.equals("Netflix") && repo.equals("feign")) {
     *     return Arrays.asList("stuarthendren"); // inspired this approach!
     *   } else {
     *     return Collections.emptyList();
     *   }
     * };
     *
     * GitHub github = HystrixFeign.builder()
     *                             ...
     *                             .target(GitHub.class, "https://api.github.com", fallback);
     * }
     *

     *
     * @see #target(Target, Object)
     */
    public <T> T target(Class<T> apiType, String url, T fallback) {
      return target(new Target.HardCodedTarget<T>(apiType, url), fallback);
    }

    /**
     * Same as {@link #target(Class, String, T)}, except you can inspect a source exception before
     * creating a fallback object.
     */
    public <T> T target(Class<T> apiType,
                        String url,
                        FallbackFactory<? extends T> fallbackFactory) {
      return target(new Target.HardCodedTarget<T>(apiType, url), fallbackFactory);
    }

    @Override
    public Feign.Builder invocationHandlerFactory(InvocationHandlerFactory invocationHandlerFactory) {
      throw new UnsupportedOperationException();
    }

    @Override
    public Builder contract(Contract contract) {
      this.contract = contract;
      return this;
    }

    @Override
    public Feign build() {
      return build(null);
    }

    /** Configures components needed for hystrix integration. */
    Feign build(final FallbackFactory<?> nullableFallbackFactory) {
      super.invocationHandlerFactory(new InvocationHandlerFactory() {
        @Override
        public InvocationHandler create(Target target,
                                        Map<Method, MethodHandler> dispatch) {
          return new HystrixInvocationHandler(target, dispatch, setterFactory,
              nullableFallbackFactory);
        }
      });
      super.contract(new HystrixDelegatingContract(contract));
      return super.build();
    }

    // Covariant overrides to support chaining to new fallback method.
    @Override
    public Builder logLevel(Logger.Level logLevel) {
      return (Builder) super.logLevel(logLevel);
    }

    @Override
    public Builder client(Client client) {
      return (Builder) super.client(client);
    }

    @Override
    public Builder retryer(Retryer retryer) {
      return (Builder) super.retryer(retryer);
    }

    @Override
    public Builder logger(Logger logger) {
      return (Builder) super.logger(logger);
    }

    @Override
    public Builder encoder(Encoder encoder) {
      return (Builder) super.encoder(encoder);
    }

    @Override
    public Builder decoder(Decoder decoder) {
      return (Builder) super.decoder(decoder);
    }

    @Override
    public Builder mapAndDecode(ResponseMapper mapper, Decoder decoder) {
      return (Builder) super.mapAndDecode(mapper, decoder);
    }

    @Override
    public Builder decode404() {
      return (Builder) super.decode404();
    }

    @Override
    public Builder dismiss404() {
      return (Builder) super.dismiss404();
    }

    @Override
    public Builder errorDecoder(ErrorDecoder errorDecoder) {
      return (Builder) super.errorDecoder(errorDecoder);
    }

    @Override
    public Builder options(Request.Options options) {
      return (Builder) super.options(options);
    }

    @Override
    public Builder requestInterceptor(RequestInterceptor requestInterceptor) {
      return (Builder) super.requestInterceptor(requestInterceptor);
    }

    @Override
    public Builder requestInterceptors(Iterable<RequestInterceptor> requestInterceptors) {
      return (Builder) super.requestInterceptors(requestInterceptors);
    }
  }
}


text:
<?php

namespace Zend\Db\Sql\Predicate;

use Zend\Db\Sql\Exception;
use Zend\Db\Sql\Select;

class In implements PredicateInterface
{
    protected $identifier;
    protected $valueSet;

    protected $specification = '%s IN %s';

    /**
     * Constructor
     *
     * @param null|string|array $identifier
     * @param null|array|Select $valueSet
     */
    public function __construct($identifier = null, $valueSet = null)
    {
        if ($identifier) {
            $this->setIdentifier($identifier);
        }
        if ($valueSet) {
            $this->setValueSet($valueSet);
        }
    }

    /**
     * Set identifier for comparison
     *
     * @param  string|array $identifier
     * @return In
     */
    public function setIdentifier($identifier)
    {
        $this->identifier = $identifier;

        return $this;
    }

    /**
     * Get identifier of comparison
     *
     * @return null|string|array
     */
    public function getIdentifier()
    {
        return $this->identifier;
    }

    /**
     * Set set of values for IN comparison
     *
     * @param  array|Select                       $valueSet
     * @throws Exception\InvalidArgumentException
     * @return In
     */
    public function setValueSet($valueSet)
    {
        if (!is_array($valueSet) && !$valueSet instanceof Select) {
            throw new Exception\InvalidArgumentException(
                '$valueSet must be either an array or a Zend\Db\Sql\Select object, ' . gettype($valueSet) . ' given'
            );
        }
        $this->valueSet = $valueSet;

        return $this;
    }

    /**
     * Gets set of values in IN comparision
     *
     * @return array|Select
     */
    public function getValueSet()
    {
        return $this->valueSet;
    }

    /**
     * Return array of parts for where statement
     *
     * @return array
     */
    public function getExpressionData()
    {
        $identifier = $this->getIdentifier();
        $values = $this->getValueSet();
        $replacements = array();

        if (is_array($identifier)) {
            $identifierSpecFragment = '(' . implode(', ', array_fill(0, count($identifier), '%s')) . ')';
            $types = array_fill(0, count($identifier), self::TYPE_IDENTIFIER);
            $replacements = $identifier;
        } else {
            $identifierSpecFragment = '%s';
            $replacements[] = $identifier;
            $types = array(self::TYPE_IDENTIFIER);
        }

        if ($values instanceof Select) {
            $specification = vsprintf(
                $this->specification,
                array($identifierSpecFragment, '%s')
            );
            $replacements[] = $values;
            $types[] = self::TYPE_VALUE;
        } else {
            $specification = vsprintf(
                $this->specification,
                array($identifierSpecFragment, '(' . implode(', ', array_fill(0, count($values), '%s')) . ')')
            );
            $replacements = array_merge($replacements, $values);
            $types = array_merge($types, array_fill(0, count($values), self::TYPE_VALUE));
        }

        return array(array(
            $specification,
            $replacements,
            $types,
        ));
    }
}


text:
/**
 * Contains the {@link org.decimal4j.dfloat.api.FloatArithmetic } interface and other
 * central elements defining the <b>decimal4j</b> API for 64 bit floating point decimal
 * numbers.
 */
package org.decimal4j.dfloat.api;


text:
package objects

type CommandArgs struct {
	Command             string
	SubCommand          string
	CmdArgs             []string
	OptionalArgs        []string
	PipeToStdIn         string
	EnvironmentVariable []string
}

type CommandOut struct {
	StdOut   string
	StdErr   string
	ExitCode int
	Err      error
}


text:
module PoormansTrends
  class ApplicationController < ActionController::Base
  end
end


text:
/**
 * ignore
 */

/**
 * @constant
 * @type {number}
 */
cc.UIInterfaceOrientationLandscapeLeft = -90;
/**
 * @constant
 * @type {number}
 */
cc.UIInterfaceOrientationLandscapeRight = 90;
/**
 * @constant
 * @type {number}
 */
cc.UIInterfaceOrientationPortraitUpsideDown = 180;
/**
 * @constant
 * @type {number}
 */
cc.UIInterfaceOrientationPortrait = 0;

/**
 *

 *  This class manages all events of input. include: touch, mouse, accelerometer, keyboard

 *

 * @class
 * @name cc.inputManager
 */
cc.inputManager = /** @lends cc.inputManager# */{
    TOUCH_TIMEOUT: 5000,

    _mousePressed: false,

    _isRegisterEvent: false,

    _preTouchPoint: cc.p(0, 0),
    _prevMousePoint: cc.p(0, 0),

    _preTouchPool: [],
    _preTouchPoolPointer: 0,

    _touches: [],
    _touchesIntegerDict: {},

    _indexBitsUsed: 0,
    _maxTouches: 5,

    _accelEnabled: false,
    _accelInterval: 1 / 30,
    _accelMinus: 1,
    _accelCurTime: 0,
    _acceleration: null,
    _accelDeviceEvent: null,

    _getUnUsedIndex: function () {
        var temp = this._indexBitsUsed;
        var now = cc.sys.now();

        for (var i = 0; i < this._maxTouches; i++) {
            if (!(temp & 0x00000001)) {
                this._indexBitsUsed |= (1 < this.TOUCH_TIMEOUT) {
                    this._removeUsedIndexBit(i);
                    delete this._touchesIntegerDict[touch.getID()];
                    return i;
                }
            }
            temp >>= 1;
        }

        // all bits are used
        return -1;
    },

    _removeUsedIndexBit: function (index) {
        if (index < 0 || index >= this._maxTouches)
            return;

        var temp = 1 << index;
        temp = ~temp;
        this._indexBitsUsed &= temp;
    },

    _glView: null,

    /**
     * @function
     * @param {Array} touches
     */
    handleTouchesBegin: function (touches) {
        var selTouch, index, curTouch, touchID,
            handleTouches = [], locTouchIntDict = this._touchesIntegerDict,
            now = cc.sys.now();
        for (var i = 0, len = touches.length; i < len; i++) {
            selTouch = touches[i];
            touchID = selTouch.getID();
            index = locTouchIntDict[touchID];

            if (index == null) {
                var unusedIndex = this._getUnUsedIndex();
                if (unusedIndex === -1) {
                    cc.log(cc._LogInfos.inputManager_handleTouchesBegin, unusedIndex);
                    continue;
                }
                //curTouch = this._touches[unusedIndex] = selTouch;
                curTouch = this._touches[unusedIndex] = new cc.Touch(selTouch._point.x, selTouch._point.y, selTouch.getID());
                curTouch._lastModified = now;
                curTouch._setPrevPoint(selTouch._prevPoint);
                locTouchIntDict[touchID] = unusedIndex;
                handleTouches.push(curTouch);
            }
        }
        if (handleTouches.length > 0) {
            this._glView._convertTouchesWithScale(handleTouches);
            var touchEvent = new cc.EventTouch(handleTouches);
            touchEvent._eventCode = cc.EventTouch.EventCode.BEGAN;
            cc.eventManager.dispatchEvent(touchEvent);
        }
    },

    /**
     * @function
     * @param {Array} touches
     */
    handleTouchesMove: function (touches) {
        var selTouch, index, touchID,
            handleTouches = [], locTouches = this._touches,
            now = cc.sys.now();
        for (var i = 0, len = touches.length; i < len; i++) {
            selTouch = touches[i];
            touchID = selTouch.getID();
            index = this._touchesIntegerDict[touchID];

            if (index == null) {
                //cc.log("if the index doesn't exist, it is an error");
                continue;
            }
            if (locTouches[index]) {
                locTouches[index]._setPoint(selTouch._point);
                locTouches[index]._setPrevPoint(selTouch._prevPoint);
                locTouches[index]._lastModified = now;
                handleTouches.push(locTouches[index]);
            }
        }
        if (handleTouches.length > 0) {
            this._glView._convertTouchesWithScale(handleTouches);
            var touchEvent = new cc.EventTouch(handleTouches);
            touchEvent._eventCode = cc.EventTouch.EventCode.MOVED;
            cc.eventManager.dispatchEvent(touchEvent);
        }
    },

    /**
     * @function
     * @param {Array} touches
     */
    handleTouchesEnd: function (touches) {
        var handleTouches = this.getSetOfTouchesEndOrCancel(touches);
        if (handleTouches.length > 0) {
            this._glView._convertTouchesWithScale(handleTouches);
            var touchEvent = new cc.EventTouch(handleTouches);
            touchEvent._eventCode = cc.EventTouch.EventCode.ENDED;
            cc.eventManager.dispatchEvent(touchEvent);
        }
    },

    /**
     * @function
     * @param {Array} touches
     */
    handleTouchesCancel: function (touches) {
        var handleTouches = this.getSetOfTouchesEndOrCancel(touches);
        if (handleTouches.length > 0) {
            this._glView._convertTouchesWithScale(handleTouches);
            var touchEvent = new cc.EventTouch(handleTouches);
            touchEvent._eventCode = cc.EventTouch.EventCode.CANCELLED;
            cc.eventManager.dispatchEvent(touchEvent);
        }
    },

    /**
     * @function
     * @param {Array} touches
     * @returns {Array}
     */
    getSetOfTouchesEndOrCancel: function (touches) {
        var selTouch, index, touchID, handleTouches = [], locTouches = this._touches, locTouchesIntDict = this._touchesIntegerDict;
        for (var i = 0, len = touches.length; i < len; i++) {
            selTouch = touches[i];
            touchID = selTouch.getID();
            index = locTouchesIntDict[touchID];

            if (index == null) {
                continue;  //cc.log("if the index doesn't exist, it is an error");
            }
            if (locTouches[index]) {
                locTouches[index]._setPoint(selTouch._point);
                locTouches[index]._setPrevPoint(selTouch._prevPoint);
                handleTouches.push(locTouches[index]);
                this._removeUsedIndexBit(index);
                delete locTouchesIntDict[touchID];
            }
        }
        return handleTouches;
    },

    /**
     * @function
     * @param {HTMLElement} element
     * @return {Object}
     */
    getHTMLElementPosition: function (element) {
        var docElem = document.documentElement;
        var win = window;
        var box = null;
        if (cc.isFunction(element.getBoundingClientRect)) {
            box = element.getBoundingClientRect();
        } else {
            box = {
                left: 0,
                top: 0,
                width: parseInt(element.style.width),
                height: parseInt(element.style.height)
            };
        }
        return {
            left: box.left + win.pageXOffset - docElem.clientLeft,
            top: box.top + win.pageYOffset - docElem.clientTop,
            width: box.width,
            height: box.height
        };
    },

    /**
     * @function
     * @param {cc.Touch} touch
     * @return {cc.Touch}
     */
    getPreTouch: function (touch) {
        var preTouch = null;
        var locPreTouchPool = this._preTouchPool;
        var id = touch.getID();
        for (var i = locPreTouchPool.length - 1; i >= 0; i--) {
            if (locPreTouchPool[i].getID() === id) {
                preTouch = locPreTouchPool[i];
                break;
            }
        }
        if (!preTouch)
            preTouch = touch;
        return preTouch;
    },

    /**
     * @function
     * @param {cc.Touch} touch
     */
    setPreTouch: function (touch) {
        var find = false;
        var locPreTouchPool = this._preTouchPool;
        var id = touch.getID();
        for (var i = locPreTouchPool.length - 1; i >= 0; i--) {
            if (locPreTouchPool[i].getID() === id) {
                locPreTouchPool[i] = touch;
                find = true;
                break;
            }
        }
        if (!find) {
            if (locPreTouchPool.length <= 50) {
                locPreTouchPool.push(touch);
            } else {
                locPreTouchPool[this._preTouchPoolPointer] = touch;
                this._preTouchPoolPointer = (this._preTouchPoolPointer + 1) % 50;
            }
        }
    },

    /**
     * @function
     * @param {Number} tx
     * @param {Number} ty
     * @param {cc.Point} pos
     * @return {cc.Touch}
     */
    getTouchByXY: function (tx, ty, pos) {
        var locPreTouch = this._preTouchPoint;
        var location = this._glView.convertToLocationInView(tx, ty, pos);
        var touch = new cc.Touch(location.x, location.y);
        touch._setPrevPoint(locPreTouch.x, locPreTouch.y);
        locPreTouch.x = location.x;
        locPreTouch.y = location.y;
        return touch;
    },

    /**
     * @function
     * @param {cc.Point} location
     * @param {cc.Point} pos
     * @param {Number} eventType
     * @returns {cc.EventMouse}
     */
    getMouseEvent: function (location, pos, eventType) {
        var locPreMouse = this._prevMousePoint;
        this._glView._convertMouseToLocationInView(location, pos);
        var mouseEvent = new cc.EventMouse(eventType);
        mouseEvent.setLocation(location.x, location.y);
        mouseEvent._setPrevCursor(locPreMouse.x, locPreMouse.y);
        locPreMouse.x = location.x;
        locPreMouse.y = location.y;
        return mouseEvent;
    },

    /**
     * @function
     * @param {Touch} event
     * @param {cc.Point} pos
     * @return {cc.Point}
     */
    getPointByEvent: function (event, pos) {
        if (event.pageX != null)  //not available in <= IE8
            return {x: event.pageX, y: event.pageY};

        pos.left -= document.body.scrollLeft;
        pos.top -= document.body.scrollTop;
        return {x: event.clientX, y: event.clientY};
    },

    /**
     * @function
     * @param {Touch} event
     * @param {cc.Point} pos
     * @returns {Array}
     */
    getTouchesByEvent: function (event, pos) {
        var touchArr = [], locView = this._glView;
        var touch_event, touch, preLocation;
        var locPreTouch = this._preTouchPoint;

        var length = event.changedTouches.length;
        for (var i = 0; i < length; i++) {
            touch_event = event.changedTouches[i];
            if (touch_event) {
                var location;
                if (cc.sys.BROWSER_TYPE_FIREFOX === cc.sys.browserType)
                    location = locView.convertToLocationInView(touch_event.pageX, touch_event.pageY, pos);
                else
                    location = locView.convertToLocationInView(touch_event.clientX, touch_event.clientY, pos);
                if (touch_event.identifier != null) {
                    touch = new cc.Touch(location.x, location.y, touch_event.identifier);
                    //use Touch Pool
                    preLocation = this.getPreTouch(touch).getLocation();
                    touch._setPrevPoint(preLocation.x, preLocation.y);
                    this.setPreTouch(touch);
                } else {
                    touch = new cc.Touch(location.x, location.y);
                    touch._setPrevPoint(locPreTouch.x, locPreTouch.y);
                }
                locPreTouch.x = location.x;
                locPreTouch.y = location.y;
                touchArr.push(touch);
            }
        }
        return touchArr;
    },

    /**
     * @function
     * @param {HTMLElement} element
     */
    registerSystemEvent: function (element) {
        if (this._isRegisterEvent) return;

        var locView = this._glView = cc.view;
        var selfPointer = this;
        var supportMouse = ('mouse' in cc.sys.capabilities), supportTouches = ('touches' in cc.sys.capabilities);

        //HACK
        //  - At the same time to trigger the ontouch event and onmouse event
        //  - The function will execute 2 times
        //The known browser:
        //  liebiao
        //  miui
        //  WECHAT
        var prohibition = false;
        if (cc.sys.isMobile)
            prohibition = true;

        //register touch event
        if (supportMouse) {
            window.addEventListener('mousedown', function () {
                selfPointer._mousePressed = true;
            }, false);

            window.addEventListener('mouseup', function (event) {
                if (prohibition) return;
                var savePressed = selfPointer._mousePressed;
                selfPointer._mousePressed = false;

                if (!savePressed)
                    return;

                var pos = selfPointer.getHTMLElementPosition(element);
                var location = selfPointer.getPointByEvent(event, pos);
                if (!cc.rectContainsPoint(new cc.Rect(pos.left, pos.top, pos.width, pos.height), location)) {
                    selfPointer.handleTouchesEnd([selfPointer.getTouchByXY(location.x, location.y, pos)]);

                    var mouseEvent = selfPointer.getMouseEvent(location, pos, cc.EventMouse.UP);
                    mouseEvent.setButton(event.button);
                    cc.eventManager.dispatchEvent(mouseEvent);
                }
            }, false);

            //register canvas mouse event
            element.addEventListener("mousedown", function (event) {
                if (prohibition) return;
                selfPointer._mousePressed = true;

                var pos = selfPointer.getHTMLElementPosition(element);
                var location = selfPointer.getPointByEvent(event, pos);

                selfPointer.handleTouchesBegin([selfPointer.getTouchByXY(location.x, location.y, pos)]);

                var mouseEvent = selfPointer.getMouseEvent(location, pos, cc.EventMouse.DOWN);
                mouseEvent.setButton(event.button);
                cc.eventManager.dispatchEvent(mouseEvent);

                event.stopPropagation();
                event.preventDefault();
                element.focus();
            }, false);

            element.addEventListener("mouseup", function (event) {
                if (prohibition) return;
                selfPointer._mousePressed = false;

                var pos = selfPointer.getHTMLElementPosition(element);
                var location = selfPointer.getPointByEvent(event, pos);

                selfPointer.handleTouchesEnd([selfPointer.getTouchByXY(location.x, location.y, pos)]);

                var mouseEvent = selfPointer.getMouseEvent(location, pos, cc.EventMouse.UP);
                mouseEvent.setButton(event.button);
                cc.eventManager.dispatchEvent(mouseEvent);

                event.stopPropagation();
                event.preventDefault();
            }, false);

            element.addEventListener("mousemove", function (event) {
                if (prohibition) return;

                var pos = selfPointer.getHTMLElementPosition(element);
                var location = selfPointer.getPointByEvent(event, pos);

                selfPointer.handleTouchesMove([selfPointer.getTouchByXY(location.x, location.y, pos)]);

                var mouseEvent = selfPointer.getMouseEvent(location, pos, cc.EventMouse.MOVE);
                if (selfPointer._mousePressed)
                    mouseEvent.setButton(event.button);
                else
                    mouseEvent.setButton(null);
                cc.eventManager.dispatchEvent(mouseEvent);

                event.stopPropagation();
                event.preventDefault();
            }, false);

            element.addEventListener("mousewheel", function (event) {
                var pos = selfPointer.getHTMLElementPosition(element);
                var location = selfPointer.getPointByEvent(event, pos);

                var mouseEvent = selfPointer.getMouseEvent(location, pos, cc.EventMouse.SCROLL);
                mouseEvent.setButton(event.button);
                mouseEvent.setScrollData(0, event.wheelDelta);
                cc.eventManager.dispatchEvent(mouseEvent);

                event.stopPropagation();
                event.preventDefault();
            }, false);

            /* firefox fix */
            element.addEventListener("DOMMouseScroll", function (event) {
                var pos = selfPointer.getHTMLElementPosition(element);
                var location = selfPointer.getPointByEvent(event, pos);

                var mouseEvent = selfPointer.getMouseEvent(location, pos, cc.EventMouse.SCROLL);
                mouseEvent.setButton(event.button);
                mouseEvent.setScrollData(0, event.detail * -120);
                cc.eventManager.dispatchEvent(mouseEvent);

                event.stopPropagation();
                event.preventDefault();
            }, false);
        }

        if (window.navigator.msPointerEnabled) {
            var _pointerEventsMap = {
                "MSPointerDown": selfPointer.handleTouchesBegin,
                "MSPointerMove": selfPointer.handleTouchesMove,
                "MSPointerUp": selfPointer.handleTouchesEnd,
                "MSPointerCancel": selfPointer.handleTouchesCancel
            };

            for (var eventName in _pointerEventsMap) {
                (function (_pointerEvent, _touchEvent) {
                    element.addEventListener(_pointerEvent, function (event) {
                        var pos = selfPointer.getHTMLElementPosition(element);
                        pos.left -= document.documentElement.scrollLeft;
                        pos.top -= document.documentElement.scrollTop;

                        _touchEvent.call(selfPointer, [selfPointer.getTouchByXY(event.clientX, event.clientY, pos)]);
                        event.stopPropagation();
                    }, false);
                })(eventName, _pointerEventsMap[eventName]);
            }
        }

        if (supportTouches) {
            //register canvas touch event
            element.addEventListener("touchstart", function (event) {
                if (!event.changedTouches) return;

                var pos = selfPointer.getHTMLElementPosition(element);
                pos.left -= document.body.scrollLeft;
                pos.top -= document.body.scrollTop;
                selfPointer.handleTouchesBegin(selfPointer.getTouchesByEvent(event, pos));
                event.stopPropagation();
                event.preventDefault();
                element.focus();
            }, false);

            element.addEventListener("touchmove", function (event) {
                if (!event.changedTouches) return;

                var pos = selfPointer.getHTMLElementPosition(element);
                pos.left -= document.body.scrollLeft;
                pos.top -= document.body.scrollTop;
                selfPointer.handleTouchesMove(selfPointer.getTouchesByEvent(event, pos));
                event.stopPropagation();
                event.preventDefault();
            }, false);

            element.addEventListener("touchend", function (event) {
                if (!event.changedTouches) return;

                var pos = selfPointer.getHTMLElementPosition(element);
                pos.left -= document.body.scrollLeft;
                pos.top -= document.body.scrollTop;
                selfPointer.handleTouchesEnd(selfPointer.getTouchesByEvent(event, pos));
                event.stopPropagation();
                event.preventDefault();
            }, false);

            element.addEventListener("touchcancel", function (event) {
                if (!event.changedTouches) return;

                var pos = selfPointer.getHTMLElementPosition(element);
                pos.left -= document.body.scrollLeft;
                pos.top -= document.body.scrollTop;
                selfPointer.handleTouchesCancel(selfPointer.getTouchesByEvent(event, pos));
                event.stopPropagation();
                event.preventDefault();
            }, false);
        }

        //register keyboard event
        this._registerKeyboardEvent();

        //register Accelerometer event
        this._registerAccelerometerEvent();

        this._isRegisterEvent = true;
    },

    _registerKeyboardEvent: function () {
    },

    _registerAccelerometerEvent: function () {
    },

    /**
     * @function
     * @param {Number} dt
     */
    update: function (dt) {
        if (this._accelCurTime > this._accelInterval) {
            this._accelCurTime -= this._accelInterval;
            cc.eventManager.dispatchEvent(new cc.EventAcceleration(this._acceleration));
        }
        this._accelCurTime += dt;
    }
};


text:
===================
Loading collections
===================

The core of Invoke's execution model involves one or more Collection objects.
While these may be created programmatically, in typical use Invoke will create
them for you from Python modules it finds or is told to use.

.. _collection-discovery:

Task module discovery
=====================

With no other configuration, simply calling ``invoke`` will look for a single
Python module named ``tasks``, and will treat it as the root namespace.
``tasks`` (and any other module name given via :ref:`the load options
<load-options>`) is searched for in the following ways:

* First, if a valid tasks module by that name already exists on Python's
  `sys.path <http://docs.python.org/release/2.6.7/library/sys.html#sys.path>`_,
  no more searching is done -- that module is selected.
* Failing that, search towards the root of the local filesystem, starting with
  the user's current working directory (`os.getcwd
  <http://docs.python.org/release/2.6.7/library/os.html#os.getcwd>`_) and try
  importing again with each directory temporarily added to ``sys.path``.

    * Due to how Python's import machinery works, this approach will always
      favor a package directory (``tasks/`` containing an ``__init__.py``) over
      a module file (``tasks.py``) in the same location.
    * If a candidate is found and successfully imported, its parent directory
      will **stay** on ``sys.path`` during the rest of the Python session --
      this allows task code to make convenient assumptions concerning sibling
      modules' importability.

Candidate modules/packages are introspected to make sure they can actually be
used as valid task collections. Any that fail are discarded, the ``sys.path``
munging done to import them is reverted, and the search continues.

.. _load-options:

Additional load options
=======================

The ``-c`` / ``--collection`` command-line argument allows you to override the
default collection name searched for. It should be a Python module name and not
a file name (so ``-c mytasks``, not ``-c mytasks.py`` or ``-c mytasks/``.) This
option is repeatable and may be used to load multiple collections at runtime.

.. note::
    When multiple collections are specified, the first collection given will be
    used as the root or default namespace. The rest will be attached to it as
    sub-collections. See :doc:`namespaces` for details.

If you need to override the default search start point so Invoke no longer
searches from the current directory, use ``--root``. E.g. if your tasks module
is in ``/opt/code/myproject/tasks.py`` and your CWD is, say, ``/home/myuser``,
you might run Invoke as::

    $ invoke --root /opt/code/myproject


text:
namespace gautier
{
	namespace program
	{
		auto process_input(gautier::interaction::input_def& instance_input_model) -> gautier::interaction::type_visual_response_model;
	}
}


text:
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chromeos/ash/services/assistant/test_support/scoped_device_actions.h"

#include <utility>

namespace ash::assistant {

void ScopedDeviceActions::GetScreenBrightnessLevel(
    GetScreenBrightnessLevelCallback callback) {
  std::move(callback).Run(/*success=*/true, current_brightness_);
}

bool ScopedDeviceActions::OpenAndroidApp(const AndroidAppInfo& app_info) {
  return true;
}

AppStatus ScopedDeviceActions::GetAndroidAppStatus(
    const AndroidAppInfo& app_info) {
  return AppStatus::kAvailable;
}

}  // namespace ash::assistant


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
 <HEAD>
  <TITLE> ¶ÁÈ¡</TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
<META http-equiv="Content-Type" content="text/html; charset=gbk" />
  <script type='text/javascript' charset='gb2312'>
    loadXML = function(xmlString){
        var xmlDoc=null;
        if(!window.DOMParser && window.ActiveXObject){   //window.DOMParser
            var xmlDomVersions = ['MSXML.2.DOMDocument.6.0','MSXML.2.DOMDocument.3.0','Microsoft.XMLDOM'];
            for(var i=0;i<xmlDomVersions.length;i++){
                try{
                    xmlDoc = new ActiveXObject(xmlDomVersions[i]);
                    xmlDoc.async = false;
                    xmlDoc.loadXML(xmlString); //loadXML
                    break;
                }catch(e){
                }
            }
        }
        else if(window.DOMParser && document.implementation && document.implementation.createDocument){
            try{

                domParser = new  DOMParser();
                xmlDoc = domParser.parseFromString(xmlString, 'text/xml');
            }catch(e){
            }
        }
        else{
            return null;
        }

        return xmlDoc;
    }

    checkXMLDocObj = function(xmlString){
        var xmlDoc = loadXML(xmlString);
        if(xmlDoc==null){
            alert('Ö»Ö§³ÖIE5.0ÒÔÉÏä¯ÀÀÆ÷');
        }
        return xmlDoc;
    }

    //
    initializeSelect = function(){
		var oShow1 = document.getElementById("show1");
		var oShow2 = document.getElementById("show2");
		var oShow3 = document.getElementById("show3");
		document.getElementById("show4").value = "";;
		document.getElementById("show5").value = "";
		 oShow1.value = "";
		 oShow2.value = "";
		 oShow3.value = "";
        var xmlstr= document.getElementById("text1").value;
        var xmlDoc = checkXMLDocObj(xmlstr);
		title = document.getElementById("title").value;
		mainView = document.getElementById("mainView").value;
		default_name = document.getElementById("default_name").value;
		default_id = document.getElementById("default_id").value;
		default_event = document.getElementById("default_event").value;
		checkbox = document.getElementById("checkbox").checked;
		/*if(xmlDoc)
		{
		   var Companys= xmlDoc.getElementsByTagName('RelativeLayout');

		   if(Companys)
		   {

				myValue = "";
				for(var i=0;i<Companys.length;i++)
				{
					var cNname = Companys[i].getElementsByTagName('RelativeLayout'); //
					//var cIP = Companys[i].getElementsByTagName('LinearLayout')[0].innerHTML;//
					//var year = Companys[i].getElementsByTagName('year')[0].innerHTML; //
					//var price = Number(Companys[i].getElementsByTagName('price')[0].innerHTML);

				  //
				  myValue += "<br\>";
				    myValue += cNname;
				  // myValue += "<br\>";
				 //  myValue += cIP;
				   var attrs = Companys[i].attributes;

				   for(var j=0;j<attrs.length;j++)
				   {
					   var attr = attrs[j];
					   var attr_name = attr.name;
						myValue += "<br\>";
					   myValue += attr_name;
					   var attr_value =  attr.value;
						myValue += "<br\>";
					   myValue += attr_value;
				   }
				}

			oShow1.innerHTML = "Êý¾Ý£º"+Companys.length+"£º£º"+ myValue+"";
		   }
		}*/
		//var nodes=xmlDoc.documentElement.childNodes;
				getNotes(xmlDoc.documentElement);
		/*for(var i=0;i<nodes.length;i++){
			if(nodes[i].nodeName != "#text" )
				getNotes(nodes[i]);
			var attrs = nodes[i].attributes;
			if(attrs != null){
				for(var k=0;k<attrs.length;k++)
				{
					var attr = attrs[k];
					var attr_name = attr.name;
						//	mdata += "<br\>";
						//	mdata += attr_name;
					if(attr_name == "android:id" ){
						var attr_value =  attr.value;
						mdata += "<br\>";
						mdata += attr_value;
					}
				}
			}

			var ll = nodes[i].childNodes.length;
			if(ll != 0){
				for(var j=0;j<ll;j++)
					var attrs = nodes[i].childNodes[j].attributes;
					if(attrs != null){
						for(var k=0;k<attrs.length;k++)
						{
							var attr = attrs[k];
							var attr_name = attr.name;
							mdata += "<br\>";
							mdata += attr_name;
							var attr_value =  attr.value;
							mdata += "<br\>";
							mdata += attr_value;
						}
				   }
			 }

		} */

			 //oShow1.innerHTML = "Êý¾Ý£º"+mdata2;
		// oShow2.innerHTML = "Êý¾Ý£º"+nodes.length+"£º£º"+mdata;

    }
	getNotes = function(nnn){
			var ch = nnn.childNodes;
			if(ch != null &&  ch.length != 0){
				writeNotesName(nnn);
				for(var j=0;j<ch.length;j++){
					if(ch[j].nodeName != "#text" ){
						getNotes(ch[j]);
					}
				}
			 }else{
				writeNotesName(nnn);
			 }

	}
	writeNotesName = function(nnn){
		var oShow1 = document.getElementById("show1");
		var oShow2 = document.getElementById("show2");
		var oShow3 = document.getElementById("show3");
		var oShow4 = document.getElementById("show4");
		var oShow5 = document.getElementById("show5");
		var data3 = "-1";

		var data = "-1";
		data = nnn.nodeName;

		var mdata = "-1";
		var attrs = nnn.attributes;
		if(attrs != null){
			for(var k=0;k<attrs.length;k++)
			{
				var attr = attrs[k];
				var attr_name = attr.name;
				if(attr_name == "android:id" ){
					var attr_value =  attr.value;
					mdata = attr_value;
				}
			}
		}

		if(mdata != "-1" && data != "-1" && data != null){
			mdata = mdata.replace("@+id/","");
			var name = getViewName(mdata);

			oShow1.value = oShow1.value + "\n" +title+" "+data+" "+default_name+name+";";

			data3= "\n" +default_id.replace("?",mdata)+"\n"+title+" "+data+" "+default_name+name+";"

			if(mainView != "" && mainView != undefined && mainView != null && mainView.indexOf(".") == -1)
				mainView = mainView+".";

			oShow2.value = oShow2.value + "\n" +" "+default_name+name+" = ("+data+") "+mainView+"findViewById(R.id."+mdata+");";
			oShow3.value = oShow3.value + data3;
			oShow4.value = oShow4.value + "\n"  + default_event.replace("?",mdata)+"\nvoid on"+name+"Click(View view) {}";
			var idCick = oShow5.value;
			if(idCick.indexOf("}") != -1){
				var nn1 = idCick.substring(0,idCick.indexOf("}"));
				oShow5.value = nn1 + "\n"  + "case R.id."+mdata+":\n  break;\n}";
			}else
				oShow5.value = oShow5.value + "switch (view.getId()) {\n"  + "case R.id."+mdata+":\n  break;}";
		}
	}
	getViewName = function(name){
			var a;
			if(checkbox){
				a = name.substring(0,1);
				a = a.toUpperCase( );
				name = name.substring(1,name.length);
				name = a + name;
			}
			while(name.indexOf("_") != -1){
				var index = name.indexOf("_");
				var nn1 = name.substring(0,index);
				var nn2 = name.substring(index+1,name.length);
				a = nn2.substring(0,1);
				a = a.toUpperCase( );
				nn2 = nn2.substring(1,name.length);
				nn2 = a + nn2;
				name = nn1+nn2;
			}
			return name;
	}

	var title = "";
	var mainView = "this";
	var default_name = "m";
	var default_id = "@BindView  (R.id.?)";
	var default_event = "@OnClick(value = R.id.?)";
	var checkbox = true;

	clearData = function(){
		var oShow1 = document.getElementById("show1");
		var oShow2 = document.getElementById("show2");
		var oShow3 = document.getElementById("show3");
		document.getElementById("show4").value = "";
		document.getElementById("show5").value = "";

		var text = document.getElementById("text1");
		title = "";
		mainView = "this";
		default_name = "m";
		default_id = "@BindView  (R.id.?)";
		default_event = "@OnClick(value = R.id.?)";

		text.value = "";
		oShow1.value = "";
		oShow2.value = "";
		oShow3.value = "";
		document.getElementById("title").value = title;
		document.getElementById("mainView").value = mainView;
		document.getElementById("default_name").value = default_name;
		document.getElementById("default_id").value = default_id;
		document.getElementById("default_event").value = default_event;
		document.getElementById("checkbox").checked = true;

	}
  </script>
 </HEAD>

 <body >
 <div>
 Ãû×Öǰ׺ <input id="default_name" value="m"></input><br\>
 title <input id="title" value=""></input><br\>
 mainView <input id="mainView" value="this"></input><br\>
 ×¢Èë±äÁ¿Ä£°å <input id="default_id" value="@BindView  (R.id.?)"></input><br\>
 ×¢Èë'þÄ£°å <input id="default_event" value="@OnClick(value = R.id.?)"></input><br\>
 <input id="checkbox" type="checkbox" checked="true">Ê××Öĸ´óд</input>
  <button onclick="initializeSelect()">¶ÁÈ¡</button><br\>
  <button onclick="clearData()">»¹Ô</button><br\>

  </div>

   <textarea  id="text1"   style="height:30%;width:40%"></textarea>
  <textarea    id="show5"   style="height:30%;width:40%"></textarea>

  <textarea    id="show1"  style="height:30%;width:40%"></textarea>

  <textarea    id="show2"   style="height:30%;width:40%"></textarea>

  <textarea    id="show3"   style="height:30%;width:40%"></textarea>
  <textarea    id="show4"   style="height:30%;width:40%"></textarea>
 </body>
 </body>
</HTML>


text:
#!/bin/bash -e

# Script to submit jobs to the queue.
# NOTE: Not meant to be used outside the framework
#
# author: Denis C. Bauer
# date: Nov.2010

function usage {
echo -e "usage: $(basename $0) -k NGSANE [OPTIONS]"
exit
}

# Submission script for PBS and SGE
while [ "$1" != "" ]; do
    case $1 in
    -k | --toolkit )        shift; CONFIG=$1 ;; # location of the NGSANE repository
    -m | --memory )         shift; SMEMORY=$1 ;; # memory used
    -n | --nodes )          shift; SNODES=$1 ;; # memory used
    -c | --cpu    )         shift; SCPU=$1 ;; # CPU used
    -w | --walltime )       shift; SWALLTIME=$1 ;; # walltime used
    -W | --wait )           shift; JOBIDS=$1 ;; # jobids to wait for
    -j | --jobname   )      shift; SNAME=$1 ;; # name used
    -q | --queue )          shift; QUEUE=$1 ;; # nodetype
    -o | --output )	        shift; SOUTPUT=$1 ;; # pbsoutput
    -a | --additional )	    shift; SADDITIONAL=$1 ;; # additional paramers
    -p | --command )	    shift; SCOMMAND=$1 ;; # Program call
    -t | --tmpdir )	        shift; STMPDIR=$1 ;; # additional paramers
    -h | --help )           usage ;;
    * )                     echo "don't understand "$1
    esac
    shift
done

#PROGRAMS
. $CONFIG
. ${NGSANE_BASE}/conf/header.sh
. $CONFIG

#check if QSUBEXTRA already contains wait commands
if [[ "$SADDITIONAL" == *"$QUEUEWAIT"* ]]; then
    sub=${SADDITIONAL/*${QUEUEWAIT}/}
    ids=${sub/ */}
    if [ -n "$ids" ]; then JOBIDS=${JOBIDS}${QUEUEWAITSEP}$ids; fi
    JOBIDS=$(echo $JOBIDS | sed 's/^://' | sed 's/::/:/')
    SADDITIONAL=${SADDITIONAL/${QUEUEWAIT}${ids}/}
fi

#echo "********** write TMP file"
if [ ! -n "$STMPDIR" ]; then STMPDIR="tmp"; fi
if [ ! -e $STMPDIR ]; then mkdir $STMPDIR; fi
TMPFILE=$STMPDIR/"qsub_"$(date '+%y%m%d%H%m')"_"$(cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 9)".tmp"
echo "#!/bin/bash -e" > $TMPFILE
echo "cd $(pwd)" >> $TMPFILE
echo $SCOMMAND >> $TMPFILE
echo "rm $TMPFILE" >> $TMPFILE

# truncate jobname to 64 characters due to job schedule constraints
SNAME="NGs_${SNAME:0:60}"

# split total memory by CPUs if needed
if [ -n "$QUEUEMEMORYPERSLOT" ]; then
    SMEMORY=$(echo $SMEMORY | sed "s|\(^[0-9. ]*\).*|scale=2; \1 / $SCPU |g" | bc -l)$(echo $SMEMORY | sed "s|^[0-9. ]*\(.*\)|\1|g")
fi

if [ "$SUBMISSIONSYSTEM" == "PBS" ]; then

	# Prepare Prologue Script
	# Emulate SGE's behaviour of appending to the previous $SOUTPUT.sh by cat in the prologue
    if [ -e $SOUTPUT.sh ]; then rm -f $SOUTPUT.sh; fi
	echo -e "#!/bin/sh \n cat $SOUTPUT \n exit 0" > $SOUTPUT.sh
	chmod 500 $SOUTPUT.sh
	# add to the TMPFILE that the prologue scripts needs deleting
	echo "rm -fr $SOUTPUT.sh" >> $TMPFILE

#	echo "********** submit with PBS submission system" 1>&2
	JOBIDS=$QUEUEWAIT${JOBIDS//:/$QUEUEWAITSEP}
	command="qsub $JOBIDS -V -S /bin/bash -j oe -o $SOUTPUT -w $(pwd) -l $SNODES -l vmem=$SMEMORY \
		-N $SNAME -l walltime=$SWALLTIME $TMPFILE $SADDITIONAL -l prologue=$SOUTPUT.sh	"

	echo "# $command" >> $TMPFILE
	RECIPT=$($command)
    JOBID=$(echo "$RECIPT" | gawk '{print $(NF-1); split($(NF-1),arr,"."); print arr[1]}' | tail -n 1)
	echo $JOBID

elif [ "$SUBMISSIONSYSTEM" == "SGE" ]; then
    ## add resource survey for job to logfile
    echo "echo '>>>>> job resources'" >> $TMPFILE
    echo "qstat -j $SNAME 2>/dev/null | egrep 'vmem|parallel environment'" >> $TMPFILE

#   taking care of the SGE module bug
    unset module
#	echo "********** submit with SGE submission system"
	if [ -n "$JOBIDS" ];then JOBIDS=$(echo -e $JOBIDS | sed 's/^://g' | sed 's/:/,/g'); HOLD_JID="-hold_jid $JOBIDS"; fi
	command="qsub $HOLD_JID -V -S /bin/bash -j y -o $SOUTPUT -cwd -pe $QUEUEPARENV $SCPU -l h_vmem=$SMEMORY \
	    -N $SNAME -l h_rt=$SWALLTIME $SADDITIONAL $TMPFILE"
	echo "# $command" >>$TMPFILE
	RECIPT=$($command)
	JOBID=$(echo "$RECIPT" | awk '{print $3}')
	echo $JOBID

elif [ "$SUBMISSIONSYSTEM" == "SLURM" ]; then

    # if it is the default (nodes=1:ppn=4) convert to SLURM (--nodes=1 as well as the separage SCPU param )
    if [[ $SNODES == *:* ]]; then
        SNODES="--"${SNODES/:*/}" --ntasks-per-node=$SCPU"
    fi

#	echo "********** submit with SLURM submission system"
	if [ -n "$JOBIDS" ];then JOBIDS=$QUEUEWAIT${JOBIDS//:/$QUEUEWAITSEP}; fi
	command="sbatch $JOBIDS --export=ALL --output=$SOUTPUT $SNODES --mem=$SMEMORY \
        --job-name=$SNAME --time=$SWALLTIME --open-mode=append --requeue $SADDITIONAL $TMPFILE"
	echo "# $command" >>$TMPFILE
	echo $command  1>&2
	RECIPT=$($command)
	JOBID=$(echo "$RECIPT" | awk '{print $4}')
	echo $JOBID

else
	echo "Submission system, $SUBMISSIONSYSTEM, not implemented; only SGE, SLURM or PBS are currently supported"
	exit
fi


text:
from PIL import Image
im = Image.open("bride.jpg")
im.rotate(45).show()

pilImage=Image.open(inputImage)
pilImage = pilImage.convert('1')   #this convert to black&white
pilImage.draft('L',(500,500))

pilImage.save('outfile.png')


text:
using AIGames.Data;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Qowaiv.Statistics;

namespace AIGames.AllTimeRanking
{
	public static class Program
	{
		public static void Main(string[] args)
		{
			bool skip = false;
			skip = args.Length > 0 && bool.TryParse(args[0], out skip) && skip;

			var sw = Stopwatch.StartNew();

			var results = new Dictionary<AIGamesCompetition, AIGameResults>();
			var bots = new Dictionary<AIGamesCompetition, AIGamesBots>();

			foreach (var competition in AIGamesCompetitions.All)
			{
				results[competition] = AIGameResults.Load(competition);
				bots[competition] = AIGamesBots.Load(competition);
			}

			if (!skip)
			{
				Update(sw, results, bots);
			}

			foreach (var comp in AIGamesCompetitions.All)
			{
				var ranking = Ranking.Create(bots[comp], results[comp], comp.IsSymmetric);

				var all = bots[comp].SelectMany(owner => owner.Bots).ToList();
				var avg_pre = all.Where(a => a.Active).Select(bot => bot.Rating).Avarage();
				ranking.Process();
				var avg_pos = all.Select(bot => bot.Rating).Avarage();

				var delta = avg_pos - avg_pre;

				foreach (var bot in all)
				{
					bot.Rating -= delta;
				}

				foreach (var owner in bots[comp])
				{
					owner.Bots.Sort();
				}
				ranking.Save(comp);

				bots[comp].Save(comp);
				results[comp].Save(comp);
			}
		}

		private static void Update(
			Stopwatch sw,
			Dictionary<AIGamesCompetition, AIGameResults> results,
			Dictionary<AIGamesCompetition, AIGamesBots> bots)
		{
			using (var driver = WebDriverWrapper.GetChrome())
			{
				foreach (var kvp in results)
				{
					var competition = kvp.Key;
					var games = kvp.Value;

					var bs = bots[competition];

					var gamesCount = games.Count;
					var botsCount = bs.BotCount;

					foreach (var game in driver.GetGames(competition))
					{
						if (games.ContainsId(game))
						{
							break;
						}
						else
						{
							games.Add(game);
						}
					}
					games.Save(competition);

					bs.DeactiveAll();

					var all = driver.GetHtmlLeaderboard(competition).ToList();
					foreach (var bot in all)
					{
						var bt = bs.AddOrUpdate(bot);
						bt.Active = true;
					}
					bs.Save(competition);

					Console.WriteLine(@"{0:mm\:ss\:f}  Saved {1:#,##0} new game results and {2:#,##0} bots for {3}. Results: {4:#,##0}, bots: {5:#,##0}",
						sw.Elapsed,
						games.Count - gamesCount,
						bs.BotCount - botsCount,
						competition.DisplayName,
						games.Count,
						bs.BotCount);
				}
			}
		}
	}
}


text:
package com.btrax.mywatch;

public class AppConsts {
    public static final String GUIDE_URL = "http://ec2-54-215-243-230.us-west-1.compute.amazonaws.com/mywatch/smp/";
}


text:
this.include = function(name,url,callback)
	{
		if(!name)
		{
			name="root"+(this.rootScripts++);
			this.baseScripts[name] = {state:"loading"};
		}
		if(url && url.length>0)
		{
			var scriptObjs = {};
			for(var i=0;i<url.length;i++)
			{
				var fullUrl = url[i];
				if(!this.baseScripts[fullUrl])
				{
					this.baseScripts[fullUrl] = scriptObjs[fullUrl] = {state:"loading"};
				}

			}

			quickforms._appendScripts(name,url,scriptObjs,callback);
		}
		else
		{
			window.setTimeout(function(){
				callback();
				quickforms.baseScripts[name] = {state:"loaded"};
				console.log("Script "+name+" loaded");
			},1);
		}
	};
	this.registerApp = function(appName)
	{
		this.addedFolders["/"+appName+"/js/"] =1;
	};
	this.findScriptFolder = function(url)
	{
		var baseFolder = url.split('/')[0];
		if(this.baseFolders[baseFolder] == 1) // Quickforms library
		{
			if(url.indexOf('.js')>0)
				return quickforms.jsUrl+url;
			else if(url.indexOf('.css')>0)
				return quickforms.cssUrl+url;
		}
		else
		{
			if(url.indexOf('.js')>0)
				return "/"+baseFolder+"/js/"+url.substring(baseFolder.length,url.length);
			else if(url.indexOf('.css')>0)
				return "/"+baseFolder+"/css/"+url.substring(baseFolder.length,url.length);
		}
		quickforms.jsUrl+url
	};
	quickforms._appendScripts = function (currentScript,dependencyArray,scriptArray,callback){
	var checkDependenciesLoaded = function()
	{
		var loadedCount = 0;
		for(var i=0;i<dependencyArray.length;i++)
		{
			if(quickforms.baseScripts[dependencyArray[i]].state == "loaded")
				loadedCount ++;
		}
		if(loadedCount >= dependencyArray.length)
			return true;
		return false;
	}
	var finishFunc = function(parentUrl,smlUrl)
	{
		if(quickforms.baseScripts[smlUrl].state == "loaded" )
		{
			if(quickforms.baseScripts[parentUrl].state == "loading") // parent may have already finished loading
			{
				if(checkDependenciesLoaded())
				{
					if(callback)
						callback();
					quickforms.baseScripts[parentUrl].state = "loaded";
					console.log("Script "+parentUrl+" loaded");
				}
				else
				{
					window.setTimeout(function()
					{
						finishFunc(parentUrl,smlUrl);
					},
					quickforms.scriptWait);
				quickforms.scriptWait += 5;
				}
			}
		}
		else
		{
			//console.log('waiting on script '+smlUrl);
			window.setTimeout(function()
				{
					finishFunc(parentUrl,smlUrl);
				},
				quickforms.scriptWait);
			quickforms.scriptWait += 5;
		}
	};
    for(var url in scriptArray)
	{
		var scriptFinalUrl = this.findScriptFolder(url);
		if(scriptArray[url].state == "loading")
		{
			var scr;
			if(url.indexOf('.js')>0)
			{
				scr = document.createElement('script');
				scr.setAttribute("type","text/javascript");
				scr.setAttribute("src", scriptFinalUrl);
				scr.smlUrl = url;
				scr.parentUrl = currentScript;
				scr.onload = scr.onreadystatechange = function()
				{
					if (!this.readyState || this.readyState == 'loaded') {
						finishFunc.call(this,this.parentUrl,this.smlUrl);
					}
				};
			}
			else if(url.indexOf('.css')>0)
			{
				scr = document.createElement('link');
				scr.setAttribute("type","text/css");
				scr.setAttribute("rel","stylesheet");
				scr.setAttribute("href", scriptFinalUrl);
				scr.smlUrl = url;
				scr.onload = scr.onreadystatechange = function()
				{
					if (!this.readyState || this.readyState == 'loaded') {
						quickforms.baseScripts[this.smlUrl].state = "loaded";
						if(checkDependenciesLoaded())
						{
							if(callback)
								callback();
							quickforms.baseScripts[currentScript].state = "loaded";
						}
					}
				};
			}
			document.getElementsByTagName('head')[0].appendChild(scr);
		}
		else
		{
		}
	}
    if(!url || url.length == 0)
	{
		for(var i=0;i<dependencyArray.length;i++)
		{
			finishFunc(currentScript,dependencyArray[i]);
		}
	}
}
quickforms._appendSynchronousScripts = function (scripts)
{
	$.ajaxSetup({ cache: true });
    $.ajaxSetup({async: false});
	for(var i=0;i<scripts.length;i++)
	{
		$.ajax({
		   url: this.jsUrl + scripts[i],
		   dataType: 'text',
		   success: function(data) {
				var script = document.createElement('script');
				var head = document.getElementsByTagName("head")[0] ||
                  document.documentElement;
				script.type = "text/javascript";
				try {
				  // doesn't work on ie...
				  script.appendChild(document.createTextNode(data));
				} catch(e) {
				  // IE has funky script nodes
				  script.text = data;
				}
				head.insertBefore(script, head.firstChild);
		   },
		   error: function(e,e2,e3){
			console.log(e + e2 + e3);
			},
		   async: false
		});
	}
	$.ajaxSetup({async: true});
}


text:
package io.mangoo.controllers;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import io.mangoo.TestExtension;
import io.mangoo.test.http.TestRequest;
import io.mangoo.test.http.TestResponse;
import io.undertow.util.StatusCodes;

/**
 *
 * @author svenkubiak
 *
 */
@ExtendWith({TestExtension.class})
class FlashControllerTest {
    @Test
    void testFlash() {
        //given
        TestResponse response = TestRequest.get("/flash").execute();

        //then
        assertThat(response, not(nullValue()));
        assertThat(response.getStatusCode(), equalTo(StatusCodes.OK));
        assertThat(response.getContent(), equalTo("simpleerrorwarningsuccess"));
    }
}


text:
using Library.Resources.Objects;
using System.Collections.Generic;
using System.Linq;

namespace Library.Cache
{
    /// <summary>
    /// Library holding the items.<br/>
    /// As they are unique for each file, the key is always the file itself
    /// </summary>
    public sealed class ItemHoard : HoardBase<string, Item>
    {
        #region Delegates + Events

        internal static event AsyncCacheEventHandler ItemRemoved;

        #endregion Delegates + Events

        #region Methods

        internal override void Remove(string file)
        {
            base.Remove(file);
            ItemRemoved(new CacheEventAsyncArgs(file));
        }

        internal IEnumerable<string> Search(string location) => Library.Keys.Where(i => i.StartsWith(location)).OrderBy(o => o);

        #endregion Methods

        #region Constructors

        public ItemHoard() : base(nameof(ItemHoard))
        {
        }

        #endregion Constructors
    }
}


text:
import React from 'react'
import SelectField from 'react-ions/lib/components/SelectField/SelectField'

class ExampleSelectFieldHideProp extends React.Component {
  constructor(props) {
    super(props)
  }

  state = {
    options: [
      { value: '0', display: 'test 1', notShowing: false },
      { value: '1', display: 'test 2', notShowing: true },
      { value: '2', display: 'test 3', notShowing: false }
    ],
    value: '1',
    status: ''
  }

  handleChange = event => {
    let options = this.state.options.map(option => {
      option.notShowing = option.value === event.target.value
      return option
    })

    this.setState({ value: event.target.value, status: 'Chosen option is ' + event.target.value, options })
  }

  render() {
    return (
      <SelectField
        options={this.state.options}
        valueProp='value'
        displayProp='display'
        changeCallback={this.handleChange}
        value={this.state.value}
        hideProp='notShowing'
      />
    )
  }
}

export default ExampleSelectFieldHideProp


text:
layout: article
title: "[Artwork] Portrait Design by Ashley"
date: 2017-02-17T03:14:02-04:00
modified:
categories: media
excerpt: "Lady portrait by Ashley"
tags: [Portrait]
comments: true
ads: false
image:
  feature:
  teaser: "portrait-ashley.png"
---

Lady Portrait by Ashley

Spread love with AnMa! #FeelGood #ANMA

Art Credits:

Artwork: Lady Portrait

Artist: Ashley Elizabeth Sego

Enjoy & stay connected with us!

[Facebook](https://www.facebook.com/anxietymanager/posts/1101264269995794)

[Twitter](https://twitter.com/anxiety_manager)


text:
import { goFalse, goTrue } from './values';

describe('Logic.ReturnValues', () => {
  beforeEach(() => {
  });
  it('should return logic values', () => {
    expect(goTrue()).toBe(true);
    expect(goFalse()).toBe(false);
  });
  afterEach(() => {
  });
});


text:
import logging
import re

from scality_manila_utils.exceptions import (ExportException,
                                             DeserializationException,
                                             ClientExistsException,
                                             ClientNotFoundException)

log = logging.getLogger(__name__)

class ExportTable(object):
    """
    A set of exports that can be distilled into /etc/exports.
    """
    def __init__(self, exports):
        """
        Create a new exports table from the given exports.

        :param exports: iterable of exports
        :type exports: iterable of
            :py:class:`scality_manila_utils.export.Export`
        """
        self.exports = dict(
            (export.export_point, export)
            for export in exports
        )

    def add_client(self, export_point, host, options=None):
        """
        Export a filesystem to a client.

        The export is created if it does not exist.

        :param export_point: filesystem (path) to export
        :type export_point: string (unicode)
        :param host: ip address, network or domain name
        :type host: string (unicode)
        :param options: sequence of nfs options (optional)
        :type options: iterable of strings
        """
        if options is None:
            export_options = frozenset()
        else:
            export_options = frozenset(options)

        if export_point not in self.exports:
            export = Export(export_point, {host: export_options})
            log.debug("Export created: %r", export)
        else:
            clients = self.exports[export_point].clients
            if host in clients:
                raise ClientExistsException("Client '{0:s}' is already "
                                            "defined".format(host))
            clients[host] = export_options
            export = Export(export_point, clients)
            log.debug("Export updated: %r", export)

        self.exports[export_point] = export

    def remove_client(self, export_point, host):
        """
        Remove access for a client to an export.

        The filesystem is unexported if there are no clients left.

        :param export_point: export to remove access from
        :type export_point: string (unicode)
        :param host: ip address, network or domain name for removal
        :type host: string (unicode)
        """
        if export_point not in self.exports:
            raise ClientNotFoundException("No acl defined for "
                                          "'{0:s}'".format(export_point))

        export = self.exports[export_point]
        if host not in export.clients:
            raise ClientNotFoundException("'{0:s}' has no access defined for "
                                          "'{1:s}'".format(export_point, host))

        clients = export.clients
        # If there are still clients after removal,
        # replace the export with an updated version
        if len(clients) > 1:
            del clients[host]
            self.exports[export_point] = Export(export_point, clients)
        # Otherwise remove the export
        else:
            del self.exports[export_point]

        log.debug("'%s' revoked from export '%s'", host, export_point)

    @classmethod
    def deserialize(cls, export_content):
        """
        Create an `ExportTable` from the contents of an /etc/exports file.

        Each line of the exports file will be represented by a
        :py:class:`scality_manila_utils.exports.Export`. Lines consisting of
        whitespace only or that are comments will be ignored.

        :param export_content: exports file contents split into a list of
            strings
        :type export_content: list of strings
        :returns: a :py:class`scality_manila_utils.exports.ExportTable` object
            with the exported filesystems
        """
        def strip_comment(line):
            export, _, _ = line.partition('#')
            return export

        def is_blank(line):
            stripped = line.strip()
            return stripped == '' or stripped.startswith('#')

        return cls(
            Export.deserialize(strip_comment(line))
            for line in export_content
            if not is_blank(line)
        )

    def serialize(self):
        """
        Serialize the `ExportTable` to a string following /etc/exports format.

        :returns: string representation of the exports
        """
        return '\n'.join(
            export.serialize() for export in self.exports.values()
        ) + '\n'

    def __eq__(self, other):
        if not isinstance(other, ExportTable):
            return NotImplemented

        return self.exports == other.exports

    def __ne__(self, other):
        eq = self.__eq__(other)

        if isinstance(eq, bool):
            return not eq
        else:
            return NotImplemented

    def __repr__(self):
        exports = (repr(export) for export in self.exports.values())
        return "ExportTable([{0:s}])".format(", ".join(exports))

    def __getitem__(self, key):
        return self.exports[key]

    def __contains__(self, item):
        return item in self.exports

class Export(object):
    """
    Represents an exported filesystem, i.e. a single line in /etc/exports.
    """
    __slots__ = ('export_point', 'clients')

    # Naive pattern, matching anything similar to an ip, hostname with wildcard
    # combinations followed by optional mount options
    CLIENT_PATTERN = re.compile(
        r'^(?P<host>[a-z0-9*.-/]+)([(](?P<options>.+)[)])?$'
    )

    def __init__(self, export_point, clients):
        """
        :param export_point: the export point or filesystem
        :type export_point: string (unicode)
        :param clients: a mapping from hostname/network to a set of export
            options
        :type clients: dict
        """
        # Exported filesystem
        self.export_point = export_point

        # Hosts, networks allowed to mount the filesystem and corresponding
        # export options
        if not clients:
            raise ExportException('An export must have at least one client')
        self.clients = clients

    @classmethod
    def deserialize(cls, line):
        """
        Deserialize a line of an /etc/exports file.

        A line contains an export point and a whitespace-separated list of
        clients allowed to mount the file system at that point;
            <export> <host1>(<options>) <host2>(<options>)...

        :param line: a line in /etc/exports format
        :type line: string (unicode)
        :returns: :py:class:`scality_manila_utils.export.Export` instance
        """
        def client_extract(client):
            match = cls.CLIENT_PATTERN.match(client)
            if match is None:
                msg = "Unable to parse client from {0:s}".format(client)
                raise DeserializationException(msg)

            host = match.group('host')
            option_list = match.group('options')
            if option_list is None:
                options = frozenset()
            else:
                options = frozenset(option_list.split(','))
            return host, options

        export_parts = line.split()

        if len(export_parts) < 2:
            msg = "'{0:s}' is not a valid export line".format(line)
            raise DeserializationException(msg)

        export_point = export_parts[0]
        clients = dict(map(client_extract, export_parts[1:]))
        return cls(export_point, clients)

    def serialize(self):
        """
        Serialize this `Export` to an /etc/exports representation.

        :returns: a string in /etc/exports format
        """
        clients = ''
        for host, options in self.clients.items():
            clients += ' ' + host
            if options:
                clients += '({0:s})'.format(','.join(options))

        # Attempt to align clients by padding with space up to col32
        export_line = '{export_point:<32s} {clients:s}'.format(
            export_point=self.export_point,
            clients=clients,
        )
        return export_line

    def __eq__(self, other):
        if not isinstance(other, Export):
            return NotImplemented

        return (self.export_point == other.export_point and
                self.clients == other.clients)

    def __ne__(self, other):
        eq = self.__eq__(other)

        if isinstance(eq, bool):
            return not eq
        else:
            return NotImplemented

    def __repr__(self):
        return "Export(export_point='{0:s}', clients={1!s})".format(
            self.export_point, self.clients
        )


text:
class Logger
  module Metadata
    VERSION = '0.1.1'.freeze
  end
end


text: <meta http-equiv="refresh" content="0; url=Memory.html#addressable%20memory%20unit">


text:
.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";line-height:0;}
.clearfix:after{clear:both;}
.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;}
.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}
.alert{padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
.alert,.alert h4{color:#c09853;}
.alert h4{margin:0;}
.alert .close{position:relative;top:-2px;right:-21px;line-height:20px;}
.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#468847;}
.alert-success h4{color:#468847;}
.alert-danger,.alert-error{background-color:#f2dede;border-color:#eed3d7;color:#b94a48;}
.alert-danger h4,.alert-error h4{color:#b94a48;}
.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#3a87ad;}
.alert-info h4{color:#3a87ad;}
.alert-block{padding-top:14px;padding-bottom:14px;}
.alert-block>p,.alert-block>ul{margin-bottom:0;}
.alert-block p+p{margin-top:5px;}


text:
import { Routes } from '@angular/router';

import { LoginRoutes } from './login/login.routes';
import { SignupRoutes } from './signup/signup.routes';
import { DashboardRoutes } from './dashboard/dashboard.routes';

import { LoginComponent } from './login/index';

export const routes: Routes = [
  ...LoginRoutes,
  ...SignupRoutes,
  ...DashboardRoutes,
  { path: '**', component: LoginComponent }
];


text:
namespace TankLevels.Demo
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading;
    using Entities;

    /// <summary>
    /// A dummy <see cref="ITank"/> implementation.
    /// </summary>
    public class OtherDummyTank : ITank
    {
        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="OtherDummyTank" /> class.
        /// </summary>
        /// <param name="minLimit">The minimum allowed quantity for the tank.</param>
        /// <param name="maxLimit">The maximum allowed quantity for the tank.</param>
        public OtherDummyTank(double minLimit = double.MinValue, double maxLimit = double.MaxValue)
        {
            MinLimit = minLimit;
            MaxLimit = maxLimit;
        }
        #endregion

        #region ITank Members

        /// <inheritdoc/>
        public double MinLimit { get; private set; }

        /// <inheritdoc/>
        public double MaxLimit { get; private set; }

        /// <summary>
        /// Checks a hypothetical put or take away operation against remaining between the min and max constraints.
        /// </summary>
        /// <param name="startTime">The possible earlier start time of the operation.</param>
        /// <param name="duration">The duration of the operation.</param>
        /// <param name="quantity">The quantity to put or take away. Positive values represent a put operation while negative values are take aways.</param>
        /// <param name="tankLevels">Tank levels are a serie of time/level pairs, and represent the Tank's level over the time.</param>
        /// <returns>CheckOperationResult.</returns>
        public CheckOperationResult CheckOperation(DateTime startTime, TimeSpan duration, double quantity, IEnumerable<TankLevel> tankLevels)
        {
            // This dummy code. You can safely delete it and write something real instead.
            Thread.Sleep(tankLevels.Count() / 5000);
            return new CheckOperationResult(startTime.AddSeconds(1000));
        }

        #endregion
    }
}