text:
from agixml import Attribute, Tag, present_attribute

class DataFeeder(object):
    """Abstract class, with the responsibility to generate the data that should be used to fill
       a website_details element.
       It allows decoupling the value generation from the actual filling operation.
    """
    pass

    def get_value(self):
        raise NotImplementedError

class DummyDataFeeder(DataFeeder):
    """The simplest kind of 'DataFeeder' : feed a value given at the object construction.
    """
    def __init__(self, value):
        self._value = value

    def get_value(self):
        return self._value

class DomDataFeeder(DataFeeder):
    """A DataFeeder specialization for values found in a data DOM.
       Those data DOM list different values inside different tag pairs,
       whose tagname describe the content.
       Site agnostic content is found as a text element at first level inside the tag pairs.
       Site specific content is enclose in an extra tag pair whose tagname is the website_detail name.
    """

    def __init__(self, website_name, map_element, data_dom):
        """Ctor
           :param map_element: is the xml relation_element. In addition to a relation_element,
                               it contains a child text element giving the name of the tag
                               containing the data (in data_dom).
           :param data_dom: the xml document listing the different fields value
                            inside separate tag pairs.
        """
        self.data_dom = data_dom
        self._field_tag = map_element.firstChild.nodeValue
        self._field_proper = present_attribute(map_element, Attribute.PROPER)
        self._field_element = None
        self._website_name = website_name

    def get_tagname(self):
        """ Returns the tagname from data_dom associated to the pointed Web element"""
        return self._field_tag

    def get_value(self):
        """ Current value associated to the Web element (as found in the data DOM)"""
        self._get_field_element()
        if self._field_element:
            return self._field_element.firstChild.nodeValue
        else:
            return None

    def set_value(self, newValue):
        """ Update/Create the value in the data DOM"""
        self._get_field_element(create=True)

        text_value_node = self._field_element.firstChild
        if text_value_node:
            text_value_node.nodeValue = newValue
        else:
            text_value_node = self.data_dom.createTextNode(newValue)
            self._field_element.appendChild(text_value_node)

    # \todo : delete
    # def get_type(self):
    #     """ Type of the Web element"""
    #     return self._web_type

    def _get_field_element(self, create=False):
        """Private method to get, and eventually create,
           the element from the data DOM that is pointed by map_element.
           It is responsible for implementing correct site agnostic / site specific data look-up.
        """
        # /todo : rework logic
        if not self._field_element:
            ad_element = self.data_dom.getElementsByTagName(Tag.ADVERTISEMENT)[0]
            try:
                general_element = self.data_dom.getElementsByTagName(self._field_tag)[0]
            except IndexError:
                if not create:
                    return
                general_element = self.data_dom.createElement(self._field_tag)
                ad_element.appendChild(general_element)

            if not self._field_proper:
                self._field_element = general_element
                return

            try:
                proper_element = general_element.getElementsByTagName(self._website_name)[0]
            except IndexError:
                if not create:
                    return
                proper_element = self.data_dom.createElement(self._website_name)
                general_element.appendChild(proper_element)

            self._field_element = proper_element


text:
@interface ADSR : TDGenerator {
    @public
    BOOL _gateOpen;
}

// all times assume a sample rate of 44100
@property (nonatomic, readwrite) NSTimeInterval attackT;
@property (nonatomic, readwrite) NSTimeInterval decayT;
@property (nonatomic, readwrite) float sustain;
@property (nonatomic, readwrite) NSTimeInterval releaseT;

@property (nonatomic, readwrite) BOOL gateOpen; // i.e., user is holding a key down

+ (instancetype)ADSRWithAttack:(NSTimeInterval)attack
                                decay:(NSTimeInterval)decay
                              sustain:(float)sustain
                       release:(NSTimeInterval)release;

@end

redpajama_set_name: RedPajamaGithub


text:
const BFLuaClass luaPaintClass = {
    .metatableName = BFPaintClassName,
    .methods = {
        {NULL, NULL}
    }
};


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:c="http://www.springframework.org/schema/c" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:util="http://www.springframework.org/schema/util" xmlns:mybatis-spring="http://mybatis.org/schema/mybatis-spring"
	xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
		http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
		http://mybatis.org/schema/mybatis-spring http://mybatis.org/schema/mybatis-spring-1.2.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">

	<!-- <context:property-placeholder file-encoding="UTF-8" location="classpath:mybatis-db-config.properties" /> -->

	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
		<property name="locations">
			<value>classpath:mybatis-db-config.properties</value>
		</property>
	</bean>

	<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
		<property name="driverClassName" value="${driver}" />
		<property name="url" value="${url}" />
		<property name="username" value="${username}" />
		<property name="password" value="${password}" />
	</bean>

	<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="configLocation" value="classpath:mybatis-config.xml" />
		<property name="mapperLocations" value="classpath:mappers/*.xml" />
	</bean>

	<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
		<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
		<property name="basePackage" value="com.github.ckwen.je.spring.mybatis.mapper" />
	</bean>

	<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
		<property name="dataSource" ref="dataSource" />
	</bean>
</beans>


text:
#if TOMIGRATE // To Newtonsoft Json
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JsonExSerializer.MetaData.Attributes;
using JsonExSerializer.MetaData;
using System.Reflection;
using JsonExSerializer;
using System.ComponentModel;
using System.Collections;

namespace LionFire.Serialization.JsonEx
{
    public class DefaultValueProcessor : AttributeProcessor
    {
        public LionSerializeContext DefaultValueContexts = LionSerializeContext.All;

        public override void Process(IMetaData metaData, ICustomAttributeProvider attributeProvider, IConfiguration config)
        {
            if (metaData is IPropertyData)
            {
                IPropertyData property = (IPropertyData)metaData;
                if (attributeProvider.IsDefined(typeof(DefaultValueAttribute), false))
                {
                    var attrs = attributeProvider.GetCustomAttributes(typeof(DefaultValueAttribute), false);

                    foreach (object ax in attrs)
                    {
                        DefaultValueAttribute attr = ax as DefaultValueAttribute;
                        if (attr == null) continue;
//                        if (property.PropertyType.IsGenericType &&
//property.PropertyType.GetGenericTypeDefinition() == typeof(Nullable<>))
//                        {
//                            //Type type = property.PropertyType.GetGenericArguments()[0];
//                            //var converter = new NullableConverter(property.PropertyType);
//                            //object converted = Convert.ChangeType(attr.Value, property.PropertyType);
//                            object converted = Activator.CreateInstance(property.PropertyType, attr.Value);

//                            //object converted = converter.ConvertFrom(attr.Value);
//                            property.DefaultValue = converted;
//                            //property.DefaultValue = converter(attr.Value, property.PropertyType);
//                        }
//                        else
                        {
                            property.DefaultValue = attr.Value;
                        }
                        break;
                    }
                }
            }
        }
    }
}

#endif


text:
package org.wso2.carbon.apimgt.rest.api.publisher.dto;

import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Objects;

/**
 * SequenceDTO
 */
public class SequenceDTO   {
  @SerializedName("name")
  private String name = null;

  @SerializedName("config")
  private String config = null;

  @SerializedName("type")
  private String type = null;

  public SequenceDTO name(String name) {
    this.name = name;
    return this;
  }

   /**
   * Get name
   * @return name
  **/
  @ApiModelProperty(example = "log_in_message", required = true, value = "")
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public SequenceDTO config(String config) {
    this.config = config;
    return this;
  }

   /**
   * Get config
   * @return config
  **/
  @ApiModelProperty(example = "", value = "")
  public String getConfig() {
    return config;
  }

  public void setConfig(String config) {
    this.config = config;
  }

  public SequenceDTO type(String type) {
    this.type = type;
    return this;
  }

   /**
   * Get type
   * @return type
  **/
  @ApiModelProperty(example = "in", value = "")
  public String getType() {
    return type;
  }

