text:
package io.grpc.internal;

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.common.annotations.VisibleForTesting;
import com.google.gson.JsonObject;
import io.grpc.Attributes;
import io.grpc.ConnectivityState;
import io.grpc.ConnectivityStateInfo;
import io.grpc.EquivalentAddressGroup;
import io.grpc.LoadBalancer;
import io.grpc.LoadBalancer.Helper;
import io.grpc.LoadBalancer.PickResult;
import io.grpc.LoadBalancer.PickSubchannelArgs;
import io.grpc.LoadBalancer.SubchannelPicker;
import io.grpc.PickFirstBalancerFactory;
import io.grpc.Status;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Locale;
import java.util.logging.Logger;
import javax.annotation.Nullable;

final class AutoConfiguredLoadBalancerFactory extends LoadBalancer.Factory {
  private static final Logger logger =
      Logger.getLogger(AutoConfiguredLoadBalancerFactory.class.getName());

  @VisibleForTesting
  static final String ROUND_ROUND_LOAD_BALANCER_FACTORY_NAME =
      "io.grpc.util.RoundRobinLoadBalancerFactory";
  @VisibleForTesting
  static final String GRPCLB_LOAD_BALANCER_FACTORY_NAME =
      "io.grpc.grpclb.GrpclbLoadBalancerFactory";

  AutoConfiguredLoadBalancerFactory() {}

  @Override
  public LoadBalancer newLoadBalancer(Helper helper) {
    return new AutoConfiguredLoadBalancer(helper);
  }

  private static final class EmptySubchannelPicker extends SubchannelPicker {

    @Override
    public PickResult pickSubchannel(PickSubchannelArgs args) {
      return PickResult.withNoResult();
    }
  }

  @VisibleForTesting
  static final class AutoConfiguredLoadBalancer extends LoadBalancer {
    private final Helper helper;
    private LoadBalancer delegate;
    private LoadBalancer.Factory delegateFactory;

    AutoConfiguredLoadBalancer(Helper helper) {
      this.helper = helper;
      setDelegateFactory(PickFirstBalancerFactory.getInstance());
      setDelegate(getDelegateFactory().newLoadBalancer(helper));
    }

    //  Must be run inside ChannelExecutor.
    @Override
    public void handleResolvedAddressGroups(
        List<EquivalentAddressGroup> servers, Attributes attributes) {
      if (attributes.keys().contains(GrpcAttributes.NAME_RESOLVER_ATTR_SERVICE_CONFIG)) {
        Factory newlbf = decideLoadBalancerFactory(
            servers, attributes.get(GrpcAttributes.NAME_RESOLVER_ATTR_SERVICE_CONFIG));
        if (newlbf != null && newlbf != delegateFactory) {
          helper.updateBalancingState(ConnectivityState.CONNECTING, new EmptySubchannelPicker());
          getDelegate().shutdown();
          setDelegateFactory(newlbf);
          setDelegate(getDelegateFactory().newLoadBalancer(helper));
        }
      }
      getDelegate().handleResolvedAddressGroups(servers, attributes);
    }

    @Override
    public void handleNameResolutionError(Status error) {
      getDelegate().handleNameResolutionError(error);
    }

    @Override
    public void handleSubchannelState(Subchannel subchannel, ConnectivityStateInfo stateInfo) {
      getDelegate().handleSubchannelState(subchannel, stateInfo);
    }

    @Override
    public void shutdown() {
      getDelegate().shutdown();
      setDelegate(null);
    }

    @VisibleForTesting
    LoadBalancer getDelegate() {
      return delegate;
    }

    @VisibleForTesting
    void setDelegate(LoadBalancer delegate) {
      this.delegate = delegate;
    }

    @VisibleForTesting
    LoadBalancer.Factory getDelegateFactory() {
      return delegateFactory;
    }

    @VisibleForTesting
    void setDelegateFactory(LoadBalancer.Factory delegateFactory) {
      this.delegateFactory = delegateFactory;
    }

    /**
     * Picks a load balancer based on given criteria.  In order of preference:
     *
     *

     *
User provided lb on the channel.  This is a degenerate case and not handled here.

     *
gRPCLB if on the class path and any gRPC LB balancer addresses are present

     *
RoundRobin if on the class path and picked by the service config

     *
PickFirst if the service config choice does not specify

     *

     *
     * @param servers The list of servers reported
     * @param choice the service config object
     * @return the new load balancer factory, or null if the existing lb should be used.
     */
    @Nullable
    @VisibleForTesting
    static LoadBalancer.Factory decideLoadBalancerFactory(
        List<EquivalentAddressGroup> servers, JsonObject choice) {
      boolean loadBalancingPolicyPresent = choice.has("loadBalancingPolicy");

      // Check for balancer addresses
      boolean haveBalancerAddress = false;
      for (EquivalentAddressGroup s : servers) {
        if (s.getAttributes().get(GrpcAttributes.ATTR_LB_ADDR_AUTHORITY) != null) {
          haveBalancerAddress = true;
          break;
        }
      }

      if (haveBalancerAddress) {
        try {
          Class<?> lbFactoryClass;
          lbFactoryClass = Class.forName(GRPCLB_LOAD_BALANCER_FACTORY_NAME);
          Method getInstance = lbFactoryClass.getMethod("getInstance");
          return (LoadBalancer.Factory) getInstance.invoke(null);
        } catch (RuntimeException e) {
          throw e;
        } catch (Exception e) {
          throw new RuntimeException("Can't get GRPCLB, but balancer addresses were present", e);
        }
      }

      // Check for an explicitly present lb choice
      if (loadBalancingPolicyPresent) {
        String serviceConfigChoiceBalancingPolicy = null;
        serviceConfigChoiceBalancingPolicy = choice.get("loadBalancingPolicy").getAsString();
        String policy = checkNotNull(serviceConfigChoiceBalancingPolicy, "policy");
        if (policy.toUpperCase(Locale.ROOT).equals("ROUND_ROBIN")) {
          ClassNotFoundException caught = null;
          try {
            Class<?> lbFactoryClass;
            lbFactoryClass = Class.forName(ROUND_ROUND_LOAD_BALANCER_FACTORY_NAME);
            Method getInstance = lbFactoryClass.getMethod("getInstance");
            return (LoadBalancer.Factory) getInstance.invoke(null);
          } catch (RuntimeException e) {
            throw e;
          } catch (Exception e) {
            throw new RuntimeException("Can't get Round Robin LB", e);
          }
        }
        throw new IllegalArgumentException("Unknown service config policy: " + policy);
      }

      return PickFirstBalancerFactory.getInstance();
    }
  }
}


text:
from wallace.db.base.sql.table import SqlTable

class PostgresTable(SqlTable):

    table_name = None

redpajama_set_name: RedPajamaGithub


text:
/* eslint-disable no-unused-vars */
import functionsTestSetup from 'firebase-functions-test'
import * as admin from 'firebase-admin'
import chai from 'chai'
import sinon from 'sinon'

process.env.NODE_ENV = 'test'
const projectId = 'unit-test-project'
const {
  FIREBASE_DATABASE_EMULATOR_HOST,
  FIRESTORE_EMULATOR_HOST = 'localhost:8080'
} = process.env

;(global as any).projectId = projectId
;(global as any).chai = chai
;(global as any).sinon = sinon
;(global as any).expect = chai.expect
;(global as any).assert = chai.assert

// Initialize admin SDK with emulator settings for RTDB (needed to
// prevent error from initializeApp not being called since it is in index.js)
admin.initializeApp({
  projectId,
  databaseURL: `http://${FIREBASE_DATABASE_EMULATOR_HOST}?ns=${projectId}`,
  credential: admin.credential.applicationDefault()
})

// Initialize Firestore with emulator settings from environment
const [servicePath, portStr] = FIRESTORE_EMULATOR_HOST.split(':')
admin.firestore().settings({
  servicePath,
  port: parseInt(portStr, 10)
})


text:
<?php

namespace Google\Service\Contentwarehouse;

class QualityActionsAppInfo extends \Google\Collection
{
  protected $collection_key = 'sourceData';
  /**
   * @var string[]
   */
  public $androidIntent;
  /**
   * @var string
   */
  public $appName;
  protected $categoryType = QualityActionsAppUnderstandingCategory::class;
  protected $categoryDataType = '';
  /**
   * @var float
   */
  public $confidence;
  /**
   * @var string
   */
  public $displayName;
  /**
   * @var string
   */
  public $fallbackUrl;
  /**
   * @var string
   */
  public $packageName;
  /**
   * @var string
   */
  public $source;
  protected $sourceDataType = QualityActionsAppInfoSourceData::class;
  protected $sourceDataDataType = 'array';

