text:
/*
 * reserved comment block
 * DO NOT REMOVE OR ALTER!
 */
/*
 * Copyright  1999-2004 The Apache Software Foundation.
 *
 *  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.sun.org.apache.xml.internal.security;

import java.io.InputStream;
import java.security.AccessController;
import java.security.PrivilegedAction;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import com.sun.org.apache.xml.internal.security.algorithms.JCEMapper;
import com.sun.org.apache.xml.internal.security.algorithms.SignatureAlgorithm;
import com.sun.org.apache.xml.internal.security.c14n.Canonicalizer;
import com.sun.org.apache.xml.internal.security.keys.KeyInfo;
import com.sun.org.apache.xml.internal.security.keys.keyresolver.KeyResolver;
import com.sun.org.apache.xml.internal.security.transforms.Transform;
import com.sun.org.apache.xml.internal.security.utils.I18n;
//import com.sun.org.apache.xml.internal.security.utils.PRNG;
import com.sun.org.apache.xml.internal.security.utils.XMLUtils;
import com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolver;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

/**
 * This class does the configuration of the library. This includes creating
 * the mapping of Canonicalization and Transform algorithms. Initialization is
 * done by calling {@link Init#init} which should be done in any static block
 * of the files of this library. We ensure that this call is only executed once.
 *
 * @author $Author: raul $
 */
public final class Init {

  /** {@link java.util.logging} logging facility */
  static java.util.logging.Logger log =
        java.util.logging.Logger.getLogger(Init.class.getName());

   /** Field _initialized */
   private static boolean _alreadyInitialized = false;

   /** The namespace for CONF file **/
   public static final String CONF_NS="http://www.xmlsecurity.org/NS/#configuration";

   /**
    * Method isInitialized
    * @return true if the librairy is already initialized.
    *
    */
   public static final boolean isInitialized() {
      return Init._alreadyInitialized;
   }

   /**
    * Method init
    *
    */
   public synchronized static void init() {

      if (_alreadyInitialized) {
        return;
      }
      long XX_configure_i18n_end=0;
      long XX_configure_reg_c14n_start=0;
      long XX_configure_reg_c14n_end=0;
      long XX_configure_reg_jcemapper_end=0;
      long XX_configure_reg_keyInfo_start=0;
      long XX_configure_reg_keyResolver_end=0;
      long XX_configure_reg_prefixes_start=0;
      long XX_configure_reg_resourceresolver_start=0;
      long XX_configure_reg_sigalgos_end=0;
      long XX_configure_reg_transforms_end=0;
      long XX_configure_reg_keyInfo_end=0;
      long XX_configure_reg_keyResolver_start=0;
         _alreadyInitialized = true;

         try {
            long XX_init_start = System.currentTimeMillis();
            long XX_prng_start = System.currentTimeMillis();

            //PRNG.init(new java.security.SecureRandom());

            long XX_prng_end = System.currentTimeMillis();

            /* read library configuration file */
            long XX_parsing_start = System.currentTimeMillis();
            DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();

            dbf.setNamespaceAware(true);
            dbf.setValidating(false);

            DocumentBuilder db = dbf.newDocumentBuilder();

            // We don't allow users to override the Apache XML Security
            // configuration in the JRE. Users should use the standard security
            // provider mechanism instead if implementing their own
            // transform or canonicalization algorithms.
            // String cfile = System.getProperty("com.sun.org.apache.xml.internal.security.resource.config");
            // InputStream is =
            //     Class.forName("com.sun.org.apache.xml.internal.security.Init")
            //     .getResourceAsStream(cfile != null ? cfile : "resource/config.xml");
            InputStream is = (InputStream) AccessController.doPrivileged(
                new PrivilegedAction() {
                    public Object run() {
                        return getClass().getResourceAsStream
                                ("resource/config.xml");
                    }
                });

            Document doc = db.parse(is);
            long XX_parsing_end = System.currentTimeMillis();
            long XX_configure_i18n_start = 0;

            {
                XX_configure_reg_keyInfo_start = System.currentTimeMillis();
               try {
                  KeyInfo.init();
               } catch (Exception e) {
                  e.printStackTrace();

                  throw e;
               }
               XX_configure_reg_keyInfo_end = System.currentTimeMillis();
            }

                        long XX_configure_reg_transforms_start=0;
                        long XX_configure_reg_jcemapper_start=0;
                        long XX_configure_reg_sigalgos_start=0;
                        long XX_configure_reg_resourceresolver_end=0;
                        long XX_configure_reg_prefixes_end=0;
            Node config=doc.getFirstChild();
            for (;config!=null;config=config.getNextSibling()) {
                if ("Configuration".equals(config.getLocalName())) {
                        break;
                }
            }
                        for (Node el=config.getFirstChild();el!=null;el=el.getNextSibling()) {
                if (!(el instanceof Element)) {
                        continue;
                }
                String tag=el.getLocalName();
//
// Commented out: not supported in the JDK. We use the default locale.
//
//            if (tag.equals("ResourceBundles")){
//                XX_configure_i18n_start = System.currentTimeMillis();
//              Element resource=(Element)el;
//               /* configure internationalization */
//               Attr langAttr = resource.getAttributeNode("defaultLanguageCode");
//               Attr countryAttr = resource.getAttributeNode("defaultCountryCode");
//               String languageCode = (langAttr == null)
//                                     ? null
//                                     : langAttr.getNodeValue();
//               String countryCode = (countryAttr == null)
//                                    ? null
//                                    : countryAttr.getNodeValue();
//
//               I18n.init(languageCode, countryCode);
//               XX_configure_i18n_end = System.currentTimeMillis();
//            }

            if (tag.equals("CanonicalizationMethods")){
                XX_configure_reg_c14n_start = System.currentTimeMillis();
               Canonicalizer.init();
               Element[] list=XMLUtils.selectNodes(el.getFirstChild(),CONF_NS,"CanonicalizationMethod");

               for (int i = 0; i < list.length; i++) {
                  String URI = list[i].getAttributeNS(null,
                                  "URI");
                  String JAVACLASS =
                     list[i].getAttributeNS(null,
                        "JAVACLASS");
                  try {
                      Class.forName(JAVACLASS);
/*                     Method methods[] = c.getMethods();

                     for (int j = 0; j < methods.length; j++) {
                        Method currMeth = methods[j];

                        if (currMeth.getDeclaringClass().getName()
                                .equals(JAVACLASS)) {
                           log.log(java.util.logging.Level.FINE, currMeth.getDeclaringClass().toString());
                        }
                     }*/
                      if (true)
                        if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Canonicalizer.register(" + URI + ", "
                            + JAVACLASS + ")");
                     Canonicalizer.register(URI, JAVACLASS);
                  } catch (ClassNotFoundException e) {
                     Object exArgs[] = { URI, JAVACLASS };

                     log.log(java.util.logging.Level.SEVERE, I18n.translate("algorithm.classDoesNotExist",
                                              exArgs));
                  }
               }
               XX_configure_reg_c14n_end = System.currentTimeMillis();
            }

            if (tag.equals("TransformAlgorithms")){
               XX_configure_reg_transforms_start = System.currentTimeMillis();
               Transform.init();

               Element[] tranElem = XMLUtils.selectNodes(el.getFirstChild(),CONF_NS,"TransformAlgorithm");

               for (int i = 0; i < tranElem.length; i++) {
                  String URI = tranElem[i].getAttributeNS(null,
                                  "URI");
                  String JAVACLASS =
                     tranElem[i].getAttributeNS(null,
                        "JAVACLASS");
                  try {
                     Class.forName(JAVACLASS);
                     if (true)
                        if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Transform.register(" + URI + ", " + JAVACLASS
                            + ")");
                     Transform.register(URI, JAVACLASS);
                  } catch (ClassNotFoundException e) {
                     Object exArgs[] = { URI, JAVACLASS };

                     log.log(java.util.logging.Level.SEVERE, I18n.translate("algorithm.classDoesNotExist",
                                              exArgs));

                  } catch (NoClassDefFoundError ex) {
                                          log.log(java.util.logging.Level.WARNING, "Not able to found dependecies for algorithm, I'm keep working.");
                  }
               }
               XX_configure_reg_transforms_end = System.currentTimeMillis();
            }

            if ("JCEAlgorithmMappings".equals(tag)){
               XX_configure_reg_jcemapper_start = System.currentTimeMillis();
               JCEMapper.init((Element)el);
               XX_configure_reg_jcemapper_end = System.currentTimeMillis();
            }

            if (tag.equals("SignatureAlgorithms")){
               XX_configure_reg_sigalgos_start = System.currentTimeMillis();
               SignatureAlgorithm.providerInit();

               Element[] sigElems = XMLUtils.selectNodes(el.getFirstChild(), CONF_NS,
                  "SignatureAlgorithm");

               for (int i = 0; i < sigElems.length; i++) {
                  String URI = sigElems[i].getAttributeNS(null,
                                  "URI");
                  String JAVACLASS =
                    sigElems[i].getAttributeNS(null,
                        "JAVACLASS");

                  /** $todo$ handle registering */

                  try {
                      Class.forName(JAVACLASS);
 //                    Method methods[] = c.getMethods();

//                     for (int j = 0; j < methods.length; j++) {
//                        Method currMeth = methods[j];
//
//                        if (currMeth.getDeclaringClass().getName()
//                                .equals(JAVACLASS)) {
//                           log.log(java.util.logging.Level.FINE, currMeth.getDeclaringClass().toString());
//                        }
//                     }
                      if (true)
                        if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "SignatureAlgorithm.register(" + URI + ", "
                            + JAVACLASS + ")");
                     SignatureAlgorithm.register(URI, JAVACLASS);
                  } catch (ClassNotFoundException e) {
                     Object exArgs[] = { URI, JAVACLASS };

                     log.log(java.util.logging.Level.SEVERE, I18n.translate("algorithm.classDoesNotExist",
                                              exArgs));

                  }
               }
               XX_configure_reg_sigalgos_end = System.currentTimeMillis();
            }

            if (tag.equals("ResourceResolvers")){
               XX_configure_reg_resourceresolver_start = System.currentTimeMillis();
               ResourceResolver.init();

               Element[]resolverElem = XMLUtils.selectNodes(el.getFirstChild(),CONF_NS,
                  "Resolver");

               for (int i = 0; i < resolverElem.length; i++) {
                  String JAVACLASS =
                      resolverElem[i].getAttributeNS(null,
                        "JAVACLASS");
                  String Description =
                     resolverElem[i].getAttributeNS(null,
                        "DESCRIPTION");

                  if ((Description != null) && (Description.length() > 0)) {
                    if (true)
                        if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Register Resolver: " + JAVACLASS + ": "
                               + Description);
                  } else {
                    if (true)
                        if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Register Resolver: " + JAVACLASS
                               + ": For unknown purposes");
                  }
                                  try {
                                          ResourceResolver.register(JAVACLASS);
                                  } catch (Throwable e) {
                                          log.log(java.util.logging.Level.WARNING, "Cannot register:"+JAVACLASS+" perhaps some needed jars are not installed",e);
                                  }
                  XX_configure_reg_resourceresolver_end =
                    System.currentTimeMillis();
               }

            }

