code
stringlengths 3
1.01M
| repo_name
stringlengths 5
116
| path
stringlengths 3
311
| language
stringclasses 30
values | license
stringclasses 15
values | size
int64 3
1.01M
|
|---|---|---|---|---|---|
import tornado.ioloop
from functools import partial
from tornado.testing import AsyncTestCase
from elasticsearch_tornado import ClusterClient
try:
# python 2.6
from unittest2 import TestCase, SkipTest
except ImportError:
from unittest import TestCase, SkipTest
class ClusterClientTest(AsyncTestCase):
def handle_cb(self, req, **kwargs):
if kwargs.get('codes'):
cl = [200, 201] + kwargs.get('codes')
self.assertTrue(req.code in cl)
else:
self.assertTrue(req.code in (200, 201, ))
self.stop()
def test_health(self):
c = ClusterClient()
c.cluster_health(callback=self.handle_cb)
self.wait()
def test_pending_tasks(self):
c = ClusterClient()
c.cluster_pending_tasks(callback=self.handle_cb)
self.wait()
def test_state(self):
c = ClusterClient()
c.cluster_state(callback=self.handle_cb)
self.wait()
def test_stats(self):
c = ClusterClient()
c.cluster_stats(callback=self.handle_cb)
self.wait()
def test_reroute(self):
c = ClusterClient()
h_cb = partial(
self.handle_cb,
**{'codes':[400, 404]}
)
body = """
{
"commands" : [ {
"move" :
{
"index" : "test", "shard" : 0,
"from_node" : "node1", "to_node" : "node2"
}
},
{
"allocate" : {
"index" : "test", "shard" : 1, "node" : "node3"
}
}
]
}
"""
c.cluster_reroute(body, callback=h_cb)
self.wait()
def test_get_settings(self):
c = ClusterClient()
c.cluster_get_settings(callback=self.handle_cb)
self.wait()
def test_put_settings(self):
c = ClusterClient()
body = """
{
"persistent" : {
"discovery.zen.minimum_master_nodes" : 1
}
}
"""
c.cluster_put_settings(body, callback=self.handle_cb)
self.wait()
|
hodgesds/elasticsearch_tornado
|
tests/test_cluster.py
|
Python
|
apache-2.0
| 2,219
|
<?php
include('head.php');
if(isset($_GET['from'])){
$from=$_GET['from'];
}
else{
$from=date("Y");
}
?>
<a id="prev" href="view_calendar.php?from=<?php echo $from-1;?>"><img src="img/left.png" style="height:35px;position:absolute;left:10px;"></a>
<a id="next" href="view_calendar.php?from=<?php echo $from+1;?>"><img src="img/right.png" style="height:35px;position:absolute;right:10px;"></a>
<div class="container">
<!-- Jumbotron Header -->
<header class="move jumbotron hero-spacer" style="padding:10px;height:750px; width:95%;margin:auto;">
<iframe scrolling="no" seamless="seamless" style="width:100%;height:100%;border:none;" src="calendar.php?from=<?php echo $from;?>"></iframe>
</header>
<?php
include('foot.php');
?>
|
oghanek/UXClass-Bamboo
|
view_calendar.php
|
PHP
|
apache-2.0
| 800
|
/*
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.social.connect.web.test;
import static org.springframework.social.connect.web.test.StubOAuthTemplateBehavior.*;
import org.springframework.social.connect.support.OAuth1ConnectionFactory;
public class StubOAuth1ConnectionFactory extends OAuth1ConnectionFactory<TestApi1> {
public StubOAuth1ConnectionFactory(String clientId, String clientSecret) {
this(clientId, clientSecret, NO_EXCEPTION);
}
public StubOAuth1ConnectionFactory(String clientId, String clientSecret, StubOAuthTemplateBehavior behavior) {
super("oauth1Provider", new StubOAuth1ServiceProvider(clientId, clientSecret, behavior), null);
}
}
|
spring-projects/spring-social
|
spring-social-web/src/test/java/org/springframework/social/connect/web/test/StubOAuth1ConnectionFactory.java
|
Java
|
apache-2.0
| 1,265
|
<?php
header("Content-Type: text/html; charset=UTF-8");
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
require_once $root.'/config.inc.php';
require_once $root.'/inc/checksession.php';
require_once $root.'/inc/dbconnect.php';
if (isset($_SESSION['login']))
{
$login = $_SESSION['login'];
$stmt = $connexion->prepare("select count(*) as 'exist' from users where `casLogin` = :login");
$stmt->bindParam(':login', $login);
$stmt-> execute();
$userInDB = $stmt -> fetch();
if(!$userInDB['exist'])
{
$currentAddr = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
if ($currentAddr != $_CONFIG['home'])
header('Location: '.$_CONFIG['home'].'account/index.php');
}
}
else
{
$currentAddr = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
if ($currentAddr != $_CONFIG['home'])
header('Location: '.$_CONFIG['home']);
}
?>
|
DEKHTIARJonathan/BilletterieUTC
|
inc/checkaccount.php
|
PHP
|
apache-2.0
| 1,012
|
/* @flow */
export default {
id: 'import-syntax',
title: 'Import Syntax',
description: `\`\`\`
import Menu, { MenuGroup } from 'mineral-ui/Menu';
\`\`\``
};
|
mineral-ui/mineral-ui
|
src/website/app/demos/Menu/MenuGroup/examples/importSyntax.js
|
JavaScript
|
apache-2.0
| 163
|
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights
* Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.cognitoidentity.model.transform;
import java.io.ByteArrayInputStream;
import java.util.Collections;
import java.util.Map;
import java.util.List;
import java.util.regex.Pattern;
import com.amazonaws.AmazonClientException;
import com.amazonaws.Request;
import com.amazonaws.DefaultRequest;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.cognitoidentity.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.util.BinaryUtils;
import com.amazonaws.util.StringUtils;
import com.amazonaws.util.IdempotentUtils;
import com.amazonaws.util.StringInputStream;
import com.amazonaws.util.json.*;
/**
* GetOpenIdTokenForDeveloperIdentityRequest Marshaller
*/
public class GetOpenIdTokenForDeveloperIdentityRequestMarshaller
implements
Marshaller<Request<GetOpenIdTokenForDeveloperIdentityRequest>, GetOpenIdTokenForDeveloperIdentityRequest> {
public Request<GetOpenIdTokenForDeveloperIdentityRequest> marshall(
GetOpenIdTokenForDeveloperIdentityRequest getOpenIdTokenForDeveloperIdentityRequest) {
if (getOpenIdTokenForDeveloperIdentityRequest == null) {
throw new AmazonClientException(
"Invalid argument passed to marshall(...)");
}
Request<GetOpenIdTokenForDeveloperIdentityRequest> request = new DefaultRequest<GetOpenIdTokenForDeveloperIdentityRequest>(
getOpenIdTokenForDeveloperIdentityRequest,
"AmazonCognitoIdentity");
request.addHeader("X-Amz-Target",
"AWSCognitoIdentityService.GetOpenIdTokenForDeveloperIdentity");
request.setHttpMethod(HttpMethodName.POST);
request.setResourcePath("");
try {
final StructuredJsonGenerator jsonGenerator = SdkJsonProtocolFactory
.createWriter(false, "1.1");
jsonGenerator.writeStartObject();
if (getOpenIdTokenForDeveloperIdentityRequest.getIdentityPoolId() != null) {
jsonGenerator.writeFieldName("IdentityPoolId").writeValue(
getOpenIdTokenForDeveloperIdentityRequest
.getIdentityPoolId());
}
if (getOpenIdTokenForDeveloperIdentityRequest.getIdentityId() != null) {
jsonGenerator.writeFieldName("IdentityId").writeValue(
getOpenIdTokenForDeveloperIdentityRequest
.getIdentityId());
}
java.util.Map<String, String> loginsMap = getOpenIdTokenForDeveloperIdentityRequest
.getLogins();
if (loginsMap != null) {
jsonGenerator.writeFieldName("Logins");
jsonGenerator.writeStartObject();
for (Map.Entry<String, String> loginsMapValue : loginsMap
.entrySet()) {
if (loginsMapValue.getValue() != null) {
jsonGenerator.writeFieldName(loginsMapValue.getKey());
jsonGenerator.writeValue(loginsMapValue.getValue());
}
}
jsonGenerator.writeEndObject();
}
if (getOpenIdTokenForDeveloperIdentityRequest.getTokenDuration() != null) {
jsonGenerator.writeFieldName("TokenDuration").writeValue(
getOpenIdTokenForDeveloperIdentityRequest
.getTokenDuration());
}
jsonGenerator.writeEndObject();
byte[] content = jsonGenerator.getBytes();
request.setContent(new ByteArrayInputStream(content));
request.addHeader("Content-Length",
Integer.toString(content.length));
request.addHeader("Content-Type", jsonGenerator.getContentType());
} catch (Throwable t) {
throw new AmazonClientException(
"Unable to marshall request to JSON: " + t.getMessage(), t);
}
return request;
}
}
|
mhurne/aws-sdk-java
|
aws-java-sdk-cognitoidentity/src/main/java/com/amazonaws/services/cognitoidentity/model/transform/GetOpenIdTokenForDeveloperIdentityRequestMarshaller.java
|
Java
|
apache-2.0
| 4,656
|
C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C SOLVER : BiCG Stabilized 11.02.97
C (d'après Templates)
C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
SUBROUTINE BICGSTAB(N, x, b, A, IA, JA, ALU, JLU, JU,
# epsilon,it_max,r,r2,p,p2,s,s2,t,v,
# IFLAG,ierr)
C
IMPLICIT REAL*8(A-H,O-Z)
C
DIMENSION A(*), ALU(*), IA(*), JA(*), JLU(*), JU(*),
# b(N), x(N),
# r(N), r2(N), p(N), p2(N),
# s(N), s2(N), t(N), v(N)
C
C------------------------------------------------------------
C
C Compute r0 & tol
C ----------------
CALL SMMV(N, A, IA, JA, x, r)
CALL VectSub(N, b, r, r)
C
residu=VectNorm(N,r)
tol=epsilon*residu
C
C Choose r20 = r0
C ---------------
CALL VectAssign(N,r2,r)
C
j=0
open(UNIT = 1, FILE = 'ite.m', STATUS = 'unknown')
C
C------------------------------------------------------------
C Boucle principale
C--------------------------------------------------------
C
10 j=j+1
C
WRITE(*,210)j, residu
WRITE(1,*)'residu3(',j,')=',residu,';'
C
C Calcul du rho et test du breakdown
C ----------------------------------
rho=ProdScal(N,r,r2)
IF (rho.EQ.(0.0D0)) THEN
WRITE(*,*)'Breakdown!'
ierr=1
GOTO 999
ENDIF
C
C Calcul de la direction de recherche
C -----------------------------------
IF (j.EQ.1) THEN
CALL VectAssign(N,p,r)
ELSE
beta=(rho/rho2)*(alpha/womega)
DO i=1,N
p(i) = r(i) + beta * (p(i) - womega * v(i))
ENDDO
ENDIF
C
C Préconditionnement
C ------------------
IF(IFLAG.NE.0) THEN
CALL lusol(n, p, p2, alu, jlu, ju)
ELSE
CALL VectAssign(N,p2,p)
ENDIF
C
CALL SMMV(N, A, IA, JA, p2, v)
C
C Calcul de alpha
C ---------------
alpha=ProdScal(N,r2,v)
alpha=rho/alpha
C
C Calcul de s
C -----------
DO i=1,N
s(i)=r(i)-alpha*v(i)
ENDDO
C
C Teste la norme de s
C -------------------
C (à faire)
C
C Préconditionnement
C ------------------
IF(IFLAG.NE.0) THEN
CALL lusol(n, s, s2, alu, jlu, ju)
ELSE
CALL VectAssign(N,s2,s)
ENDIF
C
CALL SMMV(N, A, IA, JA, s2, t)
C
womega=ProdScal(N,t,t)
womega=ProdScal(N,t,s)/womega
C
C Mise à jour de la solution et des résidus
C -----------------------------------------
DO i=1,N
x(i) = x(i) + alpha * p2(i) + womega * s2(i)
r(i) = s(i) - womega * t(i)
ENDDO
C
rho2=rho
C
C Teste la convergence
C --------------------
residu=VectNorm(N,r)
IF(residu.LT.tol) THEN
WRITE(*,*)'Convergence!'
ierr=0
GOTO 999
ENDIF
IF(j.EQ.it_max) THEN
WRITE(*,*)'it_max atteint!'
ierr=1
GOTO 999
ENDIF
C
GOTO 10
C------------------------------------------------------------
999 close(unit=1)
RETURN
C
210 FORMAT(' Iteration :',T14,I4,' Residu :',T32,D22.15)
C
END
|
rboman/progs
|
student/tfe/BiCG/lib/bicgstab.for
|
FORTRAN
|
apache-2.0
| 3,220
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-GB" xml:lang="en-GB" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Statistics of dep:pos in UD_Yupik-SLI</title>
<link rel="root" href=""/> <!-- for JS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
<link rel="stylesheet" type="text/css" href="../../css/style.css"/>
<link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
<link rel="stylesheet" type="text/css" href="../../css/hint.css"/>
<script type="text/javascript" src="../../lib/ext/head.load.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.2/anchor.min.js"></script>
<script>document.addEventListener("DOMContentLoaded", function(event) {anchors.add();});</script>
<!-- Set up this custom Google search at https://cse.google.com/cse/business/settings?cx=001145188882102106025:dl1mehhcgbo -->
<!-- DZ 2021-01-22: I am temporarily hiding the search field to find out whether it slows down loading of the title page.
<script>
(function() {
var cx = '001145188882102106025:dl1mehhcgbo';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script> -->
<!-- <link rel="shortcut icon" href="favicon.ico"/> -->
</head>
<body>
<div id="main" class="center">
<div id="hp-header">
<table width="100%"><tr><td width="50%">
<span class="header-text"><a href="http://universaldependencies.org/#language-">home</a></span>
<span class="header-text"><a href="https://github.com/universaldependencies/docs/edit/pages-source/treebanks/ess_sli/ess_sli-dep-dep-pos.md" target="#">edit page</a></span>
<span class="header-text"><a href="https://github.com/universaldependencies/docs/issues">issue tracker</a></span>
</td><td>
<gcse:search></gcse:search>
</td></tr></table>
</div>
<hr/>
<div class="v2complete">
This page pertains to UD version 2.
</div>
<div id="content">
<noscript>
<div id="noscript">
It appears that you have Javascript disabled.
Please consider enabling Javascript for this page to see the visualizations.
</div>
</noscript>
<!-- The content may include scripts and styles, hence we must load the shared libraries before the content. -->
<script type="text/javascript">
console.time('loading libraries');
var root = '../../'; // filled in by jekyll
head.js(
// External libraries
// DZ: Copied from embedding.html. I don't know which one is needed for what, so I'm currently keeping them all.
root + 'lib/ext/jquery.min.js',
root + 'lib/ext/jquery.svg.min.js',
root + 'lib/ext/jquery.svgdom.min.js',
root + 'lib/ext/jquery.timeago.js',
root + 'lib/ext/jquery-ui.min.js',
root + 'lib/ext/waypoints.min.js',
root + 'lib/ext/jquery.address.min.js'
);
</script>
<h2 id="treebank-statistics-ud_yupik-sli-relations-deppos">Treebank Statistics: UD_Yupik-SLI: Relations: <code class="language-plaintext highlighter-rouge">dep:pos</code></h2>
<p>This relation is a language-specific subtype of .
There are also 6 other language-specific subtypes of <code class="language-plaintext highlighter-rouge">dep</code>: <tt><a href="ess_sli-dep-dep-ana.html">dep:ana</a></tt>, <tt><a href="ess_sli-dep-dep-aux.html">dep:aux</a></tt>, <tt><a href="ess_sli-dep-dep-cop.html">dep:cop</a></tt>, <tt><a href="ess_sli-dep-dep-emo.html">dep:emo</a></tt>, <tt><a href="ess_sli-dep-dep-infl.html">dep:infl</a></tt>, <tt><a href="ess_sli-dep-dep-mark.html">dep:mark</a></tt>.</p>
<p>3 nodes (0%) are attached to their parents as <code class="language-plaintext highlighter-rouge">dep:pos</code>.</p>
<p>3 instances of <code class="language-plaintext highlighter-rouge">dep:pos</code> (100%) are right-to-left (child precedes parent).
Average distance between parent and child is 1.</p>
<p>The following 1 pairs of parts of speech are connected with <code class="language-plaintext highlighter-rouge">dep:pos</code>: <tt><a href="ess_sli-pos-VERB.html">VERB</a></tt>-<tt><a href="ess_sli-pos-X.html">X</a></tt> (3; 100% instances).</p>
<pre><code class="language-conllu"># visual-style 5 bgColor:blue
# visual-style 5 fgColor:white
# visual-style 6 bgColor:blue
# visual-style 6 fgColor:white
# visual-style 6 5 dep:pos color:blue
1 Sangavek sangavek ADV _ PronType=Int 2 advmod _ Analysis=sangavek(WH)|Gloss=why
2 atightugh atightugh VERB _ _ 0 root _ Analysis=atightugh(V)|Gloss=to-read
3 aq aq VERB _ Aspect=Prog|Tense=Pres 2 dep:aux _ Analysis=~(g)aqe(V→V)|Gloss=to-be-currently-V-ing
4 sin sin X _ Mood=Int|Number[subj]=Sing|Person[subj]=2|Subcat=Intr 3 dep:infl _ Analysis=[Intrg.Intr.2Sg]
5 ingagh ingagh X _ _ 6 dep:pos _ Analysis=ingagh*(POS)|Gloss=lying-down
6 nga nga VERB _ _ 2 advcl _ Analysis=~fnga(POS→STATIVE)|Gloss=to-be-in-the-R-posture
7 gpek gpek X _ Number[subj]=Sing|Person[subj]=2 6 dep:infl _ Analysis=[2Sg]
8 efluga efluga NOUN _ _ 5 obl _ Analysis=eflugagh(N)|Gloss=floor
9 mi mi X _ Case=Loc|Number=Sing 8 dep:infl _ Analysis=[Loc.Sg]
10 ? ? PUNCT _ _ 2 punct _ Analysis=?
</code></pre>
</div>
<!-- support for embedded visualizations -->
<script type="text/javascript">
var root = '../../'; // filled in by jekyll
head.js(
// We assume that external libraries such as jquery.min.js have already been loaded outside!
// (See _layouts/base.html.)
// brat helper modules
root + 'lib/brat/configuration.js',
root + 'lib/brat/util.js',
root + 'lib/brat/annotation_log.js',
root + 'lib/ext/webfont.js',
// brat modules
root + 'lib/brat/dispatcher.js',
root + 'lib/brat/url_monitor.js',
root + 'lib/brat/visualizer.js',
// embedding configuration
root + 'lib/local/config.js',
// project-specific collection data
root + 'lib/local/collections.js',
// Annodoc
root + 'lib/annodoc/annodoc.js',
// NOTE: non-local libraries
'https://spyysalo.github.io/conllu.js/conllu.js'
);
var webFontURLs = [
// root + 'static/fonts/Astloch-Bold.ttf',
root + 'static/fonts/PT_Sans-Caption-Web-Regular.ttf',
root + 'static/fonts/Liberation_Sans-Regular.ttf'
];
var setupTimeago = function() {
jQuery("time.timeago").timeago();
};
head.ready(function() {
setupTimeago();
// mark current collection (filled in by Jekyll)
Collections.listing['_current'] = '';
// perform all embedding and support functions
Annodoc.activate(Config.bratCollData, Collections.listing);
});
</script>
<!-- google analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-55233688-1', 'auto');
ga('send', 'pageview');
</script>
<div id="footer">
<p class="footer-text">© 2014–2021
<a href="http://universaldependencies.org/introduction.html#contributors" style="color:gray">Universal Dependencies contributors</a>.
Site powered by <a href="http://spyysalo.github.io/annodoc" style="color:gray">Annodoc</a> and <a href="http://brat.nlplab.org/" style="color:gray">brat</a></p>.
</div>
</div>
</body>
</html>
|
UniversalDependencies/universaldependencies.github.io
|
treebanks/ess_sli/ess_sli-dep-dep-pos.html
|
HTML
|
apache-2.0
| 8,317
|
# Alpinia pricei pricei Hayata, 1915 SUBSPECIES
#### Status
ACCEPTED
#### According to
Endemic species in Taiwan
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Liliopsida/Zingiberales/Zingiberaceae/Alpinia/Alpinia pricei/Alpinia pricei pricei/README.md
|
Markdown
|
apache-2.0
| 181
|
<?php
/*
* This file is part of the Carbon package.
*
* (c) Brian Nesbitt <brian@nesbot.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Translation messages. See http://symfony.com/doc/current/book/translation.html
* for possible formats.
*/
return array(
'year' => 'שנה|{2}שנתיים|:count שנים',
'month' => 'חודש|{2}חודשיים|:count חודשים',
'week' => 'שבוע|{2}שבועיים|:count שבועות',
'day' => 'יום|{2}יומיים|:count ימים',
'hour' => 'שעה|{2}שעתיים|:count שעות',
'minute' => 'דקה|{2}דקותיים|:count דקות',
'second' => 'שניה|:count שניות',
'ago' => 'לפני :time',
'from_now' => 'בעוד :time',
'after' => 'אחרי :time',
'before' => 'לפני :time',
);
|
focuslife/v0.1
|
vendor/nesbot/carbon/src/Carbon/Lang/he.php
|
PHP
|
apache-2.0
| 974
|
<div data-notify="container" class="col-xs-11 col-sm-3 col-lg-2 alert alert-{0}" role="alert">
<button type="button" aria-hidden="true" class="close" data-notify="dismiss">×</button>
<span data-notify="icon"></span>
<span data-notify="title">{1}</span>
<span data-notify="message">{2}</span>
<a href="{3}" target="{4}" data-notify="url"></a>
</div>
|
vba/NBlast
|
NBlast.Client/app/views/notification.html
|
HTML
|
apache-2.0
| 354
|
# Erysiphe umbelliferarum f. selini Jacz., 1927 FORM
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Taschenbestimmb. f. Pilze 2, Erysiphaceen (1926)
#### Original name
Erysiphe umbelliferarum f. selini Jacz., 1927
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Ascomycota/Leotiomycetes/Erysiphales/Erysiphaceae/Erysiphe/Erysiphe heraclei/ Syn. Erysiphe umbelliferarum selini/README.md
|
Markdown
|
apache-2.0
| 284
|
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/**
* AdUnionId.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
*/
package com.google.api.ads.adwords.axis.v201809.cm;
/**
* Represents an id indicating a grouping of Ads under some heuristic.
*/
public class AdUnionId implements java.io.Serializable {
/* The ID of the ad union
* <span class="constraint InRange">This field must be
* greater than or equal to 1.</span> */
private java.lang.Long id;
/* Indicates that this instance is a subtype of AdUnionId.
* Although this field is returned in the response, it
* is ignored on input
* and cannot be selected. Specify xsi:type instead. */
private java.lang.String adUnionIdType;
public AdUnionId() {
}
public AdUnionId(
java.lang.Long id,
java.lang.String adUnionIdType) {
this.id = id;
this.adUnionIdType = adUnionIdType;
}
@Override
public String toString() {
return com.google.common.base.MoreObjects.toStringHelper(this.getClass())
.omitNullValues()
.add("adUnionIdType", getAdUnionIdType())
.add("id", getId())
.toString();
}
/**
* Gets the id value for this AdUnionId.
*
* @return id * The ID of the ad union
* <span class="constraint InRange">This field must be
* greater than or equal to 1.</span>
*/
public java.lang.Long getId() {
return id;
}
/**
* Sets the id value for this AdUnionId.
*
* @param id * The ID of the ad union
* <span class="constraint InRange">This field must be
* greater than or equal to 1.</span>
*/
public void setId(java.lang.Long id) {
this.id = id;
}
/**
* Gets the adUnionIdType value for this AdUnionId.
*
* @return adUnionIdType * Indicates that this instance is a subtype of AdUnionId.
* Although this field is returned in the response, it
* is ignored on input
* and cannot be selected. Specify xsi:type instead.
*/
public java.lang.String getAdUnionIdType() {
return adUnionIdType;
}
/**
* Sets the adUnionIdType value for this AdUnionId.
*
* @param adUnionIdType * Indicates that this instance is a subtype of AdUnionId.
* Although this field is returned in the response, it
* is ignored on input
* and cannot be selected. Specify xsi:type instead.
*/
public void setAdUnionIdType(java.lang.String adUnionIdType) {
this.adUnionIdType = adUnionIdType;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof AdUnionId)) return false;
AdUnionId other = (AdUnionId) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
((this.id==null && other.getId()==null) ||
(this.id!=null &&
this.id.equals(other.getId()))) &&
((this.adUnionIdType==null && other.getAdUnionIdType()==null) ||
(this.adUnionIdType!=null &&
this.adUnionIdType.equals(other.getAdUnionIdType())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
if (getId() != null) {
_hashCode += getId().hashCode();
}
if (getAdUnionIdType() != null) {
_hashCode += getAdUnionIdType().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(AdUnionId.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201809", "AdUnionId"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("id");
elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201809", "id"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "long"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("adUnionIdType");
elemField.setXmlName(new javax.xml.namespace.QName("https://adwords.google.com/api/adwords/cm/v201809", "AdUnionId.Type"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
|
googleads/googleads-java-lib
|
modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/AdUnionId.java
|
Java
|
apache-2.0
| 6,830
|
# trace
Trace is a mobile payment soluti
|
joemartiny/trace
|
README.md
|
Markdown
|
apache-2.0
| 41
|
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v8/services/account_budget_service.proto
namespace Google\Ads\GoogleAds\V8\Services;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Request message for
* [AccountBudgetService.GetAccountBudget][google.ads.googleads.v8.services.AccountBudgetService.GetAccountBudget].
*
* Generated from protobuf message <code>google.ads.googleads.v8.services.GetAccountBudgetRequest</code>
*/
class GetAccountBudgetRequest extends \Google\Protobuf\Internal\Message
{
/**
* Required. The resource name of the account-level budget to fetch.
*
* Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
*/
protected $resource_name = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $resource_name
* Required. The resource name of the account-level budget to fetch.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Google\Ads\GoogleAds\V8\Services\AccountBudgetService::initOnce();
parent::__construct($data);
}
/**
* Required. The resource name of the account-level budget to fetch.
*
* Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
* @return string
*/
public function getResourceName()
{
return $this->resource_name;
}
/**
* Required. The resource name of the account-level budget to fetch.
*
* Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
* @param string $var
* @return $this
*/
public function setResourceName($var)
{
GPBUtil::checkString($var, True);
$this->resource_name = $var;
return $this;
}
}
|
googleads/google-ads-php
|
src/Google/Ads/GoogleAds/V8/Services/GetAccountBudgetRequest.php
|
PHP
|
apache-2.0
| 2,185
|
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads/v9/resources/accessible_bidding_strategy.proto
namespace Google\Ads\GoogleAds\V9\Resources;
if (false) {
/**
* This class is deprecated. Use Google\Ads\GoogleAds\V9\Resources\AccessibleBiddingStrategy\TargetSpend instead.
* @deprecated
*/
class AccessibleBiddingStrategy_TargetSpend {}
}
class_exists(AccessibleBiddingStrategy\TargetSpend::class);
@trigger_error('Google\Ads\GoogleAds\V9\Resources\AccessibleBiddingStrategy_TargetSpend is deprecated and will be removed in the next major release. Use Google\Ads\GoogleAds\V9\Resources\AccessibleBiddingStrategy\TargetSpend instead', E_USER_DEPRECATED);
|
googleads/google-ads-php
|
src/Google/Ads/GoogleAds/V9/Resources/AccessibleBiddingStrategy_TargetSpend.php
|
PHP
|
apache-2.0
| 725
|
class SignaturePredefinedListSettingsInfo
attr_accessor :name, :values, :default_value
# :internal => :external
def self.attribute_map
{
:name => :name, :values => :values, :default_value => :defaultValue
}
end
def initialize(attributes = {})
# Morph attribute keys into undescored rubyish style
if attributes.to_s != ""
if SignaturePredefinedListSettingsInfo.attribute_map["name".to_sym] != nil
name = "name".to_sym
value = attributes["name"]
send("#{name}=", value) if self.respond_to?(name)
end
if SignaturePredefinedListSettingsInfo.attribute_map["values".to_sym] != nil
name = "values".to_sym
value = attributes["values"]
send("#{name}=", value) if self.respond_to?(name)
end
if SignaturePredefinedListSettingsInfo.attribute_map["default_value".to_sym] != nil
name = "default_value".to_sym
value = attributes["defaultValue"]
send("#{name}=", value) if self.respond_to?(name)
end
end
end
def to_body
body = {}
SignaturePredefinedListSettingsInfo.attribute_map.each_pair do |key,value|
body[value] = self.send(key) unless self.send(key).nil?
end
body
end
end
|
liosha2007/groupdocs-ruby
|
groupdocs/models/signaturepredefinedlistsettingsinfo.rb
|
Ruby
|
apache-2.0
| 1,241
|
export class CallResult {
public Id: string = "";
public Name: string = "";
public LoggingUser: string = "";
public Priority: string = "";
public PriorityCss: string = "";
public State: string = "";
public StateCss: string = "";
public Timestamp: string = "";
public Color: string = "";
public Address: string = "";
}
|
Resgrid/BigBoard
|
src/models/callResult.ts
|
TypeScript
|
apache-2.0
| 358
|
# Pleospora philadelphi Politis SPECIES
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Pleospora philadelphi Politis
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Ascomycota/Dothideomycetes/Pleosporales/Pleosporaceae/Pleospora/Pleospora philadelphi/README.md
|
Markdown
|
apache-2.0
| 187
|
/* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
*
* The information contained herein is property of Nordic Semiconductor ASA.
* Terms and conditions of usage are described in detail in NORDIC
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
*
* Licensees are granted free, non-transferable use of the information. NO
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
* the file.
*
*/
#ifndef ANT_KEY_MANAGER_CONFIG_H__
#define ANT_KEY_MANAGER_CONFIG_H__
/**
* @addtogroup ant_key_manager
* @{
*/
#ifndef ANT_PLUS_NETWORK_KEY
#define ANT_PLUS_NETWORK_KEY {0, 0, 0, 0, 0, 0, 0, 0} /**< The ANT+ network key. */
#endif //ANT_PLUS_NETWORK_KEY
#ifndef ANT_FS_NETWORK_KEY
#define ANT_FS_NETWORK_KEY {0, 0, 0, 0, 0, 0, 0, 0} /**< The ANT-FS network key. */
#endif // ANT_FS_NETWORK_KEY
/**
* @}
*/
#endif // ANT_KEY_MANAGER_CONFIG_H__
|
kevin-ledinh/banana-tree
|
sw/nRF51_SDK_10.0.0_dc26b5e/components/ant/ant_key_manager/config/ant_key_manager_config.h
|
C
|
apache-2.0
| 933
|
package fr.javatronic.blog.massive.annotation1.sub1;
import fr.javatronic.blog.processor.Annotation_001;
@Annotation_001
public class Class_9830 {
}
|
lesaint/experimenting-annotation-processing
|
experimenting-rounds/massive-count-of-annotated-classes/src/main/java/fr/javatronic/blog/massive/annotation1/sub1/Class_9830.java
|
Java
|
apache-2.0
| 151
|
package org.apereo.cas.acct.provision;
import org.apereo.cas.acct.AccountRegistrationRequest;
import org.apereo.cas.config.CasAccountManagementWebflowConfiguration;
import org.apereo.cas.config.CasCoreHttpConfiguration;
import org.apereo.cas.configuration.CasConfigurationProperties;
import org.apereo.cas.web.flow.BaseWebflowConfigurerTests;
import lombok.val;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.autoconfigure.RefreshAutoConfiguration;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockServletContext;
import org.springframework.webflow.context.ExternalContextHolder;
import org.springframework.webflow.context.servlet.ServletExternalContext;
import org.springframework.webflow.execution.RequestContextHolder;
import org.springframework.webflow.test.MockRequestContext;
import java.util.Map;
import static org.junit.jupiter.api.Assertions.*;
/**
* This is {@link GroovyAccountRegistrationProvisionerTests}.
*
* @author Misagh Moayyed
* @since 6.5.0
*/
@SpringBootTest(classes = {
RefreshAutoConfiguration.class,
CasAccountManagementWebflowConfiguration.class,
BaseWebflowConfigurerTests.SharedTestConfiguration.class,
CasCoreHttpConfiguration.class
}, properties = "cas.account-registration.provisioning.groovy.location=classpath:/groovy-provisioner.groovy")
@EnableConfigurationProperties(CasConfigurationProperties.class)
@Tag("Groovy")
public class GroovyAccountRegistrationProvisionerTests {
@Autowired
@Qualifier("accountMgmtRegistrationProvisioner")
private AccountRegistrationProvisioner accountMgmtRegistrationProvisioner;
@BeforeEach
public void setup() {
val context = new MockRequestContext();
val request = new MockHttpServletRequest();
val response = new MockHttpServletResponse();
context.setExternalContext(new ServletExternalContext(new MockServletContext(), request, response));
RequestContextHolder.setRequestContext(context);
ExternalContextHolder.setExternalContext(context.getExternalContext());
}
@Test
public void verifyOperation() throws Exception {
val registrationRequest = new AccountRegistrationRequest(Map.of("username", "casuser"));
val results = accountMgmtRegistrationProvisioner.provision(registrationRequest);
assertTrue(results.isSuccess());
assertNotNull(results.toString());
}
}
|
apereo/cas
|
support/cas-server-support-account-mgmt/src/test/java/org/apereo/cas/acct/provision/GroovyAccountRegistrationProvisionerTests.java
|
Java
|
apache-2.0
| 2,853
|
package ru.stqa.pft.mantis.model;
/**
* Created by Администратор on 10.03.2017.
*/
public class MailMessage {
public String to; //поле - кому письмо
public String text; //поле - текст письма
public MailMessage(String to, String text){
this.to = to;
this.text = text;
}
}
|
Dmitry029/Java-for-testers
|
mantis-tests/src/test/java/ru/stqa/pft/mantis/model/MailMessage.java
|
Java
|
apache-2.0
| 336
|
/*
* Copyright 2014 The Skfiy Open Association.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.skfiy.typhon.spi.atlasloot;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.skfiy.typhon.AbstractComponent;
import org.skfiy.typhon.ComponentException;
import org.skfiy.typhon.domain.Lootable;
import org.skfiy.typhon.session.Session;
import org.skfiy.typhon.spi.ItemProvider;
import org.skfiy.typhon.util.ComponentUtils;
/**
*
* @author Kevin
*/
@Singleton
public class AtlaslootProvider extends AbstractComponent {
private final Map<String, RandomAtlaslootBean> allAtlasloots;
@Inject
private ItemProvider itemProvider;
public AtlaslootProvider() {
allAtlasloots = new HashMap<>();
}
@Override
protected void doInit() {
loadDatas();
}
@Override
protected void doReload() {
loadDatas();
}
@Override
protected void doDestroy() {
}
/**
*
* @param session
* @param lootable
* @param atlasloots
* @param ids
*/
public void calculateAtlasloot(Session session, Lootable lootable,
List<AtlaslootBean> atlasloots, String... ids) {
RandomAtlaslootBean randomAtlaslootBean;
AtlaslootBean atlaslootBean;
for (String id : ids) {
randomAtlaslootBean = allAtlasloots.get(id);
if (randomAtlaslootBean == null) {
throw new ComponentException("Not found atlasloot[" + id + "]");
}
atlaslootBean = randomAtlaslootBean.calculate(session, lootable);
if (atlaslootBean != null) {
atlasloots.add(atlaslootBean);
}
}
}
private void loadDatas() {
JSONArray jsonArray = JSON.parseArray(ComponentUtils.readDataFile("single_atlasloot.json"));
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
SingleAtlasloot atlasloot = new SingleAtlasloot();
atlasloot.setId(jsonObject.getString("id"));
atlasloot.setItem(itemProvider.getItem(jsonObject.getString("#item.id")));
atlasloot.setCount(jsonObject.getIntValue("count"));
atlasloot.setProb(jsonObject.getDoubleValue("prob"));
atlasloot.setFactor(jsonObject.getIntValue("factor"));
atlasloot.prepare();
allAtlasloots.put(atlasloot.getId(), atlasloot);
}
jsonArray = JSON.parseArray(ComponentUtils.readDataFile("multiple_atlasloot.json"));
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
MultipleAtlasloot atlasloot = new MultipleAtlasloot();
atlasloot.setId(jsonObject.getString("id"));
JSONArray lootArray = jsonObject.getJSONArray("loots");
AtlaslootBean[] atlaslootBeans = new AtlaslootBean[lootArray.size()];
for (int j = 0; j < atlaslootBeans.length; j++) {
JSONObject lootObject = lootArray.getJSONObject(j);
AtlaslootBean bean = new AtlaslootBean();
bean.setItem(itemProvider.getItem(lootObject.getString("#item.id")));
bean.setCount(lootObject.getIntValue("count"));
bean.setProb(lootObject.getDoubleValue("prob"));
atlaslootBeans[j] = bean;
}
double prevProb = 0;
for (AtlaslootBean ab : atlaslootBeans) {
ab.setProb(prevProb + ab.getProb());
prevProb = ab.getProb();
}
atlasloot.setAtlasloots(atlaslootBeans);
allAtlasloots.put(atlasloot.getId(), atlasloot);
}
}
}
|
weghst/typhon
|
typhon-kernel/src/main/java/org/skfiy/typhon/spi/atlasloot/AtlaslootProvider.java
|
Java
|
apache-2.0
| 4,465
|
# Dryopteris cordipinna Ching & K.H.Shing SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Pteridophyta/Polypodiopsida/Polypodiales/Dryopteridaceae/Dryopteris/Dryopteris cordipinna/README.md
|
Markdown
|
apache-2.0
| 189
|
# AUTOGENERATED FILE
FROM balenalib/colibri-imx6-debian:bookworm-run
# remove several traces of debian python
RUN apt-get purge -y python.*
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
# install python dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
netbase \
&& rm -rf /var/lib/apt/lists/*
# key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported
# key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported
RUN gpg --batch --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \
&& gpg --batch --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \
&& gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059
ENV PYTHON_VERSION 3.6.15
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION 21.3.1
ENV SETUPTOOLS_VERSION 60.5.4
RUN set -x \
&& buildDeps=' \
curl \
' \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-armv7hf-libffi3.3.tar.gz" \
&& echo "7ff252a91617ecbb724b79575986b5e5eb9398c6e500011d9359d7e729b36831 Python-$PYTHON_VERSION.linux-armv7hf-libffi3.3.tar.gz" | sha256sum -c - \
&& tar -xzf "Python-$PYTHON_VERSION.linux-armv7hf-libffi3.3.tar.gz" --strip-components=1 \
&& rm -rf "Python-$PYTHON_VERSION.linux-armv7hf-libffi3.3.tar.gz" \
&& ldconfig \
&& if [ ! -e /usr/local/bin/pip3 ]; then : \
&& curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \
&& echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c get-pip.py" | sha256sum -c - \
&& python3 get-pip.py \
&& rm get-pip.py \
; fi \
&& pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \
&& find /usr/local \
\( -type d -a -name test -o -name tests \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' + \
&& cd / \
&& rm -rf /usr/src/python ~/.cache
# make some useful symlinks that are expected to exist
RUN cd /usr/local/bin \
&& ln -sf pip3 pip \
&& { [ -e easy_install ] || ln -s easy_install-* easy_install; } \
&& ln -sf idle3 idle \
&& ln -sf pydoc3 pydoc \
&& ln -sf python3 python \
&& ln -sf python3-config python-config
# set PYTHONPATH to point to dist-packages
ENV PYTHONPATH /usr/lib/python3/dist-packages:$PYTHONPATH
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh" \
&& echo "Running test-stack@python" \
&& chmod +x test-stack@python.sh \
&& bash test-stack@python.sh \
&& rm -rf test-stack@python.sh
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Debian Bookworm \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.6.15, Pip v21.3.1, Setuptools v60.5.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh
|
resin-io-library/base-images
|
balena-base-images/python/colibri-imx6/debian/bookworm/3.6.15/run/Dockerfile
|
Dockerfile
|
apache-2.0
| 4,097
|
# Pentaschistis aspera (Thunb.) Stapf SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Pentaschistis/Pentaschistis aspera/README.md
|
Markdown
|
apache-2.0
| 193
|
# Arctostaphylos appositifolius Parry SPECIES
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Ericales/Ericaceae/Ornithostaphylos/Ornithostaphylos oppositifolia/ Syn. Arctostaphylos appositifolius/README.md
|
Markdown
|
apache-2.0
| 192
|
# Salix exigua var. columbiana Dorn VARIETY
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Malpighiales/Salicaceae/Salix/Salix columbiana/ Syn. Salix exigua columbiana/README.md
|
Markdown
|
apache-2.0
| 190
|
# Geniostoma rupestre var. ligustrifolium (A.Cunn.) B.J.Conn VARIETY
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
Geniostoma ligustrifolium A.Cunn.
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Loganiaceae/Geniostoma/Geniostoma rupestre/Geniostoma rupestre ligustrifolium/README.md
|
Markdown
|
apache-2.0
| 237
|
# Cusparia fanshawei Sandwith SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Sapindales/Rutaceae/Angostura/Cusparia fanshawei/README.md
|
Markdown
|
apache-2.0
| 177
|
# Ericala pyrenaica G.Don SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Gentianaceae/Ericala/Ericala pyrenaica/README.md
|
Markdown
|
apache-2.0
| 173
|
# Lobarina horikawai Inumaru SPECIES
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Lobarina horikawai Inumaru
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Ascomycota/Lecanoromycetes/Peltigerales/Lobariaceae/Lobarina/Lobarina horikawai/README.md
|
Markdown
|
apache-2.0
| 181
|
# Sanguisorba officinalis var. montana (Jord. ex Boreau) Focke VARIETY
#### Status
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rosaceae/Sanguisorba/Sanguisorba officinalis/ Syn. Sanguisorba officinalis montana/README.md
|
Markdown
|
apache-2.0
| 217
|
# Dolichandrone falcata Seem. SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
J. Bot. 8:381. 1870
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Bignoniaceae/Dolichandrone/Dolichandrone falcata/README.md
|
Markdown
|
apache-2.0
| 192
|
# Dussia Krug & Urb. ex Taub. GENUS
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Dussia/README.md
|
Markdown
|
apache-2.0
| 183
|
# Acicarpha spathulata var. glauca A.DC. VARIETY
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Calyceraceae/Acicarpha/Acicarpha spathulata/Acicarpha spathulata glauca/README.md
|
Markdown
|
apache-2.0
| 188
|
# Limonia alternans Wall. ex Voigt SPECIES
#### Status
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Sapindales/Rutaceae/Limonia/Limonia alternans/README.md
|
Markdown
|
apache-2.0
| 182
|
# Psora atrobrunnea var. subfumosa Arnold VARIETY
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Psora atrobrunnea var. subfumosa Arnold
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Psoraceae/Psora/Psora atrobrunnea/Psora atrobrunnea subfumosa/README.md
|
Markdown
|
apache-2.0
| 207
|
/*
* Copyright 2000-2012 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package git4idea.roots;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Condition;
import com.intellij.openapi.vcs.AbstractVcs;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.VcsDirectoryMapping;
import com.intellij.openapi.vcs.VcsRoot;
import com.intellij.openapi.vcs.roots.VcsRootDetectInfo;
import com.intellij.openapi.vcs.roots.VcsRootErrorsFinder;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.UIUtil;
import git4idea.GitPlatformFacade;
import git4idea.GitVcs;
import git4idea.Notificator;
import git4idea.commands.Git;
import git4idea.commands.GitCommandResult;
import org.jetbrains.annotations.NotNull;
import java.util.*;
import static com.intellij.dvcs.DvcsUtil.joinRootsPaths;
import static com.intellij.openapi.util.text.StringUtil.pluralize;
/**
* @author Kirill Likhodedov
*/
public class GitIntegrationEnabler {
private final @NotNull Project myProject;
private final @NotNull Git myGit;
private final @NotNull GitPlatformFacade myPlatformFacade;
private static final Logger LOG = Logger.getInstance(GitIntegrationEnabler.class);
public GitIntegrationEnabler(@NotNull Project project, @NotNull Git git, @NotNull GitPlatformFacade platformFacade) {
myProject = project;
myGit = git;
myPlatformFacade = platformFacade;
}
public void enable(@NotNull VcsRootDetectInfo detectInfo) {
Notificator notificator = myPlatformFacade.getNotificator(myProject);
Collection<VcsRoot> gitRoots = ContainerUtil.filter(detectInfo.getRoots(), new Condition<VcsRoot>() {
@Override
public boolean value(VcsRoot root) {
AbstractVcs gitVcs = root.getVcs();
return gitVcs != null && gitVcs.getName().equals(GitVcs.NAME);
}
});
Collection<VirtualFile> roots = VcsRootErrorsFinder.vcsRootsToVirtualFiles(gitRoots);
VirtualFile projectDir = myProject.getBaseDir();
assert projectDir != null : "Base dir is unexpectedly null for project: " + myProject;
if (gitRoots.isEmpty()) {
boolean succeeded = gitInitOrNotifyError(notificator, projectDir);
if (succeeded) {
addVcsRoots(Collections.singleton(projectDir));
}
}
else {
assert !roots.isEmpty();
if (roots.size() > 1 || detectInfo.projectIsBelowVcs()) {
notifyAddedRoots(notificator, roots);
}
addVcsRoots(roots);
}
}
private static void notifyAddedRoots(Notificator notificator, Collection<VirtualFile> roots) {
notificator.notifySuccess("", String.format("Added Git %s: %s", pluralize("root", roots.size()), joinRootsPaths(roots)));
}
private boolean gitInitOrNotifyError(@NotNull Notificator notificator, @NotNull final VirtualFile projectDir) {
GitCommandResult result = myGit.init(myProject, projectDir);
if (result.success()) {
refreshGitDir(projectDir);
notificator.notifySuccess("", "Created Git repository in " + projectDir.getPresentableUrl());
return true;
}
else {
if (((GitVcs)myPlatformFacade.getVcs(myProject)).getExecutableValidator().checkExecutableAndNotifyIfNeeded()) {
notificator.notifyError("Couldn't git init " + projectDir.getPresentableUrl(), result.getErrorOutputAsHtmlString());
LOG.info(result.getErrorOutputAsHtmlString());
}
return false;
}
}
private void refreshGitDir(final VirtualFile projectDir) {
UIUtil.invokeAndWaitIfNeeded(new Runnable() {
@Override
public void run() {
myPlatformFacade.runReadAction(new Runnable() {
@Override
public void run() {
myPlatformFacade.getLocalFileSystem().refreshAndFindFileByPath(projectDir.getPath() + "/.git");
}
});
}
});
}
private void addVcsRoots(@NotNull Collection<VirtualFile> roots) {
ProjectLevelVcsManager vcsManager = myPlatformFacade.getVcsManager(myProject);
AbstractVcs vcs = myPlatformFacade.getVcs(myProject);
List<VirtualFile> currentGitRoots = Arrays.asList(vcsManager.getRootsUnderVcs(vcs));
List<VcsDirectoryMapping> mappings = new ArrayList<VcsDirectoryMapping>(vcsManager.getDirectoryMappings(vcs));
for (VirtualFile root : roots) {
if (!currentGitRoots.contains(root)) {
mappings.add(new VcsDirectoryMapping(root.getPath(), vcs.getName()));
}
}
vcsManager.setDirectoryMappings(mappings);
}
}
|
romankagan/DDBWorkbench
|
plugins/git4idea/src/git4idea/roots/GitIntegrationEnabler.java
|
Java
|
apache-2.0
| 5,120
|
<?php
/* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */
$generated_i18n_strings = array(
// Reference: node_modules/yoastseo/src/assessments/readability/fleschReadingEaseAssessment.js:111
__( 'Good job!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/fleschReadingEaseAssessment.js:115
__( 'very easy', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/fleschReadingEaseAssessment.js:118
__( 'easy', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/fleschReadingEaseAssessment.js:121
__( 'fairly easy', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/fleschReadingEaseAssessment.js:124
__( 'ok', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/fleschReadingEaseAssessment.js:127
__( 'fairly difficult', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/fleschReadingEaseAssessment.js:128
__( 'Try to make shorter sentences to improve readability', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/fleschReadingEaseAssessment.js:131
__( 'difficult', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/fleschReadingEaseAssessment.js:132
// Reference: node_modules/yoastseo/src/assessments/readability/fleschReadingEaseAssessment.js:136
__( 'Try to make shorter sentences, using less difficult words to improve readability', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/fleschReadingEaseAssessment.js:135
__( 'very difficult', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/fleschReadingEaseAssessment.js:149
/* Translators: %1$s expands to a link on yoast.com,
%2$s to the anchor end tag,
%3$s expands to the numeric Flesch reading ease score,
%4$s to the easiness of reading,
%5$s expands to a call to action based on the score */
__( '%1$sFlesch Reading Ease%2$s: The copy scores %3$s in the test, which is considered %4$s to read. %5$s', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/fleschReadingEaseAssessment.js:162
/* Translators: %1$s and %5$s expand to a link on yoast.com,
%2$s to the anchor end tag,
%7$s expands to the anchor end tag and a full stop,
%3$s expands to the numeric Flesch reading ease score,
%4$s to the easiness of reading,
%6$s expands to a call to action based on the score */
__( '%1$sFlesch Reading Ease%2$s: The copy scores %3$s in the test, which is considered %4$s to read. %5$s%6$s%7$s', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/paragraphTooLongAssessment.js:87
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag */
__( '%1$sParagraph length%2$s: None of the paragraphs are too long. Great job!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/paragraphTooLongAssessment.js:96
/* Translators: %1$s and %5$s expand to a link on yoast.com, %2$s expands to the anchor end tag, %3$d expands to the
number of paragraphs over the recommended word limit, %4$d expands to the word limit */
_n_noop( '%1$sParagraph length%2$s: %3$d of the paragraphs contains more than the recommended maximum of %4$d words. %5$sShorten your paragraphs%2$s!', '%1$sParagraph length%2$s: %3$d of the paragraphs contain more than the recommended maximum of %4$d words. %5$sShorten your paragraphs%2$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/passiveVoiceAssessment.js:80
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag. */
__( '%1$sPassive voice%2$s: You\'re using enough active voice. That\'s great!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/passiveVoiceAssessment.js:89
/* Translators: %1$s and %5$s expand to a link on yoast.com, %2$s expands to the anchor end tag,
%3$s expands to the percentage of sentences in passive voice, %4$s expands to the recommended value. */
__( '%1$sPassive voice%2$s: %3$s of the sentences contain passive voice, which is more than the recommended maximum of %4$s. %5$sTry to use their active counterparts%2$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/sentenceBeginningsAssessment.js:74
/* Translators: %1$s and %5$s expand to a link on yoast.com, %2$s expands to the anchor end tag,
%3$d expands to the number of consecutive sentences starting with the same word,
%4$d expands to the number of instances where 3 or more consecutive sentences start with the same word. */
_n_noop( '%1$sConsecutive sentences%2$s: The text contains %3$d consecutive sentences starting with the same word. %5$sTry to mix things up%2$s!', '%1$sConsecutive sentences%2$s: The text contains %4$d instances where %3$d or more consecutive sentences start with the same word. %5$sTry to mix things up%2$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/sentenceBeginningsAssessment.js:82
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag */
__( '%1$sConsecutive sentences%2$s: There is enough variety in your sentences. That\'s great!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/sentenceLengthInDescriptionAssessment.js:63
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the recommended maximum sentence length,
%3$s expands to the anchor end tag. */
__( 'The meta description contains no sentences %1$sover %2$s words%3$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/sentenceLengthInDescriptionAssessment.js:71
/* Translators: %1$d expands to number of sentences, %2$s expands to a link on yoast.com,
%3$s expands to the recommended maximum sentence length, %4$s expands to the anchor end tag. */
_n_noop( 'The meta description contains %1$d sentence %2$sover %3$s words%4$s. Try to shorten this sentence.', 'The meta description contains %1$d sentences %2$sover %3$s words%4$s. Try to shorten these sentences.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/sentenceLengthInTextAssessment.js:161
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag */
__( '%1$sSentence length%2$s: Great!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/sentenceLengthInTextAssessment.js:168
/* Translators: %1$s and %6$s expand to a link on yoast.com, %2$s expands to the anchor end tag,
%3$d expands to percentage of sentences, %4$s expands to the recommended maximum sentence length,
%5$s expands to the recommended maximum percentage. */
__( '%1$sSentence length%2$s: %3$s of the sentences contain more than %4$s words, which is more than the recommended maximum of %5$s. %6$sTry to shorten the sentences%2$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/subheadingDistributionTooLongAssessment.js:183
// Reference: node_modules/yoastseo/src/assessments/readability/subheadingDistributionTooLongAssessment.js:225
/* Translators: %1$s expands to a link to https://yoa.st/headings, %2$s expands to the link closing tag. */
__( '%1$sSubheading distribution%2$s: Great job!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/subheadingDistributionTooLongAssessment.js:197
// Reference: node_modules/yoastseo/src/assessments/readability/subheadingDistributionTooLongAssessment.js:208
/* Translators: %1$s and %5$s expand to a link on yoast.com, %3$d to the number of text sections
not separated by subheadings, %4$d expands to the recommended number of words following a
subheading, %2$s expands to the link closing tag.
Translators: %1$s and %5$s expand to a link on yoast.com, %3$d to the number of text sections
not separated by subheadings, %4$d expands to the recommended number of words following a
subheading, %2$s expands to the link closing tag. */
_n_noop( '%1$sSubheading distribution%2$s: %3$d section of your text is longer than %4$d words and is not separated by any subheadings. %5$sAdd subheadings to improve readability%2$s.', '%1$sSubheading distribution%2$s: %3$d sections of your text are longer than %4$d words and are not separated by any subheadings. %5$sAdd subheadings to improve readability%2$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/subheadingDistributionTooLongAssessment.js:216
/* Translators: %1$s and %3$s expand to a link to https://yoa.st/headings, %2$s expands to the link closing tag. */
__( '%1$sSubheading distribution%2$s: You are not using any subheadings, although your text is rather long. %3$sTry and add some subheadings%2$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/subheadingDistributionTooLongAssessment.js:233
/* Translators: %1$s expands to a link to https://yoa.st/headings, %2$s expands to the link closing tag. */
__( '%1$sSubheading distribution%2$s: You are not using any subheadings, but your text is short enough and probably doesn\'t need them.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/textPresenceAssessment.js:36
/* Translators: %1$s and %3$s expand to links to articles on Yoast.com,
%2$s expands to the anchor end tag */
__( '%1$sNot enough content%2$s: %3$sPlease add some content to enable a good analysis%2$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/transitionWordsAssessment.js:97
/* Translators: %1$s and %3$s expand to a link to yoast.com, %2$s expands to the anchor end tag */
__( '%1$sTransition words%2$s: None of the sentences contain transition words. %3$sUse some%2$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/transitionWordsAssessment.js:108
/* Translators: %1$s and %4$s expand to a link to yoast.com, %2$s expands to the anchor end tag,
%3$s expands to the percentage of sentences containing transition words */
__( '%1$sTransition words%2$s: Only %3$s of the sentences contain transition words, which is not enough. %4$sUse more of them%2$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/transitionWordsAssessment.js:117
/* Translators: %1$s expands to a link on yoast.com, %3$s expands to the anchor end tag. */
__( '%1$sTransition words%2$s: Well done!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/wordComplexityAssessment.js:82
/* Translators: %1$s expands to the percentage of complex words, %2$s expands to a link on yoast.com,
%3$d expands to the recommended maximum number of syllables,
%4$s expands to the anchor end tag, %5$s expands to the recommended maximum number of syllables. */
__( '%1$s of the words contain %2$sover %3$s syllables%4$s, which is less than or equal to the recommended maximum of %5$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/readability/wordComplexityAssessment.js:94
/* Translators: %1$s expands to the percentage of complex words, %2$s expands to a link on yoast.com,
%3$d expands to the recommended maximum number of syllables,
%4$s expands to the anchor end tag, %5$s expands to the recommended maximum number of syllables. */
__( '%1$s of the words contain %2$sover %3$s syllables%4$s, which is more than the recommended maximum of %5$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/FunctionWordsInKeyphraseAssessment.js:92
__( '%1$sFunction words in keyphrase%3$s: Your keyphrase "%4$s" contains function words only. %2$sLearn more about what makes a good keyphrase.%3$s', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/InternalLinksAssessment.js:128
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sInternal links%3$s: No internal links appear in this page, %2$smake sure to add some%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/InternalLinksAssessment.js:137
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sInternal links%3$s: The internal links in this page are all nofollowed. %2$sAdd some good internal links%3$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/InternalLinksAssessment.js:146
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag */
__( '%1$sInternal links%2$s: You have enough internal links. Good job!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/InternalLinksAssessment.js:153
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag */
__( '%1$sInternal links%2$s: There are both nofollowed and normal internal links on this page. Good job!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/IntroductionKeywordAssessment.js:123
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag. */
__( '%1$sKeyphrase in introduction%2$s: Well done!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/IntroductionKeywordAssessment.js:132
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag. */
__( '%1$sKeyphrase in introduction%3$s:Your keyphrase or its synonyms appear in the first paragraph of the copy, but not within one sentence. %2$sFix that%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/IntroductionKeywordAssessment.js:140
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag. */
__( '%1$sKeyphrase in introduction%3$s: Your keyphrase or its synonyms do not appear in the first paragraph. %2$sMake sure the topic is clear immediately%3$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/KeyphraseDistributionAssessment.js:129
/* Translators: %1$s and %2$s expand to links to Yoast.com articles,
%3$s expands to the anchor end tag */
__( '%1$sKeyphrase distribution%3$s: %2$sInclude your keyphrase or its synonyms in the text so that we can check keyphrase distribution%3$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/KeyphraseDistributionAssessment.js:139
/* Translators: %1$s and %2$s expand to links to Yoast.com articles,
%3$s expands to the anchor end tag */
__( '%1$sKeyphrase distribution%3$s: Very uneven. Large parts of your text do not contain the keyphrase or its synonyms. %2$sDistribute them more evenly%3$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/KeyphraseDistributionAssessment.js:149
/* Translators: %1$s and %2$s expand to links to Yoast.com articles,
%3$s expands to the anchor end tag */
__( '%1$sKeyphrase distribution%3$s: Uneven. Some parts of your text do not contain the keyphrase or its synonyms. %2$sDistribute them more evenly%3$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/KeyphraseDistributionAssessment.js:157
/* Translators: %1$s expands to links to Yoast.com articles, %2$s expands to the anchor end tag */
__( '%1$sKeyphrase distribution%2$s: Good job!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/KeyphraseLengthAssessment.js:139
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sKeyphrase length%3$s: %2$sSet a keyphrase in order to calculate your SEO score%3$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/KeyphraseLengthAssessment.js:146
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sKeyphrase length%3$s: No focus keyphrase was set for this page. %2$sSet a keyphrase in order to calculate your SEO score%3$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/KeyphraseLengthAssessment.js:155
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag. */
__( '%1$sKeyphrase length%2$s: Good job!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/KeyphraseLengthAssessment.js:168
__( '%3$sKeyphrase length%5$s: The keyphrase is %1$d words long. That\'s more than the recommended maximum of %2$d words. %4$sMake it shorter%5$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/KeyphraseLengthAssessment.js:180
__( '%3$sKeyphrase length%5$s: The keyphrase is %1$d words long. That\'s way more than the recommended maximum of %2$d words. %4$sMake it shorter%5$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/KeywordDensityAssessment.js:249
__( '%1$sKeyphrase density%2$s: The focus keyphrase was found 0 times. That\'s less than the recommended minimum of %3$d times for a text of this length. %4$sFocus on your keyphrase%2$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/KeywordDensityAssessment.js:262
_n_noop( '%1$sKeyphrase density%2$s: The focus keyphrase was found %5$d time. That\'s less than the recommended minimum of %3$d times for a text of this length. %4$sFocus on your keyphrase%2$s!', '%1$sKeyphrase density%2$s: The focus keyphrase was found %5$d times. That\'s less than the recommended minimum of %3$d times for a text of this length. %4$sFocus on your keyphrase%2$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/KeywordDensityAssessment.js:274
_n_noop( '%1$sKeyphrase density%2$s: The focus keyphrase was found %3$d time. This is great!', '%1$sKeyphrase density%2$s: The focus keyphrase was found %3$d times. This is great!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/KeywordDensityAssessment.js:287
_n_noop( '%1$sKeyphrase density%2$s: The focus keyphrase was found %5$d time. That\'s more than the recommended maximum of %3$d times for a text of this length. %4$sDon\'t overoptimize%2$s!', '%1$sKeyphrase density%2$s: The focus keyphrase was found %5$d times. That\'s more than the recommended maximum of %3$d times for a text of this length. %4$sDon\'t overoptimize%2$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/KeywordDensityAssessment.js:300
_n_noop( '%1$sKeyphrase density%2$s: The focus keyphrase was found %5$d time. That\'s way more than the recommended maximum of %3$d times for a text of this length. %4$sDon\'t overoptimize%2$s!', '%1$sKeyphrase density%2$s: The focus keyphrase was found %5$d times. That\'s way more than the recommended maximum of %3$d times for a text of this length. %4$sDon\'t overoptimize%2$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/MetaDescriptionKeywordAssessment.js:112
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag. */
__( '%1$sKeyphrase in meta description%2$s: Keyphrase or synonym appear in the meta description. Well done!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/MetaDescriptionKeywordAssessment.js:127
__( '%1$sKeyphrase in meta description%2$s: The meta description contains the keyphrase %3$s times, which is over the advised maximum of 2 times. %4$sLimit that%5$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/MetaDescriptionKeywordAssessment.js:140
__( '%1$sKeyphrase in meta description%2$s: The meta description has been specified, but it does not contain the keyphrase. %3$sFix that%4$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/MetaDescriptionLengthAssessment.js:158
/* Translators: %1$s and %2$s expand to a links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sMeta description length%3$s: No meta description has been specified. Search engines will display copy from the page instead. %2$sMake sure to write one%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/MetaDescriptionLengthAssessment.js:166
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag,
%4$d expands to the number of characters in the meta description, %5$d expands to
the total available number of characters in the meta description */
__( '%1$sMeta description length%3$s: The meta description is too short (under %4$d characters). Up to %5$d characters are available. %2$sUse the space%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/MetaDescriptionLengthAssessment.js:173
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag,
%4$d expands to the total available number of characters in the meta description */
__( '%1$sMeta description length%3$s: The meta description is over %4$d characters. To ensure the entire description will be visible, %2$syou should reduce the length%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/MetaDescriptionLengthAssessment.js:179
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag */
__( '%1$sMeta description length%2$s: Well done!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/OutboundLinksAssessment.js:147
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sOutbound links%3$s: No outbound links appear in this page. %2$sAdd some%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/OutboundLinksAssessment.js:153
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sOutbound links%3$s: All outbound links on this page are nofollowed. %2$sAdd some normal links%3$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/OutboundLinksAssessment.js:159
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag */
__( '%1$sOutbound links%2$s: Good job!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/OutboundLinksAssessment.js:165
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag */
__( '%1$sOutbound links%2$s: There are both nofollowed and normal outbound links on this page. Good job!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/PageTitleWidthAssessment.js:150
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sSEO title width%3$s: The SEO title is too short. %2$sUse the space to add keyphrase variations or create compelling call-to-action copy%3$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/PageTitleWidthAssessment.js:156
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag */
__( '%1$sSEO title width%2$s: Good job!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/PageTitleWidthAssessment.js:162
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sSEO title width%3$s: The SEO title is wider than the viewable limit. %2$sTry to make it shorter%3$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/PageTitleWidthAssessment.js:167
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sSEO title width%3$s: %2$sPlease create an SEO title%3$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/SingleH1Assessment.js:137
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sSingle title%3$s: H1s should only be used as your main title. Find all H1s in your text that aren\'t your main title and %2$schange them to a lower heading level%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/SubHeadingsKeywordAssessment.js:205
// Reference: node_modules/yoastseo/src/assessments/seo/SubHeadingsKeywordAssessment.js:242
/* Translators: %1$s and %2$s expand to a link on yoast.com, %3$s expands to the anchor end tag. */
__( '%1$sKeyphrase in subheading%3$s: %2$sUse more keyphrases or synonyms in your higher-level subheadings%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/SubHeadingsKeywordAssessment.js:214
/* Translators: %1$s and %2$s expand to a link on yoast.com, %3$s expands to the anchor end tag. */
__( '%1$sKeyphrase in subheading%3$s: More than 75%% of your higher-level subheadings reflect the topic of your copy. That\'s too much. %2$sDon\'t over-optimize%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/SubHeadingsKeywordAssessment.js:224
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag,
%3$d expands to the number of subheadings containing the keyphrase. */
__( '%1$sKeyphrase in subheading%2$s: Your higher-level subheading reflects the topic of your copy. Good job!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/SubHeadingsKeywordAssessment.js:234
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag,
%3$d expands to the number of subheadings containing the keyphrase. */
_n_noop( '%1$sKeyphrase in subheading%2$s: %3$s of your higher-level subheadings reflects the topic of your copy. Good job!', '%1$sKeyphrase in subheading%2$s: %3$s of your higher-level subheadings reflect the topic of your copy. Good job!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/taxonomyTextLengthAssessment.js:34
// Reference: node_modules/yoastseo/src/assessments/seo/TextLengthAssessment.js:115
/* Translators: %1$d expands to the number of words in the text,
%2$s expands to a link on yoast.com, %3$s expands to the anchor end tag */
_n_noop( '%2$sText length%3$s: The text contains %1$d word. Good job!', '%2$sText length%3$s: The text contains %1$d words. Good job!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/taxonomyTextLengthAssessment.js:44
// Reference: node_modules/yoastseo/src/assessments/seo/taxonomyTextLengthAssessment.js:59
// Reference: node_modules/yoastseo/src/assessments/seo/taxonomyTextLengthAssessment.js:74
// Reference: node_modules/yoastseo/src/assessments/seo/taxonomyTextLengthAssessment.js:89
// Reference: node_modules/yoastseo/src/assessments/seo/TextLengthAssessment.js:131
// Reference: node_modules/yoastseo/src/assessments/seo/TextLengthAssessment.js:147
// Reference: node_modules/yoastseo/src/assessments/seo/TextLengthAssessment.js:161
// Reference: node_modules/yoastseo/src/assessments/seo/TextLengthAssessment.js:175
/* Translators: %1$d expands to the number of words in the text,
%2$s expands to a link on yoast.com, %4$d expands to the anchor end tag.
Translators: %1$d expands to the number of words in the text,
%2$s expands to a link on yoast.com, %4$s expands to the anchor end tag. */
_n_noop( '%2$sText length%4$s: The text contains %1$d word.', '%2$sText length%4$s: The text contains %1$d words.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/taxonomyTextLengthAssessment.js:49
// Reference: node_modules/yoastseo/src/assessments/seo/TextLengthAssessment.js:152
/* Translators: The preceding sentence is "Text length: The text contains x words.",
%3$s expands to a link on yoast.com,
%4$s expands to the anchor end tag,
%5$d expands to the recommended minimum of words. */
_n_noop( 'This is slightly below the recommended minimum of %5$d word. %3$sAdd a bit more copy%4$s.', 'This is slightly below the recommended minimum of %5$d words. %3$sAdd a bit more copy%4$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/taxonomyTextLengthAssessment.js:64
// Reference: node_modules/yoastseo/src/assessments/seo/taxonomyTextLengthAssessment.js:79
// Reference: node_modules/yoastseo/src/assessments/seo/TextLengthAssessment.js:166
// Reference: node_modules/yoastseo/src/assessments/seo/TextLengthAssessment.js:180
/* Translators: The preceding sentence is "Text length: The text contains x words.",
%3$s expands to a link on yoast.com,
%4$s expands to the anchor end tag,
%5$d expands to the recommended minimum of words. */
_n_noop( 'This is below the recommended minimum of %5$d word. %3$sAdd more content%4$s.', 'This is below the recommended minimum of %5$d words. %3$sAdd more content%4$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/taxonomyTextLengthAssessment.js:94
// Reference: node_modules/yoastseo/src/assessments/seo/TextLengthAssessment.js:136
/* Translators: The preceding sentence is "Text length: The text contains x words.",
%3$s expands to a link on yoast.com,
%4$s expands to the anchor end tag,
%5$d expands to the recommended minimum of words. */
_n_noop( 'This is far below the recommended minimum of %5$d word. %3$sAdd more content%4$s.', 'This is far below the recommended minimum of %5$d words. %3$sAdd more content%4$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/TextCompetingLinksAssessment.js:129
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sLink keyphrase%3$s: You\'re linking to another page with the words you want this page to rank for. %2$sDon\'t do that%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/TextImagesAssessment.js:175
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sImage alt attributes%3$s: No images appear on this page. %2$sAdd some%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/TextImagesAssessment.js:185
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sImage alt attributes%3$s: Images on this page have alt attributes, but you have not set your keyphrase. %2$sFix that%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/TextImagesAssessment.js:195
// Reference: node_modules/yoastseo/src/assessments/seo/TextImagesAssessment.js:241
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sImage alt attributes%3$s: Images on this page do not have alt attributes that reflect the topic of your text. %2$sAdd your keyphrase or synonyms to the alt tags of relevant images%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/TextImagesAssessment.js:207
/* Translators: %1$d expands to the number of images containing an alt attribute with the keyword,
* %2$d expands to the total number of images, %3$s and %4$s expand to links on yoast.com,
* %5$s expands to the anchor end tag. */
_n_noop( '%3$sImage alt attributes%5$s: Out of %2$d images on this page, only %1$d has an alt attribute that reflects the topic of your text. %4$sAdd your keyphrase or synonyms to the alt tags of more relevant images%5$s!', '%3$sImage alt attributes%5$s: Out of %2$d images on this page, only %1$d have alt attributes that reflect the topic of your text. %4$sAdd your keyphrase or synonyms to the alt tags of more relevant images%5$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/TextImagesAssessment.js:221
/* Translators: %1$s expands to a link on yoast.com,
* %2$s expands to the anchor end tag. */
__( '%1$sImage alt attributes%2$s: Good job!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/TextImagesAssessment.js:232
/* Translators: %1$d expands to the number of images containing an alt attribute with the keyword,
* %2$d expands to the total number of images, %3$s and %4$s expand to a link on yoast.com,
* %5$s expands to the anchor end tag. */
__( '%3$sImage alt attributes%5$s: Out of %2$d images on this page, %1$d have alt attributes with words from your keyphrase or synonyms. That\'s a bit much. %4$sOnly include the keyphrase or its synonyms when it really fits the image%5$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/TitleKeywordAssessment.js:138
/* Translators: %1$s expands to a link on yoast.com,
%2$s expands to the anchor end tag. */
__( '%1$sKeyphrase in title%2$s: The exact match of the keyphrase appears at the beginning of the SEO title. Good job!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/TitleKeywordAssessment.js:146
/* Translators: %1$s and %2$s expand to a link on yoast.com,
%3$s expands to the anchor end tag. */
__( '%1$sKeyphrase in title%3$s: The exact match of the keyphrase appears in the SEO title, but not at the beginning. %2$sTry to move it to the beginning%3$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/TitleKeywordAssessment.js:156
// Reference: node_modules/yoastseo/src/assessments/seo/TitleKeywordAssessment.js:166
/* Translators: %1$s and %2$s expand to a link on yoast.com,
%3$s expands to the anchor end tag. */
__( '%1$sKeyphrase in title%3$s: Does not contain the exact match. %2$sTry to write the exact match of your keyphrase in the SEO title%3$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/TitleKeywordAssessment.js:175
/* Translators: %1$s and %2$s expand to a link on yoast.com,
%3$s expands to the anchor end tag, %4$s expands to the keyword of the article. */
__( '%1$sKeyphrase in title%3$s: Not all the words from your keyphrase "%4$s" appear in the SEO title. %2$sTry to use the exact match of your keyphrase in the SEO title%3$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/UrlKeywordAssessment.js:122
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag */
__( '%1$sKeyphrase in slug%2$s: Great work!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/UrlKeywordAssessment.js:130
// Reference: node_modules/yoastseo/src/assessments/seo/UrlKeywordAssessment.js:146
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sKeyphrase in slug%3$s: (Part of) your keyphrase does not appear in the slug. %2$sChange that%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/UrlKeywordAssessment.js:139
/* Translators: %1$s expands to a link on yoast.com, %2$s expands to the anchor end tag */
__( '%1$sKeyphrase in slug%2$s: More than half of your keyphrase appears in the slug. That\'s great!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/UrlLengthAssessment.js:136
/* Translators: %1$s and %2$s expand to links on yoast.com, %3$s expands to the anchor end tag */
__( '%1$sSlug too long%3$s: the slug for this page is a bit long. %2$sShorten it%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessments/seo/urlStopWordsAssessment.js:38
/* Translators: %1$s and %2$s open links to an articles about stopwords, %3$s closes the links */
_n_noop( '%1$sSlug stopwords%3$s: The slug for this page contains a stop word. %2$sRemove it%3$s!', '%1$sSlug stopwords%3$s: The slug for this page contains stop words. %2$sRemove them%3$s!', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/assessor.js:216
// Reference: node_modules/yoastseo/src/parsedPaper/assess/TreeAssessor.js:164
// Reference: node_modules/yoastseo/src/worker/AnalysisWebWorker.js:1127
/* Translators: %1$s expands to the name of the assessment. */
__( 'An error occurred in the \'%1$s\' assessment', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/bundledPlugins/previouslyUsedKeywords.js:98
__( '%1$sPreviously used keyphrase%2$s: You\'ve not used this keyphrase before, very good.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/bundledPlugins/previouslyUsedKeywords.js:107
/* Translators: %1$s and %2$s expand to an admin link where the keyword is already used. %3$s and %4$s
expand to links on yoast.com, %4$s expands to the anchor end tag. */
__( '%3$sPreviously used keyphrase%5$s: You\'ve used this keyphrase %1$sonce before%2$s. %4$sDo not use your keyphrase more than once%5$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/bundledPlugins/previouslyUsedKeywords.js:117
/* Translators: %1$s and $3$s expand to the admin search page for the keyword, %2$d expands to the number
of times this keyword has been used before, %4$s and %5$s expand to links to yoast.com, %6$s expands to
the anchor end tag */
__( '%4$sPreviously used keyphrase%6$s: You\'ve used this keyphrase %1$s%2$d times before%3$s. %5$sDo not use your keyphrase more than once%6$s.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/config/presenter.js:11
__( 'Feedback', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/config/presenter.js:12
__( 'Content optimization: Has feedback', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/config/presenter.js:17
// Reference: node_modules/yoastseo/src/config/presenter.js:19
__( 'Needs improvement', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/config/presenter.js:18
__( 'Content optimization: Needs improvement', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/config/presenter.js:23
__( 'OK SEO score', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/config/presenter.js:24
__( 'Content optimization: OK SEO score', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/config/presenter.js:25
__( 'OK', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/config/presenter.js:29
__( 'Good SEO score', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/config/presenter.js:30
__( 'Content optimization: Good SEO score', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/config/presenter.js:31
__( 'Good', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/renderers/AssessorPresenter.js:361
__( 'Marks are disabled in current view', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/renderers/AssessorPresenter.js:362
__( 'Mark this result in the text', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/renderers/AssessorPresenter.js:363
__( 'Remove marks in the text', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/snippetPreview.js:399
__( 'Edit snippet', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/snippetPreview.js:400
__( 'SEO title', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/snippetPreview.js:401
__( 'Slug', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/snippetPreview.js:402
__( 'Meta description', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/snippetPreview.js:403
__( 'Close snippet editor', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/snippetPreview.js:404
__( 'Snippet preview', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/snippetPreview.js:405
__( 'SEO title preview:', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/snippetPreview.js:406
__( 'Slug preview:', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/snippetPreview.js:407
__( 'Meta description preview:', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/snippetPreview.js:408
__( 'You can click on each element in the preview to jump to the Snippet Editor.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/snippetPreview.js:409
__( 'Desktop preview', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/snippetPreview.js:410
__( 'Mobile preview', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/snippetPreview.js:411
__( 'Scroll to see the preview content.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/snippetPreview.js:620
__( 'Please provide an SEO title by editing the snippet below.', 'wordpress-seo' ),
// Reference: node_modules/yoastseo/src/snippetPreview.js:698
__( 'Please provide a meta description by editing the snippet below.', 'wordpress-seo' )
);
/* THIS IS THE END OF THE GENERATED FILE */
|
sifonsecac/capitalino-errante
|
wp-content/plugins/wordpress-seo/languages/yoast-seo-js.php
|
PHP
|
apache-2.0
| 40,953
|
#region License
// Copyright 2015-2020 Drew Noakes, Krzysztof Dul
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion
namespace Boing
{
/// <summary>
/// A constant downwards force applied to all non-pinned points, akin to gravity.
/// </summary>
public sealed class FlowDownwardForce : IForce
{
/// <summary>
/// The magnitude of the downward force, in Newtons.
/// </summary>
public float Magnitude { get; set; }
/// <summary>
/// Initialises a new instance of <see cref="FlowDownwardForce"/>.
/// </summary>
/// <param name="magnitude">The magnitude of the downward force, in Newtons. The default value is 10.</param>
public FlowDownwardForce(float magnitude = 10.0f)
{
Magnitude = magnitude;
}
/// <inheritdoc />
void IForce.ApplyTo(Simulation simulation)
{
var force = new Vector2f(0, Magnitude);
foreach (var pointMass in simulation.PointMasses)
{
if (pointMass.IsPinned)
continue;
pointMass.ApplyForce(force);
}
}
}
}
|
drewnoakes/boing
|
Boing/Forces/FlowDownwardForce.cs
|
C#
|
apache-2.0
| 1,714
|
# Phaseolus coccineus L. SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Sp. pl. 2:724. 1753
#### Original name
null
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Phaseolus/Phaseolus coccineus/README.md
|
Markdown
|
apache-2.0
| 195
|
package org.jboss.resteasy.tests;
import org.apache.http.client.HttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.codehaus.jackson.map.DeserializationConfig;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.jboss.resteasy.client.jaxrs.ResteasyClient;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.jboss.resteasy.client.jaxrs.engines.ApacheHttpClient4Engine;
import org.jboss.resteasy.security.BouncyIntegration;
import org.jboss.resteasy.security.KeyTools;
import org.jboss.resteasy.security.smime.PKCS7SignatureInput;
import org.jboss.resteasy.security.smime.SignedOutput;
import org.junit.Assert;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.security.InvalidKeyException;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.PrivateKey;
import java.security.SignatureException;
import java.security.cert.X509Certificate;
/**
* Should expose features not available in AS7
*
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
*/
@Path("/test")
public class NewFeaturesResource
{
private X509Certificate cert;
private PrivateKey privateKey;
public static final ObjectMapper DEFAULT_MAPPER = new ObjectMapper();
public static final ObjectMapper WRAPPED_MAPPER = new ObjectMapper();
// this whole block makes sure Jackson is exported
static
{
DEFAULT_MAPPER.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
//DEFAULT_MAPPER.enable(SerializationConfig.Feature.INDENT_OUTPUT);
DEFAULT_MAPPER.enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
WRAPPED_MAPPER.setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
//WRAPPED_MAPPER.enable(SerializationConfig.Feature.INDENT_OUTPUT);
WRAPPED_MAPPER.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE);
WRAPPED_MAPPER.enable(DeserializationConfig.Feature.UNWRAP_ROOT_VALUE);
WRAPPED_MAPPER.enable(DeserializationConfig.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
}
public NewFeaturesResource()
{
try
{
BouncyIntegration.init();
KeyPair keyPair = KeyPairGenerator.getInstance("RSA", "BC").generateKeyPair();
privateKey = keyPair.getPrivate();
cert = KeyTools.generateTestCertificate(keyPair);
}
catch (Exception e)
{
throw new RuntimeException(e);
}
}
@GET
@Path("signed/pkcs7-signature")
@Produces("application/pkcs7-signature")
public SignedOutput get()
{
SignedOutput output = new SignedOutput("hello world", "text/plain");
output.setCertificate(cert);
output.setPrivateKey(privateKey);
return output;
}
// make sure resteasy-crypto is exported
@GET
@Path("signed/text")
@Produces("text/plain")
public SignedOutput getText()
{
// just allocate a client to test that resteasy client is available and Apache HC4 is exposed.
ResteasyClient client = new ResteasyClientBuilder().build();
ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager();
cm.setMaxTotal(100);
cm.setDefaultMaxPerRoute(100);
HttpClient httpClient = new DefaultHttpClient(cm);
SignedOutput output = new SignedOutput("hello world", "text/plain");
output.setCertificate(cert);
output.setPrivateKey(privateKey);
return output;
}
}
|
raphaelning/resteasy-client-android
|
jaxrs/as7-integration-testing/modules-test/src/main/java/org/jboss/resteasy/tests/NewFeaturesResource.java
|
Java
|
apache-2.0
| 3,823
|
<?php
$cPageSource = GetLocationFile(__FILE__) ;
$vaDate = scDate::Date2Var(date("Y-m-d")) ;
?>
<section class="content-header">
<h1>
Lihat SPPD
</h1>
<ol class="breadcrumb">
<li><a href=""><i class="fa fa-envelope"></i>Lihat SPPD</a></li>
</ol>
</section>
<section class="content">
<div class="nav-tabs-custom">
<ul class="nav nav-tabs" id="myTabs">
<li class="active"><a href="#tab_1" data-toggle="tab" id="trsppd_tab_1">Daftar SPPD</a></li>
<li class="pull-right bg-danger no-margin" style="padding-right:10px ;padding-left:10px ">
<h5 style="font-weight:bold;">
<?=$vaDate['Hari'] . " , " . $vaDate['Tgl'] . " " . $vaDate['Bulan'] . " " . $vaDate['Tahun']?>
</h5>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active full-height" id="tab_1">
<form id="trsppd_filter">
<div class="row">
<div class="col-sm-3">
<div class="row">
<div class="col-sm-5">
<label>Start Date</label>
<input type="text" name="dTglAwal" id="dTglAwal" class="form-control sc-date text-center"
<?=scDate::SetDataDate()?> value="<?=date("01-01-Y")?>">
<Input type="hidden" name="cPageSource" id="cPageSource" value="<?=$cPageSource?>"/>
</div>
<div class="col-sm-2" style="margin-top:30px">s/d</div>
<div class="col-sm-5">
<label>End Date</label>
<input type="text" name="dTglAkhir" id="dTglAkhir" class="form-control sc-date text-center"
<?=scDate::SetDataDate()?> value="<?=date("d-m-Y")?>" >
</div>
</div>
</div>
<div class="col-sm-4">
<label>Status</label>
<br />
<div class="radio-inline">
<label>
<input type="radio" name="optStatusF" value="-" checked="true">
Semua
</label>
</div>
<div class="radio-inline">
<label>
<input type="radio" name="optStatusF" value="0">
Diinput
</label>
</div>
<div class="radio-inline">
<label>
<input type="radio" name="optStatusF" value="1">
Dikerjakan
</label>
</div>
<div class="radio-inline">
<label>
<input type="radio" name="optStatusF" value="2">
Selesai
</label>
</div>
</div>
<div class="col-sm-1" style="margin-top:20px">
<button type="button" name="cmdFilter" id="cmdFilter" class="btn btn-primary">Filter</button>
</div>
</div>
</form>
<hr />
<div id="gr_trsppd" style="width:100%;height:500px"></div>
</div>
</div><!-- /.tab-content -->
</div>
</section>
<script type="text/javascript">
OBJFORM_NEW.trsppd = {} ;
OBJFORM_NEW.trsppd.ID = "trsppd_filter" ;
OBJFORM_NEW.trsppd.Obj = $("#trsppd_filter") ;
OBJFORM_NEW.trsppd.ObjFilter = $("#trsppd_filter") ;
OBJFORM_NEW.trsppd.Url = OBJFORM_NEW.trsppd.Obj.find("#cPageSource").val().replace("./pages/","") ;
OBJFORM_NEW.trsppd.Url_A = OBJFORM_NEW.trsppd.Obj.find("#cPageSource").val() + ".ajax.php";
OBJFORM_NEW.trsppd.Grid1_Data = null ;
OBJFORM_NEW.trsppd.Grid1_LoadData= function(){
OBJFORM_NEW.trsppd.Grid1_Data = scGetDataJSON(OBJFORM_NEW.trsppd.ObjFilter.find("#cmdFilter")) ; ;
OBJFORM_NEW.trsppd.Grid1_Data["cPar"] = OBJFORM_NEW.trsppd.Url_A ;
OBJFORM_NEW.trsppd.Grid1_Data["cFunction"] = "Grid1_Load" ;
}
OBJFORM_NEW.trsppd.Grid1_Load = function(){
$("#gr_trsppd").w2grid({
name : OBJFORM_NEW.trsppd.ID + '_grid1',
limit : 100 ,
url : "./sc.core.php",
postData: OBJFORM_NEW.trsppd.Grid1_Data ,
show: {
toolbar : true,
toolbarReload : false,
toolbarColumns : false
},
multiSearch: true,
columns: [
{ field: 'code', caption: 'No SPPD', size: '150px', sortable: true,attr:'align=center' },
{ field: 'date', caption: 'Tanggal', size: '80px', sortable: true,attr:'align=center'},
{ field: 'status', caption: 'Status', size: '100px', sortable: true,attr:'align=center'},
{ field: 'purpose', caption: 'Maksud', size: '250px', sortable: true},
{ field: 'nip_pejabat', caption: 'Pemberi Perintah', size: '200px', sortable: true},
{ field: 'nip_leader', caption: 'yang diperintah', size: '200px', sortable: true},
{ field: 'place_to', caption: 'Tujuan', size: '150px', sortable: true },
{ field: 'date_go', caption: 'Berangkat', size: '80px', sortable: true,attr:'align=center'},
{ field: 'date_back', caption: 'Kembali', size: '80px', sortable: true,attr:'align=center'},
{ field: 'username', caption: 'User Input', size: '100px', sortable: true,attr:'align=center'}
]
});
}
OBJFORM_NEW.trsppd.Grid1_SetData = function(){
w2ui[OBJFORM_NEW.trsppd.ID + '_grid1'].postData = OBJFORM_NEW.trsppd.Grid1_Data ;
}
OBJFORM_NEW.trsppd.Grid1_Reload = function(){
w2ui[OBJFORM_NEW.trsppd.ID + '_grid1'].reload() ;
}
OBJFORM_NEW.trsppd.Grid1_Destroy = function(){
w2ui[OBJFORM_NEW.trsppd.ID + '_grid1'].destroy() ; //hancurkan grid biar bisa dilihat lagi
}
OBJFORM_NEW.trsppd.Grid1_Render = function(){
$("#gr_trsppd").w2render(OBJFORM_NEW.trsppd.ID + '_grid1') ;
}
OBJFORM_NEW.trsppd.Grid1_ReloadData = function(){
OBJFORM_NEW.trsppd.Grid1_LoadData() ;
OBJFORM_NEW.trsppd.Grid1_SetData() ;
OBJFORM_NEW.trsppd.Grid1_Reload() ;
}
OBJFORM_NEW.trsppd.Edit = function(code){
ChangePage("#"+OBJFORM_NEW.trsppd.Url+".add&code=" + code) ;
}
OBJFORM_NEW.trsppd.Delete = function(code){
if(confirm("Data dihapus ? ")){
scAjax(OBJFORM_NEW.trsppd.Url_A,'Deleting','code=' + code) ;
}
}
OBJFORM_NEW.trsppd.Print = function(code){
//if(confirm("Akan mencetak SPPD ?\nJika SPPD dicetak data tidak bisa dihapus")){
FRAME_PDF(true,"sc.reportme.php?scRpt="+OBJFORM_NEW.trsppd.Url+"&code=" + code) ;
//}
}
$(function(){
//init
OBJFORM_NEW.trsppd.Grid1_LoadData() ;
OBJFORM_NEW.trsppd.Grid1_Load() ;
scForm.InitDate({
cClass : "#" + OBJFORM_NEW.trsppd.ID + " .sc-date"
}) ;
//event
$("#cmdFilter").on("click",function(e){
e.preventDefault() ;
OBJFORM_NEW.trsppd.Grid1_ReloadData() ;
}) ;
}) ;
</script>
|
mirzaramadhany/webapp_sppd
|
pages/report/rptsppd.php
|
PHP
|
apache-2.0
| 7,843
|
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.activemq.artemis.core.protocol.core.impl.wireformat;
import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
import org.apache.activemq.artemis.api.core.SimpleString;
import org.apache.activemq.artemis.core.protocol.core.impl.PacketImpl;
public class ScaleDownAnnounceMessage extends PacketImpl
{
private SimpleString targetNodeId;
private SimpleString scaledDownNodeId;
public ScaleDownAnnounceMessage()
{
super(SCALEDOWN_ANNOUNCEMENT);
}
public ScaleDownAnnounceMessage(SimpleString targetNodeId, SimpleString scaledDownNodeId)
{
super(SCALEDOWN_ANNOUNCEMENT);
this.targetNodeId = targetNodeId;
this.scaledDownNodeId = scaledDownNodeId;
}
@Override
public void encodeRest(ActiveMQBuffer buffer)
{
buffer.writeSimpleString(targetNodeId);
buffer.writeSimpleString(scaledDownNodeId);
}
@Override
public void decodeRest(ActiveMQBuffer buffer)
{
targetNodeId = buffer.readSimpleString();
scaledDownNodeId = buffer.readSimpleString();
}
public SimpleString getTargetNodeId()
{
return targetNodeId;
}
public SimpleString getScaledDownNodeId()
{
return scaledDownNodeId;
}
}
|
jbertram/activemq-artemis-old
|
artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/ScaleDownAnnounceMessage.java
|
Java
|
apache-2.0
| 2,027
|
# -*- coding: utf-8 -*-
# Copyright (C) 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# -- General configuration ----------------------------------------------------
# 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',
'sphinxcontrib.apidoc',
'openstackdocstheme',
]
# openstackdocstheme options
openstackdocs_repo_name = 'openstack/oslo.privsep'
openstackdocs_bug_project = 'oslo.privsep'
openstackdocs_bug_tag = ''
# The suffix of source filenames.
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
copyright = u'2014, OpenStack Foundation'
# 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
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'native'
# -- Options for HTML output --------------------------------------------------
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
html_theme = 'openstackdocs'
# -- sphinxcontrib.apidoc configuration --------------------------------------
apidoc_module_dir = '../../oslo_privsep'
apidoc_output_dir = 'reference/api'
apidoc_excluded_paths = [
'tests',
]
|
openstack/oslo.privsep
|
doc/source/conf.py
|
Python
|
apache-2.0
| 2,044
|
package com.medievallords.carbyne.gates.commands;
import com.medievallords.carbyne.utils.MessageManager;
import com.medievallords.carbyne.utils.command.BaseCommand;
import com.medievallords.carbyne.utils.command.Command;
import com.medievallords.carbyne.utils.command.CommandArgs;
import org.bukkit.command.CommandSender;
/**
* Created by Calvin on 1/30/2017
* for the Carbyne-Gear project.
*/
public class GateCommand extends BaseCommand {
//Example command in the class: GateAddRSBCommand
@Command(name = "gate", permission = "carbyne.gate")
public void onCommand(CommandArgs commandArgs) {
CommandSender sender = commandArgs.getSender();
String[] args = commandArgs.getArgs();
if (args.length == 0) {
MessageManager.sendMessage(sender, "&7&m-------&r&7 [ &aGates &7] &m-------");
MessageManager.sendMessage(sender, "&a/gate create [name] &7- Creates a new gate.");
MessageManager.sendMessage(sender, "&a/gate active [name] &7- Sets the active length.");
MessageManager.sendMessage(sender, "&a/gate addPP [name] &7- Adds a PressurePlate to a gate.");
MessageManager.sendMessage(sender, "&a/gate addRSB [name] &7- Adds a RedstoneBlock to a gate.");
MessageManager.sendMessage(sender, "&a/gate addB [name] &7- Adds a Button to a gate.");
MessageManager.sendMessage(sender, "&a/gate addSpawner [name] [spawnerName] &7- Adds a MythicSpawner to a gate.");
MessageManager.sendMessage(sender, "&a/gate delPP &7- Deletes a PressurePlate from a gate.");
MessageManager.sendMessage(sender, "&a/gate delRSB &7- Deletes a Redstone Block from a gate.");
MessageManager.sendMessage(sender, "&a/gate delB &7- Deletes a Button from a gate.");
MessageManager.sendMessage(sender, "&a/gate delSpawner [name] [SpawnerName] &7- Deletes a MythicSpawner from a gate.");
MessageManager.sendMessage(sender, "&a/gate list &7- Lists all available gates.");
MessageManager.sendMessage(sender, "&a/gate status [name] &7- Checks a gates states.");
MessageManager.sendMessage(sender, "&a/gate rename [name] &7- Renames a gate.");
}
}
}
|
YoungOG/CarbyneCore
|
src/com/medievallords/carbyne/gates/commands/GateCommand.java
|
Java
|
apache-2.0
| 2,231
|
<!DOCTYPE html>
<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />
<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />
<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">
<link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">
<meta name="keywords" content="Hexo, NexT" />
<link rel="alternate" href="/atom.xml" title="靖然是你" type="application/atom+xml" />
<meta name="description" content="记录一只Android小菜鸡学习的点点滴滴">
<meta name="keywords" content="Android">
<meta property="og:type" content="website">
<meta property="og:title" content="靖然是你">
<meta property="og:url" content="http://levent-j.com/categories/Java/index.html">
<meta property="og:site_name" content="靖然是你">
<meta property="og:description" content="记录一只Android小菜鸡学习的点点滴滴">
<meta property="og:locale" content="zh-Hans">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="靖然是你">
<meta name="twitter:description" content="记录一只Android小菜鸡学习的点点滴滴">
<script type="text/javascript" id="hexo.configurations">
var NexT = window.NexT || {};
var CONFIG = {
root: '/',
scheme: 'Mist',
version: '5.1.4',
sidebar: {"position":"left","display":"post","offset":12,"b2t":true,"scrollpercent":false,"onmobile":false},
fancybox: true,
tabs: true,
motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
duoshuo: {
userId: '0',
author: '博主'
},
algolia: {
applicationID: '',
apiKey: '',
indexName: '',
hits: {"per_page":10},
labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
}
};
</script>
<link rel="canonical" href="http://levent-j.com/categories/Java/"/>
<title>分类: Java | 靖然是你</title>
</head>
<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">
<div class="container sidebar-position-left ">
<div class="headband"></div>
<header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner"><div class="site-brand-wrapper">
<div class="site-meta ">
<div class="custom-logo-site-title">
<a href="/" class="brand" rel="start">
<span class="logo-line-before"><i></i></span>
<span class="site-title">靖然是你</span>
<span class="logo-line-after"><i></i></span>
</a>
</div>
<p class="site-subtitle">哇啦啦啦</p>
</div>
<div class="site-nav-toggle">
<button>
<span class="btn-bar"></span>
<span class="btn-bar"></span>
<span class="btn-bar"></span>
</button>
</div>
</div>
<nav class="site-nav">
<ul id="menu" class="menu">
<li class="menu-item menu-item-home">
<a href="/" rel="section">
<i class="menu-item-icon fa fa-fw fa-home"></i> <br />
首页
</a>
</li>
<li class="menu-item menu-item-about">
<a href="/about/" rel="section">
<i class="menu-item-icon fa fa-fw fa-user"></i> <br />
关于
</a>
</li>
<li class="menu-item menu-item-tags">
<a href="/tags" rel="section">
<i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
标签
</a>
</li>
<li class="menu-item menu-item-categories">
<a href="/categories" rel="section">
<i class="menu-item-icon fa fa-fw fa-th"></i> <br />
分类
</a>
</li>
<li class="menu-item menu-item-archives">
<a href="/archives/" rel="section">
<i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
归档
</a>
</li>
<li class="menu-item menu-item-search">
<a href="javascript:;" class="popup-trigger">
<i class="menu-item-icon fa fa-search fa-fw"></i> <br />
搜索
</a>
</li>
</ul>
<div class="site-search">
<div class="popup search-popup local-search-popup">
<div class="local-search-header clearfix">
<span class="search-icon">
<i class="fa fa-search"></i>
</span>
<span class="popup-btn-close">
<i class="fa fa-times-circle"></i>
</span>
<div class="local-search-input-wrapper">
<input autocomplete="off"
placeholder="搜索..." spellcheck="false"
type="text" id="local-search-input">
</div>
</div>
<div id="local-search-result"></div>
</div>
</div>
</nav>
</div>
</header>
<main id="main" class="main">
<div class="main-inner">
<div class="content-wrap">
<div id="content" class="content">
<div class="post-block category">
<div id="posts" class="posts-collapse">
<div class="collection-title">
<h1>Java<small>分类</small>
</h1>
</div>
<article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h2 class="post-title">
<a class="post-title-link" href="/2017/10/25/jvm_note/" itemprop="url">
<span itemprop="name">《深入理解Java虚拟机》读书笔记</span>
</a>
</h2>
<div class="post-meta">
<time class="post-time" itemprop="dateCreated"
datetime="2017-10-25T11:08:26+08:00"
content="2017-10-25" >
10-25
</time>
</div>
</header>
</article>
</div>
</div>
</div>
</div>
<div class="sidebar-toggle">
<div class="sidebar-toggle-line-wrap">
<span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
<span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
<span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
</div>
</div>
<aside id="sidebar" class="sidebar">
<div class="sidebar-inner">
<section class="site-overview-wrap sidebar-panel sidebar-panel-active">
<div class="site-overview">
<div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
<img class="site-author-image" itemprop="image"
src="http://blog-lwj.oss-cn-shenzhen.aliyuncs.com/avater.png"
alt="Levent-J" />
<p class="site-author-name" itemprop="name">Levent-J</p>
<p class="site-description motion-element" itemprop="description">记录一只Android小菜鸡学习的点点滴滴</p>
</div>
<nav class="site-state motion-element">
<div class="site-state-item site-state-posts">
<a href="/archives/">
<span class="site-state-item-count">20</span>
<span class="site-state-item-name">日志</span>
</a>
</div>
<div class="site-state-item site-state-categories">
<a href="/categories/index.html">
<span class="site-state-item-count">6</span>
<span class="site-state-item-name">分类</span>
</a>
</div>
<div class="site-state-item site-state-tags">
<a href="/tags/index.html">
<span class="site-state-item-count">20</span>
<span class="site-state-item-name">标签</span>
</a>
</div>
</nav>
<div class="feed-link motion-element">
<a href="/atom.xml" rel="alternate">
<i class="fa fa-rss"></i>
RSS
</a>
</div>
<div class="links-of-author motion-element">
<span class="links-of-author-item">
<a href="https://github.com/Levent-J" target="_blank" title="GitHub">
<i class="fa fa-fw fa-github"></i>GitHub</a>
</span>
<span class="links-of-author-item">
<a href="levent_j@163.com" target="_blank" title="E-Mail">
<i class="fa fa-fw fa-envelope"></i>E-Mail</a>
</span>
<span class="links-of-author-item">
<a href="https://www.zhihu.com/people/levent_j/activities" target="_blank" title="知乎">
<i class="fa fa-fw fa-globe"></i>知乎</a>
</span>
</div>
<div class="links-of-blogroll motion-element links-of-blogroll-block">
<div class="links-of-blogroll-title">
<i class="fa fa-fw fa-link"></i>
Links
</div>
<ul class="links-of-blogroll-list">
<li class="links-of-blogroll-item">
<a href="https://braveghz.github.io/" title="小仙女在这里" target="_blank">小仙女在这里</a>
</li>
</ul>
</div>
</div>
</section>
<div class="back-to-top">
<i class="fa fa-arrow-up"></i>
</div>
</div>
</aside>
</div>
</main>
<footer id="footer" class="footer">
<div class="footer-inner">
<div class="copyright">© 2017 — <span itemprop="copyrightYear">2019</span>
<span class="with-love">
<i class="fa fa-user"></i>
</span>
<span class="author" itemprop="copyrightHolder">Levent-J</span>
</div>
<div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>
<span class="post-meta-divider">|</span>
<div class="theme-info">主题 — <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Mist</a> v5.1.4</div>
</div>
</footer>
</div>
<script type="text/javascript">
if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
window.Promise = null;
}
</script>
<script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
<script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
<script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
<script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
<script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
<script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
<script type="text/javascript" src="/lib/canvas-nest/canvas-nest.min.js"></script>
<script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src="//unpkg.com/valine/dist/Valine.min.js"></script>
<script type="text/javascript">
var GUEST = ['nick','mail','link'];
var guest = 'nick,mail,link';
guest = guest.split(',').filter(item=>{
return GUEST.indexOf(item)>-1;
});
new Valine({
el: '#comments' ,
verify: false,
notify: false,
appId: 'dx4gJ3O7BAa7y1xSEIsMv2DB-gzGzoHsz',
appKey: 'p912apR0pe3ePcyJspIlx30W',
placeholder: '来啦老弟~',
avatar:'mm',
guest_info:guest,
pageSize:'10' || 10,
});
</script>
<script type="text/javascript">
// Popup Window;
var isfetched = false;
var isXml = true;
// Search DB path;
var search_path = "search.xml";
if (search_path.length === 0) {
search_path = "search.xml";
} else if (/json$/i.test(search_path)) {
isXml = false;
}
var path = "/" + search_path;
// monitor main search box;
var onPopupClose = function (e) {
$('.popup').hide();
$('#local-search-input').val('');
$('.search-result-list').remove();
$('#no-result').remove();
$(".local-search-pop-overlay").remove();
$('body').css('overflow', '');
}
function proceedsearch() {
$("body")
.append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
.css('overflow', 'hidden');
$('.search-popup-overlay').click(onPopupClose);
$('.popup').toggle();
var $localSearchInput = $('#local-search-input');
$localSearchInput.attr("autocapitalize", "none");
$localSearchInput.attr("autocorrect", "off");
$localSearchInput.focus();
}
// search function;
var searchFunc = function(path, search_id, content_id) {
'use strict';
// start loading animation
$("body")
.append('<div class="search-popup-overlay local-search-pop-overlay">' +
'<div id="search-loading-icon">' +
'<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
'</div>' +
'</div>')
.css('overflow', 'hidden');
$("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');
$.ajax({
url: path,
dataType: isXml ? "xml" : "json",
async: true,
success: function(res) {
// get the contents from search data
isfetched = true;
$('.popup').detach().appendTo('.header-inner');
var datas = isXml ? $("entry", res).map(function() {
return {
title: $("title", this).text(),
content: $("content",this).text(),
url: $("url" , this).text()
};
}).get() : res;
var input = document.getElementById(search_id);
var resultContent = document.getElementById(content_id);
var inputEventFunction = function() {
var searchText = input.value.trim().toLowerCase();
var keywords = searchText.split(/[\s\-]+/);
if (keywords.length > 1) {
keywords.push(searchText);
}
var resultItems = [];
if (searchText.length > 0) {
// perform local searching
datas.forEach(function(data) {
var isMatch = false;
var hitCount = 0;
var searchTextCount = 0;
var title = data.title.trim();
var titleInLowerCase = title.toLowerCase();
var content = data.content.trim().replace(/<[^>]+>/g,"");
var contentInLowerCase = content.toLowerCase();
var articleUrl = decodeURIComponent(data.url);
var indexOfTitle = [];
var indexOfContent = [];
// only match articles with not empty titles
if(title != '') {
keywords.forEach(function(keyword) {
function getIndexByWord(word, text, caseSensitive) {
var wordLen = word.length;
if (wordLen === 0) {
return [];
}
var startPosition = 0, position = [], index = [];
if (!caseSensitive) {
text = text.toLowerCase();
word = word.toLowerCase();
}
while ((position = text.indexOf(word, startPosition)) > -1) {
index.push({position: position, word: word});
startPosition = position + wordLen;
}
return index;
}
indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
});
if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
isMatch = true;
hitCount = indexOfTitle.length + indexOfContent.length;
}
}
// show search results
if (isMatch) {
// sort index by position of keyword
[indexOfTitle, indexOfContent].forEach(function (index) {
index.sort(function (itemLeft, itemRight) {
if (itemRight.position !== itemLeft.position) {
return itemRight.position - itemLeft.position;
} else {
return itemLeft.word.length - itemRight.word.length;
}
});
});
// merge hits into slices
function mergeIntoSlice(text, start, end, index) {
var item = index[index.length - 1];
var position = item.position;
var word = item.word;
var hits = [];
var searchTextCountInSlice = 0;
while (position + word.length <= end && index.length != 0) {
if (word === searchText) {
searchTextCountInSlice++;
}
hits.push({position: position, length: word.length});
var wordEnd = position + word.length;
// move to next position of hit
index.pop();
while (index.length != 0) {
item = index[index.length - 1];
position = item.position;
word = item.word;
if (wordEnd > position) {
index.pop();
} else {
break;
}
}
}
searchTextCount += searchTextCountInSlice;
return {
hits: hits,
start: start,
end: end,
searchTextCount: searchTextCountInSlice
};
}
var slicesOfTitle = [];
if (indexOfTitle.length != 0) {
slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
}
var slicesOfContent = [];
while (indexOfContent.length != 0) {
var item = indexOfContent[indexOfContent.length - 1];
var position = item.position;
var word = item.word;
// cut out 100 characters
var start = position - 20;
var end = position + 80;
if(start < 0){
start = 0;
}
if (end < position + word.length) {
end = position + word.length;
}
if(end > content.length){
end = content.length;
}
slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
}
// sort slices in content by search text's count and hits' count
slicesOfContent.sort(function (sliceLeft, sliceRight) {
if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
return sliceRight.searchTextCount - sliceLeft.searchTextCount;
} else if (sliceLeft.hits.length !== sliceRight.hits.length) {
return sliceRight.hits.length - sliceLeft.hits.length;
} else {
return sliceLeft.start - sliceRight.start;
}
});
// select top N slices in content
var upperBound = parseInt('1');
if (upperBound >= 0) {
slicesOfContent = slicesOfContent.slice(0, upperBound);
}
// highlight title and content
function highlightKeyword(text, slice) {
var result = '';
var prevEnd = slice.start;
slice.hits.forEach(function (hit) {
result += text.substring(prevEnd, hit.position);
var end = hit.position + hit.length;
result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
prevEnd = end;
});
result += text.substring(prevEnd, slice.end);
return result;
}
var resultItem = '';
if (slicesOfTitle.length != 0) {
resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
} else {
resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
}
slicesOfContent.forEach(function (slice) {
resultItem += "<a href='" + articleUrl + "'>" +
"<p class=\"search-result\">" + highlightKeyword(content, slice) +
"...</p>" + "</a>";
});
resultItem += "</li>";
resultItems.push({
item: resultItem,
searchTextCount: searchTextCount,
hitCount: hitCount,
id: resultItems.length
});
}
})
};
if (keywords.length === 1 && keywords[0] === "") {
resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
} else if (resultItems.length === 0) {
resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
} else {
resultItems.sort(function (resultLeft, resultRight) {
if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
return resultRight.searchTextCount - resultLeft.searchTextCount;
} else if (resultLeft.hitCount !== resultRight.hitCount) {
return resultRight.hitCount - resultLeft.hitCount;
} else {
return resultRight.id - resultLeft.id;
}
});
var searchResultList = '<ul class=\"search-result-list\">';
resultItems.forEach(function (result) {
searchResultList += result.item;
})
searchResultList += "</ul>";
resultContent.innerHTML = searchResultList;
}
}
if ('auto' === 'auto') {
input.addEventListener('input', inputEventFunction);
} else {
$('.search-icon').click(inputEventFunction);
input.addEventListener('keypress', function (event) {
if (event.keyCode === 13) {
inputEventFunction();
}
});
}
// remove loading animation
$(".local-search-pop-overlay").remove();
$('body').css('overflow', '');
proceedsearch();
}
});
}
// handle and trigger popup window;
$('.popup-trigger').click(function(e) {
e.stopPropagation();
if (isfetched === false) {
searchFunc(path, 'local-search-input', 'local-search-result');
} else {
proceedsearch();
};
});
$('.popup-btn-close').click(onPopupClose);
$('.popup').click(function(e){
e.stopPropagation();
});
$(document).on('keyup', function (event) {
var shouldDismissSearchPopup = event.which === 27 &&
$('.search-popup').is(':visible');
if (shouldDismissSearchPopup) {
onPopupClose();
}
});
</script>
<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
<script>AV.initialize("dx4gJ3O7BAa7y1xSEIsMv2DB-gzGzoHsz", "p912apR0pe3ePcyJspIlx30W");</script>
<script>
function showTime(Counter) {
var query = new AV.Query(Counter);
var entries = [];
var $visitors = $(".leancloud_visitors");
$visitors.each(function () {
entries.push( $(this).attr("id").trim() );
});
query.containedIn('url', entries);
query.find()
.done(function (results) {
var COUNT_CONTAINER_REF = '.leancloud-visitors-count';
if (results.length === 0) {
$visitors.find(COUNT_CONTAINER_REF).text(0);
return;
}
for (var i = 0; i < results.length; i++) {
var item = results[i];
var url = item.get('url');
var time = item.get('time');
var element = document.getElementById(url);
$(element).find(COUNT_CONTAINER_REF).text(time);
}
for(var i = 0; i < entries.length; i++) {
var url = entries[i];
var element = document.getElementById(url);
var countSpan = $(element).find(COUNT_CONTAINER_REF);
if( countSpan.text() == '') {
countSpan.text(0);
}
}
})
.fail(function (object, error) {
console.log("Error: " + error.code + " " + error.message);
});
}
function addCount(Counter) {
var $visitors = $(".leancloud_visitors");
var url = $visitors.attr('id').trim();
var title = $visitors.attr('data-flag-title').trim();
var query = new AV.Query(Counter);
query.equalTo("url", url);
query.find({
success: function(results) {
if (results.length > 0) {
var counter = results[0];
counter.fetchWhenSave(true);
counter.increment("time");
counter.save(null, {
success: function(counter) {
var $element = $(document.getElementById(url));
$element.find('.leancloud-visitors-count').text(counter.get('time'));
},
error: function(counter, error) {
console.log('Failed to save Visitor num, with error message: ' + error.message);
}
});
} else {
var newcounter = new Counter();
/* Set ACL */
var acl = new AV.ACL();
acl.setPublicReadAccess(true);
acl.setPublicWriteAccess(true);
newcounter.setACL(acl);
/* End Set ACL */
newcounter.set("title", title);
newcounter.set("url", url);
newcounter.set("time", 1);
newcounter.save(null, {
success: function(newcounter) {
var $element = $(document.getElementById(url));
$element.find('.leancloud-visitors-count').text(newcounter.get('time'));
},
error: function(newcounter, error) {
console.log('Failed to create');
}
});
}
},
error: function(error) {
console.log('Error:' + error.code + " " + error.message);
}
});
}
$(function() {
var Counter = AV.Object.extend("Counter");
if ($('.leancloud_visitors').length == 1) {
addCount(Counter);
} else if ($('.post-title-link').length > 1) {
showTime(Counter);
}
});
</script>
</body>
</html>
|
Levent-J/Levent-J.github.io
|
categories/Java/index.html
|
HTML
|
apache-2.0
| 30,147
|
/*******************************************************************************
* Copyright (c) 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Zend Technologies
*******************************************************************************/
package org.eclipse.php.internal.core.codeassist;
import org.eclipse.php.core.codeassist.ICompletionContext;
public interface CompletionRequestorExtension {
ICompletionContext[] createContexts();
}
|
vovagrechka/fucking-everything
|
phizdets/phizdets-idea/eclipse-src/org.eclipse.php.core/src/org/eclipse/php/internal/core/codeassist/CompletionRequestorExtension.java
|
Java
|
apache-2.0
| 762
|
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="__PUBLIC__/Admin/images/Admin_css.css" type="text/css" rel="stylesheet">
<link rel="shortcut icon" href="__PUBLIC__/Admin/images/myfav.ico" type="image/x-icon" />
<import file= "Admin.js.admin,Admin.js.Ajax,Admin.js.Jquery"/>
<script charset="utf-8" src="__PUBLIC__/Common/artDialog/jquery.artDialog.js?skin=green"></script>
<script charset="utf-8" src="__PUBLIC__/Common/artDialog/extend.js"></script>
<title>网站会员管理</title>
<script>
function CheckForm()
{
if(EmptyCheckForm('rankname','等级名称不能为空!','')) return false;
if(EmptyCheckForm('rankmoney','等级积分不能为空!',''))return false;
if(EmptyCheckForm('rankimg','等级图片不能为空!',''))return false;
}
function EmptyCheckForm(id,value,set)
{
if($('#'+id).val()==set)
{
$.dialog({icon:'warning',content:value,ok:function(){ $('#' + id).focus();}});return true;
}
return false;
}
</script>
</head>
<body>
<form method="POST" action="{:U('Member/doaddrank')}" onsubmit="return CheckForm()">
<table width="95%" border="0" align="center" cellpadding="3" cellspacing="2" bgcolor="#FFFFFF" class="admintable">
<tr>
<td colspan="2" class="admintitle">添加新的用户等级</td>
</tr>
<tr style="text-align:left">
<td width="37%" class="forumrow"><B>等级名称</B></td>
<td width="63%" class="forumrow"><input size="30" name="rankname" id="rankname" type="text"></td>
</tr>
<tr style="text-align:left">
<td width="37%" class="forumrow"><B>最少积分</B><BR></td>
<td width="63%" class="forumrow"><input size="30" name="rankmoney" id="rankmoney" type="text"></td>
</tr>
<tr style="text-align:left">
<td width="37%" class="forumrow"><B>所属会员组</B><BR> 荣誉会员组和管理员组不参与积分累积!</td>
<td width="63%" class="forumrow">
<select name="groupid">
<option value="1">普通会员组</option>
<option value="2">荣誉会员组</option>
<option value="3">管理员组</option>
</select>
</td>
</tr>
<tr style="text-align:left">
<td width="37%" class="forumrow"><B>等级图片</B></td>
<td width="63%" class="forumrow"><input name="rankimg" type="text" id="rankimg" value="level1.gif" size="30"> </td>
</tr>
<tr>
<td colspan="2" class="forumrow">
<input name="Submit" type="submit" class="bnt" value="提 交"/> <input type="button" class="bnt" value="返 回" onclick="history.go(-1)"/> </td>
</tr>
</table>
</form>
</body>
</html>
|
minglangasp/pppon
|
Admin/Tpl/Member/addrank.html
|
HTML
|
apache-2.0
| 2,639
|
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Formatting;
using System.Collections.Immutable;
using System.Composition;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace CodeCracker.CSharp.Design
{
[ExportCodeFixProvider("CodeCrackerRethrowExceptionCodeFixProvider", LanguageNames.CSharp), Shared]
public class NameOfCodeFixProvider : CodeFixProvider
{
public override ImmutableArray<string> FixableDiagnosticIds
{
get
{
return ImmutableArray.Create(DiagnosticId.NameOf.ToDiagnosticId());
}
}
public override FixAllProvider GetFixAllProvider() => WellKnownFixAllProviders.BatchFixer;
public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
{
var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
var diagnostic = context.Diagnostics.First();
var diagnosticSpan = diagnostic.Location.SourceSpan;
var stringLiteral = root.FindToken(diagnosticSpan.Start).Parent.AncestorsAndSelf().OfType<LiteralExpressionSyntax>().FirstOrDefault();
if (stringLiteral != null)
context.RegisterCodeFix(CodeAction.Create("Use nameof()", c => MakeNameOfAsync(context.Document, stringLiteral, c)), diagnostic);
}
private async Task<Document> MakeNameOfAsync(Document document, LiteralExpressionSyntax stringLiteral, CancellationToken cancelationToken)
{
var newNameof = SyntaxFactory.ParseExpression($"nameof({stringLiteral.Token.ValueText})")
.WithLeadingTrivia(stringLiteral.GetLeadingTrivia())
.WithTrailingTrivia(stringLiteral.GetTrailingTrivia())
.WithAdditionalAnnotations(Formatter.Annotation);
var root = await document.GetSyntaxRootAsync(cancelationToken);
var newRoot = root.ReplaceNode(stringLiteral, newNameof);
return document.WithSyntaxRoot(newRoot);
}
}
}
|
f14n/code-cracker
|
src/CSharp/CodeCracker/Design/NameOfCodeFixProvider.cs
|
C#
|
apache-2.0
| 2,317
|
package net.gonnot.neuralnetwork;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.chart.LineChart;
import javafx.scene.chart.NumberAxis;
import javafx.scene.chart.XYChart;
import javafx.scene.chart.XYChart.Series;
import javafx.scene.control.Button;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
public final class ApplicationFrame extends Application {
@Override
public final void start(Stage primaryStage) {
Button launchTrainingButton = new Button();
launchTrainingButton.setText("Launch Training");
launchTrainingButton.setOnAction(event -> System.exit(0));
BorderPane root = new BorderPane();
root.setTop(launchTrainingButton);
root.setCenter(createCostLineChart());
Scene scene = new Scene(root, 300, 250);
primaryStage.setTitle("Hello World!");
primaryStage.setScene(scene);
primaryStage.show();
}
private LineChart<Number, Number> createCostLineChart() {
//defining the axes
NumberAxis xAxis = new NumberAxis();
NumberAxis yAxis = new NumberAxis();
yAxis.setLabel("Cost");
xAxis.setLabel("Iteration");
//creating the chart
LineChart<Number, Number> lineChart = new LineChart<>(xAxis, yAxis);
lineChart.setTitle("Cost Value by Iteration");
lineChart.getData().add(createSampleCostRun());
return lineChart;
}
private static Series createSampleCostRun() {
//defining a series
Series series = new Series();
series.setName("run 1");
//populating the series with data
series.getData().add(new XYChart.Data(1, 23));
series.getData().add(new XYChart.Data(2, 14));
series.getData().add(new XYChart.Data(3, 15));
series.getData().add(new XYChart.Data(4, 24));
series.getData().add(new XYChart.Data(5, 34));
series.getData().add(new XYChart.Data(6, 36));
series.getData().add(new XYChart.Data(7, 22));
series.getData().add(new XYChart.Data(8, 45));
series.getData().add(new XYChart.Data(9, 43));
series.getData().add(new XYChart.Data(10, 17));
series.getData().add(new XYChart.Data(11, 29));
series.getData().add(new XYChart.Data(12, 25));
return series;
}
}
|
gonnot/neural-network-samples
|
src/main/java/net/gonnot/neuralnetwork/ApplicationFrame.java
|
Java
|
apache-2.0
| 2,353
|
(function(){
function AlbumCtrl(Fixtures, SongPlayer) {
this.albumData = Fixtures.getAlbum();
this.songPlayer = SongPlayer;
}
angular
.module('blocJams')
.controller('AlbumCtrl', ['Fixtures', 'SongPlayer', AlbumCtrl]);
})();
|
goodsporning/bloc-jams-angular
|
app/scripts/controllers/AlbumCtrl.js
|
JavaScript
|
apache-2.0
| 270
|
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Generated code. DO NOT EDIT!
using gaxgrpc = Google.Api.Gax.Grpc;
using lro = Google.LongRunning;
using grpccore = Grpc.Core;
using moq = Moq;
using st = System.Threading;
using stt = System.Threading.Tasks;
using xunit = Xunit;
namespace Google.Cloud.Compute.V1.Tests
{
/// <summary>Generated unit tests.</summary>
public sealed class GeneratedTargetGrpcProxiesClientTest
{
[xunit::FactAttribute]
public void GetRequestObject()
{
moq::Mock<TargetGrpcProxies.TargetGrpcProxiesClient> mockGrpcClient = new moq::Mock<TargetGrpcProxies.TargetGrpcProxiesClient>(moq::MockBehavior.Strict);
mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
GetTargetGrpcProxyRequest request = new GetTargetGrpcProxyRequest
{
TargetGrpcProxy = "target_grpc_proxy51252bbb",
Project = "projectaa6ff846",
};
TargetGrpcProxy expectedResponse = new TargetGrpcProxy
{
Id = 11672635353343658936UL,
Kind = "kindf7aa39d9",
Name = "name1c9368b0",
CreationTimestamp = "creation_timestamp235e59a1",
SelfLinkWithId = "self_link_with_id6d1e3896",
ValidateForProxyless = true,
Fingerprint = "fingerprint009e6052",
UrlMap = "url_map3ccdbf57",
Description = "description2cf9da67",
SelfLink = "self_link7e87f12d",
};
mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null);
TargetGrpcProxy response = client.Get(request);
xunit::Assert.Same(expectedResponse, response);
mockGrpcClient.VerifyAll();
}
[xunit::FactAttribute]
public async stt::Task GetRequestObjectAsync()
{
moq::Mock<TargetGrpcProxies.TargetGrpcProxiesClient> mockGrpcClient = new moq::Mock<TargetGrpcProxies.TargetGrpcProxiesClient>(moq::MockBehavior.Strict);
mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
GetTargetGrpcProxyRequest request = new GetTargetGrpcProxyRequest
{
TargetGrpcProxy = "target_grpc_proxy51252bbb",
Project = "projectaa6ff846",
};
TargetGrpcProxy expectedResponse = new TargetGrpcProxy
{
Id = 11672635353343658936UL,
Kind = "kindf7aa39d9",
Name = "name1c9368b0",
CreationTimestamp = "creation_timestamp235e59a1",
SelfLinkWithId = "self_link_with_id6d1e3896",
ValidateForProxyless = true,
Fingerprint = "fingerprint009e6052",
UrlMap = "url_map3ccdbf57",
Description = "description2cf9da67",
SelfLink = "self_link7e87f12d",
};
mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<TargetGrpcProxy>(stt::Task.FromResult(expectedResponse), null, null, null, null));
TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null);
TargetGrpcProxy responseCallSettings = await client.GetAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));
xunit::Assert.Same(expectedResponse, responseCallSettings);
TargetGrpcProxy responseCancellationToken = await client.GetAsync(request, st::CancellationToken.None);
xunit::Assert.Same(expectedResponse, responseCancellationToken);
mockGrpcClient.VerifyAll();
}
[xunit::FactAttribute]
public void Get()
{
moq::Mock<TargetGrpcProxies.TargetGrpcProxiesClient> mockGrpcClient = new moq::Mock<TargetGrpcProxies.TargetGrpcProxiesClient>(moq::MockBehavior.Strict);
mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
GetTargetGrpcProxyRequest request = new GetTargetGrpcProxyRequest
{
TargetGrpcProxy = "target_grpc_proxy51252bbb",
Project = "projectaa6ff846",
};
TargetGrpcProxy expectedResponse = new TargetGrpcProxy
{
Id = 11672635353343658936UL,
Kind = "kindf7aa39d9",
Name = "name1c9368b0",
CreationTimestamp = "creation_timestamp235e59a1",
SelfLinkWithId = "self_link_with_id6d1e3896",
ValidateForProxyless = true,
Fingerprint = "fingerprint009e6052",
UrlMap = "url_map3ccdbf57",
Description = "description2cf9da67",
SelfLink = "self_link7e87f12d",
};
mockGrpcClient.Setup(x => x.Get(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null);
TargetGrpcProxy response = client.Get(request.Project, request.TargetGrpcProxy);
xunit::Assert.Same(expectedResponse, response);
mockGrpcClient.VerifyAll();
}
[xunit::FactAttribute]
public async stt::Task GetAsync()
{
moq::Mock<TargetGrpcProxies.TargetGrpcProxiesClient> mockGrpcClient = new moq::Mock<TargetGrpcProxies.TargetGrpcProxiesClient>(moq::MockBehavior.Strict);
mockGrpcClient.Setup(x => x.CreateOperationsClientForGlobalOperations()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
GetTargetGrpcProxyRequest request = new GetTargetGrpcProxyRequest
{
TargetGrpcProxy = "target_grpc_proxy51252bbb",
Project = "projectaa6ff846",
};
TargetGrpcProxy expectedResponse = new TargetGrpcProxy
{
Id = 11672635353343658936UL,
Kind = "kindf7aa39d9",
Name = "name1c9368b0",
CreationTimestamp = "creation_timestamp235e59a1",
SelfLinkWithId = "self_link_with_id6d1e3896",
ValidateForProxyless = true,
Fingerprint = "fingerprint009e6052",
UrlMap = "url_map3ccdbf57",
Description = "description2cf9da67",
SelfLink = "self_link7e87f12d",
};
mockGrpcClient.Setup(x => x.GetAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<TargetGrpcProxy>(stt::Task.FromResult(expectedResponse), null, null, null, null));
TargetGrpcProxiesClient client = new TargetGrpcProxiesClientImpl(mockGrpcClient.Object, null);
TargetGrpcProxy responseCallSettings = await client.GetAsync(request.Project, request.TargetGrpcProxy, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));
xunit::Assert.Same(expectedResponse, responseCallSettings);
TargetGrpcProxy responseCancellationToken = await client.GetAsync(request.Project, request.TargetGrpcProxy, st::CancellationToken.None);
xunit::Assert.Same(expectedResponse, responseCancellationToken);
mockGrpcClient.VerifyAll();
}
}
}
|
jskeet/gcloud-dotnet
|
apis/Google.Cloud.Compute.V1/Google.Cloud.Compute.V1.Tests/TargetGrpcProxiesClientTest.g.cs
|
C#
|
apache-2.0
| 8,299
|
/*
* Copyright 2013 Thomas Bocek
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package net.tomp2p.peers;
import java.io.IOException;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.NavigableSet;
import java.util.Random;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.concurrent.atomic.AtomicInteger;
import net.tomp2p.Utils2;
import net.tomp2p.connection.PeerException;
import net.tomp2p.connection.PeerException.AbortCause;
import net.tomp2p.utils.Utils;
import org.junit.Assert;
import org.junit.Test;
public class TestPeerMap {
private static final Number160 ID = new Number160("0x1");
@Test
public void testDifference() throws UnknownHostException {
// setup
Collection<PeerAddress> newC = new ArrayList<PeerAddress>();
newC.add(Utils2.createAddress(12));
newC.add(Utils2.createAddress(15));
newC.add(Utils2.createAddress(88));
newC.add(Utils2.createAddress(90));
newC.add(Utils2.createAddress(91));
SortedSet<PeerAddress> result = new TreeSet<PeerAddress>(PeerMap.createComparator(new Number160(88)));
SortedSet<PeerAddress> already = new TreeSet<PeerAddress>(PeerMap.createComparator(new Number160(88)));
already.add(Utils2.createAddress(90));
already.add(Utils2.createAddress(15));
// do testing
Utils.difference(newC, result, already);
// verification
Assert.assertEquals(3, result.size());
Assert.assertEquals(Utils2.createAddress(88), result.first());
}
@Test
public void testAdd1() {
PeerMapConfiguration conf = new PeerMapConfiguration(ID);
conf.bagSizeVerified(4).bagSizeOverflow(4);
conf.offlineCount(1000).offlineTimeout(60);
conf.addPeerFilter(new DefaultPeerFilter()).maintenance(new DefaultMaintenance(0, new int[] {}));
PeerMap peerMap = new PeerMap(conf);
Number160 id1 = new Number160("0x2");
Number160 id2 = new Number160("0x3");
Number160 id3 = new Number160("0x4");
Number160 id4 = new Number160("0x5");
Number160 id5 = new Number160("0x6");
Number160 id6 = new Number160("0x7");
Number160 id11 = id1.xor(ID);
Number160 id22 = id2.xor(ID);
Number160 id33 = id3.xor(ID);
Assert.assertEquals(2, id11.bitLength());
Assert.assertEquals(2, id22.bitLength());
Assert.assertEquals(3, id33.bitLength());
Assert.assertEquals(0, PeerMap.classMember(Number160.ZERO, ID));
Assert.assertEquals(1, PeerMap.classMember(Number160.ZERO, id1));
Assert.assertEquals(159, PeerMap.classMember(Number160.ZERO, Number160.MAX_VALUE));
//
PeerAddress pa1 = new PeerAddress(id1);
PeerAddress pa2 = new PeerAddress(id2);
PeerAddress pa3 = new PeerAddress(id3);
PeerAddress pa4 = new PeerAddress(id4);
PeerAddress pa5 = new PeerAddress(id5);
PeerAddress pa6 = new PeerAddress(id6);
peerMap.peerFound(pa1, null, null);
peerMap.peerFound(pa2, null, null);
peerMap.peerFound(pa3, null, null);
peerMap.peerFound(pa4, null, null);
peerMap.peerFound(pa5, null, null);
peerMap.peerFound(pa6, null, null);
SortedSet<PeerAddress> pa = peerMap.closePeers(ID, 2);
Assert.assertEquals(2, pa.size());
Iterator<PeerAddress> iterator = pa.iterator();
Assert.assertEquals("0x3", iterator.next().peerId().toString());
Assert.assertEquals("0x2", iterator.next().peerId().toString());
pa = peerMap.closePeers(id3, 3);
Assert.assertEquals(4, pa.size());
iterator = pa.iterator();
Assert.assertEquals("0x4", iterator.next().peerId().toString());
Assert.assertEquals("0x5", iterator.next().peerId().toString());
Assert.assertEquals("0x6", iterator.next().peerId().toString());
Assert.assertEquals("0x7", iterator.next().peerId().toString());
}
@Test
public void testAdd2() {
PeerMapConfiguration conf = new PeerMapConfiguration(ID);
conf.bagSizeVerified(3).bagSizeOverflow(3);
conf.offlineCount(1000).offlineTimeout(60);
conf.addPeerFilter(new DefaultPeerFilter()).maintenance(new DefaultMaintenance(0, new int[] {}));
PeerMap peerMap = new PeerMap(conf);
Number160 id1 = new Number160("0x2");
Number160 id2 = new Number160("0x3");
Number160 id3 = new Number160("0x4");
Number160 id4 = new Number160("0x5");
Number160 id5 = new Number160("0x6");
Number160 id6 = new Number160("0x7");
//
PeerAddress pa1 = new PeerAddress(id1);
PeerAddress pa2 = new PeerAddress(id2);
PeerAddress pa3 = new PeerAddress(id3);
PeerAddress pa4 = new PeerAddress(id4);
PeerAddress pa5 = new PeerAddress(id5);
PeerAddress pa6 = new PeerAddress(id6);
peerMap.peerFound(pa1, null, null);
peerMap.peerFound(pa2, null, null);
peerMap.peerFound(pa3, null, null);
peerMap.peerFound(pa4, null, null);
peerMap.peerFound(pa5, null, null);
peerMap.peerFound(pa6, null, null);
SortedSet<PeerAddress> pa = peerMap.closePeers(ID, 2);
Assert.assertEquals(2, pa.size());
Iterator<PeerAddress> iterator = pa.iterator();
Assert.assertEquals("0x3", iterator.next().peerId().toString());
Assert.assertEquals("0x2", iterator.next().peerId().toString());
pa = peerMap.closePeers(id3, 3);
Assert.assertEquals(3, pa.size());
iterator = pa.iterator();
Assert.assertEquals("0x4", iterator.next().peerId().toString());
Assert.assertEquals("0x5", iterator.next().peerId().toString());
Assert.assertEquals("0x6", iterator.next().peerId().toString());
// 0x7 is in the non-verified / overflow map
List<PeerAddress> list = peerMap.allOverflow();
Assert.assertEquals("0x7", list.iterator().next().peerId().toString());
}
@Test
public void testLength() {
Number160 bi1 = new Number160("0x127");
Number160 bi2 = new Number160("0x128");
Number160 bi3 = new Number160("0x255");
Number160 rr = PeerMap.distance(bi1, bi2);
Assert.assertFalse(bi3.equals(rr));
bi1 = new Number160("0x7f");
bi2 = new Number160("0x80");
bi3 = new Number160("0xff");
rr = PeerMap.distance(bi1, bi2);
Assert.assertTrue(bi3.equals(rr));
Assert.assertEquals(7, PeerMap.classMember(bi1, bi2));
Assert.assertEquals(6, PeerMap.classMember(bi2, bi3));
}
@Test
public void testCloser() throws UnknownHostException {
PeerAddress rn1 = new PeerAddress(new Number160("0x7f"));
PeerAddress rn2 = new PeerAddress(new Number160("0x40"));
Number160 key = new Number160("0xff");
Assert.assertEquals(-1, PeerMap.isCloser(key, rn1, rn2));
//
rn1 = new PeerAddress(new Number160("0x10"));
rn2 = new PeerAddress(new Number160("0x11"));
key = new Number160("0xff");
System.err.println("0x7f xor 0xff " + rn1.peerId().xor(key));
System.err.println("0x40 xor 0xff " + rn2.peerId().xor(key));
Assert.assertEquals(1, PeerMap.isCloser(key, rn1, rn2));
}
@Test
public void testCloser2() throws UnknownHostException {
PeerAddress rn1 = new PeerAddress(new Number160(98));
PeerAddress rn2 = new PeerAddress(new Number160(66));
PeerAddress rn3 = new PeerAddress(new Number160(67));
PeerMapConfiguration conf = new PeerMapConfiguration(ID);
conf.bagSizeVerified(3).bagSizeOverflow(3);
conf.offlineCount(1000).offlineTimeout(60);
conf.addPeerFilter(new DefaultPeerFilter()).maintenance(new DefaultMaintenance(0, new int[] {}));
PeerMap peerMap = new PeerMap(conf);
SortedSet<PeerAddress> rc = peerMap.closePeers(new Number160(98), 3);
rc.add(rn2);
rc.add(rn1);
rc.add(rn3);
Assert.assertTrue(rc.first().equals(rn1));
}
@Test
public void testAddNode() throws UnknownHostException {
PeerMapConfiguration conf = new PeerMapConfiguration(ID);
conf.bagSizeVerified(4).bagSizeOverflow(4);
conf.offlineCount(1000).offlineTimeout(60);
conf.addPeerFilter(new DefaultPeerFilter()).maintenance(new DefaultMaintenance(0, new int[] {}));
PeerMap peerMap = new PeerMap(conf);
for (int i = 1; i < 12; i++) {
PeerAddress r1 = new PeerAddress(new Number160(i));
peerMap.peerFound(r1, null, null);
}
SortedSet<PeerAddress> close = peerMap.closePeers(new Number160(2), 2);
Assert.assertEquals(2, close.size());
close = peerMap.closePeers(new Number160(6), 4);
Assert.assertEquals(4, close.size());
}
@Test
public void testAddNode2() throws UnknownHostException {
PeerMapConfiguration conf = new PeerMapConfiguration(ID);
conf.bagSizeVerified(3).bagSizeOverflow(3);
conf.offlineCount(1000).offlineTimeout(60);
conf.addPeerFilter(new DefaultPeerFilter()).maintenance(new DefaultMaintenance(0, new int[] {}));
PeerMap peerMap = new PeerMap(conf);
for (int i = 1; i < 12; i++) {
PeerAddress r1 = new PeerAddress(new Number160((i % 6) + 1));
peerMap.peerFound(r1, null, null);
}
SortedSet<PeerAddress> close = peerMap.closePeers(new Number160(2), 2);
Assert.assertEquals(2, close.size());
close = peerMap.closePeers(new Number160(6), 1);
Assert.assertEquals(3, close.size());
}
@Test
public void testRemove() throws UnknownHostException, InterruptedException {
PeerMapConfiguration conf = new PeerMapConfiguration(ID);
conf.bagSizeVerified(3).bagSizeOverflow(3);
conf.offlineCount(1000).offlineTimeout(1);
conf.addPeerFilter(new DefaultPeerFilter()).maintenance(new DefaultMaintenance(0, new int[] {}));
PeerMap peerMap = new PeerMap(conf);
for (int i = 1; i <= 200; i++) {
PeerAddress r1 = new PeerAddress(new Number160(i + 1));
peerMap.peerFound(r1, null, null);
}
Assert.assertEquals(20, peerMap.size());
peerMap.peerFailed(new PeerAddress(new Number160(100)), new PeerException(AbortCause.PROBABLY_OFFLINE, "probably offline"));
Assert.assertTrue(peerMap.isPeerRemovedTemporarly(new PeerAddress(new Number160(100))));
Assert.assertEquals(20, peerMap.size());
peerMap.peerFailed(new PeerAddress(new Number160(2)), new PeerException(AbortCause.PROBABLY_OFFLINE, "probably offline"));
Assert.assertEquals(19, peerMap.size());
Assert.assertTrue(peerMap.isPeerRemovedTemporarly(new PeerAddress(new Number160(2))));
Thread.sleep(1000);
Assert.assertFalse(peerMap.isPeerRemovedTemporarly(new PeerAddress(new Number160(2))));
Assert.assertFalse(peerMap.isPeerRemovedTemporarly(new PeerAddress(new Number160(100))));
}
@Test
public void testRemoveConcurrent() throws UnknownHostException, InterruptedException {
PeerMapConfiguration conf = new PeerMapConfiguration(ID);
conf.bagSizeVerified(3).bagSizeOverflow(3);
conf.offlineCount(1000).offlineTimeout(1);
conf.addPeerFilter(new DefaultPeerFilter()).maintenance(new DefaultMaintenance(0, new int[] {}));
final PeerMap peerMap = new PeerMap(conf);
for (int i = 1; i <= 200; i++) {
PeerAddress r1 = new PeerAddress(new Number160(i + 1));
peerMap.peerFound(r1, null, null);
}
Assert.assertEquals(20, peerMap.size());
Thread t1 = new Thread(new Runnable() {
@Override
public void run() {
for (int i = 1; i <= 50; i++) {
peerMap.peerFailed(new PeerAddress(new Number160(i + 1)), new PeerException(AbortCause.SHUTDOWN, "shutdown"));
}
}
});
t1.start();
Thread t2 = new Thread(new Runnable() {
@Override
public void run() {
for (int i = 1; i <= 100; i++) {
peerMap.peerFailed(new PeerAddress(new Number160(i + 1)), new PeerException(AbortCause.SHUTDOWN, "shutdown"));
}
}
});
t2.start();
t1.join();
t2.join();
Assert.assertTrue(peerMap.isPeerRemovedTemporarly(new PeerAddress(new Number160(100))));
Assert.assertEquals(3, peerMap.size());
}
@Test
public void testAddConcurrent() throws UnknownHostException, InterruptedException {
PeerMapConfiguration conf = new PeerMapConfiguration(ID);
conf.bagSizeVerified(3).bagSizeOverflow(3);
conf.offlineCount(1000).offlineTimeout(1);
conf.addPeerFilter(new DefaultPeerFilter()).maintenance(new DefaultMaintenance(0, new int[] {}));
final PeerMap peerMap = new PeerMap(conf);
Thread t1 = new Thread(new Runnable() {
@Override
public void run() {
for (int i = 1; i <= 50; i++) {
peerMap.peerFound(new PeerAddress(new Number160(i + 1)), null, null);
}
}
});
t1.start();
Thread t2 = new Thread(new Runnable() {
@Override
public void run() {
for (int i = 1; i <= 100; i++) {
peerMap.peerFound(new PeerAddress(new Number160(i + 1)), null, null);
}
}
});
t2.start();
t1.join();
t2.join();
Assert.assertEquals(17, peerMap.size());
}
/**
* Repeating test of testRandomAddRemove() to test for concurrency issues.
*
* @throws InterruptedException .
*/
@Test
public void testMultiRandomAddRemove() throws InterruptedException {
final int rounds = 100;
for (int i = 0; i < rounds; i++) {
testRandomAddRemove();
}
}
/**
* Tests the peermap and concurrent adds and puts. There will be two times 5000 inserts and 4989 removes. That means
* the resulting peer count needs to be 11.
*
* @throws InterruptedException .
*/
@Test
public void testRandomAddRemove() throws InterruptedException {
for (int j = 0; j < 50; j++) {
PeerMapConfiguration conf = new PeerMapConfiguration(ID);
conf.bagSizeVerified(j + 1).bagSizeOverflow(j + 1);
conf.offlineCount(1000).offlineTimeout(1);
conf.addPeerFilter(new DefaultPeerFilter()).maintenance(new DefaultMaintenance(0, new int[] {}));
final PeerMap peerMap = new PeerMap(conf);
final AtomicInteger add = new AtomicInteger();
final AtomicInteger del = new AtomicInteger();
final int rounds = 500;
final int diff = 10;
Runnable runnable = new Runnable() {
@Override
public void run() {
for (int i = 1; i <= rounds + diff; i++) {
if (i + diff < rounds) {
boolean retVal = peerMap.peerFound(new PeerAddress(new Number160(i + 1)), null, null);
if (retVal) {
add.incrementAndGet();
}
}
if (i - diff > 1) {
boolean retVal = peerMap.peerFailed(new PeerAddress(new Number160(i - diff)), new PeerException(AbortCause.SHUTDOWN, "shutdown"));
if (retVal) {
del.incrementAndGet();
}
}
}
}
};
Thread t1 = new Thread(runnable);
Thread t2 = new Thread(runnable);
t1.start();
t2.start();
t1.join();
t2.join();
System.err.println("inserted: " + add.get() + ", removed: " + del.get());
Assert.assertEquals(0, peerMap.size());
}
}
@Test
public void testPerformance() throws IOException {
PeerMapConfiguration conf = new PeerMapConfiguration(ID);
conf.bagSizeVerified(3).bagSizeOverflow(3);
conf.offlineCount(1000).offlineTimeout(100);
conf.addPeerFilter(new DefaultPeerFilter()).maintenance(new DefaultMaintenance(0, new int[] {}));
final PeerMap peerMap = new PeerMap(conf);
final Random random = new Random(42L);
final List<PeerAddress> listAdded = new ArrayList<PeerAddress>();
final List<PeerAddress> listRemoved = new ArrayList<PeerAddress>();
long start = System.currentTimeMillis();
int size = 500000;
for (int i = 1; i <= size; i++) {
PeerAddress r1 = new PeerAddress(new Number160(random));
listAdded.add(r1);
}
for (PeerAddress r1 : listAdded) {
peerMap.peerFound(r1, null, null);
}
for (PeerAddress r1 : listAdded) {
peerMap.peerFound(r1, null, null);
}
for (int i = 0; i < 100; i++) {
PeerAddress removed = listAdded.get(random.nextInt(i + 1));
if (peerMap.peerFailed(removed, new PeerException(AbortCause.SHUTDOWN, "shutdown"))) {
listRemoved.add(removed);
}
}
for (PeerAddress r1 : listAdded) {
peerMap.peerFound(r1, r1, null);
}
Assert.assertEquals(47, peerMap.size());
for (PeerAddress r1 : listRemoved) {
Assert.assertTrue(peerMap.isPeerRemovedTemporarly(r1));
}
//
for (PeerAddress r1 : listRemoved) {
listAdded.remove(r1);
}
for (int i = 0; i < 300; i++) {
PeerAddress removed = listAdded.get(random.nextInt(i + 1));
peerMap.peerFailed(removed, new PeerException(AbortCause.SHUTDOWN, "shutdown"));
}
for (PeerAddress r1 : listRemoved) {
Assert.assertTrue(peerMap.isPeerRemovedTemporarly(r1));
}
System.err.println("Time used: " + (System.currentTimeMillis() - start)
+ " ms. (time to beat ~5100ms, now ~1800ms)");
}
@Test
public void testOrder() {
Number160 b1 = new Number160("0x5");
Number160 b2 = new Number160("0x32");
Number160 b3 = new Number160("0x1F4");
Number160 b4 = new Number160("0x1388");
PeerAddress n1 = new PeerAddress(b1);
PeerAddress n2 = new PeerAddress(b2);
PeerAddress n3 = new PeerAddress(b3);
PeerAddress n4 = new PeerAddress(b4);
final NavigableSet<PeerAddress> queue = new TreeSet<PeerAddress>(PeerMap.createComparator(b3));
queue.add(n1);
queue.add(n2);
queue.add(n3);
queue.add(n4);
Assert.assertEquals(queue.pollFirst(), n3);
Assert.assertEquals(queue.pollFirst(), n2);
Assert.assertEquals(queue.pollLast(), n4);
}
@Test
public void testMaintenance() throws UnknownHostException, InterruptedException {
PeerMapConfiguration conf = new PeerMapConfiguration(ID);
conf.bagSizeVerified(10).bagSizeOverflow(10);
conf.offlineCount(1000).offlineTimeout(100);
conf.addPeerFilter(new DefaultPeerFilter()).maintenance(new DefaultMaintenance(0, new int[] {}));
conf.maintenance(new DefaultMaintenance(4, new int[] { 1, 1 }));
final PeerMap peerMap = new PeerMap(conf);
PeerAddress pa1 = Utils2.createAddress(Number160.createHash("peer 1"));
PeerAddress pa2 = Utils2.createAddress(Number160.createHash("peer 2"));
peerMap.peerFound(pa2, pa1, null);
List<PeerAddress> notInterested = new ArrayList<PeerAddress>();
PeerStatistic peerStatatistic = peerMap.nextForMaintenance(notInterested);
notInterested.add(peerStatatistic.peerAddress());
Assert.assertEquals(peerStatatistic.peerAddress(), pa2);
peerStatatistic = peerMap.nextForMaintenance(notInterested);
Assert.assertEquals(true, peerStatatistic == null);
PeerAddress pa3 = Utils2.createAddress(Number160.createHash("peer 3"));
peerMap.peerFound(pa3, null, null);
peerStatatistic = peerMap.nextForMaintenance(notInterested);
Assert.assertEquals(true, peerStatatistic == null);
Thread.sleep(1000);
peerStatatistic = peerMap.nextForMaintenance(notInterested);
Assert.assertEquals(peerStatatistic.peerAddress(), pa3);
}
@Test
public void testClose() throws UnknownHostException {
for (int i = 1; i < 30; i++) {
testClose(i);
}
}
private void testClose(int round) throws UnknownHostException {
Random rnd = new Random(round);
for (int j = 0; j < 1000; j++) {
Number160 key = new Number160(rnd);
PeerMapConfiguration conf = new PeerMapConfiguration(ID);
conf.bagSizeVerified(10).bagSizeOverflow(10);
conf.offlineCount(1000).offlineTimeout(100);
conf.addPeerFilter(new DefaultPeerFilter()).maintenance(new DefaultMaintenance(0, new int[] {}));
final PeerMap peerMap = new PeerMap(conf);
List<PeerAddress> peers = new ArrayList<PeerAddress>();
for (int i = 0; i < round; i++) {
PeerAddress r1 = new PeerAddress(new Number160(rnd));
peers.add(r1);
peerMap.peerFound(r1, null, null);
}
TreeSet<PeerAddress> set = new TreeSet<PeerAddress>(PeerMap.createComparator(key));
set.addAll(peers);
PeerAddress closest1 = set.iterator().next();
PeerAddress closest2 = peerMap.closePeers(key, 1).iterator().next();
if (peerMap.allOverflow().size() == 0) {
Assert.assertEquals(closest1, closest2);
}
}
}
}
|
Biocodr/TomP2P
|
core/src/test/java/net/tomp2p/peers/TestPeerMap.java
|
Java
|
apache-2.0
| 22,734
|
<?php
/**
* Faq Categories (faq-category)
* @var $this app\components\View
* @var $this ommu\faq\controllers\CategoryController
* @var $model ommu\faq\models\FaqCategory
*
* @author Eko Hariyanto <haryeko29@gmail.com>
* @contact (+62)857-4381-4273
* @copyright Copyright (c) 2018 Ommu Platform (www.ommu.co)
* @created date 5 January 2018, 10:08 WIB
* @modified date 27 April 2018, 12:54 WIB
* @modified by Putra Sudaryanto <putra@ommu.co>
* @contact (+62)856-299-4114
* @link https://github.com/ommu/mod-faqs
*
*/
use yii\helpers\Html;
use yii\helpers\Url;
use app\components\grid\GridView;
use yii\widgets\Pjax;
$this->params['breadcrumbs'][] = $this->title;
$this->params['menu']['content'] = [
['label' => Yii::t('app', 'Back To Setting'), 'url' => Url::to(['setting/index']), 'icon' => 'gears'],
['label' => Yii::t('app', 'Add Category'), 'url' => Url::to(['create']), 'icon' => 'plus-square', 'htmlOptions' => ['class'=>'btn btn-success']],
];
$this->params['menu']['option'] = [
//['label' => Yii::t('app', 'Search'), 'url' => 'javascript:void(0);'],
['label' => Yii::t('app', 'Grid Option'), 'url' => 'javascript:void(0);'],
];
?>
<?php Pjax::begin(); ?>
<?php //echo $this->render('_search', ['model'=>$searchModel]); ?>
<?php echo $this->render('_option_form', ['model'=>$searchModel, 'gridColumns'=>$searchModel->activeDefaultColumns($columns), 'route'=>$this->context->route]); ?>
<?php
$columnData = $columns;
array_push($columnData, [
'class' => 'app\components\grid\ActionColumn',
'header' => Yii::t('app', 'Option'),
'urlCreator' => function($action, $model, $key, $index) {
if($action == 'view')
return Url::to(['view', 'id'=>$key]);
if($action == 'update')
return Url::to(['update', 'id'=>$key]);
if($action == 'delete')
return Url::to(['delete', 'id'=>$key]);
},
'buttons' => [
'view' => function ($url, $model, $key) {
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, ['title'=>Yii::t('app', 'Detail')]);
},
'update' => function ($url, $model, $key) {
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, ['title'=>Yii::t('app', 'Update')]);
},
'delete' => function ($url, $model, $key) {
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, [
'title' => Yii::t('app', 'Delete'),
'data-confirm' => Yii::t('app', 'Are you sure you want to delete this item?'),
'data-method' => 'post',
]);
},
],
'template' => '{view} {update} {delete}',
]);
echo GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => $columnData,
]); ?>
<?php Pjax::end(); ?>
|
oMMu/Ommu-FAQ
|
views/category/admin_index.php
|
PHP
|
apache-2.0
| 2,657
|
(function() {
angular
.module("zenigmesApp")
.controller("resetCtrl", resetCtrl);
resetCtrl.$inject = ["$location", "$uibModal","$routeParams", "authentication"];
function resetCtrl($location, $uibModal, $routeParams, authentication) {
var vm = this;
vm.pageHeader = {
title: "Réinitialisation du mot de passe"
};
var resetToken = $routeParams.resetToken;
vm.onSubmit = function() {
vm.formError = "";
if (!vm.newPassword || !vm.passwordCheck) {
vm.formError = "Tous les champs sont requis, veuillez réessayer";
return false;
} else if (vm.newPassword !== vm.passwordCheck){
vm.formError = "Les deux mots de passe ne correspondent pas";
return false;
} else {
_resetPassword();
}
};
var _resetPassword = function() {
vm.formError = "";
authentication
.resetPassword(resetToken, vm.newPassword)
.then(function() {
var modalInstance = $uibModal.open({
templateUrl: "app/auth/reset/resetModal.template.html",
controller: "answerModalCtrl as vm"
});
modalInstance.result.then(function(data) {
$location.path("/");
});
}, function(err) {
vm.formError = err.data.message;
});
};
}
})();
|
fdagosti/zenigmes
|
app_client/src/app/auth/reset/reset.controller.js
|
JavaScript
|
apache-2.0
| 1,554
|
'use strict';
// Benchmark comparing performance of event emit for single listener
// To run it, do following in memoizee package path:
//
// $ npm install eventemitter2 signals
// $ node benchmark/single-on.js
var forEach = require('es5-ext/lib/Object/for-each')
, pad = require('es5-ext/lib/String/prototype/pad')
, now = Date.now
, time, count = 1000000, i, data = {}
, ee, native, ee2, signals, a = {}, b = {};
ee = (function () {
var ee = require('../lib/core');
return ee().on('test', function () {
return arguments;
});
}());
native = (function () {
var ee = require('events');
return (new ee.EventEmitter()).on('test', function () {
return arguments;
});
}());
ee2 = (function () {
var ee = require('eventemitter2');
return (new ee.EventEmitter2()).on('test', function () {
return arguments;
});
}());
signals = (function () {
var Signal = require('signals')
, ee = {test: new Signal()};
ee.test.add(function () {
return arguments;
});
return ee;
}());
console.log("Emit for single listener", "x" + count + ":\n");
i = count;
time = now();
while (i--) {
ee.emit('test', a, b);
}
data["event-emitter (this implementation)"] = now() - time;
i = count;
time = now();
while (i--) {
native.emit('test', a, b);
}
data["EventEmitter (Node.js native)"] = now() - time;
i = count;
time = now();
while (i--) {
ee2.emit('test', a, b);
}
data.EventEmitter2 = now() - time;
i = count;
time = now();
while (i--) {
signals.test.dispatch(a, b);
}
data.Signals = now() - time;
forEach(data, function (value, name, obj, index) {
console.log(index + 1 + ":", pad.call(value, " ", 5), name);
}, null, function (a, b) {
return this[a] - this[b];
});
|
DeinDesign/css
|
node_modules/bower/node_modules/inquirer/node_modules/cli-color/node_modules/memoizee/node_modules/event-emitter/benchmark/single-on.js
|
JavaScript
|
apache-2.0
| 1,717
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="de">
<head>
<!-- Generated by javadoc (version 1.7.0_03) on Sun Jun 17 23:52:18 CEST 2012 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>ch.bfh.ti.sed.patmon1.server.domain.impl (bfh - sed - patmon1 - server 1.0.0-SNAPSHOT API)</title>
<meta name="date" content="2012-06-17">
<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="ch.bfh.ti.sed.patmon1.server.domain.impl (bfh - sed - patmon1 - server 1.0.0-SNAPSHOT API)";
}
//-->
</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 class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../../ch/bfh/ti/sed/patmon1/server/domain/exception/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../../../../ch/bfh/ti/sed/patmon1/server/gtk/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?ch/bfh/ti/sed/patmon1/server/domain/impl/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.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>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package ch.bfh.ti.sed.patmon1.server.domain.impl</h1>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../../ch/bfh/ti/sed/patmon1/server/domain/impl/AbstractContextAwarableBusinessHandler.html" title="class in ch.bfh.ti.sed.patmon1.server.domain.impl">AbstractContextAwarableBusinessHandler</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../../ch/bfh/ti/sed/patmon1/server/domain/impl/BusinessHandlerFactoryImpl.html" title="class in ch.bfh.ti.sed.patmon1.server.domain.impl">BusinessHandlerFactoryImpl</a></td>
<td class="colLast"> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../../ch/bfh/ti/sed/patmon1/server/domain/impl/DeviceReturnalBusinessHandlerImpl.html" title="class in ch.bfh.ti.sed.patmon1.server.domain.impl">DeviceReturnalBusinessHandlerImpl</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../../ch/bfh/ti/sed/patmon1/server/domain/impl/MeasurementObservationPeriodBusinessHandler.html" title="class in ch.bfh.ti.sed.patmon1.server.domain.impl">MeasurementObservationPeriodBusinessHandler</a></td>
<td class="colLast"> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../../../ch/bfh/ti/sed/patmon1/server/domain/impl/MeasurementPatientBusinessHandler.html" title="class in ch.bfh.ti.sed.patmon1.server.domain.impl">MeasurementPatientBusinessHandler</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../../../ch/bfh/ti/sed/patmon1/server/domain/impl/ObservationBusinessHandlerImpl.html" title="class in ch.bfh.ti.sed.patmon1.server.domain.impl">ObservationBusinessHandlerImpl</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= 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 class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../../../ch/bfh/ti/sed/patmon1/server/domain/exception/package-summary.html">Prev Package</a></li>
<li><a href="../../../../../../../../ch/bfh/ti/sed/patmon1/server/gtk/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?ch/bfh/ti/sed/patmon1/server/domain/impl/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.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>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2012. All Rights Reserved.</small></p>
</body>
</html>
|
hip4/patmon1
|
reports/apidocs/ch/bfh/ti/sed/patmon1/server/domain/impl/package-summary.html
|
HTML
|
apache-2.0
| 6,784
|
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ARG BASE_IMAGE=gcr.io/cloud-solutions-images/webrtc-gpu-streaming-app-streaming:latest
FROM debian:jessie
WORKDIR /tmp
COPY Unigine_Heaven-4.0.run .
RUN sh Unigine_Heaven-4.0.run
FROM ${BASE_IMAGE}
WORKDIR /opt/app
COPY --from=0 /tmp/Unigine_Heaven-4.0/ /opt/app/
WORKDIR /opt/app
ENV ENABLE_WM=false
ENV EXEC_CMD /opt/app/heaven
ENV RESOLUTION 1920x1080
|
GoogleCloudPlatform/selkies-examples
|
unigine-heaven/images/unigine-heaven/Dockerfile
|
Dockerfile
|
apache-2.0
| 938
|
////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2016 ArangoDB GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is ArangoDB GmbH, Cologne, Germany
///
/// @author Jan Steemann
////////////////////////////////////////////////////////////////////////////////
#ifndef ARANGODB_APPLICATION_FEATURES_APPLICATION_SERVER_H
#define ARANGODB_APPLICATION_FEATURES_APPLICATION_SERVER_H 1
#include <atomic>
#include <functional>
#include <memory>
#include <string>
#include <type_traits>
#include <typeindex>
#include <unordered_map>
#include <vector>
#include "Basics/Common.h"
#include "Basics/ConditionVariable.h"
#include <velocypack/Builder.h>
namespace arangodb {
namespace options {
class ProgramOptions;
}
namespace application_features {
class ApplicationFeature;
// the following phases exists:
//
// `collectOptions`
//
// Creates the prgramm options for a feature. Features are not
// allowed to open files or sockets, create threads or allocate
// other resources. This method will be called regardless of whether
// to feature is enabled or disabled. There is no defined order in
// which the features are traversed.
//
// `loadOptions`
//
// Allows a feature to load more options from somewhere. This method
// will only be called for enabled features. There is no defined
// order in which the features are traversed.
//
// `validateOptions`
//
// Validates the feature's options. This method will only be called for enabled
// features. Help is handled before any `validateOptions` of a feature is
// called. The `validateOptions` methods are called in a order that obeys the
// `startsAfter `conditions.
//
// `daemonize`
//
// In this phase process control (like putting the process into the background
// will be handled). This method will only be called for enabled features.
// The `daemonize` methods are called in a order that obeys the `startsAfter`
// conditions.
//
// `prepare`
//
// Now the features will actually do some preparation work
// in the preparation phase, the features must not start any threads
// furthermore, they must not write any files under elevated privileges
// if they want other features to access them, or if they want to access
// these files with dropped privileges. The `prepare` methods are called in a
// order that obeys the `startsAfter` conditions.
//
// `start`
//
// Start the features. Features are now allowed to created threads.
//
// The `start` methods are called in a order that obeys the `startsAfter`
// conditions.
//
// `stop`
//
// Stops the features. The `stop` methods are called in reversed `start` order.
// This must stop all threads, but not destroy the features.
//
// `unprepare`
//
// This destroys the features.
class ApplicationServer {
using FeatureMap =
std::unordered_map<std::type_index, std::unique_ptr<ApplicationFeature>>;
ApplicationServer(ApplicationServer const&) = delete;
ApplicationServer& operator=(ApplicationServer const&) = delete;
public:
// handled i.e. in WindowsServiceFeature.cpp
enum class State : int {
UNINITIALIZED,
IN_COLLECT_OPTIONS,
IN_VALIDATE_OPTIONS,
IN_PREPARE,
IN_START,
IN_WAIT,
IN_SHUTDOWN,
IN_STOP,
IN_UNPREPARE,
STOPPED,
ABORTED
};
class ProgressHandler {
public:
std::function<void(State)> _state;
std::function<void(State, std::string const& featureName)> _feature;
};
static ApplicationServer& server();
static std::atomic<bool> CTRL_C;
public:
ApplicationServer(std::shared_ptr<options::ProgramOptions>, char const* binaryPath);
TEST_VIRTUAL ~ApplicationServer();
std::string helpSection() const { return _helpSection; }
bool helpShown() const { return !_helpSection.empty(); }
/// @brief stringify the internal state
char const* stringifyState() const;
// return whether or not a feature is enabled
// will throw when called for a non-existing feature
template <typename T>
bool isEnabled() const {
return getFeature<T>().isEnabled();
}
// return whether or not a feature is optional
// will throw when called for a non-existing feature
template <typename T>
bool isOptional() const {
return getFeature<T>().isOptional();
}
// return whether or not a feature is required
// will throw when called for a non-existing feature
template <typename T>
bool isRequired() const {
return getFeature<T>().isRequired();
}
/// @brief whether or not the server has made it as least as far as the IN_START state
bool isPrepared();
/// @brief whether or not the server has made it as least as far as the IN_SHUTDOWN state
bool isStopping();
/// @brief whether or not state is the shutting down state or further (i.e. stopped, aborted etc.)
bool isStoppingState(State state);
// this method will initialize and validate options
// of all feature, start them and wait for a shutdown
// signal. after that, it will shutdown all features
void run(int argc, char* argv[]);
// signal the server to shut down
void beginShutdown();
// report that we are going down by fatal error
void shutdownFatalError();
// return VPack options, with optional filters applied to filter
// out specific options. the filter function is expected to return true
// for any options that should become part of the result
velocypack::Builder options(std::function<bool(std::string const&)> const& filter) const;
// return the program options object
std::shared_ptr<options::ProgramOptions> options() const { return _options; }
// return the server state
TEST_VIRTUAL State state() const { return _state; }
void addReporter(ProgressHandler reporter) {
_progressReports.emplace_back(reporter);
}
char const* getBinaryPath() const { return _binaryPath; }
void registerStartupCallback(std::function<void()> const& callback) {
_startupCallbacks.emplace_back(callback);
}
void registerFailCallback(std::function<void(std::string const&)> const& callback) {
fail = callback;
}
// setup and validate all feature dependencies, determine feature order
void setupDependencies(bool failOnMissing);
std::vector<std::reference_wrapper<ApplicationFeature>> const& getOrderedFeatures() {
return _orderedFeatures;
}
#ifdef TEST_VIRTUAL
void setStateUnsafe(State ss) { server()._state = ss; }
#endif
// adds a feature to the application server. the application server
// will take ownership of the feature object and destroy it in its
// destructor
template <typename Type, typename As = Type, typename... Args,
typename std::enable_if<std::is_base_of<ApplicationFeature, Type>::value, int>::type = 0,
typename std::enable_if<std::is_base_of<ApplicationFeature, As>::value, int>::type = 0,
typename std::enable_if<std::is_base_of<As, Type>::value, int>::type = 0>
As& addFeature(Args&&... args) {
TRI_ASSERT(!hasFeature<As>());
std::pair<FeatureMap::iterator, bool> result =
_features.emplace(std::type_index(typeid(As)),
std::make_unique<Type>(*this, std::forward<Args>(args)...));
TRI_ASSERT(result.second);
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
auto obj = dynamic_cast<As*>(result.first->second.get());
TRI_ASSERT(obj != nullptr);
return *obj;
#else
return *static_cast<As*>(result.first->second.get());
#endif
}
// checks for the existence of a feature by type. will not throw when used
// for a non-existing feature
bool hasFeature(std::type_index type) const {
return (_features.find(type) != _features.end());
}
// checks for the existence of a feature. will not throw when used for
// a non-existing feature
template <typename Type, typename std::enable_if<std::is_base_of<ApplicationFeature, Type>::value, int>::type = 0>
bool hasFeature() const {
return hasFeature(std::type_index(typeid(Type)));
}
// returns a reference to a feature given the type. will throw when used for
// a non-existing feature
template <typename AsType, typename std::enable_if<std::is_base_of<ApplicationFeature, AsType>::value, int>::type = 0>
AsType& getFeature(std::type_index type) const {
auto it = _features.find(type);
if (it == _features.end()) {
throwFeatureNotFoundException(type.name());
}
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
auto obj = dynamic_cast<AsType*>(it->second.get());
TRI_ASSERT(obj != nullptr);
return *obj;
#else
return *static_cast<AsType*>(it->second.get());
#endif
}
// returns a const reference to a feature. will throw when used for
// a non-existing feature
template <typename Type, typename AsType = Type,
typename std::enable_if<std::is_base_of<ApplicationFeature, Type>::value, int>::type = 0,
typename std::enable_if<std::is_base_of<Type, AsType>::value || std::is_base_of<AsType, Type>::value, int>::type = 0>
AsType& getFeature() const {
auto it = _features.find(std::type_index(typeid(Type)));
if (it == _features.end()) {
throwFeatureNotFoundException(typeid(Type).name());
}
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
auto obj = dynamic_cast<AsType*>(it->second.get());
TRI_ASSERT(obj != nullptr);
return *obj;
#else
return *static_cast<AsType*>(it->second.get());
#endif
}
// returns the feature with the given name if known and enabled
// throws otherwise
template <typename Type, typename AsType = Type,
typename std::enable_if<std::is_base_of<ApplicationFeature, Type>::value, int>::type = 0,
typename std::enable_if<std::is_base_of<Type, AsType>::value || std::is_base_of<AsType, Type>::value, int>::type = 0>
AsType& getEnabledFeature() const {
AsType& feature = getFeature<Type, AsType>();
if (!feature.isEnabled()) {
throwFeatureNotEnabledException(typeid(Type).name());
}
return feature;
}
void disableFeatures(std::vector<std::type_index> const&);
void forceDisableFeatures(std::vector<std::type_index> const&);
private:
// throws an exception that a requested feature was not found
[[noreturn]] static void throwFeatureNotFoundException(char const*);
// throws an exception that a requested feature is not enabled
[[noreturn]] static void throwFeatureNotEnabledException(char const*);
void disableFeatures(std::vector<std::type_index> const& types, bool force);
// walks over all features and runs a callback function for them
void apply(std::function<void(ApplicationFeature&)>, bool enabledOnly);
// collects the program options from all features,
// without validating them
void collectOptions();
// parse options
void parseOptions(int argc, char* argv[]);
// allows features to cross-validate their program options
void validateOptions();
// allows process control
void daemonize();
// disables all features that depend on other features, which, themselves
// are disabled
void disableDependentFeatures();
// allows features to prepare themselves
void prepare();
// starts features
void start();
// stops features
void stop();
// destroys features
void unprepare();
// after start, the server will wait in this method until
// beginShutdown is called
void wait();
void raisePrivilegesTemporarily();
void dropPrivilegesTemporarily();
void dropPrivilegesPermanently();
void reportServerProgress(State);
void reportFeatureProgress(State, std::string const&);
private:
static ApplicationServer* INSTANCE;
// the current state
std::atomic<State> _state;
// the shared program options
std::shared_ptr<options::ProgramOptions> _options;
// map of feature names to features
FeatureMap _features;
// features order for prepare/start
std::vector<std::reference_wrapper<ApplicationFeature>> _orderedFeatures;
// will be signaled when the application server is asked to shut down
basics::ConditionVariable _shutdownCondition;
/// @brief the condition variable protects access to this flag
/// the flag is set to true when beginShutdown finishes
bool _abortWaiting = false;
// whether or not privileges have been dropped permanently
bool _privilegesDropped = false;
// whether or not to dump dependencies
bool _dumpDependencies = false;
// whether or not to dump configuration options
bool _dumpOptions = false;
// reporter for progress
std::vector<ProgressHandler> _progressReports;
// callbacks that are called after start
std::vector<std::function<void()>> _startupCallbacks;
// help section displayed
std::string _helpSection;
// the install directory of this program:
char const* _binaryPath;
// fail callback
std::function<void(std::string const&)> fail;
};
} // namespace application_features
} // namespace arangodb
#endif
|
fceller/arangodb
|
lib/ApplicationFeatures/ApplicationServer.h
|
C
|
apache-2.0
| 13,586
|
<?php
// Copyright 2017 DAIMTO ([Linda Lawton](https://twitter.com/LindaLawtonDK)) : [www.daimto.com](http://www.daimto.com/)
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by DAIMTO-Google-apis-Sample-generator 1.0.0
// Template File Name: ServiceAccount.tt
// Build date: 2017-10-08
// PHP generator version: 1.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
// About
//
// Unofficial sample for the webmasters v3 API for PHP.
// This sample is designed to be used with the Google PHP client library. (https://github.com/google/google-api-php-client)
//
// API Description: View Google Search Console data for your verified sites.
// API Documentation Link https://developers.google.com/webmaster-tools/
//
// Discovery Doc https://www.googleapis.com/discovery/v1/apis/webmasters/v3/rest
//
//------------------------------------------------------------------------------
// Installation
//
// The preferred method is via https://getcomposer.org. Follow the installation instructions https://getcomposer.org/doc/00-intro.md
// if you do not already have composer installed.
//
// Once composer is installed, execute the following command in your project root to install this library:
//
// composer require google/apiclient:^2.0
//
//------------------------------------------------------------------------------
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/Oauth2Authentication.php';
// Start a session to persist credentials.
session_start();
// Handle authorization flow from the server.
if (! isset($_GET['code'])) {
$client = buildClient();
$auth_url = $client->createAuthUrl();
header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL));
} else {
$client = buildClient();
$client->authenticate($_GET['code']); // Exchange the authencation code for a refresh token and access token.
// Add access token and refresh token to seession.
$_SESSION['access_token'] = $client->getAccessToken();
$_SESSION['refresh_token'] = $client->getRefreshToken();
//Redirect back to main script
$redirect_uri = str_replace("oauth2callback.php",$_SESSION['mainScript'],$client->getRedirectUri());
header('Location: ' . filter_var($redirect_uri, FILTER_SANITIZE_URL));
}
?>
|
LindaLawton/Google-APIs-PHP-Samples
|
Samples/Search Console API/v3/oauth2callback.php
|
PHP
|
apache-2.0
| 3,042
|
<?php
// Copyright 2017 DAIMTO ([Linda Lawton](https://twitter.com/LindaLawtonDK)) : [www.daimto.com](http://www.daimto.com/)
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
// the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by DAIMTO-Google-apis-Sample-generator 1.0.0
// Template File Name: methodTemplate.tt
// Build date: 2017-10-08
// PHP generator version: 1.0.0
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
// About
//
// Unofficial sample for the dfareporting v2.8 API for PHP.
// This sample is designed to be used with the Google PHP client library. (https://github.com/google/google-api-php-client)
//
// API Description: Manages your DoubleClick Campaign Manager ad campaigns and reports.
// API Documentation Link https://developers.google.com/doubleclick-advertisers/
//
// Discovery Doc https://www.googleapis.com/discovery/v1/apis/dfareporting/v2_8/rest
//
//------------------------------------------------------------------------------
// Installation
//
// The preferred method is via https://getcomposer.org. Follow the installation instructions https://getcomposer.org/doc/00-intro.md
// if you do not already have composer installed.
//
// Once composer is installed, execute the following command in your project root to install this library:
//
// composer require google/apiclient:^2.0
//
//------------------------------------------------------------------------------
// Load the Google API PHP Client Library.
require_once __DIR__ . '/vendor/autoload.php';
session_start();
/***************************************************
* Include this line for service account authencation. Note: Not all APIs support service accounts.
//require_once __DIR__ . '/ServiceAccount.php';
* Include the following four lines Oauth2 authencation.
* require_once __DIR__ . '/Oauth2Authentication.php';
* $_SESSION['mainScript'] = basename($_SERVER['PHP_SELF']); // Oauth2callback.php will return here.
* $client = getGoogleClient();
* $service = new Google_Service_Dfareporting($client);
****************************************************/
// Option paramaters can be set as needed.
$optParams = array(
//'advertiserGroupIds' => '[YourValue]', // Select only campaigns whose advertisers belong to these advertiser groups.
//'advertiserIds' => '[YourValue]', // Select only campaigns that belong to these advertisers.
//'archived' => '[YourValue]', // Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.
//'atLeastOneOptimizationActivity' => '[YourValue]', // Select only campaigns that have at least one optimization activity.
//'excludedIds' => '[YourValue]', // Exclude campaigns with these IDs.
//'ids' => '[YourValue]', // Select only campaigns with these IDs.
//'maxResults' => '[YourValue]', // Maximum number of results to return.
//'overriddenEventTagId' => '[YourValue]', // Select only campaigns that have overridden this event tag ID.
//'pageToken' => '[YourValue]', // Value of the nextPageToken from the previous result page.
//'searchString' => '[YourValue]', // Allows searching for campaigns by name or ID. Wildcards (*) are allowed. For example, "campaign*2015" will return campaigns with names like "campaign June 2015", "campaign April 2015", or simply "campaign 2015". Most of the searches also add wildcards implicitly at the start and the end of the search string. For example, a search string of "campaign" will match campaigns with name "my campaign", "campaign 2015", or simply "campaign".
//'sortField' => '[YourValue]', // Field by which to sort the list.
//'sortOrder' => '[YourValue]', // Order of sorted results.
//'subaccountId' => '[YourValue]', // Select only campaigns that belong to this subaccount.
'fields' => '*'
);
// Single Request.
$results = campaignsListExample($service, $profileId, $optParams);
// Paginiation Example
do {
if (!$results->getNextPageToken())
break;
$optParams['pageToken'] = $results->getNextPageToken();
$results = filesListExample($service, $profileId, $optParams);
} while($results->getNextPageToken());
/**
* Retrieves a list of campaigns, possibly filtered. This method supports paging.
* @service Authenticated Dfareporting service.
* @optParams Optional paramaters are not required by a request.
* @profileId User profile ID associated with this request.
* @return CampaignsListResponse
*/
function campaignsListExample($service, $profileId, $optParams)
{
try
{
// Parameter validation.
if ($service == null)
throw new Exception("service is required.");
if ($optParams == null)
throw new Exception("optParams is required.");
if (profileId == null)
throw new Exception("profileId is required.");
// Make the request and return the results.
return $service->campaigns->ListCampaigns($profileId, $optParams);
}
catch (Exception $e)
{
print "An error occurred: " . $e->getMessage();
}
}
?>
|
LindaLawton/Google-APIs-PHP-Samples
|
Samples/DCM/DFA Reporting And Trafficking API/v2.8/CampaignsListSample.php
|
PHP
|
apache-2.0
| 5,866
|
from colordetection import *
topColors(992780587437103)
|
PTAug/fashion-analytics
|
fashion-analytics/image-processing/testcolor.py
|
Python
|
apache-2.0
| 56
|
<!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_25) on Mon Dec 02 23:10:55 MST 2013 -->
<title>Uses of Class ualberta.g12.adventurecreator.BuildConfig</title>
<meta name="date" content="2013-12-02">
<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="Uses of Class ualberta.g12.adventurecreator.BuildConfig";
}
//-->
</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><a href="../../../../ualberta/g12/adventurecreator/BuildConfig.html" title="class in ualberta.g12.adventurecreator">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?ualberta/g12/adventurecreator/class-use/BuildConfig.html" target="_top">Frames</a></li>
<li><a href="BuildConfig.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>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class ualberta.g12.adventurecreator.BuildConfig" class="title">Uses of Class<br>ualberta.g12.adventurecreator.BuildConfig</h2>
</div>
<div class="classUseContainer">No usage of ualberta.g12.adventurecreator.BuildConfig</div>
<!-- ======= 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><a href="../../../../ualberta/g12/adventurecreator/BuildConfig.html" title="class in ualberta.g12.adventurecreator">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?ualberta/g12/adventurecreator/class-use/BuildConfig.html" target="_top">Frames</a></li>
<li><a href="BuildConfig.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>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|
Team-CMPUT301F13T12/301-Project
|
doc/ualberta/g12/adventurecreator/class-use/BuildConfig.html
|
HTML
|
apache-2.0
| 4,171
|
# 卷九志第四
◎礼仪四
周大定元年,静帝遣兼太傅、上柱国、杞国公椿,大宗伯、大将军、金城公煚,奉皇帝玺绂策书,禅位于隋。司录虞庆则白,请设坛于东第。博士何妥议,以为受禅登坛,以告天也,故魏受汉禅,设坛于繁昌,为在行旅,郊坛乃阙。至如汉高在汜,光武在鄗,尽非京邑所筑坛。自晋、宋揖让,皆在都下,莫不并就南郊,更无别筑之义。又后魏即位,登朱雀观,周帝初立,受朝于路门,虽自我作古,皆非礼也。今即府为坛,恐招后诮。议者从之。二月甲子,椿等乘象辂,备卤簿,持节,率百官至门下,奉策入次。百官文武,朝服立于门南,北面。高祖冠远游冠,府僚陪列。记室入白,礼曹导高祖,府僚从,出大门东厢西向。椿奉策书,煚奉玺绂,出次,节导而进。高祖揖之,入门而左,椿等入门而右。百官随入庭中。椿南向,读册书毕,进授高祖。高祖北面再拜,辞不奉诏。上柱国李穆进喻朝旨,又与百官劝进,高祖不纳。椿等又奉策书进而敦劝,高祖再拜,俯受策,以授高颎;受玺,以授虞庆则。退就东阶位。使者与百官皆北面再拜,搢笏,三称万岁。有司请备法驾,高祖不许,改服纱帽、黄袍,入幸临光殿。就阁内服衮冕,乘小舆,出自西序,如元会仪。礼部尚书以案承符命及祥瑞牒,进东阶下。纳言跪御前以闻。内史令奉宣诏大赦,改元曰开皇。是日,命有司奉册祀于南郊。
后齐将崇皇太后,则太尉以玉帛告圆丘方泽,以币告庙。皇帝乃临轩,命太保持节,太尉副之。设九傧,命使者受玺绶册及节,诣西上閤。其日,昭阳殿文物具陈,临轩讫,使者就位,持节及玺绶称诏。二侍中拜进,受节及册玺绶,以付小黄门。黄门以诣閤。皇太后服袆衣,处昭阳殿,公主及命妇陪列于殿,皆拜。小黄门以节绶入,女侍中受,以进皇太后。皇太后兴,受,以授左右。复坐,反节于使者。使者受节出。册皇后,如太后之礼。
后齐册皇太子,则皇帝临轩,司待为使,司空副之。太子服远游冠,入至位。使者入,奉册读讫,皇太子跪受册于使,以授中庶子。又受玺绶于尚书,以授庶子。稽首以出。就册,则使者持节至东宫,宫臣内外官定列。皇太子阶东,西面。若幼,则太师抱之,主衣二人奉空顶帻服从,以受册。明日,拜章表于东宫殿庭,中庶子、中舍人乘轺车,奉章诣朝堂谢。择日斋于崇正殿,服冕,乘石山安车谒庙。择日群臣上礼,又择日会。明日,三品以上笺贺。
册诸王,以临轩日上水一刻,吏部令史乘马,赍召版,诣王第。王乘高车,卤簿至东掖门止,乘轺车。既入,至席。尚书读册讫,以授王,又授章绶。事毕,乘轺车,入卤簿,乘高车,诣阊阖门,伏阙表谢。报讫,拜庙还第。就第,则鸿胪卿持节,吏部尚书授册,侍御史授节。使者受而出,乘轺车,持节,诣王第。入就西阶,东面。王入,立于东阶,西面。使者读册,博士读版,王俯伏。兴,进受册章绶茅土,俯伏三稽首,还本位,谢如上仪。在州镇,则使者受节册,乘轺车至州,如王第。
诸王、三公、仪同、尚书令、五等开国、太妃、妃、公主恭拜册,轴一枚,长二尺,以白练衣之。用竹简十二枚,六枚与轴等,六枚长尺二寸。文出集书,书皆篆字。哀册、赠册亦同。诸王、五等开国及乡男恭拜,以其封国所在方,取社坛方面土,包以白茅,内青箱中。函方五寸,以青涂饰,封授之,以为社。
隋临轩册命三师、诸王、三公,并陈车辂。馀则否。百司定列,内史令读册讫,受册者拜受出。又引次受册者,如上仪。若册开国,郊社令奉茅土,立于仗南,西面。每受册讫,授茅土焉。
后齐皇帝加元服,以玉帛告圆丘方泽,以币告庙,择日临轩。中严,群官位定,皇帝著空顶介帻以出。太尉盥讫,升,脱空顶帻,以黑介帻奉加讫,太尉进太保之右,北面读祝讫,太保加冕,侍中系玄绂,脱绛纱袍,加衮服,事毕,太保上寿,群官三称万岁。皇帝入温室,移御坐,会而不上寿。后日,文武群官朝服,上礼酒十二钟,米十二囊,牛十二头。又择日亲拜圆丘方泽,谒庙。
皇太子冠,则太尉以制币告七庙,择日临轩。有司供帐于崇正殿。中严,皇太子空顶帻公服出,立东阶之南,西面,使者入,立西阶之南,东面。皇太子受诏讫,入室盥栉,出,南面。使者进揖,诣冠席,西面坐。光禄卿盥讫,诣太子前疏栉。使者又盥,奉进贤三梁冠,至太子前,东面祝,脱空顶帻,加冠。太子兴,入室更衣,出,又南面就席。光禄卿盥栉。使者又盥祝,脱三梁冠,加远游冠。太子又入室更衣。设席中楹之西,使者揖就席,南面。光禄卿洗爵酌醴,使者诣席前,北面祝。太子拜受醴,即席坐,祭之,啐之,奠爵,降阶,复本位,西面。三师、三少及在位群官拜事讫。又择日会宫臣,又择日谒庙。
隋皇太子将冠,前一日,皇帝斋于大兴殿。皇太子与宾赞及预从官斋于正寝。其日质明,有司告庙,各设筵于阼阶。皇帝衮冕入拜,即御座。宾揖皇太子进,升筵,西向坐。赞冠者坐栉,设纚。宾盥讫,进加缁布冠。赞冠进设頍缨。宾揖皇太子适东序,衣玄衣素裳以出。赞冠者又坐栉,宾进加远游冠。改服讫,宾又受冕。太子适东序,改服以出。宾揖皇太子南面立,宾进受醴,进筵前,北面立祝。皇太子拜受觯。宾复位,东面答拜。赞冠者奉馔于筵前,皇太子祭奠。礼毕,降筵,进当御东面拜。纳言承诏,诣太子戒讫,太子拜。赞冠者引太子降自西阶。宾少进,字之。赞冠者引皇太子进,立于庭,东面。诸亲拜讫,赞冠者拜,太子皆答拜。与宾赞俱复位。纳言承诏降,令有司致礼。宾赞又拜。皇帝降复阼阶,拜,皇太子已下皆拜。皇帝出,更衣还宫。皇太子从至阙,因入见皇后,拜而还。
后齐皇帝纳后之礼,纳采、问名、纳征讫,告圆丘方泽及庙,如加元服,是日,皇帝临轩,命太尉为使,司徒副之。持节诣皇后行宫,东向,奉玺绶册,以授中常侍。皇后受册于行殿。使者出,与公卿以下皆拜。有司备迎礼。太保太尉,受诏而行。主人公服,迎拜于门。使者入,升自宾阶,东面。主人升自阼阶,西面。礼物陈于庭。设席于两楹间,童子以玺书版升,主人跪受。送使者,拜于大门之外。有司先于昭阳殿两楹间供帐,为同牢之具。皇后服大严绣衣,带绶珮,加幜。女长御引出,升画轮四望车。女侍中负玺陪乘。卤簿如大驾。皇帝服衮冕出,升御坐。皇后入门,大卤簿住门外,小卤簿入。到东上閤,施步鄣,降车,席道以入昭阳殿。前至席位,姆去幜,皇后先拜后起,皇帝后拜先起。帝升自西阶,诣同牢坐,与皇后俱坐。各三饭讫,又各酳二爵一卺。奏礼毕,皇后兴,南面立。皇帝御太极殿,王公已下拜,皇帝兴,入。明日,后展衣,于昭阳殿拜表谢。又明日,以榛栗枣修,见皇太后于昭阳殿。择日,群官上礼。又择日谒庙。皇帝使太尉先以太牢告,而后遍见群庙。皇太子纳妃礼,皇帝遣使纳采,有司备礼物。会毕,使者受诏而行。主人迎于大门外。礼毕,会于听事。其次问名、纳吉,并如纳采。纳征,则使司徒及尚书令为使,备礼物而行。请期,则以太常宗正卿为使,如纳采。亲迎,则太尉为使。三日,妃朝皇帝于昭阳殿,又朝皇后于宣光殿。择日,群官上礼。他日,妃还。又他日,皇太子拜閤。
隋皇太子纳妃礼,皇帝临轩,使者受诏而行。主人俟于庙。使者执雁,主人迎拜于大门之东。使者入,升自西阶,立于楹间,南面。纳采讫,乃行问名仪。事毕,主人请致礼于从者。礼有币马。其次择日纳吉,如纳采。又择日,以玉帛乘马纳征。又择日告期。又择日,命有司以特牲告庙,册妃。皇太子将亲迎,皇帝临轩,醮而诫曰:"往迎尔相,承我宗事,勖帅以敬。"对曰:"谨奉诏。"既受命,羽仪而行。主人几筵于庙,妃服褕翟,立于东房。主人迎于门外,西面拜。皇太子答拜。主人揖皇太子先入,主人升,立于阼阶,西面。皇太子升进,当房户前,北面,跪奠雁,俯伏,兴拜,降出。妃父少进,西面戒之。母于西阶上,施衿结帨,及门内,施鞶申之。出门,妃升辂,乘以几。姆加幜。皇太子乃御,轮三周,御者代之。皇太子出大门,乘辂,羽仪还宫。妃三日,鸡鸣夙兴以朝。奠笲于皇帝,皇帝抚之。又奠笲于皇后,皇后抚之。席于户牖间,妃立于席西,祭奠而出。
后齐娉礼,一曰纳采,二曰问名,三曰纳吉,四曰纳征,五曰请期,六曰亲迎。皆用羔羊一口,雁一双,酒黍稷稻米面各一斛。自皇子王已下至于九品皆同,流外及庶人则减其半。纳征,皇子王用玄三匹,纁二匹,束帛十匹,大璋一(第一品已下至从三品,用璧玉,四品已下皆无。)兽皮二(第一品已下至从五品,用豹皮二,六品已下至从九品,用鹿皮。)锦彩六十匹(一品锦彩四十匹,二品三十匹,三品二十匹,四品杂彩十六匹,五品十匹,六品、七品五匹。)绢二百匹,(一品一百四十匹,二品一百二十匹,三品一百匹,四品八十匹,五品六十匹,六品、七品五十匹,八品、九品三十匹。)羔羊一口,羊四口,犊二头,酒黍稷稻米面各十斛。(一品至三品,减羊二口,酒黍稷稻米面各减六斛,四品、五品减一犊,酒黍稷稻米面又减二斛,六品以下无犊,酒黍稷稻米面各一斛。)诸王之子,已封未封,礼皆同第一品。新婚从车,皇子百乘,一品五十乘,第二、第三品三十乘,第四、第五品二十乘,第六、第七品十乘,八品达于庶人五乘。各依其秩之饰。
梁大同五年,临城公婚,公夫人于皇太子妃为姑侄,进见之制,议者互有不同。令曰:"纁雁之仪,既称合于二姓,酒食之会,亦有姻不失亲。若使榛栗腶修,贽馈必举,副笄编珈,盛饰斯备,不应妇见之礼,独以亲阙。顷者敬进酏醴,已传妇事之则,而奉盘沃盥,不行侯服之家。是知繁省不同,质文异世,临城公夫人于妃既是姑侄,宜停省。"
后齐将讲于天子,先定经于孔父庙,置执经一人,侍讲二人,执读一人,擿句二人,录义六人,奉经二人。讲之旦,皇帝服通天冠、玄纱袍,乘象辂,至学,坐庙堂上。讲讫,还便殿,改服绛纱袍,乘象辂,还宫。讲毕,以一太牢释奠孔父,配以颜回,列轩悬乐,六佾舞。行三献礼毕,皇帝服通天冠、绛纱袍,升阼,即坐。宴毕,还宫。皇太子每通一经,亦释奠,乘石山安车,三师乘车在前,三少从后而至学焉。
梁天监八年,皇太子释奠。周舍议,以为:"释奠仍会,既惟大礼,请依东宫元会,太子著绛纱襮,乐用轩悬。预升殿坐者,皆服朱衣。"帝从之。又有司以为:"《礼》云:'凡为人子者,升降不由阼阶。'案今学堂凡有三阶,愚谓客若降等,则从主人之阶。今先师在堂,义所尊敬,太子宜登阼阶,以明从师之义。若释奠事讫,宴会之时,无复先师之敬,太子升堂,则宜从西阶,以明不由阼义。"吏部郎徐勉议:"郑玄云:'由命士以上,父子异宫。'宫室既异,无不由阼阶之礼。请释奠及宴会,太子升堂,并宜由东阶。若舆驾幸学,自然中陛。又检《东宫元会仪注》,太子升崇正殿,不欲东西阶。责东宫典仪,列云:'太子元会,升自西阶',此则相承为谬。请自今东宫大公事,太子升崇正殿,并由阼阶。其预会宾客,依旧西阶。"
大同七年,皇太子表其子宁国、临城公入学,时议者以与太子有齿胄之义,疑之。侍中、尚书令臣敬容、尚书仆射臣缵、尚书臣僧旻、臣之遴、臣筠等,以为:"参、点并事宣尼,回、路同谘泗水,邹鲁称盛,洙汶无讥。师道既光,得一资敬,无亏亚贰,况于两公,而云不可?"制曰:"可。"
后齐制,新立学,必释奠礼先圣先师,每岁春秋二仲,常行其礼。每月旦,祭酒领博士已下及国子诸学生已上,太学、四门博士升堂,助教已下、太学诸生阶下,拜孔揖颜。日出行事而不至者,记之为一负。雨沾服则止。学生每十日给假,皆以丙日放之。郡学则于坊内立孔、颜庙,博士已下,亦每月朝云。
隋制,国子寺,每岁以四仲月上丁,释奠于先圣先师。年别一行乡饮酒礼。州郡学则以春秋仲月释奠。州郡县亦每年于学一行乡饮酒礼。学生皆乙日试书,丙日给假焉。
梁元会之礼,未明,庭燎设,文物充庭。台门辟,禁卫皆严,有司各从其事。太阶东置白兽樽。群臣及诸蕃客并集,各从其班而拜。侍中奏中严,王公卿尹各执珪璧入拜。侍中乃奏外办,皇帝服衮冕,乘舆以出。侍中扶左,常侍扶右,黄门侍郎一人执曲直华盖从。至阶,降舆,纳舄升坐。有司御前施奉珪藉。王公以下,至阼阶,脱舄剑,升殿,席南奉贽珪璧毕,下殿,纳舄佩剑,诣本位。主客即徙珪璧于东厢。帝兴,入,徙御坐于西壁下,东向。设皇太子王公已下位。又奏中严,皇帝服通天冠,升御坐。王公上寿礼毕,食。食毕,乐伎奏。太宫进御酒,主书赋黄甘,逮二品已上。尚书驺骑引计吏,郡国各一人,皆跪受诏。侍中读五条诏,计吏每应诺讫,令陈便宜者,听诣白兽樽,以次还坐。宴乐罢,皇帝乘舆以入。皇太子朝,则远游冠服,乘金辂,卤簿以行。预会则剑履升坐。会讫,先兴。天监六年诏曰:"顷代以来,元日朝毕,次会群臣,则移就西壁下,东向坐。求之古义,王者宴万国,唯应南面,何更居东面?"于是御坐南向,以西方为上。皇太子以下,在北壁坐者,悉西边东向。尚书令以下在南方坐者,悉东边西向。旧元日御坐东向,酒壶在东壁下。御坐既南向,乃诏壶于南兰下。又诏:"元日受五等贽,珪璧并量付所司。"周舍案:"《周礼》冢宰,大朝觐,赞玉币。尚书,古之冢宰。顷王者不亲抚玉,则不复须冢宰赞助。寻尚书主客曹郎,既冢宰隶职,今元日五等奠玉既竟,请以主客郎受。郑玄注《觐礼》云:'既受之后,出付玉人于外。'汉时少府,职掌珪璧,请主客受玉,付少府掌。"帝从之。又尚书仆射沈约议:"《正会仪注》,御出,乘舆至太极殿前,纳舄升阶。寻路寝之设,本是人君居处,不容自敬宫室。案汉氏则乘小车升殿。请自今元正及大公事,御宜乘小舆至太极阶,仍乘版舆升殿。"制:"可。"
陈制,先元会十日,百官并习仪注,令仆已下,悉公服监之。设庭燎,街阙、城上、殿前皆严兵,百官各设部位而朝。宫人皆于东堂,隔绮疏而观。宫门既无籍,外人但绛衣者,亦得入观。是日,上事人发白兽樽。自余亦多依梁礼云。
后齐正日,侍中宣诏慰劳州郡国使。诏牍长一尺三寸,广一尺,雌黄涂饰,上写诏书三。计会日,侍中依仪劳郡国计吏,问刺史太守安不,及谷价麦苗善恶,人间疾苦。又班五条诏书于诸州郡国使人,写以诏牍一枚,长二尺五寸,广一尺三寸,亦以雌黄涂饰,上写诏书。正会日,依仪宣示使人,归以告刺史二千石。一曰,政在正身,在爱人,去残贼,择良吏,正决狱,平徭赋。二曰,人生在勤,勤则不匮,其劝率田桑,无或烦扰。三曰,六极之人,务加宽养,必使生有以自救,没有以自给。四曰,长吏华浮,奉客以求小誉,逐末舍本,政之所疾,宜谨察之。五曰,人事意气,干乱奉公,外内溷淆,纲纪不设,所宜纠劾。正会日,侍中黄门宣诏劳诸郡上计。劳讫付纸,遣陈土宜。字有脱误者,呼起席后立。书迹滥劣者,饮墨水一升。文理孟浪无可取者,夺容刀及席。即而本曹郎中考其文迹才辞可聚者,录牒吏部,简同流外三品叙。元正大飨,百官一品已下,流外九品已上预会。一品已下、正三品已上、开国公侯伯、散品公侯及特命之官、下代刺史,并升殿。从三品已下、从九品以上及奉正使人比流官者,在阶下。勋品已下端门外。
隋制,正旦及冬至,文物充庭,皇帝出西房,即御座。皇太子卤簿至显阳门外,入贺。复诣皇后御殿,拜贺讫,还宫。皇太子朝讫,群官客使入就位,再拜。上公一人,诣西阶,解剑,升贺;降阶,带剑,复位而拜。有司奏诸州表。群官在位者又拜而出。皇帝入东房,有司奏行事讫,乃出西房。坐定,群官入就位,上寿讫,上下俱拜。皇帝举酒,上下舞蹈,三称万岁。皇太子预会,则设坐于御东南,西向。群臣上寿毕,入,解剑以升。会讫,先兴。
后齐元日,中宫朝会,陈乐,皇后袆衣乘舆,以出于昭阳殿。坐定,内外命妇拜,皇后兴,妃主皆跪。皇后坐,妃主皆起,长公主一人,前跪拜贺。礼毕,皇后入室,乃移幄坐于西厢。皇后改服褕狄以出。坐定,公主一人上寿讫,就坐。御酒食,赐爵,并如外朝会。
隋仪如后齐制,而又有皇后受群臣贺礼。则皇后御坐,而内侍受群臣拜以入,承令而出,群臣拜而罢。
后齐皇太子月五朝。未明二刻,乘小舆出,为三师降。至承华门,升石山安车,三师轺车在前,三少在后,自云龙门入。皇帝御殿前,设拜席位,至柏阁,斋帅引,洗马、中庶子从。至殿前席南,北面再拜。
天保元年,皇太子监国,在西林园冬会。群议皆东面。二年,于北城第内冬会,又议东面。吏部郎陆卬疑非礼,魏收改为西面。邢子才议欲依前,曰:
凡礼有同者,不可令异。《诗》说,天子至于大夫,皆乘四马,况以方面之少,何可皆不同乎?若太子定西面者,王公卿大夫士,复何面邪?南面人君正位,今一官之长,无不南面,太子听政,亦南面坐。议者言皆晋旧事,太子在东宫西面,为避尊位,非为向台殿也。子才以为东晋博议,依汉、魏之旧,太子普臣四海,不以为嫌,又何疑于东面?《礼》"世子绝旁亲","世子冠于阼","冢子生,接以太牢"。汉元著令,太子绝驰道。此皆礼同于君。又晋王公世子,摄命临国,乘七旒安车,驾用三马,礼同三公。近宋太子乘象辂,皆有同处,不以为嫌。况东面者,君臣通礼,独何为避?明为向台,所以然也。近皇太子在西林园,在于殿犹且东面,于北城非宫殿之处,更不得邪?诸人以东面为尊,宴会须避。案《燕礼》、《燕义》,君位在东,宾位则在西,君位在阼阶,故有《武王践阼篇》,不在西也。《礼》"乘君之车,不敢旷左"。君在,恶空其位,左亦在东,不在西也。"君在阼,夫人在房"。郑注"人君尊东也"。前代及今,皇帝宴会接客,亦东堂西面。若以东面为贵,皇太子以储后之礼,监国之重,别第宴臣宾,自得申其正位。礼者皆东宫臣属,公卿接宴,观礼而已。若以西面为卑,实是君之正位。太公不肯北面说《丹书》,西面则道之,西面乃尊也。君位南面,有东有西,何可皆避?且事虽少异,有可相比者。周公,臣也,太子,子也。周公为冢宰,太子为储贰。明堂尊于别第,朝诸侯重于宴臣宾,南面贵于东面。臣疏于子,冢宰轻于储贰。周公摄政,得在明堂南面朝诸侯。今太子监国,不得于别第异宫东面宴客,情所未安。且君行以太子监国,君宴不以公卿为宾,明父子无嫌,君臣有嫌。案《仪注》,亲王受诏冠婚,皇子皇女皆东面。今不约王公南面,而独约太子,何所取邪?议者南尊改就西面,转君位,更非合礼。方面既少,难为节文。东西二面,君臣通用,太子宜然,于礼为允。
魏收议云:
去天保初,皇太子监国。冬会群官于西园都亭,坐从东面,义取于向中宫台殿故也。二年于宫冬会,坐乃东面,收窃以为疑。前者遂有别议,议者同之。邢尚书以前定东面之议,复申本怀,此乃国之大礼,无容不尽所见。收以为太子东宫,位在于震,长子之义也。案《易》八卦,正位向中。皇太子今居北城,于宫殿为东北,南面而坐,于义为背也。前者立议,据东宫为本。又案《东宫旧事》,太子宴会,多以西面为礼,此又成证,非徒言也。不言太子常无东南二面之坐,但用之有所。至如西园东面,所不疑也。未知君臣车服有同异之议,何为而发?就如所云,但知礼有同者,不可令异。不知礼有异者,不可令同。苟别君臣同异之礼,恐重纸累札,书不尽也。
子才竟执东面,收执西面,授引经据,大相往复。其后竟从西面为定。时议又疑宫吏之姓与太子名同。子才又谓曰:"案《曲礼》'大夫士之子,不与世子同名。'《郑注》云:'若先之生,亦不改。'汉法,天子登位,布名于天下,四海之内,无不咸避。案《春秋经》'卫石恶出奔晋',在卫侯衎卒之前。衎卒,其子恶始立。明石恶于长子同名。诸侯长子,在一国之内,与皇太子于天子,礼亦不异。郑言先生不改,盖以此义。卫石恶、宋向戌皆与君同名,《春秋》不讥。皇太子虽有储贰之重,未为海内所避,何容便改人姓。然事有消息,不得皆同于古。宫吏至微,而有所犯,朝夕从事,亦是难安,宜听出宫,尚书更补他职。"制曰:"可。"
后周制,正之二日,皇太子南面,列轩悬,宫官朝贺。及开皇初,皇太子勇准故事,张乐受朝,宫臣及京官北面称庆。高祖诮之。是后定仪注,西面而坐,唯宫臣称庆,台官不复总集。炀帝之为太子,奏降章服,宫官请不称臣。诏许之。后齐立春日,皇帝服通天冠、青介帻、青纱袍,佩苍玉,青带、青袴、青袜舄,而受朝于太极殿。尚书令等坐定,三公郎中诣席,跪读时令讫,典御酌酒卮,置郎中前,郎中耑,还席伏饮,礼成而出。立夏、季夏、立秋读令,则施御座于中楹,南向。立冬如立春,于西厢东向。各以其时之色服,仪并如春礼。
后齐每策秀孝,中书策秀才,集书策考贡士,考功郎中策廉良,皇帝常服,乘舆出,坐于朝堂中楹。秀孝各以班草对。其有脱误、书滥、孟浪者,起立席后,饮墨水,脱容刀。
后齐宴宗室礼,皇帝常服,别殿西厢东向。七庙子孙皆公服,无官者,单衣介帻,集神武门。宗室尊卑,次于殿庭。七十者二人扶拜,八十者扶而不拜。升殿就位,皇帝兴,宗室伏。皇帝坐,乃兴拜而坐。尊者南面,卑者北面,皆以西为上。八十者一坐。再至,进丝竹之乐。三爵毕,宗室避席,待诏而后复位。乃行无算爵。
正晦泛舟,则皇帝乘舆,鼓吹至行殿。升御坐,乘版舆,以与王公登舟,置酒。非预泛者,坐于便幕。
仲春令辰,陈养老礼。先一日,三老五更斋于国学。皇帝进贤冠、玄纱袍,至璧雍,入总章堂。列宫悬。王公已下及国老庶老各定位。司徒以羽仪武贲安车,迎三老五更于国学。并进贤冠、玄服、黑舄、素带。国子生黑介帻、青衿、单衣,乘马从以至。皇帝释剑,执珽,迎于门内。三老至门,五更去门十步,则降车以入。皇帝拜,三老五更摄齐答拜。皇帝揖进,三老在前,五更在后,升自右阶,就筵。三老坐,五更立。皇帝升堂,北面。公卿升自左阶,北面。三公授几杖,卿正履,国老庶老各就位。皇帝拜三老,群臣皆拜。不拜五更。乃坐,皇帝西向,肃拜五更。进珍羞酒食,亲袒割,执酱以馈,执爵以酳。以次进五更。又设酒酏于国老庶老。皇帝升御坐,三老乃论五孝六顺,典训大纲。皇帝虚躬请受,礼毕而还。又都下及外州人年七十已上,赐鸠杖黄帽。(有敕即给,不为常也。)
后周保定三年,陈养老之礼。以太傅、燕国公于谨为三老。有司具礼择日,高祖幸太学以食之。事见谨传。
|
cdcdec/LearningNotes
|
books/中国古代史/隋书/卷九志第四.md
|
Markdown
|
apache-2.0
| 26,067
|
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import copy
import logging
import random
import time
from oslo.config import cfg
import six
from sahara.openstack.common._i18n import _, _LE, _LI
periodic_opts = [
cfg.BoolOpt('run_external_periodic_tasks',
default=True,
help='Some periodic tasks can be run in a separate process. '
'Should we run them here?'),
]
CONF = cfg.CONF
CONF.register_opts(periodic_opts)
LOG = logging.getLogger(__name__)
DEFAULT_INTERVAL = 60.0
def list_opts():
"""Entry point for oslo.config-generator."""
return [(None, copy.deepcopy(periodic_opts))]
class InvalidPeriodicTaskArg(Exception):
message = _("Unexpected argument for periodic task creation: %(arg)s.")
def periodic_task(*args, **kwargs):
"""Decorator to indicate that a method is a periodic task.
This decorator can be used in two ways:
1. Without arguments '@periodic_task', this will be run on the default
interval of 60 seconds.
2. With arguments:
@periodic_task(spacing=N [, run_immediately=[True|False]]
[, name=[None|"string"])
this will be run on approximately every N seconds. If this number is
negative the periodic task will be disabled. If the run_immediately
argument is provided and has a value of 'True', the first run of the
task will be shortly after task scheduler starts. If
run_immediately is omitted or set to 'False', the first time the
task runs will be approximately N seconds after the task scheduler
starts. If name is not provided, __name__ of function is used.
"""
def decorator(f):
# Test for old style invocation
if 'ticks_between_runs' in kwargs:
raise InvalidPeriodicTaskArg(arg='ticks_between_runs')
# Control if run at all
f._periodic_task = True
f._periodic_external_ok = kwargs.pop('external_process_ok', False)
if f._periodic_external_ok and not CONF.run_external_periodic_tasks:
f._periodic_enabled = False
else:
f._periodic_enabled = kwargs.pop('enabled', True)
f._periodic_name = kwargs.pop('name', f.__name__)
# Control frequency
f._periodic_spacing = kwargs.pop('spacing', 0)
f._periodic_immediate = kwargs.pop('run_immediately', False)
if f._periodic_immediate:
f._periodic_last_run = None
else:
f._periodic_last_run = time.time()
return f
# NOTE(sirp): The `if` is necessary to allow the decorator to be used with
# and without parenthesis.
#
# In the 'with-parenthesis' case (with kwargs present), this function needs
# to return a decorator function since the interpreter will invoke it like:
#
# periodic_task(*args, **kwargs)(f)
#
# In the 'without-parenthesis' case, the original function will be passed
# in as the first argument, like:
#
# periodic_task(f)
if kwargs:
return decorator
else:
return decorator(args[0])
class _PeriodicTasksMeta(type):
def _add_periodic_task(cls, task):
"""Add a periodic task to the list of periodic tasks.
The task should already be decorated by @periodic_task.
:return: whether task was actually enabled
"""
name = task._periodic_name
if task._periodic_spacing < 0:
LOG.info(_LI('Skipping periodic task %(task)s because '
'its interval is negative'),
{'task': name})
return False
if not task._periodic_enabled:
LOG.info(_LI('Skipping periodic task %(task)s because '
'it is disabled'),
{'task': name})
return False
# A periodic spacing of zero indicates that this task should
# be run on the default interval to avoid running too
# frequently.
if task._periodic_spacing == 0:
task._periodic_spacing = DEFAULT_INTERVAL
cls._periodic_tasks.append((name, task))
cls._periodic_spacing[name] = task._periodic_spacing
return True
def __init__(cls, names, bases, dict_):
"""Metaclass that allows us to collect decorated periodic tasks."""
super(_PeriodicTasksMeta, cls).__init__(names, bases, dict_)
# NOTE(sirp): if the attribute is not present then we must be the base
# class, so, go ahead an initialize it. If the attribute is present,
# then we're a subclass so make a copy of it so we don't step on our
# parent's toes.
try:
cls._periodic_tasks = cls._periodic_tasks[:]
except AttributeError:
cls._periodic_tasks = []
try:
cls._periodic_spacing = cls._periodic_spacing.copy()
except AttributeError:
cls._periodic_spacing = {}
for value in cls.__dict__.values():
if getattr(value, '_periodic_task', False):
cls._add_periodic_task(value)
def _nearest_boundary(last_run, spacing):
"""Find nearest boundary which is in the past, which is a multiple of the
spacing with the last run as an offset.
Eg if last run was 10 and spacing was 7, the new last run could be: 17, 24,
31, 38...
0% to 5% of the spacing value will be added to this value to ensure tasks
do not synchronize. This jitter is rounded to the nearest second, this
means that spacings smaller than 20 seconds will not have jitter.
"""
current_time = time.time()
if last_run is None:
return current_time
delta = current_time - last_run
offset = delta % spacing
# Add up to 5% jitter
jitter = int(spacing * (random.random() / 20))
return current_time - offset + jitter
@six.add_metaclass(_PeriodicTasksMeta)
class PeriodicTasks(object):
def __init__(self):
super(PeriodicTasks, self).__init__()
self._periodic_last_run = {}
for name, task in self._periodic_tasks:
self._periodic_last_run[name] = task._periodic_last_run
def add_periodic_task(self, task):
"""Add a periodic task to the list of periodic tasks.
The task should already be decorated by @periodic_task.
"""
if self.__class__._add_periodic_task(task):
self._periodic_last_run[task._periodic_name] = (
task._periodic_last_run)
def run_periodic_tasks(self, context, raise_on_error=False):
"""Tasks to be run at a periodic interval."""
idle_for = DEFAULT_INTERVAL
for task_name, task in self._periodic_tasks:
full_task_name = '.'.join([self.__class__.__name__, task_name])
spacing = self._periodic_spacing[task_name]
last_run = self._periodic_last_run[task_name]
# Check if due, if not skip
idle_for = min(idle_for, spacing)
if last_run is not None:
delta = last_run + spacing - time.time()
if delta > 0:
idle_for = min(idle_for, delta)
continue
LOG.debug("Running periodic task %(full_task_name)s",
{"full_task_name": full_task_name})
self._periodic_last_run[task_name] = _nearest_boundary(
last_run, spacing)
try:
task(self, context)
except Exception as e:
if raise_on_error:
raise
LOG.exception(_LE("Error during %(full_task_name)s: %(e)s"),
{"full_task_name": full_task_name, "e": e})
time.sleep(0)
return idle_for
|
esikachev/scenario
|
sahara/openstack/common/periodic_task.py
|
Python
|
apache-2.0
| 8,319
|
#!/usr/bin/env bash
echo "===========================================$0 $@"
#Make sure to exit if anything fails
set -e
set -x
./bin/normalize_eml.sh "$@"
source ./bin/_newman_pipeline.sh "$@"
|
Sotera/pst-extraction
|
bin/eml_all.sh
|
Shell
|
apache-2.0
| 196
|
/*
* Copyright 2012 JBoss by Red Hat.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jbpm.services.task.audit.service;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import org.jbpm.services.task.HumanTaskServiceFactory;
import org.jbpm.services.task.audit.JPATaskLifeCycleEventListener;
import org.jbpm.services.task.lifecycle.listeners.BAMTaskEventListener;
import org.junit.After;
import org.junit.Before;
import org.kie.internal.task.api.InternalTaskService;
import bitronix.tm.resource.jdbc.PoolingDataSource;
import org.jbpm.services.task.audit.TaskAuditServiceFactory;
public class LocalTaskAuditTest extends TaskAuditBaseTest {
private PoolingDataSource pds;
private EntityManagerFactory emf;
@Before
public void setup() {
pds = setupPoolingDataSource();
emf = Persistence.createEntityManagerFactory( "org.jbpm.services.task" );
this.taskService = (InternalTaskService) HumanTaskServiceFactory.newTaskServiceConfigurator()
.entityManagerFactory(emf)
.listener(new JPATaskLifeCycleEventListener(true))
.listener(new BAMTaskEventListener(true))
.getTaskService();
this.taskAuditService = TaskAuditServiceFactory.newTaskAuditServiceConfigurator().setTaskService(taskService).getTaskAuditService();
}
@After
public void clean() {
if (emf != null) {
emf.close();
}
if (pds != null) {
pds.close();
}
}
}
|
lukenjmcd/jbpm
|
jbpm-human-task/jbpm-human-task-audit/src/test/java/org/jbpm/services/task/audit/service/LocalTaskAuditTest.java
|
Java
|
apache-2.0
| 1,984
|
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
<link rel="shortcut icon" type="image/x-icon" href="../../../../../../favicon.ico" />
<title>UserRecoverableException | Android Developers</title>
<!-- STYLESHEETS -->
<link rel="stylesheet"
href="http://fonts.googleapis.com/css?family=Roboto+Condensed">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold"
title="roboto">
<link href="../../../../../../assets/css/default.css?v=2" rel="stylesheet" type="text/css">
<!-- FULLSCREEN STYLESHEET -->
<link href="../../../../../../assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
type="text/css">
<!-- JAVASCRIPT -->
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script src="../../../../../../assets/js/android_3p-bundle.js" type="text/javascript"></script>
<script type="text/javascript">
var toRoot = "../../../../../../";
var metaTags = [];
var devsite = false;
</script>
<script src="../../../../../../assets/js/docs.js?v=2" type="text/javascript"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-5831155-1', 'android.com');
ga('create', 'UA-49880327-2', 'android.com', {'name': 'universal'}); // New tracker);
ga('send', 'pageview');
ga('universal.send', 'pageview'); // Send page view for new tracker.
</script>
</head>
<body class="gc-documentation
develop" itemscope itemtype="http://schema.org/Article">
<div id="doc-api-level" class="" style="display:none"></div>
<a name="top"></a>
<a name="top"></a>
<!-- Header -->
<div id="header-wrapper">
<div id="header">
<div class="wrap" id="header-wrap">
<div class="col-3 logo">
<a href="../../../../../../index.html">
<img src="../../../../../../assets/images/dac_logo.png"
srcset="../../../../../../assets/images/dac_logo@2x.png 2x"
width="123" height="25" alt="Android Developers" />
</a>
<div class="btn-quicknav" id="btn-quicknav">
<a href="#" class="arrow-inactive">Quicknav</a>
<a href="#" class="arrow-active">Quicknav</a>
</div>
</div>
<ul class="nav-x col-9">
<li class="design">
<a href="../../../../../../design/index.html"
zh-tw-lang="設計"
zh-cn-lang="设计"
ru-lang="Проектирование"
ko-lang="디자인"
ja-lang="設計"
es-lang="Diseñar"
>Design</a></li>
<li class="develop"><a href="../../../../../../develop/index.html"
zh-tw-lang="開發"
zh-cn-lang="开发"
ru-lang="Разработка"
ko-lang="개발"
ja-lang="開発"
es-lang="Desarrollar"
>Develop</a></li>
<li class="distribute last"><a href="../../../../../../distribute/googleplay/index.html"
zh-tw-lang="發佈"
zh-cn-lang="分发"
ru-lang="Распространение"
ko-lang="배포"
ja-lang="配布"
es-lang="Distribuir"
>Distribute</a></li>
</ul>
<div class="menu-container">
<div class="moremenu">
<div id="more-btn"></div>
</div>
<div class="morehover" id="moremenu">
<div class="top"></div>
<div class="mid">
<div class="header">Links</div>
<ul>
<li><a href="https://play.google.com/apps/publish/" target="_googleplay">Google Play Developer Console</a></li>
<li><a href="http://android-developers.blogspot.com/">Android Developers Blog</a></li>
<li><a href="../../../../../../about/index.html">About Android</a></li>
</ul>
<div class="header">Android Sites</div>
<ul>
<li><a href="http://www.android.com">Android.com</a></li>
<li class="active"><a>Android Developers</a></li>
<li><a href="http://source.android.com">Android Open Source Project</a></li>
</ul>
<br class="clearfix" />
</div><!-- end 'mid' -->
<div class="bottom"></div>
</div><!-- end 'moremenu' -->
<div class="search" id="search-container">
<div class="search-inner">
<div id="search-btn"></div>
<div class="left"></div>
<form onsubmit="return submit_search()">
<input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
onkeydown="return search_changed(event, true, '../../../../../../')"
onkeyup="return search_changed(event, false, '../../../../../../')" />
</form>
<div class="right"></div>
<a class="close hide">close</a>
<div class="left"></div>
<div class="right"></div>
</div><!-- end search-inner -->
</div><!-- end search-container -->
<div class="search_filtered_wrapper reference">
<div class="suggest-card reference no-display">
<ul class="search_filtered">
</ul>
</div>
</div>
<div class="search_filtered_wrapper docs">
<div class="suggest-card dummy no-display"> </div>
<div class="suggest-card develop no-display">
<ul class="search_filtered">
</ul>
<div class="child-card guides no-display">
</div>
<div class="child-card training no-display">
</div>
<div class="child-card samples no-display">
</div>
</div>
<div class="suggest-card design no-display">
<ul class="search_filtered">
</ul>
</div>
<div class="suggest-card distribute no-display">
<ul class="search_filtered">
</ul>
</div>
</div>
</div><!-- end menu-container (search and menu widget) -->
<!-- Expanded quicknav -->
<div id="quicknav" class="col-13">
<ul>
<li class="about">
<ul>
<li><a href="../../../../../../about/index.html">About</a></li>
<li><a href="../../../../../../wear/index.html">Wear</a></li>
<li><a href="../../../../../../tv/index.html">TV</a></li>
<li><a href="../../../../../../auto/index.html">Auto</a></li>
</ul>
</li>
<li class="design">
<ul>
<li><a href="../../../../../../design/index.html">Get Started</a></li>
<li><a href="../../../../../../design/devices.html">Devices</a></li>
<li><a href="../../../../../../design/style/index.html">Style</a></li>
<li><a href="../../../../../../design/patterns/index.html">Patterns</a></li>
<li><a href="../../../../../../design/building-blocks/index.html">Building Blocks</a></li>
<li><a href="../../../../../../design/downloads/index.html">Downloads</a></li>
<li><a href="../../../../../../design/videos/index.html">Videos</a></li>
</ul>
</li>
<li class="develop">
<ul>
<li><a href="../../../../../../training/index.html"
zh-tw-lang="訓練課程"
zh-cn-lang="培训"
ru-lang="Курсы"
ko-lang="교육"
ja-lang="トレーニング"
es-lang="Capacitación"
>Training</a></li>
<li><a href="../../../../../../guide/index.html"
zh-tw-lang="API 指南"
zh-cn-lang="API 指南"
ru-lang="Руководства по API"
ko-lang="API 가이드"
ja-lang="API ガイド"
es-lang="Guías de la API"
>API Guides</a></li>
<li><a href="../../../../../../reference/packages.html"
zh-tw-lang="參考資源"
zh-cn-lang="参考"
ru-lang="Справочник"
ko-lang="참조문서"
ja-lang="リファレンス"
es-lang="Referencia"
>Reference</a></li>
<li><a href="../../../../../../sdk/index.html"
zh-tw-lang="相關工具"
zh-cn-lang="工具"
ru-lang="Инструменты"
ko-lang="도구"
ja-lang="ツール"
es-lang="Herramientas"
>Tools</a>
</li>
<li><a href="../../../../../../google/index.html">Google Services</a>
</li>
</ul>
</li>
<li class="distribute last">
<ul>
<li><a href="../../../../../../distribute/googleplay/index.html">Google Play</a></li>
<li><a href="../../../../../../distribute/essentials/index.html">Essentials</a></li>
<li><a href="../../../../../../distribute/users/index.html">Get Users</a></li>
<li><a href="../../../../../../distribute/engage/index.html">Engage & Retain</a></li>
<li><a href="../../../../../../distribute/monetize/index.html">Monetize</a></li>
<li><a href="../../../../../../distribute/tools/index.html">Tools & Reference</a></li>
<li><a href="../../../../../../distribute/stories/index.html">Developer Stories</a></li>
</ul>
</li>
</ul>
</div><!-- /Expanded quicknav -->
</div><!-- end header-wrap.wrap -->
</div><!-- end header -->
<!-- Secondary x-nav -->
<div id="nav-x">
<div class="wrap">
<ul class="nav-x col-9 develop" style="width:100%">
<li class="training"><a href="../../../../../../training/index.html"
zh-tw-lang="訓練課程"
zh-cn-lang="培训"
ru-lang="Курсы"
ko-lang="교육"
ja-lang="トレーニング"
es-lang="Capacitación"
>Training</a></li>
<li class="guide"><a href="../../../../../../guide/index.html"
zh-tw-lang="API 指南"
zh-cn-lang="API 指南"
ru-lang="Руководства по API"
ko-lang="API 가이드"
ja-lang="API ガイド"
es-lang="Guías de la API"
>API Guides</a></li>
<li class="reference"><a href="../../../../../../reference/packages.html"
zh-tw-lang="參考資源"
zh-cn-lang="参考"
ru-lang="Справочник"
ko-lang="참조문서"
ja-lang="リファレンス"
es-lang="Referencia"
>Reference</a></li>
<li class="tools"><a href="../../../../../../sdk/index.html"
zh-tw-lang="相關工具"
zh-cn-lang="工具"
ru-lang="Инструменты"
ko-lang="도구"
ja-lang="ツール"
es-lang="Herramientas"
>Tools</a></li>
<li class="google"><a href="../../../../../../google/index.html"
>Google Services</a>
</li>
</ul>
</div>
</div>
<!-- /Sendondary x-nav DEVELOP -->
<div id="searchResults" class="wrap" style="display:none;">
<h2 id="searchTitle">Results</h2>
<div id="leftSearchControl" class="search-control">Loading...</div>
</div>
</div> <!--end header-wrapper -->
<div id="sticky-header">
<div>
<a class="logo" href="#top"></a>
<a class="top" href="#top"></a>
<ul class="breadcrumb">
<li class="current">UserRecoverableException</li>
</ul>
</div>
</div>
<div class="wrap clearfix" id="body-content">
<div class="col-4" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
<div id="devdoc-nav">
<div id="api-nav-header">
<div id="api-level-toggle">
<label for="apiLevelCheckbox" class="disabled"
title="Select your target API level to dim unavailable APIs">API level: </label>
<div class="select-wrapper">
<select id="apiLevelSelector">
<!-- option elements added by buildApiLevelSelector() -->
</select>
</div>
</div><!-- end toggle -->
<div id="api-nav-title">Android APIs</div>
</div><!-- end nav header -->
<script>
var SINCE_DATA = [ ];
buildApiLevelSelector();
</script>
<div id="swapper">
<div id="nav-panels">
<div id="resize-packages-nav">
<div id="packages-nav" class="scroll-pane">
<ul>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/package-summary.html">com.google.android.gms</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/actions/package-summary.html">com.google.android.gms.actions</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/ads/package-summary.html">com.google.android.gms.ads</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/ads/doubleclick/package-summary.html">com.google.android.gms.ads.doubleclick</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/ads/identifier/package-summary.html">com.google.android.gms.ads.identifier</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/ads/mediation/package-summary.html">com.google.android.gms.ads.mediation</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/ads/mediation/admob/package-summary.html">com.google.android.gms.ads.mediation.admob</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/ads/mediation/customevent/package-summary.html">com.google.android.gms.ads.mediation.customevent</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/ads/purchase/package-summary.html">com.google.android.gms.ads.purchase</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/ads/search/package-summary.html">com.google.android.gms.ads.search</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/analytics/package-summary.html">com.google.android.gms.analytics</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/analytics/ecommerce/package-summary.html">com.google.android.gms.analytics.ecommerce</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/appindexing/package-summary.html">com.google.android.gms.appindexing</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/appstate/package-summary.html">com.google.android.gms.appstate</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/auth/package-summary.html">com.google.android.gms.auth</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/auth/api/package-summary.html">com.google.android.gms.auth.api</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/cast/package-summary.html">com.google.android.gms.cast</a></li>
<li class="selected api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/common/package-summary.html">com.google.android.gms.common</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/common/annotation/package-summary.html">com.google.android.gms.common.annotation</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/common/api/package-summary.html">com.google.android.gms.common.api</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/common/data/package-summary.html">com.google.android.gms.common.data</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/common/images/package-summary.html">com.google.android.gms.common.images</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/drive/package-summary.html">com.google.android.gms.drive</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/drive/events/package-summary.html">com.google.android.gms.drive.events</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/drive/metadata/package-summary.html">com.google.android.gms.drive.metadata</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/drive/query/package-summary.html">com.google.android.gms.drive.query</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/drive/widget/package-summary.html">com.google.android.gms.drive.widget</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/fitness/package-summary.html">com.google.android.gms.fitness</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/fitness/data/package-summary.html">com.google.android.gms.fitness.data</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/fitness/request/package-summary.html">com.google.android.gms.fitness.request</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/fitness/result/package-summary.html">com.google.android.gms.fitness.result</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/fitness/service/package-summary.html">com.google.android.gms.fitness.service</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/games/package-summary.html">com.google.android.gms.games</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/games/achievement/package-summary.html">com.google.android.gms.games.achievement</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/games/event/package-summary.html">com.google.android.gms.games.event</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/games/leaderboard/package-summary.html">com.google.android.gms.games.leaderboard</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/games/multiplayer/package-summary.html">com.google.android.gms.games.multiplayer</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/games/multiplayer/realtime/package-summary.html">com.google.android.gms.games.multiplayer.realtime</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/games/multiplayer/turnbased/package-summary.html">com.google.android.gms.games.multiplayer.turnbased</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/games/quest/package-summary.html">com.google.android.gms.games.quest</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/games/request/package-summary.html">com.google.android.gms.games.request</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/games/snapshot/package-summary.html">com.google.android.gms.games.snapshot</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/gcm/package-summary.html">com.google.android.gms.gcm</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/identity/intents/package-summary.html">com.google.android.gms.identity.intents</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/identity/intents/model/package-summary.html">com.google.android.gms.identity.intents.model</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/location/package-summary.html">com.google.android.gms.location</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/maps/package-summary.html">com.google.android.gms.maps</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/maps/model/package-summary.html">com.google.android.gms.maps.model</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/panorama/package-summary.html">com.google.android.gms.panorama</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/plus/package-summary.html">com.google.android.gms.plus</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/plus/model/moments/package-summary.html">com.google.android.gms.plus.model.moments</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/plus/model/people/package-summary.html">com.google.android.gms.plus.model.people</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/security/package-summary.html">com.google.android.gms.security</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/tagmanager/package-summary.html">com.google.android.gms.tagmanager</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/wallet/package-summary.html">com.google.android.gms.wallet</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/wallet/fragment/package-summary.html">com.google.android.gms.wallet.fragment</a></li>
<li class="api apilevel-">
<a href="../../../../../../reference/com/google/android/gms/wearable/package-summary.html">com.google.android.gms.wearable</a></li>
</ul><br/>
</div> <!-- end packages-nav -->
</div> <!-- end resize-packages -->
<div id="classes-nav" class="scroll-pane">
<ul>
<li><h2>Interfaces</h2>
<ul>
<li class="api apilevel-"><a href="../../../../../../reference/com/google/android/gms/common/GooglePlayServicesClient.html">GooglePlayServicesClient</a></li>
<li class="api apilevel-"><a href="../../../../../../reference/com/google/android/gms/common/GooglePlayServicesClient.ConnectionCallbacks.html">GooglePlayServicesClient.ConnectionCallbacks</a></li>
<li class="api apilevel-"><a href="../../../../../../reference/com/google/android/gms/common/GooglePlayServicesClient.OnConnectionFailedListener.html">GooglePlayServicesClient.OnConnectionFailedListener</a></li>
</ul>
</li>
<li><h2>Classes</h2>
<ul>
<li class="api apilevel-"><a href="../../../../../../reference/com/google/android/gms/common/AccountPicker.html">AccountPicker</a></li>
<li class="api apilevel-"><a href="../../../../../../reference/com/google/android/gms/common/ConnectionResult.html">ConnectionResult</a></li>
<li class="api apilevel-"><a href="../../../../../../reference/com/google/android/gms/common/ErrorDialogFragment.html">ErrorDialogFragment</a></li>
<li class="api apilevel-"><a href="../../../../../../reference/com/google/android/gms/common/GooglePlayServicesUtil.html">GooglePlayServicesUtil</a></li>
<li class="api apilevel-"><a href="../../../../../../reference/com/google/android/gms/common/Scopes.html">Scopes</a></li>
<li class="api apilevel-"><a href="../../../../../../reference/com/google/android/gms/common/SignInButton.html">SignInButton</a></li>
<li class="api apilevel-"><a href="../../../../../../reference/com/google/android/gms/common/SupportErrorDialogFragment.html">SupportErrorDialogFragment</a></li>
</ul>
</li>
<li><h2>Exceptions</h2>
<ul>
<li class="api apilevel-"><a href="../../../../../../reference/com/google/android/gms/common/GooglePlayServicesNotAvailableException.html">GooglePlayServicesNotAvailableException</a></li>
<li class="api apilevel-"><a href="../../../../../../reference/com/google/android/gms/common/GooglePlayServicesRepairableException.html">GooglePlayServicesRepairableException</a></li>
<li class="selected api apilevel-"><a href="../../../../../../reference/com/google/android/gms/common/UserRecoverableException.html">UserRecoverableException</a></li>
</ul>
</li>
</ul><br/>
</div><!-- end classes -->
</div><!-- end nav-panels -->
<div id="nav-tree" style="display:none" class="scroll-pane">
<div id="tree-list"></div>
</div><!-- end nav-tree -->
</div><!-- end swapper -->
<div id="nav-swap">
<a class="fullscreen">fullscreen</a>
<a href='#' onclick='swapNav();return false;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>
</div>
</div> <!-- end devdoc-nav -->
</div> <!-- end side-nav -->
<script type="text/javascript">
// init fullscreen based on user pref
var fullscreen = readCookie("fullscreen");
if (fullscreen != 0) {
if (fullscreen == "false") {
toggleFullscreen(false);
} else {
toggleFullscreen(true);
}
}
// init nav version for mobile
if (isMobile) {
swapNav(); // tree view should be used on mobile
$('#nav-swap').hide();
} else {
chooseDefaultNav();
if ($("#nav-tree").is(':visible')) {
init_default_navtree("../../../../../../");
}
}
// scroll the selected page into view
$(document).ready(function() {
scrollIntoView("packages-nav");
scrollIntoView("classes-nav");
});
</script>
<div class="col-12" id="doc-col">
<div id="api-info-block">
<div class="sum-details-links">
Summary:
<a href="#pubctors">Ctors</a>
| <a href="#pubmethods">Methods</a>
| <a href="#inhmethods">Inherited Methods</a>
| <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a>
</div><!-- end sum-details-links -->
<div class="api-level">
</div>
</div><!-- end api-info-block -->
<!-- ======== START OF CLASS DATA ======== -->
<div id="jd-header">
public
class
<h1 itemprop="name">UserRecoverableException</h1>
extends <a href="http://developer.android.com/reference/java/lang/Exception.html">Exception</a><br/>
</div><!-- end header -->
<div id="naMessage"></div>
<div id="jd-content" class="api apilevel-">
<table class="jd-inheritance-table">
<tr>
<td colspan="4" class="jd-inheritance-class-cell"><a href="http://developer.android.com/reference/java/lang/Object.html">java.lang.Object</a></td>
</tr>
<tr>
<td class="jd-inheritance-space"> ↳</td>
<td colspan="3" class="jd-inheritance-class-cell"><a href="http://developer.android.com/reference/java/lang/Throwable.html">java.lang.Throwable</a></td>
</tr>
<tr>
<td class="jd-inheritance-space"> </td>
<td class="jd-inheritance-space"> ↳</td>
<td colspan="2" class="jd-inheritance-class-cell"><a href="http://developer.android.com/reference/java/lang/Exception.html">java.lang.Exception</a></td>
</tr>
<tr>
<td class="jd-inheritance-space"> </td>
<td class="jd-inheritance-space"> </td>
<td class="jd-inheritance-space"> ↳</td>
<td colspan="1" class="jd-inheritance-class-cell">com.google.android.gms.common.UserRecoverableException</td>
</tr>
</table>
<table class="jd-sumtable jd-sumtable-subclasses"><tr><td colspan="12" style="border:none;margin:0;padding:0;">
<a href="#" onclick="return toggleInherited(this, null)" id="subclasses-direct" class="jd-expando-trigger closed"
><img id="subclasses-direct-trigger"
src="../../../../../../assets/images/triangle-closed.png"
class="jd-expando-trigger-img" /></a>Known Direct Subclasses
<div id="subclasses-direct">
<div id="subclasses-direct-list"
class="jd-inheritedlinks"
>
<a href="../../../../../../reference/com/google/android/gms/common/GooglePlayServicesRepairableException.html">GooglePlayServicesRepairableException</a>
</div>
<div id="subclasses-direct-summary"
style="display: none;"
>
<table class="jd-sumtable-expando">
<tr class="alt-color api apilevel-" >
<td class="jd-linkcol"><a href="../../../../../../reference/com/google/android/gms/common/GooglePlayServicesRepairableException.html">GooglePlayServicesRepairableException</a></td>
<td class="jd-descrcol" width="100%">GooglePlayServicesRepairableExceptions are special instances of
<code><a href="../../../../../../reference/com/google/android/gms/common/UserRecoverableException.html">UserRecoverableException</a></code>s which are thrown when Google Play Services is not installed,
up-to-date, or enabled. </td>
</tr>
</table>
</div>
</div>
</td></tr></table>
<div class="jd-descr">
<h2>Class Overview</h2>
<p itemprop="articleBody">UserRecoverableExceptions signal errors that can be recovered with user
action, such as a user login.
</p>
</div><!-- jd-descr -->
<div class="jd-descr">
<h2>Summary</h2>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../../../../reference/com/google/android/gms/common/UserRecoverableException.html#UserRecoverableException(java.lang.String, android.content.Intent)">UserRecoverableException</a></span>(<a href="http://developer.android.com/reference/java/lang/String.html">String</a> msg, <a href="http://developer.android.com/reference/android/content/Intent.html">Intent</a> intent)</nobr>
</td></tr>
</table>
<!-- ========== METHOD SUMMARY =========== -->
<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
<a href="http://developer.android.com/reference/android/content/Intent.html">Intent</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad"><a href="../../../../../../reference/com/google/android/gms/common/UserRecoverableException.html#getIntent()">getIntent</a></span>()</nobr>
<div class="jd-descrdiv">Getter for an <code><a href="http://developer.android.com/reference/android/content/Intent.html">Intent</a></code> that when supplied to <code><a href="http://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)">startActivityForResult(Intent, int)</a></code>, will allow user intervention.</div>
</td></tr>
</table>
<!-- ========== METHOD SUMMARY =========== -->
<table id="inhmethods" class="jd-sumtable"><tr><th>
<a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a>
<div style="clear:left;">Inherited Methods</div></th></tr>
<tr class="api apilevel-" >
<td colspan="12">
<a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Throwable" class="jd-expando-trigger closed"
><img id="inherited-methods-java.lang.Throwable-trigger"
src="../../../../../../assets/images/triangle-closed.png"
class="jd-expando-trigger-img" /></a>
From class
<a href="http://developer.android.com/reference/java/lang/Throwable.html">java.lang.Throwable</a>
<div id="inherited-methods-java.lang.Throwable">
<div id="inherited-methods-java.lang.Throwable-list"
class="jd-inheritedlinks">
</div>
<div id="inherited-methods-java.lang.Throwable-summary" style="display: none;">
<table class="jd-sumtable-expando">
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">addSuppressed</span>(<a href="http://developer.android.com/reference/java/lang/Throwable.html">Throwable</a> arg0)</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
<a href="http://developer.android.com/reference/java/lang/Throwable.html">Throwable</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">fillInStackTrace</span>()</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
<a href="http://developer.android.com/reference/java/lang/Throwable.html">Throwable</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">getCause</span>()</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
<a href="http://developer.android.com/reference/java/lang/String.html">String</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">getLocalizedMessage</span>()</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
<a href="http://developer.android.com/reference/java/lang/String.html">String</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">getMessage</span>()</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
<a href="http://developer.android.com/reference/java/lang/StackTraceElement.html">StackTraceElement[]</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">getStackTrace</span>()</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
final
<a href="http://developer.android.com/reference/java/lang/Throwable.html">Throwable[]</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">getSuppressed</span>()</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
<a href="http://developer.android.com/reference/java/lang/Throwable.html">Throwable</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">initCause</span>(<a href="http://developer.android.com/reference/java/lang/Throwable.html">Throwable</a> arg0)</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">printStackTrace</span>(<a href="http://developer.android.com/reference/java/io/PrintStream.html">PrintStream</a> arg0)</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">printStackTrace</span>(<a href="http://developer.android.com/reference/java/io/PrintWriter.html">PrintWriter</a> arg0)</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">printStackTrace</span>()</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">setStackTrace</span>(<a href="http://developer.android.com/reference/java/lang/StackTraceElement.html">StackTraceElement[]</a> arg0)</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
<a href="http://developer.android.com/reference/java/lang/String.html">String</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">toString</span>()</nobr>
</td></tr>
</table>
</div>
</div>
</td></tr>
<tr class="api apilevel-" >
<td colspan="12">
<a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed"
><img id="inherited-methods-java.lang.Object-trigger"
src="../../../../../../assets/images/triangle-closed.png"
class="jd-expando-trigger-img" /></a>
From class
<a href="http://developer.android.com/reference/java/lang/Object.html">java.lang.Object</a>
<div id="inherited-methods-java.lang.Object">
<div id="inherited-methods-java.lang.Object-list"
class="jd-inheritedlinks">
</div>
<div id="inherited-methods-java.lang.Object-summary" style="display: none;">
<table class="jd-sumtable-expando">
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
<a href="http://developer.android.com/reference/java/lang/Object.html">Object</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">clone</span>()</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
boolean</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">equals</span>(<a href="http://developer.android.com/reference/java/lang/Object.html">Object</a> arg0)</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">finalize</span>()</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
final
<a href="http://developer.android.com/reference/java/lang/Class.html">Class</a><?></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">getClass</span>()</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
int</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">hashCode</span>()</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">notify</span>()</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">notifyAll</span>()</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
<a href="http://developer.android.com/reference/java/lang/String.html">String</a></nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">toString</span>()</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">wait</span>()</nobr>
</td></tr>
<tr class=" api apilevel-" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">wait</span>(long arg0, int arg1)</nobr>
</td></tr>
<tr class="alt-color api apilevel-" >
<td class="jd-typecol"><nobr>
final
void</nobr>
</td>
<td class="jd-linkcol" width="100%"><nobr>
<span class="sympad">wait</span>(long arg0)</nobr>
</td></tr>
</table>
</div>
</div>
</td></tr>
</table>
</div><!-- jd-descr (summary) -->
<!-- Details -->
<!-- XML Attributes -->
<!-- Enum Values -->
<!-- Constants -->
<!-- Fields -->
<!-- Public ctors -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<h2>Public Constructors</h2>
<A NAME="UserRecoverableException(java.lang.String, android.content.Intent)"></A>
<div class="jd-details api apilevel-">
<h4 class="jd-details-title">
<span class="normal">
public
</span>
<span class="sympad">UserRecoverableException</span>
<span class="normal">(<a href="http://developer.android.com/reference/java/lang/String.html">String</a> msg, <a href="http://developer.android.com/reference/android/content/Intent.html">Intent</a> intent)</span>
</h4>
<div class="api-level">
<div></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p></p></div>
</div>
</div>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- Protected ctors -->
<!-- ========= METHOD DETAIL ======== -->
<!-- Public methdos -->
<h2>Public Methods</h2>
<A NAME="getIntent()"></A>
<div class="jd-details api apilevel-">
<h4 class="jd-details-title">
<span class="normal">
public
<a href="http://developer.android.com/reference/android/content/Intent.html">Intent</a>
</span>
<span class="sympad">getIntent</span>
<span class="normal">()</span>
</h4>
<div class="api-level">
<div></div>
</div>
<div class="jd-details-descr">
<div class="jd-tagdata jd-tagdescr"><p>Getter for an <code><a href="http://developer.android.com/reference/android/content/Intent.html">Intent</a></code> that when supplied to <code><a href="http://developer.android.com/reference/android/app/Activity.html#startActivityForResult(android.content.Intent, int)">startActivityForResult(Intent, int)</a></code>, will allow user intervention.</p></div>
<div class="jd-tagdata">
<h5 class="jd-tagtitle">Returns</h5>
<ul class="nolist"><li>Intent representing the ameliorating user action.
</li></ul>
</div>
</div>
</div>
<!-- ========= METHOD DETAIL ======== -->
<!-- ========= END OF CLASS DATA ========= -->
<A NAME="navbar_top"></A>
<div id="footer" class="wrap" >
<div id="copyright">
Except as noted, this content is licensed under <a
href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>.
For details and restrictions, see the <a href="../../../../../../license.html">
Content License</a>.
</div>
<div id="build_info">
Android GmsCore 1501030 r —
<script src="../../../../../../timestamp.js" type="text/javascript"></script>
<script>document.write(BUILD_TIMESTAMP)</script>
</div>
<div id="footerlinks">
<p>
<a href="../../../../../../about/index.html">About Android</a> |
<a href="../../../../../../legal.html">Legal</a> |
<a href="../../../../../../support.html">Support</a>
</p>
</div>
</div> <!-- end footer -->
</div> <!-- jd-content -->
</div><!-- end doc-content -->
</div> <!-- end body-content -->
</body>
</html>
|
gudnam/bringluck
|
google_play_services/docs/reference/com/google/android/gms/common/UserRecoverableException.html
|
HTML
|
apache-2.0
| 47,680
|
package org.ovirt.engine.ui.webadmin.section.main.presenter.tab.cluster;
import org.ovirt.engine.core.common.businessentities.Cluster;
import org.ovirt.engine.ui.common.place.PlaceRequestFactory;
import org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter;
import org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider;
import org.ovirt.engine.ui.uicommonweb.models.HasEntity;
import org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel;
import org.ovirt.engine.ui.uicommonweb.place.WebAdminApplicationPlaces;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.GwtEvent.Type;
import com.gwtplatform.mvp.client.proxy.PlaceManager;
import com.gwtplatform.mvp.client.proxy.RevealContentHandler;
import com.gwtplatform.mvp.client.proxy.TabContentProxyPlace;
import com.gwtplatform.mvp.shared.proxy.PlaceRequest;
public abstract class AbstractSubTabClusterPresenter <D extends HasEntity<?>,
V extends AbstractSubTabPresenter.ViewDef<Cluster>, P extends TabContentProxyPlace<?>>
extends AbstractSubTabPresenter <Cluster, ClusterListModel<Void>, D, V, P>{
public AbstractSubTabClusterPresenter(EventBus eventBus, V view, P proxy, PlaceManager placeManager,
DetailModelProvider<ClusterListModel<Void>, D> modelProvider, ClusterMainTabSelectedItems selectedItems,
Type<RevealContentHandler<?>> slot) {
super(eventBus, view, proxy, placeManager, modelProvider, selectedItems, slot);
}
@Override
protected PlaceRequest getMainTabRequest() {
return PlaceRequestFactory.get(WebAdminApplicationPlaces.clusterMainTabPlace);
}
}
|
OpenUniversity/ovirt-engine
|
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/presenter/tab/cluster/AbstractSubTabClusterPresenter.java
|
Java
|
apache-2.0
| 1,647
|
import { module } from 'angular';
import { react2angular } from 'react2angular';
import { withErrorBoundary } from '@spinnaker/core';
import { ManifestSelector } from './ManifestSelector';
export const KUBERNETES_MANIFEST_SELECTOR = 'spinnaker.kubernetes.v2.manifest.selector.component';
module(KUBERNETES_MANIFEST_SELECTOR, []).component(
'kubernetesManifestSelector',
react2angular(withErrorBoundary(ManifestSelector, 'kubernetesManifestSelector'), [
'selector',
'modes',
'application',
'onChange',
]),
);
|
spinnaker/deck
|
packages/kubernetes/src/manifest/selector/selector.component.ts
|
TypeScript
|
apache-2.0
| 533
|
package com.jimmy.model;
public class MapChartPluginEntity {
private String id;
private String value;
//
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
|
jimmyLian001/SpringLearn
|
src/main/java/com/jimmy/model/MapChartPluginEntity.java
|
Java
|
apache-2.0
| 377
|
/*
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH
* under one or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information regarding copyright
* ownership. Camunda licenses this file to you under the Apache License,
* Version 2.0; you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.camunda.bpm.engine.impl.batch.externaltask;
import java.util.List;
import org.camunda.bpm.engine.batch.Batch;
import org.camunda.bpm.engine.impl.batch.AbstractBatchJobHandler;
import org.camunda.bpm.engine.impl.batch.BatchJobConfiguration;
import org.camunda.bpm.engine.impl.batch.BatchJobContext;
import org.camunda.bpm.engine.impl.batch.BatchJobDeclaration;
import org.camunda.bpm.engine.impl.batch.SetRetriesBatchConfiguration;
import org.camunda.bpm.engine.impl.interceptor.CommandContext;
import org.camunda.bpm.engine.impl.jobexecutor.JobDeclaration;
import org.camunda.bpm.engine.impl.persistence.entity.ByteArrayEntity;
import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity;
import org.camunda.bpm.engine.impl.persistence.entity.MessageEntity;
public class SetExternalTaskRetriesJobHandler extends AbstractBatchJobHandler<SetRetriesBatchConfiguration> {
public static final BatchJobDeclaration JOB_DECLARATION = new BatchJobDeclaration(Batch.TYPE_SET_EXTERNAL_TASK_RETRIES);
@Override
public String getType() {
return Batch.TYPE_SET_EXTERNAL_TASK_RETRIES;
}
@Override
public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) {
ByteArrayEntity configurationEntity = commandContext
.getDbEntityManager()
.selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId());
SetRetriesBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes());
boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers();
commandContext.disableUserOperationLog();
commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true);
try {
commandContext.getProcessEngineConfiguration()
.getExternalTaskService()
.setRetries(batchConfiguration.getIds(), batchConfiguration.getRetries());
} finally {
commandContext.enableUserOperationLog();
commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions);
}
commandContext.getByteArrayManager().delete(configurationEntity);
}
@Override
public JobDeclaration<BatchJobContext, MessageEntity> getJobDeclaration() {
return JOB_DECLARATION;
}
@Override
protected SetRetriesBatchConfiguration createJobConfiguration(SetRetriesBatchConfiguration configuration,
List<String> processIdsForJob) {
return new SetRetriesBatchConfiguration(processIdsForJob, configuration.getRetries());
}
@Override
protected SetExternalTaskRetriesBatchConfigurationJsonConverter getJsonConverterInstance() {
return SetExternalTaskRetriesBatchConfigurationJsonConverter.INSTANCE;
}
}
|
falko/camunda-bpm-platform
|
engine/src/main/java/org/camunda/bpm/engine/impl/batch/externaltask/SetExternalTaskRetriesJobHandler.java
|
Java
|
apache-2.0
| 3,576
|
---
layout: home
photo_url: "/assets/images/fb_photo.jpg"
---
<article class="home">
<section id="contenedor_front_main" style="height: 606px;">
<div class="contenedor_name_app">
<h1 class="name_app">{{ site.title }}</h1>
</div>
<div class="contenedor_text_pasion">
<p class="pasion">Esto es lo que me apasiona y voy a seguir haciéndolo hasta que Dios lo permita</p>
</div>
</section>
<div class="page-content">
<div class="wrapper">
<section class="contenedor_eslogan">
<div class="slider">
<div id="s1" class="s_element">
<span>No soy brillante pero todos tenemos la capacidad de mejorar!</span>
</div>
<div id="s2" class="s_element">
<span>Cada día se aprende algo nuevo.</span>
</div>
<div id="s3" class="s_element s_visible">
<span>La memoria es como el mal amigo; cuando más falta te hace, te falla.</span>
</div>
<div id="s4" class="s_element">
<span>Dios aprieta, pero no ahoga</span>
</div>
</div>
</section>
<section class="estado_01luisrene">
<h2 class="titulo_estado_emocional titulo_seccion">Estado emocional</h2>
<div id="img_estado">
<i class="fa fa-5x carita fa-smile-o"></i>
</div>
</section>
<section class="datos_personales">
<h2 class="titulo_seccion">Datos Personales</h2>
<div class="wrap">
<table class="lista_datos_personales">
<tr>
<td>
<i class="fa fa-black-tie fa-2x traje"></i>
</td>
<td>
<p>Luis Rene Mas Mas</p>
</td>
</tr>
<tr>
<td>
<i class="fa fa-mars fa-2x sexo"></i>
</td>
<td><p>Masculino</p></td>
</tr>
<tr>
<td>
<i class="fa fa-heart fa-2x corazon"></i>
</td>
<td><p>Casado con: </p><a href="https://twitter.com/Danythza_ayd" title="Mi linda esposa" target="_blank">Danythza</a>
</td>
</tr>
<tr>
<td>
<i class="fa fa-graduation-cap fa-2x graduacion"></i>
</td>
<td><p>Técnico en Computación e Informática</p></td>
</tr>
<tr>
<td>
<i class="fa fa-briefcase fa-2x maletin"></i>
</td>
<td><p>Instituto Nacional Penitenciario</p></td>
</tr>
<tr>
<td>
<i class="fa fa-birthday-cake fa-2x cake"></i>
</td>
<td><p>21 de Junio</p></td>
</tr>
<tr>
<td>
<i class="fa fa-mobile fa-2x phone"></i>
</td>
<td>
<span id="movistar" title="Movistar">+051 954336108</span> <span id="claro" class="hidden" title="Claro">+051 00000000</span>
</td>
</tr>
<tr>
<td>
<i class="fa fa-map-marker fa-2x ubicacion"></i>
</td>
<td>
<address><p> Chachapoyas - Amazonas -Perú</p></address>
</td>
</tr>
</table>
</div> <!-- fin de wrap -->
</section>
<section class="estudios_realizados">
<h2 class="titulo_seccion">Formación Académica</h2>
<div class="wrap">
<ul class="lista_estudios_realizados">
<li>
<p> Institución Educativa N° 18003 "Santa Rosa" - Chachapoyas</p>
</li>
<li>
<p> Institución Educativa “Santiago Antúnez de Mayolo” - Chachapoyas</p></li>
<li class="graduacion_instituto">
<p> Instituto de Educación Superior Público "Perú-Japón" - Chachapoyas</p>
</li>
</ul>
</div> <!--fin wrap-->
</section>
<section class="conocimientos">
<h2 class="titulo_seccion">Conocimientos</h2>
<div class="wrap">
<p>No soy un guru pero desarrollo aplicaciones hermosas...!</p>
<div class="tecnologias_web">
<h3>Tecnologías Web:</h3>
<ul>
<li>
<i class="fa fa-battery-full fa-2x bateria-full"></i>
<p> HTML5</p>
</li>
<li>
<i class="fa fa-battery-full fa-2x bateria-full"></i>
<p> CSS3</p></li>
<li>
<i class="fa fa-battery-full fa-2x bateria-full"></i>
<p> LESS</p></li>
<li>
<i class="fa fa-battery-full fa-2x bateria-full"></i>
<p> JavaScript</p>
</li>
<li>
<i class="fa fa-battery-half fa-2x bateria-half"></i>
<p> NODE.js</p>
</li>
<!-- <li>
<i class="fa fa-battery-half fa-2x bateria-half"></i>
<p> PYTHON</p>
</li> -->
<li>
<i class="fa fa-battery-half fa-2x bateria-half"></i>
<p> PHP</p>
</li>
</ul>
</div>
<div class="tecnologias_web">
<h3>Frameworks:</h3>
<ul>
<!-- <li>
<i class="fa fa-battery-empty fa-2x bateria-empty"></i>
<p> Django</p>
</li> -->
<li>
<i class="fa fa-battery-full fa-2x bateria-full"></i>
<p> Ghost</p>
</li>
<li>
<i class="fa fa-battery-full fa-2x bateria-full"></i>
<p> WordPress</p>
</li>
<li>
<i class="fa fa-battery-full fa-2x bateria-full"></i>
<p> Jekyll</p>
</li>
<li>
<i class="fa fa-battery-full fa-2x bateria-full"></i>
<p> Bootstrap</p>
</li>
</ul>
</div>
<div class="tecnologias_web">
<h3>Librerías:</h3>
<ul>
<li>
<i class="fa fa-battery-full fa-2x bateria-full"></i>
<p> jQuery</p>
</li>
</ul>
</div>
<div class="tecnologias_web">
<h3>Sistemas de gestión de DB:</h3>
<ul>
<li>
<i class="fa fa-database fa-2x db"></i>
<p> MySQL</p>
</li>
<li>
<i class="fa fa-database fa-2x db"></i>
<p> MongoDB</p>
</li>
</ul>
</div>
<div class="tecnologias_web">
<h3>Sistemas Operativos que utilizo:</h3>
<ul>
<li>
<i class="fa fa-windows fa-2x windows"></i>
<p> Windows</p>
</li>
<li>
<i class="fa fa-linux fa-2x linux"></i>
<p> Ubuntu</p>
</li>
</ul>
</div>
</div> <!-- fin de wrap -->
</section>
<section class="redes_sociales">
<h2 class="titulo_seccion">Redes Sociales</h2>
<div class="wrap">
<ul class="lista_redes_sociales">
<li>
<a href="https://www.facebook.com/01luisrene" title="Facebook" target="_blank" class="facebook">
<i class="fa fa-facebook-official fa-3x"></i>
</a>
</li>
<li>
<a href="https://plus.google.com/+01luisrene/about" title="Google Plus" target="_blank" class="google">
<i class="fa fa-google-plus-square fa-3x"></i>
</a>
</li>
<li>
<a href="https://twitter.com/01luisrene" title="Twitter" target="_blank" class="twitter">
<i class="fa fa-twitter-square fa-3x"></i>
</a>
</li>
<li>
<a href="cel:+051-954336108" target="_blank" title="Whatsapp" class="whatsapp">
<i class="fa fa-whatsapp fa-3x"></i>
</a>
</li>
<li>
<a href="https://www.youtube.com/user/01luisrene" title="YouTube" target="_blank" class="youtube">
<i class="fa fa-youtube-square fa-3x"></i>
</a>
</li>
<li>
<a href="mailto:01luisrene@gmail.com" title="Escribeme" target="_blank" class="escribeme">
<i class="fa fa-envelope fa-3x"></i>
</a>
</li>
</ul>
</div><!-- fin de wrap -->
</section>
<section class="colaborador">
<h2 class="titulo_seccion">Colaborador en:</h2>
<div class="wrap">
<ul class="lista_colaborador_en">
<li>
<a href="https://github.com/01luisrene" target="_blank" class="github">
<i class="fa fa-github fa-3x"></i>
<p> GitHub</p>
</a>
</li>
</ul>
</div><!-- fin de wrap -->
</section>
<section class="sitios_webs">
<h2 class="titulo_seccion">Sitios Web</h2>
<div class="wrap">
<ul class="lista_sitios_webs">
<li>
<a href="http://01luisrene.com" title="http://01luisrene.com" target="_blank" class="cerounoluisrene">
<i class="fa fa-globe fa-2x"></i>
<p> 01luisrene.com</p>
</a>
</li>
</ul>
</div><!-- fin de wrap -->
</section>
<section class="lo_que_me_gusta">
<h2 class="titulo_seccion">Lo que me gusta:</h2>
<div class="wrap">
<table class="lista_lo_que_me_gusta">
<tr>
<td>
<i class="fa fa-terminal fa-2x hobbie"></i>
</td>
<td>
<p>Aprender tecnologías web, Móviles</p>
</td>
</tr>
<tr>
<td>
<i class="fa fa-music fa-2x hobbie"></i>
</td>
<td>
<p>Reggaeton, Electrónica, Cumbia, etc.</p>
</td>
</tr>
<tr>
<td>
<i class="fa fa-film fa-2x hobbie"></i>
</td>
<td>
<p>Acción, Comedia, Drama</p>
</td>
</tr>
<tr>
<td>
<i class="fa fa-cutlery fa-2x hobbie"></i>
</td>
<td>
<p>Cecina de res, Ceviche, Parihuela</p>
</td>
</tr>
<tr>
<td>
<i class="fa fa-sun-o fa-2x sol"></i>
</td>
<td>
<p>Ir a la playa con mi familia</p>
</td>
</tr>
</table>
</div><!-- fin de wrap -->
</section>
</div>
</div>
</article>
|
01luisrene/recursosWeb
|
01luisrene/01luisrene v1.0/index.html
|
HTML
|
apache-2.0
| 9,562
|
package org.oneman.utils.producer;
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.inject.Named;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Named
@Dependent
public class LoggerProducer {
@Produces
public Logger getLogger(InjectionPoint ip) {
return LoggerFactory.getLogger(ip.getMember().getDeclaringClass());
}
}
|
nobrooklyn/oneman
|
application/projects/oneman-utils/src/main/java/org/oneman/utils/producer/LoggerProducer.java
|
Java
|
apache-2.0
| 455
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Kiwi.Textures.SingleImage - Kiwi.js</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
<script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="../assets/css/logo.png" title="Kiwi.js"></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: 1.0.1</em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="../classes/Kiwi.Animations.Animation.html">Kiwi.Animations.Animation</a></li>
<li><a href="../classes/Kiwi.Animations.Sequence.html">Kiwi.Animations.Sequence</a></li>
<li><a href="../classes/Kiwi.Animations.Tween.html">Kiwi.Animations.Tween</a></li>
<li><a href="../classes/Kiwi.Animations.Tweens.Easing.Back.html">Kiwi.Animations.Tweens.Easing.Back</a></li>
<li><a href="../classes/Kiwi.Animations.Tweens.Easing.Bounce.html">Kiwi.Animations.Tweens.Easing.Bounce</a></li>
<li><a href="../classes/Kiwi.Animations.Tweens.Easing.Circular.html">Kiwi.Animations.Tweens.Easing.Circular</a></li>
<li><a href="../classes/Kiwi.Animations.Tweens.Easing.Cubic.html">Kiwi.Animations.Tweens.Easing.Cubic</a></li>
<li><a href="../classes/Kiwi.Animations.Tweens.Easing.Elastic.html">Kiwi.Animations.Tweens.Easing.Elastic</a></li>
<li><a href="../classes/Kiwi.Animations.Tweens.Easing.Exponential.html">Kiwi.Animations.Tweens.Easing.Exponential</a></li>
<li><a href="../classes/Kiwi.Animations.Tweens.Easing.Linear.html">Kiwi.Animations.Tweens.Easing.Linear</a></li>
<li><a href="../classes/Kiwi.Animations.Tweens.Easing.Quadratic.html">Kiwi.Animations.Tweens.Easing.Quadratic</a></li>
<li><a href="../classes/Kiwi.Animations.Tweens.Easing.Quartic.html">Kiwi.Animations.Tweens.Easing.Quartic</a></li>
<li><a href="../classes/Kiwi.Animations.Tweens.Easing.Quintic.html">Kiwi.Animations.Tweens.Easing.Quintic</a></li>
<li><a href="../classes/Kiwi.Animations.Tweens.Easing.Sinusoidal.html">Kiwi.Animations.Tweens.Easing.Sinusoidal</a></li>
<li><a href="../classes/Kiwi.Animations.Tweens.TweenManager.html">Kiwi.Animations.Tweens.TweenManager</a></li>
<li><a href="../classes/Kiwi.Camera.html">Kiwi.Camera</a></li>
<li><a href="../classes/Kiwi.CameraManager.html">Kiwi.CameraManager</a></li>
<li><a href="../classes/Kiwi.Component.html">Kiwi.Component</a></li>
<li><a href="../classes/Kiwi.ComponentManager.html">Kiwi.ComponentManager</a></li>
<li><a href="../classes/Kiwi.Components.AnimationManager.html">Kiwi.Components.AnimationManager</a></li>
<li><a href="../classes/Kiwi.Components.ArcadePhysics.html">Kiwi.Components.ArcadePhysics</a></li>
<li><a href="../classes/Kiwi.Components.Box.html">Kiwi.Components.Box</a></li>
<li><a href="../classes/Kiwi.Components.Input.html">Kiwi.Components.Input</a></li>
<li><a href="../classes/Kiwi.Components.Sound.html">Kiwi.Components.Sound</a></li>
<li><a href="../classes/Kiwi.Entity.html">Kiwi.Entity</a></li>
<li><a href="../classes/Kiwi.Files.DataLibrary.html">Kiwi.Files.DataLibrary</a></li>
<li><a href="../classes/Kiwi.Files.File.html">Kiwi.Files.File</a></li>
<li><a href="../classes/Kiwi.Files.FileStore.html">Kiwi.Files.FileStore</a></li>
<li><a href="../classes/Kiwi.Files.Loader.html">Kiwi.Files.Loader</a></li>
<li><a href="../classes/Kiwi.Game.html">Kiwi.Game</a></li>
<li><a href="../classes/Kiwi.GameManager.html">Kiwi.GameManager</a></li>
<li><a href="../classes/Kiwi.GameObjects.Sprite.html">Kiwi.GameObjects.Sprite</a></li>
<li><a href="../classes/Kiwi.GameObjects.StaticImage.html">Kiwi.GameObjects.StaticImage</a></li>
<li><a href="../classes/Kiwi.GameObjects.Textfield.html">Kiwi.GameObjects.Textfield</a></li>
<li><a href="../classes/Kiwi.GameObjects.Tilemap.TileMap.html">Kiwi.GameObjects.Tilemap.TileMap</a></li>
<li><a href="../classes/Kiwi.GameObjects.Tilemap.TileMapLayer.html">Kiwi.GameObjects.Tilemap.TileMapLayer</a></li>
<li><a href="../classes/Kiwi.GameObjects.Tilemap.TileType.html">Kiwi.GameObjects.Tilemap.TileType</a></li>
<li><a href="../classes/Kiwi.Geom.AABB.html">Kiwi.Geom.AABB</a></li>
<li><a href="../classes/Kiwi.Geom.Circle.html">Kiwi.Geom.Circle</a></li>
<li><a href="../classes/Kiwi.Geom.Intersect.html">Kiwi.Geom.Intersect</a></li>
<li><a href="../classes/Kiwi.Geom.IntersectResult.html">Kiwi.Geom.IntersectResult</a></li>
<li><a href="../classes/Kiwi.Geom.Line.html">Kiwi.Geom.Line</a></li>
<li><a href="../classes/Kiwi.Geom.Matrix.html">Kiwi.Geom.Matrix</a></li>
<li><a href="../classes/Kiwi.Geom.Point.html">Kiwi.Geom.Point</a></li>
<li><a href="../classes/Kiwi.Geom.Ray.html">Kiwi.Geom.Ray</a></li>
<li><a href="../classes/Kiwi.Geom.Rectangle.html">Kiwi.Geom.Rectangle</a></li>
<li><a href="../classes/Kiwi.Geom.Transform.html">Kiwi.Geom.Transform</a></li>
<li><a href="../classes/Kiwi.Geom.Vector2.html">Kiwi.Geom.Vector2</a></li>
<li><a href="../classes/Kiwi.Group.html">Kiwi.Group</a></li>
<li><a href="../classes/Kiwi.HUD.HUDComponents.Counter.html">Kiwi.HUD.HUDComponents.Counter</a></li>
<li><a href="../classes/Kiwi.HUD.HUDComponents.Time.html">Kiwi.HUD.HUDComponents.Time</a></li>
<li><a href="../classes/Kiwi.HUD.HUDComponents.WidgetInput.html">Kiwi.HUD.HUDComponents.WidgetInput</a></li>
<li><a href="../classes/Kiwi.HUD.HUDDisplay.html">Kiwi.HUD.HUDDisplay</a></li>
<li><a href="../classes/Kiwi.HUD.HUDManager.html">Kiwi.HUD.HUDManager</a></li>
<li><a href="../classes/Kiwi.HUD.HUDWidget.html">Kiwi.HUD.HUDWidget</a></li>
<li><a href="../classes/Kiwi.HUD.Widget.Bar.html">Kiwi.HUD.Widget.Bar</a></li>
<li><a href="../classes/Kiwi.HUD.Widget.BasicScore.html">Kiwi.HUD.Widget.BasicScore</a></li>
<li><a href="../classes/Kiwi.HUD.Widget.Button.html">Kiwi.HUD.Widget.Button</a></li>
<li><a href="../classes/Kiwi.HUD.Widget.Icon.html">Kiwi.HUD.Widget.Icon</a></li>
<li><a href="../classes/Kiwi.HUD.Widget.IconBar.html">Kiwi.HUD.Widget.IconBar</a></li>
<li><a href="../classes/Kiwi.HUD.Widget.Menu.html">Kiwi.HUD.Widget.Menu</a></li>
<li><a href="../classes/Kiwi.HUD.Widget.MenuItem.html">Kiwi.HUD.Widget.MenuItem</a></li>
<li><a href="../classes/Kiwi.HUD.Widget.TextField.html">Kiwi.HUD.Widget.TextField</a></li>
<li><a href="../classes/Kiwi.HUD.Widget.Time.html">Kiwi.HUD.Widget.Time</a></li>
<li><a href="../classes/Kiwi.IChild.html">Kiwi.IChild</a></li>
<li><a href="../classes/Kiwi.Input.Finger.html">Kiwi.Input.Finger</a></li>
<li><a href="../classes/Kiwi.Input.InputManager.html">Kiwi.Input.InputManager</a></li>
<li><a href="../classes/Kiwi.Input.Key.html">Kiwi.Input.Key</a></li>
<li><a href="../classes/Kiwi.Input.Keyboard.html">Kiwi.Input.Keyboard</a></li>
<li><a href="../classes/Kiwi.Input.Keycodes.html">Kiwi.Input.Keycodes</a></li>
<li><a href="../classes/Kiwi.Input.Mouse.html">Kiwi.Input.Mouse</a></li>
<li><a href="../classes/Kiwi.Input.MouseCursor.html">Kiwi.Input.MouseCursor</a></li>
<li><a href="../classes/Kiwi.Input.Pointer.html">Kiwi.Input.Pointer</a></li>
<li><a href="../classes/Kiwi.Input.Touch.html">Kiwi.Input.Touch</a></li>
<li><a href="../classes/Kiwi.PluginManager.html">Kiwi.PluginManager</a></li>
<li><a href="../classes/Kiwi.Renderers.CanvasRenderer.html">Kiwi.Renderers.CanvasRenderer</a></li>
<li><a href="../classes/Kiwi.Renderers.GLArrayBuffer.html">Kiwi.Renderers.GLArrayBuffer</a></li>
<li><a href="../classes/Kiwi.Renderers.GLElementArrayBuffer.html">Kiwi.Renderers.GLElementArrayBuffer</a></li>
<li><a href="../classes/Kiwi.Renderers.GLRenderManager.html">Kiwi.Renderers.GLRenderManager</a></li>
<li><a href="../classes/Kiwi.Renderers.GLTextureManager.html">Kiwi.Renderers.GLTextureManager</a></li>
<li><a href="../classes/Kiwi.Renderers.GLTextureWrapper.html">Kiwi.Renderers.GLTextureWrapper</a></li>
<li><a href="../classes/Kiwi.Renderers.Renderer.html">Kiwi.Renderers.Renderer</a></li>
<li><a href="../classes/Kiwi.Renderers.TextureAtlasRenderer.html">Kiwi.Renderers.TextureAtlasRenderer</a></li>
<li><a href="../classes/Kiwi.Shaders.ShaderManager.html">Kiwi.Shaders.ShaderManager</a></li>
<li><a href="../classes/Kiwi.Shaders.ShaderPair.html">Kiwi.Shaders.ShaderPair</a></li>
<li><a href="../classes/Kiwi.Shaders.TextureAtlasShader.html">Kiwi.Shaders.TextureAtlasShader</a></li>
<li><a href="../classes/Kiwi.Signal.html">Kiwi.Signal</a></li>
<li><a href="../classes/Kiwi.SignalBinding.html">Kiwi.SignalBinding</a></li>
<li><a href="../classes/Kiwi.Sound.Audio.html">Kiwi.Sound.Audio</a></li>
<li><a href="../classes/Kiwi.Sound.AudioLibrary.html">Kiwi.Sound.AudioLibrary</a></li>
<li><a href="../classes/Kiwi.Sound.AudioManager.html">Kiwi.Sound.AudioManager</a></li>
<li><a href="../classes/Kiwi.Stage.html">Kiwi.Stage</a></li>
<li><a href="../classes/Kiwi.State.html">Kiwi.State</a></li>
<li><a href="../classes/Kiwi.StateConfig.html">Kiwi.StateConfig</a></li>
<li><a href="../classes/Kiwi.StateManager.html">Kiwi.StateManager</a></li>
<li><a href="../classes/Kiwi.System.Bootstrap.html">Kiwi.System.Bootstrap</a></li>
<li><a href="../classes/Kiwi.System.Device.html">Kiwi.System.Device</a></li>
<li><a href="../classes/Kiwi.Textures.SingleImage.html">Kiwi.Textures.SingleImage</a></li>
<li><a href="../classes/Kiwi.Textures.SpriteSheet.html">Kiwi.Textures.SpriteSheet</a></li>
<li><a href="../classes/Kiwi.Textures.TextureAtlas.html">Kiwi.Textures.TextureAtlas</a></li>
<li><a href="../classes/Kiwi.Textures.TextureLibrary.html">Kiwi.Textures.TextureLibrary</a></li>
<li><a href="../classes/Kiwi.Time.Clock.html">Kiwi.Time.Clock</a></li>
<li><a href="../classes/Kiwi.Time.ClockManager.html">Kiwi.Time.ClockManager</a></li>
<li><a href="../classes/Kiwi.Time.MasterClock.html">Kiwi.Time.MasterClock</a></li>
<li><a href="../classes/Kiwi.Time.Timer.html">Kiwi.Time.Timer</a></li>
<li><a href="../classes/Kiwi.Time.TimerEvent.html">Kiwi.Time.TimerEvent</a></li>
<li><a href="../classes/Kiwi.Utils.Canvas.html">Kiwi.Utils.Canvas</a></li>
<li><a href="../classes/Kiwi.Utils.Common.html">Kiwi.Utils.Common</a></li>
<li><a href="../classes/Kiwi.Utils.GameMath.html">Kiwi.Utils.GameMath</a></li>
<li><a href="../classes/Kiwi.Utils.RandomDataGenerator.html">Kiwi.Utils.RandomDataGenerator</a></li>
<li><a href="../classes/Kiwi.Utils.RequestAnimationFrame.html">Kiwi.Utils.RequestAnimationFrame</a></li>
<li><a href="../classes/Kiwi.Utils.Version.html">Kiwi.Utils.Version</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="../modules/Animations.html">Animations</a></li>
<li><a href="../modules/Components.html">Components</a></li>
<li><a href="../modules/Easing.html">Easing</a></li>
<li><a href="../modules/Files.html">Files</a></li>
<li><a href="../modules/GameObjects.html">GameObjects</a></li>
<li><a href="../modules/Geom.html">Geom</a></li>
<li><a href="../modules/HUD.html">HUD</a></li>
<li><a href="../modules/HUDComponents.html">HUDComponents</a></li>
<li><a href="../modules/Input.html">Input</a></li>
<li><a href="../modules/Kiwi.html">Kiwi</a></li>
<li><a href="../modules/Renderers.html">Renderers</a></li>
<li><a href="../modules/Shaders.html">Shaders</a></li>
<li><a href="../modules/Sound.html">Sound</a></li>
<li><a href="../modules/System.html">System</a></li>
<li><a href="../modules/Textures.html">Textures</a></li>
<li><a href="../modules/Tilemap.html">Tilemap</a></li>
<li><a href="../modules/Time.html">Time</a></li>
<li><a href="../modules/Tweens.html">Tweens</a></li>
<li><a href="../modules/Utils.html">Utils</a></li>
<li><a href="../modules/Widget.html">Widget</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1>Kiwi.Textures.SingleImage Class</h1>
<div class="box meta">
<div class="extends">
Extends TextureAtlas
</div>
<div class="foundat">
Defined in: <a href="../files/src_textures_SingleImage.ts.html#l10"><code>src\textures\SingleImage.ts:10</code></a>
</div>
Module: <a href="../modules/Textures.html">Textures</a><br>
Parent Module: <a href="../modules/Kiwi.html">Kiwi</a>
</div>
<div class="box intro">
<p>A special type of TextureAtlas that is used when the user has loaded a single image. This type of TextureAtlas contains only one cell which is generally the whole width/height of the image and starts at the coordinates 0/0. A SingleImage has a space to store sequences but this will not be used.</p>
</div>
<div class="constructor">
<h2>Constructor</h2>
<div id="method_Kiwi.Textures.SingleImage" class="method item">
<h3 class="name"><code>Kiwi.Textures.SingleImage</code></h3>
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
<li class="arg">
<code>name</code>
</li>
<li class="arg">
<code>image</code>
</li>
<li class="arg">
<code class="optional">[width]</code>
</li>
<li class="arg">
<code class="optional">[height]</code>
</li>
<li class="arg">
<code class="optional">[offsetX]</code>
</li>
<li class="arg">
<code class="optional">[offsetY]</code>
</li>
</ul><span class="paren">)</span>
</div>
<span class="returns-inline">
<span class="type">Kiwi.SingleImage</span>
</span>
<div class="meta">
<p>
Defined in
<a href="../files/src_textures_SingleImage.ts.html#l10"><code>src\textures\SingleImage.ts:10</code></a>
</p>
</div>
<div class="description">
</div>
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
<li class="param">
<code class="param-name">name</code>
<span class="type">String</span>
<div class="param-description">
<p>The name of the single image</p>
</div>
</li>
<li class="param">
<code class="param-name">image</code>
<span class="type">HTMLImageElement/HTMLCanvasElement</span>
<div class="param-description">
<p>the image that is being used.</p>
</div>
</li>
<li class="param">
<code class="param-name optional">[width]</code>
<span class="type">Number</span>
<span class="flag optional" title="This parameter is optional.">optional</span>
<div class="param-description">
<p>the width of the image</p>
</div>
</li>
<li class="param">
<code class="param-name optional">[height]</code>
<span class="type">Number</span>
<span class="flag optional" title="This parameter is optional.">optional</span>
<div class="param-description">
<p>the height of the image</p>
</div>
</li>
<li class="param">
<code class="param-name optional">[offsetX]</code>
<span class="type">Number</span>
<span class="flag optional" title="This parameter is optional.">optional</span>
<div class="param-description">
<p>the offset of the image on the x axis. Useful if the image has a border that you don't want to show.</p>
</div>
</li>
<li class="param">
<code class="param-name optional">[offsetY]</code>
<span class="type">Number</span>
<span class="flag optional" title="This parameter is optional.">optional</span>
<div class="param-description">
<p>the offset of the image of the y axis. Useful if the image has a border that you don't want to show.</p>
</div>
</li>
</ul>
</div>
<div class="returns">
<h4>Returns:</h4>
<div class="returns-description">
<span class="type">Kiwi.SingleImage</span>:
</div>
</div>
</div>
</div>
<div id="classdocs" class="tabview">
<ul class="api-class-tabs">
<li class="api-class-tab index"><a href="#index">Index</a></li>
<li class="api-class-tab methods"><a href="#methods">Methods</a></li>
<li class="api-class-tab properties"><a href="#properties">Properties</a></li>
</ul>
<div>
<div id="index" class="api-class-tabpanel index">
<h2 class="off-left">Item Index</h2>
<div class="index-section methods">
<h3>Methods</h3>
<ul class="index-list methods extends">
<li class="index-item method public">
<a href="#method_generateAtlasCells">generateAtlasCells</a>
</li>
<li class="index-item method public">
<a href="#method_objType">objType</a>
</li>
</ul>
</div>
<div class="index-section properties">
<h3>Properties</h3>
<ul class="index-list properties extends">
<li class="index-item property private">
<a href="#property_height">height</a>
</li>
<li class="index-item property private">
<a href="#property_offsetX">offsetX</a>
</li>
<li class="index-item property private">
<a href="#property_offsetY">offsetY</a>
</li>
<li class="index-item property private">
<a href="#property_width">width</a>
</li>
</ul>
</div>
</div>
<div id="methods" class="api-class-tabpanel">
<h2 class="off-left">Methods</h2>
<div id="method_generateAtlasCells" class="method item public">
<h3 class="name"><code>generateAtlasCells</code></h3>
<span class="paren">()</span>
<span class="returns-inline">
<span class="type">Array</span>
</span>
<span class="flag public">public</span>
<div class="meta">
<p>
Defined in
<a href="../files/src_textures_SingleImage.ts.html#l78"><code>src\textures\SingleImage.ts:78</code></a>
</p>
</div>
<div class="description">
<p>This method generates the single image cell based off the information that was passed during instantion.</p>
</div>
<div class="returns">
<h4>Returns:</h4>
<div class="returns-description">
<span class="type">Array</span>:
</div>
</div>
</div>
<div id="method_objType" class="method item public">
<h3 class="name"><code>objType</code></h3>
<span class="paren">()</span>
<span class="returns-inline">
<span class="type"></span>
</span>
<span class="flag public">public</span>
<div class="meta">
<p>
Defined in
<a href="../files/src_textures_SingleImage.ts.html#l36"><code>src\textures\SingleImage.ts:36</code></a>
</p>
</div>
<div class="description">
<p>The type of object that this is.</p>
</div>
<div class="returns">
<h4>Returns:</h4>
<div class="returns-description">
<p>string</p>
</div>
</div>
</div>
</div>
<div id="properties" class="api-class-tabpanel">
<h2 class="off-left">Properties</h2>
<div id="property_height" class="property item private">
<h3 class="name"><code>height</code></h3>
<span class="type">Number</span>
<span class="flag private">private</span>
<div class="meta">
<p>
Defined in
<a href="../files/src_textures_SingleImage.ts.html#l54"><code>src\textures\SingleImage.ts:54</code></a>
</p>
</div>
<div class="description">
<p>The height of the image.</p>
</div>
</div>
<div id="property_offsetX" class="property item private">
<h3 class="name"><code>offsetX</code></h3>
<span class="type">Number</span>
<span class="flag private">private</span>
<div class="meta">
<p>
Defined in
<a href="../files/src_textures_SingleImage.ts.html#l62"><code>src\textures\SingleImage.ts:62</code></a>
</p>
</div>
<div class="description">
<p>The offset for the image on the X axis.</p>
</div>
</div>
<div id="property_offsetY" class="property item private">
<h3 class="name"><code>offsetY</code></h3>
<span class="type">Number</span>
<span class="flag private">private</span>
<div class="meta">
<p>
Defined in
<a href="../files/src_textures_SingleImage.ts.html#l70"><code>src\textures\SingleImage.ts:70</code></a>
</p>
</div>
<div class="description">
<p>The offset for the image on the Y axis.</p>
</div>
</div>
<div id="property_width" class="property item private">
<h3 class="name"><code>width</code></h3>
<span class="type">Number</span>
<span class="flag private">private</span>
<div class="meta">
<p>
Defined in
<a href="../files/src_textures_SingleImage.ts.html#l46"><code>src\textures\SingleImage.ts:46</code></a>
</p>
</div>
<div class="description">
<p>The width of the image.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
|
dfu23/swim-meet
|
lib/kiwi.js/docs/classes/Kiwi.Textures.SingleImage.html
|
HTML
|
apache-2.0
| 32,222
|
$(function() {
var resposta = $.ajax({
url:"http://localhost:8080/estados",
method: "GET",
dataType: "jsonp"//usado por estar em domínios diferentes
});
//A requisição Ajax pode demorar a retornar uma resposta
//com Promises é possível utilizar o método done() que executa
//assim que a requisição retornar uma resposta. Pode-se utilizar mais
//de uma vez.
resposta.done(function(estados) {
var comboEstado = $("#combo-estado");
//comboEstado.empty();
comboEstado.html("<option>Selecione o estado</option>")
estados.forEach(function(estado) {
//cria uma elemento 'option' e adiciona no select
var optionEstado = $("<option>").val(estado.uf).text(estado.nome);
comboEstado.append(optionEstado);
});
});
resposta.fail(function() {
alert("Erro carregando dados do servidor.");
});
});
|
fabiokamaral/algaworks-JavaScript
|
6 - JQuery/5 - Manipulando o DOM/manipulando_o_dom.js
|
JavaScript
|
apache-2.0
| 833
|
"""Tests for the SmartThings component init module."""
from uuid import uuid4
from aiohttp import ClientConnectionError, ClientResponseError
from asynctest import Mock, patch
from pysmartthings import InstalledAppStatus, OAuthToken
import pytest
from homeassistant.components import cloud, smartthings
from homeassistant.components.smartthings.const import (
CONF_CLOUDHOOK_URL, CONF_INSTALLED_APP_ID, CONF_REFRESH_TOKEN,
DATA_BROKERS, DOMAIN, EVENT_BUTTON, SIGNAL_SMARTTHINGS_UPDATE,
SUPPORTED_PLATFORMS)
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from tests.common import MockConfigEntry
async def test_migration_creates_new_flow(
hass, smartthings_mock, config_entry):
"""Test migration deletes app and creates new flow."""
config_entry.version = 1
config_entry.add_to_hass(hass)
await smartthings.async_migrate_entry(hass, config_entry)
await hass.async_block_till_done()
assert smartthings_mock.delete_installed_app.call_count == 1
assert smartthings_mock.delete_app.call_count == 1
assert not hass.config_entries.async_entries(DOMAIN)
flows = hass.config_entries.flow.async_progress()
assert len(flows) == 1
assert flows[0]['handler'] == 'smartthings'
assert flows[0]['context'] == {'source': 'import'}
async def test_unrecoverable_api_errors_create_new_flow(
hass, config_entry, smartthings_mock):
"""
Test a new config flow is initiated when there are API errors.
401 (unauthorized): Occurs when the access token is no longer valid.
403 (forbidden/not found): Occurs when the app or installed app could
not be retrieved/found (likely deleted?)
"""
config_entry.add_to_hass(hass)
smartthings_mock.app.side_effect = \
ClientResponseError(None, None, status=401)
# Assert setup returns false
result = await smartthings.async_setup_entry(hass, config_entry)
assert not result
# Assert entry was removed and new flow created
await hass.async_block_till_done()
assert not hass.config_entries.async_entries(DOMAIN)
flows = hass.config_entries.flow.async_progress()
assert len(flows) == 1
assert flows[0]['handler'] == 'smartthings'
assert flows[0]['context'] == {'source': 'import'}
hass.config_entries.flow.async_abort(flows[0]['flow_id'])
async def test_recoverable_api_errors_raise_not_ready(
hass, config_entry, smartthings_mock):
"""Test config entry not ready raised for recoverable API errors."""
config_entry.add_to_hass(hass)
smartthings_mock.app.side_effect = \
ClientResponseError(None, None, status=500)
with pytest.raises(ConfigEntryNotReady):
await smartthings.async_setup_entry(hass, config_entry)
async def test_scenes_api_errors_raise_not_ready(
hass, config_entry, app, installed_app, smartthings_mock):
"""Test if scenes are unauthorized we continue to load platforms."""
config_entry.add_to_hass(hass)
smartthings_mock.app.return_value = app
smartthings_mock.installed_app.return_value = installed_app
smartthings_mock.scenes.side_effect = \
ClientResponseError(None, None, status=500)
with pytest.raises(ConfigEntryNotReady):
await smartthings.async_setup_entry(hass, config_entry)
async def test_connection_errors_raise_not_ready(
hass, config_entry, smartthings_mock):
"""Test config entry not ready raised for connection errors."""
config_entry.add_to_hass(hass)
smartthings_mock.app.side_effect = ClientConnectionError()
with pytest.raises(ConfigEntryNotReady):
await smartthings.async_setup_entry(hass, config_entry)
async def test_base_url_no_longer_https_does_not_load(
hass, config_entry, app, smartthings_mock):
"""Test base_url no longer valid creates a new flow."""
hass.config.api.base_url = 'http://0.0.0.0'
config_entry.add_to_hass(hass)
smartthings_mock.app.return_value = app
# Assert setup returns false
result = await smartthings.async_setup_entry(hass, config_entry)
assert not result
async def test_unauthorized_installed_app_raises_not_ready(
hass, config_entry, app, installed_app,
smartthings_mock):
"""Test config entry not ready raised when the app isn't authorized."""
config_entry.add_to_hass(hass)
installed_app.installed_app_status = InstalledAppStatus.PENDING
smartthings_mock.app.return_value = app
smartthings_mock.installed_app.return_value = installed_app
with pytest.raises(ConfigEntryNotReady):
await smartthings.async_setup_entry(hass, config_entry)
async def test_scenes_unauthorized_loads_platforms(
hass, config_entry, app, installed_app,
device, smartthings_mock, subscription_factory):
"""Test if scenes are unauthorized we continue to load platforms."""
config_entry.add_to_hass(hass)
smartthings_mock.app.return_value = app
smartthings_mock.installed_app.return_value = installed_app
smartthings_mock.devices.return_value = [device]
smartthings_mock.scenes.side_effect = \
ClientResponseError(None, None, status=403)
mock_token = Mock()
mock_token.access_token.return_value = str(uuid4())
mock_token.refresh_token.return_value = str(uuid4())
smartthings_mock.generate_tokens.return_value = mock_token
subscriptions = [subscription_factory(capability)
for capability in device.capabilities]
smartthings_mock.subscriptions.return_value = subscriptions
with patch.object(hass.config_entries,
'async_forward_entry_setup') as forward_mock:
assert await smartthings.async_setup_entry(hass, config_entry)
# Assert platforms loaded
await hass.async_block_till_done()
assert forward_mock.call_count == len(SUPPORTED_PLATFORMS)
async def test_config_entry_loads_platforms(
hass, config_entry, app, installed_app,
device, smartthings_mock, subscription_factory, scene):
"""Test config entry loads properly and proxies to platforms."""
config_entry.add_to_hass(hass)
smartthings_mock.app.return_value = app
smartthings_mock.installed_app.return_value = installed_app
smartthings_mock.devices.return_value = [device]
smartthings_mock.scenes.return_value = [scene]
mock_token = Mock()
mock_token.access_token.return_value = str(uuid4())
mock_token.refresh_token.return_value = str(uuid4())
smartthings_mock.generate_tokens.return_value = mock_token
subscriptions = [subscription_factory(capability)
for capability in device.capabilities]
smartthings_mock.subscriptions.return_value = subscriptions
with patch.object(hass.config_entries,
'async_forward_entry_setup') as forward_mock:
assert await smartthings.async_setup_entry(hass, config_entry)
# Assert platforms loaded
await hass.async_block_till_done()
assert forward_mock.call_count == len(SUPPORTED_PLATFORMS)
async def test_config_entry_loads_unconnected_cloud(
hass, config_entry, app, installed_app,
device, smartthings_mock, subscription_factory, scene):
"""Test entry loads during startup when cloud isn't connected."""
config_entry.add_to_hass(hass)
hass.data[DOMAIN][CONF_CLOUDHOOK_URL] = "https://test.cloud"
hass.config.api.base_url = 'http://0.0.0.0'
smartthings_mock.app.return_value = app
smartthings_mock.installed_app.return_value = installed_app
smartthings_mock.devices.return_value = [device]
smartthings_mock.scenes.return_value = [scene]
mock_token = Mock()
mock_token.access_token.return_value = str(uuid4())
mock_token.refresh_token.return_value = str(uuid4())
smartthings_mock.generate_tokens.return_value = mock_token
subscriptions = [subscription_factory(capability)
for capability in device.capabilities]
smartthings_mock.subscriptions.return_value = subscriptions
with patch.object(
hass.config_entries, 'async_forward_entry_setup') as forward_mock:
assert await smartthings.async_setup_entry(hass, config_entry)
await hass.async_block_till_done()
assert forward_mock.call_count == len(SUPPORTED_PLATFORMS)
async def test_unload_entry(hass, config_entry):
"""Test entries are unloaded correctly."""
connect_disconnect = Mock()
smart_app = Mock()
smart_app.connect_event.return_value = connect_disconnect
broker = smartthings.DeviceBroker(
hass, config_entry, Mock(), smart_app, [], [])
broker.connect()
hass.data[DOMAIN][DATA_BROKERS][config_entry.entry_id] = broker
with patch.object(hass.config_entries, 'async_forward_entry_unload',
return_value=True) as forward_mock:
assert await smartthings.async_unload_entry(hass, config_entry)
assert connect_disconnect.call_count == 1
assert config_entry.entry_id not in hass.data[DOMAIN][DATA_BROKERS]
# Assert platforms unloaded
await hass.async_block_till_done()
assert forward_mock.call_count == len(SUPPORTED_PLATFORMS)
async def test_remove_entry(hass, config_entry, smartthings_mock):
"""Test that the installed app and app are removed up."""
# Act
await smartthings.async_remove_entry(hass, config_entry)
# Assert
assert smartthings_mock.delete_installed_app.call_count == 1
assert smartthings_mock.delete_app.call_count == 1
async def test_remove_entry_cloudhook(hass, config_entry, smartthings_mock):
"""Test that the installed app, app, and cloudhook are removed up."""
# Arrange
config_entry.add_to_hass(hass)
hass.data[DOMAIN][CONF_CLOUDHOOK_URL] = "https://test.cloud"
# Act
with patch.object(cloud, 'async_is_logged_in',
return_value=True) as mock_async_is_logged_in, \
patch.object(cloud, 'async_delete_cloudhook') \
as mock_async_delete_cloudhook:
await smartthings.async_remove_entry(hass, config_entry)
# Assert
assert smartthings_mock.delete_installed_app.call_count == 1
assert smartthings_mock.delete_app.call_count == 1
assert mock_async_is_logged_in.call_count == 1
assert mock_async_delete_cloudhook.call_count == 1
async def test_remove_entry_app_in_use(hass, config_entry, smartthings_mock):
"""Test app is not removed if in use by another config entry."""
# Arrange
config_entry.add_to_hass(hass)
data = config_entry.data.copy()
data[CONF_INSTALLED_APP_ID] = str(uuid4())
entry2 = MockConfigEntry(version=2, domain=DOMAIN, data=data)
entry2.add_to_hass(hass)
# Act
await smartthings.async_remove_entry(hass, config_entry)
# Assert
assert smartthings_mock.delete_installed_app.call_count == 1
assert smartthings_mock.delete_app.call_count == 0
async def test_remove_entry_already_deleted(
hass, config_entry, smartthings_mock):
"""Test handles when the apps have already been removed."""
# Arrange
smartthings_mock.delete_installed_app.side_effect = ClientResponseError(
None, None, status=403)
smartthings_mock.delete_app.side_effect = ClientResponseError(
None, None, status=403)
# Act
await smartthings.async_remove_entry(hass, config_entry)
# Assert
assert smartthings_mock.delete_installed_app.call_count == 1
assert smartthings_mock.delete_app.call_count == 1
async def test_remove_entry_installedapp_api_error(
hass, config_entry, smartthings_mock):
"""Test raises exceptions removing the installed app."""
# Arrange
smartthings_mock.delete_installed_app.side_effect = \
ClientResponseError(None, None, status=500)
# Act
with pytest.raises(ClientResponseError):
await smartthings.async_remove_entry(hass, config_entry)
# Assert
assert smartthings_mock.delete_installed_app.call_count == 1
assert smartthings_mock.delete_app.call_count == 0
async def test_remove_entry_installedapp_unknown_error(
hass, config_entry, smartthings_mock):
"""Test raises exceptions removing the installed app."""
# Arrange
smartthings_mock.delete_installed_app.side_effect = Exception
# Act
with pytest.raises(Exception):
await smartthings.async_remove_entry(hass, config_entry)
# Assert
assert smartthings_mock.delete_installed_app.call_count == 1
assert smartthings_mock.delete_app.call_count == 0
async def test_remove_entry_app_api_error(
hass, config_entry, smartthings_mock):
"""Test raises exceptions removing the app."""
# Arrange
smartthings_mock.delete_app.side_effect = \
ClientResponseError(None, None, status=500)
# Act
with pytest.raises(ClientResponseError):
await smartthings.async_remove_entry(hass, config_entry)
# Assert
assert smartthings_mock.delete_installed_app.call_count == 1
assert smartthings_mock.delete_app.call_count == 1
async def test_remove_entry_app_unknown_error(
hass, config_entry, smartthings_mock):
"""Test raises exceptions removing the app."""
# Arrange
smartthings_mock.delete_app.side_effect = Exception
# Act
with pytest.raises(Exception):
await smartthings.async_remove_entry(hass, config_entry)
# Assert
assert smartthings_mock.delete_installed_app.call_count == 1
assert smartthings_mock.delete_app.call_count == 1
async def test_broker_regenerates_token(
hass, config_entry):
"""Test the device broker regenerates the refresh token."""
token = Mock(OAuthToken)
token.refresh_token = str(uuid4())
stored_action = None
def async_track_time_interval(hass, action, interval):
nonlocal stored_action
stored_action = action
with patch('homeassistant.components.smartthings'
'.async_track_time_interval',
new=async_track_time_interval):
broker = smartthings.DeviceBroker(
hass, config_entry, token, Mock(), [], [])
broker.connect()
assert stored_action
await stored_action(None) # pylint:disable=not-callable
assert token.refresh.call_count == 1
assert config_entry.data[CONF_REFRESH_TOKEN] == token.refresh_token
async def test_event_handler_dispatches_updated_devices(
hass, config_entry, device_factory, event_request_factory,
event_factory):
"""Test the event handler dispatches updated devices."""
devices = [
device_factory('Bedroom 1 Switch', ['switch']),
device_factory('Bathroom 1', ['switch']),
device_factory('Sensor', ['motionSensor']),
device_factory('Lock', ['lock'])
]
device_ids = [devices[0].device_id, devices[1].device_id,
devices[2].device_id, devices[3].device_id]
event = event_factory(devices[3].device_id, capability='lock',
attribute='lock', value='locked',
data={'codeId': '1'})
request = event_request_factory(device_ids=device_ids, events=[event])
config_entry.data[CONF_INSTALLED_APP_ID] = request.installed_app_id
called = False
def signal(ids):
nonlocal called
called = True
assert device_ids == ids
async_dispatcher_connect(hass, SIGNAL_SMARTTHINGS_UPDATE, signal)
broker = smartthings.DeviceBroker(
hass, config_entry, Mock(), Mock(), devices, [])
broker.connect()
# pylint:disable=protected-access
await broker._event_handler(request, None, None)
await hass.async_block_till_done()
assert called
for device in devices:
assert device.status.values['Updated'] == 'Value'
assert devices[3].status.attributes['lock'].value == 'locked'
assert devices[3].status.attributes['lock'].data == {'codeId': '1'}
async def test_event_handler_ignores_other_installed_app(
hass, config_entry, device_factory, event_request_factory):
"""Test the event handler dispatches updated devices."""
device = device_factory('Bedroom 1 Switch', ['switch'])
request = event_request_factory([device.device_id])
called = False
def signal(ids):
nonlocal called
called = True
async_dispatcher_connect(hass, SIGNAL_SMARTTHINGS_UPDATE, signal)
broker = smartthings.DeviceBroker(
hass, config_entry, Mock(), Mock(), [device], [])
broker.connect()
# pylint:disable=protected-access
await broker._event_handler(request, None, None)
await hass.async_block_till_done()
assert not called
async def test_event_handler_fires_button_events(
hass, config_entry, device_factory, event_factory,
event_request_factory):
"""Test the event handler fires button events."""
device = device_factory('Button 1', ['button'])
event = event_factory(device.device_id, capability='button',
attribute='button', value='pushed')
request = event_request_factory(events=[event])
config_entry.data[CONF_INSTALLED_APP_ID] = request.installed_app_id
called = False
def handler(evt):
nonlocal called
called = True
assert evt.data == {
'component_id': 'main',
'device_id': device.device_id,
'location_id': event.location_id,
'value': 'pushed',
'name': device.label,
'data': None
}
hass.bus.async_listen(EVENT_BUTTON, handler)
broker = smartthings.DeviceBroker(
hass, config_entry, Mock(), Mock(), [device], [])
broker.connect()
# pylint:disable=protected-access
await broker._event_handler(request, None, None)
await hass.async_block_till_done()
assert called
|
jabesq/home-assistant
|
tests/components/smartthings/test_init.py
|
Python
|
apache-2.0
| 17,803
|
package entity;
import CrawlerSYS.utils.StringHelper;
import java.util.Date;
import java.util.List;
public class ShowEntity {
private int id;
private String name;
private String picture;
private Date startDate;
private Date endDate;
private LocationEntity locat;
private int MINprice;
private int MAXprice;
private int showtype;
private String info;
private List<String> url;
public ShowEntity(int id, String name, String picture, Date startDate,
Date endDate, LocationEntity locat, int mINprice, int mAXprice,
int showtype, String info, List<String> url) {
super();
this.id = id;
this.name = name;
this.picture = picture;
this.startDate = startDate;
this.endDate = endDate;
this.locat = locat;
MINprice = mINprice;
MAXprice = mAXprice;
this.showtype = showtype;
this.info = info;
this.url = url;
}
public ShowEntity() {
// TODO Auto-generated constructor stub
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPicture() {
return picture;
}
public void setPicture(String picture) {
this.picture = picture;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public LocationEntity getLocat() {
return locat;
}
public void setLocat(LocationEntity locat) {
this.locat = locat;
}
public int getMINprice() {
return MINprice;
}
public void setMINprice(int mINprice) {
MINprice = mINprice;
}
public int getMAXprice() {
return MAXprice;
}
public void setMAXprice(int mAXprice) {
MAXprice = mAXprice;
}
public int getShowtype() {
return showtype;
}
public void setShowtype(int showtype) {
this.showtype = showtype;
}
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info;
}
public List<String> getUrl() {
return url;
}
public void setUrl(List<String> url) {
this.url = url;
}
@Override
public String toString() {
return "ShowEntity [id=" + id + ", name=" + name + ", picture="
+ picture + ", startDate=" + startDate + ", endDate=" + endDate
+ ", locat=" + locat + ", MINprice=" + MINprice + ", MAXprice="
+ MAXprice + ", showtype=" + showtype + ", info=" + info
+ ", url=" + url + "]";
}
public String toJson() {
return "{ \"name\":\"" + name + "\", \"picture\":\""
+ picture + "\", \"startDate\":\"" + StringHelper.sqlDate(startDate) + "\", \"endDate\":\""
+ StringHelper.sqlDate(endDate)+ "\", \"locat\":\"" + locat.getName() + "\", \"MINprice\":\""
+ MINprice + "\", \"MAXprice\":\"" + MAXprice + "\", \"showtype\":\"" + showtype
+ "\", \"info\":\"" + info + "\", \"urls\":" + toUrl() + "}";
}
String toUrl(){
String ul="[";
for (int i = 0; i < url.size(); i++) {
ul+="{\"url\":\""+url.get(i)+"\"}";
if(i!=url.size()-1)
ul+=",";
}
return ul+="]";
}
}
|
zrtzrt/HeatPoint
|
src/entity/ShowEntity.java
|
Java
|
apache-2.0
| 3,120
|
/*
* JBoss, Home of Professional Open Source
* Copyright 2010, Red Hat, Inc. and/or its affiliates, and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.hibernate.validator.constraints.impl;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import javax.validation.constraints.Future;
import org.joda.time.ReadableInstant;
/**
* Check if Joda Time type who implements
* {@code import org.joda.time.ReadableInstant}
* is in the future.
*
* @author Kevin Pollet <kevin.pollet@serli.com> (C) 2011 SERLI
*/
public class FutureValidatorForReadableInstant implements ConstraintValidator<Future, ReadableInstant> {
public void initialize(Future constraintAnnotation) {
}
public boolean isValid(ReadableInstant value, ConstraintValidatorContext context) {
//null values are valid
if ( value == null ) {
return true;
}
return value.isAfter( null );
}
}
|
gastaldi/hibernate-validator
|
hibernate-validator/src/main/java/org/hibernate/validator/constraints/impl/FutureValidatorForReadableInstant.java
|
Java
|
apache-2.0
| 1,560
|
/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
goog.declareModuleId('Blockly.test.helpers.toolboxDefinitions');
/**
* Get JSON for a toolbox that contains categories.
* @return {Blockly.utils.toolbox.ToolboxJson} The array holding information
* for a toolbox.
*/
export function getCategoryJSON() {
return {"contents": [
{
"kind": "CATEGORY",
"cssconfig": {
"container": "something",
},
"contents": [
{
"kind": "BLOCK",
"blockxml": '<block type="basic_block"><field name="TEXT">FirstCategory-FirstBlock</field></block>',
},
{
"kind": "BLOCK",
"blockxml": '<block type="basic_block"><field name="TEXT">FirstCategory-SecondBlock</field></block>',
},
],
"name": "First",
},
{
"kind": "CATEGORY",
"contents": [
{
"kind": "BLOCK",
"blockxml": '<block type="basic_block"><field name="TEXT">SecondCategory-FirstBlock</field></block>',
},
],
"name": "Second",
}]};
}
/**
* Get JSON for a simple toolbox.
* @return {Blockly.utils.toolbox.ToolboxJson} The array holding information
* for a simple toolbox.
*/
export function getSimpleJson() {
return {"contents": [
{
"kind": "BLOCK",
"blockxml":
`<block type="logic_compare">
<field name="OP">NEQ</field>
<value name="A">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
</value>
<value name="B">
<block type="math_number">
<field name="NUM">2</field>
</block>
</value>
</block>`,
},
{
"kind": "SEP",
"gap": "20",
},
{
"kind": "BUTTON",
"text": "insert",
"callbackkey": "insertConnectionRows",
},
{
"kind": "LABEL",
"text": "tooltips",
},
]};
}
export function getProperSimpleJson() {
return {
"contents": [
{
"kind": "BLOCK",
"type": "logic_compare",
"fields": {
"OP": "NEQ",
},
"inputs": {
"A": {
"shadow": {
"type": "math_number",
"fields": {
"NUM": 1,
},
},
},
"B": {
"block": {
"type": "math_number",
"fields": {
"NUM": 2,
},
},
},
},
},
{
"kind": "SEP",
"gap": "20",
},
{
"kind": "BUTTON",
"text": "insert",
"callbackkey": "insertConnectionRows",
},
{
"kind": "LABEL",
"text": "tooltips",
},
]};
}
/**
* Get JSON for a toolbox that contains categories that contain categories.
* @return {Blockly.utils.toolbox.ToolboxJson} The array holding information
* for a toolbox.
*/
export function getDeeplyNestedJSON() {
return {"contents": [
{
"kind": "CATEGORY",
"cssconfig": {
"container": "something",
},
"contents": [{
"kind": "CATEGORY",
"contents": [{
"kind": "CATEGORY",
"contents": [
{
"kind": "BLOCK",
"blockxml": '<block type="basic_block"><field name="TEXT">NestedCategory-FirstBlock</field></block>',
},
{
"kind": "BLOCK",
"blockxml": '<block type="basic_block"><field name="TEXT">NestedCategory-SecondBlock</field></block>',
},
],
"name": "NestedCategoryInner",
}],
"name": "NestedCategoryMiddle",
}],
"name": "NestedCategoryOuter",
},
{
"kind": "CATEGORY",
"contents": [
{
"kind": "BLOCK",
"blockxml": '<block type="basic_block"><field name="TEXT">SecondCategory-FirstBlock</field></block>',
},
],
"name": "Second",
}]};
}
/**
* Get an array filled with xml elements.
* @return {Array<Node>} Array holding xml elements for a toolbox.
*/
export function getXmlArray() {
const block = Blockly.Xml.textToDom(
`<block type="logic_compare">
<field name="OP">NEQ</field>
<value name="A">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
</value>
<value name="B">
<block type="math_number">
<field name="NUM">2</field>
</block>
</value>
</block>`);
const separator = Blockly.Xml.textToDom('<sep gap="20"></sep>');
const button = Blockly.Xml.textToDom('<button text="insert" callbackkey="insertConnectionRows"></button>');
const label = Blockly.Xml.textToDom('<label text="tooltips"></label>');
return [block, separator, button, label];
}
export function getInjectedToolbox() {
/**
* Category: First
* sep
* basic_block
* basic_block
* Category: second
* basic_block
* Category: Variables
* custom: VARIABLE
* Category: NestedCategory
* Category: NestedItemOne
*/
const toolboxXml = document.getElementById('toolbox-test');
const workspace = Blockly.inject('blocklyDiv',
{
toolbox: toolboxXml,
});
return workspace.getToolbox();
}
export function getBasicToolbox() {
const workspace = new Blockly.WorkspaceSvg(new Blockly.Options({}));
const toolbox = new Blockly.Toolbox(workspace);
toolbox.HtmlDiv = document.createElement('div');
toolbox.flyout_ = sinon.createStubInstance(Blockly.VerticalFlyout);
return toolbox;
}
export function getCollapsibleItem(toolbox) {
const contents = toolbox.contents_;
for (let i = 0; i < contents.length; i++) {
const item = contents[i];
if (item.isCollapsible()) {
return item;
}
}
}
export function getNonCollapsibleItem(toolbox) {
const contents = toolbox.contents_;
for (let i = 0; i < contents.length; i++) {
const item = contents[i];
if (!item.isCollapsible()) {
return item;
}
}
}
export function getChildItem(toolbox) {
return toolbox.getToolboxItemById('nestedCategory');
}
export function getSeparator(toolbox) {
return toolbox.getToolboxItemById('separator');
}
|
rachel-fenichel/blockly
|
tests/mocha/test_helpers/toolbox_definitions.js
|
JavaScript
|
apache-2.0
| 6,324
|
package org.darkphoenixs.mq.consumer;
import org.darkphoenixs.mq.exception.MQException;
import org.junit.Assert;
import org.junit.Test;
public class ConsumerTest {
@SuppressWarnings("deprecation")
@Test
public void test() throws Exception {
ConsumerImpl consumer = new ConsumerImpl();
consumer.setConsumerKey("ProtocolId");
consumer.receive(consumer.getConsumerKey());
Assert.assertEquals(consumer.getConsumerKey(), consumer.getConsumerKey());
ConsumerImpl2 consumer2 = new ConsumerImpl2();
try {
consumer2.receive(null);
} catch (Exception e) {
Assert.assertTrue(e instanceof MQException);
}
}
@SuppressWarnings("deprecation")
private class ConsumerImpl extends AbstractConsumer<String> {
@Override
protected void doReceive(String message) throws MQException {
System.out.println(message);
}
}
@SuppressWarnings("deprecation")
private class ConsumerImpl2 extends AbstractConsumer<String> {
@Override
protected void doReceive(String message) throws MQException {
throw new MQException("Test");
}
}
}
|
DarkPhoenixs/message-queue-client-framework
|
src/test/java/org/darkphoenixs/mq/consumer/ConsumerTest.java
|
Java
|
apache-2.0
| 1,268
|
# Ligusticopsis glaucescens (H.Wolff) Lavrova & Kljuykov SPECIES
#### Status
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
Pleurospermum glaucescens H.Wolff
### Remarks
null
|
mdoering/backbone
|
life/Plantae/Magnoliophyta/Magnoliopsida/Apiales/Apiaceae/Ligusticopsis/Ligusticopsis glaucescens/README.md
|
Markdown
|
apache-2.0
| 241
|
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <folly/Portability.h>
#include <folly/lang/Hint.h>
namespace folly {
/**
* assume*() functions can be used to fine-tune optimizations or suppress
* warnings when certain conditions are provably true, but the compiler is not
* able to prove them.
*
* This is different from assertions: an assertion will place an explicit check
* that the condition is true, and abort the program if the condition is not
* verified. Calling assume*() with a condition that is not true at runtime
* is undefined behavior: for example, it may or may not result in a crash,
* silently corrupt memory, or jump to a random code path.
*
* These functions should only be used on conditions that are provable internal
* logic invariants; they cannot be used safely if the condition depends on
* external inputs or data. To detect unexpected conditions that *can* happen,
* an assertion or exception should be used.
*/
/**
* assume(cond) informs the compiler that cond can be assumed true. If cond is
* not true at runtime the behavior is undefined.
*
* The typical use case is to allow the compiler exploit data structure
* invariants that can trigger better optimizations, for example to eliminate
* unnecessary bounds checks in a called function. It is recommended to check
* the generated code or run microbenchmarks to assess whether it is actually
* effective.
*
* The semantics are similar to clang's __builtin_assume(), but intentionally
* implemented as a function to force the evaluation of its argument, contrary
* to the builtin, which cannot used with expressions that have side-effects.
*/
FOLLY_ALWAYS_INLINE void assume(bool cond) {
compiler_may_unsafely_assume(cond);
}
/**
* assume_unreachable() informs the compiler that the statement is not reachable
* at runtime. It is undefined behavior if the statement is actually reached.
*
* Common use cases are to suppress a warning when the compiler cannot prove
* that the end of a non-void function is not reachable, or to optimize the
* evaluation of switch/case statements when all the possible values are
* provably enumerated.
*/
[[noreturn]] FOLLY_ALWAYS_INLINE void assume_unreachable() {
compiler_may_unsafely_assume_unreachable();
}
} // namespace folly
|
facebook/folly
|
folly/lang/Assume.h
|
C
|
apache-2.0
| 2,888
|
// Copyright (c) 2014 by SiegeLord
//
// All rights reserved. Distributed under ZLib. For full terms see the file LICENSE.
#![crate_name="allegro_dialog_sys"]
#![crate_type = "lib"]
extern crate allegro_sys;
#[macro_use]
extern crate allegro_util;
extern crate libc;
pub use allegro_dialog::*;
pub mod allegro_dialog
{
#![allow(non_camel_case_types)]
use libc::*;
use allegro_util::c_bool;
use allegro_sys::{ALLEGRO_DISPLAY, ALLEGRO_EVENT_SOURCE};
opaque!(ALLEGRO_FILECHOOSER);
opaque!(ALLEGRO_TEXTLOG);
pub const ALLEGRO_FILECHOOSER_FILE_MUST_EXIST: u32 = 1;
pub const ALLEGRO_FILECHOOSER_SAVE: u32 = 2;
pub const ALLEGRO_FILECHOOSER_FOLDER: u32 = 4;
pub const ALLEGRO_FILECHOOSER_PICTURES: u32 = 8;
pub const ALLEGRO_FILECHOOSER_SHOW_HIDDEN: u32 = 16;
pub const ALLEGRO_FILECHOOSER_MULTIPLE: u32 = 32;
pub const ALLEGRO_MESSAGEBOX_WARN: u32 = 1;
pub const ALLEGRO_MESSAGEBOX_ERROR: u32 = 2;
pub const ALLEGRO_MESSAGEBOX_OK_CANCEL: u32 = 4;
pub const ALLEGRO_MESSAGEBOX_YES_NO: u32 = 8;
pub const ALLEGRO_MESSAGEBOX_QUESTION: u32 = 16;
pub const ALLEGRO_TEXTLOG_NO_CLOSE: u32 = 1;
pub const ALLEGRO_TEXTLOG_MONOSPACE: u32 = 2;
pub const ALLEGRO_EVENT_NATIVE_DIALOG_CLOSE: c_uint = 600;
extern "C"
{
pub fn al_init_native_dialog_addon() -> c_bool;
pub fn al_shutdown_native_dialog_addon();
pub fn al_create_native_file_dialog(initial_path: *const c_char, title: *const c_char, patterns: *const c_char, mode: c_int) -> *mut ALLEGRO_FILECHOOSER;
pub fn al_show_native_file_dialog(display: *mut ALLEGRO_DISPLAY, dialog: *mut ALLEGRO_FILECHOOSER) -> c_bool;
pub fn al_get_native_file_dialog_count(dialog: *const ALLEGRO_FILECHOOSER) -> c_int;
pub fn al_get_native_file_dialog_path(dialog: *const ALLEGRO_FILECHOOSER, index: size_t) -> *const c_char;
pub fn al_destroy_native_file_dialog(dialog: *mut ALLEGRO_FILECHOOSER);
pub fn al_show_native_message_box(display: *mut ALLEGRO_DISPLAY, title: *const c_char, heading: *const c_char, text: *const c_char, buttons: *const c_char, flags: c_int) -> c_int;
pub fn al_open_native_text_log(title: *const c_char, flags: c_int) -> *mut ALLEGRO_TEXTLOG;
pub fn al_close_native_text_log(textlog: *mut ALLEGRO_TEXTLOG);
pub fn al_append_native_text_log(textlog: *mut ALLEGRO_TEXTLOG, format: *const c_char, ...);
pub fn al_get_native_text_log_event_source(textlog: *mut ALLEGRO_TEXTLOG) -> *mut ALLEGRO_EVENT_SOURCE;
pub fn al_get_allegro_native_dialog_version() -> uint32_t;
}
}
|
tempbottle/RustAllegro
|
allegro_dialog-sys/src/lib.rs
|
Rust
|
apache-2.0
| 2,474
|
/**
* Copyright (C) 2015 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.strata.finance;
/**
* A financial product that can be traded.
* <p>
* A product is a high level abstraction applicable to many different types.
* For example, an Interest Rate Swap is a product, as is a Forward Rate Agreement (FRA).
* <p>
* A product exists independently from a {@link Trade}. It represents the economics of the
* financial instrument regardless of the trade date or counterparties.
* <p>
* Implementations must be immutable and thread-safe beans.
*/
public interface Product {
}
|
nssales/Strata
|
modules/finance/src/main/java/com/opengamma/strata/finance/Product.java
|
Java
|
apache-2.0
| 669
|
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateDepartamentosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('departamentos', function (Blueprint $table) {
$table->increments('id');
$table->string('nomeDepartamento');
$table->string('descricaoDepartamento');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('departamentos');
}
}
|
eulucasilva/avatar
|
database/migrations/2017_01_31_081334_create_departamentos_table.php
|
PHP
|
apache-2.0
| 664
|
package com.sequenceiq.periscope.service;
public class NotFoundException extends RuntimeException {
public NotFoundException(String message) {
super(message);
}
public NotFoundException(String message, Throwable cause) {
super(message, cause);
}
}
|
sequenceiq/cloudbreak
|
autoscale/src/main/java/com/sequenceiq/periscope/service/NotFoundException.java
|
Java
|
apache-2.0
| 283
|
/**
* Copyright 2015 Joshua Cain
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.semper.reformanda.syndication.rss;
import org.junit.Test;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
import java.io.FileInputStream;
import java.util.Optional;
import static org.junit.Assert.assertNotNull;
public class RssTest {
@Test
public void shouldUnmarshalSampleRssFeedFields() throws Exception {
final Optional<Rss> rss = Rss.fromXmlStream(new FileInputStream("src/test/resources/sampleFeed.xml"));
assertNotNull(rss);
}
}
|
cainj13/jaxbRss
|
src/test/java/org/semper/reformanda/syndication/rss/RssTest.java
|
Java
|
apache-2.0
| 1,095
|
var Redirects = function () {
this.respondsWith = ['html', 'json', 'xml', 'js', 'txt'];
this.index = function (req, resp, params) {
var self = this;
geddy.model.Redirect.all(function(err, redirects) {
self.respondWith(redirects, {type:'Redirect'});
});
};
this.add = function (req, resp, params) {
this.respond({params: params});
};
this.create = function (req, resp, params) {
var self = this
, redirect = geddy.model.Redirect.create(params);
if (!redirect.isValid()) {
this.respondWith(redirect);
}
else {
redirect.save(function(err, data) {
if (err) {
throw err;
}
if(err)
return self.respondWith(redirect, {status: err});
self.redirect({controller: 'redirects'});
});
}
};
this.show = function (req, resp, params) {
var self = this;
geddy.model.Redirect.first(params.id, function(err, redirect) {
if (err) {
throw err;
}
if (!redirect) {
throw new geddy.errors.NotFoundError();
}
else {
self.respondWith(redirect);
}
});
};
this.edit = function (req, resp, params) {
var self = this;
geddy.model.Redirect.first(params.id, function(err, redirect) {
if (err) {
throw err;
}
if (!redirect) {
throw new geddy.errors.BadRequestError();
}
else {
self.respondWith(redirect);
}
});
};
this.update = function (req, resp, params) {
var self = this;
geddy.model.Redirect.first(params.id, function(err, redirect) {
if (err) {
throw err;
}
redirect.updateProperties(params);
if (!redirect.isValid()) {
self.respondWith(redirect);
}
else {
redirect.save(function(err, data) {
if (err) {
throw err;
}
self.respondWith(redirect, {status: err});
});
}
});
};
this.remove = function (req, resp, params) {
var self = this;
geddy.model.Redirect.first(params.id, function(err, redirect) {
if (err) {
throw err;
}
if (!redirect) {
throw new geddy.errors.BadRequestError();
}
else {
geddy.model.Redirect.remove(params.id, function(err) {
if (err) {
throw err;
}
self.respondWith(redirect);
});
}
});
};
};
exports.Redirects = Redirects;
|
dscape/mailproxy
|
app/controllers/redirects.js
|
JavaScript
|
apache-2.0
| 2,476
|
# Cryptostictis hollosti Tóth SPECIES
#### Status
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Cryptostictis hollosti Tóth
### Remarks
null
|
mdoering/backbone
|
life/Fungi/Ascomycota/Sordariomycetes/Xylariales/Amphisphaeriaceae/Cryptostictis/Cryptostictis hollosti/README.md
|
Markdown
|
apache-2.0
| 185
|
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2016-2021 Gerrit Grunwald.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package eu.hansolo.tilesfx.skins;
import eu.hansolo.tilesfx.Tile;
import eu.hansolo.tilesfx.fonts.Fonts;
import eu.hansolo.tilesfx.tools.Helper;
import javafx.beans.value.ChangeListener;
import javafx.scene.Node;
import javafx.scene.image.ImageView;
import javafx.scene.layout.StackPane;
import javafx.scene.shape.Shape;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
/**
* Created by hansolo on 26.12.16.
*/
public class CustomTileSkin extends TileSkin {
private Text titleText;
private Text text;
private StackPane graphicContainer;
private ChangeListener graphicListener;
// ******************** Constructors **************************************
public CustomTileSkin(final Tile TILE) {
super(TILE);
}
// ******************** Initialization ************************************
@Override protected void initGraphics() {
super.initGraphics();
graphicListener = (o, ov, nv) -> { if (nv != null) { graphicContainer.getChildren().setAll(tile.getGraphic()); }};
titleText = new Text();
titleText.setFill(tile.getTitleColor());
Helper.enableNode(titleText, !tile.getTitle().isEmpty());
text = new Text(tile.getText());
text.setFill(tile.getTextColor());
Helper.enableNode(text, tile.isTextVisible());
graphicContainer = new StackPane();
graphicContainer.setMinSize(size * 0.9, tile.isTextVisible() ? size * 0.72 : size * 0.795);
graphicContainer.setMaxSize(size * 0.9, tile.isTextVisible() ? size * 0.72 : size * 0.795);
graphicContainer.setPrefSize(size * 0.9, tile.isTextVisible() ? size * 0.72 : size * 0.795);
if (null != tile.getGraphic()) graphicContainer.getChildren().setAll(tile.getGraphic());
getPane().getChildren().addAll(titleText, graphicContainer, text);
}
@Override protected void registerListeners() {
super.registerListeners();
tile.graphicProperty().addListener(graphicListener);
}
// ******************** Methods *******************************************
@Override protected void handleEvents(final String EVENT_TYPE) {
super.handleEvents(EVENT_TYPE);
if ("VISIBILITY".equals(EVENT_TYPE)) {
Helper.enableNode(titleText, !tile.getTitle().isEmpty());
Helper.enableNode(text, tile.isTextVisible());
graphicContainer.setMaxSize(size * 0.9, tile.isTextVisible() ? size * 0.68 : size * 0.795);
graphicContainer.setPrefSize(size * 0.9, tile.isTextVisible() ? size * 0.68 : size * 0.795);
} else if ("GRAPHIC".equals(EVENT_TYPE)) {
if (null != tile.getGraphic()) graphicContainer.getChildren().setAll(tile.getGraphic());
}
}
@Override public void dispose() {
tile.graphicProperty().removeListener(graphicListener);
super.dispose();
}
// ******************** Resizing ******************************************
@Override protected void resizeStaticText() {
double maxWidth = width - size * 0.1;
double fontSize = size * textSize.factor;
boolean customFontEnabled = tile.isCustomFontEnabled();
Font customFont = tile.getCustomFont();
Font font = (customFontEnabled && customFont != null) ? Font.font(customFont.getFamily(), fontSize) : Fonts.latoRegular(fontSize);
titleText.setFont(font);
if (titleText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(titleText, maxWidth, fontSize); }
switch(tile.getTitleAlignment()) {
default :
case LEFT : titleText.relocate(size * 0.05, size * 0.05); break;
case CENTER: titleText.relocate((width - titleText.getLayoutBounds().getWidth()) * 0.5, size * 0.05); break;
case RIGHT : titleText.relocate(width - (size * 0.05) - titleText.getLayoutBounds().getWidth(), size * 0.05); break;
}
text.setFont(font);
if (text.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize(text, maxWidth, fontSize); }
switch(tile.getTextAlignment()) {
default :
case LEFT : text.setX(size * 0.05); break;
case CENTER: text.setX((width - text.getLayoutBounds().getWidth()) * 0.5); break;
case RIGHT : text.setX(width - (size * 0.05) - text.getLayoutBounds().getWidth()); break;
}
text.setY(height - size * 0.05);
}
@Override protected void resize() {
super.resize();
width = tile.getWidth() - tile.getInsets().getLeft() - tile.getInsets().getRight();
height = tile.getHeight() - tile.getInsets().getTop() - tile.getInsets().getBottom();
size = width < height ? width : height;
double containerWidth = contentBounds.getWidth();
double containerHeight = contentBounds.getHeight();
if (tile.isShowing() && width > 0 && height > 0) {
pane.setMaxSize(width, height);
pane.setPrefSize(width, height);
if (containerWidth > 0 && containerHeight > 0) {
graphicContainer.setMinSize(containerWidth, containerHeight);
graphicContainer.setMaxSize(containerWidth, containerHeight);
graphicContainer.setPrefSize(containerWidth, containerHeight);
graphicContainer.relocate(contentBounds.getX(), contentBounds.getY());
if (null != tile) {
Node graphic = tile.getGraphic();
if (tile.getGraphic() instanceof Shape) {
double graphicWidth = graphic.getBoundsInLocal().getWidth();
double graphicHeight = graphic.getBoundsInLocal().getHeight();
if (graphicWidth > containerWidth || graphicHeight > containerHeight) {
double scale = 1;
if (graphicWidth - containerWidth > graphicHeight - containerHeight) {
scale = containerWidth / graphicWidth;
} else {
scale = containerHeight / graphicHeight;
}
graphic.setScaleX(scale);
graphic.setScaleY(scale);
}
} else if (tile.getGraphic() instanceof ImageView) {
ImageView imgView = (ImageView) graphic;
imgView.setPreserveRatio(true);
imgView.setFitWidth(containerWidth);
imgView.setFitHeight(containerHeight);
//((ImageView) graphic).setFitWidth(containerWidth);
//((ImageView) graphic).setFitHeight(containerHeight);
}
}
}
resizeStaticText();
}
}
@Override protected void redraw() {
super.redraw();
titleText.setText(tile.getTitle());
text.setText(tile.getText());
resizeStaticText();
titleText.setFill(tile.getTitleColor());
text.setFill(tile.getTextColor());
}
}
|
HanSolo/tilesfx
|
src/main/java/eu/hansolo/tilesfx/skins/CustomTileSkin.java
|
Java
|
apache-2.0
| 7,823
|
using Crane.Core.Hosts;
namespace Crane.Console
{
public class Program
{
static int Main(string[] args)
{
var hostFactory = new HostFactory();
var consoleHost = hostFactory.CreateConsoleHost();
return consoleHost.Run(args);
}
}
}
|
ewilde/crane
|
src/Crane.Console/Program.cs
|
C#
|
apache-2.0
| 307
|
// Copyright 2013 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// This code was taken from: https://github.com/golang/groupcache/
package util
import "container/list"
// LRUCache is an LRU cache. It is not safe for concurrent access.
type LRUCache struct {
// MaxEntries is the maximum number of cache entries before
// an item is evicted. Zero means no limit.
MaxEntries int
// OnEvicted optionally specificies a callback function to be
// executed when an entry is purged from the cache.
OnEvicted func(key Key, value interface{})
ll *list.List
cache map[interface{}]*list.Element
}
// A Key may be any value that is comparable. See http://golang.org/ref/spec#Comparison_operators
type Key interface{}
type entry struct {
key Key
value interface{}
}
// NewLRUCache creates a new LRUCache.
// If maxEntries is zero, the cache has no limit and it's assumed
// that eviction is done by the caller.
func NewLRUCache(maxEntries int) *LRUCache {
return &LRUCache{
MaxEntries: maxEntries,
ll: list.New(),
cache: make(map[interface{}]*list.Element),
}
}
// Add adds a value to the cache.
func (c *LRUCache) Add(key Key, value interface{}) {
if c.cache == nil {
c.cache = make(map[interface{}]*list.Element)
c.ll = list.New()
}
if ee, ok := c.cache[key]; ok {
c.ll.MoveToFront(ee)
ee.Value.(*entry).value = value
return
}
ele := c.ll.PushFront(&entry{key, value})
c.cache[key] = ele
if c.MaxEntries != 0 && c.ll.Len() > c.MaxEntries {
c.RemoveOldest()
}
}
// Get looks up a key's value from the cache.
func (c *LRUCache) Get(key Key) (value interface{}, ok bool) {
if c.cache == nil {
return
}
if ele, hit := c.cache[key]; hit {
c.ll.MoveToFront(ele)
return ele.Value.(*entry).value, true
}
return
}
// Remove removes the provided key from the cache.
func (c *LRUCache) Remove(key Key) {
if c.cache == nil {
return
}
if ele, hit := c.cache[key]; hit {
c.removeElement(ele)
}
}
// RemoveOldest removes the oldest item from the cache.
func (c *LRUCache) RemoveOldest() {
if c.cache == nil {
return
}
ele := c.ll.Back()
if ele != nil {
c.removeElement(ele)
}
}
func (c *LRUCache) removeElement(e *list.Element) {
c.ll.Remove(e)
kv := e.Value.(*entry)
delete(c.cache, kv.key)
if c.OnEvicted != nil {
c.OnEvicted(kv.key, kv.value)
}
}
// Len returns the number of items in the cache.
func (c *LRUCache) Len() int {
if c.cache == nil {
return 0
}
return c.ll.Len()
}
|
gude/cockroach
|
util/lru.go
|
GO
|
apache-2.0
| 2,993
|
/*
* utils4j - Mandatory.java, Aug 1, 2013 12:26:44 PM
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.varra.classification;
import java.lang.annotation.*;
import static java.lang.annotation.ElementType.*;
/**
* Indicates that a method/field should be set to a valid value. If a
* method/filed is annotated with this annotation type but does not have a valid
* value API will throw an error message.
*
* @author <a href="mailto:varra@outlook.com">Rajakrishna V.
* Reddy</a>
* @version 1.0
*
*/
@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Mandatory
{
}
|
varra4u/utils4j
|
src/main/java/com/varra/classification/Mandatory.java
|
Java
|
apache-2.0
| 1,426
|
/* $NetBSD: wskbd.c,v 1.134.2.1 2014/12/01 11:38:43 martin Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christopher G. Demetriou
* for the NetBSD Project.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*/
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Keysym translator contributed to The NetBSD Foundation by
* Juergen Hannken-Illjes.
*
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
*/
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* contributed to Berkeley.
*
* All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Lawrence Berkeley Laboratory.
*
* 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 University 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 REGENTS 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 REGENTS 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.
*
* @(#)kbd.c 8.2 (Berkeley) 10/30/93
*/
/*
* Keyboard driver (/dev/wskbd*). Translates incoming bytes to ASCII or
* to `wscons_events' and passes them up to the appropriate reader.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.134.2.1 2014/12/01 11:38:43 martin Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
#include "opt_wsdisplay_compat.h"
#include "wsdisplay.h"
#include "wskbd.h"
#include "wsmux.h"
#include <sys/param.h>
#include <sys/conf.h>
#include <sys/device.h>
#include <sys/ioctl.h>
#include <sys/poll.h>
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/syslog.h>
#include <sys/systm.h>
#include <sys/callout.h>
#include <sys/malloc.h>
#include <sys/tty.h>
#include <sys/signalvar.h>
#include <sys/errno.h>
#include <sys/fcntl.h>
#include <sys/vnode.h>
#include <sys/kauth.h>
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wskbdvar.h>
#include <dev/wscons/wsksymdef.h>
#include <dev/wscons/wsksymvar.h>
#include <dev/wscons/wsdisplayvar.h>
#include <dev/wscons/wseventvar.h>
#include <dev/wscons/wscons_callbacks.h>
#ifdef KGDB
#include <sys/kgdb.h>
#endif
#ifdef WSKBD_DEBUG
#define DPRINTF(x) if (wskbddebug) printf x
int wskbddebug = 0;
#else
#define DPRINTF(x)
#endif
#include <dev/wscons/wsmuxvar.h>
struct wskbd_internal {
const struct wskbd_mapdata *t_keymap;
const struct wskbd_consops *t_consops;
void *t_consaccesscookie;
int t_modifiers;
int t_composelen; /* remaining entries in t_composebuf */
keysym_t t_composebuf[2];
int t_flags;
#define WSKFL_METAESC 1
#define MAXKEYSYMSPERKEY 2 /* ESC <key> at max */
keysym_t t_symbols[MAXKEYSYMSPERKEY];
struct wskbd_softc *t_sc; /* back pointer */
};
struct wskbd_softc {
struct wsevsrc sc_base;
struct wskbd_internal *id;
const struct wskbd_accessops *sc_accessops;
void *sc_accesscookie;
int sc_ledstate;
int sc_isconsole;
struct wskbd_bell_data sc_bell_data;
struct wskbd_keyrepeat_data sc_keyrepeat_data;
#ifdef WSDISPLAY_SCROLLSUPPORT
struct wskbd_scroll_data sc_scroll_data;
#endif
int sc_repeating; /* we've called timeout() */
callout_t sc_repeat_ch;
u_int sc_repeat_type;
int sc_repeat_value;
int sc_translating; /* xlate to chars for emulation */
int sc_maplen; /* number of entries in sc_map */
struct wscons_keymap *sc_map; /* current translation map */
kbd_t sc_layout; /* current layout */
int sc_refcnt;
u_char sc_dying; /* device is being detached */
wskbd_hotkey_plugin *sc_hotkey;
void *sc_hotkeycookie;
/* optional table to translate scancodes in event mode */
int sc_evtrans_len;
keysym_t *sc_evtrans;
};
#define MOD_SHIFT_L (1 << 0)
#define MOD_SHIFT_R (1 << 1)
#define MOD_SHIFTLOCK (1 << 2)
#define MOD_CAPSLOCK (1 << 3)
#define MOD_CONTROL_L (1 << 4)
#define MOD_CONTROL_R (1 << 5)
#define MOD_META_L (1 << 6)
#define MOD_META_R (1 << 7)
#define MOD_MODESHIFT (1 << 8)
#define MOD_NUMLOCK (1 << 9)
#define MOD_COMPOSE (1 << 10)
#define MOD_HOLDSCREEN (1 << 11)
#define MOD_COMMAND (1 << 12)
#define MOD_COMMAND1 (1 << 13)
#define MOD_COMMAND2 (1 << 14)
#define MOD_ANYSHIFT (MOD_SHIFT_L | MOD_SHIFT_R | MOD_SHIFTLOCK)
#define MOD_ANYCONTROL (MOD_CONTROL_L | MOD_CONTROL_R)
#define MOD_ANYMETA (MOD_META_L | MOD_META_R)
#define MOD_ONESET(id, mask) (((id)->t_modifiers & (mask)) != 0)
#define MOD_ALLSET(id, mask) (((id)->t_modifiers & (mask)) == (mask))
#define GETMODSTATE(src, dst) \
do { \
dst |= (src & MOD_SHIFT_L) ? MOD_SHIFT_L : 0; \
dst |= (src & MOD_SHIFT_R) ? MOD_SHIFT_R : 0; \
dst |= (src & MOD_CONTROL_L) ? MOD_CONTROL_L : 0; \
dst |= (src & MOD_CONTROL_R) ? MOD_CONTROL_R : 0; \
dst |= (src & MOD_META_L) ? MOD_META_L : 0; \
dst |= (src & MOD_META_R) ? MOD_META_R : 0; \
} while (0)
static int wskbd_match(device_t, cfdata_t, void *);
static void wskbd_attach(device_t, device_t, void *);
static int wskbd_detach(device_t, int);
static int wskbd_activate(device_t, enum devact);
static int wskbd_displayioctl(device_t, u_long, void *, int,
struct lwp *);
#if NWSDISPLAY > 0
static int wskbd_set_display(device_t, struct wsevsrc *);
#else
#define wskbd_set_display NULL
#endif
static inline void update_leds(struct wskbd_internal *);
static inline void update_modifier(struct wskbd_internal *, u_int, int, int);
static int internal_command(struct wskbd_softc *, u_int *, keysym_t, keysym_t);
static int wskbd_translate(struct wskbd_internal *, u_int, int);
static int wskbd_enable(struct wskbd_softc *, int);
#if NWSDISPLAY > 0
static void change_displayparam(struct wskbd_softc *, int, int, int);
static void wskbd_holdscreen(struct wskbd_softc *, int);
#endif
static int wskbd_do_ioctl_sc(struct wskbd_softc *, u_long, void *, int,
struct lwp *);
static void wskbd_deliver_event(struct wskbd_softc *sc, u_int type, int value);
#if NWSMUX > 0
static int wskbd_mux_open(struct wsevsrc *, struct wseventvar *);
static int wskbd_mux_close(struct wsevsrc *);
#else
#define wskbd_mux_open NULL
#define wskbd_mux_close NULL
#endif
static int wskbd_do_open(struct wskbd_softc *, struct wseventvar *);
static int wskbd_do_ioctl(device_t, u_long, void *, int, struct lwp *);
CFATTACH_DECL_NEW(wskbd, sizeof (struct wskbd_softc),
wskbd_match, wskbd_attach, wskbd_detach, wskbd_activate);
extern struct cfdriver wskbd_cd;
dev_type_open(wskbdopen);
dev_type_close(wskbdclose);
dev_type_read(wskbdread);
dev_type_ioctl(wskbdioctl);
dev_type_poll(wskbdpoll);
dev_type_kqfilter(wskbdkqfilter);
const struct cdevsw wskbd_cdevsw = {
.d_open = wskbdopen,
.d_close = wskbdclose,
.d_read = wskbdread,
.d_write = nowrite,
.d_ioctl = wskbdioctl,
.d_stop = nostop,
.d_tty = notty,
.d_poll = wskbdpoll,
.d_mmap = nommap,
.d_kqfilter = wskbdkqfilter,
.d_discard = nodiscard,
.d_flag = D_OTHER
};
#ifndef WSKBD_DEFAULT_BELL_PITCH
#define WSKBD_DEFAULT_BELL_PITCH 1500 /* 1500Hz */
#endif
#ifndef WSKBD_DEFAULT_BELL_PERIOD
#define WSKBD_DEFAULT_BELL_PERIOD 100 /* 100ms */
#endif
#ifndef WSKBD_DEFAULT_BELL_VOLUME
#define WSKBD_DEFAULT_BELL_VOLUME 50 /* 50% volume */
#endif
struct wskbd_bell_data wskbd_default_bell_data = {
WSKBD_BELL_DOALL,
WSKBD_DEFAULT_BELL_PITCH,
WSKBD_DEFAULT_BELL_PERIOD,
WSKBD_DEFAULT_BELL_VOLUME,
};
#ifdef WSDISPLAY_SCROLLSUPPORT
struct wskbd_scroll_data wskbd_default_scroll_data = {
WSKBD_SCROLL_DOALL,
WSKBD_SCROLL_MODE_NORMAL,
#ifdef WSDISPLAY_SCROLLCOMBO
WSDISPLAY_SCROLLCOMBO,
#else
MOD_SHIFT_L,
#endif
};
#endif
#ifndef WSKBD_DEFAULT_KEYREPEAT_DEL1
#define WSKBD_DEFAULT_KEYREPEAT_DEL1 400 /* 400ms to start repeating */
#endif
#ifndef WSKBD_DEFAULT_KEYREPEAT_DELN
#define WSKBD_DEFAULT_KEYREPEAT_DELN 100 /* 100ms to between repeats */
#endif
struct wskbd_keyrepeat_data wskbd_default_keyrepeat_data = {
WSKBD_KEYREPEAT_DOALL,
WSKBD_DEFAULT_KEYREPEAT_DEL1,
WSKBD_DEFAULT_KEYREPEAT_DELN,
};
#if NWSDISPLAY > 0 || NWSMUX > 0
struct wssrcops wskbd_srcops = {
WSMUX_KBD,
wskbd_mux_open, wskbd_mux_close, wskbd_do_ioctl,
wskbd_displayioctl, wskbd_set_display
};
#endif
static bool wskbd_suspend(device_t dv, const pmf_qual_t *);
static void wskbd_repeat(void *v);
static int wskbd_console_initted;
static struct wskbd_softc *wskbd_console_device;
static struct wskbd_internal wskbd_console_data;
static void wskbd_update_layout(struct wskbd_internal *, kbd_t);
static void
wskbd_update_layout(struct wskbd_internal *id, kbd_t enc)
{
if (enc & KB_METAESC)
id->t_flags |= WSKFL_METAESC;
else
id->t_flags &= ~WSKFL_METAESC;
}
/*
* Print function (for parent devices).
*/
int
wskbddevprint(void *aux, const char *pnp)
{
#if 0
struct wskbddev_attach_args *ap = aux;
#endif
if (pnp)
aprint_normal("wskbd at %s", pnp);
#if 0
aprint_normal(" console %d", ap->console);
#endif
return (UNCONF);
}
int
wskbd_match(device_t parent, cfdata_t match, void *aux)
{
struct wskbddev_attach_args *ap = aux;
if (match->wskbddevcf_console != WSKBDDEVCF_CONSOLE_UNK) {
/*
* If console-ness of device specified, either match
* exactly (at high priority), or fail.
*/
if (match->wskbddevcf_console != 0 && ap->console != 0)
return (10);
else
return (0);
}
/* If console-ness unspecified, it wins. */
return (1);
}
void
wskbd_attach(device_t parent, device_t self, void *aux)
{
struct wskbd_softc *sc = device_private(self);
struct wskbddev_attach_args *ap = aux;
#if NWSMUX > 0
int mux, error;
#endif
sc->sc_base.me_dv = self;
sc->sc_isconsole = ap->console;
sc->sc_hotkey = NULL;
sc->sc_hotkeycookie = NULL;
sc->sc_evtrans_len = 0;
sc->sc_evtrans = NULL;
#if NWSMUX > 0 || NWSDISPLAY > 0
sc->sc_base.me_ops = &wskbd_srcops;
#endif
#if NWSMUX > 0
mux = device_cfdata(sc->sc_base.me_dv)->wskbddevcf_mux;
if (ap->console) {
/* Ignore mux for console; it always goes to the console mux. */
/* printf(" (mux %d ignored for console)", mux); */
mux = -1;
}
if (mux >= 0)
aprint_normal(" mux %d", mux);
#else
if (device_cfdata(sc->sc_base.me_dv)->wskbddevcf_mux >= 0)
aprint_normal(" (mux ignored)");
#endif
if (ap->console) {
sc->id = &wskbd_console_data;
} else {
sc->id = malloc(sizeof(struct wskbd_internal),
M_DEVBUF, M_WAITOK|M_ZERO);
sc->id->t_keymap = ap->keymap;
wskbd_update_layout(sc->id, ap->keymap->layout);
}
callout_init(&sc->sc_repeat_ch, 0);
callout_setfunc(&sc->sc_repeat_ch, wskbd_repeat, sc);
sc->id->t_sc = sc;
sc->sc_accessops = ap->accessops;
sc->sc_accesscookie = ap->accesscookie;
sc->sc_repeating = 0;
sc->sc_translating = 1;
sc->sc_ledstate = -1; /* force update */
if (wskbd_load_keymap(sc->id->t_keymap,
&sc->sc_map, &sc->sc_maplen) != 0)
panic("cannot load keymap");
sc->sc_layout = sc->id->t_keymap->layout;
/* set default bell and key repeat data */
sc->sc_bell_data = wskbd_default_bell_data;
sc->sc_keyrepeat_data = wskbd_default_keyrepeat_data;
#ifdef WSDISPLAY_SCROLLSUPPORT
sc->sc_scroll_data = wskbd_default_scroll_data;
#endif
if (ap->console) {
KASSERT(wskbd_console_initted);
KASSERT(wskbd_console_device == NULL);
wskbd_console_device = sc;
aprint_naive(": console keyboard");
aprint_normal(": console keyboard");
#if NWSDISPLAY > 0
wsdisplay_set_console_kbd(&sc->sc_base); /* sets me_dispv */
if (sc->sc_base.me_dispdv != NULL)
aprint_normal(", using %s",
device_xname(sc->sc_base.me_dispdv));
#endif
}
aprint_naive("\n");
aprint_normal("\n");
#if NWSMUX > 0
if (mux >= 0) {
error = wsmux_attach_sc(wsmux_getmux(mux), &sc->sc_base);
if (error)
aprint_error_dev(sc->sc_base.me_dv,
"attach error=%d\n", error);
}
#endif
if (!pmf_device_register(self, wskbd_suspend, NULL))
aprint_error_dev(self, "couldn't establish power handler\n");
else if (!pmf_class_input_register(self))
aprint_error_dev(self, "couldn't register as input device\n");
}
static bool
wskbd_suspend(device_t dv, const pmf_qual_t *qual)
{
struct wskbd_softc *sc = device_private(dv);
sc->sc_repeating = 0;
callout_stop(&sc->sc_repeat_ch);
return true;
}
void
wskbd_cnattach(const struct wskbd_consops *consops, void *conscookie,
const struct wskbd_mapdata *mapdata)
{
KASSERT(!wskbd_console_initted);
wskbd_console_data.t_keymap = mapdata;
wskbd_update_layout(&wskbd_console_data, mapdata->layout);
wskbd_console_data.t_consops = consops;
wskbd_console_data.t_consaccesscookie = conscookie;
#if NWSDISPLAY > 0
wsdisplay_set_cons_kbd(wskbd_cngetc, wskbd_cnpollc, wskbd_cnbell);
#endif
wskbd_console_initted = 1;
}
void
wskbd_cndetach(void)
{
KASSERT(wskbd_console_initted);
wskbd_console_data.t_keymap = 0;
wskbd_console_data.t_consops = 0;
wskbd_console_data.t_consaccesscookie = 0;
#if NWSDISPLAY > 0
wsdisplay_unset_cons_kbd();
#endif
wskbd_console_initted = 0;
}
static void
wskbd_repeat(void *v)
{
struct wskbd_softc *sc = (struct wskbd_softc *)v;
int s = spltty();
if (!sc->sc_repeating) {
/*
* race condition: a "key up" event came in when wskbd_repeat()
* was already called but not yet spltty()'d
*/
splx(s);
return;
}
if (sc->sc_translating) {
/* deliver keys */
#if NWSDISPLAY > 0
if (sc->sc_base.me_dispdv != NULL) {
int i;
for (i = 0; i < sc->sc_repeating; i++)
wsdisplay_kbdinput(sc->sc_base.me_dispdv,
sc->id->t_symbols[i]);
}
#endif
} else {
#if defined(WSKBD_EVENT_AUTOREPEAT)
/* queue event */
wskbd_deliver_event(sc, sc->sc_repeat_type,
sc->sc_repeat_value);
#endif /* defined(WSKBD_EVENT_AUTOREPEAT) */
}
callout_schedule(&sc->sc_repeat_ch, mstohz(sc->sc_keyrepeat_data.delN));
splx(s);
}
int
wskbd_activate(device_t self, enum devact act)
{
struct wskbd_softc *sc = device_private(self);
if (act == DVACT_DEACTIVATE)
sc->sc_dying = 1;
return (0);
}
/*
* Detach a keyboard. To keep track of users of the softc we keep
* a reference count that's incremented while inside, e.g., read.
* If the keyboard is active and the reference count is > 0 (0 is the
* normal state) we post an event and then wait for the process
* that had the reference to wake us up again. Then we blow away the
* vnode and return (which will deallocate the softc).
*/
int
wskbd_detach(device_t self, int flags)
{
struct wskbd_softc *sc = device_private(self);
struct wseventvar *evar;
int maj, mn;
int s;
#if NWSMUX > 0
/* Tell parent mux we're leaving. */
if (sc->sc_base.me_parent != NULL)
wsmux_detach_sc(&sc->sc_base);
#endif
callout_halt(&sc->sc_repeat_ch, NULL);
callout_destroy(&sc->sc_repeat_ch);
if (sc->sc_isconsole) {
KASSERT(wskbd_console_device == sc);
wskbd_console_device = NULL;
}
pmf_device_deregister(self);
evar = sc->sc_base.me_evp;
if (evar != NULL && evar->io != NULL) {
s = spltty();
if (--sc->sc_refcnt >= 0) {
struct wscons_event event;
/* Wake everyone by generating a dummy event. */
event.type = 0;
event.value = 0;
if (wsevent_inject(evar, &event, 1) != 0)
wsevent_wakeup(evar);
/* Wait for processes to go away. */
if (tsleep(sc, PZERO, "wskdet", hz * 60))
aprint_error("wskbd_detach: %s didn't detach\n",
device_xname(self));
}
splx(s);
}
/* locate the major number */
maj = cdevsw_lookup_major(&wskbd_cdevsw);
/* Nuke the vnodes for any open instances. */
mn = device_unit(self);
vdevgone(maj, mn, mn, VCHR);
return (0);
}
void
wskbd_input(device_t dev, u_int type, int value)
{
struct wskbd_softc *sc = device_private(dev);
#if NWSDISPLAY > 0
int num, i;
#endif
if (sc->sc_repeating) {
sc->sc_repeating = 0;
callout_stop(&sc->sc_repeat_ch);
}
device_active(dev, DVA_HARDWARE);
#if NWSDISPLAY > 0
/*
* If /dev/wskbdN is not connected in event mode translate and
* send upstream.
*/
if (sc->sc_translating) {
num = wskbd_translate(sc->id, type, value);
if (num > 0) {
if (sc->sc_base.me_dispdv != NULL) {
#ifdef WSDISPLAY_SCROLLSUPPORT
if (sc->id->t_symbols [0] != KS_Print_Screen) {
wsdisplay_scroll(sc->sc_base.
me_dispdv, WSDISPLAY_SCROLL_RESET);
}
#endif
for (i = 0; i < num; i++)
wsdisplay_kbdinput(
sc->sc_base.me_dispdv,
sc->id->t_symbols[i]);
}
if (sc->sc_keyrepeat_data.del1 != 0) {
sc->sc_repeating = num;
callout_schedule(&sc->sc_repeat_ch,
mstohz(sc->sc_keyrepeat_data.del1));
}
}
return;
}
#endif
wskbd_deliver_event(sc, type, value);
#if defined(WSKBD_EVENT_AUTOREPEAT)
/* Repeat key presses if set. */
if (type == WSCONS_EVENT_KEY_DOWN && sc->sc_keyrepeat_data.del1 != 0) {
sc->sc_repeat_type = type;
sc->sc_repeat_value = value;
sc->sc_repeating = 1;
callout_schedule(&sc->sc_repeat_ch,
mstohz(sc->sc_keyrepeat_data.del1));
}
#endif /* defined(WSKBD_EVENT_AUTOREPEAT) */
}
/*
* Keyboard is generating events. Turn this keystroke into an
* event and put it in the queue. If the queue is full, the
* keystroke is lost (sorry!).
*/
static void
wskbd_deliver_event(struct wskbd_softc *sc, u_int type, int value)
{
struct wseventvar *evar;
struct wscons_event event;
evar = sc->sc_base.me_evp;
if (evar == NULL) {
DPRINTF(("wskbd_input: not open\n"));
return;
}
#ifdef DIAGNOSTIC
if (evar->q == NULL) {
printf("wskbd_input: evar->q=NULL\n");
return;
}
#endif
event.type = type;
event.value = 0;
DPRINTF(("%d ->", value));
if (sc->sc_evtrans_len > 0) {
if (sc->sc_evtrans_len > value) {
DPRINTF(("%d", sc->sc_evtrans[value]));
event.value = sc->sc_evtrans[value];
}
} else {
event.value = value;
}
DPRINTF(("\n"));
if (wsevent_inject(evar, &event, 1) != 0)
log(LOG_WARNING, "%s: event queue overflow\n",
device_xname(sc->sc_base.me_dv));
}
#ifdef WSDISPLAY_COMPAT_RAWKBD
void
wskbd_rawinput(device_t dev, u_char *tbuf, int len)
{
#if NWSDISPLAY > 0
struct wskbd_softc *sc = device_private(dev);
int i;
if (sc->sc_base.me_dispdv != NULL)
for (i = 0; i < len; i++)
wsdisplay_kbdinput(sc->sc_base.me_dispdv, tbuf[i]);
/* this is KS_GROUP_Plain */
#endif
}
#endif /* WSDISPLAY_COMPAT_RAWKBD */
#if NWSDISPLAY > 0
static void
wskbd_holdscreen(struct wskbd_softc *sc, int hold)
{
int new_state;
if (sc->sc_base.me_dispdv != NULL) {
wsdisplay_kbdholdscreen(sc->sc_base.me_dispdv, hold);
new_state = sc->sc_ledstate;
if (hold) {
#ifdef WSDISPLAY_SCROLLSUPPORT
sc->sc_scroll_data.mode = WSKBD_SCROLL_MODE_HOLD;
#endif
new_state |= WSKBD_LED_SCROLL;
} else {
#ifdef WSDISPLAY_SCROLLSUPPORT
sc->sc_scroll_data.mode = WSKBD_SCROLL_MODE_NORMAL;
#endif
new_state &= ~WSKBD_LED_SCROLL;
}
if (new_state != sc->sc_ledstate) {
(*sc->sc_accessops->set_leds)(sc->sc_accesscookie,
new_state);
sc->sc_ledstate = new_state;
#ifdef WSDISPLAY_SCROLLSUPPORT
if (!hold)
wsdisplay_scroll(sc->sc_base.me_dispdv,
WSDISPLAY_SCROLL_RESET);
#endif
}
}
}
#endif
static int
wskbd_enable(struct wskbd_softc *sc, int on)
{
int error;
#if 0
/* I don't understand the purpose of this code. And it seems to
* break things, so it's out. -- Lennart
*/
if (!on && (!sc->sc_translating
#if NWSDISPLAY > 0
|| sc->sc_base.me_dispdv
#endif
))
return (EBUSY);
#endif
#if NWSDISPLAY > 0
if (sc->sc_base.me_dispdv != NULL)
return (0);
#endif
/* Always cancel auto repeat when fiddling with the kbd. */
if (sc->sc_repeating) {
sc->sc_repeating = 0;
callout_stop(&sc->sc_repeat_ch);
}
error = (*sc->sc_accessops->enable)(sc->sc_accesscookie, on);
DPRINTF(("wskbd_enable: sc=%p on=%d res=%d\n", sc, on, error));
return (error);
}
#if NWSMUX > 0
int
wskbd_mux_open(struct wsevsrc *me, struct wseventvar *evp)
{
struct wskbd_softc *sc = (struct wskbd_softc *)me;
if (sc->sc_dying)
return (EIO);
if (sc->sc_base.me_evp != NULL)
return (EBUSY);
return (wskbd_do_open(sc, evp));
}
#endif
int
wskbdopen(dev_t dev, int flags, int mode, struct lwp *l)
{
struct wskbd_softc *sc = device_lookup_private(&wskbd_cd, minor(dev));
struct wseventvar *evar;
int error;
if (sc == NULL)
return (ENXIO);
#if NWSMUX > 0
DPRINTF(("wskbdopen: %s mux=%p l=%p\n",
device_xname(sc->sc_base.me_dv), sc->sc_base.me_parent, l));
#endif
if (sc->sc_dying)
return (EIO);
if ((flags & (FREAD | FWRITE)) == FWRITE)
/* Not opening for read, only ioctl is available. */
return (0);
#if NWSMUX > 0
if (sc->sc_base.me_parent != NULL) {
/* Grab the keyboard out of the greedy hands of the mux. */
DPRINTF(("wskbdopen: detach\n"));
wsmux_detach_sc(&sc->sc_base);
}
#endif
if (sc->sc_base.me_evp != NULL)
return (EBUSY);
evar = &sc->sc_base.me_evar;
wsevent_init(evar, l->l_proc);
error = wskbd_do_open(sc, evar);
if (error) {
DPRINTF(("wskbdopen: %s open failed\n",
device_xname(sc->sc_base.me_dv)));
sc->sc_base.me_evp = NULL;
wsevent_fini(evar);
}
return (error);
}
int
wskbd_do_open(struct wskbd_softc *sc, struct wseventvar *evp)
{
sc->sc_base.me_evp = evp;
sc->sc_translating = 0;
return (wskbd_enable(sc, 1));
}
int
wskbdclose(dev_t dev, int flags, int mode,
struct lwp *l)
{
struct wskbd_softc *sc =
device_lookup_private(&wskbd_cd, minor(dev));
struct wseventvar *evar = sc->sc_base.me_evp;
if (evar == NULL)
/* not open for read */
return (0);
sc->sc_base.me_evp = NULL;
sc->sc_translating = 1;
(void)wskbd_enable(sc, 0);
wsevent_fini(evar);
return (0);
}
#if NWSMUX > 0
int
wskbd_mux_close(struct wsevsrc *me)
{
struct wskbd_softc *sc = (struct wskbd_softc *)me;
sc->sc_base.me_evp = NULL;
sc->sc_translating = 1;
(void)wskbd_enable(sc, 0);
return (0);
}
#endif
int
wskbdread(dev_t dev, struct uio *uio, int flags)
{
struct wskbd_softc *sc =
device_lookup_private(&wskbd_cd, minor(dev));
int error;
if (sc->sc_dying)
return (EIO);
#ifdef DIAGNOSTIC
if (sc->sc_base.me_evp == NULL) {
printf("wskbdread: evp == NULL\n");
return (EINVAL);
}
#endif
sc->sc_refcnt++;
error = wsevent_read(sc->sc_base.me_evp, uio, flags);
if (--sc->sc_refcnt < 0) {
wakeup(sc);
error = EIO;
}
return (error);
}
int
wskbdioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
{
return (wskbd_do_ioctl(device_lookup(&wskbd_cd, minor(dev)),
cmd, data, flag,l));
}
/* A wrapper around the ioctl() workhorse to make reference counting easy. */
int
wskbd_do_ioctl(device_t dv, u_long cmd, void *data, int flag,
struct lwp *l)
{
struct wskbd_softc *sc = device_private(dv);
int error;
sc->sc_refcnt++;
error = wskbd_do_ioctl_sc(sc, cmd, data, flag, l);
if (--sc->sc_refcnt < 0)
wakeup(sc);
return (error);
}
int
wskbd_do_ioctl_sc(struct wskbd_softc *sc, u_long cmd, void *data, int flag,
struct lwp *l)
{
/*
* Try the generic ioctls that the wskbd interface supports.
*/
switch (cmd) {
case FIONBIO: /* we will remove this someday (soon???) */
return (0);
case FIOASYNC:
if (sc->sc_base.me_evp == NULL)
return (EINVAL);
sc->sc_base.me_evp->async = *(int *)data != 0;
return (0);
case FIOSETOWN:
if (sc->sc_base.me_evp == NULL)
return (EINVAL);
if (-*(int *)data != sc->sc_base.me_evp->io->p_pgid
&& *(int *)data != sc->sc_base.me_evp->io->p_pid)
return (EPERM);
return (0);
case TIOCSPGRP:
if (sc->sc_base.me_evp == NULL)
return (EINVAL);
if (*(int *)data != sc->sc_base.me_evp->io->p_pgid)
return (EPERM);
return (0);
}
/*
* Try the keyboard driver for WSKBDIO ioctls. It returns EPASSTHROUGH
* if it didn't recognize the request.
*/
return (wskbd_displayioctl(sc->sc_base.me_dv, cmd, data, flag, l));
}
/*
* WSKBDIO ioctls, handled in both emulation mode and in ``raw'' mode.
* Some of these have no real effect in raw mode, however.
*/
static int
wskbd_displayioctl(device_t dev, u_long cmd, void *data, int flag,
struct lwp *l)
{
#ifdef WSDISPLAY_SCROLLSUPPORT
struct wskbd_scroll_data *usdp, *ksdp;
#endif
struct wskbd_softc *sc = device_private(dev);
struct wskbd_bell_data *ubdp, *kbdp;
struct wskbd_keyrepeat_data *ukdp, *kkdp;
struct wskbd_map_data *umdp;
struct wskbd_mapdata md;
kbd_t enc;
void *tbuf;
int len, error;
switch (cmd) {
#define SETBELL(dstp, srcp, dfltp) \
do { \
(dstp)->pitch = ((srcp)->which & WSKBD_BELL_DOPITCH) ? \
(srcp)->pitch : (dfltp)->pitch; \
(dstp)->period = ((srcp)->which & WSKBD_BELL_DOPERIOD) ? \
(srcp)->period : (dfltp)->period; \
(dstp)->volume = ((srcp)->which & WSKBD_BELL_DOVOLUME) ? \
(srcp)->volume : (dfltp)->volume; \
(dstp)->which = WSKBD_BELL_DOALL; \
} while (0)
case WSKBDIO_BELL:
if ((flag & FWRITE) == 0)
return (EACCES);
return ((*sc->sc_accessops->ioctl)(sc->sc_accesscookie,
WSKBDIO_COMPLEXBELL, (void *)&sc->sc_bell_data, flag, l));
case WSKBDIO_COMPLEXBELL:
if ((flag & FWRITE) == 0)
return (EACCES);
ubdp = (struct wskbd_bell_data *)data;
SETBELL(ubdp, ubdp, &sc->sc_bell_data);
return ((*sc->sc_accessops->ioctl)(sc->sc_accesscookie,
WSKBDIO_COMPLEXBELL, (void *)ubdp, flag, l));
case WSKBDIO_SETBELL:
if ((flag & FWRITE) == 0)
return (EACCES);
kbdp = &sc->sc_bell_data;
setbell:
ubdp = (struct wskbd_bell_data *)data;
SETBELL(kbdp, ubdp, kbdp);
return (0);
case WSKBDIO_GETBELL:
kbdp = &sc->sc_bell_data;
getbell:
ubdp = (struct wskbd_bell_data *)data;
SETBELL(ubdp, kbdp, kbdp);
return (0);
case WSKBDIO_SETDEFAULTBELL:
if ((error = kauth_authorize_device(l->l_cred,
KAUTH_DEVICE_WSCONS_KEYBOARD_BELL, NULL, NULL,
NULL, NULL)) != 0)
return (error);
kbdp = &wskbd_default_bell_data;
goto setbell;
case WSKBDIO_GETDEFAULTBELL:
kbdp = &wskbd_default_bell_data;
goto getbell;
#undef SETBELL
#define SETKEYREPEAT(dstp, srcp, dfltp) \
do { \
(dstp)->del1 = ((srcp)->which & WSKBD_KEYREPEAT_DODEL1) ? \
(srcp)->del1 : (dfltp)->del1; \
(dstp)->delN = ((srcp)->which & WSKBD_KEYREPEAT_DODELN) ? \
(srcp)->delN : (dfltp)->delN; \
(dstp)->which = WSKBD_KEYREPEAT_DOALL; \
} while (0)
case WSKBDIO_SETKEYREPEAT:
if ((flag & FWRITE) == 0)
return (EACCES);
kkdp = &sc->sc_keyrepeat_data;
setkeyrepeat:
ukdp = (struct wskbd_keyrepeat_data *)data;
SETKEYREPEAT(kkdp, ukdp, kkdp);
return (0);
case WSKBDIO_GETKEYREPEAT:
kkdp = &sc->sc_keyrepeat_data;
getkeyrepeat:
ukdp = (struct wskbd_keyrepeat_data *)data;
SETKEYREPEAT(ukdp, kkdp, kkdp);
return (0);
case WSKBDIO_SETDEFAULTKEYREPEAT:
if ((error = kauth_authorize_device(l->l_cred,
KAUTH_DEVICE_WSCONS_KEYBOARD_KEYREPEAT, NULL, NULL,
NULL, NULL)) != 0)
return (error);
kkdp = &wskbd_default_keyrepeat_data;
goto setkeyrepeat;
case WSKBDIO_GETDEFAULTKEYREPEAT:
kkdp = &wskbd_default_keyrepeat_data;
goto getkeyrepeat;
#ifdef WSDISPLAY_SCROLLSUPPORT
#define SETSCROLLMOD(dstp, srcp, dfltp) \
do { \
(dstp)->mode = ((srcp)->which & WSKBD_SCROLL_DOMODE) ? \
(srcp)->mode : (dfltp)->mode; \
(dstp)->modifier = ((srcp)->which & WSKBD_SCROLL_DOMODIFIER) ? \
(srcp)->modifier : (dfltp)->modifier; \
(dstp)->which = WSKBD_SCROLL_DOALL; \
} while (0)
case WSKBDIO_SETSCROLL:
usdp = (struct wskbd_scroll_data *)data;
ksdp = &sc->sc_scroll_data;
SETSCROLLMOD(ksdp, usdp, ksdp);
return (0);
case WSKBDIO_GETSCROLL:
usdp = (struct wskbd_scroll_data *)data;
ksdp = &sc->sc_scroll_data;
SETSCROLLMOD(usdp, ksdp, ksdp);
return (0);
#else
case WSKBDIO_GETSCROLL:
case WSKBDIO_SETSCROLL:
return ENODEV;
#endif
#undef SETKEYREPEAT
case WSKBDIO_SETMAP:
if ((flag & FWRITE) == 0)
return (EACCES);
umdp = (struct wskbd_map_data *)data;
if (umdp->maplen > WSKBDIO_MAXMAPLEN)
return (EINVAL);
len = umdp->maplen*sizeof(struct wscons_keymap);
tbuf = malloc(len, M_TEMP, M_WAITOK);
error = copyin(umdp->map, tbuf, len);
if (error == 0) {
wskbd_init_keymap(umdp->maplen,
&sc->sc_map, &sc->sc_maplen);
memcpy(sc->sc_map, tbuf, len);
/* drop the variant bits handled by the map */
sc->sc_layout = KB_USER |
(KB_VARIANT(sc->sc_layout) & KB_HANDLEDBYWSKBD);
wskbd_update_layout(sc->id, sc->sc_layout);
}
free(tbuf, M_TEMP);
return(error);
case WSKBDIO_GETMAP:
umdp = (struct wskbd_map_data *)data;
if (umdp->maplen > sc->sc_maplen)
umdp->maplen = sc->sc_maplen;
error = copyout(sc->sc_map, umdp->map,
umdp->maplen*sizeof(struct wscons_keymap));
return(error);
case WSKBDIO_GETENCODING:
*((kbd_t *) data) = sc->sc_layout;
return(0);
case WSKBDIO_SETENCODING:
if ((flag & FWRITE) == 0)
return (EACCES);
enc = *((kbd_t *)data);
if (KB_ENCODING(enc) == KB_USER) {
/* user map must already be loaded */
if (KB_ENCODING(sc->sc_layout) != KB_USER)
return (EINVAL);
/* map variants make no sense */
if (KB_VARIANT(enc) & ~KB_HANDLEDBYWSKBD)
return (EINVAL);
} else {
md = *(sc->id->t_keymap); /* structure assignment */
md.layout = enc;
error = wskbd_load_keymap(&md, &sc->sc_map,
&sc->sc_maplen);
if (error)
return (error);
}
sc->sc_layout = enc;
wskbd_update_layout(sc->id, enc);
return (0);
case WSKBDIO_SETVERSION:
return wsevent_setversion(sc->sc_base.me_evp, *(int *)data);
}
/*
* Try the keyboard driver for WSKBDIO ioctls. It returns -1
* if it didn't recognize the request, and in turn we return
* -1 if we didn't recognize the request.
*/
/* printf("kbdaccess\n"); */
error = (*sc->sc_accessops->ioctl)(sc->sc_accesscookie, cmd, data,
flag, l);
#ifdef WSDISPLAY_COMPAT_RAWKBD
if (!error && cmd == WSKBDIO_SETMODE && *(int *)data == WSKBD_RAW) {
int s = spltty();
sc->id->t_modifiers &= ~(MOD_SHIFT_L | MOD_SHIFT_R
| MOD_CONTROL_L | MOD_CONTROL_R
| MOD_META_L | MOD_META_R
| MOD_COMMAND
| MOD_COMMAND1 | MOD_COMMAND2);
if (sc->sc_repeating) {
sc->sc_repeating = 0;
callout_stop(&sc->sc_repeat_ch);
}
splx(s);
}
#endif
return (error);
}
int
wskbdpoll(dev_t dev, int events, struct lwp *l)
{
struct wskbd_softc *sc =
device_lookup_private(&wskbd_cd, minor(dev));
if (sc->sc_base.me_evp == NULL)
return (POLLERR);
return (wsevent_poll(sc->sc_base.me_evp, events, l));
}
int
wskbdkqfilter(dev_t dev, struct knote *kn)
{
struct wskbd_softc *sc =
device_lookup_private(&wskbd_cd, minor(dev));
if (sc->sc_base.me_evp == NULL)
return (1);
return (wsevent_kqfilter(sc->sc_base.me_evp, kn));
}
#if NWSDISPLAY > 0
int
wskbd_pickfree(void)
{
int i;
struct wskbd_softc *sc;
for (i = 0; i < wskbd_cd.cd_ndevs; i++) {
sc = device_lookup_private(&wskbd_cd, i);
if (sc == NULL)
continue;
if (sc->sc_base.me_dispdv == NULL)
return (i);
}
return (-1);
}
struct wsevsrc *
wskbd_set_console_display(device_t displaydv, struct wsevsrc *me)
{
struct wskbd_softc *sc = wskbd_console_device;
if (sc == NULL)
return (NULL);
sc->sc_base.me_dispdv = displaydv;
#if NWSMUX > 0
(void)wsmux_attach_sc((struct wsmux_softc *)me, &sc->sc_base);
#endif
return (&sc->sc_base);
}
int
wskbd_set_display(device_t dv, struct wsevsrc *me)
{
struct wskbd_softc *sc = device_private(dv);
device_t displaydv = me != NULL ? me->me_dispdv : NULL;
device_t odisplaydv;
int error;
DPRINTF(("wskbd_set_display: %s me=%p odisp=%p disp=%p cons=%d\n",
device_xname(dv), me, sc->sc_base.me_dispdv, displaydv,
sc->sc_isconsole));
if (sc->sc_isconsole)
return (EBUSY);
if (displaydv != NULL) {
if (sc->sc_base.me_dispdv != NULL)
return (EBUSY);
} else {
if (sc->sc_base.me_dispdv == NULL)
return (ENXIO);
}
odisplaydv = sc->sc_base.me_dispdv;
sc->sc_base.me_dispdv = NULL;
error = wskbd_enable(sc, displaydv != NULL);
sc->sc_base.me_dispdv = displaydv;
if (error) {
sc->sc_base.me_dispdv = odisplaydv;
return (error);
}
if (displaydv)
aprint_verbose_dev(sc->sc_base.me_dv, "connecting to %s\n",
device_xname(displaydv));
else
aprint_verbose_dev(sc->sc_base.me_dv, "disconnecting from %s\n",
device_xname(odisplaydv));
return (0);
}
#endif /* NWSDISPLAY > 0 */
#if NWSMUX > 0
int
wskbd_add_mux(int unit, struct wsmux_softc *muxsc)
{
struct wskbd_softc *sc = device_lookup_private(&wskbd_cd, unit);
if (sc == NULL)
return (ENXIO);
if (sc->sc_base.me_parent != NULL || sc->sc_base.me_evp != NULL)
return (EBUSY);
return (wsmux_attach_sc(muxsc, &sc->sc_base));
}
#endif
/*
* Console interface.
*/
int
wskbd_cngetc(dev_t dev)
{
static int num = 0;
static int pos;
u_int type;
int data;
keysym_t ks;
if (!wskbd_console_initted)
return 0;
if (wskbd_console_device != NULL &&
!wskbd_console_device->sc_translating)
return 0;
for(;;) {
if (num-- > 0) {
ks = wskbd_console_data.t_symbols[pos++];
if (KS_GROUP(ks) == KS_GROUP_Plain)
return (KS_VALUE(ks));
} else {
(*wskbd_console_data.t_consops->getc)
(wskbd_console_data.t_consaccesscookie,
&type, &data);
if (type == WSCONS_EVENT_ASCII) {
/*
* We assume that when the driver falls back
* to deliver pure ASCII it is in a state that
* it can not track press/release events
* reliable - so we clear all previously
* accumulated modifier state.
*/
wskbd_console_data.t_modifiers = 0;
return(data);
}
num = wskbd_translate(&wskbd_console_data, type, data);
pos = 0;
}
}
}
void
wskbd_cnpollc(dev_t dev, int poll)
{
if (!wskbd_console_initted)
return;
if (wskbd_console_device != NULL &&
!wskbd_console_device->sc_translating)
return;
(*wskbd_console_data.t_consops->pollc)
(wskbd_console_data.t_consaccesscookie, poll);
}
void
wskbd_cnbell(dev_t dev, u_int pitch, u_int period, u_int volume)
{
if (!wskbd_console_initted)
return;
if (wskbd_console_data.t_consops->bell != NULL)
(*wskbd_console_data.t_consops->bell)
(wskbd_console_data.t_consaccesscookie, pitch, period,
volume);
}
static inline void
update_leds(struct wskbd_internal *id)
{
int new_state;
new_state = 0;
if (id->t_modifiers & (MOD_SHIFTLOCK | MOD_CAPSLOCK))
new_state |= WSKBD_LED_CAPS;
if (id->t_modifiers & MOD_NUMLOCK)
new_state |= WSKBD_LED_NUM;
if (id->t_modifiers & MOD_COMPOSE)
new_state |= WSKBD_LED_COMPOSE;
if (id->t_modifiers & MOD_HOLDSCREEN)
new_state |= WSKBD_LED_SCROLL;
if (id->t_sc && new_state != id->t_sc->sc_ledstate) {
(*id->t_sc->sc_accessops->set_leds)
(id->t_sc->sc_accesscookie, new_state);
id->t_sc->sc_ledstate = new_state;
}
}
static inline void
update_modifier(struct wskbd_internal *id, u_int type, int toggle, int mask)
{
if (toggle) {
if (type == WSCONS_EVENT_KEY_DOWN)
id->t_modifiers ^= mask;
} else {
if (type == WSCONS_EVENT_KEY_DOWN)
id->t_modifiers |= mask;
else
id->t_modifiers &= ~mask;
}
}
#if NWSDISPLAY > 0
static void
change_displayparam(struct wskbd_softc *sc, int param, int updown,
int wraparound)
{
int res;
struct wsdisplay_param dp;
dp.param = param;
res = wsdisplay_param(sc->sc_base.me_dispdv, WSDISPLAYIO_GETPARAM, &dp);
if (res == EINVAL)
return; /* no such parameter */
dp.curval += updown;
if (dp.max < dp.curval)
dp.curval = wraparound ? dp.min : dp.max;
else
if (dp.curval < dp.min)
dp.curval = wraparound ? dp.max : dp.min;
wsdisplay_param(sc->sc_base.me_dispdv, WSDISPLAYIO_SETPARAM, &dp);
}
#endif
static int
internal_command(struct wskbd_softc *sc, u_int *type, keysym_t ksym,
keysym_t ksym2)
{
#if NWSDISPLAY > 0 && defined(WSDISPLAY_SCROLLSUPPORT)
u_int state = 0;
#endif
switch (ksym) {
case KS_Cmd_VolumeToggle:
if (*type == WSCONS_EVENT_KEY_DOWN)
pmf_event_inject(NULL, PMFE_AUDIO_VOLUME_TOGGLE);
break;
case KS_Cmd_VolumeUp:
if (*type == WSCONS_EVENT_KEY_DOWN)
pmf_event_inject(NULL, PMFE_AUDIO_VOLUME_UP);
break;
case KS_Cmd_VolumeDown:
if (*type == WSCONS_EVENT_KEY_DOWN)
pmf_event_inject(NULL, PMFE_AUDIO_VOLUME_DOWN);
break;
#if NWSDISPLAY > 0 && defined(WSDISPLAY_SCROLLSUPPORT)
case KS_Cmd_ScrollFastUp:
case KS_Cmd_ScrollFastDown:
if (*type == WSCONS_EVENT_KEY_DOWN) {
GETMODSTATE(sc->id->t_modifiers, state);
if ((sc->sc_scroll_data.mode == WSKBD_SCROLL_MODE_HOLD
&& MOD_ONESET(sc->id, MOD_HOLDSCREEN))
|| (sc->sc_scroll_data.mode == WSKBD_SCROLL_MODE_NORMAL
&& sc->sc_scroll_data.modifier == state)) {
update_modifier(sc->id, *type, 0, MOD_COMMAND);
wsdisplay_scroll(sc->sc_base.me_dispdv,
(ksym == KS_Cmd_ScrollFastUp) ?
WSDISPLAY_SCROLL_BACKWARD :
WSDISPLAY_SCROLL_FORWARD);
return (1);
} else {
return (0);
}
}
case KS_Cmd_ScrollSlowUp:
case KS_Cmd_ScrollSlowDown:
if (*type == WSCONS_EVENT_KEY_DOWN) {
GETMODSTATE(sc->id->t_modifiers, state);
if ((sc->sc_scroll_data.mode == WSKBD_SCROLL_MODE_HOLD
&& MOD_ONESET(sc->id, MOD_HOLDSCREEN))
|| (sc->sc_scroll_data.mode == WSKBD_SCROLL_MODE_NORMAL
&& sc->sc_scroll_data.modifier == state)) {
update_modifier(sc->id, *type, 0, MOD_COMMAND);
wsdisplay_scroll(sc->sc_base.me_dispdv,
(ksym == KS_Cmd_ScrollSlowUp) ?
WSDISPLAY_SCROLL_BACKWARD | WSDISPLAY_SCROLL_LOW:
WSDISPLAY_SCROLL_FORWARD | WSDISPLAY_SCROLL_LOW);
return (1);
} else {
return (0);
}
}
#endif
case KS_Cmd:
update_modifier(sc->id, *type, 0, MOD_COMMAND);
ksym = ksym2;
break;
case KS_Cmd1:
update_modifier(sc->id, *type, 0, MOD_COMMAND1);
break;
case KS_Cmd2:
update_modifier(sc->id, *type, 0, MOD_COMMAND2);
break;
}
if (*type != WSCONS_EVENT_KEY_DOWN ||
(! MOD_ONESET(sc->id, MOD_COMMAND) &&
! MOD_ALLSET(sc->id, MOD_COMMAND1 | MOD_COMMAND2)))
return (0);
#if defined(DDB) || defined(KGDB)
if (ksym == KS_Cmd_Debugger) {
if (sc->sc_isconsole) {
#ifdef DDB
console_debugger();
#endif
#ifdef KGDB
kgdb_connect(1);
#endif
}
/* discard this key (ddb discarded command modifiers) */
*type = WSCONS_EVENT_KEY_UP;
return (1);
}
#endif
#if NWSDISPLAY > 0
if (sc->sc_base.me_dispdv == NULL)
return (0);
switch (ksym) {
case KS_Cmd_Screen0:
case KS_Cmd_Screen1:
case KS_Cmd_Screen2:
case KS_Cmd_Screen3:
case KS_Cmd_Screen4:
case KS_Cmd_Screen5:
case KS_Cmd_Screen6:
case KS_Cmd_Screen7:
case KS_Cmd_Screen8:
case KS_Cmd_Screen9:
wsdisplay_switch(sc->sc_base.me_dispdv, ksym - KS_Cmd_Screen0, 0);
return (1);
case KS_Cmd_ResetEmul:
wsdisplay_reset(sc->sc_base.me_dispdv, WSDISPLAY_RESETEMUL);
return (1);
case KS_Cmd_ResetClose:
wsdisplay_reset(sc->sc_base.me_dispdv, WSDISPLAY_RESETCLOSE);
return (1);
case KS_Cmd_BacklightOn:
case KS_Cmd_BacklightOff:
case KS_Cmd_BacklightToggle:
change_displayparam(sc, WSDISPLAYIO_PARAM_BACKLIGHT,
ksym == KS_Cmd_BacklightOff ? -1 : 1,
ksym == KS_Cmd_BacklightToggle ? 1 : 0);
return (1);
case KS_Cmd_BrightnessUp:
case KS_Cmd_BrightnessDown:
case KS_Cmd_BrightnessRotate:
change_displayparam(sc, WSDISPLAYIO_PARAM_BRIGHTNESS,
ksym == KS_Cmd_BrightnessDown ? -1 : 1,
ksym == KS_Cmd_BrightnessRotate ? 1 : 0);
return (1);
case KS_Cmd_ContrastUp:
case KS_Cmd_ContrastDown:
case KS_Cmd_ContrastRotate:
change_displayparam(sc, WSDISPLAYIO_PARAM_CONTRAST,
ksym == KS_Cmd_ContrastDown ? -1 : 1,
ksym == KS_Cmd_ContrastRotate ? 1 : 0);
return (1);
}
#endif
return (0);
}
device_t
wskbd_hotkey_register(device_t self, void *cookie, wskbd_hotkey_plugin *hotkey)
{
struct wskbd_softc *sc = device_private(self);
KASSERT(sc != NULL);
KASSERT(hotkey != NULL);
sc->sc_hotkey = hotkey;
sc->sc_hotkeycookie = cookie;
return sc->sc_base.me_dv;
}
void
wskbd_hotkey_deregister(device_t self)
{
struct wskbd_softc *sc = device_private(self);
KASSERT(sc != NULL);
sc->sc_hotkey = NULL;
sc->sc_hotkeycookie = NULL;
}
static int
wskbd_translate(struct wskbd_internal *id, u_int type, int value)
{
struct wskbd_softc *sc = id->t_sc;
keysym_t ksym, res, *group;
struct wscons_keymap kpbuf, *kp;
int iscommand = 0;
int ishotkey = 0;
if (type == WSCONS_EVENT_ALL_KEYS_UP) {
id->t_modifiers &= ~(MOD_SHIFT_L | MOD_SHIFT_R
| MOD_CONTROL_L | MOD_CONTROL_R
| MOD_META_L | MOD_META_R
| MOD_MODESHIFT
| MOD_COMMAND | MOD_COMMAND1 | MOD_COMMAND2);
update_leds(id);
return (0);
}
if (sc != NULL) {
if (sc->sc_hotkey != NULL)
ishotkey = sc->sc_hotkey(sc, sc->sc_hotkeycookie,
type, value);
if (ishotkey)
return 0;
if (value < 0 || value >= sc->sc_maplen) {
#ifdef DEBUG
printf("%s: keycode %d out of range\n",
__func__, value);
#endif
return (0);
}
kp = sc->sc_map + value;
} else {
kp = &kpbuf;
wskbd_get_mapentry(id->t_keymap, value, kp);
}
/* if this key has a command, process it first */
if (sc != NULL && kp->command != KS_voidSymbol)
iscommand = internal_command(sc, &type, kp->command,
kp->group1[0]);
/* Now update modifiers */
switch (kp->group1[0]) {
case KS_Shift_L:
update_modifier(id, type, 0, MOD_SHIFT_L);
break;
case KS_Shift_R:
update_modifier(id, type, 0, MOD_SHIFT_R);
break;
case KS_Shift_Lock:
update_modifier(id, type, 1, MOD_SHIFTLOCK);
break;
case KS_Caps_Lock:
update_modifier(id, type, 1, MOD_CAPSLOCK);
break;
case KS_Control_L:
update_modifier(id, type, 0, MOD_CONTROL_L);
break;
case KS_Control_R:
update_modifier(id, type, 0, MOD_CONTROL_R);
break;
case KS_Alt_L:
update_modifier(id, type, 0, MOD_META_L);
break;
case KS_Alt_R:
update_modifier(id, type, 0, MOD_META_R);
break;
case KS_Mode_switch:
update_modifier(id, type, 0, MOD_MODESHIFT);
break;
case KS_Num_Lock:
update_modifier(id, type, 1, MOD_NUMLOCK);
break;
#if NWSDISPLAY > 0
case KS_Hold_Screen:
if (sc != NULL) {
update_modifier(id, type, 1, MOD_HOLDSCREEN);
wskbd_holdscreen(sc, id->t_modifiers & MOD_HOLDSCREEN);
}
break;
#endif
}
/* If this is a key release or we are in command mode, we are done */
if (type != WSCONS_EVENT_KEY_DOWN || iscommand) {
update_leds(id);
return (0);
}
/* Get the keysym */
if (id->t_modifiers & MOD_MODESHIFT)
group = & kp->group2[0];
else
group = & kp->group1[0];
if ((id->t_modifiers & MOD_NUMLOCK) != 0 &&
KS_GROUP(group[1]) == KS_GROUP_Keypad) {
if (MOD_ONESET(id, MOD_ANYSHIFT))
ksym = group[0];
else
ksym = group[1];
} else if (! MOD_ONESET(id, MOD_ANYSHIFT | MOD_CAPSLOCK)) {
ksym = group[0];
} else if (MOD_ONESET(id, MOD_CAPSLOCK)) {
if (! MOD_ONESET(id, MOD_SHIFT_L | MOD_SHIFT_R))
ksym = group[0];
else
ksym = group[1];
if (ksym >= KS_a && ksym <= KS_z)
ksym += KS_A - KS_a;
else if (ksym >= KS_agrave && ksym <= KS_thorn &&
ksym != KS_division)
ksym += KS_Agrave - KS_agrave;
} else if (MOD_ONESET(id, MOD_ANYSHIFT)) {
ksym = group[1];
} else {
ksym = group[0];
}
/* Process compose sequence and dead accents */
res = KS_voidSymbol;
switch (KS_GROUP(ksym)) {
case KS_GROUP_Plain:
case KS_GROUP_Keypad:
case KS_GROUP_Function:
res = ksym;
break;
case KS_GROUP_Mod:
if (ksym == KS_Multi_key) {
update_modifier(id, 1, 0, MOD_COMPOSE);
id->t_composelen = 2;
}
break;
case KS_GROUP_Dead:
if (id->t_composelen == 0) {
update_modifier(id, 1, 0, MOD_COMPOSE);
id->t_composelen = 1;
id->t_composebuf[0] = ksym;
} else
res = ksym;
break;
}
if (res == KS_voidSymbol) {
update_leds(id);
return (0);
}
if (id->t_composelen > 0) {
id->t_composebuf[2 - id->t_composelen] = res;
if (--id->t_composelen == 0) {
res = wskbd_compose_value(id->t_composebuf);
update_modifier(id, 0, 0, MOD_COMPOSE);
} else {
return (0);
}
}
update_leds(id);
/* We are done, return the symbol */
if (KS_GROUP(res) == KS_GROUP_Plain) {
if (MOD_ONESET(id, MOD_ANYCONTROL)) {
if ((res >= KS_at && res <= KS_z) || res == KS_space)
res = res & 0x1f;
else if (res == KS_2)
res = 0x00;
else if (res >= KS_3 && res <= KS_7)
res = KS_Escape + (res - KS_3);
else if (res == KS_8)
res = KS_Delete;
/* convert CTL-/ to ^_ as xterm does (undo in emacs) */
else if (res == KS_slash)
res = KS_underscore & 0x1f;
}
if (MOD_ONESET(id, MOD_ANYMETA)) {
if (id->t_flags & WSKFL_METAESC) {
id->t_symbols[0] = KS_Escape;
id->t_symbols[1] = res;
return (2);
} else
res |= 0x80;
}
}
id->t_symbols[0] = res;
return (1);
}
void
wskbd_set_evtrans(device_t dev, keysym_t *tab, int len)
{
struct wskbd_softc *sc = device_private(dev);
sc->sc_evtrans_len = len;
sc->sc_evtrans = tab;
}
|
execunix/vinos
|
sys/dev/wscons/wskbd.c
|
C
|
apache-2.0
| 48,383
|
/* Copyright 2012 Thorben Lindhauer
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.unipotsdam.hpi.thorben.ppi.condition.event;
import de.unipotsdam.hpi.thorben.ppi.condition.ActivityEndCondition;
import de.unipotsdam.hpi.thorben.ppi.condition.ActivityStartCondition;
import de.unipotsdam.hpi.thorben.ppi.condition.PPICondition;
/**
* Corresponds to Time Instant Conditions in the PPI ontology.
* @author Thorben
*
*/
public abstract class ConditionEvent {
private String processInstanceId;
public String getProcessInstanceId() {
return processInstanceId;
}
public void setProcessInstanceId(String processInstanceId) {
this.processInstanceId = processInstanceId;
}
/*
* pseudo double dispatch methods, to be overriden in subclasses
*/
public boolean fulfills(PPICondition condition) {
return false;
}
public boolean fulfills(ActivityStartCondition condition) {
return false;
}
public boolean fulfills(ActivityEndCondition condition) {
return false;
}
}
|
ThorbenLindhauer/activiti-engine-ppi
|
modules/activiti-engine/src/main/java/de/unipotsdam/hpi/thorben/ppi/condition/event/ConditionEvent.java
|
Java
|
apache-2.0
| 1,528
|
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>executor::post</title>
<link rel="stylesheet" href="../../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="../../../index.html" title="Asio">
<link rel="up" href="../executor.html" title="executor">
<link rel="prev" href="operator_eq__eq_.html" title="executor::operator==">
<link rel="next" href="target.html" title="executor::target">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="asio C++ library" width="250" height="60" src="../../../asio.png"></td></tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="operator_eq__eq_.html"><img src="../../../prev.png" alt="Prev"></a><a accesskey="u" href="../executor.html"><img src="../../../up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../home.png" alt="Home"></a><a accesskey="n" href="target.html"><img src="../../../next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="asio.reference.executor.post"></a><a class="link" href="post.html" title="executor::post">executor::post</a>
</h4></div></div></div>
<p>
<a class="indexterm" name="idp160995104"></a>
Request the executor to invoke the given function object.
</p>
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span>
<span class="keyword">typename</span> <span class="identifier">Function</span><span class="special">,</span>
<span class="keyword">typename</span> <span class="identifier">Allocator</span><span class="special">></span>
<span class="keyword">void</span> <span class="identifier">post</span><span class="special">(</span>
<span class="identifier">Function</span> <span class="special">&&</span> <span class="identifier">f</span><span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">Allocator</span> <span class="special">&</span> <span class="identifier">a</span><span class="special">);</span>
</pre>
<p>
This function is used to ask the executor to execute the given function
object. The function object is executed according to the rules of the target
executor object.
</p>
<h6>
<a name="asio.reference.executor.post.h0"></a>
<span><a name="asio.reference.executor.post.parameters"></a></span><a class="link" href="post.html#asio.reference.executor.post.parameters">Parameters</a>
</h6>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">f</span></dt>
<dd>
<p>
The function object to be called. The executor will make a copy of
the handler object as required. The function signature of the function
object must be:
</p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">function</span><span class="special">();</span>
</pre>
<p>
</p>
</dd>
<dt><span class="term">a</span></dt>
<dd><p>
An allocator that may be used by the executor to allocate the internal
storage needed for function invocation.
</p></dd>
</dl>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2003-2015 Christopher M.
Kohlhoff<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="operator_eq__eq_.html"><img src="../../../prev.png" alt="Prev"></a><a accesskey="u" href="../executor.html"><img src="../../../up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../home.png" alt="Home"></a><a accesskey="n" href="target.html"><img src="../../../next.png" alt="Next"></a>
</div>
</body>
</html>
|
letitvi/VideoGridPlayer
|
thirdparty/source/asio-1.11.0/doc/asio/reference/executor/post.html
|
HTML
|
apache-2.0
| 4,281
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.