  /**
   * @param string[]
   */
  public function setAndroidIntent($androidIntent)
  {
    $this->androidIntent = $androidIntent;
  }
  /**
   * @return string[]
   */
  public function getAndroidIntent()
  {
    return $this->androidIntent;
  }
  /**
   * @param string
   */
  public function setAppName($appName)
  {
    $this->appName = $appName;
  }
  /**
   * @return string
   */
  public function getAppName()
  {
    return $this->appName;
  }
  /**
   * @param QualityActionsAppUnderstandingCategory
   */
  public function setCategory(QualityActionsAppUnderstandingCategory $category)
  {
    $this->category = $category;
  }
  /**
   * @return QualityActionsAppUnderstandingCategory
   */
  public function getCategory()
  {
    return $this->category;
  }
  /**
   * @param float
   */
  public function setConfidence($confidence)
  {
    $this->confidence = $confidence;
  }
  /**
   * @return float
   */
  public function getConfidence()
  {
    return $this->confidence;
  }
  /**
   * @param string
   */
  public function setDisplayName($displayName)
  {
    $this->displayName = $displayName;
  }
  /**
   * @return string
   */
  public function getDisplayName()
  {
    return $this->displayName;
  }
  /**
   * @param string
   */
  public function setFallbackUrl($fallbackUrl)
  {
    $this->fallbackUrl = $fallbackUrl;
  }
  /**
   * @return string
   */
  public function getFallbackUrl()
  {
    return $this->fallbackUrl;
  }
  /**
   * @param string
   */
  public function setPackageName($packageName)
  {
    $this->packageName = $packageName;
  }
  /**
   * @return string
   */
  public function getPackageName()
  {
    return $this->packageName;
  }
  /**
   * @param string
   */
  public function setSource($source)
  {
    $this->source = $source;
  }
  /**
   * @return string
   */
  public function getSource()
  {
    return $this->source;
  }
  /**
   * @param QualityActionsAppInfoSourceData[]
   */
  public function setSourceData($sourceData)
  {
    $this->sourceData = $sourceData;
  }
  /**
   * @return QualityActionsAppInfoSourceData[]
   */
  public function getSourceData()
  {
    return $this->sourceData;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(QualityActionsAppInfo::class, 'Google_Service_Contentwarehouse_QualityActionsAppInfo');


text:
.nav, .pagination, .carousel, .panel-title a { cursor: pointer; }

ul.menu li{

	float:left;
	background-color:#ffffaa;
	margin:5px;
	padding:8px;
	list-style-type: none;
}

input.error{
	background-color:#ffdddd;
}

input.ok{
	background-color:#aaffaa;
}

footer{
	clear:both;
	background-color:#ccc;
}


text:
#ifndef __INCE1PC_H__
#define __INCE1PC_H__

/*  basic scalar definitions have same meanning,
 *  but their declaration location depends on environment
 */

/*--------------------------------------channel numbers---------------------*/
#define CHAN_SYSTEM     0x0001      /* system channel (spooler to spooler) */
#define CHAN_ERRLOG     0x0005      /* error logger */
#define CHAN_CAPI       0x0064      /* CAPI interface */
#define CHAN_NDIS_DATA  0x1001      /* NDIS data transfer */

/*--------------------------------------POF ready msg-----------------------*/
	    /* NOTE: after booting POF sends system ready message to PC: */
#define RDY_MAGIC       0x52535953UL    /* 'SYSR' reversed */
#define RDY_MAGIC_SIZE  4               /* size in bytes */

#define MAX_N_TOK_BYTES 255

#define MIN_RDY_MSG_SIZE    RDY_MAGIC_SIZE
#define MAX_RDY_MSG_SIZE    (RDY_MAGIC_SIZE+MAX_N_TOK_BYTES)

#define SYSR_TOK_END            0
#define SYSR_TOK_B_CHAN         1   /* nr. of B-Channels;   DataLen=1; def: 2 */
#define SYSR_TOK_FAX_CHAN       2   /* nr. of FAX Channels; DataLen=1; def: 0 */
#define SYSR_TOK_MAC_ADDR       3   /* MAC-Address; DataLen=6; def: auto */
#define SYSR_TOK_ESC            255 /* undefined data size yet */
			    /* default values, if not corrected by token: */
#define SYSR_TOK_B_CHAN_DEF     2   /* assume 2 B-Channels */
#define SYSR_TOK_FAX_CHAN_DEF   1   /* assume 1 FAX Channel */

/*  syntax of new SYSR token stream:
 *  channel: CHAN_SYSTEM
 *  msgsize: MIN_RDY_MSG_SIZE <= x <= MAX_RDY_MSG_SIZE
 *           RDY_MAGIC_SIZE   <= x <= (RDY_MAGIC_SIZE+MAX_N_TOK_BYTES)
 *  msg    : 0 1 2 3 {4 5 6 ..}
 *           S Y S R  MAX_N_TOK_BYTES bytes of TokenStream
 *
 *  TokenStream     :=   empty
 *                     | {NonEndTokenChunk} EndToken RotlCRC
 *  NonEndTokenChunk:= NonEndTokenId DataLen [Data]
 *  NonEndTokenId   := 0x01 .. 0xFE                 1 BYTE
 *  DataLen         := 0x00 .. 0xFF                 1 BYTE
 *  Data            := DataLen bytes
 *  EndToken        := 0x00
 *  RotlCRC         := special 1 byte CRC over all NonEndTokenChunk bytes
 *                     s. RotlCRC algorithm
 *
 *  RotlCRC algorithm:
 *      ucSum= 0                        1 uchar
 *      for all NonEndTokenChunk bytes:
 *          ROTL(ucSum,1)               rotate left by 1
 *          ucSum += Char;              add current byte with swap around
 *      RotlCRC= ~ucSum;                invert all bits for result
 *
 *  note:
 *  - for 16-bit FIFO add padding 0 byte to achieve even token data bytes!
 */

/*--------------------------------------error logger------------------------*/
					    /* note: pof needs final 0 ! */
#define ERRLOG_CMD_REQ          "ERRLOG ON"
#define ERRLOG_CMD_REQ_SIZE     10              /* with final 0 byte ! */
#define ERRLOG_CMD_STOP         "ERRLOG OFF"
#define ERRLOG_CMD_STOP_SIZE    11              /* with final 0 byte ! */

#define ERRLOG_ENTRY_SIZE       64      /* sizeof(tErrLogEntry) */
					/* remaining text size = 55 */
#define ERRLOG_TEXT_SIZE    (ERRLOG_ENTRY_SIZE-2*4-1)

typedef struct ErrLogEntry_tag {

/*00 */ ulong ulErrType;

/*04 */ ulong ulErrSubtype;

/*08 */ uchar ucTextSize;

	/*09 */ uchar ucText[ERRLOG_TEXT_SIZE];
	/* ASCIIZ of len ucTextSize-1 */

/*40 */
} tErrLogEntry;

#if defined(__TURBOC__)
#if sizeof(tErrLogEntry) != ERRLOG_ENTRY_SIZE
#error size of tErrLogEntry != ERRLOG_ENTRY_SIZE
#endif				/*  */
#endif				/*  */

/*--------------------------------------DPRAM boot spooler------------------*/
				/*  this is the struture used between pc and
				 *  hyperstone to exchange boot data
				 */
#define DPRAM_SPOOLER_DATA_SIZE 0x20
typedef struct DpramBootSpooler_tag {

/*00 */ uchar Len;

/*01 */ volatile uchar RdPtr;

/*02 */ uchar WrPtr;

/*03 */ uchar Data[DPRAM_SPOOLER_DATA_SIZE];

/*23 */
} tDpramBootSpooler;

#define DPRAM_SPOOLER_MIN_SIZE  5       /* Len+RdPtr+Wrptr+2*data */
#define DPRAM_SPOOLER_DEF_SIZE  0x23    /* current default size   */

/*--------------------------------------HYCARD/ERGO DPRAM SoftUart----------*/
				    /* at DPRAM offset 0x1C00: */
#define SIZE_RSV_SOFT_UART  0x1B0   /* 432 bytes reserved for SoftUart */

#endif	/* __INCE1PC_H__ */


text:
  <md-card>
    <md-input-container class="full-width">
      <input mdInput type="text" [(ngModel)]="user.email" placeholder="Email">
    </md-input-container>
    <md-input-container class="full-width">
      <input mdInput type="password" [(ngModel)]="user.password" placeholder="password">
    </md-input-container>

        <button color="primary" md-raised-button (click)="doLogin()">
          Login
        </button>

  </md-card>


text:
var falcorPathUtils = require('falcor-path-utils');

function getPathsCount(pathSets) {
    return pathSets.reduce(function(numPaths, pathSet) {
        return numPaths + falcorPathUtils.pathCount(pathSet);
    }, 0);
}

module.exports = getPathsCount;


text:
module.exports = process.env.NODE_ENV === 'production'
  ? 'https://eda-lms.herokuapp.com'
  : 'http://localhost:3000'


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

class Derivacion_model extends CI_Model {

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

	private $_columns = array(
		'der_id'=>null,
		'der_emp_id'=>0,
		'der_sed_id'=>null,
		'der_are_id'=>null,
		'der_usu_id'=>null,
		'der_fecha'=>'',
		'der_observacion'=>'',
		'der_estado'=>'1'
	);

	private $_table = 'mype_derivacion';

	public function setColumns ($row = null){
		foreach ($row as $key => $value) {
			if(array_key_exists($key, $this->_columns)){
				$this->_columns[$key] = $value;
			}
		}
    }
    public function isNew(){
    	return is_null($this->_columns['der_id']) || $this->_columns['der_id'] == 0 || is_null($this->_columns['der_usu_id'] ) ;
    }
    public function findById($id){
		$this->load->database();
		$res = $this->db->get_where($this->_table,array('der_id'=>$id));
		$result = null;
		if ($res->num_rows() == 1) {
			$result = $this->create($res->row_object());
		}
		return $result;
	}

	public function get($attr){
			return $this->_columns[$attr];
	}
	public function set($key,$value)
	{
		$this->_columns[$key] = $value;
	}
	public function create($row){
		$asignacion =  new Derivacion_model();
		$asignacion->setColumns($row);
		return $asignacion;
    }

    public function save(){
		try {
			$this->load->database();
			if(is_null($this->_columns['der_id'])){
				$this->db->insert($this->_table,$this->_columns);
				$this->_columns['der_id'] = $this->db->insert_id();
			}else{
				$this->db->where('der_id',$this->_columns['der_id']);
				$this->db->update($this->_table,$this->_columns);
			}

		} catch (Exception $e) {
			echo"se produjo una excepcion del tipo".$e->getMessage() ;
		}
	}
	public function getUsuario(){
		$CI         =& get_instance();
		$CI->load->model('Usuario_model');
		return $CI->Usuario_model->findById2($this->_columns['der_usu_id']);
	}
	public function getAreaDestino(){
		$CI         =& get_instance();
		$CI->load->model('Areas_model');
		return $CI->Areas_model->findById($this->_columns['der_are_id']);
	}
	public function getSedeDestino(){
		$CI         =& get_instance();
		$CI->load->model('Datos_model');
		return $CI->Datos_model->findSedeById($this->_columns['der_sed_id']);
	}
	public function delete()
	{
		$this->db->delete('mype_derivacion',array('der_id'=>$this->_columns['der_id']));

	}
}

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


text:
<!DOCTYPE HTML>

		<meta charset="UTF-8">

		<title>Agregar Localización</title>

		<link rel="shortcut icon" type="image/x-icon" href="../imagenes/inicio.bmp">

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

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

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

		<?php
			include("../../controlador/php/validar_sesion.php");
		?>

			<?php
				include("banner.php");
				include("menu.php");
			?>

				<form action="../../controlador/php/documentos_add_data.php" method="POST">

Añadir Localización a Documento

 Cubículo:

								<input id="cubiculo" type="text" name="cubiculo" class="input4 placeholder2" placeholder="Ej. Cubículo 1" maxlength="20" required autocomplete="off">

(*)

 Año:

								<input id="año" type="text" name="ano" class="input4 placeholder2" placeholder="Ej. 2014" maxlength="4" required autocomplete="off" onKeyPress="return SoloNumeros(event);">

(*)

 Documento en PDF:

								<input id="archivo" type="file" name="archivo" style='width:350px;height:10px;padding:10px;border-radius:30px;border:2px solid #797979;text-align:justify;font-family:"Times New Roman';class="input4 placeholder2" placeholder="Ej. 2014" maxlength="4" required autocomplete="off"></file>

(*)

Título del Documento:

								<select class="input5" name="id_asignacion" required>
									<option value="0">
										Seleccione
									</option>

									<?php
										include ("../../modelo/clases/conexion.php");
										$conectar=new conectar();

										$sql="SELECT id_asignacion, titulo_asignacion FROM asignacion WHERE status_asignacion='Aprobado' AND tipo_asignacion='trabajo'";
										$ejecutar=pg_query($sql);

										while ($dato=pg_fetch_array($ejecutar))
										{
											echo "<option value='".$dato[0]."'>
													".$dato[1]."
												</option>";

										}
									?>

								</select>

(*)

								<input class="a2" type="submit" value="Ingresar" style="margin-top:155px;">
								<input class="a3" type="reset" value="Borrar" style="margin-top:155px;">

				</form>

(*) Campo Obligatorio


text:
// a dump class
class Widget { };

// a dump function
void process(const Widget& lvalArg) {
    std::cout << "Process(const Widget&) calling\n";
}

// a dump function
void process(const Widget&& rvalArg) {
    std::cout << "Process(Widget&& rvalArg)\n";
}

// a dump function
void makeLogEntry() { }

template<typename T>
void logAndProcess(T&& param) {
    auto now =
        std::chrono::system_clock::now();
    makeLogEntry();
    process(std::forward<T>(param));
}

int main() {
    Widget w;

    logAndProcess(w);
    logAndProcess(std::move(w));

    return 0;
}


text:
import {JsonSchema} from "../../../../src/common/jsonschema/class/JsonSchema";
import {MultipleOf} from "../../../../src/common/jsonschema/decorators/multipleOf";
import {stubSchemaDecorator} from "./utils";

describe("MultipleOf", () => {
    before(() => {
        this.decorateStub = stubSchemaDecorator();
        this.schema = new JsonSchema();
        try {
            MultipleOf(0);
        } catch (er) {
            this.error = er;
        }
        MultipleOf(10);
        this.decorateStub.getCall(0).args[0](this.schema);
    });
    after(() => {
        this.decorateStub.restore();
    });

    it("should store data", () => {
        this.schema.multipleOf.should.eq(10);
    });

    it("should throw an error when the given parameters is as negative integer", () => {
        this.error.message.should.deep.equal("The value of multipleOf MUST be a number, strictly greater than 0.");
    });
});


text:
package org.apache.syncope.client.console;

import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import javax.ws.rs.core.EntityTag;
import javax.ws.rs.core.MediaType;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.FastDateFormat;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.syncope.client.lib.SyncopeClient;
import org.apache.syncope.client.lib.SyncopeClientFactoryBean;
import org.apache.syncope.common.lib.SyncopeConstants;
import org.apache.syncope.common.lib.EntityTOUtils;
import org.apache.syncope.common.lib.to.DomainTO;
import org.apache.syncope.common.lib.info.PlatformInfo;
import org.apache.syncope.common.lib.info.SystemInfo;
import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.rest.api.service.DomainService;
import org.apache.syncope.common.rest.api.service.SyncopeService;
import org.apache.wicket.Session;
import org.apache.wicket.authroles.authentication.AuthenticatedWebSession;
import org.apache.wicket.authroles.authorization.strategies.role.Roles;
import org.apache.wicket.request.Request;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.concurrent.ThreadPoolExecutorFactoryBean;

public class SyncopeConsoleSession extends AuthenticatedWebSession {

    private static final long serialVersionUID = 747562246415852166L;

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

    private static final ThreadPoolExecutorFactoryBean THREAD_POOL_FACTORY;

    public static final String AUTHENTICATED = "AUTHENTICATED";

    public static final String MENU_COLLAPSE = "MENU_COLLAPSE";

    static {
        THREAD_POOL_FACTORY = new ThreadPoolExecutorFactoryBean();
        THREAD_POOL_FACTORY.setThreadNamePrefix(SyncopeConsoleSession.class.getSimpleName());
        THREAD_POOL_FACTORY.setDaemon(true);
    }

    private final PlatformInfo platformInfo;

    private final SystemInfo systemInfo;

    private final List<String> domains;

    private String domain;

    private final Map<Class<?>, Object> services = Collections.synchronizedMap(new HashMap<Class<?>, Object>());

    private final ScheduledExecutorService executorService = Executors.newScheduledThreadPool(5, THREAD_POOL_FACTORY);

    private SyncopeClient client;

    private String username;

    private String password;

    private UserTO selfTO;

    private Map<String, Set<String>> auth;

    private Roles roles;

    private boolean checkReconciliationJob = false;

    public static SyncopeConsoleSession get() {
        return (SyncopeConsoleSession) Session.get();
    }

    public SyncopeConsoleSession(final Request request) {
        super(request);

        SyncopeClient anonymousClient = SyncopeConsoleApplication.get().getClientFactory().create(
                SyncopeConsoleApplication.get().getAnonymousUser(),
                SyncopeConsoleApplication.get().getAnonymousKey());

        platformInfo = anonymousClient.getService(SyncopeService.class).platform();
        systemInfo = anonymousClient.getService(SyncopeService.class).system();

        domains = new ArrayList<>();
        domains.add(SyncopeConstants.MASTER_DOMAIN);
        CollectionUtils.collect(anonymousClient.getService(DomainService.class).list(),
                EntityTOUtils.<DomainTO>keyTransformer(), domains);
    }

    public void execute(final Runnable command) {
        executorService.execute(command);
    }

    public ScheduledFuture<?> scheduleAtFixedRate(
            final Runnable command,
            final long initialDelay,
            final long period,
            final TimeUnit unit) {

        return executorService.scheduleAtFixedRate(command, initialDelay, period, unit);
    }

    @Override
    public void invalidate() {
        super.invalidate();
        executorService.shutdownNow();
    }

    public PlatformInfo getPlatformInfo() {
        return platformInfo;
    }

    public SystemInfo getSystemInfo() {
        return systemInfo;
    }

    public List<String> getDomains() {
        return domains;
    }

    public void setDomain(final String domain) {
        this.domain = domain;
    }

    public String getDomain() {
        return StringUtils.isBlank(domain) ? SyncopeConstants.MASTER_DOMAIN : domain;
    }

    @Override
    public boolean authenticate(final String username, final String password) {
        boolean authenticated = false;

        try {
            client = SyncopeConsoleApplication.get().getClientFactory().
                    setDomain(getDomain()).create(username, password);

            Pair<Map<String, Set<String>>, UserTO> self = client.self();
            auth = self.getKey();
            selfTO = self.getValue();

            this.username = username;
            this.password = password;
            authenticated = true;
        } catch (Exception e) {
            LOG.error("Authentication failed", e);
        }

        return authenticated;
    }

    public UserTO getSelfTO() {
        return selfTO;
    }

    public boolean owns(final String entitlement) {
        return auth.containsKey(entitlement);
    }

    @Override
    public Roles getRoles() {
        if (isSignedIn() && roles == null && auth != null) {
            roles = new Roles(auth.keySet().toArray(new String[] {}));
            roles.add(AUTHENTICATED);
        }

        return roles;
    }

    public void refreshAuth() {
        authenticate(username, password);
        roles = null;
    }

    @SuppressWarnings("unchecked")
    private <T> T getCachedService(final Class<T> serviceClass) {
        T service;
        if (services.containsKey(serviceClass)) {
            service = (T) services.get(serviceClass);
        } else {
            service = client.getService(serviceClass);
            services.put(serviceClass, service);
        }

        WebClient.client(service).
                type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON);

        return service;
    }

    public <T> T getService(final Class<T> serviceClass) {
        return getCachedService(serviceClass);
    }

    public <T> T getService(final String etag, final Class<T> serviceClass) {
        T serviceInstance = getCachedService(serviceClass);
        WebClient.client(serviceInstance).match(new EntityTag(etag), false);

        return serviceInstance;
    }

    public <T> T getService(final MediaType mediaType, final Class<T> serviceClass) {
        T service;

        synchronized (SyncopeConsoleApplication.get().getClientFactory()) {
            SyncopeClientFactoryBean.ContentType preType = SyncopeConsoleApplication.get().getClientFactory().
                    getContentType();

            SyncopeConsoleApplication.get().getClientFactory().
                    setContentType(SyncopeClientFactoryBean.ContentType.fromString(mediaType.toString()));
            service = SyncopeConsoleApplication.get().getClientFactory().
                    create(username, password).getService(serviceClass);
            SyncopeConsoleApplication.get().getClientFactory().setContentType(preType);
        }

        return service;
    }

    public <T> void resetClient(final Class<T> service) {
        T serviceInstance = getCachedService(service);
        WebClient.client(serviceInstance).reset();
    }

    public FastDateFormat getDateFormat() {
        Locale locale = getLocale() == null ? Locale.ENGLISH : getLocale();
        return FastDateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, locale);
    }