  public void setType(String type) {
    this.type = type;
  }

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SequenceDTO sequence = (SequenceDTO) o;
    return Objects.equals(this.name, sequence.name) &&
        Objects.equals(this.config, sequence.config) &&
        Objects.equals(this.type, sequence.type);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, config, type);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class SequenceDTO {\n");

    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    config: ").append(toIndentedString(config)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}


text:
<?php

 Namespace Skytells\Handlers;
  Class Cookies {

    public static function instance() {
        return new Cookies();
      }
    function __construct() { }

    public static function set($Key, $Val, $time, $path = "/") {

        global $_COOKIE;
        if ($path == null){
        setcookie($Key, $Val, $time);
        }else{
          setcookie($Key, $Val, $time, $path);
        }
        return true;
    }

    public static function get($Key, $Protection = true) {
      global $_COOKIES; global $_COOKIE; global $db;
      if (!isset($_COOKIE) || empty($_COOKIE)) { return false; }
      if (!isset($_COOKIE[$Key]) || empty($_COOKIE[$Key])) { return false; }
      $Val = $_COOKIE[$Key];
        if ($Protection == true) {
        $Val = htmlspecialchars($Val, ENT_QUOTES, 'UTF-8');
          if (is_object($db) && get_class($db) == 'mysqli' && property_exists($db, 'real_escape_string')) {
             $Val = $db->real_escape_string($Val);
          }
        }
      return $Val;
    }

  }


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Homebackground_model extends CI_Model {

	function __construct(){
		// Call the Model constructor
		parent::__construct();
		$this->load->model('helper/helper_model');
	}

	public function getMapcount()
	{
		return $this->db->query("SELECT COUNT(homepage_id) as cnt from homepage_background")->result_array();
	}

	public function maplisting($limit)
	{
		return $this->db->query("SELECT hm.*,c.cust_first_name,c.cust_last_name, l.layout_name FROM homepage_background hm,customer_master c, layout_table l WHERE hm.layout_id=l.layout_id AND c.cust_id=hm.cust_id LIMIT $limit")->result_array();
	}

}


text:
<?php
namespace CodeGen;

use Exception;

class CommentBlock extends Block implements Renderable
{
    public function render(array $args = array())
    {
        $tab = Indenter::indent($this->indentLevel);
        $body = '';

        $body .= $tab . "/**\n";

        foreach ($this->lines as $line) {
            if (is_string($line)) {
                $body .= $tab . ' * ' . $line . "\n";
            } else if ($line instanceof Renderable) {
                $subbody = rtrim($line->render()); // trim the trailing white-space
                $sublines = explode("\n", $subbody);
                foreach ($sublines as $subline) {
                    $body .= $tab . ' * ' . $subline . "\n";
                }
            } else {
                throw new Exception('Unsupported line object.');
            }
        }
        $body .= " */\n";
        return Utils::renderStringTemplate($body, array_merge($this->args, $args));
    }

}


text:
import gc
import logging
import weakref

import numpy as np

import pytest

import ray
import ray.cluster_utils
from ray.test_utils import wait_for_condition
from ray.internal.internal_api import global_gc

logger = logging.getLogger(__name__)

def test_auto_local_gc(shutdown_only):
    ray.init(
        num_cpus=2,
        _system_config={
            "local_gc_interval_s": 10,
            "local_gc_min_interval_s": 5,
            "global_gc_min_interval_s": 10
        })

    class ObjectWithCyclicRef:
        def __init__(self):
            self.loop = self

    @ray.remote(num_cpus=1)
    class GarbageHolder:
        def __init__(self):
            gc.disable()
            x = ObjectWithCyclicRef()
            self.garbage = weakref.ref(x)

        def has_garbage(self):
            return self.garbage() is not None

    try:
        gc.disable()

        # Local driver.
        local_ref = weakref.ref(ObjectWithCyclicRef())

        # Remote workers.
        actors = [GarbageHolder.remote() for _ in range(2)]
        assert local_ref() is not None
        assert all(ray.get([a.has_garbage.remote() for a in actors]))

        def check_refs_gced():
            return (local_ref() is None and
                    not any(ray.get([a.has_garbage.remote() for a in actors])))

        wait_for_condition(check_refs_gced)
    finally:
        gc.enable()

def test_global_gc(shutdown_only):
    cluster = ray.cluster_utils.Cluster()
    cluster.add_node(
        num_cpus=1,
        num_gpus=0,
        _system_config={
            "local_gc_interval_s": 10,
            "local_gc_min_interval_s": 5,
            "global_gc_min_interval_s": 10
        })
    cluster.add_node(num_cpus=1, num_gpus=0)
    ray.init(address=cluster.address)

    class ObjectWithCyclicRef:
        def __init__(self):
            self.loop = self

    @ray.remote(num_cpus=1)
    class GarbageHolder:
        def __init__(self):
            gc.disable()
            x = ObjectWithCyclicRef()
            self.garbage = weakref.ref(x)

        def has_garbage(self):
            return self.garbage() is not None

    try:
        gc.disable()

        # Local driver.
        local_ref = weakref.ref(ObjectWithCyclicRef())

        # Remote workers.
        actors = [GarbageHolder.remote() for _ in range(2)]
        assert local_ref() is not None
        assert all(ray.get([a.has_garbage.remote() for a in actors]))

        # GC should be triggered for all workers, including the local driver.
        global_gc()

        def check_refs_gced():
            return (local_ref() is None and
                    not any(ray.get([a.has_garbage.remote() for a in actors])))

        wait_for_condition(check_refs_gced, timeout=30)
    finally:
        gc.enable()

def test_global_gc_when_full(shutdown_only):
    cluster = ray.cluster_utils.Cluster()
    for _ in range(2):
        cluster.add_node(
            num_cpus=1, num_gpus=0, object_store_memory=100 * 1024 * 1024)
    ray.init(address=cluster.address)

    class LargeObjectWithCyclicRef:
        def __init__(self):
            self.loop = self
            self.large_object = ray.put(
                np.zeros(20 * 1024 * 1024, dtype=np.uint8))

    @ray.remote(num_cpus=1)
    class GarbageHolder:
        def __init__(self):
            gc.disable()
            x = LargeObjectWithCyclicRef()
            self.garbage = weakref.ref(x)

        def has_garbage(self):
            return self.garbage() is not None

        def return_large_array(self):
            return np.zeros(60 * 1024 * 1024, dtype=np.uint8)

    try:
        gc.disable()

        # Local driver.
        # 20MB
        local_ref = weakref.ref(LargeObjectWithCyclicRef())

        # Remote workers.
        # 20MB * 2
        actors = [GarbageHolder.remote() for _ in range(2)]
        assert local_ref() is not None
        assert all(ray.get([a.has_garbage.remote() for a in actors]))

        # GC should be triggered for all workers, including the local driver,
        # when the driver tries to ray.put a value that doesn't fit in the
        # object store. This should cause the captured ObjectRefs' numpy arrays
        # to be evicted.
        ray.put(np.zeros(80 * 1024 * 1024, dtype=np.uint8))

        def check_refs_gced():
            return (local_ref() is None and
                    not any(ray.get([a.has_garbage.remote() for a in actors])))

        wait_for_condition(check_refs_gced)

        # Local driver.
        local_ref = weakref.ref(LargeObjectWithCyclicRef())

        # Remote workers.
        actors = [GarbageHolder.remote() for _ in range(2)]
        assert all(ray.get([a.has_garbage.remote() for a in actors]))

        # GC should be triggered for all workers, including the local driver,
        # when a remote task tries to put a return value that doesn't fit in
        # the object store. This should cause the captured ObjectRefs' numpy
        # arrays to be evicted.
        ray.get(actors[0].return_large_array.remote())

        def check_refs_gced():
            return (local_ref() is None and
                    not any(ray.get([a.has_garbage.remote() for a in actors])))

        wait_for_condition(check_refs_gced)
    finally:
        gc.enable()

def test_global_gc_actors(shutdown_only):
    ray.init(
        num_cpus=1, _system_config={"debug_dump_period_milliseconds": 500})

    try:
        gc.disable()

        @ray.remote(num_cpus=1)
        class A:
            def f(self):
                return "Ok"

        # Try creating 3 actors. Unless python GC is triggered to break
        # reference cycles, this won't be possible.
        for i in range(3):
            a = A.remote()
            cycle = [a]
            cycle.append(cycle)
            ray.get(a.f.remote())
            print("iteration", i)
            del a
            del cycle
    finally:
        gc.enable()

if __name__ == "__main__":
    import sys
    sys.exit(pytest.main(["-v", __file__]))


text:
package shell

import (
	"encoding/base64"
	"fmt"
	"os"

	"golang.org/x/text/encoding/unicode"

	"github.com/juju/errors"
	"github.com/juju/utils"
)

// PowershellRenderer is a shell renderer for Windows Powershell.
type PowershellRenderer struct {
	windowsRenderer
}

// Quote implements Renderer.
func (pr *PowershellRenderer) Quote(str string) string {
	return utils.WinPSQuote(str)
}

// Chmod implements Renderer.
func (pr *PowershellRenderer) Chmod(path string, perm os.FileMode) []string {
	// TODO(ericsnow) Is this necessary? Should we use Set-Acl?
	return nil
}

// WriteFile implements Renderer.
func (pr *PowershellRenderer) WriteFile(filename string, data []byte) []string {
	filename = pr.Quote(filename)
	return []string{
		fmt.Sprintf("Set-Content %s @\"\n%s\n\"@", filename, data),
	}
}

// MkDir implements Renderer.
func (pr *PowershellRenderer) Mkdir(dirname string) []string {
	dirname = pr.FromSlash(dirname)
	return []string{
		fmt.Sprintf(`mkdir %s`, pr.Quote(dirname)),
	}
}

// MkdirAll implements Renderer.
func (pr *PowershellRenderer) MkdirAll(dirname string) []string {
	return pr.Mkdir(dirname)
}

// ScriptFilename implements ScriptWriter.
func (pr *PowershellRenderer) ScriptFilename(name, dirname string) string {
	return pr.Join(dirname, name+".ps1")
}

// By default, winrm executes command usind cmd. Prefix the command we send over WinRM with powershell.exe.
// the powershell.exe it's a program that will execute the "%s" encoded command.
// A breakdown of the parameters:
//    -NonInteractive - prevent any prompts from stopping the execution of the scrips
//    -ExecutionPolicy - sets the execution policy for the current command, regardless of the default ExecutionPolicy on the system.
//    -EncodedCommand - allows us to run a base64 encoded script. This spares us from having to quote/escape shell special characters.
const psRemoteWrapper = "powershell.exe -Sta -NonInteractive -ExecutionPolicy RemoteSigned -EncodedCommand %s"

// newEncodedPSScript returns a UTF16-LE, base64 encoded script.
// The -EncodedCommand parameter expects this encoding for any base64 script we send over.
func newEncodedPSScript(script string) (string, error) {
	uni := unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM)
	encoded, err := uni.NewEncoder().String(script)
	if err != nil {
		return "", err
	}

	return base64.StdEncoding.EncodeToString([]byte(encoded)), nil
}

// NewPSEncodedCommand converts the given string to a UTF16-LE, base64 encoded string,
// suitable for execution using powershell.exe -EncodedCommand. This can be used on
// local systems, as well as remote systems via WinRM.
func NewPSEncodedCommand(script string) (string, error) {
	var err error
	script, err = newEncodedPSScript(script)
	if err != nil {
		return "", errors.Annotatef(err, "Cannot construct powershell command for remote execution")
	}

	return fmt.Sprintf(psRemoteWrapper, script), nil
}


text:
package com.intellij.codeInsight.daemon.quickFix;

/**
 * @author cdr
 */
public abstract class ChangeMethodSignatureFromUsageTest extends LightQuickFix15TestCase {

  public void test() throws Exception { doAllTests(); }

  @Override
  protected String getBasePath() {
    return "/codeInsight/daemonCodeAnalyzer/quickFix/changeMethodSignatureFromUsage";
  }
}


text:
package it.francescosantagati.jam;

/**
 * Exception that can be thrown during the normal execution of a {@link JAMBehaviour} thread.
 *
 * @author Francesco Santagati
 */
public class JAMBehaviourInterruptedException extends InterruptedException {
}


text:
package java.util;

/**
 * A Dictionary maps keys to values; how it does that is
 * implementation-specific.
 *
 * This is an abstract class which has really gone by the wayside.
 * People at Javasoft are probably embarrassed by it.  At this point,
 * it might as well be an interface rather than a class, but it remains
 * this poor, laughable skeleton for the sake of backwards compatibility.
 * At any rate, this was what came before the {@link Map} interface
 * in the Collections framework.
 *
 * @author Jon Zeppieri
 * @author Eric Blake (ebb9@email.byu.edu)
 * @see Map
 * @see Hashtable
 * @since 1.0
 * @status updated to 1.4
 */
public abstract class Dictionary
{
  // WARNING: Dictionary is a CORE class in the bootstrap cycle. See the
  // comments in vm/reference/java/lang/Runtime for implications of this fact.

  /**
   * Sole constructor (often called implicitly).
   */
  public Dictionary()
  {
  }

  /**
   * Returns an Enumeration of the values in this Dictionary.
   *
   * @return an Enumeration of the values
   * @see #keys()
   */
  public abstract Enumeration elements();

  /**
   * Returns the value associated with the supplied key, or null
   * if no such value exists. Since Dictionaries are not allowed null keys
   * or elements, a null result always means the key is not present.
   *
   * @param key the key to use to fetch the value
   * @return the mapped value
   * @throws NullPointerException if key is null
   * @see #put(Object, Object)
   */
  public abstract Object get(Object key);

  /**
   * Returns true when there are no elements in this Dictionary.
   *
   * @return size() == 0
   */
  public abstract boolean isEmpty();

  /**
   * Returns an Enumeration of the keys in this Dictionary
   *
   * @return an Enumeration of the keys
   * @see #elements()
   */
  public abstract Enumeration keys();