            if (tag.equals("KeyResolver")){
               XX_configure_reg_keyResolver_start =System.currentTimeMillis();
               KeyResolver.init();

               Element[] resolverElem = XMLUtils.selectNodes(el.getFirstChild(), CONF_NS,"Resolver");

               for (int i = 0; i < resolverElem.length; i++) {
                  String JAVACLASS =
                     resolverElem[i].getAttributeNS(null,
                        "JAVACLASS");
                  String Description =
                     resolverElem[i].getAttributeNS(null,
                        "DESCRIPTION");

                  if ((Description != null) && (Description.length() > 0)) {
                    if (true)
                        if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Register Resolver: " + JAVACLASS + ": "
                               + Description);
                  } else {
                    if (true)
                        if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Register Resolver: " + JAVACLASS
                               + ": For unknown purposes");
                  }

                  KeyResolver.register(JAVACLASS);
               }
               XX_configure_reg_keyResolver_end = System.currentTimeMillis();
            }

            if (tag.equals("PrefixMappings")){
                XX_configure_reg_prefixes_start = System.currentTimeMillis();
                if (true)
                        if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Now I try to bind prefixes:");

               Element[] nl = XMLUtils.selectNodes(el.getFirstChild(), CONF_NS,"PrefixMapping");

               for (int i = 0; i < nl.length; i++) {
                  String namespace = nl[i].getAttributeNS(null,
                                        "namespace");
                  String prefix = nl[i].getAttributeNS(null,
                                     "prefix");
                  if (true)
                        if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "Now I try to bind " + prefix + " to " + namespace);
                  com.sun.org.apache.xml.internal.security.utils.ElementProxy
                     .setDefaultPrefix(namespace, prefix);
               }
               XX_configure_reg_prefixes_end = System.currentTimeMillis();
            }
            }

            long XX_init_end = System.currentTimeMillis();

            //J-
            if (true) {
                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "XX_init                             " + ((int)(XX_init_end - XX_init_start)) + " ms");
                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_prng                           " + ((int)(XX_prng_end - XX_prng_start)) + " ms");
                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_parsing                        " + ((int)(XX_parsing_end - XX_parsing_start)) + " ms");
                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_i18n                 " + ((int)(XX_configure_i18n_end- XX_configure_i18n_start)) + " ms");
                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_c14n             " + ((int)(XX_configure_reg_c14n_end- XX_configure_reg_c14n_start)) + " ms");
                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_jcemapper        " + ((int)(XX_configure_reg_jcemapper_end- XX_configure_reg_jcemapper_start)) + " ms");
                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_keyInfo          " + ((int)(XX_configure_reg_keyInfo_end- XX_configure_reg_keyInfo_start)) + " ms");
                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_keyResolver      " + ((int)(XX_configure_reg_keyResolver_end- XX_configure_reg_keyResolver_start)) + " ms");
                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_prefixes         " + ((int)(XX_configure_reg_prefixes_end- XX_configure_reg_prefixes_start)) + " ms");
                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_resourceresolver " + ((int)(XX_configure_reg_resourceresolver_end- XX_configure_reg_resourceresolver_start)) + " ms");
                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_sigalgos         " + ((int)(XX_configure_reg_sigalgos_end- XX_configure_reg_sigalgos_start)) + " ms");
                if (log.isLoggable(java.util.logging.Level.FINE))                                     log.log(java.util.logging.Level.FINE, "  XX_configure_reg_transforms       " + ((int)(XX_configure_reg_transforms_end- XX_configure_reg_transforms_start)) + " ms");
            }
         } catch (Exception e) {
            log.log(java.util.logging.Level.SEVERE, "Bad: ", e);
            e.printStackTrace();
         }

   }

}


text:
package org.gradle.model.internal.inspect;

import org.gradle.model.internal.core.MutableModelNode;

import java.util.List;

public interface ExtractedModelRule {
    void apply(MethodModelRuleApplicationContext context, MutableModelNode target);

    List<? extends Class<?>> getRuleDependencies();

    MethodRuleDefinition<?, ?> getRuleDefinition();
}

redpajama_set_name: RedPajamaGithub


text: <meta http-equiv="refresh" content="0; url=CRIS_002dPseudos.html#crisnous">


text:
package org.apache.deltaspike.data.test.service;

import org.apache.deltaspike.data.api.mapping.SimpleQueryInOutMapperBase;
import org.apache.deltaspike.data.test.domain.Simple;
import org.apache.deltaspike.data.test.domain.dto.SimpleDto;
import org.apache.deltaspike.data.test.domain.dto.SimpleId;

public class SimpleQueryInOutMapper extends SimpleQueryInOutMapperBase<Simple, SimpleDto>
{

    @Override
    protected Object getPrimaryKey(SimpleDto dto)
    {
        return dto.getId() != null ? dto.getId().getId() : null;
    }

    @Override
    protected SimpleDto toDto(Simple entity)
    {
        SimpleDto dto = new SimpleDto();
        dto.setId(new SimpleId(entity.getId()));
        dto.setEnabled(entity.getEnabled());
        dto.setName(entity.getName());
        return dto;
    }

    @Override
    protected Simple toEntity(Simple entity, SimpleDto dto)
    {
        entity.setName(dto.getName());
        entity.setEnabled(dto.getEnabled());
        return entity;
    }

}


text:
var harvester = require('harvesterjs');
var config = require('./config');

var options = {
    adapter: 'mongodb',
    connectionString: config.connectionString,
    inflect: true
};

// define 2 resources
// posts and comments
// analogue to the examples used on jsonapi.org
var harvesterApp = harvester(options)
    .resource('post', {
        title: String
    })
    .resource('comment', {
        body: String,
        post: 'post'
    });

module.exports = harvesterApp;


text:
<?php

namespace Magento\Cron\Console\Command;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;
use Magento\Framework\App\ObjectManagerFactory;
use Magento\Store\Model\Store;
use Magento\Store\Model\StoreManager;
use Magento\Cron\Observer\ProcessCronQueueObserver;
use Magento\Framework\Console\Cli;
use Magento\Framework\Shell\ComplexParameter;

/**
 * Command for executing cron jobs
 */
class CronCommand extends Command
{
    /**
     * Name of input option
     */
    const INPUT_KEY_GROUP = 'group';

    /**
     * Object manager factory
     *
     * @var ObjectManagerFactory
     */
    private $objectManagerFactory;

    /**
     * Constructor
     *
     * @param ObjectManagerFactory $objectManagerFactory
     */
    public function __construct(ObjectManagerFactory $objectManagerFactory)
    {
        $this->objectManagerFactory = $objectManagerFactory;
        parent::__construct();
    }

    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $options = [
            new InputOption(
                self::INPUT_KEY_GROUP,
                null,
                InputOption::VALUE_REQUIRED,
                'Run jobs only from specified group'
            ),
            new InputOption(
                Cli::INPUT_KEY_BOOTSTRAP,
                null,
                InputOption::VALUE_REQUIRED,
                'Add or override parameters of the bootstrap'
            ),
        ];
        $this->setName('cron:run')
            ->setDescription('Runs jobs by schedule')
            ->setDefinition($options);
        parent::configure();
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $omParams = $_SERVER;
        $omParams[StoreManager::PARAM_RUN_CODE] = 'admin';
        $omParams[Store::CUSTOM_ENTRY_POINT_PARAM] = true;
        $objectManager = $this->objectManagerFactory->create($omParams);

        $params[self::INPUT_KEY_GROUP] = $input->getOption(self::INPUT_KEY_GROUP);
        $params[ProcessCronQueueObserver::STANDALONE_PROCESS_STARTED] = '0';
        $bootstrap = $input->getOption(Cli::INPUT_KEY_BOOTSTRAP);
        if ($bootstrap) {
            $bootstrapProcessor = new ComplexParameter(Cli::INPUT_KEY_BOOTSTRAP);
            $bootstrapOptionValues = $bootstrapProcessor->getFromString(
                '--' . Cli::INPUT_KEY_BOOTSTRAP . '=' . $bootstrap
            );
            $bootstrapOptionValue = $bootstrapOptionValues[ProcessCronQueueObserver::STANDALONE_PROCESS_STARTED];
            if ($bootstrapOptionValue) {
                $params[ProcessCronQueueObserver::STANDALONE_PROCESS_STARTED] = $bootstrapOptionValue;
            }
        }
        /** @var \Magento\Framework\App\Cron $cronObserver */
        $cronObserver = $objectManager->create('Magento\Framework\App\Cron', ['parameters' => $params]);
        $cronObserver->launch();
        $output->writeln('<info>' . 'Ran jobs by schedule.' . '</info>');
    }
}


text:
var gId = '#dataGrid';
$(document).ready(function(){
	$(gId).datagrid(getGridOpt());//列表

	//获取列表参数
	function getGridOpt(){
		var opt = {
			url:getUrlOpt(),
			idField:'id',
			fitColumns:true,
			frozenColumns:[[
	               {field:'ck',checkbox:true}
	        ]],
			columns:[
				getTableHeadOpt(),
				[
					{field:'wareCode',title:'货物编号',width:80,align:'left'},
					{field:'wareName',title:'货物名称',width:80,align:'left'},
					{field:'warehouseName',title:'仓库名称',width:80,align:'left'},
					{field:'wareCount',title:'货物数量',width:50,align:'left'},
					{field:'sort',title:'序号',width:50,align:'left'}
				]
			],
			pageSize:20,
			rownumbers:true,
			pagination:true,
			onDblClickRow:function(rowIndex,rowData){
				if('show' == todo){
					selectKind(rowData.id,rowData.name);
				}
			},
		    toolbar:getToolBarOpt()
		}
		return opt;
	}

	//分页区
	$(gId).datagrid('getPager').pagination(getPagerOpt() );

});