    public boolean isCheckReconciliationJob() {
        return checkReconciliationJob;
    }

    public void setCheckReconciliationJob(final boolean checkReconciliationJob) {
        this.checkReconciliationJob = checkReconciliationJob;
    }

}


text:
module Problem1 where

import Data.Char
import Data.List
import Control.Applicative
import System.IO

-- The goal in this problem is to find the minimum number of coins needed to change the input value
-- (an integer) into coins with denominations 1, 5, and 10.

main :: IO ()
main =
  hSetBuffering stdin NoBuffering >>= \_ ->
  nextNum >>= \money ->
  putStrLn $ show $ length $ coins money

coins = unfoldr f

f s
  | s >= 10 = Just (10, s - 10)
  | s >= 5 = Just (5, s - 5)
  | s > 0 = Just(1, s - 1)
  | otherwise = Nothing

nextNum = nextNum' ""

nextNum' n = getChar >>= \char ->
  if(isDigit char) then nextNum' $ char:n
  else if(null n) then nextNum' n
  else pure $ read $ reverse n


text:
import React from 'react';
import PropTypes from 'prop-types';

const Default = ({ component: C, componentProps, }) => <C {...componentProps} />;

Default.componentName = 'Default';
Default.propTypes = {
  component: PropTypes.func.isRequired,
  // eslint-disable-next-line react/forbid-prop-types
  componentProps: PropTypes.object,
};

