text:
#ifndef CAFFE2_CORE_COMMON_GPU_H_
#define CAFFE2_CORE_COMMON_GPU_H_

#include <assert.h>
#include <cuda.h>
#include <cuda_runtime.h>

// Disable strict aliasing errors for CUDA 9.
// The cuda_fp16.h header in CUDA 9 RC triggers this diagnostic.
// It is included by cusparse.h as well, so guarding the
// inclusion of that header here is not enough.
#if CUDA_VERSION >= 9000
#ifdef __GNUC__
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
#pragma GCC diagnostic push
#endif
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
#endif // CUDA_VERSION >= 9000

#include <cublas_v2.h>
#include <curand.h>
#include <driver_types.h>

#include "caffe2/core/logging.h"
#include "caffe2/core/common.h"

// This is a macro defined for cuda fp16 support. In default, cuda fp16 is
// supported by NVCC 7.5, but it is also included in the Tegra X1 platform with
// a (custom?) NVCC 7.0. As a result, we would normally just check the cuda
// version here, but would also allow a use to pass in the flag
// CAFFE_HAS_CUDA_FP16 manually.

#ifndef CAFFE_HAS_CUDA_FP16
#if CUDA_VERSION >= 7050
#define CAFFE_HAS_CUDA_FP16
#endif  // CUDA_VERSION >= 7050
#endif  // CAFFE_HAS_CUDA_FP16

#ifdef CAFFE_HAS_CUDA_FP16
#include <cuda_fp16.h>
#endif

// Re-enable strict aliasing diagnostic if it was disabled.
#if CUDA_VERSION >= 9000
#ifdef __GNUC__
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
#pragma GCC diagnostic pop
#endif
#endif // __GNUC__
#endif // CUDA_VERSION >= 9000

/**
 * The maximum number of GPUs that caffe2 recognizes.
 */
#define CAFFE2_COMPILE_TIME_MAX_GPUS 16
/**
 * The maximum number of peers that each gpu can have when doing p2p setup.
 * Currently, according to NVidia documentation, each device can support a
 * system-wide maximum of eight peer connections.
 * When Caffe2 sets up peer access resources, if we have more than 8 gpus,
 * we will enable peer access in groups of 8.
 */
#define CAFFE2_CUDA_MAX_PEER_SIZE 8

namespace caffe2 {

#if CUDA_VERSION >= 9000
/**
 * Empty class to identify TensorCore-based math
 */
class TensorCoreEngine {};
#endif

/**
 * A runtime function to report the cuda version that Caffe2 is built with.
 */
inline int CudaVersion() { return CUDA_VERSION; }

/**
 * Returns the number of devices.
 */
int NumCudaDevices();

/**
 * Check if the current running session has a cuda gpu present.
 *
 * Note that this is different from having caffe2 built with cuda. Building
 * Caffe2 with cuda only guarantees that this function exists. If there are no
 * cuda gpus present in the machine, or there are hardware configuration
 * problems like an insufficient driver, this function will still return false,
 * meaning that there is no usable GPU present.
 *
 * In the open source build, it is possible that Caffe2's GPU code is
 * dynamically loaded, and as a result a library could be only linked to the
 * CPU code, but want to test if cuda is later available or not. In this case,
 * one should use HasCudaRuntime() from common.h.
 */
inline bool HasCudaGPU() { return NumCudaDevices() > 0; }

/**
 * Sets the default GPU id for Caffe2.
 *
 * If an operator is set to run on Cuda GPU but no gpu id is given, we will use
 * the default gpu id to run the operator. Before this function is explicitly
 * called, GPU 0 will be the default GPU id.
 */
void SetDefaultGPUID(const int deviceid);

/**
 * Gets the default GPU id for Caffe2.
 */
int GetDefaultGPUID();

/**
 * Gets the current GPU id. This is a simple wrapper around cudaGetDevice().
 */
int CaffeCudaGetDevice();

/**
 * Gets the current GPU id. This is a simple wrapper around cudaGetDevice().
 */
void CaffeCudaSetDevice(const int id);

/**
 * Gets the GPU id that the current pointer is located at.
 */
int GetGPUIDForPointer(const void* ptr);

/**
 * Gets the device property for the given device. This function is thread safe.
 */
const cudaDeviceProp& GetDeviceProperty(const int device);

/**
 * Runs a device query function and prints out the results to LOG(INFO).
 */
void DeviceQuery(const int deviceid);

/**
 * Return a peer access pattern by returning a matrix (in the format of a
 * nested vector) of boolean values specifying whether peer access is possible.
 *
 * This function returns false if anything wrong happens during the query of
 * the GPU access pattern.
 */
bool GetCudaPeerAccessPattern(vector<vector<bool> >* pattern);

/**
 * Return the availability of TensorCores for math
 */
bool TensorCoreAvailable();

/**
 * Return a human readable cublas error string.
 */
const char* cublasGetErrorString(cublasStatus_t error);

/**
 * Return a human readable curand error string.
 */
const char* curandGetErrorString(curandStatus_t error);

// CUDA: various checks for different function calls.
#define CUDA_ENFORCE(condition, ...)     \
  do {                              \
    cudaError_t error = condition;  \
    CAFFE_ENFORCE_EQ(               \
        error,                      \
        cudaSuccess,                \
        "Error at: ",               \
        __FILE__,                   \
        ":",                        \
        __LINE__,                   \
        ": ",                       \
        cudaGetErrorString(error), ##__VA_ARGS__); \
  } while (0)
#define CUDA_CHECK(condition)                                 \
  do {                                                        \
    cudaError_t error = condition;                            \
    CHECK(error == cudaSuccess) << cudaGetErrorString(error); \
  } while (0)

#define CUDA_DRIVERAPI_ENFORCE(condition)                            \
  do {                                                               \
    CUresult result = condition;                                     \
    if (result != CUDA_SUCCESS) {                                    \
      const char* msg;                                               \
      cuGetErrorName(result, &msg);                                  \
      CAFFE_THROW("Error at: ", __FILE__, ":", __LINE__, ": ", msg); \
    }                                                                \
  } while (0)
#define CUDA_DRIVERAPI_CHECK(condition)                                 \
  do {                                                                  \
    CUresult result = condition;                                        \
    if (result != CUDA_SUCCESS) {                                       \
      const char* msg;                                                  \
      cuGetErrorName(result, &msg);                                     \
      LOG(FATAL) << "Error at: " << __FILE__ << ":" << __LINE__ << ": " \
                 << msg;                                                \
    }                                                                   \
  } while (0)

#define CUBLAS_ENFORCE(condition)                \
  do {                                           \
    cublasStatus_t status = condition;           \
    CAFFE_ENFORCE_EQ(                            \
        status,                                  \
        CUBLAS_STATUS_SUCCESS,                   \
        "Error at: ",                            \
        __FILE__,                                \
        ":",                                     \
        __LINE__,                                \
        ": ",                                    \
        ::caffe2::cublasGetErrorString(status)); \
  } while (0)
#define CUBLAS_CHECK(condition)                    \
  do {                                             \
    cublasStatus_t status = condition;             \
    CHECK(status == CUBLAS_STATUS_SUCCESS)         \
        << ::caffe2::cublasGetErrorString(status); \
  } while (0)

#define CURAND_ENFORCE(condition)                \
  do {                                           \
    curandStatus_t status = condition;           \
    CAFFE_ENFORCE_EQ(                            \
        status,                                  \
        CURAND_STATUS_SUCCESS,                   \
        "Error at: ",                            \
        __FILE__,                                \
        ":",                                     \
        __LINE__,                                \
        ": ",                                    \
        ::caffe2::curandGetErrorString(status)); \
  } while (0)
#define CURAND_CHECK(condition)                    \
  do {                                             \
    curandStatus_t status = condition;             \
    CHECK(status == CURAND_STATUS_SUCCESS)         \
        << ::caffe2::curandGetErrorString(status); \
  } while (0)

#define CUDA_1D_KERNEL_LOOP(i, n)                                 \
  for (size_t i = blockIdx.x * blockDim.x + threadIdx.x; i < (n); \
       i += blockDim.x * gridDim.x)

// CUDA_KERNEL_ASSERT is a macro that wraps an assert() call inside cuda
// kernels. This is not supported by Apple platforms so we special case it.
// See http://docs.nvidia.com/cuda/cuda-c-programming-guide/#assertion
#ifdef __APPLE__
#define CUDA_KERNEL_ASSERT(...)
#else  // __APPLE__
#define CUDA_KERNEL_ASSERT(...) assert(__VA_ARGS__)
#endif  // __APPLE__

// The following helper functions are here so that you can write a kernel call
// when you are not particularly interested in maxing out the kernels'
// performance. Usually, this will give you a reasonable speed, but if you
// really want to find the best performance, it is advised that you tune the
// size of the blocks and grids more reasonably.
// A legacy note: this is derived from the old good Caffe days, when I simply
// hard-coded the number of threads and wanted to keep backward compatibility
// for different computation capabilities.
// For more info on CUDA compute capabilities, visit the NVidia website at:
//    http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#compute-capabilities

// The number of cuda threads to use. 512 is used for backward compatibility,
// and it is observed that setting it to 1024 usually does not bring much
// performance gain (which makes sense, because warp size being 32 means that
// blindly setting a huge block for a random kernel isn't optimal).
constexpr int CAFFE_CUDA_NUM_THREADS = 512;
// The maximum number of blocks to use in the default kernel call. We set it to
// 4096 which would work for compute capability 2.x (where 65536 is the limit).
// This number is very carelessly chosen. Ideally, one would like to look at
// the hardware at runtime, and pick the number of blocks that makes most
// sense for the specific runtime environment. This is a todo item.
constexpr int CAFFE_MAXIMUM_NUM_BLOCKS = 4096;

/**
 * @brief Compute the number of blocks needed to run N threads.
 */
inline int CAFFE_GET_BLOCKS(const int N) {
  return std::min((N + CAFFE_CUDA_NUM_THREADS - 1) / CAFFE_CUDA_NUM_THREADS,
                  CAFFE_MAXIMUM_NUM_BLOCKS);
}

class DeviceGuard {
 public:
  explicit DeviceGuard(int newDevice) : previous_(CaffeCudaGetDevice()) {
    if (previous_ != newDevice) {
      CaffeCudaSetDevice(newDevice);
    }
  }

  ~DeviceGuard() noexcept {
    CaffeCudaSetDevice(previous_);
  }

 private:
  int previous_;
};

}  // namespace caffe2
#endif  // CAFFE2_CORE_COMMON_GPU_H_


text:
<?php

namespace app\models;

use yii\db\ActiveRecord;

/**
 * @property integer coupon_id
 * @property integer user_id
 * @property string name
 * @property string description
 * @property integer chance_type_id
 * @property boolean active
 */
class Coupon extends ActiveRecord
{
    public static function tableName()
    {
        return 'coupon';
    }

    public function rules()
    {
        return [
            [['user_id', 'name', 'chance_type_id', 'active'], 'required'],
            ['description', 'string'],
            ['active', 'boolean'],
        ];
    }

    public function attributeLabels()
    {
        return [
            'name' => 'Название',
            'description' => 'Описание',
            'chance_type_id' => 'Вероятность выпадения',
            'active' => 'Активен',
        ];
    }