//获取url参数
function getUrlOpt(){
	var url = ctx+'/WarehouseWare_json!listJson.do?1=1';
	return url;
}

//获取表头参数
function getTableHeadOpt(){
	var opt = [];
	opt.push({title:'基本信息',colspan:5});
   return opt;
}

//获取工具条参数
function getToolBarOpt(){
	var opt = [];
	 return opt;
}
//搜索框检查用户是否按下'回车键',按下则调用搜索方法
function checkKey(){
	if(event.keyCode=='13'){
		searchData();
	}
}
//搜索功能
function searchData(){

	var wareCode = $("#wareCode").val();
	var warehouseName = $("#warehouseName").val();
	var wareName = $("#wareName").val();
    realoadGrid(wareCode,warehouseName,wareName);
}
//取消搜索
function cancelSearch(){
	$("#wareCode").val('');
	$("#warehouseName").val('');
	$("#wareName").val('');
	realoadGrid('','','');
}
//确定搜索时重新加载datagrid
function realoadGrid(wareCode,warehouseName,wareName){
	var queryParams = $(gId).datagrid('options').queryParams;
	queryParams={"warehouseWare.wareCode":wareCode,"warehouseWare.warehouseName":warehouseName,"warehouseWare.wareName":wareName};
	$(gId).datagrid('options').queryParams = queryParams;
	$(gId).datagrid('reload');
}
//重新加载
function reloadDataGrid(){
	$(gId).datagrid('reload');
}

//关闭弹出窗
function closePopWindow(){
	$('#edit').window('close');
}

//选择
function selectKind(id,name){
	window.returnValue = {'id':id,'name':name};
	window.close();
}


text:
"""aiohttp plugin that reads app configuration and stores a
GitHubClient object on app['client'].

If using caching, the caching plugin MUST be set up before
setting up this plugin.
"""
from .client import GitHubClient
from api.cache import APP_KEY as CACHE_APP_KEY

CONFIG_KEY = 'GITHUB'
APP_CLIENT_KEY = 'github_client'

def setup(app):
    config = app.get(CONFIG_KEY, {})
    cache = app.get(CACHE_APP_KEY)
    client = GitHubClient(
        config.get('CLIENT_ID'),
        config.get('GITHUB_CLIENT_SECRET'),
        cache=cache
    )
    app[APP_CLIENT_KEY] = client


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

class New_trtmt_ask_model extends CI_Model
{

  protected $table = "wa_new_trtmt_ask";

	public function get_new_trtmt_ask(){

	}

  public function add_new_trtmt_ask($last_id_insert_new_trtmt, $libelle){
    $this->db->set('libelle',  $libelle);
    $this->db->set('wa_new_trtmt_id_new_trtmt',   $last_id_insert_new_trtmt);

    //	Une fois que tous les champs ont bien été définis, on "insert" le tout
    return $this->db->insert($this->table);
  }

  public function update_new_trtmt_ask(){

  }

  public function delete_new_trtmt_ask(){

  }

  public function get_last_id_new_trtmt_ask(){
    return $this->db->select('id_new_trtmt_ask')
              ->from($this->table)
              ->order_by('id_new_trtmt_ask', 'DESC')
              ->limit('1','0')
              ->get()
              ->result();
  }

  public function get_new_trtmt_ask_by_id_new_trtmt($id_new_trtmt){
      $query = $this->db->query("SELECT * FROM ".$this->table." WHERE wa_new_trtmt_id_new_trtmt =".$this->db->escape($id_new_trtmt)."");

      return $query->result();
  }

}


text:
/**
 * Created by tal on 3/13/15.
 */

var express = require('express');
var env = process.env.NODE_ENV || 'development';

module.exports = function (app){

};


text:
//--------------------------------------------------------------------------
//  <copyright file="RetrieveSchemaForEmailMessage.cs" company="Microsoft">
//      Copyright (c) 2015 Microsoft Corporation.
//
//      Permission is hereby granted, free of charge, to any person obtaining a copy
//      of this software and associated documentation files (the "Software"), to deal
//      in the Software without restriction, including without limitation the rights
//      to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//      copies of the Software, and to permit persons to whom the Software is
//      furnished to do so, subject to the following conditions:
//
//      The above copyright notice and this permission notice shall be included in
//
//      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//      IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//      FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//      AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//      LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//      OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//      THE SOFTWARE.
//  </copyright>
//--------------------------------------------------------------------------

namespace Microsoft.Dynamics.Marketing.Powershell.API.Commands.EmailMessage
{
    using System;
    using System.Management.Automation;
    using SDK.Messages.EmailMessage;

    /// <summary>
    /// Command to setup the Azure namespace and authentication used by all other commands.
    /// </summary>
    [Cmdlet(VerbsCommon.Get, "MDMSchemaForEmailMessage")]
    public class RetrieveSchemaForEmailMessage : TypedCmdlet<RetrieveMessageSchemaForEmailMessageRequest, RetrieveMessageSchemaForEmailMessageResponse>
    {
        /// <summary>
        /// Gets or sets the tracking ID
        /// </summary>
        [Parameter(Position = 0, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)]
        [ValidateNotNullOrEmpty]
        public Guid EmailMessageId
        {
            get;
            set;
        }

        /// <summary>
        /// ProcessRecord method.
        /// </summary>
        protected override void ProcessRecord()
        {
            if (this.EmailMessageId == null)
            {
                throw new PSArgumentNullException(this.GetType().Name);
            }

            var request = this.NewRequest();
            request.EmailMessageId = this.EmailMessageId;

            var response = this.ProcessRequest(request);
            if (response == null)
            {
                return;
            }

            this.WriteObject(response.MessageSchema);
        }
    }
}


text:
package ru.sbmart.almagnit.client.scaffold.ui;

import com.google.gwt.dom.client.Document;
import com.google.gwt.user.client.ui.ValueBox;

/**
 * A ValueBox that uses {@link FloatParser} and {@link FloatRenderer}.
 */
public class FloatBox extends ValueBox<Float> {

	public FloatBox() {
		super(Document.get().createTextInputElement(), FloatRenderer.instance(), FloatParser.instance());
	}
}


text:
package ru.job4j;

/**
 * //TODO add comments.
 *
 * @author Petr Arsentev (parsentev@yandex.ru)
 * @version $Id$
 * @since 0.1
 */
import java.io.Serializable;
import java.math.BigDecimal;

public class Pi implements Task<BigDecimal>, Serializable {

    private static final long serialVersionUID = 227L;

    /** constants used in pi computation */
    private static final BigDecimal FOUR =
            BigDecimal.valueOf(4);

    /** rounding mode to use during pi computation */
    private static final int roundingMode =
            BigDecimal.ROUND_HALF_EVEN;

    /** digits of precision after the decimal point */
    private final int digits;

    /**
     * Construct a task to calculate pi to the specified
     * precision.
     */
    public Pi(int digits) {
        this.digits = digits;
    }

    /**
     * Calculate pi.
     */
    public BigDecimal execute() {
        return computePi(digits);
    }

    /**
     * Compute the value of pi to the specified number of
     * digits after the decimal point.  The value is
     * computed using Machin's formula:
     *
     *          pi/4 = 4*arctan(1/5) - arctan(1/239)
     *
     * and a power series expansion of arctan(x) to
     * sufficient precision.
     */
    public static BigDecimal computePi(int digits) {
        int scale = digits + 5;
        BigDecimal arctan1_5 = arctan(5, scale);
        BigDecimal arctan1_239 = arctan(239, scale);
        BigDecimal pi = arctan1_5.multiply(FOUR).subtract(
                arctan1_239).multiply(FOUR);
        return pi.setScale(digits,
                BigDecimal.ROUND_HALF_UP);
    }
    /**
     * Compute the value, in radians, of the arctangent of
     * the inverse of the supplied integer to the specified
     * number of digits after the decimal point.  The value
     * is computed using the power series expansion for the
     * arc tangent:
     *
     * arctan(x) = x - (x^3)/3 + (x^5)/5 - (x^7)/7 +
     *     (x^9)/9 ...
     */
    public static BigDecimal arctan(int inverseX,
                                    int scale)
    {
        BigDecimal result, numer, term;
        BigDecimal invX = BigDecimal.valueOf(inverseX);
        BigDecimal invX2 =
                BigDecimal.valueOf(inverseX * inverseX);

        numer = BigDecimal.ONE.divide(invX,
                scale, roundingMode);

        result = numer;
        int i = 1;
        do {
            numer =
                    numer.divide(invX2, scale, roundingMode);
            int denom = 2 * i + 1;
            term =
                    numer.divide(BigDecimal.valueOf(denom),
                            scale, roundingMode);
            if ((i % 2) != 0) {
                result = result.subtract(term);
            } else {
                result = result.add(term);
            }
            i++;
        } while (term.compareTo(BigDecimal.ZERO) != 0);
        return result;
    }
}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _utils = require('../utils');

var _TimeSpinner = require('../basic/TimeSpinner');

var _TimeSpinner2 = _interopRequireDefault(_TimeSpinner);

var _locale = require('../../Common/locale');

var _locale2 = _interopRequireDefault(_locale);

var _PopperBase2 = require('./PopperBase');

require('../../Common/css/Date-picker.css');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var mapPropsToState = function mapPropsToState(props) {
  var state = {
    format: props.format || 'HH:mm:ss',
    currentDate: props.currentDate || new Date()
  };
  state.isShowSeconds = (state.format || '').indexOf('ss') !== -1;
  return state;
};