Default.defaultProps = {
  componentProps: {},
};

export default Default;


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Sydowia 9(1-6): 385 (1955)

#### Original name
Marasmius omphalodes Berk.

### Remarks
null


text: default_app_config = 'cyidentity.apps.IdentityConfig'


text:
require File.expand_path('../../test_helper', __FILE__)

class InvoiceMailsControllerTest < ActionController::TestCase
  fixtures :projects,
           :users,
           :roles,
           :members,
           :member_roles,
           :issues,
           :issue_statuses,
           :versions,
           :trackers,
           :projects_trackers,
           :issue_categories,
           :enabled_modules,
           :enumerations,
           :attachments,
           :workflows,
           :custom_fields,
           :custom_values,
           :custom_fields_projects,
           :custom_fields_trackers,
           :time_entries,
           :journals,
           :journal_details,
           :queries

    ActiveRecord::Fixtures.create_fixtures(Redmine::Plugin.find(:redmine_contacts).directory + '/test/fixtures/',
                            [:contacts,
                             :contacts_projects,
                             :contacts_issues,
                             :deals,
                             :notes,
                             :roles,
                             :enabled_modules,
                             :tags,
                             :taggings,
                             :contacts_queries])

    ActiveRecord::Fixtures.create_fixtures(Redmine::Plugin.find(:redmine_contacts_invoices).directory + '/test/fixtures/',
                          [:invoices,
                           :invoice_lines])

  def setup
    Project.find(1).enable_module!(:contacts_invoices)
    Project.find(5).enable_module!(:contacts_invoices)
  end

  def test_get_new
    @request.session[:user_id] = 1
    post :new, :invoice_id => 1
    assert_response :success
    assert_template 'new'
    assert_not_nil assigns(:invoice)
    assert_select 'div.invoice-card div.invoice-name h3.invoice_number', :text => '1/001'
    assert_select 'div.invoice-card div.invoice-name div a', :text => 'Domoway'
  end

  def test_get_new_by_deny_user
    @request.session[:user_id] = 4
    post :new, :invoice_id => 1
    assert_response 403
  end

  def test_post_preview
    @request.session[:user_id] = 1
    xhr :post, :preview_mail, :invoice_id => 1, :"message-content" => "{%contact.name%} test message"
    assert_response :success
    assert_match 'Domoway test message', @response.body
  end

  def test_send_mail_by_deny_user
    @request.session[:user_id] = 4
    post :send_mail, :invoice_id => 1, :"message-content" => "test message", :subject => "test subject"
    assert_response 403
  end

  def test_send_mail
    @request.session[:user_id] = 1
    message_content = "Hello {%contact.name%}\ntest message\n{%invoice.public_link%}"
    post :send_mail, :invoice_id => 1, :bcc => "test@mail.bcc", :"message-content" => message_content, :subject => "test subject"
    mail = ActionMailer::Base.deliveries.last
    assert_not_nil mail
    assert_match /Hello Domoway/, mail.text_part.body.to_s
    assert_equal "test subject", mail.subject
    assert_equal "domoway@mail.ru", mail.to.first
    assert_equal "redmine@example.net", mail.from.first
    assert_equal "test@mail.bcc", mail.bcc.first
    assert_match "invoices/1/client_view?token=#{Invoice.find(1).token}", mail.text_part.body.to_s
  end

end


text:
__all__ = [
    'Command',
    'LateTask',
    'PageCompiler',
    'RestExtension',
    'Task',
    'TaskMultiplier',
    'TemplateSystem'
]

from yapsy.IPlugin import IPlugin
from doit.cmd_base import Command as DoitCommand

class BasePlugin(IPlugin):
    """Base plugin class."""

    def set_site(self, site):
        """Sets site, which is a Nikola instance."""
        self.site = site

class Command(BasePlugin, DoitCommand):
    """These plugins are exposed via the command line.
    They implement the doit Command interface."""

    name = "dummy_command"

    doc_purpose = "A short explanation."
    doc_usage = ""
    doc_description = None  # None value will completely ommit line from doc
    # see http://python-doit.sourceforge.net/cmd_run.html#parameters
    cmd_options = ()
    needs_config = True

    def __init__(self, *args, **kwargs):
        BasePlugin.__init__(self, *args, **kwargs)
        DoitCommand.__init__(self)

    def execute(self, options={}, args=[]):
        """Check if the command can run in the current environment,
        fail if needed, or call _execute."""
        if self.needs_config and not self.site.configured:
            print("This command needs to run inside an existing Nikola site.")
            return False
        self._execute(options, args)

    def _execute(self, options, args):
        """Do whatever this command does.
        @param options (dict) with values from cmd_options
        @param args (list) list of positional arguments
        """
        raise NotImplementedError()

def help(self):
    """return help text"""
    text = []
    text.append("Purpose: %s" % self.doc_purpose)
    text.append("Usage:   nikola %s %s" % (self.name, self.doc_usage))
    text.append('')

    text.append("Options:")
    for opt in self.options:
        text.extend(opt.help_doc())

    if self.doc_description is not None:
        text.append("")
        text.append("Description:")
        text.append(self.doc_description)
    return "\n".join(text)

DoitCommand.help = help

class BaseTask(BasePlugin):
    """PLugins of this type are task generators."""

    name = "dummy_task"

    # default tasks are executed by default.
    # the others have to be specifie in the command line.
    is_default = True

    def gen_tasks(self):
        """Task generator."""
        raise NotImplementedError()

class Task(BaseTask):
    """PLugins of this type are task generators."""

class LateTask(BaseTask):
    """Plugins of this type are executed after all plugins of type Task."""

    name = "dummy_latetask"

class TemplateSystem(BasePlugin):
    """Plugins of this type wrap templating systems."""

    name = "dummy templates"

    def set_directories(self, directories, cache_folder):
        """Sets the list of folders where templates are located and cache."""
        raise NotImplementedError()

    def template_deps(self, template_name):
        """Returns filenames which are dependencies for a template."""
        raise NotImplementedError()

    def render_template(name, output_name, context):
        """Renders template to a file using context.

        This must save the data to output_name *and* return it
        so that the caller may do additional processing.
        """
        raise NotImplementedError()

class TaskMultiplier(BasePlugin):
    """Plugins that take a task and return *more* tasks."""

    name = "dummy multiplier"

    def process(self, task):
        """Examine task and create more tasks.
        Returns extra tasks only."""
        return []

class PageCompiler(BasePlugin):
    """Plugins that compile text files into HTML."""

    name = "dummy compiler"
    default_metadata = {
        'title': '',
        'slug': '',
        'date': '',
        'tags': '',
        'link': '',
        'description': '',
    }

    def compile_html(self, source, dest, is_two_file=False):
        """Compile the source, save it on dest."""
        raise NotImplementedError()

    def create_post(self, path, onefile=False, **kw):
        """Create post file with optional metadata."""
        raise NotImplementedError()

    def extension(self):
        """The preferred extension for the output of this compiler."""
        return ".html"

class RestExtension(BasePlugin):
    name = "dummy_rest_extension"

class Importer(Command):
    """Basic structure for importing data into Nikola.

    The flow is:

    read_data
    preprocess_data
    parse_data
    generate_base_site
        populate_context
        create_config
    filter_data
    process_data

    process_data can branch into:

    import_story (may use import_file and save_post)
    import_post (may use import_file and save_post)
    import_attachment (may use import_file)

    Finally:

    write_urlmap
    """

    name = "dummy_importer"

    def _execute(self, options={}, args=[]):
        """Import the data into Nikola."""
        raise NotImplementedError()

    def generate_base_site(self, path):
        """Create the base site."""
        raise NotImplementedError()

    def populate_context(self):
        """Use data to fill context for configuration."""
        raise NotImplementedError()

    def create_config(self):
        """Use the context to create configuration."""
        raise NotImplementedError()

    def read_data(self, source):
        """Fetch data into self.data"""
        raise NotImplementedError()

    def preprocess_data(self):
        """Modify data if needed."""
        pass

    def parse_data(self):
        """Convert self.data into self.items"""
        raise NotImplementedError()

    def filter_data(self):
        """Remove data that's not to be imported."""
        pass

    def process_data(self):
        """Go through self.items and save them."""

    def import_story(self):
        """Create a story."""
        raise NotImplementedError()

    def import_post(self):
        """Create a post."""
        raise NotImplementedError()

    def import_attachment(self):
        """Create an attachment."""
        raise NotImplementedError()

    def import_file(self):
        """Import a file."""
        raise NotImplementedError()

    def save_post(self):
        """Save a post to disk."""
        raise NotImplementedError()


text:
This macOS management profile suppresses the Touch ID pop-up window for all accounts on a particular Mac.

Note: This profile works on macOS 10.15.x and later


text:
include_recipe "opscode-base"

env = node["environment"]

["/srv/chef", "/srv/chef/shared", "/srv/chef/shared/vendor_chef_expander"].each do |dirname|
  directory dirname do
    owner "opscode"
    group "opscode"
    mode '0755'
  end
end

