text:
package net.violet.platform.api.actions.people;

import java.util.List;

import net.violet.common.utils.RegexTools;
import net.violet.platform.api.actions.ActionParam;
import net.violet.platform.api.exceptions.APIErrorMessage;
import net.violet.platform.api.exceptions.InvalidParameterException;
import net.violet.platform.api.exceptions.PersonAlreadyExistsException;
import net.violet.platform.api.maps.persons.PersonInformationMap;
import net.violet.platform.datamodel.Application;
import net.violet.platform.datamodel.Application.ApplicationClass;
import net.violet.platform.dataobjects.CountryData;
import net.violet.platform.dataobjects.SiteLangData;
import net.violet.platform.dataobjects.TimezoneData;
import net.violet.platform.dataobjects.UserData;
import net.violet.platform.util.Templates;

public class Create extends AbstractUserAction {

	@Override
	protected Object doProcessRequest(ActionParam inParam) throws InvalidParameterException, PersonAlreadyExistsException {

		final String email = inParam.getString("email", true);

		// Checks if the given email parameter really is a valid email address
		if (!RegexTools.isAValidEmail(email)) {
			throw new InvalidParameterException(APIErrorMessage.NOT_AN_EMAIL_ADDRESS, email);
		}

		// Checks if the given email address is not already used
		if (UserData.findByEmail(email) != null) {
			throw new PersonAlreadyExistsException(APIErrorMessage.EMAIL_ADDRESS_ALREADY_EXISTS);
		}

		final String password = inParam.getString("password", true);

		if (net.violet.common.StringShop.EMPTY_STRING.equals(password)) {
			throw new InvalidParameterException(APIErrorMessage.PASSWORD_CANNOT_BE_EMPTY, net.violet.common.StringShop.EMPTY_STRING);
		}

		final String firstName = inParam.getString("first_name", true);
		final String lastName = inParam.getString("last_name", true);
		final String city = inParam.getString("city", true);
		final String theTimeZoneName = inParam.getString("timezone", true);

		final TimezoneData theTimeZone = TimezoneData.findByJavaId(theTimeZoneName);
		if (theTimeZone == null) {
			throw new InvalidParameterException(APIErrorMessage.NOT_A_TIMEZONE, theTimeZoneName);
		}

		final String theLangCode = inParam.getString("lang", true);
		final SiteLangData theLang = SiteLangData.getByISOCode(theLangCode);

		final String theCountryCode = inParam.getString("country", true);
		final CountryData theCountry = CountryData.getDefaultCountryByJavaId(theCountryCode, theLang.getReference());
		if (theCountry == null) {
			throw new InvalidParameterException(APIErrorMessage.NOT_A_COUNTRY_CODE, theCountryCode);
		}

		final UserData newUser = UserData.createNewUser(email, password, theLang, theCountry, city, firstName, lastName, theTimeZone);

		if (newUser != null) {
			final PersonInformationMap result = new PersonInformationMap(inParam.getCaller(), newUser, true);
			Templates.createAccount(newUser.getReference());
			return result;
		}

		return null;
	}

	public long getExpirationTime() {
		return 0;
	}

	public ActionType getType() {
		return ActionType.CREATE;
	}

	public boolean isCacheable() {
		return false;
	}

	@Override
	public List<ApplicationClass> getAuthorizedApplicationClasses() {
		return Application.CLASSES_UI;
	}

}


text:
package Finds;

import com.sun.javafx.image.PixelUtils;
import com.sun.org.apache.bcel.internal.generic.NEW;

/** 基于拉链法的散列表
*
* */
public class SeparaterChainingHashST <Key extends Comparable<Key>,Value> {

    private int N;  // 键值对总数
    private int M;  // 散列表的大小
    private SequentialSearchST<Key,Value>[] st;  // 存放链表对象的数组

    public   SeparaterChainingHashST(){
        this(997);
    }

    // 初始化,生产M个链表
    public SeparaterChainingHashST(int M){
        this.M = M;
        st =  new SequentialSearchST[M];
        for (int i=0;i<M;i++){
            st[i] = new SequentialSearchST<>();
        }

    }

    private int hash(Key key){
        return (key.hashCode() & 0x7fffffff) % M;
    }

    public Value get(Key key){
        return (Value) st[hash(key)].get(key);
    }

    public void  put(Key key,Value value){
        st[hash(key)].put(key,value);
    }

}

redpajama_set_name: RedPajamaGithub


text:
/** java bean entity **/
package org.nibble.dao.factura;

import java.sql.ResultSet;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class FacturaDAO implements org.nibble.main.dbInterfase {

	private Connection conn;
	private ResultSet rSet;
	private PreparedStatement stmt;

	private int iidfactura;
	private int iidnocliente;
	private int iidusuario;
	private String tisfechafactura;
	private float decsubtotal;
	private float decivatotal;
	private String vchletra;
	private int inumero;
	private float decdescglobal;
	private String tisfechavencimient;
	private boolean bitcredito;
	private float decmontodesc;
        private String vchrfccliente;
        private String vchserie;
        private int ifolio;
        private int inumaprobacion;
        private String vchfechahora;
        private float decmontooperacion;
        private float decmontoimpuesto;
        private String vchestadocomprobante;
        private String vchefectocomprobante;
        private String vchpedimento;
        private String vchfechapedimento;
        private String vchaduana;
        private String vchformapago;
        private String vchmetodopago;
        private String vchmcuentapago;

	public void create() throws Exception, java.sql.SQLException {
		StringBuffer query = new StringBuffer();
		query.append("INSERT INTO FACTURA (iidfactura,iidnocliente,iidusuario,tisfechafactura,"
                        + "decsubtotal,decivatotal,vchletra,inumero,decdescglobal,"
                        + "tisfechavencimient,bitcredito,decmontodesc, vchrfccliente, "
                        + "vchserie, ifolio, inumaprobacion, vchfechahora, decmontooperacion, "
                        + "decmontoimpuesto, vchestadocomprobante, vchefectocomprobante, vchpedimento, "
                        + "vchfechapedimento, vchaduana, vchformapago, vchmetodopago,vchcuentapago)");
		query.append(" VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ");
		stmt = conn.prepareStatement(query.toString().toLowerCase());
		stmt.setInt(1,iidfactura);
		stmt.setInt(2,iidnocliente);
		stmt.setInt(3,iidusuario);
		stmt.setString(4,tisfechafactura);
		stmt.setFloat(5,decsubtotal);
		stmt.setFloat(6,decivatotal);
		stmt.setString(7,vchletra);
		stmt.setInt(8,inumero);
		stmt.setFloat(9,decdescglobal);
		stmt.setString(10,tisfechavencimient);
		stmt.setBoolean(11, isBitcredito());
		stmt.setFloat(12,decmontodesc);
                stmt.setString(13,vchrfccliente);
                stmt.setString(14,vchserie);
                stmt.setInt(15,ifolio);
                stmt.setInt(16,inumaprobacion);
                stmt.setString(17,vchfechahora);
                stmt.setFloat(18,decmontooperacion);
                stmt.setFloat(19,decmontoimpuesto);
                stmt.setString(20,vchestadocomprobante);
                stmt.setString(21,vchefectocomprobante);
                stmt.setString(22,vchpedimento);
                stmt.setString(23,vchfechapedimento);
                stmt.setString(24,vchaduana);
                stmt.setString(25,vchformapago);
                stmt.setString(26,vchmetodopago);
                stmt.setString(27,vchmcuentapago);
		stmt.executeUpdate();
		stmt.close();
	}
	public boolean load() throws Exception, java.sql.SQLException {
		StringBuffer query = new StringBuffer();
		query.append("SELECT * ");
		query.append("FROM FACTURA ");
		query.append("WHERE iidfactura=? ");
		stmt = conn.prepareStatement(query.toString().toLowerCase());
		stmt.setInt(1,iidfactura);
		rSet = stmt.executeQuery();

		if (rSet.next()) {
			this.iidnocliente = rSet.getInt("iidnocliente");
			this.iidusuario = rSet.getInt("iidusuario");
			this.tisfechafactura = rSet.getString("tisfechafactura");
			this.decsubtotal = rSet.getFloat("decsubtotal");
			this.decivatotal = rSet.getFloat("decivatotal");
			this.vchletra = rSet.getString("vchletra");
			this.inumero = rSet.getInt("inumero");
			this.decdescglobal = rSet.getFloat("decdescglobal");
			this.tisfechavencimient = rSet.getString("tisfechavencimient");
			this.bitcredito = rSet.getBoolean("bitcredito");
			this.decmontodesc = rSet.getFloat("decmontodesc");
		}
		else
			throw new Exception ("No se encontro el registro");
		rSet.close();
		stmt.close();
		return false;
	}
	public void remove() throws Exception, java.sql.SQLException {
		StringBuffer query = new StringBuffer();
		query.append("DELETE FROM FACTURA ");
		query.append("WHERE iidfactura=? ");
		stmt = conn.prepareStatement(query.toString().toLowerCase());
		stmt.setInt(1,iidfactura);
		stmt.executeUpdate();
		stmt.close();
	}
	public void store() throws SQLException {
		StringBuffer query = new StringBuffer();
		query.append("UPDATE FACTURA SET iidnocliente=? , iidusuario=? , tisfechafactura=? , decsubtotal=? , decivatotal=? , vchletra=? , inumero=? , decdescglobal=? , tisfechavencimient=? , bitcredito=? , decmontodesc=? ");
		query.append("WHERE iidfactura=? ");
		stmt = conn.prepareStatement(query.toString().toLowerCase());
		stmt.setInt(1,iidnocliente);
		stmt.setInt(2,iidusuario);
		stmt.setString(3,tisfechafactura);
		stmt.setFloat(4,decsubtotal);
		stmt.setFloat(5,decivatotal);
		stmt.setString(6,vchletra);
		stmt.setInt(7,inumero);
		stmt.setFloat(8,decdescglobal);
		stmt.setString(9,tisfechavencimient);
		stmt.setBoolean(10, isBitcredito());
		stmt.setFloat(11,decmontodesc);
		stmt.setInt(12,iidfactura);
		stmt.executeUpdate();
		stmt.close();
	}
	public void setConnection(java.sql.Connection conn) {
		this.conn = conn;
	}
	public void setIidfactura(int iidfactura){
		this.iidfactura=iidfactura;
	}
	public int getIidfactura(){
		return this.iidfactura;
	}
	public void setIidnocliente(int iidnocliente){
		this.iidnocliente=iidnocliente;
	}
	public int getIidnocliente(){
		return this.iidnocliente;
	}
	public void setIidusuario(int iidusuario){
		this.iidusuario=iidusuario;
	}
	public int getIidusuario(){
		return this.iidusuario;
	}
	public void setTisfechafactura(String tisfechafactura){
		this.tisfechafactura=tisfechafactura;
	}
	public String getTisfechafactura(){
		return this.tisfechafactura;
	}
	public void setDecsubtotal(float decsubtotal){
		this.decsubtotal=decsubtotal;
	}
	public float getDecsubtotal(){
		return this.decsubtotal;
	}
	public void setDecivatotal(float decivatotal){
		this.decivatotal=decivatotal;
	}
	public float getDecivatotal(){
		return this.decivatotal;
	}
	public void setVchletra(String vchletra){
		this.vchletra=vchletra;
	}
	public String getVchletra(){
		return this.vchletra;
	}
	public void setInumero(int inumero){
		this.inumero=inumero;
	}
	public int getInumero(){
		return this.inumero;
	}
	public void setDecdescglobal(float decdescglobal){
		this.decdescglobal=decdescglobal;
	}
	public float getDecdescglobal(){
		return this.decdescglobal;
	}
	public void setTisfechavencimient(String tisfechavencimient){
		this.tisfechavencimient=tisfechavencimient;
	}
	public String getTisfechavencimient(){
		return this.tisfechavencimient;
	}
	public void setBitcredito(boolean bitcredito){
		this.bitcredito=bitcredito;
	}
	public boolean getBitcredito(){
		return this.isBitcredito();
	}
	public void setDecmontodesc(float decmontodesc){
		this.decmontodesc=decmontodesc;
	}
	public float getDecmontodesc(){
		return this.decmontodesc;
	}

    /**
     * @return the bitcredito
     */
    public boolean isBitcredito() {
        return bitcredito;
    }

    /**
     * @return the vchfechahora
     */
    public String getVchfechahora() {
        return vchfechahora;
    }

    /**
     * @param vchfechahora the vchfechahora to set
     */
    public void setVchfechahora(String vchfechahora) {
        this.vchfechahora = vchfechahora;
    }

    /**
     * @return the vchrfccliente
     */
    public String getVchrfccliente() {
        return vchrfccliente;
    }

    /**
     * @param vchrfccliente the vchrfccliente to set
     */
    public void setVchrfccliente(String vchrfccliente) {
        this.vchrfccliente = vchrfccliente;
    }

    /**
     * @return the vchserie
     */
    public String getVchserie() {
        return vchserie;
    }

    /**
     * @param vchserie the vchserie to set
     */
    public void setVchserie(String vchserie) {
        this.vchserie = vchserie;
    }

    /**
     * @return the ifolio
     */
    public int getIfolio() {
        return ifolio;
    }

    /**
     * @param ifolio the ifolio to set
     */
    public void setIfolio(int ifolio) {
        this.ifolio = ifolio;
    }

    /**
     * @return the inumaprobacion
     */
    public int getInumaprobacion() {
        return inumaprobacion;
    }

    /**
     * @param inumaprobacion the inumaprobacion to set
     */
    public void setInumaprobacion(int inumaprobacion) {
        this.inumaprobacion = inumaprobacion;
    }

    /**
     * @return the decmontooperacion
     */
    public float getDecmontooperacion() {
        return decmontooperacion;
    }

    /**
     * @param decmontooperacion the decmontooperacion to set
     */
    public void setDecmontooperacion(float decmontooperacion) {
        this.decmontooperacion = decmontooperacion;
    }

    /**
     * @return the decmontoimpuesto
     */
    public float getDecmontoimpuesto() {
        return decmontoimpuesto;
    }

    /**
     * @param decmontoimpuesto the decmontoimpuesto to set
     */
    public void setDecmontoimpuesto(float decmontoimpuesto) {
        this.decmontoimpuesto = decmontoimpuesto;
    }

    /**
     * @return the vchestadocomprobante
     */
    public String getVchestadocomprobante() {
        return vchestadocomprobante;
    }

    /**
     * @param vchestadocomprobante the vchestadocomprobante to set
     */
    public void setVchestadocomprobante(String vchestadocomprobante) {
        this.vchestadocomprobante = vchestadocomprobante;
    }

    /**
     * @return the vchefectocomprobante
     */
    public String getVchefectocomprobante() {
        return vchefectocomprobante;
    }

    /**
     * @param vchefectocomprobante the vchefectocomprobante to set
     */
    public void setVchefectocomprobante(String vchefectocomprobante) {
        this.vchefectocomprobante = vchefectocomprobante;
    }

    /**
     * @return the vchpedimento
     */
    public String getVchpedimento() {
        return vchpedimento;
    }

    /**
     * @param vchpedimento the vchpedimento to set
     */
    public void setVchpedimento(String vchpedimento) {
        this.vchpedimento = vchpedimento;
    }

    /**
     * @return the vchfechapedimento
     */
    public String getVchfechapedimento() {
        return vchfechapedimento;
    }

    /**
     * @param vchfechapedimento the vchfechapedimento to set
     */
    public void setVchfechapedimento(String vchfechapedimento) {
        this.vchfechapedimento = vchfechapedimento;
    }

    /**
     * @return the vchaduana
     */
    public String getVchaduana() {
        return vchaduana;
    }

    /**
     * @param vchaduana the vchaduana to set
     */
    public void setVchaduana(String vchaduana) {
        this.vchaduana = vchaduana;
    }

    /**
     * @return the vchformapago
     */
    public String getVchformapago() {
        return vchformapago;
    }

    /**
     * @param vchformapago the vchformapago to set
     */
    public void setVchformapago(String vchformapago) {
        this.vchformapago = vchformapago;
    }

    /**
     * @return the vchmetodopago
     */
    public String getVchmetodopago() {
        return vchmetodopago;
    }

    /**
     * @param vchmetodopago the vchmetodopago to set
     */
    public void setVchmetodopago(String vchmetodopago) {
        this.vchmetodopago = vchmetodopago;
    }

    /**
     * @return the vchmcuentapgo
     */
    public String getVchmcuentapago() {
        return vchmcuentapago;
    }

    /**
     * @param vchmcuentapgo the vchmcuentapgo to set
     */
    public void setVchmcuentapago(String vchmcuentapago) {
        this.vchmcuentapago = vchmcuentapago;
    }
}