var TimePanel = function (_PopperBase) {
  _inherits(TimePanel, _PopperBase);

  _createClass(TimePanel, null, [{
    key: 'propTypes',
    get: function get() {
      return Object.assign({}, {
        selectableRange: _TimeSpinner2.default.propTypes.selectableRange,
        onSelectRangeChange: _TimeSpinner2.default.propTypes.onSelectRangeChange
      }, {
        pickerWidth: _propTypes2.default.number,
        currentDate: _propTypes2.default.instanceOf(Date),
        /*
        onPicked: (value, isKeepPannelOpen)=>()
         @param value: Date|null
        @param isKeepPannelOpen:boolean, should parent close the pannel
        */
        onPicked: _propTypes2.default.func.isRequired,
        // cancel btn is clicked
        //()=>()
        onCancel: _propTypes2.default.func.isRequired
      }, _PopperBase2.PopperBase.propTypes);
    }
  }, {
    key: 'defaultProps',
    get: function get() {
      return {
        popperMixinOption: {}
      };
    }
  }]);

  function TimePanel(props) {
    _classCallCheck(this, TimePanel);

    var _this = _possibleConstructorReturn(this, (TimePanel.__proto__ || Object.getPrototypeOf(TimePanel)).call(this, props));

    _this.state = mapPropsToState(props);
    return _this;
  }

  _createClass(TimePanel, [{
    key: 'componentWillReceiveProps',
    value: function componentWillReceiveProps(nextProps) {
      this.setState(mapPropsToState(nextProps));
    }

    // type: string,  one of [hours, minutes, seconds]
    // date: {type: number}

  }, {
    key: 'handleChange',
    value: function handleChange(date) {
      var currentDate = this.state.currentDate;

      if (date.hours !== undefined) {
        currentDate.setHours(date.hours);
      }

      if (date.minutes !== undefined) {
        currentDate.setMinutes(date.minutes);
      }

      if (date.seconds !== undefined) {
        currentDate.setSeconds(date.seconds);
      }
      this.setState({});
      this.handleConfirm(true);
    }
  }, {
    key: 'handleConfirm',
    value: function handleConfirm() {
      var isKeepPannelOpen = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
      var currentDate = this.state.currentDate;
      var _props = this.props,
          onPicked = _props.onPicked,
          selectableRange = _props.selectableRange;

      var date = new Date((0, _utils.limitRange)(currentDate, selectableRange, 'HH:mm:ss'));
      onPicked(date, isKeepPannelOpen);
    }
  }, {
    key: 'render',
    value: function render() {
      var _this2 = this;

      var _state = this.state,
          isShowSeconds = _state.isShowSeconds,
          currentDate = _state.currentDate;
      var _props2 = this.props,
          onSelectRangeChange = _props2.onSelectRangeChange,
          selectableRange = _props2.selectableRange;

      var hours = currentDate.getHours();
      var minutes = currentDate.getMinutes();
      var seconds = currentDate.getSeconds();

      var $t = _locale2.default.t;

      return _react2.default.createElement(
        'div',
        {
          ref: 'root',
          className: 'ishow-time-panel' },
        _react2.default.createElement(
          'div',
          { className: this.classNames('ishow-time-panel__content', { 'has-seconds': isShowSeconds }) },
          _react2.default.createElement(_TimeSpinner2.default, {
            ref: 'spinner',
            onChange: this.handleChange.bind(this),
            isShowSeconds: isShowSeconds,
            hours: hours,
            minutes: minutes,
            seconds: seconds,
            selectableRange: selectableRange,
            onSelectRangeChange: onSelectRangeChange
          })
        ),
        _react2.default.createElement(
          'div',
          { className: 'ishow-time-panel__footer' },
          _react2.default.createElement(
            'button',
            {
              type: 'button',
              className: 'ishow-time-panel__btn cancel',
              onClick: function onClick() {
                return _this2.props.onCancel();
              } },
            $t('el.datepicker.cancel')
          ),
          _react2.default.createElement(
            'button',
            {
              type: 'button',
              className: 'ishow-time-panel__btn confirm',
              onClick: function onClick() {
                return _this2.handleConfirm();
              } },
            $t('el.datepicker.confirm')
          )
        )
      );
    }
  }]);

  return TimePanel;
}(_PopperBase2.PopperBase);

exports.default = TimePanel;


text:
<?php

/**
 * The "tracks" collection of methods.
 * Typical usage is:
 *  <code>
 *   $androidpublisherService = new Google_Service_AndroidPublisher(...);
 *   $tracks = $androidpublisherService->tracks;
 *  </code>
 */
class Google_Service_AndroidPublisher_Resource_EditsTracks extends Google_Service_Resource
{
  /**
   * Fetches the track configuration for the specified track type. Includes the
   * APK version codes that are in this track. (tracks.get)
   *
   * @param string $packageName Unique identifier for the Android app that is
   * being updated; for example, "com.spiffygame".
   * @param string $editId Unique identifier for this edit.
   * @param string $track The track to read or modify.
   * @param array $optParams Optional parameters.
   * @return Google_Service_AndroidPublisher_Track
   */
  public function get($packageName, $editId, $track, $optParams = array())
  {
    $params = array('packageName' => $packageName, 'editId' => $editId, 'track' => $track);
    $params = array_merge($params, $optParams);
    return $this->call('get', array($params), "Google_Service_AndroidPublisher_Track");
  }
  /**
   * Lists all the track configurations for this edit. (tracks.listEditsTracks)
   *
   * @param string $packageName Unique identifier for the Android app that is
   * being updated; for example, "com.spiffygame".
   * @param string $editId Unique identifier for this edit.
   * @param array $optParams Optional parameters.
   * @return Google_Service_AndroidPublisher_TracksListResponse
   */
  public function listEditsTracks($packageName, $editId, $optParams = array())
  {
    $params = array('packageName' => $packageName, 'editId' => $editId);
    $params = array_merge($params, $optParams);
    return $this->call('list', array($params), "Google_Service_AndroidPublisher_TracksListResponse");
  }
  /**
   * Updates the track configuration for the specified track type. This method
   * supports patch semantics. (tracks.patch)
   *
   * @param string $packageName Unique identifier for the Android app that is
   * being updated; for example, "com.spiffygame".
   * @param string $editId Unique identifier for this edit.
   * @param string $track The track to read or modify.
   * @param Google_Service_AndroidPublisher_Track $postBody
   * @param array $optParams Optional parameters.
   * @return Google_Service_AndroidPublisher_Track
   */
  public function patch($packageName, $editId, $track, Google_Service_AndroidPublisher_Track $postBody, $optParams = array())
  {
    $params = array('packageName' => $packageName, 'editId' => $editId, 'track' => $track, 'postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('patch', array($params), "Google_Service_AndroidPublisher_Track");
  }
  /**
   * Updates the track configuration for the specified track type. (tracks.update)
   *
   * @param string $packageName Unique identifier for the Android app that is
   * being updated; for example, "com.spiffygame".
   * @param string $editId Unique identifier for this edit.
   * @param string $track The track to read or modify.
   * @param Google_Service_AndroidPublisher_Track $postBody
   * @param array $optParams Optional parameters.
   * @return Google_Service_AndroidPublisher_Track
   */
  public function update($packageName, $editId, $track, Google_Service_AndroidPublisher_Track $postBody, $optParams = array())
  {
    $params = array('packageName' => $packageName, 'editId' => $editId, 'track' => $track, 'postBody' => $postBody);
    $params = array_merge($params, $optParams);
    return $this->call('update', array($params), "Google_Service_AndroidPublisher_Track");
  }
}


text:
import os.path
from pathlib import Path

TEST_ROOT = os.path.dirname(__file__)

TEST_SETTINGS = {
    "MEDIA_URL": "media/",
    "STATIC_URL": "static/",
    "MEDIA_ROOT": os.path.join(TEST_ROOT, "project", "site_media", "media"),
    "STATIC_ROOT": os.path.join(TEST_ROOT, "project", "site_media", "static"),
    "STATICFILES_DIRS": [
        os.path.join(TEST_ROOT, "project", "documents"),
        ("prefix", os.path.join(TEST_ROOT, "project", "prefixed")),
        Path(TEST_ROOT) / "project" / "pathlib",
    ],
    "STATICFILES_FINDERS": [
        "django.contrib.staticfiles.finders.FileSystemFinder",
        "django.contrib.staticfiles.finders.AppDirectoriesFinder",
        "django.contrib.staticfiles.finders.DefaultStorageFinder",
    ],
    "INSTALLED_APPS": [
        "django.contrib.staticfiles",
        "staticfiles_tests",
        "staticfiles_tests.apps.test",
        "staticfiles_tests.apps.no_label",
    ],
    # In particular, AuthenticationMiddleware can't be used because
    # contrib.auth isn't in INSTALLED_APPS.
    "MIDDLEWARE": [],
}


text:
package com.mixer.api.resource.channel;

import com.google.gson.annotations.SerializedName;
import com.mixer.api.resource.MixerUser;
import com.mixer.api.resource.chat.events.data.IncomingMessageData;
import com.mixer.api.resource.chat.events.data.MessageComponent;

import java.util.List;
import java.util.UUID;

public class CachedMessage {
    public MessageComponent message;
    public int channel;
    public UUID id;
    @SerializedName("user_id") public int userId;
    @SerializedName("user_name") public String userName;
    @SerializedName("user_roles") public List<MixerUser.Role> userRoles;

    public IncomingMessageData getMessage() {
        IncomingMessageData d = new IncomingMessageData();
        d.channel = this.channel;
        d.id = this.id.toString();
        d.userId = this.userId;
        d.userName = this.userName;
        d.message = this.message;
        d.userRoles = this.userRoles;

        return d;
    }
}


text:
var title2 = function(game){}

title2.prototype = {
  	preload: function(){
        this.game.load.image('background', 'assets/background/title2.png');
	},
    create: function(){
        var background = this.game.add.sprite(0, 0, 'background');
		var select_controlsButton = this.game.add.button(386/2,284/2,"select_controls",this.select_controls,this);
		select_controlsButton.anchor.setTo(0.5,0.5);
	},
	select_controls: function(){
		this.game.state.start("select_controls");
	}
}


text:
package org.springframework.boot.context.properties.bind;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;

import org.springframework.boot.context.properties.source.ConfigurationPropertyName;
import org.springframework.core.ResolvableType;

/**
 * {@link AggregateBinder} for arrays.
 *
 * @author Phillip Webb
 * @author Madhura Bhave
 */
class ArrayBinder extends IndexedElementsBinder<Object> {

	ArrayBinder(BindContext context) {
		super(context);
	}

	@Override
	protected Object bindAggregate(ConfigurationPropertyName name, Bindable<?> target,
			AggregateElementBinder elementBinder) {
		IndexedCollectionSupplier collection = new IndexedCollectionSupplier(
				ArrayList::new);
		ResolvableType elementType = target.getType().getComponentType();
		bindIndexed(name, target, elementBinder, collection, target.getType(),
				elementType);
		if (collection.wasSupplied()) {
			List<Object> list = (List<Object>) collection.get();
			Object array = Array.newInstance(elementType.resolve(), list.size());
			for (int i = 0; i < list.size(); i++) {
				Array.set(array, i, list.get(i));
			}
			return array;
		}
		return null;
	}