    public static function findIdentity($couponId)
    {
        return self::findOne(['coupon_id' => $couponId]);
    }

    public static function findByUserId($userId)
    {
        return self::findAll(['user_id' => $userId]);
    }
}

redpajama_set_name: RedPajamaGithub


text:
package no.digipost.concurrent.executor;

import no.digipost.DiggConcurrent;

import java.time.Duration;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
import java.util.function.LongFunction;

/**
 * @deprecated Use {@link DiggConcurrent} instead. This will eventually be removed.
 */
@Deprecated
public final class DefaultExecutors {

    /**
     * @see DiggConcurrent#fixedThreadPool(int, String)
     */
    public static ExecutorService fixedThreadPool(int threadAmount, String name) {
        return DiggConcurrent.fixedThreadPool(threadAmount, name);
    }

    /**
     * @see DiggConcurrent#singleThreaded(String)
     */
    public static ExecutorService singleThreaded(String name) {
        return DiggConcurrent.singleThreaded(name);
    }

    /**
     * @see DiggConcurrent#scheduledSingleThreaded(String)
     */
    public static ScheduledExecutorService scheduledSingleThreaded(String name) {
        return DiggConcurrent.scheduledSingleThreaded(name);
    }

    /**
     * @see DiggConcurrent#scheduled(int, String)
     */
    public static ScheduledExecutorService scheduled(int threadAmount, String name) {
        return DiggConcurrent.scheduled(threadAmount, name);
    }

    /**
     * @see DiggConcurrent#threadNamingFactory(String)
     */
    public static ThreadFactory threadNamingFactory(String threadBaseName) {
        return DiggConcurrent.threadNamingFactory(threadBaseName);
    }

    /**
     * @see DiggConcurrent#threadNamingFactory(LongFunction)
     */
    public static ThreadFactory threadNamingFactory(LongFunction<String> threadName) {
        return DiggConcurrent.threadNamingFactory(threadName);
    }

    /**
     * @see DiggConcurrent#threadNamingFactory(LongFunction, ThreadFactory)
     */
    public static ThreadFactory threadNamingFactory(LongFunction<String> threadName, ThreadFactory backingFactory) {
        return DiggConcurrent.threadNamingFactory(threadName, backingFactory);
    }

    /**
     * @see DiggConcurrent#externallyManaged(ExecutorService)
     */
    public static ExecutorService externallyManaged(ExecutorService executor) {
        return DiggConcurrent.externallyManaged(executor);
    }

    /**
     * @see DiggConcurrent#isExternallyManaged(ExecutorService)
     */
    public static boolean isExternallyManaged(ExecutorService executor) {
        return DiggConcurrent.isExternallyManaged(executor);
    }

    /**
     * @see DiggConcurrent#ensureShutdown(ExecutorService, Duration)
     */
    public static void ensureShutdown(ExecutorService executor, Duration timeoutBeforeForcefulShutdown) {
        DiggConcurrent.ensureShutdown(executor, timeoutBeforeForcefulShutdown);
    }

    /**
     * @see DiggConcurrent#ensureShutdown(String, ExecutorService, Duration)
     */
    public static void ensureShutdown(String executorName, ExecutorService executor, Duration timeoutBeforeForcefulShutdown) {
        DiggConcurrent.ensureShutdown(executorName, executor, timeoutBeforeForcefulShutdown);
    }

    private DefaultExecutors() {}
}


text:
package biz.paluch.logging.gelf.intern.sender;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.when;

import java.util.Arrays;
import java.util.List;

import org.assertj.core.api.ThrowableAssert;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import biz.paluch.logging.gelf.intern.GelfSenderConfiguration;

/**
 * @author Rifat Döver
 */
@ExtendWith(MockitoExtension.class)
class KafkaGelfSenderProviderUnitTest {

    @Mock
    GelfSenderConfiguration configuration;

    private KafkaGelfSenderProvider kafkaSenderProvider = new KafkaGelfSenderProvider();

    @Test
    void testSupports() {

        List<String> prefixes = Arrays.asList(null, "", "tcp", "kafka");

        for (String prefix : prefixes) {
            assertThat(kafkaSenderProvider.supports(prefix)).as("Prefix '" + prefix + "'").isFalse();
        }

        assertThat(kafkaSenderProvider.supports("kafka:")).isTrue();
    }

    @Test
    void testValidUri() {

        String host = "kafka://localhost:9092,localhost:9093?acks=1&ssl.keystore.location=/var/private/ssl/kafka.server.keystore.jks&retries=2#kafka-log-topic";
        when(configuration.getHost()).thenReturn(host);
        assertThat(kafkaSenderProvider.create(configuration)).isNotNull();
    }

    @Test
    void testUnspecifiedTopic() {

        String host = "kafka://localhost:9092,localhost:9093?acks=1&ssl.keystore.location=/var/private/ssl/kafka.server.keystore.jks&retries=2#";
        when(configuration.getHost()).thenReturn(host);

        assertThatThrownBy(new ThrowableAssert.ThrowingCallable() {
            @Override
            public void call() throws Throwable {
                kafkaSenderProvider.create(configuration);
            }
        }).hasMessage("Kafka URI must specify log topic as fragment.");

        host = "kafka://localhost:9092,localhost:9093?acks=1&ssl.keystore.location=/var/private/ssl/kafka.server.keystore.jks&retries=2";
        when(configuration.getHost()).thenReturn(host);

        assertThatThrownBy(new ThrowableAssert.ThrowingCallable() {
            @Override
            public void call() throws Throwable {
                kafkaSenderProvider.create(configuration);
            }
        }).hasMessage("Kafka URI must specify log topic as fragment.");
    }

    @Test
    void testUnspecifiedBroker() {

        String host = "kafka://?acks=1&ssl.keystore.location=/var/private/ssl/kafka.server.keystore.jks&retries=2#";
        when(configuration.getHost()).thenReturn(host);

        assertThatThrownBy(new ThrowableAssert.ThrowingCallable() {
            @Override
            public void call() throws Throwable {
                kafkaSenderProvider.create(configuration);
            }
        }).hasMessage("Kafka URI must specify bootstrap.servers.");
    }

    @Test
    void testValidPortNotSpecified() {
        String host = "kafka://localhost#topic";
        when(configuration.getHost()).thenReturn(host);
        assertThat(kafkaSenderProvider.create(configuration)).isNotNull();
    }