  /**
   * Inserts a new value into this Dictionary, located by the
   * supplied key. Dictionary does not support null keys or values, so
   * a null return can safely be interpreted as adding a new key.
   *
   * @param key the key which locates the value
   * @param value the value to put into the Dictionary
   * @return the previous value of the key, or null if there was none
   * @throws NullPointerException if key or value is null
   * @see #get(Object)
   */
  public abstract Object put(Object key, Object value);

  /**
   * Removes from the Dictionary the value located by the given key. A null
   * return safely means that the key was not mapped in the Dictionary.
   *
   * @param key the key used to locate the value to be removed
   * @return the value associated with the removed key
   * @throws NullPointerException if key is null
   */
  public abstract Object remove(Object key);

  /**
   * Returns the number of values currently in this Dictionary.
   *
   * @return the number of keys in the Dictionary
   */
  public abstract int size();
} // class Dictionary


text:
swig-sandbox
============

Repo containing code for tinkering with SWIG.


text:
package com.leacox.sandbox.runtime.simple;

import java.lang.reflect.Method;

/**
 * A runner that is allowed setAccessible permission because the Foo class is from the same code
 * source as the runner.
 *
 * @author John Leacox
 */
public class AllowedRunner implements Runnable {
  @Override
  public void run() {
    Foo foo = new Foo();

    String methodName = "inAccessibleMethod";

    try {
      Method method = foo.getClass().getDeclaredMethod(methodName);
      method.setAccessible(true);
      method.invoke(foo);
    } catch (Exception e) {
      System.out.println(e);
      throw new RuntimeException(e);
    }
  }
}


text:
var chai = require('chai');
var sinon = require('sinon');

global.expect = chai.expect;

beforeEach(function () {
  this.sandbox = sinon.sandbox.create();
});