	@Override
	protected Object merge(Object existing, Object additional) {
		return additional;
	}

}


text:
/**
 * API adapter
 */

const API_ENDPOINT = process.env.REACT_APP_API_ENDPOINT;

if (!API_ENDPOINT) {
  throw new Error('required_API_ENDPOINT');
}

function checkStatus(response) {
  // console.log('checkState', response);
  if (response.status === 0) {
    return response;
  } else if (response.status >= 200 && response.status < 300) {
    return response;
  } else {
    const error = new Error(response.statusText);
    error.response = response;
    throw error;
  }
}

function parseJSON(response) {
  return response.json();
}

// function sleep(obj) {
//   return new Promise(function(resolve, reject) {
//     setTimeout(() => {
//       resolve(obj);
//     }, 1000);
//   });
// };

const reqHeaders = new Headers();
reqHeaders.append('Content-Type', 'text/plain');

export default {
  // products, regions, etc
  get: (graphQLQuery) => {
    if (!graphQLQuery) {
      throw new Error('required_graphQLQuery');
    }
    // const query = queryParams ? Object.keys(queryParams)
    //       .map(k => encodeURIComponent(k) + '='
    //            + encodeURIComponent(queryParams[k]))
    //       .join('&') : '';

    const finalUrl = API_ENDPOINT + '?q=' + encodeURIComponent(graphQLQuery);

// , {
//       method: 'GET'
//       // headers: reqHeaders,
//       // cache: 'default',
//       // body: graphQLQuery
//     })

    return fetch(finalUrl)
      .then(checkStatus)
      .then(parseJSON)
      .then((obj) => {
        if (obj.errors) {
          // just first error
          throw new Error(obj.errors[0].message);
        }

        return obj.data;
      })
    // .then(sleep)
      .catch(function(error) {
        console.log('request failed', error);
        throw error;
      });
  }
};

// https://stackoverflow.com/questions/36292537/what-is-an-opaque-request-and-what-it-serves-for
// no-cors — Prevents the method from being anything other than HEAD, GET or POST. If any ServiceWorkers intercept these requests, they may not add or override any headers except for these. In addition, JavaScript may not access any properties of the resulting Response. This ensures that ServiceWorkers do not affect the semantics of the Web and prevents security and privacy issues arising from leaking data across domains.
// mode: 'no-cors',


text:
#include <aws/opsworks/model/DescribeElasticIpsResult.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <aws/core/AmazonWebServiceResult.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/UnreferencedParam.h>

#include <utility>

using namespace Aws::OpsWorks::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
using namespace Aws;

DescribeElasticIpsResult::DescribeElasticIpsResult()
{
}

DescribeElasticIpsResult::DescribeElasticIpsResult(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  *this = result;
}

DescribeElasticIpsResult& DescribeElasticIpsResult::operator =(const Aws::AmazonWebServiceResult<JsonValue>& result)
{
  JsonView jsonValue = result.GetPayload().View();
  if(jsonValue.ValueExists("ElasticIps"))
  {
    Array<JsonView> elasticIpsJsonList = jsonValue.GetArray("ElasticIps");
    for(unsigned elasticIpsIndex = 0; elasticIpsIndex < elasticIpsJsonList.GetLength(); ++elasticIpsIndex)
    {
      m_elasticIps.push_back(elasticIpsJsonList[elasticIpsIndex].AsObject());
    }
  }

  return *this;
}


text:
/**
 * Executa callbackFunction se ENTER foi pressionado
 *
 * handleEnterKey(e => callbackFunction(e.target.value))
 */
export const handleEnterKey = callback => event => {
    if (typeof callback !== 'function') {
        throw new Error('handleEnterKey() deve receber uma function de callback')
    }

    return event.key === 'Enter' && callback(event)
}


text:
package io.scalecube.socketio.pipeline;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.SocketAddress;
import java.util.List;

import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.codec.http.FullHttpRequest;
import io.netty.handler.codec.http.HttpMethod;
import io.netty.handler.codec.http.QueryStringDecoder;
import io.netty.util.ReferenceCountUtil;
import io.scalecube.socketio.TransportType;
import io.scalecube.socketio.packets.ConnectPacket;
import io.scalecube.socketio.packets.Packet;
import io.scalecube.socketio.serialization.PacketFramer;

@ChannelHandler.Sharable
public class XHRPollingHandler extends ChannelInboundHandlerAdapter {

  private final Logger log = LoggerFactory.getLogger(getClass());

  private final String connectPath;
  private final String remoteAddressHeader;

  public XHRPollingHandler(final String handshakePath, final String remoteAddressHeader) {
    this.connectPath = handshakePath + TransportType.XHR_POLLING.getName();
    this.remoteAddressHeader = remoteAddressHeader;
  }

  @Override
  public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
    if (msg instanceof FullHttpRequest) {
      final FullHttpRequest req = (FullHttpRequest) msg;
      final HttpMethod requestMethod = req.method();
      final QueryStringDecoder queryDecoder = new QueryStringDecoder(req.uri());
      final String requestPath = queryDecoder.path();

      if (requestPath.startsWith(connectPath)) {
        if (log.isDebugEnabled())
          log.debug("Received HTTP XHR-Polling request: {} {} from channel: {}", requestMethod, requestPath, ctx.channel());

        final String sessionId = PipelineUtils.getSessionId(requestPath);
        final String origin = PipelineUtils.getOrigin(req);

        if (HttpMethod.GET.equals(requestMethod)) {
          SocketAddress clientIp = PipelineUtils.resolveClientIpByRemoteAddressHeader(req, remoteAddressHeader);

          // Process polling request from client
          final ConnectPacket packet = new ConnectPacket(sessionId, origin);
          packet.setTransportType(TransportType.XHR_POLLING);
          packet.setRemoteAddress(clientIp);

          ctx.fireChannelRead(packet);
        } else if (HttpMethod.POST.equals(requestMethod)) {
          // Process message request from client
          List<Packet> packets = PacketFramer.decodePacketsFrame(req.content());
          for (Packet packet : packets) {
            packet.setSessionId(sessionId);
            packet.setOrigin(origin);
            ctx.fireChannelRead(packet);
          }
        } else {
          log.warn("Can't process HTTP XHR-Polling request. Unknown request method: {} from channel: {}", requestMethod,
              ctx.channel());
        }
        ReferenceCountUtil.release(msg);
        return;
      }
    }

    ctx.fireChannelRead(msg);
  }

}


text:
import os
import shutil

from unittest import TestCase

from yasmin.utils import get_installed_recipes, check_recipe_sanity
from yasmin.utils import get_recipe_dir
from yasmin.logger import ErrorType

def generate_dummy_recipe():
    recipe_list = get_installed_recipes()
    return recipe_list[0] + "-dummy"

def cleanup_dummies():
    shutil.rmtree(get_recipe_dir() + "/" + dummy)

dummy = generate_dummy_recipe()
dummy_base_filename = get_recipe_dir() + "/" + dummy + "/" + dummy

class TestRecipeExists(TestCase):
    def test_detect_uninstalled_recipe(self):
        self.assertEqual(check_recipe_sanity(dummy),
                         ErrorType.RECIPE_NOT_INSTALLED)

    def test_detect_broken_recipe(self):
        os.makedirs(get_recipe_dir() + "/" + dummy)
        open(dummy_base_filename + ".html", 'a').close()
        self.assertEqual(check_recipe_sanity(dummy),
                         ErrorType.RECIPE_BROKEN)

    def test_detect_correct_recipe(self):
        open(dummy_base_filename + ".css", 'a').close()
        self.assertTrue(check_recipe_sanity(dummy))
        cleanup_dummies()


text:
"""Fichier contenant l'action effacer_memoire."""

import re
from fractions import Fraction

from primaires.scripting.action import Action
from primaires.scripting.instruction import ErreurExecution

# Constantes
RE_TEMPS = re.compile(r"^[0-9]+[mhjs]$")