deploy_revision 'chef' do
  revision env['chef-revision'] || env['default-revision']
  repository 'git://github.com/' + (env['chef-remote'] || env['default-remote']) + '/chef.git'
  remote (env['chef-remote'] || env['default-remote'])

  user "opscode"
  group "opscode"
  deploy_to "/srv/chef"

  symlink_before_migrate Hash.new
  symlinks("vendor_chef_expander" => "chef-expander/vendor")

  migrate false
  before_symlink do
    bash "install_localgems_chef" do
      user "root"
      cwd "#{release_path}"
      code <<-EOH
          export "GEM_HOME=/srv/localgems"
          export "GEM_PATH=/srv/localgems"
          export "PATH=/srv/localgems/bin:$PATH"
          cd chef
          rake gem
          gem install pkg/*.gem
          cd ../chef-solr
          rake gem
          gem install pkg/*.gem
      EOH
    end
  end
end


text:
import { forwardRef, Inject, Injectable } from '@angular/core';
import { ConfigService } from '@ngx-config/core';

import { ConsoleService } from './console.service';
import { LogLevel } from './models/log-level';

@Injectable()
export class LogService {
  constructor(private readonly config: ConfigService, @Inject(forwardRef(() => ConsoleService)) readonly logger: ConsoleService) {}

  // debug (standard output)
  debug(msg: any): void {
    if (this.config.getSettings('logging.level') >= LogLevel.Debug) {
      // console.debug does not work on {N} apps... use `log`
      this.logger.log(msg);
    }
  }

  // error
  error(err: any): void {
    if (this.config.getSettings('logging.level') >= LogLevel.Error) {
      this.logger.error(err);
    }
  }

  // warn
  warn(err: any): void {
    if (this.config.getSettings('logging.level') >= LogLevel.Warn) {
      this.logger.warn(err);
    }
  }

  // info
  info(err: any): void {
    if (this.config.getSettings('logging.level') >= LogLevel.Info) {
      this.logger.info(err);
    }
  }
}


text:
<TITLE>Review for Rock, The (1996)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Rock, The (1996)

reviewed by
James Berardinelli

                                     THE ROCK
                       A film review by James Berardinelli
                        Copyright 1996 James Berardinelli

RATING (0 TO 10): 7.5
Alternative Scale: *** out of ****

United States, 1996
U.S. Release Date: 6/7/96 (wide)
Running Length: 2:15
MPAA Classification: R (Violence, profanity, sex)
Theatrical Aspect Ratio: 2.35:1

Cast: Sean Connery, Nicolas Cage, Ed Harris, Michael Biehn,
      William Forsythe, David Morse, John Spencer, John C. McGinley,
      Bokeem Woodbine, Vanessa Marcil
Director: Michael Bay
Producers: Jerry Bruckheimer and Don Simpson
Screenplay: David Weisberg & Donald S. Cook and Mark Rosner
Cinematography: John Schwartzman
Music: Nick Glennie-Smith and Hans Zimmer
U.S. Distributor: Hollywood Pictures

     It seems that once every dozen-or-so years, Sean Connery has the
urge to go back into Bondage.  After turning in his tuxedo and Aston
Martin following 1971's DIAMONDS ARE FOREVER, Connery ventured into the
acting market as a free agent.  His vow to "never again" play 007 held
for a little over a decade.  Lured back by an enormous sum of money and
the offer of limited creative control, Connery returned to Her Majesty's
Secret Service in 1983, with the "unofficial" Bond entry, NEVER SAY
NEVER AGAIN.  Now, in 1996's THE ROCK, the veteran actor has once more
come home to the action genre.  Granted, his character is called John
Mason, not James Bond, but Connery plays him exactly as he might portray
a sixty-something version of the world-renowned British spy.

     THE ROCK is the summer of 1996's first "traditional" action film.
There are no tornadoes to chase or dragons to slay, and, while the plot
certainly isn't Dostoevsky, it beats MISSION IMPOSSIBLE's swiss-cheese-
like storyline hands down.  There's some wry humor amidst all the
wreckage from car chases and missile strikes, and a few of the
characters are allowed to break through their stereotypical boundaries.
Not surprisingly, the energy level is high, and there's plenty of
action, ranking this film alongside BROKEN ARROW and EXECUTIVE DECISION
among the year's best high-adrenaline offerings.

     As is often the case with action films, a simple premise is the
most effective.  Here, it's that a group of ex-Marines have stolen 15 VX
gas rockets and are threatening to launch a lethal strike on the San
Francisco Bay area if their demands aren't met.  Led by war hero and
living legend, Brigadier General Frank Hummel (Ed Harris), the crack
platoon has holed up on Alcatraz, where they're holding 81 civilians
hostage.  The U.S. government responds by sending a troop of Navy SEALS
on a secret raid, using the labyrinth of tunnels beneath the island as
their entranceway.  Their guide is the only man ever to escape from the
legendary prison:  ex-SAS operative, John Mason (Connery).  Also in the
party is FBI agent Stanley Goodspeed (Nicolas Cage), an admitted
"chemical superfreak" who has the knowledge and experience to defuse
Hummel's rockets.

     The cast is first rate.  Nicolas Cage, last year's Best Actor Oscar
winner, doesn't excel as an action hero, but he's a good enough
performer to forge a likable character.  Ed Harris portrays a
surprisingly sympathetic bad guy.  Unlike most villains in this sort of
movie, his Hummel isn't greedy or mad -- just angry.  He's championing a
cause ("this isn't about terrorism -- it's about justice"), and feels
that drastic action is the only way to get people to listen to him.
David Morse, who left an impression in last year's THE CROSSING GUARD,
is Hummel's right-hand man.  John Spencer portrays the FBI director,
Michael Biehn is the SEAL team leader, and Vanessa Marcil is Goodspeed's
pregnant fiancee, who has been placed in harm's way.

     But the real standout is, of course, Connery.  Having lost none of
his charisma with age, the veteran actor puts to use his mastery of
mixing humor and action.  Just like Bond, Mason does all his shooting
and battling with tongue in cheek.  Along the way, he develops a nice
rapport with Goodspeed, with the two actors clicking in the best "buddy
movie" fashion.

     THE ROCK's running time could have been trimmed.  There's no reason
for it to last a bloated one-hundred thirty-five minutes (unless it's
trying to rival the Bond films for length).  Much of the early,
character-building material could have been shortened without damaging
the complexity of the principal trio, and certain aspects of the script
might have benefiting from a little tightening up.  Flaws aside,
however, THE ROCK still represents a loud, fast-paced night's worth of
entertainment.  There are all the expected shoot-outs, explosions, and
death-defying stunts.  Director Michael Bay (BAD BOYS) doesn't break new
ground, but he displays his command of the genre by keeping the familiar
from becoming boring.  His steals from Quentin Tarantino (a master of
theft in his own right) and others fit seamlessly into this movie.

     Producers Jerry Bruckheimer and the late Don Simpson have a highly-
successful resume that includes TOP GUN and CRIMSON TIDE.  THE ROCK will
add more luster to that reputation.  Since TWISTER and MISSION
IMPOSSIBLE are losing a fraction of their tremendous momentum, THE ROCK
is poised to storm past them.  With Connery, Cage, Harris, and a host of
harrowing action sequences, this is the kind of breath-stealing summer
entertainment that audiences crave.  Although not as expertly-crafted as
DIE HARD or SPEED, THE ROCK is exhausting in its own right -- and that's
just one of several convincing reasons to see this film.

- James Berardinelli
e-mail: berardin@bc.cybernex.net
ReelViews web site: http://www.cybernex.net/~berardin

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
package org.gbif.pubindex.rome.modules.prism;

import com.sun.syndication.feed.module.Module;

/**
 * RSS ROME module to parse the PRISM module for rss feeds
 * Publishing Requirements for Industry Standard Metadata (PRISM)
 * http://www.prismstandard.org/specifications/PRISM1[1].2.pdf
 */
public interface PrismModule extends Module{
  public static final String URI = "http://prismstandard.org/namespaces/1.2/basic/";
  public String getByteCount();
  public String getCategory();
  public String getComplianceProfile();
  public String getCopyright();
  public String getCorporateEntity();
  public String getCoverDate();
  public String getCoverDisplayDate();
  public String getCreationDate();
  public String getDistributor();
  public String getDoi();
  public String getEIssn();
  public String getEdition();
  public String getEmbargoDate();
  public String getEndingPage();
  public String getEvent();
  public String getExpirationDate();
  public String getHasAlternative();
  public String getHasCorrection();
  public String getHasFormat();
  public String getHasPart();
  public String getHasPreviousVersion();
  public String getHasTranslation();
  public String getIndustry();
  public String getIsCorrectionOf();
  public String getIsFormatOf();
  public String getIsPartOf();
  public String getIsReferencedBy();
  public String getIsRequiredBy();
  public String getIsTranslationOf();
  public String getIsVersionOf();
  public String getIssn();
  public String getIssueIdentifier();
  public String getIssueName();
  public String getLocation();
  public String getModificationDate();
  public String getNumber();
  public String getObjectTitle();
  public String getOrganization();
  public String getPerson();
  public String getPublicationDate();
  public String getPublicationName();
  public String getReceptionDate();
  public String getReferences();
  public String getRequires();
  public String getRightsAgent();
  public String getSection();
  public String getStartingPage();
  public String getSubsection();
  public String getTeaser();
  public String getVolume();
  public String getWordCount();

}


text:
This document explains how to get started with developing for NGINX Ingress controller.

## Prerequisites

