code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
from flask import request, current_app, url_for from flask_jsonschema import validate from .. import db from ..models import AHBot as Bot from .decorators import json_response from . import api @api.route('/abusehelper', methods=['GET']) @json_response def get_abusehelper(): """Return a list of available abusehelper **Example request**: .. sourcecode:: http GET /api/1.0/abusehelper HTTP/1.1 Host: do.cert.europa.eu Accept: application/json **Example response**: .. sourcecode:: http HTTP/1.0 200 OK Content-Type: application/json { "abusehelper": [ { "name": "ShadowServerBot", "url": "http://sample.com/path.html", "id": 1 } ] } :reqheader Accept: Content type(s) accepted by the client :resheader Content-Type: this depends on `Accept` header or request :>json array abusehelper: List of available bots :>jsonobj integer id: Bot ID :>jsonobj integer name: Bot name :status 200: Deliverable endpoint found, response may be empty :status 404: Not found """ bots = Bot.query.filter().all() return {'abusehelper': [a.serialize() for a in bots]} @api.route('/abusehelper/<int:bot_id>', methods=['GET']) @json_response def get_got(bot_id): """Get bot from database **Example request**: .. sourcecode:: http GET /api/1.0/abusehelper/1 HTTP/1.1 Host: do.cert.europa.eu Accept: application/json **Example response**: .. sourcecode:: http HTTP/1.0 200 OK Content-Type: application/json { "name": "ShadowServerBot", "url": "http://sample.com/path.html", "id": 1 } :param bot_id: Bot unique ID :reqheader Accept: Content type(s) accepted by the client :resheader Content-Type: this depends on `Accept` header or request :>json integer id: Bot unique ID :>json integer name: Bot name :status 200: ASN found :status 404: Resource not found """ a = Bot.query.get_or_404(bot_id) return a.serialize() @api.route('/abusehelper', methods=['POST', 'PUT']) @validate('abusehelper', 'add_bot') @json_response def add_bot(): """Add new bot entry **Example request**: .. sourcecode:: http POST /api/1.0/abusehelper HTTP/1.1 Host: do.cert.europa.eu Accept: application/json Content-Type: application/json { "name": "ShadowServerBot", "url": "http://sample.com/path.html" } **Example response**: .. sourcecode:: http HTTP/1.0 201 CREATED Content-Type: application/json { "bot": { "name": "ShadowServerBot", "url": "http://sample.com/path.html", "id": 1 }, 'message': "Bot added" } :reqheader Accept: Content type(s) accepted by the client :resheader Content-Type: this depends on `Accept` header or request :<json integer name: Bot name :>jsonobj integer id: Unique ID of new bot :>jsonobj integer name: bot name :>json string message: Status message :status 201: ASN successfully saved :status 400: Bad request """ a = Bot.fromdict(request.json) db.session.add(a) db.session.commit() return {'bot': a.serialize(), 'message': 'Bot added'}, 201, \ {'Location': url_for('api.get_bot', bot_id=a.id)} @api.route('/abusehelper/<int:bot_id>', methods=['PUT']) @validate('abusehelper', 'update_bot') @json_response def update_bot(bot_id): return NotImplemented @api.route('/abusehelper/<int:bot_id>', methods=['DELETE']) @json_response def delete_bot(bot_id): """Delete bot **Example request**: .. sourcecode:: http DELETE /api/1.0/abusehelper/1 HTTP/1.1 Host: do.cert.europa.eu Accept: application/json **Example response**: .. sourcecode:: http HTTP/1.0 200 OK Content-Type: application/json { "message": "Bot deleted" } :param bot_id: Bot unique ID. :reqheader Accept: Content type(s) accepted by the client :resheader Content-Type: this depends on `Accept` header or request :>json string message: Action status status :status 200: Bot was deleted :status 404: Bot was not found """ a = Bot.query.filter_by(id == bot_id).delete() if not a: return {'message': 'No such bot'}, 404 db.session.commit() return {'message': 'Bot deleted'} @api.route('/abusehelper', methods=['DELETE']) @json_response def delete_abusehelper(): """Clear abusehelper table **Example request**: .. sourcecode:: http DELETE /api/1.0/abusehelper HTTP/1.1 Host: do.cert.europa.eu Accept: application/json **Example response**: .. sourcecode:: http HTTP/1.0 200 OK Content-Type: application/json { "message": "Bots deleted" } :reqheader Accept: Content type(s) accepted by the client :resheader Content-Type: this depends on `Accept` header or request :>json string message: Action status status :status 200: Bot was deleted :status 404: Bot was not found """ a = Bot.query.all().delete() db.session.commit() current_app.log.debug('Deleted {} abusehelper'.format(a)) return {'message': 'Bots deleted'}
certeu/do-portal
app/api/abusehelper.py
Python
bsd-3-clause
5,478
/* * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION * Copyright (c) 2008, Nationwide Health Information Network (NHIN) Connect. All rights reserved. * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * - Neither the name of the NHIN Connect Project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * END OF TERMS AND CONDITIONS */ package gov.hhs.fha.nhinc.common.dda; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for GetDetailDataForUserRequestType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="GetDetailDataForUserRequestType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="userId" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="dataSource" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;element name="itemId" type="{http://www.w3.org/2001/XMLSchema}string"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "GetDetailDataForUserRequestType", propOrder = { "userId", "dataSource", "itemId" }) public class GetDetailDataForUserRequestType { @XmlElement(required = true) protected String userId; @XmlElement(required = true) protected String dataSource; @XmlElement(required = true) protected String itemId; /** * Gets the value of the userId property. * * @return * possible object is * {@link String } * */ public String getUserId() { return userId; } /** * Sets the value of the userId property. * * @param value * allowed object is * {@link String } * */ public void setUserId(String value) { this.userId = value; } /** * Gets the value of the dataSource property. * * @return * possible object is * {@link String } * */ public String getDataSource() { return dataSource; } /** * Sets the value of the dataSource property. * * @param value * allowed object is * {@link String } * */ public void setDataSource(String value) { this.dataSource = value; } /** * Gets the value of the itemId property. * * @return * possible object is * {@link String } * */ public String getItemId() { return itemId; } /** * Sets the value of the itemId property. * * @param value * allowed object is * {@link String } * */ public void setItemId(String value) { this.itemId = value; } }
TATRC/KMR2
Services/Common/XDSCommonLib/src/main/java/gov/hhs/fha/nhinc/common/dda/GetDetailDataForUserRequestType.java
Java
bsd-3-clause
4,397
use actix::Addr; use actix_web::{http, middleware}; use actix_web::{web, App, HttpServer}; use diesel::r2d2::{self, ConnectionManager}; use diesel::PgConnection; use crate::database::DbExecutor; use badge::handlers::badge_handler; // use run::handlers::run_handler; use status::handlers::status_handler; pub type Pool = r2d2::Pool<ConnectionManager<PgConnection>>; #[derive(Clone)] pub struct WebState { pub db: Pool, pub db_actor: Addr<DbExecutor>, } pub fn http_server(state: WebState, http_bind: String, http_port: String) { use actix_web::middleware::cors::Cors; HttpServer::new(move || { App::new() .data(state.clone()) .wrap(middleware::Logger::default()) .wrap( Cors::new() // <- Construct CORS middleware builder .allowed_methods(vec!["GET", "POST", "OPTION"]) .allowed_headers(vec![http::header::AUTHORIZATION, http::header::ACCEPT]) .allowed_header(http::header::CONTENT_TYPE) .max_age(3600), ) .service(web::resource("/{project}/{workflow}/badge.svg").to_async(badge_handler)) .service(web::resource("/mon/status").to(status_handler)) }) .bind(format!("{}:{}", http_bind, http_port)) .unwrap() .start(); }
ovh/cds
contrib/uservices/badge/src/web.rs
Rust
bsd-3-clause
1,331
from django.contrib import admin # Register your models here. from .models import Photos admin.site.register(Photos)
dadisigursveinn/VEF-Lokaverkefni
myphotos/admin.py
Python
bsd-3-clause
118
#ifndef SSERVICE_LOGGER_H #define SSERVICE_LOGGER_H /****************************************************************************** "Copyright (c) 2015-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. " ******************************************************************************/ /** @file @brief Logger system header. */ #include "xss_types.h" #include "xss_error.h" /** * @enum log_target_t defines Types of log messages */ #define LOG_ERROR_VAL (0) #define LOG_WARNING_VAL (1) #define LOG_INFO_VAL (2) #define LOG_ALL_VAL ( 0xff ) typedef enum { LOG_ERROR = LOG_ERROR_VAL, /**< error. Operation is not successfull; Continue to run */ LOG_WARNING = LOG_WARNING_VAL, /**< Warning. Operation is finished successfully, but there is something to notify (Old keys?) */ LOG_INFO = LOG_INFO_VAL, /**< Information to developer; */ LOG_ALL = LOG_ALL_VAL, /**< Cannot be passed to log, it is just set for Log filtering: Print ALL logs */ } sservice_log_level_t ; #define LOG_SOURCE_JS_VAL (2) #define LOG_SOURCE_BRIDGE_VAL (1) #define LOG_SOURCE_RUNTIME_VAL (0) typedef enum { LOG_SOURCE_JS=LOG_SOURCE_JS_VAL, LOG_SOURCE_BRIDGE = LOG_SOURCE_BRIDGE_VAL, LOG_SOURCE_RUNTIME = LOG_SOURCE_RUNTIME_VAL, } sservice_log_source_t ; #endif
AppSecurityApi/com-intel-security-cordova-plugin
src/ios/xss_log.h
C
bsd-3-clause
2,689
#include "Ht.h" #include "PersBug.h" void CPersBug::PersBug() { if (PR_htValid) { switch (PR_htInst) { case BUG_RTN: { if (SendReturnBusy_htmain()) { HtRetry(); break; } SendReturn_htmain(); } break; default: assert(0); } } }
TonyBrewer/OpenHT
tests/bug_ngram/src_pers/PersBug_src.cpp
C++
bsd-3-clause
261
# Copyright (c) 2014, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in LICENSE.txt and may be redistributed only # under the conditions described in the aforementioned license. The license # is also available online at http://www.enthought.com/licenses/BSD.txt # Thanks for using Enthought open source! # # Author: Enthought, Inc. """ Tests for the BetterZoom Chaco tool """ import unittest import numpy from chaco.api import create_line_plot from chaco.tools.api import BetterZoom from enable.testing import EnableTestAssistant class TestBetterZoomTool(EnableTestAssistant, unittest.TestCase): """ Tests for the BetterZoom Chaco tool """ def setUp(self): values = numpy.arange(10) self.plot = create_line_plot((values, values)) self.plot.bounds = [100, 100] self.plot._window = self.create_mock_window() self.tool = BetterZoom(component=self.plot) self.plot.active_tool = self.tool self.plot.do_layout() def tearDown(self): del self.tool del self.plot def test_default_position(self): tool = self.tool # this doesn't throw an exception self.send_key(tool, '+') self.assertEqual(tool.position, (50, 50)) # expected behaviour for a normal zoom in operation self.assertNotEqual(tool._index_factor, 1.0) self.assertNotEqual(tool._value_factor, 1.0) self.assertEqual(len(tool._history), 2)
tommy-u/chaco
chaco/tools/tests/better_zoom_test_case.py
Python
bsd-3-clause
1,537
/** * Copyright (c) 2015 See AUTHORS file * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the mini2Dx nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.mini2Dx.core.di.exception; /** * A base class for bean exceptions */ public class BeanException extends Exception { private static final long serialVersionUID = 4487528732406582847L; public BeanException(String message) { super(message); } }
hyperverse/mini2Dx
core/src/main/java/org/mini2Dx/core/di/exception/BeanException.java
Java
bsd-3-clause
1,761
<?php /** * Created by PhpStorm. * User: wesley * Date: 03/01/15 * Time: 10:04 */ namespace Ordemservico\Form\View\Helper; use Zend\Form\ElementInterface; use Zend\Form\View\Helper\FormElementErrors; class FormElementErros extends FormElementErrors { public function render(ElementInterface $element, array $attributes = array()){ //Associando menssagem com varivel $messages = $element->getMessages(); //Verificando se $message está vazio if(empty($messages)){ return ''; } $markup = '<div class="alert alert-danger col-sm-10 col-sm-offset-2" role="alert">'; $markup .= implode(' - ', $messages); $markup .= '</div>'; return $markup; } }
wsldesigner/Rvk-web
module/Ordemservico/src/Ordemservico/Form/View/Helper/FormElementErros.php
PHP
bsd-3-clause
746
<?php use yii\helpers\Html; use yii\bootstrap\Modal; use yii\bootstrap\ButtonGroup; use yii\widgets\Menu; use yii\widgets\Pjax; use kartik\export\ExportMenu; use kartik\grid\GridView; /* @var $this yii\web\View */ /* @var $searchModel app\models\TransaccionrefaccionSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('app', 'Transaccionrefaccions'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="transaccionrefaccion-index col-lg-12 col-md-12 col-xs-12 well"> <h1><?= Html::encode($this->title) ?></h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <div class="col-md-12 col-lg-12 col-xs-12 well"> <?php $datagrid=[ ['class' => 'kartik\grid\SerialColumn'], // 'id_transaccionrefaccion', [ 'attribute'=>'id_lineaprovisional', 'value'=>'tblMaquinaIdMaquina.tblLineaIdLinea.tbl_linea_nombre', 'filterType'=>GridView::FILTER_SELECT2, 'filter'=>$model->tbllineaList, 'filterInputOptions'=>['placeholder' => 'Selecciona '], 'filterWidgetOptions'=>[ 'pluginOptions'=>['allowClear'=>true], ], 'group'=>true, 'groupFooter'=>function ($model, $key, $index, $widget) { // Closure method return [ 'mergeColumns'=>[[0,2]], // columns to merge in summary 'content'=>[ // content to show in each summary cell 0=>'Resumen (' . $model->tblMaquinaIdMaquina->tblLineaIdLinea->tbl_linea_nombre . ')', 2=>GridView::F_SUM, 3=>GridView::F_SUM, ], 'contentFormats'=>[ // content reformatting for each summary cell 2=>['format'=>'number', 'decimals'=>0], 3=>['format'=>'number', 'decimals'=>2], ], 'contentOptions'=>[ // content html attributes for each summary cell 0=>['style'=>'font-variant:small-caps'], 2=>['style'=>'text-align:right'], 3=>['style'=>'text-align:right'], ], 'options'=>['class'=>'danger','style'=>'font-weight:bold;'] ]; } ], [ 'attribute'=>'tbl_maquina_id_maquina', 'value'=>'tblMaquinaIdMaquina.tbl_maquina_bim', 'filterType'=>GridView::FILTER_SELECT2, 'filter'=>$model->tblmaquinaList, 'filterInputOptions'=>['placeholder' => 'Selecciona '], 'group'=>true, 'subGroupOf'=>1, 'groupFooter'=>function ($model, $key, $index, $widget) { // Closure method return [ 'mergeColumns'=>[[3]], // columns to merge in summary 'content'=>[ // content to show in each summary cell 2=>'Resumen (' . $model->tblMaquinaIdMaquina->tbl_maquina_bim . ')', 3=>GridView::F_SUM, ], 'contentFormats'=>[ // content reformatting for each summary cell 3=>['format'=>'number', 'decimals'=>0], 4=>['format'=>'number', 'decimals'=>2], ], 'contentOptions'=>[ // content html attributes for each summary cell 2=>['style'=>'font-variant:small-caps'], 3=>['style'=>'text-align:right'], ], 'options'=>['class'=>'success','style'=>'font-weight:bold;'] ]; }, ], [ 'label'=>'Total', 'value'=>function ($model, $key, $index, $column) { $precios=$model->tblItemIdItem->tblPrecios; $costo=0; foreach($precios as $precio){ if($precio->tbl_precio_opcion==1){ $costo=$costo+$precio->tbl_precio_precio; } } return $costo*$model->sumacount; }, ], [ 'attribute'=>'mod_transaccionrefaccion_date', 'value'=>'mod_transaccionrefaccion_date', 'filter'=> kartik\daterange\DateRangePicker::widget([ 'model' => $searchModel, 'attribute'=>'mod_transaccionrefaccion_date', 'convertFormat'=>true, 'pluginOptions'=>[ 'locale'=>[ 'format'=>'Y-m-d', 'separator' => 'to', ] ] ]), 'format' => ['date', 'php:Y-m-d'], ], ]; $exportvar=ExportMenu::widget([ 'dataProvider' => $dataProvider, 'columns' =>$datagrid, 'target' => ExportMenu::TARGET_BLANK, 'asDropdown' => false, ]); ?> <?= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' =>$datagrid, 'responsive'=>true, 'panel'=>[ 'type' => GridView::TYPE_PRIMARY, 'heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-book"></i>'.Html::encode($this->title).'</h3>', ], 'toolbar'=>[ '{export}',[ 'content'=>Html::a('<i class="glyphicon glyphicon-repeat"></i>', ['reporte'], ['class' => 'btn btn-default', 'title'=> 'Reset Grid']) ] ], 'export'=>[ 'itemsAfter'=> [ '<li role="presentation" class="divider"></li>', '<li class="dropdown-header">All Data</li>', $exportvar ] ] ]); ?> </div> <?php Modal::begin([ 'id'=>'transaccionrefaccion-modal', 'size'=>'modal-lg' ]); ?> <div id="transaccionrefaccion-modal-form"></div> <?php Modal::end(); ?> </div>
atreyu3/UER
views/transaccionrefaccion/reportejecutivo.php
PHP
bsd-3-clause
5,710
# Minimal makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build SPHINXPROJ = DjangoCorrelationId SOURCEDIR = . BUILDDIR = ../build/sphinx # Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) .PHONY: help Makefile # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
snowball-one/cid
docs/Makefile
Makefile
bsd-3-clause
626
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_75) on Sun Mar 01 12:04:16 AEDT 2015 --> <title>X509AttributeCertificateHolderSelectorBuilder (Bouncy Castle Library 1.52 API Specification)</title> <meta name="date" content="2015-03-01"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="X509AttributeCertificateHolderSelectorBuilder (Bouncy Castle Library 1.52 API Specification)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em><b>Bouncy Castle Cryptography Library 1.52</b></em></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelector.html" title="class in org.bouncycastle.cert.selector"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/bouncycastle/cert/selector/X509CertificateHolderSelector.html" title="class in org.bouncycastle.cert.selector"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html" target="_top">Frames</a></li> <li><a href="X509AttributeCertificateHolderSelectorBuilder.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.bouncycastle.cert.selector</div> <h2 title="Class X509AttributeCertificateHolderSelectorBuilder" class="title">Class X509AttributeCertificateHolderSelectorBuilder</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.bouncycastle.cert.selector.X509AttributeCertificateHolderSelectorBuilder</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="strong">X509AttributeCertificateHolderSelectorBuilder</span> extends java.lang.Object</pre> <div class="block">This class builds selectors according to the set criteria.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html#X509AttributeCertificateHolderSelectorBuilder()">X509AttributeCertificateHolderSelectorBuilder</a></strong>()</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html#addTargetGroup(org.bouncycastle.asn1.x509.GeneralName)">addTargetGroup</a></strong>(org.bouncycastle.asn1.x509.GeneralName&nbsp;group)</code> <div class="block">Adds a target group criterion for the attribute certificate to the target information extension criteria.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html#addTargetName(org.bouncycastle.asn1.x509.GeneralName)">addTargetName</a></strong>(org.bouncycastle.asn1.x509.GeneralName&nbsp;name)</code> <div class="block">Adds a target name criterion for the attribute certificate to the target information extension criteria.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelector.html" title="class in org.bouncycastle.cert.selector">X509AttributeCertificateHolderSelector</a></code></td> <td class="colLast"><code><strong><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html#build()">build</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html#setAttributeCert(org.bouncycastle.cert.X509AttributeCertificateHolder)">setAttributeCert</a></strong>(<a href="../../../../org/bouncycastle/cert/X509AttributeCertificateHolder.html" title="class in org.bouncycastle.cert">X509AttributeCertificateHolder</a>&nbsp;attributeCert)</code> <div class="block">Set the attribute certificate to be matched.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html#setAttributeCertificateValid(java.util.Date)">setAttributeCertificateValid</a></strong>(java.util.Date&nbsp;attributeCertificateValid)</code> <div class="block">Set the time, when the certificate must be valid.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html#setHolder(org.bouncycastle.cert.AttributeCertificateHolder)">setHolder</a></strong>(<a href="../../../../org/bouncycastle/cert/AttributeCertificateHolder.html" title="class in org.bouncycastle.cert">AttributeCertificateHolder</a>&nbsp;holder)</code> <div class="block">Sets the holder.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html#setIssuer(org.bouncycastle.cert.AttributeCertificateIssuer)">setIssuer</a></strong>(<a href="../../../../org/bouncycastle/cert/AttributeCertificateIssuer.html" title="class in org.bouncycastle.cert">AttributeCertificateIssuer</a>&nbsp;issuer)</code> <div class="block">Sets the issuer the attribute certificate must have.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html#setSerialNumber(java.math.BigInteger)">setSerialNumber</a></strong>(java.math.BigInteger&nbsp;serialNumber)</code> <div class="block">Sets the serial number the attribute certificate must have.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html#setTargetGroups(java.util.Collection)">setTargetGroups</a></strong>(java.util.Collection&nbsp;names)</code> <div class="block">Adds a collection with target groups criteria.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html#setTargetNames(java.util.Collection)">setTargetNames</a></strong>(java.util.Collection&nbsp;names)</code> <div class="block">Adds a collection with target names criteria.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="X509AttributeCertificateHolderSelectorBuilder()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>X509AttributeCertificateHolderSelectorBuilder</h4> <pre>public&nbsp;X509AttributeCertificateHolderSelectorBuilder()</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="setAttributeCert(org.bouncycastle.cert.X509AttributeCertificateHolder)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setAttributeCert</h4> <pre>public&nbsp;void&nbsp;setAttributeCert(<a href="../../../../org/bouncycastle/cert/X509AttributeCertificateHolder.html" title="class in org.bouncycastle.cert">X509AttributeCertificateHolder</a>&nbsp;attributeCert)</pre> <div class="block">Set the attribute certificate to be matched. If <code>null</code> is given any will do.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>attributeCert</code> - The attribute certificate holder to set.</dd></dl> </li> </ul> <a name="setAttributeCertificateValid(java.util.Date)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setAttributeCertificateValid</h4> <pre>public&nbsp;void&nbsp;setAttributeCertificateValid(java.util.Date&nbsp;attributeCertificateValid)</pre> <div class="block">Set the time, when the certificate must be valid. If <code>null</code> is given any will do.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>attributeCertificateValid</code> - The attribute certificate validation time to set.</dd></dl> </li> </ul> <a name="setHolder(org.bouncycastle.cert.AttributeCertificateHolder)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setHolder</h4> <pre>public&nbsp;void&nbsp;setHolder(<a href="../../../../org/bouncycastle/cert/AttributeCertificateHolder.html" title="class in org.bouncycastle.cert">AttributeCertificateHolder</a>&nbsp;holder)</pre> <div class="block">Sets the holder. If <code>null</code> is given any will do.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>holder</code> - The holder to set.</dd></dl> </li> </ul> <a name="setIssuer(org.bouncycastle.cert.AttributeCertificateIssuer)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setIssuer</h4> <pre>public&nbsp;void&nbsp;setIssuer(<a href="../../../../org/bouncycastle/cert/AttributeCertificateIssuer.html" title="class in org.bouncycastle.cert">AttributeCertificateIssuer</a>&nbsp;issuer)</pre> <div class="block">Sets the issuer the attribute certificate must have. If <code>null</code> is given any will do.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>issuer</code> - The issuer to set.</dd></dl> </li> </ul> <a name="setSerialNumber(java.math.BigInteger)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setSerialNumber</h4> <pre>public&nbsp;void&nbsp;setSerialNumber(java.math.BigInteger&nbsp;serialNumber)</pre> <div class="block">Sets the serial number the attribute certificate must have. If <code>null</code> is given any will do.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>serialNumber</code> - The serialNumber to set.</dd></dl> </li> </ul> <a name="addTargetName(org.bouncycastle.asn1.x509.GeneralName)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>addTargetName</h4> <pre>public&nbsp;void&nbsp;addTargetName(org.bouncycastle.asn1.x509.GeneralName&nbsp;name)</pre> <div class="block">Adds a target name criterion for the attribute certificate to the target information extension criteria. The <code>X509AttributeCertificateHolder</code> must contain at least one of the specified target names. <p> Each attribute certificate may contain a target information extension limiting the servers where this attribute certificate can be used. If this extension is not present, the attribute certificate is not targeted and may be accepted by any server.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - The name as a GeneralName (not <code>null</code>)</dd></dl> </li> </ul> <a name="setTargetNames(java.util.Collection)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setTargetNames</h4> <pre>public&nbsp;void&nbsp;setTargetNames(java.util.Collection&nbsp;names) throws java.io.IOException</pre> <div class="block">Adds a collection with target names criteria. If <code>null</code> is given any will do. <p> The collection consists of either GeneralName objects or byte[] arrays representing DER encoded GeneralName structures.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>names</code> - A collection of target names.</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code> - if a parsing error occurs.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html#addTargetName(org.bouncycastle.asn1.x509.GeneralName)"><code>addTargetName(org.bouncycastle.asn1.x509.GeneralName)</code></a></dd></dl> </li> </ul> <a name="addTargetGroup(org.bouncycastle.asn1.x509.GeneralName)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>addTargetGroup</h4> <pre>public&nbsp;void&nbsp;addTargetGroup(org.bouncycastle.asn1.x509.GeneralName&nbsp;group)</pre> <div class="block">Adds a target group criterion for the attribute certificate to the target information extension criteria. The <code>X509AttributeCertificateHolder</code> must contain at least one of the specified target groups. <p> Each attribute certificate may contain a target information extension limiting the servers where this attribute certificate can be used. If this extension is not present, the attribute certificate is not targeted and may be accepted by any server.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>group</code> - The group as GeneralName form (not <code>null</code>)</dd></dl> </li> </ul> <a name="setTargetGroups(java.util.Collection)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setTargetGroups</h4> <pre>public&nbsp;void&nbsp;setTargetGroups(java.util.Collection&nbsp;names) throws java.io.IOException</pre> <div class="block">Adds a collection with target groups criteria. If <code>null</code> is given any will do. <p> The collection consists of <code>GeneralName</code> objects or <code>byte[]</code representing DER encoded GeneralNames.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>names</code> - A collection of target groups.</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.io.IOException</code> - if a parsing error occurs.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html#addTargetGroup(org.bouncycastle.asn1.x509.GeneralName)"><code>addTargetGroup(org.bouncycastle.asn1.x509.GeneralName)</code></a></dd></dl> </li> </ul> <a name="build()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>build</h4> <pre>public&nbsp;<a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelector.html" title="class in org.bouncycastle.cert.selector">X509AttributeCertificateHolderSelector</a>&nbsp;build()</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em><b>Bouncy Castle Cryptography Library 1.52</b></em></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelector.html" title="class in org.bouncycastle.cert.selector"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../org/bouncycastle/cert/selector/X509CertificateHolderSelector.html" title="class in org.bouncycastle.cert.selector"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html" target="_top">Frames</a></li> <li><a href="X509AttributeCertificateHolderSelectorBuilder.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
GaloisInc/hacrypto
src/Java/BouncyCastle/bcpkix-jdk15on-152/javadoc/org/bouncycastle/cert/selector/X509AttributeCertificateHolderSelectorBuilder.html
HTML
bsd-3-clause
20,476
/* iCheck plugin Square skin, black ----------------------------------- */ .icheckbox_square, .iradio_square { display: inline-block; *display: inline; vertical-align: middle; margin: 0; padding: 0; width: 22px; height: 22px; background: url(square.png) no-repeat; border: none; cursor: pointer; } .icheckbox_square { background-position: 0 0; } .icheckbox_square.hover { background-position: -24px 0; } .icheckbox_square.checked { background-position: -48px 0; } .icheckbox_square.disabled { background-position: -72px 0; cursor: default; } .icheckbox_square.checked.disabled { background-position: -96px 0; } .iradio_square { background-position: -120px 0; } .iradio_square.hover { background-position: -144px 0; } .iradio_square.checked { background-position: -168px 0; } .iradio_square.disabled { background-position: -192px 0; cursor: default; } .iradio_square.checked.disabled { background-position: -216px 0; } /* HiDPI support */ @media (-o-min-device-pixel-ratio: 5/4), (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi), (min-resolution: 1.25dppx) { .icheckbox_square, .iradio_square { background-image: url([email protected]); -webkit-background-size: 240px 24px; background-size: 240px 24px; } }
callcocam/zf2-puro
public_html/admin_assets/icheck/skins/square/square.css
CSS
bsd-3-clause
1,506
import pytest from py4jdbc.dbapi2 import connect, Connection from py4jdbc.resultset import ResultSet from py4jdbc.exceptions.dbapi2 import Error def test_connect(gateway): url = "jdbc:derby:memory:testdb;create=true" conn = connect(url, gateway=gateway) cur = conn.cursor() rs = cur.execute("select * from SYS.SYSTABLES") assert isinstance(rs, ResultSet) def test_execute(derby): cur = derby.cursor() rs = cur.execute("select * from SYS.SYSTABLES") assert isinstance(rs, ResultSet) def test_execute_with_params(derby): derby.autocommit = False cur = derby.cursor() cur.execute("create schema x_with_params") cur.execute("create table x_with_params.cowtest(a int, b char(1))") # Verify table is empty. rows = cur.execute("select * from x_with_params.cowtest as r").fetchall() assert len(rows) == 0 # Insert one with parameter binding.. sql = "insert into x_with_params.cowtest (a, b) values (?, ?)" cur.execute(sql, (12, "m")) # Verify there's 1 row. rows = cur.execute("select * from x_with_params.cowtest as r").fetchall() assert len(rows) == 1 # Insert a bunch. params = list(enumerate("thecowsaremooing")) cur.executemany(sql, params) rows = cur.execute("select * from x_with_params.cowtest as r").fetchall() assert len(rows) == len("thecowsaremooing") + 1 derby.rollback() derby.autocommit = True def test_fetchone(derby): cur = derby.cursor() rs = cur.execute("select * from SYS.SYSTABLES") assert isinstance(rs.fetchone(), rs.Row) def test_fetchmany(derby): '''Assert all rows of result set have the correct class. ''' cur = derby.cursor() rs = cur.execute("select * from SYS.SYSTABLES") assert all({isinstance(row, rs.Row) for row in rs.fetchmany(5)}) def test_fetchManyCount(derby): derby.autocommit = False cur = derby.cursor() cur.execute("create schema x_with_params") cur.execute("create table x_with_params.cowtest(a int, b char(1))") sql = "insert into x_with_params.cowtest (a, b) values (?, ?)" params = list(enumerate("thecowsaremooing")) cur.executemany(sql, params) rs = cur.execute("select a from x_with_params.cowtest") ress = [] while True: x = rs.fetchmany(3) ress.append(x) if len(x) < 3: break derby.rollback() derby.autocommit = True assert sum(map(len, ress)) == len("thecowsaremooing") def test_fetchall(derby): '''Assert all rows of result set have the correct class. ''' cur = derby.cursor() rs = cur.execute("select * from SYS.SYSTABLES") assert all({isinstance(row, rs.Row) for row in rs.fetchall()}) def test_Cursor__iter__(derby): cur = derby.cursor() rs = cur.execute("select * from SYS.SYSTABLES") assert all({isinstance(row, rs.Row) for row in rs}) def test_Cursor__iter__(derby): cur = derby.cursor() rs = cur.execute("select * from SYS.SYSTABLES") # Exhaust all rows. list(rs) assert rs.fetchone() == None def test_close_and_execute(derby): cur = derby.cursor() cur.close() with pytest.raises(Error): cur.execute("select * from SYS.SYSTABLES") def test_close_and_fetchone(derby): cur = derby.cursor() cur.execute("select * from SYS.SYSTABLES") cur.close() with pytest.raises(Error): cur.fetchone() def test_close_twice(derby): cur = derby.cursor() cur.close() with pytest.raises(Error): cur.close()
massmutual/py4jdbc
tests/test_Cursor.py
Python
bsd-3-clause
3,513
## How to be a contributor to this project ### Are you submitting a pull request? * Make sure to fill out an issue for your PR, so that we have traceability as to what you are trying to fix, versus how you fixed it. * Spaces (not tabs), and 2 of them, that's what we like. Set your code style :) * Sign the [Sonatype CLA](https://sonatypecla.herokuapp.com/sign-cla) * Try to fix one thing per pull request! Many people work on this code, so the more focused your changes are, the less of a headache other people will have when they merge their work in. * Ensure your Pull Request passes tests either locally or via CircleCI (it will run automatically on your PR) * Make sure to add yourself or your organization to CONTRIBUTORS.md as a part of your PR, if you are new to the project! * If you're stuck, ask our [gitter channel](https://gitter.im/sonatype/nexus-developers)! There are a number of experienced programmers who are happy to help with learning and troubleshooting. ### Are you new and looking to dive in? * Check our issues to see if there is something you can dive in to. * Come hang out with us at our [gitter channel](https://gitter.im/sonatype/nexus-developers).
OSSIndex/auditjs
.github/CONTRIBUTING.md
Markdown
bsd-3-clause
1,183
# writestream-promise Adds WriteStream.itsa_endPromise(): WriteStream.end() as a Promise.
ItsAsbreuk/writestream-promise
README.md
Markdown
bsd-3-clause
91
"""Unit-tests for `tree.visitors` """ from py2c import tree from py2c.tree import visitors from py2c.tests import Test, data_driven_test from nose.tools import assert_equal # TEST:: Add non-node fields # ============================================================================= # Helper classes # ============================================================================= class BasicNode(tree.Node): _fields = [] class BasicNodeReplacement(tree.Node): _fields = [] class BasicNodeWithListReplacement(tree.Node): _fields = [] class BasicNodeDeletable(tree.Node): _fields = [] class ParentNode(tree.Node): _fields = [ ('child', tree.Node, 'OPTIONAL'), ] class ParentNodeWithChildrenList(tree.Node): """Node with list of nodes as field """ _fields = [ ('child', tree.Node, 'ZERO_OR_MORE'), ] # ----------------------------------------------------------------------------- # Concrete Visitors used for testing # ----------------------------------------------------------------------------- class VisitOrderCheckingVisitor(visitors.RecursiveNodeVisitor): def __init__(self): super().__init__() self.visited = [] def generic_visit(self, node): self.visited.append(node.__class__.__name__) super().generic_visit(node) def visit_BasicNodeReplacement(self, node): self.visited.append("visited Copy!") class AccessPathCheckingVisitor(visitors.RecursiveNodeVisitor): def __init__(self): super().__init__() self.recorded_access_path = None def visit_BasicNode(self, node): self.recorded_access_path = self.access_path[:] class EmptyTransformer(visitors.RecursiveNodeTransformer): pass class VisitOrderCheckingTransformer(visitors.RecursiveNodeTransformer): def __init__(self): super().__init__() self.visited = [] def generic_visit(self, node): self.visited.append(node.__class__.__name__) return super().generic_visit(node) def visit_BasicNodeReplacement(self, node): self.visited.append("visited Copy!") return node class AccessPathCheckingTransformer(visitors.RecursiveNodeTransformer): def __init__(self): super().__init__() self.recorded_access_path = None def visit_BasicNode(self, node): self.recorded_access_path = self.access_path[:] return node class TransformationCheckingTransformer(visitors.RecursiveNodeTransformer): def visit_BasicNode(self, node): return BasicNodeReplacement() def visit_BasicNodeDeletable(self, node): return None # Delete this node def visit_BasicNodeReplacement(self, node): return self.NONE_DEPUTY # Replace this node with None def visit_BasicNodeWithListReplacement(self, node): return [BasicNode(), BasicNodeReplacement()] # ----------------------------------------------------------------------------- # Tests # ----------------------------------------------------------------------------- class TestRecursiveASTVisitor(Test): """py2c.tree.visitors.RecursiveNodeVisitor """ context = globals() @data_driven_test("visitors-visitor_order.yaml", prefix="visit order of ") def test_visit_order(self, node, order): to_visit = self.load(node) # The main stuff visitor = VisitOrderCheckingVisitor() retval = visitor.visit(to_visit) assert_equal(retval, None) assert_equal(visitor.visited, order) @data_driven_test("visitors-access_path.yaml", prefix="access path on visit of ") def test_access_path(self, node, access): to_visit = self.load(node) access_path = self.load(access) # The main stuff visitor = AccessPathCheckingVisitor() retval = visitor.visit(to_visit) assert_equal(retval, None) assert_equal(visitor.recorded_access_path, access_path) class TestRecursiveASTTransformer(Test): """py2c.tree.visitors.RecursiveNodeTransformer """ context = globals() @data_driven_test("visitors-visitor_order.yaml", prefix="empty transformer does not transform ") def test_empty_transformer(self, node, order): to_visit = self.load(node) # The main stuff visitor = EmptyTransformer() retval = visitor.visit(to_visit) assert_equal(to_visit, retval) @data_driven_test("visitors-visitor_order.yaml", prefix="visit order of ") def test_visit_order(self, node, order): to_visit = self.load(node) # The main stuff visitor = VisitOrderCheckingTransformer() retval = visitor.visit(to_visit) assert_equal(to_visit, retval) assert_equal(visitor.visited, order) @data_driven_test("visitors-access_path.yaml", prefix="access path on visit of ") def test_access_path(self, node, access): to_visit = self.load(node) access_path = self.load(access) # The main stuff visitor = AccessPathCheckingTransformer() retval = visitor.visit(to_visit) assert_equal(retval, to_visit) assert_equal(visitor.recorded_access_path, access_path) @data_driven_test("visitors-transform.yaml", prefix="transformation of ") def test_transformation(self, node, expected): to_visit = self.load(node) expected_node = self.load(expected) # The main stuff visitor = TransformationCheckingTransformer() retval = visitor.visit(to_visit) assert_equal(retval, expected_node) if __name__ == '__main__': from py2c.tests import runmodule runmodule()
pradyunsg/Py2C
py2c/tree/tests/test_visitors.py
Python
bsd-3-clause
5,659
<?php use yii\helpers\Html; use yii\widgets\ActiveForm; /* @var $this yii\web\View */ /* @var $model app\models\WindowSearch */ /* @var $form yii\widgets\ActiveForm */ ?> <div class="window-search"> <?php $form = ActiveForm::begin([ 'action' => ['index'], 'method' => 'get', ]); ?> <?= $form->field($model, 'id') ?> <?= $form->field($model, 'status_ventana') ?> <?= $form->field($model, 'status_cortina') ?> <?= $form->field($model, 'rain_sensor') ?> <?= $form->field($model, 'light_sensor') ?> <?= $form->field($model, 'voice_sensor') ?> <?php // echo $form->field($model, 'datetime') ?> <div class="form-group"> <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?> <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?> </div> <?php ActiveForm::end(); ?> </div>
CarlosTrinidad/VentanaIOT
views/window/_search.php
PHP
bsd-3-clause
913
from importlib import import_module from inspect import getdoc def attribs(name): mod = import_module(name) print name print 'Has __all__?', hasattr(mod, '__all__') print 'Has __doc__?', hasattr(mod, '__doc__') print 'doc: ', getdoc(mod) if __name__=='__main__': attribs('cairo') attribs('zope') attribs('A.B.C') import hacked class Object(object): pass opt = Object() opt.ignore_errors = False a, d = hacked.get_all_attr_has_docstr('/home/ali/ws-pydev/apidocfilter/A/B', '/home/ali/ws-pydev/apidocfilter/A/B/C', opt) print(a) print(d)
baharev/apidocfilter
check.py
Python
bsd-3-clause
702
#include "Statistics.hpp" #include "CaptureInstance.hpp" #include "MainWindow.hpp" #include "ui_Statistics.h" using namespace EPL_Viz; using namespace EPL_DataCollect; Statistics::Statistics(MainWindow *parent) : QDialog(parent), ui(new Ui::Statistics), mw(parent) { ui->setupUi(this); refresh(); } Statistics::~Statistics() { delete ui; } void Statistics::refresh() { CaptureInstance *ci = mw->getCaptureInstance(); auto stats = ci->getCycleBuilder()->getStats(); auto ihStats = ci->getInputHandler()->getStats(); ui->List->clear(); // Make sure not to devide by 0 if (stats.cycleCount == 0) stats.cycleCount = 1; if (ihStats.packetsParsed == 0) ihStats.packetsParsed = 1; if (ihStats.cyclesParsed == 0) ihStats.cyclesParsed = 1; QList<QTreeWidgetItem *> items; QTreeWidgetItem * pItem = nullptr; items.append(new QTreeWidgetItem({"Cycle count", std::to_string(stats.cycleCount).c_str()})); items.append(new QTreeWidgetItem({"Cycle count", std::to_string(stats.cycleCount).c_str()})); items.append(new QTreeWidgetItem({"Packet count", std::to_string(stats.packetCount).c_str()})); items.append(new QTreeWidgetItem({"Events count", std::to_string(stats.eventsCount).c_str()})); items.append(new QTreeWidgetItem({"Packet parsed", std::to_string(ihStats.packetsParsed).c_str()})); items.append(new QTreeWidgetItem({"Cycles parsed", std::to_string(ihStats.cyclesParsed).c_str()})); items.append(new QTreeWidgetItem({"Cycle Processing time", ""})); pItem = items.back(); items.append(new QTreeWidgetItem(pItem, {"Total", (std::to_string(stats.totalTime.count()) + " ns").c_str()})); items.append(new QTreeWidgetItem( pItem, {"Average", (std::to_string(stats.totalTime.count() / stats.cycleCount) + " ns").c_str()})); items.append(new QTreeWidgetItem({"Time waited for packets to be parsed", ""})); pItem = items.back(); items.append( new QTreeWidgetItem(pItem, {"Total", (std::to_string(stats.waitForPacketsTime.count()) + " ns").c_str()})); items.append(new QTreeWidgetItem( pItem, {"Average", (std::to_string(stats.waitForPacketsTime.count() / stats.cycleCount) + " ns").c_str()})); items.append(new QTreeWidgetItem({"Packets parsing time", ""})); pItem = items.back(); items.append( new QTreeWidgetItem(pItem, {"Total", (std::to_string(ihStats.timePacketsParsed.count()) + " ns").c_str()})); items.append(new QTreeWidgetItem( pItem, {"Average", (std::to_string(ihStats.timePacketsParsed.count() / ihStats.packetsParsed) + " ns").c_str()})); items.append(new QTreeWidgetItem({"Packets of a Cycle parsing time", ""})); pItem = items.back(); items.append( new QTreeWidgetItem(pItem, {"Total", (std::to_string(ihStats.timeCyclesParsed.count()) + " ns").c_str()})); items.append(new QTreeWidgetItem( pItem, {"Average", (std::to_string(ihStats.timeCyclesParsed.count() / ihStats.cyclesParsed) + " ns").c_str()})); ui->List->addTopLevelItems(items); ui->List->expandAll(); ui->List->header()->resizeSection(0, 275); }
epl-viz/EPL-Viz
libEPLViz/src/stats/Statistics.cpp
C++
bsd-3-clause
3,110
--- layout: organization category: national title: Sereolipi Nomadic Education Foundation Inc. impact_area: Children keywords: location_services: location_offices: website: www.thorntreeproject.org description: mission: | Our mission is to help educate the children of traditional nomadic families in Northern Samburu. We work to help more Samburu children go to school and receive the level of education they desire, whether that is primary school, high school, technical school, or college. With hard work, resourcefulness, and a little help from the outside world, the Samburu people have begun to create significant, meaningful, and measurable change by providing education for their children. The Thorn Tree Project exists to do all it can to support their efforts. Our mission comes from the Samburu people themselves. It is a privilege to be invited into the Samburu tribe, and we make sure that everything we do is in tune with their culture and aligned with their goals. We aim to have the smallest possible footprint in Samburu, maintaining our focus on education. cash_grants: grants: service_opp: services: learn: cont_relationship: salutation: first_name: last_name: title_contact_person: city: Troutman state: NC address: | PO Box 263 Troutman NC 28166 lat: 35.677955 lng: -80.879258 phone: ext: fax: email: preferred_contact: contact_person_intro: ---
flipside-org/penny-harvest
_posts/organizations/2015-01-12-O1135.md
Markdown
bsd-3-clause
1,408
/* This file is a part of JustLogic product which is distributed under the BSD 3-clause "New" or "Revised" License Copyright (c) 2015. All rights reserved. Authors: Vladyslav Taranov. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of JustLogic nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ using JustLogic.Core; using System.Collections.Generic; using UnityEngine; [UnitMenu("Vectors/Sqr Magnitude (Vector4)")] [UnitFriendlyName("Sqr Magnitude")] [UnitUsage(typeof(System.Single), HideExpressionInActionsList = true)] public class JLVector4SqrMagnitude : JLExpression { [Parameter(ExpressionType = typeof(Vector4))] public JLExpression OperandValue; public override object GetAnyResult(IExecutionContext context) { Vector4 opValue = OperandValue.GetResult<Vector4>(context); return opValue.SqrMagnitude(); } }
AqlaSolutions/JustLogic
Assets/JustLogicUnits/Generated/Vectors/JLVector4SqrMagnitude.cs
C#
bsd-3-clause
2,210
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_20) on Sat Oct 20 16:08:50 CDT 2012 --> <TITLE> I-Index </TITLE> <META NAME="date" CONTENT="2012-10-20"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="I-Index"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="index-8.html"><B>PREV LETTER</B></A>&nbsp; &nbsp;<A HREF="index-10.html"><B>NEXT LETTER</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../index.html?index-filesindex-9.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="index-9.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <A HREF="index-1.html">A</A> <A HREF="index-2.html">B</A> <A HREF="index-3.html">C</A> <A HREF="index-4.html">D</A> <A HREF="index-5.html">E</A> <A HREF="index-6.html">F</A> <A HREF="index-7.html">G</A> <A HREF="index-8.html">H</A> <A HREF="index-9.html">I</A> <A HREF="index-10.html">K</A> <A HREF="index-11.html">L</A> <A HREF="index-12.html">M</A> <A HREF="index-13.html">N</A> <A HREF="index-14.html">O</A> <A HREF="index-15.html">P</A> <A HREF="index-16.html">Q</A> <A HREF="index-17.html">R</A> <A HREF="index-18.html">S</A> <A HREF="index-19.html">T</A> <A HREF="index-20.html">U</A> <A HREF="index-21.html">V</A> <A HREF="index-22.html">W</A> <A HREF="index-23.html">X</A> <HR> <A NAME="_I_"><!-- --></A><H2> <B>I</B></H2> <DL> <DT><A HREF="../org/epri/pt2/gui/FuzzTestUtils.html#initFuzzTestsFromDatabase()"><B>initFuzzTestsFromDatabase()</B></A> - Method in class org.epri.pt2.gui.<A HREF="../org/epri/pt2/gui/FuzzTestUtils.html" title="class in org.epri.pt2.gui">FuzzTestUtils</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/fuzzer/RequestPanel.html#initRequestPacketTable()"><B>initRequestPacketTable()</B></A> - Method in class org.epri.pt2.fuzzer.<A HREF="../org/epri/pt2/fuzzer/RequestPanel.html" title="class in org.epri.pt2.fuzzer">RequestPanel</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/fuzzer/ResponsePanel.html#initResponsePacketTable()"><B>initResponsePacketTable()</B></A> - Method in class org.epri.pt2.fuzzer.<A HREF="../org/epri/pt2/fuzzer/ResponsePanel.html" title="class in org.epri.pt2.fuzzer">ResponsePanel</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/gui/StatusArea.html#initTabComponent(int, java.lang.String, org.epri.pt2.gui.TestExecutionTask)"><B>initTabComponent(int, String, TestExecutionTask)</B></A> - Method in class org.epri.pt2.gui.<A HREF="../org/epri/pt2/gui/StatusArea.html" title="class in org.epri.pt2.gui">StatusArea</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/InterfaceMapper.html" title="class in org.epri.pt2"><B>InterfaceMapper</B></A> - Class in <A HREF="../org/epri/pt2/package-summary.html">org.epri.pt2</A><DD>The InterfaceMapper class provides a static mapping method <A HREF="../org/epri/pt2/InterfaceMapper.html#getClass(org.epri.pt2.InterfaceType)"><CODE>InterfaceMapper.getClass(InterfaceType)</CODE></A> which returns an AbstractIfaceDO instance.<DT><A HREF="../org/epri/pt2/InterfaceMapper.html#InterfaceMapper()"><B>InterfaceMapper()</B></A> - Constructor for class org.epri.pt2.<A HREF="../org/epri/pt2/InterfaceMapper.html" title="class in org.epri.pt2">InterfaceMapper</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/InterfaceType.html" title="enum in org.epri.pt2"><B>InterfaceType</B></A> - Enum in <A HREF="../org/epri/pt2/package-summary.html">org.epri.pt2</A><DD>A list of permissible interface types.<DT><A HREF="../org/epri/pt2/gui/model/MyTableModel.html#isCellEditable(int, int)"><B>isCellEditable(int, int)</B></A> - Method in class org.epri.pt2.gui.model.<A HREF="../org/epri/pt2/gui/model/MyTableModel.html" title="class in org.epri.pt2.gui.model">MyTableModel</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/gui/model/TestCaseDOTableModel.html#isCellEditable(int, int)"><B>isCellEditable(int, int)</B></A> - Method in class org.epri.pt2.gui.model.<A HREF="../org/epri/pt2/gui/model/TestCaseDOTableModel.html" title="class in org.epri.pt2.gui.model">TestCaseDOTableModel</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/DO/AbstractIfaceDO.html#isConnected()"><B>isConnected()</B></A> - Method in class org.epri.pt2.DO.<A HREF="../org/epri/pt2/DO/AbstractIfaceDO.html" title="class in org.epri.pt2.DO">AbstractIfaceDO</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/proxy/ProxyController.html#isEnabled()"><B>isEnabled()</B></A> - Method in class org.epri.pt2.proxy.<A HREF="../org/epri/pt2/proxy/ProxyController.html" title="class in org.epri.pt2.proxy">ProxyController</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/fuzzer/request/SocketHandler.html#isErroredOrClosed()"><B>isErroredOrClosed()</B></A> - Method in class org.epri.pt2.fuzzer.request.<A HREF="../org/epri/pt2/fuzzer/request/SocketHandler.html" title="class in org.epri.pt2.fuzzer.request">SocketHandler</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/proxy/ProxyController.html#isFilteringEnabled()"><B>isFilteringEnabled()</B></A> - Method in class org.epri.pt2.proxy.<A HREF="../org/epri/pt2/proxy/ProxyController.html" title="class in org.epri.pt2.proxy">ProxyController</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/DO/PacketDO.html#isFuzzed()"><B>isFuzzed()</B></A> - Method in class org.epri.pt2.DO.<A HREF="../org/epri/pt2/DO/PacketDO.html" title="class in org.epri.pt2.DO">PacketDO</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/proxy/ProxyController.html#isFuzzingEnabled()"><B>isFuzzingEnabled()</B></A> - Method in class org.epri.pt2.proxy.<A HREF="../org/epri/pt2/proxy/ProxyController.html" title="class in org.epri.pt2.proxy">ProxyController</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/proxy/ProxyController.html#isInterceptEnabled()"><B>isInterceptEnabled()</B></A> - Method in class org.epri.pt2.proxy.<A HREF="../org/epri/pt2/proxy/ProxyController.html" title="class in org.epri.pt2.proxy">ProxyController</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/packetparser/treemodel/XMLNode.html#isLeaf()"><B>isLeaf()</B></A> - Method in class org.epri.pt2.packetparser.treemodel.<A HREF="../org/epri/pt2/packetparser/treemodel/XMLNode.html" title="class in org.epri.pt2.packetparser.treemodel">XMLNode</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/packetparser/treemodel/XMLTreeModel.html#isLeaf(java.lang.Object)"><B>isLeaf(Object)</B></A> - Method in class org.epri.pt2.packetparser.treemodel.<A HREF="../org/epri/pt2/packetparser/treemodel/XMLTreeModel.html" title="class in org.epri.pt2.packetparser.treemodel">XMLTreeModel</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/sniffer/PCAPEthListener.html#isOpen()"><B>isOpen()</B></A> - Method in class org.epri.pt2.sniffer.<A HREF="../org/epri/pt2/sniffer/PCAPEthListener.html" title="class in org.epri.pt2.sniffer">PCAPEthListener</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/sniffer/SnifferController.html#isOpen(org.epri.pt2.DO.DeviceDO)"><B>isOpen(DeviceDO)</B></A> - Method in class org.epri.pt2.sniffer.<A HREF="../org/epri/pt2/sniffer/SnifferController.html" title="class in org.epri.pt2.sniffer">SnifferController</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/sniffer/SnifferInterface.html#isOpen()"><B>isOpen()</B></A> - Method in interface org.epri.pt2.sniffer.<A HREF="../org/epri/pt2/sniffer/SnifferInterface.html" title="interface in org.epri.pt2.sniffer">SnifferInterface</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/reassembler/TcpLink.html#isProcessed()"><B>isProcessed()</B></A> - Method in class org.epri.pt2.reassembler.<A HREF="../org/epri/pt2/reassembler/TcpLink.html" title="class in org.epri.pt2.reassembler">TcpLink</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/fuzzer/request/SocketHandler.html#isReadyToSend()"><B>isReadyToSend()</B></A> - Method in class org.epri.pt2.fuzzer.request.<A HREF="../org/epri/pt2/fuzzer/request/SocketHandler.html" title="class in org.epri.pt2.fuzzer.request">SocketHandler</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/reassembler/TcpReassembler.html#isRunning()"><B>isRunning()</B></A> - Method in class org.epri.pt2.reassembler.<A HREF="../org/epri/pt2/reassembler/TcpReassembler.html" title="class in org.epri.pt2.reassembler">TcpReassembler</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/DO/DataTypeDO.html#isSelected()"><B>isSelected()</B></A> - Method in class org.epri.pt2.DO.<A HREF="../org/epri/pt2/DO/DataTypeDO.html" title="class in org.epri.pt2.DO">DataTypeDO</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/DO/FuzzTestDO.html#isSelected()"><B>isSelected()</B></A> - Method in class org.epri.pt2.DO.<A HREF="../org/epri/pt2/DO/FuzzTestDO.html" title="class in org.epri.pt2.DO">FuzzTestDO</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/DO/PacketDO.html#isSelected()"><B>isSelected()</B></A> - Method in class org.epri.pt2.DO.<A HREF="../org/epri/pt2/DO/PacketDO.html" title="class in org.epri.pt2.DO">PacketDO</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/DO/TestCaseDO.html#isSelected()"><B>isSelected()</B></A> - Method in class org.epri.pt2.DO.<A HREF="../org/epri/pt2/DO/TestCaseDO.html" title="class in org.epri.pt2.DO">TestCaseDO</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/sniffer/PCAPEthListener.html#isSnifferType(int)"><B>isSnifferType(int)</B></A> - Method in class org.epri.pt2.sniffer.<A HREF="../org/epri/pt2/sniffer/PCAPEthListener.html" title="class in org.epri.pt2.sniffer">PCAPEthListener</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/sniffer/SnifferInterface.html#isSnifferType(int)"><B>isSnifferType(int)</B></A> - Method in interface org.epri.pt2.sniffer.<A HREF="../org/epri/pt2/sniffer/SnifferInterface.html" title="interface in org.epri.pt2.sniffer">SnifferInterface</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/proxy/ProxyController.html#isSSLEnabled()"><B>isSSLEnabled()</B></A> - Method in class org.epri.pt2.proxy.<A HREF="../org/epri/pt2/proxy/ProxyController.html" title="class in org.epri.pt2.proxy">ProxyController</A> <DD>&nbsp; <DT><A HREF="../org/epri/pt2/packetparser/treemodel/XMLNode.html#isText()"><B>isText()</B></A> - Method in class org.epri.pt2.packetparser.treemodel.<A HREF="../org/epri/pt2/packetparser/treemodel/XMLNode.html" title="class in org.epri.pt2.packetparser.treemodel">XMLNode</A> <DD>&nbsp; </DL> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Index</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="index-8.html"><B>PREV LETTER</B></A>&nbsp; &nbsp;<A HREF="index-10.html"><B>NEXT LETTER</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../index.html?index-filesindex-9.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="index-9.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <A HREF="index-1.html">A</A> <A HREF="index-2.html">B</A> <A HREF="index-3.html">C</A> <A HREF="index-4.html">D</A> <A HREF="index-5.html">E</A> <A HREF="index-6.html">F</A> <A HREF="index-7.html">G</A> <A HREF="index-8.html">H</A> <A HREF="index-9.html">I</A> <A HREF="index-10.html">K</A> <A HREF="index-11.html">L</A> <A HREF="index-12.html">M</A> <A HREF="index-13.html">N</A> <A HREF="index-14.html">O</A> <A HREF="index-15.html">P</A> <A HREF="index-16.html">Q</A> <A HREF="index-17.html">R</A> <A HREF="index-18.html">S</A> <A HREF="index-19.html">T</A> <A HREF="index-20.html">U</A> <A HREF="index-21.html">V</A> <A HREF="index-22.html">W</A> <A HREF="index-23.html">X</A> <HR> </BODY> </HTML>
epri-dev/PT2
Documents/javadoc/index-files/index-9.html
HTML
bsd-3-clause
15,240
class Requirement(object): """ Requirements are the basis for Dominion. They define what needs to exist on a host/role, or perhaps what *mustn't* exist. Requirements are defined on Roles. """ creation_counter = 0 "The base class for requirements." def __init__(self, required=True, ensure=None, depends=None, post=None): self.required = required self.ensure = ensure or "exists" self.depends = depends or () if self.ensure == "removed": self.required = False self.post = post or () # Increase the creation counter, and save our local copy. self.creation_counter = Requirement.creation_counter Requirement.creation_counter += 1 def __call__(self): self.apply() def apply(self): if self.ensure == "exists" or self.required: if hasattr(self, 'install'): return self.install() if self.ensure == "removed": if hasattr(self, 'uninstall'): return self.uninstall()
paulcwatts/dominion
dominion/base.py
Python
bsd-3-clause
1,060
<?php use app\components\Formatter; use yii\helpers\Html; ?> <div class="rep-wrapper"> <div id="stats"> <div id="rep-page-container"> <table class="rep-table"> <tbody> <?php foreach ($reputes as $date => $repute): ?> <tr class="rep-table-row"> <td class="rep-cell"> <span class="rep-up"><?php echo $repute['total']; ?></span> </td> <td title="<?php echo $date; ?>" class="rep-day "> <a class="load-body expander-arrow-small-hide hide-body expander-arrow-small-show" style=""></a> <?php echo $date; ?> </td> </tr> <tr class="loaded-body"> <td style="height: 0px; padding: 0px;" class="body-container body-loaded" colspan="2"> <div style="display: block;"> <div class="rep-breakdown"> <table class="tbl-reputation"> <tbody> <?php foreach ($repute['list'] as $item): ?> <tr class="rep-breakdown-row rep-recent-row expandable-row"> <td class="rep-left"> <span class="rep-up"><?php echo $item->reputation; ?></span> </td> <td title="<?php echo Formatter::time($item->time); ?>" class="rep-time"><?php echo Formatter::ago($item->time); ?></td> <td class="rep-desc"><?php echo $item->lng; ?></td> <td class="rep-link async-load load-prepped"> <?php $url = $item->question->url; if ($item->apostid > 0) { $url .= '#' . $item->apostid; } echo Html::a(Html::encode($item->question->title), $url, array('class' => "answer-hyperlink")); ?> </td> </tr> <tr class="loaded-body"> <td colspan="4" class="body-container" style="padding: 0px;"></td> </tr> <?php endforeach; ?> </tbody> </table> </div> <script type="text/javascript"> $(function () { expandPostBody('.tbl-reputation td.rep-link.async-load:not(.load-prepped)', null, null, 4); }); </script> </div> </td> </tr> <?php endforeach; ?> </tbody> </table> <?= yii\widgets\LinkPager::widget(['pagination' => $pages, 'options' => ['id' => 'reputation-pager', 'class' => 'pagination']]); ?> <script type="text/javascript"> var reputationView = 'post'; var reputationPageSize = 30; $(function () { expandPostBody('.rep-table td.async-load:not(.load-prepped)', '', null, 2); if (!$('.rep-day .expander-arrow-small-hide').length) $(".rep-table .load-body").slice(0, 3).click(); }); </script> </div> </div> </div>
snowpine/qanswer
modules/user/views/view/_view-reputation.php
PHP
bsd-3-clause
4,322
include ../../Library/GNU.mk Title= libzip Name= libzip Version= 0.12.2 Revision= 0 Site= http://nih.at/libzip/ Source= http://nih.at/libzip//$(Name)-$(Version).tar.bz2 License= BSD LicenseFile= $(SourceDir)/LICENSE define test_inner_hook /usr/local/bin/zipcmp -h /usr/local/bin/zipmerge -h endef
FelixZhang00/rudix
Ports/libzip/Makefile
Makefile
bsd-3-clause
304
package registry import ( "crypto/tls" "fmt" "log" "net/http" "strings" ) type LogfCallback func(format string, args ...interface{}) /* * Discard log messages silently. */ func Quiet(format string, args ...interface{}) { /* discard logs */ } /* * Pass log messages along to Go's "log" module. */ func Log(format string, args ...interface{}) { log.Printf(format, args...) } type Registry struct { URL string Client *http.Client Logf LogfCallback } /* * Create a new Registry with the given URL and credentials, then Ping()s it * before returning it to verify that the registry is available. * * You can, alternately, construct a Registry manually by populating the fields. * This passes http.DefaultTransport to WrapTransport when creating the * http.Client. */ func New(registryURL, username, password string) (*Registry, error) { transport := http.DefaultTransport return newFromTransport(registryURL, username, password, transport, Log) } /* * Create a new Registry, as with New, using an http.Transport that disables * SSL certificate verification. */ func NewInsecure(registryURL, username, password string) (*Registry, error) { transport := &http.Transport{ TLSClientConfig: &tls.Config{ // TODO: Why? InsecureSkipVerify: true, //nolint:gosec }, } return newFromTransport(registryURL, username, password, transport, Log) } /* * Given an existing http.RoundTripper such as http.DefaultTransport, build the * transport stack necessary to authenticate to the Docker registry API. This * adds in support for OAuth bearer tokens and HTTP Basic auth, and sets up * error handling this library relies on. */ func WrapTransport(transport http.RoundTripper, url, username, password string) http.RoundTripper { tokenTransport := &TokenTransport{ Transport: transport, Username: username, Password: password, } basicAuthTransport := &BasicTransport{ Transport: tokenTransport, URL: url, Username: username, Password: password, } errorTransport := &ErrorTransport{ Transport: basicAuthTransport, } return errorTransport } func newFromTransport(registryURL, username, password string, transport http.RoundTripper, logf LogfCallback) (*Registry, error) { url := strings.TrimSuffix(registryURL, "/") transport = WrapTransport(transport, url, username, password) registry := &Registry{ URL: url, Client: &http.Client{ Transport: transport, }, Logf: logf, } if err := registry.Ping(); err != nil { return nil, err } return registry, nil } func (r *Registry) url(pathTemplate string, args ...interface{}) string { pathSuffix := fmt.Sprintf(pathTemplate, args...) url := fmt.Sprintf("%s%s", r.URL, pathSuffix) return url } func (r *Registry) Ping() error { url := r.url("/v2/") r.Logf("registry.ping url=%s", url) resp, err := r.Client.Get(url) if resp != nil { defer resp.Body.Close() } return err }
heroku/docker-registry-client
registry/registry.go
GO
bsd-3-clause
2,915
/* CoAP on Moterunner Demonstration * Copyright (c) 2013-2014, SAP AG * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - Neither the name of the SAP AG nor the names of its contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL SAP BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Contributors: * Matthias Thoma * Martin Zabel * Theofilos Kakantousis * * The following things need to be added before any public release: * 3. Consider to add TTL / Resend stuff (see hellosensor.java) * 4. Have a look at rules for message id and consider to move it either here or to some generic class */ package com.sap.coap; import com.ibm.saguaro.system.*; import com.ibm.iris.*; import com.ibm.saguaro.mrv6.*; //##if LOGGING import com.ibm.saguaro.logger.*; //##endif public class Message { public byte[] header = new byte[4]; public byte[] token = null; public byte[] payload = null; public int payloadLength = 0; public byte[] options; public int optionArraySize = 0; public int roundCounter = 0; @Immutable public static final byte CON = 0x00; @Immutable public static final byte NON = 0x01; @Immutable public static final byte ACK = 0x02; @Immutable public static final byte RST = 0x03; @Immutable public static final byte EMPTY = 0x00; @Immutable public static final byte GET = 0x01; @Immutable public static final byte POST = 0x02; @Immutable public static final byte PUT = 0x03; @Immutable public static final byte DELETE = 0x04; public final void setPayload(byte[] mypayload){ this.payload = mypayload; this.payloadLength = mypayload.length; } public Message() { header[0] = 0x40; // set the version number } /// <summary> /// Constructor. /// </summary> /// <param name="type"> something </param> /// <param name="tokenLen"> token legnth </param> /// <param name="code"> CoAP message code </param> /// <param name="msgid"> CoAP message id </param> public Message(byte type, byte tokenLen, byte code, int msgid) { setMessageHeader(type, tokenLen, code, msgid); } public final void setMessageHeader(byte type, byte tokenLen, byte code, int msgid) { header[0] = (byte) ((0x40 | (type << 4)) | tokenLen); header[1] = code; Util.set16be(header,2,msgid); } public static byte createResponseCode(final byte cl, final byte cc) { return (byte) ((cl << 5) | cc); } public final byte getVersion() { return (byte) ((header[0] >>> 6) & 0x03); } public final byte getType() { return (byte) ((header[0] & 0x30) >> 4); } public final void setType(final byte type) { byte tl = (byte) (header [0] & 0x0F); header[0] = (byte) ((0x40 | (type << 4)) | tl); // set the version number } public final byte getTokenLength() { return (byte) (header[0] & 0x0F); } public final byte getCode() { return header[1]; } public final int getMessageId() { return Util.get16be(header,2); } public final void clearOptions() { options=null; optionArraySize=0; } public final void clearPayload() { payloadLength = 0; payload = null; } public final byte[] getPayload() { return this.payload; } public final int getPayloadSize() { return this.payloadLength; } public byte[] getURIfromOptionArray() { int partNo = 0; int bufferOffset = 0; int offset = getOffsetOfOptionWithId(11, partNo); if (offset<0) return null; int bufferSize = 0; // Calculate buffer size int firstOffset = offset; while (offset>=0) { if (partNo>0) bufferSize++; int valueSize = getValueSizeOfOptionWithOffset(offset); bufferSize += valueSize; partNo++; offset = getOffsetOfOptionWithId(11, partNo); } byte[] buffer = new byte[bufferSize]; partNo=0; offset = getOffsetOfOptionWithId(11, partNo); int valueSize = getValueSizeOfOptionWithOffset(offset); byte[] data = getValueOfOptionWithOffset(offset); while (data != null) { if (partNo>0) { buffer[bufferOffset]='/'; bufferOffset++; } partNo++; Util.copyData(data, 0, buffer, bufferOffset, valueSize); bufferOffset += valueSize; offset = getOffsetOfOptionWithId(11, partNo); data = null; if (offset>=0) { valueSize = getValueSizeOfOptionWithOffset(offset); data = getValueOfOptionWithOffset(offset); } } return buffer; } public boolean hasOption(int id) { return (getOffsetOfOptionWithId(id,0) != -1); } public void insertOption(int id, byte[] value, int valueSize) { //1. find position // an ascending order of the options has to be kept // find start offsets of the 'enclosing' options left and right of the one to insert // special case: inserting at the beginning: offsetRightOption = 0 // special case: inserting at the end: offsetRightOption = optionArraySize (i.e. points behind the array) int offsetRightOption = 0; int idRightOption = 0; int idLeftOption = 0; while(offsetRightOption < optionArraySize) { //if the loop is not left by a break, the option has to be inserted at the end idRightOption = idOfOptionWithOffset(options, offsetRightOption, idRightOption); if(idRightOption > id) { //insertion point found break; } idLeftOption = idRightOption; offsetRightOption = findOffsetOfNextOption(options, offsetRightOption); } //2. calculate value length field size for this option int optionExtendedLengthFieldSize = getExtendedOptionFieldSizeFor(valueSize); //3. calculate delta value for this option. // depends on the previous id (being 0 when no previous option exists) int delta = id - idLeftOption; //4. calculate delta field size for this option int optionExtendedDeltaFieldSize = getExtendedOptionFieldSizeFor(delta); //5. recalculate the delta field size for the next option // the delta value for the next option decreases due to the insertion // this may result in less bytes being used for the size field int deltaFieldSizeRightOption = 0; int deltaFieldSizeRightOptionNew = 0; int deltaRightOptionNew = 0; int extendedDeltaFieldSizeDifferenceRightOption = 0; //only if a next option exists if(offsetRightOption != optionArraySize) { //get the old field size for the next option deltaFieldSizeRightOption = optionExtendedDeltaFieldSize(options, offsetRightOption); //recalculate delta field size for next option deltaRightOptionNew = idRightOption - id; deltaFieldSizeRightOptionNew = getExtendedOptionFieldSizeFor(deltaRightOptionNew); //determine the size difference between the new and the old field extendedDeltaFieldSizeDifferenceRightOption = deltaFieldSizeRightOption - deltaFieldSizeRightOptionNew; } //7. calculate total size of new option array int optionArraySizeNew = optionArraySize + 1 + optionExtendedLengthFieldSize + optionExtendedDeltaFieldSize + valueSize - extendedDeltaFieldSizeDifferenceRightOption; //8. allocate mem for new option array byte[] optionsNew = new byte[optionArraySizeNew]; //9. copy options until insertion point to new array if(offsetRightOption>0) { Util.copyData(options, 0, optionsNew, 0, offsetRightOption); } int currentOffset = offsetRightOption; //next position to read from the old options where no additional option is present. points now to the header byte of the next option int offsetFirstByte = offsetRightOption; //points to the header byte of the option to insert int currentOffsetNew = offsetFirstByte+1; //next position to write in the new array (after the header byte of the option to insert) //10. write delta if(optionExtendedDeltaFieldSize == 1) { optionsNew[offsetFirstByte] += 13 << 4; optionsNew[currentOffsetNew] = (byte)(delta-13); } else if(optionExtendedDeltaFieldSize == 2) { optionsNew[offsetFirstByte] += 14 << 4; Util.set16(optionsNew, currentOffsetNew, delta-269); } else { //optionExtendedDeltaFieldSize == 0 optionsNew[offsetFirstByte] += delta << 4; } currentOffsetNew += optionExtendedDeltaFieldSize; //11. write value length if(optionExtendedLengthFieldSize == 1) { optionsNew[offsetFirstByte] += 13; optionsNew[currentOffsetNew] = (byte)(valueSize-13); } else if(optionExtendedLengthFieldSize == 2) { optionsNew[offsetFirstByte] += 14; Util.set16(optionsNew, currentOffsetNew, valueSize-269); } else { //optionExtendedLengthFieldSize == 0 optionsNew[offsetFirstByte] += valueSize; } currentOffsetNew += optionExtendedLengthFieldSize; //12. copy value if(valueSize>0) { Util.copyData(value, 0, optionsNew, currentOffsetNew, valueSize); } currentOffsetNew += valueSize; //only if a next option exists if(offsetRightOption != optionArraySize) { //13. write header of next option with adjusted delta //length stays constant, delta is erased optionsNew[currentOffsetNew] = (byte) (options[currentOffset] & 0x0F); //write recalculated delta to the next option if(deltaFieldSizeRightOptionNew == 1) { optionsNew[currentOffsetNew] += 13 << 4; optionsNew[currentOffsetNew+1] = (byte) (deltaRightOptionNew-13); } else if(deltaFieldSizeRightOptionNew == 2){ optionsNew[currentOffsetNew] += 14 << 4; Util.set16(optionsNew, currentOffsetNew+1, deltaRightOptionNew-269); } else { //deltaFieldSizeRightOptionNew == 0 optionsNew[currentOffsetNew] += deltaRightOptionNew << 4; } //jump behind the next option's extended delta field delta in the new array currentOffsetNew += 1+deltaFieldSizeRightOptionNew; //jump behind the next option's extended delta field in the old array currentOffset += 1+deltaFieldSizeRightOption; //14. copy rest of array (= next option's extended value length field, next option's value, all subsequent options) int restLength = optionArraySize - currentOffset; Util.copyData(options, currentOffset, optionsNew, currentOffsetNew, restLength); } //15. replace old options by new options = optionsNew; optionArraySize = optionArraySizeNew; } public int getOffsetOfOptionWithId(int wantedOptionId, int matchNumber) { int currentOptionOffset = 0; int currentDelta = 0; while(currentOptionOffset < optionArraySize) { int currentOptionId = idOfOptionWithOffset(options, currentOptionOffset, currentDelta); if(currentOptionId == wantedOptionId) { //first of the options has been found. iterate them until the right match number is found for(int i = 0; i<matchNumber; i++) { currentOptionOffset = findOffsetOfNextOption(options, currentOptionOffset); if(currentOptionOffset == optionArraySize || (options[currentOptionOffset] & 0xF0) != 0x00) { return -1; //array length has been exceeded or the delta is not 0, i.e. an option with an higher id was found } } return currentOptionOffset; } if(currentOptionId > wantedOptionId) { return -1; } currentDelta = currentOptionId; currentOptionOffset = findOffsetOfNextOption(options, currentOptionOffset); } return -1; } public byte[] getValueOfOptionWithOffset(int offset) { int valueSize = getValueSizeOfOptionWithOffset(options, offset); int headerSize = headerSizeOfOptionWithOffset(options, offset); offset += headerSize; byte[] value = new byte[valueSize]; if(valueSize>0) { Util.copyData(options, offset, value, 0, valueSize); } return value; } public int getValueSizeOfOptionWithOffset(int offset) { return getValueSizeOfOptionWithOffset(options, offset); } public void removeOptionWithOffset(int offset) { //1. get delta of this option int delta = idOfOptionWithOffset(options, offset, 0); //this method with 0 as previous delta gives just the delta of this option //2. get length of the block to remove int optionSize = headerSizeOfOptionWithOffset(options, offset) + getValueSizeOfOptionWithOffset(options, offset); //3. recalculate next option's new delta value int offsetRightOption = offset + optionSize; //same as findOffsetOfNextOption(options, offset); int deltaRightOption; int deltaFieldSizeRightOption = 0; int deltaRightOptionNew = 0; int deltaFieldSizeRightOptionNew = 0; int deltaFieldSizeDifferenceRightOption = 0; if(offsetRightOption != optionArraySize) { //get the old field size for the next option deltaRightOption = idOfOptionWithOffset(options, offsetRightOption, 0); //this method with 0 as previous delta gives just the delta of this option deltaFieldSizeRightOption = optionExtendedDeltaFieldSize(options, offsetRightOption); //recalculate delta field size for next option deltaRightOptionNew = delta + deltaRightOption; deltaFieldSizeRightOptionNew = getExtendedOptionFieldSizeFor(deltaRightOptionNew); //determine the size difference between the new and the old field deltaFieldSizeDifferenceRightOption = deltaFieldSizeRightOptionNew - deltaFieldSizeRightOption; } //6. calculate new array size int optionArraySizeNew = optionArraySize - optionSize + deltaFieldSizeDifferenceRightOption; //7. allocate mem for new option array byte[] optionsNew = new byte[optionArraySizeNew]; //8. copy old option array to the start of the option to remove if (offset>0) Util.copyData(options, 0, optionsNew, 0, offset); int offsetNew = offset; offset += optionSize; //only if a next option exists if(offsetRightOption != optionArraySize) { //9. write new delta for next option //length stays constant, delta is erased optionsNew[offsetNew] = (byte) (options[offset] & 0x0F); //write recalculated delta to the next option if(deltaFieldSizeRightOptionNew == 1) { optionsNew[offsetNew] += 13 << 4; optionsNew[offsetNew+1] = (byte) (deltaRightOptionNew-13); } else if(deltaFieldSizeRightOptionNew == 2){ optionsNew[offsetNew] += 14 << 4; Util.set16(optionsNew, offsetNew+1, deltaRightOptionNew-269); } else { //deltaFieldSizeRightOptionNew == 0 optionsNew[offsetNew] += deltaRightOptionNew << 4; } //jump behind the next option's extended delta field delta in the new array offsetNew += 1+deltaFieldSizeRightOptionNew; //jump behind the next option's extended delta field in the old array offset += 1+deltaFieldSizeRightOption; //10. copy rest of the array int restLength = optionArraySizeNew - offsetNew; Util.copyData(options, offset, optionsNew, offsetNew, restLength); } options = optionsNew; optionArraySize = optionArraySizeNew; } public void removeOptionWithId(int id, int matchNumber) { int offset = getOffsetOfOptionWithId(id, matchNumber); removeOptionWithOffset(offset); } public byte[] valueOfOptionWithId(int id, int no) { int partNo = 0; int offset = getOffsetOfOptionWithId(id, no); if (offset>=0) { int valueSize = getValueSizeOfOptionWithOffset(offset); byte[] data = getValueOfOptionWithOffset(offset); return data; } return null; } public int findOffsetOfNextOption(int offset) { return findOffsetOfNextOption(this.options, offset); } public int idOfOptionWithOffset(int offset, int currentDelta) { return idOfOptionWithOffset(this.options, offset, currentDelta); } public void encodeTo(byte[] buffer, int offset) { int iOffset = 0; Util.copyData(header, 0, buffer, offset, 4); iOffset+=4; byte tokenLength = this.getTokenLength(); if (tokenLength > 0) { Util.copyData(token,0, buffer, offset+iOffset, tokenLength); iOffset += tokenLength; } if (optionArraySize>0) { Util.copyData(options, 0, buffer, offset+iOffset, optionArraySize); iOffset += optionArraySize; } if (this.payloadLength!=0) { buffer[offset+iOffset] = (byte) 0xFF; iOffset++; Util.copyData(this.payload,0, buffer, offset+iOffset, this.payloadLength); } } // // Return: // 0: OK // -1: Protocol error // -2: Currently unsupported feature public byte decode(byte[] inBuffer, int offset, int len) { //##if LOGGING Logger.appendString(csr.s2b("CoAPDecode :: ENTER DECODE")); Logger.flush(Mote.INFO); //##endif int inOffset = offset; int endLen = offset+len; payloadLength = 0; Util.copyData(inBuffer, offset, header, 0, 4); inOffset += 4; // Read token byte tokenLength = getTokenLength(); if(tokenLength > 8) { return -1; } if(inOffset == -1) { return -1; } //##if LOGGING Logger.appendString(csr.s2b("CoAPDecode :: token len")); Logger.appendInt(tokenLength); Logger.flush(Mote.INFO); //##endif if (tokenLength>0) { token = new byte[tokenLength]; Util.copyData(inBuffer, inOffset, token, 0, tokenLength); } inOffset += tokenLength; // Check if end of Message if (inOffset >= endLen) // Zero length Message, zero options return 0; //##if LOGGING Logger.appendString(csr.s2b("CoAPDecode :: start reading options ")); Logger.flush(Mote.INFO); //##endif // Check if payload marker or options int optionOffset = inOffset; inOffset = jumpOverOptions(inBuffer, inOffset, endLen); if(inOffset == -1) { return -1; } //##if LOGGING Logger.appendString(csr.s2b("CoAPDecode :: new offset")); Logger.appendInt(inOffset); Logger.appendString(csr.s2b("CoAPDecode :: endlen")); Logger.appendInt(endLen); Logger.flush(Mote.INFO); //##endif optionArraySize = inOffset - optionOffset; //may be 0 if no options are given options = new byte[optionArraySize]; if(optionArraySize > 0) { Util.copyData(inBuffer, optionOffset, options, 0, optionArraySize); } //##if LOGGING Logger.appendString(csr.s2b("CoAPDecode :: end reading options ")); Logger.flush(Mote.INFO); //##endif if (inOffset == endLen) { // Zero length Message //##if LOGGING Logger.appendString(csr.s2b("CoAPDecode :: no payload ")); Logger.flush(Mote.INFO); //##endif return 0; } if (inBuffer[inOffset] == (byte) 0xFF) { inOffset++; if(inOffset == endLen) { //protocol error: there is no payload though the marker indicates //##if LOGGING Logger.appendString(csr.s2b("CoAPDecode :: protocol error ")); Logger.flush(Mote.INFO); //##endif return -1; } // Payload payloadLength = endLen-inOffset; payload = new byte[payloadLength]; Util.copyData(inBuffer, inOffset, payload, 0, payloadLength); } else { inOffset++; if(inOffset < endLen) { //protocol error: there is payload though there is no marker //##if LOGGING Logger.appendString(csr.s2b("CoAPDecode :: protocol error ")); Logger.flush(Mote.INFO); //##endif return -1; } } return 0; } public final int getMessageLength() { int len=4+getTokenLength(); if (this.payloadLength!=0) len += 1+payloadLength; len += optionArraySize; return len; } public final Packet prepareResponseForSourcePacket(int inDstPort, byte[] inDstAddr, byte[] inSrcAddr, int srcPort) { int dstport = inDstPort; int lenp = getMessageLength(); Packet tempPacket = Mac.getPacket(); tempPacket.release(); Address.copyAddress(inDstAddr, 0, tempPacket.dstaddr, 0); Address.copyAddress(inSrcAddr, 0, tempPacket.srcaddr, 0); tempPacket.create(dstport, srcPort, lenp); encodeTo(tempPacket.payloadBuf, tempPacket.payloadOff); return tempPacket; } private static int jumpOverOptions(byte[] inBuffer, int offset, int len) { int nextOptionOffset = offset; while(nextOptionOffset < len && inBuffer[nextOptionOffset] != (byte) 0xFF) { // checking for protocol violation -- one of the nibbles is F but it's not the payload marker // check belongs only here since the first time parsing of a received message happens here if( (inBuffer[offset] & 0x0F) == 0x0F || (inBuffer[offset] & 0xF0) == 0xF0 ) { return -1; } nextOptionOffset = findOffsetOfNextOption(inBuffer, nextOptionOffset); } return nextOptionOffset; } private static int findOffsetOfNextOption(byte[] inBuffer, int offset) { int headerSize = headerSizeOfOptionWithOffset(inBuffer, offset); int valueSize = getValueSizeOfOptionWithOffset(inBuffer, offset); int currentOptionSize = headerSize + valueSize; return offset + currentOptionSize; } private static int headerSizeOfOptionWithOffset(byte[] inBuffer, int offset) { int size = 1; size += optionExtendedDeltaFieldSize(inBuffer, offset); size += optionExtendedLengthFieldSize(inBuffer, offset); return size; } private static int optionExtendedDeltaFieldSize(byte[] inBuffer, int offset) { byte optionDelta = (byte) (((inBuffer[offset] & 0xF0) >> 4)); if(optionDelta < 13) return 0; if(optionDelta == 13) return 1; return 2; //optionDelta == 14 } private static int optionExtendedLengthFieldSize(byte[] inBuffer, int offset) { byte optionLength = (byte) (inBuffer[offset] & 0x0F); if(optionLength < 13) return 0; if(optionLength == 13) return 1; return 2; //optionLength == 14 } private static int getValueSizeOfOptionWithOffset(byte[] inBuffer, int offset) { byte optionLength = (byte) (inBuffer[offset] & 0x0F); if(optionLength < 13) return optionLength; else { offset += 1 + optionExtendedDeltaFieldSize(inBuffer, offset); if(optionLength == 13) { return inBuffer[offset] + 13; } return Util.get16(inBuffer, offset) + 269; //optionLength == 14 } } private static int idOfOptionWithOffset(byte[] inBuffer, int offset, int currentDelta) { byte optionDelta = (byte) (((inBuffer[offset] & 0xF0) >> 4)); if(optionDelta < 13) return currentDelta + optionDelta; else { offset += 1; if(optionDelta == 13) { return currentDelta + inBuffer[offset] + 13; } return currentDelta + Util.get16(inBuffer, offset) + 269; //optionDelta == 14 } } private static int getExtendedOptionFieldSizeFor(int input) { if(input<13) return 0; else if(input >= 13 && input < 269) return 1; return 2; //input >= 269 } }
MR-CoAP/CoAP
src/com/sap/coap/Message.java
Java
bsd-3-clause
26,430
/* Copyright (c) Robert Adams * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * The name of the copyright holder may not be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // #include "StdAfx.h" #include "OLPreloadArchive.h" #include "OgreFileSystem.h" #include "LookingGlassOgre.h" #include "RendererOgre.h" namespace LG { OLPreloadArchive::OLPreloadArchive( const Ogre::String& name, const Ogre::String& archType ) : Ogre::Archive(name, archType) { LG::Log("OLPreloadArchive creation: n=%s, t=%s", name.c_str(), archType.c_str()); m_FSArchive = NULL; return; } OLPreloadArchive::~OLPreloadArchive(void) { unload(); } /// Get the name of this archive // const String& OLPreloadArchive::getName(void) const { return mName; } /// Returns whether this archive is case sensitive in the way it matches files bool OLPreloadArchive::isCaseSensitive(void) const { return m_FSArchive->isCaseSensitive(); } // Loads the archive. void OLPreloadArchive::load() { // this is really a wrapper for a filesystem archive LG::Log("OLPreloadArchive::load(): mName=%s", mName.c_str()); m_defaultMeshFilename = LG::GetParameter("Renderer.Ogre.DefaultMeshFilename"); LG::Log("OLPreloadArchive::load(): DefaultMeshFile=%s", m_defaultMeshFilename.c_str()); m_defaultTextureFilename = LG::GetParameter("Renderer.Ogre.DefaultTextureFilename"); LG::Log("OLPreloadArchive::load(): DefaultTextureFile=%s", m_defaultTextureFilename.c_str()); m_FSArchive = OGRE_NEW Ogre::FileSystemArchive(mName, "XXOLFilesystem"); m_FSArchive->load(); } // Unloads the archive. void OLPreloadArchive::unload() { Ogre::ArchiveManager::getSingleton().unload(m_FSArchive); } // The preloaded entities are in a filesystem without the grid name at the beginning. // This routine strips the grid name of the beginning and looks for the file. Ogre::DataStreamPtr OLPreloadArchive::open(const Ogre::String& filename, bool readonly) const { LG::Log("OLPreloadArchive::open(%s)", filename.c_str()); Ogre::String entityName = ExtractEntityFromFilename(filename); if (m_FSArchive->exists(entityName)) { return m_FSArchive->open(entityName); } // if the file doesn't exist, we shouldn't have been asked for it LG::Log("OLPreloadArchive::open(): the entity didn't exist!!!!. '%s'", entityName.c_str()); return Ogre::DataStreamPtr(new Ogre::MemoryDataStream(10)); } Ogre::DataStreamPtr OLPreloadArchive::open(const Ogre::String& filename) const { return this->open(filename, true); } // List all file names in the archive. Ogre::StringVectorPtr OLPreloadArchive::list(bool recursive, bool dirs) { LG::Log("OLPreloadArchive::list()"); return m_FSArchive->list(recursive, dirs); } // List all files in the archive with accompanying information. Ogre::FileInfoListPtr OLPreloadArchive::listFileInfo(bool recursive, bool dirs) { LG::Log("OLPreloadArchive::listFileInfo()"); return m_FSArchive->listFileInfo(recursive, dirs); } Ogre::// Find all file or directory names matching a given pattern StringVectorPtr OLPreloadArchive::find(const Ogre::String& pattern, bool recursive, bool dirs) { LG::Log("OLPreloadArchive::find(%s)", pattern.c_str()); return m_FSArchive->find(pattern, recursive, dirs); } // Find out if the named file exists (note: fully qualified filename required) */ bool OLPreloadArchive::exists(const Ogre::String& filename) { // Ogre::String entityName = ExtractEntityFromFilename(filename); // bool answer = m_FSArchive->exists(ExtractEntityFromFilename(filename)); // LG::Log("OLPreloadArchive::exists(%s)(%s)(%s)", filename.c_str(), // entityName.c_str(), answer ? "exists" : "does not exist"); // return answer; return m_FSArchive->exists(ExtractEntityFromFilename(filename)); } // Retrieve the modification time of a given file */ time_t OLPreloadArchive::getModifiedTime(const Ogre::String& filename) { return m_FSArchive->getModifiedTime(ExtractEntityFromFilename(filename)); } // Find all files or directories matching a given pattern in this Ogre::FileInfoListPtr OLPreloadArchive::findFileInfo(const Ogre::String& pattern, bool recursive, bool dirs) { return m_FSArchive->findFileInfo(pattern, recursive, dirs); } const Ogre::String& OLPreloadArchiveFactory::getType(void) const { static Ogre::String name = OLPreloadTypeName; return name; } Ogre::Archive* OLPreloadArchiveFactory::createInstance( const Ogre::String& name ) { LG::Log("OLPreloadArchiveFactory::createInstance(%s)", name.c_str()); return OGRE_NEW OLPreloadArchive(name, OLPreloadTypeName); } // The filename passed to us has the grid name at the beginning. Remove that and // return the result. We presume it's everything up the slash. Ogre::String OLPreloadArchive::ExtractEntityFromFilename(Ogre::String filename) const { int pos = filename.find("/"); if (pos > 0) { return filename.substr(pos + 1); } return Ogre::String(""); } }
Misterblue/LookingGlass-Viewer
src/LookingGlassOgre/OLPreloadArchive.cpp
C++
bsd-3-clause
6,141
import py try: from pypy.rpython.test.test_llinterp import interpret except ImportError: py.test.skip('Needs PyPy to be on the PYTHONPATH') from rply import ParserGenerator, Token from rply.errors import ParserGeneratorWarning from .base import BaseTests from .utils import FakeLexer, BoxInt, ParserState class TestTranslation(BaseTests): def run(self, func, args): return interpret(func, args) def test_basic(self): pg = ParserGenerator(["NUMBER", "PLUS"]) @pg.production("main : expr") def main(p): return p[0] @pg.production("expr : expr PLUS expr") def expr_op(p): return BoxInt(p[0].getint() + p[2].getint()) @pg.production("expr : NUMBER") def expr_num(p): return BoxInt(int(p[0].getstr())) with self.assert_warns(ParserGeneratorWarning, "1 shift/reduce conflict"): parser = pg.build() def f(n): return parser.parse(FakeLexer([ Token("NUMBER", str(n)), Token("PLUS", "+"), Token("NUMBER", str(n)) ])).getint() assert self.run(f, [12]) == 24 def test_state(self): pg = ParserGenerator(["NUMBER", "PLUS"], precedence=[ ("left", ["PLUS"]), ]) @pg.production("main : expression") def main(state, p): state.count += 1 return p[0] @pg.production("expression : expression PLUS expression") def expression_plus(state, p): state.count += 1 return BoxInt(p[0].getint() + p[2].getint()) @pg.production("expression : NUMBER") def expression_number(state, p): state.count += 1 return BoxInt(int(p[0].getstr())) parser = pg.build() def f(): state = ParserState() return parser.parse(FakeLexer([ Token("NUMBER", "10"), Token("PLUS", "+"), Token("NUMBER", "12"), Token("PLUS", "+"), Token("NUMBER", "-2"), ]), state=state).getint() + state.count assert self.run(f, []) == 26
solanolabs/rply
tests/test_ztranslation.py
Python
bsd-3-clause
2,200
<!DOCTYPE html><html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> <meta charset="utf-8"> <title>SLS_PHP_SDK » \Aliyun_Log_Models_ListLogstoresRequest</title> <meta name="author" content="Mike van Riel"> <meta name="description" content=""> <link href="../css/template.css" rel="stylesheet" media="all"> <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script><script src="../js/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script><script src="../js/jquery.mousewheel.min.js" type="text/javascript"></script><script src="../js/bootstrap.js" type="text/javascript"></script><script src="../js/template.js" type="text/javascript"></script><script src="../js/prettify/prettify.min.js" type="text/javascript"></script><link rel="shortcut icon" href="../img/favicon.ico"> <link rel="apple-touch-icon" href="../img/apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="72x72" href="../img/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="114x114" href="../img/apple-touch-icon-114x114.png"> </head> <body> <div class="navbar navbar-fixed-top"> <div class="navbar-inner"><div class="container"> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></a><a class="brand" href="../index.html">SLS_PHP_SDK</a><div class="nav-collapse"><ul class="nav"> <li class="dropdown"> <a href="#api" class="dropdown-toggle" data-toggle="dropdown"> API Documentation <b class="caret"></b></a><ul class="dropdown-menu"> <li><a>Packages</a></li> <li><a href="../packages/SLS_PHP_SDK.html"><i class="icon-folder-open"></i> SLS_PHP_SDK</a></li> </ul> </li> <li class="dropdown" id="charts-menu"> <a href="#charts" class="dropdown-toggle" data-toggle="dropdown"> Charts <b class="caret"></b></a><ul class="dropdown-menu"><li><a href="../graph_class.html"><i class="icon-list-alt"></i> Class hierarchy diagram</a></li></ul> </li> <li class="dropdown" id="reports-menu"> <a href="#reports" class="dropdown-toggle" data-toggle="dropdown"> Reports <b class="caret"></b></a><ul class="dropdown-menu"> <li><a href="../errors.html"><i class="icon-remove-sign"></i> Errors  <span class="label label-info">290</span></a></li> <li><a href="../markers.html"><i class="icon-map-marker"></i> Markers  <ul></ul></a></li> <li><a href="../deprecated.html"><i class="icon-stop"></i> Deprecated elements  <span class="label label-info">0</span></a></li> </ul> </li> </ul></div> </div></div> <div class="go_to_top"><a href="#___" style="color: inherit">Back to top  <i class="icon-upload icon-white"></i></a></div> </div> <div id="___" class="container"> <noscript><div class="alert alert-warning"> Javascript is disabled; several features are only available if Javascript is enabled. </div></noscript> <div class="row"> <div class="span4"> <div xmlns:php="http://php.net/xsl" class="btn-toolbar"> <div class="btn-group visibility" data-toggle="buttons-checkbox"> <button class="btn public active" title="Show public elements">Public</button><button class="btn protected" title="Show protected elements">Protected</button><button class="btn private" title="Show private elements">Private</button><button class="btn inherited active" title="Show inherited elements">Inherited</button> </div> <div class="btn-group view pull-right" data-toggle="buttons-radio"> <button class="btn details" title="Show descriptions and method names"><i class="icon-list"></i></button><button class="btn simple" title="Show only method names"><i class="icon-align-justify"></i></button> </div> </div> <ul xmlns:php="http://php.net/xsl" class="side-nav nav nav-list"> <li class="nav-header"> <i title="Methods" class="icon-custom icon-method"></i> Methods <ul> <li class="method public "><a href="#method___construct" title="__construct() :: Aliyun_Log_Models_ListLogstoresRequest constructor"><span class="description">Aliyun_Log_Models_ListLogstoresRequest constructor</span><pre>__construct()</pre></a></li> <li class="method public inherited"><a href="#method___construct" title="__construct() :: Aliyun_Log_Models_Request constructor"><span class="description">Aliyun_Log_Models_Request constructor</span><pre>__construct()</pre></a></li> <li class="method public inherited"><a href="#method_getProject" title="getProject() :: Get project name"><span class="description">Get project name</span><pre>getProject()</pre></a></li> <li class="method public inherited"><a href="#method_setProject" title="setProject() :: Set project name"><span class="description">Set project name</span><pre>setProject()</pre></a></li> </ul> </li> <li class="nav-header"> <i title="Properties" class="icon-custom icon-property"></i> Properties <ul></ul> </li> <li class="nav-header private">» Private <ul><li class="property private "><a href="#property_project" title="$project() :: "><span class="description">project name</span><pre>$project</pre></a></li></ul> </li> </ul> </div> <div class="span8"> <a xmlns:php="http://php.net/xsl" id="\Aliyun_Log_Models_ListLogstoresRequest"></a><ul xmlns:php="http://php.net/xsl" class="breadcrumb"> <li> <a href="../index.html"><i title="Classes" class="icon-custom icon-class"></i></a><span class="divider">\</span> </li> <li class="active"> <span class="divider">\</span><a href="../classes/Aliyun_Log_Models_ListLogstoresRequest.html">Aliyun_Log_Models_ListLogstoresRequest</a> </li> </ul> <div xmlns:php="http://php.net/xsl" class="element class"> <p class="short_description">The request used to list logstore from sls.</p> <div class="details"> <div class="long_description"></div> <table class="table table-bordered"> <tr> <th>author</th> <td><a href="">sls_dev</a></td> </tr> <tr> <th>package</th> <td><a href="../packages/SLS_PHP_SDK.html">SLS_PHP_SDK</a></td> </tr> <tr> <th>inherited_from</th> <td>\Aliyun_Log_Models_Request</td> </tr> </table> <h3> <i title="Methods" class="icon-custom icon-method"></i> Methods</h3> <a id="method___construct"></a><div class="element clickable method public method___construct " data-toggle="collapse" data-target=".method___construct .collapse" title="public"> <h2>Aliyun_Log_Models_ListLogstoresRequest constructor</h2> <pre>__construct(string $project<code> = null</code>) </pre> <div class="labels"></div> <div class="row collapse"><div class="detail-description"> <div class="long_description"></div> <table class="table table-bordered"><tr> <th>inherited_from</th> <td>\Aliyun_Log_Models_Request::__construct()</td> </tr></table> <h3>Parameters</h3> <div class="subelement argument"> <h4>$project</h4> <code>string</code><p>project name</p></div> </div></div> </div> <a id="method___construct"></a><div class="element clickable method public method___construct inherited" data-toggle="collapse" data-target=".method___construct .collapse" title="public"> <h2>Aliyun_Log_Models_Request constructor</h2> <pre>__construct(string $project) </pre> <div class="labels"><span class="label">Inherited</span></div> <div class="row collapse"><div class="detail-description"> <div class="long_description"></div> <h3>Parameters</h3> <div class="subelement argument"> <h4>$project</h4> <code>string</code><p>project name</p></div> </div></div> </div> <a id="method_getProject"></a><div class="element clickable method public method_getProject inherited" data-toggle="collapse" data-target=".method_getProject .collapse" title="public"> <h2>Get project name</h2> <pre>getProject() : string</pre> <div class="labels"><span class="label">Inherited</span></div> <div class="row collapse"><div class="detail-description"> <div class="long_description"></div> <h3>Returns</h3> <div class="subelement response"> <code>string</code>project name</div> </div></div> </div> <a id="method_setProject"></a><div class="element clickable method public method_setProject inherited" data-toggle="collapse" data-target=".method_setProject .collapse" title="public"> <h2>Set project name</h2> <pre>setProject(string $project) </pre> <div class="labels"><span class="label">Inherited</span></div> <div class="row collapse"><div class="detail-description"> <div class="long_description"></div> <h3>Parameters</h3> <div class="subelement argument"> <h4>$project</h4> <code>string</code><p>project name</p></div> </div></div> </div> <h3> <i title="Properties" class="icon-custom icon-property"></i> Properties</h3> <a id="property_project"> </a><div class="element clickable property private property_project" data-toggle="collapse" data-target=".property_project .collapse" title="private"> <h2>project name</h2> <pre>$project : string</pre> <div class="row collapse"><div class="detail-description"> <h3>Default</h3> <div class="subelement argument"></div> </div></div> <div class="labels"></div> <div class="row collapse"><div class="detail-description"><div class="long_description"></div></div></div> </div> </div> </div> </div> </div> <div class="row"><footer class="span12"> Template is built using <a href="http://twitter.github.com/bootstrap/">Twitter Bootstrap 2</a> and icons provided by <a href="http://glyphicons.com/">Glyphicons</a>.<br> Documentation is powered by <a href="http://www.phpdoc.org/">phpDocumentor v2.8.0-3-gd2074ac</a> and<br> generated on 2015-01-26T01:53:31-08:00.<br></footer></div> </div> </body> </html>
weijiansdlx/aliyun
aliyun-log-php-sdk-master/docs/classes/Aliyun_Sls_Models_ListLogstoresRequest.html
HTML
bsd-3-clause
9,786
/* Copyright (c) 2014 Andrea Zoli. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ package it.inaf.android; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Locale; public class DateFormatter { public static String formatType1(String date) { SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.UK); java.util.Date tmpDate = null; try { tmpDate = format.parse(date); } catch(ParseException e) { e.printStackTrace(); } SimpleDateFormat postFormater = new SimpleDateFormat("dd.MM.yyyy", Locale.ITALY); return postFormater.format(tmpDate); } public static String formatType2(String date) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", Locale.UK); java.util.Date tmpDate = null; try { tmpDate = format.parse(date); } catch(ParseException e) { e.printStackTrace(); } SimpleDateFormat postFormater = new SimpleDateFormat("dd.MM.yyyy", Locale.ITALY); return postFormater.format(tmpDate); } public static String formatType3(String date) { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.UK); java.util.Date tmpDate = null; try { tmpDate = format.parse(date); } catch(ParseException e) { e.printStackTrace(); } SimpleDateFormat postFormater = new SimpleDateFormat("dd.MM.yyyy", Locale.ITALY); return postFormater.format(tmpDate); } }
mediainaf/AppINAFAndroid
app/src/main/java/it/inaf/android/DateFormatter.java
Java
bsd-3-clause
1,724
// Copyright 2019 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. #ifndef MEDIA_GPU_TEST_VIDEO_PLAYER_TEST_VDA_VIDEO_DECODER_H_ #define MEDIA_GPU_TEST_VIDEO_PLAYER_TEST_VDA_VIDEO_DECODER_H_ #include <stdint.h> #include <map> #include <memory> #include "base/containers/lru_cache.h" #include "base/macros.h" #include "base/sequence_checker.h" #include "gpu/ipc/service/gpu_memory_buffer_factory.h" #include "media/base/video_decoder.h" #include "media/gpu/test/video_player/video_decoder_client.h" #include "media/media_buildflags.h" #include "media/video/video_decode_accelerator.h" namespace media { class VideoFrame; namespace test { class FrameRenderer; // The test VDA video decoder translates between the media::VideoDecoder and the // media::VideoDecodeAccelerator interfaces. This makes it possible to run // VD-based tests against VDA's. class TestVDAVideoDecoder : public media::VideoDecoder, public VideoDecodeAccelerator::Client { public: // Constructor for the TestVDAVideoDecoder. TestVDAVideoDecoder(bool use_vd_vda, const gfx::ColorSpace& target_color_space, FrameRenderer* const frame_renderer, gpu::GpuMemoryBufferFactory* gpu_memory_buffer_factory); TestVDAVideoDecoder(const TestVDAVideoDecoder&) = delete; TestVDAVideoDecoder& operator=(const TestVDAVideoDecoder&) = delete; ~TestVDAVideoDecoder() override; // media::VideoDecoder implementation VideoDecoderType GetDecoderType() const override; bool IsPlatformDecoder() const override; void Initialize(const VideoDecoderConfig& config, bool low_delay, CdmContext* cdm_context, InitCB init_cb, const OutputCB& output_cb, const WaitingCB& waiting_cb) override; void Decode(scoped_refptr<DecoderBuffer> buffer, DecodeCB decode_cb) override; void Reset(base::OnceClosure reset_cb) override; bool NeedsBitstreamConversion() const override; bool CanReadWithoutStalling() const override; int GetMaxDecodeRequests() const override; private: // media::VideoDecodeAccelerator::Client implementation void NotifyInitializationComplete(Status status) override; void ProvidePictureBuffers(uint32_t requested_num_of_buffers, VideoPixelFormat format, uint32_t textures_per_buffer, const gfx::Size& dimensions, uint32_t texture_target) override; void ProvidePictureBuffersWithVisibleRect(uint32_t requested_num_of_buffers, VideoPixelFormat format, uint32_t textures_per_buffer, const gfx::Size& dimensions, const gfx::Rect& visible_rect, uint32_t texture_target) override; void DismissPictureBuffer(int32_t picture_buffer_id) override; void PictureReady(const Picture& picture) override; void ReusePictureBufferTask(int32_t picture_buffer_id); void NotifyEndOfBitstreamBuffer(int32_t bitstream_buffer_id) override; void NotifyFlushDone() override; void NotifyResetDone() override; void NotifyError(VideoDecodeAccelerator::Error error) override; // Helper thunk to avoid dereferencing WeakPtrs on the wrong thread. static void ReusePictureBufferThunk( absl::optional<base::WeakPtr<TestVDAVideoDecoder>> decoder_client, scoped_refptr<base::SequencedTaskRunner> task_runner, int32_t picture_buffer_id); // Get the next bitstream buffer id to be used. int32_t GetNextBitstreamBufferId(); // Get the next picture buffer id to be used. int32_t GetNextPictureBufferId(); // Called when initialization is done. The callback is stored only when VDA // allows deferred initialization. InitCB init_cb_; // Called when a buffer is decoded. OutputCB output_cb_; // Called when the decoder finished flushing. DecodeCB flush_cb_; // Called when the decoder finished resetting. base::OnceClosure reset_cb_; // Whether VdVideoDecodeAccelerator is used. bool use_vd_vda_; // Output color space, used as hint to decoder to avoid conversions. const gfx::ColorSpace target_color_space_; // Frame renderer used to manage GL context. FrameRenderer* const frame_renderer_; #if BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) // Owned by VideoDecoderClient. gpu::GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; #endif // BUILDFLAG(USE_CHROMEOS_MEDIA_ACCELERATION) // Map of video frames the decoder uses as output, keyed on picture buffer id. std::map<int32_t, scoped_refptr<VideoFrame>> video_frames_; // Map of video frame decoded callbacks, keyed on bitstream buffer id. std::map<int32_t, DecodeCB> decode_cbs_; // Records the time at which each bitstream buffer decode operation started. base::LRUCache<int32_t, base::TimeDelta> decode_start_timestamps_; int32_t next_bitstream_buffer_id_ = 0; int32_t next_picture_buffer_id_ = 0; std::unique_ptr<VideoDecodeAccelerator> decoder_; scoped_refptr<base::SequencedTaskRunner> vda_wrapper_task_runner_; SEQUENCE_CHECKER(vda_wrapper_sequence_checker_); base::WeakPtr<TestVDAVideoDecoder> weak_this_; base::WeakPtrFactory<TestVDAVideoDecoder> weak_this_factory_{this}; }; } // namespace test } // namespace media #endif // MEDIA_GPU_TEST_VIDEO_PLAYER_TEST_VDA_VIDEO_DECODER_H_
nwjs/chromium.src
media/gpu/test/video_player/test_vda_video_decoder.h
C
bsd-3-clause
5,650
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <?php //Get Controller Action name $action_ = Yii::app()->controller->action->id; if($action_=='login') { //If Login Page, below html are worked ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="language" content="en" /> <!--[if lt IE 8]> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" /> <![endif]--> <title><?php echo CHtml::encode($this->pageTitle); ?></title> </head> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/login_style_v1.css" /> <script src="<?php echo Yii::app()->request->baseUrl; ?>/assets/js/jquery-1.4.1.min.js" type="text/javascript"></script> <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/assets/js/jQueryRotate.js"></script> <!-- Custom jquery scripts --> <script src="<?php echo Yii::app()->request->baseUrl; ?>/assets/js/custom_jquery.js" type="text/javascript"></script> <!-- MUST BE THE LAST SCRIPT IN <HEAD></HEAD></HEAD> png fix --> <script src="<?php echo Yii::app()->request->baseUrl; ?>/assets/js/jquery.pngFix.pack.js" type="text/javascript"></script> <script type="text/javascript"> //javascript code for Rotate Logo in Login Page $(document).ready(function() { $(document).pngFix( ); //call function , for png image fix in IE //code for Rotating Logo Image var angle = 0; setInterval(function() { angle+=3; $("#image1").rotate(angle); },50); } ); //End here, Code for Rotate Logo in Login Page </script> <body id="login-bg"> <div id="left-cont-login" > <table width="860" border="0"> <tr> <td class="left-cont-login-inner" width="416" align="center" > <img src="<?php echo Yii::app()->request->baseUrl; ?>/images/login/rotate.png" alt="" id="image1" style="position:absolute; margin-top:32px; " /> <img src="<?php echo Yii::app()->request->baseUrl; ?>/images/login/l_hrms.png" width="250" height="106" alt="" id="image" align="center" /> <br /> <br /> <!---left content----> <p> eHORIZON HRMS delivers comprehensive HR capabilities, from workforce management to compensation and talent management. Extensive business process automation and rich self service capabilities enable HR teams to perform value added services while reducing operational costs. eHorizon HRMS comprise an array of features, and the powerful reporting and analysis capabilities that an organization needs to manage the workforce.</p><br /> <p> The System transforms HR practices from administrative to strategic. It automates common administrative tasks, and leverages industry best practices to enable strategic management, along with efficient administration. </p><br /> <!---left content----> </td> <td width="434" align="center" valign="top"> <img src="<?php echo Yii::app()->request->baseUrl; ?>/images/login/stl-logo.png"> <div id="login-holder"> <div class="clear"></div> <!-- START LOGIN BOX --> <div id="loginbox"> <div id="login-inner"> <?php echo $content; ?> </div> <!-- end login-inner --> <div class="clear"></div> <!--<a href="" class="forgot-pwd">Forgot Password?</a>--> </div> <!-- END LOGIN BOX --> </div> </td> </tr> </table> </div> </body> </html> <?php } else { ?> <?php $modelname = Yii::app()->controller->id; $modelaction = Yii::app()->controller->action->id; //echo "<h1>".$modelname."--------".$modelaction."</h1>"; //Calling Bootstrap CSS Framework echo Yii::app()->bootstrap->init();//Yii::app()->language = 'zh-cn'; $this->widget('application.extensions.PNotify.PNotify', array( 'message'=>'Some Information Showing Here After Login' ), $_default_options=array( 'width'=>'700px', 'title_escape'=>false, 'text'=>false, // 'text_escape'=>false, ) ); //echo "<h1>".Yii::app()->user->id."</h1>"; // $condition="PID=".Yii::app()->user->id; // $Theme_rst= Theme_Management::model()->find($condition); // if($Theme_rst->THEME<>"") { // $css_theme_rst = $Theme_rst->THEME; // } // else {$css_theme_rst="default"; } ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="language" content="en" /> <!-- blueprint CSS framework --> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" /> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" /> <!--[if lt IE 8]> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" /> <![endif]--> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/pure-css-custom-form-elements/style.css" /> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/page_style_v1.css" /> <link id="change_theme" rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/theme_changer/<?php echo trim(Yii::app()->session['css_theme_rst']) ?>.css" /> <!------Including page slide js-----------> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/jquery.pageslide.css" /> <!-- <link rel="stylesheet" type="text/css" href="--><?php //echo Yii::app()->request->baseUrl; ?><!--/assets/custom_css/dropdown_menu.css" />--> <!------Including page slidejs-----------> <title><?php echo CHtml::encode($this->pageTitle); ?></title> </head> <!------including jquery scroll js and css--------> <script src="<?php echo Yii::app()->request->baseUrl; ?>/assets/Form_Wizard/formwizard.js" type="text/javascript"> <link href="<?php echo Yii::app()->request->baseUrl; ?>/assets/SrollBar/perfect-scrollbar.css" rel="stylesheet"> <script src="<?php echo Yii::app()->request->baseUrl; ?>/assets/SrollBar/jquery.mousewheel.js"></script> <script src="<?php echo Yii::app()->request->baseUrl; ?>/assets/SrollBar/perfect-scrollbar.js"></script> <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/assets/js/jquery.wheelmenu.js"></script> <!------including jquery scroll js and css--------> <script src="<?php echo Yii::app()->request->baseUrl; ?>/assets/js/jquery.maskedinput.js"></script> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/assets/Form_Wizard/formwizard.css" /> <!-- <link rel="stylesheet" type="text/css" href="--><?php //echo Yii::app()->request->baseUrl; ?><!--/css/add_new_menu_css/default.css"/>--> <!-- <link rel="stylesheet" type="text/css" href="--><?php //echo Yii::app()->request->baseUrl; ?><!--/css/add_new_menu_css/elusive-webfont.css"/>--> <!-- <link rel="stylesheet" type="text/css" href="--><?php //echo Yii::app()->request->baseUrl; ?><!--/css/add_new_menu_css/style.css"/> --> <script type="text/javascript"> $(document).ready(function(){ $('#panel2').slidePanel({ triggerName: '#trigger2', triggerTopPos: '20px', panelTopPos: '10px' }); $("#css-D371A7").click(function() { $("#change_theme").attr({href : "<?php echo Yii::app()->request->baseUrl; ?>/css/theme_changer/D371A7.css"}); }); $("#css-blue").click(function() { $("#change_theme").attr({href : "<?php echo Yii::app()->request->baseUrl; ?>/css/theme_changer/blue.css"}); }); $("#css-green").click(function() { $("#change_theme").attr({href : "<?php echo Yii::app()->request->baseUrl; ?>/css/theme_changer/green.css"}); }); //popover for user account //$("[rel='popover']").popover({ //placement : 'bottom', // top, bottom, left or right //title : 'My Settings <a class="close" href="#");">&times;</a>', //html: 'true', //content : '<div class="msg" style="width:auto;"><table id="popovertable" style="margin-bottom:.1em !important ;"><tr><td>Change Password</td></tr><tr><td><a href="<?php echo Yii::app()->request->baseUrl; ?>/index.php/site/logout">Logout</a></td></tr><table></div>' //}); // $(document).click(function (e) { // if ($(e.target).is('.close')) { // $("[rel='popover']").popover('hide'); // } // });// // Clickable Dropdown //popover end //Add and Manage Icons Top $("#patternDiv").append("<div style='float:right; width:200px; height:25px; text-align:right'><a href='<?php echo Yii::app()->request->baseUrl."/index.php/".$modelname?>/create' data-toggle='tooltip' title='Create New' class='btn btn-success btn-mini' style='margin-right:5px;'><i class='icon-white icon-plus-sign'></i>Create</a><a href='<?php echo Yii::app()->request->baseUrl."/index.php/".$modelname?>/admin' data-toggle='tooltip' title='Manage' class='btn btn-success btn-mini'><i class='icon-white icon-cog'></i>Manage<a></div>"); //tooltip code $("input[type=text]").dblclick(function() { var valueoftooltip =$(this).val(); if(valueoftooltip!="") { $("#"+$(this).attr("id")).after("<div class=tooltip-style id=tooltip-"+$(this).attr("id")+" style=display:block;>"+$(this).val()+"<div id=tooltip-pointer></div></div>"); $("#tooltip-"+$(this).attr("id")).animate({opacity: 1.0}, 3000).fadeOut("slow"); } }); //tooltip end //start Add new Button [ OLD STYLE BUT GOOD ANIMATION] // $(".wheel-button").wheelmenu({ // trigger: "hover", // animation: "fly", // animationSpeed: "fast" // }); //end Add new Button [ OLD STYLE BUT GOOD ANIMATION] //code for slide show -- orgbanner $("#slideshow_org_banner > div:gt(0)").hide(); setInterval(function() { $('#slideshow_org_banner > div:first') .fadeIn(1000) .next() .fadeOut(1000) .end() .appendTo('#slideshow_org_banner'); }, 3000); //end slide show code -- orgbanner //code for fixed header after scroll down--- start $(window).bind("scroll",function(e){ if($(document).scrollTop() > 120) // { //alert("scroll downe..."); //$("#Help_Box1").show(); //$("#top_menu_bar").show(1000); $("#top_menu_bar").addClass("somecloass"); $("#bottom_menu_bar").addClass("somecloass_bottom"); //Set content B to header } else { $("#top_menu_bar").removeClass("somecloass"); $("#bottom_menu_bar").removeClass("somecloass_bottom"); //alert("Normal Position "); //$("#Help_Box1").hide(); //$("#top_menu_bar").css({ position: "none",z-index: ""; }) //Set content A to header } }); //end $("#example_bottom").click(function(){ //alert("clicked"); if ($('#u_menu_content').css('display') == 'none') { $("#u_menu_content").fadeIn("1000"); } else { $("#u_menu_content").fadeOut("1000"); } }); $("#cross_myaccount").click(function(){ $("#u_menu_content").fadeOut("1000"); }); $("#theme_selector").click(function(){ //alert("clicked"); if ($('#u_theme_content').css('display') == 'none') { $("#u_theme_content").fadeIn("1000"); } else { $("#u_theme_content").fadeOut("1000"); } }); $("#cross_theme").click(function(){ $("#u_theme_content").fadeOut("1000"); }); //$("#example_bottom").popover({placement:'bottom',container:'#page-bgtop'}); }); ///add some animation on scroll // function scroll_to(div){ // $('#Help_Box1').animate({ // scrollTop: $(div).offset().top // },1000); // } // - See more at: http://www.w3resource.com/twitter-bootstrap/popover-tutorial.php#sthash.IhP0YULz.dpuf $(function() { $("#red").treeview({ //collapsed: true, animated: "medium", control:"#treecontrol", persist: "location" }); }) </script> <!---Write Some Inline CSS To Overide Bootstrap CSS Style---> <style> .table { width: auto; float:left} </style> <body viewsource="no"> <!--<a href="#" id="trigger2" class="trigger right"><img src="<?php echo Yii::app()->request->baseUrl; ?>/css/images/theme-icon.png" width="25" height="25" style="padding: 2px;"></a>--> <!-- <div id="panel2" class="panel right"> <h4>Choose Your Theme</h4> <span><a id="css-red" href="#red"><div id="box_red"></div></a></span> <span><a id="css-green" href="#green"><div id="box_green"></div></a></span> <span><a id="css-blue" href="#blue"><div id="box_blue"></div></a></span> <span style="margin-left:5px;"><a href="#" class="btn btn-info btn-mini"><i class="icon-white icon-thumbs-up"></i> Activate</a></span> </div>--> <div id="top_menu_bar" style="display: none"> <?php require_once("menus/top_menu_bar.php"); ?> </div> <div id="menu-wrapper"> <!--- logo ----> <img src="<?php echo Yii::app()->request->baseUrl; ?>/css/img/logo.png" width="115" height="100" style="float:left; padding: 5px;"> <!--ORGANIZATION Banner ---> <div id="org_name_position" style=""> <div id="slideshow_org_banner"> <!-- <div>--> <!-- <img src="--><?php //echo Yii::app()->request->baseUrl; ?><!--/images/organization_banner/org1/banner1.jpg" alt="" class="active" />--> <!-- </div>--> <!-- <div>--> <!-- <img src="--><?php //echo Yii::app()->request->baseUrl; ?><!--/images/organization_banner/org1/banner2.jpg" alt="" />--> <!-- </div>--> <!-- <div>--> <!-- <img src="--><?php //echo Yii::app()->request->baseUrl; ?><!--/images/organization_banner/org1/banner3.jpg" alt="" />--> <!-- </div>--> <!-- <div>--> <!-- Pretty cool eh?--> <!-- </div>--> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="468" height="75"> <param name="movie" value="<?php echo Yii::app()->request->baseUrl; ?>/images/flashvortex.swf" /> <param name="quality" value="best" /> <param name="menu" value="true" /> <param name="allowScriptAccess" value="sameDomain" /> <embed src="<?php echo Yii::app()->request->baseUrl; ?>/images/flashvortex.swf" quality="best" menu="true" width="468" height="75" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="sameDomain" /> </object> </div> </div> <!---START TOP RIGHT USER IMAGE--> <div id="menu"> <div id="example_bottom" style="background-image:url(<?php echo Yii::app()->request->baseUrl; ?>/images/prof_image1.jpg)"> </div> <div id="u_menu_content"> <div class="arrow-up"></div> <table id="inside_table_dmenu"> <tr> <td class="title_td">My Account</td> <td class="title_td" style="text-align: right"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/cross_orange.png" width="16" style="cursor: pointer; padding-right: 5px;" id="cross_myaccount"> </td> </tr> <tr class="d_menu_sub_tr"> <td class="dmenu_sub_td">Change Password</td><td style="text-align: right" class="dmenu_sub_td"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/lock.png" style="padding-right: 5px;"> </td> </tr> <tr class="d_menu_sub_tr"> <td class="dmenu_sub_td"><a id="text_color" href="<?php echo Yii::app()->request->baseUrl; ?>/index.php?site/logout">Logout</a> </td><td style="text-align: right" class="dmenu_sub_td"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/logout.png" style="padding-right: 5px;"> </td> </tr> </table> </div> </div> <!-- END USER IMAGE--> <!----start notification icons----> <div id="icons_div_on_top" style="margin-top: 13px !important; "> <div style="width: auto; height: auto; float: left; margin-top: 3px ; margin-right: 4px";> <img id="theme_selector" src="<?php echo Yii::app()->request->baseUrl; ?>/css/images/theme-icon.png" width="25" height="25" align="right" title="Change Theme" style="cursor: pointer;"> </div> <div id="u_theme_content"> <div class="arrow-up"></div> <table id="inside_table_dmenu"> <tr> <td class="title_td">Choose Any Theme</td> <td class="title_td" style="text-align: right"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/cross_orange.png" width="16" style="cursor: pointer; padding-right: 5px;" id="cross_theme"> </td> </tr> <tr class="d_menu_sub_tr"> <td colspan="2" class="dmenu_sub_td"> <span><a id="css-D371A7" href="#D371A7"><div id="box_D371A7"></div></a></span> <span><a id="css-green" href="#green"><div id="box_green"></div></a></span> <span><a id="css-blue" href="#blue"><div id="box_blue"></div></a></span> <span style="margin-right:5px; float: right;"><a href="#" class="btn btn-info btn-mini"><i class="icon-white icon-thumbs-up"></i> Activate</a></span> </td> <!--<td style="text-align: right" class="dmenu_sub_td"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/lock.png" style="padding-right: 5px;"> </td>--> </tr> <!-- <tr class="d_menu_sub_tr"> <td class="dmenu_sub_td"><a href="<?php echo Yii::app()->request->baseUrl; ?>/index.php?site/logout">Logout</a> </td><td style="text-align: right" class="dmenu_sub_td"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/logout.png" style="padding-right: 5px;"> </td> </tr>--> </table> </div> <div style="width: auto; height: auto; float: left; margin-top: 3px ; margin-right: 10px";> <img class="bell" src="<?php echo Yii::app()->request->baseUrl; ?>/images/bell.png" width="25" height="25" align="right" style="cursor: pointer;"> <div style=" position: absolute; margin-left: 15px;"> <span style="font-size: 10px; color: white; padding: 2px; background-color: red; border-radius: 100%; cursor: pointer; font-weight: bold;">23</span> </div> </div> <div style="width: auto; height: auto; float: left; margin-top: 0px; margin-right: 5px";> <div style="width: auto; height: auto; float: left; margin-top: 3px";> <img class="vertical" src="<?php echo Yii::app()->request->baseUrl; ?>/images/calendar.png" width="25" height="25" align="right" style="cursor: pointer"> <div style=" position: absolute;margin-left: 18px;"> <span style="font-size: 10px; color: white; padding: 2px; background-color: red; border-radius: 100%; cursor: pointer; font-weight: bold;">41</span> </div> </div> </div> <div style="width: auto; height: auto; float: left; margin-top: 0px; margin-right: 10px";> <div style="width: auto; height: auto; float: left; margin-top: 0px";> <!-- <img rel='popover' src="--><?php //echo Yii::app()->request->baseUrl; ?><!--/images/user_small.png" width="20" height="20" align="right" style="cursor: pointer">--> </div> </div> </div> <!----end notification-------> </div> <div id="bottom_menu_bar"> <?php require_once("menus/bottom_menu_bar.php") ?> </div> <!-------Start Header---------> <div id="header-wrapper"> <div id="header"></div> </div> <!----End Header-----> <div id="wrapper"> <div id="page"> <?php require_once("help_box/help_box_with_menu.php"); ?> <div id="page-bgtop"> <div id="page-bgbtm"> <div id="contentnew"> <?php echo $content; ?> <div style="clear: both;">&nbsp;</div> </div> <div id="sidebar2" style="visibility: hidden; position: absolute" > <!---Start Here Tree menu [include js and css]--> <link rel="stylesheet" href="<?php echo Yii::app()->request->baseUrl; ?>/tree/jquery.treeview.css"> <script src="<?php echo Yii::app()->request->baseUrl; ?>/tree/jquery.cookie.js" type="text/javascript"></script> <script src="<?php echo Yii::app()->request->baseUrl; ?>/tree/jquery.treeview.js" type="text/javascript"></script> <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/tree/demo.js"></script> <!---End Here Tree menu [include js and css] --> <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/assets/js/jquery.pageslide.js"></script> <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/assets/js/jquery.slidePanel.js"></script> <div id="modal"> <img id="Navigate_Right_Icon" src="<?php echo Yii::app()->request->baseUrl; ?>/images/cross.png" onclick="js:$.pageslide.close()" style="position:absolute; cursor: pointer;left: -10px; top: -2%;" /> <!----Including And Displaying Tree menu-----> <!--<div id="treecontrol"><a href="?#">Collapse All</a> | <a href="?#">Expand All</a></div>--> <?php include_once("menus/TreeMenu.php"); ?> <!----End here Including And Displaying Tree menu-----> </div> </div> <!-------Script For Menu Slide-----------> <script> /* Slide to the left, and make it model (you'll have to call $.pageslide.close() to close) */ $(".second").pageslide({ direction: "left", modal: false }); </script> <!-------End Here Script For Menu Slide-----------> </div> <div style="clear: both;">&nbsp;</div> </div> </div> </div> </div> <!-- BEGIN FOOTER --> <div id="footer"> <p>Copyright &copy; <?php echo date('Y')?> <a href="http://www.loksolutions.biz/" target="_blank">LOK Solutions</a> Private Limited. All Rights Reserved.</p> </div> <!-- END FOOTER --> </body> </html> <?php } ?>
Rathilesh/FMS_V1
protected/views/layouts/main-9-jan-2014.php
PHP
bsd-3-clause
26,894
extract: ${tooldir}/ecore2bgf BIBTEXML.ecore grammar.bgf include ../../Makefile.grammar
grammarware/slps
topics/grammars/bibtex/bibtex-1.2/Makefile
Makefile
bsd-3-clause
90
{-# LANGUAGE TypeOperators, MultiParamTypeClasses, FunctionalDependencies , UndecidableInstances #-} -- For ghc 6.6 compatibility -- {-# OPTIONS -fglasgow-exts -fallow-undecidable-instances #-} ---------------------------------------------------------------------- -- | -- Module : Data.FunArr -- Copyright : (c) Conal Elliott 2007-2013 -- License : BSD3 -- -- Maintainer : [email protected] -- Stability : experimental -- Portability : portable -- -- Conversion between arrow values and wrapped functions. ---------------------------------------------------------------------- module Data.FunArr ( FunArr(..) -- , wapl ) where -- import Control.Monad.Identity import Control.Compose infixr 0 $$ -- FunArr application -- | Convert between an arrow value and a \"wrapped function\". The \"arrow\" -- doesn't really have to be an arrow. I'd appreciate ideas for names & -- uses. class FunArr ar w | ar->w , w->ar where -- | Convert a @w@-wrapped function to an arrow value toArr :: w (a->b) -> (a `ar` b) -- | Apply an arrow to a @w@-wrapped value ($$) :: (a `ar` b) -> w a -> w b -- -- | Apply a wrapped function to a wrapped value -- wapl :: FunArr ar w => w (a->b) -> w a -> w b -- wapl f a = toArr f $$ a -- The type of wapl matches <*> from Control.Applicative. What about -- "pure" from the Applicative class, with type a -> w a? -- Function/Id instance instance FunArr (->) Id where toArr (Id f) = f f $$ Id a = Id (f a) -- -- Oops! This instance can't work with the mutual functional -- dependencies. Instead, instantiate it per @h@. -- -- instance FunArr (FunA h) h where -- toArr = error "toArr: undefined for FunArr" -- Add FunArrable class & delegate -- FunA f $$ ha = f ha -- The following instance violates the "coverage condition" and so -- requires -fallow-undecidable-instances. instance (FunArr ar w, FunArr ar' w') => FunArr (ar ::*:: ar') (w :*: w') where toArr (Prod (f,f')) = Prodd (toArr f, toArr f') Prodd (f,f') $$ Prod (w,w') = Prod (f $$ w, f' $$ w')
conal/DeepArrow
src/Data/FunArr.hs
Haskell
bsd-3-clause
2,075
# -*- coding: utf-8 -*- # # zambiaureport documentation build configuration file, created by # sphinx-quickstart. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = [] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'zambiaureport' copyright = u'2014, Andre Lesa' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '0.1' # The full version, including alpha/beta/rc tags. release = '0.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'zambiaureportdoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'zambiaureport.tex', u'zambiaureport Documentation', u'Andre Lesa', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'zambiaureport', u'zambiaureport Documentation', [u'Andre Lesa'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'zambiaureport', u'zambiaureport Documentation', u'Andre Lesa', 'zambiaureport', 'Zambia U-Report reference implementation.','Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote'
unicef-zambia/zambia-ureport
docs/conf.py
Python
bsd-3-clause
7,753
// RobotBuilder Version: 2.0 // // This file was generated by RobotBuilder. It contains sections of // code that are automatically generated and assigned by robotbuilder. // These sections will be updated in the future when you export to // Java from RobotBuilder. Do not put any code or make any change in // the blocks indicating autogenerated code or it will be lost on an // update. Deleting the comments indicating the section will prevent // it from being updated in the future. package org.usfirst.frc2619.SirLancebot2016.commands; import edu.wpi.first.wpilibj.command.CommandGroup; import org.usfirst.frc2619.SirLancebot2016.subsystems.*; /** * */ public class CrossRockWallCG extends CommandGroup { double distanceFromStart = 4.2; // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=PARAMETERS public CrossRockWallCG() { // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=PARAMETERS // Add Commands here: // e.g. addSequential(new Command1()); // addSequential(new Command2()); // these will run in order. // To run multiple commands at the same time, // use addParallel() // e.g. addParallel(new Command1()); // addSequential(new Command2()); // Command1 and Command2 will run in parallel. // A command group will require all of the subsystems that each member // would require. // e.g. if Command1 requires chassis, and Command2 requires arm, // a CommandGroup containing them would require both the chassis and the // arm. // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=COMMAND_DECLARATIONS // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=COMMAND_DECLARATIONS addSequential(new DriveXfeet(distanceFromStart)); addSequential(new DriveUntilFlat(1)); } }
The-Charge/SirLancebot2016
src/org/usfirst/frc2619/SirLancebot2016/commands/CrossRockWallCG.java
Java
bsd-3-clause
1,844
#include<iostream> using namespace std; int n,k; const int maxn=100010; bool b[2*maxn]; struct { int num,cn; }queue[2*maxn]; int head,tail; void bfs() { b[n]=1; queue[0].num=n; queue[0].cn=1; while(head<=tail) { if(queue[head].num==k) { printf("%d\n",queue[head].cn); return; } else if(queue[head].num>k&&!b[queue[head].num-1]) { b[queue[head].num-1]=1; queue[++tail].num=queue[head].num-1; queue[tail].cn=queue[head].cn+1; } else { if(queue[head].num>0&&!b[queue[head].num-1]) { b[queue[head].num-1]=1; queue[++tail].num=queue[head].num-1; queue[tail].cn=queue[head].cn+1; } if(!b[queue[head].num*2]) { b[queue[head].num*2]=1; queue[++tail].num=queue[head].num*2; queue[tail].cn=queue[head].cn+1; } if(!b[queue[head].num+1]) { b[queue[head].num+1]=1; queue[++tail].num=queue[head].num+1; queue[tail].cn=queue[head].cn+1; } } ++head; } } int main() { scanf("%d%d",&n,&k); if(n==k) { printf("1\n"); return 0; } memset(b,0,sizeof(b)); head=tail=0; bfs(); return 0; }
lulyon/poj-archive
emperorlu/3278/3841255_WA.cc
C++
bsd-3-clause
1,548
<?php namespace app\models; use Yii; /** * This is the model class for table "contact". * * @property integer $id * @property string $type * @property string $name * @property string $lastname * @property string $email * @property string $cellphone * @property string $message * @property string $identity * @property string $medium */ class Contact extends \yii\db\ActiveRecord { /** * @inheritdoc */ public static function tableName() { return 'contact'; } /** * @inheritdoc */ public function rules() { return [ [['type', 'name', 'lastname', 'email', 'cellphone', 'message'], 'required'], [['type', 'message'], 'string'], [['name', 'lastname', 'email'], 'string', 'max' => 150], [['cellphone', 'identity'], 'string', 'max' => 10], [['medium'], 'string', 'max' => 50] ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'type' => 'Type', 'name' => 'Name', 'lastname' => 'Lastname', 'email' => 'Email', 'cellphone' => 'Cellphone', 'message' => 'Message', 'identity' => 'Identity', 'medium' => 'Medium', ]; } }
frankpaul142/optica-los-andes
models/Contact.php
PHP
bsd-3-clause
1,347
#include <iostream> #include <type_traits> #include <vector> #include <cassert> #include <agency/execution/executor/sequenced_executor.hpp> #include <agency/execution/executor/executor_traits.hpp> int main() { using namespace agency; static_assert(is_bulk_synchronous_executor<sequenced_executor>::value, "sequenced_executor should be a bulk synchronous executor"); static_assert(is_bulk_executor<sequenced_executor>::value, "sequenced_executor should be a bulk executor"); static_assert(detail::is_detected_exact<sequenced_execution_tag, executor_execution_category_t, sequenced_executor>::value, "sequenced_executor should have sequenced_execution_tag execution_category"); static_assert(detail::is_detected_exact<size_t, executor_shape_t, sequenced_executor>::value, "sequenced_executor should have size_t shape_type"); static_assert(detail::is_detected_exact<size_t, executor_index_t, sequenced_executor>::value, "sequenced_executor should have size_t index_type"); static_assert(detail::is_detected_exact<std::future<int>, executor_future_t, sequenced_executor, int>::value, "sequenced_executor should have std::future furture"); static_assert(executor_execution_depth<sequenced_executor>::value == 1, "sequenced_executor should have execution_depth == 1"); sequenced_executor exec; size_t shape = 10; auto result = exec.bulk_sync_execute( [](size_t idx, std::vector<int>& results, std::vector<int>& shared_arg) { results[idx] = shared_arg[idx]; }, shape, [=]{ return std::vector<int>(shape); }, // results [=]{ return std::vector<int>(shape, 13); } // shared_arg ); assert(std::vector<int>(10, 13) == result); std::cout << "OK" << std::endl; return 0; }
egaburov/agency
testing/executor/sequenced_executor.cpp
C++
bsd-3-clause
1,773
/*========================================================================= Program: Visualization Toolkit Module: vtkBitArray.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ // .NAME vtkBitArray - dynamic, self-adjusting array of bits // .SECTION Description // vtkBitArray is an array of bits (0/1 data value). The array is packed // so that each byte stores eight bits. vtkBitArray provides methods // for insertion and retrieval of bits, and will automatically resize // itself to hold new data. #ifndef vtkBitArray_h #define vtkBitArray_h #include "vtkCommonCoreModule.h" // For export macro #include "vtkDataArray.h" class vtkBitArrayLookup; class VTKCOMMONCORE_EXPORT vtkBitArray : public vtkDataArray { public: static vtkBitArray *New(); vtkTypeMacro(vtkBitArray,vtkDataArray); void PrintSelf(ostream& os, vtkIndent indent); // Description: // Allocate memory for this array. Delete old storage only if necessary. // Note that ext is no longer used. int Allocate(vtkIdType sz, vtkIdType ext=1000); // Description: // Release storage and reset array to initial state. void Initialize(); // satisfy vtkDataArray API int GetDataType() {return VTK_BIT;}; int GetDataTypeSize() { return 0; } // Description: // Set the number of n-tuples in the array. void SetNumberOfTuples(vtkIdType number); // Description: // Set the tuple at the ith location using the jth tuple in the source array. // This method assumes that the two arrays have the same type // and structure. Note that range checking and memory allocation is not // performed; use in conjunction with SetNumberOfTuples() to allocate space. virtual void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray* source); // Description: // Insert the jth tuple in the source array, at ith location in this array. // Note that memory allocation is performed as necessary to hold the data. virtual void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray* source); // Description: // Copy the tuples indexed in srcIds from the source array to the tuple // locations indexed by dstIds in this array. // Note that memory allocation is performed as necessary to hold the data. virtual void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds, vtkAbstractArray *source); // Description: // Copy n consecutive tuples starting at srcStart from the source array to // this array, starting at the dstStart location. // Note that memory allocation is performed as necessary to hold the data. virtual void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart, vtkAbstractArray* source); // Description: // Insert the jth tuple in the source array, at the end in this array. // Note that memory allocation is performed as necessary to hold the data. // Returns the location at which the data was inserted. virtual vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray* source); // Description: // Get a pointer to a tuple at the ith location. This is a dangerous method // (it is not thread safe since a pointer is returned). double *GetTuple(vtkIdType i); // Description: // Copy the tuple value into a user-provided array. void GetTuple(vtkIdType i, double * tuple); // Description: // Set the tuple value at the ith location in the array. void SetTuple(vtkIdType i, const float * tuple); void SetTuple(vtkIdType i, const double * tuple); // Description: // Insert (memory allocation performed) the tuple into the ith location // in the array. void InsertTuple(vtkIdType i, const float * tuple); void InsertTuple(vtkIdType i, const double * tuple); // Description: // Insert (memory allocation performed) the tuple onto the end of the array. vtkIdType InsertNextTuple(const float * tuple); vtkIdType InsertNextTuple(const double * tuple); // Description: // These methods remove tuples from the data array. They shift data and // resize array, so the data array is still valid after this operation. Note, // this operation is fairly slow. virtual void RemoveTuple(vtkIdType id); virtual void RemoveFirstTuple(); virtual void RemoveLastTuple(); // Description: // Set the data component at the ith tuple and jth component location. // Note that i is less then NumberOfTuples and j is less then // NumberOfComponents. Make sure enough memory has been allocated (use // SetNumberOfTuples() and SetNumberOfComponents()). void SetComponent(vtkIdType i, int j, double c); // Description: // Free any unneeded memory. void Squeeze(); // Description: // Resize the array while conserving the data. virtual int Resize(vtkIdType numTuples); // Description: // Get the data at a particular index. int GetValue(vtkIdType id); // Description: // Fast method based setting of values without memory checks. First // use SetNumberOfValues then use SetValue to actually set them. // Specify the number of values for this object to hold. Does an // allocation as well as setting the MaxId ivar. Used in conjunction with // SetValue() method for fast insertion. void SetNumberOfValues(vtkIdType number); // Description: // Set the data at a particular index. Does not do range checking. Make sure // you use the method SetNumberOfValues() before inserting data. void SetValue(vtkIdType id, int value); // Description: // Inserts values and checks to make sure there is enough memory void InsertValue(vtkIdType id, int i); // Description: // Set a value in the array from a variant. void SetVariantValue(vtkIdType idx, vtkVariant value); // Description: // Inserts values from a variant and checks to ensure there is enough memory void InsertVariantValue(vtkIdType idx, vtkVariant value); vtkIdType InsertNextValue(int i); // Description: // Insert the data component at ith tuple and jth component location. // Note that memory allocation is performed as necessary to hold the data. virtual void InsertComponent(vtkIdType i, int j, double c); // Description: // Direct manipulation of the underlying data. unsigned char *GetPointer(vtkIdType id) {return this->Array + id/8;} // Description: // Get the address of a particular data index. Make sure data is allocated // for the number of items requested. Set MaxId according to the number of // data values requested. unsigned char *WritePointer(vtkIdType id, vtkIdType number); void* WriteVoidPointer(vtkIdType id, vtkIdType number) { return this->WritePointer(id, number); } void *GetVoidPointer(vtkIdType id) { return static_cast<void *>(this->GetPointer(id)); } // Description: // Deep copy of another bit array. void DeepCopy(vtkDataArray *da); void DeepCopy(vtkAbstractArray* aa) { this->Superclass::DeepCopy(aa); } // Description: // This method lets the user specify data to be held by the array. The // array argument is a pointer to the data. size is the size of // the array supplied by the user. Set save to 1 to keep the class // from deleting the array when it cleans up or reallocates memory. // The class uses the actual array provided; it does not copy the data // from the supplied array. If save 0, the array must have been allocated // with new[] not malloc. #ifndef __VTK_WRAP__ void SetArray(unsigned char* array, vtkIdType size, int save); #endif void SetVoidArray(void *array, vtkIdType size, int save) { this->SetArray(static_cast<unsigned char *>(array), size, save); } void SetVoidArray(void *array, vtkIdType size, int save, int vtkNotUsed(deleteMethod)) { this->SetArray(static_cast<unsigned char *>(array), size, save); } // Description: // Returns a new vtkBitArrayIterator instance. VTK_NEWINSTANCE vtkArrayIterator* NewIterator(); // Description: // Return the indices where a specific value appears. virtual vtkIdType LookupValue(vtkVariant value); virtual void LookupValue(vtkVariant value, vtkIdList* ids); vtkIdType LookupValue(int value); void LookupValue(int value, vtkIdList* ids); // Description: // Tell the array explicitly that the data has changed. // This is only necessary to call when you modify the array contents // without using the array's API (i.e. you retrieve a pointer to the // data and modify the array contents). You need to call this so that // the fast lookup will know to rebuild itself. Otherwise, the lookup // functions will give incorrect results. virtual void DataChanged(); // Description: // Delete the associated fast lookup data structure on this array, // if it exists. The lookup will be rebuilt on the next call to a lookup // function. virtual void ClearLookup(); protected: vtkBitArray(); ~vtkBitArray(); unsigned char *Array; // pointer to data unsigned char *ResizeAndExtend(vtkIdType sz); // function to resize data int TupleSize; //used for data conversion double *Tuple; int SaveUserArray; private: // hide superclass' DeepCopy() from the user and the compiler void DeepCopy(vtkDataArray &da) {this->vtkDataArray::DeepCopy(&da);} private: vtkBitArray(const vtkBitArray&) VTK_DELETE_FUNCTION; void operator=(const vtkBitArray&) VTK_DELETE_FUNCTION; vtkBitArrayLookup* Lookup; void UpdateLookup(); }; inline void vtkBitArray::SetNumberOfValues(vtkIdType number) { this->Allocate(number); this->MaxId = number - 1; this->DataChanged(); } inline void vtkBitArray::SetValue(vtkIdType id, int value) { if (value) { this->Array[id/8] = static_cast<unsigned char>( this->Array[id/8] | (0x80 >> id%8)); } else { this->Array[id/8] = static_cast<unsigned char>( this->Array[id/8] & (~(0x80 >> id%8))); } this->DataChanged(); } inline void vtkBitArray::InsertValue(vtkIdType id, int i) { if ( id >= this->Size ) { if (!this->ResizeAndExtend(id+1)) { return; } } if (i) { this->Array[id/8] = static_cast<unsigned char>( this->Array[id/8] | (0x80 >> id%8)); } else { this->Array[id/8] = static_cast<unsigned char>( this->Array[id/8] & (~(0x80 >> id%8))); } if ( id > this->MaxId ) { this->MaxId = id; } this->DataChanged(); } inline void vtkBitArray::SetVariantValue(vtkIdType id, vtkVariant value) { this->SetValue(id, value.ToInt()); } inline void vtkBitArray::InsertVariantValue(vtkIdType id, vtkVariant value) { this->InsertValue(id, value.ToInt()); } inline vtkIdType vtkBitArray::InsertNextValue(int i) { this->InsertValue (++this->MaxId,i); this->DataChanged(); return this->MaxId; } inline void vtkBitArray::Squeeze() {this->ResizeAndExtend (this->MaxId+1);} #endif
SimVascular/VTK
Common/Core/vtkBitArray.h
C
bsd-3-clause
11,213
/* * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer; * redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution; * neither the name of the copyright holders nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __MEM_RUBY_SYSTEM_PERSISTENTTABLE_HH__ #define __MEM_RUBY_SYSTEM_PERSISTENTTABLE_HH__ #include <iostream> #include "mem/gems_common/Map.hh" #include "mem/protocol/AccessType.hh" #include "mem/ruby/common/Address.hh" #include "mem/ruby/common/Global.hh" #include "mem/ruby/common/NetDest.hh" #include "mem/ruby/system/MachineID.hh" class PersistentTableEntry { public: void print(std::ostream& out) const {} NetDest m_starving; NetDest m_marked; NetDest m_request_to_write; }; class PersistentTable { public: // Constructors PersistentTable(); // Destructor ~PersistentTable(); // Public Methods void persistentRequestLock(const Address& address, MachineID locker, AccessType type); void persistentRequestUnlock(const Address& address, MachineID unlocker); bool okToIssueStarving(const Address& address, MachineID machID) const; MachineID findSmallest(const Address& address) const; AccessType typeOfSmallest(const Address& address) const; void markEntries(const Address& address); bool isLocked(const Address& addr) const; int countStarvingForAddress(const Address& addr) const; int countReadStarvingForAddress(const Address& addr) const; static void printConfig(std::ostream& out) {} void print(std::ostream& out) const; private: // Private copy constructor and assignment operator PersistentTable(const PersistentTable& obj); PersistentTable& operator=(const PersistentTable& obj); // Data Members (m_prefix) Map<Address, PersistentTableEntry>* m_map_ptr; }; inline std::ostream& operator<<(std::ostream& out, const PersistentTable& obj) { obj.print(out); out << std::flush; return out; } inline std::ostream& operator<<(std::ostream& out, const PersistentTableEntry& obj) { obj.print(out); out << std::flush; return out; } #endif // __MEM_RUBY_SYSTEM_PERSISTENTTABLE_HH__
liangwang/m5
src/mem/ruby/system/PersistentTable.hh
C++
bsd-3-clause
3,532
/******************************************************************************* * Copyright (c) 2009-2012, University of Manchester * * Licensed under the New BSD License. * Please see LICENSE file that is distributed with the source code ******************************************************************************/ package uk.ac.manchester.cs.owl.semspreadsheets.model; /** * Author: Matthew Horridge<br> * The University of Manchester<br> * Information Management Group<br> * Date: 08-Nov-2009 */ public interface NamedRange { String getName(); Range getRange(); }
Tokebluff/RightField
src/main/java/uk/ac/manchester/cs/owl/semspreadsheets/model/NamedRange.java
Java
bsd-3-clause
595
/*L * Copyright SAIC, SAIC-Frederick. * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/caadapter/LICENSE.txt for details. */ package gov.nih.nci.caadapter.sdtm.util; /** * This class represents a entity * * @author OWNER: Harsha Jayanna * @author LAST UPDATE $Author: phadkes $ * @version Since caAdapter v4.0 revision * $Revision: 1.4 $ * $Date: 2008-06-09 19:53:51 $ */ public class Entity { private String schema = null; private String entityName = null; /** * Creates a new instance of Entity */ public Entity(String schema, String entityName) { this.setSchema(schema); this.setEntityName(entityName); } public String toString() { return getEntityName(); } public String getSchema() { return schema; } public void setSchema(String schema) { this.schema = schema; } public String getEntityName() { return entityName; } public void setEntityName(String entityName) { this.entityName = entityName; } } /** * Change History * $Log: not supported by cvs2svn $ * Revision 1.3 2008/06/06 18:55:19 phadkes * Changes for License Text * * Revision 1.2 2007/08/16 19:04:58 jayannah * Reformatted and added the Comments and the log tags for all the files * */
NCIP/caadapter
software/caadapter/src/java/gov/nih/nci/caadapter/sdtm/util/Entity.java
Java
bsd-3-clause
1,371
define(function () { return [ { "default": { name: 'form1', label: 'Form 1', "_elements": [ { "default": { "name": "id", "type": "hidden" } }, { "default": { "name": "test1", "type": "text", "label": "Test1", "defaultValue": "test1", "page": 0 } }, { "default": { "name": "test2", "type": "text", "label": "Test2", "defaultValue": "test2", "page": 0 } }, { "default": { "name": "calc_button", "type": "button", "label": "Calculate", "persist": false, "page": 0 } }, { "default": { "name": "calc", "type": "message", "label": "Calc", "labelPlacement": "default", "labelStyle": "Plain", "showTextbox": "show", "calculationType": "manual", "buttonText": "Calculate", "persist": true, "page": 0 } } ], "_checks": [ ], "_actions": [ { "default": { "javascript": "\"[test1]\"+\"[test2]\"", "outputTarget": "calc", "name": "CALC_calc" } } ], "_behaviours": [ { "default": { "name": "auto_calculations", "trigger": { "formElements": ["calc_button"] }, "actions": [ "CALC_calc" ] } } ] } } ]; });
blinkmobile/forms
test/18_calculation/definitions.js
JavaScript
bsd-3-clause
1,923
#include <stdio.h> #include <stdlib.h> static void foo() { throw 123; } int main(int argc, char *argv[]) { int count = argc == 1 ? 10000 : atoi(argv[ 1 ]); int n = 0; for(int i = 0; i < count; ++i) { try { foo(); } catch(...) { ++n; } } printf("%d\n", n); return 0; }
alaricsp/chicken-scheme
benchmarks/others/exception.cpp
C++
bsd-3-clause
314
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #----------------------------------------------------------------------------- ''' ''' #----------------------------------------------------------------------------- # Boilerplate #----------------------------------------------------------------------------- import logging # isort:skip log = logging.getLogger(__name__) #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- # Bokeh imports from .notebook import run_notebook_hook from .state import curstate #----------------------------------------------------------------------------- # Globals and constants #----------------------------------------------------------------------------- __all__ = ( 'output_file', 'output_notebook', 'reset_output', ) #----------------------------------------------------------------------------- # General API #----------------------------------------------------------------------------- def output_file(filename, title="Bokeh Plot", mode=None, root_dir=None): '''Configure the default output state to generate output saved to a file when :func:`show` is called. Does not change the current ``Document`` from ``curdoc()``. File and notebook output may be active at the same time, so e.g., this does not clear the effects of ``output_notebook()``. Args: filename (str) : a filename for saving the HTML document title (str, optional) : a title for the HTML document (default: "Bokeh Plot") mode (str, optional) : how to include BokehJS (default: ``'cdn'``) One of: ``'inline'``, ``'cdn'``, ``'relative(-dev)'`` or ``'absolute(-dev)'``. See :class:`bokeh.resources.Resources` for more details. root_dir (str, optional) : root directory to use for 'absolute' resources. (default: None) This value is ignored for other resource types, e.g. ``INLINE`` or ``CDN``. Returns: None .. note:: Generally, this should be called at the beginning of an interactive session or the top of a script. .. warning:: This output file will be overwritten on every save, e.g., each time show() or save() is invoked. ''' curstate().output_file( filename, title=title, mode=mode, root_dir=root_dir ) def output_notebook(resources=None, verbose=False, hide_banner=False, load_timeout=5000, notebook_type='jupyter'): ''' Configure the default output state to generate output in notebook cells when :func:`show` is called. Note that, :func:`show` may be called multiple times in a single cell to display multiple objects in the output cell. The objects will be displayed in order. Args: resources (Resource, optional) : How and where to load BokehJS from (default: CDN) verbose (bool, optional) : whether to display detailed BokehJS banner (default: False) hide_banner (bool, optional): whether to hide the Bokeh banner (default: False) load_timeout (int, optional) : Timeout in milliseconds when plots assume load timed out (default: 5000) notebook_type (string, optional): Notebook type (default: jupyter) Returns: None .. note:: Generally, this should be called at the beginning of an interactive session or the top of a script. ''' # verify notebook_type first in curstate().output_notebook curstate().output_notebook(notebook_type) run_notebook_hook(notebook_type, 'load', resources, verbose, hide_banner, load_timeout) def reset_output(state=None): ''' Clear the default state of all output modes. Returns: None ''' curstate().reset() #----------------------------------------------------------------------------- # Dev API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Private API #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Code #-----------------------------------------------------------------------------
ericmjl/bokeh
bokeh/io/output.py
Python
bsd-3-clause
4,608
module Main where import Build_doctests (flags, pkgs, module_sources) import Data.Foldable (traverse_) import Test.DocTest (doctest) main :: IO () main = do traverse_ putStrLn args doctest args where args = ["-XOverloadedStrings"] ++ flags ++ pkgs ++ module_sources
kazu-yamamoto/unix-time
test/doctests.hs
Haskell
bsd-3-clause
282
require './test_common.rb' require '../lib/crocus/minibloom' class TestMiniBloom < Test::Unit::TestCase def test_single_push results = [] mb = MiniBloom.new mb.source('p1',1) mb.p1.pro {|i| results << [2*i[0]]} mb.p1 << [2] assert_equal([4], results.pop) end def test_single_table results = [] mb = MiniBloom.new mb.table('p1',{[:key]=>[:val]}) mb.p1 << [1,2] mb.p1.pro {|i| results << [2*i[0]]} keys = mb.p1.keys vals = mb.p1.values mb.tick assert_equal([[2]], results) assert_equal([[1]], keys) assert_equal([[2]], vals) end def test_join_tables results = [] mb = MiniBloom.new mb.table('rel1',{[:key]=>[:val]}) mb.table('p2',{[:key]=>[:val]}) mb.rel1 <= [[:alpha,1], [:beta,2]] mb.p2 <= [[:alpha,3], [:beta,4]] (mb.rel1 * mb.p2).pairs([0]=>[0]){|x,y| results << [x[0],x[1],y[1]]} mb.tick assert_equal([[:alpha, 1, 3], [:beta, 2, 4]], results) end def test_join results = [] mb = MiniBloom.new mb.run_bg mb.source('rel1',2) mb.source('rel2',2) (mb.rel1*mb.rel2).pairs([1]=>[1]) {|i,j| results << [i[0], j[0], j[1]]} mb.rel1 <= [['a',1], ['c', 3]] mb.rel2 << ['b',1] mb.stop assert_equal(['a', 'b', 1], results.pop) assert_equal([], results) end def test_cross_product results = [] mb = MiniBloom.new mb.run_bg mb.source('rel1',2) mb.source('rel2',2) (mb.rel1*mb.rel2).pairs {|i,j| results << i+j} mb.rel1 <= [['a',1], ['c', 3]] mb.rel2 << ['b',1] mb.stop assert_equal([['a', 1, 'b', 1],['c',3, 'b',1]], results.sort) end def test_two_joins outs = [] mb = MiniBloom.new mb.run_bg mb.source('rel1',2) mb.source('rel2',2) mb.source('rel3',2) ((mb.rel1*mb.rel2).pairs([0]=>[0]){|i,j| i+j} * mb.rel3).pairs([2]=>[0]).pro do |i,j| outs << i+j end mb.rel1 <= [[1,:a],[2,:a]] mb.rel2 <= [[1,:b],[2,:b]] mb.rel3 <= [[1,:c],[2,:c]] mb.stop assert_equal([[1, :a, 1, :b, 1, :c], [2, :a, 2, :b, 2, :c]], outs.sort) end require 'set' def test_recursion outs = Set.new links = Set.new mb = MiniBloom.new mb.run_bg mb.source('link', 2) mb.source('path', 2) mb.path <= mb.link mb.path <= (mb.link*mb.path).pairs([1]=>[0]) do |i,j| tup = [i[0], j[1]] unless outs.include? tup outs << tup tup else nil end end [[1,2],[2,3],[3,4],[6,7],[2,7]].each{|i| links << i} mb.link <= links mb.stop assert_equal([[1,2],[1,3],[1,4],[1,7],[2,3],[2,4],[2,7],[3,4],[6,7]], (outs+links).to_a.sort) end def test_group_by outs = [] mb = MiniBloom.new mb.run_bg mb.source('r',2) mb.r.group([1], Crocus::sum(0)) {|i| outs << i unless i.nil?} mb.r <= [[1,'a'],[2,'a'],[2,'c']] mb.stop assert_equal([['a', 3],['c', 2]], outs.sort) end def test_agg_nogroup outs = [] mb = MiniBloom.new mb.run_bg mb.source('r',2) mb.r.group([], Crocus::sum(0)) {|i| outs << i unless i.nil?} mb.r <= [[1,'a'],[2,'a'],[2,'c']] mb.stop assert_equal([[5]], outs.sort) end def test_argagg agg_outs = [] max_outs = [] min_outs = [] mb = MiniBloom.new mb.run_bg mb.source('r',2) mb.r.argagg([1], Crocus::min(0)) {|i| agg_outs << i unless i.nil?} mb.r.argmin([1], 0) {|i| min_outs << i unless i.nil?} mb.r.argmax([1], 0) {|i| max_outs << i unless i.nil?} mb.r <= [[1,'a'],[2,'a'],[2,'c']] mb.stop assert_equal([[1,'a'],[2,'c']], agg_outs.sort) assert_equal([[1,'a'],[2,'c']], min_outs.sort) assert_equal([[2,'a'],[2,'c']], max_outs.sort) end def test_argagg_nogroup outs = [] mb = MiniBloom.new mb.run_bg mb.source('r',2) mb.r.argagg([], Crocus::min(0)) {|i| outs << i unless i.nil?} mb.r <= [[1,'a'],[2,'a'],[2,'c']] mb.stop assert_equal([[1,'a']], outs) end def test_preds mb = MiniBloom.new mb.run_bg mb.source('r',2) ex_outs = false inc_outs = false fail_outs = false mb.r.on_exists? {ex_outs = true} mb.r.on_include?([1,'a']) {inc_outs = true} mb.r.on_include?(['joe']) {fail_outs = true} mb.r <= [[1,'a'],[2,'a'],[2,'c']] mb.stop assert_equal(true, ex_outs) assert_equal(true, inc_outs) assert_equal(false, fail_outs) end def test_inspected outs = [] mb = MiniBloom.new mb.run_bg mb.source('r',2) mb.r.inspected.pro {|i| outs << i} mb.r <= [[1,'a'],[2,'a'],[2,'c']] mb.stop assert_equal([[1,'a'],[2,'a'],[2,'c']].map{|i| [i.inspect]}, outs) end end
jhellerstein/crocus
test/tc_minibloom.rb
Ruby
bsd-3-clause
4,706
<!-- %BD_HTML%/SearchResult.htm --> <HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=windows-1255"> <TITLE>úåöàú àéðèøðè - Takanot File</TITLE> </HEAD> <style> <!-- TR.A_Table {font-color:#3e6ea6; background-color: #f7f9fb; font-size:11;font-family: Arial,} TR.B_Table {font-color:#3e6ea6; background-color: #ecf1f6; font-size:11;font-family: Arial,} TR.C {font-color:#1e4a7a; background-color: #A9CAEF;font-weight:bold; font-size:11;font-family: Arial,} TR.clear { font-color:#1e4a7a; background-color: #FFFFFF;} H5 { font-family:Arial, Helvetica, sans-serif; font-size: 14px;} H3 { font-family:Arial, Helvetica, sans-serif; font-size: 16px;} TD.A_Row { font-family: Arial, Helvetica, sans-serif; font-weight:bold; font-style: normal; color: #093300; font-size: 10px} .defaultFont { color:#1f4a7b;font-family: Arial, Helvetica, sans-serif; font-size: 12px} --> </style> <BODY dir=rtl class="defaultFont"> <CENTER> <IMG src="/budget/Images/title1.jpg" align=bottom alt="ú÷öéá äîãéðä"> <TABLE align="center" border=0 cellspacing=0 cellpadding=0> <TR align="center"> <TD><H3>úåöàú çéôåù ìùðú 2005</H3></TD> </TR> <TR align="center"> <!--<TD><H3>ðúåðé áéöåò ðëåðéí ìñåó çåãù 08/2006</H3></TD>--> <TD><H3>ðúåðé áéöåò ëôé ùðøùîå áñôøé äðäìú äçùáåðåú ùì äîùøãéí - 08/2006<br></H3></TD> </TR> </TR align="center"> <TD><H3>àéï àçéãåú áéï äñòéôéí ìâáé îåòã òãëåï äðúåðéí</H3></TD> </TR> </TABLE> <H5>äñëåîéí äéðí ùì çå÷ äú÷öéá äî÷åøé åáàìôé ù÷ìéí <BR> </H5> </CENTER> <table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#8fbcee"> <TR class="C" align="center"> <TD valign=top width=50>ñòéó</TD> <TD valign=top align="right" width=120>ùí ñòéó</TD> <TD valign=top width=65>äåöàä ðèå</TD> <TD valign=top width=65>äåöàä îåúðéú áäëðñä</TD> <TD valign=top width=65>ñä"ë äåöàä</TD> <TD valign=top width=65>äøùàä ìäúçééá</TD> <TD valign=top width=65>ùéà ë"à</TD> <TD valign=top width=40>ñä"ë ðåöì</TD> <TD valign=top width=40>àçåæ ðåöì</TD> </TR> </TABLE> <table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#8fbcee"> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;73</TD> <TD valign=top align="right" width=120>&nbsp;îôòìé îéí</TD> <TD valign=top width=65>&nbsp; 655,551</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 655,551</TD> <TD valign=top width=65>&nbsp; 510,481</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 544,800</TD> <TD valign=top width=40>&nbsp; 83.11</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;7304</TD> <TD valign=top align="right" width=120>&nbsp;àùøàé ìñô÷é îéí</TD> <TD valign=top width=65>&nbsp; 1,943</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 1,943</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 699</TD> <TD valign=top width=40>&nbsp; 35.98</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;730401</TD> <TD valign=top align="right" width=120>&nbsp;àùøàé ìñô÷é îéí</TD> <TD valign=top width=65>&nbsp; 1,943</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 1,943</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 699</TD> <TD valign=top width=40>&nbsp; 35.98</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;7312</TD> <TD valign=top align="right" width=120>&nbsp;ðöéáåú äîéí ôòåìåú åøëéùåú</TD> <TD valign=top width=65>&nbsp; 25,421</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 25,421</TD> <TD valign=top width=65>&nbsp; 17,834</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 14,537</TD> <TD valign=top width=40>&nbsp; 57.19</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;731202</TD> <TD valign=top align="right" width=120>&nbsp;îçùåá</TD> <TD valign=top width=65>&nbsp; 6,756</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 6,756</TD> <TD valign=top width=65>&nbsp; 6,282</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 3,954</TD> <TD valign=top width=40>&nbsp; 58.53</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;731203</TD> <TD valign=top align="right" width=120>&nbsp;àéëåú îéí, ðéèåø åîãéãåú</TD> <TD valign=top width=65>&nbsp; 18,665</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 18,665</TD> <TD valign=top width=65>&nbsp; 11,552</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 10,583</TD> <TD valign=top width=40>&nbsp; 56.70</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;731204</TD> <TD valign=top align="right" width=120>&nbsp;îç÷øé äô÷ä</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;7314</TD> <TD valign=top align="right" width=120>&nbsp;îôòìé îéí áéäåãä ùåîøåï åòæä</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;731403</TD> <TD valign=top align="right" width=120>&nbsp;îôòìé îéí áéäåãä ùåîøåï åòæä</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;7318</TD> <TD valign=top align="right" width=120>&nbsp;úëðåï ìáéöåò îôòìé îéí</TD> <TD valign=top width=65>&nbsp; 9,404</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 9,404</TD> <TD valign=top width=65>&nbsp; 12,723</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 13,516</TD> <TD valign=top width=40>&nbsp;143.73</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;731801</TD> <TD valign=top align="right" width=120>&nbsp;úëðåï ëåìì åúëðåï îôåøè-ä÷ãîåú úëðåï</TD> <TD valign=top width=65>&nbsp; 9,404</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 9,404</TD> <TD valign=top width=65>&nbsp; 12,723</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 13,516</TD> <TD valign=top width=40>&nbsp;143.73</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;7319</TD> <TD valign=top align="right" width=120>&nbsp;ôéúåç î÷åøåú îéí</TD> <TD valign=top width=65>&nbsp; 121,809</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 121,809</TD> <TD valign=top width=65>&nbsp; 54,075</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 103,154</TD> <TD valign=top width=40>&nbsp; 84.69</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;731903</TD> <TD valign=top align="right" width=120>&nbsp;ôéúåç îôòìé ÷åìçéï ìäîøä, èéåá áàøåú åäçãøú îéí</TD> <TD valign=top width=65>&nbsp; 108,195</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 108,195</TD> <TD valign=top width=65>&nbsp; 38,975</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 97,990</TD> <TD valign=top width=40>&nbsp; 90.57</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;731904</TD> <TD valign=top align="right" width=120>&nbsp;ééòåì äùéîåù áîéí</TD> <TD valign=top width=65>&nbsp; 13,614</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 13,614</TD> <TD valign=top width=65>&nbsp; 15,100</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 5,165</TD> <TD valign=top width=40>&nbsp; 37.94</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;7320</TD> <TD valign=top align="right" width=120>&nbsp;ôòåìåú ðé÷åæ</TD> <TD valign=top width=65>&nbsp; 900</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 900</TD> <TD valign=top width=65>&nbsp; 900</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 11,768</TD> <TD valign=top width=40>&nbsp;******</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732002</TD> <TD valign=top align="right" width=120>&nbsp;ðçìéí àøöééí</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 9,685</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;732003</TD> <TD valign=top align="right" width=120>&nbsp;ðé÷åæ - ôøåéé÷èéí îéåçãéí</TD> <TD valign=top width=65>&nbsp; 900</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 900</TD> <TD valign=top width=65>&nbsp; 900</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 1,434</TD> <TD valign=top width=40>&nbsp;159.33</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732004</TD> <TD valign=top align="right" width=120>&nbsp;äñãøú øùåéåú ðé÷åæ</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 649</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;7321</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò ìúàâéãé ôééìåè ìîéí åìáéåá</TD> <TD valign=top width=65>&nbsp; 58,240</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 58,240</TD> <TD valign=top width=65>&nbsp; 30,871</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 7,259</TD> <TD valign=top width=40>&nbsp; 12.46</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732101</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò ìúàâéãé ôééìåè ìîéí åìáéåá</TD> <TD valign=top width=65>&nbsp; 58,240</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 58,240</TD> <TD valign=top width=65>&nbsp; 30,871</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 7,259</TD> <TD valign=top width=40>&nbsp; 12.46</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;7322</TD> <TD valign=top align="right" width=120>&nbsp;îôòìé áéåá</TD> <TD valign=top width=65>&nbsp; 417,840</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 417,840</TD> <TD valign=top width=65>&nbsp; 394,078</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 393,867</TD> <TD valign=top width=40>&nbsp; 94.26</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732202</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò øâéì 96 åàéìê</TD> <TD valign=top width=65>&nbsp; 243,312</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 243,312</TD> <TD valign=top width=65>&nbsp; 251,738</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 165,865</TD> <TD valign=top width=40>&nbsp; 68.17</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;732203</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò ìúàâéã éøåùìéí 96 åàéìê</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732204</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò áúðàéí îéåçãéí</TD> <TD valign=top width=65>&nbsp; 16,870</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 16,870</TD> <TD valign=top width=65>&nbsp; 22,290</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 32,579</TD> <TD valign=top width=40>&nbsp;193.12</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;732205</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò îéåçã ì÷å òéîåú</TD> <TD valign=top width=65>&nbsp; 32,609</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 32,609</TD> <TD valign=top width=65>&nbsp; 19,125</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 38,002</TD> <TD valign=top width=40>&nbsp;116.54</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732206</TD> <TD valign=top align="right" width=120>&nbsp;îòð÷éí</TD> <TD valign=top width=65>&nbsp; 506</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 506</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 3,178</TD> <TD valign=top width=40>&nbsp;628.06</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;732207</TD> <TD valign=top align="right" width=120>&nbsp;úëðåï îôòìé áéåá</TD> <TD valign=top width=65>&nbsp; 612</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 612</TD> <TD valign=top width=65>&nbsp; 431</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 257</TD> <TD valign=top width=40>&nbsp; 41.99</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732208</TD> <TD valign=top align="right" width=120>&nbsp;äùúúôåéåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;732209</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò îéåçã ìùãøåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 20,634</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;732210</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò îéåçã ìéùåáé îâæø äîéòåèéí ùðú 2001 åàéìê</TD> <TD valign=top width=65>&nbsp; 90,405</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 90,405</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 97,146</TD> <TD valign=top width=40>&nbsp;107.46</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;732211</TD> <TD valign=top align="right" width=120>&nbsp;ñéåò îéåçã ìéùåáé "èéôåì ð÷åãúé" ùðú 2001 åàéìê</TD> <TD valign=top width=65>&nbsp; 33,526</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 33,526</TD> <TD valign=top width=65>&nbsp; 79,860</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 56,840</TD> <TD valign=top width=40>&nbsp;169.54</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;7323</TD> <TD valign=top align="right" width=120>&nbsp;øæøáä ìäúéé÷øåéåú</TD> <TD valign=top width=65>&nbsp; 19,994</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 19,994</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;732301</TD> <TD valign=top align="right" width=120>&nbsp;øæøáä ìäúéé÷øåéåú</TD> <TD valign=top width=65>&nbsp; 19,994</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 19,994</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> </TABLE> </CENTER> <BR> <CENTER> <table border="0" cellspacing="1" cellpadding="3" bgcolor="#8fbcee" dir="rtl"> <TR class="C" align="center"> <TD class="A_Row" valign=top width=80>ñéëåí ãå"ç</TD> <TD class="A_Row" valign=top width=60>äåöàä ðèå</TD> <TD class="A_Row" valign=top width=60>äåöàä îåúðéú áäëðñä</TD> <TD class="A_Row" valign=top width=60>ñä"ë äåöàä</TD> <TD class="A_Row" valign=top width=60>äøùàä ìäúçééá</TD> <TD class="A_Row" valign=top width=60>ùéà ë"à</TD> <TD class="A_Row" valign=top width=50>ñä"ë ðåöì</TD> <TD class="A_Row" valign=top width=50>àçåæ ðåöì</TD> </TR> <TR class="clear" align="center"> <TD class="A_Row" valign=top width=80>&nbsp;ú÷öéá î÷åøé</TD> <TD class="A_Row" valign=top width=60>&nbsp; 655,551</TD> <TD class="A_Row" valign=top width=60>&nbsp; 0</TD> <TD class="A_Row" valign=top width=60>&nbsp; 655,551</TD> <TD class="A_Row" valign=top width=60>&nbsp; 510,481</TD> <TD class="A_Row" valign=top width=60>&nbsp; 0</TD> <TD class="A_Row" valign=top width=50>&nbsp;</TD> <TD class="A_Row" valign=top width=50>&nbsp;</TD> </TR> <!--<TR class="clear" align="center"> <TD class="A_Row" valign=top width=80>&nbsp;ú÷öéá òì ùéðåééå</TD> <TD class="A_Row" valign=top width=60>&nbsp; 1,418,999</TD> <TD class="A_Row" valign=top width=60>&nbsp; 300</TD> <TD class="A_Row" valign=top width=60>&nbsp; 1,419,299</TD> <TD class="A_Row" valign=top width=60>&nbsp; 854,241</TD> <TD class="A_Row" valign=top width=60>&nbsp; 0</TD> <TD class="A_Row" valign=top width=50>&nbsp; 544,801</TD> <TD class="A_Row" valign=top width=50>&nbsp; 83.11</TD> </TR>--> </TABLE> <CENTER> <TABLE WIDTH="100" > <TR> <TD align="center" nowrap> <IMG SRC="/budget/Images/semel.gif" HEIGHT=37 WIDTH=30 border = "0"><BR> <FONT SIZE=-2> <A HREF="http://www.mof.gov.il/rights.htm"> ëì äæëåéåú &copy; .ùîåøåú,2005,îãéðú éùøàì<BR></A> ðùîç ì÷áì àú äòøåúéëí åäöòåúéëí ìëúåáú: </FONT> <FONT SIZE=-2 dir=ltr> <A HREF="mailto:[email protected]">[email protected]</A><BR> </FONT> </TD> </TR> </TABLE> </CENTER> </CENTER> </BODY> </HTML>
daonb/obudget
data/queries/results/result-2005-73.html
HTML
bsd-3-clause
24,557
// Copyright (c) 2012 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. #include "media/audio/mac/audio_low_latency_output_mac.h" #include <CoreServices/CoreServices.h> #include "base/basictypes.h" #include "base/command_line.h" #include "base/logging.h" #include "base/mac/mac_logging.h" #include "media/audio/audio_util.h" #include "media/audio/mac/audio_manager_mac.h" #include "media/base/media_switches.h" namespace media { static std::ostream& operator<<(std::ostream& os, const AudioStreamBasicDescription& format) { os << "sample rate : " << format.mSampleRate << std::endl << "format ID : " << format.mFormatID << std::endl << "format flags : " << format.mFormatFlags << std::endl << "bytes per packet : " << format.mBytesPerPacket << std::endl << "frames per packet : " << format.mFramesPerPacket << std::endl << "bytes per frame : " << format.mBytesPerFrame << std::endl << "channels per frame: " << format.mChannelsPerFrame << std::endl << "bits per channel : " << format.mBitsPerChannel; return os; } static AudioObjectPropertyAddress kDefaultOutputDeviceAddress = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; // Overview of operation: // 1) An object of AUAudioOutputStream is created by the AudioManager // factory: audio_man->MakeAudioStream(). // 2) Next some thread will call Open(), at that point the underlying // default output Audio Unit is created and configured. // 3) Then some thread will call Start(source). // Then the Audio Unit is started which creates its own thread which // periodically will call the source for more data as buffers are being // consumed. // 4) At some point some thread will call Stop(), which we handle by directly // stopping the default output Audio Unit. // 6) The same thread that called stop will call Close() where we cleanup // and notify the audio manager, which likely will destroy this object. AUAudioOutputStream::AUAudioOutputStream( AudioManagerMac* manager, const AudioParameters& params) : manager_(manager), source_(NULL), output_unit_(0), output_device_id_(kAudioObjectUnknown), volume_(1), hardware_latency_frames_(0), stopped_(false), audio_bus_(AudioBus::Create(params)) { // We must have a manager. DCHECK(manager_); // A frame is one sample across all channels. In interleaved audio the per // frame fields identify the set of n |channels|. In uncompressed audio, a // packet is always one frame. format_.mSampleRate = params.sample_rate(); format_.mFormatID = kAudioFormatLinearPCM; format_.mFormatFlags = kLinearPCMFormatFlagIsPacked | kLinearPCMFormatFlagIsSignedInteger; format_.mBitsPerChannel = params.bits_per_sample(); format_.mChannelsPerFrame = params.channels(); format_.mFramesPerPacket = 1; format_.mBytesPerPacket = (format_.mBitsPerChannel * params.channels()) / 8; format_.mBytesPerFrame = format_.mBytesPerPacket; format_.mReserved = 0; DVLOG(1) << "Desired ouput format: " << format_; // Calculate the number of sample frames per callback. number_of_frames_ = params.GetBytesPerBuffer() / format_.mBytesPerPacket; DVLOG(1) << "Number of frames per callback: " << number_of_frames_; const AudioParameters parameters = manager_->GetDefaultOutputStreamParameters(); CHECK_EQ(number_of_frames_, static_cast<size_t>(parameters.frames_per_buffer())); } AUAudioOutputStream::~AUAudioOutputStream() { } bool AUAudioOutputStream::Open() { // Obtain the current input device selected by the user. UInt32 size = sizeof(output_device_id_); OSStatus result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &kDefaultOutputDeviceAddress, 0, 0, &size, &output_device_id_); if (result != noErr || output_device_id_ == kAudioObjectUnknown) { OSSTATUS_DLOG(WARNING, result) << "Could not get default audio output device."; return false; } // Open and initialize the DefaultOutputUnit. AudioComponent comp; AudioComponentDescription desc; desc.componentType = kAudioUnitType_Output; desc.componentSubType = kAudioUnitSubType_DefaultOutput; desc.componentManufacturer = kAudioUnitManufacturer_Apple; desc.componentFlags = 0; desc.componentFlagsMask = 0; comp = AudioComponentFindNext(0, &desc); if (!comp) return false; result = AudioComponentInstanceNew(comp, &output_unit_); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "AudioComponentInstanceNew() failed."; return false; } result = AudioUnitInitialize(output_unit_); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "AudioUnitInitialize() failed."; return false; } hardware_latency_frames_ = GetHardwareLatency(); return Configure(); } bool AUAudioOutputStream::Configure() { // Set the render callback. AURenderCallbackStruct input; input.inputProc = InputProc; input.inputProcRefCon = this; OSStatus result = AudioUnitSetProperty( output_unit_, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Global, 0, &input, sizeof(input)); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "AudioUnitSetProperty(kAudioUnitProperty_SetRenderCallback) failed."; return false; } // Set the stream format. result = AudioUnitSetProperty( output_unit_, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, 0, &format_, sizeof(format_)); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "AudioUnitSetProperty(kAudioUnitProperty_StreamFormat) failed."; return false; } // Set the buffer frame size. // WARNING: Setting this value changes the frame size for all audio units in // the current process. It's imperative that the input and output frame sizes // be the same as the frames_per_buffer() returned by // GetDefaultOutputStreamParameters. // See http://crbug.com/154352 for details. UInt32 buffer_size = number_of_frames_; result = AudioUnitSetProperty( output_unit_, kAudioDevicePropertyBufferFrameSize, kAudioUnitScope_Output, 0, &buffer_size, sizeof(buffer_size)); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "AudioUnitSetProperty(kAudioDevicePropertyBufferFrameSize) failed."; return false; } return true; } void AUAudioOutputStream::Close() { if (output_unit_) AudioComponentInstanceDispose(output_unit_); // Inform the audio manager that we have been closed. This can cause our // destruction. manager_->ReleaseOutputStream(this); } void AUAudioOutputStream::Start(AudioSourceCallback* callback) { DCHECK(callback); if (!output_unit_) { DLOG(ERROR) << "Open() has not been called successfully"; return; } stopped_ = false; { base::AutoLock auto_lock(source_lock_); source_ = callback; } AudioOutputUnitStart(output_unit_); } void AUAudioOutputStream::Stop() { if (stopped_) return; AudioOutputUnitStop(output_unit_); base::AutoLock auto_lock(source_lock_); source_ = NULL; stopped_ = true; } void AUAudioOutputStream::SetVolume(double volume) { if (!output_unit_) return; volume_ = static_cast<float>(volume); // TODO(crogers): set volume property } void AUAudioOutputStream::GetVolume(double* volume) { if (!output_unit_) return; *volume = volume_; } // Pulls on our provider to get rendered audio stream. // Note to future hackers of this function: Do not add locks here because this // is running on a real-time thread (for low-latency). OSStatus AUAudioOutputStream::Render(UInt32 number_of_frames, AudioBufferList* io_data, const AudioTimeStamp* output_time_stamp) { // Update the playout latency. double playout_latency_frames = GetPlayoutLatency(output_time_stamp); AudioBuffer& buffer = io_data->mBuffers[0]; uint8* audio_data = reinterpret_cast<uint8*>(buffer.mData); uint32 hardware_pending_bytes = static_cast<uint32> ((playout_latency_frames + 0.5) * format_.mBytesPerFrame); // Unfortunately AUAudioInputStream and AUAudioOutputStream share the frame // size set by kAudioDevicePropertyBufferFrameSize above on a per process // basis. What this means is that the |number_of_frames| value may be larger // or smaller than the value set during Configure(). In this case either // audio input or audio output will be broken, so just output silence. // TODO(crogers): Figure out what can trigger a change in |number_of_frames|. // See http://crbug.com/154352 for details. if (number_of_frames != static_cast<UInt32>(audio_bus_->frames())) { memset(audio_data, 0, number_of_frames * format_.mBytesPerFrame); return noErr; } int frames_filled = 0; { // Render() shouldn't be called except between AudioOutputUnitStart() and // AudioOutputUnitStop() calls, but crash reports have shown otherwise: // http://crbug.com/178765. We use |source_lock_| to prevent races and // crashes in Render() when |source_| is cleared. base::AutoLock auto_lock(source_lock_); if (!source_) { memset(audio_data, 0, number_of_frames * format_.mBytesPerFrame); return noErr; } frames_filled = source_->OnMoreData( audio_bus_.get(), AudioBuffersState(0, hardware_pending_bytes)); } // Note: If this ever changes to output raw float the data must be clipped and // sanitized since it may come from an untrusted source such as NaCl. audio_bus_->ToInterleaved( frames_filled, format_.mBitsPerChannel / 8, audio_data); uint32 filled = frames_filled * format_.mBytesPerFrame; // Perform in-place, software-volume adjustments. media::AdjustVolume(audio_data, filled, audio_bus_->channels(), format_.mBitsPerChannel / 8, volume_); return noErr; } // DefaultOutputUnit callback OSStatus AUAudioOutputStream::InputProc(void* user_data, AudioUnitRenderActionFlags*, const AudioTimeStamp* output_time_stamp, UInt32, UInt32 number_of_frames, AudioBufferList* io_data) { AUAudioOutputStream* audio_output = static_cast<AUAudioOutputStream*>(user_data); if (!audio_output) return -1; return audio_output->Render(number_of_frames, io_data, output_time_stamp); } int AUAudioOutputStream::HardwareSampleRate() { // Determine the default output device's sample-rate. AudioDeviceID device_id = kAudioObjectUnknown; UInt32 info_size = sizeof(device_id); OSStatus result = AudioObjectGetPropertyData(kAudioObjectSystemObject, &kDefaultOutputDeviceAddress, 0, 0, &info_size, &device_id); if (result != noErr || device_id == kAudioObjectUnknown) { OSSTATUS_DLOG(WARNING, result) << "Could not get default audio output device."; return 0; } Float64 nominal_sample_rate; info_size = sizeof(nominal_sample_rate); AudioObjectPropertyAddress nominal_sample_rate_address = { kAudioDevicePropertyNominalSampleRate, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster }; result = AudioObjectGetPropertyData(device_id, &nominal_sample_rate_address, 0, 0, &info_size, &nominal_sample_rate); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "Could not get default sample rate for device: " << device_id; return 0; } return static_cast<int>(nominal_sample_rate); } double AUAudioOutputStream::GetHardwareLatency() { if (!output_unit_ || output_device_id_ == kAudioObjectUnknown) { DLOG(WARNING) << "Audio unit object is NULL or device ID is unknown"; return 0.0; } // Get audio unit latency. Float64 audio_unit_latency_sec = 0.0; UInt32 size = sizeof(audio_unit_latency_sec); OSStatus result = AudioUnitGetProperty(output_unit_, kAudioUnitProperty_Latency, kAudioUnitScope_Global, 0, &audio_unit_latency_sec, &size); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "Could not get audio unit latency"; return 0.0; } // Get output audio device latency. AudioObjectPropertyAddress property_address = { kAudioDevicePropertyLatency, kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementMaster }; UInt32 device_latency_frames = 0; size = sizeof(device_latency_frames); result = AudioObjectGetPropertyData(output_device_id_, &property_address, 0, NULL, &size, &device_latency_frames); if (result != noErr) { OSSTATUS_DLOG(WARNING, result) << "Could not get audio unit latency"; return 0.0; } return static_cast<double>((audio_unit_latency_sec * format_.mSampleRate) + device_latency_frames); } double AUAudioOutputStream::GetPlayoutLatency( const AudioTimeStamp* output_time_stamp) { // Ensure mHostTime is valid. if ((output_time_stamp->mFlags & kAudioTimeStampHostTimeValid) == 0) return 0; // Get the delay between the moment getting the callback and the scheduled // time stamp that tells when the data is going to be played out. UInt64 output_time_ns = AudioConvertHostTimeToNanos( output_time_stamp->mHostTime); UInt64 now_ns = AudioConvertHostTimeToNanos(AudioGetCurrentHostTime()); // Prevent overflow leading to huge delay information; occurs regularly on // the bots, probably less so in the wild. if (now_ns > output_time_ns) return 0; double delay_frames = static_cast<double> (1e-9 * (output_time_ns - now_ns) * format_.mSampleRate); return (delay_frames + hardware_latency_frames_); } } // namespace media
timopulkkinen/BubbleFish
media/audio/mac/audio_low_latency_output_mac.cc
C++
bsd-3-clause
15,052
<?php use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model common\models\ComputerVih */ $this->title = Yii::t('app', 'Create Computer Vih'); $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Computer Vihs'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="computer-vih-create"> <h1><?= Html::encode($this->title) ?></h1> <?= $this->render('_form', [ 'model' => $model, ]) ?> </div>
tongmckub/yii2-asset-vih-final
frontend/views/computer-vih/create.php
PHP
bsd-3-clause
468
<?php /** * CmsModule class file. * @author Christoffer Niska <[email protected]> * @copyright Copyright &copy; 2011, Nord Software Ltd * @license http://www.opensource.org/licenses/bsd-license.php New BSD License * @package cms */ class CmsModule extends CWebModule { /** * @var string the name of the default controller */ public $defaultController = 'admin'; /** * Initializes the module. */ public function init() { // Register module imports. $this->setImport(array( 'cms.components.*', 'cms.models.*', 'ext.bootstrap.widgets.*' )); } /** * Performs access check to this module. * @param CController $controller the controller to be accessed * @param CAction $action the action to be accessed * @return boolean whether the action should be executed */ public function beforeControllerAction($controller, $action) { if (parent::beforeControllerAction($controller, $action)) { $route = $controller->id.'/'.$action->id; if (!Yii::app()->cms->checkAccess() && $route !== 'node/page') throw new CHttpException(403, Yii::t('CmsModule.core', 'You are not allowed to access this page.')); $publicPages = array('node/page'); if (Yii::app()->user->isGuest && !in_array($route, $publicPages)) Yii::app()->user->loginRequired(); else return true; } return false; } public function getVersion() { return '0.9.1'; } }
boo1ean/NordCms
CmsModule.php
PHP
bsd-3-clause
1,428
// SDLRegisterAppInterface.h // #import "SDLRPCRequest.h" #import "SDLAppHMIType.h" #import "SDLLanguage.h" @class SDLAppInfo; @class SDLDeviceInfo; @class SDLLifecycleConfiguration; @class SDLSyncMsgVersion; @class SDLTemplateColorScheme; @class SDLTTSChunk; /** * Registers the application's interface with SDL. The `RegisterAppInterface` RPC declares the properties of the app, including the messaging interface version, the app name, etc. The mobile application must establish its interface registration with SDL before any other interaction with SDL can take place. The registration lasts until it is terminated either by the application calling the `SDLUnregisterAppInterface` method, or by SDL sending an `SDLOnAppInterfaceUnregistered` notification, or by loss of the underlying transport connection, or closing of the underlying message transmission protocol RPC session. * * Until the application receives its first `SDLOnHMIStatus` notification, its `SDLHMILevel` is assumed to be `NONE`, the `SDLAudioStreamingState` is assumed to be `NOT_AUDIBLE`, and the `SDLSystemContext` is assumed to be `MAIN`. * * All SDL resources which the application creates or uses (e.g. choice sets, command menu, etc.) are associated with the application's interface registration. Therefore, when the interface registration ends, the SDL resources associated with the application are disposed of. As a result, even though the application itself may continue to run on its host platform (e.g. mobile device) after the interface registration terminates, the application will not be able to use the SDL HMI without first establishing a new interface registration and re-creating its required SDL resources. That is, SDL resources created by (or on behalf of) an application do not persist beyond the life-span of the interface registration. Resources and settings whose lifespan is tied to the duration of an application's interface registration include: choice sets, command menus, and the media clock timer display value * * If the application intends to stream audio it is important to indicate so via the `isMediaApp` parameter. When set to true, audio will reliably stream without any configuration required by the user. When not set, audio may stream, depending on what the user might have manually configured as a media source on SDL. * * @since SDL 1.0 * * @see SDLUnregisterAppInterface, SDLOnAppInterfaceUnregistered */ NS_ASSUME_NONNULL_BEGIN @interface SDLRegisterAppInterface : SDLRPCRequest /** * Convenience init for registering the application with a lifecycle configuration. * * @param lifecycleConfiguration Configuration options for SDLManager */ - (instancetype)initWithLifecycleConfiguration:(SDLLifecycleConfiguration *)lifecycleConfiguration; /** * Convenience init for registering the application. * * @param appName The mobile application's name * @param appId An appId used to validate app with policy table entries * @param languageDesired The language the application intends to use for user interaction * @return A SDLRegisterAppInterface object */ - (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId languageDesired:(SDLLanguage)languageDesired; /** * Convenience init for registering the application. * * @param appName The mobile application's name * @param appId An appId used to validate app with policy table entries * @param languageDesired The language the application intends to use for user interaction * @param isMediaApp Indicates if the application is a media or a non-media application * @param appTypes A list of all applicable app types stating which classifications to be given to the app * @param shortAppName An abbreviated version of the mobile application's name * @return A SDLRegisterAppInterface object */ - (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId languageDesired:(SDLLanguage)languageDesired isMediaApp:(BOOL)isMediaApp appTypes:(NSArray<SDLAppHMIType> *)appTypes shortAppName:(nullable NSString *)shortAppName __deprecated_msg(("Use initWithAppName:appId:fullAppId:languageDesired:isMediaApp:appTypes:shortAppName:ttsName:vrSynonyms:hmiDisplayLanguageDesired:resumeHash:dayColorScheme:nightColorScheme: instead")); /** * Convenience init for registering the application. * * @param appName The mobile application's name * @param appId An appId used to validate app with policy table entries * @param languageDesired The language the application intends to use for user interaction * @param isMediaApp Indicates if the application is a media or a non-media application * @param appTypes A list of all applicable app types stating which classifications to be given to the app * @param shortAppName An abbreviated version of the mobile application's name * @param ttsName TTS string for VR recognition of the mobile application name * @param vrSynonyms Additional voice recognition commands * @param hmiDisplayLanguageDesired Current app's expected VR+TTS language * @param resumeHash ID used to uniquely identify current state of all app data that can persist through connection cycles * @return A SDLRegisterAppInterface object */ - (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId languageDesired:(SDLLanguage)languageDesired isMediaApp:(BOOL)isMediaApp appTypes:(NSArray<SDLAppHMIType> *)appTypes shortAppName:(nullable NSString *)shortAppName ttsName:(nullable NSArray<SDLTTSChunk *> *)ttsName vrSynonyms:(nullable NSArray<NSString *> *)vrSynonyms hmiDisplayLanguageDesired:(SDLLanguage)hmiDisplayLanguageDesired resumeHash:(nullable NSString *)resumeHash __deprecated_msg(("Use initWithAppName:appId:fullAppId:languageDesired:isMediaApp:appTypes:shortAppName:ttsName:vrSynonyms:hmiDisplayLanguageDesired:resumeHash:dayColorScheme:nightColorScheme: instead")); /** * Convenience init for registering the application with all possible options. * * @param appName The mobile application's name * @param appId An appId used to validate app with policy table entries * @param fullAppId A full UUID appID used to validate app with policy table entries. * @param languageDesired The language the application intends to use for user interaction * @param isMediaApp Indicates if the application is a media or a non-media application * @param appTypes A list of all applicable app types stating which classifications to be given to the app * @param shortAppName An abbreviated version of the mobile application's name * @param ttsName TTS string for VR recognition of the mobile application name * @param vrSynonyms Additional voice recognition commands * @param hmiDisplayLanguageDesired Current app's expected VR+TTS language * @param resumeHash ID used to uniquely identify current state of all app data that can persist through connection cycles * @param dayColorScheme The color scheme to be used on a head unit using a "light" or "day" color scheme. * @param nightColorScheme The color scheme to be used on a head unit using a "dark" or "night" color scheme * @return A SDLRegisterAppInterface object */ - (instancetype)initWithAppName:(NSString *)appName appId:(NSString *)appId fullAppId:(nullable NSString *)fullAppId languageDesired:(SDLLanguage)languageDesired isMediaApp:(BOOL)isMediaApp appTypes:(NSArray<SDLAppHMIType> *)appTypes shortAppName:(nullable NSString *)shortAppName ttsName:(nullable NSArray<SDLTTSChunk *> *)ttsName vrSynonyms:(nullable NSArray<NSString *> *)vrSynonyms hmiDisplayLanguageDesired:(SDLLanguage)hmiDisplayLanguageDesired resumeHash:(nullable NSString *)resumeHash dayColorScheme:(nullable SDLTemplateColorScheme *)dayColorScheme nightColorScheme:(nullable SDLTemplateColorScheme *)nightColorScheme; /** * The version of the SDL interface * * Required */ @property (strong, nonatomic) SDLSyncMsgVersion *syncMsgVersion; /** * The mobile application's name. This name is displayed in the SDL Mobile Applications menu. It also serves as the unique identifier of the application for SmartDeviceLink. * * 1. Needs to be unique over all applications. Applications with the same name will be rejected. * 2. May not be empty. * 3. May not start with a new line character. * 4. May not interfere with any name or synonym of previously registered applications and any predefined blacklist of words (global commands). * * Required, Max length 100 chars */ @property (strong, nonatomic) NSString *appName; /** * TTS string for VR recognition of the mobile application name. * * @discussion Meant to overcome any failing on speech engine in properly pronouncing / understanding app name. * 1. Needs to be unique over all applications. * 2. May not be empty. * 3. May not start with a new line character. * * Optional, Array of SDLTTSChunk, Array size 1 - 100 * * @since SDL 2.0 * @see SDLTTSChunk */ @property (nullable, strong, nonatomic) NSArray<SDLTTSChunk *> *ttsName; /** * A String representing an abbreviated version of the mobile application's name (if necessary) that will be displayed on the media screen. * * @discussion If not provided, the appName is used instead (and will be truncated if too long) * * Optional, Max length 100 chars */ @property (nullable, strong, nonatomic) NSString *ngnMediaScreenAppName; /** * Defines additional voice recognition commands * * @discussion May not interfere with any app name of previously registered applications and any predefined blacklist of words (global commands). * * Optional, Array of Strings, Array length 1 - 100, Max String length 40 */ @property (nullable, strong, nonatomic) NSArray<NSString *> *vrSynonyms; /** * Indicates if the application is a media or a non-media application. * * @discussion Only media applications will be able to stream audio to head units that is audible outside of the BT media source. * * Required, Boolean */ @property (strong, nonatomic) NSNumber<SDLBool> *isMediaApplication; /** * A Language enumeration indicating what language the application intends to use for user interaction (TTS and VR). * * @discussion If there is a mismatch with the head unit, the app will be able to change this registration with changeRegistration prior to app being brought into focus. * * Required */ @property (strong, nonatomic) SDLLanguage languageDesired; /** * An enumeration indicating what language the application intends to use for user interaction (Display). * * @discussion If there is a mismatch with the head unit, the app will be able to change this registration with changeRegistration prior to app being brought into focus. * * Required * * @since SDL 2.0 */ @property (strong, nonatomic) SDLLanguage hmiDisplayLanguageDesired; /** * A list of all applicable app types stating which classifications to be given to the app. * * Optional, Array of SDLAppHMIType, Array size 1 - 100 * * @since SDL 2.0 * @see SDLAppHMIType */ @property (nullable, strong, nonatomic) NSArray<SDLAppHMIType> *appHMIType; /** * ID used to uniquely identify current state of all app data that can persist through connection cycles (e.g. ignition cycles). * * @discussion This registered data (commands, submenus, choice sets, etc.) can be reestablished without needing to explicitly reregister each piece. If omitted, then the previous state of an app's commands, etc. will not be restored. * * When sending hashID, all RegisterAppInterface parameters should still be provided (e.g. ttsName, etc.). * * Optional, max length 100 chars */ @property (nullable, strong, nonatomic) NSString *hashID; /** * Information about the connecting device * * Optional */ @property (nullable, strong, nonatomic) SDLDeviceInfo *deviceInfo; /** * ID used to validate app with policy table entries * * Required, max length 100 * * @see `fullAppID` * * @since SDL 2.0 */ @property (strong, nonatomic) NSString *appID; /** * A full UUID appID used to validate app with policy table entries. * * Optional * * @discussion The `fullAppId` is used to authenticate apps that connect with head units that implement SDL Core v.5.0 and newer. If connecting with older head units, the `fullAppId` can be truncated to create the required `appId` needed to register the app. The `appId` is the first 10 non-dash ("-") characters of the `fullAppID` (e.g. if you have a `fullAppId` of 123e4567-e89b-12d3-a456-426655440000, the `appId` will be 123e4567e8). */ @property (nullable, strong, nonatomic) NSString *fullAppID; /** * Information about the application running * * Optional */ @property (nullable, strong, nonatomic) SDLAppInfo *appInfo; /** * The color scheme to be used on a head unit using a "light" or "day" color scheme. The OEM may only support this theme if their head unit only has a light color scheme. * * Optional */ @property (strong, nonatomic, nullable) SDLTemplateColorScheme *dayColorScheme; /** * The color scheme to be used on a head unit using a "dark" or "night" color scheme. The OEM may only support this theme if their head unit only has a dark color scheme. * * Optional */ @property (strong, nonatomic, nullable) SDLTemplateColorScheme *nightColorScheme; @end NS_ASSUME_NONNULL_END
smartdevicelink/sdl_mobileweather_tutorial_ios
Pods/SmartDeviceLink/SmartDeviceLink/SDLRegisterAppInterface.h
C
bsd-3-clause
13,759
<style> .buy-tickets__title{margin: 10px; width: 6%; margin-left: 0px;} .buy-tickets__title.ticket-title{width: 50%;} .buy-tickets__title.flash{width: 15%;} .buy-tickets__title.flash-price{width: 11%;} .form .input__number .input__number-control.sold-out{ width: 80px;height: 10px;margin: 5px;} p.error{display: none; color: #ff0000;text-align: center;margin: 10px;} .buy-tickets{ display:none } .hidden-div{ display:none; margin-bottom:0;} </style> <button onclick="getElementById('hidden-div').style.display = 'block'" style="margin-bottom: 1px"> Buy Tickets Now </button> <div class="hidden-div" id="hidden-div" style="height: 100%;"><?php echo $eventbrite;?></div> <br><br><br><br><br>
Michelle941/v1.0
views/site/_buyTicketForm.php
PHP
bsd-3-clause
723
// Copyright 2020 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // These tests check that Torque-generated verifier functions crash the process // when encountering data that doesn't fit the Torque type definitions. #include "src/api/api-inl.h" #include "src/objects/descriptor-array.h" #include "src/objects/map-inl.h" #include "test/cctest/cctest.h" #include "torque-generated/class-verifiers.h" namespace v8 { namespace internal { // Defines a pair of tests with similar code. The goal is to test that a // specific action causes a failure, but that everything else in the test case // succeeds. The general pattern should be: // // TEST_PAIR(Something) { // do_setup_steps_that_always_succeed(); // if (should_fail) { // do_the_step_that_fails(); // } // do_teardown_steps_that_always_succeed(); // } // // A corresponding entry in cctest.status specifies that all Fail* tests in this // file must fail. #define TEST_PAIR(Name) \ static void Name(bool should_fail); \ TEST(Pass##Name) { Name(false); } \ TEST(Fail##Name) { Name(true); } \ static void Name(bool should_fail) #ifdef VERIFY_HEAP TEST_PAIR(TestWrongTypeInNormalField) { CcTest::InitializeVM(); v8::Isolate* isolate = CcTest::isolate(); i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); v8::HandleScope scope(isolate); v8::Local<v8::Value> v = CompileRun("({a: 3, b: 4})"); Handle<JSObject> o = Handle<JSObject>::cast(v8::Utils::OpenHandle(*v)); Handle<Object> original_elements( TaggedField<Object>::load(*o, JSObject::kElementsOffset), i_isolate); CHECK(original_elements->IsFixedArrayBase()); // There must be no GC (and therefore no verifiers running) until we can // restore the modified data. DisallowHeapAllocation no_gc; // Elements must be FixedArrayBase according to the Torque definition, so a // JSObject should cause a failure. TaggedField<Object>::store(*o, JSObject::kElementsOffset, *o); if (should_fail) { TorqueGeneratedClassVerifiers::JSObjectVerify(*o, i_isolate); } // Put back the original value in case verifiers run on test shutdown. TaggedField<Object>::store(*o, JSObject::kElementsOffset, *original_elements); } TEST_PAIR(TestWrongStrongTypeInIndexedStructField) { CcTest::InitializeVM(); v8::Isolate* isolate = CcTest::isolate(); i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); v8::HandleScope scope(isolate); v8::Local<v8::Value> v = CompileRun("({a: 3, b: 4})"); Handle<Object> o = v8::Utils::OpenHandle(*v); Handle<Map> map(Handle<HeapObject>::cast(o)->map(), i_isolate); Handle<DescriptorArray> descriptors(map->instance_descriptors(kRelaxedLoad), i_isolate); int offset = DescriptorArray::OffsetOfDescriptorAt(1) + DescriptorArray::kEntryKeyOffset; Handle<Object> original_key(TaggedField<Object>::load(*descriptors, offset), i_isolate); CHECK(original_key->IsString()); // There must be no GC (and therefore no verifiers running) until we can // restore the modified data. DisallowHeapAllocation no_gc; // Key must be Name|Undefined according to the Torque definition, so a // JSObject should cause a failure. TaggedField<Object>::store(*descriptors, offset, *o); if (should_fail) { TorqueGeneratedClassVerifiers::DescriptorArrayVerify(*descriptors, i_isolate); } // Put back the original value in case verifiers run on test shutdown. TaggedField<Object>::store(*descriptors, offset, *original_key); } TEST_PAIR(TestWrongWeakTypeInIndexedStructField) { CcTest::InitializeVM(); v8::Isolate* isolate = CcTest::isolate(); i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); v8::HandleScope scope(isolate); v8::Local<v8::Value> v = CompileRun("({a: 3, b: 4})"); Handle<Object> o = v8::Utils::OpenHandle(*v); Handle<Map> map(Handle<HeapObject>::cast(o)->map(), i_isolate); Handle<DescriptorArray> descriptors(map->instance_descriptors(kRelaxedLoad), i_isolate); int offset = DescriptorArray::OffsetOfDescriptorAt(0) + DescriptorArray::kEntryValueOffset; Handle<Object> original_value(TaggedField<Object>::load(*descriptors, offset), i_isolate); // There must be no GC (and therefore no verifiers running) until we can // restore the modified data. DisallowHeapAllocation no_gc; // Value can be JSAny, which includes JSObject, and it can be Weak<Map>, but // it can't be Weak<JSObject>. TaggedField<Object>::store(*descriptors, offset, *o); TorqueGeneratedClassVerifiers::DescriptorArrayVerify(*descriptors, i_isolate); MaybeObject weak = MaybeObject::MakeWeak(MaybeObject::FromObject(*o)); TaggedField<MaybeObject>::store(*descriptors, offset, weak); if (should_fail) { TorqueGeneratedClassVerifiers::DescriptorArrayVerify(*descriptors, i_isolate); } // Put back the original value in case verifiers run on test shutdown. TaggedField<Object>::store(*descriptors, offset, *original_value); } TEST_PAIR(TestWrongOddball) { CcTest::InitializeVM(); v8::Isolate* isolate = CcTest::isolate(); i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); v8::HandleScope scope(isolate); v8::Local<v8::Value> v = CompileRun("new Date()"); Handle<JSDate> date = Handle<JSDate>::cast(v8::Utils::OpenHandle(*v)); Handle<Object> original_hour( TaggedField<Object>::load(*date, JSDate::kHourOffset), i_isolate); // There must be no GC (and therefore no verifiers running) until we can // restore the modified data. DisallowHeapAllocation no_gc; // Hour is Undefined|Smi|NaN. Other oddballs like null should cause a failure. TaggedField<Object>::store(*date, JSDate::kHourOffset, *i_isolate->factory()->null_value()); if (should_fail) { TorqueGeneratedClassVerifiers::JSDateVerify(*date, i_isolate); } // Put back the original value in case verifiers run on test shutdown. TaggedField<Object>::store(*date, JSDate::kHourOffset, *original_hour); } TEST_PAIR(TestWrongNumber) { CcTest::InitializeVM(); v8::Isolate* isolate = CcTest::isolate(); i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); v8::HandleScope scope(isolate); v8::Local<v8::Value> v = CompileRun("new Date()"); Handle<JSDate> date = Handle<JSDate>::cast(v8::Utils::OpenHandle(*v)); Handle<Object> original_hour( TaggedField<Object>::load(*date, JSDate::kHourOffset), i_isolate); v8::Local<v8::Value> v2 = CompileRun("1.1"); Handle<Object> float_val = v8::Utils::OpenHandle(*v2); // There must be no GC (and therefore no verifiers running) until we can // restore the modified data. DisallowHeapAllocation no_gc; // Hour is Undefined|Smi|NaN. Other doubles like 1.1 should cause a failure. TaggedField<Object>::store(*date, JSDate::kHourOffset, *float_val); if (should_fail) { TorqueGeneratedClassVerifiers::JSDateVerify(*date, i_isolate); } // Put back the original value in case verifiers run on test shutdown. TaggedField<Object>::store(*date, JSDate::kHourOffset, *original_hour); } #endif // VERIFY_HEAP #undef TEST_PAIR } // namespace internal } // namespace v8
youtube/cobalt
third_party/v8/test/cctest/test-verifiers.cc
C++
bsd-3-clause
7,485
from django import template from django.utils.safestring import mark_safe from mezzanine.conf import settings from mezzanine_developer_extension.utils import refactor_html register = template.Library() # Checking settings.TEMPLATE_STYLE. # Possible values are: # - mezzanine_developer_extension.styles.macos # - mezzanine_developer_extension.styles.ubuntu # - mezzanine_developer_extension.styles.windows _prefix = "mezzanine_developer_extension.styles" try: if settings.TERMINAL_STYLE not in \ ["%s.macos" % _prefix, "%s.ubuntu" % _prefix, "%s.windows" % _prefix]: # If the user has specified a wrong terminal styling format, we # raise an exception warning about this. msg = "Wrong terminal style format. Check the value of TERMINAL_STYLE"\ " in your settings.py file." raise Exception(msg) except AttributeError: msg = "You have not specified a terminal output format. You have to"\ " define the attribute TERMINAL_STYLE in your settings.py" raise Exception(msg) @register.filter(name='safe_developer') def safe_developer(content, style="macos"): """ Renders content without cleaning the original. Replaces the terminal divs for a more complext html layout. """ new_content = refactor_html(content, style) return mark_safe(new_content)
educalleja/mezzanine-developer-extension
mezzanine_developer_extension/templatetags/devfilters.py
Python
bsd-3-clause
1,349
#pragma once //=====================================================================// /*! @file @brief R8C グループ・コンパレーター I/O 制御 @author 平松邦仁 ([email protected]) @copyright Copyright (C) 2015, 2017 Kunihito Hiramatsu @n Released under the MIT license @n https://github.com/hirakuni45/R8C/blob/master/LICENSE */ //=====================================================================// #include "common/vect.h" #include "M120AN/system.hpp" #include "M120AN/intr.hpp" #include "M120AN/comp.hpp" namespace device { //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// /*! @brief コンパレーター・フィルター */ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// enum class comp_filter { none, ///< 無し f1, f8, f32 }; //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// /*! @brief コンパレーター・エッジ */ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// enum class comp_edge { a_lt_r, ///< アナログ入力が基準入力より低い時 a_gt_r, ///< アナログ入力が基準入力より高い時 ltgt = 3, ///< 低いおよび高い時 }; //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// /*! @brief コンパレーター I/O 制御クラス @param[in] TASK1 コンパレーター1割り込み処理 @param[in] TASK3 コンパレーター3割り込み処理 */ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// template <class TASK1, class TASK3> class comp_io { static TASK1 task1_; static TASK3 task3_; public: static inline void itask1() { task1_(); WCB1INTR.WCB1F = 0; } static inline void itask3() { task3_(); WCB3INTR.WCB3F = 0; } public: //-----------------------------------------------------------------// /*! @brief コンストラクター */ //-----------------------------------------------------------------// comp_io() { } //-----------------------------------------------------------------// /*! @brief チャネル1開始 @param[in] et 比較モード @para,[in] fl フィルター */ //-----------------------------------------------------------------// void start1(comp_edge eg = comp_edge::ltgt, comp_filter fl = comp_filter::none, uint8_t ir_lvl = 0) const { WCMPR.WCB1M0 = 1; ILVL2.B01 = ir_lvl; if(ir_lvl) { WCB1INTR.WCB1FL = static_cast<uint8_t>(fl); WCB1INTR.WCB1S = static_cast<uint8_t>(eg); WCB1INTR.WCB1INTEN = 1; } else { WCB1INTR.WCB1INTEN = 0; } } //-----------------------------------------------------------------// /*! @brief チャネル3開始 @param[in] et 比較モード @para,[in] fl フィルター */ //-----------------------------------------------------------------// void start3(comp_edge eg = comp_edge::ltgt, comp_filter fl = comp_filter::none, uint8_t ir_lvl = 0) const { WCMPR.WCB3M0 = 1; ILVL2.B45 = ir_lvl; if(ir_lvl) { WCB3INTR.WCB3FL = static_cast<uint8_t>(fl); WCB3INTR.WCB3S = static_cast<uint8_t>(eg); WCB3INTR.WCB3INTEN = 1; } else { WCB3INTR.WCB3INTEN = 0; } } //-----------------------------------------------------------------// /*! @brief チャネル1出力を取得 @return チャネル1出力 */ //-----------------------------------------------------------------// bool get_value1() const { return WCMPR.WCB1OUT(); } //-----------------------------------------------------------------// /*! @brief チャネル3出力を取得 @return チャネル3出力 */ //-----------------------------------------------------------------// bool get_value3() const { return WCMPR.WCB3OUT(); } }; }
hirakuni45/R8C
common/comp_io.hpp
C++
bsd-3-clause
3,845
./scidb2postgres -i data/fromSciDBIntDoubleString.bin -o data/toPostgresIntDoubleString.bin -f'int32_t,int32_t null,double,double null,string,string null'
bigdawg-istc/bigdawg
src/main/cmigrator/commands_scidb2postgres.sh
Shell
bsd-3-clause
155
To update Mongo to Version 4.0 you must first upgrade to 3.6 then to version 4.0 as follows 1. Install 3.6 Binary 2. Close mongo and mongod 3. Start mongo and mongod in 3.6 bin folder 4. run command db.adminCommand({setFeatureCompatibilityVersion: "3.6"}) 1. Install 4.0 Binary 2. Close mongo and mongod 3. Start mongo and mongod in 3.6 bin folder 4. run command db.adminCommand({setFeatureCompatibilityVersion: "4.0"})
dandahle/Catalyst-AppVetting
MongoUpdate.md
Markdown
bsd-3-clause
422
/* Copyright (c) 2003-2014, Arvid Norberg All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include <vector> #include <list> #include <cctype> #include <algorithm> #include "libtorrent/config.hpp" #include "libtorrent/gzip.hpp" #include "libtorrent/socket_io.hpp" #ifdef _MSC_VER #pragma warning(push, 1) #endif #include <boost/bind.hpp> #ifdef _MSC_VER #pragma warning(pop) #endif #include "libtorrent/tracker_manager.hpp" #include "libtorrent/http_tracker_connection.hpp" #include "libtorrent/http_connection.hpp" #include "libtorrent/entry.hpp" #include "libtorrent/bencode.hpp" #include "libtorrent/torrent.hpp" #include "libtorrent/io.hpp" #include "libtorrent/socket.hpp" #include "libtorrent/aux_/session_impl.hpp" #include "libtorrent/broadcast_socket.hpp" // for is_local using namespace libtorrent; namespace libtorrent { #if TORRENT_USE_I2P // defined in torrent_info.cpp bool is_i2p_url(std::string const& url); #endif http_tracker_connection::http_tracker_connection( io_service& ios , connection_queue& cc , tracker_manager& man , tracker_request const& req , boost::weak_ptr<request_callback> c , aux::session_impl& ses , std::string const& auth #if TORRENT_USE_I2P , i2p_connection* i2p_conn #endif ) : tracker_connection(man, req, ios, c) , m_man(man) , m_ses(ses) , m_cc(cc) , m_ios(ios) #if TORRENT_USE_I2P , m_i2p_conn(i2p_conn) #endif {} void http_tracker_connection::start() { // TODO: 0 support authentication (i.e. user name and password) in the URL std::string url = tracker_req().url; if (tracker_req().kind == tracker_request::scrape_request) { // find and replace "announce" with "scrape" // in request std::size_t pos = url.find("announce"); if (pos == std::string::npos) { tracker_connection::fail(error_code(errors::scrape_not_available)); return; } url.replace(pos, 8, "scrape"); } #if TORRENT_USE_I2P bool i2p = is_i2p_url(url); #else static const bool i2p = false; #endif aux::session_settings const& settings = m_ses.settings(); // if request-string already contains // some parameters, append an ampersand instead // of a question mark size_t arguments_start = url.find('?'); if (arguments_start != std::string::npos) url += "&"; else url += "?"; if (tracker_req().kind == tracker_request::announce_request) { const char* event_string[] = {"completed", "started", "stopped", "paused"}; char str[1024]; const bool stats = tracker_req().send_stats; snprintf(str, sizeof(str) , "info_hash=%s" "&peer_id=%s" "&port=%d" "&uploaded=%" PRId64 "&downloaded=%" PRId64 "&left=%" PRId64 "&corrupt=%" PRId64 "&key=%08X" "%s%s" // event "&numwant=%d" "&compact=1" "&no_peer_id=1" , escape_string((const char*)&tracker_req().info_hash[0], 20).c_str() , escape_string((const char*)&tracker_req().pid[0], 20).c_str() // the i2p tracker seems to verify that the port is not 0, // even though it ignores it otherwise , i2p ? 1 : tracker_req().listen_port , stats ? tracker_req().uploaded : 0 , stats ? tracker_req().downloaded : 0 , stats ? tracker_req().left : 0 , stats ? tracker_req().corrupt : 0 , tracker_req().key , (tracker_req().event != tracker_request::none) ? "&event=" : "" , (tracker_req().event != tracker_request::none) ? event_string[tracker_req().event - 1] : "" , tracker_req().num_want); url += str; #ifndef TORRENT_DISABLE_ENCRYPTION if (m_ses.settings().get_int(settings_pack::in_enc_policy) != settings_pack::pe_disabled && m_ses.settings().get_bool(settings_pack::announce_crypto_support)) url += "&supportcrypto=1"; #endif if (stats && m_ses.settings().get_bool(settings_pack::report_redundant_bytes)) { url += "&redundant="; url += to_string(tracker_req().redundant).elems; } if (!tracker_req().trackerid.empty()) { std::string id = tracker_req().trackerid; url += "&trackerid="; url += escape_string(id.c_str(), id.length()); } #if TORRENT_USE_I2P if (i2p) { url += "&ip="; url += escape_string(m_i2p_conn->local_endpoint().c_str() , m_i2p_conn->local_endpoint().size()); url += ".i2p"; } else #endif if (!m_ses.settings().get_bool(settings_pack::anonymous_mode)) { std::string announce_ip = settings.get_str(settings_pack::announce_ip); if (!announce_ip.empty()) { url += "&ip=" + escape_string(announce_ip.c_str(), announce_ip.size()); } else if (m_ses.settings().get_bool(settings_pack::announce_double_nat) && is_local(m_ses.listen_address())) { // only use the global external listen address here // if it turned out to be on a local network // since otherwise the tracker should use our // source IP to determine our origin url += "&ip=" + print_address(m_ses.listen_address()); } } } m_tracker_connection.reset(new http_connection(m_ios, m_cc, m_ses.m_host_resolver , boost::bind(&http_tracker_connection::on_response, self(), _1, _2, _3, _4) , true, settings.get_int(settings_pack::max_http_recv_buffer_size) , boost::bind(&http_tracker_connection::on_connect, self(), _1) , boost::bind(&http_tracker_connection::on_filter, self(), _1, _2) #ifdef TORRENT_USE_OPENSSL , tracker_req().ssl_ctx #endif )); int timeout = tracker_req().event==tracker_request::stopped ?settings.get_int(settings_pack::stop_tracker_timeout) :settings.get_int(settings_pack::tracker_completion_timeout); // when sending stopped requests, prefer the cached DNS entry // to avoid being blocked for slow or failing responses. Chances // are that we're shutting down, and this should be a best-effort // attempt. It's not worth stalling shutdown. proxy_settings ps = m_ses.proxy(); m_tracker_connection->get(url, seconds(timeout) , tracker_req().event == tracker_request::stopped ? 2 : 1 , &ps, 5, settings.get_bool(settings_pack::anonymous_mode) ? "" : settings.get_str(settings_pack::user_agent) , bind_interface() , tracker_req().event == tracker_request::stopped ? resolver_interface::prefer_cache : 0 #if TORRENT_USE_I2P , m_i2p_conn #endif ); // the url + 100 estimated header size sent_bytes(url.size() + 100); #if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) boost::shared_ptr<request_callback> cb = requester(); if (cb) { cb->debug_log("==> TRACKER_REQUEST [ url: %s ]", url.c_str()); } #endif } void http_tracker_connection::close() { if (m_tracker_connection) { m_tracker_connection->close(); m_tracker_connection.reset(); } tracker_connection::close(); } void http_tracker_connection::on_filter(http_connection& c, std::vector<tcp::endpoint>& endpoints) { if (tracker_req().apply_ip_filter == false) return; // remove endpoints that are filtered by the IP filter for (std::vector<tcp::endpoint>::iterator i = endpoints.begin(); i != endpoints.end();) { if (m_ses.m_ip_filter.access(i->address()) == ip_filter::blocked) i = endpoints.erase(i); else ++i; } #if defined(TORRENT_VERBOSE_LOGGING) || defined(TORRENT_LOGGING) boost::shared_ptr<request_callback> cb = requester(); if (cb) { cb->debug_log("*** TRACKER_FILTER"); } #endif if (endpoints.empty()) fail(error_code(errors::banned_by_ip_filter)); } void http_tracker_connection::on_connect(http_connection& c) { error_code ec; tcp::endpoint ep = c.socket().remote_endpoint(ec); m_tracker_ip = ep.address(); boost::shared_ptr<request_callback> cb = requester(); } void http_tracker_connection::on_response(error_code const& ec , http_parser const& parser, char const* data, int size) { // keep this alive boost::intrusive_ptr<http_tracker_connection> me(this); if (ec && ec != asio::error::eof) { fail(ec); return; } if (!parser.header_finished()) { fail(asio::error::eof); return; } if (parser.status_code() != 200) { fail(error_code(parser.status_code(), get_http_category()) , parser.status_code(), parser.message().c_str()); return; } if (ec && ec != asio::error::eof) { fail(ec, parser.status_code()); return; } received_bytes(size + parser.body_start()); // handle tracker response error_code ecode; boost::shared_ptr<request_callback> cb = requester(); if (!cb) { close(); return; } tracker_response resp = parse_tracker_response(data, size, ecode , tracker_req().kind == tracker_request::scrape_request , tracker_req().info_hash); if (!resp.warning_message.empty()) cb->tracker_warning(tracker_req(), resp.warning_message); if (ecode) { fail(ecode, parser.status_code()); close(); return; } if (!resp.failure_reason.empty()) { fail(error_code(errors::tracker_failure), parser.status_code() , resp.failure_reason.c_str(), resp.interval, resp.min_interval); close(); return; } // do slightly different things for scrape requests if (tracker_req().kind == tracker_request::scrape_request) { cb->tracker_scrape_response(tracker_req(), resp.complete , resp.incomplete, resp.downloaded, resp.downloaders); } else { std::list<address> ip_list; if (m_tracker_connection) { error_code ec; ip_list.push_back( m_tracker_connection->socket().remote_endpoint(ec).address()); std::vector<tcp::endpoint> const& epts = m_tracker_connection->endpoints(); for (std::vector<tcp::endpoint>::const_iterator i = epts.begin() , end(epts.end()); i != end; ++i) { ip_list.push_back(i->address()); } } cb->tracker_response(tracker_req(), m_tracker_ip, ip_list, resp); } close(); } bool extract_peer_info(lazy_entry const& info, peer_entry& ret, error_code& ec) { // extract peer id (if any) if (info.type() != lazy_entry::dict_t) { ec.assign(errors::invalid_peer_dict, get_libtorrent_category()); return false; } lazy_entry const* i = info.dict_find_string("peer id"); if (i != 0 && i->string_length() == 20) { std::copy(i->string_ptr(), i->string_ptr()+20, ret.pid.begin()); } else { // if there's no peer_id, just initialize it to a bunch of zeroes std::fill_n(ret.pid.begin(), 20, 0); } // extract ip i = info.dict_find_string("ip"); if (i == 0) { ec.assign(errors::invalid_tracker_response, get_libtorrent_category()); return false; } ret.hostname = i->string_value(); // extract port i = info.dict_find_int("port"); if (i == 0) { ec.assign(errors::invalid_tracker_response, get_libtorrent_category()); return false; } ret.port = (unsigned short)i->int_value(); return true; } tracker_response parse_tracker_response(char const* data, int size, error_code& ec , bool scrape_request, sha1_hash scrape_ih) { tracker_response resp; lazy_entry e; int res = lazy_bdecode(data, data + size, e, ec); if (ec) return resp; if (res != 0 || e.type() != lazy_entry::dict_t) { ec.assign(errors::invalid_tracker_response, get_libtorrent_category()); return resp; } int interval = int(e.dict_find_int_value("interval", 0)); // if no interval is specified, default to 30 minutes if (interval == 0) interval = 1800; int min_interval = int(e.dict_find_int_value("min interval", 30)); resp.interval = interval; resp.min_interval = min_interval; lazy_entry const* tracker_id = e.dict_find_string("tracker id"); if (tracker_id) resp.trackerid = tracker_id->string_value(); // parse the response lazy_entry const* failure = e.dict_find_string("failure reason"); if (failure) { resp.failure_reason = failure->string_value(); ec.assign(errors::tracker_failure, get_libtorrent_category()); return resp; } lazy_entry const* warning = e.dict_find_string("warning message"); if (warning) resp.warning_message = warning->string_value(); if (scrape_request) { lazy_entry const* files = e.dict_find_dict("files"); if (files == 0) { ec.assign(errors::invalid_files_entry, get_libtorrent_category()); return resp; } lazy_entry const* scrape_data = files->dict_find_dict( scrape_ih.to_string()); if (scrape_data == 0) { ec.assign(errors::invalid_hash_entry, get_libtorrent_category()); return resp; } resp.complete = int(scrape_data->dict_find_int_value("complete", -1)); resp.incomplete = int(scrape_data->dict_find_int_value("incomplete", -1)); resp.downloaded = int(scrape_data->dict_find_int_value("downloaded", -1)); resp.downloaders = int(scrape_data->dict_find_int_value("downloaders", -1)); return resp; } // look for optional scrape info resp.complete = int(e.dict_find_int_value("complete", -1)); resp.incomplete = int(e.dict_find_int_value("incomplete", -1)); resp.downloaded = int(e.dict_find_int_value("downloaded", -1)); lazy_entry const* peers_ent = e.dict_find("peers"); if (peers_ent && peers_ent->type() == lazy_entry::string_t) { char const* peers = peers_ent->string_ptr(); int len = peers_ent->string_length(); resp.peers4.reserve(len / 6); for (int i = 0; i < len; i += 6) { if (len - i < 6) break; ipv4_peer_entry p; error_code ec; p.ip = detail::read_v4_address(peers).to_v4().to_bytes(); p.port = detail::read_uint16(peers); resp.peers4.push_back(p); } } else if (peers_ent && peers_ent->type() == lazy_entry::list_t) { int len = peers_ent->list_size(); resp.peers.reserve(len); error_code parse_error; for (int i = 0; i < len; ++i) { peer_entry p; if (!extract_peer_info(*peers_ent->list_at(i), p, parse_error)) continue; resp.peers.push_back(p); } // only report an error if all peer entries are invalid if (resp.peers.empty() && parse_error) { ec = parse_error; return resp; } } else { peers_ent = 0; } #if TORRENT_USE_IPV6 lazy_entry const* ipv6_peers = e.dict_find_string("peers6"); if (ipv6_peers) { char const* peers = ipv6_peers->string_ptr(); int len = ipv6_peers->string_length(); resp.peers6.reserve(len / 18); for (int i = 0; i < len; i += 18) { if (len - i < 18) break; ipv6_peer_entry p; p.ip = detail::read_v6_address(peers).to_v6().to_bytes(); p.port = detail::read_uint16(peers); resp.peers6.push_back(p); } } else { ipv6_peers = 0; } #else lazy_entry const* ipv6_peers = 0; #endif /* // if we didn't receive any peers. We don't care if we're stopping anyway if (peers_ent == 0 && ipv6_peers == 0 && tracker_req().event != tracker_request::stopped) { ec.assign(errors::invalid_peers_entry, get_libtorrent_category()); return resp; } */ lazy_entry const* ip_ent = e.dict_find_string("external ip"); if (ip_ent) { char const* p = ip_ent->string_ptr(); if (ip_ent->string_length() == int(address_v4::bytes_type().size())) resp.external_ip = detail::read_v4_address(p); #if TORRENT_USE_IPV6 else if (ip_ent->string_length() == int(address_v6::bytes_type().size())) resp.external_ip = detail::read_v6_address(p); #endif } return resp; } }
mrmichalis/libtorrent-code
src/http_tracker_connection.cpp
C++
bsd-3-clause
16,622
<?php /** * Gem - File Uploading for Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE. * * @category Gem * @package Gem_Manipulator * @copyright Copyright (c) 2008 Johan Nilsson. (http://www.markupartist.com) * @license New BSD License */ require_once 'Gem/Manipulator/Adapter/Interface.php'; require_once 'Gem/Manipulator/Adapter/Exception.php'; /** * @category Gem * @package Gem_Manipulator */ class Gem_Manipulator_Adapter_Thumbnail implements Gem_Manipulator_Adapter_Interface { /** * Perfoms manipulation * * @param string $from * @param string $to * @param string $options * @return void */ public function manipulate($from, $to, $options) { if (false === class_exists('Thumbnail')) { throw new Gem_Manipulator_Adapter_Exception('Class Thumbnail could not be loaded'); } if (!isset($options['geometry'])) { throw new Gem_Manipulator_Adapter_Exception('Thumbnail requires the \'geometry\' option to be set'); } $matches = array(); preg_match('/(c)?([0-9]+)x([0-9]+)/', $options['geometry'], $matches); $crop = empty($matches[1]) ? false : true; $width = $matches[2]; $height = $matches[3]; if (empty($matches[2])) { throw new Gem_Manipulator_Adapter_Exception('Invalid geometry pattern \'' . $options['geometry'] . '\''); } if (empty($matches[3])) { throw new Gem_Manipulator_Adapter_Exception('Invalid geometry pattern \'' . $options['geometry'] . '\''); } $thumbnail = new Thumbnail($from); // TODO: Fix error handling around this... $quality = 80; if (false == $crop) { $thumbnail->resize($width, $height); $quality = 100; } else if ($width == $height) { // Well works for now... the crop for ImageTransform is a bit better // but who cares? $thumbnail->cropFromCenter($width); } else { $thumbnail->crop(0, 0, $width, $height); } $thumbnail->save($to, $quality); } }
johannilsson/zfgem
library/Gem/Manipulator/Adapter/Thumbnail.php
PHP
bsd-3-clause
2,242
<?php use yii\helpers\Url; ?> <div class="bjui-pageContent"> <form action="<?= Url::toRoute([$model?'update':'create','name'=>$model?$model->name:'']) ?>" id="user_form" data-toggle="validate" data-alertmsg="false"> <input name="_csrf" type="hidden" id="_csrf" value="<?= Yii::$app->request->csrfToken ?>"> <table class="table table-condensed table-hover" width="100%"> <tbody> <tr> <td><label for="name" class="control-label x120">规则名称:</label> <input type="text" name="name" id="name" value="<?= $model?$model->name:''; ?>" data-rule="required" size="20"></td> </tr> <tr> <td><label for="class" class="control-label x120">规则类名:</label> <input type="text" name="class" id="class" value="<?= $model?$model::className():''; ?>" data-rule="required" size="35"></td> </tr> </tbody> </table> </form> </div> <div class="bjui-pageFooter"> <ul> <li> <button type="button" class="btn-close" data-icon="close">取消</button> </li> <li> <button type="submit" class="btn-default" data-icon="save">保存</button> </li> </ul> </div>
171906502/wetM2.0
backend/modules/core/views/rule/view.php
PHP
bsd-3-clause
1,266
// // BenthosLibraryTableCell.h // SeafloorExplore // // Modified from Brad Larson's Molecules Project in 2011-2012 for use in The SeafloorExplore Project // // Copyright (C) 2012 Matthew Johnson-Roberson // // See COPYING for license details // // Molecules // // The source code for Molecules is available under a BSD license. See COPYING for details. // // Created by Brad Larson on 4/30/2011. // #import <UIKit/UIKit.h> #import <QuartzCore/QuartzCore.h> @interface BenthosLibraryTableCell : UITableViewCell { CAGradientLayer *highlightGradientLayer; BOOL isSelected; } @property(assign, nonatomic) CAGradientLayer *highlightGradientLayer; @property(assign, nonatomic) BOOL isSelected; @end
mattjr/seafloorexplore
BenthosLibraryTableCell.h
C
bsd-3-clause
718
--- --- # Migration Guide 2.x to 3.0 ## General ### Removed ui object The `ui` object (`tabris.ui`) and `Ui` class no longer exist. All properties formerly hosted by `ui` are now directly attached to the `tabris` object/namespace. Example: Tabris 2.x ```js import {ui} from 'tabris'; ui.contentView.background = 'red'; ui.drawer.background = 'red'; ui.statusBar.background = 'red'; ui.navigationBar.background = 'red'; ``` Tabris 3.0 ```js import {contentView, drawer, statusBar, navigationBar} from 'tabris'; contentView.background = 'red'; drawer.background = 'red'; statusBar.background = 'red'; navigationBar.background = 'red'; ``` ### Removed `get("prop")` and `set("prop", value)` This concerns all instances of `NativeObject` (including widgets) and `WidgetCollection`. The `set` method still exists, but now only takes one argument (the properties object). The `get` method has been removed entirely. #### Alternatives for `set("prop", value)`: On both `NativeObject` and `WidgetCollection`, `obj.set('foo', baz)` can be replaced with `obj.set({foo: baz})`, and `obj.set(bar, baz)` can be replaced with `obj.set({[foo]: baz})`. On `NativeObject` only, `obj.set('foo', baz)` can be replaced with `obj.foo = baz`, and `obj.set(bar, baz)` can be replaced with `obj[bar] = baz`. #### Alternatives for `get("prop")`: On `NativeObject`, `bar = obj.get('foo')` can be replaced with `bar = obj.foo`, and `baz = obj.get(bar)` can be replaced with `baz = obj[bar]`. On `WidgetCollection`, `bar = wc.get('foo');` can be replaced with `bar = wc.first().foo`, and `baz = wc.get(bar)` can be replaced with `baz = wc.first()[bar]`. ### app.installPatch removed You can no longer patch your application using this method. ### AlertDialog textInputs property is now a ContentView Instead of assigning `TextInputs` widgets to that property they need to be appended: Old: ```js alertDialog.textInputs = [new TextInput()]; ``` New: ```js alertDialog.textInputs.append(new TextInput()); ``` Alternatively JSX my be used: ```jsx <AlertDialog> <TextInput/> </AlertDialog> ``` ### Removed properties "placementPriority" of Action and "navigationAction" of NavigationView These properties are replaced by a new property `placement` on the `Action` widget. It accepts the values `'default'` (same as `placementPriority = 'normal'`), `'overflow'` (same as a `placementPriority = 'low'`) and `'navigation'`, which puts the action in the place usually reserved by the drawer icon. ### Removed property `topToolbarHeight` and `bottomToolbarHeight` on `NavigationView` On iOS a toolbar at the bottom of a `NavigationView` has been used for actions with low priority. With the introduction of the new `Action` `placement` property the bottom toolbar has been removed along with the respective properties `topToolbarHeight` and `bottomToolbarHeight`. In their place a new property `toolbarHeight` has been added. ### Removed widgetCollection.find This method has been removed due to its ambiguous nature. This does not affect `composite.find` which still exists. ### "trigger" object/eventObject parameter is now cloned **This is relevant only if in your application you are passing values to `trigger` of types other than `Object` or `EventObject`.** Examples would be passing primitives (e.g. `trigger('select', selectionIndex);`) or instances of classes other than `Object` (e.g. `trigger('select', someArray);`). If you do that you need to change this to pass an object that references the value instead (e.g. `trigger('select', {selectionIndex});`) Previously the second parameter of the `trigger` method was directly passed on to all listeners in all cases. However, we want to ensure that listeners can always expect to be called with a valid `EventObject` instance. For that reason the values of the `trigger` parameter are now copied to a new event object, *unless* the given parameter is already an instance of `EventObject` and has not been initialized yet. ### Color properties All color properties are now of the type `ColorValue`. While these properties still accept the same string values as in 2.x, they will return a "Color" class instance instead of a string. The exception is CanvasContext, where color properties still return a string for W3C compatibility. ### Widget.background property Widget background setter now also accepts `ColorValue`, `ImageValue`, and `LinearGradientValue` values and the getter will return instances of the "Color", "Image" and "LinearGradient" classes. ### Widget.backgroundImage property removed You can now set images directly on the `background` property. ### alignment properties All widget `alignment` properties (on `Button`, `TextInput`, `TextView` and `ToggleButton`) now expect `centerX` instead of `center`. ### TabFolder.textColor property replaced with more flexible properties The `TabFolder.textColor` property has been replaced with a set of new properties which provide more control over the appearance of the TabFolder tabs: - `tabTintColor` - `selectedTabTintColor` - `tabBarBackground` - `selectedTabIndicatorTintColor` In addition the `TabFolder` gained the property `tabBarElevation` which is applicable on Android. ### Tab.badge property changed to be of type number instead of string With the added support for `badge` on Android, the type of the `badge` property has been updated to be a number: ```js tab.badge = 10 ``` ### CollectionView select event removed The collectionView no longer provides a select event. Interactions with a cell have to be handled directly by listeners attached to the cell. A new method `itemIndex` may be used to determine the index associated with a cell: ```js collectionView.createCell = () => { const cell = new SomeWidget(); cell.onTap(() => { const index = cell.parent(CollectionView).itemIndex(cell); // do something with the item... }); return cell; } ``` ### Picker allows empty state with "message" property as placeholder The `Picker` now allows to show an (initial) empty state. This unselected state can be filled with a `message` text similar to a `TextInput`. The initial `selectionIndex` is therefore `-1`. It can also be set to `-1` which shows the empty state or the `message` respectively. To recreate the previous behavior the `selectionIndex` could be set to `0`. ### Picker property "fillColor" removed With the introduction of the new `style` property on `Picker`, the iOS only property `fillColor` became redundant. Previously the `fillColor` was required to separate the Android underline colorization from the ios picker background color. Setting the `Picker` `style` to _underline_ on Android now ignores the background and only applies the `borderColor` property. ### Font properties All font properties are now of the type "FontValue". While these properties still accept the same string values as in 2.x, they will return a "Font" class instance instead of a string. The exception is CanvasContext, where font properties still return a string for W3C compatibility. ### Image properties All image properties are now of the type "ImageValue". While these properties still accept the same string values as in 2.x, they will return an "Image" class instance instead of a string. ### Gesture event "longpress" renamed to "longPress" To be consistent with the event naming scheme of gesture events, the event "longpress" has been renamed to "longPress". ### TextInput property "fillColor" removed With the introduction of the new `style` property on `TextInput`, the iOS only property `fillColor` became redundant. Previously the `fillColor` was required to separate the Android underline colorization from the ios input background color. Setting the `TextInput` `style` to _underline_ on Android now ignores the background and only applies the `borderColor` property. ## TypeScript ### Properties interfaces removed The `tabris` module no longer exports a separate properties interfaces for every built-in type. These can be replaced with the generic `Properties` type: `CompositeProperties` `=>` `Properties<Composite>` ### "tsProperties" property no longer supported It is no longer necessary or supported to create a property `tsProperties` on classes inheriting from `Widget` to control the properties accepted by the `set` method. In most cases public properties are recognized by `set` automatically. That excludes methods/functions. When called on `this` the supported properties can not be inferred. To fix this the `set` method can be overwritten/re-declared, or it may be called with the appropriate generic type like this: `this.set<MyComponent>({propA: valueA});` ### type "Partial" The helper type `Partial<T, U>` was removed to avoid confusion with the `Partial` type built in to newer TypeScript versions. It can be replaced with `Partial<Pick<T, U>>`. ### CollectionView is generic The `CollectionView` is now a generic type `CollectionView<Cell extends Widget>`, where `Cell` is the type of widget returned by the `createCell` callback. All occurrences of `CollectionView` as a type should be replaced with the appropriate generic version, e.g. `CollectionView<Composite>`. ### types "dimension" and "offset" Types "dimension" and "offset" have been renamed to start with an upper case. Type "margin" has been replaced with "ConstraintValue", which includes the former "margin" type. ### LayoutData and related properties The `layoutData` property is now of the type `LayoutDataValue`. The values that were accepted in 2.x are still accepted, with one exception: It was previously possible to give a percentage as a number type within a `margin` (now `ConstraintValue`) type array, i.e. `[number, number]`. However, this was an undocumented feature, as the documentation stated: > "All **percentages** are provided as strings with a percent suffix, e.g. `"50%"`." All percentages are now of the `PercentValue` type, i.e. a string like `"50%"`, an instance of the `Percent` class, or a `Percent`-like object, e.g. `{percent: 50}`. The return value of the `layoutData` property is now always an instance of the `LayoutData` class instead of a plain object. The shorthand properties to `layoutData` now also return the normalized types used in the `LayoutData` class, i.e. an instance of `Constraint` (for `left`, `right`, `top` and `bottom`) or `SiblingReference` (for `baseline`), a number (for `width`, `height`, `centerX` and `centerY`), or `"auto"` (the default for all of these). In 2.x, negative edge offsets were previously supported on some platforms. To prevent inconsistent layouts among platforms, they are not supported anymore. ### Event handling The methods `on` and `once` no longer have widget-specific parameters, meaning they are not type-safe anymore. Strictly speaking this is not a breaking change, but it is strongly recommended to switch to the new (type safe) `Listeners` API as soon as possible. Some examples: `widget.on('resize', listener)` and `widget.on({resize: listener})` become `widget.onResize(listener)`. `widget.off('resize', listener)` becomes `widget.onResize.removeListener(listener)`. `widget.once('resize', listener)` becomes `widget.onResize.once(listener)`. ## JSX ### Elements need to be imported Tabris no longer provides "intrinsic" elements. This means that instead of creating a built-in widget via a lowercase element it has to be done by referencing the actual widget class. Example: This... ```jsx import { ui } from 'tabris'; ui.contentView.append(<textView text='foo'/>); ``` has to be changed to: ```jsx import { contentView, TextView } from 'tabris'; contentView.append(<TextView text='foo' />); ``` Only widgets actually supporting different fonts now have a font property. Most applications should not have to adjust to this change. ### jsxProperties It used to be necessary to declare this property to add JSX attributes to a custom component. This now happens automatically. The mechanism itself is still present, but the property is now named `jsxAttributes` to make it distinct from the properties of the created object. Declaring `jsxAttributes` may sometimes be be necessary because properties that are either functions or are marked as readonly are not available as JSX attributes by default. ## Cordova plugins The Cordova CLI dependency has been updated from `6.5.0` to `8.1.2`. The Cordova CLI will now use the system `npm` to install plugins. This has following implications: * Plugins need to provide a `package.json` in their root directory. * Plugins in package [subdirectories](https://cordova.apache.org/docs/en/6.x/reference/cordova-cli/index.html#plugin-spec) are not supported anymore. ## Android custom theme Creating a custom theme follows the same approach as in 2.x but the paths to the theme.xml file has been changed slightly due to the migration to cordova-android 8.0. Declared theme.xml resource files need to be prefixed with with `app/src/main/`, e.g.: ``` <resource-file src="res/android/values/my_theme.xml" target="res/values/my_theme.xml" /> ``` should be changed to: ``` <resource-file src="res/android/values/my_theme.xml" target="app/src/main/res/values/my_theme.xml" /> ``` For more details on Android custom themes see: https://docs.tabris.com/3.0/theming-android.html
eclipsesource/tabris-js
doc/migration-guide.md
Markdown
bsd-3-clause
13,317
/* Copyright (C) 2011 uberspot * * Compiling: znc-buildmod urlbuffer.cpp * Dependencies: curl, wget, sed and a unix environment. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 3 as published * by the Free Software Foundation (http://www.gnu.org/licenses/gpl.txt). */ #include "main.h" #include "User.h" #include "Nick.h" #include "Modules.h" #include "Chan.h" #include "FileUtils.h" #include <pthread.h> #include <climits> #define MAX_EXTS 6 #define MAX_CHARS 16 class CUrlBufferModule : public CModule { private: VCString lastUrls, nicks; unsigned int linkNum; CString target; static const string supportedExts[MAX_EXTS]; static const char unSupportedChars[MAX_CHARS]; static inline CString getStdoutFromCommand(const CString& cmd); inline void LoadDefaults(); inline CString convertTime(const CString& str) { time_t curtime; tm* timeinfo; char buffer[1024]; time(&curtime); curtime += (time_t) (m_pUser->GetTimezoneOffset() * 60 * 60); timeinfo = localtime(&curtime); if (!strftime(buffer, sizeof(buffer), str.c_str(), timeinfo)) { return ""; } return CString(buffer); } inline bool isValidExtension(CString ext) { ext.MakeLower(); for(int i=0; i< MAX_EXTS; i++) { if( ext == supportedExts[i]) return true; } return false; } inline bool isValidDir(const string& dir) { for(int i=0; i< MAX_CHARS; i++) { if (dir.find(unSupportedChars[i]) !=string::npos) return false; } return true; } static void* sendLinks(void *ptr); inline void CheckLineForLink(const CString& sMessage, const CString& sOrigin); inline void CheckLineForTrigger(const CString& sMessage, const CString& sTarget); public: MODCONSTRUCTOR(CUrlBufferModule) {} bool OnLoad(const CString& sArgs, CString& sErrorMsg); ~CUrlBufferModule(); EModRet OnUserMsg(CString& sTarget, CString& sMessage); EModRet OnPrivMsg(CNick& Nick, CString& sMessage); EModRet OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage); void OnModCommand(const CString& sCommand); }; const string CUrlBufferModule::supportedExts[MAX_EXTS] = {"jpg", "png", "gif", "jpeg", "bmp", "tiff"} ; const char CUrlBufferModule::unSupportedChars[MAX_CHARS] = {'|', ';', '!', '@', '#', '(', ')', '<', '>', '"', '\'', '`', '~', '=', '&', '^'}; bool CUrlBufferModule::OnLoad(const CString& sArgs, CString& sErrorMsg) { LoadDefaults(); return true; } CUrlBufferModule::~CUrlBufferModule() {} CUrlBufferModule::EModRet CUrlBufferModule::OnUserMsg(CString& sTarget, CString& sMessage) { CheckLineForLink(sMessage, ""); CheckLineForTrigger(sMessage, m_pUser->GetIRCNick().GetNick()); return CONTINUE; } CUrlBufferModule::EModRet CUrlBufferModule::OnPrivMsg(CNick& Nick, CString& sMessage) { CheckLineForLink(sMessage, Nick.GetNick()); CheckLineForTrigger(sMessage, Nick.GetNick()); return CONTINUE; } CUrlBufferModule::EModRet CUrlBufferModule::OnChanMsg(CNick& Nick, CChan& Channel, CString& sMessage) { CheckLineForLink(sMessage, Nick.GetNick()); CheckLineForTrigger(sMessage, Nick.GetNick()); return CONTINUE; } void CUrlBufferModule::OnModCommand(const CString& sCommand) { CString command = sCommand.Token(0).AsLower().Trim_n(); if (command == "help") { CTable CmdTable; CmdTable.AddColumn("Command"); CmdTable.AddColumn("Description"); CmdTable.AddRow(); CmdTable.SetCell("Command", "ENABLE"); CmdTable.SetCell("Description", "Activates link buffering."); CmdTable.AddRow(); CmdTable.SetCell("Command", "DISABLE"); CmdTable.SetCell("Description", "Deactivates link buffering."); CmdTable.AddRow(); CmdTable.SetCell("Command", "ENABLELOCAL"); CmdTable.SetCell("Description", "Enables downloading of each link to local directory."); CmdTable.AddRow(); CmdTable.SetCell("Command", "DISABLELOCAL"); CmdTable.SetCell("Description", "Disables downloading of each link to local directory."); CmdTable.AddRow(); CmdTable.SetCell("Command","ENABLEPUBLIC"); CmdTable.SetCell("Description", "Enables the usage of !showlinks publicly, by other users."); CmdTable.AddRow(); CmdTable.SetCell("Command","DISABLEPUBLIC"); CmdTable.SetCell("Description", "Disables the usage of !showlinks publicly, by other users."); CmdTable.AddRow(); CmdTable.SetCell("Command", "DIRECTORY <#directory>"); CmdTable.SetCell("Description", "Sets the local directory where the links will be saved."); CmdTable.AddRow(); CmdTable.SetCell("Command", "CLEARBUFFER"); CmdTable.SetCell("Description", "Empties the link buffer."); CmdTable.AddRow(); CmdTable.SetCell("Command", "BUFFERSIZE <#size>"); CmdTable.SetCell("Description", "Sets the size of the link buffer. Only integers >=0."); CmdTable.AddRow(); CmdTable.SetCell("Command", "SHOWSETTINGS"); CmdTable.SetCell("Description", "Prints all the settings."); CmdTable.AddRow(); CmdTable.SetCell("Command", "BUFFERALLLINKS"); CmdTable.SetCell("Description", "Toggles the buffering of all links or only image links."); CmdTable.AddRow(); CmdTable.SetCell("Command", "SHOWLINKS <#number>"); CmdTable.SetCell("Description", "Prints <#number> or <#buffersize> number of cached links."); CmdTable.AddRow(); CmdTable.SetCell("Command", "HELP"); CmdTable.SetCell("Description", "This help."); PutModule(CmdTable); return; }else if (command == "enable") { SetNV("enable","true",true); PutModule("Enabled buffering"); }else if (command == "disable") { SetNV("enable","false",true); PutModule("Disabled buffering"); }else if (command == "enablelocal") { if(GetNV("directory") == "") { PutModule("Directory is not set. First set a directory and then enable local caching"); return; } SetNV("enablelocal","true",true); PutModule("Enabled local caching"); }else if (command == "disablelocal") { SetNV("enablelocal", "false", true); PutModule("Disabled local caching"); }else if (command == "enablepublic") { SetNV("enablepublic", "true", true); PutModule("Enabled public usage of showlinks."); }else if (command == "disablepublic") { SetNV("enablepublic", "false", true); PutModule("Disabled public usage of showlinks."); }else if (command == "directory") { CString dir=sCommand.Token(1).Replace_n("//", "/").TrimRight_n("/") + "/"; if (!isValidDir(dir)) { PutModule("Error in directory name. Avoid using: | ; ! @ # ( ) < > \" ' ` ~ = & ^ <space> <tab>"); return; } // Check if file exists and is directory if (dir.empty() || !CFile::Exists(dir) || !CFile::IsDir(dir, false)) { PutModule("Invalid path or no write access to ["+ sCommand.Token(1) +"]."); return; } SetNV("directory", dir, true); PutModule("Directory for local caching set to " + GetNV("directory")); }else if (command == "clearbuffer") { lastUrls.clear(); nicks.clear(); }else if (command == "buffersize") { unsigned int bufSize = sCommand.Token(1).ToUInt(); if(bufSize==0 || bufSize==UINT_MAX) { PutModule("Error in buffer size. Use only integers >= 0."); return; } SetNV("buffersize", CString(bufSize), true); PutModule("Buffer size set to " + GetNV("buffersize")); }else if (command == "showsettings") { for(MCString::iterator it = BeginNV(); it != EndNV(); it++) { PutModule(it->first.AsUpper() + " : " + it->second); } }else if(command == "bufferalllinks"){ SetNV("bufferalllinks", CString(!GetNV("bufferalllinks").ToBool()), true); PutModule( CString(GetNV("bufferalllinks").ToBool()?"Enabled":"Disabled") + " buffering of all links."); }else if (command == "showlinks") { if(lastUrls.empty()) PutModule("No links were found..."); else { unsigned int maxLinks = GetNV("buffersize").ToUInt(); unsigned int size = sCommand.Token(1).ToUInt(); if(size!=0 && size<UINT_MAX) //if it was a valid number maxLinks = size; unsigned int maxSize = lastUrls.size()-1; for(unsigned int i=0; i<=maxSize && i< maxLinks; i++) { PutModule(nicks[maxSize-i] + ": " + lastUrls[maxSize-i]); } } }else { PutModule("Unknown command! Try HELP."); } } void CUrlBufferModule::LoadDefaults() { if(GetNV("enable")==""){ SetNV("enable", "true", true); } if(GetNV("enablelocal")==""){ SetNV("enablelocal", "false", true); } if(GetNV("buffersize")== ""){ SetNV("buffersize", "5", true); } if(GetNV("enablepublic")==""){ SetNV("enablepublic", "true", true); } if(GetNV("bufferalllinks")==""){ SetNV("bufferalllinks", "false", true); } } void CUrlBufferModule::CheckLineForLink(const CString& sMessage, const CString& sOrigin) { if(sOrigin != m_pUser->GetIRCNick().GetNick() && GetNV("enable").ToBool() ) { VCString words; CString output; sMessage.Split(" ", words, false, "", "", true, true); for (size_t a = 0; a < words.size(); a++) { CString& word = words[a]; if(word.Left(4) == "http" || word.Left(4) == "www.") { //if you find an image download it, save it in the www directory and keep the new link in buffer VCString tokens; word.Split("/", tokens, false, "", "", true, true); string name = tokens[tokens.size()-1]; word.Split(".", tokens, false, "", "", true, true); //if it's an image link download/upload it else just keep the link if(isValidExtension( tokens[tokens.size()-1] )) { std::stringstream ss; if( GetNV("enablelocal").ToBool()) { CString dir = GetNV("directory") + convertTime("%Y-%m-%d") + "/"; if(!CFile::Exists(dir) && !CFile::IsDir(dir, false)) { CDir::MakeDir(dir, 0755); } ss << "wget -b -O " << dir.c_str() << name <<" -q " << word.c_str() << " 2>&1"; getStdoutFromCommand(ss.str()); } ss.str(""); if (!word.WildCmp("*imgur*")) { ss << "curl -d \"image=" << word.c_str() << "\" -d \"key=5ce86e7f95d8e58b18931bf290f387be\" http://api.imgur.com/2/upload.xml | sed -n 's/.*<original>\\(.*\\)<\\/original>.*/\\1/p' 2>&1"; output = getStdoutFromCommand(ss.str()); lastUrls.push_back(output); }else { lastUrls.push_back(word); } } else if(GetNV("bufferalllinks").ToBool()){ lastUrls.push_back(word); } nicks.push_back( (sOrigin.empty())? m_pUser->GetIRCNick().GetNick() : sOrigin ); } } } } CString CUrlBufferModule::getStdoutFromCommand(const CString& cmd) { string data=""; char buffer[128]; FILE* stream = popen(cmd.c_str(), "r"); if (stream == NULL || !stream || ferror(stream)) { return "Error!"; } while (!feof(stream)) { if (fgets(buffer, 128, stream) != NULL) data.append(buffer); } pclose(stream); return data; } void *CUrlBufferModule::sendLinks(void *ptr) { CUrlBufferModule *caller = static_cast<CUrlBufferModule*> (ptr); VCString links = caller->lastUrls; VCString nicks = caller->nicks; unsigned int maxSize = links.size()-1; for(unsigned int i=0; i<=maxSize && i<caller->linkNum; i++) { sleep(2); caller->PutIRC("PRIVMSG " + caller->target + " :" + nicks[maxSize-i] + ": "+ links[maxSize-i]); } return NULL; } void CUrlBufferModule::CheckLineForTrigger(const CString& sMessage, const CString& sTarget) { if(GetNV("enablepublic").ToBool()) { VCString words; sMessage.Split(" ", words, false, "", "", true, true); for (size_t a = 0; a < words.size(); a++) { CString& word = words[a]; if(word.AsLower() == "!showlinks") { if(lastUrls.empty()) PutIRC("PRIVMSG " + sTarget + " :No links were found..."); else { unsigned int maxLinks = GetNV("buffersize").ToUInt(); if (a+1 < words.size()) { unsigned int size = words[a+1].ToUInt(); if(size!=0 && size<UINT_MAX) //if it was a valid number maxLinks = size; } linkNum = maxLinks; target = sTarget; pthread_t thread; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); pthread_create( &thread, &attr, &sendLinks, this); } } } } } MODULEDEFS(CUrlBufferModule, "Module that caches locally images/links posted on irc channels.")
1stsetup/spksrc
cross/znc/modules/urlbuffer.cpp
C++
bsd-3-clause
12,622
@extends('layout.master') @section('title','Administração') @section('content') @include('layout.topo') <div class="row"> @include('layout.menu') <div class="col-md-9"> <div class="row"> <div class="col-md-12"> <h1>Cadastro de Textos</h1> </div> </div> <form action="{{Route('admin.gravaTexto')}}" method="POST" enctype="multipart/form-data"> <div class="row"> <div class="col-md-2"><span>Título</span></div> <div class="col-md-10"><input type="text" id="titulo" name="titulo"></div> </div> <div class="row"> <div class="col-md-2"><span>Imagem</span></div> <div class="col-md-10"><input type="file" id="imagem" name="imagem"></div> </div> <div class="row"> <div class="col-md-2"><span>Texto</span></div> <div class="col-md-10"> <?php $oFCKeditor = new FCKeditor('texto'); $oFCKeditor->BasePath = "/fckeditor/"; $oFCKeditor->Height = '300'; echo $oFCKeditor->CreateHtml(); ?> </div> </div> <div class="row"> <div class="col-md-12"><button type="submit" class="btn btn-default">Enviar</button><a href="{{Route('admin.textos')}}" class="btn btn-danger">Cancelar</a></div> </div> </form> </div> </div> @include('layout.rodape') @stop
villagres/website
public/administracao/app/views/admin3/texto/cadastra.blade.php
PHP
bsd-3-clause
1,284
from datetime import datetime from pymongo.connection import Connection from django.db import models from eventtracker.conf import settings def get_mongo_collection(): "Open a connection to MongoDB and return the collection to use." if settings.RIGHT_MONGODB_HOST: connection = Connection.paired( left=(settings.MONGODB_HOST, settings.MONGODB_PORT), right=(settings.RIGHT_MONGODB_HOST, settings.RIGHT_MONGODB_PORT) ) else: connection = Connection(host=settings.MONGODB_HOST, port=settings.MONGODB_PORT) return connection[settings.MONGODB_DB][settings.MONGODB_COLLECTION] def save_event(collection, event, timestamp, params): "Save the event in MongoDB collection" collection.insert({ 'event': event, 'timestamp': datetime.fromtimestamp(timestamp), 'params': params }) class Event(models.Model): "Dummy model for development." timestamp = models.DateTimeField(auto_now_add=True) event = models.SlugField() params = models.TextField()
ella/django-event-tracker
eventtracker/models.py
Python
bsd-3-clause
1,073
// Copyright (c) 2012 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. #include "ash/display/display_controller.h" #include <algorithm> #include "ash/ash_switches.h" #include "ash/display/display_manager.h" #include "ash/root_window_controller.h" #include "ash/screen_ash.h" #include "ash/shell.h" #include "ash/wm/coordinate_conversion.h" #include "ash/wm/property_util.h" #include "ash/wm/window_util.h" #include "base/command_line.h" #include "base/json/json_value_converter.h" #include "base/string_piece.h" #include "base/stringprintf.h" #include "base/values.h" #include "ui/aura/client/screen_position_client.h" #include "ui/aura/env.h" #include "ui/aura/root_window.h" #include "ui/aura/window.h" #include "ui/compositor/dip_util.h" #include "ui/gfx/display.h" #include "ui/gfx/screen.h" #if defined(OS_CHROMEOS) #include "ash/display/output_configurator_animation.h" #include "base/chromeos/chromeos_version.h" #include "base/string_number_conversions.h" #include "base/time.h" #include "chromeos/display/output_configurator.h" #include "ui/base/x/x11_util.h" #endif // defined(OS_CHROMEOS) namespace ash { namespace { // Primary display stored in global object as it can be // accessed after Shell is deleted. A separate display instance is created // during the shutdown instead of always keeping two display instances // (one here and another one in display_manager) in sync, which is error prone. int64 primary_display_id = gfx::Display::kInvalidDisplayID; gfx::Display* primary_display_for_shutdown = NULL; // Keeps the number of displays during the shutdown after // ash::Shell:: is deleted. int num_displays_for_shutdown = -1; // The maximum value for 'offset' in DisplayLayout in case of outliers. Need // to change this value in case to support even larger displays. const int kMaxValidOffset = 10000; // The number of pixels to overlap between the primary and secondary displays, // in case that the offset value is too large. const int kMinimumOverlapForInvalidOffset = 100; // Specifies how long the display change should have been disabled // after each display change operations. // |kCycleDisplayThrottleTimeoutMs| is set to be longer to avoid // changing the settings while the system is still configurating // displays. It will be overriden by |kAfterDisplayChangeThrottleTimeoutMs| // when the display change happens, so the actual timeout is much shorter. const int64 kAfterDisplayChangeThrottleTimeoutMs = 500; const int64 kCycleDisplayThrottleTimeoutMs = 4000; const int64 kSwapDisplayThrottleTimeoutMs = 500; bool GetPositionFromString(const base::StringPiece& position, DisplayLayout::Position* field) { if (position == "top") { *field = DisplayLayout::TOP; return true; } else if (position == "bottom") { *field = DisplayLayout::BOTTOM; return true; } else if (position == "right") { *field = DisplayLayout::RIGHT; return true; } else if (position == "left") { *field = DisplayLayout::LEFT; return true; } LOG(ERROR) << "Invalid position value: " << position; return false; } std::string GetStringFromPosition(DisplayLayout::Position position) { switch (position) { case DisplayLayout::TOP: return std::string("top"); case DisplayLayout::BOTTOM: return std::string("bottom"); case DisplayLayout::RIGHT: return std::string("right"); case DisplayLayout::LEFT: return std::string("left"); } return std::string("unknown"); } internal::DisplayManager* GetDisplayManager() { return Shell::GetInstance()->display_manager(); } void SetDisplayPropertiesOnHostWindow(aura::RootWindow* root, const gfx::Display& display) { #if defined(OS_CHROMEOS) // Native window property (Atom in X11) that specifies the display's // rotation and scale factor. They are read and used by // touchpad/mouse driver directly on X (contact adlr@ for more // details on touchpad/mouse driver side). The value of the rotation // is one of 0 (normal), 1 (90 degrees clockwise), 2 (180 degree) or // 3 (270 degrees clockwise). The value of the scale factor is in // percent (100, 140, 200 etc). const char kRotationProp[] = "_CHROME_DISPLAY_ROTATION"; const char kScaleFactorProp[] = "_CHROME_DISPLAY_SCALE_FACTOR"; const char kCARDINAL[] = "CARDINAL"; CommandLine* command_line = CommandLine::ForCurrentProcess(); int rotation = 0; if (command_line->HasSwitch(switches::kAshOverrideDisplayOrientation)) { std::string value = command_line-> GetSwitchValueASCII(switches::kAshOverrideDisplayOrientation); DCHECK(base::StringToInt(value, &rotation)); DCHECK(0 <= rotation && rotation <= 3) << "Invalid rotation value=" << rotation; if (rotation < 0 || rotation > 3) rotation = 0; } gfx::AcceleratedWidget xwindow = root->GetAcceleratedWidget(); ui::SetIntProperty(xwindow, kRotationProp, kCARDINAL, rotation); ui::SetIntProperty(xwindow, kScaleFactorProp, kCARDINAL, 100 * display.device_scale_factor()); #endif } } // namespace //////////////////////////////////////////////////////////////////////////////// // DisplayLayout DisplayLayout::DisplayLayout() : position(RIGHT), offset(0) {} DisplayLayout::DisplayLayout(DisplayLayout::Position position, int offset) : position(position), offset(offset) { DCHECK_LE(TOP, position); DCHECK_GE(LEFT, position); // Set the default value to |position| in case position is invalid. DCHECKs // above doesn't stop in Release builds. if (TOP > position || LEFT < position) this->position = RIGHT; DCHECK_GE(kMaxValidOffset, abs(offset)); } DisplayLayout DisplayLayout::Invert() const { Position inverted_position = RIGHT; switch (position) { case TOP: inverted_position = BOTTOM; break; case BOTTOM: inverted_position = TOP; break; case RIGHT: inverted_position = LEFT; break; case LEFT: inverted_position = RIGHT; break; } return DisplayLayout(inverted_position, -offset); } // static bool DisplayLayout::ConvertFromValue(const base::Value& value, DisplayLayout* layout) { base::JSONValueConverter<DisplayLayout> converter; return converter.Convert(value, layout); } // static bool DisplayLayout::ConvertToValue(const DisplayLayout& layout, base::Value* value) { base::DictionaryValue* dict_value = NULL; if (!value->GetAsDictionary(&dict_value) || dict_value == NULL) return false; const std::string position_str = GetStringFromPosition(layout.position); dict_value->SetString("position", position_str); dict_value->SetInteger("offset", layout.offset); return true; } std::string DisplayLayout::ToString() const { const std::string position_str = GetStringFromPosition(position); return StringPrintf("%s, %d", position_str.c_str(), offset); } // static void DisplayLayout::RegisterJSONConverter( base::JSONValueConverter<DisplayLayout>* converter) { converter->RegisterCustomField<Position>( "position", &DisplayLayout::position, &GetPositionFromString); converter->RegisterIntField("offset", &DisplayLayout::offset); } //////////////////////////////////////////////////////////////////////////////// // DisplayChangeLimiter DisplayController::DisplayChangeLimiter::DisplayChangeLimiter() : throttle_timeout_(base::Time::Now()) { } void DisplayController::DisplayChangeLimiter::SetThrottleTimeout( int64 throttle_ms) { throttle_timeout_ = base::Time::Now() + base::TimeDelta::FromMilliseconds(throttle_ms); } bool DisplayController::DisplayChangeLimiter::IsThrottled() const { return base::Time::Now() < throttle_timeout_; } //////////////////////////////////////////////////////////////////////////////// // DisplayController DisplayController::DisplayController() : desired_primary_display_id_(gfx::Display::kInvalidDisplayID), primary_root_window_for_replace_(NULL) { #if defined(OS_CHROMEOS) CommandLine* command_line = CommandLine::ForCurrentProcess(); if (!command_line->HasSwitch(switches::kAshDisableDisplayChangeLimiter) && base::chromeos::IsRunningOnChromeOS()) limiter_.reset(new DisplayChangeLimiter); #endif // Reset primary display to make sure that tests don't use // stale display info from previous tests. primary_display_id = gfx::Display::kInvalidDisplayID; delete primary_display_for_shutdown; primary_display_for_shutdown = NULL; num_displays_for_shutdown = -1; Shell::GetScreen()->AddObserver(this); } DisplayController::~DisplayController() { DCHECK(primary_display_for_shutdown); } void DisplayController::Shutdown() { DCHECK(!primary_display_for_shutdown); primary_display_for_shutdown = new gfx::Display( GetDisplayManager()->GetDisplayForId(primary_display_id)); num_displays_for_shutdown = GetDisplayManager()->GetNumDisplays(); Shell::GetScreen()->RemoveObserver(this); // Delete all root window controllers, which deletes root window // from the last so that the primary root window gets deleted last. for (std::map<int64, aura::RootWindow*>::const_reverse_iterator it = root_windows_.rbegin(); it != root_windows_.rend(); ++it) { internal::RootWindowController* controller = GetRootWindowController(it->second); DCHECK(controller); delete controller; } } // static const gfx::Display& DisplayController::GetPrimaryDisplay() { DCHECK_NE(primary_display_id, gfx::Display::kInvalidDisplayID); if (primary_display_for_shutdown) return *primary_display_for_shutdown; return GetDisplayManager()->GetDisplayForId(primary_display_id); } // static int DisplayController::GetNumDisplays() { if (num_displays_for_shutdown >= 0) return num_displays_for_shutdown; return GetDisplayManager()->GetNumDisplays(); } // static bool DisplayController::HasPrimaryDisplay() { return primary_display_id != gfx::Display::kInvalidDisplayID; } void DisplayController::InitPrimaryDisplay() { const gfx::Display* primary_candidate = GetDisplayManager()->GetDisplayAt(0); #if defined(OS_CHROMEOS) if (base::chromeos::IsRunningOnChromeOS()) { internal::DisplayManager* display_manager = GetDisplayManager(); // On ChromeOS device, root windows are stacked vertically, and // default primary is the one on top. int count = display_manager->GetNumDisplays(); int y = primary_candidate->bounds_in_pixel().y(); for (int i = 1; i < count; ++i) { const gfx::Display* display = display_manager->GetDisplayAt(i); if (display->IsInternal()) { primary_candidate = display; break; } else if (display->bounds_in_pixel().y() < y) { primary_candidate = display; y = display->bounds_in_pixel().y(); } } } #endif primary_display_id = primary_candidate->id(); AddRootWindowForDisplay(*primary_candidate); UpdateDisplayBoundsForLayout(); } void DisplayController::InitSecondaryDisplays() { internal::DisplayManager* display_manager = GetDisplayManager(); for (size_t i = 0; i < display_manager->GetNumDisplays(); ++i) { const gfx::Display* display = display_manager->GetDisplayAt(i); if (primary_display_id != display->id()) { aura::RootWindow* root = AddRootWindowForDisplay(*display); Shell::GetInstance()->InitRootWindowForSecondaryDisplay(root); } } CommandLine* command_line = CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kAshSecondaryDisplayLayout)) { std::string value = command_line->GetSwitchValueASCII( switches::kAshSecondaryDisplayLayout); char layout; int offset; if (sscanf(value.c_str(), "%c,%d", &layout, &offset) == 2) { if (layout == 't') default_display_layout_.position = DisplayLayout::TOP; else if (layout == 'b') default_display_layout_.position = DisplayLayout::BOTTOM; else if (layout == 'r') default_display_layout_.position = DisplayLayout::RIGHT; else if (layout == 'l') default_display_layout_.position = DisplayLayout::LEFT; default_display_layout_.offset = offset; } } UpdateDisplayBoundsForLayout(); } void DisplayController::AddObserver(Observer* observer) { observers_.AddObserver(observer); } void DisplayController::RemoveObserver(Observer* observer) { observers_.RemoveObserver(observer); } aura::RootWindow* DisplayController::GetPrimaryRootWindow() { DCHECK(!root_windows_.empty()); return root_windows_[primary_display_id]; } aura::RootWindow* DisplayController::GetRootWindowForDisplayId(int64 id) { return root_windows_[id]; } void DisplayController::CloseChildWindows() { for (std::map<int64, aura::RootWindow*>::const_iterator it = root_windows_.begin(); it != root_windows_.end(); ++it) { aura::RootWindow* root_window = it->second; internal::RootWindowController* controller = GetRootWindowController(root_window); if (controller) { controller->CloseChildWindows(); } else { while (!root_window->children().empty()) { aura::Window* child = root_window->children()[0]; delete child; } } } } std::vector<aura::RootWindow*> DisplayController::GetAllRootWindows() { std::vector<aura::RootWindow*> windows; for (std::map<int64, aura::RootWindow*>::const_iterator it = root_windows_.begin(); it != root_windows_.end(); ++it) { DCHECK(it->second); if (GetRootWindowController(it->second)) windows.push_back(it->second); } return windows; } gfx::Insets DisplayController::GetOverscanInsets(int64 display_id) const { return GetDisplayManager()->GetOverscanInsets(display_id); } void DisplayController::SetOverscanInsets(int64 display_id, const gfx::Insets& insets_in_dip) { GetDisplayManager()->SetOverscanInsets(display_id, insets_in_dip); } std::vector<internal::RootWindowController*> DisplayController::GetAllRootWindowControllers() { std::vector<internal::RootWindowController*> controllers; for (std::map<int64, aura::RootWindow*>::const_iterator it = root_windows_.begin(); it != root_windows_.end(); ++it) { internal::RootWindowController* controller = GetRootWindowController(it->second); if (controller) controllers.push_back(controller); } return controllers; } void DisplayController::SetDefaultDisplayLayout(const DisplayLayout& layout) { CommandLine* command_line = CommandLine::ForCurrentProcess(); if (!command_line->HasSwitch(switches::kAshSecondaryDisplayLayout) && (default_display_layout_.position != layout.position || default_display_layout_.offset != layout.offset)) { default_display_layout_ = layout; NotifyDisplayConfigurationChanging(); UpdateDisplayBoundsForLayout(); } } void DisplayController::SetLayoutForDisplayId(int64 id, const DisplayLayout& layout) { DisplayLayout& display_for_id = secondary_layouts_[id]; if (display_for_id.position != layout.position || display_for_id.offset != layout.offset) { secondary_layouts_[id] = layout; NotifyDisplayConfigurationChanging(); UpdateDisplayBoundsForLayout(); } } const DisplayLayout& DisplayController::GetLayoutForDisplay( const gfx::Display& display) const { std::map<int64, DisplayLayout>::const_iterator it = secondary_layouts_.find(display.id()); if (it != secondary_layouts_.end()) return it->second; return default_display_layout_; } const DisplayLayout& DisplayController::GetCurrentDisplayLayout() const { DCHECK_EQ(2U, GetDisplayManager()->GetNumDisplays()); if (GetDisplayManager()->GetNumDisplays() > 1) { DisplayController* non_const = const_cast<DisplayController*>(this); return GetLayoutForDisplay(*(non_const->GetSecondaryDisplay())); } // On release build, just fallback to default instead of blowing up. return default_display_layout_; } void DisplayController::CycleDisplayMode() { if (limiter_.get()) { if (limiter_->IsThrottled()) return; limiter_->SetThrottleTimeout(kCycleDisplayThrottleTimeoutMs); } #if defined(OS_CHROMEOS) Shell* shell = Shell::GetInstance(); if (!base::chromeos::IsRunningOnChromeOS()) { internal::DisplayManager::CycleDisplay(); } else if (shell->output_configurator()->connected_output_count() > 1) { internal::OutputConfiguratorAnimation* animation = shell->output_configurator_animation(); animation->StartFadeOutAnimation(base::Bind( base::IgnoreResult(&chromeos::OutputConfigurator::CycleDisplayMode), base::Unretained(shell->output_configurator()))); } #endif } void DisplayController::SwapPrimaryDisplay() { if (limiter_.get()) { if (limiter_->IsThrottled()) return; limiter_->SetThrottleTimeout(kSwapDisplayThrottleTimeoutMs); } if (Shell::GetScreen()->GetNumDisplays() > 1) SetPrimaryDisplay(ScreenAsh::GetSecondaryDisplay()); } void DisplayController::SetPrimaryDisplayId(int64 id) { desired_primary_display_id_ = id; if (desired_primary_display_id_ == primary_display_id) return; internal::DisplayManager* display_manager = GetDisplayManager(); for (size_t i = 0; i < display_manager->GetNumDisplays(); ++i) { gfx::Display* display = display_manager->GetDisplayAt(i); if (display->id() == id) { SetPrimaryDisplay(*display); break; } } } void DisplayController::SetPrimaryDisplay( const gfx::Display& new_primary_display) { internal::DisplayManager* display_manager = GetDisplayManager(); DCHECK(new_primary_display.is_valid()); DCHECK(display_manager->IsActiveDisplay(new_primary_display)); if (!new_primary_display.is_valid() || !display_manager->IsActiveDisplay(new_primary_display)) { LOG(ERROR) << "Invalid or non-existent display is requested:" << new_primary_display.ToString(); return; } if (primary_display_id == new_primary_display.id() || root_windows_.size() < 2) { return; } aura::RootWindow* non_primary_root = root_windows_[new_primary_display.id()]; LOG_IF(ERROR, !non_primary_root) << "Unknown display is requested in SetPrimaryDisplay: id=" << new_primary_display.id(); if (!non_primary_root) return; gfx::Display old_primary_display = GetPrimaryDisplay(); // Swap root windows between current and new primary display. aura::RootWindow* primary_root = root_windows_[primary_display_id]; DCHECK(primary_root); DCHECK_NE(primary_root, non_primary_root); root_windows_[new_primary_display.id()] = primary_root; primary_root->SetProperty(internal::kDisplayIdKey, new_primary_display.id()); root_windows_[old_primary_display.id()] = non_primary_root; non_primary_root->SetProperty(internal::kDisplayIdKey, old_primary_display.id()); primary_display_id = new_primary_display.id(); desired_primary_display_id_ = primary_display_id; display_manager->UpdateWorkAreaOfDisplayNearestWindow( primary_root, old_primary_display.GetWorkAreaInsets()); display_manager->UpdateWorkAreaOfDisplayNearestWindow( non_primary_root, new_primary_display.GetWorkAreaInsets()); // Update the layout. SetLayoutForDisplayId(old_primary_display.id(), GetLayoutForDisplay(new_primary_display).Invert()); // Update the dispay manager with new display info. std::vector<gfx::Display> displays; displays.push_back(display_manager->GetDisplayForId(primary_display_id)); displays.push_back(*GetSecondaryDisplay()); GetDisplayManager()->set_force_bounds_changed(true); GetDisplayManager()->UpdateDisplays(displays); GetDisplayManager()->set_force_bounds_changed(false); } gfx::Display* DisplayController::GetSecondaryDisplay() { internal::DisplayManager* display_manager = GetDisplayManager(); CHECK_EQ(2U, display_manager->GetNumDisplays()); return display_manager->GetDisplayAt(0)->id() == primary_display_id ? display_manager->GetDisplayAt(1) : display_manager->GetDisplayAt(0); } void DisplayController::OnDisplayBoundsChanged(const gfx::Display& display) { if (limiter_.get()) limiter_->SetThrottleTimeout(kAfterDisplayChangeThrottleTimeoutMs); NotifyDisplayConfigurationChanging(); UpdateDisplayBoundsForLayout(); aura::RootWindow* root = root_windows_[display.id()]; SetDisplayPropertiesOnHostWindow(root, display); root->SetHostBounds(display.bounds_in_pixel()); } void DisplayController::OnDisplayAdded(const gfx::Display& display) { if (limiter_.get()) limiter_->SetThrottleTimeout(kAfterDisplayChangeThrottleTimeoutMs); NotifyDisplayConfigurationChanging(); if (primary_root_window_for_replace_) { DCHECK(root_windows_.empty()); primary_display_id = display.id(); root_windows_[display.id()] = primary_root_window_for_replace_; primary_root_window_for_replace_->SetProperty( internal::kDisplayIdKey, display.id()); primary_root_window_for_replace_ = NULL; UpdateDisplayBoundsForLayout(); root_windows_[display.id()]->SetHostBounds(display.bounds_in_pixel()); } else { DCHECK(!root_windows_.empty()); aura::RootWindow* root = AddRootWindowForDisplay(display); UpdateDisplayBoundsForLayout(); if (desired_primary_display_id_ == display.id()) SetPrimaryDisplay(display); Shell::GetInstance()->InitRootWindowForSecondaryDisplay(root); } } void DisplayController::OnDisplayRemoved(const gfx::Display& display) { if (limiter_.get()) limiter_->SetThrottleTimeout(kAfterDisplayChangeThrottleTimeoutMs); aura::RootWindow* root_to_delete = root_windows_[display.id()]; DCHECK(root_to_delete) << display.ToString(); NotifyDisplayConfigurationChanging(); // Display for root window will be deleted when the Primary RootWindow // is deleted by the Shell. root_windows_.erase(display.id()); // When the primary root window's display is removed, move the primary // root to the other display. if (primary_display_id == display.id()) { // Temporarily store the primary root window in // |primary_root_window_for_replace_| when replacing the display. if (root_windows_.size() == 0) { primary_display_id = gfx::Display::kInvalidDisplayID; primary_root_window_for_replace_ = root_to_delete; return; } DCHECK_EQ(1U, root_windows_.size()); primary_display_id = GetSecondaryDisplay()->id(); aura::RootWindow* primary_root = root_to_delete; // Delete the other root instead. root_to_delete = root_windows_[primary_display_id]; root_to_delete->SetProperty(internal::kDisplayIdKey, display.id()); // Setup primary root. root_windows_[primary_display_id] = primary_root; primary_root->SetProperty(internal::kDisplayIdKey, primary_display_id); OnDisplayBoundsChanged( GetDisplayManager()->GetDisplayForId(primary_display_id)); } internal::RootWindowController* controller = GetRootWindowController(root_to_delete); DCHECK(controller); controller->MoveWindowsTo(GetPrimaryRootWindow()); // Delete most of root window related objects, but don't delete // root window itself yet because the stack may be using it. controller->Shutdown(); MessageLoop::current()->DeleteSoon(FROM_HERE, controller); } aura::RootWindow* DisplayController::AddRootWindowForDisplay( const gfx::Display& display) { aura::RootWindow* root = GetDisplayManager()->CreateRootWindowForDisplay(display); root_windows_[display.id()] = root; SetDisplayPropertiesOnHostWindow(root, display); #if defined(OS_CHROMEOS) static bool force_constrain_pointer_to_root = CommandLine::ForCurrentProcess()->HasSwitch( switches::kAshConstrainPointerToRoot); if (base::chromeos::IsRunningOnChromeOS() || force_constrain_pointer_to_root) root->ConfineCursorToWindow(); #endif return root; } void DisplayController::UpdateDisplayBoundsForLayout() { if (Shell::GetScreen()->GetNumDisplays() <= 1) return; DCHECK_EQ(2, Shell::GetScreen()->GetNumDisplays()); const gfx::Rect& primary_bounds = GetPrimaryDisplay().bounds(); gfx::Display* secondary_display = GetSecondaryDisplay(); const gfx::Rect& secondary_bounds = secondary_display->bounds(); gfx::Point new_secondary_origin = primary_bounds.origin(); const DisplayLayout& layout = GetLayoutForDisplay(*secondary_display); DisplayLayout::Position position = layout.position; // Ignore the offset in case the secondary display doesn't share edges with // the primary display. int offset = layout.offset; if (position == DisplayLayout::TOP || position == DisplayLayout::BOTTOM) { offset = std::min( offset, primary_bounds.width() - kMinimumOverlapForInvalidOffset); offset = std::max( offset, -secondary_bounds.width() + kMinimumOverlapForInvalidOffset); } else { offset = std::min( offset, primary_bounds.height() - kMinimumOverlapForInvalidOffset); offset = std::max( offset, -secondary_bounds.height() + kMinimumOverlapForInvalidOffset); } switch (position) { case DisplayLayout::TOP: new_secondary_origin.Offset(offset, -secondary_bounds.height()); break; case DisplayLayout::RIGHT: new_secondary_origin.Offset(primary_bounds.width(), offset); break; case DisplayLayout::BOTTOM: new_secondary_origin.Offset(offset, primary_bounds.height()); break; case DisplayLayout::LEFT: new_secondary_origin.Offset(-secondary_bounds.width(), offset); break; } gfx::Insets insets = secondary_display->GetWorkAreaInsets(); secondary_display->set_bounds( gfx::Rect(new_secondary_origin, secondary_bounds.size())); secondary_display->UpdateWorkAreaFromInsets(insets); } void DisplayController::NotifyDisplayConfigurationChanging() { FOR_EACH_OBSERVER(Observer, observers_, OnDisplayConfigurationChanging()); } } // namespace ash
zcbenz/cefode-chromium
ash/display/display_controller.cc
C++
bsd-3-clause
26,202
/** * Copyright 5AM Solutions Inc, ESAC, ScenPro & SAIC * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/caintegrator/LICENSE.txt for details. */ package gov.nih.nci.caintegrator.web.action.study.management; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import gov.nih.nci.caintegrator.application.study.LogEntry; import gov.nih.nci.caintegrator.application.study.StudyConfiguration; import gov.nih.nci.caintegrator.application.study.StudyManagementServiceStub; import gov.nih.nci.caintegrator.web.action.AbstractSessionBasedTest; import gov.nih.nci.caintegrator.web.action.study.management.EditStudyLogAction; import java.util.Date; import org.junit.Before; import org.junit.Test; import com.opensymphony.xwork2.Action; /** * */ public class EditStudyLogActionTest extends AbstractSessionBasedTest { private EditStudyLogAction action = new EditStudyLogAction(); private StudyManagementServiceStub studyManagementService; private LogEntry logEntry1; private LogEntry logEntry2; @Override @Before public void setUp() throws Exception { super.setUp(); action.setStudyConfiguration(new StudyConfiguration()); action = new EditStudyLogAction(); studyManagementService = new StudyManagementServiceStub(); action.setStudyManagementService(studyManagementService); action.setWorkspaceService(workspaceService); logEntry1 = new LogEntry(); logEntry1.setTrimSystemLogMessage("message"); logEntry1.setLogDate(new Date()); logEntry1.setTrimDescription("desc"); try { Thread.sleep(20l); } catch (InterruptedException e) { } logEntry2 = new LogEntry(); logEntry2.setSystemLogMessage("message2"); logEntry2.setLogDate(new Date()); logEntry2.setDescription("desc"); action.getStudyConfiguration().getLogEntries().add(logEntry1); action.getStudyConfiguration().getLogEntries().add(logEntry2); } @Test public void testPrepare() throws InterruptedException { action.prepare(); // Verify the most recent ones are sorted first. assertEquals(logEntry2, action.getDisplayableLogEntries().get(0).getLogEntry()); assertEquals(logEntry1, action.getDisplayableLogEntries().get(1).getLogEntry()); assertTrue(studyManagementService.getRefreshedStudyEntityCalled); } @Test public void testSave() { action.prepare(); // logEntry2 is first action.getDisplayableLogEntries().get(0).setDescription("new"); action.getDisplayableLogEntries().get(0).setUpdateDescription(true); // logEntry1 will have a new description, but the checkbox will be false. action.getDisplayableLogEntries().get(1).setDescription("new"); action.getDisplayableLogEntries().get(1).setUpdateDescription(false); assertEquals(Action.SUCCESS, action.save()); assertEquals("new", logEntry2.getDescription()); assertEquals("desc", logEntry1.getDescription()); assertTrue(studyManagementService.saveCalled); } @Test public void testAcceptableParameterName() { assertTrue(action.acceptableParameterName(null)); assertTrue(action.acceptableParameterName("ABC")); assertFalse(action.acceptableParameterName("123")); assertFalse(action.acceptableParameterName("d-123-e")); } }
NCIP/caintegrator
caintegrator-war/test/src/gov/nih/nci/caintegrator/web/action/study/management/EditStudyLogActionTest.java
Java
bsd-3-clause
3,632
# AWS SDK for JavaScript [![NPM](https://nodei.co/npm/aws-sdk.svg?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/aws-sdk/) [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/aws/aws-sdk-js) [![Version](https://badge.fury.io/js/aws-sdk.svg)](http://badge.fury.io/js/aws-sdk) [![Build Status](https://travis-ci.org/aws/aws-sdk-js.svg?branch=master)](https://travis-ci.org/aws/aws-sdk-js) [![Coverage Status](https://coveralls.io/repos/aws/aws-sdk-js/badge.svg?branch=master)](https://coveralls.io/r/aws/aws-sdk-js?branch=master) The official AWS SDK for JavaScript, available for browsers and mobile devices, or Node.js backends For release notes, see the [CHANGELOG](CHANGELOG.md). Prior to v2.4.8, release notes can be found at http://aws.amazon.com/releasenotes/SDK/JavaScript <p class="note"> If you are upgrading from 1.x to 2.0 of the SDK, please see the {file:UPGRADING.md} notes for information on how to migrate existing code to work with the new major version. </p> ## Installing ### In the Browser To use the SDK in the browser, simply add the following script tag to your HTML pages: <script src="https://sdk.amazonaws.com/js/aws-sdk-2.7.7.min.js"></script> You can also build a custom browser SDK with your specified set of AWS services. This can allow you to reduce the SDK's size, specify different API versions of services, or use AWS services that don't currently support CORS if you are working in an environment that does not enforce CORS. To get started: http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/building-sdk-for-browsers.html The AWS SDK is also compatible with [browserify](http://browserify.org). ### In Node.js The preferred way to install the AWS SDK for Node.js is to use the [npm](http://npmjs.org) package manager for Node.js. Simply type the following into a terminal window: ```sh npm install aws-sdk ``` ### Using Bower You can also use [Bower](http://bower.io) to install the SDK by typing the following into a terminal window: ```sh bower install aws-sdk-js ``` ## Usage and Getting Started You can find a getting started guide at: http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide ## Usage with TypeScript The AWS SDK for JavaScript bundles TypeScript definition files for use in TypeScript projects and to support tools that can read `.d.ts` files. Our goal is to keep these TypeScript definition files updated with each release for any public api. ### Pre-requisites Before you can begin using these TypeScript definitions with your project, you need to make sure your project meets a few of these requirements: * Use TypeScript v2.x * Includes the TypeScript definitions for node. You can use npm to install this by typing the following into a terminal window: ```sh npm install --save-dev @types/node ``` * Your `tsconfig.json` or `jsconfig.json` includes `'dom'` and `'es2015.promise'` under `compilerOptions.lib`. See [tsconfig.json](./ts/tsconfig.json) for an example. ### In the Browser To use the TypeScript definition files with the global `AWS` object in a front-end project, add the following line to the top of your JavaScript file: ```javascript /// <reference types="aws-sdk" /> ``` This will provide support for the global `AWS` object. ### In Node.js To use the TypeScript definition files within a Node.js project, simply import `aws-sdk` as you normally would. In a TypeScript file: ```javascript // import entire SDK import AWS = require('aws-sdk'); // import AWS object without services import AWS = require('aws-sdk/global'); // import individual service import S3 = require('aws-sdk/clients/s3'); ``` In a JavaScript file: ```javascript // import entire SDK var AWS = require('aws-sdk'); // import AWS object without services var AWS = require('aws-sdk/global'); // import individual service var S3 = require('aws-sdk/clients/s3'); ``` ### Known Limitations There are a few known limitations with the bundled TypeScript definitions at this time: * Service client typings reflect the latest `apiVersion`, regardless of which `apiVersion` is specified when creating a client. * Service-bound parameters use the `any` type. ## Supported Services <p class="note"><strong>Note</strong>: Although all services are supported in the browser version of the SDK, not all of the services are available in the default hosted build (using the script tag provided above). Instructions on how to build a custom version of the SDK with individual services are provided in the "<a href="http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/building-sdk-for-browsers.html">Building the SDK for Browsers</a>" section of the SDK Developer Guide. </p> The SDK currently supports the following services: <table> <thead> <th>Service Name</th> <th>Class Name</th> <th>API Version</th> </thead> <tbody> <tr><td>Amazon API Gateway</td><td>AWS.APIGateway</td><td>2015-07-09</td></tr> <tr><td>Amazon CloudFront</td><td>AWS.CloudFront</td><td>2014-10-21</td></tr> <tr><td>Amazon CloudHSM</td><td>AWS.CloudHSM</td><td>2014-05-30</td></tr> <tr><td>Amazon CloudSearch</td><td>AWS.CloudSearch</td><td>2013-01-01</td></tr> <tr><td>Amazon CloudSearch Domain</td><td>AWS.CloudSearchDomain</td><td>2013-01-01</td></tr> <tr><td>Amazon CloudWatch</td><td>AWS.CloudWatch</td><td>2010-08-01</td></tr> <tr><td>Amazon CloudWatch Events</td><td>AWS.CloudWatchLogs</td><td>2015-10-07</td></tr> <tr><td>Amazon CloudWatch Logs</td><td>AWS.CloudWatchLogs</td><td>2014-03-28</td></tr> <tr><td>Amazon Cognito Identity</td><td>AWS.CognitoIdentity</td><td>2014-06-30</td></tr> <tr><td>Amazon Cognito Sync</td><td>AWS.CognitoSync</td><td>2014-06-30</td></tr> <tr><td>Amazon DynamoDB</td><td>AWS.DynamoDB</td><td>2012-08-10</td></tr> <tr><td>Amazon DynamoDB Streams</td><td>AWS.DynamoDBStreams</td><td>2012-08-10</td></tr> <tr><td>Amazon EC2 Container Registry</td><td>AWS.ECR</td><td>2015-09-21</td></tr> <tr><td>Amazon EC2 Container Service</td><td>AWS.ECS</td><td>2014-11-13</td></tr> <tr><td>Amazon Elastic Compute Cloud</td><td>AWS.EC2</td><td>2014-10-01</td></tr> <tr><td>Amazon Elastic File System</td><td>AWS.EFS</td><td>2015-02-01</td></tr> <tr><td>Amazon Elastic MapReduce</td><td>AWS.EMR</td><td>2009-03-31</td></tr> <tr><td>Amazon Elastic Transcoder</td><td>AWS.ElasticTranscoder</td><td>2012-09-25</td></tr> <tr><td>Amazon ElastiCache</td><td>AWS.ElastiCache</td><td>2014-09-30</td></tr> <tr><td>Amazon Elasticsearch Service</td><td>AWS.ES</td><td>2015-01-01</td></tr> <tr><td>Amazon GameLift</td><td>AWS.GameLift</td><td>2015-10-01</td></tr> <tr><td>Amazon Glacier</td><td>AWS.Glacier</td><td>2012-06-01</td></tr> <tr><td>Amazon Inspector</td><td>AWS.Inspector</td><td>2016-02-16</td></tr> <tr><td>Amazon Kinesis</td><td>AWS.Kinesis</td><td>2013-12-02</td></tr> <tr><td>Amazon Kinesis Analytics</td><td>AWS.KinesisAnalytics</td><td>2015-08-14</td></tr> <tr><td>Amazon Kinesis Firehose</td><td>AWS.Firehose</td><td>2015-08-04</td></tr> <tr><td>Amazon Machine Learning</td><td>AWS.MachineLearning</td><td>2014-12-12</td></tr> <tr><td>Amazon Mobile Analytics</td><td>AWS.MobileAnalytics</td><td>2014-06-05</td></tr> <tr><td>Amazon Redshift</td><td>AWS.Redshift</td><td>2012-12-01</td></tr> <tr><td>Amazon Relational Database Service</td><td>AWS.RDS</td><td>2014-09-01</td></tr> <tr><td>Amazon Route 53</td><td>AWS.Route53</td><td>2013-04-01</td></tr> <tr><td>Amazon Route 53 Domains</td><td>AWS.Route53Domains</td><td>2014-05-15</td></tr> <tr><td>Amazon Simple Email Service</td><td>AWS.SES</td><td>2010-12-01</td></tr> <tr><td>Amazon Simple Notification Service</td><td>AWS.SNS</td><td>2010-03-31</td></tr> <tr><td>Amazon Simple Queue Service</td><td>AWS.SQS</td><td>2012-11-05</td></tr> <tr><td>Amazon Simple Storage Service</td><td>AWS.S3</td><td>2006-03-01</td></tr> <tr><td>Amazon Simple Systems Management Service</td><td>AWS.SSM</td><td>2014-11-06</td></tr> <tr><td>Amazon Simple Workflow Service</td><td>AWS.SWF</td><td>2012-01-25</td></tr> <tr><td>Amazon SimpleDB</td><td>AWS.SimpleDB</td><td>2009-04-15</td></tr> <tr><td>Amazon Snowball</td><td>AWS.Snowball</td><td>2016-06-30</td></tr> <tr><td>Amazon WorkSpaces</td><td>AWS.WorkSpaces</td><td>2015-04-08</td></tr> <tr><td>Auto Scaling</td><td>AWS.AutoScaling</td><td>2011-01-01</td></tr> <tr><td>AWS Certificate Manager</td><td>AWS.ACM</td><td>2015-12-08</td></tr> <tr><td>AWS CloudFormation</td><td>AWS.CloudFormation</td><td>2010-05-15</td></tr> <tr><td>AWS CloudTrail</td><td>AWS.CloudTrail</td><td>2013-11-01</td></tr> <tr><td>AWS CodeCommit</td><td>AWS.CodeCommit</td><td>2015-04-13</td></tr> <tr><td>AWS CodeDeploy</td><td>AWS.CodeDeploy</td><td>2014-10-06</td></tr> <tr><td>AWS CodePipeline</td><td>AWS.CodePipeline</td><td>2015-07-09</td></tr> <tr><td>AWS Config</td><td>AWS.ConfigService</td><td>2014-11-12</td></tr> <tr><td>AWS Data Pipeline</td><td>AWS.DataPipeline</td><td>2012-10-29</td></tr> <tr><td>AWS Database Migration Service</td><td>AWS.DMS</td><td>2016-01-01</td></tr> <tr><td>AWS Device Farm</td><td>AWS.DeviceFarm</td><td>2015-06-23</td></tr> <tr><td>AWS Direct Connect</td><td>AWS.DirectConnect</td><td>2012-10-25</td></tr> <tr><td>AWS Directory Service</td><td>AWS.DirectoryService</td><td>2015-04-16</td></tr> <tr><td>AWS Elastic Beanstalk</td><td>AWS.ElasticBeanstalk</td><td>2010-12-01</td></tr> <tr><td>AWS Identity and Access Management</td><td>AWS.IAM</td><td>2010-05-08</td></tr> <tr><td>AWS Import/Export</td><td>AWS.ImportExport</td><td>2010-06-01</td></tr> <tr><td>AWS IoT</td><td>AWS.Iot</td><td>2015-05-28</td></tr> <tr><td>AWS IoT Data Plane</td><td>AWS.IotData</td><td>2015-05-28</td></tr> <tr><td>AWS Key Management Service</td><td>AWS.KMS</td><td>2014-11-01</td></tr> <tr><td>AWS Lambda</td><td>AWS.Lambda</td><td>2015-03-31</td></tr> <tr><td>AWS Marketplace Commerce Analytics</td><td>AWS.MarketplaceCommerceAnalytics</td><td>2015-07-01</td></tr> <tr><td>AWS Marketplace Metering</td><td>AWS.MarketplaceMetering</td><td>2016-01-14</td></tr> <tr><td>AWS OpsWorks</td><td>AWS.OpsWorks</td><td>2013-02-18</td></tr> <tr><td>AWS Security Token Service</td><td>AWS.STS</td><td>2011-06-15</td></tr> <tr><td>AWS Storage Gateway</td><td>AWS.StorageGateway</td><td>2013-06-30</td></tr> <tr><td>AWS Support</td><td>AWS.Support</td><td>2013-04-15</td></tr> <tr><td>AWS WAF</td><td>AWS.WAF</td><td>2015-08-24</td></tr> <tr><td>Elastic Load Balancing</td><td>AWS.ELB</td><td>2012-06-01</td></tr> <tr><td>Elastic Load Balancing v2</td><td>AWS.ELBv2</td><td>2015-12-01</td></tr> </tbody> </table> ## License This SDK is distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), see LICENSE.txt and NOTICE.txt for more information.
thesoupgirl/PlanIt
node_modules/aws-dynamodb/node_modules/aws-sdk/README.md
Markdown
bsd-3-clause
11,021
# encoding: utf-8 import sys sys.path.append(sys.path.insert(0,"../src")) def urlopen(*args, **kwargs): # Only parse one arg: the url return Urls[args[0]] # Provide a simple hashtable to contain the content of the urls and # provide a mock object similar to what will be returned from the # real urlopen() function calls from io import StringIO from time import time import re from nose.tools import with_setup class MockUrlContent(StringIO): def __init__(self, content): super(MockUrlContent, self).__init__(content) self.headers = { 'last-modified': time() } def close(self): pass scheme_re = re.compile(r'file:(/+)?') class MockUrlCache(dict): def __setitem__(self, name, content): super(MockUrlCache, self).__setitem__(name, MockUrlContent(content)) def __getitem__(self, name): if name in self: return super(MockUrlCache, self).__getitem__(name) # Strip off 'file:[///]' from url elif name.startswith('file:'): try: name= scheme_re.sub('', name) return super(MockUrlCache, self).__getitem__(name) except: # Fall through pass # urlopen raises ValueError if unable to load content (not KeyError) raise ValueError("{0}: Cannot find file content".format(name)) Urls = MockUrlCache() def clear_configs(): pass @with_setup(clear_configs) def testImportContent(): "Cannot import content from a file" from xmlconfig import getConfig Urls.clear() Urls["file:file.txt"] = "Content embedded in a file" Urls["config.xml"] = \ u"""<?xml version="1.0" encoding="utf-8"?> <config> <constants> <string key="import" src="file:file.txt"/> </constants> </config> """ conf=getConfig() conf.load("config.xml") assert conf.get("import") == "Content embedded in a file" @with_setup(clear_configs) def testImportConfig(): "Cannot import another config file" from xmlconfig import getConfig Urls.clear() Urls["config2.xml"] = \ """<?xml version="1.0"?> <config> <constants> <string key="key22">This was imported from config2.xml</string> </constants> </config> """ Urls["config.xml"] = \ u"""<?xml version="1.0" encoding="utf-8"?> <config> <constants namespace="import" src="file:config2.xml"/> <constants> <string key="imported">%(import:key22)</string> </constants> </config> """ conf=getConfig() conf.load("config.xml") assert conf.get("imported") == "This was imported from config2.xml" @with_setup(clear_configs) def testCircularImport(): "Property detect circluar importing" from xmlconfig import getConfig Urls.clear() Urls["config2.xml"] = \ """<?xml version="1.0"?> <config> <constants namespace="circular" src="file:config.xml"/> <constants> <string key="key22">This was imported from config2.xml</string> <string key="foreign"> Namespace changed in %(circular:key4.import) </string> </constants> </config> """ Urls["config.xml"] = \ """<?xml version="1.0"?> <config> <constants namespace="import" src="file:config2.xml"/> <constants> <section key="key4"> <string key="key5">value2</string> <string key="import">%(import:key22)</string> </section> </constants> </config> """ conf=getConfig() conf.load("config.xml") assert conf.get("import:foreign") == \ "Namespace changed in This was imported from config2.xml" @with_setup(clear_configs) def testRelativeImport(): """Transfer leading absolute or relative path to the location of documents imported""" from xmlconfig import getConfig Urls["../config/config2.xml"] = \ """<?xml version="1.0"?> <config> <constants> <string key="key22">This was imported from config2.xml</string> </constants> </config> """ Urls["../config/config.xml"] = \ """<?xml version="1.0" encoding="utf-8"?> <config> <constants namespace="import" src="file:config2.xml"/> <constants> <string key="imported">%(import:key22)</string> </constants> </config> """ conf=getConfig() conf.load("../config/config.xml") assert conf.get("imported") == "This was imported from config2.xml"
greezybacon/xmlconfig
test/testImport.py
Python
bsd-3-clause
4,610
<!DOCTYPE html> <!-- | Setting the 4 different border widths for 4 directions. border-top-width | would be default width. | https://www.w3.org/TR/css3-background/#border-width --> <html> <head> <style> div { border: solid; border-color: blue; border-left-width: 20px; border-bottom-width: .8em; border-right-width: 10px; background: #ff6363; height: 100px; width: 100px; } </style> </head> <body> <div></div> </body> </html>
youtube/cobalt
cobalt/layout_tests/testdata/css3-background/4-0-different-border-widths-with-solid-border-style.html
HTML
bsd-3-clause
493
# -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) cwd = os.getcwd() parent = os.path.dirname(cwd) sys.path.append(parent) import organigrammi # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'openpa-organigrammi' copyright = u'2014, Simone Dalla' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = organigrammi.__version__ # The full version, including alpha/beta/rc tags. release = organigrammi.__version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'openpa-organigrammidoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'openpa-organigrammi.tex', u'openpa-organigrammi Documentation', u'Simone Dalla', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'openpa-organigrammi', u'openpa-organigrammi Documentation', [u'Simone Dalla'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'openpa-organigrammi', u'openpa-organigrammi Documentation', u'Simone Dalla', 'openpa-organigrammi', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False
simodalla/pympa-affarigenerali-OLD
docs/conf.py
Python
bsd-3-clause
8,210
/* * Copyright (c) 2008, Keith Woodward * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of Keith Woodward nor the names * of its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * */ package straightedge.geom.vision; import straightedge.geom.*; public class CollinearOverlap{ public KPolygon polygon; public int pointIndex; public int nextPointIndex; public KPolygon polygon2; public int point2Index; public CollinearOverlap(KPolygon polygon, int pointIndex, int nextPointIndex, KPolygon polygon2, int point2Index){ this.polygon = polygon; this.pointIndex = pointIndex; this.nextPointIndex = nextPointIndex; this.polygon2 = polygon2; this.point2Index = point2Index; } public KPolygon getPolygon() { return polygon; } public int getPointIndex() { return pointIndex; } public int getNextPointIndex() { return nextPointIndex; } public KPolygon getPolygon2() { return polygon2; } public int getPoint2Index() { return point2Index; } }
rpax/straightedge
src/main/java/straightedge/geom/vision/CollinearOverlap.java
Java
bsd-3-clause
2,372
<?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ return array( 'router' => array( 'routes' => array( 'home' => array( 'type' => 'Zend\Mvc\Router\Http\Literal', 'options' => array( 'route' => '/', 'defaults' => array( 'controller' => 'Application\Controller\Index', 'action' => 'index', ), ), ), // The following is a route to simplify getting started creating // new controllers and actions without needing to create a new // module. Simply drop new controllers in, and you can access them // using the path /application/:controller/:action 'application' => array( 'type' => 'Literal', 'options' => array( 'route' => '/application', 'defaults' => array( '__NAMESPACE__' => 'Application\Controller', 'controller' => 'Index', 'action' => 'index', ), ), 'may_terminate' => true, 'child_routes' => array( 'default' => array( 'type' => 'Segment', 'options' => array( 'route' => '/[:controller[/:action[/:id[/:id2]]]]', 'constraints' => array( //en realidad solo funcionan las minusculas. 'controller' => '[a-zA-Z][a-zA-Z0-9_-]*', 'action' => '[a-zA-Z][a-zA-Z0-9_-]*', 'id' => '[0-9-a-z]*', 'id2' => '[0-9-a-z]*' ), 'defaults' => array( // '__NAMESPACE__' => 'Application\Controller', // 'controller' => 'Index', // 'action' => 'index', // ), ), ), ), ), ), ), 'service_manager' => array( 'factories' => array( 'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory', ), ), 'translator' => array( 'locale' => 'en_US', 'translation_file_patterns' => array( array( 'type' => 'gettext', 'base_dir' => __DIR__ . '/../language', 'pattern' => '%s.mo', ), ), ), 'controllers' => array( 'invokables' => array( //Agregar otros controllers aqui Unicamente ejecutar: http://localhost/clase3/public/application/trabajo/otro 'Application\Controller\Index' => 'Application\Controller\IndexController', 'Application\Controller\Trabajo' => 'Application\Controller\TrabajoController' ), ), 'view_manager' => array( 'display_not_found_reason' => true, 'display_exceptions' => true, 'doctype' => 'HTML5', 'not_found_template' => 'error/404', 'exception_template' => 'error/index', 'template_map' => array( 'layout/layout' => __DIR__ . '/../view/layout/layout.phtml', 'application/index/index' => __DIR__ . '/../view/application/index/index.phtml', 'error/404' => __DIR__ . '/../view/error/404.phtml', 'error/index' => __DIR__ . '/../view/error/index.phtml', ), 'template_path_stack' => array( __DIR__ . '/../view', ), ), );
maxcastroro/clase03
module/Application/config/module.config.php
PHP
bsd-3-clause
4,225
// RobotBuilder Version: 2.0 // // This file was generated by RobotBuilder. It contains sections of // code that are automatically generated and assigned by robotbuilder. // These sections will be updated in the future when you export to // Java from RobotBuilder. Do not put any code or make any change in // the blocks indicating autogenerated code or it will be lost on an // update. Deleting the comments indicating the section will prevent // it from being updated in the future. package org.usfirst.frc157.ProtoBot2017; import org.usfirst.frc157.ProtoBot2017.AnalogSelectSwitch; // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=IMPORTS import com.ctre.CANTalon; import edu.wpi.first.wpilibj.Relay; import edu.wpi.first.wpilibj.RobotDrive; // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=IMPORTS import edu.wpi.first.wpilibj.livewindow.LiveWindow; /** * The RobotMap is a mapping from the ports sensors and actuators are wired into * to a variable name. This provides flexibility changing wiring, makes checking * the wiring easier and significantly reduces the number of magic numbers * floating around. */ public class RobotMap { // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS public static CANTalon driveFL_Motor; public static CANTalon driveFR_Motor; public static CANTalon driveRL_Motor; public static CANTalon driveRR_Motor; public static RobotDrive driveMechDrive; public static CANTalon gearMotorLeft; public static CANTalon gearMotorRight; public static CANTalon collectMotor; public static CANTalon helixMotorRight; public static CANTalon helixMotorLeft; public static CANTalon shootMotor; public static CANTalon climbMotor; public static Relay leftGateRelay; public static Relay rightGateRelay; public final static int OnboardModeSelectSwitchAnalogInID = 3; public static AnalogSelectSwitch modeSelect; // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS public static void init() { // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS modeSelect = new AnalogSelectSwitch(0); // Analog Port 0 driveFL_Motor = new CANTalon(5); // CAN ID 5 LiveWindow.addActuator("Drive", "FL_Motor", driveFL_Motor); driveFR_Motor = new CANTalon(4); // CAN ID 4 LiveWindow.addActuator("Drive", "FR_Motor", driveFR_Motor); driveRL_Motor = new CANTalon(7); // CAN ID 7 LiveWindow.addActuator("Drive", "RL_Motor", driveRL_Motor); driveRR_Motor = new CANTalon(6) ; // CAN ID 6 LiveWindow.addActuator("Drive", "RR_Motor", driveRR_Motor); driveMechDrive = new RobotDrive(driveFL_Motor, driveRL_Motor, driveFR_Motor, driveRR_Motor); driveMechDrive.setSafetyEnabled(true); driveMechDrive.setExpiration(0.5); driveMechDrive.setSensitivity(0.5); driveMechDrive.setMaxOutput(1.0); gearMotorRight = new CANTalon(14); // CAN ID 14 LiveWindow.addActuator("Gear", "gearMotor", gearMotorRight); gearMotorLeft = new CANTalon(12); LiveWindow.addActuator("Gear", "gearMotor", gearMotorLeft); collectMotor = new CANTalon(13); // CAN ID 13 LiveWindow.addActuator("Collect", "collectMotor", collectMotor); helixMotorRight = new CANTalon(9); // CAN ID 9 helixMotorLeft = new CANTalon(8); // CAN ID 8 shootMotor = new CANTalon(11); // CAN ID 11 climbMotor = new CANTalon(10); // CAN ID 10 rightGateRelay = new Relay(0); // Relay Port 0 leftGateRelay = new Relay(1); // Relay Port 1 // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS } }
Aztechs157/ProtoBot2017
src/org/usfirst/frc157/ProtoBot2017/RobotMap.java
Java
bsd-3-clause
3,913
# -*- encoding : utf-8 -*- require 'test_helper' class Cuenta::CompeticionesControllerTest < ActionController::TestCase test "should_see_configuration_page_of_every_competition" do u = User.find(1) sym_login 1 competitions = [] # Usamos random porque hay 361 combinaciones posibles de competiciones y testearlas todas ralentizaría la fase de testeo [League, Tournament, Ladder].each { |cls| competitions<< cls.find(:first, :conditions => 'state = 0', :order => 'RANDOM() ASC') } [League, Tournament, Ladder].each { |cls| competitions<< cls.find(:first, :conditions => 'state = 1', :order => 'RANDOM() ASC') } [League, Tournament, Ladder].each { |cls| competitions<< cls.find(:first, :conditions => 'state = 2', :order => 'RANDOM() ASC') } [League, Tournament, Ladder].each { |cls| competitions<< cls.find(:first, :conditions => 'state = 3', :order => 'RANDOM() ASC') } competitions.each do |c| c.add_admin(u) u.last_competition_id = c.id u.save get :configuracion assert_response :success end end test "update_tourney_groups" do # TODO end test "update_tourney_seeds" do # TODO end test "add_participants" do test_switch_active_competition # deshabilitamos esto porque a veces se añaden usuarios repetidos y casca # post :add_participants, { :participants_count => 1} assert_response :redirect end test "recreate_matches" do # TODO # test_switch_active_competition # get :recreate_matches # assert_response :redirect end test "index_with_enable_competition_indicator" do test_switch_active_competition assert User.find(1).update_attributes(:enable_competition_indicator => true) get :index assert_response :success end test "remove_all_participants" do test_switch_active_competition get :remove_all_participants assert_response :redirect end test "reselect_maps" do test_switch_active_competition get :reselect_maps assert_response :redirect end test "update_maches_games_maps" do # TODO end test "update_matches_play_on" do # TODO end test "previous_stage" do test_switch_active_competition get :previous_stage assert_response :redirect end test "general" do test_switch_active_competition get :general assert_response :success end test "avanzada" do # TODO end test "add_allowed_participant" do # TODO end test "configuracion" do test_switch_active_competition get :configuracion assert_response :success end test "admins" do test_switch_active_competition get :admins assert_response :success end test "partidas" do test_switch_active_competition get :partidas assert_response :success end test "participantes" do test_switch_active_competition get :participantes assert_response :success end test "eliminar_participante" do # TODO end test "crear_admin" do test_switch_active_competition post :crear_admin, :login => 'panzer' assert_response :redirect assert @c.user_is_admin(User.find_by_login('panzer').id) end test "eliminar_admin" do test_crear_admin post :eliminar_admin, :user_id => User.find_by_login('panzer').id assert_response :redirect assert [email protected]_is_admin(User.find_by_login('panzer').id) end test "crear_supervisor" do test_switch_active_competition post :crear_supervisor, :login => 'panzer' assert_response :redirect assert @c.user_is_supervisor(User.find_by_login('panzer').id) end test "eliminar_supervisor" do test_crear_supervisor post :eliminar_supervisor, :user_id => User.find_by_login('panzer').id assert_response :redirect assert [email protected]_is_supervisor(User.find_by_login('panzer').id) end test "cambiar" do sym_login 1 get :cambiar assert_response :success end test "mis_partidas" do # TODO end test "list" do sym_login 1 get :list assert_response :success end test "new" do sym_login 1 get :new assert_response :success end test "create" do sym_login 1 assert_count_increases(Competition) do post :create, :competition => { :type => 'Ladder', :name => 'mi ladder', :game_id => 1, :competitions_participants_type_id => 1, :competitions_types_options => {}, :timetable_options => {}} end @c = Competition.find(:first, :order => 'id desc') assert_equal @c.id, User.find(1).last_competition_id end test "update" do test_create post :update, { :id => @c.id, :competition => {:description => 'test_update'} } assert_response :redirect @c.reload assert_equal 'test_update', @c.description end test "destroy" do test_switch_active_competition post :destroy assert_response :redirect assert_nil User.find(1).last_competition_id assert_nil Competition.find_by_id(@c.id) end test "change_state" do # TODO end test "switch_active_competition" do @c = Competition.find(1) @c.add_admin(User.find(1)) @c.pro = true assert @c.save sym_login 1 post :switch_active_competition, :id => 1 assert_response :redirect assert_equal 1, User.find(1).last_competition_id end test "sponsors_should_work" do test_switch_active_competition get :sponsors assert_response :success end test "sponsors_new_should_work" do test_switch_active_competition get :sponsors_new assert_response :success end test "sponsors_create_should_work" do test_switch_active_competition assert_count_increases(CompetitionsSponsor) do post :sponsors_create, { :competitions_sponsor => { :name => 'el nombre', :image => fixture_file_upload('files/buddha.jpg', 'image/jpeg')}} end assert_response :redirect @fl = CompetitionsSponsor.find(:first, :order => 'id desc') end test "sponsors_edit_should_work" do test_sponsors_create_should_work get :sponsors_edit, :id => CompetitionsSponsor.find(:first, :order => 'id desc').id assert_response :success end test "sponsors_update_should_work" do test_sponsors_create_should_work assert_not_equal 'succubus', @fl.name post :sponsors_update, :id => @fl.id, :competitions_sponsor => {:name => 'dm-tower', :image => fixture_file_upload('files/babe.jpg', 'image/jpeg')} assert_response :redirect @fl.reload assert_equal 'dm-tower', @fl.name end test "sponsors_destroy" do test_sponsors_create_should_work assert_count_decreases(CompetitionsSponsor) do post :sponsors_destroy, :id => @fl.id end end end
gamersmafia/gamersmafia
test/functional/cuenta/competiciones_controller_test.rb
Ruby
bsd-3-clause
6,668
# This file is part of Metasm, the Ruby assembly manipulation suite # Copyright (C) 2006-2009 Yoann GUILLOT # # Licence is LGPL, see LICENCE in the top-level directory require 'metasm/main' require 'metasm/ia32' module Metasm # The x86_64, 64-bit extension of the x86 CPU (x64, em64t, amd64...) class X86_64 < Ia32 # SegReg, Farptr unchanged # no more floating point registers (use sse*) FpReg = nil # Simd extended to 16 regs, xmm only (mmx gone with 80387) class SimdReg < Ia32::SimdReg double_map 128 => (0..15).map { |n| "xmm#{n}" } end # general purpose registers, all sizes # 8 new gprs (r8..r15), set bit R in the REX prefix to reference them (or X/B if in ModRM) # aonethusaontehsanothe with 8bit subreg: with no rex prefix, refers to ah ch dh bh (as usual) # but whenever the prefix is present, those become unavailable and encodie spl..dil (low byte of rsp/rdi) class Reg < Ia32::Reg double_map 8 => %w{ al cl dl bl spl bpl sil dil r8b r9b r10b r11b r12b r13b r14b r15b ah ch dh bh}, 16 => %w{ ax cx dx bx sp bp si di r8w r9w r10w r11w r12w r13w r14w r15w}, 32 => %w{eax ecx edx ebx esp ebp esi edi r8d r9d r10d r11d r12d r13d r14d r15d eip}, 64 => %w{rax rcx rdx rbx rsp rbp rsi rdi r8 r9 r10 r11 r12 r13 r14 r15 rip} Sym = @i_to_s[64].map { |s| s.to_sym } # returns a symbolic representation of the register: # cx => :rcx & 0xffff # ah => (:rax >> 8) & 0xff # XXX in x64, 32bits operations are zero-extended to 64bits (eg mov rax, 0x1234_ffff_ffff ; add eax, 1 => rax == 0 def symbolic(di=nil) s = Sym[@val] s = di.next_addr if s == :rip and di if @sz == 8 and to_s[-1] == ?h Expression[[Sym[@val-16], :>>, 8], :&, 0xff] elsif @sz == 8 Expression[s, :&, 0xff] elsif @sz == 16 Expression[s, :&, 0xffff] elsif @sz == 32 Expression[s, :&, 0xffffffff] else s end end # checks if two registers have bits in common def share?(other) raise 'TODO' # XXX TODO wtf does formula this do ? other.val % (other.sz >> 1) == @val % (@sz >> 1) and (other.sz != @sz or @sz != 8 or other.val == @val) end # returns the part of @val to encode in an instruction field def val_enc if @sz == 8 and @val >= 16; @val-12 # ah, bh, ch, dh elsif @val >= 16 # rip else @val & 7 # others end end # returns the part of @val to encode in an instruction's rex prefix def val_rex if @sz == 8 and @val >= 16 # ah, bh, ch, dh: rex forbidden elsif @val >= 16 # rip else @val >> 3 # others end end end # ModRM represents indirections (eg dword ptr [eax+4*ebx+12h]) # 16bit mode unavailable in x64 # opcodes use 64bit addressing by default, use adsz override (67h) prefix to switch to 32 # immediate values are encoded as :i32 sign-extended to 64bits class ModRM < Ia32::ModRM # mod 0/1/2 m 4 => sib # mod 0 m 5 => rip+imm # sib: i 4 => no index, b 5 => no base end class DbgReg < Ia32::DbgReg simple_map((0..15).map { |i| [i, "dr#{i}"] }) end class CtrlReg < Ia32::CtrlReg simple_map((0..15).map { |i| [i, "cr#{i}"] }) end # Create a new instance of an X86 cpu # arguments (any order) # - instruction set (386, 486, sse2...) [latest] # - endianness [:little] def initialize(*a) super(:latest) @size = 64 a.delete @size @endianness = (a & [:big, :little]).first || :little a.delete @endianness @family = a.pop || :latest raise "Invalid arguments #{a.inspect}" if not a.empty? raise "Invalid X86_64 family #{@family.inspect}" if not respond_to?("init_#@family") end # defines some preprocessor macros to say who we are: # TODO def tune_prepro(pp) super(pp, :itsmeX64) # ask Ia32's to just call super() pp.define_weak('_M_AMD64') pp.define_weak('_M_X64') pp.define_weak('__amd64__') pp.define_weak('__x86_64__') end def str_to_reg(str) # X86_64::Reg != Ia32::Reg Reg.from_str(str) if Reg.s_to_i.has_key? str end def shortname "x64#{'_be' if @endianness == :big}" end end X64 = X86_64 AMD64 = X86_64 end
boboguessme/cold_grinder
node/lib/metasm/metasm/x86_64/main.rb
Ruby
bsd-3-clause
4,044
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains the computed version number. # This file is released into the public domain. Generated by # versioneer-0.19 (https://github.com/python-versioneer/python-versioneer) """Git implementation of _version.py.""" import errno import os import re import subprocess import sys def get_keywords(): """Get the keywords needed to look up the version information.""" # these strings will be replaced by git during git-archive. # setup.py/versioneer.py will grep for the variable names, so they must # each be defined on a line of their own. _version.py will just call # get_keywords(). git_refnames = "$Format:%d$" git_full = "$Format:%H$" git_date = "$Format:%ci$" keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} return keywords class VersioneerConfig: """Container for Versioneer configuration parameters.""" def get_config(): """Create, populate and return the VersioneerConfig() object.""" # these strings are filled in when 'setup.py versioneer' creates # _version.py cfg = VersioneerConfig() cfg.VCS = "git" cfg.style = "pep440" cfg.tag_prefix = "v" cfg.parentdir_prefix = "" cfg.versionfile_source = "jxl2txt/_version.py" cfg.verbose = False return cfg class NotThisMethod(Exception): """Exception raised if a method is not valid for the current scenario.""" LONG_VERSION_PY = {} HANDLERS = {} def register_vcs_handler(vcs, method): # decorator """Create decorator to mark a method as the handler of a VCS.""" def decorate(f): """Store f in HANDLERS[vcs][method].""" if vcs not in HANDLERS: HANDLERS[vcs] = {} HANDLERS[vcs][method] = f return f return decorate def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=None): """Call the given command(s).""" assert isinstance(commands, list) p = None for c in commands: try: dispcmd = str([c] + args) # remember shell=False, so use git.cmd on windows, not just git p = subprocess.Popen([c] + args, cwd=cwd, env=env, stdout=subprocess.PIPE, stderr=(subprocess.PIPE if hide_stderr else None)) break except EnvironmentError: e = sys.exc_info()[1] if e.errno == errno.ENOENT: continue if verbose: print("unable to run %s" % dispcmd) print(e) return None, None else: if verbose: print("unable to find command, tried %s" % (commands,)) return None, None stdout = p.communicate()[0].strip().decode() if p.returncode != 0: if verbose: print("unable to run %s (error)" % dispcmd) print("stdout was %s" % stdout) return None, p.returncode return stdout, p.returncode def versions_from_parentdir(parentdir_prefix, root, verbose): """Try to determine the version from the parent directory name. Source tarballs conventionally unpack into a directory that includes both the project name and a version string. We will also support searching up two directory levels for an appropriately named parent directory """ rootdirs = [] for i in range(3): dirname = os.path.basename(root) if dirname.startswith(parentdir_prefix): return {"version": dirname[len(parentdir_prefix):], "full-revisionid": None, "dirty": False, "error": None, "date": None} else: rootdirs.append(root) root = os.path.dirname(root) # up a level if verbose: print("Tried directories %s but none started with prefix %s" % (str(rootdirs), parentdir_prefix)) raise NotThisMethod("rootdir doesn't start with parentdir_prefix") @register_vcs_handler("git", "get_keywords") def git_get_keywords(versionfile_abs): """Extract version information from the given file.""" # the code embedded in _version.py can just fetch the value of these # keywords. When used from setup.py, we don't want to import _version.py, # so we do it with a regexp instead. This function is not used from # _version.py. keywords = {} try: f = open(versionfile_abs, "r") for line in f.readlines(): if line.strip().startswith("git_refnames ="): mo = re.search(r'=\s*"(.*)"', line) if mo: keywords["refnames"] = mo.group(1) if line.strip().startswith("git_full ="): mo = re.search(r'=\s*"(.*)"', line) if mo: keywords["full"] = mo.group(1) if line.strip().startswith("git_date ="): mo = re.search(r'=\s*"(.*)"', line) if mo: keywords["date"] = mo.group(1) f.close() except EnvironmentError: pass return keywords @register_vcs_handler("git", "keywords") def git_versions_from_keywords(keywords, tag_prefix, verbose): """Get version information from git keywords.""" if not keywords: raise NotThisMethod("no keywords at all, weird") date = keywords.get("date") if date is not None: # Use only the last line. Previous lines may contain GPG signature # information. date = date.splitlines()[-1] # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliant # datestamp. However we prefer "%ci" (which expands to an "ISO-8601 # -like" string, which we must then edit to make compliant), because # it's been around since git-1.5.3, and it's too difficult to # discover which version we're using, or to work around using an # older one. date = date.strip().replace(" ", "T", 1).replace(" ", "", 1) refnames = keywords["refnames"].strip() if refnames.startswith("$Format"): if verbose: print("keywords are unexpanded, not using") raise NotThisMethod("unexpanded keywords, not a git-archive tarball") refs = set([r.strip() for r in refnames.strip("()").split(",")]) # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of # just "foo-1.0". If we see a "tag: " prefix, prefer those. TAG = "tag: " tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)]) if not tags: # Either we're using git < 1.8.3, or there really are no tags. We use # a heuristic: assume all version tags have a digit. The old git %d # expansion behaves like git log --decorate=short and strips out the # refs/heads/ and refs/tags/ prefixes that would let us distinguish # between branches and tags. By ignoring refnames without digits, we # filter out many common branch names like "release" and # "stabilization", as well as "HEAD" and "master". tags = set([r for r in refs if re.search(r'\d', r)]) if verbose: print("discarding '%s', no digits" % ",".join(refs - tags)) if verbose: print("likely tags: %s" % ",".join(sorted(tags))) for ref in sorted(tags): # sorting will prefer e.g. "2.0" over "2.0rc1" if ref.startswith(tag_prefix): r = ref[len(tag_prefix):] if verbose: print("picking %s" % r) return {"version": r, "full-revisionid": keywords["full"].strip(), "dirty": False, "error": None, "date": date} # no suitable tags, so version is "0+unknown", but full hex is still there if verbose: print("no suitable tags, using unknown + full revision id") return {"version": "0+unknown", "full-revisionid": keywords["full"].strip(), "dirty": False, "error": "no suitable tags", "date": None} @register_vcs_handler("git", "pieces_from_vcs") def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): """Get version from 'git describe' in the root of the source tree. This only gets called if the git-archive 'subst' keywords were *not* expanded, and _version.py hasn't already been rewritten with a short version string, meaning we're inside a checked out source tree. """ GITS = ["git"] if sys.platform == "win32": GITS = ["git.cmd", "git.exe"] out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root, hide_stderr=True) if rc != 0: if verbose: print("Directory %s not under git control" % root) raise NotThisMethod("'git rev-parse --git-dir' returned error") # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty] # if there isn't one, this yields HEX[-dirty] (no NUM) describe_out, rc = run_command(GITS, ["describe", "--tags", "--dirty", "--always", "--long", "--match", "%s*" % tag_prefix], cwd=root) # --long was added in git-1.5.5 if describe_out is None: raise NotThisMethod("'git describe' failed") describe_out = describe_out.strip() full_out, rc = run_command(GITS, ["rev-parse", "HEAD"], cwd=root) if full_out is None: raise NotThisMethod("'git rev-parse' failed") full_out = full_out.strip() pieces = {} pieces["long"] = full_out pieces["short"] = full_out[:7] # maybe improved later pieces["error"] = None # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty] # TAG might have hyphens. git_describe = describe_out # look for -dirty suffix dirty = git_describe.endswith("-dirty") pieces["dirty"] = dirty if dirty: git_describe = git_describe[:git_describe.rindex("-dirty")] # now we have TAG-NUM-gHEX or HEX if "-" in git_describe: # TAG-NUM-gHEX mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe) if not mo: # unparseable. Maybe git-describe is misbehaving? pieces["error"] = ("unable to parse git-describe output: '%s'" % describe_out) return pieces # tag full_tag = mo.group(1) if not full_tag.startswith(tag_prefix): if verbose: fmt = "tag '%s' doesn't start with prefix '%s'" print(fmt % (full_tag, tag_prefix)) pieces["error"] = ("tag '%s' doesn't start with prefix '%s'" % (full_tag, tag_prefix)) return pieces pieces["closest-tag"] = full_tag[len(tag_prefix):] # distance: number of commits since tag pieces["distance"] = int(mo.group(2)) # commit: short hex revision ID pieces["short"] = mo.group(3) else: # HEX: no tags pieces["closest-tag"] = None count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"], cwd=root) pieces["distance"] = int(count_out) # total number of commits # commit date: see ISO-8601 comment in git_versions_from_keywords() date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"], cwd=root)[0].strip() # Use only the last line. Previous lines may contain GPG signature # information. date = date.splitlines()[-1] pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1) return pieces def plus_or_dot(pieces): """Return a + if we don't already have one, else return a .""" if "+" in pieces.get("closest-tag", ""): return "." return "+" def render_pep440(pieces): """Build up version string, with post-release "local version identifier". Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty Exceptions: 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty] """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"] or pieces["dirty"]: rendered += plus_or_dot(pieces) rendered += "%d.g%s" % (pieces["distance"], pieces["short"]) if pieces["dirty"]: rendered += ".dirty" else: # exception #1 rendered = "0+untagged.%d.g%s" % (pieces["distance"], pieces["short"]) if pieces["dirty"]: rendered += ".dirty" return rendered def render_pep440_pre(pieces): """TAG[.post0.devDISTANCE] -- No -dirty. Exceptions: 1: no tags. 0.post0.devDISTANCE """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"]: rendered += ".post0.dev%d" % pieces["distance"] else: # exception #1 rendered = "0.post0.dev%d" % pieces["distance"] return rendered def render_pep440_post(pieces): """TAG[.postDISTANCE[.dev0]+gHEX] . The ".dev0" means dirty. Note that .dev0 sorts backwards (a dirty tree will appear "older" than the corresponding clean one), but you shouldn't be releasing software with -dirty anyways. Exceptions: 1: no tags. 0.postDISTANCE[.dev0] """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"] or pieces["dirty"]: rendered += ".post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" rendered += plus_or_dot(pieces) rendered += "g%s" % pieces["short"] else: # exception #1 rendered = "0.post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" rendered += "+g%s" % pieces["short"] return rendered def render_pep440_old(pieces): """TAG[.postDISTANCE[.dev0]] . The ".dev0" means dirty. Exceptions: 1: no tags. 0.postDISTANCE[.dev0] """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"] or pieces["dirty"]: rendered += ".post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" else: # exception #1 rendered = "0.post%d" % pieces["distance"] if pieces["dirty"]: rendered += ".dev0" return rendered def render_git_describe(pieces): """TAG[-DISTANCE-gHEX][-dirty]. Like 'git describe --tags --dirty --always'. Exceptions: 1: no tags. HEX[-dirty] (note: no 'g' prefix) """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] if pieces["distance"]: rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) else: # exception #1 rendered = pieces["short"] if pieces["dirty"]: rendered += "-dirty" return rendered def render_git_describe_long(pieces): """TAG-DISTANCE-gHEX[-dirty]. Like 'git describe --tags --dirty --always -long'. The distance/hash is unconditional. Exceptions: 1: no tags. HEX[-dirty] (note: no 'g' prefix) """ if pieces["closest-tag"]: rendered = pieces["closest-tag"] rendered += "-%d-g%s" % (pieces["distance"], pieces["short"]) else: # exception #1 rendered = pieces["short"] if pieces["dirty"]: rendered += "-dirty" return rendered def render(pieces, style): """Render the given version pieces into the requested style.""" if pieces["error"]: return {"version": "unknown", "full-revisionid": pieces.get("long"), "dirty": None, "error": pieces["error"], "date": None} if not style or style == "default": style = "pep440" # the default if style == "pep440": rendered = render_pep440(pieces) elif style == "pep440-pre": rendered = render_pep440_pre(pieces) elif style == "pep440-post": rendered = render_pep440_post(pieces) elif style == "pep440-old": rendered = render_pep440_old(pieces) elif style == "git-describe": rendered = render_git_describe(pieces) elif style == "git-describe-long": rendered = render_git_describe_long(pieces) else: raise ValueError("unknown style '%s'" % style) return {"version": rendered, "full-revisionid": pieces["long"], "dirty": pieces["dirty"], "error": None, "date": pieces.get("date")} def get_versions(): """Get version information or return default if unable to do so.""" # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have # __file__, we can work backwards from there to the root. Some # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which # case we can only use expanded keywords. cfg = get_config() verbose = cfg.verbose try: return git_versions_from_keywords(get_keywords(), cfg.tag_prefix, verbose) except NotThisMethod: pass try: root = os.path.realpath(__file__) # versionfile_source is the relative path from the top of the source # tree (where the .git directory might live) to this file. Invert # this to find the root from __file__. for i in cfg.versionfile_source.split('/'): root = os.path.dirname(root) except NameError: return {"version": "0+unknown", "full-revisionid": None, "dirty": None, "error": "unable to find root of source tree", "date": None} try: pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose) return render(pieces, cfg.style) except NotThisMethod: pass try: if cfg.parentdir_prefix: return versions_from_parentdir(cfg.parentdir_prefix, root, verbose) except NotThisMethod: pass return {"version": "0+unknown", "full-revisionid": None, "dirty": None, "error": "unable to compute version", "date": None}
mrahnis/jxl2txt
jxl2txt/_version.py
Python
bsd-3-clause
18,658
<!-- %BD_HTML%/SearchResult.htm --> <HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=windows-1255"> <TITLE>úåöàú àéðèøðè - Takanot File</TITLE> </HEAD> <style> <!-- TR.A_Table {font-color:#3e6ea6; background-color: #f7f9fb; font-size:11;font-family: Arial,} TR.B_Table {font-color:#3e6ea6; background-color: #ecf1f6; font-size:11;font-family: Arial,} TR.C {font-color:#1e4a7a; background-color: #A9CAEF;font-weight:bold; font-size:11;font-family: Arial,} TR.clear { font-color:#1e4a7a; background-color: #FFFFFF;} H5 { font-family:Arial, Helvetica, sans-serif; font-size: 14px;} H3 { font-family:Arial, Helvetica, sans-serif; font-size: 16px;} TD.A_Row { font-family: Arial, Helvetica, sans-serif; font-weight:bold; font-style: normal; color: #093300; font-size: 10px} .defaultFont { color:#1f4a7b;font-family: Arial, Helvetica, sans-serif; font-size: 12px} --> </style> <BODY dir=rtl class="defaultFont"> <CENTER> <IMG src="/budget/Images/title1.jpg" align=bottom alt="ú÷öéá äîãéðä"> <TABLE align="center" border=0 cellspacing=0 cellpadding=0> <TR align="center"> <TD><H3>úåöàú çéôåù ìùðú 2006</H3></TD> </TR> <TR align="center"> <!--<TD><H3>ðúåðé áéöåò ðëåðéí ìñåó çåãù 04/2007</H3></TD>--> <TD><H3>ðúåðé áéöåò ëôé ùðøùîå áñôøé äðäìú äçùáåðåú ùì äîùøãéí - 04/2007<br></H3></TD> </TR> </TR align="center"> <TD><H3>àéï àçéãåú áéï äñòéôéí ìâáé îåòã òãëåï äðúåðéí</H3></TD> </TR> </TABLE> <H5>äñëåîéí äéðí ùì çå÷ äú÷öéá äî÷åøé åáàìôé ù÷ìéí <BR> </H5> </CENTER> <table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#8fbcee"> <TR class="C" align="center"> <TD valign=top width=50>ñòéó</TD> <TD valign=top align="right" width=120>ùí ñòéó</TD> <TD valign=top width=65>äåöàä ðèå</TD> <TD valign=top width=65>äåöàä îåúðéú áäëðñä</TD> <TD valign=top width=65>ñä"ë äåöàä</TD> <TD valign=top width=65>äøùàä ìäúçééá</TD> <TD valign=top width=65>ùéà ë"à</TD> <TD valign=top width=40>ñä"ë ðåöì</TD> <TD valign=top width=40>àçåæ ðåöì</TD> </TR> </TABLE> <table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#8fbcee"> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;06</TD> <TD valign=top align="right" width=120>&nbsp;îùøã äôðéí</TD> <TD valign=top width=65>&nbsp; 332,206</TD> <TD valign=top width=65>&nbsp; 45,823</TD> <TD valign=top width=65>&nbsp; 378,029</TD> <TD valign=top width=65>&nbsp; 107,616</TD> <TD valign=top width=65>&nbsp; 907.0</TD> <TD valign=top width=40>&nbsp; 410,283</TD> <TD valign=top width=40>&nbsp;108.53</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0601</TD> <TD valign=top align="right" width=120>&nbsp;úçåí ôòåìä ëììé</TD> <TD valign=top width=65>&nbsp; 87,342</TD> <TD valign=top width=65>&nbsp; 107</TD> <TD valign=top width=65>&nbsp; 87,449</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 170.0</TD> <TD valign=top width=40>&nbsp; 137,806</TD> <TD valign=top width=40>&nbsp;157.58</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060101</TD> <TD valign=top align="right" width=120>&nbsp;äðäìú äîùøã</TD> <TD valign=top width=65>&nbsp; 23,844</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 23,844</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 158.5</TD> <TD valign=top width=40>&nbsp; 25,826</TD> <TD valign=top width=40>&nbsp;108.31</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060102</TD> <TD valign=top align="right" width=120>&nbsp;äðäìú äîçåæåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 44</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060103</TD> <TD valign=top align="right" width=120>&nbsp;éòåõ îùôèé</TD> <TD valign=top width=65>&nbsp; 3,945</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 3,945</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 11.5</TD> <TD valign=top width=40>&nbsp; 3,836</TD> <TD valign=top width=40>&nbsp; 97.24</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060104</TD> <TD valign=top align="right" width=120>&nbsp;äãøëä àøâåï åùéèåú</TD> <TD valign=top width=65>&nbsp; 300</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 300</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 2,827</TD> <TD valign=top width=40>&nbsp;942.33</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060106</TD> <TD valign=top align="right" width=120>&nbsp;àîøëìåú</TD> <TD valign=top width=65>&nbsp; 53,391</TD> <TD valign=top width=65>&nbsp; 107</TD> <TD valign=top width=65>&nbsp; 53,498</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 99,786</TD> <TD valign=top width=40>&nbsp;186.52</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060108</TD> <TD valign=top align="right" width=120>&nbsp;îçùåá</TD> <TD valign=top width=65>&nbsp; 5,862</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 5,862</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 5,487</TD> <TD valign=top width=40>&nbsp; 93.60</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060110</TD> <TD valign=top align="right" width=120>&nbsp;îçùåá îéðäì äúëðåï</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0602</TD> <TD valign=top align="right" width=120>&nbsp;ô÷åç àøöé òì äáçéøåú</TD> <TD valign=top width=65>&nbsp; 29,382</TD> <TD valign=top width=65>&nbsp; 107</TD> <TD valign=top width=65>&nbsp; 29,489</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 2.0</TD> <TD valign=top width=40>&nbsp; 23,179</TD> <TD valign=top width=40>&nbsp; 78.60</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060201</TD> <TD valign=top align="right" width=120>&nbsp;ô÷åç àøöé òì äáçéøåú</TD> <TD valign=top width=65>&nbsp; 4,340</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 4,340</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 2.0</TD> <TD valign=top width=40>&nbsp; 16,427</TD> <TD valign=top width=40>&nbsp;378.50</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060203</TD> <TD valign=top align="right" width=120>&nbsp;áçéøåú ìîåòöåú àæåøéåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 107</TD> <TD valign=top width=65>&nbsp; 107</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060204</TD> <TD valign=top align="right" width=120>&nbsp;äåöàåú äáçéøåú ìøùåéåú</TD> <TD valign=top width=65>&nbsp; 15,200</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 15,200</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 1,222</TD> <TD valign=top width=40>&nbsp; 8.04</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060205</TD> <TD valign=top align="right" width=120>&nbsp;îéîåï îôìâåú øùåéåú î÷åîéåú</TD> <TD valign=top width=65>&nbsp; 9,842</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 9,842</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 5,530</TD> <TD valign=top width=40>&nbsp; 56.19</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;0603</TD> <TD valign=top align="right" width=120>&nbsp;ùìèåï î÷åîé</TD> <TD valign=top width=65>&nbsp; 7,884</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 7,884</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 48.5</TD> <TD valign=top width=40>&nbsp; 7,727</TD> <TD valign=top width=40>&nbsp; 98.01</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060301</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúéí îøëæééí</TD> <TD valign=top width=65>&nbsp; 7,884</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 7,884</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 48.5</TD> <TD valign=top width=40>&nbsp; 7,727</TD> <TD valign=top width=40>&nbsp; 98.01</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060302</TD> <TD valign=top align="right" width=120>&nbsp;àâó ùëø åë"à ìøùåî"÷</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060303</TD> <TD valign=top align="right" width=120>&nbsp;éçéãä ìçéåá àéùé</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060304</TD> <TD valign=top align="right" width=120>&nbsp;áé÷åøú áøùåéåú î÷åîéåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0604</TD> <TD valign=top align="right" width=120>&nbsp;îðäì äàåëìåñéï</TD> <TD valign=top width=65>&nbsp; 82,516</TD> <TD valign=top width=65>&nbsp; 9,897</TD> <TD valign=top width=65>&nbsp; 92,413</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 409.0</TD> <TD valign=top width=40>&nbsp; 101,664</TD> <TD valign=top width=40>&nbsp;110.01</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060401</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúéí îøëæééí áàâó</TD> <TD valign=top width=65>&nbsp; 18,115</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 18,115</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 94.5</TD> <TD valign=top width=40>&nbsp; 23,162</TD> <TD valign=top width=40>&nbsp;127.86</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060402</TD> <TD valign=top align="right" width=120>&nbsp;îçùåá îøùí äàåëìåñéï</TD> <TD valign=top width=65>&nbsp; 8,898</TD> <TD valign=top width=65>&nbsp; 3,544</TD> <TD valign=top width=65>&nbsp; 12,442</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 13,702</TD> <TD valign=top width=40>&nbsp;110.13</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060404</TD> <TD valign=top align="right" width=120>&nbsp;ìùëåú ìîðäì àåëìåñéï</TD> <TD valign=top width=65>&nbsp; 44,308</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 44,308</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 314.5</TD> <TD valign=top width=40>&nbsp; 48,351</TD> <TD valign=top width=40>&nbsp;109.12</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060405</TD> <TD valign=top align="right" width=120>&nbsp;áé÷åøú âáåìåú</TD> <TD valign=top width=65>&nbsp; 648</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 648</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060409</TD> <TD valign=top align="right" width=120>&nbsp;éçéãä ìèéôåì áòåáãéí æøéí</TD> <TD valign=top width=65>&nbsp; 190</TD> <TD valign=top width=65>&nbsp; 6,353</TD> <TD valign=top width=65>&nbsp; 6,543</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 7,839</TD> <TD valign=top width=40>&nbsp;119.81</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060410</TD> <TD valign=top align="right" width=120>&nbsp;éçéãú àëéôä òåáãéí æøéí</TD> <TD valign=top width=65>&nbsp; 10,357</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 10,357</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 8,611</TD> <TD valign=top width=40>&nbsp; 83.14</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;0605</TD> <TD valign=top align="right" width=120>&nbsp;úëðåï ôéæé</TD> <TD valign=top width=65>&nbsp; 53,640</TD> <TD valign=top width=65>&nbsp; 35,712</TD> <TD valign=top width=65>&nbsp; 89,352</TD> <TD valign=top width=65>&nbsp; 100,000</TD> <TD valign=top width=65>&nbsp; 81.5</TD> <TD valign=top width=40>&nbsp; 66,221</TD> <TD valign=top width=40>&nbsp; 74.11</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060501</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúéí îøëæééí áîéðäì äúëðåï</TD> <TD valign=top width=65>&nbsp; 20,189</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 20,189</TD> <TD valign=top width=65>&nbsp; 4,000</TD> <TD valign=top width=65>&nbsp; 81.5</TD> <TD valign=top width=40>&nbsp; 19,991</TD> <TD valign=top width=40>&nbsp; 99.02</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060504</TD> <TD valign=top align="right" width=120>&nbsp;úëðéåú îúàø</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 21,150</TD> <TD valign=top width=65>&nbsp; 21,150</TD> <TD valign=top width=65>&nbsp; 56,000</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 6,078</TD> <TD valign=top width=40>&nbsp; 28.74</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060506</TD> <TD valign=top align="right" width=120>&nbsp;âåó îúàí ìú÷ðåú äáðéä</TD> <TD valign=top width=65>&nbsp; 1,500</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 1,500</TD> <TD valign=top width=65>&nbsp; 2,250</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 378</TD> <TD valign=top width=40>&nbsp; 25.20</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060507</TD> <TD valign=top align="right" width=120>&nbsp;îãéðéåú åðäìé úëðåï</TD> <TD valign=top width=65>&nbsp; 400</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 400</TD> <TD valign=top width=65>&nbsp; 500</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 674</TD> <TD valign=top width=40>&nbsp;168.50</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060508</TD> <TD valign=top align="right" width=120>&nbsp;îò÷á á÷øä åúàåí úëðéåú</TD> <TD valign=top width=65>&nbsp; 700</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 700</TD> <TD valign=top width=65>&nbsp; 1,000</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 273</TD> <TD valign=top width=40>&nbsp; 39.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060509</TD> <TD valign=top align="right" width=120>&nbsp;äîåòöä äàøöéú ìúëðåï åáðéä</TD> <TD valign=top width=65>&nbsp; 25</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 25</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 10</TD> <TD valign=top width=40>&nbsp; 40.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060510</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúé úëðåï áîçåæåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 5,712</TD> <TD valign=top width=65>&nbsp; 5,712</TD> <TD valign=top width=65>&nbsp; 250</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 2,561</TD> <TD valign=top width=40>&nbsp; 44.84</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060511</TD> <TD valign=top align="right" width=120>&nbsp;îâæø òøáé ÷éãåí úåëðéåú</TD> <TD valign=top width=65>&nbsp; 25</TD> <TD valign=top width=65>&nbsp; 8,850</TD> <TD valign=top width=65>&nbsp; 8,875</TD> <TD valign=top width=65>&nbsp; 18,000</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 2,491</TD> <TD valign=top width=40>&nbsp; 28.07</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060512</TD> <TD valign=top align="right" width=120>&nbsp;åòãú úëðåï ìúùúéåú ìàåîéåú</TD> <TD valign=top width=65>&nbsp; 2,500</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 2,500</TD> <TD valign=top width=65>&nbsp; 1,000</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 5,141</TD> <TD valign=top width=40>&nbsp;205.64</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060513</TD> <TD valign=top align="right" width=120>&nbsp;åòãåú úëðåï îçåæéåú</TD> <TD valign=top width=65>&nbsp; 28,301</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 28,301</TD> <TD valign=top width=65>&nbsp; 17,000</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 28,625</TD> <TD valign=top width=40>&nbsp;101.14</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0606</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúé çéøåí åúô÷éãéí îéåçãéí</TD> <TD valign=top width=65>&nbsp; 173</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 173</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060601</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúéí îøëæééí</TD> <TD valign=top width=65>&nbsp; 4</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 4</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060602</TD> <TD valign=top align="right" width=120>&nbsp;øéùåé åôé÷åç</TD> <TD valign=top width=65>&nbsp; 35</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 35</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060604</TD> <TD valign=top align="right" width=120>&nbsp;øùåú ôñ"ç</TD> <TD valign=top width=65>&nbsp; 35</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 35</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060605</TD> <TD valign=top align="right" width=120>&nbsp;øéùåé îôòìéí áéèçåðééí</TD> <TD valign=top width=65>&nbsp; 99</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 99</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;0607</TD> <TD valign=top align="right" width=120>&nbsp;éçéãú øùí äòîåúåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060701</TD> <TD valign=top align="right" width=120>&nbsp;øùí äòîåúåú</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;0608</TD> <TD valign=top align="right" width=120>&nbsp;øæøáä</TD> <TD valign=top width=65>&nbsp; 5,134</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 5,134</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060801</TD> <TD valign=top align="right" width=120>&nbsp;øæøáä ìäúéé÷øåéåú</TD> <TD valign=top width=65>&nbsp; 5,134</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 5,134</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060802</TD> <TD valign=top align="right" width=120>&nbsp;øæøáä</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0609</TD> <TD valign=top align="right" width=120>&nbsp;éçéãú äôé÷åç</TD> <TD valign=top width=65>&nbsp; 13,174</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 13,174</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 12.0</TD> <TD valign=top width=40>&nbsp; 14,609</TD> <TD valign=top width=40>&nbsp;110.89</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;060901</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúéí îøëæéí</TD> <TD valign=top width=65>&nbsp; 12,596</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 12,596</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 12.0</TD> <TD valign=top width=40>&nbsp; 11,777</TD> <TD valign=top width=40>&nbsp; 93.50</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;060902</TD> <TD valign=top align="right" width=120>&nbsp;úôòåì åàçæ÷ä</TD> <TD valign=top width=65>&nbsp; 578</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 578</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 2,833</TD> <TD valign=top width=40>&nbsp;490.14</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;0610</TD> <TD valign=top align="right" width=120>&nbsp;ðöéáåú ëáàåú åäöìä</TD> <TD valign=top width=65>&nbsp; 6,933</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 6,933</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 27.0</TD> <TD valign=top width=40>&nbsp; 18,194</TD> <TD valign=top width=40>&nbsp;262.43</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;061002</TD> <TD valign=top align="right" width=120>&nbsp;ú÷öéá ðöéáåú ëáàåú åäöìä</TD> <TD valign=top width=65>&nbsp; 6,933</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 6,933</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 27.0</TD> <TD valign=top width=40>&nbsp; 17,650</TD> <TD valign=top width=40>&nbsp;254.58</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;061003</TD> <TD valign=top align="right" width=120>&nbsp;ú÷öéá îëììä ìëáàåú åäöìä</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 544</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0611</TD> <TD valign=top align="right" width=120>&nbsp;îéðäì äîéí</TD> <TD valign=top width=65>&nbsp; 3,774</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 3,774</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 3,312</TD> <TD valign=top width=40>&nbsp; 87.76</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;061104</TD> <TD valign=top align="right" width=120>&nbsp;ëç àãí åôòåìåú</TD> <TD valign=top width=65>&nbsp; 3,774</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 3,774</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 3,312</TD> <TD valign=top width=40>&nbsp; 87.76</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0614</TD> <TD valign=top align="right" width=120>&nbsp;äîîåðä òì äúàâéãéí</TD> <TD valign=top width=65>&nbsp; 2,164</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 2,164</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 1.0</TD> <TD valign=top width=40>&nbsp; 1,406</TD> <TD valign=top width=40>&nbsp; 64.97</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;061401</TD> <TD valign=top align="right" width=120>&nbsp;äîîåðä òì äúàâéãéí</TD> <TD valign=top width=65>&nbsp; 2,164</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 2,164</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 1.0</TD> <TD valign=top width=40>&nbsp; 1,406</TD> <TD valign=top width=40>&nbsp; 64.97</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;0615</TD> <TD valign=top align="right" width=120>&nbsp;úôòåì ùéøåúé ãú</TD> <TD valign=top width=65>&nbsp; 40,090</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 40,090</TD> <TD valign=top width=65>&nbsp; 7,616</TD> <TD valign=top width=65>&nbsp; 156.0</TD> <TD valign=top width=40>&nbsp; 36,164</TD> <TD valign=top width=40>&nbsp; 90.21</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;061501</TD> <TD valign=top align="right" width=120>&nbsp;ùéøåúé ãú ìòãåú ìà éäåãéåú</TD> <TD valign=top width=65>&nbsp; 29,644</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 29,644</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 156.0</TD> <TD valign=top width=40>&nbsp; 28,300</TD> <TD valign=top width=40>&nbsp; 95.47</TD> </TR> <TR class="A_Table" align="center"> <TD valign=top width=50>&nbsp;061502</TD> <TD valign=top align="right" width=120>&nbsp;øæøáä ìäúéé÷øåéåú- ùéøåúé ãú</TD> <TD valign=top width=65>&nbsp; 1,039</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 1,039</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 0</TD> <TD valign=top width=40>&nbsp; 0.00</TD> </TR> <TR class="B_Table" align="center"> <TD valign=top width=50>&nbsp;061503</TD> <TD valign=top align="right" width=120>&nbsp;îáðé ãú ìà éäåãééí</TD> <TD valign=top width=65>&nbsp; 9,407</TD> <TD valign=top width=65>&nbsp; 0</TD> <TD valign=top width=65>&nbsp; 9,407</TD> <TD valign=top width=65>&nbsp; 7,616</TD> <TD valign=top width=65>&nbsp; 0.0</TD> <TD valign=top width=40>&nbsp; 7,864</TD> <TD valign=top width=40>&nbsp; 83.60</TD> </TR> </TABLE> </CENTER> <BR> <CENTER> <table border="0" cellspacing="1" cellpadding="3" bgcolor="#8fbcee" dir="rtl"> <TR class="C" align="center"> <TD class="A_Row" valign=top width=80>ñéëåí ãå"ç</TD> <TD class="A_Row" valign=top width=60>äåöàä ðèå</TD> <TD class="A_Row" valign=top width=60>äåöàä îåúðéú áäëðñä</TD> <TD class="A_Row" valign=top width=60>ñä"ë äåöàä</TD> <TD class="A_Row" valign=top width=60>äøùàä ìäúçééá</TD> <TD class="A_Row" valign=top width=60>ùéà ë"à</TD> <TD class="A_Row" valign=top width=50>ñä"ë ðåöì</TD> <TD class="A_Row" valign=top width=50>àçåæ ðåöì</TD> </TR> <TR class="clear" align="center"> <TD class="A_Row" valign=top width=80>&nbsp;ú÷öéá î÷åøé</TD> <TD class="A_Row" valign=top width=60>&nbsp; 332,206</TD> <TD class="A_Row" valign=top width=60>&nbsp; 45,823</TD> <TD class="A_Row" valign=top width=60>&nbsp; 378,029</TD> <TD class="A_Row" valign=top width=60>&nbsp; 107,616</TD> <TD class="A_Row" valign=top width=60>&nbsp; 910</TD> <TD class="A_Row" valign=top width=50>&nbsp;</TD> <TD class="A_Row" valign=top width=50>&nbsp;</TD> </TR> <!--<TR class="clear" align="center"> <TD class="A_Row" valign=top width=80>&nbsp;ú÷öéá òì ùéðåééå</TD> <TD class="A_Row" valign=top width=60>&nbsp; 536,004</TD> <TD class="A_Row" valign=top width=60>&nbsp; 50,096</TD> <TD class="A_Row" valign=top width=60>&nbsp; 586,100</TD> <TD class="A_Row" valign=top width=60>&nbsp; 107,616</TD> <TD class="A_Row" valign=top width=60>&nbsp; 912</TD> <TD class="A_Row" valign=top width=50>&nbsp; 410,285</TD> <TD class="A_Row" valign=top width=50>&nbsp;108.53</TD> </TR>--> </TABLE> <CENTER> <TABLE WIDTH="100" > <TR> <TD align="center" nowrap> <IMG SRC="/budget/Images/semel.gif" HEIGHT=37 WIDTH=30 border = "0"><BR> <FONT SIZE=-2> <A HREF="http://www.mof.gov.il/rights.htm"> ëì äæëåéåú &copy; .ùîåøåú,2005,îãéðú éùøàì<BR></A> ðùîç ì÷áì àú äòøåúéëí åäöòåúéëí ìëúåáú: </FONT> <FONT SIZE=-2 dir=ltr> <A HREF="mailto:[email protected]">[email protected]</A><BR> </FONT> </TD> </TR> </TABLE> </CENTER> </CENTER> </BODY> </HTML>
daonb/obudget
data/queries/results/result-2006-06.html
HTML
bsd-3-clause
41,078
<?php /** * RSSAggregatingPage lets a CMS Authors aggregate and filter a number of RSS feed. */ class RSSAggregatingPage extends Page { static $db = array ( "NumberOfItems" => "Int" ); static $has_many = array( "SourceFeeds" => "RSSAggSource", "Entries" => "RSSAggEntry" ); private static $moderation_required = false; function getCMSFields() { $fields = parent::getCMSFields(); if(!isset($_REQUEST['executeForm'])) $this->updateRSS(); $fields->addFieldToTab("Root.Content.Sources", new TableField("SourceFeeds", "RSSAggSource", array( "RSSFeed" => "RSS Feed URL", "Title" => "Feed Title" ), array( "RSSFeed" => "TextField", "Title" => "ReadonlyField", ), "PageID", round($this->ID), true, "RSSFeed" )); global $number_of_items_list; // Insert Items as the first tab $fields->addFieldToTab("Root.Content", new Tab("Items"), "Main"); if ( !self::get_moderation_required() ) { $fields->addFieldToTab("Root.Content.Items", new DropdownField('NumberOfItems','Number Of Items', $number_of_items_list)); } $fields->addFieldToTab("Root.Content.Items", $entries = new TableField("Entries", "RSSAggEntry", array( "Displayed" => "Show", "DateNice" => "Date", "SourceNice" => "Source", "Title" => "Title", ), array( "Displayed" => "CheckboxField", "DateNice" => "ReadonlyField", "SourceNice" => "ReadonlyField", "Title" => "ReadonlyField", ), "PageID", round($this->ID), true, "Date DESC" )); $entries->setPermissions(array("edit")); return $fields; } /** * Use SimplePie to get all the RSS feeds and agregate them into Entries */ function updateRSS() { require_once(Director::baseFolder() . '/rssaggregator/thirdparty/simplepie/simplepie.inc'); if(!is_numeric($this->ID)) return; $goodSourceIDs = array(); foreach($this->SourceFeeds() as $sourceFeed) { $goodSourceIDs[] = $sourceFeed->ID; if(isset($_REQUEST['flush']) || strtotime($sourceFeed->LastChecked) < time() - 3600) { $simplePie = new SimplePie($sourceFeed->RSSFeed); /*$simplePie->enable_caching(false); $simplePie->enable_xmldump(true);*/ $simplePie->init(); $sourceFeed->Title = $simplePie->get_title(); $sourceFeed->LastChecked = date('Y-m-d H:i:s'); $sourceFeed->write(); $idClause = ''; $goodIDs = array(); $items = $simplePie->get_items(); //if(!$items) user_error("RSS Error: $simplePie->error", E_USER_WARNING); if($items) foreach($items as $item) { $entry = new RSSAggEntry(); $entry->Permalink = $item->get_permalink(); $entry->Date = $item->get_date('Y-m-d H:i:s'); $entry->Title = Convert::xml2raw($item->get_title()); $entry->Title = str_replace(array( '&nbsp;', '&lsquo;', '&rsquo;', '&ldquo;', '&rdquo;', '&amp;', '&apos;' ), array( '&#160;', "'", "'", '"', '"', '&', '`' ), $entry->Title); $entry->Content = str_replace(array( '&nbsp;', '&lsquo;', '&rsquo;', '&ldquo;', '&rdquo;', '&amp;', '&apos;' ), array( '&#160;', "'", "'", '"', '"', '&', '`' ), $item->get_description()); $entry->PageID = $this->ID; $entry->SourceID = $sourceFeed->ID; if($enclosure = $item->get_enclosure()) { $entry->EnclosureURL = $enclosure->get_link(); } $SQL_permalink = Convert::raw2sql($entry->Permalink); $existingID = DB::query("SELECT \"ID\" FROM \"RSSAggEntry\" WHERE \"Permalink\" = '$SQL_permalink' AND \"SourceID\" = $entry->SourceID AND \"PageID\" = $entry->PageID")->value(); if($existingID) $entry->ID = $existingID; $entry->write(); $goodIDs[] = $entry->ID; } if($goodIDs) { $list_goodIDs = implode(', ', $goodIDs); $idClause = "AND \"ID\" NOT IN ($list_goodIDs)"; } DB::query("DELETE FROM \"RSSAggEntry\" WHERE \"SourceID\" = $sourceFeed->ID AND \"PageID\" = $this->ID $idClause"); } } if($goodSourceIDs) { $list_goodSourceIDs = implode(', ', $goodSourceIDs); $sourceIDClause = " AND \"SourceID\" NOT IN ($list_goodSourceIDs)"; } else { $sourceIDClause = ''; } DB::query("DELETE FROM \"RSSAggEntry\" WHERE \"PageID\" = $this->ID $sourceIDClause"); } function Children() { $this->updateRSS(); // Tack the RSS feed children to the end of the children provided by the RSS feed $c1 = DataObject::get("SiteTree", "\"ParentID\" = '$this->ID'"); $c2 = DataObject::get("RSSAggEntry", "\"PageID\" = $this->ID AND \"Displayed\" = 1", "\"Date\" ASC"); if($c1) { if($c2) $c1->merge($c2); return $c1; } else { return $c2; } } /* * Set moderation mode * On (true) admin manually controls which items to display * Off (false) new imported feed item is set to display automatically * @param boolean */ static function set_moderation_required($required) { self::$moderation_required = $required; } /* * Get feed moderation mode * @return boolean */ static function get_moderation_required() { return self::$moderation_required; } } class RSSAggregatingPage_Controller extends Page_Controller { } ?>
sminnee/silverstripe-rssaggregator
code/RSSAggregatingPage.php
PHP
bsd-3-clause
5,295
from . import Cl, conformalize layout_orig, blades_orig = Cl(3) layout, blades, stuff = conformalize(layout_orig) locals().update(blades) locals().update(stuff) # for shorter reprs layout.__name__ = 'layout' layout.__module__ = __name__
arsenovic/clifford
clifford/g3c.py
Python
bsd-3-clause
240
using System; using Renci.SshNet.Messages.Connection; namespace Renci.SshNet.Channels { internal abstract class ServerChannel : Channel { internal void Initialize(Session session, uint localWindowSize, uint localPacketSize, uint remoteChannelNumber, uint remoteWindowSize, uint remotePacketSize) { Initialize(session, localWindowSize, localPacketSize); InitializeRemoteInfo(remoteChannelNumber, remoteWindowSize, remotePacketSize); //Session.ChannelOpenReceived += OnChannelOpen; } //private void OnChannelOpen(object sender, MessageEventArgs<ChannelOpenMessage> e) //{ // var channelOpenMessage = e.Message; // if (channelOpenMessage.LocalChannelNumber == LocalChannelNumber) // { // _remoteChannelNumber = channelOpenMessage.LocalChannelNumber; // RemoteWindowSize = channelOpenMessage.InitialWindowSize; // _remotePacketSize = channelOpenMessage.MaximumPacketSize; // OnOpen(e.Message.Info); // } //} protected void SendMessage(ChannelOpenConfirmationMessage message) { // No need to check whether channel is open when trying to open a channel Session.SendMessage(message); // When we act as server, consider the channel open when we've sent the // confirmation message to the peer IsOpen = true; } ///// <summary> ///// Called when channel need to be open on the client. ///// </summary> ///// <param name="info">Channel open information.</param> //protected virtual void OnOpen(ChannelOpenInfo info) //{ //} protected override void Dispose(bool disposing) { if (disposing) { var session = Session; if (session != null) { //session.ChannelOpenReceived -= OnChannelOpen; } } base.Dispose(disposing); } } }
EddyBeaupre/Renci.SshNet
Channels/ServerChannel.cs
C#
bsd-3-clause
2,118
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>mne.find_events &#8212; MNE 0.15 documentation</title> <link rel="stylesheet" href="../_static/bootstrap-sphinx.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../_static/gallery.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../', VERSION: '0.15', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt' }; </script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> <script type="text/javascript" src="../_static/js/jquery-1.11.0.min.js"></script> <script type="text/javascript" src="../_static/js/jquery-fix.js"></script> <script type="text/javascript" src="../_static/bootstrap-3.3.7/js/bootstrap.min.js"></script> <script type="text/javascript" src="../_static/bootstrap-sphinx.js"></script> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <script type="text/javascript" src="../_static/copybutton.js"></script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-37225609-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <link rel="stylesheet" href="../_static/style.css " type="text/css" /> <link rel="stylesheet" href="../_static/font-awesome.css" type="text/css" /> <link rel="stylesheet" href="../_static/flag-icon.css" type="text/css" /> <script type="text/javascript"> !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s); js.id=id;js.src="https://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); </script> <script type="text/javascript"> (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); </script> <link rel="canonical" href="https://mne.tools/stable/index.html" /> </head> <body> <div id="navbar" class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <!-- .btn-navbar is used as the toggle for collapsed navbar content --> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../index.html"><span><img src="../_static/mne_logo_small.png"></span> </a> <span class="navbar-text navbar-version pull-left"><b>0.15</b></span> </div> <div class="collapse navbar-collapse nav-collapse"> <ul class="nav navbar-nav"> <li><a href="../getting_started.html">Install</a></li> <li><a href="../documentation.html">Documentation</a></li> <li><a href="../python_reference.html">API</a></li> <li><a href="../auto_examples/index.html">Examples</a></li> <li><a href="../contributing.html">Contribute</a></li> <li class="dropdown globaltoc-container"> <a role="button" id="dLabelGlobalToc" data-toggle="dropdown" data-target="#" href="../index.html">Site <b class="caret"></b></a> <ul class="dropdown-menu globaltoc" role="menu" aria-labelledby="dLabelGlobalToc"></ul> </li> <li class="hidden-sm"></li> </ul> <div class="navbar-form navbar-right navbar-btn dropdown btn-group-sm" style="margin-left: 20px; margin-top: 5px; margin-bottom: 5px"> <button type="button" class="btn btn-primary navbar-btn dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown"> v0.15 <span class="caret"></span> </button> <ul class="dropdown-menu" aria-labelledby="dropdownMenu1"> <li><a href="https://mne-tools.github.io/dev/index.html">Development</a></li> <li><a href="https://mne-tools.github.io/stable/index.html">v0.15 (stable)</a></li> <li><a href="https://mne-tools.github.io/0.14/index.html">v0.14</a></li> <li><a href="https://mne-tools.github.io/0.13/index.html">v0.13</a></li> <li><a href="https://mne-tools.github.io/0.12/index.html">v0.12</a></li> <li><a href="https://mne-tools.github.io/0.11/index.html">v0.11</a></li> </ul> </div> <form class="navbar-form navbar-right" action="../search.html" method="get"> <div class="form-group"> <input type="text" name="q" class="form-control" placeholder="Search" /> </div> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> </div> <div class="container"> <div class="row"> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <p class="logo"><a href="../index.html"> <img class="logo" src="../_static/mne_logo_small.png" alt="Logo"/> </a></p><ul> <li><a class="reference internal" href="#">mne.find_events</a><ul> <li><a class="reference internal" href="#examples-using-mne-find-events">Examples using <code class="docutils literal"><span class="pre">mne.find_events</span></code></a></li> </ul> </li> </ul> <form action="../search.html" method="get"> <div class="form-group"> <input type="text" name="q" class="form-control" placeholder="Search" /> </div> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> </div> <div class="col-md-12 content"> <div class="section" id="mne-find-events"> <h1>mne.find_events<a class="headerlink" href="#mne-find-events" title="Permalink to this headline">¶</a></h1> <dl class="function"> <dt id="mne.find_events"> <code class="descclassname">mne.</code><code class="descname">find_events</code><span class="sig-paren">(</span><em>raw</em>, <em>stim_channel=None</em>, <em>output='onset'</em>, <em>consecutive='increasing'</em>, <em>min_duration=0</em>, <em>shortest_event=2</em>, <em>mask=None</em>, <em>uint_cast=False</em>, <em>mask_type=None</em>, <em>verbose=None</em><span class="sig-paren">)</span><a class="reference external" href="http://github.com/mne-tools/mne-python/blob/maint/0.15/mne/event.py"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#mne.find_events" title="Permalink to this definition">¶</a></dt> <dd><p>Find events from raw file.</p> <p>See <a class="reference internal" href="../auto_tutorials/plot_epoching_and_averaging.html#tut-epoching-and-averaging"><span class="std std-ref">Epoching and averaging (ERP/ERF)</span></a> as well as <a class="reference internal" href="../auto_examples/io/plot_read_events.html#ex-read-events"><span class="std std-ref">Reading an event file</span></a> for more information about events.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>raw</strong> : Raw object</p> <blockquote> <div><p>The raw data.</p> </div></blockquote> <p><strong>stim_channel</strong> : None | string | list of string</p> <blockquote> <div><p>Name of the stim channel or all the stim channels affected by triggers. If None, the config variables ‘MNE_STIM_CHANNEL’, ‘MNE_STIM_CHANNEL_1’, ‘MNE_STIM_CHANNEL_2’, etc. are read. If these are not found, it will fall back to ‘STI 014’ if present, then fall back to the first channel of type ‘stim’, if present. If multiple channels are provided then the returned events are the union of all the events extracted from individual stim channels.</p> </div></blockquote> <p><strong>output</strong> : ‘onset’ | ‘offset’ | ‘step’</p> <blockquote> <div><p>Whether to report when events start, when events end, or both.</p> </div></blockquote> <p><strong>consecutive</strong> : bool | ‘increasing’</p> <blockquote> <div><p>If True, consider instances where the value of the events channel changes without first returning to zero as multiple events. If False, report only instances where the value of the events channel changes from/to zero. If ‘increasing’, report adjacent events only when the second event code is greater than the first.</p> </div></blockquote> <p><strong>min_duration</strong> : float</p> <blockquote> <div><p>The minimum duration of a change in the events channel required to consider it as an event (in seconds).</p> </div></blockquote> <p><strong>shortest_event</strong> : int</p> <blockquote> <div><p>Minimum number of samples an event must last (default is 2). If the duration is less than this an exception will be raised.</p> </div></blockquote> <p><strong>mask</strong> : int | None</p> <blockquote> <div><p>The value of the digital mask to apply to the stim channel values. If None (default), no masking is performed.</p> </div></blockquote> <p><strong>uint_cast</strong> : bool</p> <blockquote> <div><p>If True (default False), do a cast to <code class="docutils literal"><span class="pre">uint16</span></code> on the channel data. This can be used to fix a bug with STI101 and STI014 in Neuromag acquisition setups that use channel STI016 (channel 16 turns data into e.g. -32768), similar to <code class="docutils literal"><span class="pre">mne_fix_stim14</span> <span class="pre">--32</span></code> in MNE-C.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 0.12.</span></p> </div> </div></blockquote> <p><strong>mask_type: ‘and’ | ‘not_and’</strong></p> <blockquote> <div><p>The type of operation between the mask and the trigger. Choose ‘and’ for MNE-C masking behavior. The default (‘not_and’) will change to ‘and’ in 0.16.</p> <div class="versionadded"> <p><span class="versionmodified">New in version 0.13.</span></p> </div> </div></blockquote> <p><strong>verbose</strong> : bool, str, int, or None</p> <blockquote> <div><p>If not None, override default verbose level (see <a class="reference internal" href="mne.verbose.html#mne.verbose" title="mne.verbose"><code class="xref py py-func docutils literal"><span class="pre">mne.verbose()</span></code></a> and <a class="reference internal" href="../auto_tutorials/plot_configuration.html#tut-logging"><span class="std std-ref">Logging documentation</span></a> for more).</p> </div></blockquote> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>events</strong> : array, shape = (n_events, 3)</p> <blockquote class="last"> <div><p>All events that were found. The first column contains the event time in samples and the third column contains the event id. For output = ‘onset’ or ‘step’, the second column contains the value of the stim channel immediately before the event/step. For output = ‘offset’, the second column contains the value of the stim channel after the event offset.</p> </div></blockquote> </td> </tr> </tbody> </table> <div class="admonition seealso"> <p class="first admonition-title">See also</p> <dl class="last docutils"> <dt><a class="reference internal" href="mne.find_stim_steps.html#mne.find_stim_steps" title="mne.find_stim_steps"><code class="xref py py-obj docutils literal"><span class="pre">find_stim_steps</span></code></a></dt> <dd>Find all the steps in the stim channel.</dd> <dt><a class="reference internal" href="mne.read_events.html#mne.read_events" title="mne.read_events"><code class="xref py py-obj docutils literal"><span class="pre">read_events</span></code></a></dt> <dd>Read events from disk.</dd> <dt><a class="reference internal" href="mne.write_events.html#mne.write_events" title="mne.write_events"><code class="xref py py-obj docutils literal"><span class="pre">write_events</span></code></a></dt> <dd>Write events to disk.</dd> </dl> </div> <p class="rubric">Notes</p> <div class="admonition warning"> <p class="first admonition-title">Warning</p> <p class="last">If you are working with downsampled data, events computed before decimation are no longer valid. Please recompute your events after decimation, but note this reduces the precision of event timing.</p> </div> <p class="rubric">Examples</p> <p>Consider data with a stim channel that looks like:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">32</span><span class="p">,</span> <span class="mi">32</span><span class="p">,</span> <span class="mi">33</span><span class="p">,</span> <span class="mi">32</span><span class="p">,</span> <span class="mi">0</span><span class="p">]</span> </pre></div> </div> <p>By default, find_events returns all samples at which the value of the stim channel increases:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">find_events</span><span class="p">(</span><span class="n">raw</span><span class="p">))</span> <span class="go">[[ 1 0 32]</span> <span class="go"> [ 3 32 33]]</span> </pre></div> </div> <p>If consecutive is False, find_events only returns the samples at which the stim channel changes from zero to a non-zero value:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">find_events</span><span class="p">(</span><span class="n">raw</span><span class="p">,</span> <span class="n">consecutive</span><span class="o">=</span><span class="kc">False</span><span class="p">))</span> <span class="go">[[ 1 0 32]]</span> </pre></div> </div> <p>If consecutive is True, find_events returns samples at which the event changes, regardless of whether it first returns to zero:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">find_events</span><span class="p">(</span><span class="n">raw</span><span class="p">,</span> <span class="n">consecutive</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span> <span class="go">[[ 1 0 32]</span> <span class="go"> [ 3 32 33]</span> <span class="go"> [ 4 33 32]]</span> </pre></div> </div> <p>If output is ‘offset’, find_events returns the last sample of each event instead of the first one:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">find_events</span><span class="p">(</span><span class="n">raw</span><span class="p">,</span> <span class="n">consecutive</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="gp">... </span> <span class="n">output</span><span class="o">=</span><span class="s1">&#39;offset&#39;</span><span class="p">))</span> <span class="go">[[ 2 33 32]</span> <span class="go"> [ 3 32 33]</span> <span class="go"> [ 4 0 32]]</span> </pre></div> </div> <p>If output is ‘step’, find_events returns the samples at which an event starts or ends:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">find_events</span><span class="p">(</span><span class="n">raw</span><span class="p">,</span> <span class="n">consecutive</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="gp">... </span> <span class="n">output</span><span class="o">=</span><span class="s1">&#39;step&#39;</span><span class="p">))</span> <span class="go">[[ 1 0 32]</span> <span class="go"> [ 3 32 33]</span> <span class="go"> [ 4 33 32]</span> <span class="go"> [ 5 32 0]]</span> </pre></div> </div> <p>To ignore spurious events, it is also possible to specify a minimum event duration. Assuming our events channel has a sample rate of 1000 Hz:</p> <div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">find_events</span><span class="p">(</span><span class="n">raw</span><span class="p">,</span> <span class="n">consecutive</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="gp">... </span> <span class="n">min_duration</span><span class="o">=</span><span class="mf">0.002</span><span class="p">))</span> <span class="go">[[ 1 0 32]]</span> </pre></div> </div> <p>For the digital mask, if mask_type is set to ‘and’ it will take the binary representation of the digital mask, e.g. 5 -&gt; ‘00000101’, and will allow the values to pass where mask is one, e.g.:</p> <div class="highlight-default"><div class="highlight"><pre><span></span> <span class="mi">7</span> <span class="s1">&#39;0000111&#39;</span> <span class="o">&lt;-</span> <span class="n">trigger</span> <span class="n">value</span> <span class="mi">37</span> <span class="s1">&#39;0100101&#39;</span> <span class="o">&lt;-</span> <span class="n">mask</span> <span class="o">----------------</span> <span class="mi">5</span> <span class="s1">&#39;0000101&#39;</span> </pre></div> </div> <p>For the digital mask, if mask_type is set to ‘not_and’ it will take the binary representation of the digital mask, e.g. 5 -&gt; ‘00000101’, and will block the values where mask is one, e.g.:</p> <div class="highlight-default"><div class="highlight"><pre><span></span> <span class="mi">7</span> <span class="s1">&#39;0000111&#39;</span> <span class="o">&lt;-</span> <span class="n">trigger</span> <span class="n">value</span> <span class="mi">37</span> <span class="s1">&#39;0100101&#39;</span> <span class="o">&lt;-</span> <span class="n">mask</span> <span class="o">----------------</span> <span class="mi">2</span> <span class="s1">&#39;0000010&#39;</span> </pre></div> </div> </dd></dl> <div class="section" id="examples-using-mne-find-events"> <h2>Examples using <code class="docutils literal"><span class="pre">mne.find_events</span></code><a class="headerlink" href="#examples-using-mne-find-events" title="Permalink to this headline">¶</a></h2> <div class="sphx-glr-thumbcontainer" tooltip="The MEGSIM consists of experimental and simulated MEG data which can be useful for reproducing ..."><div class="figure" id="id1"> <img alt="../_images/sphx_glr_plot_megsim_data_thumb.png" src="../_images/sphx_glr_plot_megsim_data_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/datasets/plot_megsim_data.html#sphx-glr-auto-examples-datasets-plot-megsim-data-py"><span class="std std-ref">MEGSIM experimental and simulation datasets</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Here we compute the evoked from raw for the Brainstorm tutorial dataset. For comparison, see [1..."><div class="figure" id="id2"> <img alt="../_images/sphx_glr_plot_brainstorm_data_thumb.png" src="../_images/sphx_glr_plot_brainstorm_data_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/datasets/plot_brainstorm_data.html#sphx-glr-auto-examples-datasets-plot-brainstorm-data-py"><span class="std std-ref">Brainstorm tutorial datasets</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Runs a full pipeline using MNE-Python:"><div class="figure" id="id3"> <img alt="../_images/sphx_glr_plot_spm_faces_dataset_thumb.png" src="../_images/sphx_glr_plot_spm_faces_dataset_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/datasets/plot_spm_faces_dataset.html#sphx-glr-auto-examples-datasets-plot-spm-faces-dataset-py"><span class="std std-ref">From raw data to dSPM on SPM Faces dataset</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Representational Similarity Analysis is used to perform summary statistics on supervised classi..."><div class="figure" id="id4"> <img alt="../_images/sphx_glr_decoding_rsa_thumb.png" src="../_images/sphx_glr_decoding_rsa_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/decoding/decoding_rsa.html#sphx-glr-auto-examples-decoding-decoding-rsa-py"><span class="std std-ref">Representational Similarity Analysis</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Decoding of motor imagery applied to EEG data decomposed using CSP. Here the classifier is appl..."><div class="figure" id="id5"> <img alt="../_images/sphx_glr_plot_decoding_csp_eeg_thumb.png" src="../_images/sphx_glr_plot_decoding_csp_eeg_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/decoding/plot_decoding_csp_eeg.html#sphx-glr-auto-examples-decoding-plot-decoding-csp-eeg-py"><span class="std std-ref">Motor imagery decoding from EEG data using the Common Spatial Pattern (CSP)</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip=" The time-frequency decomposition is estimated by iterating over raw data that has been band-pa..."><div class="figure" id="id6"> <img alt="../_images/sphx_glr_plot_decoding_csp_timefreq_thumb.png" src="../_images/sphx_glr_plot_decoding_csp_timefreq_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/decoding/plot_decoding_csp_timefreq.html#sphx-glr-auto-examples-decoding-plot-decoding-csp-timefreq-py"><span class="std std-ref">Decoding in time-frequency space data using the Common Spatial Pattern (CSP)</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="This example demonstrates the relationship between the noise covariance estimate and the MNE / ..."><div class="figure" id="id7"> <img alt="../_images/sphx_glr_plot_covariance_whitening_dspm_thumb.png" src="../_images/sphx_glr_plot_covariance_whitening_dspm_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/inverse/plot_covariance_whitening_dspm.html#sphx-glr-auto-examples-inverse-plot-covariance-whitening-dspm-py"><span class="std std-ref">Demonstrate impact of whitening on source estimates</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="ICA is fit to MEG raw data. We assume that the non-stationary EOG artifacts have already been r..."><div class="figure" id="id8"> <img alt="../_images/sphx_glr_plot_run_ica_thumb.png" src="../_images/sphx_glr_plot_run_ica_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/preprocessing/plot_run_ica.html#sphx-glr-auto-examples-preprocessing-plot-run-ica-py"><span class="std std-ref">Compute ICA components on epochs</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Compute the distribution of timing for EOG artifacts."><div class="figure" id="id9"> <img alt="../_images/sphx_glr_plot_eog_artifact_histogram_thumb.png" src="../_images/sphx_glr_plot_eog_artifact_histogram_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/preprocessing/plot_eog_artifact_histogram.html#sphx-glr-auto-examples-preprocessing-plot-eog-artifact-histogram-py"><span class="std std-ref">Show EOG artifact timing</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Demonstrate movement compensation on simulated data. The simulated data contains bilateral acti..."><div class="figure" id="id10"> <img alt="../_images/sphx_glr_plot_movement_compensation_thumb.png" src="../_images/sphx_glr_plot_movement_compensation_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/preprocessing/plot_movement_compensation.html#sphx-glr-auto-examples-preprocessing-plot-movement-compensation-py"><span class="std std-ref">Maxwell filter data with movement compensation</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="When performing experiments where timing is critical, a signal with a high sampling rate is des..."><div class="figure" id="id11"> <img alt="../_images/sphx_glr_plot_resample_thumb.png" src="../_images/sphx_glr_plot_resample_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/preprocessing/plot_resample.html#sphx-glr-auto-examples-preprocessing-plot-resample-py"><span class="std std-ref">Resampling data</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="This example generates raw data by repeating a desired source activation multiple times."><div class="figure" id="id12"> <img alt="../_images/sphx_glr_plot_simulate_raw_data_thumb.png" src="../_images/sphx_glr_plot_simulate_raw_data_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/simulation/plot_simulate_raw_data.html#sphx-glr-auto-examples-simulation-plot-simulate-raw-data-py"><span class="std std-ref">Generate simulated raw data</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="This demonstrates how rER[P/F]s - regressing the continuous data - is a generalisation of tradi..."><div class="figure" id="id13"> <img alt="../_images/sphx_glr_plot_linear_regression_raw_thumb.png" src="../_images/sphx_glr_plot_linear_regression_raw_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/stats/plot_linear_regression_raw.html#sphx-glr-auto-examples-stats-plot-linear-regression-raw-py"><span class="std std-ref">Regression on continuous data (rER[P/F])</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Returns an STC file containing the PSD (in dB) of each of the sources."><div class="figure" id="id14"> <img alt="../_images/sphx_glr_plot_source_power_spectrum_thumb.png" src="../_images/sphx_glr_plot_source_power_spectrum_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/time_frequency/plot_source_power_spectrum.html#sphx-glr-auto-examples-time-frequency-plot-source-power-spectrum-py"><span class="std std-ref">Compute power spectrum densities of the sources with dSPM</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Returns STC files ie source estimates of induced power for different bands in the source space...."><div class="figure" id="id15"> <img alt="../_images/sphx_glr_plot_source_space_time_frequency_thumb.png" src="../_images/sphx_glr_plot_source_space_time_frequency_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/time_frequency/plot_source_space_time_frequency.html#sphx-glr-auto-examples-time-frequency-plot-source-space-time-frequency-py"><span class="std std-ref">Compute induced power in the source space with dSPM</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="The objective is to show you how to explore spectrally localized effects. For this purpose we a..."><div class="figure" id="id16"> <img alt="../_images/sphx_glr_plot_time_frequency_global_field_power_thumb.png" src="../_images/sphx_glr_plot_time_frequency_global_field_power_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/time_frequency/plot_time_frequency_global_field_power.html#sphx-glr-auto-examples-time-frequency-plot-time-frequency-global-field-power-py"><span class="std std-ref">Explore event-related dynamics for specific frequency bands</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Compute time-frequency maps of power and phase lock in the source space. The inverse method is ..."><div class="figure" id="id17"> <img alt="../_images/sphx_glr_plot_source_label_time_frequency_thumb.png" src="../_images/sphx_glr_plot_source_label_time_frequency_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/time_frequency/plot_source_label_time_frequency.html#sphx-glr-auto-examples-time-frequency-plot-source-label-time-frequency-py"><span class="std std-ref">Compute power and phase lock in label of the source space</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="This example calculates and displays ERDS maps of event-related EEG data. ERDS (sometimes also ..."><div class="figure" id="id18"> <img alt="../_images/sphx_glr_plot_time_frequency_erds_thumb.png" src="../_images/sphx_glr_plot_time_frequency_erds_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/time_frequency/plot_time_frequency_erds.html#sphx-glr-auto-examples-time-frequency-plot-time-frequency-erds-py"><span class="std std-ref">Compute and visualize ERDS maps</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="This will produce what is sometimes called an event related potential / field (ERP/ERF) image."><div class="figure" id="id19"> <img alt="../_images/sphx_glr_plot_roi_erpimage_by_rt_thumb.png" src="../_images/sphx_glr_plot_roi_erpimage_by_rt_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_examples/visualization/plot_roi_erpimage_by_rt.html#sphx-glr-auto-examples-visualization-plot-roi-erpimage-by-rt-py"><span class="std std-ref">Plot single trial activity, grouped by ROI and sorted by RT</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="This tutorial shows how to clean MEG data with Maxwell filtering."><div class="figure" id="id20"> <img alt="../_images/sphx_glr_plot_artifacts_correction_maxwell_filtering_thumb.png" src="../_images/sphx_glr_plot_artifacts_correction_maxwell_filtering_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_artifacts_correction_maxwell_filtering.html#sphx-glr-auto-tutorials-plot-artifacts-correction-maxwell-filtering-py"><span class="std std-ref">Artifact correction with Maxwell filter</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip=""><div class="figure" id="id21"> <img alt="../_images/sphx_glr_plot_artifacts_correction_ssp_thumb.png" src="../_images/sphx_glr_plot_artifacts_correction_ssp_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_artifacts_correction_ssp.html#sphx-glr-auto-tutorials-plot-artifacts-correction-ssp-py"><span class="std std-ref">Artifact Correction with SSP</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Many methods in MNE, including e.g. source estimation and some classification algorithms, requi..."><div class="figure" id="id22"> <img alt="../_images/sphx_glr_plot_compute_covariance_thumb.png" src="../_images/sphx_glr_plot_compute_covariance_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_compute_covariance.html#sphx-glr-auto-tutorials-plot-compute-covariance-py"><span class="std std-ref">Computing covariance matrix</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip=""><div class="figure" id="id23"> <img alt="../_images/sphx_glr_plot_epoching_and_averaging_thumb.png" src="../_images/sphx_glr_plot_epoching_and_averaging_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_epoching_and_averaging.html#sphx-glr-auto-tutorials-plot-epoching-and-averaging-py"><span class="std std-ref">Epoching and averaging (ERP/ERF)</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip=""><div class="figure" id="id24"> <img alt="../_images/sphx_glr_plot_artifacts_correction_rejection_thumb.png" src="../_images/sphx_glr_plot_artifacts_correction_rejection_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_artifacts_correction_rejection.html#sphx-glr-auto-tutorials-plot-artifacts-correction-rejection-py"><span class="std std-ref">Rejecting bad data (channels and segments)</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip=":class:`Epochs &lt;mne.Epochs&gt;` objects are a way of representing continuous data as a collection ..."><div class="figure" id="id25"> <img alt="../_images/sphx_glr_plot_object_epochs_thumb.png" src="../_images/sphx_glr_plot_object_epochs_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_object_epochs.html#sphx-glr-auto-tutorials-plot-object-epochs-py"><span class="std std-ref">The Epochs data structure: epoched data</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="The objective is to show you how to explore the spectral content of your data (frequency and ti..."><div class="figure" id="id26"> <img alt="../_images/sphx_glr_plot_sensors_time_frequency_thumb.png" src="../_images/sphx_glr_plot_sensors_time_frequency_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_sensors_time_frequency.html#sphx-glr-auto-tutorials-plot-sensors-time-frequency-py"><span class="std std-ref">Frequency and time-frequency sensors analysis</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="This script shows how to estimate significant clusters in time-frequency power estimates. It us..."><div class="figure" id="id27"> <img alt="../_images/sphx_glr_plot_stats_cluster_1samp_test_time_frequency_thumb.png" src="../_images/sphx_glr_plot_stats_cluster_1samp_test_time_frequency_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_stats_cluster_1samp_test_time_frequency.html#sphx-glr-auto-tutorials-plot-stats-cluster-1samp-test-time-frequency-py"><span class="std std-ref">Non-parametric 1 sample cluster statistic on single trial power</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Here we compute the evoked from raw for the Brainstorm Elekta phantom tutorial dataset. For com..."><div class="figure" id="id28"> <img alt="../_images/sphx_glr_plot_brainstorm_phantom_elekta_thumb.png" src="../_images/sphx_glr_plot_brainstorm_phantom_elekta_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_brainstorm_phantom_elekta.html#sphx-glr-auto-tutorials-plot-brainstorm-phantom-elekta-py"><span class="std std-ref">Brainstorm Elekta phantom tutorial dataset</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="The aim of this tutorial is to teach you how to compute and apply a linear inverse method such ..."><div class="figure" id="id29"> <img alt="../_images/sphx_glr_plot_mne_dspm_source_localization_thumb.png" src="../_images/sphx_glr_plot_mne_dspm_source_localization_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_mne_dspm_source_localization.html#sphx-glr-auto-tutorials-plot-mne-dspm-source-localization-py"><span class="std std-ref">Source localization with MNE/dSPM/sLORETA</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="The aim of this tutorial is to demonstrate how to put a known signal at a desired location(s) i..."><div class="figure" id="id30"> <img alt="../_images/sphx_glr_plot_point_spread_thumb.png" src="../_images/sphx_glr_plot_point_spread_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_point_spread.html#sphx-glr-auto-tutorials-plot-point-spread-py"><span class="std std-ref">Corrupt known signal with point spread</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Decoding, a.k.a MVPA or supervised machine learning applied to MEG data in sensor space. Here t..."><div class="figure" id="id31"> <img alt="../_images/sphx_glr_plot_sensors_decoding_thumb.png" src="../_images/sphx_glr_plot_sensors_decoding_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_sensors_decoding.html#sphx-glr-auto-tutorials-plot-sensors-decoding-py"><span class="std std-ref">Decoding sensor space data (MVPA)</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="MNE-Python reimplements most of MNE-C's (the original MNE command line utils) functionality and..."><div class="figure" id="id32"> <img alt="../_images/sphx_glr_plot_introduction_thumb.png" src="../_images/sphx_glr_plot_introduction_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_introduction.html#sphx-glr-auto-tutorials-plot-introduction-py"><span class="std std-ref">Basic MEG and EEG data processing</span></a></span></p> </div> </div><div class="sphx-glr-thumbcontainer" tooltip="Here we compute the evoked from raw for the auditory Brainstorm tutorial dataset. For compariso..."><div class="figure" id="id33"> <img alt="../_images/sphx_glr_plot_brainstorm_auditory_thumb.png" src="../_images/sphx_glr_plot_brainstorm_auditory_thumb.png" /> <p class="caption"><span class="caption-text"><a class="reference internal" href="../auto_tutorials/plot_brainstorm_auditory.html#sphx-glr-auto-tutorials-plot-brainstorm-auditory-py"><span class="std std-ref">Brainstorm auditory tutorial dataset</span></a></span></p> </div> </div><div style='clear:both'></div></div> </div> </div> </div> </div> <footer class="footer"> <div class="container"><img src="../_static/institutions.png" alt="Institutions"></div> <div class="container"> <ul class="list-inline"> <li><a href="https://github.com/mne-tools/mne-python">GitHub</a></li> <li>·</li> <li><a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis">Mailing list</a></li> <li>·</li> <li><a href="https://gitter.im/mne-tools/mne-python">Gitter</a></li> <li>·</li> <li><a href="whats_new.html">What's new</a></li> <li>·</li> <li><a href="faq.html#cite">Cite MNE</a></li> <li class="pull-right"><a href="#">Back to top</a></li> </ul> <p>&copy; Copyright 2012-2017, MNE Developers. Last updated on 2017-10-31.</p> </div> </footer> <script src="https://mne.tools/versionwarning.js"></script> </body> </html>
mne-tools/mne-tools.github.io
0.15/generated/mne.find_events.html
HTML
bsd-3-clause
40,529
<?php use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model app\models\ShopGoodsCategory */ $this->title = Yii::t('app', 'Create Shop Goods Category'); $this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Shop Goods Categories'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="shop-goods-category-create"> <?= $this->render('_form', [ 'model' => $model, ]) ?> </div>
xiangpingeasy/yii2_fbg_shop
backend/views/shop-goods-category/create.php
PHP
bsd-3-clause
446
// Copyright (c) 2012 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. #include "chrome/browser/chromeos/login/login_utils.h" #include <algorithm> #include <set> #include <vector> #include "base/bind.h" #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/file_util.h" #include "base/files/file_path.h" #include "base/location.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/singleton.h" #include "base/memory/weak_ptr.h" #include "base/path_service.h" #include "base/prefs/pref_member.h" #include "base/prefs/pref_registry_simple.h" #include "base/prefs/pref_service.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "base/synchronization/lock.h" #include "base/sys_info.h" #include "base/task_runner_util.h" #include "base/threading/worker_pool.h" #include "base/time/time.h" #include "chrome/browser/about_flags.h" #include "chrome/browser/app_mode/app_mode_utils.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_shutdown.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chromeos/boot_times_loader.h" #include "chrome/browser/chromeos/input_method/input_method_util.h" #include "chrome/browser/chromeos/login/chrome_restart_request.h" #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" #include "chrome/browser/chromeos/login/input_events_blocker.h" #include "chrome/browser/chromeos/login/login_display_host.h" #include "chrome/browser/chromeos/login/oauth2_login_manager.h" #include "chrome/browser/chromeos/login/oauth2_login_manager_factory.h" #include "chrome/browser/chromeos/login/parallel_authenticator.h" #include "chrome/browser/chromeos/login/profile_auth_data.h" #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter.h" #include "chrome/browser/chromeos/login/saml/saml_offline_signin_limiter_factory.h" #include "chrome/browser/chromeos/login/screen_locker.h" #include "chrome/browser/chromeos/login/startup_utils.h" #include "chrome/browser/chromeos/login/supervised_user_manager.h" #include "chrome/browser/chromeos/login/user.h" #include "chrome/browser/chromeos/login/user_manager.h" #include "chrome/browser/chromeos/settings/cros_settings.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/first_run/first_run.h" #include "chrome/browser/google/google_util_chromeos.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/pref_service_flags_storage.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/rlz/rlz.h" #include "chrome/browser/signin/signin_manager.h" #include "chrome/browser/signin/signin_manager_factory.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/ui/app_list/start_page_service.h" #include "chrome/browser/ui/startup/startup_browser_creator.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/logging_chrome.h" #include "chrome/common/pref_names.h" #include "chromeos/chromeos_switches.h" #include "chromeos/cryptohome/cryptohome_util.h" #include "chromeos/dbus/cryptohome_client.h" #include "chromeos/dbus/dbus_method_call_status.h" #include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/session_manager_client.h" #include "chromeos/ime/input_method_manager.h" #include "chromeos/settings/cros_settings_names.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/notification_service.h" #include "google_apis/gaia/gaia_auth_consumer.h" #include "net/base/network_change_notifier.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" #include "url/gurl.h" using content::BrowserThread; namespace chromeos { namespace { #if defined(ENABLE_RLZ) // Flag file that disables RLZ tracking, when present. const base::FilePath::CharType kRLZDisabledFlagName[] = FILE_PATH_LITERAL(".rlz_disabled"); base::FilePath GetRlzDisabledFlagPath() { return base::GetHomeDir().Append(kRLZDisabledFlagName); } #endif } // namespace struct DoBrowserLaunchOnLocaleLoadedData; class LoginUtilsImpl : public LoginUtils, public OAuth2LoginManager::Observer, public net::NetworkChangeNotifier::ConnectionTypeObserver, public base::SupportsWeakPtr<LoginUtilsImpl> { public: LoginUtilsImpl() : has_web_auth_cookies_(false), delegate_(NULL), exit_after_session_restore_(false), session_restore_strategy_( OAuth2LoginManager::RESTORE_FROM_SAVED_OAUTH2_REFRESH_TOKEN) { net::NetworkChangeNotifier::AddConnectionTypeObserver(this); } virtual ~LoginUtilsImpl() { net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); } // LoginUtils implementation: virtual void DoBrowserLaunch(Profile* profile, LoginDisplayHost* login_host) OVERRIDE; virtual void PrepareProfile( const UserContext& user_context, const std::string& display_email, bool has_cookies, bool has_active_session, LoginUtils::Delegate* delegate) OVERRIDE; virtual void DelegateDeleted(LoginUtils::Delegate* delegate) OVERRIDE; virtual void CompleteOffTheRecordLogin(const GURL& start_url) OVERRIDE; virtual void SetFirstLoginPrefs(PrefService* prefs) OVERRIDE; virtual scoped_refptr<Authenticator> CreateAuthenticator( LoginStatusConsumer* consumer) OVERRIDE; virtual void RestoreAuthenticationSession(Profile* profile) OVERRIDE; virtual void InitRlzDelayed(Profile* user_profile) OVERRIDE; // OAuth2LoginManager::Observer overrides. virtual void OnSessionRestoreStateChanged( Profile* user_profile, OAuth2LoginManager::SessionRestoreState state) OVERRIDE; virtual void OnNewRefreshTokenAvaiable(Profile* user_profile) OVERRIDE; // net::NetworkChangeNotifier::ConnectionTypeObserver overrides. virtual void OnConnectionTypeChanged( net::NetworkChangeNotifier::ConnectionType type) OVERRIDE; private: typedef std::set<std::string> SessionRestoreStateSet; // DoBrowserLaunch is split into two parts. // This one is called after anynchronous locale switch. void DoBrowserLaunchOnLocaleLoadedImpl(Profile* profile, LoginDisplayHost* login_host); // Callback for locale_util::SwitchLanguage(). static void DoBrowserLaunchOnLocaleLoaded( scoped_ptr<DoBrowserLaunchOnLocaleLoadedData> context, const std::string& locale, const std::string& loaded_locale, const bool success); // Restarts OAuth session authentication check. void KickStartAuthentication(Profile* profile); // Callback for Profile::CREATE_STATUS_CREATED profile state. // Initializes basic preferences for newly created profile. Any other // early profile initialization that needs to happen before // ProfileManager::DoFinalInit() gets called is done here. void InitProfilePreferences(Profile* user_profile, const std::string& email); // Callback for asynchronous profile creation. void OnProfileCreated(const std::string& email, Profile* profile, Profile::CreateStatus status); // Callback for asynchronous off the record profile creation. void OnOTRProfileCreated(const std::string& email, Profile* profile, Profile::CreateStatus status); // Callback for Profile::CREATE_STATUS_INITIALIZED profile state. // Profile is created, extensions and promo resources are initialized. void UserProfileInitialized(Profile* user_profile); // Callback for Profile::CREATE_STATUS_INITIALIZED profile state for an OTR // login. void OTRProfileInitialized(Profile* user_profile); // Callback to resume profile creation after transferring auth data from // the authentication profile. void CompleteProfileCreate(Profile* user_profile); // Finalized profile preparation. void FinalizePrepareProfile(Profile* user_profile); // Initializes member variables needed for session restore process via // OAuthLoginManager. void InitSessionRestoreStrategy(); // Restores GAIA auth cookies for the created user profile from OAuth2 token. void RestoreAuthSession(Profile* user_profile, bool restore_from_auth_cookies); // Initializes RLZ. If |disabled| is true, RLZ pings are disabled. void InitRlz(Profile* user_profile, bool disabled); // Attempts restarting the browser process and esures that this does // not happen while we are still fetching new OAuth refresh tokens. void AttemptRestart(Profile* profile); UserContext user_context_; // True if the authentication profile's cookie jar should contain // authentication cookies from the authentication extension log in flow. bool has_web_auth_cookies_; // Has to be scoped_refptr, see comment for CreateAuthenticator(...). scoped_refptr<Authenticator> authenticator_; // Delegate to be fired when the profile will be prepared. LoginUtils::Delegate* delegate_; // Set of user_id for those users that we should restore authentication // session when notified about online state change. SessionRestoreStateSet pending_restore_sessions_; // True if we should restart chrome right after session restore. bool exit_after_session_restore_; // Sesion restore strategy. OAuth2LoginManager::SessionRestoreStrategy session_restore_strategy_; // OAuth2 refresh token for session restore. std::string oauth2_refresh_token_; DISALLOW_COPY_AND_ASSIGN(LoginUtilsImpl); }; class LoginUtilsWrapper { public: static LoginUtilsWrapper* GetInstance() { return Singleton<LoginUtilsWrapper>::get(); } LoginUtils* get() { base::AutoLock create(create_lock_); if (!ptr_.get()) reset(new LoginUtilsImpl); return ptr_.get(); } void reset(LoginUtils* ptr) { ptr_.reset(ptr); } private: friend struct DefaultSingletonTraits<LoginUtilsWrapper>; LoginUtilsWrapper() {} base::Lock create_lock_; scoped_ptr<LoginUtils> ptr_; DISALLOW_COPY_AND_ASSIGN(LoginUtilsWrapper); }; struct DoBrowserLaunchOnLocaleLoadedData { DoBrowserLaunchOnLocaleLoadedData(LoginUtilsImpl* login_utils_impl, Profile* profile, LoginDisplayHost* display_host) : login_utils_impl(login_utils_impl), profile(profile), display_host(display_host) {} LoginUtilsImpl* login_utils_impl; Profile* profile; chromeos::LoginDisplayHost* display_host; // Block UI events untill ResourceBundle is reloaded. InputEventsBlocker input_events_blocker; }; // static void LoginUtilsImpl::DoBrowserLaunchOnLocaleLoaded( scoped_ptr<DoBrowserLaunchOnLocaleLoadedData> context, const std::string& /* locale */, const std::string& /* loaded_locale */, const bool /* success */) { context->login_utils_impl->DoBrowserLaunchOnLocaleLoadedImpl( context->profile, context->display_host); } // Called from DoBrowserLaunch() or from // DoBrowserLaunchOnLocaleLoaded() depending on // if locale switch was needed. void LoginUtilsImpl::DoBrowserLaunchOnLocaleLoadedImpl( Profile* profile, LoginDisplayHost* login_host) { if (!UserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) { UserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile); return; } CommandLine user_flags(CommandLine::NO_PROGRAM); about_flags::PrefServiceFlagsStorage flags_storage_(profile->GetPrefs()); about_flags::ConvertFlagsToSwitches(&flags_storage_, &user_flags, about_flags::kAddSentinels); // Only restart if needed and if not going into managed mode. // Don't restart browser if it is not first profile in session. if (UserManager::Get()->GetLoggedInUsers().size() == 1 && !UserManager::Get()->IsLoggedInAsLocallyManagedUser() && !about_flags::AreSwitchesIdenticalToCurrentCommandLine( user_flags, *CommandLine::ForCurrentProcess())) { CommandLine::StringVector flags; // argv[0] is the program name |CommandLine::NO_PROGRAM|. flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end()); VLOG(1) << "Restarting to apply per-session flags..."; DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser( UserManager::Get()->GetActiveUser()->email(), flags); AttemptRestart(profile); return; } if (login_host) { login_host->SetStatusAreaVisible(true); login_host->BeforeSessionStart(); } BootTimesLoader::Get()->AddLoginTimeMarker("BrowserLaunched", false); VLOG(1) << "Launching browser..."; StartupBrowserCreator browser_creator; int return_code; chrome::startup::IsFirstRun first_run = first_run::IsChromeFirstRun() ? chrome::startup::IS_FIRST_RUN : chrome::startup::IS_NOT_FIRST_RUN; browser_creator.LaunchBrowser(*CommandLine::ForCurrentProcess(), profile, base::FilePath(), chrome::startup::IS_PROCESS_STARTUP, first_run, &return_code); // Triggers app launcher start page service to load start page web contents. app_list::StartPageService::Get(profile); // Mark login host for deletion after browser starts. This // guarantees that the message loop will be referenced by the // browser before it is dereferenced by the login host. if (login_host) login_host->Finalize(); UserManager::Get()->SessionStarted(); } void LoginUtilsImpl::DoBrowserLaunch(Profile* profile, LoginDisplayHost* login_host) { if (browser_shutdown::IsTryingToQuit()) return; User* const user = UserManager::Get()->GetUserByProfile(profile); scoped_ptr<DoBrowserLaunchOnLocaleLoadedData> data( new DoBrowserLaunchOnLocaleLoadedData(this, profile, login_host)); scoped_ptr<locale_util::SwitchLanguageCallback> callback( new locale_util::SwitchLanguageCallback( base::Bind(&LoginUtilsImpl::DoBrowserLaunchOnLocaleLoaded, base::Passed(data.Pass())))); if (!UserManager::Get()-> RespectLocalePreference(profile, user, callback.Pass())) { DoBrowserLaunchOnLocaleLoadedImpl(profile, login_host); } } void LoginUtilsImpl::PrepareProfile( const UserContext& user_context, const std::string& display_email, bool has_cookies, bool has_active_session, LoginUtils::Delegate* delegate) { BootTimesLoader* btl = BootTimesLoader::Get(); VLOG(1) << "Completing login for " << user_context.username; if (!has_active_session) { btl->AddLoginTimeMarker("StartSession-Start", false); DBusThreadManager::Get()->GetSessionManagerClient()->StartSession( user_context.username); btl->AddLoginTimeMarker("StartSession-End", false); } btl->AddLoginTimeMarker("UserLoggedIn-Start", false); UserManager* user_manager = UserManager::Get(); user_manager->UserLoggedIn(user_context.username, user_context.username_hash, false); btl->AddLoginTimeMarker("UserLoggedIn-End", false); // Switch log file as soon as possible. if (base::SysInfo::IsRunningOnChromeOS()) logging::RedirectChromeLogging(*(CommandLine::ForCurrentProcess())); // Update user's displayed email. if (!display_email.empty()) user_manager->SaveUserDisplayEmail(user_context.username, display_email); user_context_ = user_context; has_web_auth_cookies_ = has_cookies; delegate_ = delegate; InitSessionRestoreStrategy(); if (DemoAppLauncher::IsDemoAppSession(user_context.username)) { g_browser_process->profile_manager()->CreateProfileAsync( user_manager->GetUserProfileDir(user_context.username), base::Bind(&LoginUtilsImpl::OnOTRProfileCreated, AsWeakPtr(), user_context.username), base::string16(), base::string16(), std::string()); } else { // Can't use display_email because it is empty when existing user logs in // using sing-in pod on login screen (i.e. user didn't type email). g_browser_process->profile_manager()->CreateProfileAsync( user_manager->GetUserProfileDir(user_context.username), base::Bind(&LoginUtilsImpl::OnProfileCreated, AsWeakPtr(), user_context.username), base::string16(), base::string16(), std::string()); } } void LoginUtilsImpl::DelegateDeleted(LoginUtils::Delegate* delegate) { if (delegate_ == delegate) delegate_ = NULL; } void LoginUtilsImpl::InitProfilePreferences(Profile* user_profile, const std::string& user_id) { if (UserManager::Get()->IsCurrentUserNew()) SetFirstLoginPrefs(user_profile->GetPrefs()); if (UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { User* active_user = UserManager::Get()->GetActiveUser(); std::string managed_user_sync_id = UserManager::Get()->GetSupervisedUserManager()-> GetUserSyncId(active_user->email()); // TODO(ibraaaa): Remove that when 97% of our users are using M31. // http://crbug.com/276163 if (managed_user_sync_id.empty()) managed_user_sync_id = "DUMMY_ID"; user_profile->GetPrefs()->SetString(prefs::kManagedUserId, managed_user_sync_id); } else { // Make sure that the google service username is properly set (we do this // on every sign in, not just the first login, to deal with existing // profiles that might not have it set yet). SigninManagerBase* signin_manager = SigninManagerFactory::GetForProfile(user_profile); signin_manager->SetAuthenticatedUsername(user_id); } } void LoginUtilsImpl::InitSessionRestoreStrategy() { CommandLine* command_line = CommandLine::ForCurrentProcess(); bool in_app_mode = chrome::IsRunningInForcedAppMode(); // Are we in kiosk app mode? if (in_app_mode) { if (command_line->HasSwitch(::switches::kAppModeOAuth2Token)) { oauth2_refresh_token_ = command_line->GetSwitchValueASCII( ::switches::kAppModeOAuth2Token); } if (command_line->HasSwitch(::switches::kAppModeAuthCode)) { user_context_.auth_code = command_line->GetSwitchValueASCII( ::switches::kAppModeAuthCode); } DCHECK(!has_web_auth_cookies_); if (!user_context_.auth_code.empty()) { session_restore_strategy_ = OAuth2LoginManager::RESTORE_FROM_AUTH_CODE; } else if (!oauth2_refresh_token_.empty()) { session_restore_strategy_ = OAuth2LoginManager::RESTORE_FROM_PASSED_OAUTH2_REFRESH_TOKEN; } else { session_restore_strategy_ = OAuth2LoginManager::RESTORE_FROM_SAVED_OAUTH2_REFRESH_TOKEN; } return; } if (has_web_auth_cookies_) { session_restore_strategy_ = OAuth2LoginManager::RESTORE_FROM_COOKIE_JAR; } else if (!user_context_.auth_code.empty()) { session_restore_strategy_ = OAuth2LoginManager::RESTORE_FROM_AUTH_CODE; } else { session_restore_strategy_ = OAuth2LoginManager::RESTORE_FROM_SAVED_OAUTH2_REFRESH_TOKEN; } } void LoginUtilsImpl::OnProfileCreated( const std::string& user_id, Profile* user_profile, Profile::CreateStatus status) { CHECK(user_profile); switch (status) { case Profile::CREATE_STATUS_CREATED: InitProfilePreferences(user_profile, user_id); break; case Profile::CREATE_STATUS_INITIALIZED: UserProfileInitialized(user_profile); break; case Profile::CREATE_STATUS_LOCAL_FAIL: case Profile::CREATE_STATUS_REMOTE_FAIL: case Profile::CREATE_STATUS_CANCELED: case Profile::MAX_CREATE_STATUS: NOTREACHED(); break; } } void LoginUtilsImpl::OnOTRProfileCreated( const std::string& user_id, Profile* user_profile, Profile::CreateStatus status) { CHECK(user_profile); switch (status) { case Profile::CREATE_STATUS_CREATED: InitProfilePreferences(user_profile, user_id); break; case Profile::CREATE_STATUS_INITIALIZED: OTRProfileInitialized(user_profile); break; case Profile::CREATE_STATUS_LOCAL_FAIL: case Profile::CREATE_STATUS_REMOTE_FAIL: case Profile::CREATE_STATUS_CANCELED: case Profile::MAX_CREATE_STATUS: NOTREACHED(); break; } } void LoginUtilsImpl::UserProfileInitialized(Profile* user_profile) { BootTimesLoader* btl = BootTimesLoader::Get(); btl->AddLoginTimeMarker("UserProfileGotten", false); if (user_context_.using_oauth) { // Transfer proxy authentication cache, cookies (optionally) and server // bound certs from the profile that was used for authentication. This // profile contains cookies that auth extension should have already put in // place that will ensure that the newly created session is authenticated // for the websites that work with the used authentication schema. ProfileAuthData::Transfer(authenticator_->authentication_profile(), user_profile, has_web_auth_cookies_, // transfer_cookies base::Bind( &LoginUtilsImpl::CompleteProfileCreate, AsWeakPtr(), user_profile)); return; } FinalizePrepareProfile(user_profile); } void LoginUtilsImpl::OTRProfileInitialized(Profile* user_profile) { user_profile->OnLogin(); // Send the notification before creating the browser so additional objects // that need the profile (e.g. the launcher) can be created first. content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, content::NotificationService::AllSources(), content::Details<Profile>(user_profile)); if (delegate_) delegate_->OnProfilePrepared(user_profile); } void LoginUtilsImpl::CompleteProfileCreate(Profile* user_profile) { RestoreAuthSession(user_profile, has_web_auth_cookies_); FinalizePrepareProfile(user_profile); } void LoginUtilsImpl::RestoreAuthSession(Profile* user_profile, bool restore_from_auth_cookies) { CHECK((authenticator_.get() && authenticator_->authentication_profile()) || !restore_from_auth_cookies); if (chrome::IsRunningInForcedAppMode() || CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kOobeSkipPostLogin)) { return; } exit_after_session_restore_ = false; // Remove legacy OAuth1 token if we have one. If it's valid, we should already // have OAuth2 refresh token in OAuth2TokenService that could be used to // retrieve all other tokens and user_context. OAuth2LoginManager* login_manager = OAuth2LoginManagerFactory::GetInstance()->GetForProfile(user_profile); login_manager->AddObserver(this); login_manager->RestoreSession( authenticator_.get() && authenticator_->authentication_profile() ? authenticator_->authentication_profile()->GetRequestContext() : NULL, session_restore_strategy_, oauth2_refresh_token_, user_context_.auth_code); } void LoginUtilsImpl::FinalizePrepareProfile(Profile* user_profile) { BootTimesLoader* btl = BootTimesLoader::Get(); // Own TPM device if, for any reason, it has not been done in EULA // wizard screen. CryptohomeClient* client = DBusThreadManager::Get()->GetCryptohomeClient(); btl->AddLoginTimeMarker("TPMOwn-Start", false); if (cryptohome_util::TpmIsEnabled() && !cryptohome_util::TpmIsBeingOwned()) { if (cryptohome_util::TpmIsOwned()) { client->CallTpmClearStoredPasswordAndBlock(); } else { client->TpmCanAttemptOwnership(EmptyVoidDBusMethodCallback()); } } btl->AddLoginTimeMarker("TPMOwn-End", false); if (UserManager::Get()->IsLoggedInAsRegularUser()) { SAMLOfflineSigninLimiter* saml_offline_signin_limiter = SAMLOfflineSigninLimiterFactory::GetForProfile(user_profile); if (saml_offline_signin_limiter) saml_offline_signin_limiter->SignedIn(user_context_.auth_flow); } user_profile->OnLogin(); // Send the notification before creating the browser so additional objects // that need the profile (e.g. the launcher) can be created first. content::NotificationService::current()->Notify( chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, content::NotificationService::AllSources(), content::Details<Profile>(user_profile)); // Initialize RLZ only for primary user. if (UserManager::Get()->GetPrimaryUser() == UserManager::Get()->GetUserByProfile(user_profile)) { InitRlzDelayed(user_profile); } // TODO(altimofeev): This pointer should probably never be NULL, but it looks // like LoginUtilsImpl::OnProfileCreated() may be getting called before // LoginUtilsImpl::PrepareProfile() has set |delegate_| when Chrome is killed // during shutdown in tests -- see http://crosbug.com/18269. Replace this // 'if' statement with a CHECK(delegate_) once the underlying issue is // resolved. if (delegate_) delegate_->OnProfilePrepared(user_profile); } void LoginUtilsImpl::InitRlzDelayed(Profile* user_profile) { #if defined(ENABLE_RLZ) if (!g_browser_process->local_state()->HasPrefPath(prefs::kRLZBrand)) { // Read brand code asynchronously from an OEM data and repost ourselves. google_util::chromeos::InitBrand( base::Bind(&LoginUtilsImpl::InitRlzDelayed, AsWeakPtr(), user_profile)); return; } base::PostTaskAndReplyWithResult( base::WorkerPool::GetTaskRunner(false), FROM_HERE, base::Bind(&base::PathExists, GetRlzDisabledFlagPath()), base::Bind(&LoginUtilsImpl::InitRlz, AsWeakPtr(), user_profile)); #endif } void LoginUtilsImpl::InitRlz(Profile* user_profile, bool disabled) { #if defined(ENABLE_RLZ) PrefService* local_state = g_browser_process->local_state(); if (disabled) { // Empty brand code means an organic install (no RLZ pings are sent). google_util::chromeos::ClearBrandForCurrentSession(); } if (disabled != local_state->GetBoolean(prefs::kRLZDisabled)) { // When switching to RLZ enabled/disabled state, clear all recorded events. RLZTracker::ClearRlzState(); local_state->SetBoolean(prefs::kRLZDisabled, disabled); } // Init the RLZ library. int ping_delay = user_profile->GetPrefs()->GetInteger( first_run::GetPingDelayPrefName().c_str()); // Negative ping delay means to send ping immediately after a first search is // recorded. RLZTracker::InitRlzFromProfileDelayed( user_profile, UserManager::Get()->IsCurrentUserNew(), ping_delay < 0, base::TimeDelta::FromMilliseconds(abs(ping_delay))); if (delegate_) delegate_->OnRlzInitialized(user_profile); #endif } void LoginUtilsImpl::CompleteOffTheRecordLogin(const GURL& start_url) { VLOG(1) << "Completing incognito login"; // For guest session we ask session manager to restart Chrome with --bwsi // flag. We keep only some of the arguments of this process. const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); CommandLine command_line(browser_command_line.GetProgram()); std::string cmd_line_str = GetOffTheRecordCommandLine(start_url, StartupUtils::IsOobeCompleted(), browser_command_line, &command_line); RestartChrome(cmd_line_str); } void LoginUtilsImpl::SetFirstLoginPrefs(PrefService* prefs) { VLOG(1) << "Setting first login prefs"; BootTimesLoader* btl = BootTimesLoader::Get(); std::string locale = g_browser_process->GetApplicationLocale(); // First, we'll set kLanguagePreloadEngines. input_method::InputMethodManager* manager = input_method::InputMethodManager::Get(); std::vector<std::string> input_method_ids; manager->GetInputMethodUtil()->GetFirstLoginInputMethodIds( locale, manager->GetCurrentInputMethod(), &input_method_ids); // Save the input methods in the user's preferences. StringPrefMember language_preload_engines; language_preload_engines.Init(prefs::kLanguagePreloadEngines, prefs); language_preload_engines.SetValue(JoinString(input_method_ids, ',')); btl->AddLoginTimeMarker("IMEStarted", false); // Second, we'll set kLanguagePreferredLanguages. std::vector<std::string> language_codes; // The current locale should be on the top. language_codes.push_back(locale); // Add input method IDs based on the input methods, as there may be // input methods that are unrelated to the current locale. Example: the // hardware keyboard layout xkb:us::eng is used for logging in, but the // UI language is set to French. In this case, we should set "fr,en" // to the preferred languages preference. std::vector<std::string> candidates; manager->GetInputMethodUtil()->GetLanguageCodesFromInputMethodIds( input_method_ids, &candidates); for (size_t i = 0; i < candidates.size(); ++i) { const std::string& candidate = candidates[i]; // Skip if it's already in language_codes. if (std::count(language_codes.begin(), language_codes.end(), candidate) == 0) { language_codes.push_back(candidate); } } // Save the preferred languages in the user's preferences. StringPrefMember language_preferred_languages; language_preferred_languages.Init(prefs::kLanguagePreferredLanguages, prefs); language_preferred_languages.SetValue(JoinString(language_codes, ',')); } scoped_refptr<Authenticator> LoginUtilsImpl::CreateAuthenticator( LoginStatusConsumer* consumer) { // Screen locker needs new Authenticator instance each time. if (ScreenLocker::default_screen_locker()) { if (authenticator_.get()) authenticator_->SetConsumer(NULL); authenticator_ = NULL; } if (authenticator_.get() == NULL) { authenticator_ = new ParallelAuthenticator(consumer); } else { // TODO(nkostylev): Fix this hack by improving Authenticator dependencies. authenticator_->SetConsumer(consumer); } return authenticator_; } void LoginUtilsImpl::RestoreAuthenticationSession(Profile* user_profile) { UserManager* user_manager = UserManager::Get(); // We don't need to restore session for demo/guest/stub/public account users. if (!user_manager->IsUserLoggedIn() || user_manager->IsLoggedInAsGuest() || user_manager->IsLoggedInAsPublicAccount() || user_manager->IsLoggedInAsDemoUser() || user_manager->IsLoggedInAsStub()) { return; } User* user = user_manager->GetUserByProfile(user_profile); DCHECK(user); if (!net::NetworkChangeNotifier::IsOffline()) { pending_restore_sessions_.erase(user->email()); RestoreAuthSession(user_profile, false); } else { // Even if we're online we should wait till initial // OnConnectionTypeChanged() call. Otherwise starting fetchers too early may // end up canceling all request when initial network connection type is // processed. See http://crbug.com/121643. pending_restore_sessions_.insert(user->email()); } } void LoginUtilsImpl::OnSessionRestoreStateChanged( Profile* user_profile, OAuth2LoginManager::SessionRestoreState state) { User::OAuthTokenStatus user_status = User::OAUTH_TOKEN_STATUS_UNKNOWN; OAuth2LoginManager* login_manager = OAuth2LoginManagerFactory::GetInstance()->GetForProfile(user_profile); bool connection_error = false; switch (state) { case OAuth2LoginManager::SESSION_RESTORE_DONE: user_status = User::OAUTH2_TOKEN_STATUS_VALID; break; case OAuth2LoginManager::SESSION_RESTORE_FAILED: user_status = User::OAUTH2_TOKEN_STATUS_INVALID; break; case OAuth2LoginManager::SESSION_RESTORE_CONNECTION_FAILED: connection_error = true; break; case OAuth2LoginManager::SESSION_RESTORE_NOT_STARTED: case OAuth2LoginManager::SESSION_RESTORE_PREPARING: case OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS: return; } // We should not be clearing existing token state if that was a connection // error. http://crbug.com/295245 if (!connection_error) { // We are in one of "done" states here. UserManager::Get()->SaveUserOAuthStatus( UserManager::Get()->GetLoggedInUser()->email(), user_status); } login_manager->RemoveObserver(this); } void LoginUtilsImpl::OnNewRefreshTokenAvaiable(Profile* user_profile) { // Check if we were waiting to restart chrome. if (!exit_after_session_restore_) return; OAuth2LoginManager* login_manager = OAuth2LoginManagerFactory::GetInstance()->GetForProfile(user_profile); login_manager->RemoveObserver(this); // Mark user auth token status as valid. UserManager::Get()->SaveUserOAuthStatus( UserManager::Get()->GetLoggedInUser()->email(), User::OAUTH2_TOKEN_STATUS_VALID); LOG(WARNING) << "Exiting after new refresh token fetched"; // We need to restart cleanly in this case to make sure OAuth2 RT is actually // saved. chrome::AttemptRestart(); } void LoginUtilsImpl::OnConnectionTypeChanged( net::NetworkChangeNotifier::ConnectionType type) { UserManager* user_manager = UserManager::Get(); if (type == net::NetworkChangeNotifier::CONNECTION_NONE || user_manager->IsLoggedInAsGuest() || !user_manager->IsUserLoggedIn()) { return; } // Need to iterate over all users and their OAuth2 session state. const UserList& users = user_manager->GetLoggedInUsers(); for (UserList::const_iterator it = users.begin(); it != users.end(); ++it) { Profile* user_profile = user_manager->GetProfileByUser(*it); bool should_restore_session = pending_restore_sessions_.find((*it)->email()) != pending_restore_sessions_.end(); OAuth2LoginManager* login_manager = OAuth2LoginManagerFactory::GetInstance()->GetForProfile(user_profile); if (login_manager->state() == OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS) { // If we come online for the first time after successful offline login, // we need to kick off OAuth token verification process again. login_manager->ContinueSessionRestore(); } else if (should_restore_session) { pending_restore_sessions_.erase((*it)->email()); RestoreAuthSession(user_profile, has_web_auth_cookies_); } } } void LoginUtilsImpl::AttemptRestart(Profile* profile) { if (session_restore_strategy_ != OAuth2LoginManager::RESTORE_FROM_COOKIE_JAR) { chrome::AttemptRestart(); return; } // We can't really quit if the session restore process that mints new // refresh token is still in progress. OAuth2LoginManager* login_manager = OAuth2LoginManagerFactory::GetInstance()->GetForProfile(profile); if (login_manager->state() != OAuth2LoginManager::SESSION_RESTORE_PREPARING && login_manager->state() != OAuth2LoginManager::SESSION_RESTORE_IN_PROGRESS) { chrome::AttemptRestart(); return; } LOG(WARNING) << "Attempting browser restart during session restore."; exit_after_session_restore_ = true; } // static void LoginUtils::RegisterPrefs(PrefRegistrySimple* registry) { registry->RegisterBooleanPref(prefs::kFactoryResetRequested, false); registry->RegisterBooleanPref(prefs::kRollbackRequested, false); registry->RegisterStringPref(prefs::kRLZBrand, std::string()); registry->RegisterBooleanPref(prefs::kRLZDisabled, false); } // static LoginUtils* LoginUtils::Get() { return LoginUtilsWrapper::GetInstance()->get(); } // static void LoginUtils::Set(LoginUtils* mock) { LoginUtilsWrapper::GetInstance()->reset(mock); } // static bool LoginUtils::IsWhitelisted(const std::string& username, bool* wildcard_match) { // Skip whitelist check for tests. if (CommandLine::ForCurrentProcess()->HasSwitch( chromeos::switches::kOobeSkipPostLogin)) { return true; } CrosSettings* cros_settings = CrosSettings::Get(); bool allow_new_user = false; cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); if (allow_new_user) return true; return cros_settings->FindEmailInList( kAccountsPrefUsers, username, wildcard_match); } } // namespace chromeos
patrickm/chromium.src
chrome/browser/chromeos/login/login_utils.cc
C++
bsd-3-clause
36,738
package edu.ucdenver.ccp.datasource.fileparsers.snomed; import edu.ucdenver.ccp.datasource.fileparsers.SingleLineFileRecord; /* * #%L * Colorado Computational Pharmacology's common module * %% * Copyright (C) 2012 - 2015 Regents of the University of Colorado * %% * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. Neither the name of the Regents of the University of Colorado nor the names of its contributors * may be used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * #L% */ import lombok.Getter; /** * @author Center for Computational Pharmacology, UC Denver; [email protected] * */ @Getter public class SnomedRf2DescriptionFileRecord extends SingleLineFileRecord { public enum DescriptionType { FULLY_SPECIFIED_NAME("900000000000003001"), SYNONYM("900000000000013009"); private final String typeId; private DescriptionType(String typeId) { this.typeId = typeId; } public String typeId() { return typeId; } public static DescriptionType getType(String typeId) { for (DescriptionType type : values()) { if (type.typeId().equals(typeId)) { return type; } } throw new IllegalArgumentException("Invalid SnoMed description type id: " + typeId); } } /* * id effectiveTime active moduleId conceptId languageCode typeId term caseSignificanceId */ private final String descriptionId; private final String effectiveTime; private final boolean active; private final String moduleId; private final String conceptId; private final String languageCode; private final DescriptionType type; private final String term; private final String caseSignificanceId; /** * @param byteOffset * @param lineNumber * @param definitionId * @param effectiveTime * @param active * @param moduleId * @param conceptId * @param languageCode * @param typeId * @param term * @param caseSignificanceId */ public SnomedRf2DescriptionFileRecord(String descriptionId, String effectiveTime, boolean active, String moduleId, String conceptId, String languageCode, DescriptionType type, String term, String caseSignificanceId, long byteOffset, long lineNumber) { super(byteOffset, lineNumber); this.descriptionId = descriptionId; this.effectiveTime = effectiveTime; this.active = active; this.moduleId = moduleId; this.conceptId = conceptId; this.languageCode = languageCode; this.type = type; this.term = term; this.caseSignificanceId = caseSignificanceId; } }
UCDenver-ccp/datasource
datasource-fileparsers/src/main/java/edu/ucdenver/ccp/datasource/fileparsers/snomed/SnomedRf2DescriptionFileRecord.java
Java
bsd-3-clause
3,805
""" Unit tests to ensure that we can call reset_traits/delete on a property trait (regression tests for Github issue #67). """ from traits import _py2to3 from traits.api import Any, HasTraits, Int, Property, TraitError from traits.testing.unittest_tools import unittest class E(HasTraits): a = Property(Any) b = Property(Int) class TestPropertyDelete(unittest.TestCase): def test_property_delete(self): e = E() with self.assertRaises(TraitError): del e.a with self.assertRaises(TraitError): del e.b def test_property_reset_traits(self): e = E() unresetable = e.reset_traits() _py2to3.assertCountEqual(self, unresetable, ['a', 'b'])
burnpanck/traits
traits/tests/test_property_delete.py
Python
bsd-3-clause
730
<?php namespace app\controllers; use app\models\ContactForm; use app\models\LoginForm; use Yii; use yii\filters\AccessControl; use yii\filters\VerbFilter; use yii\web\Controller; class SiteController extends Controller { public function behaviors() { return [ 'access' => [ 'class' => AccessControl::className(), 'only' => ['logout'], 'rules' => [ [ 'actions' => ['logout'], 'allow' => true, 'roles' => ['@'], ], ], ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ 'logout' => ['post'], ], ], ]; } public function actions() { return [ 'error' => [ 'class' => 'yii\web\ErrorAction', ], 'captcha' => [ 'class' => 'yii\captcha\CaptchaAction', 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, ], ]; } public function actionIndex() { return $this->render('index'); } public function actionLogin() { if (!\Yii::$app->user->isGuest) { return $this->goHome(); } $model = new LoginForm(); if ($model->load(Yii::$app->request->post()) && $model->login()) { return $this->goBack(); } return $this->render('login', [ 'model' => $model, ]); } public function actionLogout() { Yii::$app->user->logout(); return $this->goHome(); } public function actionContact() { $model = new ContactForm(); if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) { Yii::$app->session->setFlash('contactFormSubmitted'); return $this->refresh(); } return $this->render('contact', [ 'model' => $model, ]); } public function actionAbout() { return $this->render('about'); } public function actionLayout() { $this->layout = 'frontEnd'; return $this->render('index'); // return $this->render('//order/step1'); } }
locnes/monstars
controllers/SiteController.php
PHP
bsd-3-clause
2,402
/* dlar1v.f -- translated by f2c (version 20061008). You must link the resulting object file with libf2c: on Microsoft Windows system, link with libf2c.lib; on Linux or Unix systems, link with .../path/to/libf2c.a -lm or, if you install libf2c.a in a standard place, with -lf2c -lm -- in that order, at the end of the command line, as in cc *.o -lf2c -lm Source for libf2c is in /netlib/f2c/libf2c.zip, e.g., http://www.netlib.org/f2c/libf2c.zip */ #include "f2c.h" #include "blaswrap.h" /* Subroutine */ int dlar1v_(integer *n, integer *b1, integer *bn, doublereal *lambda, doublereal *d__, doublereal *l, doublereal *ld, doublereal * lld, doublereal *pivmin, doublereal *gaptol, doublereal *z__, logical *wantnc, integer *negcnt, doublereal *ztz, doublereal *mingma, integer *r__, integer *isuppz, doublereal *nrminv, doublereal *resid, doublereal *rqcorr, doublereal *work) { /* System generated locals */ integer i__1; doublereal d__1, d__2, d__3; /* Local variables */ integer i__; doublereal s; integer r1, r2; doublereal eps, tmp; integer neg1, neg2, indp, inds; doublereal dplus; integer indlpl, indumn; doublereal dminus; logical sawnan1, sawnan2; /* -- LAPACK auxiliary routine (version 3.2) -- */ /* November 2006 */ /* Purpose */ /* ======= */ /* DLAR1V computes the (scaled) r-th column of the inverse of */ /* the sumbmatrix in rows B1 through BN of the tridiagonal matrix */ /* L D L^T - sigma I. When sigma is close to an eigenvalue, the */ /* computed vector is an accurate eigenvector. Usually, r corresponds */ /* to the index where the eigenvector is largest in magnitude. */ /* The following steps accomplish this computation : */ /* (a) Stationary qd transform, L D L^T - sigma I = L(+) D(+) L(+)^T, */ /* (b) Progressive qd transform, L D L^T - sigma I = U(-) D(-) U(-)^T, */ /* (c) Computation of the diagonal elements of the inverse of */ /* L D L^T - sigma I by combining the above transforms, and choosing */ /* r as the index where the diagonal of the inverse is (one of the) */ /* largest in magnitude. */ /* (d) Computation of the (scaled) r-th column of the inverse using the */ /* twisted factorization obtained by combining the top part of the */ /* the stationary and the bottom part of the progressive transform. */ /* Arguments */ /* ========= */ /* N (input) INTEGER */ /* The order of the matrix L D L^T. */ /* B1 (input) INTEGER */ /* First index of the submatrix of L D L^T. */ /* BN (input) INTEGER */ /* Last index of the submatrix of L D L^T. */ /* LAMBDA (input) DOUBLE PRECISION */ /* The shift. In order to compute an accurate eigenvector, */ /* LAMBDA should be a good approximation to an eigenvalue */ /* of L D L^T. */ /* L (input) DOUBLE PRECISION array, dimension (N-1) */ /* The (n-1) subdiagonal elements of the unit bidiagonal matrix */ /* L, in elements 1 to N-1. */ /* D (input) DOUBLE PRECISION array, dimension (N) */ /* The n diagonal elements of the diagonal matrix D. */ /* LD (input) DOUBLE PRECISION array, dimension (N-1) */ /* The n-1 elements L(i)*D(i). */ /* LLD (input) DOUBLE PRECISION array, dimension (N-1) */ /* The n-1 elements L(i)*L(i)*D(i). */ /* PIVMIN (input) DOUBLE PRECISION */ /* The minimum pivot in the Sturm sequence. */ /* GAPTOL (input) DOUBLE PRECISION */ /* Tolerance that indicates when eigenvector entries are negligible */ /* w.r.t. their contribution to the residual. */ /* Z (input/output) DOUBLE PRECISION array, dimension (N) */ /* On input, all entries of Z must be set to 0. */ /* On output, Z contains the (scaled) r-th column of the */ /* inverse. The scaling is such that Z(R) equals 1. */ /* WANTNC (input) LOGICAL */ /* Specifies whether NEGCNT has to be computed. */ /* NEGCNT (output) INTEGER */ /* If WANTNC is .TRUE. then NEGCNT = the number of pivots < pivmin */ /* in the matrix factorization L D L^T, and NEGCNT = -1 otherwise. */ /* ZTZ (output) DOUBLE PRECISION */ /* The square of the 2-norm of Z. */ /* MINGMA (output) DOUBLE PRECISION */ /* The reciprocal of the largest (in magnitude) diagonal */ /* element of the inverse of L D L^T - sigma I. */ /* R (input/output) INTEGER */ /* The twist index for the twisted factorization used to */ /* compute Z. */ /* On input, 0 <= R <= N. If R is input as 0, R is set to */ /* the index where (L D L^T - sigma I)^{-1} is largest */ /* in magnitude. If 1 <= R <= N, R is unchanged. */ /* On output, R contains the twist index used to compute Z. */ /* Ideally, R designates the position of the maximum entry in the */ /* eigenvector. */ /* ISUPPZ (output) INTEGER array, dimension (2) */ /* The support of the vector in Z, i.e., the vector Z is */ /* nonzero only in elements ISUPPZ(1) through ISUPPZ( 2 ). */ /* NRMINV (output) DOUBLE PRECISION */ /* NRMINV = 1/SQRT( ZTZ ) */ /* RESID (output) DOUBLE PRECISION */ /* The residual of the FP vector. */ /* RESID = ABS( MINGMA )/SQRT( ZTZ ) */ /* RQCORR (output) DOUBLE PRECISION */ /* The Rayleigh Quotient correction to LAMBDA. */ /* RQCORR = MINGMA*TMP */ /* WORK (workspace) DOUBLE PRECISION array, dimension (4*N) */ /* Further Details */ /* =============== */ /* Based on contributions by */ /* Beresford Parlett, University of California, Berkeley, USA */ /* Jim Demmel, University of California, Berkeley, USA */ /* Inderjit Dhillon, University of Texas, Austin, USA */ /* Osni Marques, LBNL/NERSC, USA */ /* Christof Voemel, University of California, Berkeley, USA */ /* ===================================================================== */ /* Parameter adjustments */ --work; --isuppz; --z__; --lld; --ld; --l; --d__; /* Function Body */ eps = dlamch_("Precision"); if (*r__ == 0) { r1 = *b1; r2 = *bn; } else { r1 = *r__; r2 = *r__; } /* Storage for LPLUS */ indlpl = 0; /* Storage for UMINUS */ indumn = *n; inds = (*n << 1) + 1; indp = *n * 3 + 1; if (*b1 == 1) { work[inds] = 0.; } else { work[inds + *b1 - 1] = lld[*b1 - 1]; } /* Compute the stationary transform (using the differential form) */ /* until the index R2. */ sawnan1 = FALSE_; neg1 = 0; s = work[inds + *b1 - 1] - *lambda; i__1 = r1 - 1; for (i__ = *b1; i__ <= i__1; ++i__) { dplus = d__[i__] + s; work[indlpl + i__] = ld[i__] / dplus; if (dplus < 0.) { ++neg1; } work[inds + i__] = s * work[indlpl + i__] * l[i__]; s = work[inds + i__] - *lambda; } sawnan1 = disnan_(&s); if (sawnan1) { goto L60; } i__1 = r2 - 1; for (i__ = r1; i__ <= i__1; ++i__) { dplus = d__[i__] + s; work[indlpl + i__] = ld[i__] / dplus; work[inds + i__] = s * work[indlpl + i__] * l[i__]; s = work[inds + i__] - *lambda; } sawnan1 = disnan_(&s); L60: if (sawnan1) { /* Runs a slower version of the above loop if a NaN is detected */ neg1 = 0; s = work[inds + *b1 - 1] - *lambda; i__1 = r1 - 1; for (i__ = *b1; i__ <= i__1; ++i__) { dplus = d__[i__] + s; if (abs(dplus) < *pivmin) { dplus = -(*pivmin); } work[indlpl + i__] = ld[i__] / dplus; if (dplus < 0.) { ++neg1; } work[inds + i__] = s * work[indlpl + i__] * l[i__]; if (work[indlpl + i__] == 0.) { work[inds + i__] = lld[i__]; } s = work[inds + i__] - *lambda; } i__1 = r2 - 1; for (i__ = r1; i__ <= i__1; ++i__) { dplus = d__[i__] + s; if (abs(dplus) < *pivmin) { dplus = -(*pivmin); } work[indlpl + i__] = ld[i__] / dplus; work[inds + i__] = s * work[indlpl + i__] * l[i__]; if (work[indlpl + i__] == 0.) { work[inds + i__] = lld[i__]; } s = work[inds + i__] - *lambda; } } /* Compute the progressive transform (using the differential form) */ /* until the index R1 */ sawnan2 = FALSE_; neg2 = 0; work[indp + *bn - 1] = d__[*bn] - *lambda; i__1 = r1; for (i__ = *bn - 1; i__ >= i__1; --i__) { dminus = lld[i__] + work[indp + i__]; tmp = d__[i__] / dminus; if (dminus < 0.) { ++neg2; } work[indumn + i__] = l[i__] * tmp; work[indp + i__ - 1] = work[indp + i__] * tmp - *lambda; } tmp = work[indp + r1 - 1]; sawnan2 = disnan_(&tmp); if (sawnan2) { /* Runs a slower version of the above loop if a NaN is detected */ neg2 = 0; i__1 = r1; for (i__ = *bn - 1; i__ >= i__1; --i__) { dminus = lld[i__] + work[indp + i__]; if (abs(dminus) < *pivmin) { dminus = -(*pivmin); } tmp = d__[i__] / dminus; if (dminus < 0.) { ++neg2; } work[indumn + i__] = l[i__] * tmp; work[indp + i__ - 1] = work[indp + i__] * tmp - *lambda; if (tmp == 0.) { work[indp + i__ - 1] = d__[i__] - *lambda; } } } /* Find the index (from R1 to R2) of the largest (in magnitude) */ /* diagonal element of the inverse */ *mingma = work[inds + r1 - 1] + work[indp + r1 - 1]; if (*mingma < 0.) { ++neg1; } if (*wantnc) { *negcnt = neg1 + neg2; } else { *negcnt = -1; } if (abs(*mingma) == 0.) { *mingma = eps * work[inds + r1 - 1]; } *r__ = r1; i__1 = r2 - 1; for (i__ = r1; i__ <= i__1; ++i__) { tmp = work[inds + i__] + work[indp + i__]; if (tmp == 0.) { tmp = eps * work[inds + i__]; } if (abs(tmp) <= abs(*mingma)) { *mingma = tmp; *r__ = i__ + 1; } } /* Compute the FP vector: solve N^T v = e_r */ isuppz[1] = *b1; isuppz[2] = *bn; z__[*r__] = 1.; *ztz = 1.; /* Compute the FP vector upwards from R */ if (! sawnan1 && ! sawnan2) { i__1 = *b1; for (i__ = *r__ - 1; i__ >= i__1; --i__) { z__[i__] = -(work[indlpl + i__] * z__[i__ + 1]); if (((d__1 = z__[i__], abs(d__1)) + (d__2 = z__[i__ + 1], abs( d__2))) * (d__3 = ld[i__], abs(d__3)) < *gaptol) { z__[i__] = 0.; isuppz[1] = i__ + 1; goto L220; } *ztz += z__[i__] * z__[i__]; } L220: ; } else { /* Run slower loop if NaN occurred. */ i__1 = *b1; for (i__ = *r__ - 1; i__ >= i__1; --i__) { if (z__[i__ + 1] == 0.) { z__[i__] = -(ld[i__ + 1] / ld[i__]) * z__[i__ + 2]; } else { z__[i__] = -(work[indlpl + i__] * z__[i__ + 1]); } if (((d__1 = z__[i__], abs(d__1)) + (d__2 = z__[i__ + 1], abs( d__2))) * (d__3 = ld[i__], abs(d__3)) < *gaptol) { z__[i__] = 0.; isuppz[1] = i__ + 1; goto L240; } *ztz += z__[i__] * z__[i__]; } L240: ; } /* Compute the FP vector downwards from R in blocks of size BLKSIZ */ if (! sawnan1 && ! sawnan2) { i__1 = *bn - 1; for (i__ = *r__; i__ <= i__1; ++i__) { z__[i__ + 1] = -(work[indumn + i__] * z__[i__]); if (((d__1 = z__[i__], abs(d__1)) + (d__2 = z__[i__ + 1], abs( d__2))) * (d__3 = ld[i__], abs(d__3)) < *gaptol) { z__[i__ + 1] = 0.; isuppz[2] = i__; goto L260; } *ztz += z__[i__ + 1] * z__[i__ + 1]; } L260: ; } else { /* Run slower loop if NaN occurred. */ i__1 = *bn - 1; for (i__ = *r__; i__ <= i__1; ++i__) { if (z__[i__] == 0.) { z__[i__ + 1] = -(ld[i__ - 1] / ld[i__]) * z__[i__ - 1]; } else { z__[i__ + 1] = -(work[indumn + i__] * z__[i__]); } if (((d__1 = z__[i__], abs(d__1)) + (d__2 = z__[i__ + 1], abs( d__2))) * (d__3 = ld[i__], abs(d__3)) < *gaptol) { z__[i__ + 1] = 0.; isuppz[2] = i__; goto L280; } *ztz += z__[i__ + 1] * z__[i__ + 1]; } L280: ; } /* Compute quantities for convergence test */ tmp = 1. / *ztz; *nrminv = sqrt(tmp); *resid = abs(*mingma) * *nrminv; *rqcorr = *mingma * tmp; return 0; /* End of DLAR1V */ } /* dlar1v_ */
juanjosegarciaripoll/cblapack
src/lapack/dlar1v.c
C
bsd-3-clause
12,170
<?php namespace elisdn\gii\fixture\tests; use yii\db\ActiveRecord; class Post extends ActiveRecord { public static function tableName() { return 'post'; } }
ElisDN/yii2-gii-fixture-generator
tests/Post.php
PHP
bsd-3-clause
180
package com.mattunderscore.trees.base; import static org.junit.Assert.*; import static org.mockito.Mockito.verify; import static org.mockito.MockitoAnnotations.initMocks; import java.util.Iterator; import java.util.NoSuchElementException; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import com.mattunderscore.iterators.SingletonIterator; import com.mattunderscore.trees.mutable.MutableNode; import com.mattunderscore.trees.tree.Node; /** * Unit tests for {@link MutableChildIterator}. * * @author Matt Champion on 29/08/2015 */ public final class MutableChildIteratorTest { @Mock private MutableNode<String> parent; @Mock private MutableNode<String> child; private Iterator<? extends MutableNode<String>> iterator; @Before public void setUp() { initMocks(this); iterator = new SingletonIterator<>(child); } @Test public void hasNext() { final MutableChildIterator<String, MutableNode<String>> mutableIterator = new MutableChildIterator<>(parent, iterator); assertTrue(mutableIterator.hasNext()); mutableIterator.next(); assertFalse(mutableIterator.hasNext()); } @Test(expected = NoSuchElementException.class) public void next() { final MutableChildIterator<String, MutableNode<String>> mutableIterator = new MutableChildIterator<>(parent, iterator); final MutableNode<String> node = mutableIterator.next(); assertSame(child, node); mutableIterator.next(); } @Test public void remove() { final MutableChildIterator<String, MutableNode<String>> mutableIterator = new MutableChildIterator<>(parent, iterator); mutableIterator.next(); mutableIterator.remove(); verify(parent).removeChild(child); } }
mattunderscorechampion/tree-root
trees-basic-nodes/src/test/java/com/mattunderscore/trees/base/MutableChildIteratorTest.java
Java
bsd-3-clause
1,823
// Copyright 2004-present Facebook. All Rights Reserved. #include <vector> #include <string> #include <osquery/core.h> #include <osquery/logger.h> #include <osquery/tables.h> #include "osquery/events/linux/udev.h" namespace osquery { namespace tables { /** * @brief Track udev events in Linux */ class HardwareEventSubscriber : public EventSubscriber { DECLARE_EVENTSUBSCRIBER(HardwareEventSubscriber, UdevEventPublisher); DECLARE_CALLBACK(Callback, UdevEventContext); public: void init(); Status Callback(const UdevEventContextRef ec); }; REGISTER_EVENTSUBSCRIBER(HardwareEventSubscriber); void HardwareEventSubscriber::init() { auto subscription = UdevEventPublisher::createSubscriptionContext(); subscription->action = UDEV_EVENT_ACTION_ALL; BIND_CALLBACK(Callback, subscription); } Status HardwareEventSubscriber::Callback(const UdevEventContextRef ec) { Row r; if (ec->devtype.empty()) { // Superfluous hardware event. return Status(0, "Missing type."); } else if (ec->devnode.empty() && ec->driver.empty()) { return Status(0, "Missing node and driver."); } struct udev_device *device = ec->device; r["action"] = ec->action_string; r["path"] = ec->devnode; r["type"] = ec->devtype; r["driver"] = ec->driver; // UDEV properties. r["model"] = UdevEventPublisher::getValue(device, "ID_MODEL_FROM_DATABASE"); if (r["path"].empty() && r["model"].empty()) { // Don't emit mising path/model combos. return Status(0, "Missing path and model."); } r["model_id"] = INTEGER(UdevEventPublisher::getValue(device, "ID_MODEL_ID")); r["vendor"] = UdevEventPublisher::getValue(device, "ID_VENDOR_FROM_DATABASE"); r["vendor_id"] = INTEGER(UdevEventPublisher::getValue(device, "ID_VENDOR_ID")); r["serial"] = INTEGER(UdevEventPublisher::getValue(device, "ID_SERIAL_SHORT")); r["revision"] = INTEGER(UdevEventPublisher::getValue(device, "ID_REVISION")); r["time"] = INTEGER(ec->time); add(r, ec->time); return Status(0, "OK"); } } }
Anubisss/osquery
osquery/tables/events/linux/hardware_events.cpp
C++
bsd-3-clause
2,025
// Copyright 2018 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. #ifndef CHROME_BROWSER_UI_WEBAUTHN_SHEET_MODELS_H_ #define CHROME_BROWSER_UI_WEBAUTHN_SHEET_MODELS_H_ #include <memory> #include <string> #include "chrome/browser/ui/webauthn/authenticator_request_sheet_model.h" #include "chrome/browser/ui/webauthn/transport_hover_list_model.h" #include "chrome/browser/webauthn/authenticator_request_dialog_model.h" #include "device/fido/pin.h" namespace gfx { struct VectorIcon; } namespace ui { class MenuModel; } class OtherMechanismsMenuModel; // Base class for sheets, implementing the shared behavior used on most sheets, // as well as maintaining a weak pointer to the dialog model. class AuthenticatorSheetModelBase : public AuthenticatorRequestSheetModel, public AuthenticatorRequestDialogModel::Observer { public: explicit AuthenticatorSheetModelBase( AuthenticatorRequestDialogModel* dialog_model); AuthenticatorSheetModelBase(const AuthenticatorSheetModelBase&) = delete; AuthenticatorSheetModelBase& operator=(const AuthenticatorSheetModelBase&) = delete; ~AuthenticatorSheetModelBase() override; AuthenticatorRequestDialogModel* dialog_model() const { return dialog_model_; } // Returns a string containing the RP ID, styled as an origin, truncated to a // reasonable width. static std::u16string GetRelyingPartyIdString( const AuthenticatorRequestDialogModel* dialog_model); protected: // AuthenticatorRequestSheetModel: bool IsActivityIndicatorVisible() const override; bool IsBackButtonVisible() const override; bool IsCancelButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; void OnBack() override; void OnAccept() override; void OnCancel() override; // AuthenticatorRequestDialogModel::Observer: void OnModelDestroyed(AuthenticatorRequestDialogModel* model) override; private: AuthenticatorRequestDialogModel* dialog_model_; }; // The sheet shown for selecting the transport over which the security key // should be accessed. class AuthenticatorMechanismSelectorSheetModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; }; class AuthenticatorInsertAndActivateUsbSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorInsertAndActivateUsbSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorInsertAndActivateUsbSheetModel() override; private: // AuthenticatorSheetModelBase: bool IsActivityIndicatorVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; std::u16string GetAdditionalDescription() const override; ui::MenuModel* GetOtherMechanismsMenuModel() override; std::unique_ptr<OtherMechanismsMenuModel> other_mechanisms_menu_model_; }; class AuthenticatorTimeoutErrorModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; }; class AuthenticatorNoAvailableTransportsErrorModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; }; class AuthenticatorNotRegisteredErrorModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; void OnAccept() override; }; class AuthenticatorAlreadyRegisteredErrorModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; void OnAccept() override; }; class AuthenticatorInternalUnrecognizedErrorSheetModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; void OnAccept() override; }; class AuthenticatorBlePowerOnManualSheetModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; void OnAccept() override; // AuthenticatorRequestDialogModel::Observer: void OnBluetoothPoweredStateChanged() override; }; class AuthenticatorBlePowerOnAutomaticSheetModel : public AuthenticatorSheetModelBase { public: using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; private: // AuthenticatorSheetModelBase: bool IsActivityIndicatorVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; void OnAccept() override; bool busy_powering_on_ble_ = false; }; class AuthenticatorOffTheRecordInterstitialSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorOffTheRecordInterstitialSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorOffTheRecordInterstitialSheetModel() override; private: // AuthenticatorSheetModelBase: const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; ui::MenuModel* GetOtherMechanismsMenuModel() override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; std::u16string GetCancelButtonLabel() const override; void OnAccept() override; std::unique_ptr<OtherMechanismsMenuModel> other_mechanisms_menu_model_; }; class AuthenticatorPaaskSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorPaaskSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorPaaskSheetModel() override; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; bool IsActivityIndicatorVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; ui::MenuModel* GetOtherMechanismsMenuModel() override; std::unique_ptr<OtherMechanismsMenuModel> other_mechanisms_menu_model_; }; class AuthenticatorAndroidAccessorySheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorAndroidAccessorySheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorAndroidAccessorySheetModel() override; private: // AuthenticatorSheetModelBase: bool IsBackButtonVisible() const override; bool IsActivityIndicatorVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; ui::MenuModel* GetOtherMechanismsMenuModel() override; std::unique_ptr<OtherMechanismsMenuModel> other_mechanisms_menu_model_; }; class AuthenticatorClientPinEntrySheetModel : public AuthenticatorSheetModelBase { public: // Indicates whether the view should accommodate changing an existing PIN, // setting up a new PIN or entering an existing one. enum class Mode { kPinChange, kPinEntry, kPinSetup }; AuthenticatorClientPinEntrySheetModel( AuthenticatorRequestDialogModel* dialog_model, Mode mode, device::pin::PINEntryError error); ~AuthenticatorClientPinEntrySheetModel() override; using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; void SetPinCode(std::u16string pin_code); void SetPinConfirmation(std::u16string pin_confirmation); Mode mode() const { return mode_; } private: // AuthenticatorSheetModelBase: const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; std::u16string GetError() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; void OnAccept() override; std::u16string pin_code_; std::u16string pin_confirmation_; std::u16string error_; const Mode mode_; }; class AuthenticatorClientPinTapAgainSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorClientPinTapAgainSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorClientPinTapAgainSheetModel() override; private: // AuthenticatorSheetModelBase: bool IsActivityIndicatorVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; std::u16string GetAdditionalDescription() const override; }; class AuthenticatorBioEnrollmentSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorBioEnrollmentSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorBioEnrollmentSheetModel() override; int max_bio_samples() { return dialog_model()->max_bio_samples().value_or(1); } int bio_samples_remaining() { return dialog_model()->bio_samples_remaining().value_or(1); } private: // AuthenticatorSheetModelBase: bool IsActivityIndicatorVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; bool IsAcceptButtonEnabled() const override; bool IsAcceptButtonVisible() const override; std::u16string GetAcceptButtonLabel() const override; bool IsCancelButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; void OnAccept() override; void OnCancel() override; }; class AuthenticatorRetryUvSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorRetryUvSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorRetryUvSheetModel() override; private: // AuthenticatorSheetModelBase: bool IsActivityIndicatorVisible() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; std::u16string GetError() const override; }; // Generic error dialog that allows starting the request over. class AuthenticatorGenericErrorSheetModel : public AuthenticatorSheetModelBase { public: static std::unique_ptr<AuthenticatorGenericErrorSheetModel> ForClientPinErrorSoftBlock(AuthenticatorRequestDialogModel* dialog_model); static std::unique_ptr<AuthenticatorGenericErrorSheetModel> ForClientPinErrorHardBlock(AuthenticatorRequestDialogModel* dialog_model); static std::unique_ptr<AuthenticatorGenericErrorSheetModel> ForClientPinErrorAuthenticatorRemoved( AuthenticatorRequestDialogModel* dialog_model); static std::unique_ptr<AuthenticatorGenericErrorSheetModel> ForMissingCapability(AuthenticatorRequestDialogModel* dialog_model); static std::unique_ptr<AuthenticatorGenericErrorSheetModel> ForStorageFull( AuthenticatorRequestDialogModel* dialog_model); private: AuthenticatorGenericErrorSheetModel( AuthenticatorRequestDialogModel* dialog_model, std::u16string title, std::u16string description); // AuthenticatorSheetModelBase: bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; bool IsBackButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; void OnAccept() override; std::u16string title_; std::u16string description_; }; class AuthenticatorResidentCredentialConfirmationSheetView : public AuthenticatorSheetModelBase { public: explicit AuthenticatorResidentCredentialConfirmationSheetView( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorResidentCredentialConfirmationSheetView() override; private: // AuthenticatorSheetModelBase: const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; bool IsBackButtonVisible() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; void OnAccept() override; }; // The sheet shown when the user needs to select an account. class AuthenticatorSelectAccountSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorSelectAccountSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorSelectAccountSheetModel() override; // Set the index of the currently selected row. void SetCurrentSelection(int selected); // AuthenticatorSheetModelBase: void OnAccept() override; private: // AuthenticatorSheetModelBase: const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; size_t selected_ = 0; }; class AttestationPermissionRequestSheetModel : public AuthenticatorSheetModelBase { public: explicit AttestationPermissionRequestSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AttestationPermissionRequestSheetModel() override; // AuthenticatorSheetModelBase: void OnAccept() override; void OnCancel() override; private: // AuthenticatorSheetModelBase: const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; bool IsBackButtonVisible() const override; bool IsAcceptButtonVisible() const override; bool IsAcceptButtonEnabled() const override; std::u16string GetAcceptButtonLabel() const override; bool IsCancelButtonVisible() const override; std::u16string GetCancelButtonLabel() const override; }; class EnterpriseAttestationPermissionRequestSheetModel : public AttestationPermissionRequestSheetModel { public: explicit EnterpriseAttestationPermissionRequestSheetModel( AuthenticatorRequestDialogModel* dialog_model); private: // AuthenticatorSheetModelBase: std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; }; class AuthenticatorQRSheetModel : public AuthenticatorSheetModelBase { public: explicit AuthenticatorQRSheetModel( AuthenticatorRequestDialogModel* dialog_model); ~AuthenticatorQRSheetModel() override; private: // AuthenticatorSheetModelBase: const gfx::VectorIcon& GetStepIllustration( ImageColorScheme color_scheme) const override; std::u16string GetStepTitle() const override; std::u16string GetStepDescription() const override; }; #endif // CHROME_BROWSER_UI_WEBAUTHN_SHEET_MODELS_H_
scheib/chromium
chrome/browser/ui/webauthn/sheet_models.h
C
bsd-3-clause
18,896
package com.spm.store; import java.io.Serializable; import java.util.List; import android.content.Context; /** * * @author Agustin Sgarlata * @param <T> */ public class DbProvider<T extends Serializable> extends Db4oHelper { public Class<T> persistentClass; public DbProvider(Class<T> persistentClass, Context ctx) { super(ctx); this.persistentClass = persistentClass; } public void store(T obj) { db().store(obj); db().commit(); } public void delete(T obj) { db().delete(obj); db().commit(); } public List<T> findAll() { return db().query(persistentClass); } public List<T> get(T obj) { return db().queryByExample(obj); } }
mural/spm
SPM/src/main/java/com/spm/store/DbProvider.java
Java
bsd-3-clause
670
package main /* * CSCI 4229 Assignment 5: Lighting * * Author: Zach Anders * * Some code derived from CSCI 4229 Examples 9, 10, and 13 (ex9.c, ex10.c, ex13.c) * * Code for 2D text display (due to missing windowpos2i) based off some example code * at http://programmingexamples.net/wiki/OpenGL/Text */ import ( "actor" "entity" "math/rand" "os" "runtime" "time" "glutil" "util" "world" "github.com/go-gl/gl" "github.com/ianremmler/ode" "github.com/rhencke/glut" ) var renderQueue util.RenderQueue = util.NewEmptyRenderQueue() //var currentCamera = CreateDefaultViewport() var my_world = world.NewWorld() var player = actor.NewPlayer(&my_world, glutil.Point3D{0, 0, 0}, 5) var light actor.OrbitActor var currentMouse = glutil.CreateMouseState() // Normal order: //Translate -> Rotate -> Scale // Creates the display function func DisplayFunc() { gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT) gl.Enable(gl.DEPTH_TEST) gl.LoadIdentity() // currentCamera.PositionSelf() player.PositionSelf() my_world.Tick() renderQueue.RenderAll() gl.Disable(gl.DEPTH_TEST) gl.Disable(gl.LIGHTING) gl.Color3f(.9, .9, .9) glutil.Print2d(5, 35, "Keys: W,S,A,D : Move Around | Q / E : Move Light left/right | L : Toggle light rotation") glutil.Print2d(5, 20, "Click and Drag: Rotate | Arrow keys: Rotate") glutil.Print2d(5, 5, "%s", player.ToString()) gl.Flush() glut.SwapBuffers() } // Creates the key handler function func KeyDownFunc(ch byte, x int, y int) { switch ch { case 27: os.Exit(0) break case 's': player.Translate(-2.5, 0.0, 0.0) break case 'w': player.Translate(2.5, 0.0, 0.0) break case 'd': player.Translate(0.0, 0.0, -2.5) break case 'a': player.Translate(0.0, 0.0, 2.5) break case 'q': light.AdjustAngle(-5) break case 'e': light.AdjustAngle(5) break case 'l': light.Toggle() break } glut.PostRedisplay() } // Creates the special key handler function func SpecialFunc(key int, x int, y int) { // Phi: Elevation, Theta: Azimuth if key == glut.KEY_RIGHT { player.Rotate(10, 0) } else if key == glut.KEY_LEFT { player.Rotate(-10, 0) } else if key == glut.KEY_UP { player.Rotate(0, 10) } else if key == glut.KEY_DOWN { player.Rotate(0, -10) } // Tell GLUT it is necessary to redisplay the scene glut.PostRedisplay() } func MouseMotion(x, y int) { if currentMouse.LeftDown { horiz_delta := currentMouse.X - x vert_delta := currentMouse.Y - y player.Rotate(int32(horiz_delta)/-5, int32(vert_delta)/5) player.ImmediateLook() } currentMouse.X, currentMouse.Y = x, y } func MouseDown(button, state, x, y int) { currentMouse.X, currentMouse.Y = x, y switch button { case glut.LEFT_BUTTON: currentMouse.LeftDown = (state == glut.DOWN) break case glut.MIDDLE_BUTTON: currentMouse.MiddleDown = (state == glut.DOWN) break case glut.RIGHT_BUTTON: currentMouse.RightDown = (state == glut.DOWN) break } } /* * GLUT calls this routine when the window is resized */ func Reshape(width int, height int) { asp := float64(1) // Ratio of the width to the height of the window if height > 0 { asp = float64(width) / float64(height) } // Set the viewport to the entire window gl.Viewport(0, 0, width, height) player.GetProjection().AspectRatio = asp player.GetProjection().SetProjectionMatrix() } // Idler function. Called whenever GLUT is idle. func IdleFunc() { s_time := glut.Get(glut.ELAPSED_TIME) glut.PostRedisplay() e_time := glut.Get(glut.ELAPSED_TIME) - s_time if e_time < 33 { time.Sleep(time.Duration(33-e_time) * time.Millisecond) } } func setup() { lightsource := actor.NewBallLight(&my_world, glutil.Point3D{15, 15, 15}) renderQueue.AddNamed(&lightsource, "light") light = actor.NewOrbitActor(&my_world, &lightsource, glutil.Point3D{0, 15, 0}, 50) my_world.AddActor(&light) rand.Seed(0x12345 + 8) my_world.AddActor(&player) block := actor.NewBlock(&my_world, glutil.Point3D{22, 0, 0}, glutil.Point3D{10, 20.5, 20}, glutil.Color4D{.5, .3, .1, 1}) my_world.AddActor(&block) renderQueue.Add(&block) tmpList := []actor.OrbitActor{} for i := 0; i < 250; i++ { speed := rand.Intn(3) //radius := rand.Intn(50) + 125 radius := 100 x, y, z := float64(rand.Intn(10)-5), float64(rand.Intn(10)-5), float64(rand.Intn(150)-75) angle := float64(rand.Intn(360)) //cylinder := NewCylinder(&my_world, glutil.Point3D{x, y + 30, z}, 1, 4) cylinder := actor.NewBlock(&my_world, glutil.Point3D{x, y + 30, z}, glutil.Point3D{.1, .1, .1}, glutil.Color4D{.8, .8, .8, .05}) tmpList = append(tmpList, actor.NewOrbitActor(&my_world, &cylinder, glutil.Point3D{x, y + 0, z}, float64(radius))) tmpList[i].SetSpeed(int32(speed)) tmpList[i].SetAngle(int32(angle)) tmpList[i].SetAxis(glutil.Point3D{0, 0, 1}) renderQueue.Add(&cylinder) my_world.AddActor(&tmpList[i]) } // Create castle //myCastle := NewCastle() //renderQueue.AddNamed(&myCastle, "castle") // Create ground ground := entity.NewXYPlane(glutil.Point3D{100, 0, 100}, glutil.Point3D{-100, 0, -100}, 0) ground.SetColor(glutil.Color4D{0.4313725490 * .7, 0.24705882 * .7, 0.098039215 * .7, 1}) ground.SetPolygonOffset(1.0) renderQueue.Add(&ground) my_world.AddEntity(&ground.Box) stairs := actor.NewStairs(&my_world, glutil.Point3D{0, 0, 0}) renderQueue.Add(&stairs) scale := float64(200) for i := 0; i < 100; i++ { x := (rand.Float64() * scale) - (scale / 2) z := (rand.Float64() * scale) - (scale / 2) x_scale, z_scale := (rand.Float64()/2)+.75, (rand.Float64()/2)+.75 y_scale := (rand.Float64() * 1) + .75 if (x < -5 || x > 20) && (z < -5 || z > 20) { tree1 := entity.NewTree(glutil.Point3D{x, 0, z}, x_scale, y_scale, z_scale) renderQueue.Add(&tree1) } } // Put camera somewhere //currentCamera.Translate(5, -5, 28) player.Translate(10, 0, -20) player.ImmediateJump() // Skip interpolation player.Rotate(-120, 0) player.ImmediateLook() // Skip interpolation } func main() { // Let go use 2 threads runtime.GOMAXPROCS(2) // Init glut.InitDisplayMode(glut.RGB | glut.DOUBLE | glut.DEPTH) glut.InitWindowSize(750, 750) glut.CreateWindow("Zach Anders - Assignment 5") setup() // Display Callbacks glut.DisplayFunc(DisplayFunc) glut.IdleFunc(IdleFunc) glut.ReshapeFunc(Reshape) // Input Callbacks glut.SpecialFunc(SpecialFunc) glut.KeyboardFunc(KeyDownFunc) glut.MotionFunc(MouseMotion) glut.MouseFunc(MouseDown) glut.MainLoop() }
ZachAnders/Graphics_HW5_lighting
src/main/scene_main.go
GO
bsd-3-clause
6,411
from django import forms from ncdjango.interfaces.arcgis.form_fields import SrField class PointForm(forms.Form): x = forms.FloatField() y = forms.FloatField() projection = SrField()
consbio/ncdjango
ncdjango/interfaces/data/forms.py
Python
bsd-3-clause
195
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="lang:clipboard.copy" content="Copy to clipboard"> <meta name="lang:clipboard.copied" content="Copied to clipboard"> <meta name="lang:search.language" content="en"> <meta name="lang:search.pipeline.stopwords" content="True"> <meta name="lang:search.pipeline.trimmer" content="True"> <meta name="lang:search.result.none" content="No matching documents"> <meta name="lang:search.result.one" content="1 matching document"> <meta name="lang:search.result.other" content="# matching documents"> <meta name="lang:search.tokenizer" content="[\s\-]+"> <link href="https://fonts.gstatic.com/" rel="preconnect" crossorigin> <link href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,500,700|Roboto:300,400,400i,700&display=fallback" rel="stylesheet"> <style> body, input { font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif } code, kbd, pre { font-family: "Roboto Mono", "Courier New", Courier, monospace } </style> <link rel="stylesheet" href="../_static/stylesheets/application.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-palette.css"/> <link rel="stylesheet" href="../_static/stylesheets/application-fixes.css"/> <link rel="stylesheet" href="../_static/fonts/material-icons.css"/> <meta name="theme-color" content="#3f51b5"> <script src="../_static/javascripts/modernizr.js"></script> <title>statsmodels.sandbox.regression.gmm.NonlinearIVGMM.endog_names &#8212; statsmodels</title> <link rel="icon" type="image/png" sizes="32x32" href="../_static/icons/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="../_static/icons/favicon-16x16.png"> <link rel="manifest" href="../_static/icons/site.webmanifest"> <link rel="mask-icon" href="../_static/icons/safari-pinned-tab.svg" color="#919191"> <meta name="msapplication-TileColor" content="#2b5797"> <meta name="msapplication-config" content="../_static/icons/browserconfig.xml"> <link rel="stylesheet" href="../_static/stylesheets/examples.css"> <link rel="stylesheet" href="../_static/stylesheets/deprecation.css"> <link rel="stylesheet" type="text/css" href="../_static/pygments.css" /> <link rel="stylesheet" type="text/css" href="../_static/material.css" /> <link rel="stylesheet" type="text/css" href="../_static/graphviz.css" /> <link rel="stylesheet" type="text/css" href="../_static/plot_directive.css" /> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script> <link rel="shortcut icon" href="../_static/favicon.ico"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.exog_names" href="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.exog_names.html" /> <link rel="prev" title="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.start_weights" href="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.start_weights.html" /> </head> <body dir=ltr data-md-color-primary=indigo data-md-color-accent=blue> <svg class="md-svg"> <defs data-children-count="0"> <svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg> </defs> </svg> <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer"> <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search"> <label class="md-overlay" data-md-component="overlay" for="__drawer"></label> <a href="#generated/statsmodels.sandbox.regression.gmm.NonlinearIVGMM.endog_names" tabindex="1" class="md-skip"> Skip to content </a> <header class="md-header" data-md-component="header"> <nav class="md-header-nav md-grid"> <div class="md-flex navheader"> <div class="md-flex__cell md-flex__cell--shrink"> <a href="../index.html" title="statsmodels" class="md-header-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" height="26" alt="statsmodels logo"> </a> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label> </div> <div class="md-flex__cell md-flex__cell--stretch"> <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title"> <span class="md-header-nav__topic">statsmodels v0.13.1</span> <span class="md-header-nav__topic"> statsmodels.sandbox.regression.gmm.NonlinearIVGMM.endog_names </span> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label> <div class="md-search" data-md-component="search" role="dialog"> <label class="md-search__overlay" for="__search"></label> <div class="md-search__inner" role="search"> <form class="md-search__form" action="../search.html" method="get" name="search"> <input type="text" class="md-search__input" name="q" placeholder="Search" autocapitalize="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active"> <label class="md-icon md-search__icon" for="__search"></label> <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1"> &#xE5CD; </button> </form> <div class="md-search__output"> <div class="md-search__scrollwrap" data-md-scrollfix> <div class="md-search-result" data-md-component="result"> <div class="md-search-result__meta"> Type to start searching </div> <ol class="md-search-result__list"></ol> </div> </div> </div> </div> </div> </div> <div class="md-flex__cell md-flex__cell--shrink"> <div class="md-header-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> </div> <script src="../_static/javascripts/version_dropdown.js"></script> <script> var json_loc = "../../versions-v2.json", target_loc = "../../", text = "Versions"; $( document ).ready( add_version_dropdown(json_loc, target_loc, text)); </script> </div> </nav> </header> <div class="md-container"> <nav class="md-tabs" data-md-component="tabs"> <div class="md-tabs__inner md-grid"> <ul class="md-tabs__list"> <li class="md-tabs__item"><a href="../user-guide.html" class="md-tabs__link">User Guide</a></li> <li class="md-tabs__item"><a href="../gmm.html" class="md-tabs__link">Generalized Method of Moments <code class="xref py py-mod docutils literal notranslate"><span class="pre">gmm</span></code></a></li> <li class="md-tabs__item"><a href="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.html" class="md-tabs__link">statsmodels.sandbox.regression.gmm.NonlinearIVGMM</a></li> </ul> </div> </nav> <main class="md-main"> <div class="md-main__inner md-grid" data-md-component="container"> <div class="md-sidebar md-sidebar--primary" data-md-component="navigation"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--primary" data-md-level="0"> <label class="md-nav__title md-nav__title--site" for="__drawer"> <a href="../index.html" title="statsmodels" class="md-nav__button md-logo"> <img src="../_static/statsmodels-logo-v2-bw.svg" alt=" logo" width="48" height="48"> </a> <a href="../index.html" title="statsmodels">statsmodels v0.13.1</a> </label> <div class="md-nav__source"> <a href="https://github.com/statsmodels/statsmodels" title="Go to repository" class="md-source" data-md-source="github"> <div class="md-source__icon"> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="28" height="28"> <use xlink:href="#__github" width="24" height="24"></use> </svg> </div> <div class="md-source__repository"> statsmodels </div> </a> </div> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../install.html" class="md-nav__link">Installing statsmodels</a> </li> <li class="md-nav__item"> <a href="../gettingstarted.html" class="md-nav__link">Getting started</a> </li> <li class="md-nav__item"> <a href="../user-guide.html" class="md-nav__link">User Guide</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../user-guide.html#background" class="md-nav__link">Background</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#regression-and-linear-models" class="md-nav__link">Regression and Linear Models</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#time-series-analysis" class="md-nav__link">Time Series Analysis</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#other-models" class="md-nav__link">Other Models</a> <ul class="md-nav__list"> <li class="md-nav__item"> <a href="../duration.html" class="md-nav__link">Methods for Survival and Duration Analysis</a> </li> <li class="md-nav__item"> <a href="../nonparametric.html" class="md-nav__link">Nonparametric Methods <code class="xref py py-mod docutils literal notranslate"><span class="pre">nonparametric</span></code></a> </li> <li class="md-nav__item"> <a href="../gmm.html" class="md-nav__link">Generalized Method of Moments <code class="xref py py-mod docutils literal notranslate"><span class="pre">gmm</span></code></a> </li> <li class="md-nav__item"> <a href="../miscmodels.html" class="md-nav__link">Other Models <code class="xref py py-mod docutils literal notranslate"><span class="pre">miscmodels</span></code></a> </li> <li class="md-nav__item"> <a href="../multivariate.html" class="md-nav__link">Multivariate Statistics <code class="xref py py-mod docutils literal notranslate"><span class="pre">multivariate</span></code></a> </li></ul> </li> <li class="md-nav__item"> <a href="../user-guide.html#statistics-and-tools" class="md-nav__link">Statistics and Tools</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#data-sets" class="md-nav__link">Data Sets</a> </li> <li class="md-nav__item"> <a href="../user-guide.html#sandbox" class="md-nav__link">Sandbox</a> </li></ul> </li> <li class="md-nav__item"> <a href="../examples/index.html" class="md-nav__link">Examples</a> </li> <li class="md-nav__item"> <a href="../api.html" class="md-nav__link">API Reference</a> </li> <li class="md-nav__item"> <a href="../about.html" class="md-nav__link">About statsmodels</a> </li> <li class="md-nav__item"> <a href="../dev/index.html" class="md-nav__link">Developer Page</a> </li> <li class="md-nav__item"> <a href="../release/index.html" class="md-nav__link">Release Notes</a> </li> </ul> </nav> </div> </div> </div> <div class="md-sidebar md-sidebar--secondary" data-md-component="toc"> <div class="md-sidebar__scrollwrap"> <div class="md-sidebar__inner"> <nav class="md-nav md-nav--secondary"> <ul class="md-nav__list" data-md-scrollfix=""> <li class="md-nav__item"><a class="md-nav__extra_link" href="../_sources/generated/statsmodels.sandbox.regression.gmm.NonlinearIVGMM.endog_names.rst.txt">Show Source</a> </li> <li id="searchbox" class="md-nav__item"></li> </ul> </nav> </div> </div> </div> <div class="md-content"> <article class="md-content__inner md-typeset" role="main"> <section id="statsmodels-sandbox-regression-gmm-nonlinearivgmm-endog-names"> <h1 id="generated-statsmodels-sandbox-regression-gmm-nonlinearivgmm-endog-names--page-root">statsmodels.sandbox.regression.gmm.NonlinearIVGMM.endog_names<a class="headerlink" href="#generated-statsmodels-sandbox-regression-gmm-nonlinearivgmm-endog-names--page-root" title="Permalink to this headline">¶</a></h1> <dl class="py property"> <dt class="sig sig-object py" id="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.endog_names"> <em class="property"><span class="pre">property</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">NonlinearIVGMM.</span></span><span class="sig-name descname"><span class="pre">endog_names</span></span><a class="headerlink" href="#statsmodels.sandbox.regression.gmm.NonlinearIVGMM.endog_names" title="Permalink to this definition">¶</a></dt> <dd><p>Names of endogenous variables.</p> </dd></dl> </section> </article> </div> </div> </main> </div> <footer class="md-footer"> <div class="md-footer-nav"> <nav class="md-footer-nav__inner md-grid"> <a href="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.start_weights.html" title="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.start_weights" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev"> <div class="md-flex__cell md-flex__cell--shrink"> <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i> </div> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"> <span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Previous </span> statsmodels.sandbox.regression.gmm.NonlinearIVGMM.start_weights </span> </div> </a> <a href="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.exog_names.html" title="statsmodels.sandbox.regression.gmm.NonlinearIVGMM.exog_names" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next"> <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title"><span class="md-flex__ellipsis"> <span class="md-footer-nav__direction"> Next </span> statsmodels.sandbox.regression.gmm.NonlinearIVGMM.exog_names </span> </div> <div class="md-flex__cell md-flex__cell--shrink"><i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i> </div> </a> </nav> </div> <div class="md-footer-meta md-typeset"> <div class="md-footer-meta__inner md-grid"> <div class="md-footer-copyright"> <div class="md-footer-copyright__highlight"> &#169; Copyright 2009-2019, Josef Perktold, Skipper Seabold, Jonathan Taylor, statsmodels-developers. </div> Last updated on Nov 12, 2021. <br/> Created using <a href="http://www.sphinx-doc.org/">Sphinx</a> 4.3.0. and <a href="https://github.com/bashtage/sphinx-material/">Material for Sphinx</a> </div> </div> </div> </footer> <script src="../_static/javascripts/application.js"></script> <script>app.initialize({version: "1.0.4", url: {base: ".."}})</script> </body> </html>
statsmodels/statsmodels.github.io
v0.13.1/generated/statsmodels.sandbox.regression.gmm.NonlinearIVGMM.endog_names.html
HTML
bsd-3-clause
18,305