afterEach(function () {
  this.sandbox.restore();
});


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Ads_model extends CI_Model {

	public $variable;

	public function __construct()
	{
		parent::__construct();
	}

	// get list of ads
	public function get_list($filter,$offset)
	{
		// set state filter
		if(isset($filter['state']) && $filter['state'] != '' && $filter['state'] != '0' && $filter['state'] !== 0 ){
			$state = $this->security->xss_clean($filter['state']);
			$this->db->where('state_',$state);
		}

		// set cat filter
		if(isset($filter['cat'][0])){
			$cat = $this->security->xss_clean($filter['cat']);
			$this->db->where_in('ads.cat_',$cat);
		}

		// set title or description filter
		if(isset($filter['keyword']) && $filter['keyword'] != '' && $filter['keyword'] != '0' && $filter['keyword'] !== 0 ){
			$keyword = $this->security->xss_clean($filter['keyword']);
			$this->db->like('ads.title',$keyword);
			$this->db->or_like('ads.description',$keyword);
		}

		$this->db->select('
			ads.id as ads_id,
			ads_pics.id as pic_id,
			ads_pics.subdate as pic_subdate,
			title,
			ads.subdate as ads_subdate,
			ads.price,
			ads.cat_pic,
			ads_pics.pic as pic');
		$this->db->join('ads_pics','ads.id = ads_pics.ads_','left');
		$this->db->order_by('ads.subdate desc');
		$this->db->limit(30,$filter['offset']);

		return $this->db->get('ads')->result_array();
	}

	// get cat fields for check in add action ot others
	public function get_catFields($cat)
	{
		$cat = $this->security->xss_clean($cat);
		$this->db->where('cat_' , $cat);
		return $this->db->get('cat_fields')->result_array();
	}

	public function add($post)
	{
		$data = array(
			'user_' => $post['uid'],
			'name' => $this->security->xss_clean($post['name']),
			'email' => $this->security->xss_clean($post['email']),
			'phone' => $this->security->xss_clean($post['phone']),
			'state_' => $this->security->xss_clean($post['state']),
			'city_' => $this->security->xss_clean($post['city']),
			'street' => $this->security->xss_clean($post['street']),
			'cat_' => $this->security->xss_clean($post['cat']),
			'title' => $this->security->xss_clean($post['title']),
			'hashkey' => $this->security->xss_clean($post['hashkey']),
			'description' => $this->security->xss_clean($post['description']),
			'price' => $this->security->xss_clean($post['price']),
			'cat_pic' => $post['cat_pic']
			);
		$this->db->insert('ads',$data);
		return $this->db->insert_id();
	}

	// add custom fileds of ads
	public function add_fields($data)
	{
		return $this->db->insert_batch('fields_value',$data);
	}

	// add ads pics
	public function add_pics($data)
	{
		return $this->db->insert_batch('ads_pics',$data);
	}

	// get ads detail
	public function get_detail($id)
	{
		$this->db->select('
			ads.*,
			state.title as state_title,
			city.title as city_title,
			type_slave.title as cat_title
			');
		$this->db->where('ads.id',$id);
		$this->db->join('state','state.id = ads.state_' ,'left');
		$this->db->join('city','city.id = ads.city_' ,'left');
		$this->db->join('type_slave','type_slave.id = ads.cat_' ,'left');
		$data['info'] = $this->db->get('ads')->row_array();

		$this->db->select('
			fields_value.*,
			type_slave.title as field_title,
			');
		$this->db->where('fields_value.ads_',$id);
		$this->db->join('type_slave','type_slave.id = fields_value.field_' ,'left');
		$data['fields'] = $this->db->get('fields_value')->result_array();

		$this->db->where('ads_',$id);
		$data['pics'] = $this->db->get('ads_pics')->result_array();

		return $data;

	}

	// get ads pics
	public function get_adsPics($id)
	{
		$this->db->where('ads_',$id);
		return $this->db->get('ads_pics')->result_array();
	}

	// get ads pics
	public function get_pic($id)
	{
		$this->db->where('id',$id);
		return $this->db->get('ads_pics')->row_array();
	}

	// get ads owner (user_)
	public function get_adsOwner($id)
	{
		$this->db->select('user_');
		$this->db->where('id',$id);
		return $this->db->get('ads')->row_array();
	}

	// delete ads
	public function delete($id,$uid)
	{
		// delete static row
		//$this->db->where('user_',$uid);
		$this->db->where('id',$id);
		$this->db->delete('ads');

		// delete custom fields
		$this->db->where('ads_',$id);
		$this->db->delete('fields_value');

		// delete pics
		$this->db->where('ads_',$id);
		$this->db->delete('ads_pics');
	}

	// delete pic
	public function delete_pic($id)
	{
		$this->db->where('id',$id);
		$this->db->delete('ads_pics');
	}

	// delete custom fields
	public function delete_customFields($id)
	{
		$this->db->where('ads_',$id);
		$this->db->delete('fields_value');
	}

	public function update($post)
	{
		$id = $this->security->xss_clean($post['id']);
		$data = array(
			'name' => $this->security->xss_clean($post['name']),
			'phone' => $this->security->xss_clean($post['phone']),
			'state_' => $this->security->xss_clean($post['state']),
			'city_' => $this->security->xss_clean($post['city']),
			'street' => $this->security->xss_clean($post['street']),
			'cat_' => $this->security->xss_clean($post['cat']),
			'title' => $this->security->xss_clean($post['title']),
			'description' => $this->security->xss_clean($post['description']),
			'cat_pic' => $post['cat_pic'],
			'status' => 0
			);
		$this->db->where('id',$id);
		//$this->db->where('user_',$uid);
		return $this->db->update('ads',$data);
	}

	// get list of ads
	public function get_related($filter)
	{
		// set state filter
		$state = $filter['state'];
		$this->db->where('state_',$state);

		// set city filter
		$city = $filter['city'];
		$this->db->where('city_',$city);

		// set cat filter
		$cat = $filter['cat'];
		$this->db->where('cat_',$cat);

		$id = $filter['id'];
		$this->db->where('ads.id !=',$id);

		$this->db->select('
			ads.id as ads_id,
			ads_pics.id as pic_id,
			title,
			ads.subdate as ads_subdate,
			ads.price,
			ads_pics.pic as pic');
		$this->db->join('ads_pics','ads.id = ads_pics.ads_','left');
		$this->db->order_by('ads.subdate desc');
		$this->db->limit(5,0);

		return $this->db->get('ads')->result_array();
	}

	// getting vip packs
	public function get_vipPacks($id = false){
		if($id !== false){
			$this->db->where('id',$id);
			return $this->db->get('vip_packs')->row_array();
		}
		return $this->db->get('vip_packs')->result_array();
	}

	// set ads report
	public function set_adsReport($uid,$post)
	{
		$this->db->where('user_',$uid);
		$this->db->where('ads_',$post['ads_id']);
		$this->db->delete('reports');

		$data = array(
			'user_' => $uid,
			'ads_' => $post['ads_id'],
			'type' => $post['type'],
			'msg' => $post['msg'],
			'ip' => $post['ip']
			);
		$this->db->insert('reports',$data);
		return $this->db->insert_id();
	}

}

/* End of file ads_model.php */
/* Location: ./application/models/ads_model.php */


text:
package ithinkican.MCP2515;

import ithinkican.driver.IDriver;
import ithinkican.driver.SPIChannel;
import ithinkican.driver.SPIMode;
import ithinkican.network.NetworkFunction;
import ithinkican.network.NetworkManager;
import ithinkican.util.Component;

import java.io.IOException;
import java.util.function.Supplier;

import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioFactory;
import com.pi4j.io.gpio.GpioPinDigitalInput;
import com.pi4j.io.gpio.PinState;
import com.pi4j.io.gpio.RaspiPin;
import com.pi4j.io.gpio.event.GpioPinDigitalStateChangeEvent;
import com.pi4j.io.gpio.event.GpioPinListenerDigital;
import com.pi4j.io.spi.SpiChannel;
import com.pi4j.io.spi.SpiDevice;
import com.pi4j.io.spi.SpiFactory;
import com.pi4j.io.spi.SpiMode;

public class MCP2515 implements IDriver, Component {

	private SpiDevice driver;

    private GpioController gpio = GpioFactory.getInstance();

    // provision gpio pin #02 as an input pin with its internal pull down resistor enabled
    public GpioPinDigitalInput bufferZeroInterrupt = gpio.provisionDigitalInputPin(RaspiPin.GPIO_29);

    private NetworkManager manager;

	public MCP2515(NetworkManager manager, SPIChannel channel, SPIMode mode, int speed) throws IOException {

		SpiChannel c = null;
		SpiMode m = null;

		this.manager = manager;

		switch(channel) {
			case CE0:
				c = SpiChannel.CS0;
				break;
			case CE1:
				c = SpiChannel.CS1;
				break;
		}

		switch(mode) {
			case MODE0:
				m = SpiMode.MODE_0;
				break;
			case MODE1:
				m = SpiMode.MODE_1;
				break;
			case MODE2:
				m = SpiMode.MODE_2;
				break;
			case MODE3:
				m = SpiMode.MODE_3;
				break;
		}

		driver = SpiFactory.getInstance(c, speed, m);
	}

	@Override
	public void start() {

		bufferZeroInterrupt.addListener(new GpioPinListenerDigital() {

			@Override
            public void handleGpioPinDigitalStateChangeEvent(GpioPinDigitalStateChangeEvent event) {
				// display pin state on console

				//System.out.println(" --> MESSAGE RECEIVED: " + event.getPin() + " = " + event.getState());

                if(event.getState() == PinState.LOW) {

                	//Message is in RX0
                	manager.submitRead(readBufferZero());
                }
            }
        });
	}

	@Override
	public void stop() {

		gpio.shutdown();
	}

	public Supplier<Byte[]> readBufferZero() {

		Supplier<Byte[]> supplier = new Supplier<Byte[]>() {

			@Override
			public Byte[] get() {

            	byte[] src = {(byte) 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

            	byte[] b = new byte[9];

            	try {
					b = driver.write(src);
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}

            	//clearBufferZero();

            	Byte[] buf = new Byte[8];
            	for(int i = 1; i <= 8; i++) {
            		buf[i-1] = b[i];
            	}

				return buf;
			}
		};

		return supplier;
	}

	public Supplier<Byte[]> readBufferOne() {

		Supplier<Byte[]> supplier = new Supplier<Byte[]>() {

			@Override
			public Byte[] get() {

            	byte[] src = {(byte) 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};

            	byte[] b = new byte[9];

            	try {
					b = driver.write(src);
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}

            	//clearBufferZero();

            	Byte[] buf = new Byte[8];
            	for(int i = 1; i <= 8; i++) {
            		buf[i-1] = b[i];
            	}

				return buf;
			}
		};

		return supplier;
	}

	@Override
	public NetworkFunction ack() {

		return new NetworkFunction() {

			@Override
			public void call() {

				try {
					for(int i = 0; i < MCP2515Messages.ack.length; i++) {
						driver.write(MCP2515Messages.ack[i]);
					}
				} catch (IOException e) {
					//TODO: Elevate the exception
					e.printStackTrace();
				}
			}
		};
	}

	@Override
	public NetworkFunction getStatus() {

		return new NetworkFunction() {

			@Override
			public void call() {
				try {
					for(int i = 0; i < MCP2515Messages.getStatus.length; i++) {
						driver.write(MCP2515Messages.getStatus[i]);
					}
				} catch (IOException e) {
					//TODO: Elevate the exception
					e.printStackTrace();
				}
			}
		};
	}

	@Override
	public NetworkFunction unlock() {

		return new NetworkFunction() {

			@Override
			public void call() {

				try {
					for(int i = 0; i < MCP2515Messages.unlock.length; i++) {
						driver.write(MCP2515Messages.unlock[i]);
					}
				} catch (IOException e) {
					//TODO: Elevate the exception
					e.printStackTrace();
				}

			}

		};
	}

	@Override
	public NetworkFunction lock() {

		return new NetworkFunction() {

			@Override
			public void call() {

				try {
					for(int i = 0; i < MCP2515Messages.lock.length; i++) {
						driver.write(MCP2515Messages.lock[i]);
					}
				} catch (IOException e) {
					//TODO: Elevate the exception
					e.printStackTrace();
				}
			}
		};
	}

	@Override
	public NetworkFunction enable() {

		return new NetworkFunction() {

			@Override
			public void call() {

				try {
					for(int i = 0; i < MCP2515Messages.enable.length; i++) {
						driver.write(MCP2515Messages.enable[i]);
					}
				} catch (IOException e) {
					//TODO: Elevate the exception
					e.printStackTrace();
				}

			}

		};
	}

	@Override
	public NetworkFunction disable() {

		return new NetworkFunction() {

			@Override
			public void call() {

				try {
					for(int i = 0; i < MCP2515Messages.disable.length; i++) {
						driver.write(MCP2515Messages.disable[i]);
					}
				} catch (IOException e) {
					//TODO: Elevate the exception
					e.printStackTrace();
				}

			}
		};

	}

	@Override
	public NetworkFunction getBikeID() {

		return new NetworkFunction() {

			@Override
			public void call() {

				try {
					for(int i = 0; i < MCP2515Messages.getBikeID.length; i++) {
						driver.write(MCP2515Messages.getBikeID[i]);
					}
				} catch (IOException e) {
					//TODO: Elevate the exception
					e.printStackTrace();
				}

			}

		};

	}

	@Override
	public NetworkFunction initialize() {

		return new NetworkFunction() {

			@Override
			public void call() {

				try {
					for(int i = 0; i < MCP2515Messages.initialize.length; i++) {
						driver.write(MCP2515Messages.initialize[i]);
					}
				} catch (IOException e) {
					//TODO: Elevate the exception
					e.printStackTrace();
				}

			}

		};

	}

	@Override
	public NetworkFunction reset() {

		return new NetworkFunction() {

			@Override
			public void call() {

				try {
					driver.write(MCP2515Messages.reset);
				} catch (IOException e) {
					//TODO: Elevate the exception
					e.printStackTrace();
				}

			}

		};

	}

	@Override
	public NetworkFunction readyToSend() {

		return new NetworkFunction() {

			@Override
			public void call() {
				try {
					for(int i = 0; i < MCP2515Messages.readyToSend.length; i++) {
						driver.write(MCP2515Messages.readyToSend[i]);
					}
				} catch (IOException e) {

					e.printStackTrace();
				}

			}
		};
	}

	//NOT CURRENTly IN AN INTERFACE
	public byte[] readByte(int address) {

		byte[] msg = {(byte) 0x03, (byte) address, (byte) 0xDF};

		byte [] bs = null;

		try {
			bs = driver.write(msg);
		} catch (IOException e) {
			e.printStackTrace();
		}
		return bs;
	}

	public void clearBufferZero() {

		byte [] msg = {0x05, 0x2C, (byte) 0x01, 0x00};

		try {
			driver.write(msg);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public void clearBufferOne() {

		byte [] msg = {(byte) 0x05, (byte) 0x2C, (byte) 0x02, (byte) 0x00};

		try {
			driver.write(msg);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}


text:
package org.apache.mina.service.executor;

import org.apache.mina.api.IoSession;

/**
 * An {@link IoSession} sent a message {@link Event}
 *
 * @author Apache MINA Project
 */
public class SentEvent implements Event {
    private final IoSession session;

    private final Object message;

    public SentEvent(final IoSession session, final Object message) {
        this.session = session;
        this.message = message;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public IoSession getSession() {
        return session;
    }

    public Object getMessage() {
        return message;
    }

    @Override
    public void visit(EventVisitor visitor) {
        visitor.visit(this);
    }
}


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

[assembly: AssemblyTitle("Xpressive.Home.Service")]
[assembly: AssemblyDescription("")]

[assembly: Guid("3e96c478-c4b1-4479-8a40-59fdac020986")]

[assembly: log4net.Config.XmlConfigurator(Watch = true)]


text:
package com.ys.yoosir.zzshow.mvp.view;

import com.ys.yoosir.zzshow.mvp.model.entity.videos.VideoChannel;
import com.ys.yoosir.zzshow.mvp.base.BaseView;

import java.util.List;

/**
 * @version 1.0
 * @author  yoosir
 * Created by Administrator on 2016/11/26.
 */

public interface VideoView extends BaseView {

    void initViewPager(List<VideoChannel> videoChannelList);

}


text:
import { AuthTimestampCache } from '../../src/server/revocations'

export class MockAuthTimestampCache extends AuthTimestampCache {
  constructor() {
    super('none', null, 1)
  }
  async getAuthTimestamp(bucketAddress: string): Promise<number> {
    return Promise.resolve(0)
  }
}


text:
package com.example.horizon.myapplication;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.DefaultItemAnimator;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {

    private RecyclerView mRecyclerView;
    private AnimationAdapter commonAdapter;
    private AnimationAdapter staggGridAdapter;
    private ArrayList<Animation> animationList;
    private RecyclerView.LayoutManager layoutManager;

    //初始化数据
    private String[] name = {"超神学院", "勇者大冒险", "航海王", "画江湖", "火影忍者", "墓王之王",
            "秦时明月", "侠岚", "太乙仙魔录"};
    private int[] pic = {R.drawable.chaoshenxueyuan, R.drawable.damaoxian, R.drawable.hanghaiwang,
            R.drawable.huajianghu, R.drawable.huoying, R.drawable.muwangzhiwang,
            R.drawable.qinshimingyue, R.drawable.xialan, R.drawable.xianmolu};

    private boolean flag;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initRecyclerView();

        AnimOnclick();
    }

    public void initData(){
        //为mRecyclerView设置Adapter
        animationList = new ArrayList<>();
        for (int i = 0; i < 9; i++) {
            animationList.add(new Animation(pic[i], name[i]));
        }
    }

    public void initAdapter(){
        commonAdapter = new AnimationAdapter(animationList);
        staggGridAdapter = new AnimationAdapter(animationList,true);
    }
    /**
     * 初始化RecyclerView
     */
    public void initRecyclerView() {
        mRecyclerView = (RecyclerView) findViewById(R.id.recyclerView);

        initData();
        initAdapter();

        //采用瀑布流布局时,若高度固定,设置该方法可提高性能
        //mRecyclerView.setHasFixedSize(true);

        //初始化Item显示方式以及适配器
        initLayoutManger('G');

        //横竖分割线,自行添加
//        mRecyclerView.addItemDecoration(new DividerLinearItemDecoration(this, LinearLayout.HORIZONTAL));
//        mRecyclerView.addItemDecoration(new DividerLinearItemDecoration(this, LinearLayout.VERTICAL));

        mRecyclerView.setItemAnimator(new DefaultItemAnimator()); // 默认动画

    }

    /**
     * 根据参数选择布局样式和分割线
     */
    public void initLayoutManger(char layoutType) {
        flag = false;
        switch (layoutType) {
            case 'L':
                layoutManager = new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
                break;
            case 'G':
                layoutManager = new GridLayoutManager(this, 3, GridLayoutManager.VERTICAL, false);
                break;
            case 'S':
                layoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
                flag = true;
                break;
            default:
                return;
        }

        mRecyclerView.setLayoutManager(layoutManager);

        if(flag)
        mRecyclerView.setAdapter(staggGridAdapter);
        else
        mRecyclerView.setAdapter(commonAdapter);
    }

    /**
     * 为Item设置监听
     */
    public void AnimOnclick() {
        if(flag)
        staggGridAdapter.setOnItemClickListener(new AnimationAdapter.OnRecyclerViewItemClickListener() {
            @Override
            public void onItemClick(View view, int pos) {
                //删除中间的
                Log.d("GHJ",String.valueOf(pos));
                itemRemove(pos);

            }
        });
        else
            commonAdapter.setOnItemClickListener(new AnimationAdapter.OnRecyclerViewItemClickListener() {
                @Override
                public void onItemClick(View view, int pos) {
                    //删除中间的
                    Log.d("GHJ",String.valueOf(pos));
                    itemRemove(pos);
                }
            });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu, menu);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.add_item:
                itemAdd(1000);//添加到末尾
                break;
            case R.id.del_item:
                itemRemove(-1);//删除末尾
                break;
            case R.id.linear:
                initLayoutManger('L');
                break;
            case R.id.grid:
                initLayoutManger('G');
                break;
            case R.id.staggeredGrid:
                initLayoutManger('S');
                break;
            default:
                break;
        }
        return super.onOptionsItemSelected(item);
    }

    public void itemAdd(int pos){
        //对向下取值没有严格的限制,请自行设定
        if(flag)
            if(pos > staggGridAdapter.getItemCount())
            staggGridAdapter.addItem(staggGridAdapter.getItemCount());
            else
                staggGridAdapter.addItem(pos);
        else
            if(pos > commonAdapter.getItemCount())
            commonAdapter.addItem(commonAdapter.getItemCount());
        else
            commonAdapter.addItem(pos);
    }

    public void itemRemove(int pos){
        //这里对向上取值并没有进行进行严格的限制,请根据需要自行设定
        if(pos<0){
            if(flag)
                staggGridAdapter.delItem(staggGridAdapter.getItemCount() - 1);
            else
                commonAdapter.delItem(commonAdapter.getItemCount() - 1);
        }
        else
        if(flag)
            staggGridAdapter.delItem(pos);
        else
            commonAdapter.delItem(pos);

    }
}


text:
  Engomer est
       un village
       géographiquement positionné dans le département de l'Ariège en Midi-Pyrénées. Elle totalisait 273 habitants en 2008.

Le parc d'habitations, à Engomer, se décomposait en 2011 en 19 appartements et 219 maisons soit
 un marché relativement équilibré.

Si vous pensez emmenager à Engomer, vous pourrez facilement trouver une maison à vendre.

La commune propose quelques  équipements, elle dispose, entre autres, de un terrain de tennis.

À coté de Engomer sont positionnées géographiquement les villes de
Moulis située à 3 km, 796 habitants,
Arrien-en-Bethmale située à 5 km, 103 habitants,
Audressein localisée à 3 km, 118 habitants,
Montégut-en-Couserans située à 4 km, 70 habitants,
Les Bordes-sur-Lez localisée à 5 km, 161 habitants,
Arrout située à 2 km, 61 habitants,
 entre autres. De plus, Engomer est située à seulement huit km de Saint-Girons.


text:
define (function (require, exports){
	"use strict";

	var FileUtils = brackets.getModule("file/FileUtils"),
		Common    = require("src/Common"),
		Globals   = require("src/Globals"),
		Logger    = require("src/Logger");

	var nodeId = 0;

	function TreeNode(name){
		this.parent     = null;
		this.id         = newNodeId();
		this.name       = name || '';
		this.level      = 0;
		this.childDirs  = [];
		this.childFiles = [];

		this.isSelected = false;
	}

	/**
	 * Add child directory node to the current node
	 **/
	TreeNode.prototype.addChildDir = function(dirName, relativePath, isSelected){
		if (this.getChildDirIndexByName(dirName) === -1){
			var newNode = new TreeNode(dirName);
			newNode.parent = this;
			newNode.type   = Globals.TREE_TYPE_DIR;
			newNode.level  = this.level + 1;

			newNode.relativePath = relativePath;
			newNode.isSelected = isSelected;

			this.childDirs.push(newNode);
			registerTreeNode(newNode);

			Logger.consoleDebug(newNode);
		}
	};

	/**
	 * Add child file node to the current node
	 **/
	TreeNode.prototype.addChildFiles = function(fileName, relativePath, isSelected){
		// Validate imput
		if (this.getChildFileIndexByName(fileName) === -1){
			var newNode = new TreeNode(fileName);
			newNode.parent = this;
			newNode.type   = Globals.TREE_TYPE_FILE;
			newNode.level  = this.level + 1;

			newNode.relativePath = relativePath;
			newNode.isSelected   = isSelected;

			this.childFiles.push(newNode);
			registerTreeNode(newNode);

			Logger.consoleDebug(newNode);
		}
	};

	/**
	 * Build the tree relative path from the root.
	 **/

	TreeNode.prototype.addRelativePath = function(filePath, isSelected){
		Logger.consoleDebug('TreeNode.addRelativePath(' + filePath + ')');
		if (typeof filePath !== 'string'){
			return false;
		}

		// parse the input path into an array of directories
		filePath = FileUtils.convertWindowsPathToUnixPath(filePath);
		var listDir = filePath.split('/');
		var currNode = this.getRootNode();
		var currPath = '';
		var nodeName = '';

		Logger.consoleDebug(listDir);

		// Loop through and build the tree
		for (var i = 0; i < listDir.length - 1; i++){
			nodeName = listDir[i];
			if (currPath === ''){
				currPath = listDir[i];
			} else {
				currPath += currPath + '/' + listDir[i];
			}
			currNode.addChildDir(nodeName, currPath, isSelected);

			currNode = currNode.childDirs[currNode.getChildDirIndexByName(nodeName)];
		}

		// The last element of the array is always the file.
		currNode.addChildFiles(listDir[listDir.length - 1], filePath, isSelected);

	};

	/**
	 * Return root node
	 **/
	TreeNode.prototype.getRootNode = function(){
		var currNode = this;

		while(currNode.type !== Globals.TREE_TYPE_ROOT){
			currNode = currNode.parent;
		}

		return currNode;
	};

	/**
	 *
	 **/
	TreeNode.prototype.getChildDirIndexByName = function (dirName){
		var retIndex = -1;

		for (var index = 0; index < this.childDirs.length; index++){
			if (this.childDirs[index].name === dirName){
				retIndex = index;
			}
		}

		return retIndex;
	};

	/**
	 *
	 **/
	TreeNode.prototype.getChildFileIndexByName = function (fileName){
		var retIndex = -1;

		for (var index = 0; index < this.childFiles.length; index++){
			if (this.childFiles[index] === fileName){
				retIndex = index;
			}
		}

		return retIndex;
	};

	/**
	 * Search and return the node that contain the input id
	 **/
	TreeNode.prototype.getNodeById = function(id){
		var rootNode = this.getRootNode();
		var retNode = rootNode.nodeInventory[id];

		return retNode;
	};

	/**
	 *
	 **/

	TreeNode.prototype.getNodeByHtmlId = function(htmlId){
		var template = this.getRootNode().htmlId + '-node';
		var nodeId = htmlId.replace(template, '');

		return this.getNodeById(nodeId);
	};

	/**
	 *
	 **/
	TreeNode.prototype.getChildren = function(){
		Logger.consoleDebug('TreeNode.getChildren()');
		var children = [];

		for (var dir = 0; dir < this.childDirs.length; dir++){
			children.push(this.childDirs[dir]);
			children = children.concat(this.childDirs[dir].getChildren());
		}

		for (var file = 0; file < this.childFiles.length; file++){
			children.push(this.childFiles[file]);
		}

		return children;
	};

	/**
	 *
	 **/
	TreeNode.prototype.isNodeHtmlGenerated = function(){
		for (var dir in this.childDirs){
			var childDir = this.childDirs[dir];
			if (!childDir.hasOwnProperty('htmlId')){
				return false;
			}
		}

		for (var file in this.childFiles){
			var childFile = this.childFiles[file];
			if (!childFile.hasOwnProperty('htmlId')){
				return false;
			}
		}

		return true;
	};

	/**
	 *
	 **/
	TreeNode.prototype.getTotalFilesCount = function(){
		var listNode = this.getRootNode().nodeInventory;
		var retCount = 0;

		for (var index in listNode){
			if (listNode[index].type === Globals.TREE_TYPE_FILE){
				retCount++;
			}
		}

		return retCount;
	};

	/**
	 *
	 **/
	TreeNode.prototype.getSelectedFileCount = function(){
		var listNode = this.getRootNode().nodeInventory;
		var retCount = 0;

		for (var index in listNode){
			if (listNode[index].type === Globals.TREE_TYPE_FILE && listNode[index].isSelected){
				retCount++;
			}
		}

		return retCount;
	};

	/**
	 * generate new Tree function
	 */

	function newFileTree(rootDir){
		var newTree = new TreeNode();
		newTree.objType = Globals.OBJECT_DIR_TREE_ID;
		newTree.type = Globals.TREE_TYPE_ROOT;
		newTree.rootDir = rootDir;

		newTree.nodeInventory = [];
		registerTreeNode(newTree);

		return newTree;
	}

	/**
	 *
	 **/

	function generateHtmlTreeContainer(treeNode, treeDiv){
		Logger.consoleDebug("generateHtmlTreeContainer()");
		var tableId = treeDiv + '-tree';

		var html = '
';
		html += "
";

		treeNode.htmlId = tableId;

		return html;
	}

	/**
	 *
	 **/

	function generateHtmlTreeNode(treeNode){
		Logger.consoleDebug('generateHtmlTreeNode()');

		var nodeId, currNode;
		var html = '';

		// Generate node for directories
		for (var dir = 0; dir < treeNode.childDirs.length; dir++){
			currNode = treeNode.childDirs[dir];
			nodeId = treeNode.getRootNode().htmlId + '-node' + currNode.id ;

			html += '
';

			html += '';
			html += '<input type="checkbox" ';

			if (currNode.isSelected){
				html += 'checked';
			}

			html += '/>';

			html += currNode.name + '	';

			html += '
';

			currNode.htmlId = nodeId;
		}

		// Generate node for files
		for (var file = 0; file < treeNode.childFiles.length; file++){
			currNode = treeNode.childFiles[file];
			nodeId = treeNode.getRootNode().htmlId + '-node' + currNode.id;

			html += '
';

			html += '';
			html += '<input type="checkbox" ';

			if (currNode.isSelected){
				html += 'checked';
			}

			html += '/>';

			html += currNode.name;
			html += '<input type="hidden" value="' + currNode.relativePath + '"/>';
			html += '	';
			html += '
';

			currNode.htmlId = nodeId;
		}

		return html;
	}

	/**
	 * debugPrint function
	 **/

	function debugPrint(TreeNode){
		if (Common.isSet(TreeNode)){
			Logger.consoleDebug('id:     ' + TreeNode.id);
			Logger.consoleDebug('type:   ' + TreeNode.type);
			Logger.consoleDebug('level:  ' + TreeNode.level);
			Logger.consoleDebug('name:   ' + TreeNode.name);
			Logger.consoleDebug('parent: ' + TreeNode.parent);
			Logger.consoleDebug('relativePath: ' + TreeNode.relativePath);
			Logger.consoleDebug('isSelected: ' + TreeNode.isSelected);

			for (var child = 0; child < TreeNode.childFiles; child++){
				Logger.consoleDebug('childFile ' + child + ': ' + TreeNode.childFiles[child]);
			}

			for (var childDir = 0; childDir < TreeNode.childDirs.length; childDir++){
				Logger.consoleDebug('childDir ' + childDir + ': ' + TreeNode.childDirs[childDir]);
				debugPrint(TreeNode.childDirs[childDir]);
			}
		}
	}

	function registerTreeNode(node){
		var rootNode = node.getRootNode();
		Logger.consoleDebug(rootNode);
		rootNode.nodeInventory[node.id] = node;
	}

	function newNodeId(){
		var returnId = nodeId;
		nodeId++;

		return returnId;
	}

	exports.newFileTree               = newFileTree;
	exports.debugPrint                = debugPrint;
	exports.generateHtmlTreeContainer = generateHtmlTreeContainer;
	exports.generateHtmlTreeNode      = generateHtmlTreeNode;

});


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta http-equiv="imagetoolbar" content="no"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
    <title></title>

    <link rel="stylesheet" type="text/css" href="../css/loadmore.css">

        111111 section

        111111 section

        111111 section

        111111 section

        111111 section

        111111 section

        111111 section

        111111 section

        111111 section

        111111 section


text:
import jwt

from django.utils.encoding import smart_text
from django.utils.translation import ugettext as _
from rest_framework import exceptions
from rest_framework.authentication import (
    BaseAuthentication, get_authorization_header
)

from keybar.models.device import Device
from keybar.utils.jwt import decode_token

class JSONWebTokenAuthentication(BaseAuthentication):
    """Token based authentication using the JSON Web Token standard.

    Clients should authenticate by passing the token key in the "Authorization"
    HTTP header, prepended with the string "JWT".

    .. code-block::

        Authorization: JWT eyJhbGciOiAiSFMyNTYiLCAidHlwIj...
    """
    www_authenticate_realm = 'api'
    auth_header_prefix = 'JWT'

    def get_jwt_value(self, request):
        auth = get_authorization_header(request).split()
        auth_header_prefix = self.auth_header_prefix.lower()

        if not auth or smart_text(auth[0].lower()) != auth_header_prefix:
            return None

        if len(auth) == 1:
            msg = _('Invalid Authorization header. No credentials provided.')
            raise exceptions.AuthenticationFailed(msg)
        elif len(auth) > 2:
            msg = _('Invalid Authorization header. Credentials string '
                    'should not contain spaces.')
            raise exceptions.AuthenticationFailed(msg)

        return auth[1]

    def authenticate(self, request):
        """Authenticate `request`.

        Returns a two-tuple of `User` and token if a valid signature has been
        supplied using JWT-based authentication.  Otherwise returns `None`.
        """
        jwt_value = self.get_jwt_value(request)

        if jwt_value is None:
            return None

        unverified_data = jwt.decode(jwt_value, verify=False)

        if 'iss' not in unverified_data:
            msg = 'JWT iss (issuer) claim is missing'
            raise exceptions.AuthenticationFailed(detail=msg)

        device = Device.objects.get(pk=unverified_data['iss'])

        try:
            payload = decode_token(jwt_value, device)
        except jwt.ExpiredSignature:
            msg = _('Signature has expired.')
            raise exceptions.AuthenticationFailed(msg)
        except jwt.DecodeError:
            msg = _('Error decoding signature.')
            raise exceptions.AuthenticationFailed(msg)
        except jwt.InvalidTokenError:
            raise exceptions.AuthenticationFailed()

        if unverified_data['iss'] != payload['iss']:
            raise exceptions.AuthenticationFailed()

        user = self.authenticate_credentials(device)

        return (user, jwt_value)

    def authenticate_credentials(self, device):
        # TODO:
        # if not user.is_active:
        #     msg = _('User account is disabled.')
        #     raise exceptions.AuthenticationFailed(msg)

        return device.user

    def authenticate_header(self, request):
        """
        Return a string to be used as the value of the `WWW-Authenticate`
        header in a `401 Unauthenticated` response, or `None` if the
        authentication scheme should return `403 Permission Denied` responses.
        """
        return '{0} realm="{1}"'.format(self.auth_header_prefix, self.www_authenticate_realm)


text:
package org.oep.core.processmgt.model.impl;

import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.json.JSON;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.ProxyUtil;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.model.CacheModel;
import com.liferay.portal.model.impl.BaseModelImpl;
import com.liferay.portal.service.ServiceContext;
import com.liferay.portal.util.PortalUtil;

import com.liferay.portlet.expando.model.ExpandoBridge;
import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;

import org.oep.core.processmgt.model.UserAssignment;
import org.oep.core.processmgt.model.UserAssignmentModel;
import org.oep.core.processmgt.model.UserAssignmentSoap;

import java.io.Serializable;

import java.sql.Types;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * The base model implementation for the UserAssignment service. Represents a row in the "oep_processmgt_userassignment" database table, with each column mapped to a property of this class.
 *
 * <p>
 * This implementation and its corresponding interface {@link org.oep.core.processmgt.model.UserAssignmentModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link UserAssignmentImpl}.
 * </p>
 *
 * @author trungdk
 * @see UserAssignmentImpl
 * @see org.oep.core.processmgt.model.UserAssignment
 * @see org.oep.core.processmgt.model.UserAssignmentModel
 * @generated
 */
@JSON(strict = true)
public class UserAssignmentModelImpl extends BaseModelImpl<UserAssignment>
	implements UserAssignmentModel {
	/*
	 * NOTE FOR DEVELOPERS:
	 *
	 * Never modify or reference this class directly. All methods that expect a user assignment model instance should use the {@link org.oep.core.processmgt.model.UserAssignment} interface instead.
	 */
	public static final String TABLE_NAME = "oep_processmgt_userassignment";
	public static final Object[][] TABLE_COLUMNS = {
			{ "userAssignmentId", Types.BIGINT },
			{ "userId", Types.BIGINT },
			{ "groupId", Types.BIGINT },
			{ "companyId", Types.BIGINT },
			{ "createDate", Types.TIMESTAMP },
			{ "processOrderId", Types.BIGINT },
			{ "dossierStepId", Types.BIGINT },
			{ "assignToUserId", Types.BIGINT }
		};
	public static final String TABLE_SQL_CREATE = "create table oep_processmgt_userassignment (userAssignmentId LONG not null primary key,userId LONG,groupId LONG,companyId LONG,createDate DATE null,processOrderId LONG,dossierStepId LONG,assignToUserId LONG)";
	public static final String TABLE_SQL_DROP = "drop table oep_processmgt_userassignment";
	public static final String ORDER_BY_JPQL = " ORDER BY userAssignment.userAssignmentId ASC";
	public static final String ORDER_BY_SQL = " ORDER BY oep_processmgt_userassignment.userAssignmentId ASC";
	public static final String DATA_SOURCE = "liferayDataSource";
	public static final String SESSION_FACTORY = "liferaySessionFactory";
	public static final String TX_MANAGER = "liferayTransactionManager";
	public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.entity.cache.enabled.org.oep.core.processmgt.model.UserAssignment"),
			true);
	public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.util.service.ServiceProps.get(
				"value.object.finder.cache.enabled.org.oep.core.processmgt.model.UserAssignment"),
			true);
	public static final boolean COLUMN_BITMASK_ENABLED = false;

	/**
	 * Converts the soap model instance into a normal model instance.
	 *
	 * @param soapModel the soap model instance to convert
	 * @return the normal model instance
	 */
	public static UserAssignment toModel(UserAssignmentSoap soapModel) {
		if (soapModel == null) {
			return null;
		}

		UserAssignment model = new UserAssignmentImpl();

		model.setUserAssignmentId(soapModel.getUserAssignmentId());
		model.setUserId(soapModel.getUserId());
		model.setGroupId(soapModel.getGroupId());
		model.setCompanyId(soapModel.getCompanyId());
		model.setCreateDate(soapModel.getCreateDate());
		model.setProcessOrderId(soapModel.getProcessOrderId());
		model.setDossierStepId(soapModel.getDossierStepId());
		model.setAssignToUserId(soapModel.getAssignToUserId());

		return model;
	}

	/**
	 * Converts the soap model instances into normal model instances.
	 *
	 * @param soapModels the soap model instances to convert
	 * @return the normal model instances
	 */
	public static List<UserAssignment> toModels(UserAssignmentSoap[] soapModels) {
		if (soapModels == null) {
			return null;
		}

		List<UserAssignment> models = new ArrayList<UserAssignment>(soapModels.length);

		for (UserAssignmentSoap soapModel : soapModels) {
			models.add(toModel(soapModel));
		}

		return models;
	}

	public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.util.service.ServiceProps.get(
				"lock.expiration.time.org.oep.core.processmgt.model.UserAssignment"));

	public UserAssignmentModelImpl() {
	}

	@Override
	public long getPrimaryKey() {
		return _userAssignmentId;
	}

	@Override
	public void setPrimaryKey(long primaryKey) {
		setUserAssignmentId(primaryKey);
	}

	@Override
	public Serializable getPrimaryKeyObj() {
		return _userAssignmentId;
	}

	@Override
	public void setPrimaryKeyObj(Serializable primaryKeyObj) {
		setPrimaryKey(((Long)primaryKeyObj).longValue());
	}

	@Override
	public Class<?> getModelClass() {
		return UserAssignment.class;
	}

	@Override
	public String getModelClassName() {
		return UserAssignment.class.getName();
	}

	@Override
	public Map<String, Object> getModelAttributes() {
		Map<String, Object> attributes = new HashMap<String, Object>();

		attributes.put("userAssignmentId", getUserAssignmentId());
		attributes.put("userId", getUserId());
		attributes.put("groupId", getGroupId());
		attributes.put("companyId", getCompanyId());
		attributes.put("createDate", getCreateDate());
		attributes.put("processOrderId", getProcessOrderId());
		attributes.put("dossierStepId", getDossierStepId());
		attributes.put("assignToUserId", getAssignToUserId());

		return attributes;
	}

	@Override
	public void setModelAttributes(Map<String, Object> attributes) {
		Long userAssignmentId = (Long)attributes.get("userAssignmentId");

		if (userAssignmentId != null) {
			setUserAssignmentId(userAssignmentId);
		}

		Long userId = (Long)attributes.get("userId");

		if (userId != null) {
			setUserId(userId);
		}

		Long groupId = (Long)attributes.get("groupId");

		if (groupId != null) {
			setGroupId(groupId);
		}

		Long companyId = (Long)attributes.get("companyId");

		if (companyId != null) {
			setCompanyId(companyId);
		}

		Date createDate = (Date)attributes.get("createDate");

		if (createDate != null) {
			setCreateDate(createDate);
		}

		Long processOrderId = (Long)attributes.get("processOrderId");

		if (processOrderId != null) {
			setProcessOrderId(processOrderId);
		}

		Long dossierStepId = (Long)attributes.get("dossierStepId");

		if (dossierStepId != null) {
			setDossierStepId(dossierStepId);
		}

		Long assignToUserId = (Long)attributes.get("assignToUserId");

		if (assignToUserId != null) {
			setAssignToUserId(assignToUserId);
		}
	}

	@JSON
	@Override
	public long getUserAssignmentId() {
		return _userAssignmentId;
	}

	@Override
	public void setUserAssignmentId(long userAssignmentId) {
		_userAssignmentId = userAssignmentId;
	}

	@JSON
	@Override
	public long getUserId() {
		return _userId;
	}

	@Override
	public void setUserId(long userId) {
		_userId = userId;
	}

	@Override
	public String getUserUuid() throws SystemException {
		return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
	}

	@Override
	public void setUserUuid(String userUuid) {
		_userUuid = userUuid;
	}

	@JSON
	@Override
	public long getGroupId() {
		return _groupId;
	}

	@Override
	public void setGroupId(long groupId) {
		_groupId = groupId;
	}

	@JSON
	@Override
	public long getCompanyId() {
		return _companyId;
	}

	@Override
	public void setCompanyId(long companyId) {
		_companyId = companyId;
	}

	@JSON
	@Override
	public Date getCreateDate() {
		return _createDate;
	}

	@Override
	public void setCreateDate(Date createDate) {
		_createDate = createDate;
	}

	@JSON
	@Override
	public long getProcessOrderId() {
		return _processOrderId;
	}

	@Override
	public void setProcessOrderId(long processOrderId) {
		_processOrderId = processOrderId;
	}

	@JSON
	@Override
	public long getDossierStepId() {
		return _dossierStepId;
	}

	@Override
	public void setDossierStepId(long dossierStepId) {
		_dossierStepId = dossierStepId;
	}

	@JSON
	@Override
	public long getAssignToUserId() {
		return _assignToUserId;
	}

	@Override
	public void setAssignToUserId(long assignToUserId) {
		_assignToUserId = assignToUserId;
	}

	@Override
	public String getAssignToUserUuid() throws SystemException {
		return PortalUtil.getUserValue(getAssignToUserId(), "uuid",
			_assignToUserUuid);
	}

	@Override
	public void setAssignToUserUuid(String assignToUserUuid) {
		_assignToUserUuid = assignToUserUuid;
	}

	@Override
	public ExpandoBridge getExpandoBridge() {
		return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
			UserAssignment.class.getName(), getPrimaryKey());
	}

	@Override
	public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
		ExpandoBridge expandoBridge = getExpandoBridge();

		expandoBridge.setAttributes(serviceContext);
	}

	@Override
	public UserAssignment toEscapedModel() {
		if (_escapedModel == null) {
			_escapedModel = (UserAssignment)ProxyUtil.newProxyInstance(_classLoader,
					_escapedModelInterfaces, new AutoEscapeBeanHandler(this));
		}

		return _escapedModel;
	}

	@Override
	public Object clone() {
		UserAssignmentImpl userAssignmentImpl = new UserAssignmentImpl();

		userAssignmentImpl.setUserAssignmentId(getUserAssignmentId());
		userAssignmentImpl.setUserId(getUserId());
		userAssignmentImpl.setGroupId(getGroupId());
		userAssignmentImpl.setCompanyId(getCompanyId());
		userAssignmentImpl.setCreateDate(getCreateDate());
		userAssignmentImpl.setProcessOrderId(getProcessOrderId());
		userAssignmentImpl.setDossierStepId(getDossierStepId());
		userAssignmentImpl.setAssignToUserId(getAssignToUserId());

		userAssignmentImpl.resetOriginalValues();

		return userAssignmentImpl;
	}

	@Override
	public int compareTo(UserAssignment userAssignment) {
		long primaryKey = userAssignment.getPrimaryKey();

		if (getPrimaryKey() < primaryKey) {
			return -1;
		}
		else if (getPrimaryKey() > primaryKey) {
			return 1;
		}
		else {
			return 0;
		}
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}

		if (!(obj instanceof UserAssignment)) {
			return false;
		}

		UserAssignment userAssignment = (UserAssignment)obj;

		long primaryKey = userAssignment.getPrimaryKey();

		if (getPrimaryKey() == primaryKey) {
			return true;
		}
		else {
			return false;
		}
	}

	@Override
	public int hashCode() {
		return (int)getPrimaryKey();
	}

	@Override
	public void resetOriginalValues() {
	}

	@Override
	public CacheModel<UserAssignment> toCacheModel() {
		UserAssignmentCacheModel userAssignmentCacheModel = new UserAssignmentCacheModel();

		userAssignmentCacheModel.userAssignmentId = getUserAssignmentId();

		userAssignmentCacheModel.userId = getUserId();

		userAssignmentCacheModel.groupId = getGroupId();

		userAssignmentCacheModel.companyId = getCompanyId();

		Date createDate = getCreateDate();

		if (createDate != null) {
			userAssignmentCacheModel.createDate = createDate.getTime();
		}
		else {
			userAssignmentCacheModel.createDate = Long.MIN_VALUE;
		}

		userAssignmentCacheModel.processOrderId = getProcessOrderId();

		userAssignmentCacheModel.dossierStepId = getDossierStepId();

		userAssignmentCacheModel.assignToUserId = getAssignToUserId();

		return userAssignmentCacheModel;
	}

	@Override
	public String toString() {
		StringBundler sb = new StringBundler(17);

		sb.append("{userAssignmentId=");
		sb.append(getUserAssignmentId());
		sb.append(", userId=");
		sb.append(getUserId());
		sb.append(", groupId=");
		sb.append(getGroupId());
		sb.append(", companyId=");
		sb.append(getCompanyId());
		sb.append(", createDate=");
		sb.append(getCreateDate());
		sb.append(", processOrderId=");
		sb.append(getProcessOrderId());
		sb.append(", dossierStepId=");
		sb.append(getDossierStepId());
		sb.append(", assignToUserId=");
		sb.append(getAssignToUserId());
		sb.append("}");

		return sb.toString();
	}

	@Override
	public String toXmlString() {
		StringBundler sb = new StringBundler(28);

		sb.append("<model><model-name>");
		sb.append("org.oep.core.processmgt.model.UserAssignment");
		sb.append("</model-name>");

		sb.append(
			"<column><column-name>userAssignmentId</column-name><column-value><![CDATA[");
		sb.append(getUserAssignmentId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>userId</column-name><column-value><![CDATA[");
		sb.append(getUserId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>groupId</column-name><column-value><![CDATA[");
		sb.append(getGroupId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>companyId</column-name><column-value><![CDATA[");
		sb.append(getCompanyId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>createDate</column-name><column-value><![CDATA[");
		sb.append(getCreateDate());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>processOrderId</column-name><column-value><![CDATA[");
		sb.append(getProcessOrderId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>dossierStepId</column-name><column-value><![CDATA[");
		sb.append(getDossierStepId());
		sb.append("]]></column-value></column>");
		sb.append(
			"<column><column-name>assignToUserId</column-name><column-value><![CDATA[");
		sb.append(getAssignToUserId());
		sb.append("]]></column-value></column>");

		sb.append("</model>");

		return sb.toString();
	}

	private static ClassLoader _classLoader = UserAssignment.class.getClassLoader();
	private static Class<?>[] _escapedModelInterfaces = new Class[] {
			UserAssignment.class
		};
	private long _userAssignmentId;
	private long _userId;
	private String _userUuid;
	private long _groupId;
	private long _companyId;
	private Date _createDate;
	private long _processOrderId;
	private long _dossierStepId;
	private long _assignToUserId;
	private String _assignToUserUuid;
	private UserAssignment _escapedModel;
}


text:
+++
City = "Singapore"
Year = "2016"
date = "2016-03-06T22:47:24-06:00"
title = "propose"
type = "event"

+++
{{< cfp_dates >}}

Click here to submit your proposal!

There are three ways to propose a session:

A proposal for a talk/panel during the conference part : these are 30 minute slots that will have the full attention of all attendees, as everybody will be in that one room.

An Ignite talk that will be presented during the Ignite sessions. These are 5 minutes slots with slides changing every 15 seconds (20 slides total) which are also presented to all attendees in one room

Open Space session : even without a prepared presentation we welcome the discussion and interaction by having people propose a session on the fly during Open Space. Check the Open Space explanation for more information.

Our main criteria to make it to the top selection are:

- _original content_: content not yet presented at other conferences, or a new angle to an existing problem
- _new presenters_: people who are new to the space and have insightful stuff to say; we want to hear everybody's voice
- _no vendor pitches_: as much as we value vendors and sponsors, we just don't think this is the right forum. You can demo at your table or during Open Space.

How to submit a proposal: Use [this form](https://docs.google.com/forms/d/1rRowHmmZbcFhTuQmhf-ptpWE04bCLYpA7VbSVb6Bs-4/viewform) and provide the details in the form.

### Rules

Be specific... we aren't mind readers (a description of about 20 lines is about right)

Detail is good... but not as important as explaining why your proposal would be interesting

Propose your own talk; don't have someone else do it for you.

Nominations welcome... if you know someone who has content/experience relevant to the DevOps conversation, please point us in their direction!

Multiple proposals welcome... just follow the other rules


text:
package net.bourgau.philippe.concurrency.kata.tests;

import net.bourgau.philippe.concurrency.kata.CountingOutput;
import net.bourgau.philippe.concurrency.kata.Implementations;
import net.bourgau.philippe.concurrency.kata.MatchingOutput;
import net.bourgau.philippe.concurrency.kata.NullOutput;
import net.bourgau.philippe.concurrency.kata.common.*;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;

import static com.jayway.awaitility.Awaitility.await;
import static com.jayway.awaitility.Duration.FIVE_SECONDS;

@RunWith(Parameterized.class)
public class ConcurrencyTest {

    public static final int NB_LOGIN_MESSAGES = 1000;
    public static final String LOGIN_MESSAGE = "I am the boss !!!";

    @Parameterized.Parameters(name = "{0}")
    public static Collection<Object[]> parameters() {
        return Implementations.multithreaded();
    }

    @Parameterized.Parameter(0)
    public Implementation implementation;

    private ChatRoom chatRoom;
    private List<Thread> threads;
    private CountDownLatch startLatch;
    private CountingOutput countingOutput;
    private Client observer;
    private List<MatchingOutput> allOutputs;
    private Thread moderatorThread;

    @Before
    public void setUp() throws Exception {
        chatRoom = implementation.startNewChatRoom();
        threads = new ArrayList<>();
        countingOutput = new CountingOutput();
        observer = implementation.newClient("Observer", chatRoom, countingOutput);
        allOutputs = new CopyOnWriteArrayList<>();

        enterObserver();
    }

    private void setNumberOfThreads(int count) {
        startLatch = new CountDownLatch(count);
    }

    @Test
    public void
    it_should_handle_many_clients_concurrently() throws Exception {
        final int nbClients = 500;
        setNumberOfThreads(nbClients);

        for (int i = 0; i < nbClients; i++) {
            createThread(new EnterQuit(newClient(i)));
        }

        runThreads();

        await().atMost(FIVE_SECONDS).until(messageCountIs(nbClients * 3));
    }

    @Test
    public void
    new_clients_should_all_receive_all_login_messages() throws Exception {
        final int nbThreads = 2;
        setNumberOfThreads(nbThreads + 1);

        moderatorThread = new Thread(moderatorGoneWild());
        moderatorThread.start();

        for (int i = 0; i < nbThreads; i++) {
            createThread(enterClients("Client-" + i + "-"));
        }

        runThreads();

        await().atMost(FIVE_SECONDS).until(allClientsReceivedAtLeast(NB_LOGIN_MESSAGES));
    }

    private Runnable allClientsReceivedAtLeast(final int expectedMessageCount) {
        return new Runnable() {
            @Override
            public void run() {
                for (MatchingOutput output : allOutputs) {
                    output.assertMessageCount().isGreaterThanOrEqualTo(expectedMessageCount);
                }
            }
        };
    }

    private void createThread(Runnable runnable) {
        threads.add(new Thread(runnable));
    }

    private ConcurrentRunnable enterClients(final String clientPseudoPrefix) {
        return new ConcurrentRunnable() {
            @Override
            public void go() throws Exception {
                int j = 0;
                while (moderatorThread.isAlive()) {
                    final MatchingOutput output = new MatchingOutput(LOGIN_MESSAGE);
                    Client client = implementation.newClient(clientPseudoPrefix + j, chatRoom, output);
                    client.enter();
                    allOutputs.add(output);
                }
            }
        };
    }

    private ConcurrentRunnable moderatorGoneWild() {
        return new ConcurrentRunnable() {
            @Override
            protected void go() throws Exception {
                for (int i = 0; i < NB_LOGIN_MESSAGES; i++) {
                    observer.announce(Message.login(LOGIN_MESSAGE));
                }
            }
        };
    }

    private void enterObserver() throws Exception {
        observer.enter();
        await().until(messageCountIs(1));
        countingOutput.reset();
    }

    private Client newClient(int i) {
        return implementation.newClient("Client#" + i, chatRoom, new NullOutput());
    }

    private Runnable messageCountIs(final int expectedMessageCount) {
        return new Runnable() {
            @Override
            public void run() {
                countingOutput.assertMessageCount().isEqualTo(expectedMessageCount);
            }
        };
    }

    private void runThreads() throws InterruptedException {
        for (Thread thread : threads) {
            thread.start();
        }

        for (Thread thread : threads) {
            thread.join();
        }
    }

    private abstract class ConcurrentRunnable extends UnsafeRunnable {

        @Override
        public void doRun() throws Exception {
            startLatch.countDown();
            startLatch.await();

            go();
        }

        protected abstract void go() throws Exception;
    }

    private class EnterQuit extends ConcurrentRunnable {
        private final Client client;

        public EnterQuit(Client client) {

            this.client = client;
        }

        @Override
        public void go() throws Exception {
            client.enter();
            client.announce("Hi !");
            client.leave();
        }
    }
}


text:
<?php

namespace Ledjin\Bundle\SyliusSagepayBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

class Configuration implements ConfigurationInterface
{
    /**
     * {@inheritDoc}
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('ledjin_sylius_sagepay');

        return $treeBuilder;
    }
}


text:
package org.pac4j.kerberos.credentials.authenticator;

import org.ietf.jgss.GSSContext;

import javax.security.auth.Subject;
import javax.security.auth.kerberos.KerberosPrincipal;
import java.util.HashSet;
import java.util.Set;

/**
 * Result of ticket validation
 *
 * @author Garry Boyce
 * @since 2.1.0
 */
public class KerberosTicketValidation {

    private final String username;
    private final byte[] responseToken;
    private final GSSContext gssContext;
    private final String servicePrincipal;

    public KerberosTicketValidation(String username, String servicePrincipal, byte[] responseToken, GSSContext gssContext) {
        this.username = username;
        this.servicePrincipal = servicePrincipal;
        if (responseToken != null) {
            this.responseToken = responseToken.clone();
        } else {
            this.responseToken = null;
        }
        this.gssContext = gssContext;
    }

    public String username() {
        return username;
    }

    public byte[] responseToken() {
        return responseToken.clone();
    }

    public GSSContext getGssContext() {
        return gssContext;
    }

    public Subject subject() {
        final Set<KerberosPrincipal> princs = new HashSet<>();
        princs.add(new KerberosPrincipal(servicePrincipal));
        return new Subject(false, princs, new HashSet<>(), new HashSet<>());
    }
}


text:
namespace cold {

// An constant-sized array of vertices
class VertexArray {
public:
	VertexArray(const VertexDeclaration& _vd, unsigned int size);
	VertexArray(const VertexArray& va);
	~VertexArray();
	VertexArray& operator=(VertexArray v);

	// Returns a pointer of `T` to the element at `index`
	// index: Index of the element to get
	template <typename T>
	T* get(unsigned int index) const {
		return reinterpret_cast<T*>(_data + index * _vd.stride);
	}

	// Returns a raw pointer to the data
	void *get_data() const { return _data; }

	// Returns the size of the array in bytes
	unsigned int get_size() const { return _size * _vd.stride; }

	// Returns the amount of the vertices in the array
	unsigned int get_count() const { return _size; }

	// Applies the array to the current render state
	void apply() const;

	// Returns the vertex declaration attributed to the array
	const VertexDeclaration& get_vertex_declaration() const { return _vd; }
private:
	unsigned int _size;
	char *_data;
	const VertexDeclaration& _vd;
};

}

#endif


text:
namespace ipc_fuzzer {

namespace {

// Used to simulate a basic child process IPC endpoint and bootstrap the legacy
// IPC channel driven by this process.
class FakeChildProcessImpl
    : public content::mojom::ChildProcessInterceptorForTesting {
 public:
  FakeChildProcessImpl() {
    std::ignore = disconnected_process_.BindNewPipeAndPassReceiver();
  }

  // content::mojom::ChildProcessInterceptorForTesting overrides:
  content::mojom::ChildProcess* GetForwardingInterface() override {
    return disconnected_process_.get();
  }

 private:
  mojo::Remote<content::mojom::ChildProcess> disconnected_process_;
};

}  // namespace

void InitializeMojo() {
  mojo::core::Configuration config;
  config.max_message_num_bytes = 64 * 1024 * 1024;
  mojo::core::Init(config);
}

mojo::IncomingInvitation InitializeMojoIPCChannel() {
  mojo::PlatformChannelEndpoint endpoint;
#if BUILDFLAG(IS_WIN)
  endpoint = mojo::PlatformChannel::RecoverPassedEndpointFromCommandLine(
      *base::CommandLine::ForCurrentProcess());
#elif BUILDFLAG(IS_POSIX)
  endpoint = mojo::PlatformChannelEndpoint(mojo::PlatformHandle(base::ScopedFD(
      base::GlobalDescriptors::GetInstance()->Get(kMojoIPCChannel))));
#endif
  CHECK(endpoint.is_valid());
  return mojo::IncomingInvitation::Accept(std::move(endpoint));
}

ReplayProcess::ReplayProcess()
    : io_thread_("Chrome_ChildIOThread"),
      shutdown_event_(base::WaitableEvent::ResetPolicy::MANUAL,
                      base::WaitableEvent::InitialState::NOT_SIGNALED),
      message_index_(0) {}

ReplayProcess::~ReplayProcess() {
  channel_.reset();

  // Signal this event before shutting down the service process. That way all
  // background threads can cleanup.
  shutdown_event_.Signal();
  io_thread_.Stop();
}

bool ReplayProcess::Initialize(int argc, const char** argv) {
  base::CommandLine::Init(argc, argv);

  if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
          switches::kIpcFuzzerTestcase)) {
    LOG(ERROR) << "This binary shouldn't be executed directly, "
               << "please use tools/ipc_fuzzer/scripts/play_testcase.py";
    return false;
  }

  // Log to both stderr and file destinations.
  logging::SetMinLogLevel(logging::LOG_ERROR);
  logging::LoggingSettings settings;
  settings.logging_dest = logging::LOG_TO_ALL;
  settings.log_file_path = FILE_PATH_LITERAL("ipc_replay.log");
  logging::InitLogging(settings);

  // Make sure to initialize Mojo before starting the IO thread.
  InitializeMojo();

  io_thread_.StartWithOptions(
      base::Thread::Options(base::MessagePumpType::IO, 0));

#if BUILDFLAG(IS_POSIX)
  base::GlobalDescriptors* g_fds = base::GlobalDescriptors::GetInstance();
  g_fds->Set(kMojoIPCChannel,
             kMojoIPCChannel + base::GlobalDescriptors::kBaseDescriptor);
#endif

  mojo_ipc_support_.reset(new mojo::core::ScopedIPCSupport(
      io_thread_.task_runner(),
      mojo::core::ScopedIPCSupport::ShutdownPolicy::FAST));
  mojo_invitation_ =
      std::make_unique<mojo::IncomingInvitation>(InitializeMojoIPCChannel());

  return true;
}

void ReplayProcess::OpenChannel() {
  DCHECK(mojo_invitation_);
  mojo::ScopedMessagePipeHandle child_process_pipe_for_receiver =
      mojo_invitation_->ExtractMessagePipe(
          content::kChildProcessReceiverAttachmentName);
  mojo::ScopedMessagePipeHandle legacy_ipc_bootstrap_pipe =
      mojo_invitation_->ExtractMessagePipe(
          content::kLegacyIpcBootstrapAttachmentName);
  mojo::MakeSelfOwnedReceiver(
      std::make_unique<FakeChildProcessImpl>(),
      mojo::PendingReceiver<content::mojom::ChildProcess>(
          std::move(child_process_pipe_for_receiver)));
  channel_ = IPC::ChannelProxy::Create(
      IPC::ChannelMojo::CreateClientFactory(
          std::move(legacy_ipc_bootstrap_pipe), io_thread_.task_runner(),
          base::ThreadTaskRunnerHandle::Get()),
      this, io_thread_.task_runner(), base::ThreadTaskRunnerHandle::Get());
}

bool ReplayProcess::OpenTestcase() {
  base::FilePath path =
      base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
          switches::kIpcFuzzerTestcase);
  return MessageFile::Read(path, &messages_);
}

void ReplayProcess::SendNextMessage() {
  if (message_index_ >= messages_.size()) {
    base::RunLoop::QuitCurrentWhenIdleDeprecated();
    return;
  }

  std::unique_ptr<IPC::Message> message =
      std::move(messages_[message_index_++]);

  if (!channel_->Send(message.release())) {
    LOG(ERROR) << "ChannelProxy::Send() failed after "
               << message_index_ << " messages";
    base::RunLoop::QuitCurrentWhenIdleDeprecated();
  }
}

void ReplayProcess::Run() {
  base::RepeatingTimer timer;
  timer.Start(FROM_HERE, base::Milliseconds(1),
              base::BindRepeating(&ReplayProcess::SendNextMessage,
                                  base::Unretained(this)));
  base::RunLoop().Run();
}

bool ReplayProcess::OnMessageReceived(const IPC::Message& msg) {
  return true;
}

void ReplayProcess::OnChannelError() {
  LOG(ERROR) << "Channel error, quitting after "
             << message_index_ << " messages";
  base::RunLoop::QuitCurrentWhenIdleDeprecated();
}

}  // namespace ipc_fuzzer


text:
// This file is automatically generated.

package adila.db;

/*
 * Motorola Droid Pro
 *
 * DEVICE: cdma_venus2
 * MODEL: DROID PRO
 */
final class cdma5fvenus2_droid20pro {
    public static final String DATA = "Motorola|Droid Pro|";
}