class ClasseAction(Action):

    """Efface ou programme l'effacement d'une mémoire de scripting."""

    @classmethod
    def init_types(cls):
        cls.ajouter_types(cls.effacer_salle, "Salle", "str")
        cls.ajouter_types(cls.effacer_perso, "Personnage", "str")
        cls.ajouter_types(cls.effacer_objet, "Objet", "str")
        cls.ajouter_types(cls.effacer_salle, "Salle", "str", "Fraction")
        cls.ajouter_types(cls.effacer_perso, "Personnage", "str", "Fraction")
        cls.ajouter_types(cls.effacer_objet, "Objet", "str", "Fraction")
        cls.ajouter_types(cls.effacer_salle, "Salle", "str", "str")
        cls.ajouter_types(cls.effacer_perso, "Personnage", "str", "str")
        cls.ajouter_types(cls.effacer_objet, "Objet", "str", "str")

    @staticmethod
    def effacer_salle(salle, cle, temps=0):
        """Efface une mémoire de salle.

        Paramètres à préciser :

          * salle : la salle dont on veut supprimer la mémoire
          * cle : la clé de la mémoire à effacer
          * temps (optionnel) : permet de programmer la suppression.

        Si un temps est précisé, la mémoire n'est pas effacée tout de suite
        mais sa suppression est programmée. Il est ainsi possible d'avoir des
        mémoires temporaires, devant exister 5 minutes par exemple.

        Le temps peut être précisé :

          * Sous la forme d'un nombre (le nombre de minutes à attendre) ;
          * Sous la forme d'une chaîne (détail plus bas).

        La chaîne doit contenir un nombre suivi d'une lettre. Les lettres sont
        s pour un nombre de secondes, m pour un nombre de minutes, h
        pour les heures et j pour les jours.

        Par exemple :

          * "3s" signifie supprimer la mémoire dans 3 secondes ;
          * "12h" signifie "supprimer la mémoire dans 12 heures" ;
          * "5j" signifie "supprimer la mémoire dans 5 jours" ;
          * "38m" est équivalent à 38. (38 minutes)

        Exemples d'utilisation :

          # Supprime immédiatement la mémoire "createur" de la salle
          effacer_memoire salle "createur"
          # Supprime la mémoire dans 8 secondes
          effacer_memoire salle "createur" "8s"
          # Supprime la mémoire dans 30 minutes
          effacer_memoire salle "createur" 30
          # Équivaut à
          effacer_memoire salle "createur" "30m"

        """
        temps = temps_en_secondes(temps)
        if temps:
            try:
                importeur.scripting.memoires.programmer_destruction(
                        salle, cle, temps)
            except ValueError as err:
                raise ErreurExecution(str(err))
            return

        if salle in importeur.scripting.memoires:
            if cle in importeur.scripting.memoires[salle]:
                del importeur.scripting.memoires[salle][cle]
                importeur.scripting.memoires.nettoyer_memoire(salle, cle)
            else:
                raise ErreurExecution("la mémoire {}:{} n'existe pas".format(
                        salle, cle))
            if not importeur.scripting.memoires[salle]:
                del importeur.scripting.memoires[salle]
        else:
            raise ErreurExecution("pas de mémoire pour {}".format(salle))

    @staticmethod
    def effacer_perso(personnage, cle, temps=0):
        """Efface une mémoire de personnage.

        Paramètres à préciser :

          * personnage : le personnage dont on veut supprimer la mémoire
          * cle : la clé de la mémoire à effacer
          * temps (optionnel) : permet de programmer la suppression.

        Si un temps est précisé, la mémoire n'est pas effacée tout de suite
        mais sa suppression est programmée. Il est ainsi possible d'avoir des
        mémoires temporaires, devant exister 5 minutes par exemple.

        Le temps peut être précisé :

          * Sous la forme d'un nombre (le nombre de minutes à attendre) ;
          * Sous la forme d'une chaîne (détail plus bas).

        La chaîne doit contenir un nombre suivi d'une lettre. Les lettres sont
        s pour un nombre de secondes, m pour un nombre de minutes, h
        pour les heures et j pour les jours.

        Par exemple :

          * "3s" signifie supprimer la mémoire dans 3 secondes ;
          * "12h" signifie "supprimer la mémoire dans 12 heures" ;
          * "5j" signifie "supprimer la mémoire dans 5 jours" ;
          * "38m" est équivalent à 38. (38 minutes)

        Exemples d'utilisation :

          # Supprime immédiatement la mémoire "createur" du personnage
          effacer_memoire personnage "createur"
          # Supprime la mémoire dans 8 secondes
          effacer_memoire personnage "createur" "8s"
          # Supprime la mémoire dans 30 minutes
          effacer_memoire personnage "createur" 30
          # Équivaut à
          effacer_memoire personnage "createur" "30m"

        """
        personnage = hasattr(personnage, "prototype") and \
                personnage.prototype or personnage
        temps = temps_en_secondes(temps)
        if temps:
            try:
                importeur.scripting.memoires.programmer_destruction(
                        personnage, cle, temps)
            except ValueError as err:
                raise ErreurExecution(str(err))
            return

        if personnage in importeur.scripting.memoires:
            if cle in importeur.scripting.memoires[personnage]:
                del importeur.scripting.memoires[personnage][cle]
            else:
                raise ErreurExecution("la mémoire {}:{} n'existe pas".format(
                        personnage, cle))
            if not importeur.scripting.memoires[personnage]:
                del importeur.scripting.memoires[personnage]
                importeur.scripting.memoires.nettoyer_memoire(personnage,
                        cle)
        else:
            raise ErreurExecution("pas de mémoire pour {}".format(personnage))

    @staticmethod
    def effacer_objet(objet, cle, temps=0):
        """Efface une mémoire d'objet.

        Paramètres à préciser :

          * objet : l'objet dont on veut supprimer la mémoire
          * cle : la clé de la mémoire à effacer
          * temps (optionnel) : permet de programmer la suppression.

        Si un temps est précisé, la mémoire n'est pas effacée tout de suite
        mais sa suppression est programmée. Il est ainsi possible d'avoir des
        mémoires temporaires, devant exister 5 minutes par exemple.

        Le temps peut être précisé :

          * Sous la forme d'un nombre (le nombre de minutes à attendre) ;
          * Sous la forme d'une chaîne (détail plus bas).

        La chaîne doit contenir un nombre suivi d'une lettre. Les lettres sont
        s pour un nombre de secondes, m pour un nombre de minutes, h
        pour les heures et j pour les jours.

        Par exemple :

          * "3s" signifie supprimer la mémoire dans 3 secondes ;
          * "12h" signifie "supprimer la mémoire dans 12 heures" ;
          * "5j" signifie "supprimer la mémoire dans 5 jours" ;
          * "38m" est équivalent à 38. (38 minutes)

        Exemples d'utilisation :

          # Supprime immédiatement la mémoire "createur" de l'objet
          effacer_memoire objet "createur"
          # Supprime la mémoire dans 8 secondes
          effacer_memoire objet "createur" "8s"
          # Supprime la mémoire dans 30 minutes
          effacer_memoire objet "createur" 30
          # Équivaut à
          effacer_memoire objet "createur" "30m"

        """
        temps = temps_en_secondes(temps)
        if temps:
            try:
                importeur.scripting.memoires.programmer_destruction(
                        objet, cle, temps)
            except ValueError as err:
                raise ErreurExecution(str(err))
            return

        if objet in importeur.scripting.memoires:
            if cle in importeur.scripting.memoires[objet]:
                del importeur.scripting.memoires[objet][cle]
                importeur.scripting.memoires.nettoyer_memoire(objet, cle)
            else:
                raise ErreurExecution("la mémoire {}:{} n'existe pas".format(
                        objet, cle))
            if not importeur.scripting.memoires[objet]:
                del importeur.scripting.memoires[objet]
        else:
            raise ErreurExecution("pas de mémoire pour {}".format(objet))

def temps_en_secondes(temps):
    """Retourne le temps en secondes."""
    if isinstance(temps, (Fraction, int)):
        return int(temps) * 60
    elif isinstance(temps, str):
        if not RE_TEMPS.search(temps):
            raise ErreurExecution("syntaxe de temps invalide")

        mul = temps[-1]
        temps = temps[:-1]
        try:
            temps = int(temps)
        except ValueError:
            raise ErreurExecution("temps invalide")

        if mul == "h":
            temps *= 60 * 60
        elif mul == "j":
            temps *= 60 * 60 * 24
        elif mul == "m":
            temps *= 60

        return temps
    else:
        raise ValueError("type de temps invalide")


text:
layout: default
title: Brainet Lab - Contact
---

<h1>{{ page.title }}</h1>
BrainetLab is hosted at Center For Neuroscience and Cognitive Systems.

## Address:
* Corso Bettini 31
* 38068
* Rovereto, (TN)
* Italy


text:
<?php
namespace suver\integrator;

use Yii;
use yii\base\Controller;
use yii\base\Event;
use yii\helpers\ArrayHelper;
use yii\web\NotFoundHttpException;

trait Tabs
{
	use TabsTrait;
}


text:
<?php
/*
 * Generated by CRUDigniter v3.0 Beta
 * www.crudigniter.com
 */

class Country_model extends CI_Model
{
    function __construct()
    {
        parent::__construct();
    }

    /*
     * Get country by country_code
     */
    function get_country($country_code)
    {
        $country = $this->db->query("
            SELECT
                *

            FROM
                `country`

            WHERE
                `country_code` = ?
        ",array($country_code))->row_array();

        return $country;
    }

    /*
     * Get all countries
     */
    function get_all_countries()
    {
        $countries = $this->db->query("
            SELECT
                *

            FROM
                `country`

            WHERE
                1 = 1
        ")->result_array();

        return $countries;
    }

    /*
     * function to add new country
     */
    function add_country($params)
    {
        $this->db->insert('country',$params);
        return $this->db->insert_id();
    }

    /*
     * function to update country
     */
    function update_country($country_code,$params)
    {
        $this->db->where('country_code',$country_code);
        $response = $this->db->update('country',$params);
        if($response)
        {
            return "country updated successfully";
        }
        else
        {
            return "Error occuring while updating country";
        }
    }

    /*
     * function to delete country
     */
    function delete_country($country_code)
    {
        $response = $this->db->delete('country',array('country_code'=>$country_code));
        if($response)
        {
            return "country deleted successfully";
        }
        else
        {
            return "Error occuring while deleting country";
        }
    }
}


text:
title: Journal de bord du 16/01/17
author: Nicolas
type: post
date: 2017-01-16T17:52:02+00:00
url: /2017/01/16/journal-de-bord-du-160117/
image:
---

1er jour du convoyage d'Okolé de la Trinité sur mer à Hyères.

Départ à 12h avec Côme et moi.

Plein de gasoil fait à 698h.

Situation à 18h, 20kt NE avec petite houle d'ENE. Faisons route en direction du Cap Finistère à 7-8kt. Tout va bien à bord.

[Position à 18h](https://map.iridium.com/m?lat=47.333362&lon=-3.369197)

J'aurais du mal à dire que je n'étais pas stressé de partir et que je ne le suis pas encore un peu... la houle qui nous prend par le travers n'aide pas. Mais tout va très bien, le bateau est chargé pour au moins 4 semaines d'autonomie, tous les systèmes de sécurité ont été pris en main et contrôlé, bref... On a conscience de faire quelque chose d'un peu hors du commun qui comporte des risques, mais ça fait plusieurs années que je m'y prépare, entre les lectures, les stages, les navigations en famille ou entre potes, y'a un moment où la suite de l'histoire est de prendre la mer. Nous y voilà !

Je vais gérer la nuit en enchaînant les siestes de 15 min. Je serais assisté par l'AIS et le radar qui tourne en permanence. Côme sera susceptible de faire de la veille si il le souhaite mais ne pourra pas sortir de la descente protégée.

En attendant je vais allé préparer la lotte que j'ai acheté au port de la Trinité.

A demain!

Nicolas

PS: La correctrice orthographique nommé Florence ne fonctionne pas par satellite... de nombreuses fote peuvent se glisser à l'issue de mon plein grès dans le journal de bord... merci de votre compréhension 😉


text:
SVProgressHUD的使用

````
安装: pod 'SVProgressHUD'
引入头: #import "SVProgressHUD.h"

````

测试方法

````objc

[SVProgressHUD show];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
    // time-consuming task
    sleep(3);
    dispatch_async(dispatch_get_main_queue(), ^{
        [SVProgressHUD dismiss];
    });
});

````

示例:

````obcj

#import "ViewController.h"
#import "SVProgressHUD.h"

@implementation ViewController

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    return YES;
}