Install [Go 1.14](https://golang.org/dl/) or later.

!!! note
    The project uses [Go Modules](https://github.com/golang/go/wiki/Modules)

Install [Docker](https://docs.docker.com/engine/install/) (v19.03.0 or later with experimental feature on)

!!! important
    The majority of make tasks run as docker containers

## Quick Start

1. Fork the repository
2. Clone the repository to any location in your work station
3. Add a `GO111MODULE` environment variable with `export GO111MODULE=on`
4. Run `go mod download` to install dependencies

### Local build

Start a local Kubernetes cluster using [kind](https://kind.sigs.k8s.io/), build and deploy the ingress controller

```console
make dev-env
```
- If you are working on the v1.x.x version of this controler, and you want to create a cluster with kubernetes version 1.22, then please visit the [documentation for kind](https://kind.sigs.k8s.io/docs/user/configuration/#a-note-on-cli-parameters-and-configuration-files), and look for how to set a custom image for the kind node (image: kindest/node...), in the kind config file.

### Testing

**Run go unit tests**

```console
make test
```

**Run unit-tests for lua code**

```console
make lua-test
```

Lua tests are located in the directory `rootfs/etc/nginx/lua/test`

!!! important
    Test files must follow the naming convention `<mytest>_test.lua` or it will be ignored

**Run e2e test suite**

```console
make kind-e2e-test
```

To limit the scope of the tests to execute, we can use the environment variable `FOCUS`

```console
FOCUS="no-auth-locations" make kind-e2e-test
```

!!! note
    The variable `FOCUS` defines Ginkgo [Focused Specs](https://onsi.github.io/ginkgo/#focused-specs)

Valid values are defined in the describe definition of the e2e tests like [Default Backend](https://github.com/kubernetes/ingress-nginx/blob/main/test/e2e/defaultbackend/default_backend.go#L29)

The complete list of tests can be found [here](../e2e-tests.md)

### Custom docker image

In some cases, it can be useful to build a docker image and publish such an image to a private or custom registry location.

This can be done setting two environment variables, `REGISTRY` and `TAG`

```console
export TAG="dev"
export REGISTRY="$USER"

make build image
```

and then publish such version with

```console
docker push $REGISTRY/controller:$TAG
```


text:
tSNEJS is an implementation of t-SNE visualization algorithm in Javascript.

t-SNE is a visualization algorithm that embeds things in 2 or 3 dimensions. If you have some data and you can measure their pairwise differences, t-SNE visualization can help you identify clusters in your data. See example below.

## Online demo
The main project website has a [live example](http://cs.stanford.edu/people/karpathy/tsnejs/) and more description.

## Research Paper
The algorithm was originally described in this paper:

    L.J.P. van der Maaten and G.E. Hinton.
    Visualizing High-Dimensional Data Using t-SNE. Journal of Machine Learning Research
    9(Nov):2579-2605, 2008.

You can find the PDF [here](http://jmlr.csail.mit.edu/papers/volume9/vandermaaten08a/vandermaaten08a.pdf).

## Example code
Import tsne.js into your document: `<script src="tsne.js"></script>`
And then here is some example code:

    var opt = {epsilon: 10}; // epsilon is learning rate (10 = default)
    var tsne = new tsnejs.tSNE(opt); // create a tSNE instance

    // initialize data. Here we have 3 points and some example pairwise dissimilarities
    var dists = [[1.0, 0.1, 0.2], [0.1, 1.0, 0.3], [0.2, 0.1, 1.0]];
    tsne.initDataDist(dists);

    for(var k = 0; k < 500; k++) {
      tsne.step(); // every time you call this, solution gets better
    }

    var Y = tsne.getSolution(); // Y is an array of 2-D points that you can plot

The data can be passed to tSNEJS as a set of high-dimensional points using the `tsne.initDataRaw(X)` function, where X is an array of arrays (high-dimensional points that need to be embedded). The algorithm computes the Gaussian kernel over these points and then finds the appropriate embedding.

## Web Demos
There are two web interfaces to this library that we are aware of:

- By Andrej, [here](http://cs.stanford.edu/people/karpathy/tsnejs/csvdemo.html).
- By Laurens, [here](http://homepage.tudelft.nl/19j49/tsnejs/), which takes data in different format and can also use Google Spreadsheet input.

## About
Send questions to [@karpathy](https://twitter.com/karpathy).

## License

MIT


text:
html, body{margin:0;padding:0;height:100%;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: moz-none;
	-ms-user-select: none;
	user-select: none;
}

* {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

#settings{
	border:0px;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-khtml-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

img a, img a:link, img a:active, img a:visited, img a:hover{
border:0px;
}

#entry{
	display:none;
	width:100%;
	height:100%;
	background-color:#80e1cc;
}

#entry_ust{width:100%; height:50%;background-color: #ecf0f1;background-image:url(../img/mosque.jpg);background-size:80% 80%;background-repeat:no-repeat;background-position:center;}
#entry_alt{width:100%; height:50%; background-color: #ecf0f1;text-align:center;}
#entry_kontrol{width:70%; height:80%;margin:auto;background-color: #ecf0f1;text-align:center;}
#select_city{text-align:center;}

ul, li{margin:0;padding:0;list-style:none;display:inline;}

#board{width:100%;height:100%;overflow:hidden;display:none;}

#case{width:100%;height:7%;font-family: "Trebuchet MS", Helvetica, sans-serif;background-color: #ecf0f1;line-height:50px;text-align:center;z-index:2;}

#case img{position:absolute;right:5%;margin-top:5px;}

span.city{font-size:25px;color:#666666;margin-left:20px;line-height:100%;font-weight:bold;}

#scene{position:relative;left:0;width:2400px;height:83%;}

#page_one{float:left;width:800px;height:100%;background-color:#ecf0f1;}
#page_two{text-align:center;float:left;width:800px;height:100%;background-color:#ecf0f1;}
#page_three{float:left;width:800px;height:100%;background-color:#ecf0f1;}

#bar{width:100%;height:10%;}

.bar_one{float:left;width:33.3333333%;height:100%;background-color:#ecf0f1;background-image:url(../img/hadis.png);background-repeat:no-repeat;background-position:center;}
.bar_two{float:left;width:33.3333333%;height:100%;background-color:#ecf0f1;background-image:url(../img/sayac.png);background-repeat:no-repeat;background-position:center;}
.bar_three{float:left;width:33.3333333%;height:100%;background-color:#ecf0f1;background-image:url(../img/vakit.png);background-repeat:no-repeat;background-position:center;}

.active{border-top:3px solid #cccccc;}

 /* Ic sayfalar */

#kalan_sure_yazi{font-family: "Trebuchet MS", Helvetica, sans-serif;font-size: 20px;color:#749c7a;font-weight:bold;text-align:center;margin-top:10%;}
#kalan_sure{text-align:center;margin:auto;font-family:"Trebuchet MS", Helvetica, sans-serif;color:#666666;font-size:20px;margin-top:10%;}
#kalan_gun{text-align:center;font-family:"Trebuchet MS", Helvetica, sans-serif;color:#666666;font-size:1.0em;margin-top:5%;}
#saat_kucuk{font-family:"Trebuchet MS", Helvetica, sans-serif;color:#666666;font-size:0.5em;margin-top:3%;}

#vakit_yazi{font-family: "Trebuchet MS", Helvetica, sans-serif;font-size:20px;color:#749c7a;font-weight:bold;text-align:center;margin-top:15%;}
#sayilan_vakit{font-family: "Trebuchet MS", Helvetica, sans-serif;font-size: 2.0em;color:#666666;text-align:center;margin-top:5.2%;}

#hadis{width:90%;padding-left:5%;font-family:"Trebuchet MS", Helvetica, sans-serif;font-size:1.1em;color:#666666;text-decoration:justify;margin-top:10%;padding-bottom:5px;line-height: 1.4;}
#hadis_bar{width:100%;height:30%;font-family:"Times New Roman";color:#7781a1;font-style:italic;font-size:2.0em;padding-left:5%;margin-top:5px;line-height: 1.2;}

#imsak{width:100%;height:19%;color:#dd90fd;}
#ogle{width:100%;height:19%;color:#cb64f6;}
#ikindi{width:100%;height:19%;color:#b558dc;}
#aksam{width:100%;height:19%;color:#a45dc2;}
#yatsi{width:100%;height:20%;color:#8e44ad;}

.title_vakit{float:left;width:49%;height:100%;font-family:"Trebuchet MS", Helvetica, sans-serif;font-size: 1.3em;text-align:right;line-height:100px;}
.title_sayac{float:left;width:46%;height:100%;font-family:"Trebuchet MS", Helvetica, sans-serif;font-size:2.2em;color:#666666;text-align:left;margin-left:5%;line-height:100px;}

#saat{
	font-size:3.0em;
	color:#666666;
}
#dakika{
	font-size:3.0em;
	color:#666666;
}
#saniye{
	font-size:3.0em;
	color:#666666;
}

 /* Media sorgulari */

@media (min-width: 980px) {
#scene{left:0;width:2940px;height:83%;}
#page_one{float:left;width:980px;height:100%;background-color:#ecf0f1;}
#page_two{text-align:center;float:left;width:980px;height:100%;background-color:#ecf0f1;}
#page_three{float:left;width:980px;height:100%;background-color:#ecf0f1;}
#bar{width:100%;height:10%;}
#kalan_sure_yazi{font-family: Trebuchet MS;font-size:20px;color:#749c7a;font-weight:bold;text-align:center;margin-top:10%;}
#kalan_sure{text-align:center;margin:auto;font-family:"Trebuchet MS", Helvetica, sans-serif;color:#666666;font-size:20px;margin-top:10%;}
#saat_kucuk{font-family:"Trebuchet MS", Helvetica, sans-serif;color:#666666;font-size:1.5em;margin-top:11%;}
#vakit_yazi{font-family: Trebuchet MS;font-size:20px;color:#749c7a;font-weight:bold;text-align:center;margin-top:5%;}
#sayilan_vakit{font-family: "Trebuchet MS", Helvetica, sans-serif;font-size:2.0em;text-align:center;margin-top:5.2%;}
#hadis{width:90%;padding-left:5%;font-family:"Trebuchet MS", Helvetica, sans-serif;font-size:1.1em;color:#666666;text-decoration:justify;padding-bottom:5px;line-height: 1.4;}
#hadis_bar{width:100%;height:30%;font-family:"Times New Roman";color:#7781a1;font-style:italic;font-size:2.0em;padding-left:5%;margin-top:5px;line-height: 1.2;}
}

@media (min-width: 768px) and (max-width: 979px) {
#scene{left:0;width:2937px;height:83%;}
#page_one{float:left;width:979px;height:100%;background-color:#ecf0f1;}
#page_two{text-align:center;float:left;width:979px;height:100%;background-color:#ecf0f1;}
#page_three{float:left;width:979px;height:100%;background-color:#ecf0f1;}
#bar{width:100%;height:10%;}
#kalan_sure_yazi{font-family: Trebuchet MS;font-size:20px;color:#749c7a;font-weight:bold;text-align:center;margin-top:10%;}
#kalan_sure{text-align:center;margin:auto;font-family:"Trebuchet MS", Helvetica, sans-serif;color:#666666;font-size:20px;margin-top:10%;}
#saat_kucuk{font-family:"Trebuchet MS", Helvetica, sans-serif;color:#666666;font-size:1.5em;margin-top:10%;}
#vakit_yazi{font-family: Trebuchet MS;font-size:20px;color:#749c7a;font-weight:bold;text-align:center;margin-top:5%;}
#sayilan_vakit{font-family: "Trebuchet MS", Helvetica, sans-serif;font-size:2.0em;text-align:center;margin-top:5.2%;}
#hadis{width:90%;padding-left:5%;font-family:"Trebuchet MS", Helvetica, sans-serif;font-size:1.1em;color:#666666;text-decoration:justify;padding-bottom:5px;line-height: 1.4;}
#hadis_bar{width:100%;height:30%;font-family:"Times New Roman";color:#7781a1;font-style:italic;font-size:2.0em;padding-left:5%;margin-top:5px;line-height: 1.2;}
}

@media (max-width: 767px) {
#scene{left:0;width:2301px;height:83%;}
#page_one{float:left;width:767px;height:100%;background-color:#ecf0f1;}
#page_two{text-align:center;float:left;width:767px;height:100%;background-color:#ecf0f1;}
#page_three{float:left;width:767px;height:100%;background-color:#ecf0f1;}
#bar{width:100%;height:10%;}
#kalan_sure_yazi{font-family: Trebuchet MS;font-size:20px;color:#749c7a;font-weight:bold;text-align:center;margin-top:10%;}
#kalan_sure{text-align:center;margin:auto;font-family:"Trebuchet MS", Helvetica, sans-serif;color:#666666;font-size:20px;margin-top:10%;}
#saat_kucuk{font-family:"Trebuchet MS", Helvetica, sans-serif;color:#666666;font-size:1.1em;margin-top:9%;}
#vakit_yazi{font-family: Trebuchet MS;font-size:20px;color:#749c7a;font-weight:bold;text-align:center;margin-top:5%;}
#sayilan_vakit{font-family: "Trebuchet MS", Helvetica, sans-serif;font-size:2.0em;text-align:center;margin-top:5.2%;}
#hadis{width:90%;padding-left:5%;font-family:"Trebuchet MS", Helvetica, sans-serif;font-size:1.1em;color:#666666;text-decoration:justify;padding-bottom:5px;line-height: 1.4;}
#hadis_bar{width:100%;height:30%;font-family:"Times New Roman";color:#7781a1;font-style:italic;font-size:2.0em;padding-left:5%;margin-top:5px;line-height: 1.2;}
}

@media (max-width: 480px) {
#scene{left:0;width:1440px;height:83%;}
#page_one{float:left;width:480px;height:100%;background-color:#ecf0f1;}
#page_two{text-align:center;float:left;width:480px;height:100%;background-color:#ecf0f1;}
#page_three{float:left;width:480px;height:100%;background-color:#ecf0f1;}
#bar{width:100%;height:10%;}
#kalan_sure_yazi{font-family: Trebuchet MS;font-size:20px;color:#749c7a;font-weight:bold;text-align:center;margin-top:10%;}
#kalan_sure{text-align:center;margin:auto;font-family:"Trebuchet MS", Helvetica, sans-serif;color:#666666;font-size:20px;margin-top:10%;}
#saat_kucuk{font-family:"Trebuchet MS", Helvetica, sans-serif;color:#666666;font-size:1.0em;margin-top:7%;}
#vakit_yazi{font-family: Trebuchet MS;font-size:20px;color:#749c7a;font-weight:bold;text-align:center;margin-top:5%;}
#sayilan_vakit{font-family: "Trebuchet MS", Helvetica, sans-serif;font-size:2.0em;text-align:center;margin-top:5.2%;}
#hadis{width:90%;padding-left:5%;font-family:"Trebuchet MS", Helvetica, sans-serif;font-size:1.1em;color:#666666;text-decoration:justify;padding-bottom:5px;line-height: 1.4;}
#hadis_bar{width:100%;height:30%;font-family:"Times New Roman";color:#7781a1;font-style:italic;font-size:2.0em;padding-left:5%;margin-top:5px;line-height: 1.2;}
}

@media (min-width: 320px) and (max-width: 360px) {
#scene{left:0;width:1440px;height:83%;}
#page_one{float:left;width:360px;height:100%;background-color:#ecf0f1;}
#page_two{text-align:center;float:left;width:360px;height:100%;background-color:#ecf0f1;}
#page_three{float:left;width:360px;height:100%;background-color:#ecf0f1;}
#bar{width:100%;height:10%;}
#bar{width:100%;height:10%;}
#kalan_sure_yazi{font-family: Trebuchet MS;font-size:20px;color:#749c7a;font-weight:bold;text-align:center;margin-top:10%;}
#kalan_sure{text-align:center;margin:auto;font-family:"Trebuchet MS", Helvetica, sans-serif;color:#666666;font-size:20px;margin-top:10%;}
#saat_kucuk{font-family:"Trebuchet MS", Helvetica, sans-serif;color:#666666;font-size:1.0em;margin-top:7%;}
#vakit_yazi{font-family: Trebuchet MS;font-size:20px;color:#749c7a;font-weight:bold;text-align:center;margin-top:5%;}
#sayilan_vakit{font-family: "Trebuchet MS", Helvetica, sans-serif;font-size:2.0em;text-align:center;margin-top:5.2%;}
#hadis{width:90%;padding-left:5%;font-family:"Trebuchet MS", Helvetica, sans-serif;font-size:1.1em;color:#666666;text-decoration:justify;padding-bottom:5px;line-height: 1.4;}
#hadis_bar{width:100%;height:30%;font-family:"Times New Roman";color:#7781a1;font-style:italic;font-size:2.0em;padding-left:5%;margin-top:5px;line-height: 1.2;}
}

@media (max-width: 320px) {
#scene{left:0;width:960px;height:83%;}
#page_one{float:left;width:320px;height:100%;background-color:#ecf0f1;}
#page_two{text-align:center;float:left;width:320px;height:100%;background-color:#ecf0f1;}
#page_three{float:left;width:320px;height:100%;background-color:#ecf0f1;}
#bar{width:100%;height:10%;}
#kalan_sure_yazi{font-family: Trebuchet MS;font-size:20px;color:#749c7a;font-weight:bold;text-align:center;margin-top:10%;}
#kalan_sure{text-align:center;margin:auto;font-family:"Trebuchet MS", Helvetica, sans-serif;color:#666666;font-size:20px;margin-top:10%;}
#saat_kucuk{font-family:"Trebuchet MS", Helvetica, sans-serif;color:#666666;font-size:0.9em;margin-top:3%;}
#vakit_yazi{font-family: Trebuchet MS;font-size:20px;color:#749c7a;font-weight:bold;text-align:center;margin-top:7%;}
#sayilan_vakit{font-family: "Trebuchet MS", Helvetica, sans-serif;font-size:2.0em;text-align:center;margin-top:1.2%;}
#hadis{width:90%;padding-left:5%;font-family:"Trebuchet MS", Helvetica, sans-serif;font-size:1.1em;color:#666666;padding-bottom:5%;text-decoration:justify;margin-top:10%;line-height: 1.4;}
#hadis_bar{width:100%;height:30%;font-family:"Times New Roman";color:#7781a1;font-style:italic;font-size:2.0em;margin-top:5%;padding-left:5%;line-height: 1.2;}
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Tweenable - Shifty</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">

            API Docs for: 1.5.2

APIs

Classes

Modules

            <input type="search" id="api-filter" placeholder="Type to filter APIs">

Tweenable

Tweenable

Tweenable.token

        Show:

            <input type="checkbox" id="api-show-inherited" checked>
            Inherited

            <input type="checkbox" id="api-show-protected">
            Protected

            <input type="checkbox" id="api-show-private">
            Private

            <input type="checkbox" id="api-show-deprecated">
            Deprecated

Tweenable Module

            Defined in: dist/shifty.js:260

Tweenable constructor.

This module provides the following classes:

                        Tweenable

This module is a rollup of the following modules:

                        Tweenable.token

                        This module adds string interpolation support to Shifty.

The Token extension allows Shifty to tween numbers inside of strings.  Among
other things, this allows you to animate CSS properties.  For example, you
can do this:

    var tweenable = new Tweenable();
    tweenable.tween({
      from: { transform: 'translateX(45px)' },
      to: { transform: 'translateX(90xp)' }
    });

translateX(45) will be tweened to translateX(90).  To demonstrate:

    var tweenable = new Tweenable();
    tweenable.tween({
      from: { transform: 'translateX(45px)' },
      to: { transform: 'translateX(90px)' },
      step: function (state) {
        console.log(state.transform);
      }
    });

The above snippet will log something like this in the console:

    translateX(60.3px)
    ...
    translateX(76.05px)
    ...
    translateX(90px)

Another use for this is animating colors:

    var tweenable = new Tweenable();
    tweenable.tween({
      from: { color: 'rgb(0,255,0)' },
      to: { color: 'rgb(255,0,255)' },
      step: function (state) {
        console.log(state.color);
      }
    });

The above snippet will log something like this:

    rgb(84,170,84)
    ...
    rgb(170,84,170)
    ...
    rgb(255,0,255)

This extension also supports hexadecimal colors, in both long (#ff00ff)
and short (#f0f) forms.  Be aware that hexadecimal input values will be
converted into the equivalent RGB output values.  This is done to optimize
for performance.

    var tweenable = new Tweenable();
    tweenable.tween({
      from: { color: '#0f0' },
      to: { color: '#f0f' },
      step: function (state) {
        console.log(state.color);
      }
    });

This snippet will generate the same output as the one before it because
equivalent values were supplied (just in hexadecimal form rather than RGB):

    rgb(84,170,84)
    ...
    rgb(170,84,170)
    ...
    rgb(255,0,255)

## Easing support

Easing works somewhat differently in the Token extension.  This is because
some CSS properties have multiple values in them, and you might need to
tween each value along its own easing curve.  A basic example:

    var tweenable = new Tweenable();
    tweenable.tween({
      from: { transform: 'translateX(0px) translateY(0px)' },
      to: { transform:   'translateX(100px) translateY(100px)' },
      easing: { transform: 'easeInQuad' },
      step: function (state) {
        console.log(state.transform);
      }
    });

The above snippet will create values like this:

    translateX(11.56px) translateY(11.56px)
    ...
    translateX(46.24px) translateY(46.24px)
    ...
    translateX(100px) translateY(100px)

In this case, the values for translateX and translateY are always the
same for each step of the tween, because they have the same start and end
points and both use the same easing curve.  We can also tween translateX
and translateY along independent curves:

    var tweenable = new Tweenable();
    tweenable.tween({
      from: { transform: 'translateX(0px) translateY(0px)' },
      to: { transform:   'translateX(100px) translateY(100px)' },
      easing: { transform: 'easeInQuad bounce' },
      step: function (state) {
        console.log(state.transform);
      }
    });

The above snippet will create values like this:

    translateX(10.89px) translateY(82.35px)
    ...
    translateX(44.89px) translateY(86.73px)
    ...
    translateX(100px) translateY(100px)

translateX and translateY are not in sync anymore, because easeInQuad
was specified for translateX and bounce for translateY.  Mixing and
matching easing curves can make for some interesting motion in your
animations.

The order of the space-separated easing curves correspond the token values
they apply to.  If there are more token values than easing curves listed,
the last easing curve listed is used.


text:
require 'active_support/core_ext/module'

module Kangaroo
  module Model
    module Finder
      RELATION_DELEGATES = %w(where limit offset order select context reverse)
      delegate *(RELATION_DELEGATES + [:to => :relation])

      def find_in_batches batch_size = 100
        relation.find_in_batches(batch_size)
      end

      # Retrieve all records
      #
      # @return [Array] records
      def all
        relation.all
      end

      # Retrieve one column
      #
      # @param [String, Symbol] column/field
      # #return [Array] values
      def pluck column
        relation.pluck column
      end

      # ActiveRecord-ish find method
      #
      # @overload find(id)
      #   Find a record by id
      #   @param [Number] id
      # @overload find(keyword)
      #   Find all, first or last record
      #   @param [String, Symbol] keyword :all, :first or :last
      def find id_or_keyword
        case id_or_keyword
        when :all, 'all'
          all
        when :first, 'first'
          first
        when :last, 'last'
          last
        else
          super
        end
      end

      def exists? ids
        where(:id => ids).exists?
      end

      # Retrieve first record
      #
      # @return record
      def first
        relation.first
      end

      # Retrieve last record
      #
      # @return record
      def last
        relation.last
      end

      # Count number of records
      #
      # @return [Number]
      def count
        count_by
      end

      # @private
      # Search, read and instantiate records at once
      #
      # @param [Array, Hash, String] conditions
      # @param [Hash] search_options
      # @param [Hash] read_options
      # @return [Array]
      def search_and_read conditions, search_options = {}, read_options = {}
        ids = search conditions, search_options.merge(:count => false)
        return [] if ids.blank?

        read ids, read_options
      end

      # @private
      # Count objects matching the conditions
      #
      # @param [Array, Hash, String] conditions
      # @param [Hash] search options
      # @return [Number]
      def count_by conditions = [], search_options = {}
        search conditions, search_options.merge(:count => true)
      end

      # @private
      def relation
        @relation ||= Relation.new self
      end
    end
  end
end


text:
#include "../data_types/tensor.h"
#include "../utility/helper.h"

#ifndef NEXURALNET_DNN_I_LAYER
#define NEXURALNET_DNN_I_LAYER

namespace nexural {
	class ILayer {
	public:
		virtual ~ILayer() { }
		virtual void FeedForward(const Tensor& inputData, const NetworkState networkState) = 0;
		virtual Tensor* GetOutput() = 0;
		virtual Tensor* GetLayerErrors() = 0;
		virtual LayerShape GetOutputShape() = 0;
		virtual void SetupLayerForTraining() = 0;
	};
}
#endif


text:
require_relative '../spec_helper'
require_relative '../../libraries/resource_shipyard_agent_service'

describe Chef::Resource::ShipyardAgentService do
  [:install_type, :docker_image].each do |i|
    let(i) { nil }
  end
  let(:resource) do
    r = Chef::Resource::ShipyardAgentService.new('my_agent', nil)
    r.install_type(install_type)
    r.docker_image(docker_image)
    r
  end

  describe '#initialize' do
    it 'defaults to the GitHub provider' do
      expected = Chef::Provider::ShipyardAgentService::Standard
      expect(resource.instance_variable_get(:@provider)).to eq(expected)
    end

    it 'defaults to the "create" + "enable" + "start" actions' do
      expected = [:create, :enable, :start]
      expect(resource.instance_variable_get(:@action)).to eq(expected)
    end
  end

  describe '#install_type' do
    let(:override) { nil }
    let(:resource) do
      r = super()
      r.install_type(override)
      r
    end

    context 'no override provided' do
      it 'defaults to a GitHub install' do
        expect(resource.install_type).to eq(:standard)
      end
    end

    context 'a valid override provided' do
      let(:override) { 'container' }

      it 'returns the override symbolized' do
        expect(resource.install_type).to eq(:container)
      end

      it 'sets the corresponding provider' do
        expected = Chef::Provider::ShipyardAgentService::Container
        expect(resource.provider).to eq(expected)
        expect(resource.instance_variable_get(:@provider)).to eq(expected)
      end
    end

    context 'an invalid override provided' do
      let(:install_type) { 'monkeys' }

      it 'raises an exception' do
        expect { resource }.to raise_error(Chef::Exceptions::ValidationFailed)
      end
    end
  end

  describe '#config_file' do
    let(:override) { nil }
    let(:resource) do
      r = super()
      r.config_file(override)
      r
    end

    before(:each) do
      path = override || '/etc/default/shipyard-agent'
      allow(::File).to receive(:exist?).with(path).and_return(true)
    end

    context 'no override provided' do
      it 'defaults to "/etc/default/shipyard-agent"' do
        expect(resource.config_file).to eq('/etc/default/shipyard-agent')
      end
    end

    context 'a valid override provided' do
      let(:override) { '/tmp/agent' }

      it 'returns the override' do
        expect(resource.config_file).to eq('/tmp/agent')
      end
    end

    context 'an invalid override provided' do
      let(:install_type) { :monkeys }

      it 'raises an exception' do
        expect { resource }.to raise_error(Chef::Exceptions::ValidationFailed)
      end
    end

    context 'a missing config file' do
      let(:override) { '/etc/wiggles' }

      before(:each) do
        allow(::File).to receive(:exist?).with(override).and_return(false)
      end

      it 'raises an exception' do
        expect { resource }.to raise_error(Chef::Exceptions::ValidationFailed)
      end
    end
  end

  describe '#docker_image' do
    let(:override) { nil }
    let(:resource) do
      r = super()
      r.docker_image(override)
      r
    end

    context 'no override provided' do
      context 'a default install' do
        it 'returns nil' do
          expect(resource.docker_image).to eq(nil)
        end
      end

      context 'a container-based install' do
        let(:install_type) { :container }

        it 'returns "shipyard/agent"' do
          expect(resource.docker_image).to eq('shipyard/agent')
        end
      end

      context 'a valid override provided' do
        let(:override) { 'ship/yard' }

        context 'a default install' do
          it 'raises an exception' do
            expect { resource }.to raise_error(Chef::Exceptions::ValidationFailed)
          end
        end

        context 'a container-based install' do
          let(:install_type) { :container }

          it 'returns the overridden container' do
            expect(resource.docker_image).to eq('ship/yard')
          end
        end
      end

      context 'an invalid override provided' do
        let(:override) { :container }

        context 'a default install' do
          it 'raises an exception' do
            expect { resource }.to raise_error(Chef::Exceptions::ValidationFailed)
          end
        end

        context 'a container-based install' do
          let(:install_type) { :container }

          it 'raises an exception' do
            expect { resource }.to raise_error(Chef::Exceptions::ValidationFailed)
          end
        end
      end
    end
  end
end


text:
package io.fabric8.process.manager.commands.support;

import java.net.MalformedURLException;
import java.net.URL;

import io.fabric8.process.manager.InstallOptions;
import io.fabric8.process.manager.ProcessManager;
import org.apache.felix.gogo.commands.Option;
import org.osgi.framework.BundleContext;

/**
 */
public abstract class InstallActionSupport extends ProcessCommandSupport {

    @Option(name="-c", aliases={"--controllerUrl"}, required = false, description = "The optional JSON document URL containing the controller configuration")
    protected String controllerJson;
    @Option(name="-k", aliases={"--kind"}, required = false, description = "The kind of controller to create")
    protected String controllerKind;
    @Option(name="-i", aliases={"--id"}, required = false, description = "The ID of the process to create (defaults to an incrementing number)")
    protected String id;

    private final BundleContext bundleContext;

    protected InstallActionSupport(ProcessManager processManager, BundleContext bundleContext) {
        super(processManager);
        this.bundleContext = bundleContext;
    }

    public BundleContext getBundleContext() {
        return bundleContext;
    }

    protected URL getControllerURL() throws MalformedURLException {
        URL controllerUrl = null;
        if (controllerJson != null) {
            controllerUrl = new URL(controllerJson);
        } else if (controllerKind != null) {
            String name = controllerKind + ".json";
            controllerUrl = getBundleContext().getBundle().getResource(name);
            if (controllerUrl == null) {
                throw new IllegalStateException("Cannot find controller kind: " + name + " on the classpath");
            }
        }
        return controllerUrl;
    }

    protected InstallOptions build(InstallOptions.InstallOptionsBuilder builder) throws MalformedURLException {
        if (id != null) {
            builder = builder.id(id);
        }
        return builder.build();
    }
}


text:
require File.expand_path('../application', __FILE__)

# Initialize the Rails application.
Arfaian::Application.initialize!