text:
<?php

use opensrs\Request;

error_reporting(-1);

if (isset($_POST['function'])) {
    $formFormat = $_POST['format'];
    $formFunction = $_POST['function'];

    $callstring = '';
    $callArray = array(
        'func' => $_POST['function'],
        'personal' => array(
            'first_name' => $_POST['first_name'],
            'last_name' => $_POST['last_name'],
            'org_name' => $_POST['org_name'],
            'address1' => $_POST['address1'],
            'address2' => $_POST['address2'],
            'address3' => $_POST['address3'],
            'city' => $_POST['city'],
            'state' => $_POST['state'],
            'postal_code' => $_POST['postal_code'],
            'country' => $_POST['country'],
            'phone' => $_POST['phone'],
            'fax' => $_POST['fax'],
            'email' => $_POST['email'],
            'url' => $_POST['url'],
            'lang_pref' => $_POST['lang_pref'],
            ),
        'cedinfo' => array(
            'contact_type' => $_POST['contact_type'],
            'id_number' => $_POST['id_number'],
            'id_type' => $_POST['id_type'],
            'id_type_info' => $_POST['id_type_info'],
            'legal_entity_type' => $_POST['legal_entity_type'],
            'legal_entity_type_info' => $_POST['legal_entity_type_info'],
            'locality_city' => $_POST['locality_city'],
            'locality_country' => $_POST['locality_country'],
            'locality_state_prov' => $_POST['locality_state_prov'],
            ),
        'nexus' => array(
            'app_purpose' => $_POST['app_purpose'],
            'category' => $_POST['category'],
            'validator' => $_POST['validator'],
            ),
        'it_registrant_info' => array(
            'nationality_code' => $_POST['nationality_code'],
            'reg_code' => $_POST['reg_code'],
            'entity_type' => $_POST['entity_type'],
            ),

        'au_registrant_info' => array(
            'registrant_name' => $_POST['registrant_name'],
            'registrant_id' => $_POST['registrant_id'],
            'registrant_id_type' => $_POST['registrant_id_type'],
            'eligibility_type' => $_POST['eligibility_type'],
            'eligibility_id' => $_POST['eligibility_id'],
            'eligibility_id_type' => $_POST['eligibility_id_type'],
            'eligibility_name' => $_POST['eligibility_name'],

            ),

        'professional_data' => array(
            'authority' => $_POST['authority'],
            'authority_website' => $_POST['authority_website'],
            'license_number' => $_POST['license_number'],
            'profession' => $_POST['profession'],
            ),

        'br_registrant_info' => array(
            'br_register_number' => $_POST['br_register_number'],
            ),

        'data' => array(
            'affiliate_id' => $_POST['affiliate_id'],
            'auto_renew' => $_POST['auto_renew'],
            'ca_link_domain' => $_POST['ca_link_domain'],
            'change_contact' => $_POST['change_contact'],
            'custom_nameservers' => $_POST['custom_nameservers'],
            'custom_tech_contact' => $_POST['custom_tech_contact'],
            'custom_transfer_nameservers' => $_POST['custom_transfer_nameservers'],
            'cwa' => $_POST['cwa'],
            'dns_template' => $_POST['dns_template'],
            'domain' => $_POST['domain'],
            'domain_description' => $_POST['domain_description'],
            'encoding_type' => $_POST['encoding_type'],
            'eu_country' => $_POST['eu_country'],
            'f_lock_domain' => $_POST['f_lock_domain'],
            'f_parkp' => $_POST['f_parkp'],
            'f_whois_privacy' => $_POST['f_whois_privacy'],
            'forwarding_email' => $_POST['forwarding_email'],
            'handle' => $_POST['handle'],
            'isa_trademark' => $_POST['isa_trademark'],
            'lang' => $_POST['lang'],
            'lang_pref' => $_POST['lang_pref'],
            'legal_type' => $_POST['legal_type'],
            'link_domains' => $_POST['link_domains'],
            'master_order_id' => $_POST['master_order_id'],
            'name1' => $_POST['name1'],
            'name2' => $_POST['name2'],
            'name3' => $_POST['name3'],
            'name4' => $_POST['name4'],
            'name5' => $_POST['name5'],
            'owner_confirm_address' => $_POST['owner_confirm_address'],
            'period' => $_POST['period'],
            'premium_price_to_verify' => $_POST['premium_price_to_verify'],
            'rant_agrees' => $_POST['rant_agrees'],
            'rant_no' => $_POST['rant_no'],
            'reg_domain' => $_POST['reg_domain'],
            'reg_password' => $_POST['reg_password'],
            'reg_type' => $_POST['reg_type'],
            'reg_username' => $_POST['reg_username'],
            'sortorder1' => $_POST['sortorder1'],
            'sortorder2' => $_POST['sortorder2'],
            'sortorder3' => $_POST['sortorder3'],
            'sortorder4' => $_POST['sortorder4'],
            'sortorder5' => $_POST['sortorder5'],
            ),
);

    if ($formFormat == 'array') {
        $callstring = $callArray;
    }
    if ($formFormat == 'json') {
        $callstring = json_encode($callArray);
    }
    if ($formFormat == 'yaml') {
        $callstring = Spyc::YAMLDump($callArray);
    }

// Open SRS Call -> Result
require_once dirname(__FILE__).'/../../vendor/autoload.php';

// $osrsHandler = processOpenSRS ($formFormat, $callstring);

$request = new Request();
    $osrsHandler = $request->process('array', $callArray);

// Print out the results
echo('{"in":'.$callstring.'},');
    echo('{"out":'.json_encode($osrsHandler->resultRaw).'}');
} else {
    // Format
    if (isset($_GET['format'])) {
        $tf = $_GET['format'];
    } else {
        $tf = 'json';
    }
    ?>

	<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

		<title></title>
		<meta name="generator" http-equiv="generator" content="Claire Lam" />
		<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
		<meta http-equiv="Content-Language" content="en"/>

		<form action="test-provSWregister.php" method="post">
			<input type="hidden" name="format" value="<?php echo($tf);
    ?>">
			<input type="hidden" name="function" value="provSWregister">

						Register new domain

						Personal info

						first_name: <input type="text" name="first_name" value="John">

						last_name: <input type="text" name="last_name" value="Smith">

						org_name: <input type="text" name="org_name" value="Tucows">

						address1: <input type="text" name="address1" value="96 Mowat Avenue">

						address2: <input type="text" name="address2" value="">

						address3: <input type="text" name="address3" value="">

						city: <input type="text" name="city" value="Toronto">

						state: <input type="text" name="state" value="ON">

						postal_code: <input type="text" name="postal_code" value="M6K 3M1">

						country: <input type="text" name="country" value="CA">

						phone: <input type="text" name="phone" value="+1.4165350123">

						fax: <input type="text" name="fax" value="">

						email: <input type="text" name="email" value="phptoolkit@tucows.com">

						url: <input type="text" name="url" value="http://www.tucows.com">

						lang_pref: <input type="text" name="lang_pref" value="EN">

						Required at all time

						<?php echo('domain: <input type="text" name="domain" value="phptest'.time().'.com">
');
    ?>
						period: <input type="text" name="period" value="1">year(s)

						reg_username: <input type="text" name="reg_username" value="phptest">

						reg_password: <input type="text" name="reg_password" value="abc123">

						reg_type: <input type="text" name="reg_type" value="new">

						custom_tech_contact: <input type="text" name="custom_tech_contact" value="1">

						custom_nameservers: <input type="text" name="custom_nameservers" value="1">

						Common optional

						affiliate_id: <input type="text" name="affiliate_id" value="">Required on renewal order Leave blank for no affiliate

						auto_renew: <input type="text" name="auto_renew" value="0">

						change_contact: <input type="text" name="change_contact" value="">

						reg_domain: <input type="text" name="reg_domain" value="">

						f_parkp: <input type="text" name="f_parkp" value="Y">

						f_whois_privacy: <input type="text" name="f_whois_privacy" value="1">

						f_lock_domain: <input type="text" name="f_lock_domain" value="1">

						link_domains: <input type="text" name="link_domains" value="0">

						master_order_id: <input type="text" name="master_order_id" value="">

						encoding_type: <input type="text" name="encoding_type" value="">

						dns_template: <input type="text" name="dns_template" value="">

						handle: <input type="text" name="handle" value="">

						custom_transfer_nameservers: <input type="text" name="custom_transfer_nameservers" value="">

						premium_price_to_verify: <input type="text" name="premium_price_to_verify" value="">

						nameserver_list >>

						   custom_nameserver: <input type="text" name="name1" value="ns1.systemdns.com"> <input type="text" name="sortorder1" value="1">

						   custom_nameserver: <input type="text" name="name2" value="ns2.systemdns.com"> <input type="text" name="sortorder2" value="2">

						   custom_nameserver: <input type="text" name="name3" value=""> <input type="text" name="sortorder3" value="">

						   custom_nameserver: <input type="text" name="name4" value=""> <input type="text" name="sortorder4" value="">

						   custom_nameserver: <input type="text" name="name5" value=""> <input type="text" name="sortorder5" value="">

						.Asia

						tld_data >> ced_info >>

						   contact_type: <input type="text" name="contact_type" value="owner">

						   id_number: <input type="text" name="id_number" value="Pasport number">

						   id_type: <input type="text" name="id_type" value="passport">

						   id_type_info: <input type="text" name="id_type_info" value=""> required only for id_type = other

						   legal_entity_type: <input type="text" name="legal_entity_type" value="naturalPerson">

						   legal_entity_type_info: <input type="text" name="legal_entity_type_info" value="">required only for legal_entity_type = other

						   locality_city: <input type="text" name="locality_city" value=""> - Optional

						   locality_country: <input type="text" name="locality_country" value="">

						   locality_state_prov: <input type="text" name="locality_state_prov" value=""> - Optional

						.EU / .BE / .DE

						                  .EU | country: <input type="text" name="eu_country" value="gb">

						         .BE | .EU | lang: <input type="text" name="lang" value="en">

						.DE | .BE | .EU | owner_confirm_address: <input type="text" name="owner_confirm_address" value="">

						.CA

						ca_link_domain: <input type="text" name="ca_link_domain" value=""> - Optional

						cwa: <input type="text" name="cwa" value=""> - Optional

						domain_description: <input type="text" name="domain_description" value=""> - Optional

						isa_trademark: <input type="text" name="isa_trademark" value="0">

						lang_pref: <input type="text" name="lang_pref" value="en">

						legal_type: <input type="text" name="legal_type" value="CCT">

						rant_agrees: <input type="text" name="rant_agrees" value=""> - Optional

						rant_no: <input type="text" name="rant_no" value=""> - Optional

						.IT

						tld_data >> it_registrant_info >>

						reg_code: <input type="text" name="reg_code" value="SGLMRA80A01H501E">

						entity_type: <input type="text" name="entity_type" value="1">

						nationality_code: <input type="text" name="nationality_code" value=""> - Optional

						.AU

						tld_data >> au_registrant_info >>

						registrant_name: <input type="text" name="registrant_name" value="Registered Company Name Ltd">

						registrant_id_type: <input type="text" name="registrant_id_type" value="ABN">

						registrant_id: <input type="text" name="registrant_id" value="99 999 999 999"> - Required if registrant_id_type = ACN or ABN

						eligibility_type: <input type="text" name="eligibility_type" value="Registered Business">

						eligibility_id: <input type="text" name="eligibility_id" value="99999999"> - Required for .COM.AU and .NET.AU

						eligibility_id_type: <input type="text" name="eligibility_id_type" value="ACN"> - Required for .COM.AU and .NET.AU

						eligibility_name: <input type="text" name="eligibility_name" value="Don Marshall CTO"> - Optional

						.PRO

						tld_data >> professional_data >>

						profession: <input type="text" name="profession" value="Dentist">

						authority: <input type="text" name="authority" value="Canadian Dental Associatio"> - Optional

						authority_website: <input type="text" name="authority_website" value="http://www.cda-adc.ca"> - Optional

						license_number: <input type="text" name="license_number" value="123456789"> - Optional

						.US

						tld_data >> nexus >>

						   app_purpose: <input type="text" name="app_purpose" value="">

						   category: <input type="text" name="category" value="">

						   validator: <input type="text" name="validator" value="">Required if category = C31 or C32

						.HU / .NU / .SE

						tld_data >> registrant_extra_info >>

						   registrant_type: <input type="text" name="registrant_type" value="">individual or organization

						   id_card_number: <input type="text" name="id_card_number" value="">Required if registrant_type = individual

						   registrant_vat_id: <input type="text" name="registrant_vat_id" value="">Required if registrant_type != individual

						   registration_number: <input type="text" name="registration_number" value="">Required if registrant_type != individual

						.NAME

						tld_data >>

						   forwarding_email: <input type="text" name="forwarding_email" value="">

						.COM.BR

						tld_data >>

						   br_register_number: <input type="text" name="br_register_number" value="">

					<input value="Register" id="lookupSearch" type="submit">

		</form>

	<?php
}
?>


text:
from tagmanager import TagManager
from groupmanager import GroupManager
from systemmanager import System, ThreadedSystem, SystemBitTracker, SystemManager
#from componentmanager import Component, ComponentBitTracker, ComponentManager
from entitymanager import Component, ComponentBitTracker, Entity, EntityProxy, EntityBitTracker, EntityManager

redpajama_set_name: RedPajamaGithub


text:
var wingedMonkeyDirectives = angular.module('wingedMonkeyDirectives',[]);

// Toggle directive
wingedMonkeyDirectives.directive('wmToggle', function () {
  return function (scope, elm, attrs) {
    scope.$watch(attrs.wmToggle, function (newVal, oldVal) {
      if (newVal) {
        elm.removeClass('js_hide').addClass('js_show');
      } else {
        elm.removeClass('js_show').addClass('js_hide');
      }
    });
  };
});

wingedMonkeyDirectives.directive('wmProviderAppConfirm', function() {
  return{
    restrict: "A",
    replace: true,
    scope: {
      message: '@wmProviderAppConfirm',
      providerApp: '=',
      toggleProperty: '=',
      action: '@',
      confirmAction: '&',
      confirmTitle: '@',
      cancel: '@'
    },
    templateUrl: "/directive_templates/wm_provider_app_confirm",
    link: function(scope, element, attrs) {
      var initialButton = angular.element(element.children()[0]);

      scope.$watch(attrs.toggleProperty, function (newVal, oldVal) {
        if (newVal) {
          initialButton.addClass('active');
          scope.providerApp.disableButtons = true;
        } else {
          initialButton.removeClass('active');
        }
      });

      scope.cancelAction = function() {
        scope.providerApp.disableButtons = false;
      }
    }
  }
});

wingedMonkeyDirectives.directive('wmFlashMessage', function() {
  return {
    restrict: 'A',
    templateUrl: "/directive_templates/wm_flash_message",
    controller: function($scope, $attrs, FlashMessage) {
      $scope.flashMessages = FlashMessage.all();

      $scope.clear = function(msg){
        FlashMessage.remove(msg);
      }

      $scope.clearAll = function(){
        FlashMessage.removeAll();
      }
    },
    link: function(scope, element, attrs) {

    }
  }
});


text:
// Python Tools for Visual Studio
// Copyright(c) Microsoft Corporation
// All rights reserved.
//
// 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
//
// THIS CODE IS PROVIDED ON AN  *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABILITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing
// permissions and limitations under the License.

using System.Collections.Generic;
using Newtonsoft.Json;

namespace Microsoft.PythonTools.Ipc.Json {
    public class Event {

        [JsonIgnore]
        public virtual string name => null;
    }

    public class GenericEvent : Event {
        public Dictionary<string, object> body;
    }
}


text:
// Override default jasmine TIMEOUT
jasmine.DEFAULT_TIMEOUT_INTERVAL = 120000;


text:
<?php

// Check to ensure this file is included in Joomla!
defined ( '_JEXEC' ) or die ( 'Restricted access' );

if (JRequest::getVar ( 'task' ) == null || JRequest::getVar ( 'task' ) == '') {
	$mainframes = JFactory::getApplication ();
	$mainframes->redirect ( JRoute::_ ( 'index.php?option=com_angelgirls&task=carregarMinhasSessoes&Itemid='.JRequest::getVar ( 'Itemid' ), false ), "" );
	exit ();
}

JFactory::getDocument()->addStyleSheet(JURI::base( true ).'/components/com_angelgirls/assets/css/jquery.dataTables.css?v='.VERSAO_ANGELGIRLS);
//JFactory::getDocument()->addStyleSheet(JURI::base( true ).'/components/com_angelgirls/assets/css/dataTables.foundation.css?v='.VERSAO_ANGELGIRLS);
//JFactory::getDocument()->addStyleSheet(JURI::base( true ).'/components/com_angelgirls/assets/css/dataTables.bootstrap.css?v='.VERSAO_ANGELGIRLS);
JFactory::getDocument()->addScript(JURI::base( true ).'/components/com_angelgirls/assets/js/jquery.dataTables.js?v='.VERSAO_ANGELGIRLS);
//JFactory::getDocument()->addScript(JURI::base( true ).'/components/com_angelgirls/assets/js/dataTables.foundation.js?v='.VERSAO_ANGELGIRLS);
//JFactory::getDocument()->addScript(JURI::base( true ).'/components/com_angelgirls/assets/js/dataTables.bootstrap.js?v='.VERSAO_ANGELGIRLS);
JFactory::getDocument()->addScript(JURI::base( true ).'/components/com_angelgirls/assets/js/aprovacao.js?v='.VERSAO_ANGELGIRLS);

$sessoes = JRequest::getVar('sessoes');
$modelos = JRequest::getVar('modelos');
$fotografos = JRequest::getVar('fotografos');

$nome = JRequest::getString('nome','');
$dataInicio = JRequest::getString('data_inicio','');
$dataFim = JRequest::getString('data_fim','');
$idModelo = JRequest::getInt('id_modelo',0);
$idFotografo = JRequest::getString('id_fotografo',0);
$ordem = JRequest::getString('ordem',0);
$perfil = JRequest::getVar('perfil');

if($dataInicio!=''){
	$dataInicio = DateTime::createFromFormat('d/m/Y', $dataInicio )->format('Y-m-d');
}
if($dataFim!=''){
	$dataFim = DateTime::createFromFormat('d/m/Y', $dataFim )->format('Y-m-d');
}

JFactory::getDocument()->addScriptDeclaration('

jQuery(document).ready(function() {
		setTimeout(function(){
		    jQuery("#tabelaComSessoes").DataTable({
				"lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "Todos"]],
				"language": {
		            "lengthMenu": "Exibir _MENU_ itens por página",
		            "zeroRecords": "Não encontrado - sorry",
		            "info": "Exibir pag. _PAGE_ de _PAGES_",
		            "infoEmpty": "Sem registros",
		            "infoFiltered": "(filtrado de _MAX_ total)",
					"search": "Busca"
		        },
				"aoColumns": [
		            null,
					null,
		            { "orderSequence": [ "desc", "asc" ] },
		            null,
		            { "orderSequence": [ "desc", "asc" ] },
		            null,
		            { "orderSequence": [ "desc", "asc" ] },
					{ "orderSequence": [ "desc", "asc" ] }
		        ]
			});

		},1000);
});
');

?>

<?php AngelgirlsController::GetMenuLateral(); ?>

Suas sessões permite editar e alterar

		<form action="index.php" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data" >
			<?php echo JHtml::_('form.token');?>
			<input type="hidden" name="task" id="task" value="carregarMinhasSessoes"/>
			<input type="hidden" name="view" id="option" value="sessoes"/>
			<input type="hidden" name="option" id="option" value="com_angelgirls"/>

			<input type="hidden" name="Itemid" id="Itemid" value="<?php echo(JRequest::getVar ( 'Itemid' ));?>"/>

				<?php if(isset($perfil)) : ?>

					<a href="<?php echo(JRoute::_('index.php?option=com_angelgirls&task=carregarEditarSessao'));?>" class="btn btn-success" type="button" id="novo"><?php echo JText::_('Nova'); ?>

				<?php endif;?>

					<button  class="btn btn-" type="button" id="limpar"><?php echo JText::_('Limpar Busca'); ?>

					</button>
					<button  class="btn btn-success" type="submit"><?php echo JText::_('Filtrar'); ?>

					</button>

Filtro

				<?php echo JText::_('Titulo'); ?>
				<input class="form-control" style="width: 90%;" type="text" name="nome"  id="nome" value="<?php echo($nome);?>" size="32" maxlength="150" placeholder="<?php echo JText::_('Buscar por titulo da sessão'); ?>"/>

				<?php echo JText::_('Apartir da data'); ?>
				<?php echo JHtml::calendar($dataInicio, 'data_inicio', 'data_inicio', '%d/%m/%Y', 'class="form-control validate-data validate-apartir"');?>

				<?php echo JText::_('Até a data'); ?>
				<?php echo JHtml::calendar($dataFim, 'data_fim', 'data_fim', '%d/%m/%Y', 'class="form-control validate-data validate-ate"');?>

				<?php echo JText::_('Com a modelo'); ?>
				<select name="id_modelo" id="id_modelo" class="form-control"/>
					<option></option>
					<?php foreach($modelos as $conteudo){
					$img =  JRoute::_('index.php?option=com_angelgirls&view=modelo&task=loadImage&id='.$conteudo->id.':ico');
					?>
					<option value="<?php echo($conteudo->id);?>" data-foto="<?php echo($img); ?>" title="<?php echo($conteudo->nome);?>"<?php echo($idModelo==$conteudo->id?" selected":"") ?>>
					<?php echo($conteudo->nome);?></option>
				    <?php
					}?>
				</select>

				<?php echo JText::_('Com a modelo'); ?>
				<select name="id_fotografo" id="id_fotografo" class="form-control"/>
					<option></option>
					<?php foreach($fotografos as $conteudo){
						$img =  JRoute::_('index.php?option=com_angelgirls&view=fotografo&task=loadImage&id='.$conteudo->id.':ico');
					?>
					<option value="<?php echo($conteudo->id);?>" data-foto="<?php echo($img); ?>" title="<?php echo($conteudo->nome);?>"<?php echo($idFotografo==$conteudo->id?" selected":"") ?>><?php echo($conteudo->nome);?></option>
				    <?php
					}?>
				</select>

Modelo selecionada

Fotografo selecionada

		</form>

Sessões

<?php
		require_once 'minhas_sessoes_html.php';
?>


text:
package gseproject.tests.unitTests;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import gseproject.passive.core.Floor;
import gseproject.passive.core.FloorException;

public abstract class FloorTest {
	protected Floor f;

	@Test
	public void iOccupyTest() {
		try {
			f.iOccupy();
		} catch (FloorException e) {
			e.printStackTrace();
		}
		assertTrue(f.isOccupied());
	}

	@Test
	public void iLeaveTest() {
		try {
			f.iOccupy();
			f.iLeave();
		} catch (FloorException e) {
			e.printStackTrace();
		}
		assertFalse(f.isOccupied());
	}
}


text:
/*
 *description:implement of screen echo or black,depend on timeout in input event or invoke screen_set;
 *    this file is inner file within miui_input.c ,so more api bind static property, but function screen_is_black
 *    and screen_set_black could be invoked by external module
 *author:dennise
 *email:yanhao@xiaomi.com
 */
//typedef long time_t
#include <errno.h>
#include "miui_screen.h"

static time_t time_orig;
//for further consideration, change time_interval in device.conf
static time_t time_interval;
static int bool_black = 0;
static pthread_mutex_t mutex_screen = PTHREAD_MUTEX_INITIALIZER;
//screen_ligt, [0-255] for config by device_config
static char screen_light_buf[4];

static int screen_set_time(time_t time)
{
    return_val_if_fail(time > 0, -1);
    miui_debug("set time %ld\n", time);
    time_orig = time;
    return 0;
}

int screen_set_brightness(char* brightness)
{
	pthread_mutex_lock(&mutex_screen);
	int fd = open(acfg()->brightness_path, O_WRONLY);
	if (fd <= 0)
	{
		miui_error("open %s failed!\n", acfg()->brightness_path);
	}
	else
	{
		if (write(fd, brightness, 1) <= 0)
		{
			miui_error("% write error %s", acfg()->brightness_path, strerror(errno));
		}
		close(fd);
	}
	pthread_mutex_unlock(&mutex_screen);
    return 0;
}

int screen_set_black(int black)
{
    pthread_mutex_lock(&mutex_screen);
    int fd = open(acfg()->brightness_path, O_WRONLY);
    if (fd <= 0)
    {
        miui_error("open %s failed!\n", acfg()->brightness_path);
    }
    else
    {
        bool_black = black;
        if (bool_black)
        {
            if (write(fd,"0", 1) <= 0)
            {
                miui_error("%s write error %s", acfg()->brightness_path, strerror(errno));
            }
        }
        else
        {
            miui_debug("screen_light_buf is %s\n", screen_light_buf);
            if (write(fd,screen_light_buf,strlen(screen_light_buf)) <= 0)
            {
                miui_error("%s write error %s", acfg()->brightness_path, strerror(errno));
            }

        }
        close(fd);
    }
    pthread_mutex_unlock(&mutex_screen);
    return 0;
}
int screen_is_black()
{
    return bool_black;
}
int screen_set_light(int light)
{
    return_val_if_fail(light > 10, -1);
    return_val_if_fail(light <= 255, -1);
    return_val_if_fail(0 <= snprintf(screen_light_buf,sizeof(screen_light_buf), "%d", light), -1);
    return 0;
}

int screen_set_interval(int interval)
{
    return_val_if_fail(interval > 0, -1);
    time_interval = interval;
    return 0;
}
static void *screen_black_thread(void *cookie)
{
    while(1)
    {
        if (difftime(time((time_t *)NULL), time_orig) > time_interval)
        {
            if (0 == bool_black)
                screen_set_black(1);
        }
        else if (0 != bool_black)
        {
            screen_set_black(0);
        }
        sleep(1);

    }
    return NULL;
}
static pthread_t screen_thread_t;
static int screen_init()
{
    //default interval 120 seconds
    time_interval = 120;
    screen_set_light(60);
    screen_set_time(time((time_t*)NULL));
    screen_set_black(0);

    pthread_create(&screen_thread_t, NULL, screen_black_thread, NULL);
    pthread_detach(screen_thread_t);
    return 0;
}


text:
<project
	xmlns="http://maven.apache.org/POM/4.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>org.mybatis.plugin</groupId>
	<artifactId>mybatis-pager</artifactId>
	<version>1.0-SNAPSHOT</version>
	<name>mybatis pager</name>
	<description>Mybatis Physical paging plugin (Executor or StatementHandler)</description>

	<issueManagement>
		<url>https://github.com/GitHanter/mybatis-pager/issues</url>
		<system>GitHub Issues</system>
	</issueManagement>

	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<scm>
		<connection>scm:git:git@github.com:GitHanter/mybatis-pager.git</connection>
		<developerConnection>scm:git:git@github.com:GitHanter/mybatis-pager.git</developerConnection>
		<url>git@github.com:GitHanter/mybatis-pager.git</url>
	</scm>

	<distributionManagement>
		<repository>
			<id>nexus-releases</id>
			<name>Nexus Release Repository</name>
			<uniqueVersion>false</uniqueVersion>
			<url>http://localhost:8081/nexus/content/repositories/releases/</url>
		</repository>
		<snapshotRepository>
			<id>nexus-snapshots</id>
			<name>Nexus Snapshot Repository</name>
			<uniqueVersion>false</uniqueVersion>
			<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
		</snapshotRepository>
	</distributionManagement>

	<developers>
		<developer>
			<id>john</id>
			<name>Yanjing Han</name>
			<email>han.yanjingyy@gmail.com</email>
			<url>https://github.com/GitHanter</url>
		</developer>
	</developers>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
		<slf4j.version>1.7.12</slf4j.version>
		<org.mybatis.version>3.3.0</org.mybatis.version>
		<logback.version>1.1.3</logback.version>
		<jackson.version>2.6.2</jackson.version>
		<servlet.version>2.5</servlet.version>
	</properties>
	<dependencies>
		<dependency>
		    <groupId>javax.servlet.jsp</groupId>
		    <artifactId>jsp-api</artifactId>
		    <version>2.2</version>
		    <scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.36</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mybatis</groupId>
			<artifactId>mybatis</artifactId>
			<version>${org.mybatis.version}</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>${logback.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>commons-beanutils</groupId>
			<artifactId>commons-beanutils</artifactId>
			<version>1.9.2</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
			<version>${jackson.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>${jackson.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>${servlet.version}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</version>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>2.4</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<phase>deploy</phase>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<keyname>${gpg.keyname}</keyname>
									<passphraseServerId>${gpg.keyname}</passphraseServerId>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>Jrebel</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.zeroturnaround</groupId>
						<artifactId>jrebel-maven-plugin</artifactId>
						<version>1.1.5</version>
						<executions>
							<execution>
								<id>generate-rebel-xml</id>
								<phase>process-resources</phase>
								<goals>
									<goal>generate</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
N. Z. Jl Bot. 15(4): 723 (1978)

#### Original name
Inocybe phaeosquarrosa E. Horak, 1978

### Remarks
null


text:
module Scratchpad

end

require 'scratchpad/common/crypto.rb'
require 'scratchpad/common/disk_helper.rb'
require 'scratchpad/common/hash_tree.rb'
require 'scratchpad/common/hash_tree_cache.rb'
require 'scratchpad/common/hash_tree_cache_driver.rb'
require 'scratchpad/common/hash_tree_on_disk.rb'
require 'scratchpad/ethernet/ping.rb'
require 'scratchpad/ethernet/raw_ethernet.rb'
require 'scratchpad/fpga/provision.rb'
require 'scratchpad/models/client.rb'
require 'scratchpad/models/disk.rb'
require 'scratchpad/models/fpga.rb'
require 'scratchpad/models/manufacturer.rb'
require 'scratchpad/models/server.rb'
require 'scratchpad/models/smartcard.rb'
require 'scratchpad/protocols/fpga_client.rb'
require 'scratchpad/protocols/server_client.rb'
require 'scratchpad/protocols/server.rb'


text:
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.android_webview.test;

import static org.chromium.android_webview.test.AwActivityTestRule.WAIT_TIMEOUT_MS;

import android.support.test.InstrumentationRegistry;
import android.support.test.filters.MediumTest;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import org.chromium.android_webview.test.util.JSUtils;
import org.chromium.android_webview.test.util.JavascriptEventObserver;
import org.chromium.base.test.util.DisabledTest;
import org.chromium.base.test.util.Feature;
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.browser.test.util.CriteriaHelper;
import org.chromium.content_public.browser.test.util.DOMUtils;
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.content_public.browser.test.util.TouchCommon;
import org.chromium.url.GURL;

import java.util.concurrent.TimeoutException;

/**
 * Test the fullscreen API (WebChromeClient::onShow/HideCustomView).
 *
 * <p>Fullscreen support follows a different code path depending on whether
 * the element is a video or not, so we test we both. For non-video elements
 * we pick a div containing a video and custom html controls since this is a
 * very common use case.
 */
@RunWith(AwJUnit4ClassRunner.class)
public class AwContentsClientFullScreenTest {
    @Rule
    public AwActivityTestRule mActivityTestRule = new AwActivityTestRule();

    private static final String VIDEO_TEST_URL =
            "file:///android_asset/full_screen_video_test.html";
    private static final String VIDEO_INSIDE_DIV_TEST_URL =
            "file:///android_asset/full_screen_video_inside_div_test.html";

    // These values must be kept in sync with the strings in
    // full_screen_video_test.html, full_screen_video_inside_div_test.html and
    // full_screen_video.js.
    private static final String VIDEO_ID = "video";
    private static final String CUSTOM_PLAY_CONTROL_ID = "playControl";
    private static final String CUSTOM_FULLSCREEN_CONTROL_ID = "fullscreenControl";
    private static final String FULLSCREEN_ERROR_OBSERVER = "javaFullScreenErrorObserver";

    private FullScreenVideoTestAwContentsClient mContentsClient;
    private AwTestContainerView mTestContainerView;

    @Before
    public void setUp() {
        mContentsClient = new FullScreenVideoTestAwContentsClient(
                mActivityTestRule.getActivity(), mActivityTestRule.isHardwareAcceleratedTest());
        mTestContainerView = mActivityTestRule.createAwTestContainerViewOnMainSync(mContentsClient);
        AwActivityTestRule.enableJavaScriptOnUiThread(mTestContainerView.getAwContents());
        mTestContainerView.getAwContents().getSettings().setFullscreenSupported(true);
    }

    @MediumTest
    @Feature({"AndroidWebView"})
    @DisableHardwareAccelerationForTest
    @Test
    @DisabledTest(message = "crbug.com/618749") // turning this on as an experiment.
    public void testFullscreenVideoInSoftwareModeDoesNotDeadlock() throws Throwable {
        // Although fullscreen video is not supported without hardware acceleration
        // we should not deadlock if apps try to use it.
        loadTestPageAndClickFullscreen(VIDEO_TEST_URL);
        mContentsClient.waitForCustomViewShown();
        InstrumentationRegistry.getInstrumentation().runOnMainSync(
                () -> mContentsClient.getExitCallback().onCustomViewHidden());
        mContentsClient.waitForCustomViewHidden();
    }

    @MediumTest
    @Feature({"AndroidWebView"})
    @DisableHardwareAccelerationForTest
    @Test
    public void testFullscreenForNonVideoElementIsSupportedInSoftwareMode() throws Throwable {
        // Fullscreen for non-video elements is supported and works as expected. Note that
        // this test is the same as testOnShowAndHideCustomViewWithCallback_videoInsideDiv below.
        doTestOnShowAndHideCustomViewWithCallback(VIDEO_INSIDE_DIV_TEST_URL);
    }

    @MediumTest
    @Feature({"AndroidWebView"})
    @Test
    @DisabledTest(message = "crbug.com/618749")
    public void testOnShowAndHideCustomViewWithCallback_video() throws Throwable {
        doTestOnShowAndHideCustomViewWithCallback(VIDEO_TEST_URL);
    }

    @MediumTest
    @Feature({"AndroidWebView"})
    @Test
    @DisabledTest(message = "crbug.com/618749")
    public void testOnShowAndHideCustomViewWithCallback_videoInsideDiv() throws Throwable {
        doTestOnShowAndHideCustomViewWithCallback(VIDEO_INSIDE_DIV_TEST_URL);
    }

    public void doTestOnShowAndHideCustomViewWithCallback(String videoTestUrl) throws Throwable {
        doOnShowAndHideCustomViewTest(videoTestUrl,
                () -> mContentsClient.getExitCallback().onCustomViewHidden());
    }

    @MediumTest
    @Feature({"AndroidWebView"})
    @Test
    @DisabledTest(message = "crbug.com/618749")
    public void testOnShowAndHideCustomViewWithJavascript_video() throws Throwable {
        doTestOnShowAndHideCustomViewWithJavascript(VIDEO_TEST_URL);
    }

    @MediumTest
    @Feature({"AndroidWebView"})
    @Test
    @DisabledTest(message = "crbug.com/618749")
    public void testOnShowAndHideCustomViewWithJavascript_videoInsideDiv() throws Throwable {
        doTestOnShowAndHideCustomViewWithJavascript(VIDEO_INSIDE_DIV_TEST_URL);
    }

    public void doTestOnShowAndHideCustomViewWithJavascript(String videoTestUrl) throws Throwable {
        doOnShowAndHideCustomViewTest(
                videoTestUrl, () -> DOMUtils.exitFullscreen(mTestContainerView.getWebContents()));
    }

    @MediumTest
    @Feature({"AndroidWebView"})
    @Test
    // Originally flaked only in multi-process mode (http://crbug.com/616501)
    @DisabledTest(message = "crbug.com/618749")
    public void testOnShowAndHideCustomViewWithBackKey_video() throws Throwable {
        doTestOnShowAndHideCustomViewWithBackKey(VIDEO_TEST_URL);
    }

    @MediumTest
    @Feature({"AndroidWebView"})
    @Test
    @DisabledTest(message = "crbug.com/618749")
    public void testOnShowAndHideCustomViewWithBackKey_videoInsideDiv() throws Throwable {
        doTestOnShowAndHideCustomViewWithBackKey(VIDEO_INSIDE_DIV_TEST_URL);
    }

    public void doTestOnShowAndHideCustomViewWithBackKey(String videoTestUrl) throws Throwable {
        doOnShowCustomViewTest(videoTestUrl);

        // The key event should not be propagated to mTestContainerView (the original container
        // view).
        mTestContainerView.setOnKeyListener((v, keyCode, event) -> {
            Assert.fail("mTestContainerView received key event");
            return false;
        });

        InstrumentationRegistry.getInstrumentation().sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
        mContentsClient.waitForCustomViewHidden();
        Assert.assertFalse(mContentsClient.wasOnUnhandledKeyUpEventCalled());
        assertWaitForIsEmbedded();
    }

    @Test
    @MediumTest
    @Feature({"AndroidWebView"})
    public void testExitFullscreenEndsIfAppInvokesCallbackFromOnHideCustomView() throws Throwable {
        mContentsClient.setOnHideCustomViewRunnable(
                () -> mContentsClient.getExitCallback().onCustomViewHidden());
        doTestOnShowAndHideCustomViewWithCallback(VIDEO_TEST_URL);
    }

    @Test
    @MediumTest
    @Feature({"AndroidWebView"})
    public void testOnShowCustomViewAndPlayWithHtmlControl_video() throws Throwable {
        doTestOnShowCustomViewAndPlayWithHtmlControl(VIDEO_TEST_URL);
    }

    @Test
    @MediumTest
    @Feature({"AndroidWebView"})
    public void testOnShowCustomViewAndPlayWithHtmlControl_videoInsideDiv() throws Throwable {
        doTestOnShowCustomViewAndPlayWithHtmlControl(VIDEO_INSIDE_DIV_TEST_URL);
    }

    public void doTestOnShowCustomViewAndPlayWithHtmlControl(String videoTestUrl) throws Throwable {
        doOnShowCustomViewTest(videoTestUrl);
        Assert.assertTrue(DOMUtils.isMediaPaused(getWebContentsOnUiThread(), VIDEO_ID));

        playVideo();
        DOMUtils.waitForMediaPlay(getWebContentsOnUiThread(), VIDEO_ID);
    }

    @Test
    @MediumTest
    @Feature({"AndroidWebView"})
    public void testFullscreenNotSupported_video() throws Throwable {
        doTestFullscreenNotSupported(VIDEO_TEST_URL);
    }

    @Test
    @MediumTest
    @Feature({"AndroidWebView"})
    public void testFullscreenNotSupported_videoInsideDiv() throws Throwable {
        doTestFullscreenNotSupported(VIDEO_INSIDE_DIV_TEST_URL);
    }

    public void doTestFullscreenNotSupported(String videoTestUrl) throws Throwable {
        mTestContainerView.getAwContents().getSettings().setFullscreenSupported(false);
        final JavascriptEventObserver fullscreenErrorObserver = registerObserver(
                FULLSCREEN_ERROR_OBSERVER);

        loadTestPageAndClickFullscreen(videoTestUrl);

        Assert.assertTrue(fullscreenErrorObserver.waitForEvent(WAIT_TIMEOUT_MS));
        Assert.assertFalse(mContentsClient.wasCustomViewShownCalled());
    }

    @Test
    @MediumTest
    @Feature({"AndroidWebView"})
    public void testPowerSaveBlockerIsEnabledDuringFullscreenPlayback_video() throws Throwable {
        doTestPowerSaveBlockerIsEnabledDuringFullscreenPlayback(VIDEO_TEST_URL);
    }

    @Test
    @MediumTest
    @Feature({"AndroidWebView"})
    public void testPowerSaveBlockerIsEnabledDuringFullscreenPlayback_videoInsideDiv()
            throws Throwable {
        doTestPowerSaveBlockerIsEnabledDuringFullscreenPlayback(VIDEO_INSIDE_DIV_TEST_URL);
    }

    public void doTestPowerSaveBlockerIsEnabledDuringFullscreenPlayback(String videoTestUrl)
            throws Throwable {
        // Enter fullscreen.
        doOnShowCustomViewTest(videoTestUrl);
        View customView = mContentsClient.getCustomView();

        // No power save blocker is active before playback starts.
        assertKeepScreenOnActive(customView, false);

        // Play and verify that there is an active power save blocker.
        playVideo();
        assertWaitForKeepScreenOnActive(customView, true);

        // Stop the video and verify that the power save blocker is gone.
        DOMUtils.pauseMedia(getWebContentsOnUiThread(), VIDEO_ID);
        assertWaitForKeepScreenOnActive(customView, false);
    }

    @Test
    @MediumTest
    @Feature({"AndroidWebView"})
    public void testPowerSaveBlockerIsEnabledDuringEmbeddedPlayback() throws Throwable {
        Assert.assertFalse(DOMUtils.isFullscreen(getWebContentsOnUiThread()));
        loadTestPage(VIDEO_INSIDE_DIV_TEST_URL);

        // No power save blocker is active before playback starts.
        assertKeepScreenOnActive(mTestContainerView, false);

        // Play and verify that there is an active power save blocker.
        playVideoOnEmbedderView();
        assertWaitForKeepScreenOnActive(mTestContainerView, true);

        // Stop the video and verify that the power save blocker is gone.
        DOMUtils.pauseMedia(getWebContentsOnUiThread(), VIDEO_ID);
        assertWaitForKeepScreenOnActive(mTestContainerView, false);
    }

    @MediumTest
    @Feature({"AndroidWebView"})
    @Test
    public void testPowerSaveBlockerIsTransferredToFullscreen() throws Throwable {
        Assert.assertFalse(DOMUtils.isFullscreen(getWebContentsOnUiThread()));
        loadTestPage(VIDEO_INSIDE_DIV_TEST_URL);

        // Play and verify that there is an active power save blocker.
        playVideoOnEmbedderView();
        assertWaitForKeepScreenOnActive(mTestContainerView, true);

        // Enter fullscreen and verify that the power save blocker is
        // still there.
        JSUtils.clickNodeWithUserGesture(
                mTestContainerView.getWebContents(), CUSTOM_FULLSCREEN_CONTROL_ID);
        mContentsClient.waitForCustomViewShown();
        assertKeepScreenOnActive(mTestContainerView, true);

        // Pause the video and the power save blocker is gone.
        DOMUtils.pauseMedia(getWebContentsOnUiThread(), VIDEO_ID);
        assertWaitForKeepScreenOnActive(mTestContainerView, false);

        // Exit fullscreen and the power save blocker is still gone.
        DOMUtils.exitFullscreen(getWebContentsOnUiThread());
        mContentsClient.waitForCustomViewHidden();
        assertKeepScreenOnActive(mTestContainerView, false);
    }

    @Test
    @MediumTest
    @Feature({"AndroidWebView"})
    public void testPowerSaveBlockerIsTransferredToEmbedded() throws Throwable {
        // Enter fullscreen.
        doOnShowCustomViewTest(VIDEO_INSIDE_DIV_TEST_URL);
        View customView = mContentsClient.getCustomView();

        // Play and verify that there is an active power save blocker
        // in fullscreen.
        playVideoOnEmbedderView();
        assertWaitForKeepScreenOnActive(customView, true);

        // Exit fullscreen and verify that the power save blocker is
        // still there.
        DOMUtils.exitFullscreen(getWebContentsOnUiThread());
        mContentsClient.waitForCustomViewHidden();
        assertKeepScreenOnActive(customView, true);
    }

    private boolean shouldPlayOnFullScreenView() throws Exception {
        GURL testUrl = mTestContainerView.getAwContents().getUrl();
        return new GURL(VIDEO_TEST_URL).equals(testUrl)
                && DOMUtils.isFullscreen(getWebContentsOnUiThread());
    }

    private void playVideo() throws Exception {
        if (shouldPlayOnFullScreenView()) {
            playVideoOnFullScreenView();
        } else {
            playVideoOnEmbedderView();
        }
    }

    private void playVideoOnEmbedderView() throws Exception {
        Assert.assertFalse(shouldPlayOnFullScreenView());
        waitUntilHaveEnoughDataForPlay();
        JSUtils.clickNodeWithUserGesture(
                mTestContainerView.getWebContents(), CUSTOM_PLAY_CONTROL_ID);
    }

    private void waitUntilHaveEnoughDataForPlay() {
        // crbug.com/936757: you are expected to wait before media playback is ready.
        CriteriaHelper.pollInstrumentationThread(() -> {
            try {
                // Checking HTMLMediaElement.readyState == 4 (HAVE_ENOUGH_DATA).
                int readyState = DOMUtils.getNodeField(
                        "readyState", getWebContentsOnUiThread(), VIDEO_ID, Integer.class);
                Assert.assertEquals(4, readyState);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        });
    }

    private void playVideoOnFullScreenView() throws Exception {
        Assert.assertTrue(shouldPlayOnFullScreenView());
        waitUntilHaveEnoughDataForPlay();
        // JSUtils.clickNodeWithUserGesture(getWebContentsOnUiThread(), nodeId);
        // The VIDEO_TEST_URL page goes fullscreen on the <video> element. In fullscreen
        // the button with id CUSTOM_PLAY_CONTROL_ID will not be visible, but the standard
        // html5 video controls are. The standard html5 controls are shadow html elements
        // without any ids so it is difficult to retrieve its precise location. However,
        // a large play control is rendered in the center of the custom view
        // (containing the fullscreen <video>) so we just rely on that fact here.
        TouchCommon.singleClickView(mContentsClient.getCustomView());
    }

    /**
     * Asserts that the keep screen on property in the given {@code view} is active as
     * {@code expected}. It also verifies that it is only active when the video is playing.
     */
    private void assertWaitForKeepScreenOnActive(final View view, final boolean expected) {
        // We need to poll because it takes time to synchronize the state between the android
        // views and Javascript.
        CriteriaHelper.pollInstrumentationThread(() -> {
            try {
                Assert.assertEquals(expected, getKeepScreenOnOnInstrumentationThread(view));
                Assert.assertNotEquals(
                        expected, DOMUtils.isMediaPaused(getWebContentsOnUiThread(), VIDEO_ID));
            } catch (TimeoutException e) {
                Assert.fail(e.getMessage());
            }
        });
    }

    private void assertKeepScreenOnActive(final View view, final boolean expectKeepScreenOn)
            throws Exception {
        Assert.assertEquals(expectKeepScreenOn, getKeepScreenOnOnInstrumentationThread(view));

        // Note: we're currently checking this after the above assertion to ensure that the timing
        // of failure is as close to the assertEquals check below.
        boolean ended = DOMUtils.isMediaEnded(getWebContentsOnUiThread(), VIDEO_ID);
        // If this fails, consider increasing the media length.
        Assert.assertFalse("Media playback should not end too early to test this.", ended);

        boolean expectPaused = !expectKeepScreenOn;
        boolean paused = DOMUtils.isMediaPaused(getWebContentsOnUiThread(), VIDEO_ID);
        Assert.assertEquals(
                "The playback should be paused/not paused as expected.", expectPaused, paused);
    }

    private boolean getKeepScreenOnOnInstrumentationThread(final View view) {
        try {
            return TestThreadUtils.runOnUiThreadBlocking(() -> getKeepScreenOnOnUiThread(view));
        } catch (Exception e) {
            Assert.fail(e.getMessage());
            return false;
        }
    }

    private boolean getKeepScreenOnOnUiThread(View view) {
        // The power save blocker is added to the container view.
        // Search the view hierarchy for it.
        if (view instanceof ViewGroup) {
            ViewGroup viewGroup = (ViewGroup) view;
            for (int i = 0; i < viewGroup.getChildCount(); i++) {
                if (getKeepScreenOnOnUiThread(viewGroup.getChildAt(i))) {
                    return true;
                }
            }
        }
        return view.getKeepScreenOn();
    }

    private void assertWaitForIsFullscreen() {
        // We need to poll because the Javascript state is updated asynchronously
        CriteriaHelper.pollInstrumentationThread(() -> {
            try {
                Assert.assertTrue(DOMUtils.isFullscreen(getWebContentsOnUiThread()));
            } catch (TimeoutException e) {
                Assert.fail(e.getMessage());
            }
        });
    }

    private void assertWaitForIsEmbedded() {
        // We need to poll because the Javascript state is updated asynchronously
        CriteriaHelper.pollInstrumentationThread(() -> {
            try {
                Assert.assertFalse(DOMUtils.isFullscreen(getWebContentsOnUiThread()));
            } catch (TimeoutException e) {
                Assert.fail(e.getMessage());
            }
        });
        // TODO: Test that inline video is actually displayed.
    }

    private JavascriptEventObserver registerObserver(final String observerName) {
        final JavascriptEventObserver observer = new JavascriptEventObserver();
        InstrumentationRegistry.getInstrumentation().runOnMainSync(
                () -> observer.register(mTestContainerView.getWebContents(), observerName));
        return observer;
    }

    private void doOnShowAndHideCustomViewTest(String videoTestUrl, final Runnable existFullscreen)
            throws Throwable {
        doOnShowCustomViewTest(videoTestUrl);
        InstrumentationRegistry.getInstrumentation().runOnMainSync(existFullscreen);
        mContentsClient.waitForCustomViewHidden();
        assertWaitForIsEmbedded();
    }

    private void doOnShowCustomViewTest(String videoTestUrl) throws Exception {
        loadTestPageAndClickFullscreen(videoTestUrl);
        mContentsClient.waitForCustomViewShown();
        assertWaitForIsFullscreen();
    }

    private void loadTestPageAndClickFullscreen(String videoTestUrl) throws Exception {
        loadTestPage(videoTestUrl);
        JSUtils.clickNodeWithUserGesture(
                mTestContainerView.getWebContents(), CUSTOM_FULLSCREEN_CONTROL_ID);
    }

    private void loadTestPage(String videoTestUrl) throws Exception {
        mActivityTestRule.loadUrlSync(mTestContainerView.getAwContents(),
                mContentsClient.getOnPageFinishedHelper(), videoTestUrl);
        // As we are loading a non-trivial page, let's wait until we have something displayed.
        mActivityTestRule.waitForVisualStateCallback(mTestContainerView.getAwContents());
    }

    private WebContents getWebContentsOnUiThread() {
        try {
            return TestThreadUtils.runOnUiThreadBlocking(() -> mTestContainerView.getWebContents());
        } catch (Exception e) {
            Assert.fail(e.getMessage());
            return null;
        }
    }
}


text:
<?php
/*************************************************************************************************/
/* The class handles everything connected with the administrator's account - logging in and out, */
/* creating and destroying sessions, verifying the current session for safety reasons.           */
/*************************************************************************************************/

require_once('db.class.php');

class AdminAccount {

  public $db;

  /* Connects to the database */
  public function AdminAccount() {

    $this->db = Db::getInstance();

  }

  /* Creates an administration account session after successful login */
  private function createSession() {

    /* First, we need to get some info */
    $ip = $_SERVER["REMOTE_ADDR"];
    $time = time();
    $random_num = mt_rand();

    /* Insert the data about this session into the database */
    $this->db->query("INSERT INTO confy_admin_sessions (id, ip, time, random_num)
                      VALUES ('', '" . $ip . "', '" . $time . "', '" . $random_num . "')");

    session_start();

    /* Save the exact same data to the SESSION variable */
    $_SESSION['admin_logged'] = true;
    $_SESSION['admin_ip'] = $ip;
    $_SESSION['admin_time'] = $time;
    $_SESSION['admin_random_num'] = $random_num;

    /* No conference is selected yet */
    $_SESSION['admin_conference_selected'] = false;

  }

  /* Destroys the actual session */
  private function destroySession() {

    session_start();

    unset($_SESSION['admin_logged']);
    unset($_SESSION['admin_ip']);
    unset($_SESSION['admin_time']);
    unset($_SESSION['admin_random_num']);
    unset($_SESSION['admin_conference_selected']);

  }

  /* Authenticates the actual session by comparing the data in the SESSION variable with the data in the database.
     If any of the info is missing or has been changed, we're propably dealing with an unauthorized access. */
  private function authSession() {

    session_start();

    /* Try to get the exact same data from the sessions log in the database */
    $query = $this->db->query("SELECT id FROM confy_admin_sessions
                               WHERE ip = '" . $_SESSION['admin_ip'] . "' AND
                                     time = '" . $_SESSION['admin_time'] . "' AND
                                     random_num = '" . $_SESSION['admin_random_num'] . "'");

    /* If we got exactly one result, access is authorized */
    if (mysqli_num_rows($query) == 1) {
      return true;
    } else {
      return false;
    }

  }

  /* Verifies validity of administrator's password */
  public function verifyPassword($password) {

    /* Lets verify the password */
    $query = $this->db->query("SELECT value FROM confy_admin_settings WHERE setting='admin_password'");
    $login_data = mysqli_fetch_array($query);

    /* Check if the password is correct */
    if ($login_data["value"] == MD5($password)) {
      return true;
    } else {
      return false;
    }

  }

  /* Sets a new administrator's password. */
  public function changePassword($password) {

    /* Save the password to the database, MD5 encoded */
    $this->db->query("UPDATE confy_admin_settings
                      SET value = '" . md5($password) . "'
                      WHERE setting='admin_password'");

  }

  /* Tries to log in the administrator */
  public function logIn($password) {

    /* If the password is correct, log in the administrator by creating new session */
    if ($this->verifyPassword($password)) {
      $this->createSession();
      return true;
    } else {
      return false;
    }

  }

  /* Logs out the administrator */
  public function logOut() {

    $this->destroySession();

  }

  /* Checks if the administrator is correctly logged in */
  public function isLogged() {

    return $this->authSession();

  }

  /* Sets currently selected conference to SESSION variable */
  public function setCurrentConference($url) {

    session_start();
    $_SESSION['admin_conference_selected'] = $url;

  }

  /* Returns currently selected conference */
  public function getCurrentConference() {

    session_start();
    return $_SESSION['admin_conference_selected'];

  }

  /* Returns the actual URL address of currenly selected conference */
  public function getConferenceURL() {

    $systemURL = substr(currentURL(), 0, strpos(currentURL(), 'admin/'));
    return $systemURL . $this->getCurrentConference();

  }

}

?>


text:
require "polymorphic_attachments/version"
require "polymorphic_attachments/engine"
require "polymorphic_attachments/configration"

require "generators/polymorphic_attachments/install_generator"

require 'simple_form'
require 'carrierwave'
require 'mini_magick'
require 'jquery-fileupload-rails'

module PolymorphicAttachments

  NAME = 'polymorphic attachments'
  GEM  = 'polymorphic_attachments'
  class << self
    def config
      return @config if defined?(@config)
      @config = Configuration.new
      @config.limit_number = 3
      @config
    end

    def configure(&block)
      config.instance_exec(&block)
    end

  end

end


text:
// Midas Server. Copyright Kitware SAS. Licensed under the Apache License 2.0.

/* global json */

var midas = midas || {};
var jsonShare = $.parseJSON($('div.jsonShareContent').html());

$('a#setElementPublicLink').click(function () {
    'use strict';
    $.post(json.global.webroot + '/share/dialog', {
        setPublic: true,
        type: jsonShare.type,
        element: jsonShare.element
    },
        function (data) {
            var jsonResponse = $.parseJSON(data);
            if (jsonResponse[0]) {
                midas.createNotice(jsonResponse[1], 1500);
                $('div#elementDirectLink').show();
                $('div#permissionPublic').show();
                $('div#permissionPrivate').hide();
            }
            else {
                midas.createNotice(jsonResponse[1], 4000, 'error');
            }
        }
    );
});

$('a.removeShareLink').click(function () {
    'use strict';
    var removeType = $(this).parents('tr').attr('type');
    var removeId = $(this).parents('tr').attr('element');
    var obj = $(this).parents('tr');
    $.post(json.global.webroot + '/share/dialog', {
        removePolicy: true,
        removeType: removeType,
        removeId: removeId,
        type: jsonShare.type,
        element: jsonShare.element
    },
        function (data) {
            var jsonResponse = $.parseJSON(data);
            if (jsonResponse[0]) {
                midas.createNotice(jsonResponse[1], 1500);
                obj.remove();
            }
            else {
                midas.createNotice(jsonResponse[1], 4000, 'error');
            }
        }
    );
});

$('select.changePermissionSelect').change(function () {
    'use strict';
    var changeType = $(this).parents('tr').attr('type');
    var changeId = $(this).parents('tr').attr('element');
    var changeVal = $(this).val();
    var obj = $(this).parents('tr');
    $.post(json.global.webroot + '/share/dialog', {
        changePolicy: true,
        changeVal: changeVal,
        changeType: changeType,
        changeId: changeId,
        type: jsonShare.type,
        element: jsonShare.element
    },
        function (data) {
            var jsonResponse = $.parseJSON(data);
            if (jsonResponse[0]) {
                midas.createNotice(jsonResponse[1], 1500);
            }
            else {
                midas.createNotice(jsonResponse[1], 4000);
            }
        }
    );
});

$('a#setElementPrivateLink').click(function () {
    'use strict';
    $.post(json.global.webroot + '/share/dialog', {
        setPrivate: true,
        type: jsonShare.type,
        element: jsonShare.element
    },
        function (data) {
            var jsonResponse = $.parseJSON(data);
            if (jsonResponse[0]) {
                midas.createNotice(jsonResponse[1], 1500);
                $('div#elementDirectLink').hide();
                $('div#permissionPublic').hide();
                $('div#permissionPrivate').show();
            }
            else {
                midas.createNotice(jsonResponse[1], 4000, 'error');
            }
        }
    );
});

// Live search
$.widget('custom.catcomplete', $.ui.autocomplete, {
    _renderMenu: function (ul, items) {
        'use strict';
        var self = this,
            currentCategory = '';
        $.each(items, function (index, item) {
            if (item.category != currentCategory) {
                ul.append('
' + item.category + '
');
                currentCategory = item.category;
            }
            self._renderItemData(ul, item);
        });
    }
});

var shareSearchcache = {},
    lastShareXhr;
var itemShareSelected;
$('#live_share_search').catcomplete({
    minLength: 2,
    delay: 10,
    source: function (request, response) {
        'use strict';
        var term = request.term;
        if (term in shareSearchcache) {
            response(shareSearchcache[term]);
            return;
        }

        $('#searchShareLoading').show();

        lastShareXhr = $.getJSON($('.webroot').val() + '/search/live?shareSearch=true', request,
            function (data, status, xhr) {
                $('#searchShareLoading').hide();
                shareSearchcache[term] = data;
                if (xhr === lastShareXhr) {
                    itemShareSelected = false;
                    response(data);
                }
            });
    }, // end source
    select: function (event, ui) {
        'use strict';
        var newPolicyType;
        var newPolicyId;
        if (ui.item.communityid) { // if we have a community
            newPolicyType = 'community';
            newPolicyId = ui.item.communityid;
        }
        else if (ui.item.groupid) { // if we have a folder
            newPolicyType = 'group';
            newPolicyId = ui.item.groupid;
        }
        else if (ui.item.userid) { // if we have a user
            newPolicyType = 'user';
            newPolicyId = ui.item.userid;
        }
        else {
            return;
        }
        $.post(json.global.webroot + '/share/dialog', {
            createPolicy: true,
            newPolicyType: newPolicyType,
            newPolicyId: newPolicyId,
            type: jsonShare.type,
            element: jsonShare.element
        },
            function (data) {
                var jsonResponse = $.parseJSON(data);
                if (jsonResponse[0]) {
                    midas.createNotice(jsonResponse[1], 1500);
                    midas.loadDialog('sharing' + $(this).attr('type') + $(this).attr('element') + newPolicyId, '/share/dialog?type=' + encodeURIComponent(jsonShare.type) + '&element=' + encodeURIComponent(jsonShare.element));
                    midas.showDialog(json.browse.share);
                }
                else {
                    midas.createNotice(jsonResponse[1], 4000, 'error');
                }
            }
        );
        itemShareSelected = true;
    }
});

$('#live_share_search').focus(function () {
    'use strict';
    if ($('#live_share_search_value').val() == 'init') {
        $('#live_share_search_value').val($('#live_share_search').val());
        $('#live_share_search').val('');
    }
});

$('#live_share_search').focusout(function () {
    'use strict';
    if ($('#live_share_search').val() == '') {
        $('#live_share_search').val($('#live_share_search_value').val());
        $('#live_share_search_value').val('init');
    }
});
// end live search

$('input.permissionsDone').click(function () {
    'use strict';
    $('div.MainDialog').dialog('close');
    if (jsonShare.type == 'folder') {
        midas.loadDialog('applyRecursive' + jsonShare.element, '/share/applyrecursivedialog?folderId=' + encodeURIComponent(jsonShare.element));
        midas.showDialog(json.browse.share);
    }
});


text:
<?php
/**
 * User: BrandonXu
 * Date: 2017/9/2
 * Time: 20:28
 */

namespace source\core\rest;

use yii;

/**
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since 2.0
 */
class ViewAction extends yii\rest\ViewAction
{

    public $prepareDataProvider;

    /**
     * Displays a model.
     * @param string $id the primary key of the model.
     * @return \yii\db\ActiveRecordInterface the model being displayed
     */
    public function run($id) {
        $model = $this->findModel($id);
        if ($this->checkAccess) {
            call_user_func($this->checkAccess, $this->id, $model);
        }

        if ($this->prepareDataProvider !== NULL) {
            return call_user_func($this->prepareDataProvider, $id);
        }

        return $model;
    }

}


text:
package config

import (
	"github.com/spf13/cobra"
)

var AddonsCmd = &cobra.Command{
	Use:   "addons SUBCOMMAND [flags]",
	Short: "Modify minikube's kubernetes addons",
	Long:  `addons modifies minikube addons files using subcommands like "minikube addons enable heapster"`,
	Run: func(cmd *cobra.Command, args []string) {
		cmd.Help()
	},
}


text:
package jkind.lustre.visitors;

import jkind.lustre.Constant;
import jkind.lustre.Contract;
import jkind.lustre.Equation;
import jkind.lustre.Function;
import jkind.lustre.Node;
import jkind.lustre.Program;
import jkind.lustre.TypeDef;
import jkind.lustre.VarDecl;

public interface AstVisitor<T, S extends T> extends ExprVisitor<S> {
	public T visit(Constant constant);

	public T visit(Equation equation);

	public T visit(Function function);

	public T visit(Node node);

	public T visit(Program program);

	public T visit(TypeDef typeDef);

	public T visit(VarDecl varDecl);

	public T visit(Contract contract);
}


text:
@interface CircleOverlay : NSObject <MKOverlay>

@property (nonatomic, readonly) CLLocationDistance radius;
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;

- (id)initWithCoordinate:(CLLocationCoordinate2D)aCoordinate radius:(CLLocationDistance)aRadius;

@end


text:
package org.elasticsearch.xpack.sql.session;

import org.elasticsearch.xpack.ql.type.Schema;

import java.util.List;

public class ListRowSet extends AbstractRowSet implements SchemaRowSet {

    private final Schema schema;
    private final List<List<?>> list;
    private final int columnCount;
    private int pos = 0;

    ListRowSet(Schema schema, List<List<?>> list) {
        this(schema, list, schema.size());
    }

    ListRowSet(Schema schema, List<List<?>> list, int columnCount) {
        this.schema = schema;
        this.columnCount = columnCount;
        this.list = list;
    }

    @Override
    protected boolean doHasCurrent() {
        return pos < size();
    }

    @Override
    protected boolean doNext() {
        if (pos + 1 < size()) {
            pos++;
            return true;
        }
        return false;
    }

    @Override
    protected Object getColumn(int index) {
        return list.get(pos).get(index);
    }

    @Override
    protected void doReset() {
        pos = 0;
    }

    @Override
    public int size() {
        return list.size();
    }

    @Override
    public Schema schema() {
        return schema;
    }

    @Override
    public int columnCount() {
        return columnCount;
    }
}


text:
module Hyperwaverelay
  VERSION = "0.0.3"
end


text:
/*
*
* enabled on flag 'enable_idle_timeout'
* js script is only loaded when the flag is enabled
*
*/

// 600,000ms = 10 minutes
var timeoutLength = 600000;
var pretimeoutLength = 300000;

var timeoutTimer = setTimeout(runtimeout, timeoutLength);
var pretimeoutTimer = setTimeout(preruntimeout, pretimeoutLength);

$("body").keypress(function() {
  // reset timer whenever a key is pressed
  clearTimeout(timeoutTimer);
  timeoutTimer = setTimeout(runtimeout, timeoutLength);

  clearTimeout(pretimeoutTimer);
  pretimeoutTimer = setTimeout(preruntimeout, pretimeoutLength);

  $(".errorbar").slideUp();
});

function preruntimeout() {
  oh("You will be kicked out of your session in 5 minutes. Press any key to cancel and click this message to close.", "Timeout warning");
}

function runtimeout() {
  window.location = "auth.php?confirm=reauth";
}


text:
import Dropzone from 'dropzone';
import $ from 'jquery';
import 'materialize-css/dist/js/materialize';
import 'select2';
import Sortable from 'sortablejs';
import SVGInjector from 'svg-injector-2';

import '../scss/dashboard.scss';

var supportsPassive = false;
try {
  var opts = Object.defineProperty({}, 'passive', {
    get: function() {
      supportsPassive = true;
    }
  });
  window.addEventListener('test', null, opts);
} catch (e) {}

function onScroll(func) {
  window.addEventListener('scroll', func, supportsPassive ? {passive: true} : false);
}

new SVGInjector().inject(document.querySelectorAll('svg[data-src]'));

function openModal() {
  $('.modal-trigger-custom').on('click', function (e) {
    let that = this;
    $.ajax({
      url: $(this).data('href'),
      method: 'get',
      success: function (response) {
        let $modal = $($(that).attr('href'));
        $modal.html(response);
        initSelects();
        $modal.modal();
      }
    });

    e.preventDefault();
  });
}

$(document).ready(function() {

  let styleGuideMenu = $('.styleguide__menu');

  $(window).scroll(function () {
    if ($(this).scrollTop() > 100) {
      styleGuideMenu.addClass("fixed");
    } else {
      styleGuideMenu.removeClass("fixed");
    }
  })

  let mainNavTop = $('.side-nav');
  let $toggleMenu = $('#toggle-menu');
  function toggleMenu(e) {
    $(document.body).toggleClass('nav-toggled');
    e.preventDefault();
  }
  $toggleMenu.click(toggleMenu);
  if (mainNavTop.length > 0) {
    mainNavTop = mainNavTop.offset().top;
    onScroll(function() {
      $(document.body).toggleClass('sticky-nav', Math.floor($(window).scrollTop()) > Math.ceil(mainNavTop));
    });
  }
  initSelects();
  $('.modal').modal();

  let $tabs = $('ul.tabs');
  if ($tabs.length) {
    $tabs.find('.tab').on('click', function (e) {
      let tabSelector = $(this).find('a').attr('href');
      $('.btn-fab').addClass('btn-fab-hidden');
      $(tabSelector + '-btn').removeClass('btn-fab-hidden');
    });

    $tabs.find('a.active').parent().click();
  }
  openModal();
  let $messages = $('.message');
  let timeout = 0;
  let offset = 100;
  let firstMessageOffset = 250;
  setTimeout(function() {
    $messages.each(function () {
      let that = this;
      setTimeout(function () {
        $(that).removeClass('toast--hidden');
      }, timeout + offset);
      timeout += 3000;
      setTimeout(function () {
        $(that).addClass('toast--hidden');
      }, timeout - offset);
    });
  }, firstMessageOffset);

  $(document).on('submit', '.form-async', function(e) {
    let that = this;
    $.ajax({
      url: $(that).attr('action'),
      method: 'post',
      data: $(that).serialize(),
      complete: function(response) {
        if (response.status === 400) {
          $(that).parent().html(response.responseText);
          initSelects();
        } else {
          $('.modal-close').click();
        }
      },
      success: function(response) {
        if (response.redirectUrl) {
          window.location.href = response.redirectUrl;
        } else {
          location.reload();
        }
      }
    });
    e.preventDefault();
  }).on('click', '.modal-close', function() {
    $('.modal').modal('close');
  });

  function isTablet() {
    return !$('.hide-on-med-only').is(':visible');
  }
});
Dropzone.options.productImageForm = {
  paramName: 'image',
  maxFilesize: 20,
  previewsContainer: '.product-gallery',
  thumbnailWidth: 400,
  thumbnailHeight: 400,
  previewTemplate: $('#template').html(),
  clickable: false,
  init: function() {
    let $dropzoneMessage = $('.dropzone-message');
    let $gallery = $('.product-gallery');

    this.on('success', function(e, response) {
      $(e.previewElement).find('.product-gallery-item-desc').html(response.image);
      $(e.previewElement).attr('data-id', response.id);
      let editLinkHref = $(e.previewElement).find('.card-action-edit').attr('href');
      editLinkHref = editLinkHref.split('/');
      editLinkHref[editLinkHref.length - 2] = response.id;
      $(e.previewElement).find('.card-action-edit').attr('href', editLinkHref.join('/'));
      $(e.previewElement).find('.card-action-edit').show();
      let deleteLinkHref = $(e.previewElement).find('.card-action-delete').attr('data-href');
      deleteLinkHref = deleteLinkHref.split('/');
      deleteLinkHref[deleteLinkHref.length - 3] = response.id;
      $(e.previewElement).find('.card-action-delete').attr('data-href', deleteLinkHref.join('/'));
      $(e.previewElement).find('.card-action-delete').show();
      $('.no-images').addClass('hide');
      openModal();
    });
  }
};
let el = document.getElementById('product-gallery');
if (el) {
  Sortable.create(el, {
    handle: '.sortable__drag-area',
    onUpdate: function () {
      $.ajax({
        dataType: 'json',
        contentType: 'application/json',
        data: JSON.stringify({
          'order': (function () {
            let postData = [];
            $(el).find('.product-gallery-item[data-id]').each(function() {
              postData.push($(this).data('id'));
            });
            return postData;
          })()
        }),
        headers: {
          'X-CSRFToken': $('[name=csrfmiddlewaretoken]').val()
        },
        method: 'post',
        url: $(el).data('post-url')
      });
    }
  });
}
$('.select-all').on('change', function() {
  let $items = $(this).parents('form').find('.switch-actions');
  if (this.checked) {
    $items.prop('checked', true);
  } else {
    $items.prop('checked', false);
  }
});
$('.switch-actions').on('change', function() {
  let $btnChecked = $(this).parents('form').find('.btn-show-when-checked');
  let $btnUnchecked = $(this).parents('form').find('.btn-show-when-unchecked');
  if ($(this).parents('form').find('.switch-actions:checked').length) {
    $btnChecked.show();
    $btnUnchecked.hide();
  } else {
    $btnUnchecked.show();
    $btnChecked.hide();
  }
});
$('.datepicker').pickadate({
  // The title label to use for the month nav buttons
  labelMonthNext: pgettext('Datepicker option', 'Next month'),
  labelMonthPrev: pgettext('Datepicker option', 'Previous month'),

  // The title label to use for the dropdown selectors
  labelMonthSelect: pgettext('Datepicker option', 'Select a month'),
  labelYearSelect: pgettext('Datepicker option', 'Select a year'),

  // Months and weekdays
  monthsFull: [ pgettext('Datepicker option', 'January'), pgettext('Datepicker option', 'February'), pgettext('Datepicker option', 'March'), pgettext('Datepicker option', 'April'), pgettext('Datepicker option', 'May'), pgettext('Datepicker option', 'June'), pgettext('Datepicker option', 'July'), pgettext('Datepicker option', 'August'), pgettext('Datepicker option', 'September'), pgettext('Datepicker option', 'October'), pgettext('Datepicker option', 'November'), pgettext('Datepicker option', 'December') ],
  monthsShort: [ pgettext('Datepicker option', 'Jan'), pgettext('Datepicker option', 'Feb'), pgettext('Datepicker option', 'Mar'), pgettext('Datepicker option', 'Apr'), pgettext('Datepicker option', 'May'), pgettext('Datepicker option', 'Jun'), pgettext('Datepicker option', 'Jul'), pgettext('Datepicker option', 'Aug'), pgettext('Datepicker option', 'Sep'), pgettext('Datepicker option', 'Oct'), pgettext('Datepicker option', 'Nov'), pgettext('Datepicker option', 'Dec') ],
  weekdaysFull: [ pgettext('Datepicker option', 'Sunday'), pgettext('Datepicker option', 'Monday'), pgettext('Datepicker option', 'Tuesday'), pgettext('Datepicker option', 'Wednesday'), pgettext('Datepicker option', 'Thursday'), pgettext('Datepicker option', 'Friday'), pgettext('Datepicker option', 'Saturday') ],
  weekdaysShort: [ pgettext('Datepicker option', 'Sun'), pgettext('Datepicker option', 'Mon'), pgettext('Datepicker option', 'Tue'), pgettext('Datepicker option', 'Wed'), pgettext('Datepicker option', 'Thu'), pgettext('Datepicker option', 'Fri'), pgettext('Datepicker option', 'Sat') ],

  // Materialize modified
  weekdaysLetter: [ pgettext('Sunday shortcut','S'), pgettext('Monday shortcut','M'), pgettext('Tuesday shortcut','T'), pgettext('Wednesday shortcut','W'), pgettext('Thursday shortcut','T'), pgettext('Friday shortcut','F'), pgettext('Saturday shortcut','S') ],
  today: pgettext('Datepicker option', 'Today'),
  clear: pgettext('Datepicker option', 'Clear'),
  close: pgettext('Datepicker option','Close'),

  format: 'd mmmm yyyy',
  formatSubmit: 'yyyy-mm-dd',
  selectMonths: true,
  hiddenName: true,
  onClose: function() {
    $(document.activeElement).blur();
  }
});

function initSelects() {
  $('select:not(.browser-default):not([multiple])').material_select();
  $('select[multiple]:not(.browser-default)').select2({width: '100%'});
}
// Clickable rows in dashboard tables
$(document).on('click', 'tr[data-action-go]>td:not(.ignore-link)', function() {
  let target = $(this).parent();
  window.location.href = target.data('action-go');
});

// Coupon dynamic forms
$(document).ready(() => {
  let $voucherTypeInput = $('.body-vouchers [name="type"]');
  if ($voucherTypeInput.length) {
    let $discountValueType = $('[name="discount_value_type"]');
    let $voucherForms = $('.voucher-form');
    let $applyToProduct = $('[name="product-apply_to"]').parents('.input');
    let $applyToCategory = $('[name="category-apply_to"]').parents('.input');
    let onChange = () => {
      let discountValueType = $discountValueType.val();
      let type = $voucherTypeInput.val();
      let hide = discountValueType === 'percentage';
      $applyToProduct.toggleClass('hide', hide);
      $applyToCategory.toggleClass('hide', hide);

      $voucherForms.each((index, form) => {
        let $form = $(form);
        let hideForm = $form.data('type') !== type;
        $form.toggleClass('hide', hideForm);
      });
    };

    $discountValueType.on('change', onChange);
    $voucherTypeInput.on('change', onChange);
    $voucherTypeInput.trigger('change');
  }
});


text:
/* See LICENSE for licensing information */

/**
 * \file kvline.h
 *
 * \brief Header for kvline.c
 **/

#ifndef TOR_KVLINE_H
#define TOR_KVLINE_H

struct config_line_t;

#define KV_QUOTED    (1u<<0)
#define KV_OMIT_KEYS (1u<<1)
#define KV_OMIT_VALS (1u<<2)
#define KV_QUOTED_QSTRING (1u<<3)
#define KV_RAW       (1u<<4)

struct config_line_t *kvline_parse(const char *line, unsigned flags);
char *kvline_encode(const struct config_line_t *line, unsigned flags);

#endif /* !defined(TOR_KVLINE_H) */


text:
name: "\U0001F381 Feature Request"
about: Do you have an idea for an improvement, a new feature or a plugin?

---

## Feature description
<!-- Please describe the feature: Which area of the library is it related to? What specific solution would you like? -->

## Could the feature be a [custom component](https://spacy.io/usage/processing-pipelines#custom-components) or [spaCy plugin](https://spacy.io/universe)?
If so, we will tag it as [`project idea`](https://github.com/explosion/spaCy/labels/project%20idea) so other users can take it on.


text:
class HomeController < ApplicationController

  def index
    @user_city         = user_city
    @features = Feature.random(user_latlong).first(7)
    @closests_features = Feature.random(user_latlong, user_latlong).first(9)
  end

end


text:
A jQuery depencency liberator for [t3js](https://github.com/box/t3js).

Overrides `window.$` with hooks for `.on` and `.off`.

## Why does this exist?
**t3js** has a jQuery dependency due to obligated support for IE8 and event handling. The core library uses it primarily as browser-normalizing as described here: ['Why is there a dependency on jQuery?'](https://github.com/box/t3js#why-is-there-a-dependency-on-jquery).
The support for IE8 is planned to stop in late December 2015 as [Box officially has end-of-lifed it](https://github.com/box/t3js#why-support-ie8).

In a current project, we're not obliged to officially support IE8, and did not want to bloat our resource includes with a library used only as a small dependency for another library.

## License

The MIT License (MIT)

Copyright (c) 2015 Meridium

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 all
copies or substantial portions of the Software.

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.


text:
define(['angular','services/module-name'], function (angular,moduleName) {
    angular.module(moduleName).factory('ElasticSearchService',["$q","$http","CommonRestUrlService", function ($q, $http, CommonRestUrlService) {

        function performSearch(query, rowsPerPage, start) {
            return $http.get(CommonRestUrlService.ELASTIC_SEARCH_URL, {params: {q: query, rows: rowsPerPage, start: start}}).then(function (response) {
                return response.data;

            });
        }

        var data = {
            searchQuery: '',
            search: function (query, rows, start) {
                return performSearch(query, rows, start);
            }

        };

        return data;

    }]);
});


text:
boom.js
=======

BOOM is a little piece of JS which makes creating HTML trees
from JS a little easier. It also comes with some jQuery-like syntax
for which I am eternaly grateful to the great Resig.

To create a BOOM, use boom:

```javascript
var myDiv = boom(['div', {cls:'my-div'}, {
    header: ['h2', {}, 'Some header in my-div'],
    form: ['form', {id: 'a-form-to-show-more-nesting'}, {
        textfield: ['input', {type:'text', name:'mytextfield', id:'mytextfield'}],
        submit ['input', {type:'submit', name:'mybutton', id:'mybutton', value:'My value'}],
    }]
}])
myDiv.appendTo(document.body)
```

After creating you BOOM, you can simply access all of its elements by name,
for example:

```javascript
myDiv.header.html('I\'ve changed the <b>header</b>');
var val = myDiv.form.textfield.val();
myDiv.form.listen('submit', function(evt) { });
```


text:
$(document).ready(function () {
    $(".dropdown-menu li").click(function () {
        var selText = $(this).text();
        $(this).closest('.input-group-btn').children('button').html(selText + ' ')
    });
});


text:
var kvStrengthValidator = {};
(function ($) {
    "use strict";
    var emailRegExp = /^([\w!#$%&'\*\+\-\/=\?\^`{\|}~]+\.)*[\w!#$%&'\*\+\-\/=\?\^`{\|}~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(:\d{1,5})?)$/i;
    kvStrengthValidator = {
        isEmpty: function (value, trim) {
            return value === null || value === undefined || value.length === 0 || trim && $.trim(value) === '';
        },
        addMessage: function (messages, message, value) {
            var val = this.isEmpty(value) ? 'none' : value;
            messages.push(message.replace(/\{value}/g, val));
        },
        addError: function (messages, message, valueRequired, valueFound) {
            var self = this, msg = message.replace(/\{found}/g, valueFound);
            self.addMessage(messages, msg, valueRequired);
        },
        findPatterns: function (str) {
            var self = this, isEmpty = self.isEmpty,
                lower = str.match(/[a-z]/g),
                upper = str.match(/[A-Z]/g),
                digit = str.match(/\d/g),
                special = str.match(/\W/g);
            return {
                lower: isEmpty(lower) ? 0 : lower.length,
                upper: isEmpty(upper) ? 0 : upper.length,
                digit: isEmpty(digit) ? 0 : digit.length,
                special: isEmpty(special) ? 0 : special.length
            };
        },
        compare: function (from, operator, to) {
            var chk = (from !== undefined) && (to !== undefined);
            if (operator === '<') {
                return chk && (from < to);
            }
            if (operator === '>') {
                return chk && (from > to);
            }
            return chk && (from === to);
        },
        validate: function (value, messages, options) {
            var self = this, compare = self.compare;
            /** @namespace options.minError */
            /** @namespace options.maxError */
            /** @namespace options.lengthError */
            /** @namespace options.allowSpaces */
            /** @namespace options.allowSpacesError */
            /** @namespace options.userField */
            /** @namespace options.hasUser */
            /** @namespace options.hasUserError */
            /** @namespace options.hasEmail */
            /** @namespace options.hasEmailError */
            /** @namespace options.lowerError */
            /** @namespace options.upperError */
            /** @namespace options.digitError */
            /** @namespace options.specialError */
            /** @namespace options.strError */
            if (self.isEmpty(value)) {
                return;
            }
            if (typeof value !== 'string') {
                self.addMessage(messages, options.strError, value);
                return;
            }
            var patterns = self.findPatterns(value), len = value.length || 0,
                username = $(options.userField).val();
            if (compare(len, '<', options.min)) {
                self.addError(messages, options.minError, options.min, len);
            }
            if (compare(len, '>', options.max)) {
                self.addError(messages, options.maxError, options.max, len);
            }
            if (compare(len, '>', options['length'])) { // jshint ignore:line
                self.addError(messages, options.lengthError, options['length'], len); // jshint ignore:line
            }
            if (options.allowSpaces === false && value.indexOf(' ') !== -1) {
                self.addMessage(messages, options.allowSpacesError, value);
            }
            if (options.hasUser && username && value.toLowerCase().match(username.toLowerCase())) {
                self.addMessage(messages, options.hasUserError, value);
            }
            if (options.hasEmail && value.match(emailRegExp)) {
                self.addMessage(messages, options.hasEmailError, value);
            }
            if (compare(patterns.lower, '<', options.lower)) {
                self.addError(messages, options.lowerError, options.lower, patterns.lower);
            }
            if (compare(patterns.upper, '<', options.upper)) {
                self.addError(messages, options.upperError, options.upper, patterns.upper);
            }
            if (compare(patterns.digit, '<', options.digit)) {
                self.addError(messages, options.digitError, options.digit, patterns.digit);
            }
            if (compare(patterns.special, '<', options.special)) {
                self.addError(messages, options.specialError, options.special, patterns.special);
            }
        }
    };
})(window.jQuery);


text:
namespace MailPlus.Models
{
    using System.Linq;

    public partial class MailingHistory
    {
        /// <summary>
        /// Initializes a new instance of the MailingHistory class.
        /// </summary>
        public MailingHistory() { }

        /// <summary>
        /// Initializes a new instance of the MailingHistory class.
        /// </summary>
        /// <param name="sentDate">Date & time the mailing was sent</param>
        /// <param name="bounce">Possible values include: 'HARDBOUNCE',
        /// 'SOFTBOUNCE'</param>
        public MailingHistory(bool clicked, Mailing mailing, bool opened, System.DateTime sentDate, string bounce = default(string))
        {
            Bounce = bounce;
            Clicked = clicked;
            Mailing = mailing;
            Opened = opened;
            SentDate = sentDate;
        }

        /// <summary>
        /// Gets or sets possible values include: 'HARDBOUNCE', 'SOFTBOUNCE'
        /// </summary>
        [Newtonsoft.Json.JsonProperty(PropertyName = "bounce")]
        public string Bounce { get; set; }

        /// <summary>
        /// </summary>
        [Newtonsoft.Json.JsonProperty(PropertyName = "clicked")]
        public bool Clicked { get; set; }

        /// <summary>
        /// </summary>
        [Newtonsoft.Json.JsonProperty(PropertyName = "mailing")]
        public Mailing Mailing { get; set; }

        /// <summary>
        /// </summary>
        [Newtonsoft.Json.JsonProperty(PropertyName = "opened")]
        public bool Opened { get; set; }

        /// <summary>
        /// Gets or sets date & time the mailing was sent
        /// </summary>
        [Newtonsoft.Json.JsonProperty(PropertyName = "sentDate")]
        public System.DateTime SentDate { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (Mailing == null)
            {
                throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Mailing");
            }
            if (this.Mailing != null)
            {
                this.Mailing.Validate();
            }
        }
    }
}


text:
package org.apache.ibatis.submitted.overwritingproperties;

import java.io.Serializable;

public class Foo implements Serializable {

  private Long field1;
  private Bar field2;
  private Integer field3;
  private Integer field4;

  public Foo() {
    super();
  }

  public Foo(Long field1, Bar field2, Integer field3, Integer field4) {
    this.field1 = field1;
    this.field2 = field2;
    this.field3 = field3;
    this.field4 = field4;
  }

  public Long getField1() {
    return field1;
  }

  public void setField1(Long field1) {
    this.field1 = field1;
  }

  public Bar getField2() {
    return field2;
  }

  public void setField2(Bar field2) {
    this.field2 = field2;
  }

  public Integer getField3() {
    return field3;
  }

  public void setField3(Integer field3) {
    this.field3 = field3;
  }

  public Integer getField4() {
    return field4;
  }

  public void setField4(Integer field4) {
    this.field4 = field4;
  }
}


text:
<bill session="111" type="sr" number="39" updated="2009-03-07T14:42:59-05:00">
	<status><introduced date="1234414800" datetime="2009-02-12"/></status>

	<introduced date="1234414800" datetime="2009-02-12"/>
	<titles>
		<title type="official" as="introduced">An original resolution authorizing expenditures by the Committee on the Judiciary.</title>
	</titles>
	<sponsor id="300065"/>
	<cosponsors>

	</cosponsors>
	<actions>
		<action date="1234414800" datetime="2009-02-12"><text>Committee on the Judiciary. Original measure reported to Senate by Senator Leahy. Without written report.</text></action>
		<action date="1234414800" datetime="2009-02-12"><text>Referred to the Committee on Rules and Administration.</text><reference label="text of measure as introduced" ref="CR S2248-2249"/></action>
	</actions>
	<committees>
		<committee name="Senate Judiciary" subcommittee="" activity="Origin, Reporting" />
		<committee name="Senate Rules and Administration" subcommittee="" activity="Referral, In Committee" />
	</committees>
	<relatedbills>

	</relatedbills>
	<subjects>
		<term name="Congress"/>
		<term name="Congressional committees"/>
		<term name="Senate Committee on the Judiciary"/>
	</subjects>
	<amendments>

	</amendments>
	<summary>

	</summary>
</bill>


text:
<?php

namespace Symfony\Component\Workflow\Dumper;

use Symfony\Component\Workflow\Definition;
use Symfony\Component\Workflow\Marking;

/**
 * DumperInterface is the interface implemented by workflow dumper classes.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 * @author Grégoire Pineau <lyrixx@lyrixx.info>
 */
interface DumperInterface
{
    /**
     * Dumps a workflow definition.
     */
    public function dump(Definition $definition, Marking $marking = null, array $options = []): string;
}


text:
ACCEPTED

#### According to
Interim Register of Marine and Nonmarine Genera

#### Published in
Eclog. Geol. Helv. 55: 520.

#### Original name
null

### Remarks
null


text:
package pabix.chickens.una.Management;

/**
 * Created by JunHyeok on 2016. 12. 11..
 */
public class UserManager {
    private String id;
    private String name;
    private String email = "";

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

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

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    private static UserManager ourInstance = new UserManager();

    public static UserManager getInstance() {
        return ourInstance;
    }

    private UserManager() {
    }
}