#pragma mark - Notification Methods Sample

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(handleNotification:)
                                                 name:SVProgressHUDWillAppearNotification
                                               object:nil];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(handleNotification:)
                                                 name:SVProgressHUDDidAppearNotification
                                               object:nil];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(handleNotification:)
                                                 name:SVProgressHUDWillDisappearNotification
                                               object:nil];

    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(handleNotification:)
                                                 name:SVProgressHUDDidDisappearNotification
                                               object:nil];
}

- (void)handleNotification:(NSNotification *)notif
{
    NSLog(@"Notification recieved: %@", notif.name);
    NSLog(@"Status user info key: %@", [notif.userInfo objectForKey:SVProgressHUDStatusUserInfoKey]);
}

#pragma mark - Show Methods Sample

- (void)show {
	[SVProgressHUD show];
}

- (void)showWithStatus {
	[SVProgressHUD showWithStatus:@"Doing Stuff"];
}

static float progress = 0.0f;

- (IBAction)showWithProgress:(id)sender {
    progress = 0.0f;
    [SVProgressHUD showProgress:0 status:@"Loading"];
    [self performSelector:@selector(increaseProgress) withObject:nil afterDelay:0.3f];
}

- (void)increaseProgress {
    progress+=0.1f;
    [SVProgressHUD showProgress:progress status:@"Loading"];

    if(progress < 1.0f)
        [self performSelector:@selector(increaseProgress) withObject:nil afterDelay:0.3f];
    else
        [self performSelector:@selector(dismiss) withObject:nil afterDelay:0.4f];
}

#pragma mark - Dismiss Methods Sample

- (void)dismiss {
	[SVProgressHUD dismiss];
}

- (IBAction)dismissInfo{
    [SVProgressHUD showInfoWithStatus:@"Useful Information."];
}

- (void)dismissSuccess {
	[SVProgressHUD showSuccessWithStatus:@"Great Success!"];
}

- (void)dismissError {
	[SVProgressHUD showErrorWithStatus:@"Failed with Error"];
}

@end

````


text:
import AlteryxPythonSDK as Sdk
import xml.etree.ElementTree as Et

class AyxPlugin:
    """
    Implements the plugin interface methods, to be utilized by the Alteryx engine to communicate with a plugin.
    Prefixed with "pi", the Alteryx engine will expect the below five interface methods to be defined.
    """

    def __init__(self, n_tool_id: int, alteryx_engine: object, output_anchor_mgr: object):
        """
        Constructor is called whenever the Alteryx engine wants to instantiate an instance of this plugin.
        :param n_tool_id: The assigned unique identification for a tool instance.
        :param alteryx_engine: Provides an interface into the Alteryx engine.
        :param output_anchor_mgr: A helper that wraps the outgoing connections for a plugin.
        """

        # Default properties
        self.n_tool_id = n_tool_id
        self.alteryx_engine = alteryx_engine
        self.output_anchor_mgr = output_anchor_mgr

        # Custom properties
        self.is_initialized = True

        self.single_input = None
        self.grouping_fields = None
        self.xml_sort_info = None

        self.output_anchor = None
        self.output_field = None
        self.output_field_name = None
        self.output_field_type = None
        self.output_field_size = None
        self.output_field_last = False

        self.starting_value = None
        self.current_value = None
        self.current_group = None
        self.grouping_fields_objects = None

    def pi_init(self, str_xml: str):
        """
        Handles configuration based on the GUI.
        Called when the Alteryx engine is ready to provide the tool configuration from the GUI.
        :param str_xml: The raw XML from the GUI.
        """

        # Getting the dataName data property from the Gui.html
        self.output_field_name = Et.fromstring(str_xml).find('FieldName').text if 'FieldName' in str_xml else None
        if self.output_field_name is None:
            self.display_error_msg('Field name cannot be empty. Please enter a field name.')
        elif len(self.output_field_name) > 255:
            self.display_error_msg('Field name cannot be greater than 255 characters.')

        self.output_field_last = Et.fromstring(str_xml).find('LastColumn').text if 'LastColumn' in str_xml else 'False' == 'True'

        # Assigning the appropriate Alteryx field type.
        field_type = Et.fromstring(str_xml).find('FieldType').text if 'FieldType' in str_xml else None
        if field_type == 'Byte':
            self.output_field_type = Sdk.FieldType.byte
        elif field_type == 'Int16':
            self.output_field_type = Sdk.FieldType.int16
        elif field_type == 'Int32':
            self.output_field_type = Sdk.FieldType.int32
        elif field_type == 'Int64':
            self.output_field_type = Sdk.FieldType.int64
        elif field_type == 'String':
            self.output_field_type = Sdk.FieldType.string
            self.output_field_size = int(Et.fromstring(str_xml).find('StringSize').text) if 'StringSize' in str_xml else 1
        elif field_type == 'WString':
            self.output_field_type = Sdk.FieldType.wstring
            self.output_field_size = int(Et.fromstring(str_xml).find('StringSize').text) if 'StringSize' in str_xml else 1
        elif field_type == 'V_String':
            self.output_field_type = Sdk.FieldType.v_string
            self.output_field_size = int(Et.fromstring(str_xml).find('StringSize').text) if 'StringSize' in str_xml else 1
        elif field_type == 'V_WString':
            self.output_field_type = Sdk.FieldType.v_wstring
            self.output_field_size = int(Et.fromstring(str_xml).find('StringSize').text) if 'StringSize' in str_xml else 1
        else:
            self.display_error_msg('Field type must be selected.')

        # Initial Value For ID
        self.starting_value = int(Et.fromstring(str_xml).find('StartingValue').text) if 'StartingValue' in str_xml else 1
        self.current_value = self.starting_value - 1

        # Build Sorting String
        self.grouping_fields = Et.fromstring(str_xml).find('GroupingFields').text.split(',') if 'GroupingFields' in str_xml else []
        sorting_fields = Et.fromstring(str_xml).find('SortingFields').text.split(',') if 'SortingFields' in str_xml else []
        descending_fields = Et.fromstring(str_xml).find('DescendingFields').text.split(',') if 'DescendingFields' in str_xml else []
        self.xml_sort_info = ''
        for grouping_field in self.grouping_fields:
            if grouping_field != '""':
                self.xml_sort_info += '<Field field=' + grouping_field + ' order="' + ('Desc' if grouping_field in descending_fields else 'Asc') + '" />\n'
        for grouping_field in sorting_fields:
            if not grouping_field in self.grouping_fields and grouping_field != '""':
                self.xml_sort_info += '<Field field=' + grouping_field + ' order="' + ('Desc' if grouping_field in descending_fields else 'Asc') + '" />\n'
        self.xml_sort_info = ('<SortInfo>\n<GroupByFields>\n' + self.xml_sort_info + '</GroupByFields>\n</SortInfo>\n') if self.xml_sort_info else ''
        self.alteryx_engine.output_message(self.n_tool_id, Sdk.EngineMessageType.info, self.xml_sort_info)

        # Getting the output anchor from Config.xml by the output connection name
        self.output_anchor = self.output_anchor_mgr.get_output_anchor('Output')

    def pi_add_incoming_connection(self, str_type: str, str_name: str) -> object:
        """
        The IncomingInterface objects are instantiated here, one object per incoming connection.
        Called when the Alteryx engine is attempting to add an incoming data connection.
        :param str_type: The name of the input connection anchor, defined in the Config.xml file.
        :param str_name: The name of the wire, defined by the workflow author.
        :return: The IncomingInterface object(s).
        """
        self.alteryx_engine.pre_sort(str_type, str_name, self.xml_sort_info)
        self.single_input = IncomingInterface(self)
        return self.single_input

    def pi_add_outgoing_connection(self, str_name: str) -> bool:
        """
        Called when the Alteryx engine is attempting to add an outgoing data connection.
        :param str_name: The name of the output connection anchor, defined in the Config.xml file.
        :return: True signifies that the connection is accepted.
        """
        return True

    def pi_push_all_records(self, n_record_limit: int) -> bool:
        """
        Handles generating a new field for no incoming connections.
        Called when a tool has no incoming data connection.
        :param n_record_limit: Set it to <0 for no limit, 0 for no records, and >0 to specify the number of records.
        :return: False if there's an error with the field name, otherwise True.
        """
        return False

    def pi_close(self, b_has_errors: bool):
        """
        Called after all records have been processed.
        :param b_has_errors: Set to true to not do the final processing.
        """
        self.output_anchor.assert_close()

    def display_error_msg(self, msg_string: str):
        """
        A non-interface method, that is responsible for displaying the relevant error message in Designer.
        :param msg_string: The custom error message.
        """
        self.is_initialized = False