text:
using System.Windows.Controls;
using System.Linq;
using GameRes.Formats.Properties;
using GameRes.Formats.NitroPlus;
using GameRes.Formats.Strings;

namespace GameRes.Formats.GUI
{
    /// <summary>
    /// Interaction logic for WidgetNPA.xaml
    /// </summary>
    public partial class WidgetNPA : Grid
    {
        public WidgetNPA ()
        {
            var selected = Settings.Default.NPAScheme;
            InitializeComponent();
            var keys = new string[] { arcStrings.ArcNoEncryption };
            Scheme.ItemsSource = keys.Concat (NpaOpener.KnownSchemes.Keys.OrderBy (x => x));
            if (NpaTitleId.NotEncrypted == NpaOpener.GetTitleId (selected))
                Scheme.SelectedIndex = 0;
            else
                Scheme.SelectedValue = selected;
        }
    }
}


text:
package org.apache.reef.tests.fail.task;

import org.apache.reef.annotations.audience.ClientSide;
import org.apache.reef.annotations.audience.Private;
import org.apache.reef.bridge.driver.client.DriverClientConfiguration;
import org.apache.reef.bridge.proto.ClientProtocol;
import org.apache.reef.client.LauncherStatus;
import org.apache.reef.tang.Configuration;
import org.apache.reef.tang.JavaConfigurationBuilder;
import org.apache.reef.tang.Tang;
import org.apache.reef.tang.exceptions.InjectionException;
import org.apache.reef.task.Task;
import org.apache.reef.tests.TestDriverLauncher;
import org.apache.reef.tests.fail.util.FailBridgeClientUtils;
import org.apache.reef.util.EnvironmentUtils;
import org.apache.reef.util.OSUtils;

import java.io.IOException;

/**
 * Fail task bridge client.
 */
@Private
@ClientSide
public final class BridgeClient  {

  /**
   * Empty private constructor to prohibit instantiation of utility class.
   */
  private BridgeClient() {
  }

  public static LauncherStatus run(
      final Class<? extends Task> failTaskClass,
      final Configuration runtimeConfig,
      final int timeOut) throws IOException, InjectionException {
    ClientProtocol.DriverClientConfiguration.Builder builder =
        ClientProtocol.DriverClientConfiguration.newBuilder()
            .setJobid("FailBridge_" + failTaskClass.getSimpleName())
            .addGlobalLibraries(EnvironmentUtils.getClassLocation(Driver.class));
    builder.setOperatingSystem(
        OSUtils.isWindows() ?
            ClientProtocol.DriverClientConfiguration.OS.WINDOWS :
            ClientProtocol.DriverClientConfiguration.OS.LINUX);

    return run(failTaskClass, runtimeConfig, builder.build(), timeOut);
  }

  public static LauncherStatus run(
      final Class<? extends Task> failTaskClass,
      final Configuration runtimeConfig,
      final ClientProtocol.DriverClientConfiguration driverClientConfiguration,
      final int timeOut) throws InjectionException, IOException {

    final Configuration driverConfig = DriverClientConfiguration.CONF
        .set(DriverClientConfiguration.ON_EVALUATOR_ALLOCATED, Driver.AllocatedEvaluatorHandler.class)
        .set(DriverClientConfiguration.ON_TASK_RUNNING, Driver.RunningTaskHandler.class)
        .set(DriverClientConfiguration.ON_CONTEXT_ACTIVE, Driver.ActiveContextHandler.class)
        .set(DriverClientConfiguration.ON_DRIVER_STARTED, Driver.StartHandler.class)
        .build();

    final JavaConfigurationBuilder cb = Tang.Factory.getTang().newConfigurationBuilder();
    cb.addConfiguration(driverConfig);
    cb.bindNamedParameter(Driver.FailTaskName.class, failTaskClass.getSimpleName());

    final Configuration driverServiceConfiguration =
        FailBridgeClientUtils.setupDriverService(
            runtimeConfig,
            cb.build(),
            driverClientConfiguration);
    return TestDriverLauncher.getLauncher(runtimeConfig).run(driverServiceConfiguration, timeOut);
  }
}


text:
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "tests.h"

JSPrincipals system_principals = {
    1
};

JSClass global_class = {
    "global",
    JSCLASS_IS_GLOBAL | JSCLASS_GLOBAL_FLAGS,
    JS_PropertyStub,
    JS_PropertyStub,
    JS_PropertyStub,
    JS_StrictPropertyStub,
    JS_EnumerateStub,
    JS_ResolveStub,
    JS_ConvertStub
};

JSObject *trusted_glob = NULL;
JSObject *trusted_fun = NULL;

JSBool
CallTrusted(JSContext *cx, unsigned argc, jsval *vp)
{
    if (!JS_SaveFrameChain(cx))
        return JS_FALSE;

    JSBool ok = JS_FALSE;
    {
        JSAutoCompartment ac(cx, trusted_glob);
        ok = JS_CallFunctionValue(cx, NULL, OBJECT_TO_JSVAL(trusted_fun),
                                  0, NULL, vp);
    }
    JS_RestoreFrameChain(cx);
    return ok;
}