    @Test
    void testValidPortSpecifiedInConfig() {
        String host = "kafka://localhost#topic";
        when(configuration.getHost()).thenReturn(host);
        when(configuration.getPort()).thenReturn(9091);
        assertThat(kafkaSenderProvider.create(configuration)).isNotNull();
    }
}


text:
EventoApp
===================================

Nesse projeto vamos desenvolver um aplicativo de eventos, onde mostraremos a programação da Semana do Desenvolvimento Android e todos os materiais extras disponíveis no evento. Você poderá usar esse projeto como exemplo para criar outros aplicativos de eventos, como por exemplo, eventos em sua cidade, shows e etc.

***Esse projeto faz parte da Semana do Desenvolvimento Android (http://semana.androidaccelerate.com.br/).***

Pré-requisitos
--------------
- Android SDK 23 ou mais novo
- Build Tools version 23.0.2
- Android Support AppCompat 23.4.0

Começando
---------------
Este exemplo usa o sistema de compilação Gradle. Para compilar este projeto, use o comando "gradle build" ou utilize "Project Import" no Android Studio.

Comunidade
-------

Esse é o nosso espaço para conversarmos, nos conhecermos e tirarmos dúvidas. Suporte e perguntas também são aqui. Isso é para fortalecer e ter um único espaço de interação onde todos podem se encontrar.

- http://semana.androidaccelerate.com.br/

Sugestões de correções do projeto são muito bem vindas, devem ser apresentadas efetuando um fork do projeto e efetuando um pull request através do Github.

Licença
-------
Copyright 2016 AndroidPro.

Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements.  See the NOTICE file distributed with this work for
additional information regarding copyright ownership.  The ASF licenses this
file to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License.  You may obtain a copy of
the License at

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

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


text:
package com.github.rma350.jgraphv.core.shapes;

import com.github.rma350.jgraphv.core.engine.Camera;
import com.github.rma350.jgraphv.core.portable.GL;

public class PointsShader {

  private static final String uModel = "uModel";
  private static final String uView = "uView";
  private static final String uProjection = "uProjection";
  private static final String aPosition = "aPosition";
  private static final String aSize = "aSize";

  private static final String vertexShaderCode =
      "uniform mat4 " + uModel + ";\n" +
      "uniform mat4 "  + uView + ";\n" +
      "uniform mat4 " + uProjection + ";\n" +
      "attribute vec4 " + aPosition + ";\n" +
      "attribute float " + aSize + ";\n" +
      "void main() {\n" +
      "  gl_PointSize = (" + uView  + "* vec4(" + aSize + ", 0 , 0 , 0)).x;\n" +
      "  gl_Position = " + uProjection + "*" + uView  + "*" +  uModel + "*" + aPosition + ";\n" +
      "}\n";

  private static final String uColor = "uColor";

  private static final String fragmentShaderCode =
      "precision mediump float;\n" +
      "uniform vec4 " + uColor + ";\n" +
      "void main() {\n" +
      "  gl_FragColor = " + uColor + ";\n" +
      "}\n";

  private int mProgram;

  // Attributes
  private int mSize;
  private int mPosition;

  // Uniforms
  private int mColor;
  private int mModel;
  private int mView;
  private int mProjection;
  private GL gl;

  public PointsShader(GL gl) {
    this.gl = gl;
    mProgram = ShaderUtil.createProgram(gl, vertexShaderCode, fragmentShaderCode);
    mSize = gl.glGetAttribLocation(mProgram, aSize);
    mPosition = gl.glGetAttribLocation(mProgram, aPosition);
    mColor = gl.glGetUniformLocation(mProgram, uColor);

    mModel = gl.glGetUniformLocation(mProgram, uModel);
    mView = gl.glGetUniformLocation(mProgram, uView);
    mProjection = gl.glGetUniformLocation(mProgram, uProjection);
  }

  public void use(float r, float g, float b, float a, Camera camera) {
    gl.glUseProgram(mProgram);
    gl.glEnableVertexAttribArray(mSize);
    gl.glEnableVertexAttribArray(mPosition);
    gl.glUniform4f(mColor, r, g, b, a);
    gl.glUniformMatrix4(mView, camera.getView());
    gl.glUniformMatrix4(mProjection, camera.getProjection());
  }

  private static int COORDS_PER_VERTEX = 3;

  static int BYTES_PER_FLOAT = 4;
  static int vertexStrideInBytes = BYTES_PER_FLOAT * COORDS_PER_VERTEX;

  public void draw(PointsBuffer points) {
    gl.glUniformMatrix4(mModel, points.getModelMatrix());
    points.bindBuffer();
    points.ensureOnGpu();
    gl.glVertexAttribPointer(mPosition, 2, false,
        vertexStrideInBytes, 0);
    gl.glVertexAttribPointer(mSize, 1, false,
        vertexStrideInBytes, 2*BYTES_PER_FLOAT);
    gl.glDrawArrays(gl.kGL_POINTS(), 0, points.getVertexCount());
    points.unBindBuffer();
  }

  public void unuse() {
    // GLES20.glDisableVertexAttribArray(mPositionAttr);
  }

  GL getGL(){
    return gl;
  }

}


text:
/**
 * This class was created by <Vazkii>. It's distributed as
 * part of the Botania Mod. Get the Source Code in github:
 * https://github.com/Vazkii/Botania
 *
 * Botania is Open Source and distributed under the
 * Botania License: http://botaniamod.net/license.php
 *
 * File Created @ [Apr 17, 2015, 5:07:25 PM (GMT)]
 */
package vazkii.botania.api.recipe;

import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import vazkii.botania.api.subtile.SubTileEntity;

public class RecipePureDaisy {

	Object input;
	Block output;
	int outputMeta;

	public RecipePureDaisy(Object input, Block output, int outputMeta) {
		this.input = input;
		this.output = output;
		this.outputMeta = outputMeta;

		if(input != null && !(input instanceof String || input instanceof Block))
			throw new IllegalArgumentException("input must be an oredict String or a Block.");
	}

	/**
	 * This gets called every tick, please be careful with your checks.
	 */
	public boolean matches(World world, int x, int y, int z, SubTileEntity pureDaisy) {
		Block block = world.getBlock(x, y, z);
		world.getBlockMetadata(x, y, z);
		if(input instanceof Block && block == input)
			return true;

		ItemStack stack = new ItemStack(block, 1, world.getBlockMetadata(x, y, z));
		String oredict = (String) input;
		return isOreDict(stack, oredict);
	}

	public boolean isOreDict(ItemStack stack, String entry) {
		if(stack == null || stack.getItem() == null)
			return false;

		for(ItemStack ostack : OreDictionary.getOres(entry)) {
			ItemStack cstack = ostack.copy();
			if(cstack.getItemDamage() == Short.MAX_VALUE)
				cstack.setItemDamage(stack.getItemDamage());

			if(stack.isItemEqual(cstack))
				return true;
		}

		return false;
	}

	/**
	 * Returns true if the block was placed (and if the Pure Daisy should do particles and stuffs).
	 * Should only place the block if !world.isRemote, but should return true if it would've placed
	 * it otherwise. You may return false to cancel the normal particles and do your own.
	 */
	public boolean set(World world, int x, int y, int z, SubTileEntity pureDaisy) {
		if(!world.isRemote)
			world.setBlock(x, y, z, output, outputMeta, 1 | 2);
		return true;
	}

	public Object getInput() {
		return input;
	}

	public Block getOutput() {
		return output;
	}

	public int getOutputMeta() {
		return outputMeta;
	}

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace PetStore.Data.Repositories
{
    public interface IGenericRepository<T> where T : class
    {
        T GetById(object id);

        IEnumerable<T> GetAll();

        IEnumerable<T> GetAll(Expression<Func<T, bool>> filterExpression);

        IEnumerable<T> GetAll<T1>(Expression<Func<T, bool>> filterExpression, Expression<Func<T, T1>> sortExpression);

        IEnumerable<T2> GetAll<T1, T2>(Expression<Func<T, bool>> filterExpression, Expression<Func<T, T1>> sortExpression, Expression<Func<T, T2>> selectExpression);

        void Add(T entity);

        void Update(T entity);

        void Delete(T entity);
    }
}


text:
/**
 * Notification Configuration
 *
 * \ingroup AutoScaling
 */

@interface AutoScalingNotificationConfiguration:NSObject

{
    NSString *autoScalingGroupName;
    NSString *topicARN;
    NSString *notificationType;
}

/**
 * Default constructor for a new  object.  Callers should use the
 * property methods to initialize this object after creating it.
 */
-(id)init;

/**
 * Specifies the Auto Scaling group name.
 *

 * Constraints:

 * Length: 1 - 1600

 * Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 */
@property (nonatomic, retain) NSString *autoScalingGroupName;

/**
 * The Amazon Resource Name (ARN) of the Amazon Simple Notification
 * Service (SNS) topic.
 *

 * Constraints:

 * Length: 1 - 1600

 * Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 */
@property (nonatomic, retain) NSString *topicARN;

/**
 * The types of events for an action to start.
 *

 * Constraints:

 * Length: 1 - 255

 * Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 */
@property (nonatomic, retain) NSString *notificationType;

/**
 * Returns a string representation of this object; useful for testing and
 * debugging.
 *
 * @return A string representation of this object.
 */
-(NSString *)description;

@end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Boletus vassilkovii Nazarova {?}

### Remarks
null


text:
Perl 5.26 container image
=================

This container image includes Perl 5.26 as a [S2I](https://github.com/openshift/source-to-image) base image for your Perl 5.26 applications.
Users can choose between RHEL and CentOS based builder images.
The RHEL image is available in the [Red Hat Container Catalog](https://access.redhat.com/containers/#/registry.access.redhat.com/rhscl/perl-526-rhel7)
as registry.access.redhat.com/rhscl/perl-526-rhel7.
The CentOS image is then available on [Docker Hub](https://hub.docker.com/r/centos/perl-526-centos7/)
as centos/perl-526-centos7.
The resulting image can be run using [Docker](http://docker.io).

Description
-----------

Perl 5.26 available as container is a base platform for
building and running various Perl 5.26 applications and frameworks.
Perl is a high-level programming language with roots in C, sed, awk and shell scripting.
Perl is good at handling processes and files, and is especially good at handling text.
Perl's hallmarks are practicality and efficiency. While it is used to do a lot of
different things, Perl's most common applications are system administration utilities
and web programming.

This container image includes an npm utility, so users can use it to install JavaScript
modules for their web applications. There is no guarantee for any specific npm or nodejs
version, that is included in the image; those versions can be changed anytime and
the nodejs itself is included just to make the npm work.

Usage
---------------------
To build a simple [perl-sample-app](https://github.com/sclorg/s2i-perl-container/tree/master/5.26/test/sample-test-app) application,
using standalone [S2I](https://github.com/openshift/source-to-image) and then run the
resulting image with [Docker](http://docker.io) execute:

*  **For RHEL based image**
    ```
    $ s2i build https://github.com/sclorg/s2i-perl-container.git --context-dir=5.26/test/sample-test-app/ rhscl/perl-526-rhel7 perl-sample-app
    $ docker run -p 8080:8080 perl-sample-app
    ```

*  **For CentOS based image**
    ```
    $ s2i build https://github.com/sclorg/s2i-perl-container.git --context-dir=5.26/test/sample-test-app/ centos/perl-526-centos7 perl-sample-app
    $ docker run -p 8080:8080 perl-sample-app
    ```

**Accessing the application:**
```
$ curl 127.0.0.1:8080
```

Environment variables
---------------------

To set environment variables, you can place them as a key value pair into a `.sti/environment`
file inside your source code repository.

* **ENABLE_CPAN_TEST**

    Allow the installation of all specified cpan packages and the running of their tests. The default value is `false`.

* **CPAN_MIRROR**

    This variable specifies a mirror URL which will used by cpanminus to install dependencies.
    By default the URL is not specified.

* **PERL_APACHE2_RELOAD**

    Set this to "true" to enable automatic reloading of modified Perl modules.

* **HTTPD_START_SERVERS**

    The [StartServers](https://httpd.apache.org/docs/2.4/mod/mpm_common.html#startservers)
    directive sets the number of child server processes created on startup. Default is 8.

* **HTTPD_MAX_REQUEST_WORKERS**

    Number of simultaneous requests that will be handled by Apache. The default
    is 256, but it will be automatically lowered if memory is limited.

* **PSGI_FILE**

    Override PSGI application detection.

    If the PSGI_FILE variable is set to empty value, no PSGI application will
    be detected and mod_perl not be reconfigured.

    If the PSGI_FILE variable is set and non-empty, it will define path to
    the PSGI application file. No detection will be used.

    If the PSGI_FILE variable does not exist, autodetection will be used:
    If exactly one ./*.psgi file exists, mod_perl will be configured to
    execute that file.

* **PSGI_URI_PATH**

    This variable overrides location URI path that is handled path the PSGI
    application. Default value is "/".

See also
--------
Dockerfile and other sources are available on https://github.com/sclorg/s2i-perl-container.
In that repository you also can find another versions of Perl environment Dockerfiles.
Dockerfile for CentOS is called Dockerfile, Dockerfile for RHEL is called Dockerfile.rhel7.


text:
<?php namespace Fungku\NetSuite\Classes;

class Preferences {
	public $warningAsError;
	public $disableMandatoryCustomFieldValidation;
	public $disableSystemNotesForCustomFields;
	public $ignoreReadOnlyFields;
	static $paramtypesmap = array(
		"warningAsError" => "boolean",
		"disableMandatoryCustomFieldValidation" => "boolean",
		"disableSystemNotesForCustomFields" => "boolean",
		"ignoreReadOnlyFields" => "boolean",
	);
}


text:
(function(){
	"use strict";

	angular.module("myApp").value("Config", {

		getUrl: "http://ionicapp.esy.es/"
	});

	angular.module("myApp").service("Data", function($http, Config){
		//recuperação de dados
		this.getData = function(params){
			return $http({
				method: "POST",
				url: Config.getUrl + "apiRecupera.php",
				data: params,
				headers : {
				                'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8'
				            }
			});
		};
		//recuperação de credencial
		this.loginData = function(credential){
			return $http({
				method: "POST",
				url: Config.getUrl + "apiLogin.php",
				data: credential,
				headers : {
				                'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8'
				            }
			});
		};
		//cadastro
		this.setData = function(dados){
			return $http({
				method: "POST",
				url: Config.getUrl + "apiCadastro.php",
				data: dados,
				headers : {
				                'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8'
				            }
			});
		};
		this.delData = function(id) {
			return $http ({
				method: "POST",
				url: Config.getUrl + "apiDeleta.php",
				data: id,
				headers : {
				                'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8'
				            }
			});
		};

	});
})();


text:
package hex
package variant

abstract class Variant(
    val id: Int,
    val key: String,
    val name: String,
    val shortName: String,
    val title: String,
    val standardInitialPosition: Boolean) {

  def standard = this == Standard

  def exotic = !standard

  override def toString = s"Variant($name)"
}

object Variant {

  val all = List(Standard, FromPosition)
  val byId = all map { v => (v.id, v) } toMap

  val default = Standard

  def apply(id: Int): Option[Variant] = byId get id
  def orDefault(id: Int): Variant = apply(id) | default

  def byName(name: String): Option[Variant] =
    all find (_.name.toLowerCase == name.toLowerCase)

  def exists(id: Int): Boolean = byId contains id
}


text:
module CommoditiesHelper
end


text:
package pylapp.smoothclicker.android.json;

import org.junit.Test;

import pylapp.smoothclicker.android.AbstractTest;

import static junit.framework.Assert.assertEquals;

/**
 * Class to test the MissingJsonPointsFileException
 *
 * @author Pierre-Yves Lapersonne
 * @version 1.0.0
 * @since 20/05/2016
 */
public class UtMissingJsonPointsFileException extends AbstractTest {

    /**
     * Tests the getMessage()
     */
    @Test
    public void getMessage(){

        l(this, "@Test getMessage");

        final String S = "A dummy message";

        MissingJsonPointsFileException e = new MissingJsonPointsFileException(S);
        assertEquals(S, e.getMessage());

    }

}


text:
@implementation Yeast

@end


text:
<?php
/* @var $this FriendLinkController */
/* @var $model FriendLink */
/* @var $form TbActiveForm */
?>

    <?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'id'=>'friend-link-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

带 * 的必须填写。

    <?php echo $form->errorSummary($model); ?>

            <?php echo $form->textFieldControlGroup($model,'category_id',array('span'=>5)); ?>

            <?php echo $form->textFieldControlGroup($model,'title',array('span'=>5,'maxlength'=>100)); ?>

            <?php echo $form->textFieldControlGroup($model,'pic',array('span'=>5,'maxlength'=>255)); ?>

            <?php echo $form->textFieldControlGroup($model,'url',array('span'=>5,'maxlength'=>200)); ?>

            <?php echo $form->textAreaControlGroup($model,'memo',array('rows'=>6,'span'=>8)); ?>

            <?php echo $form->textFieldControlGroup($model,'sort_order',array('span'=>5)); ?>

            <?php echo $form->textFieldControlGroup($model,'language',array('span'=>5,'maxlength'=>45)); ?>

            <?php echo $form->textFieldControlGroup($model,'create_time',array('span'=>5)); ?>

            <?php echo $form->textFieldControlGroup($model,'update_time',array('span'=>5)); ?>

        <?php echo TbHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array(
		    'color'=>TbHtml::BUTTON_COLOR_PRIMARY,
		    'size'=>TbHtml::BUTTON_SIZE_LARGE,
		)); ?>

    <?php $this->endWidget(); ?>


text:
import os
import sys
import yaml

from usage_translator import UsageTranslator

def __load_translations__(file_location):
    with open(file_location, 'r') as stream:
        return yaml.load(stream)

def __not_found_message__(args, from_type, translations_file):
    return 'No translation found for `{from_type} {args}` in "{file}"'.format(
        from_type=from_type,
        args=args,
        file=translations_file,
    )

def main(from_type, to_type, args):
    if len(args) == 0:
        print('Please provide at least one argument to translate!')
        return
    script_dir = os.path.dirname(os.path.realpath(__file__))
    translations_file = os.path.join(os.getcwd(), script_dir, 'data/git_hg.yaml')
    translations = __load_translations__(translations_file)
    translator = UsageTranslator(from_type=from_type,
                                 to_type=to_type,
                                 translations=translations)

    usage = translator.lookup_usage(args)
    if usage is not None:
        print(usage)
    else:
        print(__not_found_message__(args, from_type, translations_file))

if __name__ == "__main__":
    args = sys.argv[1:]
    main(from_type=args[0], to_type=args[2], args=args[3])


text:
<?php
namespace Oka\ApiBundle\EventListener;

use Oka\ApiBundle\Http\HostRequestMatcher;
use Oka\ApiBundle\Service\ErrorResponseFactory;
use Oka\ApiBundle\Util\LoggerHelper;
use Oka\ApiBundle\Util\RequestUtil;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
use Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\Translation\TranslatorInterface;

/**
 *
 * @author Cedrick Oka Baidai <okacedrick@gmail.com>
 *
 */
class RequestListener extends LoggerHelper implements EventSubscriberInterface
{
	const STOP_WATCH_API_EVENT_NAME = 'oka_api.request_duration';

	/**
	 * @var HostRequestMatcher $hostMatcher
	 */
	protected $hostMatcher;

	/**
	 * @var TranslatorInterface $translator
	 */
	protected $translator;

	/**
	 * @var ErrorResponseFactory $errorFactory
	 */
	protected $errorFactory;

	/**
	 * @var string $environment
	 */
	protected $environment;

	/**
	 * @var Stopwatch $stopWatch
	 */
	protected $stopWatch;

	public function __construct(HostRequestMatcher $hostMatcher, TranslatorInterface $translator, ErrorResponseFactory $errorFactory, $environment)
	{
		$this->hostMatcher = $hostMatcher;
		$this->translator = $translator;
		$this->errorFactory = $errorFactory;
		$this->environment = $environment;
		$this->stopWatch = new Stopwatch();
	}

	/**
	 * @param GetResponseEvent $event
	 */
	public function onKernelRequest(GetResponseEvent $event)
	{
		$request = $event->getRequest();

		if (true === $event->isMasterRequest() && true === $this->hostMatcher->matches($request) && true === $request->query->has('debug')) {
			$this->stopWatch->start(self::STOP_WATCH_API_EVENT_NAME);
		}
	}

	/**
	 * @param FilterResponseEvent $event
	 */
	public function onKernelResponse(FilterResponseEvent $event)
	{
		$request = $event->getRequest();
		$responseHeaders = $event->getResponse()->headers;

		// Utils Server
		$responseHeaders->set('X-Server-Time', date('c'));

		if (true === $event->isMasterRequest() && true === $this->hostMatcher->matches($request) && true === $request->query->has('debug')) {
			if (true === $this->stopWatch->isStarted(self::STOP_WATCH_API_EVENT_NAME)) {
				$event = $this->stopWatch->stop(self::STOP_WATCH_API_EVENT_NAME);
				$responseHeaders->set('X-Request-Duration', $event->getDuration() / 1000);
			}
		}
	}

	/**
	 * @param GetResponseForExceptionEvent $event
	 */
	public function onKernelException(GetResponseForExceptionEvent $event)
	{
		if (false === $event->isMasterRequest() || $this->environment === 'dev') {
			return;
		}

		$request = $event->getRequest();

		if (true === $this->hostMatcher->matches($request)) {
			$exception = $event->getException();
			$format = $request->attributes->has('format') ? $request->attributes->get('format') : RequestUtil::getFirstAcceptableFormat($request, 'json');

			if ($exception instanceof UnauthorizedHttpException) {
				$response = $this->errorFactory->createFromException($exception, null, [], $exception->getStatusCode(), [], $format);
			} elseif($exception instanceof AuthenticationException) {
				$response = $this->errorFactory->create($exception->getMessage(), 403, null, [], 403, [], $format);
			} elseif($exception instanceof BadRequestHttpException) {
				$response = $this->errorFactory->createFromException($exception, null, [], $exception->getStatusCode(), [], $format);
			} elseif ($exception instanceof NotFoundHttpException) {
				$response = $this->errorFactory->create($this->translator->trans('response.not_found', ['%ressource%' => $request->getRequestUri()], 'OkaApiBundle'), 404, null, [], 404, [], $format);
			} elseif ($exception instanceof MethodNotAllowedHttpException) {
				$response = $this->errorFactory->createFromException($exception, null, [], $exception->getStatusCode(), [], $format);
			} elseif ($exception instanceof NotAcceptableHttpException) {
				$response = $this->errorFactory->createFromException($exception, null, [], $exception->getStatusCode(), [], $format);
			} else {
				if ($exception instanceof HttpException) {
					$response = $this->errorFactory->createFromException($exception, null, [], $exception->getStatusCode(), [], $format);
				} else {
					$response = $this->errorFactory->create($this->translator->trans('response.server_error', [], 'OkaApiBundle'), 500, null, [], 500, [], $format);
				}
			}

			$event->setResponse($response);
			$this->logErrException($exception);
		}
	}

	public static function getSubscribedEvents()
	{
		return [
				KernelEvents::REQUEST => 'onKernelRequest',
				KernelEvents::RESPONSE => 'onKernelResponse',
				KernelEvents::EXCEPTION => 'onKernelException'
		];
	}
}


text:
'use strict';

exports.Booth = require('./Booth');
exports.Doctor = require('./Doctor');
exports.TheDoctorIsComponent = require('./TheDoctorIsComponent');

exports.THEDOCTORIS_PROVIDERS = [
	exports.Booth,
	exports.Doctor,
];


text:
#include <photon/element/proxy.hpp>
#include <photon/support/context.hpp>
#include <photon/view.hpp>

namespace cycfi { namespace photon
{
   ////////////////////////////////////////////////////////////////////////////
   // proxy class implementation
   ////////////////////////////////////////////////////////////////////////////
   view_limits proxy_base::limits(basic_context const& ctx) const
   {
      return subject().limits(ctx);
   }

   element* proxy_base::hit_test(context const& ctx, point p)
   {
      context sctx { ctx, &subject(), ctx.bounds };
      prepare_subject(sctx, p);
      auto r = subject().hit_test(sctx, p);
      restore_subject(sctx);
      return r;
   }

   void proxy_base::draw(context const& ctx)
   {
      context sctx { ctx, &subject(), ctx.bounds };
      prepare_subject(sctx);
      subject().draw(sctx);
      restore_subject(sctx);
   }

   void proxy_base::layout(context const& ctx)
   {
      context sctx { ctx, &subject(), ctx.bounds };
      prepare_subject(sctx);
      subject().layout(sctx);
      restore_subject(sctx);
   }

   void proxy_base::refresh(context const& ctx, element& element)
   {
      if (&element == this)
      {
         ctx.view.refresh(ctx);
      }
      else
      {
         context sctx { ctx, &subject(), ctx.bounds };
         prepare_subject(sctx);
         subject().refresh(sctx, element);
         restore_subject(sctx);
      }
   }

   void proxy_base::prepare_subject(context& ctx)
   {
   }

   void proxy_base::prepare_subject(context& ctx, point& p)
   {
      prepare_subject(ctx);
   }

   void proxy_base::restore_subject(context& ctx)
   {
   }

   element* proxy_base::click(context const& ctx, mouse_button btn)
   {
      context sctx { ctx, &subject(), ctx.bounds };
      prepare_subject(sctx, btn.pos);
      auto r = subject().click(sctx, btn);
      restore_subject(sctx);
      return r;
   }

   void proxy_base::drag(context const& ctx, mouse_button btn)
   {
      context sctx { ctx, &subject(), ctx.bounds };
      prepare_subject(sctx, btn.pos);
      subject().drag(sctx, btn);
      restore_subject(sctx);
   }

   bool proxy_base::key(context const& ctx, key_info k)
   {
      context sctx { ctx, &subject(), ctx.bounds };
      prepare_subject(sctx);
      auto r = subject().key(sctx, k);
      restore_subject(sctx);
      return r;
   }

   bool proxy_base::text(context const& ctx, text_info info)
   {
      context sctx { ctx, &subject(), ctx.bounds };
      prepare_subject(sctx);
      auto r = subject().text(sctx, info);
      restore_subject(sctx);
      return r;
   }

   bool proxy_base::cursor(context const& ctx, point p, cursor_tracking status)
   {
      context sctx { ctx, &subject(), ctx.bounds };
      prepare_subject(sctx, p);
      auto r = subject().cursor(sctx, p, status);
      restore_subject(sctx);
      return r;
   }

   bool proxy_base::scroll(context const& ctx, point dir, point p)
   {
      context sctx { ctx, &subject(), ctx.bounds };
      prepare_subject(sctx, p);
      auto r = subject().scroll(sctx, dir, p);
      restore_subject(sctx);
      return r;
   }

   bool proxy_base::focus(focus_request r)
   {
      return subject().focus(r);
   }

   element const* proxy_base::focus() const
   {
      return subject().focus();
   }

   element* proxy_base::focus()
   {
      return subject().focus();
   }

   bool proxy_base::is_control() const
   {
      return subject().is_control();
   }

   void proxy_base::idle(basic_context const& ctx)
   {
      subject().idle(ctx);
   }

   void proxy_base::value(bool val)
   {
      subject().value(val);
   }

   void proxy_base::value(int val)
   {
      subject().value(val);
   }

   void proxy_base::value(double val)
   {
      subject().value(val);
   }

   void proxy_base::value(std::string val)
   {
      subject().value(val);
   }
}}


text:
package org.broadinstitute.sting.queue.extensions.picard

import org.broadinstitute.sting.commandline._

import java.io.File

/*
 * Created by IntelliJ IDEA.
 * User: carneiro
 * Date: 6/22/11
 * Time: 10:35 AM
 */
class SamToFastq extends org.broadinstitute.sting.queue.function.JavaCommandLineFunction with PicardBamFunction {
  analysisName = "SamToFastq"
  javaMainClass = "net.sf.picard.sam.SamToFastq"

  @Input(shortName = "input", fullName = "input_bam_files", required = true, doc = "Input SAM/BAM file to extract reads from.")
  var input: Seq[File] = Nil

  @Output(shortName = "fastq", fullName = "output_fastq_file", required = true, doc = "Output fastq file (single-end fastq or, if paired, first end of the pair fastq).")
  var fastq: File = _

  @Output(shortName = "se", fullName = "second_end_fastq", required = false, doc = "Output fastq file (if paired, second end of the pair fastq).")
  var secondEndFastQ: File = _

  @Argument(shortName = "opg", fullName = "output_per_readgroup", required = false, doc = "Output a fastq file per read group (two fastq files per read group if the group is paired).")
  var outputPerReadGroup: Boolean = false

  @Argument(shortName = "od", fullName = "output_dir", required = false, doc = "Directory in which to output the fastq file(s). Used only when OUTPUT_PER_RG is true.")
  var outputDir: File = _

  @Argument(shortName = "rr", fullName = "re_reverse", required = false, doc = "Re-reverse bases and qualities of reads with negative strand flag set before writing them to fastq.")
  var reReverse: Boolean = true

  @Argument(shortName = "nonpf", fullName = "include_non_pf_reads", required = false, doc = "Include non-PF reads from the SAM file into the output FASTQ files.")
  var includeNonPFReads: Boolean = false

  @Argument(shortName = "cat", fullName = "clipping_attribute", required = false, doc = "The attribute that stores the position at which the SAM record should be clipped.")
  var clippingAttribute: String = null

  @Argument(shortName = "cac", fullName = "clipping_action", required = false, doc = "The action that should be taken with clipped reads: 'X' means the reads and qualities should be trimmed at the clipped position; 'N' means the bases should be changed to Ns in the clipped region; and any integer means that the base qualities should be set to that value in the clipped region.")
  var clippingAction: String = null

  @Argument(shortName = "r1t", fullName = "read_one_trim", required = false, doc = "The number of bases to trim from the beginning of read 1.")
  var readOneTrim: Int = -1

  @Argument(shortName = "r1mbtw", fullName = "read_one_max_bases_to_write", required = false, doc = "The maximum number of bases to write from read 1 after trimming. If there are fewer than this many bases left after trimming, all will be written. If this value is null then all bases left after trimming will be written.")
  var readOneMaxBasesToWrite: Int = -1

  @Argument(shortName = "r2t", fullName = "read_two_trim", required = false, doc = "The number of bases to trim from the beginning of read 2.")
  var readTwoTrim: Int = -1

  @Argument(shortName = "r2mbtw", fullName = "read_two_max_bases_to_write", required = false, doc = "The maximum number of bases to write from read 2 after trimming. If there are fewer than this many bases left after trimming, all will be written. If this value is null then all bases left after trimming will be written.")
  var readTwoMaxBasesToWrite: Int = -1

  @Argument(shortName = "inpa", fullName = "include_non_primary_alignments", required = false, doc = "If true, include non-primary alignments in the output. Support of non-primary alignments in SamToFastq is not comprehensive, so there may be exceptions if this is set to true and there are paired reads with non-primary alignments.")
  var includeNonPrimaryAlignments: Boolean = false

  override def inputBams = input
  override def outputBam = null
  this.sortOrder = null

  override def commandLine = super.commandLine +
                             required("FASTQ=" + fastq) +
                             optional("SECOND_END_FASTQ=", secondEndFastQ, spaceSeparated=false) +
                             conditional(outputPerReadGroup, "OUTPUT_PER_RG=" + outputPerReadGroup) +
                             optional("OUTPUT_DIR=", outputDir, spaceSeparated=false) +
                             conditional(!reReverse, "RE_REVERSE=" + reReverse) +
                             conditional(includeNonPFReads, "INCLUDE_NON_PF_READS=" + includeNonPFReads) +
                             optional("CLIPPING_ATTRIBUTE=", clippingAttribute, spaceSeparated=false) +
                             optional("CLIPPING_ACTION=", clippingAction, spaceSeparated=false) +
                             conditional(readOneTrim >= 0, "READ1_TRIM=" + readOneTrim) +
                             conditional(readOneMaxBasesToWrite >= 0, "READ1_MAX_BASES_TO_WRITE=" + readOneMaxBasesToWrite) +
                             conditional(readTwoTrim >= 0, "READ2_TRIM=" + readTwoTrim) +
                             conditional(readTwoMaxBasesToWrite >= 0, "READ2_MAX_BASES_TO_WRITE=" + readTwoMaxBasesToWrite) +
                             conditional(includeNonPrimaryAlignments, "INCLUDE_NON_PRIMARY_ALIGNMENTS=" + includeNonPrimaryAlignments)
}


text:
package org.dasein.cloud.vsphere.compute;

import org.dasein.cloud.*;
import org.dasein.cloud.compute.Architecture;
import org.dasein.cloud.compute.ImageClass;
import org.dasein.cloud.compute.Platform;
import org.dasein.cloud.compute.VirtualMachineCapabilities;
import org.dasein.cloud.compute.VMScalingCapabilities;
import org.dasein.cloud.compute.VmState;
import org.dasein.cloud.util.NamingConstraints;
import org.dasein.cloud.vsphere.PrivateCloud;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Locale;

/**
 * Describes the capabilities of VSphere with respect to Dasein virtual machine operations.
 *
Created by Danielle Mayne: 4/03/14 15:27 PM

 * @author Danielle Mayne
 * @version 2014.03 initial version
 * @since 2014.03
 */
public class VMCapabilities extends AbstractCapabilities<PrivateCloud> implements VirtualMachineCapabilities{
    public VMCapabilities(@Nonnull PrivateCloud provider) {
        super(provider);
    }

    @Override
    public boolean canAlter(@Nonnull VmState fromState) throws CloudException, InternalException {
        return true;
    }

    @Override
    public boolean canClone(@Nonnull VmState fromState) throws CloudException, InternalException {
        return true;
    }

    @Override
    public boolean canPause(@Nonnull VmState fromState) throws CloudException, InternalException {
        return false;
    }

    @Override
    public boolean canReboot(@Nonnull VmState fromState) throws CloudException, InternalException {
        return fromState.equals(VmState.RUNNING);
    }

    @Override
    public boolean canResume(@Nonnull VmState fromState) throws CloudException, InternalException {
        return !fromState.equals(VmState.RUNNING);
    }

    @Override
    public boolean canStart(@Nonnull VmState fromState) throws CloudException, InternalException {
        return !fromState.equals(VmState.RUNNING);
    }

    @Override
    public boolean canStop(@Nonnull VmState fromState) throws CloudException, InternalException {
        return !fromState.equals(VmState.STOPPED);
    }

    @Override
    public boolean canSuspend(@Nonnull VmState fromState) throws CloudException, InternalException {
        return !fromState.equals(VmState.SUSPENDED);
    }

    @Override
    public boolean canTerminate(@Nonnull VmState fromState) throws CloudException, InternalException {
        return !fromState.equals(VmState.TERMINATED);
    }

    @Override
    public boolean canUnpause(@Nonnull VmState fromState) throws CloudException, InternalException {
        return false;
    }

    @Override
    public int getMaximumVirtualMachineCount() throws CloudException, InternalException {
        return -1;
    }

    @Override
    public int getCostFactor(@Nonnull VmState state) throws CloudException, InternalException {
        return 0;
    }

    @Nonnull
    @Override
    public String getProviderTermForVirtualMachine(@Nonnull Locale locale) throws CloudException, InternalException {
        return "server";
    }

    @Nullable
    @Override
    public VMScalingCapabilities getVerticalScalingCapabilities() throws CloudException, InternalException {
        return VMScalingCapabilities.getInstance(false,false,true);
    }

    @Nonnull
    @Override
    public NamingConstraints getVirtualMachineNamingConstraints() throws CloudException, InternalException {
        return NamingConstraints.getAlphaNumeric(1, 30).constrainedBy(new char[] {'-'}).lowerCaseOnly();
    }

    @Nullable
    @Override
    public VisibleScope getVirtualMachineVisibleScope() {
        return null;
    }

    @Nullable @Override public VisibleScope getVirtualMachineProductVisibleScope() {
        return null;
    }

    @Nonnull
    @Override
    public Requirement identifyDataCenterLaunchRequirement() throws CloudException, InternalException {
        return Requirement.REQUIRED;
    }

    @Nonnull
    @Override
    public Requirement identifyImageRequirement(@Nonnull ImageClass cls) throws CloudException, InternalException {
        return (cls.equals(ImageClass.MACHINE) ? Requirement.REQUIRED : Requirement.NONE);
    }

    @Nonnull
    @Override
    public Requirement identifyPasswordRequirement(Platform platform) throws CloudException, InternalException {
        return Requirement.REQUIRED;
    }

    @Nonnull
    @Override
    public Requirement identifyRootVolumeRequirement() throws CloudException, InternalException {
        return Requirement.NONE;
    }

    @Nonnull
    @Override
    public Requirement identifyShellKeyRequirement(Platform platform) throws CloudException, InternalException {
        return Requirement.NONE;
    }

    @Nonnull
    @Override
    public Requirement identifyStaticIPRequirement() throws CloudException, InternalException {
        return Requirement.OPTIONAL;
    }

    @Nonnull
    @Override
    public Requirement identifySubnetRequirement() throws CloudException, InternalException {
        return Requirement.NONE;
    }

    @Nonnull
    @Override
    public Requirement identifyVlanRequirement() throws CloudException, InternalException {
        return Requirement.OPTIONAL;
    }

    @Override
    public boolean isAPITerminationPreventable() throws CloudException, InternalException {
        return false;
    }

    @Override
    public boolean isBasicAnalyticsSupported() throws CloudException, InternalException {
        return false;
    }

    @Override
    public boolean isExtendedAnalyticsSupported() throws CloudException, InternalException {
        return false;
    }

    @Override
    public boolean isUserDataSupported() throws CloudException, InternalException {
        return false;
    }

    @Override
    public boolean isUserDefinedPrivateIPSupported() throws CloudException, InternalException {
        return true;
    }

    static private Collection<Architecture> architectures;@Nonnull
    @Override
    public Iterable<Architecture> listSupportedArchitectures() throws InternalException, CloudException {
        if( architectures == null ) {
            ArrayList<Architecture> list = new ArrayList<Architecture>();

            list.add(Architecture.I32);
            list.add(Architecture.I64);
            architectures = Collections.unmodifiableCollection(list);
        }
        return architectures;
    }

    @Override
    public boolean supportsSpotVirtualMachines() throws InternalException, CloudException {
        return false;
    }

    @Override
    public boolean supportsAlterVM() {
        return true;
    }

    @Override
    public boolean supportsClone() {
        return true;
    }

    @Override
    public boolean supportsPause() {
        return false;
    }

    @Override
    public boolean supportsReboot() {
        return true;
    }

    @Override
    public boolean supportsResume() {
        return true;
    }

    @Override
    public boolean supportsStart() {
        return true;
    }

    @Override
    public boolean supportsStop() {
        return true;
    }

    @Override
    public boolean supportsSuspend() {
        return true;
    }

    @Override
    public boolean supportsTerminate() {
        return true;
    }

    @Override
    public boolean supportsUnPause() {
        return false;
    }
}


text:
package com.evolveum.midpoint.model.impl.controller;

import java.util.ArrayList;
import java.util.Collection;

import com.evolveum.midpoint.prism.DisplayableValueImpl;

/**
 * @author semancik
 *
 */
public class RoleSelectionSpecEntry extends DisplayableValueImpl<String> {

	boolean negative = false;

	public RoleSelectionSpecEntry(String value, String label, String description) {
		super(value, label, description);
	}

	public boolean isNegative() {
		return negative;
	}

	public void setNegative(boolean negative) {
		this.negative = negative;
	}

	public void negate() {
		this.negative = !this.negative;
	}

	public static void negate(Collection<RoleSelectionSpecEntry> col) {
		if (col == null) {
			return;
		}
		for (RoleSelectionSpecEntry entry: col) {
			entry.negate();
		}
	}

	public static boolean hasNegative(Collection<RoleSelectionSpecEntry> col) {
		if (col == null) {
			return false;
		}
		for (RoleSelectionSpecEntry entry: col) {
			if (entry.isNegative()) {
				return true;
			}
		}
		return false;
	}

	public static boolean hasNegativeValue(Collection<RoleSelectionSpecEntry> col, String value) {
		if (col == null) {
			return false;
		}
		for (RoleSelectionSpecEntry entry: col) {
			if (entry.isNegative() && value.equals(entry.getValue())) {
				return true;
			}
		}
		return false;
	}

	public static Collection<RoleSelectionSpecEntry> getPositive(Collection<RoleSelectionSpecEntry> col) {
		if (col == null) {
			return null;
		}
		Collection<RoleSelectionSpecEntry> out = new ArrayList<>();
		for (RoleSelectionSpecEntry entry: col) {
			if (!entry.isNegative()) {
				out.add(entry);
			}
		}
		return out;
	}
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.facebook.presto.ml;

import com.google.common.base.Throwables;
import com.google.common.util.concurrent.SimpleTimeLimiter;
import com.google.common.util.concurrent.TimeLimiter;
import libsvm.svm;
import libsvm.svm_model;
import libsvm.svm_node;
import libsvm.svm_parameter;
import libsvm.svm_problem;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.List;
import java.util.SortedMap;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;

import static io.airlift.concurrent.Threads.threadsNamed;
import static java.util.Objects.requireNonNull;
import static java.util.concurrent.Executors.newCachedThreadPool;

public abstract class AbstractSvmModel
        implements Model
{
    protected svm_model model;
    protected svm_parameter params;

    protected AbstractSvmModel(svm_parameter params)
    {
        this.params = requireNonNull(params, "params is null");
    }

    protected AbstractSvmModel(svm_model model)
    {
        this.model = requireNonNull(model, "model is null");
    }

    @Override
    public byte[] getSerializedData()
    {
        File file = null;
        try {
            // libsvm doesn't have a method to serialize the model into a buffer, so write it out to a file and then read it back in
            file = File.createTempFile("svm", null);
            svm.svm_save_model(file.getAbsolutePath(), model);
            return Files.readAllBytes(file.toPath());
        }
        catch (IOException e) {
            throw Throwables.propagate(e);
        }
        finally {
            if (file != null) {
                //noinspection ResultOfMethodCallIgnored
                file.delete();
            }
        }
    }

    @Override
    public void train(Dataset dataset)
    {
        params.svm_type = getLibsvmType();

        svm_problem problem = toSvmProblem(dataset);

        ExecutorService service = newCachedThreadPool(threadsNamed("libsvm-trainer-" + System.identityHashCode(this) + "-%s"));
        try {
            TimeLimiter limiter = new SimpleTimeLimiter(service);
            //TODO: this time limit should be configurable
            model = limiter.callWithTimeout(getTrainingFunction(problem, params), 1, TimeUnit.HOURS, true);
        }
        catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            throw Throwables.propagate(e);
        }
        catch (Exception e) {
            throw Throwables.propagate(e);
        }
        finally {
            service.shutdownNow();
        }
    }

    private static Callable<svm_model> getTrainingFunction(svm_problem problem, svm_parameter param)
    {
        return () -> svm.svm_train(problem, param);
    }

    protected abstract int getLibsvmType();

    private static svm_problem toSvmProblem(Dataset dataset)
    {
        svm_problem problem = new svm_problem();
        List<Double> labels = dataset.getLabels();
        problem.l = labels.size();
        problem.y = new double[labels.size()];
        for (int i = 0; i < labels.size(); i++) {
            problem.y[i] = labels.get(i);
        }
        problem.x = new svm_node[labels.size()][];
        for (int i = 0; i < dataset.getDatapoints().size(); i++) {
            problem.x[i] = toSvmNodes(dataset.getDatapoints().get(i));
        }
        return problem;
    }

    protected static svm_node[] toSvmNodes(FeatureVector features)
    {
        svm_node[] nodes = new svm_node[features.size()];
        int i = 0;
        // Features map is sorted, so we can just flatten it to a list for libsvm
        for (SortedMap.Entry<Integer, Double> feature : features.getFeatures().entrySet()) {
            nodes[i] = new svm_node();
            nodes[i].index = feature.getKey();
            nodes[i].value = feature.getValue();
            i++;
        }

        return nodes;
    }
}


text:
package gwt.material.design.addins.client.cropper;

import com.google.gwt.core.client.GWT;
import com.google.gwt.resources.client.ClientBundle;
import com.google.gwt.resources.client.TextResource;

/**
 * Client Bundle for Image Cropper component
 *
 * @author kevzlou7979
 */
interface MaterialImageCropperDebugClientBundle extends ClientBundle {

    MaterialImageCropperDebugClientBundle INSTANCE = GWT.create(MaterialImageCropperDebugClientBundle.class);

    @Source("resources/js/croppie.js")
    TextResource imageCropperDebugJs();

    @Source("resources/css/croppie.css")
    TextResource imageCropperDebugCss();
}


text:
<form id="files_external" class="section">

<?php p($l->t('External Storage')); ?>

	<?php if (isset($_['dependencies']) and ($_['dependencies']<>'')) print_unescaped(''.$_['dependencies'].''); ?>
	<table id="externalStorage" class="grid" data-admin='<?php print_unescaped(json_encode($_['isAdminPage'])); ?>'>

				<?php p($l->t('Folder name')); ?>
				<?php p($l->t('External storage')); ?>
				<?php p($l->t('Configuration')); ?>
				<?php if ($_['isAdminPage']) print_unescaped(''.$l->t('Available for').'	'); ?>

		<?php $_['mounts'] = array_merge($_['mounts'], array('' => array())); ?>
		<?php foreach ($_['mounts'] as $mount): ?>
			<tr <?php print_unescaped(isset($mount['mountpoint']) ? 'class="'.OC_Util::sanitizeHTML($mount['class']).'"' : 'id="addMountPoint"'); ?>>

				<?php if (isset($mount['status'])): ?>
					<span class="<?php p(($mount['status']) ? 'success' : 'error'); ?>">
				<?php endif; ?>

				<input type="text" name="mountPoint"
											  value="<?php p(isset($mount['mountpoint']) ? $mount['mountpoint'] : ''); ?>"
											  data-mountpoint="<?php p(isset($mount['mountpoint']) ? $mount['mountpoint'] : ''); ?>"
											  placeholder="<?php p($l->t('Folder name')); ?>" />

				<?php if (!isset($mount['mountpoint'])): ?>

						<select id="selectBackend" data-configurations='<?php p(json_encode($_['backends'])); ?>'>
							<option value="" disabled selected
									style="display:none;"><?php p($l->t('Add storage')); ?></option>
							<?php foreach ($_['backends'] as $class => $backend): ?>
								<option value="<?php p($class); ?>"><?php p($backend['backend']); ?></option>
							<?php endforeach; ?>
						</select>

				<?php else: ?>
					<td class="backend" data-class="<?php p($mount['class']); ?>"><?php p($mount['backend']); ?>

				<?php endif; ?>

					<?php if (isset($mount['options'])): ?>
						<?php foreach ($mount['options'] as $parameter => $value): ?>
							<?php if (isset($_['backends'][$mount['class']]['configuration'][$parameter])): ?>
								<?php
									$placeholder = $_['backends'][$mount['class']]['configuration'][$parameter];
									$is_optional = FALSE;
									if (strpos($placeholder, '&') === 0) {
										$is_optional = TRUE;
										$placeholder = substr($placeholder, 1);
									}
								?>
								<?php if (strpos($placeholder, '*') === 0): ?>
									<input type="password"
										   <?php if ($is_optional): ?> class="optional"<?php endif; ?>
										   data-parameter="<?php p($parameter); ?>"
										   value="<?php p($value); ?>"
										   placeholder="<?php p(substr($placeholder, 1)); ?>" />
								<?php elseif (strpos($placeholder, '!') === 0): ?>
									<input type="checkbox"
												  data-parameter="<?php p($parameter); ?>"
												  <?php if ($value == 'true'): ?> checked="checked"<?php endif; ?>
												  /><?php p(substr($placeholder, 1)); ?>
								<?php elseif (strpos($placeholder, '#') === 0): ?>
									<input type="hidden"
										   data-parameter="<?php p($parameter); ?>"
										   value="<?php p($value); ?>" />
								<?php else: ?>
									<input type="text"
										   <?php if ($is_optional): ?> class="optional"<?php endif; ?>
										   data-parameter="<?php p($parameter); ?>"
										   value="<?php p($value); ?>"
										   placeholder="<?php p($placeholder); ?>" />
								<?php endif; ?>
							<?php endif; ?>
						<?php endforeach; ?>
						<?php if (isset($_['backends'][$mount['class']]['custom'])): ?>
							<?php OCP\Util::addScript('files_external', $_['backends'][$mount['class']]['custom']); ?>
						<?php endif; ?>
					<?php endif; ?>

				<?php if ($_['isAdminPage']): ?>
				<td class="applicable"
					align="right"
					data-applicable-groups='<?php if (isset($mount['applicable']['groups']))
													print_unescaped(json_encode($mount['applicable']['groups'])); ?>'
					data-applicable-users='<?php if (isset($mount['applicable']['users']))
													print_unescaped(json_encode($mount['applicable']['users'])); ?>'>
					<input type="hidden" class="applicableUsers" style="width:20em;" value=""/>

				<?php endif; ?>
				<td <?php if (isset($mount['mountpoint'])): ?>class="remove"
					<?php else: ?>style="visibility:hidden;"
					<?php endif ?>><img alt="<?php p($l->t('Delete')); ?>"
										title="<?php p($l->t('Delete')); ?>"
										class="svg action"
										src="<?php print_unescaped(image_path('core', 'actions/delete.svg')); ?>" />

		<?php endforeach; ?>

	<?php if ($_['isAdminPage']): ?>

		<input type="checkbox" name="allowUserMounting" id="allowUserMounting"
			value="1" <?php if ($_['allowUserMounting'] == 'yes') print_unescaped(' checked="checked"'); ?> />
		<?php p($l->t('Enable User External Storage')); ?>

		<p id="userMountingBackends"<?php if ($_['allowUserMounting'] != 'yes'): ?> class="hidden"<?php endif; ?>>
			<?php p($l->t('Allow users to mount the following external storage')); ?>

			<?php $i = 0; foreach ($_['personal_backends'] as $class => $backend): ?>
				<input type="checkbox" id="allowUserMountingBackends<?php p($i); ?>" name="allowUserMountingBackends[]" value="<?php p($class); ?>" <?php if ($backend['enabled']) print_unescaped(' checked="checked"'); ?> />
				<label for="allowUserMountingBackends<?php p($i); ?>"><?php p($backend['backend']); ?>

				<?php $i++; ?>
			<?php endforeach; ?>

	<?php endif; ?>
</form>


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Threading;
using Microsoft.CodeAnalysis;

namespace Microsoft.CodeAnalysis.Scripting
{
    /// <summary>
    /// A variable declared by the script.
    /// </summary>
    [DebuggerDisplay("{GetDebuggerDisplay(), nq}")]
    public class ScriptVariable
    {
        private readonly object _instance;
        private readonly MemberInfo _member;

        internal ScriptVariable(object instance, MemberInfo member)
        {
            _instance = instance;
            _member = member;
        }

        /// <summary>
        /// The name of the variable.
        /// </summary>
        public string Name
        {
            get { return _member.Name; }
        }

        /// <summary>
        /// The type of the variable.
        /// </summary>
        public Type Type
        {
            get
            {
                if (_member.MemberType == MemberTypes.Field)
                {
                    return ((FieldInfo)_member).FieldType;
                }
                else
                {
                    return ((PropertyInfo)_member).PropertyType;
                }
            }
        }

        /// <summary>
        /// The value of the variable after running the script.
        /// </summary>
        public object Value
        {
            get
            {
                if (_member.MemberType == MemberTypes.Field)
                {
                    return ((FieldInfo)_member).GetValue(_instance);
                }
                else
                {
                    return ((PropertyInfo)_member).GetValue(_instance);
                }
            }
        }

        private string GetDebuggerDisplay()
        {
            return string.Format("{0}: {1}", this.Name, (this.Value != null) ? this.Value : "<null>");
        }
    }
}


text:
<?php
// Heading
$_['heading_title']    = 'Featured';

// Text
$_['text_module']      = 'Modules';
$_['text_success']     = 'Success: You have modified module Featured!';
$_['text_left']        = 'Left';
$_['text_right']       = 'Right';

// Entry
$_['entry_limit']      = 'Limit:';
$_['entry_position']   = 'Position:';
$_['entry_status']     = 'Status:';
$_['entry_sort_order'] = 'Sort Order:';
$_['entry_product']    = 'Products:';

// Error
$_['error_permission'] = 'Warning: You do not have permission to modify module Featured!';
?>


text:
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using ScripturePublishingEntity;
using ScripturePublishingService.Factory;

namespace ScripturePublishing.Helpers
{
    public class ProcessHelper
    {
        public static List<SelectListItem> GetProcessList()
        {
            return ServiceFactory.GetProcessService(new WorkflowEngine()).GetProcesses().Select(p => new SelectListItem
            {
                Value = p.Id.ToString(),
                Text = p.Name
            }).ToList();
        }

        public static List<SelectListItem> GetProcessList(int processId)
        {
            return ServiceFactory.GetProcessService(new WorkflowEngine()).GetProcesses().Select(p => new SelectListItem
            {
                Value = p.Id.ToString(),
                Text = p.Name,
                Selected = p.Id == processId
            }).ToList();
        }
    }
}


text:
<?php
include('Craftyy/Playwright/index.php');
?>


text:
layout: default.liquid

title: First Post
is_draft: true
---

# This is our first Post!

Welcome to the first post ever on cobalt.rs!


text: export { default } from 'ember-accordion/components/accordion-panel';


text:
<?php

namespace ZendTest\Code\Reflection;

use PHPUnit\Framework\TestCase;
use Zend\Code\Reflection;
use Zend\Code\Reflection\ClassReflection;
use ZendTest\Code\TestAsset\ClassTypeHintedClass;
use ZendTest\Code\TestAsset\DocBlockOnlyHintsClass;
use ZendTest\Code\TestAsset\InternalHintsClass;

/**
 * @group Zend_Reflection
 * @group Zend_Reflection_Parameter
 */
class ParameterReflectionTest extends TestCase
{
    public function testDeclaringClassReturn()
    {
        $parameter = new Reflection\ParameterReflection(
            [TestAsset\TestSampleClass2::class, 'getProp2'],
            0
        );
        self::assertInstanceOf(ClassReflection::class, $parameter->getDeclaringClass());
    }

    public function testClassReturnNoClassGivenReturnsNull()
    {
        $parameter = new Reflection\ParameterReflection(
            [TestAsset\TestSampleClass2::class, 'getProp2'],
            'param1'
        );
        self::assertNull($parameter->getClass());
    }

    public function testClassReturn()
    {
        $parameter = new Reflection\ParameterReflection(
            [TestAsset\TestSampleClass2::class, 'getProp2'],
            'param2'
        );
        self::assertInstanceOf(ClassReflection::class, $parameter->getClass());
    }

    /**
     * @dataProvider paramType
     *
     * @param string $param
     * @param string $type
     */
    public function testTypeReturn($param, $type)
    {
        $parameter = new Reflection\ParameterReflection(
            [TestAsset\TestSampleClass5::class, 'doSomething'],
            $param
        );
        self::assertEquals($type, $parameter->detectType());
    }

    public function testCallableTypeHint()
    {
        $parameter = new Reflection\ParameterReflection(
            [TestAsset\CallableTypeHintClass::class, 'foo'],
            'bar'
        );
        self::assertEquals('callable', $parameter->detectType());
    }

    public function paramType()
    {
        return [
            ['one','int'],
            ['two','int'],
            ['three','string'],
            ['array','array'],
            ['class',TestAsset\TestSampleClass::class],
        ];
    }

    /**
     * @group zendframework/zend-code#29
     *
     * @dataProvider reflectionHints
     *
     * @param string $className
     * @param string $methodName
     * @param string $parameterName
     * @param string $expectedType
     */
    public function testGetType($className, $methodName, $parameterName, $expectedType)
    {
        $reflection = new Reflection\ParameterReflection(
            [$className, $methodName],
            $parameterName
        );

        $type = $reflection->getType();

        self::assertInstanceOf(\ReflectionType::class, $type);
        self::assertSame($expectedType, $type->getName());
    }

    /**
     * @group zendframework/zend-code#29
     *
     * @dataProvider reflectionHints
     *
     * @param string $className
     * @param string $methodName
     * @param string $parameterName
     * @param string $expectedType
     */
    public function testDetectType($className, $methodName, $parameterName, $expectedType)
    {
        $reflection = new Reflection\ParameterReflection(
            [$className, $methodName],
            $parameterName
        );

        // following is just due to an incompatibility between this test method and `testGetType`
        if ('self' === $expectedType) {
            $expectedType = $className;
        }

        self::assertSame($expectedType, $reflection->detectType());
    }

    /**
     * @return string[][]
     */
    public function reflectionHints()
    {
        return [
            [InternalHintsClass::class, 'arrayParameter', 'foo', 'array'],
            [InternalHintsClass::class, 'callableParameter', 'foo', 'callable'],
            [InternalHintsClass::class, 'intParameter', 'foo', 'int'],
            [InternalHintsClass::class, 'floatParameter', 'foo', 'float'],
            [InternalHintsClass::class, 'stringParameter', 'foo', 'string'],
            [InternalHintsClass::class, 'boolParameter', 'foo', 'bool'],
            [ClassTypeHintedClass::class, 'selfParameter', 'foo', 'self'],
            [ClassTypeHintedClass::class, 'classParameter', 'foo', ClassTypeHintedClass::class],
            [ClassTypeHintedClass::class, 'otherClassParameter', 'foo', InternalHintsClass::class],
            [ClassTypeHintedClass::class, 'closureParameter', 'foo', \Closure::class],
            [ClassTypeHintedClass::class, 'importedClosureParameter', 'foo', \Closure::class],
        ];
    }

    /**
     * @group zendframework/zend-code#29
     *
     * @dataProvider docBlockHints
     *
     * @param string $className
     * @param string $methodName
     * @param string $parameterName
     */
    public function testGetTypeWithDocBlockOnlyTypes($className, $methodName, $parameterName)
    {
        $reflection = new Reflection\ParameterReflection(
            [$className, $methodName],
            $parameterName
        );

        self::assertNull($reflection->getType());
    }

    /**
     * @group zendframework/zend-code#29
     *
     * @dataProvider docBlockHints
     *
     * @param string $className
     * @param string $methodName
     * @param string $parameterName
     * @param string $expectedType
     */
    public function testDetectTypeWithDocBlockOnlyTypes($className, $methodName, $parameterName, $expectedType)
    {
        $reflection = new Reflection\ParameterReflection(
            [$className, $methodName],
            $parameterName
        );

        self::assertSame($expectedType, $reflection->detectType());
    }

    /**
     * @return string[][]
     */
    public function docBlockHints()
    {
        return [
            [DocBlockOnlyHintsClass::class, 'arrayParameter', 'foo', 'array'],
            [DocBlockOnlyHintsClass::class, 'callableParameter', 'foo', 'callable'],
            [DocBlockOnlyHintsClass::class, 'intParameter', 'foo', 'int'],
            [DocBlockOnlyHintsClass::class, 'floatParameter', 'foo', 'float'],
            [DocBlockOnlyHintsClass::class, 'stringParameter', 'foo', 'string'],
            [DocBlockOnlyHintsClass::class, 'boolParameter', 'foo', 'bool'],
            [DocBlockOnlyHintsClass::class, 'selfParameter', 'foo', 'self'],
            [DocBlockOnlyHintsClass::class, 'classParameter', 'foo', 'DocBlockOnlyHintsClass'],
            [DocBlockOnlyHintsClass::class, 'otherClassParameter', 'foo', 'InternalHintsClass'],
        ];
    }
}


text:
package home.smart.fly.animations.ui.activity;

import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;

import home.smart.fly.animations.R;

public class LoaderActivity extends AppCompatActivity {

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


text:
#include <codecvt>
#include <locale>

#include <boost/filesystem.hpp>

#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>

#include "util.h"

boost::filesystem::path GetDataPath(const wchar_t *path)
{
	boost::filesystem::wpath data_path = GetAppPath() / L"Data";

	boost::system::error_code ec;
	if (!boost::filesystem::is_directory(data_path, ec))
	{
		boost::filesystem::remove(data_path);
		boost::filesystem::create_directory(data_path, ec);
	}

	return data_path / path;
}

boost::filesystem::path GetLangPath(const wchar_t *path)
{
	return GetAppPath() / L"Lang" / path;
}

bool LoadFromFile(boost::property_tree::wptree &config, const wchar_t *path)
{
	try{
		std::wifstream file(path, std::ios_base::binary);

		file.imbue(std::locale(std::locale(), new std::codecvt_utf8_utf16<wchar_t>));

		boost::property_tree::json_parser::read_json(file, config);

		file.close();
		return true;
	}
	catch (...)
	{
		boost::filesystem::remove(path);
	}

	return false;
}

void SaveToFile(const boost::property_tree::wptree &config, const wchar_t *path)
{
	std::wofstream file(path, std::ios_base::binary);

	file.imbue(std::locale(std::locale(), new std::codecvt_utf8_utf16<wchar_t>));

	boost::property_tree::json_parser::write_json(file, config);
	file.close();
}


text:
<?php

namespace TwigBridge\Tests;

use PHPUnit\Framework\TestCase;

abstract class Base extends TestCase
{
    use TwigBridgeTestTrait;
}


text:
<?php
/**
 * This class has been auto-generated by the Doctrine ORM Framework
 */
class Version135 extends Doctrine_Migration_Base
{
    public function up()
    {
        $this->createForeignKey('customers_domains_registrars', 'cpdp', array(
             'name' => 'cpdp',
             'local' => 'profile_id',
             'foreign' => 'profile_id',
             'foreignTable' => 'domains_profiles',
             'onUpdate' => '',
             'onDelete' => 'CASCADE',
             ));
        $this->addIndex('customers_domains_registrars', 'customers_domains_registrars_profile_id', array(
             'fields' =>
             array(
              0 => 'profile_id',
             ),
             ));
    }

    public function down()
    {
        $this->dropForeignKey('customers_domains_registrars', 'cpdp');
        $this->removeIndex('customers_domains_registrars', 'customers_domains_registrars_profile_id', array(
             'fields' =>
             array(
              0 => 'profile_id',
             ),
             ));
    }
}


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.tasomaniac.android.widget.example.MainActivity" >

    <item android:id="@+id/action_about"
        android:title="@string/action_about"
        app:showAsAction="never" />

    <item android:id="@+id/action_github"
        android:title="@string/action_github"
        app:showAsAction="never" />

</menu>


text:
using System;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Core.Internal;
using Grpc.Core.Utils;
using NUnit.Framework;

namespace Grpc.Core.Tests
{
    public class ClientServerTest
    {
        const string Host = "127.0.0.1";

        MockServiceHelper helper;
        Server server;
        Channel channel;

        [SetUp]
        public void Init()
        {
            helper = new MockServiceHelper(Host);
            server = helper.GetServer();
            server.Start();
            channel = helper.GetChannel();
        }

        [TearDown]
        public void Cleanup()
        {
            channel.ShutdownAsync().Wait();
            server.ShutdownAsync().Wait();
        }

        [Test]
        public async Task UnaryCall()
        {
            helper.UnaryHandler = new UnaryServerMethod<string, string>(async (request, context) =>
            {
                return request;
            });

            Assert.AreEqual("ABC", Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "ABC"));

            Assert.AreEqual("ABC", await Calls.AsyncUnaryCall(helper.CreateUnaryCall(), "ABC"));
        }

        [Test]
        public void UnaryCall_ServerHandlerThrows()
        {
            helper.UnaryHandler = new UnaryServerMethod<string, string>((request, context) =>
            {
                throw new Exception("This was thrown on purpose by a test");
            });

            var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc"));
            Assert.AreEqual(StatusCode.Unknown, ex.Status.StatusCode);

            var ex2 = Assert.Throws<RpcException>(async () => await Calls.AsyncUnaryCall(helper.CreateUnaryCall(), "abc"));
            Assert.AreEqual(StatusCode.Unknown, ex2.Status.StatusCode);
        }

        [Test]
        public void UnaryCall_ServerHandlerThrowsRpcException()
        {
            helper.UnaryHandler = new UnaryServerMethod<string, string>((request, context) =>
            {
                throw new RpcException(new Status(StatusCode.Unauthenticated, ""));
            });

            var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc"));
            Assert.AreEqual(StatusCode.Unauthenticated, ex.Status.StatusCode);

            var ex2 = Assert.Throws<RpcException>(async () => await Calls.AsyncUnaryCall(helper.CreateUnaryCall(), "abc"));
            Assert.AreEqual(StatusCode.Unauthenticated, ex2.Status.StatusCode);
        }

        [Test]
        public void UnaryCall_ServerHandlerSetsStatus()
        {
            helper.UnaryHandler = new UnaryServerMethod<string, string>(async (request, context) =>
            {
                context.Status = new Status(StatusCode.Unauthenticated, "");
                return "";
            });

            var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc"));
            Assert.AreEqual(StatusCode.Unauthenticated, ex.Status.StatusCode);

            var ex2 = Assert.Throws<RpcException>(async () => await Calls.AsyncUnaryCall(helper.CreateUnaryCall(), "abc"));
            Assert.AreEqual(StatusCode.Unauthenticated, ex2.Status.StatusCode);
        }

        [Test]
        public async Task ClientStreamingCall()
        {
            helper.ClientStreamingHandler = new ClientStreamingServerMethod<string, string>(async (requestStream, context) =>
            {
                string result = "";
                await requestStream.ForEachAsync(async (request) =>
                {
                    result += request;
                });
                await Task.Delay(100);
                return result;
            });

            var call = Calls.AsyncClientStreamingCall(helper.CreateClientStreamingCall());
            await call.RequestStream.WriteAllAsync(new string[] { "A", "B", "C" });
            Assert.AreEqual("ABC", await call.ResponseAsync);
        }

        [Test]
        public async Task ClientStreamingCall_CancelAfterBegin()
        {
            var barrier = new TaskCompletionSource<object>();

            helper.ClientStreamingHandler = new ClientStreamingServerMethod<string, string>(async (requestStream, context) =>
            {
                barrier.SetResult(null);
                await requestStream.ToListAsync();
                return "";
            });

            var cts = new CancellationTokenSource();
            var call = Calls.AsyncClientStreamingCall(helper.CreateClientStreamingCall(new CallOptions(cancellationToken: cts.Token)));

            await barrier.Task;  // make sure the handler has started.
            cts.Cancel();

            var ex = Assert.Throws<RpcException>(async () => await call.ResponseAsync);
            Assert.AreEqual(StatusCode.Cancelled, ex.Status.StatusCode);
        }

        [Test]
        public async Task AsyncUnaryCall_EchoMetadata()
        {
            helper.UnaryHandler = new UnaryServerMethod<string, string>(async (request, context) =>
            {
                foreach (Metadata.Entry metadataEntry in context.RequestHeaders)
                {
                    if (metadataEntry.Key != "user-agent")
                    {
                        context.ResponseTrailers.Add(metadataEntry);
                    }
                }
                return "";
            });

            var headers = new Metadata
            {
                { "ascii-header", "abcdefg" },
                { "binary-header-bin", new byte[] { 1, 2, 3, 0, 0xff } }
            };
            var call = Calls.AsyncUnaryCall(helper.CreateUnaryCall(new CallOptions(headers: headers)), "ABC");
            await call;

            Assert.AreEqual(StatusCode.OK, call.GetStatus().StatusCode);

            var trailers = call.GetTrailers();
            Assert.AreEqual(2, trailers.Count);
            Assert.AreEqual(headers[0].Key, trailers[0].Key);
            Assert.AreEqual(headers[0].Value, trailers[0].Value);

            Assert.AreEqual(headers[1].Key, trailers[1].Key);
            CollectionAssert.AreEqual(headers[1].ValueBytes, trailers[1].ValueBytes);
        }

        [Test]
        public void UnaryCallPerformance()
        {
            helper.UnaryHandler = new UnaryServerMethod<string, string>(async (request, context) =>
            {
                return request;
            });

            var callDetails = helper.CreateUnaryCall();
            BenchmarkUtil.RunBenchmark(100, 100,
                                       () => { Calls.BlockingUnaryCall(callDetails, "ABC"); });
        }

        [Test]
        public void UnknownMethodHandler()
        {
            var nonexistentMethod = new Method<string, string>(
                MethodType.Unary,
                MockServiceHelper.ServiceName,
                "NonExistentMethod",
                Marshallers.StringMarshaller,
                Marshallers.StringMarshaller);

            var callDetails = new CallInvocationDetails<string, string>(channel, nonexistentMethod, new CallOptions());

            var ex = Assert.Throws<RpcException>(() => Calls.BlockingUnaryCall(callDetails, "abc"));
            Assert.AreEqual(StatusCode.Unimplemented, ex.Status.StatusCode);
        }

        [Test]
        public void UserAgentStringPresent()
        {
            helper.UnaryHandler = new UnaryServerMethod<string, string>(async (request, context) =>
            {
                return context.RequestHeaders.Where(entry => entry.Key == "user-agent").Single().Value;
            });

            string userAgent = Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc");
            Assert.IsTrue(userAgent.StartsWith("grpc-csharp/"));
        }

        [Test]
        public void PeerInfoPresent()
        {
            helper.UnaryHandler = new UnaryServerMethod<string, string>(async (request, context) =>
            {
                return context.Peer;
            });

            string peer = Calls.BlockingUnaryCall(helper.CreateUnaryCall(), "abc");
            Assert.IsTrue(peer.Contains(Host));
        }

        [Test]
        public async Task Channel_WaitForStateChangedAsync()
        {
            helper.UnaryHandler = new UnaryServerMethod<string, string>(async (request, context) =>
            {
                return request;
            });

            Assert.Throws(typeof(TaskCanceledException),
                async () => await channel.WaitForStateChangedAsync(channel.State, DateTime.UtcNow.AddMilliseconds(10)));

            var stateChangedTask = channel.WaitForStateChangedAsync(channel.State);

            await Calls.AsyncUnaryCall(helper.CreateUnaryCall(), "abc");

            await stateChangedTask;
            Assert.AreEqual(ChannelState.Ready, channel.State);
        }

        [Test]
        public async Task Channel_ConnectAsync()
        {
            await channel.ConnectAsync();
            Assert.AreEqual(ChannelState.Ready, channel.State);

            await channel.ConnectAsync(DateTime.UtcNow.AddMilliseconds(1000));
            Assert.AreEqual(ChannelState.Ready, channel.State);
        }
    }
}


text:
@interface AddCustomViewController : UIViewController

@property (weak, nonatomic) IBOutlet UIView *addView;
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator;

@property (strong) PaymentezAddNativeViewController *paymentezAddVC;
@end


text:
all: ../src/unicode_util_compat.erl

../src/unicode_util_compat.erl: ../uc_spec/*
	escript ../uc_spec/gen_unicode_mod.escript


text:
<!--
id: 341165556
link: http://tumblr.atmos.org/post/341165556/hammertime-an-interactive-error-console-for-ruby
slug: hammertime-an-interactive-error-console-for-ruby
date: Mon Jan 18 2010 09:45:53 GMT-0800 (PST)
publish: 2010-01-018
tags:
title:   Hammertime: An interactive error console for Ruby  | Virtuous Code
-->

  Hammertime: An interactive error console for Ruby  | Virtuous Code
====================================================================

[http://avdi.org/devblog/2010/01/18/hammertime/](http://avdi.org/devblog/2010/01/18/hammertime/)