class IncomingInterface:
    """
    This class is returned by pi_add_incoming_connection, and it implements the incoming interface methods, to be\
    utilized by the Alteryx engine to communicate with a plugin when processing an incoming connection.
    Prefixed with "ii", the Alteryx engine will expect the below four interface methods to be defined.
    """

    def __init__(self, parent: object):
        """
        Constructor for IncomingInterface.
        :param parent: AyxPlugin
        """

        # Default properties
        self.parent = parent

        # Custom properties
        self.record_copier = None
        self.record_creator = None

    def ii_init(self, record_info_in: object) -> bool:
        """
        Handles appending the new field to the incoming data.
        Called to report changes of the incoming connection's record metadata to the Alteryx engine.
        :param record_info_in: A RecordInfo object for the incoming connection's fields.
        :return: False if there's an error with the field name, otherwise True.
        """

        if not self.parent.is_initialized:
            return False

        # Returns a new, empty RecordCreator object that is identical to record_info_in.
        record_info_out = record_info_in.clone()
        if self.parent.output_field_size:
            self.parent.output_field = record_info_out.add_field(self.parent.output_field_name, self.parent.output_field_type, self.parent.output_field_size)
        else:
            self.parent.output_field = record_info_out.add_field(self.parent.output_field_name, self.parent.output_field_type)
        self.parent.output_anchor.init(record_info_out)

        # Creating a new, empty record creator based on record_info_out's record layout.
        self.record_creator = record_info_out.construct_record_creator()

        # Instantiate a new instance of the RecordCopier class.
        self.record_copier = Sdk.RecordCopier(record_info_out, record_info_in)
        for index in range(record_info_in.num_fields):
            self.record_copier.add(index, index)
        self.record_copier.done_adding()

        # Construct Group Reader
        self.parent.grouping_fields_objects = []
        for grouping_field in self.parent.grouping_fields:
            if grouping_field != '""':
                if record_info_in.get_field_by_name(grouping_field.strip('"')):
                    self.parent.grouping_fields_objects.append(record_info_in.get_field_by_name(grouping_field.strip('"')))
                else:
                    self.alteryx_engine.output_message(self.n_tool_id, Sdk.EngineMessageType.info, 'Failed to find ' + grouping_field.strip('"'))

        return True

    def ii_push_record(self, in_record: object) -> bool:
        """
        Responsible for pushing records out.
        Called when an input record is being sent to the plugin.
        :param in_record: The data for the incoming record.
        :return: False if there's a downstream error, or if there's an error with the field name, otherwise True.
        """

        if not self.parent.is_initialized:
            return False

        # Copy the data from the incoming record into the outgoing record.
        self.record_creator.reset()
        self.record_copier.copy(self.record_creator, in_record)

        # Check Group
        if len(self.parent.grouping_fields_objects) > 0:
            new_group = []
            for grouping_field in self.parent.grouping_fields_objects:
                if grouping_field.type in [Sdk.FieldType.byte, Sdk.FieldType.int16, Sdk.FieldType.int32, Sdk.FieldType.int64]:
                    new_group.append(grouping_field.get_as_int64(in_record))
                elif grouping_field.type in [Sdk.FieldType.float, Sdk.FieldType.double]:
                    new_group.append(grouping_field.get_as_double(in_record))
                else:
                    new_group.append(grouping_field.get_as_string(in_record))
            if self.parent.current_group and self.parent.current_group == new_group:
                self.parent.current_value += 1
            else:
                self.parent.current_value = self.parent.starting_value
                self.parent.current_group = new_group
        else:
            self.parent.current_value += 1

        # Sets the value of this field in the specified record_creator from an int64 value.
        if self.parent.output_field_type == Sdk.FieldType.string or self.parent.output_field_type == Sdk.FieldType.wstring:
            self.parent.output_field.set_from_string(self.record_creator, str(self.parent.current_value).zfill(self.parent.output_field_size))
        else:
            self.parent.output_field.set_from_int64(self.record_creator, self.parent.current_value)

        out_record = self.record_creator.finalize_record()

        # Push the record downstream and quit if there's a downstream error.
        if not self.parent.output_anchor.push_record(out_record):
            return False

        return True

    def ii_update_progress(self, d_percent: float):
        """
        Called by the upstream tool to report what percentage of records have been pushed.
        :param d_percent: Value between 0.0 and 1.0.
        """
        self.parent.alteryx_engine.output_tool_progress(self.parent.n_tool_id, d_percent)
        self.parent.output_anchor.update_progress(d_percent)

    def ii_close(self):
        """
        Called when the incoming connection has finished passing all of its records.
        """
        self.parent.output_anchor.close()


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Reflection;
using Castle.Windsor;
using Core.Forms.Permissions.Operations;
using Core.Framework.Permissions.Helpers;
using Core.Framework.Permissions.Models;
using Core.Framework.Plugins.Plugins;
using Core.Framework.Plugins.Web;

namespace Core.Forms
{
    [Export(typeof(ICorePlugin))]
    [Export(typeof(IPermissible))]
    public class FormsPlugin: BasePlugin, IPermissible
    {
         #region Singleton

        private static FormsPlugin _instance;

        private static readonly Object SyncRoot = new Object();

        public static FormsPlugin Instance
        {
            get
            {
                lock (SyncRoot)
                {
                    return _instance ?? (_instance = new FormsPlugin());
                }
            }
        }

        #endregion

        private FormsPlugin()
        {
            PermissionTitle = Title;
            Operations = OperationsHelper.GetOperations<FormsPluginOperations>();
        }

        public override string Identifier
        {
            get { return GetPluginIdentifier(); }
        }

        public override string Title
        {
            get
            {
                return "Forms";
            }
        }

        public override string Description
        {
            get
            {
                return "Allow managing Web Forms";
            }
        }

        /// <summary>
        /// Registers the specified container.
        /// </summary>
        /// <param name="container">The container.</param>
        public override void Register(IWindsorContainer container)
        {
            NHibernate.CoreFormsNHibernateModule.Install(container);
        }

        public override void Install()
        {

        }

        public override void Uninstall()
        {

        }

        public override Assembly GetPluginMigrationsAssembly()
        {
             return Assembly.Load("Core.Forms.Migrations");
        }

        public static string GetPluginIdentifier()
        {
            return "123";
        }

        #region IPermissible members

        public string PermissionTitle { get; set; }

        public IEnumerable<IPermissionOperation> Operations { get; set; }

        #endregion
    }
}


text:
extern "C"
#include <stdio.h>
#include <stdlib.h>
#include "deeplearning4j.h"
//scalar and current element
__global  double op(double d1,double d2,double *params);

__global  void transform(int n, int idx,double dx,double *dy,int incy,double *params,double *result) {
	int totalThreads = get_num_groups(0) * get_local_size(0);
	int tid = get_local_id(0);
	int i = get_group_id(0) * get_local_size(0) + tid;

	for (; i < n; i += totalThreads) {
		result[i * incy] = op(dx,dy[i * incy],params);
	}

}


text:
/**
 * Edition field for a date - a text input with a datepicker.
 *
 * @example <ma-date-field field="field" value="value"></ma-date-field>
 */
function maDateField() {
    return {
        scope: {
            'field': '&',
            'value': '='
        },
        restrict: 'E',
        link: function(scope, element) {
            var field = scope.field();
            scope.name = field.name();
            scope.rawValue = scope.value;
            scope.$watch('rawValue', function(rawValue) {
                scope.value = field.parse()(rawValue);
            });
            scope.format = field.format();
            if (!scope.format) {
                scope.format = field.type() === 'date' ? 'yyyy-MM-dd' : 'yyyy-MM-dd HH:mm:ss';
            }

            scope.v = field.validation();
            scope.isOpen = false;
            var input = element.find('input').eq(0);
            var attributes = field.attributes();
            for (var name in attributes) {
                input.attr(name, attributes[name]);
            }
            scope.toggleDatePicker = function ($event) {
                $event.preventDefault();
                $event.stopPropagation();
                scope.isOpen = !scope.isOpen;
            };
        },
        template: `

                <input
                    type="text" ng-model="rawValue" id="{{ name }}" name="{{ name }}" class="form-control"
                    datepicker-popup="{{ format }}" is-open="isOpen" close-text="Close" ng-required="v.required" />

                    <button type="button" class="btn btn-default" ng-click="toggleDatePicker($event)">

                    </button>

        `
    };
}

maDateField.$inject = [];

export default maDateField;


text:
<?php

namespace sas\galleryBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class DocumentType extends AbstractType
{
        /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            /*->add('path')*/
            ->add('file')
            ->getForm();
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'sas\galleryBundle\Entity\Document'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'sas_gallerybundle_document';
    }
}


text:
#import <Foundation/NSObject.h>

#if USE(APPLE_INTERNAL_SDK)

#import <CFNetwork/CFNSURLConnection.h>

#else

@interface NSURLAuthenticationChallenge ()
#if PLATFORM(IOS)
+(NSURLAuthenticationChallenge *)_createAuthenticationChallengeForCFAuthChallenge:(CFURLAuthChallengeRef)cfChallenge sender:(id <NSURLAuthenticationChallengeSender>)sender;
#else
+(NSURLAuthenticationChallenge *)_authenticationChallengeForCFAuthChallenge:(CFURLAuthChallengeRef)cfChallenge sender:(id <NSURLAuthenticationChallengeSender>)sender;
#endif
-(CFURLAuthChallengeRef)_createCFAuthChallenge;
@end

#endif


text:
package gc

import (
	"context"
	"fmt"
	"time"

	corev1 "k8s.io/api/core/v1"
	cm "knative.dev/pkg/configmap"
	"knative.dev/pkg/controller"
	"knative.dev/pkg/logging"
)

const (
	ConfigName = "config-gc"
)

type Config struct {
	// Delay duration after a revision create before considering it for GC
	StaleRevisionCreateDelay time.Duration
	// Timeout since a revision lastPinned before it should be GC'd
	// This must be longer than the controller resync period
	StaleRevisionTimeout time.Duration
	// Minimum number of generations of revisions to keep before considering for GC
	StaleRevisionMinimumGenerations int64
	// Minimum staleness duration before updating lastPinned
	StaleRevisionLastpinnedDebounce time.Duration
}

func defaultConfig() *Config {
	return &Config{
		StaleRevisionCreateDelay:        48 * time.Hour,
		StaleRevisionTimeout:            15 * time.Hour,
		StaleRevisionLastpinnedDebounce: 5 * time.Hour,
		StaleRevisionMinimumGenerations: 20,
	}
}

func NewConfigFromConfigMapFunc(ctx context.Context) func(configMap *corev1.ConfigMap) (*Config, error) {
	logger := logging.FromContext(ctx)
	minRevisionTimeout := controller.GetResyncPeriod(ctx)
	return func(configMap *corev1.ConfigMap) (*Config, error) {
		c := defaultConfig()

		if err := cm.Parse(configMap.Data,
			cm.AsDuration("stale-revision-create-delay", &c.StaleRevisionCreateDelay),
			cm.AsDuration("stale-revision-timeout", &c.StaleRevisionTimeout),
			cm.AsDuration("stale-revision-lastpinned-debounce", &c.StaleRevisionLastpinnedDebounce),

			cm.AsInt64("stale-revision-minimum-generations", &c.StaleRevisionMinimumGenerations),
		); err != nil {
			return nil, fmt.Errorf("failed to parse data: %w", err)
		}

		if c.StaleRevisionMinimumGenerations < 0 {
			return nil, fmt.Errorf("stale-revision-minimum-generations must be non-negative, was: %d", c.StaleRevisionMinimumGenerations)
		}

		if c.StaleRevisionTimeout-c.StaleRevisionLastpinnedDebounce < minRevisionTimeout {
			logger.Warnf("Got revision timeout of %v, minimum supported value is %v", c.StaleRevisionTimeout, minRevisionTimeout+c.StaleRevisionLastpinnedDebounce)
			c.StaleRevisionTimeout = minRevisionTimeout + c.StaleRevisionLastpinnedDebounce
		}
		return c, nil
	}
}