BEGIN_TEST(testChromeBuffer)
{
    JS_SetTrustedPrincipals(rt, &system_principals);

    trusted_glob = JS_NewGlobalObject(cx, &global_class, &system_principals);
    CHECK(trusted_glob);

    if (!JS_AddNamedObjectRoot(cx, &trusted_glob, "trusted-global"))
        return false;
    if (!JS_AddNamedObjectRoot(cx, &trusted_fun, "trusted-function"))
        return false;

    JSFunction *fun;

    /*
     * Check that, even after untrusted content has exhausted the stack, code
     * compiled with "trusted principals" can run using reserved trusted-only
     * buffer space.
     */
    {
        {
            JSAutoCompartment ac(cx, trusted_glob);
            const char *paramName = "x";
            const char *bytes = "return x ? 1 + trusted(x-1) : 0";
            JS::HandleObject global = JS::HandleObject::fromMarkedLocation(&trusted_glob);
            CHECK(fun = JS_CompileFunctionForPrincipals(cx, global, &system_principals,
                                                        "trusted", 1, &paramName, bytes, strlen(bytes),
                                                        "", 0));
            trusted_fun = JS_GetFunctionObject(fun);
        }

        jsval v = OBJECT_TO_JSVAL(trusted_fun);
        CHECK(JS_WrapValue(cx, &v));

        const char *paramName = "trusted";
        const char *bytes = "try {                                      "
                            "  return untrusted(trusted);               "
                            "} catch (e) {                              "
                            "  return trusted(100);                     "
                            "}                                          ";
        CHECK(fun = JS_CompileFunction(cx, global, "untrusted", 1, &paramName,
                                       bytes, strlen(bytes), "", 0));

        jsval rval;
        CHECK(JS_CallFunction(cx, NULL, fun, 1, &v, &rval));
        CHECK(JSVAL_TO_INT(rval) == 100);
    }

    /*
     * Check that content called from chrome in the reserved-buffer space
     * immediately ooms.
     */
    {
        {
            JSAutoCompartment ac(cx, trusted_glob);
            const char *paramName = "untrusted";
            const char *bytes = "try {                                  "
                                "  untrusted();                         "
                                "} catch (e) {                          "
                                "  return 'From trusted: ' + e;         "
                                "}                                      ";
            JS::HandleObject global = JS::HandleObject::fromMarkedLocation(&trusted_glob);
            CHECK(fun = JS_CompileFunctionForPrincipals(cx, global, &system_principals,
                                                        "trusted", 1, &paramName, bytes, strlen(bytes),
                                                        "", 0));
            trusted_fun = JS_GetFunctionObject(fun);
        }

        jsval v = OBJECT_TO_JSVAL(trusted_fun);
        CHECK(JS_WrapValue(cx, &v));

        const char *paramName = "trusted";
        const char *bytes = "try {                                      "
                            "  return untrusted(trusted);               "
                            "} catch (e) {                              "
                            "  return trusted(untrusted);               "
                            "}                                          ";
        CHECK(fun = JS_CompileFunction(cx, global, "untrusted", 1, &paramName,
                                       bytes, strlen(bytes), "", 0));

        jsval rval;
        CHECK(JS_CallFunction(cx, NULL, fun, 1, &v, &rval));
        JSBool match;
        CHECK(JS_StringEqualsAscii(cx, JSVAL_TO_STRING(rval), "From trusted: InternalError: too much recursion", &match));
        CHECK(match);
    }

    /*
     * Check that JS_SaveFrameChain called on the way from content to chrome
     * (say, as done by XPCJSContextSTack::Push) works.
     */
    {
        {
            JSAutoCompartment ac(cx, trusted_glob);
            const char *bytes = "return 42";
            JS::HandleObject global = JS::HandleObject::fromMarkedLocation(&trusted_glob);
            CHECK(fun = JS_CompileFunctionForPrincipals(cx, global, &system_principals,
                                                        "trusted", 0, NULL, bytes, strlen(bytes),
                                                        "", 0));
            trusted_fun = JS_GetFunctionObject(fun);
        }

        JSFunction *fun = JS_NewFunction(cx, CallTrusted, 0, 0, global, "callTrusted");
        JS::Anchor<JSObject *> callTrusted(JS_GetFunctionObject(fun));

        const char *paramName = "f";
        const char *bytes = "try {                                      "
                            "  return untrusted(trusted);               "
                            "} catch (e) {                              "
                            "  return f();                              "
                            "}                                          ";
        CHECK(fun = JS_CompileFunction(cx, global, "untrusted", 1, &paramName,
                                       bytes, strlen(bytes), "", 0));

        jsval arg = OBJECT_TO_JSVAL(callTrusted.get());
        jsval rval;
        CHECK(JS_CallFunction(cx, NULL, fun, 1, &arg, &rval));
        CHECK(JSVAL_TO_INT(rval) == 42);
    }

    return true;
}
virtual void uninit() {
    JS_RemoveObjectRoot(cx, &trusted_glob);
    JS_RemoveObjectRoot(cx, &trusted_fun);
    JSAPITest::uninit();
}
END_TEST(testChromeBuffer)


text:
package org.teavm.jso.dom.html;

import org.teavm.jso.JSProperty;

/**
 *
 * @author Alexey Andreev
 */
public interface HTMLTitleElement extends HTMLElement {
    @JSProperty
    String getText();

    @JSProperty
    void setText(String text);
}


text:
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
 *  (C) 2006 by Argonne National Laboratory.
 *      See COPYRIGHT in top-level directory.
 */

#include "tcp_impl.h"

/* MPID_nem_tcp_get_conninfo -- This function takes a VC
   pointer as input and outputs the sockaddr, pg_id, and pg_rank of
   the remote process associated with this VC.  [NOTE: I'm not sure
   yet, if the pg_id parameters will be char* or char**.  I'd like to
   avoid a copy on this.] */
#undef FUNCNAME
#define FUNCNAME MPID_nem_tcp_get_conninfo
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_nem_tcp_get_conninfo (struct MPIDI_VC *vc, struct sockaddr_in *addr, char **pg_id, int *pg_rank)
{
    int mpi_errno = MPI_SUCCESS;
    MPID_nem_tcp_vc_area *vc_tcp = VC_TCP(vc);

    *addr = vc_tcp->sock_id;
    *pg_id = (char *)vc->pg->id;
    *pg_rank = vc->pg_rank;

    return mpi_errno;
}

/* MPID_nem_tcp_get_vc_from_conninfo -- This function takes
   the pg_id and pg_rank and returns the corresponding VC. */
#undef FUNCNAME
#define FUNCNAME MPID_nem_tcp_get_vc_from_conninfo
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_nem_tcp_get_vc_from_conninfo (char *pg_id, int pg_rank, struct MPIDI_VC **vc)
{
    int mpi_errno = MPI_SUCCESS;
    MPIDI_PG_t *pg;
    MPIDI_STATE_DECL(MPID_STATE_MPID_NEM_TCP_GET_VC_FROM_CONNINFO);

    MPIDI_FUNC_ENTER(MPID_STATE_MPID_NEM_TCP_GET_VC_FROM_CONNINFO);

    MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "pg_id=%s pg_rank=%d", pg_id, pg_rank));

    mpi_errno = MPIDI_PG_Find (pg_id, &pg);
    if (mpi_errno) MPIU_ERR_POP (mpi_errno);

    MPIU_ERR_CHKINTERNAL(pg == NULL, mpi_errno, "invalid PG");
    MPIU_ERR_CHKINTERNAL(pg_rank < 0 || pg_rank > MPIDI_PG_Get_size (pg), mpi_errno, "invalid pg_rank");

    MPIDI_PG_Get_vc_set_active (pg, pg_rank, vc);

 fn_exit:
    MPIDI_FUNC_EXIT(MPID_STATE_MPID_NEM_TCP_GET_VC_FROM_CONNINFO);
    return mpi_errno;
 fn_fail:
    goto fn_exit;
}

#undef FUNCNAME
#define FUNCNAME set_sockopts
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_nem_tcp_set_sockopts (int fd)
{
    int mpi_errno = MPI_SUCCESS;
    int option, flags;
    int ret;
    socklen_t len;

/*     fprintf(stdout, FCNAME " Enter\n"); fflush(stdout); */
    /* I heard you have to read the options after setting them in some implementations */

    option = 1;
    len = sizeof(int);
    ret = setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &option, len);
    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
    ret = getsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &option, &len);
    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);

    option = 128*1024;
    len = sizeof(int);
    ret = setsockopt (fd, SOL_SOCKET, SO_RCVBUF, &option, len);
    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
    ret = getsockopt (fd, SOL_SOCKET, SO_RCVBUF, &option, &len);
    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
    ret = setsockopt (fd, SOL_SOCKET, SO_SNDBUF, &option, len);
    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
    ret = getsockopt (fd, SOL_SOCKET, SO_SNDBUF, &option, &len);
    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);

    flags = fcntl(fd, F_GETFL, 0);
    MPIU_ERR_CHKANDJUMP2 (flags == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
    ret = fcntl(fd, F_SETFL, flags | SO_REUSEADDR);
    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);

    flags = fcntl(fd, F_GETFL, 0);
    MPIU_ERR_CHKANDJUMP2 (flags == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);
    ret = fcntl(fd, F_SETFL, flags | O_NONBLOCK);
    MPIU_ERR_CHKANDJUMP2 (ret == -1, mpi_errno, MPI_ERR_OTHER, "**fail", "**fail %s %d", MPIU_Strerror (errno), errno);

 fn_exit:
/*     fprintf(stdout, FCNAME " Exit\n"); fflush(stdout); */
    return mpi_errno;
 fn_fail:
/*     fprintf(stdout, "failure. mpi_errno = %d\n", mpi_errno); */
    goto fn_exit;
}

/*
  MPID_NEM_TCP_SOCK_ERROR_EOF : connection failed
  MPID_NEM_TCP_SOCK_CONNECTED : socket connected (connection success)
  MPID_NEM_TCP_SOCK_NOEVENT   : No event on socket

N1: some implementations do not set POLLERR when there is a pending error on socket.
So, solution is to check for readability/writeablility and then call getsockopt.
Again, getsockopt behaves differently in different implementations which  is handled
safely here (per Stevens-Unix Network Programming)

N2: As far as the socket code is concerned, it doesn't really differentiate whether
there is an error in the socket or whether the peer has closed it (i.e we have received
EOF and hence recv returns 0). Either way, we deccide the socket fd is not usable any
more. So, same return code is used.
A design decision is not to write also, if the peer has closed the socket. Please note that
write will still be succesful, even if the peer has sent us FIN. Only the subsequent
write will fail. So, this function is made tight enough and this should be called
before doing any read/write at least in the connection establishment state machine code.

N3: return code MPID_NEM_TCP_SOCK_NOEVENT is used only by the code that wants to
know whether the connect is still not complete after a non-blocking connect is issued.

TODO: Make this a macro for performance, if needed based on the usage.
FIXME : Above comments are inconsistent now with the changes. No check for EOF is
actually done now in this function.
*/

#undef FUNCNAME
#define FUNCNAME MPID_nem_tcp_check_sock_status
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
MPID_NEM_TCP_SOCK_STATUS_t
MPID_nem_tcp_check_sock_status(const struct pollfd *const plfd)
{
    int rc = MPID_NEM_TCP_SOCK_NOEVENT;

    if (plfd->revents & POLLERR)
    {
        rc = MPID_NEM_TCP_SOCK_ERROR_EOF;
        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "POLLERR on socket"));
        goto fn_exit;
    }
    if (plfd->revents & POLLIN || plfd->revents & POLLOUT)
    {
        int error=0;
        socklen_t n = sizeof(error);

        n = sizeof(error);
        if (getsockopt(plfd->fd, SOL_SOCKET, SO_ERROR, &error, &n) < 0 || error != 0)
        {
            rc = MPID_NEM_TCP_SOCK_ERROR_EOF; /*  (N1) */
            MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "getsockopt failure. error=%d:%s", error, MPIU_Strerror(error)));
            goto fn_exit;
        }
        rc = MPID_NEM_TCP_SOCK_CONNECTED;
    }
 fn_exit:
    return rc;
}

/*
 */
#undef FUNCNAME
#define FUNCNAME MPID_nem_tcp_is_sock_connected
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
int MPID_nem_tcp_is_sock_connected(int fd)
{
    int rc = FALSE;
    char buf[1];
    int buf_len = sizeof(buf)/sizeof(buf[0]), ret_recv, error=0;
    socklen_t n = sizeof(error);

    n = sizeof(error);
    if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &n) < 0 || error != 0)
    {
        MPIU_DBG_MSG_FMT(NEM_SOCK_DET, VERBOSE, (MPIU_DBG_FDEST, "getsockopt failure. error=%d:%s", error, MPIU_Strerror(error)));
        rc = FALSE; /*  error */
        goto fn_exit;
    }

    CHECK_EINTR(ret_recv, recv(fd, buf, buf_len, MSG_PEEK));
    if (ret_recv == 0)
        rc = FALSE;
    else
        rc = TRUE;
 fn_exit:
    return rc;
}

/* --BEGIN ERROR HANDLING-- */
#undef FUNCNAME
#define FUNCNAME MPID_nem_dbg_print_all_sendq
#undef FCNAME
#define FCNAME MPIDI_QUOTE(FUNCNAME)
void MPID_nem_tcp_vc_dbg_print_sendq(FILE *stream, MPIDI_VC_t *vc)
{
    int i;
    MPID_Request *sreq;
    MPID_nem_tcp_vc_area *vc_tcp = VC_TCP(vc);

    fprintf(stream, "..   sc=%p fd=%d vc_tcp->state=%d\n", vc_tcp->sc, (vc_tcp->sc ? vc_tcp->sc->fd : -1), vc_tcp->state);

    /* This function violates any abstraction in the queues, since there's no
       good way to print them without inspecting the internals. */
    sreq = vc_tcp->send_queue.head;
    i = 0;
    while (sreq)
    {
        fprintf(stream, "....[%d] sreq=%p ctx=%#x rank=%d tag=%d\n", i, sreq,
                        sreq->dev.match.parts.context_id,
                        sreq->dev.match.parts.rank,
                        sreq->dev.match.parts.tag);
        ++i;
        sreq = sreq->dev.next;
    }
}
/* --END ERROR HANDLING-- */


text:
This is an [Angular.js](http://angularjs.org) directive for viewing PDF documents using Mozilla's [PDF.js](http://mozilla.github.io/pdf.js/) library. For browsers that are not supported by PDF.js, it uses the OS' native PDF plugin. It also includes very basic pagination and zooming.

# Usage

```javascript
var app = angular.module("MyApp", ['angular-pdf-viewer']);
```

```html
<div pdf-viewer src="sample.pdf"></div>
```

# Demo

You can see a basic demo [here](http://adamalbrecht.github.io/angular-pdf-viewer/).

# Development

1. Install dependencies: [NPM](http://npmjs.org), [Ruby](https://www.ruby-lang.org/en/), [Bundler](http://bundler.io/)
2. Clone the repository
3. Run `bundle install`. This will install the version of [SASS](http://sass-lang.com/) specified in the Gemfile.
4. Run `npm install`
5. Run `bower install`
6. Run `gulp` in one shell. This will watch your files, auto-compile them, and start a local server.
7. Open your browser to [http://localhost:8282](http://localhost:8282) to view the demo


text:
.datepicker {
  width: 290px;
  position: absolute;
  background: #fff;
  border-radius: 6px;
  color: #708D66;
  font-size: 12px;
  line-height: 16px;
  padding: 15px 0 25px;
  user-select: none;
  z-index: 99;
  transform: translate3d(0px, 10px, 0px);
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease; }
  .datepicker.show {
    transform: translate3d(0px, 0px, 0px);
    opacity: 1; }
  .datepicker .header {
    width: 100%;
    height: 16px;
    padding: 0 25px; }
    .datepicker .header h4 {
      float: left;
      font-weight: 400;
      line-height: 16px;
      text-transform: capitalize; }
    .datepicker .header .controls {
      width: 45px;
      height: 16px;
      float: right;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between; }
      .datepicker .header .controls .switch {
        width: 16px;
        height: 16px;
        border-radius: 100%;
        background-color: #D7E0CE;
        cursor: pointer; }
        .datepicker .header .controls .switch.prev {
          background-image: url(../images/date-arrow-left.svg);
          background-repeat: no-repeat;
          background-size: 5px;
          background-position: 5px center; }
        .datepicker .header .controls .switch.next {
          background-image: url(../images/date-arrow-right.svg);
          background-repeat: no-repeat;
          background-size: 5px;
          background-position: 6px center; }
  .datepicker .dates {
    width: 100%;
    padding: 0 25px; }
  .datepicker ul.row {
    width: 100%;
    height: 20px;
    margin: 0 0 8px 0;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between; }
    .datepicker ul.row:last-of-type {
      margin: 0; }
    .datepicker ul.row.weekdays {
      margin: 20px 0 15px; }
    .datepicker ul.row .bar {
      height: 20px;
      position: absolute;
      top: 0;
      z-index: 1;
      background: rgba(112, 141, 102, 0.25);
      border-radius: 10px; }
    .datepicker ul.row li {
      width: 20px;
      height: 20px;
      line-height: 20px;
      float: left;
      text-align: center;
      position: relative;
      z-index: 2;
      border-radius: 100%; }
  .datepicker .weeks ul.row li {
    cursor: pointer; }
    .datepicker .weeks ul.row li.other {
      color: #E1E4E7; }
    .datepicker .weeks ul.row li.selected {
      color: #fff;
      background: #708D66; }


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/coordinatorLayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.v4.widget.SwipeRefreshLayout
            android:id="@+id/swipeRefreshDiscounts"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <com.github.dan4ik95dv.famousartists.ui.widget.EmptyRecyclerView
                android:id="@+id/listTracks"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scrollbars="vertical" />
        </android.support.v4.widget.SwipeRefreshLayout>

        <RelativeLayout
            android:id="@+id/layoutNoTracks"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone">

            <com.devspark.robototextview.widget.RobotoTextView
                android:id="@+id/textNoTracksMain"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_above="@+id/textNoTracksSecond"
                android:layout_alignWithParentIfMissing="false"
                android:layout_centerHorizontal="true"
                android:layout_marginBottom="12dp"
                android:layout_marginLeft="35dp"
                android:layout_marginRight="35dp"
                android:gravity="center"
                android:text="@string/empty_tracks"
                android:textColor="@color/primary_text_default_material_light"
                android:textSize="20sp" />

            <com.devspark.robototextview.widget.RobotoTextView
                android:id="@+id/textNoTracksSecond"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:layout_marginLeft="35dp"
                android:layout_marginRight="35dp"
                android:gravity="center"
                android:singleLine="false"
                android:text="@string/sooo_bad"
                android:textColor="@color/secondary_text_default_material_light"
                android:textSize="16sp" />
        </RelativeLayout>

        <include layout="@layout/view_progress" />
    </FrameLayout>
</android.support.design.widget.CoordinatorLayout>


text:
// Copyright (c) egmkang wang. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

namespace SharpServer.Config
{
    using System;

    public abstract class ConfigAttribute : Attribute
    {
    }

    [AttributeUsage(AttributeTargets.Class)]
    public class ConfigRootAttribute : ConfigAttribute
    {
        public ConfigRootAttribute()
        {
        }

        /// <summary>
        /// 配置的前缀, XML标记的前缀
        /// </summary>
        public string XmlNode { get; set; }
        /// <summary>
        /// 具体的配置文件名
        /// </summary>
        public string File { get; set; }
    }

    [AttributeUsage(AttributeTargets.Field)]
    public class ConfigElementAttribute : ConfigAttribute
    {
        public ConfigElementAttribute()
        {
        }

        /// <summary>
        /// XML属性的名称(可以用来重命名)
        /// </summary>
        public string Element { get; set; }
    }
}


text:
/* Ferdinand Saufler <mail@saufler.de>
 * 22.03.2015
 *
 * this example prints the ip-adresses of a given host
 */

#include <stdio.h>
#include <string.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/types.h>

int main(int argc, char** argv)
{
    /* err, stores the return value of getaddrinfo() */
    int err;

    /* store the ip-addresses in a char array, the lenth of an
     * IPv6 address on my machine is defined in
     * in.h (/usr/include/netinet/in.h) on line 233 - its 46
     * characters long */
    char ip[INET6_ADDRSTRLEN];

    /* man 3 getaddrinfo
     * struct addrinfo {
     *     int              ai_flags;
     *     int              ai_family;
     *     int              ai_socktype;
     *     int              ai_protocol;
     *     socklen_t        ai_addrlen;
     *     struct sockaddr *ai_addr;
     *     char            *ai_canonname;
     *     struct addrinfo *ai_next;
     * };
     */
    struct addrinfo hints, *result, *ptr;

    /* check the commandline argument */
    if(argc != 2)
    {
        fprintf(stderr,"usage: %s host\n",argv[0]);
        return 1;
    }
    else if (strlen(argv[1]) < 3)
    {
        fputs("length of the hostname must be at least 3 characters.\n",stderr);
        return 2;
    }

    /* make sure hints is empty */
    memset(&hints, 0, sizeof(hints));

    /* we dont care about IP4 or IP6, use AF_INET or
     * AF_INET6 to force the ip-version */
    hints.ai_family = AF_UNSPEC;

    /* use a TCP Stream Socket */
    hints.ai_socktype = SOCK_STREAM;

    /* man 3 getaddrinfo
     * the secound argument of getaddrinfo() is "0", because
     * we dont search for a specific service, we just want
     * the ip-address. getaddrinfo() creates a linked list of,
     * results, in that case "result" points to the first entry
     * in the list. */
    if((err = getaddrinfo(argv[1], 0, &hints, &result)) != 0)
    {
        fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(err));
        return 3;
    }

    printf("ip-adresses for host %s:\n", argv[1]);

    /* getaddrinfo() writes a linked list to result (**res), now
     * iterate over that linked list while ptr != NULL and
     * print out the ip-address */
    for(ptr = result; ptr != NULL; ptr = ptr->ai_next)
    {
        void *address;
        char *version;

        /* if its a IPv4 address */
        if (ptr->ai_family == AF_INET)
        {
            struct sockaddr_in *ipv4 = (struct sockaddr_in *)ptr->ai_addr;
            address = &(ipv4->sin_addr);
            version = "IPv4";
        }
        /* if its a IPv6 address */
        else if(ptr->ai_family == AF_INET6)
        {
            struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)ptr->ai_addr;
            address = &(ipv6->sin6_addr);
            version = "IPv6";
        }
        else
        {
            continue;
        }

        /* convert the ip-address to a string.
         * man 3 inet_ntop:
         * "inet_ntop - convert IPv4 and IPv6 addresses from
         * binary to text form" */
        inet_ntop(ptr->ai_family, address, ip, sizeof(ip));

        /* print the string */
        printf("  %s: %s\n", version, ip);
    }

    /* cleanup memory, free the linked list */
    freeaddrinfo(result);

    return 0;
}


text:
The socket uses OSC messages to communicate. [OSC has a simple spec](http://opensoundcontrol.org/spec-1_0) and has numerous supporting libraries. MG will only use string, integer, and boolean values in unbundled messages.

An OSC message has a path and a list of arguments.

Every request sent by a client has an argument called the "response id","resp_id","request id". These ids are chosen by the client, and will be echoed back as the first argument of any response message that was related to that request. This allows the responses to be interleaved while still allowing the client to associate each with its request.

The response id 0 is reserved for messages that arise independently of any request.

# Wire Format
In addition to the OSC protocol, MG also needs to know the size of the packet it is about to read. The size in bytes of a OSC message should be written as a 4-byte integer immediately before the packet. Currently the byte order of this integer is host-dependent.

Thus the data stream on the socket should resemble:

    <size>-<packet> <size>-<packet> ...

This same format is used when writing response packets.

# Syntax in this Document

An OSC message will be stylized as

    /the/path  (<arg list>)

where `<arg list>` is a comma separated list of arguments. Each argument will be type followed by a name.

# Client Requests

These are the messages a client might send to MG.

## eval

    /eval (int resp_id, string command)

This runs the provided string as if it was entered directly in MG's standard input. This allows clients to act as a shell for a running instance of MG.

## listen

    /listen (int resp_id, string stream_name, bool enable)

Tells MG that this client wishes to start receiving or stop receiving messages from the specified event stream. Any such events are considered independent of this request and will have a response id of 0.

Currently there are only two streams a client can listen to:

* "slot" : events occur when an input source is added to or removed from an output slot, or a slot opens and closes
* "plug" : events occur when an input source is added or removed.

# Server Responses

These are the messages a client might receive.

## done

    /done (int resp_id)

Indicates that MG is done responding to the given request. A client can stop waiting for a response to the response id.

## text

    /text (int resp_id, string text)

Indicates text for display, like standard output.

## error

    /error (int resp_id, string text, string file_name, int line_number)

Indicates an error message, possibly with a relate file name and line number where the error arose.

## Slot event

    /devslot (int resp_id, string device_name, string slot_name)

This will only be emitted if listening to slot events. It indicates the output slot an input source is moved to. If the slot name is the empty string, this means the device is currently not assigned to any slot.

## Plug event

    /devplug (int resp_id, string device_name, string action)

This will only be emitted if listening to plug events. It indicates the action has just occured for the specified device. The action may be "add" or "remove".

## Slot event

    /slotevent (int resp_id, string device_name, string action)

This will only be emitted if listening to plug events. It indicates the action has just occured for the specified slot. The action may be "open" or "close". These correspond to creating or destroying the virtual output device of this slot.


text:
TOS = $(shell ncc -print-tosdir)
PACKAGE = net.tinyos.drip
MIG = mig java
NCG = ncg java
LIB = $(TOSDIR)/../beta/Drip

# List of message classes to build
MSGS = DripMsg.java AddressMsg.java TestDripMsg.java
CONSTS = DripConsts.java
INITIAL_TARGETS = $(MSGS) $(CONSTS)
OTHER_CLEAN = cleanmig
PLATFORM = pc

ROOT = $(TOSDIR)/../tools/java
include $(ROOT)/Makefile.include

DripMsg.java: $(LIB)/Drip.h
	$(MIG) -java-classname=$(PACKAGE).DripMsg $(LIB)/Drip.h DripMsg -o $@

AddressMsg.java: $(LIB)/DripSend.h
	$(MIG) -java-classname=$(PACKAGE).AddressMsg $(LIB)/DripSend.h AddressMsg -o $@

DripConsts.java: $(LIB)/Drip.h
	$(NCG) -java-classname=$(PACKAGE).DripConsts -I$(LIB) $(LIB)/Drip.h Drip.h -o $@

TestDripMsg.java: $(LIB)/TestDrip/TestDrip.h
	$(MIG) -java-classname=$(PACKAGE).TestDripMsg $(LIB)/TestDrip/TestDrip.h TestDripMsg -o $@

cleanmig:
	rm -f $(MSGS) $(CONSTS) platforms.properties


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycologia 100: 457 (2008)

#### Original name
Ulocladium brassicae Yong Wang bis & X.G. Zhang

### Remarks
null


text:
"""
WSGI config for surfapp project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "surfapp.settings.production")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

# Wrap werkzeug debugger if DEBUG is on
from django.conf import settings
if settings.DEBUG:
    try:
        import django.views.debug
        import six
        from werkzeug.debug import DebuggedApplication

        def null_technical_500_response(request, exc_type, exc_value, tb):
            six.reraise(exc_type, exc_value, tb)

        django.views.debug.technical_500_response = null_technical_500_response
        application = DebuggedApplication(application, evalex=True)
    except ImportError:
        pass

from whitenoise.django import DjangoWhiteNoise
application = DjangoWhiteNoise(application)


text:
package com.dashingqi.intenttest;

import android.os.Parcel;
import android.os.Parcelable;

import java.io.Serializable;

/**
 * Created by zhangqi on 2017/5/23.
 */

public class Person implements Parcelable {

    private String name;
    private String age;

    public String getName() {
        return name;
    }

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

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(name);//将person类中name字段写出
        dest.writeString(age);//将person类中age字段写出

    }
    public static final Parcelable.Creator<Person> CREATOR = new Creator<Person>() {
        @Override
        public Person createFromParcel(Parcel source) {
            Person person = new Person();
            person.name = source.readString();
            person.age = source.readString();
            return person;
        }

        @Override
        public Person[] newArray(int size) {
            return new Person[size];
        }
    };
}


text:
import classNames from "classnames";
import * as React from "react";
import { useTranslation } from "react-i18next";
import { typeColor, typeColorBG, typeColorBorder } from "./colors";
import { Generation } from "./data-generations";
import { defensiveMatchups, offensiveMatchups } from "./data-matchups";
import { Type } from "./data-types";

interface BadgeProps {
  type: Type;
}

function Badge({ type }: BadgeProps) {
  const { t } = useTranslation();
  return (

        {t(`types.${type}`)}

  );
}

interface SectionProps {
  title: string;
  types: Type[];
}

function Section({ title, types }: SectionProps) {
  if (types.length === 0) {
    return null;
  }
  return (

{title}

        {types.map((t) => (
          <Badge key={`type-${t}`} type={t} />
        ))}

  );
}

interface MatchupsProps {
  kind: "offense" | "defense";
  generation: Generation;
  types: Type[];
}

export function Matchups({ kind, generation, types }: MatchupsProps) {
  const { t } = useTranslation();
  const formatTitle: (x: string) => string =
    kind === "offense"
      ? (x) => t("offense.dealsXTo", { x })
      : (x) => t("defense.takesXFrom", { x });
  const matchups =
    kind === "offense"
      ? offensiveMatchups(generation, types)
      : defensiveMatchups(generation, types);
  return (
    <div id={`matchup-${kind}`}>
      {effectivenessLevels.map((eff) => {
        return (

        );
      })}

  );
}

const effectivenessLevels = [8, 4, 2, 1, 1 / 2, 1 / 4, 1 / 8, 0];

const displayEffectiveness = {
  [8]: "8×",
  [4]: "4×",
  [2]: "2×",
  [1]: "1×",
  [1 / 2]: "½×",
  [1 / 4]: "¼×",
  [1 / 8]: "⅛×",
  [0]: "0×",
};


text:
class Spree::Admin::BuscapesController < Spree::Admin::BaseController

  def update
    SpreeBuscape::Config.set(params[:preferences])

    respond_to do |format|
      format.html {
        redirect_to admin_buscapes_path
      }
    end
  end

end


text:
using System;

using Blueprint41;
using Blueprint41.Query;

namespace Domain.Data.Query
{
public partial class WORKORDER_HAS_SCRAPREASON_REL : RELATIONSHIP, IFromIn_WORKORDER_HAS_SCRAPREASON_REL, IFromOut_WORKORDER_HAS_SCRAPREASON_REL	{
        public override string NEO4J_TYPE
        {
            get
            {
                return "HAS_SCRAPREASON";
            }
        }
        public override AliasResult RelationshipAlias { get; protected set; }

		internal WORKORDER_HAS_SCRAPREASON_REL(Blueprint41.Query.Node parent, DirectionEnum direction) : base(parent, direction) { }

		public WORKORDER_HAS_SCRAPREASON_REL Alias(out WORKORDER_HAS_SCRAPREASON_ALIAS alias)
		{
			alias = new WORKORDER_HAS_SCRAPREASON_ALIAS(this);
            RelationshipAlias = alias;
			return this;
		}
		public WORKORDER_HAS_SCRAPREASON_REL Repeat(int maxHops)
		{
			return Repeat(1, maxHops);
		}
		public WORKORDER_HAS_SCRAPREASON_REL Repeat(int minHops, int maxHops)
		{
			return this;
		}

		IFromIn_WORKORDER_HAS_SCRAPREASON_REL IFromIn_WORKORDER_HAS_SCRAPREASON_REL.Alias(out WORKORDER_HAS_SCRAPREASON_ALIAS alias)
		{
			return Alias(out alias);
		}
		IFromOut_WORKORDER_HAS_SCRAPREASON_REL IFromOut_WORKORDER_HAS_SCRAPREASON_REL.Alias(out WORKORDER_HAS_SCRAPREASON_ALIAS alias)
		{
			return Alias(out alias);
		}
		IFromIn_WORKORDER_HAS_SCRAPREASON_REL IFromIn_WORKORDER_HAS_SCRAPREASON_REL.Repeat(int maxHops)
		{
			return Repeat(maxHops);
		}
		IFromIn_WORKORDER_HAS_SCRAPREASON_REL IFromIn_WORKORDER_HAS_SCRAPREASON_REL.Repeat(int minHops, int maxHops)
		{
			return Repeat(minHops, maxHops);
		}
		IFromOut_WORKORDER_HAS_SCRAPREASON_REL IFromOut_WORKORDER_HAS_SCRAPREASON_REL.Repeat(int maxHops)
		{
			return Repeat(maxHops);
		}
		IFromOut_WORKORDER_HAS_SCRAPREASON_REL IFromOut_WORKORDER_HAS_SCRAPREASON_REL.Repeat(int minHops, int maxHops)
		{
			return Repeat(minHops, maxHops);
		}

		public WORKORDER_HAS_SCRAPREASON_IN In { get { return new WORKORDER_HAS_SCRAPREASON_IN(this); } }
        public class WORKORDER_HAS_SCRAPREASON_IN
        {
            private WORKORDER_HAS_SCRAPREASON_REL Parent;
            internal WORKORDER_HAS_SCRAPREASON_IN(WORKORDER_HAS_SCRAPREASON_REL parent)
            {
                Parent = parent;
            }

			public WorkOrderNode WorkOrder { get { return new WorkOrderNode(Parent, DirectionEnum.In); } }
        }

        public WORKORDER_HAS_SCRAPREASON_OUT Out { get { return new WORKORDER_HAS_SCRAPREASON_OUT(this); } }
        public class WORKORDER_HAS_SCRAPREASON_OUT
        {
            private WORKORDER_HAS_SCRAPREASON_REL Parent;
            internal WORKORDER_HAS_SCRAPREASON_OUT(WORKORDER_HAS_SCRAPREASON_REL parent)
            {
                Parent = parent;
            }

			public ScrapReasonNode ScrapReason { get { return new ScrapReasonNode(Parent, DirectionEnum.Out); } }
        }
	}

    public interface IFromIn_WORKORDER_HAS_SCRAPREASON_REL
    {
		IFromIn_WORKORDER_HAS_SCRAPREASON_REL Alias(out WORKORDER_HAS_SCRAPREASON_ALIAS alias);
		IFromIn_WORKORDER_HAS_SCRAPREASON_REL Repeat(int maxHops);
		IFromIn_WORKORDER_HAS_SCRAPREASON_REL Repeat(int minHops, int maxHops);

        WORKORDER_HAS_SCRAPREASON_REL.WORKORDER_HAS_SCRAPREASON_OUT Out { get; }
    }
    public interface IFromOut_WORKORDER_HAS_SCRAPREASON_REL
    {
		IFromOut_WORKORDER_HAS_SCRAPREASON_REL Alias(out WORKORDER_HAS_SCRAPREASON_ALIAS alias);
		IFromOut_WORKORDER_HAS_SCRAPREASON_REL Repeat(int maxHops);
		IFromOut_WORKORDER_HAS_SCRAPREASON_REL Repeat(int minHops, int maxHops);

        WORKORDER_HAS_SCRAPREASON_REL.WORKORDER_HAS_SCRAPREASON_IN In { get; }
    }

    public class WORKORDER_HAS_SCRAPREASON_ALIAS : AliasResult
    {
		private WORKORDER_HAS_SCRAPREASON_REL Parent;

        internal WORKORDER_HAS_SCRAPREASON_ALIAS(WORKORDER_HAS_SCRAPREASON_REL parent)
        {
			Parent = parent;
        }
    }
}


text:
errors=0
exe="$1"

# Allow output message to contain "Usage" or "Synopsis" in any case
$exe -h | grep -q -i -e 'Usage' -e 'Synopsis' || {
    echo "Test Failed: $exe -h. Expected 'Usage' or 'Synopsis' in output"
    let errors+=1
}

res1='test_data/one_sequence.fasta	1	237	237	237	237'
$exe test_data/one_sequence.fasta | grep -q "$res1" || {
    echo "Test Failed: $exe test_data/one_sequence.fasta. Expected '$res1'"
    let errors+=1
}

res2='test_data/two_sequence.fasta	2	357	120	178	237'
$exe test_data/two_sequence.fasta | grep -q "$res2" || {
    echo "Test Failed: $exe test_data/two_sequence.fasta. Expected '$res2'"
    let errors+=1
}

# Test filtering
res3='test_data/two_sequence.fasta	1	237	237	237	237'
$exe --minlen 200 test_data/two_sequence.fasta | grep -q "$res3" || {
    echo "Test Failed: $exe --minlen 200 test_data/two_sequence.fasta. Expected '$res3'"
    let errors+=1
}

# Test reading stdin
res4='	1	237	237	237	237'
$exe --minlen 200 < test_data/two_sequence.fasta | grep -q "$res4" || {
    echo "Test Failed: $exe --minlen 200 < test_data/two_sequence.fasta. Expected '$res4'"
    let errors+=1
}

# Test exit status for a bad command line invocation
$exe --this_is_not_a_valid_argument > /dev/null 2>&1
ex=$?
[ $ex -ne 2 ] && {
    echo "Test Failed '$exe --this_is_not_a_valid_argument'. Exit status was $ex. Expected 2"
    let errors+=1
}

# Test exit status for a non existent input FASTA file
$exe this_file_does_not_exist.fasta > /dev/null 2>&1
ex=$?
[ $ex -ne 1 ] && {
    echo "Test Failed '$exe this_file_does_not_exist.fasta'. Exit status was $ex. Expected 1"
    let errors+=1
}

# Test empty file
res='test_data/empty_file	0	0	-	-	-'
$exe test_data/empty_file | grep -q "$res" || {
    echo "Test Failed: $exe test_data/empty. Expected '$res'"
    let errors+=1
}

# Test when --minlen filters out ALL sequences (empty result)
fasta='test_data/two_sequence.fasta'
res="$fasta	0	0	-	-	-"
$exe --minlen 1000 "$fasta" | grep -q "$res" || {
    echo "Test Failed: $exe --minlen 1000 $fasta. Expected '$res'"
    let errors+=1
}

# End of testing - check if any errors occurrred
[ "$errors" -gt 0 ] && {
    echo "There were $errors errors found"
    exit 1
}

echo "Ok : $exe"


text:
<form name="signupForm" novalidate>
    <md-input-container class="md-block" flex-gt-sm>
        Username
        <md-icon ng-md-icon icon="account_circle" style="fill: black" size="24"></md-icon>
        <input type="text" id="username" name="username" ng-model="ctrl.user.username" required>

    </md-input-container>
    <md-input-container class="md-block" flex-gt-sm>
        Email
        <md-icon ng-md-icon icon="email" style="fill: black" size="24"></md-icon>
        <input type="email" id="email" name="email" ng-model="ctrl.user.email" ng-minlength="4" ng-maxlength="254" required>

    </md-input-container>
    <md-input-container class="md-block" flex-gt-sm>
        Password
        <md-icon ng-md-icon icon="lock" style="fill: black" size="24"></md-icon>
        <input password-strength type="password" id="password" name="password" ng-model="ctrl.user.password" ng-minlength="8" required>

    </md-input-container>
    <md-input-container class="md-block" flex-gt-sm>
        Confirm Password
        <md-icon ng-md-icon icon="lock" style="fill: black" size="24"></md-icon>
        <input password-match="ctrl.user.password" type="password" id="password_confirmation" name="password_confirmation" ng-model="ctrl.user.password_confirmation" ng-minlength="8" required>

    </md-input-container>

        By clicking on sign up, you agree to terms & conditions and
            privacy policy

        <md-button ng-click="ctrl.signup()" ng-disabled="signupForm.$invalid" class="md-raised md-primary md-hue-3">
            <ng-md-icon icon="input" style="fill: black" size="24"></ng-md-icon>
            Sign-up
        </md-button>

        Already have an account? Sign in

</form>


text:
<?php

namespace AppBundle\Form\Handler;

use AppBundle\Entity\GeorgeProfile;
use AppBundle\Entity\WorkedDay;
use AppBundle\Repository\GeorgeProfileRepository;
use AppBundle\Repository\WorkedDaysRepository;
use League\Period\Period;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Security\Core\User\UserInterface;

class AddGeorgeProfileHandler
{
    /**
     * @var GeorgeProfileRepository
     */
    private $georgeProfileRepository;

    /**
     * @var WorkedDaysRepository
     */
    private $workedDaysRepository;

    /**
     * AddGeorgeProfileHandler constructor
     *
     * @param GeorgeProfileRepository $georgeProfileRepository
     * @param WorkedDaysRepository $workedDaysRepository
     */
    public function __construct(
        GeorgeProfileRepository $georgeProfileRepository,
        WorkedDaysRepository $workedDaysRepository
    ) {
        $this->georgeProfileRepository = $georgeProfileRepository;
        $this->workedDaysRepository = $workedDaysRepository;
    }

    /**
     * @param FormInterface $form
     * @param UserInterface $user
     */
    public function handle(FormInterface $form, UserInterface $user)
    {
        $data = $form->getData();
        $profileId = $data['profileId'];
        /** @var GeorgeProfile $profile */
        $profile = $this
            ->georgeProfileRepository
            ->find($profileId);

        $profile->setGeorge($user);

        $this
            ->georgeProfileRepository
            ->save($profile);

        $period = Period::createFromMonth($data['year'], $data['month']);

        foreach ($period->getDatePeriod('1 DAY') as $day) {
            // fill missing working days in database
            $workedDay = new WorkedDay();
            $workedDay->setDate($day);
            $workedDay->setProfile($profile);

            // bind it to the profile
            $profile->addWorkedDay($workedDay);

            $this
                ->workedDaysRepository
                ->save($workedDay);
        }
    }
}


text:
jupyter:
  jupytext:
    notebook_metadata_filter: all
    text_representation:
      extension: .md
      format_name: markdown
      format_version: '1.1'
      jupytext_version: 1.1.1
  kernelspec:
    display_name: Python 2
    language: python
    name: python2
  plotly:
    description: How to project 3D Surface plots in 2D with Plotly.
    display_as: 3d_charts
    language: python
    layout: base
    name: Projection of 3D Surface
    order: 19
    page_type: u-guide
    permalink: python/2d-projection-of-3d-surface/
    thumbnail: thumbnail/projection-3d.jpg
---

#### New to Plotly?
Plotly's Python library is free and open source! [Get started](https://plot.ly/python/getting-started/) by downloading the client and [reading the primer](https://plot.ly/python/getting-started/).

You can set up Plotly to work in [online](https://plot.ly/python/getting-started/#initialization-for-online-plotting) or [offline](https://plot.ly/python/getting-started/#initialization-for-offline-plotting) mode, or in [jupyter notebooks](https://plot.ly/python/getting-started/#start-plotting-online).

We also have a quick-reference [cheatsheet](https://images.plot.ly/plotly-documentation/images/python_cheat_sheet.pdf) (new!) to help you get started!

#### Projections of a 3d surface onto planes

This example will demonstrate how to create heatmaps of projections of a 3d surface onto planes perpendicular to the z, x, respectively y-direction. Usually surfaces in the 3d space are colored with  a colormap associated to the normalized range of the z coordinates of points on that surface.
Recently, Plotly devised a method to color a surface according to a custom color function.

Namely, if $x, y, z$ are numpy arrays of shape (m, n), defined by a discretization (via a meshgrid) of a surface z=f(x,y) or in parametric form, $x=x(u,v), y=y(u,v), z=z(u,v)$, then a custom function, `Color(x,y,z)`, returns a numpy array `C`, of the same shape as z, and the surface is colored by a colormap, according to the values in `C`.

This method allows to project a surface onto planes perpendicular to the z, x or y-direction in the 3d space
and interpret the projection as a planar surface colored according to the z, x or y value at each point
of the coresponding plane.

First, define the surface and its discretization:

```python
import plotly.plotly as py
import plotly.graph_objs as go

import numpy as np

xx=np.linspace(-3.5, 3.5, 100)
yy=np.linspace(-3.5, 3.5, 100)
x,y=np.meshgrid(xx, yy)
z=np.exp(-(x-1)**2-y**2)-10*(x**3+y**4-x/5)*np.exp(-(x**2+y**2))
```

#### Color according to normalized z-values

```python
colorscale=[[0.0, 'rgb(20,29,67)'],
           [0.1, 'rgb(28,76,96)'],
           [0.2, 'rgb(16,125,121)'],
           [0.3, 'rgb(92,166,133)'],
           [0.4, 'rgb(182,202,175)'],
           [0.5, 'rgb(253,245,243)'],
           [0.6, 'rgb(230,183,162)'],
           [0.7, 'rgb(211,118,105)'],
           [0.8, 'rgb(174,63,95)'],
           [0.9, 'rgb(116,25,93)'],
           [1.0, 'rgb(51,13,53)']]
```

#### Add hover text for the surface:

```python
textz = [['x: '+'{:0.5f}'.format(x[i][j])+'<br>y: '+'{:0.5f}'.format(y[i][j])+
        '<br>z: '+'{:0.5f}'.format(z[i][j]) for j in range(z.shape[1])] for i in range(z.shape[0])]

trace1= go.Surface(
    x=tuple(x),
    y=tuple(y),
    z=tuple(z),
    colorscale=colorscale,
    text=textz,
    hoverinfo='text',
)
```

#### Set Plot Layout:

```python
axis = dict(
showbackground=True,
backgroundcolor="rgb(230, 230,230)",
showgrid=False,
zeroline=False,
showline=False)

ztickvals=list(range(-6,4))
layout = go.Layout(title="Projections of a surface onto coordinate planes" ,
                autosize=False,
                width=700,
                height=600,
                scene=dict(xaxis=dict(axis, range=[-3.5, 3.5]),
                            yaxis=dict(axis, range=[-3.5, 3.5]),
                            zaxis=dict(axis , tickvals=ztickvals),
                            aspectratio=dict(x=1,
                                             y=1,
                                             z=0.95)
                           )
                )
```

#### Discretization of each Plane
The surface projections will be plotted in the planes of equations
`Z=np.min(z)-2`, `X=np.min(xx)`, respectively `Y=np.min(yy)`.

```python
z_offset=(np.min(z)-2)*np.ones(z.shape)#
x_offset=np.min(xx)*np.ones(z.shape)
y_offset=np.min(yy)*np.ones(z.shape)
```

Define the color functions and the color numpy arrays, `C_z`, `C_x`, `C_y`, corresponding to each plane:

Define the 3-tuples of coordinates to be displayed at hovering the mouse over the projections.
The first two coordinates give the position in the projection plane, whereas the third one  is used
for assigning the color, just in the same way the coordinate z is used for the z-direction projection.

```python
proj_z=lambda x, y, z: z#projection in the z-direction
colorsurfz=proj_z(x,y,z)
proj_x=lambda x, y, z: x
colorsurfx=proj_z(x,y,z)
proj_y=lambda x, y, z: y
colorsurfy=proj_z(x,y,z)

textx=[['y: '+'{:0.5f}'.format(y[i][j])+'<br>z: '+'{:0.5f}'.format(z[i][j])+
        '<br>x: '+'{:0.5f}'.format(x[i][j]) for j in range(z.shape[1])]  for i in range(z.shape[0])]
texty=[['x: '+'{:0.5f}'.format(x[i][j])+'<br>z: '+'{:0.5f}'.format(z[i][j]) +
        '<br>y: '+'{:0.5f}'.format(y[i][j]) for j in range(z.shape[1])] for i in range(z.shape[0])]

tracex = go.Surface(z=list(z),
                x=list(x_offset),
                y=list(y),
                colorscale=colorscale,
                showlegend=False,
                showscale=False,
                surfacecolor=colorsurfx,
                text=textx,
                hoverinfo='text'
               )
tracey = go.Surface(z=list(z),
                x=list(x),
                y=list(y_offset),
                colorscale=colorscale,
                showlegend=False,
                showscale=False,
                surfacecolor=colorsurfy,
                text=texty,
                hoverinfo='text'
               )
tracez = go.Surface(z=list(z_offset),
                x=list(x),
                y=list(y),
                colorscale=colorscale,
                showlegend=False,
                showscale=False,
                surfacecolor=colorsurfx,
                text=textz,
                hoverinfo='text'
               )

data=[trace1, tracex, tracey, tracez]
fig = go.Figure(data=data, layout=layout)
py.iplot(fig)
```

```python
from IPython.display import display, HTML

display(HTML('<link href="//fonts.googleapis.com/css?family=Open+Sans:600,400,300,200|Inconsolata|Ubuntu+Mono:400,700rel="stylesheet" type="text/css" />'))
display(HTML('<link rel="stylesheet" type="text/csshref="http://help.plot.ly/documentation/all_static/css/ipython-notebook-custom.css">'))

! pip install git+https://github.com/plotly/publisher.git --upgrade

import publisher
publisher.publish(
    'Plotly-project-3d-onto-a-plane.ipynb', 'python/2d-projection-of-3d-surface/', 'Projection of 3D Surface',
    'How to project 3D Surface plots in 2D with Plotly.',
    title = '2D Projection of 3D surface | plotly',
    has_thumbnail='true', thumbnail='thumbnail/projection-3d.jpg',
    language='python',
    display_as='3d_charts', order=19,
    ipynb= '~notebook_demo/79')
```

```python

```


text:
package com.amaranth.structlog.config;

import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.XMLConfiguration;
import org.apache.commons.lang.StringUtils;

public class StructLogAppConfig {
	private static XMLConfiguration appConfig;

	/**
	 * XML formatted fileName is parsed to initialize XMLCOnfiguration object
	 * appConfig. If for any reason parsing fails, then appConfig will be null
	 * and that will be interpreted as StuctLogAppConfig is disabled. To Enable
	 * the StructLogAppConfig, call setAppConfig with correct file name.
	 *
	 * @param fileName
	 */
	public static void setAppConfig(String fileName) {
		try {
			if (!StringUtils.isEmpty(fileName)) {
				appConfig = new XMLConfiguration(fileName);
			} else {
				appConfig = null;
			}
		} catch (ConfigurationException e) {
			appConfig = null;
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public static String getMongoDBUrl() {
		return getAppConfig().getString("databases.mongodb.url");
	}

	public static String getMongoDBName() {
		return getAppConfig().getString("databases.mongodb.name");
	}

	public static String getDatabaseToUse() {
		return getAppConfig().getString("databaseToUse");
	}

	public static boolean isStructLogConfigInitialized() {
		if (null == appConfig) {
			return false;
		}
		return true;
	}

	public static XMLConfiguration getAppConfig() {
		return appConfig;
	}

	public static void setAppConfig(XMLConfiguration appConfig) {
		StructLogAppConfig.appConfig = appConfig;
	}
}


text:
DROP SCHEMA IF EXISTS demo_ds;
DROP SCHEMA IF EXISTS demo_ds_0;
DROP SCHEMA IF EXISTS demo_ds_1;

DROP SCHEMA IF EXISTS demo_ds_master;
DROP SCHEMA IF EXISTS demo_ds_slave_0;
DROP SCHEMA IF EXISTS demo_ds_slave_1;

DROP SCHEMA IF EXISTS demo_ds_master_0;
DROP SCHEMA IF EXISTS demo_ds_master_0_slave_0;
DROP SCHEMA IF EXISTS demo_ds_master_0_slave_1;
DROP SCHEMA IF EXISTS demo_ds_master_1;
DROP SCHEMA IF EXISTS demo_ds_master_1_slave_0;
DROP SCHEMA IF EXISTS demo_ds_master_1_slave_1;

CREATE SCHEMA IF NOT EXISTS demo_ds;
CREATE SCHEMA IF NOT EXISTS demo_ds_0;
CREATE SCHEMA IF NOT EXISTS demo_ds_1;

CREATE SCHEMA IF NOT EXISTS demo_ds_master;
CREATE SCHEMA IF NOT EXISTS demo_ds_slave_0;
CREATE SCHEMA IF NOT EXISTS demo_ds_slave_1;

CREATE SCHEMA IF NOT EXISTS demo_ds_master_0;
CREATE SCHEMA IF NOT EXISTS demo_ds_master_0_slave_0;
CREATE SCHEMA IF NOT EXISTS demo_ds_master_0_slave_1;
CREATE SCHEMA IF NOT EXISTS demo_ds_master_1;
CREATE SCHEMA IF NOT EXISTS demo_ds_master_1_slave_0;
CREATE SCHEMA IF NOT EXISTS demo_ds_master_1_slave_1;

-- Should sync from master-salve automatically
-- CREATE TABLE IF NOT EXISTS demo_ds_slave_0.t_order (order_id BIGINT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_slave_1.t_order (order_id BIGINT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_slave_0.t_order_item (order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_slave_1.t_order_item (order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));

-- CREATE TABLE IF NOT EXISTS demo_ds_master_0_slave_0.t_order_0 (order_id BIGINT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_master_0_slave_0.t_order_1 (order_id BIGINT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_master_0_slave_1.t_order_0 (order_id BIGINT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_master_0_slave_1.t_order_1 (order_id BIGINT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_master_1_slave_0.t_order_0 (order_id BIGINT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_master_1_slave_0.t_order_1 (order_id BIGINT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_master_1_slave_1.t_order_0 (order_id BIGINT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_master_1_slave_1.t_order_1 (order_id BIGINT NOT NULL AUTO_INCREMENT, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_master_0_slave_0.t_order_item_0 (order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_master_0_slave_0.t_order_item_1 (order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_master_0_slave_1.t_order_item_0 (order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_master_0_slave_1.t_order_item_1 (order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_master_1_slave_0.t_order_item_0 (order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_master_1_slave_0.t_order_item_1 (order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_master_1_slave_1.t_order_item_0 (order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));
-- CREATE TABLE IF NOT EXISTS demo_ds_master_1_slave_1.t_order_item_1 (order_item_id BIGINT NOT NULL AUTO_INCREMENT, order_id BIGINT NOT NULL, user_id INT NOT NULL, status VARCHAR(50), PRIMARY KEY (order_item_id));


text: export * from './components/treeselect/TreeSelect';


text:
using Orleans.Runtime;
using Orleans.Serialization;
using Orleans.Streams;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;

namespace Orleans.Providers.GCP.Streams.PubSub
{
    internal class PubSubAdapter<TDataAdapter> : IQueueAdapter
        where TDataAdapter : IPubSubDataAdapter
    {
        protected readonly string ServiceId;
        protected readonly string ProjectId;
        protected readonly string TopicId;
        protected readonly TimeSpan? Deadline;
        private readonly HashRingBasedStreamQueueMapper _streamQueueMapper;
        protected readonly ConcurrentDictionary<QueueId, PubSubDataManager> Subscriptions = new ConcurrentDictionary<QueueId, PubSubDataManager>();
        protected readonly IPubSubDataAdapter _dataAdapter;
        private readonly ILogger _logger;
        private readonly ILoggerFactory loggerFactory;
        private readonly string _customEndpoint;
        public string Name { get; }
        public bool IsRewindable => false;
        public StreamProviderDirection Direction => StreamProviderDirection.ReadWrite;

        public PubSubAdapter(
            TDataAdapter dataAdapter,
            ILoggerFactory loggerFactory,
            HashRingBasedStreamQueueMapper streamQueueMapper,
            string projectId,
            string topicId,
            string serviceId,
            string providerName,
            TimeSpan? deadline = null,
            string customEndpoint = "")
        {
            if (string.IsNullOrEmpty(projectId)) throw new ArgumentNullException(nameof(projectId));
            if (string.IsNullOrEmpty(topicId)) throw new ArgumentNullException(nameof(topicId));
            if (string.IsNullOrEmpty(serviceId)) throw new ArgumentNullException(nameof(serviceId));

            _logger = loggerFactory.CreateLogger($"{this.GetType().FullName}.{providerName}");
            this.loggerFactory = loggerFactory;
            ProjectId = projectId;
            TopicId = topicId;
            ServiceId = serviceId;
            Name = providerName;
            Deadline = deadline;
            _streamQueueMapper = streamQueueMapper;
            _dataAdapter = dataAdapter;
            _customEndpoint = customEndpoint;
        }

        public IQueueAdapterReceiver CreateReceiver(QueueId queueId)
        {
            return PubSubAdapterReceiver.Create(this.loggerFactory, queueId, ProjectId, TopicId, ServiceId, _dataAdapter, Deadline, _customEndpoint);
        }

        public async Task QueueMessageBatchAsync<T>(StreamId streamId, IEnumerable<T> events, StreamSequenceToken token, Dictionary<string, object> requestContext)
        {
            if (token != null) throw new ArgumentException("Google PubSub stream provider currently does not support non-null StreamSequenceToken.", nameof(token));
            var queueId = _streamQueueMapper.GetQueueForStream(streamId);

            PubSubDataManager pubSub;
            if (!Subscriptions.TryGetValue(queueId, out pubSub))
            {
                var tmpPubSub = new PubSubDataManager(this.loggerFactory, ProjectId, TopicId, queueId.ToString(), ServiceId, Deadline);
                await tmpPubSub.Initialize();
                pubSub = Subscriptions.GetOrAdd(queueId, tmpPubSub);
            }

            var msg = _dataAdapter.ToPubSubMessage(streamId, events, requestContext);
            await pubSub.PublishMessages(new[] { msg });
        }
    }
}


text:
import FWCore.ParameterSet.Config as cms

process = cms.Process('FILEFI')

# import of standard configurations
process.load('Configuration/StandardSequences/Services_cff')
process.load('FWCore/MessageService/MessageLogger_cfi')
process.load('Configuration.StandardSequences.GeometryDB_cff')
process.load('Configuration/StandardSequences/MagneticField_38T_cff')
process.load('Configuration/StandardSequences/FrontierConditions_GlobalTag_cff')
process.load('Configuration/EventContent/EventContent_cff')

process.configurationMetadata = cms.untracked.PSet(
  version    = cms.untracked.string('Mit_029'),
  annotation = cms.untracked.string('AOD'),
  name       = cms.untracked.string('BambuProduction')
)

process.maxEvents = cms.untracked.PSet(
  input = cms.untracked.int32(-1)
)

process.options = cms.untracked.PSet(
  Rethrow = cms.untracked.vstring('ProductNotFound'),
  fileMode = cms.untracked.string('NOMERGE'),
)

# input source
process.source = cms.Source("PoolSource",
  fileNames = cms.untracked.vstring('/store/results/tau-pflow/DoubleMuParked/StoreResults-Run2012B_22Jan2013_v1_PFembedded_trans1_tau115_ptelec1_20had1_18_v1-5ef1c0fd428eb740081f19333520fdc8/DoubleMuParked/USER/StoreResults-Run2012B_22Jan2013_v1_PFembedded_trans1_tau115_ptelec1_20had1_18_v1-5ef1c0fd428eb740081f19333520fdc8/0000/FEDB3320-CEE7-E211-8BED-0023AEFDEE84.root')
)
#process.source.inputCommands = cms.untracked.vstring("keep *",
#                                                     "drop *_MEtoEDMConverter_*_*",
#                                                     "drop L1GlobalTriggerObjectMapRecord_hltL1GtObjectMap__HLT")

# other statements
process.GlobalTag.globaltag = 'START53_V15::All'

process.add_(cms.Service("ObjectService"))

process.load("MitProd.BAMBUSequences.BambuFillAOD_cfi")

process.MitTreeFiller.TreeWriter.fileName = 'XX-MITDATASET-XX'

process.load('TauAnalysis/MCEmbeddingTools/embeddingKineReweight_cff')
process.embeddingKineReweightRECembedding.inputFileName = cms.FileInPath('TauAnalysis/MCEmbeddingTools/data/embeddingKineReweight_recEmbedding_mutau.root')
# process.embeddingKineReweightRECembedding.inputFileName = cms.FileInPath('TauAnalysis/MCEmbeddingTools/data/embeddingKineReweight_recEmbedding_etau.root')
# process.embeddingKineReweightRECembedding.inputFileName = cms.FileInPath('TauAnalysis/MCEmbeddingTools/data/embeddingKineReweight_recEmbedding_emu.root')

from MitProd.TreeFiller.filltauembedded_cff import *
filltauembedded(process.MitTreeFiller)
process.MitTreeFiller.MergedConversions.checkTrackRef           = cms.untracked.bool(False)
process.MitTreeFiller.EmbedWeight.useGenInfo                    = True
process.MitTreeFiller.EmbedWeight.useRecHit                     = False
process.MitTreeFiller.MergedEmbeddedTracks.edmName              = 'tmfTracks'
process.MitTreeFiller.MergedEmbeddedTracks.trackMapName         = 'tmfTracksMapName'
process.MitTreeFiller.PrimaryVertexes.trackMapName              = 'tmfTracksMapName'
process.MitTreeFiller.PrimaryVertexesBS.trackMapName            = 'tmfTracksMapName'
process.MitTreeFiller.PFCandidates.trackerTrackMapNames         = cms.untracked.vstring('tmfTracksMapName')
process.MitTreeFiller.ShrinkingConePFTaus.trackMapNames         = cms.untracked.vstring('tmfTracksMapName')
process.MitTreeFiller.HPSTaus.trackMapNames                     = cms.untracked.vstring('tmfTracksMapName')
#process.MitTreeFiller.Electrons.trackerTrackMapName             = 'tmfTracksMapName'
process.MitTreeFiller.Electrons.trackerTrackMapName             = 'TracksMapName'
process.MitTreeFiller.PFCandidates.gsfTrackMapName              = ''
process.MitTreeFiller.PFCandidates.allowMissingPhotonRef        = True
process.newJetTracksAssociatorAtVertex.tracks = "tmfTracks"
process.bambu_step  = cms.Path(process.BambuFillAOD)
# schedule definition
process.schedule = cms.Schedule(process.bambu_step)


text:
<?php
$TRANSLATIONS = array(
"There is no error, the file uploaded with success" => "Файлът е качен успешно",
"The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form" => "Файлът който се опитвате да качите надвишава стойностите в MAX_FILE_SIZE в HTML формата.",
"The uploaded file was only partially uploaded" => "Файлът е качен частично",
"No file was uploaded" => "Фахлът не бе качен",
"Missing a temporary folder" => "Липсва временна папка",
"Failed to write to disk" => "Възникна проблем при запис в диска",
"Invalid directory." => "Невалидна директория.",
"Files" => "Файлове",
"Upload cancelled." => "Качването е спряно.",
"Share" => "Споделяне",
"Delete permanently" => "Изтриване завинаги",
"Rename" => "Преименуване",
"Pending" => "Чакащо",
"undo" => "възтановяване",
"_%n folder_::_%n folders_" => array("",""),
"_%n file_::_%n files_" => array("",""),
"_Uploading %n file_::_Uploading %n files_" => array("",""),
"Error" => "Грешка",
"Name" => "Име",
"Size" => "Размер",
"Modified" => "Променено",
"Upload" => "Качване",
"Maximum upload size" => "Максимален размер за качване",
"0 is unlimited" => "Ползвайте 0 за без ограничения",
"Save" => "Запис",
"New" => "Ново",
"Text file" => "Текстов файл",
"Folder" => "Папка",
"Cancel upload" => "Спри качването",
"Nothing in here. Upload something!" => "Няма нищо тук. Качете нещо.",
"Download" => "Изтегляне",
"Delete" => "Изтриване",
"Upload too large" => "Файлът който сте избрали за качване е прекалено голям",
"The files you are trying to upload exceed the maximum size for file uploads on this server." => "Файловете които се опитвате да качите са по-големи от позволеното за сървъра.",
"Files are being scanned, please wait." => "Файловете се претърсват, изчакайте."
);
$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";


text:
from __future__ import unicode_literals

from django.apps import AppConfig

class SensorConfig(AppConfig):
    name = 'sensor'