text stringlengths 2 1.04M | meta dict |
|---|---|
layout: post
date: 2016-02-01
title: "Jovani Black Sleeveless Lace Prom Dress 90897 Sleeveless Sweep/Brush Train Sheath/Column"
category: Jovani
tags: [Jovani ,Jovani,Sheath/Column,V-neck,Sweep/Brush Train,Sleeveless]
---
### Jovani Black Sleeveless Lace Prom Dress 90897
Just **$538.98**
### Sleeveless Sweep/Brush Train Sheath/Column
<table><tr><td>BRANDS</td><td>Jovani</td></tr><tr><td>Silhouette</td><td>Sheath/Column</td></tr><tr><td>Neckline</td><td>V-neck</td></tr><tr><td>Hemline/Train</td><td>Sweep/Brush Train</td></tr><tr><td>Sleeve</td><td>Sleeveless</td></tr></table>
<a href="https://www.readybrides.com/en/jovani-/39484-jovani-black-sleeveless-lace-prom-dress-90897.html"><img src="//img.readybrides.com/85033/jovani-black-sleeveless-lace-prom-dress-90897.jpg" alt="Jovani Black Sleeveless Lace Prom Dress 90897" style="width:100%;" /></a>
<!-- break --><a href="https://www.readybrides.com/en/jovani-/39484-jovani-black-sleeveless-lace-prom-dress-90897.html"><img src="//img.readybrides.com/85032/jovani-black-sleeveless-lace-prom-dress-90897.jpg" alt="Jovani Black Sleeveless Lace Prom Dress 90897" style="width:100%;" /></a>
Buy it: [https://www.readybrides.com/en/jovani-/39484-jovani-black-sleeveless-lace-prom-dress-90897.html](https://www.readybrides.com/en/jovani-/39484-jovani-black-sleeveless-lace-prom-dress-90897.html)
| {
"content_hash": "2c30a9a956f184ef0e70740a5732c831",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 287,
"avg_line_length": 96.57142857142857,
"alnum_prop": 0.742603550295858,
"repo_name": "novstylessee/novstylessee.github.io",
"id": "bfde2d1c4f6613e7efec6d42a046fd223e50ff7a",
"size": "1356",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2016-02-01-Jovani-Black-Sleeveless-Lace-Prom-Dress-90897-Sleeveless-SweepBrush-Train-SheathColumn.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "83876"
},
{
"name": "HTML",
"bytes": "14755"
},
{
"name": "Ruby",
"bytes": "897"
}
],
"symlink_target": ""
} |
<?xml version="1.0"?>
<!--
~ Copyright 2015 OpenCB
~
~ 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.
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.opencb.biodata</groupId>
<artifactId>biodata</artifactId>
<version>0.6.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.opencb.biodata</groupId>
<artifactId>biodata-tools</artifactId>
<version>${biodata.version}</version>
<name>tools</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>org.opencb.ga4gh</groupId>
<artifactId>ga4gh</artifactId>
<version>0.5.1</version>
</dependency>
<dependency>
<groupId>org.opencb.biodata</groupId>
<artifactId>biodata-formats</artifactId>
</dependency>
<dependency>
<groupId>org.opencb.biodata</groupId>
<artifactId>biodata-models</artifactId>
</dependency>
<dependency>
<groupId>org.opencb.commons</groupId>
<artifactId>commons-lib</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>${compileSource}</source>
<target>${compileSource}</target>
<excludes>
<exclude>**/VariantEVSControlAnnotator.java</exclude>
</excludes>
<testExcludes>
<exclude>**/EffectCalculatorTest.java</exclude>
<exclude>**/VariantGeneNameAnnotatorTest.java</exclude>
</testExcludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "a4436447ed890e80085fc1af8bd09391",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 149,
"avg_line_length": 35.41573033707865,
"alnum_prop": 0.5843908629441624,
"repo_name": "jmmut/biodata",
"id": "33e5e41646243e881eb0c4b031bf00a13e254857",
"size": "3152",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "biodata-tools/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "10756"
},
{
"name": "Java",
"bytes": "2568573"
},
{
"name": "Protocol Buffer",
"bytes": "2745"
}
],
"symlink_target": ""
} |
import json
from pants.backend.experimental.java.register import rules as java_rules
from pants.backend.java.dependency_inference.types import JavaSourceDependencyAnalysis
from pants.backend.java.target_types import JavaFieldSet
from pants.core.util_rules.source_files import SourceFilesRequest
from pants.engine.console import Console
from pants.engine.goal import Goal, GoalSubsystem
from pants.engine.internals.selectors import Get, MultiGet
from pants.engine.rules import collect_rules, goal_rule
from pants.engine.target import Targets
from pants.jvm.goals import debug_goals
class DumpJavaSourceAnalysisSubsystem(GoalSubsystem):
name = "java-dump-source-analysis"
help = "Dump source analysis for java_source[s] targets."
class DumpJavaSourceAnalysis(Goal):
subsystem_cls = DumpJavaSourceAnalysisSubsystem
environment_behavior = Goal.EnvironmentBehavior.LOCAL_ONLY # TODO(#17129) — Migrate this.
@goal_rule
async def dump_java_source_analysis(targets: Targets, console: Console) -> DumpJavaSourceAnalysis:
java_source_field_sets = [
JavaFieldSet.create(tgt) for tgt in targets if JavaFieldSet.is_applicable(tgt)
]
java_source_analysis = await MultiGet(
Get(JavaSourceDependencyAnalysis, SourceFilesRequest([fs.sources]))
for fs in java_source_field_sets
)
java_source_analysis_json = [
{"address": str(fs.address), **analysis.to_debug_json_dict()}
for (fs, analysis) in zip(java_source_field_sets, java_source_analysis)
]
console.print_stdout(json.dumps(java_source_analysis_json))
return DumpJavaSourceAnalysis(exit_code=0)
def rules():
return [
*collect_rules(),
*java_rules(),
*debug_goals.rules(),
]
| {
"content_hash": "6412ccb1a4a884218e755d75c4c50617",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 98,
"avg_line_length": 37.02127659574468,
"alnum_prop": 0.7477011494252873,
"repo_name": "pantsbuild/pants",
"id": "f1f5493588472a5c693f94deebd26a4c8616a404",
"size": "1874",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/python/pants/backend/java/goals/debug_goals.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "688"
},
{
"name": "Dockerfile",
"bytes": "1132"
},
{
"name": "Go",
"bytes": "67315"
},
{
"name": "Java",
"bytes": "97190"
},
{
"name": "Kotlin",
"bytes": "6433"
},
{
"name": "Mustache",
"bytes": "3771"
},
{
"name": "Python",
"bytes": "7582858"
},
{
"name": "Rust",
"bytes": "1657282"
},
{
"name": "Scala",
"bytes": "21950"
},
{
"name": "Shell",
"bytes": "31400"
},
{
"name": "Starlark",
"bytes": "76892"
}
],
"symlink_target": ""
} |
<?php defined('C5_EXECUTE') or die("Access Denied.");
$form = Loader::helper('form');
$json = Loader::helper('json');
// Set's helpful, accessible instruction title attribute text on our UI buttons.
// Saves us battling with some of the convoluted JS string concatenation below
// where the t() function is involved. Saves hitting the function multiple times too.
// @var String
$removeOptionText = t('Remove Option');
if ($akSelectAllowMultipleValues && $akSelectAllowOtherValues) { // display autocomplete form
$attrKeyID = $this->attributeKey->getAttributeKeyID();
?>
<style type="text/css">
.ccm-ui .ccm-attribute-type-select-autocomplete .newAttrValue,
.ccm-ui .ccm-attribute-type-select-autocomplete .existingAttrValue {
padding-top: 3px;
margin-right: 12px;
float: left;
line-height: 20px;
}
.ccm-ui .ccm-attribute-type-select-autocomplete h6 {
margin-top: 0px;
margin-bottom: 2px;
}
.ccm-ui .ccm-attribute-type-select-autocomplete .well {
margin-bottom: 5px;
max-width: 500px;
}
.ccm-ui .ccm-attribute-type-select-autocomplete .text-error {
color: #b94a48 !important;
font-weight: bold;
}
</style>
<div class="ccm-attribute-type-select-autocomplete">
<div id="selectedAttrValueRows_<?php echo $attrKeyID;?>" class="well well-small clearfix">
<h6><?php echo t('Selected Options')?></h6>
<?php
foreach($selectedOptions as $optID) {
$opt = Concrete\Attribute\Select\Option::getByID($optID);
?>
<div class="existingAttrValue">
<?php echo $form->hidden($this->field('atSelectOptionID') . '[]', $opt->getSelectAttributeOptionID(), array('style'=>'position:relative;')); ?>
<span class="badge"><?php echo $opt->getSelectAttributeOptionValue()?></span>
<a class="text-error" title="<?php echo $removeOptionText?>" href="javascript:void(0);" onclick="$(this).parent().remove()">x</a>
</div>
<?php }
// now we get items from the post
$vals = $this->post('atSelectNewOption');
if (is_array($vals)) {
foreach($vals as $v) { ?>
<div class="newAttrValue">
<?php echo $form->hidden($this->field('atSelectNewOption') . '[]', $v)?>
<span class="badge"><?php echo $v?></span>
<a class="text-error" title="<?php echo $removeOptionText?>" onclick="ccmAttributeTypeSelectTagHelper<?php echo $attrKeyID?>.remove(this)" href="javascript:void(0)">x</a>
</div>
<?php
}
}
?>
</div>
<div class="input-group">
<?php
echo $form->text('newAttrValueRows'.$attrKeyID, array('class' => 'ccm-attribute-type-select-autocomplete-text', 'style'=>'position:relative;'));
?>
<span class="input-group-btn">
<input type="button" class="btn ccm-input-button btn-default" value="<?php echo t('Add')?>" onclick="ccmAttributeTypeSelectTagHelper<?php echo $attrKeyID?>.addButtonClick(); return false" />
</span>
</div>
</div>
<script type="text/javascript">
//<![CDATA[
$(function() {
var availableTags = <?php echo $json->encode($opt_values);?>;
$("#newAttrValueRows<?php echo $attrKeyID?>").autocomplete({
source: "<?php echo $view->action('load_autocomplete_values')?>",
select: function( event, ui ) {
ccmAttributeTypeSelectTagHelper<?php echo $attrKeyID?>.add(ui.item.value);
$(this).val('');
return false;
}
});
$("#newAttrValueRows<?php echo $attrKeyID?>").bind("keydown", function(e) {
if (e.keyCode == 13) { // comma or enter
if($(this).val().length > 0) {
ccmAttributeTypeSelectTagHelper<?php echo $attrKeyID?>.add($(this).val());
$(this).val('');
$("#newAttrValueRows<?php echo $this->attributeKey->getAttributeKeyID()?>").autocomplete( "close" );
}
return false;
}
});
});
var ccmAttributeTypeSelectTagHelper<?php echo $attrKeyID?>={
addButtonClick: function() {
// Get and cache our row element
var valrow = $("input[name=newAttrValueRows<?php echo $attrKeyID?>]");
// Get and cache our row element's value
var valrowval = valrow.val();
// Any text actually entered? If value passed, continue!
// A length check was being done on keydown (enter press) but not
// when button clicked (!). Fixed now. Might avoid some of those ugly, empty
// option rows appearing in the attribute select type options db.
if(valrowval.length > 0) {
ccmAttributeTypeSelectTagHelper<?php echo $attrKeyID?>.add(valrowval);
valrow.val('');
$("#newAttrValueRows<?php echo $this->attributeKey->getAttributeKeyID()?>").autocomplete( "close" );
}
return false;
},
add:function(value){
var newRow=document.createElement('div');
newRow.className='newAttrValue';
newRow.innerHTML='<input name="<?php echo $this->field('atSelectNewOption')?>[]" type="hidden" value="'+value+'" /> ';
newRow.innerHTML+='<span class="badge">'+value+'</span>';
newRow.innerHTML+=' <a class="text-error" title="<?php echo $removeOptionText?>" onclick="ccmAttributeTypeSelectTagHelper<?php echo $attrKeyID?>.remove(this)" href="javascript:void(0)">x</a>';
$('#selectedAttrValueRows_<?php echo $attrKeyID;?>').append(newRow);
},
remove:function(a){
$(a.parentNode).remove();
}
}
//]]>
</script>
<?php
} else {
?>
<style type="text/css">
.ccm-ui .newAttrValueRow {
padding-top: 2px;
}
</style>
<?php
$options = $this->controller->getOptions();
if ($akSelectAllowMultipleValues) { ?>
<?php foreach($options as $opt) { ?>
<div class="checkbox"><label>
<?php echo $form->checkbox($this->field('atSelectOptionID') . '[]', $opt->getSelectAttributeOptionID(), in_array($opt->getSelectAttributeOptionID(), $selectedOptions)); ?>
<?php echo $opt->getSelectAttributeOptionDisplayValue()?>
</label>
</div>
<?php } ?>
<?php } else {
$opts = array('' => t('** None'));
foreach($options as $opt) {
$opts[$opt->getSelectAttributeOptionID()] = $opt->getSelectAttributeOptionDisplayValue();
}
?>
<?php echo $form->select($this->field('atSelectOptionID') . '[]', $opts, $selectedOptions[0]); ?>
<?php }
if ($akSelectAllowOtherValues) { ?>
<div id="newAttrValueRows<?php echo $this->attributeKey->getAttributeKeyID()?>" class="newAttrValueRows"></div>
<div style="padding-top: 5px;">
<a title="<?php echo t('Add Another Option')?>" class="btn btn-small" href="javascript:void(0)" onclick="ccmAttributeTypeSelectHelper.add(<?php echo $this->attributeKey->getAttributeKeyID()?>, '<?php echo $this->field('atSelectNewOption')?>[]')">
<?php echo t('Add Another Option')?>
</a>
</div>
<?php } ?>
<script type="text/javascript">
//<![CDATA[
var ccmAttributeTypeSelectHelper={
add:function(akID, field){
var newRow=document.createElement('div');
newRow.className='newAttrValueRow';
newRow.innerHTML='<input name="' + field + '" type="text" value="" /> ';
newRow.innerHTML+='<a title="<?php echo $removeOptionText?>" class="btn btn-mini btn-danger" onclick="ccmAttributeTypeSelectHelper.remove(this)" href="javascript:void(0)"><i class="icon icon-white icon-trash"></i></a>';
$('#newAttrValueRows'+akID).append(newRow);
},
remove:function(a){
$(a.parentNode).remove();
}
}
//]]>
</script>
<?php } ?>
| {
"content_hash": "407ed0fc3cc4f3e1b339831d92dbd9dd",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 249,
"avg_line_length": 37.15979381443299,
"alnum_prop": 0.651685393258427,
"repo_name": "Cele-soft/myCmsConcr3te5",
"id": "ee99137e19e27f815d1412d635f51119fc60a698",
"size": "7209",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "concrete/attributes/select/form.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "169025"
},
{
"name": "CSS",
"bytes": "461380"
},
{
"name": "HTML",
"bytes": "4108"
},
{
"name": "JavaScript",
"bytes": "636985"
},
{
"name": "PHP",
"bytes": "5316110"
}
],
"symlink_target": ""
} |
using System;
using System.Diagnostics;
using System.Fabric;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Owin.Hosting;
using Microsoft.ServiceFabric.Services.Communication.Runtime;
namespace Kevsoft.WordCount.WebService
{
public class OwinCommunicationListener : ICommunicationListener
{
private readonly ServiceContext _serviceContext;
/// <summary>
/// OWIN server handle.
/// </summary>
private IDisposable _serverHandle;
private readonly IOwinAppBuilder _startup;
private string _publishAddress;
private string _listeningAddress;
private readonly string _appRoot;
public OwinCommunicationListener(string appRoot, IOwinAppBuilder startup, ServiceContext serviceContext)
{
_startup = startup;
_appRoot = appRoot;
_serviceContext = serviceContext;
}
public Task<string> OpenAsync(CancellationToken cancellationToken)
{
Trace.WriteLine("Initialize");
var serviceEndpoint = this._serviceContext.CodePackageActivationContext.GetEndpoint("ServiceEndpoint");
var port = serviceEndpoint.Port;
var statefulServiceContext = _serviceContext as StatefulServiceContext;
if (statefulServiceContext != null )
{
var statefulInitParams = statefulServiceContext;
_listeningAddress = string.Format(
CultureInfo.InvariantCulture,
"http://+:{0}/{1}/{2}/{3}/",
port,
statefulInitParams.PartitionId,
statefulInitParams.ReplicaId,
Guid.NewGuid());
}
else
{
var statelessServiceContext = _serviceContext as StatelessServiceContext;
if (statelessServiceContext != null)
{
_listeningAddress = string.Format(
CultureInfo.InvariantCulture,
"http://+:{0}/{1}",
port,
string.IsNullOrWhiteSpace(_appRoot)
? ""
: _appRoot.TrimEnd('/') + '/');
}
else
{
throw new InvalidOperationException();
}
}
_publishAddress = _listeningAddress.Replace("+", FabricRuntime.GetNodeContext().IPAddressOrFQDN);
Trace.WriteLine($"Opening on {_publishAddress}");
try
{
Trace.WriteLine($"Starting web server on {_listeningAddress}");
_serverHandle = WebApp.Start(_listeningAddress, appBuilder => _startup.Configuration(appBuilder));
return Task.FromResult(_publishAddress);
}
catch (Exception ex)
{
Trace.WriteLine(ex);
StopWebServer();
throw;
}
}
public Task CloseAsync(CancellationToken cancellationToken)
{
Trace.WriteLine("Close");
StopWebServer();
return Task.FromResult(true);
}
public void Abort()
{
Trace.WriteLine("Abort");
StopWebServer();
}
private void StopWebServer()
{
if (_serverHandle != null)
{
try
{
_serverHandle.Dispose();
}
catch (ObjectDisposedException)
{
// no-op
}
}
}
}
} | {
"content_hash": "5e3be4c3628a47cfe66747864d924384",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 115,
"avg_line_length": 30.16,
"alnum_prop": 0.5204244031830239,
"repo_name": "kevbite/MassTransit.ServiceFabric",
"id": "d7dcfd7564b5684e399fd2cff89bc6c7ab77c806",
"size": "3772",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/WordCount.WebService/OwinCommunicationListener.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "42166"
},
{
"name": "HTML",
"bytes": "6071"
},
{
"name": "PowerShell",
"bytes": "9233"
}
],
"symlink_target": ""
} |
/*
* gtgutil
*
* Provides utility functions for displaying error, status, and help messages.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include "gtg.h"
#include "gtgutil.h"
namespace gtgutil {
bool verbose = false;
}
/*
* Print an error message to stderr and exit with failure status.
* Message may include format specifiers with additional variable arguments.
*/
void FailDetail(const char *file, int lineNumber, const char *errorString, ...) {
va_list arglist;
va_start(arglist, errorString);
fprintf(stderr, "%s:%s:%d: ", _GTG_PROGRAM_, file, lineNumber);
vfprintf(stderr, errorString, arglist);
va_end(arglist);
exit(EXIT_FAILURE);
}
/*
* Toggle verbose mode.
*/
void SetVerbosity(bool verbose)
{
gtgutil::verbose = verbose;
}
/*
* Print a diagnostic message to stdout (if verbose mode is enabled).
* Message may include format specifiers with additional variable arguments.
*/
void Note(const char *noteString, ...) {
va_list arglist;
if (gtgutil::verbose) {
va_start(arglist, noteString);
vprintf(noteString, arglist);
va_end(arglist);
}
}
/*
* Print a non-fatal error message to stderr.
* Message may include format specifiers with additional variable arguments.
*/
void Warn(const char *warnString, ...) {
va_list arglist;
va_start(arglist, warnString);
vfprintf(stderr, warnString, arglist);
va_end(arglist);
}
/*
* Display program name and version and quit successfully.
*/
void ShowVersion(void)
{
printf("%s %s\n", _GTG_NAME_, _GTG_VERSION_);
exit(EXIT_SUCCESS);
}
/*
* Display a concise usage message and quit successfully.
*/
void ShowHelp(void)
{
printf("%s %s\n", _GTG_NAME_, _GTG_VERSION_);
printf("usage: %s [OPTIONS] [TLE [TLE ...]]\n", _GTG_PROGRAM_);
printf("\n");
printf("Ground Track Generator outputs GIS-compatible shapefiles containing point or\n");
printf("line segment representations of the ground track of specified satellite orbits.\n");
printf("The extent and resolution of the ground track is controlled by the TRACE OPTIONS\n");
printf("described below. Orbit information is read from two-line element sets and the\n");
printf("orbit is modelled with the SGP4/SDP4 simplified perturbation model.\n");
printf("\n");
printf("OPTIONS:\n");
printf("\n");
printf(" INPUT OPTIONS:\n");
printf("\n");
printf(" --tle/-t TEXT\n");
printf(" Load two-line element sets directly from TEXT.\n");
printf("\n");
printf(" --input/-i PATH\n");
printf(" Load two-line element sets from file PATH.\n");
printf("\n");
printf(" TLE [TLE ...]\n");
printf(" Any command line arguments not interpreted as the options or arguments\n");
printf(" described here are treated as the PATH to two-line element set files.\n");
printf("\n");
printf(" If no two-line element sets (TLEs) are loaded from the command line, gtg\n");
printf(" will attempt to read two-line element sets from standard input. If multiple\n");
printf(" TLEs are loaded, a separate shapefile will be output for each TLE.\n");
printf("\n");
printf(" OUTPUT OPTIONS:\n");
printf("\n");
printf(" --format/-m shapefile | csv\n");
printf(" Select output format. Shapefile is default. If csv output is selected,\n");
printf(" a comma-separated value is output, including id, latitude, longitude,\n");
printf(" and any other specified attributes. If no --output argument is provided\n");
printf(" in csv, data is written to standard output instead of a default file.\n");
printf("\n");
printf(" --header/-h\n");
printf(" Include a header row in csv output. No effect with any other --format.\n");
printf("\n");
printf(" --output/-o PATH | DIRECTORY\n");
printf(" If a single two-line element set is loaded, specify the base PATH of the\n");
printf(" output (defaults to the TLE identifier described below).\n");
printf(" If multiple two-line element sets are loaded, specify the directory in\n");
printf(" which to write output files (defaults to current working directory).\n");
printf("\n");
printf(" --prefix/-p PREFIX\n");
printf(" If specified, PREFIX is prepended to the base name identifier, unless\n");
printf(" there is only one two-line element set and an --output PATH is given.\n");
printf("\n");
printf(" --suffix/-x SUFFIX\n");
printf(" If specified, SUFFIX is appended to the base name identifier, unless\n");
printf(" there is only one two-line element set and an --output PATH is given.\n");
printf("\n");
printf(" --noprj\n");
printf(" Suppress output of .prj \"projection\" file, which explicitly specifies\n");
printf(" the geodetic reference system of the generated shapefile (WGS-72).\n");
printf("\n");
printf(" The default base name for output files is the [NORAD] satellite number\n");
printf(" encoded in the second field of the first line of the two-line element set.\n");
printf("\n");
printf(" GEOMETRY OPTIONS:\n");
printf("\n");
printf(" --features/-f point | line\n");
printf(" Specify whether to output points (the default) or line segment features\n");
printf(" for each step. Attributes refer to the starting point of line features.\n");
printf("\n");
printf(" --split/-d\n");
printf(" If generating line --features, split any lines that cross the 180th\n");
printf(" meridian into east and west hemisphere segments. Disabled by default.\n");
printf(" IMPORTANT: --split is intended as a cosmetic convenience only. The split\n");
printf(" point latitude is not determined with the same precision as the trace.\n");
printf("\n");
printf(" ATTRIBUTE OPTIONS:\n");
printf("\n");
printf(" --attributes/-a all | standard | ATTRIBUTE [ATTRIBUTE ...]\n");
printf(" By default, no attributes are output.\n");
printf(" all - Output all attributes. Some require an --observer.\n");
printf(" standard - All attributes except those which require an observer.\n");
printf(" Alternatively, list one or more of the following ATTRIBUTE names:\n");
printf(" time - Step timestamp in YYYY-MM-DD HH:MM:SS.SSSSSS UTC\n");
printf(" unixtime - Step timestamp in seconds since 0:0:0 UTC 1 Jan 1970.\n");
printf(" mfe - Relative timestamp in minutes from epoch.\n");
printf(" altitude - Altitude of satellite in km.\n");
printf(" velocity - Magnitude of satellite velocity in km/s.\n");
printf(" heading - Direction of motion in degrees clockwise from north.\n");
printf(" latitude - Geodetic latitude of satellite position.\n");
printf(" longitude - Geodetic longitude of satellite position.\n");
printf(" xposition - Earth Centered Inertial (ECI) x position in km.\n");
printf(" yposition - Satellite ECI y position in km.\n");
printf(" zposition - Satellite ECI z position in km.\n");
printf(" xvelocity - Satellite ECI x velocity in km/s.\n");
printf(" yvelocity - Satellite ECI y velocity in km/s.\n");
printf(" zvelocity - Satellite ECI z velocity in km/s.\n");
printf(" range - Range to satellite from observer in km.\n");
printf(" rate - Rate of satellite range from observer in km/s.\n");
printf(" elevation - Elevation to satellite from observer.\n");
printf(" azimuth - Azimuth to satellite from observer.\n");
printf(" Attributes are output in this order regardless of order specified.\n");
printf("\n");
printf(" --observer/-g LATITUDE LONGITUDE [ALTITUDE]\n");
printf(" Specify the surface location of an observer (optional altitude in km).\n");
printf(" Some --attributes require an observer to be defined. None by default.\n");
printf("\n");
printf(" TRACE OPTIONS:\n");
printf("\n");
printf(" --start/-s now | epoch | TIME | UNIXTIME\n");
printf(" Timestamp for first step of output. Subsequent steps are output at\n");
printf(" uniform time --intervals until --end time or --steps count is reached.\n");
printf(" now[OFFSET] - Current time, with optional offset.\n");
printf(" epoch[OFFSET] - TLE reference time, with optional offset. Default.\n");
printf(" SECONDS[OFFSET] - Time in seconds since 0:0:0 UTC 1 Jan 1970.\n");
printf(" TIMESTAMP - Time in \"YYYY-MM-DD HH:MM:SS.SSSSSS UTC\" format.\n");
printf(" OFFSET format is a +/- number followed by s, m, h, or d, indicating the\n");
printf(" offset unit (seconds, minutes, hours, or days, respectively).\n");
printf("\n");
printf(" --end/e now | epoch | TIME | UNIXTIME\n");
printf(" If specified, trace is output from --start to no later than --end. If\n");
printf(" not specified, trace is output for the specified number of --steps.\n");
printf(" Same argument format as --start. The --end time must be later than the\n");
printf(" --start time. The time interval between --start and --end must be\n");
printf(" greater than the step --interval.\n");
printf("\n");
printf(" --forceend\n");
printf(" Causes a final feature to be output exactly at --end time, regardless of\n");
printf(" interval. Has no effect if --end is not specified.\n");
printf("\n");
printf(" --steps/-n STEPS\n");
printf(" Number of steps to output. Defaults to 1. Ignored if --end is given.\n");
printf("\n");
printf(" --interval/-l DURATION\n");
printf(" Step interval. Duration format is a number followed by s, m, h, or d,\n");
printf(" indicating the unit (seconds, minutes, hours, or days, respectively).\n");
printf("\n");
printf(" MISCELLANEOUS OPTIONS:\n");
printf("\n");
printf(" --verbose\n");
printf(" Print status messages (including coordinates and attribute values).\n");
printf("\n");
printf(" --help/-?\n");
printf(" Display this usage message.\n");
printf("\n");
printf(" --version/-v\n");
printf(" Display the program version.\n");
printf("\n");
printf("CREDITS:\n");
printf("\n");
printf(" C++ SGP4 Satellite Library:\n");
printf(" <http://www.danrw.com/sgp4-satellite.php>\n");
printf("\n");
printf(" Shapefile C Library:\n");
printf(" <http://shapelib.maptools.org/>\n");
printf("\n");
printf(" Revisiting Spacetrack Report #3 (background reference and test cases):\n");
printf(" <http://www.celestrak.com/publications/AIAA/2006-6753/>\n");
printf("\n");
exit(EXIT_SUCCESS);
}
| {
"content_hash": "b40fdd0788b3fbd362cbe0f408ef2e3d",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 94,
"avg_line_length": 45.69230769230769,
"alnum_prop": 0.6450617283950617,
"repo_name": "anoved/Ground-Track-Generator",
"id": "54939eb24cd4d3e65f2c1612dec6f40d279534d0",
"size": "10692",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/gtgutil.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "499198"
},
{
"name": "C++",
"bytes": "220990"
},
{
"name": "Delphi",
"bytes": "11169"
},
{
"name": "Perl",
"bytes": "848"
},
{
"name": "Shell",
"bytes": "49878"
},
{
"name": "Tcl",
"bytes": "7310"
}
],
"symlink_target": ""
} |
"""
Given an integer, write a function to determine if it is a power of two.
"""
__author__ = 'Daniel'
class Solution:
def isPowerOfTwo(self, n):
"""
Bit manipulation
:type n: int
:rtype: bool
"""
if n <= 0:
return False
return n & (n-1) == 0 | {
"content_hash": "2a513e52197c448f54daab721ad6f29c",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 72,
"avg_line_length": 18.647058823529413,
"alnum_prop": 0.49842271293375395,
"repo_name": "ee08b397/LeetCode-4",
"id": "88c22349a06b5b0740f437d1595aca73001d23e0",
"size": "317",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "231 Power of Two.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "555639"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Symb. sin. 7:1243. 1936
#### Original name
null
### Remarks
null | {
"content_hash": "6767aa09abd5266f1e212800dee755da",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 11.76923076923077,
"alnum_prop": 0.6862745098039216,
"repo_name": "mdoering/backbone",
"id": "3c4724472e80f6ce79fae9303fa10e4f6cb41c85",
"size": "214",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Commelinales/Commelinaceae/Murdannia/Murdannia keisak/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windy.Domain.Contracts;
using Windy.Domain.Contracts.Managers;
namespace Windy.Business.Managers
{
public class ExceptionManager : IExceptionManager
{
private readonly ILogger _logger;
public ExceptionManager(ILogger logger)
{
_logger = logger;
}
public void Execute(Action unsafeAction, string callingMethodDescription, bool rethrowException = false)
{
try
{
unsafeAction.Invoke();
}
catch(Exception ex)
{
_logger.LogException(callingMethodDescription, ex);
if (rethrowException)
throw;
}
}
public TReturnValue Execute<TReturnValue>(Func<TReturnValue> unsafeFunction, string callingMethodDescription, bool rethrowException = false)
{
try
{
return unsafeFunction.Invoke();
}
catch(Exception ex)
{
_logger.LogException(callingMethodDescription, ex);
if (rethrowException)
throw;
}
return default(TReturnValue);
}
}
}
| {
"content_hash": "42aa55daa4a9dc4c7805ce300c1e78de",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 148,
"avg_line_length": 25.807692307692307,
"alnum_prop": 0.5625931445603577,
"repo_name": "msdevno/windy",
"id": "d331887cccb8fef86b805201d32459361f1d9eec",
"size": "1344",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Source/Windy.Business/Managers/ExceptionManager.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "90635"
},
{
"name": "CSS",
"bytes": "60"
},
{
"name": "HTML",
"bytes": "1411"
},
{
"name": "JavaScript",
"bytes": "207735"
}
],
"symlink_target": ""
} |
package com.thoughtworks.cruise.editpipelinewizard;
import com.thoughtworks.cruise.page.CruisePage;
import com.thoughtworks.cruise.state.CurrentPageState;
import com.thoughtworks.cruise.state.CurrentPageState.Page;
import com.thoughtworks.cruise.state.ScenarioState;
import net.sf.sahi.client.Browser;
import org.hamcrest.core.Is;
import org.junit.Assert;
public class BuildTaskPopup extends CruisePage {
private CurrentPageState currentPageState;
public BuildTaskPopup(ScenarioState scenarioState, Browser browser, CurrentPageState currentPageState) {
super(scenarioState, true, browser);
this.currentPageState = currentPageState;
}
@Override
protected String url() {
return null;
}
@com.thoughtworks.gauge.Step("Enter build file as <value>")
public void enterBuildFileAs(final String value) throws Exception {
enterInTextBox("task[buildFile]", value);
}
@com.thoughtworks.gauge.Step("Enter target as <value>")
public void enterTargetAs(final String value) throws Exception {
enterInTextBox("task[target]", value);
}
@com.thoughtworks.gauge.Step("Enter working directory as <value>")
public void enterWorkingDirectoryAs(final String value) throws Exception {
enterInTextBox("task[workingDirectory]", value);
}
@com.thoughtworks.gauge.Step("Click save - BuildTaskPopup")
public void clickSave() throws Exception {
browser.submit("SAVE").click();
currentPageState.currentPageIs(Page.PIPELINE_WIZARD_JOB_EDIT_PAGE);
}
@com.thoughtworks.gauge.Step("Set failed runif")
public void setFailedRunif() throws Exception {
browser.checkbox("task[runIfConfigsFailed]").click();
}
@com.thoughtworks.gauge.Step("Set any runif")
public void setAnyRunif() throws Exception {
browser.checkbox("task[runIfConfigsAny]").click();
}
@com.thoughtworks.gauge.Step("Verify build file is <value>")
public void verifyBuildFileIs(String value) throws Exception {
Assert.assertThat(browser.textbox("task[buildFile]").value(), Is.is(value));
}
@com.thoughtworks.gauge.Step("Verify target is <value>")
public void verifyTargetIs(String value) throws Exception {
Assert.assertThat(browser.textbox("task[target]").value(), Is.is(value));
}
@com.thoughtworks.gauge.Step("Verify working directory is <value>")
public void verifyWorkingDirectoryIs(String value) throws Exception {
Assert.assertThat(browser.textbox("task[workingDirectory]").value(), Is.is(value));
}
protected void enterInTextBox(String fieldName, String value) {
super.enterInTextBox(fieldName, value);
}
@com.thoughtworks.gauge.Step("Add a <onCancelTaskType> on cancel task")
public void addAOnCancelTask(String onCancelTaskType) throws Exception {
browser.checkbox("task[hasCancelTask]").check();
browser.select("task[onCancelConfig][onCancelOption]").choose(onCancelTaskType);
}
@com.thoughtworks.gauge.Step("Enter on cancel build file as <value>")
public void enterOnCancelBuildFileAs(String value) throws Exception {
enterInTextBox("task[onCancelConfig][antOnCancel][buildFile]", value);
}
@com.thoughtworks.gauge.Step("Enter on cancel target as <value>")
public void enterOnCancelTargetAs(String value) throws Exception {
enterInTextBox("task[onCancelConfig][antOnCancel][target]", value);
}
@com.thoughtworks.gauge.Step("Enter on cancel working directory as <value>")
public void enterOnCancelWorkingDirectoryAs(String value) throws Exception {
enterInTextBox("task[onCancelConfig][antOnCancel][workingDirectory]", value);
}
public void clickSaveInErrorCase() throws Exception {
browser.submit("SAVE").click();
currentPageState.currentPageIs(Page.PIPELINE_WIZARD_TASK_EDIT_POPUP);
}
}
| {
"content_hash": "f9a966e5e26f60bb5d4958005eb82e1e",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 108,
"avg_line_length": 38.13592233009709,
"alnum_prop": 0.7176680244399185,
"repo_name": "varshavaradarajan/functional-tests",
"id": "55631cbf841bc8c39ca8fc9a6e49f35b891ed083",
"size": "4674",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "src/test/java/com/thoughtworks/cruise/editpipelinewizard/BuildTaskPopup.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "12917"
},
{
"name": "C",
"bytes": "144"
},
{
"name": "C++",
"bytes": "37"
},
{
"name": "CSS",
"bytes": "6622"
},
{
"name": "Gherkin",
"bytes": "484"
},
{
"name": "HTML",
"bytes": "1316282"
},
{
"name": "Java",
"bytes": "1846156"
},
{
"name": "JavaScript",
"bytes": "787482"
},
{
"name": "PHP",
"bytes": "2182"
},
{
"name": "Ruby",
"bytes": "132504"
},
{
"name": "Shell",
"bytes": "116894"
},
{
"name": "Tcl",
"bytes": "11341"
},
{
"name": "Visual Basic",
"bytes": "84"
}
],
"symlink_target": ""
} |
class ForceCreateUserCommentUuidConstraint < Neo4j::Migrations::Base
def up
add_constraint :UserComment, :uuid, force: true
end
def down
drop_constraint :UserComment, :uuid
end
end
| {
"content_hash": "15ee4aab756b4cc893356fe92a2f0532",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 68,
"avg_line_length": 22,
"alnum_prop": 0.7424242424242424,
"repo_name": "ndoit/fenrir",
"id": "106f84c13b724b11acdeba02434b2851141fc62b",
"size": "198",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "db/neo4j/migrate/20190124160641_force_create_user_comment_uuid_constraint.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1088535"
},
{
"name": "HTML",
"bytes": "648517"
},
{
"name": "JavaScript",
"bytes": "740188"
},
{
"name": "Ruby",
"bytes": "1247518"
},
{
"name": "Shell",
"bytes": "7942"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
NUB Generator [autonym]
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "a85da9d8d7e6d468b46cf398468126a8",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 23,
"avg_line_length": 9.076923076923077,
"alnum_prop": 0.6779661016949152,
"repo_name": "mdoering/backbone",
"id": "cee50a679a11e9a4273e28d670bb141d861eb7c6",
"size": "179",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Bacillariophyta/Bacillariophyceae/Naviculales/Pleurosigmataceae/Gyrosigma/Gyrosigma balticum/Gyrosigma balticum balticum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
import * as React from 'react';
import * as Constants from '../constants';
interface ISelectorItemProps {
class: any;
item: any;
select: (item: any) => void;
remove?: (item: any) => void;
}
class SelectorItem extends React.Component<ISelectorItemProps, {}> {
constructor(props) {
super(props);
this.select = this.select.bind(this);
this.remove = this.remove.bind(this);
}
select(e) {
this.props.select(this.props.item);
}
remove(e) {
e.stopPropagation();
if (this.props.remove) {
this.props.remove(this.props.item);
}
console.log('remove');
}
render() {
let renderedItem = React.createElement(this.props.class, { item: this.props.item });
let removeButton;
if (this.props.remove) {
removeButton = (<div className='remove-item' onClick={this.remove} dangerouslySetInnerHTML={{ __html: Constants.removeIcon('', 20) }}></div>);
}
return (
<div className='selector-item-container'>
<div className='selector-item' onClick={this.select}>{renderedItem}</div>
{removeButton}
</div>
);
}
}
export class SelectorComponent<TItem> extends React.Component<{
getIsVisible: () => boolean,
setIsVisible: (isVisible: boolean) => void,
items: TItem[],
placeholder?: string,
getSelectedItem: () => TItem,
selectItem: (TItem) => void,
addItemLabel?: string,
onClickAddItem?: () => void,
onClickRemoveItem?: (TItem) => void,
classes?: string
}, {}> {
private top: string;
private left: string;
private width: string;
private itemComponentType: any;
constructor(props, itemComponentType?) {
super(props);
this.itemComponentType = itemComponentType;
this.toggle = this.toggle.bind(this);
this.select = this.select.bind(this);
this.addItem = this.addItem.bind(this);
this.removeItem = this.removeItem.bind(this);
}
select(item: TItem) {
this.props.selectItem(item);
this.props.setIsVisible(false);
}
addItem() {
this.props.setIsVisible(false);
this.props.onClickAddItem();
}
removeItem(item: TItem) {
this.props.onClickRemoveItem(item);
}
toggle(evt) {
let isVisible = this.props.getIsVisible();
if (isVisible || this.props.addItemLabel || (this.props.items && this.props.items.length > 0)) {
let target = evt.target as HTMLElement;
let selector = target.closest('.checkout-selector') as HTMLElement;
evt.stopPropagation();
this.props.setIsVisible(!isVisible);
this.width = selector.offsetWidth + 'px';
this.left = selector.offsetLeft + 'px';
this.top = (selector.offsetHeight + selector.offsetTop) + 'px';
}
}
render() {
let contents = undefined;
if (this.props.getIsVisible()) {
let selectorList = [];
let keyIdx = 0;
if (this.props.items) {
this.props.items.forEach(ri => {
selectorList.push(<SelectorItem
key={keyIdx}
class={this.itemComponentType}
item={ri}
select={(item) => { this.select(item); }}
remove={(this.props.onClickRemoveItem ? (item) => { this.removeItem(item); } : undefined) }
/>);
keyIdx++;
});
}
if (this.props.addItemLabel && this.props.onClickAddItem) {
selectorList.push(
<div className='selector-item' onClick={this.addItem} key='addItem'>
<div className='add-item'>{this.props.addItemLabel}</div>
</div>);
}
if (selectorList.length > 0) {
contents = (
<div className='selector-items grow' style={{top: this.top, width: this.width, left: this.left}}>
{selectorList}
</div>);
}
}
let labelElement = undefined;
let selectedItem = this.props.getSelectedItem();
if (selectedItem) {
labelElement = React.createElement(this.itemComponentType, { item: selectedItem });
} else if (this.props.placeholder) {
labelElement = (<div className='placeholder-text'>{this.props.placeholder}</div>)
}
return (<div className={'checkout-selector ' + (this.props.classes ? this.props.classes : '')} onClick={this.toggle}>
<div className='selected-item-label-container'>
<div className='selected-item-label'>{labelElement}</div>
<div className='down-chevron'>\/</div>
</div>
{contents}
</div>);
}
} | {
"content_hash": "41cdf5acd4344c6193245f9298d88a4c",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 154,
"avg_line_length": 33.098684210526315,
"alnum_prop": 0.5418405883522163,
"repo_name": "mgbennet/BotFramework-Emulator",
"id": "dcf26f864d3dec40b14e8ce99ed1b2472464ec92",
"size": "6428",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/client/payments/selectorComponent.tsx",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "41"
},
{
"name": "CSS",
"bytes": "26180"
},
{
"name": "HTML",
"bytes": "7509"
},
{
"name": "JavaScript",
"bytes": "774"
},
{
"name": "TypeScript",
"bytes": "470849"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace TaskManagerMVC.Filters
{
public class AuthenticationFilter : ActionFilterAttribute
{
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
if (TaskManagerMVC.Services.AuthenticatonService.LoggedUser == null)
{
filterContext.HttpContext.Response.Redirect("~/Account/Login?RedirectUrl=" + filterContext.HttpContext.Request.Url);
filterContext.Result = new EmptyResult();
}
}
}
} | {
"content_hash": "f9c6e4506bd5684781190026a7703c3a",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 132,
"avg_line_length": 31.2,
"alnum_prop": 0.6826923076923077,
"repo_name": "toshetoo/TaskManagerMVC",
"id": "91e103356439e7e8c5f89174198faec9f7eddadd",
"size": "626",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "TaskManagerMVC/TaskManagerMVC/Filters/AuthenticationFilter.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "105"
},
{
"name": "C#",
"bytes": "93870"
},
{
"name": "CSS",
"bytes": "122799"
},
{
"name": "HTML",
"bytes": "204505"
},
{
"name": "JavaScript",
"bytes": "2230137"
},
{
"name": "PHP",
"bytes": "9643"
}
],
"symlink_target": ""
} |
<!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_76) on Tue Apr 21 13:16:28 PDT 2015 -->
<title>Listener (AWS SDK for Android - 2.2.1)</title>
<meta name="date" content="2015-04-21">
<link rel="stylesheet" type="text/css" href="../../../../../JavaDoc.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Listener (AWS SDK for Android - 2.2.1)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="../../../../../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="../../../../../com/amazonaws/services/elasticloadbalancing/model/LBCookieStickinessPolicy.html" title="class in com.amazonaws.services.elasticloadbalancing.model"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/ListenerDescription.html" title="class in com.amazonaws.services.elasticloadbalancing.model"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/amazonaws/services/elasticloadbalancing/model/Listener.html" target="_top">Frames</a></li>
<li><a href="Listener.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.amazonaws.services.elasticloadbalancing.model</div>
<h2 title="Class Listener" class="title">Class Listener</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>com.amazonaws.services.elasticloadbalancing.model.Listener</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">Listener</span>
extends <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</a></pre>
<div class="block"><p>
The Listener data type.
</p></div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../serialized-form.html#com.amazonaws.services.elasticloadbalancing.model.Listener">Serialized Form</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#Listener()">Listener</a></strong>()</code>
<div class="block">Default constructor for a new Listener object.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#Listener(java.lang.String,%20java.lang.Integer,%20java.lang.Integer)">Listener</a></strong>(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> protocol,
<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> loadBalancerPort,
<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> instancePort)</code>
<div class="block">Constructs a new Listener object.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#equals(java.lang.Object)">equals</a></strong>(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> obj)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#getInstancePort()">getInstancePort</a></strong>()</code>
<div class="block">Specifies the TCP port on which the instance server is listening.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#getInstanceProtocol()">getInstanceProtocol</a></strong>()</code>
<div class="block">Specifies the protocol to use for routing traffic to back-end
instances - HTTP, HTTPS, TCP, or SSL.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#getLoadBalancerPort()">getLoadBalancerPort</a></strong>()</code>
<div class="block">Specifies the external load balancer port number.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#getProtocol()">getProtocol</a></strong>()</code>
<div class="block">Specifies the load balancer transport protocol to use for routing -
HTTP, HTTPS, TCP or SSL.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#getSSLCertificateId()">getSSLCertificateId</a></strong>()</code>
<div class="block">The ARN string of the server certificate.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#hashCode()">hashCode</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#setInstancePort(java.lang.Integer)">setInstancePort</a></strong>(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> instancePort)</code>
<div class="block">Specifies the TCP port on which the instance server is listening.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#setInstanceProtocol(java.lang.String)">setInstanceProtocol</a></strong>(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> instanceProtocol)</code>
<div class="block">Specifies the protocol to use for routing traffic to back-end
instances - HTTP, HTTPS, TCP, or SSL.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#setLoadBalancerPort(java.lang.Integer)">setLoadBalancerPort</a></strong>(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> loadBalancerPort)</code>
<div class="block">Specifies the external load balancer port number.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#setProtocol(java.lang.String)">setProtocol</a></strong>(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> protocol)</code>
<div class="block">Specifies the load balancer transport protocol to use for routing -
HTTP, HTTPS, TCP or SSL.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#setSSLCertificateId(java.lang.String)">setSSLCertificateId</a></strong>(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> sSLCertificateId)</code>
<div class="block">The ARN string of the server certificate.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#toString()">toString</a></strong>()</code>
<div class="block">Returns a string representation of this object; useful for testing and
debugging.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html" title="class in com.amazonaws.services.elasticloadbalancing.model">Listener</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#withInstancePort(java.lang.Integer)">withInstancePort</a></strong>(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> instancePort)</code>
<div class="block">Specifies the TCP port on which the instance server is listening.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html" title="class in com.amazonaws.services.elasticloadbalancing.model">Listener</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#withInstanceProtocol(java.lang.String)">withInstanceProtocol</a></strong>(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> instanceProtocol)</code>
<div class="block">Specifies the protocol to use for routing traffic to back-end
instances - HTTP, HTTPS, TCP, or SSL.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html" title="class in com.amazonaws.services.elasticloadbalancing.model">Listener</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#withLoadBalancerPort(java.lang.Integer)">withLoadBalancerPort</a></strong>(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> loadBalancerPort)</code>
<div class="block">Specifies the external load balancer port number.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html" title="class in com.amazonaws.services.elasticloadbalancing.model">Listener</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#withProtocol(java.lang.String)">withProtocol</a></strong>(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> protocol)</code>
<div class="block">Specifies the load balancer transport protocol to use for routing -
HTTP, HTTPS, TCP or SSL.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html" title="class in com.amazonaws.services.elasticloadbalancing.model">Listener</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html#withSSLCertificateId(java.lang.String)">withSSLCertificateId</a></strong>(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> sSLCertificateId)</code>
<div class="block">The ARN string of the server certificate.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Listener()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Listener</h4>
<pre>public Listener()</pre>
<div class="block">Default constructor for a new Listener object. Callers should use the
setter or fluent setter (with...) methods to initialize this object after creating it.</div>
</li>
</ul>
<a name="Listener(java.lang.String, java.lang.Integer, java.lang.Integer)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Listener</h4>
<pre>public Listener(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> protocol,
<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> loadBalancerPort,
<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> instancePort)</pre>
<div class="block">Constructs a new Listener object.
Callers should use the setter or fluent setter (with...) methods to
initialize any additional object members.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>protocol</code> - Specifies the load balancer transport protocol to use
for routing - HTTP, HTTPS, TCP or SSL. This property cannot be
modified for the life of the load balancer.</dd><dd><code>loadBalancerPort</code> - Specifies the external load balancer port
number. This property cannot be modified for the life of the load
balancer.</dd><dd><code>instancePort</code> - Specifies the TCP port on which the instance
server is listening. This property cannot be modified for the life of
the load balancer.</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getProtocol()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getProtocol</h4>
<pre>public <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getProtocol()</pre>
<div class="block">Specifies the load balancer transport protocol to use for routing -
HTTP, HTTPS, TCP or SSL. This property cannot be modified for the life
of the load balancer.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Specifies the load balancer transport protocol to use for routing -
HTTP, HTTPS, TCP or SSL. This property cannot be modified for the life
of the load balancer.</dd></dl>
</li>
</ul>
<a name="setProtocol(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setProtocol</h4>
<pre>public void setProtocol(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> protocol)</pre>
<div class="block">Specifies the load balancer transport protocol to use for routing -
HTTP, HTTPS, TCP or SSL. This property cannot be modified for the life
of the load balancer.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>protocol</code> - Specifies the load balancer transport protocol to use for routing -
HTTP, HTTPS, TCP or SSL. This property cannot be modified for the life
of the load balancer.</dd></dl>
</li>
</ul>
<a name="withProtocol(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withProtocol</h4>
<pre>public <a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html" title="class in com.amazonaws.services.elasticloadbalancing.model">Listener</a> withProtocol(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> protocol)</pre>
<div class="block">Specifies the load balancer transport protocol to use for routing -
HTTP, HTTPS, TCP or SSL. This property cannot be modified for the life
of the load balancer.
<p>
Returns a reference to this object so that method calls can be chained together.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>protocol</code> - Specifies the load balancer transport protocol to use for routing -
HTTP, HTTPS, TCP or SSL. This property cannot be modified for the life
of the load balancer.</dd>
<dt><span class="strong">Returns:</span></dt><dd>A reference to this updated object so that method calls can be chained
together.</dd></dl>
</li>
</ul>
<a name="getLoadBalancerPort()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLoadBalancerPort</h4>
<pre>public <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> getLoadBalancerPort()</pre>
<div class="block">Specifies the external load balancer port number. This property cannot
be modified for the life of the load balancer.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Specifies the external load balancer port number. This property cannot
be modified for the life of the load balancer.</dd></dl>
</li>
</ul>
<a name="setLoadBalancerPort(java.lang.Integer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setLoadBalancerPort</h4>
<pre>public void setLoadBalancerPort(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> loadBalancerPort)</pre>
<div class="block">Specifies the external load balancer port number. This property cannot
be modified for the life of the load balancer.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>loadBalancerPort</code> - Specifies the external load balancer port number. This property cannot
be modified for the life of the load balancer.</dd></dl>
</li>
</ul>
<a name="withLoadBalancerPort(java.lang.Integer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withLoadBalancerPort</h4>
<pre>public <a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html" title="class in com.amazonaws.services.elasticloadbalancing.model">Listener</a> withLoadBalancerPort(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> loadBalancerPort)</pre>
<div class="block">Specifies the external load balancer port number. This property cannot
be modified for the life of the load balancer.
<p>
Returns a reference to this object so that method calls can be chained together.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>loadBalancerPort</code> - Specifies the external load balancer port number. This property cannot
be modified for the life of the load balancer.</dd>
<dt><span class="strong">Returns:</span></dt><dd>A reference to this updated object so that method calls can be chained
together.</dd></dl>
</li>
</ul>
<a name="getInstanceProtocol()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInstanceProtocol</h4>
<pre>public <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getInstanceProtocol()</pre>
<div class="block">Specifies the protocol to use for routing traffic to back-end
instances - HTTP, HTTPS, TCP, or SSL. This property cannot be modified
for the life of the load balancer. <note> If the front-end protocol is
HTTP or HTTPS, <code>InstanceProtocol</code> has to be at the same
protocol layer, i.e., HTTP or HTTPS. Likewise, if the front-end
protocol is TCP or SSL, InstanceProtocol has to be TCP or SSL. </note>
<note> If there is another listener with the same
<code>InstancePort</code> whose <code>InstanceProtocol</code> is
secure, i.e., HTTPS or SSL, the listener's
<code>InstanceProtocol</code> has to be secure, i.e., HTTPS or SSL. If
there is another listener with the same <code>InstancePort</code>
whose <code>InstanceProtocol</code> is HTTP or TCP, the listener's
<code>InstanceProtocol</code> must be either HTTP or TCP. </note></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Specifies the protocol to use for routing traffic to back-end
instances - HTTP, HTTPS, TCP, or SSL. This property cannot be modified
for the life of the load balancer. <note> If the front-end protocol is
HTTP or HTTPS, <code>InstanceProtocol</code> has to be at the same
protocol layer, i.e., HTTP or HTTPS. Likewise, if the front-end
protocol is TCP or SSL, InstanceProtocol has to be TCP or SSL. </note>
<note> If there is another listener with the same
<code>InstancePort</code> whose <code>InstanceProtocol</code> is
secure, i.e., HTTPS or SSL, the listener's
<code>InstanceProtocol</code> has to be secure, i.e., HTTPS or SSL. If
there is another listener with the same <code>InstancePort</code>
whose <code>InstanceProtocol</code> is HTTP or TCP, the listener's
<code>InstanceProtocol</code> must be either HTTP or TCP. </note></dd></dl>
</li>
</ul>
<a name="setInstanceProtocol(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setInstanceProtocol</h4>
<pre>public void setInstanceProtocol(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> instanceProtocol)</pre>
<div class="block">Specifies the protocol to use for routing traffic to back-end
instances - HTTP, HTTPS, TCP, or SSL. This property cannot be modified
for the life of the load balancer. <note> If the front-end protocol is
HTTP or HTTPS, <code>InstanceProtocol</code> has to be at the same
protocol layer, i.e., HTTP or HTTPS. Likewise, if the front-end
protocol is TCP or SSL, InstanceProtocol has to be TCP or SSL. </note>
<note> If there is another listener with the same
<code>InstancePort</code> whose <code>InstanceProtocol</code> is
secure, i.e., HTTPS or SSL, the listener's
<code>InstanceProtocol</code> has to be secure, i.e., HTTPS or SSL. If
there is another listener with the same <code>InstancePort</code>
whose <code>InstanceProtocol</code> is HTTP or TCP, the listener's
<code>InstanceProtocol</code> must be either HTTP or TCP. </note></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>instanceProtocol</code> - Specifies the protocol to use for routing traffic to back-end
instances - HTTP, HTTPS, TCP, or SSL. This property cannot be modified
for the life of the load balancer. <note> If the front-end protocol is
HTTP or HTTPS, <code>InstanceProtocol</code> has to be at the same
protocol layer, i.e., HTTP or HTTPS. Likewise, if the front-end
protocol is TCP or SSL, InstanceProtocol has to be TCP or SSL. </note>
<note> If there is another listener with the same
<code>InstancePort</code> whose <code>InstanceProtocol</code> is
secure, i.e., HTTPS or SSL, the listener's
<code>InstanceProtocol</code> has to be secure, i.e., HTTPS or SSL. If
there is another listener with the same <code>InstancePort</code>
whose <code>InstanceProtocol</code> is HTTP or TCP, the listener's
<code>InstanceProtocol</code> must be either HTTP or TCP. </note></dd></dl>
</li>
</ul>
<a name="withInstanceProtocol(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withInstanceProtocol</h4>
<pre>public <a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html" title="class in com.amazonaws.services.elasticloadbalancing.model">Listener</a> withInstanceProtocol(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> instanceProtocol)</pre>
<div class="block">Specifies the protocol to use for routing traffic to back-end
instances - HTTP, HTTPS, TCP, or SSL. This property cannot be modified
for the life of the load balancer. <note> If the front-end protocol is
HTTP or HTTPS, <code>InstanceProtocol</code> has to be at the same
protocol layer, i.e., HTTP or HTTPS. Likewise, if the front-end
protocol is TCP or SSL, InstanceProtocol has to be TCP or SSL. </note>
<note> If there is another listener with the same
<code>InstancePort</code> whose <code>InstanceProtocol</code> is
secure, i.e., HTTPS or SSL, the listener's
<code>InstanceProtocol</code> has to be secure, i.e., HTTPS or SSL. If
there is another listener with the same <code>InstancePort</code>
whose <code>InstanceProtocol</code> is HTTP or TCP, the listener's
<code>InstanceProtocol</code> must be either HTTP or TCP. </note>
<p>
Returns a reference to this object so that method calls can be chained together.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>instanceProtocol</code> - Specifies the protocol to use for routing traffic to back-end
instances - HTTP, HTTPS, TCP, or SSL. This property cannot be modified
for the life of the load balancer. <note> If the front-end protocol is
HTTP or HTTPS, <code>InstanceProtocol</code> has to be at the same
protocol layer, i.e., HTTP or HTTPS. Likewise, if the front-end
protocol is TCP or SSL, InstanceProtocol has to be TCP or SSL. </note>
<note> If there is another listener with the same
<code>InstancePort</code> whose <code>InstanceProtocol</code> is
secure, i.e., HTTPS or SSL, the listener's
<code>InstanceProtocol</code> has to be secure, i.e., HTTPS or SSL. If
there is another listener with the same <code>InstancePort</code>
whose <code>InstanceProtocol</code> is HTTP or TCP, the listener's
<code>InstanceProtocol</code> must be either HTTP or TCP. </note></dd>
<dt><span class="strong">Returns:</span></dt><dd>A reference to this updated object so that method calls can be chained
together.</dd></dl>
</li>
</ul>
<a name="getInstancePort()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInstancePort</h4>
<pre>public <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> getInstancePort()</pre>
<div class="block">Specifies the TCP port on which the instance server is listening. This
property cannot be modified for the life of the load balancer.
<p>
<b>Constraints:</b><br/>
<b>Range: </b>1 - 65535<br/></div>
<dl><dt><span class="strong">Returns:</span></dt><dd>Specifies the TCP port on which the instance server is listening. This
property cannot be modified for the life of the load balancer.</dd></dl>
</li>
</ul>
<a name="setInstancePort(java.lang.Integer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setInstancePort</h4>
<pre>public void setInstancePort(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> instancePort)</pre>
<div class="block">Specifies the TCP port on which the instance server is listening. This
property cannot be modified for the life of the load balancer.
<p>
<b>Constraints:</b><br/>
<b>Range: </b>1 - 65535<br/></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>instancePort</code> - Specifies the TCP port on which the instance server is listening. This
property cannot be modified for the life of the load balancer.</dd></dl>
</li>
</ul>
<a name="withInstancePort(java.lang.Integer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withInstancePort</h4>
<pre>public <a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html" title="class in com.amazonaws.services.elasticloadbalancing.model">Listener</a> withInstancePort(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a> instancePort)</pre>
<div class="block">Specifies the TCP port on which the instance server is listening. This
property cannot be modified for the life of the load balancer.
<p>
Returns a reference to this object so that method calls can be chained together.
<p>
<b>Constraints:</b><br/>
<b>Range: </b>1 - 65535<br/></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>instancePort</code> - Specifies the TCP port on which the instance server is listening. This
property cannot be modified for the life of the load balancer.</dd>
<dt><span class="strong">Returns:</span></dt><dd>A reference to this updated object so that method calls can be chained
together.</dd></dl>
</li>
</ul>
<a name="getSSLCertificateId()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSSLCertificateId</h4>
<pre>public <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getSSLCertificateId()</pre>
<div class="block">The ARN string of the server certificate. To get the ARN of the server
certificate, call the AWS Identity and Access Management <a
href="http://docs.aws.amazon.com/IAM/latest/APIReference/index.html?API_UploadServerCertificate.html">UploadServerCertificate
</a> API.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>The ARN string of the server certificate. To get the ARN of the server
certificate, call the AWS Identity and Access Management <a
href="http://docs.aws.amazon.com/IAM/latest/APIReference/index.html?API_UploadServerCertificate.html">UploadServerCertificate
</a> API.</dd></dl>
</li>
</ul>
<a name="setSSLCertificateId(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSSLCertificateId</h4>
<pre>public void setSSLCertificateId(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> sSLCertificateId)</pre>
<div class="block">The ARN string of the server certificate. To get the ARN of the server
certificate, call the AWS Identity and Access Management <a
href="http://docs.aws.amazon.com/IAM/latest/APIReference/index.html?API_UploadServerCertificate.html">UploadServerCertificate
</a> API.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>sSLCertificateId</code> - The ARN string of the server certificate. To get the ARN of the server
certificate, call the AWS Identity and Access Management <a
href="http://docs.aws.amazon.com/IAM/latest/APIReference/index.html?API_UploadServerCertificate.html">UploadServerCertificate
</a> API.</dd></dl>
</li>
</ul>
<a name="withSSLCertificateId(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withSSLCertificateId</h4>
<pre>public <a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/Listener.html" title="class in com.amazonaws.services.elasticloadbalancing.model">Listener</a> withSSLCertificateId(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> sSLCertificateId)</pre>
<div class="block">The ARN string of the server certificate. To get the ARN of the server
certificate, call the AWS Identity and Access Management <a
href="http://docs.aws.amazon.com/IAM/latest/APIReference/index.html?API_UploadServerCertificate.html">UploadServerCertificate
</a> API.
<p>
Returns a reference to this object so that method calls can be chained together.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>sSLCertificateId</code> - The ARN string of the server certificate. To get the ARN of the server
certificate, call the AWS Identity and Access Management <a
href="http://docs.aws.amazon.com/IAM/latest/APIReference/index.html?API_UploadServerCertificate.html">UploadServerCertificate
</a> API.</dd>
<dt><span class="strong">Returns:</span></dt><dd>A reference to this updated object so that method calls can be chained
together.</dd></dl>
</li>
</ul>
<a name="toString()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> toString()</pre>
<div class="block">Returns a string representation of this object; useful for testing and
debugging.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a></code> in class <code><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>A string representation of this object.</dd><dt><span class="strong">See Also:</span></dt><dd><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang"><code>Object.toString()</code></a></dd></dl>
</li>
</ul>
<a name="hashCode()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode</h4>
<pre>public int hashCode()</pre>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a></code> in class <code><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
</dl>
</li>
</ul>
<a name="equals(java.lang.Object)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>equals</h4>
<pre>public boolean equals(<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> obj)</pre>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a></code> in class <code><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em>
<script src="http://aws.amazon.com/js/urchin.js" type="text/javascript"></script>
<script type="text/javascript">urchinTracker();</script>
</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/LBCookieStickinessPolicy.html" title="class in com.amazonaws.services.elasticloadbalancing.model"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../com/amazonaws/services/elasticloadbalancing/model/ListenerDescription.html" title="class in com.amazonaws.services.elasticloadbalancing.model"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/amazonaws/services/elasticloadbalancing/model/Listener.html" target="_top">Frames</a></li>
<li><a href="Listener.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.
</small></p>
</body>
</html>
| {
"content_hash": "0a704176c86c48faf8c3ea741e1f0029",
"timestamp": "",
"source": "github",
"line_count": 745,
"max_line_length": 929,
"avg_line_length": 58.25503355704698,
"alnum_prop": 0.7014746543778801,
"repo_name": "94bryanr/PartypushAndroid",
"id": "e9a4fc257097dc5242b35075f4418ed5d77bd3ac",
"size": "43400",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Libraries/aws-android-sdk-2.2.1/documentation/javadoc/com/amazonaws/services/elasticloadbalancing/model/Listener.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "10671"
},
{
"name": "Java",
"bytes": "139466"
},
{
"name": "JavaScript",
"bytes": "5141"
}
],
"symlink_target": ""
} |
<!--
@author Horacio Gonzalez (@lostinbrittany)
@copyright (c) 2017 Cityzen Data
@license Apache 2.0
-->
<!-- Load the Polymer.Element base class -->
<link rel="import" href="../polymer/polymer-element.html">
<!-- Import mixins -->
<link rel="import" href="./warp10-tiles-mixin.html">
<!-- Import elements -->
<link rel="import" href="./warp10-tiles-engine.html">
<link rel="import" href="./warp10-tiles-style.html">
<link rel="import" href="../warp10-quantumviz/warp10-display-map.html">
<dom-module id="warp10-tiles-display-map">
<template>
<style include="warp10-tiles-style">
:host {
display: inline-block;
}
</style>
<warp10-tiles-engine
size="[[size]]"
fg-color="[[fgColor]]"
bg-color="[[bgColor]]"
label="[[label]]"
description="[[description]]"
icon="[[icon]]"
on-useful-dimensions-changed="_onUsefulDimensionsChange"
debug="[[debug]]">
<div id="value" slot="value" lang="en">
<warp10-display-map
data="[[data]]"
zoom="[[zoom]]"
longitude="[[longitude]]"
latitude="[[latitude]]"
debug="[[debug]]"
currentValues="[[currentValues]]"
annotationsSelectedTimestamp="[[annotationsSelectedTimestamp]]"
></warp10-display-map>
</div>
</warp10-tiles-engine>
</template>
<script>
// Extend Polymer.Element base class
/* global Warp10TilesMixin */
/* eslint new-cap: ["error", { "capIsNewExceptions": ["Warp10TilesMixin"] }] */
class Warp10TilesDisplayMap extends Warp10TilesMixin(Polymer.Element) {
static get is() {
return 'warp10-tiles-display-map';
}
static get properties() {
return {
/**
* The data to display
*/
data: {
type: Object,
observer: '_onDatachange',
},
_dimensions: {
type: Object,
},
_valueFontSize: {
type: Number,
value: 1,
},
_isAttached: {
type: Boolean,
value: false,
},
/**
* The level of zoom
*/
zoom: {
type: Number,
notify: true,
value: 10,
},
/**
* The longitude of the map center
*/
longitude: {
type: Number,
notify: true,
},
/**
* The latitude of the map center
*/
latitude: {
type: Number,
notify: true,
},
/**
* The selected value set
*/
currentValues: {
type: Object,
observer: '_currentValuesChanged',
notify: true,
},
/**
* The timestamp of the selected annotationsSelectedTimestamp
*/
annotationsSelectedTimestamp: {
type: Number,
notify: true,
observer: '_annotationsSelectedTimestampChanged',
value: -1,
},
};
}
_onDatachange() {
if (this.debug) {
console.log('[warp10-tiles-display-map] _onDatachange', this.data);
console.log('[warp10-tiles-display-map] _onDatachange', JSON.stringify(this.data));
}
}
connectedCallback() {
super.connectedCallback();
this._isAttached = true;
if (this.debug) {
console.log('[warp10-tiles-display-map] connectedCallback');
}
}
// --------------------------------------------------------------------------------------------
// Event listeners
// --------------------------------------------------------------------------------------------
_onUsefulDimensionsChange(evt) {
if (this.debug) {
console.log('[warp10-tiles-display-map] _onUsefulDimensionsChange', evt.detail.value);
}
this._dimensions = evt.detail.value;
// this.updateStyles({'--max-width': this._dimensions.width+'px'});
}
}
// Register custom element definition using standard platform API
customElements.define(Warp10TilesDisplayMap.is, Warp10TilesDisplayMap);
</script>
</dom-module>
| {
"content_hash": "2b8019267a14e3a1314a07c09a26233b",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 101,
"avg_line_length": 27.264150943396228,
"alnum_prop": 0.4938869665513264,
"repo_name": "LostInBrittany/warp10-tiles",
"id": "30b3f6b5b45c9fde10aa6eb373945cda94a338d9",
"size": "4335",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "warp10-tiles-display-map.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "127967"
}
],
"symlink_target": ""
} |
goog.provide('pl.retained.Image');
goog.require('pl.gfx');
goog.require('pl.retained.Element');
/**
* @constructor
* @extends {pl.retained.Element}
* @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} value
* @param {number} width
* @param {number} height
*/
pl.retained.Image = function(value, width, height) {
goog.base(this, width, height, false);
this._value = value;
};
goog.inherits(pl.retained.Image, pl.retained.Element);
/**
* @override
*/
pl.retained.Image.prototype.drawOverride = function(ctx) {
ctx.drawImage(this._value, 0, 0, this.width, this.height);
};
| {
"content_hash": "969a03eb7a7940a194e745f928469ea0",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 69,
"avg_line_length": 22.22222222222222,
"alnum_prop": 0.6983333333333334,
"repo_name": "Talinpa/html5B4",
"id": "9e9cc1ad770f8baee9f3c859554de52656e8a447",
"size": "600",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "box2d/src/retained/image.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ActionScript",
"bytes": "5233"
},
{
"name": "CSS",
"bytes": "125416"
},
{
"name": "Emacs Lisp",
"bytes": "2410"
},
{
"name": "HTML",
"bytes": "1488839"
},
{
"name": "JavaScript",
"bytes": "19024592"
},
{
"name": "Makefile",
"bytes": "1230"
},
{
"name": "Python",
"bytes": "91571"
},
{
"name": "Ruby",
"bytes": "308"
},
{
"name": "Shell",
"bytes": "1903"
}
],
"symlink_target": ""
} |
package com.leanplum.messagetemplates.actions;
import android.app.Activity;
import android.content.Context;
import androidx.annotation.NonNull;
import com.leanplum.ActionArgs;
import com.leanplum.ActionContext;
import com.leanplum.LeanplumActivityHelper;
import com.leanplum.internal.Log;
import com.leanplum.messagetemplates.MessageTemplate;
import com.leanplum.messagetemplates.controllers.RichHtmlController;
import com.leanplum.messagetemplates.options.RichHtmlOptions;
public class RichHtmlMessage implements MessageTemplate {
private static final String HTML = "HTML";
private RichHtmlController richHtml;
@NonNull
@Override
public String getName() {
return HTML;
}
@NonNull
@Override
public ActionArgs createActionArgs(@NonNull Context context) {
return RichHtmlOptions.toArgs();
}
@Override
public boolean present(@NonNull ActionContext context) {
Activity activity = LeanplumActivityHelper.getCurrentActivity();
if (activity == null || activity.isFinishing()) {
return false;
}
try {
RichHtmlOptions richOptions = new RichHtmlOptions(context);
if (richOptions.getHtmlTemplate() == null) {
return false;
}
// Message is shown after html is rendered. Check handleOpenEvent(url) method.
richHtml = new RichHtmlController(activity, richOptions);
richHtml.setOnDismissListener(listener -> {
richHtml = null;
context.actionDismissed();
});
return true;
} catch (Throwable t) {
Log.e("Fail on show HTML In-App message: %s", t.getMessage());
return false;
}
}
@Override
public boolean dismiss(@NonNull ActionContext context) {
if (richHtml != null) {
richHtml.dismiss();
}
return true;
}
}
| {
"content_hash": "9ec039541ff059b1f8e0d2a4af4766bb",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 84,
"avg_line_length": 26.492537313432837,
"alnum_prop": 0.716056338028169,
"repo_name": "Leanplum/Leanplum-Android-SDK",
"id": "eb7779bed3a792c28ca789d2e146f8a7be2461ad",
"size": "2645",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "AndroidSDKCore/src/main/java/com/leanplum/messagetemplates/actions/RichHtmlMessage.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "8924"
},
{
"name": "Java",
"bytes": "1196008"
},
{
"name": "Kotlin",
"bytes": "112584"
},
{
"name": "Makefile",
"bytes": "286"
},
{
"name": "Shell",
"bytes": "1224"
}
],
"symlink_target": ""
} |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE191_Integer_Underflow__int_fgets_sub_82.h
Label Definition File: CWE191_Integer_Underflow__int.label.xml
Template File: sources-sinks-82.tmpl.h
*/
/*
* @description
* CWE: 191 Integer Underflow
* BadSource: fgets Read data from the console using fgets()
* GoodSource: Set data to a small, non-zero number (negative two)
* Sinks: sub
* GoodSink: Ensure there will not be an underflow before subtracting 1 from data
* BadSink : Subtract 1 from data, which can cause an Underflow
* Flow Variant: 82 Data flow: data passed in a parameter to an virtual method called via a pointer
*
* */
#include "std_testcase.h"
namespace CWE191_Integer_Underflow__int_fgets_sub_82
{
class CWE191_Integer_Underflow__int_fgets_sub_82_base
{
public:
/* pure virtual function */
virtual void action(int data) = 0;
};
#ifndef OMITBAD
class CWE191_Integer_Underflow__int_fgets_sub_82_bad : public CWE191_Integer_Underflow__int_fgets_sub_82_base
{
public:
void action(int data);
};
#endif /* OMITBAD */
#ifndef OMITGOOD
class CWE191_Integer_Underflow__int_fgets_sub_82_goodG2B : public CWE191_Integer_Underflow__int_fgets_sub_82_base
{
public:
void action(int data);
};
class CWE191_Integer_Underflow__int_fgets_sub_82_goodB2G : public CWE191_Integer_Underflow__int_fgets_sub_82_base
{
public:
void action(int data);
};
#endif /* OMITGOOD */
}
| {
"content_hash": "75b33fbc2691fccca00a2e634f011251",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 113,
"avg_line_length": 26.25,
"alnum_prop": 0.7020408163265306,
"repo_name": "maurer/tiamat",
"id": "14208d9336458d615223d6f3d5349f0b975884dc",
"size": "1470",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "samples/Juliet/testcases/CWE191_Integer_Underflow/s02/CWE191_Integer_Underflow__int_fgets_sub_82.h",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package com.google.idea.blaze.base.lang.projectview.parser;
import com.google.idea.blaze.base.lang.projectview.language.ProjectViewKeywords;
import com.google.idea.blaze.base.lang.projectview.lexer.ProjectViewTokenType;
import com.google.idea.blaze.base.lang.projectview.psi.ProjectViewElementType;
import com.google.idea.blaze.base.lang.projectview.psi.ProjectViewElementTypes;
import com.google.idea.blaze.base.projectview.section.ScalarSectionParser;
import com.intellij.lang.PsiBuilder;
import com.intellij.openapi.application.ApplicationManager;
import javax.annotation.Nullable;
/** Project view psi parser. */
public class ProjectViewPsiParser {
private final PsiBuilder builder;
public ProjectViewPsiParser(PsiBuilder builder) {
this.builder = builder;
}
public void parseFile() {
builder.setDebugMode(ApplicationManager.getApplication().isUnitTestMode());
while (!builder.eof()) {
if (matches(ProjectViewTokenType.NEWLINE)) {
continue;
}
parseSection();
}
}
/** A block is one of: - scalar section - list section */
private void parseSection() {
PsiBuilder.Marker marker = builder.mark();
if (matches(ProjectViewTokenType.LIST_KEYWORD)) {
expect(ProjectViewTokenType.COLON);
skipPastNewline();
parseListItems();
marker.done(ProjectViewElementTypes.LIST_SECTION);
return;
}
if (currentToken() == ProjectViewTokenType.SCALAR_KEYWORD) {
ScalarSectionParser parser =
ProjectViewKeywords.SCALAR_KEYWORD_MAP.get(builder.getTokenText());
if (parser != null) {
parseScalarSection(parser);
marker.done(ProjectViewElementTypes.SCALAR_SECTION);
return;
}
}
// handle each of the error cases
if (matches(ProjectViewTokenType.INDENT)) {
skipBlockAndError(
marker, "Invalid indentation. Indented lines must be preceded by a list keyword");
return;
}
if (matches(ProjectViewTokenType.COLON)) {
skipBlockAndError(marker, "Invalid section: lines cannot begin with a colon.");
return;
}
skipBlockAndError(marker, "Unrecognized keyword: " + builder.getTokenText());
}
private void parseListItems() {
while (!builder.eof()) {
if (matches(ProjectViewTokenType.NEWLINE)) {
continue;
}
if (!matches(ProjectViewTokenType.INDENT)) {
return;
}
PsiBuilder.Marker marker = builder.mark();
skipToNewlineToken();
marker.done(ProjectViewElementTypes.LIST_ITEM);
builder.advanceLexer();
}
}
private void parseScalarSection(ScalarSectionParser parser) {
boolean whitespaceDivider = builder.rawLookup(1) == ProjectViewTokenType.WHITESPACE;
builder.advanceLexer();
char divider = parser.getDivider();
if (divider == ' ') {
if (!whitespaceDivider) {
builder.error("Whitespace divider expected after '" + parser.getName() + "'");
builder.advanceLexer();
}
parseScalarItem();
return;
}
if (whitespaceDivider || !Character.toString(divider).equals(builder.getTokenText())) {
builder.error(String.format("'%s' expected", divider));
}
if (!whitespaceDivider) {
builder.advanceLexer();
}
parseScalarItem();
}
private void parseScalarItem() {
PsiBuilder.Marker marker = builder.mark();
skipToNewlineToken();
marker.done(ProjectViewElementTypes.SCALAR_ITEM);
builder.advanceLexer();
}
/** Consumes the current token iff it matches the expected type. Otherwise, returns false */
private boolean matches(ProjectViewTokenType kind) {
if (currentToken() == kind) {
builder.advanceLexer();
return true;
}
return false;
}
/**
* Consumes the current token if it's of the expected type. Otherwise, returns false and reports
* an error.
*/
private boolean expect(ProjectViewTokenType kind) {
if (matches(kind)) {
return true;
}
builder.error(String.format("'%s' expected", kind));
return false;
}
/** Checks if the upcoming sequence of tokens match that expected. Doesn't advance the parser. */
private boolean atTokenSequence(ProjectViewTokenType... kinds) {
for (int i = 0; i < kinds.length; i++) {
if (builder.lookAhead(i) != kinds[i]) {
return false;
}
}
return true;
}
@Nullable
private ProjectViewTokenType currentToken() {
return (ProjectViewTokenType) builder.getTokenType();
}
private void skipBlockAndError(PsiBuilder.Marker marker, String message) {
skipToNextBlock();
marker.error(message);
}
/** Skip to the start of the next unindented line */
private void skipToNextBlock() {
while (!builder.eof()) {
if (atTokenSequence(ProjectViewTokenType.NEWLINE, ProjectViewTokenType.IDENTIFIER)) {
builder.advanceLexer();
return;
}
builder.advanceLexer();
}
}
/** Skip to the start of the next line */
private void skipPastNewline() {
while (!builder.eof()) {
if (matches(ProjectViewTokenType.NEWLINE)) {
return;
}
builder.advanceLexer();
}
}
/** Skip to the end of the current line */
private void skipToNewlineToken() {
while (!builder.eof()) {
if (currentToken() == ProjectViewTokenType.NEWLINE) {
return;
}
builder.advanceLexer();
}
}
private void buildTokenElement(ProjectViewElementType type) {
PsiBuilder.Marker marker = builder.mark();
builder.advanceLexer();
marker.done(type);
}
}
| {
"content_hash": "30712908d255aab0bf3d71d0ffedf711",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 99,
"avg_line_length": 30.01081081081081,
"alnum_prop": 0.6734510086455331,
"repo_name": "brendandouglas/intellij",
"id": "2703bd2796d357f032f7bc5d06a524bedc544fcc",
"size": "6173",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "base/src/com/google/idea/blaze/base/lang/projectview/parser/ProjectViewPsiParser.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "390"
},
{
"name": "C++",
"bytes": "190"
},
{
"name": "Java",
"bytes": "5276951"
},
{
"name": "Python",
"bytes": "166921"
},
{
"name": "Scala",
"bytes": "466"
}
],
"symlink_target": ""
} |
#ifndef ALIANALYSISTASKPARTICLEEFF
#define ALIANALYSISTASKPARTICLEEFF
#define MULTBINS 1
#define PARTTYPES 6
#include "AliAnalysisTaskSE.h"
#include "AliAnalysisUtils.h"
#include "AliEventCuts.h"
#include "THnSparse.h"
#include "AliPIDResponse.h"
#include "AliAODpidUtil.h"
class AliAnalysisUtils;
class AliAnalysisTaskParticleEff :public AliAnalysisTaskSE{
public:
AliAnalysisTaskParticleEff() : AliAnalysisTaskSE(), centrality(0), fHistoList(0), fMassInvLambdaPass(0),fMassInvAntiLambdaPass(0), fMassInvLambdaFail(0), fMassInvAntiLambdaFail(0),fEtaLambda(0),fPtLambda(0), fEtaAntiLambda(0),fPtAntiLambda(0), fCutsLambda(0), fCutsAntiLambda(0), fTruePtLambdaMC(0), fRecPtLambdaMC(0), fTruePtAntiLambdaMC(0),fRecPtAntiLambdaMC(0), fMassInvXimPass(0),fMassInvXipPass(0), fMassInvXimFail(0), fMassInvXipFail(0),fEtaXim(0),fPtXim(0), fEtaXip(0),fPtXip(0), fCutsXim(0), fCutsXip(0), fTruePtXimMC(0), fRecPtXimMC(0), fTruePtXipMC(0),fRecPtXipMC(0), fDCAtoPrimVtx(0), fpidResponse(0), fAODpidUtil(0), fEventCuts(0)
{
for(Int_t i = 0; i < MULTBINS*PARTTYPES; i++) {
for(Int_t chg=0;chg<2;chg++){
fGeneratedMCPrimaries[i][chg] = NULL;
fMCPrimariesThatAreReconstructed[i][chg] = NULL;
fGeneratedMCPrimaries4D[i][chg] = NULL;
fMCPrimariesThatAreReconstructed4D[i][chg] = NULL;
fMCPrimariesThatAreReconstructedNoNsigma[i][chg] = NULL;
fReconstructedAfterCuts[i][chg] = NULL;
fReconstructedNotPrimaries[i][chg] = NULL;
fReconstructedPrimaries[i][chg] = NULL;
fContamination[i][chg] = NULL;
}
}
for ( Int_t i = 0; i < 11; i++) {
fHistQA[i] = NULL;
if(i<3) fHistQA2D[i] = NULL;
}
}
AliAnalysisTaskParticleEff(const Char_t *partName); // default constructor
virtual ~AliAnalysisTaskParticleEff(); // default destructor
virtual void UserCreateOutputObjects(); // user create output objects
virtual void UserExec(Option_t *option); // user exec
//void Terminate(Option_t *option);
private:
AliAnalysisTaskParticleEff(const AliAnalysisTaskParticleEff &); // copy constructor
AliAnalysisTaskParticleEff &operator=(const AliAnalysisTaskParticleEff &); // operator=
//AliAODEvent *aodEvent;
AliCentrality *centrality;
//AliAODTrack *fTpcTracks;
//AliAODVertex *vertex;
//AliAODVertex *vtxSPD;
//AliAODMCParticle *MCtrk;
//AliESDtrackCuts *fTrackCuts; // ESD track cuts
TList *fHistoList; // histo list
//TClonesArray *arrayMC;
TH1F *fHistEv[4];
TH1F *fHistQA[11];
TH2F *fHistQA2D[3];
TH2F *fHistQAPID[5][PARTTYPES][2];
TH2F *fHistQAPIDFail[5][PARTTYPES][2];
TH1F* fHistEvCuts[MULTBINS];
TH2F *fHistQALambdas[2];
TH2F *fOriginLambdas[5][2];
TH2F *fHistQAXi[2];
TH2F *fOriginXi[5][2];
//TObjArray *recoParticleArray;
TH2F *fGeneratedMCPrimaries[MULTBINS*PARTTYPES][2];
TH2F *fMCPrimariesThatAreReconstructed[MULTBINS*PARTTYPES][2];
THnSparseF *fMCPrimariesThatAreReconstructed4D[MULTBINS*PARTTYPES][2];
THnSparseF *fGeneratedMCPrimaries4D[MULTBINS*PARTTYPES][2];
TH2F *fMCPrimariesThatAreReconstructedNoNsigma[MULTBINS*PARTTYPES][2];
TH2F *fReconstructedAfterCuts[MULTBINS*PARTTYPES][2];
TH2F *fReconstructedNotPrimaries[MULTBINS*PARTTYPES][2];
TH2F *fReconstructedPrimaries[MULTBINS*PARTTYPES][2];
TH2F *fContamination[MULTBINS*PARTTYPES][2];
TH2F *fMisidentification[MULTBINS*PARTTYPES][2];
TH2F *fPrimVsDCA[MULTBINS*PARTTYPES][2];
TH2F *fSecWeakVsDCA[MULTBINS*PARTTYPES][2];
TH2F *fSecMatVsDCA[MULTBINS*PARTTYPES][2];
TH2F *fFakeVsDCA[MULTBINS*PARTTYPES][2];
TH2F *fPrimVsCosPointingAngle[MULTBINS*PARTTYPES][2];
TH2F *fSecWeakVsCosPointingAngle[MULTBINS*PARTTYPES][2];
TH2F *fSecMatVsCosPointingAngle[MULTBINS*PARTTYPES][2];
TH2F *fFakeVsCosPointingAngle[MULTBINS*PARTTYPES][2];
TH2F *fPrimVsDecayRadius[MULTBINS*PARTTYPES][2];
TH2F *fSecWeakVsDecayRadius[MULTBINS*PARTTYPES][2];
TH2F *fSecMatVsDecayRadius[MULTBINS*PARTTYPES][2];
TH2F *fFakeVsDecayRadius[MULTBINS*PARTTYPES][2];
TH2F *fAllVsDCA[MULTBINS*PARTTYPES][2];
TH2F *fAllVsCosPointingAngle[MULTBINS*PARTTYPES][2];
TH2F *fAllVsDecayRadius[MULTBINS*PARTTYPES][2];
TH1D *fMassInvLambdaPass;
TH1D *fMassInvAntiLambdaPass;
TH1D *fMassInvLambdaFail;
TH1D *fMassInvAntiLambdaFail;
TH1D *fEtaLambda;
TH1D *fPtLambda;
TH1D *fEtaAntiLambda;
TH1D *fPtAntiLambda;
TH1D *fCutsLambda;
TH1D *fCutsAntiLambda;
TH2D *fTruePtLambdaMC;
TH2D *fRecPtLambdaMC;
TH2D *fTruePtAntiLambdaMC;
TH2D *fRecPtAntiLambdaMC;
//********************Xi*******************
TH1D *fMassInvXimPass;
TH1D *fMassInvXipPass;
TH1D *fMassInvXimFail;
TH1D *fMassInvXipFail;
TH1D *fEtaXim;
TH1D *fPtXim;
TH1D *fEtaXip;
TH1D *fPtXip;
TH2D *fTruePtXimMC;
TH2D *fRecPtXimMC;
TH2D *fTruePtXipMC;
TH2D *fRecPtXipMC;
TH1D *fCutsXim;
TH1D *fCutsXip;
//******************************************
double fDCAtoPrimVtx;
AliPIDResponse *fpidResponse;
AliAODpidUtil *fAODpidUtil;
AliEventCuts *fEventCuts;
ClassDef(AliAnalysisTaskParticleEff, 0);
};
#endif /* ALIANALYSISTASKPARTICLEEFFICIENCY */
| {
"content_hash": "a0e95248dc86d324d1fac9e71eaa0f01",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 645,
"avg_line_length": 32.0125786163522,
"alnum_prop": 0.7337917485265226,
"repo_name": "dstocco/AliPhysics",
"id": "726600a784d876ed9eb5295073ca4d8b4a7d70f6",
"size": "5090",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "PWGCF/FEMTOSCOPY/EfficiencyTask/AliAnalysisTaskParticleEff.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "65492082"
},
{
"name": "C++",
"bytes": "113266180"
},
{
"name": "CMake",
"bytes": "585834"
},
{
"name": "CSS",
"bytes": "5189"
},
{
"name": "Fortran",
"bytes": "134275"
},
{
"name": "HTML",
"bytes": "34737"
},
{
"name": "JavaScript",
"bytes": "3536"
},
{
"name": "Makefile",
"bytes": "25080"
},
{
"name": "Objective-C",
"bytes": "169708"
},
{
"name": "Perl",
"bytes": "17128"
},
{
"name": "Python",
"bytes": "758511"
},
{
"name": "Shell",
"bytes": "956557"
},
{
"name": "TeX",
"bytes": "392122"
}
],
"symlink_target": ""
} |
<?php
require_once(__DIR__ . '/../vendor/autoload.php');
use League\Flysystem\Filesystem;
use League\Flysystem\Memory\MemoryAdapter as Adapter;
use Flyfinder\Finder;
use Flyfinder\Specification\IsHidden;
/*
* First create a new Filesystem and add the FlySystem plugin
* In this example we are using a filesystem with the memory adapter
*/
$filesystem = new Filesystem(new Adapter());
$filesystem->addPlugin(new Finder());
// Create some demo files
$filesystem->write('test.txt', 'test');
$filesystem->write('.hiddendir/.test.txt', 'test');
//In order to tell FlyFinder what to find, you need to give it a specification
//In this example the specification will be satisfied by files and directories that are hidden
$specification = new IsHidden();
//FlyFinder will yield a generator object with the files that are found
$generator = $filesystem->find($specification);
$result = [];
foreach ($generator as $value) {
$result[] = $value;
}
| {
"content_hash": "799769b990f4fd2fa502f7db86d4cee7",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 94,
"avg_line_length": 30.64516129032258,
"alnum_prop": 0.7368421052631579,
"repo_name": "phpDocumentor/FlyFinder",
"id": "0bfd896bcbc39d436f9dd94c56e7319c8ecf35ed",
"size": "950",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/01-find-hidden-files.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Makefile",
"bytes": "1091"
},
{
"name": "PHP",
"bytes": "65895"
}
],
"symlink_target": ""
} |
cask "metashape" do
version "1.8.0"
sha256 "cd32618913ad89338923f7fbdface5e6cfb17a7d9f40f1f3bfb5bc4268ddcc17"
url "http://download.agisoft.com/metashape_#{version.dots_to_underscores}.dmg"
name "Agisoft Metashape Standard Edition"
desc "Process digital images and generate 3D spatial data"
homepage "https://www.agisoft.com/"
livecheck do
url "https://www.agisoft.com/downloads/installer/"
regex(/Metashape\s*(\d+(?:\.\d+)+)/i)
end
app "Metashape.app"
zap trash: [
"~/Library/Preferences/com.agisoft.Metashape.plist",
"~/Library/Saved Application State/com.agisoft.metashape.standard.savedState",
]
end
| {
"content_hash": "7de76c5fdb60e4d755a9af379758bb7f",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 82,
"avg_line_length": 30.714285714285715,
"alnum_prop": 0.7271317829457364,
"repo_name": "malob/homebrew-cask",
"id": "79933f39ef6ae3d45d817cba5579f94ee43a2fab",
"size": "645",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "Casks/metashape.rb",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Dockerfile",
"bytes": "249"
},
{
"name": "Python",
"bytes": "3630"
},
{
"name": "Ruby",
"bytes": "2864635"
},
{
"name": "Shell",
"bytes": "32035"
}
],
"symlink_target": ""
} |
=================================================
Psycopg -- PostgreSQL database adapter for Python
=================================================
.. sectionauthor:: Daniele Varrazzo <daniele.varrazzo@gmail.com>
Psycopg_ is the most popular PostgreSQL_ database adapter for the Python_
programming language. Its main features are the complete implementation of
the Python |DBAPI|_ specification and the thread safety (several threads can
share the same connection). It was designed for heavily multi-threaded
applications that create and destroy lots of cursors and make a large number
of concurrent :sql:`INSERT`\s or :sql:`UPDATE`\s.
Psycopg 2 is mostly implemented in C as a libpq_ wrapper, resulting in being
both efficient and secure. It features client-side and :ref:`server-side
<server-side-cursors>` cursors, :ref:`asynchronous communication
<async-support>` and :ref:`notifications <async-notify>`, |COPY-TO-FROM|__
support. Many Python types are supported out-of-the-box and :ref:`adapted to
matching PostgreSQL data types <python-types-adaptation>`; adaptation can be
extended and customized thanks to a flexible :ref:`objects adaptation system
<adapting-new-types>`.
Psycopg 2 is both Unicode and Python 3 friendly.
.. _Psycopg: http://initd.org/psycopg/
.. _PostgreSQL: http://www.postgresql.org/
.. _Python: http://www.python.org/
.. _libpq: http://www.postgresql.org/docs/current/static/libpq.html
.. |COPY-TO-FROM| replace:: :sql:`COPY TO/COPY FROM`
.. __: http://www.postgresql.org/docs/current/static/sql-copy.html
.. rubric:: Contents
.. toctree::
:maxdepth: 2
install
usage
module
connection
cursor
advanced
extensions
extras
tz
pool
errorcodes
faq
news
.. ifconfig:: builder != 'text'
.. rubric:: Indices and tables
* :ref:`genindex`
* :ref:`search`
.. ifconfig:: todo_include_todos
.. note::
**To Do items in the documentation**
.. todolist::
| {
"content_hash": "ce835b2e658651d1e2f11cae8c285bb3",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 77,
"avg_line_length": 28.47826086956522,
"alnum_prop": 0.6844783715012722,
"repo_name": "mollstam/UnrealPy",
"id": "5cf0f24eaf23f3f2663a15942c5e8515578d47c2",
"size": "1965",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/psycopg2-2.6.1/doc/src/index.rst",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "APL",
"bytes": "587"
},
{
"name": "ASP",
"bytes": "2753"
},
{
"name": "ActionScript",
"bytes": "5686"
},
{
"name": "Ada",
"bytes": "94225"
},
{
"name": "Agda",
"bytes": "3154"
},
{
"name": "Alloy",
"bytes": "6579"
},
{
"name": "ApacheConf",
"bytes": "12482"
},
{
"name": "AppleScript",
"bytes": "421"
},
{
"name": "Assembly",
"bytes": "1093261"
},
{
"name": "AutoHotkey",
"bytes": "3733"
},
{
"name": "AutoIt",
"bytes": "667"
},
{
"name": "Awk",
"bytes": "63276"
},
{
"name": "Batchfile",
"bytes": "147828"
},
{
"name": "BlitzBasic",
"bytes": "185102"
},
{
"name": "BlitzMax",
"bytes": "2387"
},
{
"name": "Boo",
"bytes": "1111"
},
{
"name": "Bro",
"bytes": "7337"
},
{
"name": "C",
"bytes": "108397183"
},
{
"name": "C#",
"bytes": "156749"
},
{
"name": "C++",
"bytes": "13535833"
},
{
"name": "CLIPS",
"bytes": "6933"
},
{
"name": "CMake",
"bytes": "12441"
},
{
"name": "COBOL",
"bytes": "114812"
},
{
"name": "CSS",
"bytes": "430375"
},
{
"name": "Ceylon",
"bytes": "1387"
},
{
"name": "Chapel",
"bytes": "4366"
},
{
"name": "Cirru",
"bytes": "2574"
},
{
"name": "Clean",
"bytes": "9679"
},
{
"name": "Clojure",
"bytes": "23871"
},
{
"name": "CoffeeScript",
"bytes": "20149"
},
{
"name": "ColdFusion",
"bytes": "9006"
},
{
"name": "Common Lisp",
"bytes": "49017"
},
{
"name": "Coq",
"bytes": "66"
},
{
"name": "Cucumber",
"bytes": "390"
},
{
"name": "Cuda",
"bytes": "776"
},
{
"name": "D",
"bytes": "7556"
},
{
"name": "DIGITAL Command Language",
"bytes": "425938"
},
{
"name": "DTrace",
"bytes": "6706"
},
{
"name": "Dart",
"bytes": "591"
},
{
"name": "Dylan",
"bytes": "6343"
},
{
"name": "Ecl",
"bytes": "2599"
},
{
"name": "Eiffel",
"bytes": "2145"
},
{
"name": "Elixir",
"bytes": "4340"
},
{
"name": "Emacs Lisp",
"bytes": "18303"
},
{
"name": "Erlang",
"bytes": "5746"
},
{
"name": "F#",
"bytes": "19156"
},
{
"name": "FORTRAN",
"bytes": "38458"
},
{
"name": "Factor",
"bytes": "10194"
},
{
"name": "Fancy",
"bytes": "2581"
},
{
"name": "Fantom",
"bytes": "25331"
},
{
"name": "GAP",
"bytes": "29880"
},
{
"name": "GLSL",
"bytes": "450"
},
{
"name": "Gnuplot",
"bytes": "11501"
},
{
"name": "Go",
"bytes": "5444"
},
{
"name": "Golo",
"bytes": "1649"
},
{
"name": "Gosu",
"bytes": "2853"
},
{
"name": "Groff",
"bytes": "3458639"
},
{
"name": "Groovy",
"bytes": "2586"
},
{
"name": "HTML",
"bytes": "92126540"
},
{
"name": "Haskell",
"bytes": "49593"
},
{
"name": "Haxe",
"bytes": "16812"
},
{
"name": "Hy",
"bytes": "7237"
},
{
"name": "IDL",
"bytes": "2098"
},
{
"name": "Idris",
"bytes": "2771"
},
{
"name": "Inform 7",
"bytes": "1944"
},
{
"name": "Inno Setup",
"bytes": "18796"
},
{
"name": "Ioke",
"bytes": "469"
},
{
"name": "Isabelle",
"bytes": "21392"
},
{
"name": "Jasmin",
"bytes": "9428"
},
{
"name": "Java",
"bytes": "4040623"
},
{
"name": "JavaScript",
"bytes": "223927"
},
{
"name": "Julia",
"bytes": "27687"
},
{
"name": "KiCad",
"bytes": "475"
},
{
"name": "Kotlin",
"bytes": "971"
},
{
"name": "LSL",
"bytes": "160"
},
{
"name": "Lasso",
"bytes": "18650"
},
{
"name": "Lean",
"bytes": "6921"
},
{
"name": "Limbo",
"bytes": "9891"
},
{
"name": "Liquid",
"bytes": "862"
},
{
"name": "LiveScript",
"bytes": "972"
},
{
"name": "Logos",
"bytes": "19509"
},
{
"name": "Logtalk",
"bytes": "7260"
},
{
"name": "Lua",
"bytes": "8677"
},
{
"name": "Makefile",
"bytes": "2053844"
},
{
"name": "Mask",
"bytes": "815"
},
{
"name": "Mathematica",
"bytes": "191"
},
{
"name": "Max",
"bytes": "296"
},
{
"name": "Modelica",
"bytes": "6213"
},
{
"name": "Modula-2",
"bytes": "23838"
},
{
"name": "Module Management System",
"bytes": "14798"
},
{
"name": "Monkey",
"bytes": "2587"
},
{
"name": "Moocode",
"bytes": "3343"
},
{
"name": "MoonScript",
"bytes": "14862"
},
{
"name": "Myghty",
"bytes": "3939"
},
{
"name": "NSIS",
"bytes": "7663"
},
{
"name": "Nemerle",
"bytes": "1517"
},
{
"name": "NewLisp",
"bytes": "42726"
},
{
"name": "Nimrod",
"bytes": "37191"
},
{
"name": "Nit",
"bytes": "55581"
},
{
"name": "Nix",
"bytes": "2448"
},
{
"name": "OCaml",
"bytes": "42416"
},
{
"name": "Objective-C",
"bytes": "104883"
},
{
"name": "Objective-J",
"bytes": "15340"
},
{
"name": "Opa",
"bytes": "172"
},
{
"name": "OpenEdge ABL",
"bytes": "49943"
},
{
"name": "PAWN",
"bytes": "6555"
},
{
"name": "PHP",
"bytes": "68611"
},
{
"name": "PLSQL",
"bytes": "45772"
},
{
"name": "Pan",
"bytes": "1241"
},
{
"name": "Pascal",
"bytes": "349743"
},
{
"name": "Perl",
"bytes": "5931502"
},
{
"name": "Perl6",
"bytes": "113623"
},
{
"name": "PigLatin",
"bytes": "6657"
},
{
"name": "Pike",
"bytes": "8479"
},
{
"name": "PostScript",
"bytes": "18216"
},
{
"name": "PowerShell",
"bytes": "14236"
},
{
"name": "Prolog",
"bytes": "43750"
},
{
"name": "Protocol Buffer",
"bytes": "3401"
},
{
"name": "Puppet",
"bytes": "130"
},
{
"name": "Python",
"bytes": "122886305"
},
{
"name": "QML",
"bytes": "3912"
},
{
"name": "R",
"bytes": "49247"
},
{
"name": "Racket",
"bytes": "11341"
},
{
"name": "Rebol",
"bytes": "17708"
},
{
"name": "Red",
"bytes": "10536"
},
{
"name": "Redcode",
"bytes": "830"
},
{
"name": "Ruby",
"bytes": "91403"
},
{
"name": "Rust",
"bytes": "6788"
},
{
"name": "SAS",
"bytes": "15603"
},
{
"name": "SaltStack",
"bytes": "1040"
},
{
"name": "Scala",
"bytes": "730"
},
{
"name": "Scheme",
"bytes": "50346"
},
{
"name": "Scilab",
"bytes": "943"
},
{
"name": "Shell",
"bytes": "2925518"
},
{
"name": "ShellSession",
"bytes": "320"
},
{
"name": "Smali",
"bytes": "832"
},
{
"name": "Smalltalk",
"bytes": "158636"
},
{
"name": "Smarty",
"bytes": "523"
},
{
"name": "SourcePawn",
"bytes": "130"
},
{
"name": "Standard ML",
"bytes": "36869"
},
{
"name": "Swift",
"bytes": "2035"
},
{
"name": "SystemVerilog",
"bytes": "265"
},
{
"name": "Tcl",
"bytes": "6077233"
},
{
"name": "TeX",
"bytes": "487999"
},
{
"name": "Tea",
"bytes": "391"
},
{
"name": "TypeScript",
"bytes": "535"
},
{
"name": "VHDL",
"bytes": "4446"
},
{
"name": "VimL",
"bytes": "32053"
},
{
"name": "Visual Basic",
"bytes": "19441"
},
{
"name": "XQuery",
"bytes": "4289"
},
{
"name": "XS",
"bytes": "178055"
},
{
"name": "XSLT",
"bytes": "1995174"
},
{
"name": "Xtend",
"bytes": "727"
},
{
"name": "Yacc",
"bytes": "25665"
},
{
"name": "Zephir",
"bytes": "485"
},
{
"name": "eC",
"bytes": "31545"
},
{
"name": "mupad",
"bytes": "2442"
},
{
"name": "nesC",
"bytes": "23697"
},
{
"name": "xBase",
"bytes": "3349"
}
],
"symlink_target": ""
} |
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/console.h>
#include <linux/export.h>
#include <linux/pci.h>
#include <linux/of_platform.h>
#include <linux/gfp.h>
#include <asm/prom.h>
#include <asm/system.h>
#include <asm/iommu.h>
#include <asm/machdep.h>
#include <asm/mpic.h>
#include <asm/smp.h>
#include <asm/time.h>
#include <asm/mmu.h>
#include <pcmcia/ss.h>
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
#include "pasemi.h"
/* SDC reset register, must be pre-mapped at reset time */
static void __iomem *reset_reg;
/* Various error status registers, must be pre-mapped at MCE time */
#define MAX_MCE_REGS 32
struct mce_regs {
char *name;
void __iomem *addr;
};
static struct mce_regs mce_regs[MAX_MCE_REGS];
static int num_mce_regs;
static int nmi_virq = NO_IRQ;
static void pas_restart(char *cmd)
{
/* Need to put others cpu in hold loop so they're not sleeping */
smp_send_stop();
udelay(10000);
printk("Restarting...\n");
while (1)
out_le32(reset_reg, 0x6000000);
}
#ifdef CONFIG_SMP
static arch_spinlock_t timebase_lock;
static unsigned long timebase;
static void __devinit pas_give_timebase(void)
{
unsigned long flags;
local_irq_save(flags);
hard_irq_disable();
arch_spin_lock(&timebase_lock);
mtspr(SPRN_TBCTL, TBCTL_FREEZE);
isync();
timebase = get_tb();
arch_spin_unlock(&timebase_lock);
while (timebase)
barrier();
mtspr(SPRN_TBCTL, TBCTL_RESTART);
local_irq_restore(flags);
}
static void __devinit pas_take_timebase(void)
{
while (!timebase)
smp_rmb();
arch_spin_lock(&timebase_lock);
set_tb(timebase >> 32, timebase & 0xffffffff);
timebase = 0;
arch_spin_unlock(&timebase_lock);
}
struct smp_ops_t pas_smp_ops = {
.probe = smp_mpic_probe,
.message_pass = smp_mpic_message_pass,
.kick_cpu = smp_generic_kick_cpu,
.setup_cpu = smp_mpic_setup_cpu,
.give_timebase = pas_give_timebase,
.take_timebase = pas_take_timebase,
};
#endif /* CONFIG_SMP */
void __init pas_setup_arch(void)
{
#ifdef CONFIG_SMP
/* Setup SMP callback */
smp_ops = &pas_smp_ops;
#endif
/* Lookup PCI hosts */
pas_pci_init();
#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif
/* Remap SDC register for doing reset */
/* XXXOJN This should maybe come out of the device tree */
reset_reg = ioremap(0xfc101100, 4);
}
static int __init pas_setup_mce_regs(void)
{
struct pci_dev *dev;
int reg;
/* Remap various SoC status registers for use by the MCE handler */
reg = 0;
dev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa00a, NULL);
while (dev && reg < MAX_MCE_REGS) {
mce_regs[reg].name = kasprintf(GFP_KERNEL,
"mc%d_mcdebug_errsta", reg);
mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x730);
dev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa00a, dev);
reg++;
}
dev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa001, NULL);
if (dev && reg+4 < MAX_MCE_REGS) {
mce_regs[reg].name = "iobdbg_IntStatus1";
mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x438);
reg++;
mce_regs[reg].name = "iobdbg_IOCTbusIntDbgReg";
mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x454);
reg++;
mce_regs[reg].name = "iobiom_IntStatus";
mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0xc10);
reg++;
mce_regs[reg].name = "iobiom_IntDbgReg";
mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0xc1c);
reg++;
}
dev = pci_get_device(PCI_VENDOR_ID_PASEMI, 0xa009, NULL);
if (dev && reg+2 < MAX_MCE_REGS) {
mce_regs[reg].name = "l2csts_IntStatus";
mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x200);
reg++;
mce_regs[reg].name = "l2csts_Cnt";
mce_regs[reg].addr = pasemi_pci_getcfgaddr(dev, 0x214);
reg++;
}
num_mce_regs = reg;
return 0;
}
machine_device_initcall(pasemi, pas_setup_mce_regs);
static __init void pas_init_IRQ(void)
{
struct device_node *np;
struct device_node *root, *mpic_node;
unsigned long openpic_addr;
const unsigned int *opprop;
int naddr, opplen;
int mpic_flags;
const unsigned int *nmiprop;
struct mpic *mpic;
mpic_node = NULL;
for_each_node_by_type(np, "interrupt-controller")
if (of_device_is_compatible(np, "open-pic")) {
mpic_node = np;
break;
}
if (!mpic_node)
for_each_node_by_type(np, "open-pic") {
mpic_node = np;
break;
}
if (!mpic_node) {
printk(KERN_ERR
"Failed to locate the MPIC interrupt controller\n");
return;
}
/* Find address list in /platform-open-pic */
root = of_find_node_by_path("/");
naddr = of_n_addr_cells(root);
opprop = of_get_property(root, "platform-open-pic", &opplen);
if (!opprop) {
printk(KERN_ERR "No platform-open-pic property.\n");
of_node_put(root);
return;
}
openpic_addr = of_read_number(opprop, naddr);
printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr);
mpic_flags = MPIC_PRIMARY | MPIC_LARGE_VECTORS | MPIC_NO_BIAS;
nmiprop = of_get_property(mpic_node, "nmi-source", NULL);
if (nmiprop)
mpic_flags |= MPIC_ENABLE_MCK;
mpic = mpic_alloc(mpic_node, openpic_addr,
mpic_flags, 0, 0, "PASEMI-OPIC");
BUG_ON(!mpic);
mpic_assign_isu(mpic, 0, openpic_addr + 0x10000);
mpic_init(mpic);
/* The NMI/MCK source needs to be prio 15 */
if (nmiprop) {
nmi_virq = irq_create_mapping(NULL, *nmiprop);
mpic_irq_set_priority(nmi_virq, 15);
irq_set_irq_type(nmi_virq, IRQ_TYPE_EDGE_RISING);
mpic_unmask_irq(irq_get_irq_data(nmi_virq));
}
of_node_put(mpic_node);
of_node_put(root);
}
static void __init pas_progress(char *s, unsigned short hex)
{
printk("[%04x] : %s\n", hex, s ? s : "");
}
static int pas_machine_check_handler(struct pt_regs *regs)
{
int cpu = smp_processor_id();
unsigned long srr0, srr1, dsisr;
int dump_slb = 0;
int i;
srr0 = regs->nip;
srr1 = regs->msr;
if (nmi_virq != NO_IRQ && mpic_get_mcirq() == nmi_virq) {
printk(KERN_ERR "NMI delivered\n");
debugger(regs);
mpic_end_irq(irq_get_irq_data(nmi_virq));
goto out;
}
dsisr = mfspr(SPRN_DSISR);
printk(KERN_ERR "Machine Check on CPU %d\n", cpu);
printk(KERN_ERR "SRR0 0x%016lx SRR1 0x%016lx\n", srr0, srr1);
printk(KERN_ERR "DSISR 0x%016lx DAR 0x%016lx\n", dsisr, regs->dar);
printk(KERN_ERR "BER 0x%016lx MER 0x%016lx\n", mfspr(SPRN_PA6T_BER),
mfspr(SPRN_PA6T_MER));
printk(KERN_ERR "IER 0x%016lx DER 0x%016lx\n", mfspr(SPRN_PA6T_IER),
mfspr(SPRN_PA6T_DER));
printk(KERN_ERR "Cause:\n");
if (srr1 & 0x200000)
printk(KERN_ERR "Signalled by SDC\n");
if (srr1 & 0x100000) {
printk(KERN_ERR "Load/Store detected error:\n");
if (dsisr & 0x8000)
printk(KERN_ERR "D-cache ECC double-bit error or bus error\n");
if (dsisr & 0x4000)
printk(KERN_ERR "LSU snoop response error\n");
if (dsisr & 0x2000) {
printk(KERN_ERR "MMU SLB multi-hit or invalid B field\n");
dump_slb = 1;
}
if (dsisr & 0x1000)
printk(KERN_ERR "Recoverable Duptags\n");
if (dsisr & 0x800)
printk(KERN_ERR "Recoverable D-cache parity error count overflow\n");
if (dsisr & 0x400)
printk(KERN_ERR "TLB parity error count overflow\n");
}
if (srr1 & 0x80000)
printk(KERN_ERR "Bus Error\n");
if (srr1 & 0x40000) {
printk(KERN_ERR "I-side SLB multiple hit\n");
dump_slb = 1;
}
if (srr1 & 0x20000)
printk(KERN_ERR "I-cache parity error hit\n");
if (num_mce_regs == 0)
printk(KERN_ERR "No MCE registers mapped yet, can't dump\n");
else
printk(KERN_ERR "SoC debug registers:\n");
for (i = 0; i < num_mce_regs; i++)
printk(KERN_ERR "%s: 0x%08x\n", mce_regs[i].name,
in_le32(mce_regs[i].addr));
if (dump_slb) {
unsigned long e, v;
int i;
printk(KERN_ERR "slb contents:\n");
for (i = 0; i < mmu_slb_size; i++) {
asm volatile("slbmfee %0,%1" : "=r" (e) : "r" (i));
asm volatile("slbmfev %0,%1" : "=r" (v) : "r" (i));
printk(KERN_ERR "%02d %016lx %016lx\n", i, e, v);
}
}
out:
/* SRR1[62] is from MSR[62] if recoverable, so pass that back */
return !!(srr1 & 0x2);
}
static void __init pas_init_early(void)
{
iommu_init_early_pasemi();
}
#ifdef CONFIG_PCMCIA
static int pcmcia_notify(struct notifier_block *nb, unsigned long action,
void *data)
{
struct device *dev = data;
struct device *parent;
struct pcmcia_device *pdev = to_pcmcia_dev(dev);
/* We are only intereted in device addition */
if (action != BUS_NOTIFY_ADD_DEVICE)
return 0;
parent = pdev->socket->dev.parent;
/* We know electra_cf devices will always have of_node set, since
* electra_cf is an of_platform driver.
*/
if (!parent->of_node)
return 0;
if (!of_device_is_compatible(parent->of_node, "electra-cf"))
return 0;
/* We use the direct ops for localbus */
dev->archdata.dma_ops = &dma_direct_ops;
return 0;
}
static struct notifier_block pcmcia_notifier = {
.notifier_call = pcmcia_notify,
};
static inline void pasemi_pcmcia_init(void)
{
extern struct bus_type pcmcia_bus_type;
bus_register_notifier(&pcmcia_bus_type, &pcmcia_notifier);
}
#else
static inline void pasemi_pcmcia_init(void)
{
}
#endif
static struct of_device_id pasemi_bus_ids[] = {
/* Unfortunately needed for legacy firmwares */
{ .type = "localbus", },
{ .type = "sdc", },
/* These are the proper entries, which newer firmware uses */
{ .compatible = "pasemi,localbus", },
{ .compatible = "pasemi,sdc", },
{},
};
static int __init pasemi_publish_devices(void)
{
pasemi_pcmcia_init();
/* Publish OF platform devices for SDC and other non-PCI devices */
of_platform_bus_probe(NULL, pasemi_bus_ids, NULL);
return 0;
}
machine_device_initcall(pasemi, pasemi_publish_devices);
/*
* Called very early, MMU is off, device-tree isn't unflattened
*/
static int __init pas_probe(void)
{
unsigned long root = of_get_flat_dt_root();
if (!of_flat_dt_is_compatible(root, "PA6T-1682M") &&
!of_flat_dt_is_compatible(root, "pasemi,pwrficient"))
return 0;
hpte_init_native();
alloc_iobmap_l2();
return 1;
}
define_machine(pasemi) {
.name = "PA Semi PWRficient",
.probe = pas_probe,
.setup_arch = pas_setup_arch,
.init_early = pas_init_early,
.init_IRQ = pas_init_IRQ,
.get_irq = mpic_get_irq,
.restart = pas_restart,
.get_boot_time = pas_get_boot_time,
.calibrate_decr = generic_calibrate_decr,
.progress = pas_progress,
.machine_check_exception = pas_machine_check_handler,
};
| {
"content_hash": "08f3ef5d47dc8cfd4b2c0a72545773bd",
"timestamp": "",
"source": "github",
"line_count": 426,
"max_line_length": 73,
"avg_line_length": 23.821596244131456,
"alnum_prop": 0.6651556957035869,
"repo_name": "WhiteBearSolutions/WBSAirback",
"id": "6f35582105544396ca584f908e6cb2dbef548dfc",
"size": "11015",
"binary": false,
"copies": "157",
"ref": "refs/heads/master",
"path": "packages/wbsairback-kernel-image/wbsairback-kernel-image-3.2.43/arch/powerpc/platforms/pasemi/setup.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "4780982"
}
],
"symlink_target": ""
} |
<?php
namespace Pharel\Nodes;
class SqlLiteral {
use \Pharel\Expressions;
use \Pharel\Predications;
use \Pharel\AliasPredication;
use \Pharel\OrderPredications;
public $value;
public function __construct($value) {
if ($value instanceof SqlLiteral)
$this->value = $value->value;
else
$this->value = $value;
}
}
| {
"content_hash": "b7468bdcaab3ecd5df90a17221ec4fa2",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 41,
"avg_line_length": 20.105263157894736,
"alnum_prop": 0.6099476439790575,
"repo_name": "aomega08/pharel",
"id": "57c2efe178bac9b93e1f65edb35720cfba45912b",
"size": "382",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/Pharel/Nodes/SqlLiteral.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "105414"
}
],
"symlink_target": ""
} |
package com.android.volley;
/**
* Encapsulates a parsed response for delivery.
*
* @param <T> Parsed type of this response
*/
public class Response<T> {
/**
* Callback interface for delivering parsed responses.
*/
public interface Listener<T> {
/**
* Called when a response is received.
*/
void onResponse(T response);
}
/**
* Callback interface for delivering error responses.
*/
public interface ErrorListener {
/**
* Callback method that an error has been occurred with the
* provided error code and optional user-readable message.
*/
void onErrorResponse(VolleyError error);
}
/**
* Returns a successful response containing the parsed result.
*/
public static <T> Response<T> success(T result, Cache.Entry cacheEntry) {
return new Response<T>(result, cacheEntry);
}
/**
* Returns a failed response containing the given error code and an optional
* localized message displayed to the user.
*/
public static <T> Response<T> error(VolleyError error) {
return new Response<T>(error);
}
/**
* Parsed response, or null in the case of error.
*/
public final T result;
/**
* Cache metadata for this response, or null in the case of error.
*/
public final Cache.Entry cacheEntry;
/**
* Detailed error information if <code>errorCode != OK</code>.
*/
public final VolleyError error;
/**
* True if this response was a soft-expired one and a second one MAY be coming.
*/
public boolean intermediate = false;
/**
* Returns whether this response is considered successful.
*/
public boolean isSuccess() {
return error == null;
}
private Response(T result, Cache.Entry cacheEntry) {
this.result = result;
this.cacheEntry = cacheEntry;
this.error = null;
}
private Response(VolleyError error) {
this.result = null;
this.cacheEntry = null;
this.error = error;
}
}
| {
"content_hash": "d092755b744fd8a94da70eabd2daba9f",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 83,
"avg_line_length": 24.367816091954023,
"alnum_prop": 0.6084905660377359,
"repo_name": "longluo/AndroidDemo",
"id": "9b9c9d04e80d18c3a5fed2e90460d7580389adf9",
"size": "2739",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "volley/src/main/java/com/android/volley/Response.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "2597677"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>hammer-tactics: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.12.0 / hammer-tactics - 1.3.2+8.12</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
hammer-tactics
<small>
1.3.2+8.12
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-10-12 21:55:03 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-12 21:55:03 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
coq 8.12.0 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.06.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.06.1 Official 4.06.1 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "palmskog@gmail.com"
homepage: "https://github.com/lukaszcz/coqhammer"
dev-repo: "git+https://github.com/lukaszcz/coqhammer.git"
bug-reports: "https://github.com/lukaszcz/coqhammer/issues"
license: "LGPL-2.1-only"
synopsis: "Reconstruction tactics for the hammer for Coq"
description: """
Collection of tactics that are used by the hammer for Coq
to reconstruct proofs found by automated theorem provers. When the hammer
has been successfully applied to a project, only this package needs
to be installed; the hammer plugin is not required.
"""
build: [make "-j%{jobs}%" "tactics"]
install: [
[make "install-tactics"]
[make "test-tactics"] {with-test}
]
depends: [
"ocaml" { >= "4.08" }
"coq" {>= "8.12" & < "8.13~"}
]
conflicts: [
"coq-hammer" {!= version}
]
tags: [
"keyword:automation"
"keyword:hammer"
"keyword:tactics"
"logpath:Hammer.Tactics"
"date:2021-10-01"
]
authors: [
"Lukasz Czajka <lukaszcz@mimuw.edu.pl>"
]
url {
src: "https://github.com/lukaszcz/coqhammer/archive/refs/tags/v1.3.2-coq8.12.tar.gz"
checksum: "sha512=10f7bbf5b03101fda47953fc53981b46b5f368558ce4efa8944b0fa67f220c94f4dd21068a1bcaf0ceb771ba9e94c8c6558c8863720157e27407133c43bf0282"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-hammer-tactics.1.3.2+8.12 coq.8.12.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.12.0).
The following dependencies couldn't be met:
- coq-hammer-tactics -> ocaml >= 4.08
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-hammer-tactics.1.3.2+8.12</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "838c96f9ad9c8e3a61ab267f7632a0b3",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 159,
"avg_line_length": 40.02824858757062,
"alnum_prop": 0.5515878616796048,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "c59ab2fbf00f1f50339de99b4d93e65b24947d90",
"size": "7110",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.06.1-2.0.5/released/8.12.0/hammer-tactics/1.3.2+8.12.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package cineCheck;
import java.lang.reflect.Type;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
public class DateSerializer implements JsonSerializer<Date> {
protected static final String TAG = DateSerializer.class.getName();
public JsonElement serialize(Date src, Type typeOfSrc,
JsonSerializationContext context) {
if (src != null){
return new JsonPrimitive(new SimpleDateFormat().format(src));
}
return null;
}
}
| {
"content_hash": "687fe88aaa7ca7ec7ca63aff260d1bd4",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 68,
"avg_line_length": 25.5,
"alnum_prop": 0.7859477124183006,
"repo_name": "vvhof/cineCheck",
"id": "3802aed7ed07d86a6b678b4797b9dc89fe7e1d7b",
"size": "612",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/cineCheck/DateSerializer.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "10842"
}
],
"symlink_target": ""
} |
package org.apache.ignite.testsuites;
import junit.framework.*;
import org.apache.ignite.examples.*;
import org.apache.ignite.testframework.*;
import static org.apache.ignite.IgniteSystemProperties.*;
/**
* Examples test suite.
* <p>
* Contains only Spring ignite examples tests.
*/
public class IgniteExamplesSelfTestSuite extends TestSuite {
/**
* @return Suite.
* @throws Exception If failed.
*/
public static TestSuite suite() throws Exception {
System.setProperty(IGNITE_OVERRIDE_MCAST_GRP,
GridTestUtils.getNextMulticastGroup(IgniteExamplesSelfTestSuite.class));
TestSuite suite = new TestSuite("Ignite Examples Test Suite");
suite.addTest(new TestSuite(CacheExamplesSelfTest.class));
suite.addTest(new TestSuite(BasicExamplesSelfTest.class));
suite.addTest(new TestSuite(ContinuationExamplesSelfTest.class));
suite.addTest(new TestSuite(ContinuousMapperExamplesSelfTest.class));
suite.addTest(new TestSuite(DeploymentExamplesSelfTest.class));
suite.addTest(new TestSuite(EventsExamplesSelfTest.class));
suite.addTest(new TestSuite(LifecycleExamplesSelfTest.class));
suite.addTest(new TestSuite(MessagingExamplesSelfTest.class));
suite.addTest(new TestSuite(MemcacheRestExamplesSelfTest.class));
suite.addTest(new TestSuite(MonteCarloExamplesSelfTest.class));
suite.addTest(new TestSuite(TaskExamplesSelfTest.class));
suite.addTest(new TestSuite(SpringBeanExamplesSelfTest.class));
suite.addTest(new TestSuite(IgfsExamplesSelfTest.class));
suite.addTest(new TestSuite(CheckpointExamplesSelfTest.class));
suite.addTest(new TestSuite(HibernateL2CacheExampleSelfTest.class));
suite.addTest(new TestSuite(ClusterGroupExampleSelfTest.class));
// Multi-node.
suite.addTest(new TestSuite(CacheExamplesMultiNodeSelfTest.class));
suite.addTest(new TestSuite(BasicExamplesMultiNodeSelfTest.class));
suite.addTest(new TestSuite(ContinuationExamplesMultiNodeSelfTest.class));
suite.addTest(new TestSuite(ContinuousMapperExamplesMultiNodeSelfTest.class));
suite.addTest(new TestSuite(DeploymentExamplesMultiNodeSelfTest.class));
suite.addTest(new TestSuite(EventsExamplesMultiNodeSelfTest.class));
suite.addTest(new TestSuite(TaskExamplesMultiNodeSelfTest.class));
suite.addTest(new TestSuite(MemcacheRestExamplesMultiNodeSelfTest.class));
suite.addTest(new TestSuite(MonteCarloExamplesMultiNodeSelfTest.class));
suite.addTest(new TestSuite(HibernateL2CacheExampleMultiNodeSelfTest.class));
return suite;
}
}
| {
"content_hash": "6b62f4f533e5a90629f63ac30cb23a39",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 86,
"avg_line_length": 46.44827586206897,
"alnum_prop": 0.7516703786191536,
"repo_name": "akuznetsov-gridgain/ignite",
"id": "3ede10fd5d01493d3f19f50633f6b1372667b6e7",
"size": "3496",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "examples/src/test/java/org/apache/ignite/testsuites/IgniteExamplesSelfTestSuite.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "31291"
},
{
"name": "C++",
"bytes": "28098"
},
{
"name": "CSS",
"bytes": "17517"
},
{
"name": "Groovy",
"bytes": "15102"
},
{
"name": "HTML",
"bytes": "4669"
},
{
"name": "Java",
"bytes": "18401553"
},
{
"name": "JavaScript",
"bytes": "1085"
},
{
"name": "PHP",
"bytes": "11079"
},
{
"name": "Scala",
"bytes": "653258"
},
{
"name": "Shell",
"bytes": "392571"
}
],
"symlink_target": ""
} |
using System;
using Windows.UI.StartScreen;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
namespace CodeShow.CS.Shared
{
public sealed partial class CreateSecondaryTileDemo : UserControl
{
public CreateSecondaryTileDemo()
{
this.InitializeComponent();
}
// BeginCutPaste
private async void Button_Tapped(object sender, TappedRoutedEventArgs e)
{
Uri square150x150Logo = new Uri("ms-appx:///Assets/Logo.png");
Uri square30x30Logo = new Uri("ms-appx:///Assets/SmallLogo.png");
SecondaryTile secondaryTile = new SecondaryTile("MyTileId",
this.tileName.Text,
"LaunchedFromMyTile",
square150x150Logo,
TileSize.Square150x150);
secondaryTile.VisualElements.Square30x30Logo = square30x30Logo;
secondaryTile.VisualElements.ShowNameOnSquare150x150Logo = true;
secondaryTile.VisualElements.ForegroundText = ForegroundText.Dark;
await secondaryTile.RequestCreateAsync();
}
// EndCutPaste
}
}
| {
"content_hash": "2503d1846a1b686628233d317ba48027",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 84,
"avg_line_length": 38.61764705882353,
"alnum_prop": 0.5567402894135567,
"repo_name": "codefoster/codeshow",
"id": "a407a6eca2bf3284d09490448786da657351f4c1",
"size": "1315",
"binary": false,
"copies": "16",
"ref": "refs/heads/master",
"path": "CodeShow.CS/CodeShow.CS.Shared/CreateSecondaryTileDemo.xaml.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "226997"
},
{
"name": "CSS",
"bytes": "55495"
},
{
"name": "JavaScript",
"bytes": "1348583"
}
],
"symlink_target": ""
} |
<Record>
<Term>Ovrette</Term>
<SemanticType>Pharmacologic Substance</SemanticType>
<SemanticType>Organic Chemical</SemanticType>
<PrimarySemanticType>Pharmacologic Substance</PrimarySemanticType>
<Synonym>Norgestrel</Synonym>
<Source>FDA Registry</Source>
</Record>
| {
"content_hash": "96a55ed795c98aea5159ac7fa25c29af",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 66,
"avg_line_length": 34.25,
"alnum_prop": 0.7992700729927007,
"repo_name": "detnavillus/modular-informatic-designs",
"id": "ab0f5e08101bc6effed3815d7ebd2725cb6120ea",
"size": "274",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pipeline/src/test/resources/thesaurus/fdarecords/ovrette.xml",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2069134"
}
],
"symlink_target": ""
} |
@interface MOBProjectionEPSG4181 : MOBProjection
@end
| {
"content_hash": "0d069fb1cd338b8db01e5e85bc5b68dc",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 48,
"avg_line_length": 18.333333333333332,
"alnum_prop": 0.8363636363636363,
"repo_name": "jkdubr/Proj4",
"id": "7a2095072b1c2998c4bffc3d12570722bea1b609",
"size": "82",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Pod/Classes/Projection/MOBProjectionEPSG4181.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1141"
},
{
"name": "Objective-C",
"bytes": "1689233"
},
{
"name": "Ruby",
"bytes": "1604"
},
{
"name": "Shell",
"bytes": "7202"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace PADIMapNoReduce
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
int port;
List<string> pmMap = new List<string>();
if (args.Length == 0)
{
port = 20001;
}
else
{
port = int.Parse(args[0]);
if (port < 20001 || port > 29999)
{
Console.Error.WriteLine("PuppetMaster ports must be between 20001 and 29999");
return;
}
if (args.Length > 1)
{
int s = args.Length - 1;
if (s < 0)
{
s = 0;
}
pmMap = (new List<string>(args)).GetRange(1, s);
}
}
Controller controller = new Controller();
PuppetMasterService puppetMaster = new PuppetMasterService(port, controller);
//int workerPort = 30001;
controller.run();
/*Process.Start("Worker.exe", Convert.ToString(workerPort));
workerPort++;
Process.Start("Worker.exe", Convert.ToString(workerPort));*/
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1(controller));
}
}
}
| {
"content_hash": "b479fe2549129129fad6502ad2f99630",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 98,
"avg_line_length": 28.55,
"alnum_prop": 0.46876824284880325,
"repo_name": "ruipgil/MapNoReduce",
"id": "df566c5eb628d5aa03022ab7341139c833a12c3d",
"size": "1715",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "PADIMapNoReduce/PuppetMaster/Program.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "70397"
}
],
"symlink_target": ""
} |
/****
Boby
****/
body {
background-color: #fff;
}
/******
General
******/
/* Theme Font Color */
.theme-font {
color: #44B6AE !important;
}
/* Pace - Page Progress */
.pace .pace-progress {
background: #44B6AE;
}
/* Theme Light Portlet */
.portlet.light .btn.btn-circle.btn-icon-only.btn-default {
border-color: #bbc2ce;
}
.portlet.light .btn.btn-circle.btn-icon-only.btn-default > i {
font-size: 13px;
color: #a6b0bf;
}
.portlet.light .btn.btn-circle.btn-icon-only.btn-default:hover, .portlet.light .btn.btn-circle.btn-icon-only.btn-default.active {
color: #fff;
background: #44B6AE;
border-color: #44B6AE;
}
.portlet.light .btn.btn-circle.btn-icon-only.btn-default:hover > i, .portlet.light .btn.btn-circle.btn-icon-only.btn-default.active > i {
color: #fff;
}
/******
Page Header
******/
.page-header {
background-color: #fff;
/* Page Header Top */
/* Page Header Menu */
}
.page-header .page-header-top {
/* Top menu */
}
.page-header .page-header-top.fixed {
background: #fff !important;
box-shadow: 0px 1px 10px 0px rgba(50, 50, 50, 0.2);
}
.page-header .page-header-top .top-menu .navbar-nav {
/* Top Links */
/* Separator */
/* Extended Dropdowns */
/* Notification */
/* Inbox */
/* Tasks */
/* User */
/* Language */
/* Dark version */
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown .separator {
border-left: 1px solid #E3E8EC;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown > .dropdown-toggle > i {
color: #C1CCD1;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown > .dropdown-toggle:hover {
background-color: #fff;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown > .dropdown-toggle:hover > i {
color: #a4b4bb;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown > .dropdown-toggle .badge.badge-default {
background-color: #f36a5a;
color: #ffffff;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown.open .dropdown-toggle {
background-color: #fff;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown.open .dropdown-toggle > i {
color: #a4b4bb;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-separator .separator {
border-left: 1px solid #E3E8EC;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu:after {
border-bottom-color: #f7f8fa;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu > li.external {
background: #f7f8fa;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu > li.external > h3 {
color: #6f949c;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu > li.external > a {
color: #5b9bd1;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu > li.external > a:hover {
color: #3175af;
text-decoration: none;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu .dropdown-menu-list > li > a {
border-bottom: 1px solid #EFF2F6 !important;
color: #222222;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-extended .dropdown-menu .dropdown-menu-list > li > a:hover {
background: #f8f9fa;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-notification .dropdown-menu .dropdown-menu-list > li > a .time {
background: #f1f1f1;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-notification .dropdown-menu .dropdown-menu-list > li > a:hover .time {
background: #e4e4e4;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-inbox > .dropdown-toggle > .circle {
background-color: #44B6AE;
color: #ffffff;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-inbox > .dropdown-toggle > .corner {
border-color: transparent transparent transparent #44B6AE;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-inbox .dropdown-menu .dropdown-menu-list .subject .from {
color: #5b9bd1;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-tasks .dropdown-menu .dropdown-menu-list .progress {
background-color: #dfe2e9;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-user > .dropdown-toggle > .username {
color: #8ea3b6;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-user > .dropdown-toggle > i {
color: #8ea3b6;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-user > .dropdown-menu {
width: 195px;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-user:hover > .dropdown-toggle > .username,
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-user:hover > .dropdown-toggle > i, .page-header .page-header-top .top-menu .navbar-nav > li.dropdown-user.open > .dropdown-toggle > .username,
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-user.open > .dropdown-toggle > i {
color: #7089a2;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-language > .dropdown-toggle > .langname {
color: #8ea3b6;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-language:hover > .dropdown-toggle > .langname, .page-header .page-header-top .top-menu .navbar-nav > li.dropdown-language.open > .dropdown-toggle > .langname {
color: #7089a2;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu {
background: #2e343b;
border: 0;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu:after {
border-bottom-color: #2e343b;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu > li.external {
background: #272c33;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu > li.external > h3 {
color: #a2abb7;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu > li.external > a:hover {
color: #87b6dd;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu.dropdown-menu-default > li a,
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu .dropdown-menu-list > li a {
color: #aaafb7;
border-bottom: 1px solid #3b434c !important;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu.dropdown-menu-default > li a > i,
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu .dropdown-menu-list > li a > i {
color: #6FA7D7;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu.dropdown-menu-default > li a:hover,
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu .dropdown-menu-list > li a:hover {
background: #373e47;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu.dropdown-menu-default > li a {
border-bottom: 0 !important;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-dark .dropdown-menu.dropdown-menu-default > li.divider {
background: #3b434c;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-notification.dropdown-dark .dropdown-menu .dropdown-menu-list > li > a .time {
background: #23272d;
}
.page-header .page-header-top .top-menu .navbar-nav > li.dropdown-notification.dropdown-dark .dropdown-menu .dropdown-menu-list > li > a:hover .time {
background: #181b1e;
}
.page-header .page-header-menu {
background: #444d58;
/* Default Mega Menu */
/* Light Mega Menu */
/* Header seaech box */
}
.page-header .page-header-menu.fixed {
box-shadow: 0px 1px 10px 0px rgba(68, 77, 88, 0.2);
}
.page-header .page-header-menu .hor-menu .navbar-nav {
/* Mega menu content */
/* Classic menu */
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.mega-menu-dropdown > .dropdown-menu {
box-shadow: 5px 5px rgba(85, 97, 111, 0.2);
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.mega-menu-dropdown > .dropdown-menu .mega-menu-content .mega-menu-submenu li > h3 {
color: #ced5de;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li > a {
color: #BCC2CB;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li > a > i {
color: #BCC2CB;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.open > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li > a:hover {
color: #ffffff;
background: #55616f !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.open > a > i,
.page-header .page-header-menu .hor-menu .navbar-nav > li > a:hover > i {
color: #ffffff;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.active > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li.active > a:hover, .page-header .page-header-menu .hor-menu .navbar-nav > li.current > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li.current > a:hover {
color: #f1f1f1;
background: #4E5966;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.active > a > i,
.page-header .page-header-menu .hor-menu .navbar-nav > li.active > a:hover > i, .page-header .page-header-menu .hor-menu .navbar-nav > li.current > a > i,
.page-header .page-header-menu .hor-menu .navbar-nav > li.current > a:hover > i {
color: #BCC2CB;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu {
box-shadow: 5px 5px rgba(85, 97, 111, 0.2);
background: #55616f;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li > a {
color: #ced5de;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li > a > i {
color: #6fa7d7;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li:hover > a {
color: #ced5de;
background: #5d6b7a;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li:hover > a > i {
color: #6fa7d7;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.active > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.active > a:hover, .page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.current > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.current > a:hover {
color: #ced5de;
background: #5d6b7a;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.active > a > i,
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.active > a:hover > i, .page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.current > a > i,
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.current > a:hover > i {
color: #6fa7d7;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.divider {
background-color: #606d7d;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-submenu > a:after {
color: #6fa7d7;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav {
/* Mega menu content */
/* Classic menu */
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li.mega-menu-dropdown > .dropdown-menu {
box-shadow: 5px 5px rgba(85, 97, 111, 0.2);
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li.mega-menu-dropdown > .dropdown-menu .mega-menu-content .mega-menu-submenu li > h3 {
color: #555;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li > a {
color: #BCC2CB;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li > a > i {
color: #BCC2CB;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li > a:hover {
color: #ffffff;
background: #55616f;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li > a:hover > i {
color: #ffffff;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li.open > a {
color: #333 !important;
background: #fafafc !important;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li.open > a > i {
color: #333 !important;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li.active > a,
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li.active > a:hover, .page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li.current > a,
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li.current > a:hover {
color: #f1f1f1;
background: #4E5966;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li.active > a > i,
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li.active > a:hover > i, .page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li.current > a > i,
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li.current > a:hover > i {
color: #BCC2CB;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li .dropdown-menu {
box-shadow: 5px 5px rgba(85, 97, 111, 0.2);
background: #fafafc;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li .dropdown-menu li > a {
color: #000;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li .dropdown-menu li > a > i {
color: #6fa7d7;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li .dropdown-menu li:hover > a {
color: #000;
background: #eaeaf2;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li .dropdown-menu li:hover > a > i {
color: #6fa7d7;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li .dropdown-menu li.active > a,
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li .dropdown-menu li.active > a:hover, .page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li .dropdown-menu li.current > a,
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li .dropdown-menu li.current > a:hover {
color: #000;
background: #eaeaf2;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li .dropdown-menu li.active > a > i,
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li .dropdown-menu li.active > a:hover > i, .page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li .dropdown-menu li.current > a > i,
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li .dropdown-menu li.current > a:hover > i {
color: #6fa7d7;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li .dropdown-menu li.divider {
background-color: #ededf4;
}
.page-header .page-header-menu .hor-menu.hor-menu-light .navbar-nav > li > .dropdown-menu {
border: 1px solid #eaeaf2;
border-top: 0;
}
.page-header .page-header-menu .search-form {
background: #38414c;
}
.page-header .page-header-menu .search-form .input-group {
background: #38414c;
}
.page-header .page-header-menu .search-form .input-group .form-control {
color: #616d7d;
background: #38414c;
}
.page-header .page-header-menu .search-form .input-group .form-control::-moz-placeholder {
color: #5f6a7a;
opacity: 1;
}
.page-header .page-header-menu .search-form .input-group .form-control:-ms-input-placeholder {
color: #5f6a7a;
}
.page-header .page-header-menu .search-form .input-group .form-control::-webkit-input-placeholder {
color: #5f6a7a;
}
.page-header .page-header-menu .search-form .input-group .input-group-btn .btn.submit > i {
color: #616d7d;
}
/******
Page Footer
******/
.page-prefooter {
background: #48525e;
color: #a2abb7;
}
.page-prefooter h2 {
color: #44B6AE;
}
.page-prefooter .subscribe-form .form-control {
background: #343b44;
border-color: #343b44;
color: #a2abb7;
}
.page-prefooter .subscribe-form .form-control::-moz-placeholder {
color: #939eac;
opacity: 1;
}
.page-prefooter .subscribe-form .form-control:-ms-input-placeholder {
color: #939eac;
}
.page-prefooter .subscribe-form .form-control::-webkit-input-placeholder {
color: #939eac;
}
.page-prefooter .subscribe-form .btn {
color: #fff;
background-color: #4dbcb5;
border-color: "";
}
.page-prefooter .subscribe-form .btn:hover, .page-prefooter .subscribe-form .btn:focus, .page-prefooter .subscribe-form .btn:active, .page-prefooter .subscribe-form .btn.active {
color: #fff;
background-color: #3ea7a0;
}
.open .page-prefooter .subscribe-form .btn.dropdown-toggle {
color: #fff;
background-color: #3ea7a0;
}
.page-prefooter .subscribe-form .btn:active, .page-prefooter .subscribe-form .btn.active {
background-image: none;
background-color: #38958e;
}
.page-prefooter .subscribe-form .btn:active:hover, .page-prefooter .subscribe-form .btn.active:hover {
background-color: #3a9c95;
}
.open .page-prefooter .subscribe-form .btn.dropdown-toggle {
background-image: none;
}
.page-prefooter .subscribe-form .btn.disabled, .page-prefooter .subscribe-form .btn.disabled:hover, .page-prefooter .subscribe-form .btn.disabled:focus, .page-prefooter .subscribe-form .btn.disabled:active, .page-prefooter .subscribe-form .btn.disabled.active, .page-prefooter .subscribe-form .btn[disabled], .page-prefooter .subscribe-form .btn[disabled]:hover, .page-prefooter .subscribe-form .btn[disabled]:focus, .page-prefooter .subscribe-form .btn[disabled]:active, .page-prefooter .subscribe-form .btn[disabled].active, fieldset[disabled] .page-prefooter .subscribe-form .btn, fieldset[disabled] .page-prefooter .subscribe-form .btn:hover, fieldset[disabled] .page-prefooter .subscribe-form .btn:focus, fieldset[disabled] .page-prefooter .subscribe-form .btn:active, fieldset[disabled] .page-prefooter .subscribe-form .btn.active {
background-color: #4dbcb5;
}
.page-prefooter .subscribe-form .btn .badge {
color: #4dbcb5;
background-color: #fff;
}
.page-footer {
background: #3b434c;
color: #a2abb7;
}
/* Scroll Top */
.scroll-to-top > i {
color: #657383;
font-size: 32px;
opacity: 0.7;
filter: alpha(opacity=70);
}
@media (min-width: 992px) {
/* 992px */
.page-header {
/* Page Header Menu */
}
.page-header .page-header-menu.fixed {
width: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 9995;
}
}
@media (max-width: 991px) {
/* 991px */
.page-header .page-header-menu {
background: #eff3f8;
/* Horizontal mega menu */
}
.page-header .page-header-menu .hor-menu .navbar-nav {
background: #fff !important;
/* Mega menu content */
/* Classic menu */
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.mega-menu-dropdown > .dropdown-menu {
box-shadow: none;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.mega-menu-dropdown > .dropdown-menu .mega-menu-content .mega-menu-submenu {
border-right: none !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.mega-menu-dropdown > .dropdown-menu .mega-menu-content .mega-menu-submenu li > h3 {
color: #72808a;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li {
border-bottom: 1px solid #F0F0F0;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li:last-child {
border-bottom: 0;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li > a {
background: none !important;
color: #666 !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li > a > i {
color: #666 !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li:hover > a {
background: none !important;
color: #44B6AE !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li:hover > a > i {
color: #44B6AE !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.open > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li.open > a:hover, .page-header .page-header-menu .hor-menu .navbar-nav > li.active > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li.active > a:hover, .page-header .page-header-menu .hor-menu .navbar-nav > li.current > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li.current > a:hover {
color: #fff !important;
background: #44B6AE !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.open > a > i,
.page-header .page-header-menu .hor-menu .navbar-nav > li.open > a:hover > i, .page-header .page-header-menu .hor-menu .navbar-nav > li.active > a > i,
.page-header .page-header-menu .hor-menu .navbar-nav > li.active > a:hover > i, .page-header .page-header-menu .hor-menu .navbar-nav > li.current > a > i,
.page-header .page-header-menu .hor-menu .navbar-nav > li.current > a:hover > i {
color: #fff !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu {
border: 0 !important;
border-top: 1px solid #eee;
box-shadow: none !important;
background: #fff !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.divider {
border-bottom: 1px solid #F0F0F0;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li:first-child {
margin-top: 1px;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li > a {
color: #666 !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li > a > i {
color: #666 !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li:hover > a {
background: none !important;
color: #44B6AE !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li:hover > a > i {
color: #44B6AE !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.open > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.open > a:hover, .page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.active > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.active > a:hover, .page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.current > a,
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.current > a:hover {
color: #fff !important;
background: #44B6AE !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.open > a > i,
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.open > a:hover > i, .page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.active > a > i,
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.active > a:hover > i, .page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.current > a > i,
.page-header .page-header-menu .hor-menu .navbar-nav > li .dropdown-menu li.current > a:hover > i {
color: #fff !important;
}
.page-header .page-header-menu .hor-menu .navbar-nav > li.classic-menu-dropdown .dropdown-menu > li.dropdown-submenu.open > a:after {
color: #fff !important;
}
.page-header .page-header-menu .hor-menu .nav {
border: 0 !important;
margin: 0 !important;
}
.page-header .page-header-menu .hor-menu .nav .dropdown-submenu.open > a,
.page-header .page-header-menu .hor-menu .nav .dropdown-submenu.open > a:hover {
border: 0 !important;
margin: 0 !important;
color: #fff !important;
background: #54bfb8 !important;
}
.page-header .page-header-menu .hor-menu .nav .dropdown-submenu.open > a > i,
.page-header .page-header-menu .hor-menu .nav .dropdown-submenu.open > a:hover > i {
color: #fff !important;
}
.page-header .search-form {
background: #fff !important;
}
.page-header .search-form .input-group {
background: #fff !important;
}
.page-header .search-form .input-group .form-control {
background: #fff !important;
}
.page-header .search-form .input-group .input-group-btn .btn.submit {
background: #44B6AE;
}
.page-header .search-form .input-group .input-group-btn .btn.submit i {
color: #fff !important;
}
.page-header .search-form .input-group .input-group-btn .btn.submit:hover, .page-header .search-form .input-group .input-group-btn .btn.submit:focus, .page-header .search-form .input-group .input-group-btn .btn.submit:active, .page-header .search-form .input-group .input-group-btn .btn.submit.active {
background: #399892;
}
}
@media (max-width: 480px) {
/* 480px */
.page-header {
/* Top menu */
}
.page-header .top-menu {
background-color: #fff;
}
.page-header-fixed-mobile .page-header .top-menu {
background-color: #fff;
}
.page-header .top-menu .navbar-nav > li.dropdown-user .dropdown-toggle {
background-color: white;
}
.page-header-fixed-mobile .page-header .top-menu .navbar-nav > li.dropdown-user .dropdown-toggle {
background: none;
}
.page-header .top-menu .navbar-nav > li.dropdown-user .dropdown-toggle:hover {
background-color: #fff;
}
}
/****
CSS3 Spinner Bar
****/
.page-spinner-bar > div,
.block-spinner-bar > div {
background: #54bfb8;
}
| {
"content_hash": "fec19af2abc9e242d46801ffe8cd5ec5",
"timestamp": "",
"source": "github",
"line_count": 608,
"max_line_length": 838,
"avg_line_length": 42.30263157894737,
"alnum_prop": 0.672045101088647,
"repo_name": "sarankh80/restaurant168",
"id": "16f688b7f8e3796b6a7230934f5c2031ae45b487",
"size": "25720",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "public/assets/admin/layout3/css/themes/green-haze.css",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "298"
},
{
"name": "ApacheConf",
"bytes": "659"
},
{
"name": "CSS",
"bytes": "2687551"
},
{
"name": "CoffeeScript",
"bytes": "83631"
},
{
"name": "Go",
"bytes": "7076"
},
{
"name": "HTML",
"bytes": "5630952"
},
{
"name": "JavaScript",
"bytes": "6077862"
},
{
"name": "PHP",
"bytes": "30568563"
},
{
"name": "Python",
"bytes": "5845"
},
{
"name": "Shell",
"bytes": "444"
}
],
"symlink_target": ""
} |
from typing import Tuple, Callable, Optional, cast
from ..model import Model
from ..config import registry
from ..types import Floats1d, Floats2d
from ..initializers import glorot_uniform_init, zero_init
from ..util import get_width, partial
InT = Floats2d
OutT = Floats2d
@registry.layers("Linear.v1")
def Linear(
nO: Optional[int] = None,
nI: Optional[int] = None,
*,
init_W: Callable = glorot_uniform_init,
init_b: Callable = zero_init,
) -> Model[InT, OutT]:
"""Multiply inputs by a weights matrix and adds a bias vector."""
return Model(
"linear",
forward,
init=partial(init, init_W, init_b),
dims={"nO": nO, "nI": nI},
params={"W": None, "b": None},
)
def forward(model: Model[InT, OutT], X: InT, is_train: bool) -> Tuple[OutT, Callable]:
W = cast(Floats2d, model.get_param("W"))
b = cast(Floats1d, model.get_param("b"))
Y = model.ops.gemm(X, W, trans2=True)
Y += b
def backprop(dY: OutT) -> InT:
model.inc_grad("b", dY.sum(axis=0))
model.inc_grad("W", model.ops.gemm(dY, X, trans1=True))
return model.ops.gemm(dY, W)
return Y, backprop
def init(
init_W: Callable,
init_b: Callable,
model: Model[InT, OutT],
X: Optional[InT] = None,
Y: Optional[OutT] = None,
) -> None:
if X is not None:
model.set_dim("nI", get_width(X))
if Y is not None:
model.set_dim("nO", get_width(Y))
model.set_param("W", init_W(model.ops, (model.get_dim("nO"), model.get_dim("nI"))))
model.set_param("b", init_b(model.ops, (model.get_dim("nO"),)))
| {
"content_hash": "650cce39013e749b8a6c8f6e201ab5bf",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 87,
"avg_line_length": 27.775862068965516,
"alnum_prop": 0.6039726877715704,
"repo_name": "explosion/thinc",
"id": "c6dc1b350b15f457f534aa21129604b58d8b5dbf",
"size": "1611",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "thinc/layers/linear.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "14601"
},
{
"name": "Cuda",
"bytes": "23473"
},
{
"name": "Cython",
"bytes": "77312"
},
{
"name": "Dockerfile",
"bytes": "430"
},
{
"name": "JavaScript",
"bytes": "57198"
},
{
"name": "Python",
"bytes": "668790"
},
{
"name": "Sass",
"bytes": "29988"
},
{
"name": "Shell",
"bytes": "364"
}
],
"symlink_target": ""
} |
Title: WebGL - Orthographic 3D
Description: How to do 3D in WebGL starting with an orthographic projection.
This post is a continuation of a series of posts about WebGL.
The first [started with fundamentals](webgl-fundamentals.html) and
the previous was [about 2D matrices](webgl-2d-matrices.html).
If you haven't read those please view them first.
In the last post we went over how 2D matrices worked. We talked
about how translation, rotation, scaling, and even projecting from
pixels into clip space can all be done by 1 matrix and some magic
matrix math. To do 3D is only a small step from there.
In our previous 2D examples we had 2D points (x, y) that we multiplied by
a 3x3 matrix. To do 3D we need 3D points (x, y, z) and a 4x4 matrix.
Let's take our last example and change it to 3D. We'll use an F again but
this time a 3D 'F'.
The first thing we need to do is change the vertex shader to handle 3D.
Here's the old shader.
```
<script id="2d-vertex-shader" type="x-shader/x-vertex">
attribute vec2 a_position;
uniform mat3 u_matrix;
void main() {
// Multiply the position by the matrix.
gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, 0, 1);
}
</script>
```
And here's the new one
```
<script id="3d-vertex-shader" type="x-shader/x-vertex">
attribute vec4 a_position;
*uniform mat4 u_matrix;
void main() {
// Multiply the position by the matrix.
* gl_Position = u_matrix * a_position;
}
</script>
```
It got even simpler!
Then we need to provide 3D data.
```
...
// Tell the attribute how to get data out of positionBuffer (ARRAY_BUFFER)
* var size = 3; // 3 components per iteration
var type = gl.FLOAT; // the data is 32bit floats
var normalize = false; // don't normalize the data
var stride = 0; // 0 = move forward size * sizeof(type) each iteration to get the next position
var offset = 0; // start at the beginning of the buffer
gl.vertexAttribPointer(
positionAttributeLocation, size, type, normalize, stride, offset);
...
// Fill the current ARRAY_BUFFER buffer
// Fill the buffer with the values that define a letter 'F'.
function setGeometry(gl) {
gl.bufferData(
gl.ARRAY_BUFFER,
new Float32Array([
// left column
0, 0, 0,
30, 0, 0,
0, 150, 0,
0, 150, 0,
30, 0, 0,
30, 150, 0,
// top rung
30, 0, 0,
100, 0, 0,
30, 30, 0,
30, 30, 0,
100, 0, 0,
100, 30, 0,
// middle rung
30, 60, 0,
67, 60, 0,
30, 90, 0,
30, 90, 0,
67, 60, 0,
67, 90, 0]),
gl.STATIC_DRAW);
}
```
Next we need to change all the matrix functions from 2D to 3D
Here are the 2D (before) versions of m3.translation, m3.rotation, and m3.scaling
```
var m3 = {
translation: function translation(tx, ty) {
return [
1, 0, 0,
0, 1, 0,
tx, ty, 1
];
},
rotation: function rotation(angleInRadians) {
var c = Math.cos(angleInRadians);
var s = Math.sin(angleInRadians);
return [
c,-s, 0,
s, c, 0,
0, 0, 1
];
},
scaling: function scaling(sx, sy) {
return [
sx, 0, 0,
0, sy, 0,
0, 0, 1
];
},
};
```
And here are the updated 3D versions.
```
var m4 = {
translation: function(tx, ty, tz) {
return [
1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
tx, ty, tz, 1,
];
},
xRotation: function(angleInRadians) {
var c = Math.cos(angleInRadians);
var s = Math.sin(angleInRadians);
return [
1, 0, 0, 0,
0, c, s, 0,
0, -s, c, 0,
0, 0, 0, 1,
];
},
yRotation: function(angleInRadians) {
var c = Math.cos(angleInRadians);
var s = Math.sin(angleInRadians);
return [
c, 0, -s, 0,
0, 1, 0, 0,
s, 0, c, 0,
0, 0, 0, 1,
];
},
xRotation: function(angleInRadians) {
var c = Math.cos(angleInRadians);
var s = Math.sin(angleInRadians);
return [
c, s, 0, 0,
-s, c, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1,
];
},
scaling: function(sx, sy, sz) {
return [
sx, 0, 0, 0,
0, sy, 0, 0,
0, 0, sz, 0,
0, 0, 0, 1,
];
},
};
```
Notice we now have 3 rotation functions. We only needed one in 2D as we
were effectively only rotating around the Z axis. Now though to do 3D we
also want to be able to rotate around the X axis and Y axis as well. You
can see from looking at them they are all very similar. If we were to
work them out you'd see them simplify just like before
Z rotation
<div class="webgl_center">
<div>newX = x * c + y * s;</div>
<div>newY = x * -s + y * c;</div>
</div>
Y rotation
<div class="webgl_center">
<div>newX = x * c + z * s;</div>
<div>newZ = x * -s + z * c;</div>
</div>
X rotation
<div class="webgl_center">
<div>newY = y * c + z * s;</div>
<div>newZ = y * -s + z * c;</div>
</div>
which gives you these rotations.
<iframe class="external_diagram" src="resources/axis-diagram.html" style="width: 540px; height: 240px;"></iframe>
Similarly we'll make our simplified functions
```
translate: function(m, tx, ty, tz) {
return m4.multiply(b, m4.translation(tx, ty, tz));
},
xRotate: function(m, angleInRadians) {
return m4.multiply(m, m4.xRotation(angleInRadians));
},
yRotate: function(m, angleInRadians) {
return m4.multiply(m, m4.yRotation(angleInRadians));
},
zRotate: function(m, angleInRadians) {
return m4.multiply(m, m4.zRotation(angleInRadians));
},
scale: function(m, sx, sy, sz) {
return m4.multiply(m, m4.scaling(sx, sy, sz));
},
```
We also need to update the projection function. Here's the old one
```
projection: function (width, height) {
// Note: This matrix flips the Y axis so 0 is at the top.
return [
2 / width, 0, 0,
0, -2 / height, 0,
-1, 1, 1
];
},
}
```
which converted from pixels to clip space. For our first attempt at
expanding it to 3D let's try
```
projection: function(width, height, depth) {
// Note: This matrix flips the Y axis so 0 is at the top.
return [
2 / width, 0, 0, 0,
0, -2 / height, 0, 0,
0, 0, 2 / depth, 0,
-1, 1, 0, 1,
];
},
```
Just like we needed to convert from pixels to clip space for X and Y, for
Z we need to do the same thing. In this case I'm making the Z axis pixel
units as well. I'll pass in some value similar to `width` for the `depth`
so our space will be 0 to `width` pixels wide, 0 to `height` pixels tall, but
for `depth` it will be `-depth / 2` to `+depth / 2`.
Finally we need to to update the code that computes the matrix.
```
// Compute the matrix
* var matrix = m4.projection(gl.canvas.clientWidth, gl.canvas.clientHeight, 400);
* matrix = m4.translate(matrix, translation[0], translation[1], translation[2]);
* matrix = m4.xRotate(matrix, rotation[0]);
* matrix = m4.yRotate(matrix, rotation[1]);
* matrix = m4.zRotate(matrix, rotation[2]);
* matrix = m4.scale(matrix, scale[0], scale[1], scale[2]);
// Set the matrix.
* gl.uniformMatrix4fv(matrixLocation, false, matrix);
```
And here's that sample.
{{{example url="../webgl-3d-step1.html" }}}
The first problem we have is that our geometry is a flat F which makes it
hard to see any 3D. To fix that let's expand the geometry to 3D. Our
current F is made of 3 rectangles, 2 triangles each. To make it 3D will
require a total of 16 rectangles. the 3 rectangles on the front, 3 on the
back, 1 on the left, 4 on the right, 3 on the bottoms
<img class="webgl_center" width="300" src="resources/3df.svg" />
That's quite a few to list out here.
16 rectangles with 2 triangles per rectangle and 3 vertices per triangle is 96
vertices. If you want to see all of them view the source of the sample.
We have to draw more vertices so
```
// Draw the geometry.
var primitiveType = gl.TRIANGLES;
var offset = 0;
* var count = 16 * 6;
gl.drawArrays(primitiveType, offset, count);
```
And here's that version
{{{example url="../webgl-3d-step2.html" }}}
Moving the sliders it's pretty hard to tell that it's 3D. Let's try
coloring each rectangle a different color. To do this we will add another
attribute to our vertex shader and a varying to pass it from the vertex
shader to the fragment shader.
Here's the new vertex shader
```
<script id="3d-vertex-shader" type="x-shader/x-vertex">
attribute vec4 a_position;
+attribute vec4 a_color;
uniform mat4 u_matrix;
+varying vec4 v_color;
void main() {
// Multiply the position by the matrix.
gl_Position = u_matrix * a_position;
+ // Pass the color to the fragment shader.
+ v_color = a_color;
}
</script>
```
And we need to use that color in the fragment shader
```
<script id="3d-vertex-shader" type="x-shader/x-fragment">
precision mediump float;
+// Passed in from the vertex shader.
+varying vec4 v_color;
void main() {
* gl_FragColor = v_color;
}
</script>
```
We need to lookup the location to supply the colors, then setup another
buffer and put the colors in it.
```
...
var colorLocation = gl.getAttribLocation(program, "a_color");
...
// Create a buffer for colors.
var colorBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
// Put the colors in the buffer.
setColors(gl);
...
// Fill the buffer with colors for the 'F'.
function setColors(gl) {
gl.bufferData(
gl.ARRAY_BUFFER,
new Uint8Array([
// left column front
200, 70, 120,
200, 70, 120,
200, 70, 120,
200, 70, 120,
200, 70, 120,
200, 70, 120,
// top rung front
200, 70, 120,
200, 70, 120,
...
...
gl.STATIC_DRAW);
}
```
Then at render time we need to tell the color attribute how to get colors
out of the color buffer
```
// Turn on the color attribute
gl.enableVertexAttribArray(colorLocation);
// Bind the color buffer.
gl.bindBuffer(gl.ARRAY_BUFFER, colorBuffer);
// Tell the attribute how to get data out of colorBuffer (ARRAY_BUFFER)
var size = 3; // 3 components per iteration
var type = gl.UNSIGNED_BYTE; // the data is 8bit unsigned values
var normalize = true; // normalize the data (convert from 0-255 to 0-1)
var stride = 0; // 0 = move forward size * sizeof(type) each iteration to get the next position
var offset = 0; // start at the beginning of the buffer
gl.vertexAttribPointer(
colorLocation, size, type, normalize, stride, offset)
```
Now we get this.
{{{example url="../webgl-3d-step3.html" }}}
Uh oh, what's that mess? Well, it turns out all the various parts of
that 3D 'F', front, back, sides, etc get drawn in the order they appear in in
our geometry. That doesn't give us quite the desired results as sometimes
the ones in the back get drawn after the ones in the front.
Triangles in WebGL have the concept of front facing and back facing. A
front facing triangle has its vertices go in a clockwise direction. A
back facing triangle has its vertices go in a counter clockwise direction
<img src="resources/triangle-winding.svg" class="webgl_center" width="400" />
WebGL has the ability to draw only forward facing or back facing
triangles. We can turn that feature on with
```
gl.enable(gl.CULL_FACE);
```
Well put that in our `drawScene` function. With that
feature turned on, WebGL defaults to "culling" back facing triangles.
"Culling" in this case is a fancy word for "not drawing".
Note that as far as WebGL is concerned, whether or not a triangle is
considered to be going clockwise or counter clockwise depends on the
vertices of that triangle in clip space. In other words, WebGL figures out
whether a triangle is front or back AFTER you've applied math to the
vertices in the vertex shader. That means for example a clockwise
triangle that is scaled in X by -1 becomes a counter clockwise triangle or
a clockwise triangle rotated 180 degrees becomes a couter clockwise
triangle. Because we had CULL_FACE disabled we can see both
clockwise(front) and counter clockwise(back) triangles. Now that we've
turned it on, any time a front facing triangle flips around either because
of scaling or rotation or for whatever reason, WebGL won't draw it.
That's a good thing since as your turn something around in 3D you
generally want whichever triangles are facing you to be considered front
facing.
With CULL_FACE turned on this is what we get
{{{example url="../webgl-3d-step4.html" }}}
Hey! Where did all the triangles go? It turns out, many of them are
facing the wrong way. Rotate it and you'll see them appear when you look
at the other side. Fortunately it's easy to fix. We just look at which
ones are backward and exchange 2 of their vertices. For example if one
backward triangle is
```
1, 2, 3,
40, 50, 60,
700, 800, 900,
```
we just flip the last 2 vertices to make it forward.
```
1, 2, 3,
700, 800, 900,
40, 50, 60,
```
Going through and fixing all the backward triangles gets us to this
{{{example url="../webgl-3d-step5.html" }}}
That's closer but there's still one more problem. Even with all the
triangles facing in the correct direction and with the back facing ones
being culled we still have places where triangles that should be in the back
are being drawn over triangles that should be in front.
Enter the DEPTH BUFFER.
A depth buffer, sometimes called a Z-Buffer, is a rectangle of *depth*
pixels, one depth pixel for each color pixel used to make the image. As
WebGL draws each color pixel it can also draw a depth pixel. It does this
based on the values we return from the vertex shader for Z. Just like we
had to convert to clip space for X and Y, Z is also in clip space or (-1
to +1). That value is then converted into a depth space value (0 to +1).
Before WebGL draws a color pixel it will check the corresponding depth
pixel. If the depth value for the pixel it's about to draw is greater
than the value of the corresponding depth pixel then WebGL does not draw
the new color pixel. Otherwise it draws both the new color pixel with the
color from your fragment shader AND it draws the depth pixel with the new
depth value. This means, pixels that are behind other pixels won't get
drawn.
We can turn on this feature nearly as simply as we turned on culling with
```
gl.enable(gl.DEPTH_TEST);
```
We also need to clear the depth buffer back to 1.0 before we start drawing.
```
// Draw the scene.
function drawScene() {
...
// Clear the canvas AND the depth buffer.
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
...
```
And now we get
{{{example url="../webgl-3d-step6.html" }}}
which is 3D!
One minor thing. In most 3d math libraries this is no `projection` function to
do our conversions from clip space to pixel space. Rather there's usually a function
called `ortho` or `orthographic` that looks like this
var m4 = {
orthographic: function(left, right, bottom, top, near, far) {
return [
2 / (right - left), 0, 0, 0,
0, 2 / (top - bottom), 0, 0,
0, 0, 2 / (near - far), 0,
(left + right) / (left - right),
(bottom + top) / (bottom - top),
(near + far) / (near - far),
1,
];
}
Unlike our simplified `projection` function above which only had width, height, and depth
parameters this more common othrographic projection function we can pass in left, right,
bottom, top, near, and far which gives as more flexability. To use it the same as
our original projection function we'd call it with
var left = 0;
var right = gl.canvas.clientWidth;
var bottom = gl.canvas.clientHeight;
var top = 0;
var near = -400;
var far = 400;
m4.orthographic(left, right, bottom, top, near, far);
In the next post I'll go over [how to make it have perspective](webgl-3d-perspective.html).
<div class="webgl_bottombar">
<h3>Why is the attribute vec4 but gl.vertexAttribPointer size 3</h3>
<p>
For those of you who are detail oriented you might have noticed we defined our 2 attributes as
</p>
<pre class="prettyprint showlinemods">
attribute vec4 a_position;
attribute vec4 a_color;
</pre>
<p>both of which are 'vec4' but when we tell WebGL how to take data out of our buffers we used</p>
<pre class="prettyprint showlinemods">
// Tell the attribute how to get data out of positionBuffer (ARRAY_BUFFER)
var size = 3; // 3 components per iteration
var type = gl.FLOAT; // the data is 32bit floats
var normalize = false; // don't normalize the data
var stride = 0; // 0 = move forward size * sizeof(type) each
// iteration to get the next position
var offset = 0; // start at the beginning of the buffer
gl.vertexAttribPointer(
positionAttributeLocation, size, type, normalize, stride, offset);
...
// Tell the attribute how to get data out of colorBuffer (ARRAY_BUFFER)
var size = 3; // 3 components per iteration
var type = gl.UNSIGNED_BYTE; // the data is 8bit unsigned bytes
var normalize = true; // convert from 0-255 to 0.0-1.0
var stride = 0; // 0 = move forward size * sizeof(type) each
// iteration to get the next color
var offset = 0; // start at the beginning of the buffer
gl.vertexAttribPointer(
colorAttributeLocation, size, type, normalize, stride, offset);
</pre>
<p>
That '3' in each of those says only to pull 3 values out of the buffer per attribute
per iteration of the vertex shader.
This works because in the vertex shader WebGL provides defaults for those
values you don't supply. The defaults are 0, 0, 0, 1 where x = 0, y = 0, z = 0
and w = 1. This is why in our old 2D vertex shader we had to explicitly
supply the 1. We were passing in x and y and we needed a 1 for z but
because the default for z is 0 we had to explicitly supply a 1. For 3D
though, even though we don't supply a 'w' it defaults to 1 which is what
we need for the matrix math to work.
</p>
</div>
| {
"content_hash": "e32df4317862e64ac13e9ed54a9f7765",
"timestamp": "",
"source": "github",
"line_count": 625,
"max_line_length": 113,
"avg_line_length": 29.272,
"alnum_prop": 0.6567368133369773,
"repo_name": "ichenjin/webgl-fundamentals",
"id": "108cfe490997ba4e70f0d191009293a68e9cc726",
"size": "18295",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "webgl/lessons/webgl-3d-orthographic.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "194941"
},
{
"name": "HTML",
"bytes": "2834526"
},
{
"name": "JavaScript",
"bytes": "1144850"
},
{
"name": "Python",
"bytes": "2818"
},
{
"name": "TypeScript",
"bytes": "383761"
}
],
"symlink_target": ""
} |
#include <aws/appstream/model/DeleteImageBuilderRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::AppStream::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
DeleteImageBuilderRequest::DeleteImageBuilderRequest() :
m_nameHasBeenSet(false)
{
}
Aws::String DeleteImageBuilderRequest::SerializePayload() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("Name", m_name);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection DeleteImageBuilderRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "PhotonAdminProxyService.DeleteImageBuilder"));
return headers;
}
| {
"content_hash": "5667befafa9944ce51d6d8bbd3af1596",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 107,
"avg_line_length": 20.025,
"alnum_prop": 0.7640449438202247,
"repo_name": "JoyIfBam5/aws-sdk-cpp",
"id": "fa82cacef40ad0afa89eea6a4a1fae5db5b4307f",
"size": "1374",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-cpp-sdk-appstream/source/model/DeleteImageBuilderRequest.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "11868"
},
{
"name": "C++",
"bytes": "167818064"
},
{
"name": "CMake",
"bytes": "591577"
},
{
"name": "HTML",
"bytes": "4471"
},
{
"name": "Java",
"bytes": "271801"
},
{
"name": "Python",
"bytes": "85650"
},
{
"name": "Shell",
"bytes": "5277"
}
],
"symlink_target": ""
} |
import requests
import ConfigParser
from getpass import getpass
class Setup:
URLS = {
"1": "https://www.fireservicerota.co.uk",
"2": "https://www.brandweerrooster.nl"
}
CONFIG_FILE = '.local_settings.ini'
domain = None
api_key = None
def __init__(self):
pass
def get_settings(self):
self.read_configuration()
while(not self.is_configured()):
self.ask_user()
self.write_configuration()
return {'domain': self.domain, 'api_key': self.api_key}
def is_configured(self):
return self.domain != None and self.api_key != None
def read_configuration(self):
config = ConfigParser.ConfigParser()
config.read(self.CONFIG_FILE)
try:
self.domain = config.get('Main', 'Domain')
self.api_key = config.get('Main', 'APIKey')
finally:
return
def write_configuration(self):
config = ConfigParser.ConfigParser()
config.add_section('Main')
config.set('Main', 'Domain', self.domain)
config.set('Main', 'APIKey', self.api_key)
cfgfile = open('.local_settings.ini', 'w')
config.write(cfgfile)
cfgfile.close()
def get_api_key(self):
url_template = '{}/api/sessions'
url = url_template.format(self.domain)
result = requests.post(url, json = {'user_login': self.email, 'password': self.password})
response_json = result.json()
success = response_json['success']
if(success):
return response_json['auth_token']
else:
return None
def ask_user(self):
while True:
self.ask_system_choice()
self.ask_email()
self.ask_password()
self.api_key = self.get_api_key()
if self.api_key:
print "Logged in"
print
return
else:
print
print "Invalid email or password. Please try again"
print
def ask_email(self):
self.email = raw_input("Please enter your email address: ")
def ask_password(self):
self.password = getpass("Please enter your password: ")
def ask_system_choice(self):
print "Please select the system you use"
print "1. FireServiceRota (international)"
print "2. Brandweerrooster (Netherlands)"
while True:
self.system_choice = raw_input("Please enter 1 or 2: ")
if self.system_choice in ["1", "2"]:
break
self.domain = self.URLS[self.system_choice]
return
| {
"content_hash": "67edf8ddf3592ccc10ce4651433df890",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 93,
"avg_line_length": 24.83157894736842,
"alnum_prop": 0.6299279355659178,
"repo_name": "rhomeister/firepi",
"id": "5b229462fa8c147896abfdf6592cf246b8ca0220",
"size": "2377",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "firepi/setup.py",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "16251"
}
],
"symlink_target": ""
} |
echo "Running wordcount example"
. ./configDefaults.sh
ARGS="$HDFS_WC $HDFS_WC_OUT"
echo "running wc with args $ARGS"
$FLINK_BUILD_HOME"/bin/flink" run -p $DOP -j $FLINK_BUILD_HOME/examples/flink-java-examples-*-WordCount.jar $ARGS
| {
"content_hash": "c7cdd50280f94c0f84f4418da986cc78",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 113,
"avg_line_length": 29.375,
"alnum_prop": 0.7319148936170212,
"repo_name": "rmetzger/flink-perf",
"id": "45d88e4351578005ca3c365856cbed6510e80d3a",
"size": "248",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "automation/runWC-JAPI.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package org.smurve.hsr2014.utils;
import org.smurve.hsr2014.domain.User;
import org.springframework.security.core.userdetails.UserDetails;
public interface UserFactory {
User newUser(UserDetails details);
User newInactiveUser(String username, String password);
User newUser(String username, String password);
void encodeUserPassword(User user);
}
| {
"content_hash": "481d5287c43957f96227a6e6dc543206",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 65,
"avg_line_length": 24.6,
"alnum_prop": 0.7831978319783198,
"repo_name": "smurve/hsr2015",
"id": "5b68f0c6dd01190846b260e3f3b738e0bdf0e021",
"size": "369",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SpringSecurity/src/main/java/org/smurve/hsr2014/utils/UserFactory.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "768"
},
{
"name": "Java",
"bytes": "294851"
},
{
"name": "JavaScript",
"bytes": "312"
}
],
"symlink_target": ""
} |
var vows = require('vows');
var assert = require('assert');
var tools = require(__dirname + '/utils/rest.js');
var specs = require(__dirname + '/utils/defaultspecs.js');
// Create a Test Suite
vows.describe('bug 1409070735: Things may have a criteria and a state:').addBatch({
'Insert me to men laughed and cried and insert another person laughed and request a Daniel laughed' : {
topic : function() {
var self = this;
var person = {
firstname : 'Daniel',
lastname : 'Oltmanns',
_secret : '1409070735' + new Date().getTime()
};
tools.postRequest('addto/men/laughed.json', person, function() {
tools.postRequest('addto/men/cried.json', person, function() {
person.firstname = 'Dirk';
tools.postRequest('addto/men/laughed.json', person, function() {
tools.getRequest('get/men/laughed.json', self.callback, {
firstname : "Daniel",
_secret : person._secret
});
});
});
});
},
'the response should' : {
'have a http status 200' : specs.assertResponse.hasStatus200(),
'be unique' : specs.assertResponse.json.hasLength(1),
'have Daniel as firstname' : specs.assertResponse.json.key('firstname').hasValue('Daniel'),
'have laughed as state' : specs.assertResponse.json.key('_state').hasValue('laughed'),
'not have cried as state' : specs.assertResponse.json.key('_state').not.hasValue('cried')
}
}
}).exportTo(module); // Run it
| {
"content_hash": "72401d734b0aa6ee73801e19f697ff14",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 105,
"avg_line_length": 41.189189189189186,
"alnum_prop": 0.6141732283464567,
"repo_name": "knurtsysteme/things-happened-db",
"id": "5c573c0f92fb92c12629bf42ab2f1de2a973f948",
"size": "1553",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "things-happened-db/src/test/things-bug-1409070735.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "11"
},
{
"name": "JavaScript",
"bytes": "65312"
}
],
"symlink_target": ""
} |
import unittest
import os
import imath
import IECore
import Gaffer
import GafferTest
class MetadataAlgoTest( GafferTest.TestCase ) :
def testReadOnly( self ) :
n = GafferTest.AddNode()
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n ), False )
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n["op1"] ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n["op1"] ), False )
Gaffer.MetadataAlgo.setReadOnly( n["op1"], True )
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n ), False )
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n["op1"] ), True )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n["op1"] ), True )
Gaffer.MetadataAlgo.setReadOnly( n, True )
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n ), True )
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n["op1"] ), True )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n ), True )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n["op1"] ), True )
Gaffer.MetadataAlgo.setReadOnly( n["op1"], False )
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n ), True )
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n["op1"] ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n ), True )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n["op1"] ), True )
with self.assertRaisesRegex( Exception, r"did not match C\+\+ signature" ) :
Gaffer.MetadataAlgo.readOnly( None )
def testReadOnlyReason( self ) :
b = Gaffer.Box()
b["b"] = Gaffer.Box()
n = GafferTest.AddNode()
b["b"]["n"] = n
self.assertIsNone( Gaffer.MetadataAlgo.readOnlyReason( n ) )
self.assertIsNone( Gaffer.MetadataAlgo.readOnlyReason( n["op1"] ) )
Gaffer.MetadataAlgo.setReadOnly( b, True )
self.assertEqual( Gaffer.MetadataAlgo.readOnlyReason( n ), b )
self.assertEqual( Gaffer.MetadataAlgo.readOnlyReason( n["op1"] ), b )
Gaffer.MetadataAlgo.setReadOnly( b["b"], True )
self.assertEqual( Gaffer.MetadataAlgo.readOnlyReason( n["op1"] ), b )
Gaffer.MetadataAlgo.setReadOnly( b["b"]["n"], True )
self.assertEqual( Gaffer.MetadataAlgo.readOnlyReason( n["op1"] ), b )
Gaffer.MetadataAlgo.setReadOnly( b["b"]["n"]["op1"], True )
self.assertEqual( Gaffer.MetadataAlgo.readOnlyReason( n["op1"] ), b )
Gaffer.MetadataAlgo.setReadOnly( b, False )
self.assertEqual( Gaffer.MetadataAlgo.readOnlyReason( n["op1"] ), b["b"] )
Gaffer.MetadataAlgo.setReadOnly( b["b"], False )
self.assertEqual( Gaffer.MetadataAlgo.readOnlyReason( n["op1"] ), n )
Gaffer.MetadataAlgo.setReadOnly( b["b"]["n"], False )
self.assertEqual( Gaffer.MetadataAlgo.readOnlyReason( n["op1"] ), n["op1"] )
Gaffer.MetadataAlgo.setReadOnly( b["b"]["n"]["op1"], False )
self.assertIsNone( Gaffer.MetadataAlgo.readOnlyReason( n["op1"] ) )
with self.assertRaisesRegex( Exception, r"did not match C\+\+ signature" ) :
Gaffer.MetadataAlgo.readOnlyReason( None )
def testChildNodesAreReadOnly( self ) :
b = Gaffer.Box()
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( b ), False )
self.assertEqual( Gaffer.MetadataAlgo.getChildNodesAreReadOnly( b ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( b ), False )
p1 = Gaffer.IntPlug( "boxPlug", Gaffer.Plug.Direction.In )
b.addChild( p1 )
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( p1 ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( p1 ), False )
n = GafferTest.AddNode()
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n ), False )
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n["op1"] ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n["op1"] ), False )
b.addChild( n )
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n ), False )
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n["op1"] ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n["op1"] ), False )
Gaffer.MetadataAlgo.setChildNodesAreReadOnly( b, True )
self.assertEqual( Gaffer.MetadataAlgo.getChildNodesAreReadOnly( b ), True )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( b ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( p1 ), False )
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n ), False )
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n["op1"] ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n ), True )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n["op1"] ), True )
Gaffer.MetadataAlgo.setChildNodesAreReadOnly( b, False )
self.assertEqual( Gaffer.MetadataAlgo.getChildNodesAreReadOnly( b ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( b ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( p1 ), False )
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n ), False )
self.assertEqual( Gaffer.MetadataAlgo.getReadOnly( n["op1"] ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n ), False )
self.assertEqual( Gaffer.MetadataAlgo.readOnly( n["op1"] ), False )
def testBookmarks( self ) :
b = Gaffer.Box()
b["n0"] = GafferTest.AddNode()
b["n1"] = GafferTest.AddNode()
self.assertEqual( Gaffer.MetadataAlgo.getBookmarked( b ), False )
self.assertEqual( Gaffer.MetadataAlgo.getBookmarked( b["n0"] ), False )
self.assertEqual( Gaffer.MetadataAlgo.getBookmarked( b["n1"] ), False )
self.assertEqual( Gaffer.MetadataAlgo.bookmarks( b ), [] )
Gaffer.MetadataAlgo.setBookmarked( b["n0"], True )
self.assertEqual( Gaffer.MetadataAlgo.getBookmarked( b ), False )
self.assertEqual( Gaffer.MetadataAlgo.getBookmarked( b["n0"] ), True )
self.assertEqual( Gaffer.MetadataAlgo.getBookmarked( b["n1"] ), False )
self.assertEqual( Gaffer.MetadataAlgo.bookmarks( b ), [ b["n0"] ] )
Gaffer.MetadataAlgo.setBookmarked( b["n1"], True )
self.assertEqual( Gaffer.MetadataAlgo.getBookmarked( b ), False )
self.assertEqual( Gaffer.MetadataAlgo.getBookmarked( b["n0"] ), True )
self.assertEqual( Gaffer.MetadataAlgo.getBookmarked( b["n1"] ), True )
self.assertEqual( Gaffer.MetadataAlgo.bookmarks( b ), [ b["n0"], b["n1"] ] )
Gaffer.MetadataAlgo.setBookmarked( b["n0"], False )
self.assertEqual( Gaffer.MetadataAlgo.getBookmarked( b ), False )
self.assertEqual( Gaffer.MetadataAlgo.getBookmarked( b["n0"] ), False )
self.assertEqual( Gaffer.MetadataAlgo.getBookmarked( b["n1"] ), True )
self.assertEqual( Gaffer.MetadataAlgo.bookmarks( b ), [ b["n1"] ] )
Gaffer.MetadataAlgo.setBookmarked( b, True )
self.assertEqual( Gaffer.MetadataAlgo.getBookmarked( b ), True )
self.assertTrue( b not in Gaffer.MetadataAlgo.bookmarks( b ) )
s = Gaffer.ScriptNode()
s.addChild( b )
self.assertEqual( Gaffer.MetadataAlgo.getBookmarked( b ), True )
self.assertEqual( Gaffer.MetadataAlgo.bookmarks( s ), [ b ] )
def testAffected( self ) :
n = GafferTest.CompoundPlugNode()
affected = []
ancestorAffected = []
childAffected = []
def plugValueChanged( nodeTypeId, plugPath, key, plug ) :
affected.append( Gaffer.MetadataAlgo.affectedByChange( n["p"]["s"], nodeTypeId, plugPath, plug ) )
ancestorAffected.append( Gaffer.MetadataAlgo.ancestorAffectedByChange( n["p"]["s"], nodeTypeId, plugPath, plug ) )
childAffected.append( Gaffer.MetadataAlgo.childAffectedByChange( n["p"], nodeTypeId, plugPath, plug ) )
c = Gaffer.Metadata.plugValueChangedSignal().connect( plugValueChanged, scoped = True )
Gaffer.Metadata.registerValue( Gaffer.Node, "user", "test", 1 )
self.assertEqual( affected, [ False ] )
self.assertEqual( ancestorAffected, [ False ] )
self.assertEqual( childAffected, [ False ] )
Gaffer.Metadata.registerValue( GafferTest.StringInOutNode, "p.s", "test", 1 )
self.assertEqual( affected, [ False, False ] )
self.assertEqual( ancestorAffected, [ False, False ] )
self.assertEqual( childAffected, [ False, False ] )
Gaffer.Metadata.registerValue( GafferTest.CompoundPlugNode, "p.s", "test", 1 )
self.assertEqual( affected, [ False, False, True ] )
self.assertEqual( ancestorAffected, [ False, False, False ] )
self.assertEqual( childAffected, [ False, False, True ] )
Gaffer.Metadata.registerValue( GafferTest.CompoundPlugNode, "p", "test", 2 )
self.assertEqual( affected, [ False, False, True, False ] )
self.assertEqual( ancestorAffected, [ False, False, False, True ] )
self.assertEqual( childAffected, [ False, False, True, False ] )
del affected[:]
del ancestorAffected[:]
del childAffected[:]
Gaffer.Metadata.registerValue( n["user"], "test", 3 )
self.assertEqual( affected, [ False ] )
self.assertEqual( ancestorAffected, [ False ] )
self.assertEqual( childAffected, [ False ] )
Gaffer.Metadata.registerValue( n["p"]["s"], "test", 4 )
self.assertEqual( affected, [ False, True ] )
self.assertEqual( ancestorAffected, [ False, False ] )
self.assertEqual( childAffected, [ False, True ] )
Gaffer.Metadata.registerValue( n["p"], "test", 5 )
self.assertEqual( affected, [ False, True, False ] )
self.assertEqual( ancestorAffected, [ False, False, True ] )
self.assertEqual( childAffected, [ False, True, False ] )
def testNodeAffected( self ) :
n = Gaffer.Box()
n["c"] = Gaffer.Node()
affected = []
childAffected = []
def nodeValueChanged( nodeTypeId, key, node ) :
affected.append( Gaffer.MetadataAlgo.affectedByChange( n, nodeTypeId, node ) )
childAffected.append( Gaffer.MetadataAlgo.childAffectedByChange( n, nodeTypeId, node ) )
c = Gaffer.Metadata.nodeValueChangedSignal().connect( nodeValueChanged, scoped = True )
Gaffer.Metadata.registerValue( Gaffer.Node, "metadataAlgoTest", 1 )
self.assertEqual( affected, [ True ] )
self.assertEqual( childAffected, [ True ] )
Gaffer.Metadata.registerValue( GafferTest.AddNode, "metadataAlgoTest", 2 )
self.assertEqual( affected, [ True, False ] )
self.assertEqual( childAffected, [ True, False ] )
Gaffer.Metadata.registerValue( n, "metadataAlgoTest", 3 )
self.assertEqual( affected, [ True, False, True ] )
self.assertEqual( childAffected, [ True, False, False ] )
n["a"] = GafferTest.AddNode()
Gaffer.Metadata.registerValue( n["a"], "metadataAlgoTest", 4 )
self.assertEqual( affected, [ True, False, True, False ] )
self.assertEqual( childAffected, [ True, False, False, True ] )
def testAncestorNodeAffected( self ) :
s = Gaffer.ScriptNode()
s["b"] = Gaffer.Box()
s["b"]["n"] = GafferTest.AddNode()
s["b2"] = Gaffer.Box()
affected = []
def nodeValueChanged( nodeTypeId, key, node ) :
a = set()
for g in ( s["b"]["n"]["op1"], s["b"]["n"], s["b"] ) :
if Gaffer.MetadataAlgo.ancestorAffectedByChange( g, nodeTypeId, node ) :
a.add( g )
affected.append( a )
c = Gaffer.Metadata.nodeValueChangedSignal().connect( nodeValueChanged, scoped = True )
Gaffer.Metadata.registerValue( s["b"]["n"], "metadataAlgoTest", "test" )
self.assertEqual( len( affected ), 1 )
self.assertEqual( affected[-1], { s["b"]["n"]["op1"] } )
Gaffer.Metadata.registerValue( s["b"], "metadataAlgoTest", "test" )
self.assertEqual( len( affected ), 2 )
self.assertEqual( affected[-1], { s["b"]["n"], s["b"]["n"]["op1"] } )
Gaffer.Metadata.registerValue( s, "metadataAlgoTest", "test" )
self.assertEqual( len( affected ), 3 )
self.assertEqual( affected[-1], { s["b"], s["b"]["n"], s["b"]["n"]["op1"] } )
Gaffer.Metadata.registerValue( Gaffer.Box, "metadataAlgoTest", "test" )
Gaffer.Metadata.registerValue( s["b"], "metadataAlgoTest", "test" )
self.assertEqual( len( affected ), 4 )
self.assertEqual( affected[-1], { s["b"]["n"], s["b"]["n"]["op1"] } )
Gaffer.Metadata.registerValue( s["b2"], "metadataAlgoTest", "test" )
self.assertEqual( len( affected ), 5 )
self.assertEqual( affected[-1], set() )
def testCopy( self ) :
Gaffer.Metadata.registerValue( GafferTest.AddNode, "metadataAlgoTest", "test" )
s = GafferTest.AddNode()
Gaffer.Metadata.registerValue( s, "a", "a" )
Gaffer.Metadata.registerValue( s, "a2", "a2" )
Gaffer.Metadata.registerValue( s, "b", "b" )
Gaffer.Metadata.registerValue( s, "c", "c", persistent = False )
def registeredTestValues( node ) :
# We don't know what metadata might have been registered to the node
# before we run, so here we strip out any values that we're not interested in.
return set( Gaffer.Metadata.registeredValues( t ) ).intersection(
{ "metadataAlgoTest", "a", "a2", "b", "c" }
)
t = Gaffer.Node()
Gaffer.MetadataAlgo.copy( s, t )
self.assertEqual( registeredTestValues( t ), { "metadataAlgoTest", "a", "a2", "b" } )
t = Gaffer.Node()
Gaffer.MetadataAlgo.copy( s, t, persistentOnly = False )
self.assertEqual( registeredTestValues( t ), { "metadataAlgoTest", "a", "a2", "b", "c" } )
t = Gaffer.Node()
Gaffer.MetadataAlgo.copy( s, t, exclude = "a*" )
self.assertEqual( registeredTestValues( t ), { "metadataAlgoTest", "b" } )
t = Gaffer.Node()
Gaffer.MetadataAlgo.copy( s, t, exclude = "a b" )
self.assertEqual( registeredTestValues( t ), { "metadataAlgoTest", "a2" } )
t = Gaffer.Node()
Gaffer.MetadataAlgo.copy( s, t )
for k in Gaffer.Metadata.registeredValues( t ) :
self.assertEqual( Gaffer.Metadata.value( t, k ), Gaffer.Metadata.value( s, k ) )
t = Gaffer.Node()
Gaffer.MetadataAlgo.copyIf( s, t, lambda f, t, n : n.startswith( "a" ) )
self.assertEqual( registeredTestValues( t ), { "a", "a2" } )
t = Gaffer.Node()
Gaffer.MetadataAlgo.copyIf( s, t, lambda f, t, n : n.startswith( "c" ) )
self.assertEqual( registeredTestValues( t ), { "c" } )
def testIsPromotable( self ) :
Gaffer.Metadata.registerValue( GafferTest.AddNode, "notPromotableTest:promotable", False )
Gaffer.Metadata.registerValue( GafferTest.AddNode, "notPromotableTest", "no")
Gaffer.Metadata.registerValue( GafferTest.AddNode, "promotableTest:promotable", True )
Gaffer.Metadata.registerValue( GafferTest.AddNode, "promotableTest", "yes" )
s = GafferTest.AddNode()
t = Gaffer.Node()
self.assertFalse( Gaffer.MetadataAlgo.isPromotable( s, t, "notPromotableTest" ) )
self.assertFalse( Gaffer.MetadataAlgo.isPromotable( s, t, "notPromotableTest:promotable" ) )
self.assertTrue( Gaffer.MetadataAlgo.isPromotable( s, t, "promotableTest") )
self.assertFalse( Gaffer.MetadataAlgo.isPromotable( s, t, "promotableTest:promotable" ) )
def testCopyColorKeepExisting( self ) :
plug1 = Gaffer.IntPlug()
plug2 = Gaffer.IntPlug()
connectionColor = imath.Color3f( 0.1 , 0.2 , 0.3 )
noodleColor = imath.Color3f( 0.4, 0.5 , 0.6 )
noodleColorExisting = imath.Color3f( 0.7, 0.8 , 0.9 )
Gaffer.Metadata.registerValue( plug1, "connectionGadget:color", connectionColor )
Gaffer.Metadata.registerValue( plug1, "nodule:color", noodleColor )
Gaffer.Metadata.registerValue( plug2, "nodule:color", noodleColorExisting )
Gaffer.MetadataAlgo.copyColors(plug1, plug2, overwrite = False )
self.assertEqual( Gaffer.Metadata.value( plug2, "connectionGadget:color" ), connectionColor )
self.assertEqual( Gaffer.Metadata.value( plug2, "nodule:color" ), noodleColorExisting )
def testCopyColorForceOverWrite( self ) :
plug1 = Gaffer.IntPlug()
plug2 = Gaffer.IntPlug()
connectionColor = imath.Color3f( 0.1 , 0.2 , 0.3 )
noodleColor = imath.Color3f( 0.4, 0.5 , 0.6 )
noodleColorExisting = imath.Color3f( 0.7, 0.8 , 0.9 )
Gaffer.Metadata.registerValue( plug1, "connectionGadget:color", connectionColor )
Gaffer.Metadata.registerValue( plug1, "nodule:color", noodleColor )
Gaffer.Metadata.registerValue( plug2, "nodule:color", noodleColorExisting )
Gaffer.MetadataAlgo.copyColors(plug1, plug2, overwrite = True )
self.assertEqual( Gaffer.Metadata.value( plug2, "connectionGadget:color" ), connectionColor )
self.assertEqual( Gaffer.Metadata.value( plug2, "nodule:color" ), noodleColor )
def testReadOnlyAffectedByChange( self ) :
s = Gaffer.ScriptNode()
s["b"] = Gaffer.Box()
s["b"]["n"] = GafferTest.AddNode()
s["b2"] = Gaffer.Box()
affected = []
def nodeValueChanged( nodeTypeId, key, node ) :
a = set()
for g in ( s["b"]["n"]["op1"], s["b"]["n"], s["b"] ) :
if Gaffer.MetadataAlgo.readOnlyAffectedByChange( g, nodeTypeId, key, node ) :
a.add( g )
affected.append( a )
c1 = Gaffer.Metadata.nodeValueChangedSignal().connect( nodeValueChanged, scoped = True )
def plugValueChanged( nodeTypeId, plugPath, key, plug ) :
a = set()
for g in ( s["b"]["n"]["op1"], s["b"]["n"], s["b"] ) :
if Gaffer.MetadataAlgo.readOnlyAffectedByChange( g, nodeTypeId, plugPath, key, plug ) :
a.add( g )
affected.append( a )
c2 = Gaffer.Metadata.plugValueChangedSignal().connect( plugValueChanged, scoped = True )
Gaffer.Metadata.registerValue( s["b"]["n"]["op1"], "metadataAlgoTest", "test" )
self.assertEqual( len( affected ), 1 )
self.assertEqual( affected[-1], set() )
Gaffer.MetadataAlgo.setReadOnly( s["b"]["n"]["op1"], True )
self.assertEqual( len( affected ), 2 )
self.assertEqual( affected[-1], { s["b"]["n"]["op1"] } )
Gaffer.MetadataAlgo.setReadOnly( s["b"]["n"], True )
self.assertEqual( len( affected ), 3 )
self.assertEqual( affected[-1], { s["b"]["n"]["op1"], s["b"]["n"] } )
Gaffer.MetadataAlgo.setChildNodesAreReadOnly( s["b"], True )
self.assertEqual( len( affected ), 4 )
self.assertEqual( affected[-1], { s["b"]["n"]["op1"], s["b"]["n"] } )
Gaffer.MetadataAlgo.setChildNodesAreReadOnly( s["b2"], True )
self.assertEqual( len( affected ), 5 )
self.assertEqual( affected[-1], set() )
def testUnbookmarkedNodesDontHaveMetadata( self ) :
s = Gaffer.ScriptNode()
s["n"] = Gaffer.Node()
self.assertEqual( len( Gaffer.Metadata.registeredValues( s["n"], instanceOnly = True ) ), 0 )
Gaffer.MetadataAlgo.setBookmarked( s["n"], True )
self.assertEqual( len( Gaffer.Metadata.registeredValues( s["n"], instanceOnly = True ) ), 1 )
Gaffer.MetadataAlgo.setBookmarked( s["n"], False )
self.assertEqual( len( Gaffer.Metadata.registeredValues( s["n"], instanceOnly = True ) ), 0 )
def testNumericBookmarks( self ) :
s = Gaffer.ScriptNode()
s["n1"] = Gaffer.Node()
s["n2"] = Gaffer.Node()
Gaffer.MetadataAlgo.setNumericBookmark( s, 1, s["n1"] )
self.assertEqual( Gaffer.MetadataAlgo.getNumericBookmark( s, 1 ), s["n1"] )
self.assertEqual( Gaffer.MetadataAlgo.numericBookmark( s["n1"] ), 1 )
Gaffer.MetadataAlgo.setNumericBookmark( s, 1, s["n2"] ) # moving the bookmark
self.assertEqual( Gaffer.MetadataAlgo.numericBookmark( s["n1"] ), 0 )
self.assertEqual( Gaffer.MetadataAlgo.getNumericBookmark( s, 1 ), s["n2"] )
self.assertEqual( Gaffer.MetadataAlgo.numericBookmark( s["n2"] ), 1 )
Gaffer.MetadataAlgo.setNumericBookmark( s, 1, None )
self.assertEqual( Gaffer.MetadataAlgo.getNumericBookmark( s, 1 ), None )
self.assertEqual( Gaffer.MetadataAlgo.numericBookmark( s["n2"] ), 0 )
def testNumericBookmarksSerialisation( self ) :
s = Gaffer.ScriptNode()
s["n1"] = Gaffer.Node()
s["n2"] = Gaffer.Node()
Gaffer.MetadataAlgo.setNumericBookmark( s, 1, s["n1"] )
Gaffer.MetadataAlgo.setNumericBookmark( s, 2, s["n2"] )
# Copying within script doesn't copy numeric bookmarks
s.execute( s.serialise() )
self.assertEqual( Gaffer.MetadataAlgo.getNumericBookmark( s, 1 ), s["n1"] )
self.assertEqual( Gaffer.MetadataAlgo.getNumericBookmark( s, 2 ), s["n2"] )
self.assertEqual( Gaffer.MetadataAlgo.numericBookmark( s["n3"] ), 0 )
self.assertEqual( Gaffer.MetadataAlgo.numericBookmark( s["n4"] ), 0 )
del s["n3"]
del s["n4"]
# Copying to new script preserves numeric bookmarks
s2 = Gaffer.ScriptNode()
s2.execute( s.serialise() )
self.assertEqual( Gaffer.MetadataAlgo.getNumericBookmark( s2, 1 ), s2["n1"] )
self.assertEqual( Gaffer.MetadataAlgo.getNumericBookmark( s2, 2 ), s2["n2"] )
def testNumericBookmarksInReferences( self ) :
# Numeric bookmarks are removed when loading References.
s = Gaffer.ScriptNode()
s["box"] = Gaffer.Box()
s["box"]["n"] = Gaffer.Node()
Gaffer.MetadataAlgo.setNumericBookmark( s, 1, s["box"]["n"] )
s["box"].exportForReference( self.temporaryDirectory() + "/bookmarked.grf" )
# Bring reference back in
s["r"] = Gaffer.Reference()
s["r"].load( self.temporaryDirectory() + "/bookmarked.grf" )
# Clashing Metadata was completely removed
self.assertEqual( Gaffer.Metadata.value( s["r"]["n"], "numericBookmark1" ), None )
self.assertEqual( Gaffer.MetadataAlgo.numericBookmark( s["r"]["n"] ), 0 )
self.assertEqual( Gaffer.MetadataAlgo.getNumericBookmark( s, 1 ), s["box"]["n"] )
# Even without the clash, the metadata is removed
Gaffer.MetadataAlgo.setNumericBookmark( s, 1, None )
s["r2"] = Gaffer.Reference()
s["r2"].load( self.temporaryDirectory() + "/bookmarked.grf" )
self.assertEqual( Gaffer.Metadata.value( s["r2"]["n"], "numericBookmark1" ), None )
self.assertEqual( Gaffer.MetadataAlgo.numericBookmark( s["r2"]["n"] ), 0 )
self.assertEqual( Gaffer.MetadataAlgo.getNumericBookmark( s, 1 ), None )
def testNumericBookmarksInReadOnlyBox( self ) :
# Numeric bookmarks are removed when loading read-only boxes.
s = Gaffer.ScriptNode()
s["box"] = Gaffer.Box()
s["box"]["n"] = Gaffer.Node()
Gaffer.MetadataAlgo.setNumericBookmark( s, 1, s["box"]["n"] )
s["box"].exportForReference( self.temporaryDirectory() + "/bookmarked.grf" )
# Bring the box back in, not as a Reference, but as read-only Box
s["b1"] = Gaffer.Box()
Gaffer.MetadataAlgo.setChildNodesAreReadOnly( s["b1"], True )
s.executeFile( self.temporaryDirectory() + "/bookmarked.grf", parent = s["b1"], continueOnError = True)
# Clashing Metadata was completely removed
self.assertEqual( Gaffer.Metadata.value( s["b1"]["n"], "numericBookmark1" ), None )
self.assertEqual( Gaffer.MetadataAlgo.numericBookmark( s["b1"]["n"] ), 0 )
self.assertEqual( Gaffer.MetadataAlgo.getNumericBookmark( s, 1 ), s["box"]["n"] )
# Even without the clash, the metadata is removed
Gaffer.MetadataAlgo.setNumericBookmark( s, 1, None )
s["b2"] = Gaffer.Box()
Gaffer.MetadataAlgo.setChildNodesAreReadOnly( s["b2"], True )
s.executeFile( self.temporaryDirectory() + "/bookmarked.grf", parent = s["b2"], continueOnError = True)
self.assertEqual( Gaffer.Metadata.value( s["b2"]["n"], "numericBookmark1" ), None )
self.assertEqual( Gaffer.MetadataAlgo.numericBookmark( s["b2"]["n"] ), 0 )
self.assertEqual( Gaffer.MetadataAlgo.getNumericBookmark( s, 1 ), None )
# But loading it without the read-only flag results in the bookmark being set
s["b3"] = Gaffer.Box()
s.executeFile( self.temporaryDirectory() + "/bookmarked.grf", parent = s["b3"], continueOnError = True)
self.assertEqual( Gaffer.Metadata.value( s["b3"]["n"], "numericBookmark1" ), True )
self.assertEqual( Gaffer.MetadataAlgo.numericBookmark( s["b3"]["n"] ), 1 )
self.assertEqual( Gaffer.MetadataAlgo.getNumericBookmark( s, 1 ), s["b3"]["n"] )
def testNumericBookmarkAffectedByChange( self ) :
# The naming convention for valid numeric bookmarks is "numericBookmark<1-9>"
for i in range( 1, 10 ) :
self.assertTrue( Gaffer.MetadataAlgo.numericBookmarkAffectedByChange( "numericBookmark%s" % i ) )
self.assertFalse( Gaffer.MetadataAlgo.numericBookmarkAffectedByChange( "numericBookmark0" ) )
self.assertFalse( Gaffer.MetadataAlgo.numericBookmarkAffectedByChange( "numericBookmark-1" ) )
self.assertFalse( Gaffer.MetadataAlgo.numericBookmarkAffectedByChange( "numericBookmark10" ) )
self.assertFalse( Gaffer.MetadataAlgo.numericBookmarkAffectedByChange( "foo" ) )
def testAffectedByPlugTypeRegistration( self ) :
n = GafferTest.CompoundPlugNode()
self.assertTrue( Gaffer.MetadataAlgo.affectedByChange( n["p"]["s"], Gaffer.StringPlug, changedPlugPath = "", changedPlug = None ) )
self.assertFalse( Gaffer.MetadataAlgo.affectedByChange( n["p"]["s"], Gaffer.IntPlug, changedPlugPath = "", changedPlug = None ) )
self.assertTrue( Gaffer.MetadataAlgo.affectedByChange( n["p"], Gaffer.Plug, changedPlugPath = "", changedPlug = None ) )
self.assertTrue( Gaffer.MetadataAlgo.childAffectedByChange( n["p"], Gaffer.StringPlug, changedPlugPath = "", changedPlug = None ) )
self.assertTrue( Gaffer.MetadataAlgo.childAffectedByChange( n["p"], Gaffer.FloatPlug, changedPlugPath = "", changedPlug = None ) )
self.assertFalse( Gaffer.MetadataAlgo.childAffectedByChange( n["p"], Gaffer.IntPlug, changedPlugPath = "", changedPlug = None ) )
self.assertFalse( Gaffer.MetadataAlgo.childAffectedByChange( n["p"]["s"], Gaffer.StringPlug, changedPlugPath = "", changedPlug = None ) )
self.assertFalse( Gaffer.MetadataAlgo.ancestorAffectedByChange( n["p"], Gaffer.CompoundPlug, changedPlugPath = "", changedPlug = None ) )
self.assertTrue( Gaffer.MetadataAlgo.ancestorAffectedByChange( n["p"]["s"], Gaffer.CompoundPlug, changedPlugPath = "", changedPlug = None ) )
self.assertTrue( Gaffer.MetadataAlgo.ancestorAffectedByChange( n["p"]["s"], Gaffer.Plug, changedPlugPath = "", changedPlug = None ) )
self.assertFalse( Gaffer.MetadataAlgo.ancestorAffectedByChange( n["p"]["s"], Gaffer.StringPlug, changedPlugPath = "", changedPlug = None ) )
def testAffectedByPlugRelativeMetadata( self ) :
n = GafferTest.CompoundNumericNode()
self.assertTrue( Gaffer.MetadataAlgo.affectedByChange( n["p"]["x"], Gaffer.V3fPlug, changedPlugPath = "*", changedPlug = None ) )
self.assertTrue( Gaffer.MetadataAlgo.affectedByChange( n["p"]["x"], Gaffer.V3fPlug, changedPlugPath = "[xyz]", changedPlug = None ) )
self.assertTrue( Gaffer.MetadataAlgo.affectedByChange( n["p"]["x"], Gaffer.V3fPlug, changedPlugPath = "...", changedPlug = None ) )
self.assertFalse( Gaffer.MetadataAlgo.affectedByChange( n["p"]["x"], Gaffer.V3fPlug, changedPlugPath = "x.c", changedPlug = None ) )
self.assertFalse( Gaffer.MetadataAlgo.affectedByChange( n["p"]["x"], Gaffer.V3fPlug, changedPlugPath = "c", changedPlug = None ) )
self.assertTrue( Gaffer.MetadataAlgo.childAffectedByChange( n["p"], Gaffer.V3fPlug, changedPlugPath = "[xyz]", changedPlug = None ) )
self.assertFalse( Gaffer.MetadataAlgo.childAffectedByChange( n["p"], Gaffer.V3fPlug, changedPlugPath = "x.c", changedPlug = None ) )
def testAnnotations( self ) :
n = Gaffer.Node()
self.assertEqual( Gaffer.MetadataAlgo.annotations( n ), [] )
self.assertIsNone( Gaffer.MetadataAlgo.getAnnotation( n, "test" ) )
cs = GafferTest.CapturingSlot( Gaffer.Metadata.nodeValueChangedSignal( n ) )
Gaffer.MetadataAlgo.addAnnotation( n, "test", Gaffer.MetadataAlgo.Annotation( "Hello world", imath.Color3f( 1, 0, 0 ) ) )
self.assertTrue( len( cs ) )
for x in cs :
self.assertTrue( Gaffer.MetadataAlgo.annotationsAffectedByChange( x[1] ) )
self.assertEqual( Gaffer.MetadataAlgo.annotations( n ), [ "test" ] )
self.assertEqual(
Gaffer.MetadataAlgo.getAnnotation( n, "test" ),
Gaffer.MetadataAlgo.Annotation( "Hello world", imath.Color3f( 1, 0, 0 ) )
)
del cs[:]
Gaffer.MetadataAlgo.addAnnotation( n, "test2", Gaffer.MetadataAlgo.Annotation( "abc", imath.Color3f( 0, 1, 0 ) ) )
self.assertTrue( len( cs ) )
for x in cs :
self.assertTrue( Gaffer.MetadataAlgo.annotationsAffectedByChange( x[1] ) )
self.assertEqual( Gaffer.MetadataAlgo.annotations( n ), [ "test", "test2" ] )
self.assertEqual(
Gaffer.MetadataAlgo.getAnnotation( n, "test2" ),
Gaffer.MetadataAlgo.Annotation( "abc", imath.Color3f( 0, 1, 0 ) )
)
del cs[:]
Gaffer.MetadataAlgo.removeAnnotation( n, "test" )
self.assertTrue( len( cs ) )
for x in cs :
self.assertTrue( Gaffer.MetadataAlgo.annotationsAffectedByChange( x[1] ) )
self.assertEqual( Gaffer.MetadataAlgo.annotations( n ), [ "test2" ] )
self.assertIsNone( Gaffer.MetadataAlgo.getAnnotation( n, "test" ) )
self.assertEqual(
Gaffer.MetadataAlgo.getAnnotation( n, "test2" ),
Gaffer.MetadataAlgo.Annotation( "abc", imath.Color3f( 0, 1, 0 ) )
)
def testAnnotationWithoutColor( self ) :
n = Gaffer.Node()
Gaffer.MetadataAlgo.addAnnotation( n, "test", Gaffer.MetadataAlgo.Annotation( text = "abc" ) )
self.assertEqual( len( Gaffer.Metadata.registeredValues( n, instanceOnly = True ) ), 1 )
self.assertEqual(
Gaffer.MetadataAlgo.getAnnotation( n, "test" ),
Gaffer.MetadataAlgo.Annotation( text = "abc" )
)
Gaffer.MetadataAlgo.addAnnotation( n, "test", Gaffer.MetadataAlgo.Annotation( text = "xyz", color = imath.Color3f( 1 ) ) )
self.assertEqual( len( Gaffer.Metadata.registeredValues( n, instanceOnly = True ) ), 2 )
self.assertEqual(
Gaffer.MetadataAlgo.getAnnotation( n, "test" ),
Gaffer.MetadataAlgo.Annotation( text = "xyz", color = imath.Color3f( 1 ) )
)
Gaffer.MetadataAlgo.addAnnotation( n, "test", Gaffer.MetadataAlgo.Annotation( text = "abc" ) )
self.assertEqual( len( Gaffer.Metadata.registeredValues( n, instanceOnly = True ) ), 1 )
self.assertEqual(
Gaffer.MetadataAlgo.getAnnotation( n, "test" ),
Gaffer.MetadataAlgo.Annotation( text = "abc" )
)
def testAnnotationToBool( self ) :
self.assertFalse( Gaffer.MetadataAlgo.Annotation() )
self.assertTrue( Gaffer.MetadataAlgo.Annotation( "test" ) )
def testAnnotationTemplates( self ) :
defaultTemplates = Gaffer.MetadataAlgo.annotationTemplates()
self.assertIsNone( Gaffer.MetadataAlgo.getAnnotationTemplate( "test" ) )
a = Gaffer.MetadataAlgo.Annotation( "", imath.Color3f( 1, 0, 0 ) )
Gaffer.MetadataAlgo.addAnnotationTemplate( "test", a )
self.assertEqual( Gaffer.MetadataAlgo.getAnnotationTemplate( "test" ), a )
self.assertEqual( Gaffer.MetadataAlgo.annotationTemplates(), defaultTemplates + [ "test" ] )
n = Gaffer.Node()
Gaffer.MetadataAlgo.addAnnotation( n, "test", Gaffer.MetadataAlgo.Annotation( "hi" ) )
self.assertEqual(
Gaffer.MetadataAlgo.getAnnotation( n, "test" ),
Gaffer.MetadataAlgo.Annotation( "hi" ),
)
self.assertEqual(
Gaffer.MetadataAlgo.getAnnotation( n, "test", inheritTemplate = True ),
Gaffer.MetadataAlgo.Annotation( "hi", imath.Color3f( 1, 0, 0 ) ),
)
Gaffer.MetadataAlgo.removeAnnotationTemplate( "test" )
self.assertIsNone( Gaffer.MetadataAlgo.getAnnotationTemplate( "test" ) )
self.assertEqual( Gaffer.MetadataAlgo.annotationTemplates(), defaultTemplates )
self.assertEqual(
Gaffer.MetadataAlgo.getAnnotation( n, "test" ),
Gaffer.MetadataAlgo.Annotation( "hi" ),
)
self.assertEqual(
Gaffer.MetadataAlgo.getAnnotation( n, "test", inheritTemplate = True ),
Gaffer.MetadataAlgo.Annotation( "hi" ),
)
def testNonUserAnnotationTemplates( self ) :
defaultTemplates = Gaffer.MetadataAlgo.annotationTemplates()
userOnlyDefaultTemplates = Gaffer.MetadataAlgo.annotationTemplates( userOnly = True )
a = Gaffer.MetadataAlgo.Annotation( "", imath.Color3f( 1, 0, 0 ) )
Gaffer.MetadataAlgo.addAnnotationTemplate( "test", a, user = False )
self.assertEqual( Gaffer.MetadataAlgo.annotationTemplates(), defaultTemplates + [ "test" ] )
self.assertEqual( Gaffer.MetadataAlgo.annotationTemplates( userOnly = True ), userOnlyDefaultTemplates )
Gaffer.MetadataAlgo.addAnnotationTemplate( "test2", a, user = True )
self.assertEqual( Gaffer.MetadataAlgo.annotationTemplates(), defaultTemplates + [ "test", "test2" ] )
self.assertEqual( Gaffer.MetadataAlgo.annotationTemplates( userOnly = True ), userOnlyDefaultTemplates + [ "test2" ] )
def tearDown( self ) :
for n in ( Gaffer.Node, Gaffer.Box, GafferTest.AddNode ) :
Gaffer.Metadata.deregisterValue( n, "metadataAlgoTest" )
if __name__ == "__main__":
unittest.main()
| {
"content_hash": "881957d2d5c33bfdc68af52af36b4ea1",
"timestamp": "",
"source": "github",
"line_count": 756,
"max_line_length": 143,
"avg_line_length": 41.72486772486773,
"alnum_prop": 0.704349480091301,
"repo_name": "GafferHQ/gaffer",
"id": "ead9a77675e5c70bb5db07b9a3f60a839bcce5f5",
"size": "33347",
"binary": false,
"copies": "3",
"ref": "refs/heads/main",
"path": "python/GafferTest/MetadataAlgoTest.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "5790"
},
{
"name": "C",
"bytes": "61993"
},
{
"name": "C++",
"bytes": "9572701"
},
{
"name": "CMake",
"bytes": "85201"
},
{
"name": "GLSL",
"bytes": "6208"
},
{
"name": "Python",
"bytes": "10280178"
},
{
"name": "Ruby",
"bytes": "419"
},
{
"name": "Shell",
"bytes": "14580"
}
],
"symlink_target": ""
} |
@implementation BHBlockTableStaticSectionCellDef
@end
| {
"content_hash": "4c26f190cb053c396023ccf44cee736a",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 48,
"avg_line_length": 18.333333333333332,
"alnum_prop": 0.8909090909090909,
"repo_name": "eorygen/sema2_ios",
"id": "253654c77ce512176bc92c624da5472f97fa2326",
"size": "257",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/ThirdPartyLibs/BHBlockTable/BHBlockTableStaticSectionCellDef.m",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "282"
},
{
"name": "Objective-C",
"bytes": "209863"
},
{
"name": "Ruby",
"bytes": "629"
}
],
"symlink_target": ""
} |
package gowd
import (
"fmt"
)
//ExecJS executes JS code after a DOM update from gowd
func ExecJS(js string) {
execJSBuffer = append(execJSBuffer, js)
}
//ExecJSNow Executes JS code in NWJS without waiting for a DOM update to be finished.
func ExecJSNow(js string) {
fmt.Fprintf(Output, "$%v\n", stripchars(js, '\r', '\n'))
}
//Alert calls javascript alert now
func Alert(text string) {
ExecJSNow(fmt.Sprintf(`alert("%v");`, text))
}
| {
"content_hash": "10dc6c7290c7171c163e342d8ed40430",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 85,
"avg_line_length": 22.05,
"alnum_prop": 0.7029478458049887,
"repo_name": "dtylman/gowd",
"id": "9450e09d0f18fe5053af93a87c040dabda301a93",
"size": "441",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "js.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "49510"
},
{
"name": "HTML",
"bytes": "1931"
},
{
"name": "JavaScript",
"bytes": "8830"
}
],
"symlink_target": ""
} |
'use strict';
import React, { Component } from 'react';
import {
View,
ScrollView,
Text,
} from 'react-native';
import { styles } from '../styles';
import { connect } from 'react-redux';
import Question from './Question';
if (global.globalDeviceType == 'iPad') {
var headingSize = 48;
var bodySize = 20;
} else { // iPhone
var headingSize = 24;
var bodySize = 14;
}
const Help = () => (
<View style={styles.container}>
<ScrollView style={{margin: 20}} >
<Text style={{ fontSize: headingSize }}>Frequently Asked Questions</Text>
<Question
question="How do I delete an image?"
answer="Double tap an image to delete it."/>
<Question
question="How do I create a sentence for an image?"
answer="Tap on an image for the option to create a new sentence for it."/>
<Question
question="How do I add a word to my sentence?"
answer="Click on a card category to add an empty card to the end of the sentence. Then click the empty card to choose a word."/>
<Question
question="How do I delete a word that I added to the sentence?"
answer="Double tap the word to delete it."/>
<Question
question="How do I rearrange words in the sentence?"
answer="Long press a word in the sentence to move the word."/>
</ScrollView>
</View>
)
/* Container Component */
const mapDispatchToProps = (dispatch) => {
return {}
}
const mapStateToProps = (state) => {
return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(Help) | {
"content_hash": "41b498a3d83902d8ebd5db5aa97b71ef",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 136,
"avg_line_length": 27.732142857142858,
"alnum_prop": 0.6490663232453316,
"repo_name": "DFAxCMU/sentence-mosaics",
"id": "dc7566f4c090d4e8b04974072071116c19846388",
"size": "1553",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SentenceMosaics/app/components/Help.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "1764"
},
{
"name": "JavaScript",
"bytes": "64056"
},
{
"name": "Objective-C",
"bytes": "4443"
},
{
"name": "Python",
"bytes": "1655"
}
],
"symlink_target": ""
} |
package com.netflix.zeno.util.collections.heapfriendly;
import static com.netflix.zeno.util.collections.heapfriendly.HeapFriendlyMapArrayRecycler.INDIVIDUAL_OBJECT_ARRAY_SIZE;
import java.util.AbstractSet;
import java.util.Collection;
import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.Set;
/**
* The HeapFriendlyDerivableKeyHashMap is an open-addressed, linear probing hash table. It uses a single array to hold only the values,
* and assumes that keys are derivable from values. The HeapFriendlyDerivableKeyHashMap may be used to conserve memory.<p/>
*
* HeapFriendlyDerivableKeyHashMap must be extended to override the deriveKey method.<p/>
*
* The key should be derivable from the value without causing any overhead. For example, if K is a field in V, then
* the implementation may be as simple as "return value.getKey();".<p/>
*
* However, if a compound key is required, or if any non-trivial amount of work must be done to derive the key, the
* HeapFriendlyDerivableKeyHashMap may not be appropriate. Instead see {@link HeapFriendlyHashMap}
*
* @author dkoszewnik
*
*/
public abstract class HeapFriendlyDerivableKeyHashMap<K, V> extends AbstractHeapFriendlyMap<K, V> {
private final Object[][] values;
private final int numBuckets;
private final int maxSize;
private final HeapFriendlyMapArrayRecycler recycler;
private int size;
protected HeapFriendlyDerivableKeyHashMap(int numEntries) {
this(numEntries, HeapFriendlyMapArrayRecycler.get());
}
protected HeapFriendlyDerivableKeyHashMap(int numEntries, HeapFriendlyMapArrayRecycler recycler) {
int arraySize = numEntries * 10 / 7; // 70% load factor
arraySize = 1 << (32 - Integer.numberOfLeadingZeros(arraySize)); // next power of 2
arraySize = Math.max(arraySize, INDIVIDUAL_OBJECT_ARRAY_SIZE);
this.numBuckets = arraySize;
this.maxSize = numEntries;
this.recycler = recycler;
values = createSegmentedObjectArray(arraySize);
}
private Object[][] createSegmentedObjectArray(int arraySize) {
int numArrays = arraySize / INDIVIDUAL_OBJECT_ARRAY_SIZE;
Object[][] segmentedArray = new Object[numArrays][];
for(int i=0;i<numArrays;i++) {
segmentedArray[i] = recycler.getObjectArray();
}
return segmentedArray;
}
@SuppressWarnings("unchecked")
public V put(V value) {
if(size == maxSize && !containsKey(deriveKey(value)))
throw new UnsupportedOperationException("Cannot add more elements than " + maxSize);
K key = deriveKey(value);
if(key == null) {
throw new NullPointerException("Null keys not allowed in HeapFriendlyDerivableKeyHashMap");
}
int hashCode = rehash(key.hashCode());
/// numBuckets is a power of 2, so the operation [x & (numBuckets - 1)]
/// is equivalent to [Math.abs(x % numBuckets)]
int bucket = hashCode & (numBuckets - 1);
V foundValue = (V) segmentedGet(values, bucket);
while(foundValue != null && !deriveKey(foundValue).equals(deriveKey(value))) {
bucket = (bucket + 1) & (numBuckets - 1);
foundValue = (V) segmentedGet(values, bucket);
}
segmentedSet(values, bucket, value);
if(foundValue == null)
size++;
return foundValue;
}
@SuppressWarnings("unchecked")
public V get(Object key) {
int hashCode = rehash(key.hashCode());
int bucket = hashCode & (numBuckets - 1);
V foundValue = (V) segmentedGet(values, bucket);
while(foundValue != null) {
if(deriveKey(foundValue).equals(key))
return foundValue;
bucket = (bucket + 1) & (numBuckets - 1);
foundValue = (V) segmentedGet(values, bucket);
}
return null;
}
@Override
public int size() {
return size;
}
@Override
public boolean isEmpty() {
return size == 0;
}
@Override
public boolean containsKey(Object key) {
return get(key) != null;
}
@Override
@SuppressWarnings("unchecked")
public boolean containsValue(Object value) {
if(value == null)
return false;
return get(deriveKey((V)value)) != null;
}
@Override
public void releaseObjectArrays() {
releaseObjectArrays(values, recycler);
}
@Override
public Set<K> keySet() {
return new AbstractSet<K>() {
public Iterator<K> iterator() {
return new HeapFriendlyMapIterator<K>(values, numBuckets) {
@Override
@SuppressWarnings("unchecked")
public K next() {
K key = deriveKey((V) segmentedGet(values, current));
moveToNext();
return key;
}
};
}
@Override
public boolean contains(Object value) {
return containsKey(value);
}
@Override
public int size() {
return size;
}
};
}
@Override
public Collection<V> values() {
return new AbstractSet<V>() {
@Override
public Iterator<V> iterator() {
return new HeapFriendlyMapIterator<V>(values, numBuckets);
}
@Override
public int size() {
return size;
}
};
}
@Override
public Set<Entry<K, V>> entrySet() {
return new AbstractSet<Entry<K, V>>() {
@Override
public Iterator<Entry<K, V>> iterator() {
return new HeapFriendlyMapIterator<Entry<K,V>>(values, numBuckets) {
@Override
@SuppressWarnings("unchecked")
public Entry<K, V> next() {
if(current >= numBuckets)
throw new NoSuchElementException();
Entry<K, V> entry = new DerivableKeyHashMapEntry((V) segmentedGet(segmentedArray, current));
moveToNext();
return entry;
}
};
}
@Override
public int size() {
return size;
}
};
}
/**
* Each implementation of HeapFriendlyDerivableKeyHashMap must be overridden to implement the deriveKey method.
*
* The key should be derivable from the value without causing any overhead. For example, if K is a field in V, then
* the implementation may be as simple as "return value.getKey();".
*
* However, if a compound key is required, or if any non-trivial amount of work must be done to derive the key, the
* HeapFriendlyDerivableKeyHashMap may not be appropriate. Instead see {@link HeapFriendlyHashMap}
*
*/
protected abstract K deriveKey(V value);
@Override
public V put(K key, V value) {
throw new UnsupportedOperationException("VMS error: HeapFriendlyDerivableKeyMap cannot be added to with a specified key. Please use put(V value).");
}
private int rehash(int hash) {
hash = ~hash + (hash << 15);
hash = hash ^ (hash >>> 12);
hash = hash + (hash << 2);
hash = hash ^ (hash >>> 4);
hash = hash * 2057;
hash = hash ^ (hash >>> 16);
return hash;
}
private class DerivableKeyHashMapEntry extends AbstractHeapFriendlyMapEntry<K, V> {
private final V value;
DerivableKeyHashMapEntry(V value) {
this.value = value;
}
@Override
public K getKey() {
return deriveKey(value);
}
@Override
public V getValue() {
return value;
}
}
}
| {
"content_hash": "7c96efdffa70b4f6ccd8efe31c332e28",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 157,
"avg_line_length": 31.4251968503937,
"alnum_prop": 0.5895765472312704,
"repo_name": "Netflix/zeno",
"id": "4945a287a627557f197f181f959b52c7d3cadfbc",
"size": "8621",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/netflix/zeno/util/collections/heapfriendly/HeapFriendlyDerivableKeyHashMap.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "960074"
}
],
"symlink_target": ""
} |
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Web.Hosting;
using Root.Infrastructure.Imaging;
using Root.Web.Extensions;
using Root.Web.Mvc.Models;
namespace Root.RootPosition.Services
{
internal class DescendingComparer : IComparer<string>
{
public int Compare(string x, string y)
{
try
{
return string.Compare(x, y, StringComparison.CurrentCultureIgnoreCase) * -1;
}
catch (Exception)
{
return Comparer.DefaultInvariant.Compare(x, y);
}
}
}
public class GalleryServiceController
{
public static IList<PhotoGalleryModel> GetGalleries(string virtualPath)
{
var physicalPath = HostingEnvironment.MapPath(virtualPath);
var galleries = new SortedList<string, PhotoGalleryModel>(new DescendingComparer());
var dir = new DirectoryInfo(physicalPath);
foreach (var subDir in dir.GetDirectories("????-??-??"))
{
DateTime galleryDate;
DateTime.TryParseExact(subDir.Name, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.None, out galleryDate);
var gallery = new PhotoGalleryModel(virtualPath + "/" + subDir.Name, galleryDate);
galleries.Add(subDir.Name, gallery);
foreach (var file in subDir.GetFiles("*.jpg"))
{
var size = ImageHelper.GetDimensions(file.FullName);
gallery.Photos.Add(new PhotoModel(file.Name, size.Orientation()));
}
}
return galleries.Values;
}
}
}
| {
"content_hash": "5dd21e506936ab3fc96dc6608c547a34",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 134,
"avg_line_length": 34.72549019607843,
"alnum_prop": 0.6007905138339921,
"repo_name": "kolotygin/RootPosition",
"id": "3ff31a8357ba2f3f26a1d559dfbc6c3eef7f72b9",
"size": "1773",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Root.RootPosition/Services/GalleryServiceController.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "213"
},
{
"name": "C#",
"bytes": "154318"
},
{
"name": "CSS",
"bytes": "94915"
},
{
"name": "HTML",
"bytes": "53"
},
{
"name": "JavaScript",
"bytes": "596348"
}
],
"symlink_target": ""
} |
<?php
?>
<hr>
<h4>
Resources:
</h4>
<ul>
<li>
Source code for iPXE images is available at
<a href="http://www.ipxe.org/download" target="_blank">
http://www.ipxe.org/download</a>
<br><br>
</li>
<li>
For general information about using iPXE, please visit the
<a href="http://www.ipxe.org/" target="_blank">
iPXE Project Home Page</a>
<br><br>
</li>
<li>
For Email-based support for iPXE please join
<a href="http://www.ipxe.org/contact" target="_blank">
iPXE Project mailing lists.</a>
<br><br>
</li>
<li>
For real-time online iPXE support via IRC please visit the
<a href="irc://irc.freenode.net/%23ipxe"> #ipxe channel
of irc.freenode.net</a>.
<br><br>
</li>
</ul>
<hr>
<font size="-1">
<br>
Please email <a href="mailto:<?php echo "${webmaster_email}" ?>"><?php echo "${webmaster_email}"?></a>
with questions or comments about this website.
</font>
<br><br>
<hr>
</body>
</html>
| {
"content_hash": "2685587c0e395257b6a0a1cc0f61b3cf",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 106,
"avg_line_length": 21.822222222222223,
"alnum_prop": 0.5977596741344195,
"repo_name": "egraba/vbox_openbsd",
"id": "9ba8e3190a7519b37ba23b2019b2bc2925fcb430",
"size": "1769",
"binary": false,
"copies": "58",
"ref": "refs/heads/master",
"path": "VirtualBox-5.0.0/src/VBox/Devices/PC/ipxe/contrib/rom-o-matic/bottom.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ada",
"bytes": "88714"
},
{
"name": "Assembly",
"bytes": "4303680"
},
{
"name": "AutoIt",
"bytes": "2187"
},
{
"name": "Batchfile",
"bytes": "95534"
},
{
"name": "C",
"bytes": "192632221"
},
{
"name": "C#",
"bytes": "64255"
},
{
"name": "C++",
"bytes": "83842667"
},
{
"name": "CLIPS",
"bytes": "5291"
},
{
"name": "CMake",
"bytes": "6041"
},
{
"name": "CSS",
"bytes": "26756"
},
{
"name": "D",
"bytes": "41844"
},
{
"name": "DIGITAL Command Language",
"bytes": "56579"
},
{
"name": "DTrace",
"bytes": "1466646"
},
{
"name": "GAP",
"bytes": "350327"
},
{
"name": "Groff",
"bytes": "298540"
},
{
"name": "HTML",
"bytes": "467691"
},
{
"name": "IDL",
"bytes": "106734"
},
{
"name": "Java",
"bytes": "261605"
},
{
"name": "JavaScript",
"bytes": "80927"
},
{
"name": "Lex",
"bytes": "25122"
},
{
"name": "Logos",
"bytes": "4941"
},
{
"name": "Makefile",
"bytes": "426902"
},
{
"name": "Module Management System",
"bytes": "2707"
},
{
"name": "NSIS",
"bytes": "177212"
},
{
"name": "Objective-C",
"bytes": "5619792"
},
{
"name": "Objective-C++",
"bytes": "81554"
},
{
"name": "PHP",
"bytes": "58585"
},
{
"name": "Pascal",
"bytes": "69941"
},
{
"name": "Perl",
"bytes": "240063"
},
{
"name": "PowerShell",
"bytes": "10664"
},
{
"name": "Python",
"bytes": "9094160"
},
{
"name": "QMake",
"bytes": "3055"
},
{
"name": "R",
"bytes": "21094"
},
{
"name": "SAS",
"bytes": "1847"
},
{
"name": "Shell",
"bytes": "1460572"
},
{
"name": "SourcePawn",
"bytes": "4139"
},
{
"name": "TypeScript",
"bytes": "142342"
},
{
"name": "Visual Basic",
"bytes": "7161"
},
{
"name": "XSLT",
"bytes": "1034475"
},
{
"name": "Yacc",
"bytes": "22312"
}
],
"symlink_target": ""
} |
Kubernetes
==========
.. toctree::
:maxdepth: 1
:hidden:
Helm <kubernetes-helm.rst>
Native <kubernetes-native.rst>
Kubernetes_ is a popular system for deploying distributed applications on clusters,
particularly in the cloud. You can use Kubernetes to launch Dask workers in the
following two ways:
1. **Helm**:
You can launch a Dask scheduler, several workers, and an optional Jupyter Notebook server
on a Kubernetes easily using Helm_
.. code-block:: bash
helm repo add dask https://helm.dask.org/ # add the Dask Helm chart repository
helm repo update # get latest Helm charts
helm install dask/dask # deploy standard Dask chart
This is a good choice if you want to do the following:
1. Run a managed Dask cluster for a long period of time
2. Also deploy a Jupyter server from which to run code
3. Share the same Dask cluster between many automated services
4. Try out Dask for the first time on a cloud-based system
like Amazon, Google, or Microsoft Azure
(see also our :doc:`Cloud documentation <cloud>`)
.. note::
For more information, see :doc:`Dask and Helm documentation <kubernetes-helm>`.
2. **Native**:
You can quickly deploy Dask workers on Kubernetes
from within a Python script or interactive session using Dask-Kubernetes_
.. code-block:: python
from dask_kubernetes import KubeCluster
cluster = KubeCluster.from_yaml('worker-template.yaml')
cluster.scale(20) # add 20 workers
cluster.adapt() # or create and destroy workers dynamically based on workload
from dask.distributed import Client
client = Client(cluster)
This is a good choice if you want to do the following:
1. Dynamically create a personal and ephemeral deployment for interactive use
2. Allow many individuals the ability to launch their own custom dask deployments,
rather than depend on a centralized system
3. Quickly adapt Dask cluster size to the current workload
.. note::
For more information, see Dask-Kubernetes_ documentation.
You may also want to see the documentation on using
:doc:`Dask with Docker containers <docker>`
to help you manage your software environments on Kubernetes.
.. _Kubernetes: https://kubernetes.io/
.. _Dask-Kubernetes: https://kubernetes.dask.org/
.. _Helm: https://helm.sh/
| {
"content_hash": "65215cbec59ede3805d4be09d8018979",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 93,
"avg_line_length": 35.56521739130435,
"alnum_prop": 0.6943765281173594,
"repo_name": "ContinuumIO/dask",
"id": "2ab9fae15e05f89afb34d6d988e498a2e8f3115d",
"size": "2454",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/source/setup/kubernetes.rst",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "51"
},
{
"name": "Python",
"bytes": "1033885"
},
{
"name": "Shell",
"bytes": "36"
}
],
"symlink_target": ""
} |
package org.jboss.arquillian.container.fabric8.common;
import io.fabric8.api.EnvironmentVariables;
import io.fabric8.utils.Strings;
import io.fabric8.testkit.support.FabricControllerManagerSupport;
import org.jboss.arquillian.container.spi.ConfigurationException;
import org.jboss.arquillian.container.spi.client.container.ContainerConfiguration;
import java.io.File;
import java.util.Arrays;
import java.util.List;
/**
*/
public class Fabric8CommonConfiguration implements ContainerConfiguration {
private String profiles;
private String workFolder;
private String globalResolver;
private String fabricDockerImage;
public static File getBaseDir() {
return new File(System.getProperty("basedir", "."));
}
@Override
public void validate() throws ConfigurationException {
}
/**
* Lets configure the controllerManager with the given configuration
*/
public void configure(FabricControllerManagerSupport controllerManager) {
String profilesText = getProfiles();
String[] profileArrays = null;
if (Strings.isNotBlank(profilesText)) {
profileArrays = profilesText.split(",");
}
if (profileArrays == null || profileArrays.length == 0) {
profileArrays = new String[]{"autoscale"};
}
List<String> profiles = Arrays.asList(profileArrays);
System.out.println("Populating initial fabric node with the profiles: " + profiles);
controllerManager.setProfiles(profiles);
// lets specify the work directory
File baseDir = getBaseDir();
String outputFolder = Strings.defaultIfEmpty(getWorkFolder(), "fabric8");
File workDir = new File(baseDir, "target/" + outputFolder);
System.out.println("Using " + workDir.getPath() + " to store the fabric8 installation");
controllerManager.setWorkDirectory(workDir);
if (Strings.isNotBlank(globalResolver)) {
System.out.println("Using global resolver " + globalResolver);
controllerManager.setEnvironmentVariable(EnvironmentVariables.FABRIC8_GLOBAL_RESOLVER, globalResolver);
}
if (Strings.isNotBlank(fabricDockerImage)) {
System.out.println("Using fabric docker image: " + fabricDockerImage);
controllerManager.setEnvironmentVariable("FABRIC8_DOCKER_IMAGE_FABRIC8", fabricDockerImage);
}
}
public String getProfiles() {
return profiles;
}
public void setProfiles(String profiles) {
this.profiles = profiles;
}
public String getWorkFolder() {
return workFolder;
}
public void setWorkFolder(String workFolder) {
this.workFolder = workFolder;
}
public String getGlobalResolver() {
return globalResolver;
}
public void setGlobalResolver(String globalResolver) {
this.globalResolver = globalResolver;
}
public String getFabricDockerImage() {
return fabricDockerImage;
}
public void setFabricDockerImage(String fabricDockerImage) {
this.fabricDockerImage = fabricDockerImage;
}
}
| {
"content_hash": "c761c2aafedc91aa4acd7d8f354b38c1",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 115,
"avg_line_length": 32.96842105263158,
"alnum_prop": 0.691890166028097,
"repo_name": "rnc/fabric8",
"id": "9974218a23e26c8f1374962879f8ab824e509c34",
"size": "3933",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "sandbox/itests/arquillian/arquillian-fabric8-common/src/main/java/org/jboss/arquillian/container/fabric8/common/Fabric8CommonConfiguration.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "56290"
},
{
"name": "Groff",
"bytes": "78280"
},
{
"name": "HTML",
"bytes": "186433"
},
{
"name": "Java",
"bytes": "11530957"
},
{
"name": "JavaScript",
"bytes": "1909792"
},
{
"name": "Nginx",
"bytes": "1321"
},
{
"name": "Protocol Buffer",
"bytes": "899"
},
{
"name": "Ruby",
"bytes": "4708"
},
{
"name": "Scala",
"bytes": "5260"
},
{
"name": "Shell",
"bytes": "83430"
},
{
"name": "XSLT",
"bytes": "23668"
}
],
"symlink_target": ""
} |
layout: page
title: Dragon Township Motors Dinner
date: 2016-05-24
author: Ann Wilkins
tags: weekly links, java
status: published
summary: Sed id justo a leo.
banner: images/banner/wedding.jpg
booking:
startDate: 08/19/2019
endDate: 08/20/2019
ctyhocn: MBGINHX
groupCode: DTMD
published: true
---
Vivamus a tincidunt leo. Proin ut tellus rhoncus, suscipit lectus vitae, scelerisque tellus. Ut at elementum eros, in efficitur elit. Sed auctor ut justo eget rutrum. Nullam rutrum tortor ut cursus hendrerit. Aliquam erat volutpat. Sed malesuada felis quam, in elementum leo hendrerit id. Vestibulum at accumsan lacus, eget porta libero. Aenean imperdiet a mauris quis pretium. Mauris a facilisis mauris. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Integer fermentum, ex laoreet venenatis euismod, velit orci mattis felis, facilisis accumsan magna mi vitae risus.
* Aenean quis mi et felis posuere lobortis
* Donec quis felis consectetur orci mattis consequat imperdiet ullamcorper magna
* Donec commodo elit vel elit consectetur, sit amet vulputate mauris imperdiet
* Maecenas commodo metus vel ligula porta, eget placerat odio ornare
* Suspendisse semper magna nec tellus aliquam laoreet
* Praesent nec magna interdum, facilisis nunc ac, fermentum ligula.
Quisque vulputate sapien vel cursus rutrum. Mauris hendrerit, purus sit amet finibus dapibus, ipsum orci porttitor metus, et consequat ante diam sit amet sapien. Integer quis dolor efficitur, tincidunt dolor in, aliquam dui. Suspendisse volutpat faucibus placerat. Sed maximus porttitor lacus, at sodales lorem malesuada malesuada. Pellentesque interdum, magna at condimentum placerat, erat turpis ultrices justo, non suscipit magna lorem nec augue. Fusce arcu diam, dictum sed orci tempor, facilisis fermentum enim. Proin eget lorem quis odio aliquam mattis vitae a mi. Etiam vitae nisl ultricies, dignissim augue ut, congue elit. Nullam finibus, sem in dapibus vestibulum, mauris urna elementum quam, in tempor tellus erat elementum risus. Vestibulum nisl metus, facilisis nec iaculis vitae, aliquam tempor augue. Nunc tempus euismod quam, ut egestas nulla eleifend a.
| {
"content_hash": "4556b6ce47403ea2242ec268334dee46",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 870,
"avg_line_length": 87.12,
"alnum_prop": 0.8099173553719008,
"repo_name": "KlishGroup/prose-pogs",
"id": "1644a78c095de765d65077c10d6da12de1244a29",
"size": "2182",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "pogs/M/MBGINHX/DTMD/index.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
/**
* @fileoverview Extensions for vertical blocks in scratch-blocks.
* The following extensions can be used to describe a block in Scratch terms.
* For instance, a block in the operators colour scheme with a number output
* would have the "colours_operators" and "output_number" extensions.
* @author fenichel@google.com (Rachel Fenichel)
*/
'use strict';
goog.provide('Blockly.ScratchBlocks.VerticalExtensions');
goog.require('Blockly.Colours');
goog.require('Blockly.constants');
/**
* Helper function that generates an extension based on a category name.
* The generated function will set primary, secondary, and tertiary colours
* based on the category name.
* @param {String} category The name of the category to set colours for.
* @return {function} An extension function that sets colours based on the given
* category.
*/
Blockly.ScratchBlocks.VerticalExtensions.colourHelper = function(category) {
var colours = Blockly.Colours[category];
if (!(colours && colours.primary && colours.secondary && colours.tertiary)) {
throw new Error('Could not find colours for category "' + category + '"');
}
/**
* Set the primary, secondary, and tertiary colours on this block for the
* given category.
* @this {Blockly.Block}
*/
return function() {
this.setColourFromRawValues_(colours.primary, colours.secondary,
colours.tertiary);
};
};
/**
* Extension to set the colours of a text field, which are all the same.
*/
Blockly.ScratchBlocks.VerticalExtensions.COLOUR_TEXTFIELD = function() {
this.setColourFromRawValues_(Blockly.Colours.textField,
Blockly.Colours.textField, Blockly.Colours.textField);
};
/**
* Extension to make a block fit into a stack of statements, regardless of its
* inputs. That means the block should have a previous connection and a next
* connection and have inline inputs.
* @this {Blockly.Block}
* @readonly
*/
Blockly.ScratchBlocks.VerticalExtensions.SHAPE_STATEMENT = function() {
this.setInputsInline(true);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
};
/**
* Extension to make a block be shaped as a hat block, regardless of its
* inputs. That means the block should have a next connection and have inline
* inputs, but have no previous connection.
* @this {Blockly.Block}
* @readonly
*/
Blockly.ScratchBlocks.VerticalExtensions.SHAPE_HAT = function() {
this.setInputsInline(true);
this.setNextStatement(true, null);
};
/**
* Extension to make a block be shaped as an end block, regardless of its
* inputs. That means the block should have a previous connection and have
* inline inputs, but have no next connection.
* @this {Blockly.Block}
* @readonly
*/
Blockly.ScratchBlocks.VerticalExtensions.SHAPE_END = function() {
this.setInputsInline(true);
this.setPreviousStatement(true, null);
};
/**
* Extension to make represent a number reporter in Scratch-Blocks.
* That means the block has inline inputs, a round output shape, and a 'Number'
* output type.
* @this {Blockly.Block}
* @readonly
*/
Blockly.ScratchBlocks.VerticalExtensions.OUTPUT_NUMBER = function() {
this.setInputsInline(true);
this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);
this.setOutput(true, 'Number');
};
/**
* Extension to make represent a string reporter in Scratch-Blocks.
* That means the block has inline inputs, a round output shape, and a 'String'
* output type.
* @this {Blockly.Block}
* @readonly
*/
Blockly.ScratchBlocks.VerticalExtensions.OUTPUT_STRING = function() {
this.setInputsInline(true);
this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);
this.setOutput(true, 'String');
};
/**
* Extension to make represent a boolean reporter in Scratch-Blocks.
* That means the block has inline inputs, a round output shape, and a 'Boolean'
* output type.
* @this {Blockly.Block}
* @readonly
*/
Blockly.ScratchBlocks.VerticalExtensions.OUTPUT_BOOLEAN = function() {
this.setInputsInline(true);
this.setOutputShape(Blockly.OUTPUT_SHAPE_HEXAGONAL);
this.setOutput(true, 'Boolean');
};
/**
* Mixin to add a context menu for a procedure definition block.
* It adds the "edit" option and removes the "duplicate" option.
* @mixin
* @augments Blockly.Block
* @package
* @readonly
*/
Blockly.ScratchBlocks.VerticalExtensions.PROCEDURE_DEF_CONTEXTMENU = {
/**
* Add the "edit" option and removes the "duplicate" option from the context
* menu.
* @param {!Array.<!Object>} menuOptions List of menu options to edit.
* @this Blockly.Block
*/
customContextMenu: function(menuOptions) {
// Add the edit option at the end.
menuOptions.push(Blockly.Procedures.makeEditOption(this));
// Find the delete option and update its callback to be specific to
// functions.
for (var i = 0, option; option = menuOptions[i]; i++) {
if (option.text == Blockly.Msg.DELETE_BLOCK) {
var input = this.getInput('custom_block');
// this is the root block, not the shadow block.
if (input && input.connection && input.connection.targetBlock()) {
var procCode = input.connection.targetBlock().getProcCode();
} else {
return;
}
var rootBlock = this;
option.callback = function() {
var didDelete = Blockly.Procedures.deleteProcedureDefCallback(
procCode, rootBlock);
if (!didDelete) {
// TODO:(#1151)
alert('To delete a block definition, first remove all uses of the block');
}
};
}
}
// Find and remove the duplicate option
for (var i = 0, option; option = menuOptions[i]; i++) {
if (option.text == Blockly.Msg.DUPLICATE_BLOCK) {
menuOptions.splice(i, 1);
break;
}
}
}
};
/**
* Mixin to add a context menu for a procedure call block.
* It adds the "edit" option and the "define" option.
* @mixin
* @augments Blockly.Block
* @package
* @readonly
*/
Blockly.ScratchBlocks.VerticalExtensions.PROCEDURE_CALL_CONTEXTMENU = {
/**
* Add the "edit" and "go to definition" options to the context menu.
* @param {!Array.<!Object>} menuOptions List of menu options to edit.
* @this Blockly.Block
*/
customContextMenu: function(menuOptions) {
menuOptions.push(Blockly.Procedures.makeEditOption(this));
menuOptions.push(Blockly.Procedures.makeShowDefinitionOption(this));
}
};
/**
* Register all extensions for scratch-blocks.
* @package
*/
Blockly.ScratchBlocks.VerticalExtensions.registerAll = function() {
var categoryNames =
['control', 'data', 'sounds', 'motion', 'looks', 'event', 'sensing',
'pen', 'operators', 'more'];
// Register functions for all category colours.
for (var i = 0; i < categoryNames.length; i++) {
name = categoryNames[i];
Blockly.Extensions.register('colours_' + name,
Blockly.ScratchBlocks.VerticalExtensions.colourHelper(name));
}
// Text fields transcend categories.
Blockly.Extensions.register('colours_textfield',
Blockly.ScratchBlocks.VerticalExtensions.COLOUR_TEXTFIELD);
// Register extensions for common block shapes.
Blockly.Extensions.register('shape_statement',
Blockly.ScratchBlocks.VerticalExtensions.SHAPE_STATEMENT);
Blockly.Extensions.register('shape_hat',
Blockly.ScratchBlocks.VerticalExtensions.SHAPE_HAT);
Blockly.Extensions.register('shape_end',
Blockly.ScratchBlocks.VerticalExtensions.SHAPE_END);
// Output shapes and types are related.
Blockly.Extensions.register('output_number',
Blockly.ScratchBlocks.VerticalExtensions.OUTPUT_NUMBER);
Blockly.Extensions.register('output_string',
Blockly.ScratchBlocks.VerticalExtensions.OUTPUT_STRING);
Blockly.Extensions.register('output_boolean',
Blockly.ScratchBlocks.VerticalExtensions.OUTPUT_BOOLEAN);
// Custom procedures have interesting context menus.
Blockly.Extensions.registerMixin('procedure_def_contextmenu',
Blockly.ScratchBlocks.VerticalExtensions.PROCEDURE_DEF_CONTEXTMENU);
Blockly.Extensions.registerMixin('procedure_call_contextmenu',
Blockly.ScratchBlocks.VerticalExtensions.PROCEDURE_CALL_CONTEXTMENU);
};
Blockly.ScratchBlocks.VerticalExtensions.registerAll();
| {
"content_hash": "40ba134d5fa2f540f8eb7dde94258d07",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 86,
"avg_line_length": 34.554621848739494,
"alnum_prop": 0.711454280155642,
"repo_name": "isabela-angelo/scratch-tangible-blocks",
"id": "4f5ab8c30f685c54d2acff045a86a76b0e00d445",
"size": "8898",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "node_modules/scratch-blocks/gh-pages/playgrounds/blocks_vertical/vertical_extensions.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "2600"
},
{
"name": "CSS",
"bytes": "126624"
},
{
"name": "Emacs Lisp",
"bytes": "2410"
},
{
"name": "HTML",
"bytes": "1386607"
},
{
"name": "JavaScript",
"bytes": "25042017"
},
{
"name": "Python",
"bytes": "137663"
},
{
"name": "Ruby",
"bytes": "607"
},
{
"name": "Shell",
"bytes": "16905"
}
],
"symlink_target": ""
} |
import pytest
from mitmproxy.utils import data
def test_pkg_data():
assert data.pkg_data.path("tools/console")
with pytest.raises(ValueError):
data.pkg_data.path("nonexistent")
| {
"content_hash": "6cf258f78e1368c7e6950831c46b0650",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 46,
"avg_line_length": 24.375,
"alnum_prop": 0.7128205128205128,
"repo_name": "StevenVanAcker/mitmproxy",
"id": "f40fc86657127ed60f5084884502a6bd52c17eca",
"size": "195",
"binary": false,
"copies": "14",
"ref": "refs/heads/master",
"path": "test/mitmproxy/utils/test_data.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "20922"
},
{
"name": "HTML",
"bytes": "8617"
},
{
"name": "JavaScript",
"bytes": "276302"
},
{
"name": "PowerShell",
"bytes": "494"
},
{
"name": "Python",
"bytes": "1657512"
},
{
"name": "Shell",
"bytes": "4644"
}
],
"symlink_target": ""
} |
factorio jetpack mod
awfasdf
| {
"content_hash": "54af4a42e97f64c26eb5b52ba5b5c47b",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 20,
"avg_line_length": 14.5,
"alnum_prop": 0.8620689655172413,
"repo_name": "imajor75/jetpack",
"id": "2c04d64b54a7f4bb38529fb9b01055891caf6696",
"size": "39",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package Paws::CloudSearchDomain::UploadDocuments;
use Moose;
has ContentType => (is => 'ro', isa => 'Str', traits => ['ParamInHeader'], header_name => 'contentType', required => 1);
has Documents => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'documents', required => 1);
use MooseX::ClassAttribute;
class_has _stream_param => (is => 'ro', default => 'Documents');
class_has _api_call => (isa => 'Str', is => 'ro', default => 'UploadDocuments');
class_has _api_uri => (isa => 'Str', is => 'ro', default => '/2013-01-01/documents/batch?format=sdk');
class_has _api_method => (isa => 'Str', is => 'ro', default => 'POST');
class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::CloudSearchDomain::UploadDocumentsResponse');
class_has _result_key => (isa => 'Str', is => 'ro');
1;
### main pod documentation begin ###
=head1 NAME
Paws::CloudSearchDomain::UploadDocuments - Arguments for method UploadDocuments on Paws::CloudSearchDomain
=head1 DESCRIPTION
This class represents the parameters used for calling the method UploadDocuments on the
Amazon CloudSearch Domain service. Use the attributes of this class
as arguments to method UploadDocuments.
You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to UploadDocuments.
As an example:
$service_obj->UploadDocuments(Att1 => $value1, Att2 => $value2, ...);
Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
=head1 ATTRIBUTES
=head2 B<REQUIRED> ContentType => Str
The format of the batch you are uploading. Amazon CloudSearch supports
two document batch formats:
=over
=item * application/json
=item * application/xml
=back
Valid values are: C<"application/json">, C<"application/xml">
=head2 B<REQUIRED> Documents => Str
A batch of documents formatted in JSON or HTML.
=head1 SEE ALSO
This class forms part of L<Paws>, documenting arguments for method UploadDocuments in L<Paws::CloudSearchDomain>
=head1 BUGS and CONTRIBUTIONS
The source code is located here: https://github.com/pplu/aws-sdk-perl
Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues
=cut
| {
"content_hash": "c8ea7d0f0ed3b4a86bcf1ecf1b4f9b25",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 249,
"avg_line_length": 32.916666666666664,
"alnum_prop": 0.7113924050632912,
"repo_name": "ioanrogers/aws-sdk-perl",
"id": "24cba58582791e4b2e653e5712894b7e7edda805",
"size": "2371",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "auto-lib/Paws/CloudSearchDomain/UploadDocuments.pm",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "1292"
},
{
"name": "Perl",
"bytes": "20360380"
},
{
"name": "Perl 6",
"bytes": "99393"
},
{
"name": "Shell",
"bytes": "445"
}
],
"symlink_target": ""
} |
import os
import sys
import uuid
from scrapy.command import ScrapyCommand
from scrapy.utils.conf import arglist_to_dict
from scrapy.exceptions import UsageError
from collections import defaultdict
import json
from scrapy_sci.status import Status, Reader
from scrapy_sci.classifier import ClassifierFactory
class Command(ScrapyCommand):
requires_project = True
def syntax(self):
return "[options] <file_name>"
def short_desc(self):
return "Review file with classifiers"
def add_options(self, parser):
ScrapyCommand.add_options(self, parser)
parser.add_option("-c", "--classifiers", dest="classifiers", action="append", default=[],
help="list classifiers by which the file will be reviewed")
parser.add_option("-r", "--resume", dest="i_no", type="int", default=0,
help="resume review of a file at a given item")
def process_options(self, args, opts):
ScrapyCommand.process_options(self, args, opts)
def run(self, args, opts):
if len(args) < 1:
raise UsageError()
elif len(args) > 1:
raise UsageError("running 'scrapy review' with more than one argument is not supported")
file_name = args[0]
status = Status()
if len(opts.classifiers) == 0: opts.classifiers = status.classifiers.keys() #If all classifiers are to be used
#Setting up classifiers which are possible
valid_classifiers = defaultdict(dict)#Dictionary for currently feasible classifiers only
for classifier_name in status.classifiers.keys():
classifications = []
if status.classifiers[classifier_name]['info']['settings'] and opts.classifiers.count(classifier_name) == 1:
valid_classifiers[classifier_name]['classifications'] = \
sorted(status.classifiers[classifier_name]['classifications'])
#Counting files for valid classifiers
no_files = {}
classifiers = valid_classifiers.keys()
for classifier in valid_classifiers.keys():
reviewed = status.classifiers[classifier]['reviewed']
for classification in list(valid_classifiers[classifier]['classifications']):
no_files[classification] = len([x for x in reviewed if x.find(os.sep + classification) >= 0])
items = Reader.read_unreviewed(file_name)
#Confirmation mode
confirmation_mode = False
conf_input = 3
while conf_input > 2:
try:
conf_input = int(raw_input("1. Keep the same\n2. Turn on confirmation mode"))
except:
print "Wrong input"
if conf_input == 2: confirmation_mode = True
#Review of items
n = opts.i_no
while n < len(items):
print "ITEM {0}/{1}".format(n, len(items))
print no_files
item = items[n]
status.item.review(item)
if n >= opts.i_no:
to_write = {}
for classifier in valid_classifiers.keys():
#Loop to ensure a choice
is_a_choice = False
while is_a_choice == False:
prompt= "Pick classification\n"
choices = {}
i = 0
for classification in valid_classifiers[classifier]['classifications']:
i+=1
choices[i] = classification
prompt+= "{0}. {1}\t".format(i, classification)
if i % 3 == 0: prompt += "\n"
try:
choice = int(raw_input(prompt))
except:
print "Wrong input"
if choices.has_key(choice): is_a_choice = True
to_write[classifier] = choices[choice]
confirmed = True
if confirmation_mode:
confirmed = False
print "Choices: {0}".format("\t".join(to_write[classifier] for classifier in to_write.keys()))
try:
choice = int(raw_input("1. Confirm \n 2. Reclassify"))
except:
print "Wrong input"
if choice == 1: confirmed = True
if confirmed:
for classifier in to_write.keys():
classifications
classifier_dir = os.path.join(status.data_dir, classifier)
no_files[to_write[classifier]]+=1
new_f_name = "{0}0{1}.json".format(to_write[classifier], no_files[to_write[classifier]])
with open(os.path.join(classifier_dir, new_f_name), "wb") as new_f:
new_f.write(json.dumps(item))
item['classifications'] = to_write
with open(os.path.join(status.to_upload_dir, "{0}.json".format(str(uuid.uuid4()))), "wb") as upload_f:
upload_f.write(json.dumps(item))
n+=1
if n == len(items): sys.exit() | {
"content_hash": "e0e04152f923616491fa2ff03499efcd",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 122,
"avg_line_length": 46.80530973451327,
"alnum_prop": 0.5354509359047079,
"repo_name": "dangra/scrapy-sci",
"id": "ce71d5152d88cef2c54194589d8f0f01bb381c72",
"size": "5289",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "scrapy_sci/commands/review.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
class LinkType {
bool used = false;
public:
void setUsed() {used = true;}
bool isUsed() {return used;}
virtual int getIfacesSupported() = 0;
virtual void writeIncludes(std::ostream& str) = 0;
virtual void writeTypeInit(std::ostream& str) = 0;
virtual void writeLinkInit(std::ostream& str, std::shared_ptr<yntdl::Link> linkPtr) = 0;
virtual void addIfacesToLink(std::ostream& str, std::shared_ptr<yntdl::Link> linkPtr) = 0;
virtual void writeClosingRemarks(std::ostream& str) = 0;
};
#endif | {
"content_hash": "c9a592fe47d2f09cbd1823f0aa6c75d0",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 94,
"avg_line_length": 35.13333333333333,
"alnum_prop": 0.681214421252372,
"repo_name": "buzz66boy/NS-3_LXC",
"id": "b8dc32358430e39af0a5389c3075f802448836a0",
"size": "684",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/links/include/linkType.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "75938"
},
{
"name": "CMake",
"bytes": "2978"
},
{
"name": "Shell",
"bytes": "312"
}
],
"symlink_target": ""
} |
/**
* @typedef {object} Phaser.Types.Animations.GenerateFrameNumbers
* @since 3.0.0
*
* @property {number} [start=0] - The starting frame of the animation.
* @property {number} [end=-1] - The ending frame of the animation.
* @property {(boolean|number)} [first=false] - A frame to put at the beginning of the animation, before `start` or `outputArray` or `frames`.
* @property {Phaser.Types.Animations.AnimationFrame[]} [outputArray=[]] - An array to concatenate the output onto.
* @property {(boolean|number[])} [frames=false] - A custom sequence of frames.
*/
| {
"content_hash": "27a3e2bd4c584fe5c5ba6d3d91b7950d",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 142,
"avg_line_length": 57.1,
"alnum_prop": 0.7040280210157618,
"repo_name": "photonstorm/phaser",
"id": "e5d8b6a27c11c44e11daaa1d7f5956eccf8b8f92",
"size": "571",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/animations/typedefs/GenerateFrameNumbers.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "GLSL",
"bytes": "12475"
},
{
"name": "JavaScript",
"bytes": "9073671"
},
{
"name": "TypeScript",
"bytes": "25601"
}
],
"symlink_target": ""
} |
package org.apache.camel.component.aws2.msk;
import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.Endpoint;
import org.apache.camel.spi.Metadata;
import org.apache.camel.spi.annotations.Component;
import org.apache.camel.support.DefaultComponent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* For working with Amazon MSK SDK v2.
*/
@Component("aws2-msk")
public class MSK2Component extends DefaultComponent {
private static final Logger LOG = LoggerFactory.getLogger(MSK2Component.class);
@Metadata
private MSK2Configuration configuration = new MSK2Configuration();
public MSK2Component() {
this(null);
}
public MSK2Component(CamelContext context) {
super(context);
registerExtension(new MSK2ComponentVerifierExtension());
}
@Override
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
MSK2Configuration configuration = this.configuration != null ? this.configuration.copy() : new MSK2Configuration();
MSK2Endpoint endpoint = new MSK2Endpoint(uri, this, configuration);
setProperties(endpoint, parameters);
if (configuration.getMskClient() == null
&& (configuration.getAccessKey() == null || configuration.getSecretKey() == null)) {
throw new IllegalArgumentException("Amazon msk client or accessKey and secretKey must be specified");
}
return endpoint;
}
public MSK2Configuration getConfiguration() {
return configuration;
}
/**
* Component configuration
*/
public void setConfiguration(MSK2Configuration configuration) {
this.configuration = configuration;
}
}
| {
"content_hash": "9b1d61095c6f84222a28943169c2f2e7",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 123,
"avg_line_length": 31.140350877192983,
"alnum_prop": 0.7115492957746479,
"repo_name": "gnodet/camel",
"id": "a7fd84654a4cbeb786043d1e9e74344d51eba9b1",
"size": "2577",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "components/camel-aws2-msk/src/main/java/org/apache/camel/component/aws2/msk/MSK2Component.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Apex",
"bytes": "6521"
},
{
"name": "Batchfile",
"bytes": "2353"
},
{
"name": "CSS",
"bytes": "5472"
},
{
"name": "Dockerfile",
"bytes": "5462"
},
{
"name": "Elm",
"bytes": "10852"
},
{
"name": "FreeMarker",
"bytes": "8015"
},
{
"name": "Groovy",
"bytes": "25954"
},
{
"name": "HTML",
"bytes": "205030"
},
{
"name": "Java",
"bytes": "106323474"
},
{
"name": "JavaScript",
"bytes": "101298"
},
{
"name": "Jsonnet",
"bytes": "1734"
},
{
"name": "RobotFramework",
"bytes": "8461"
},
{
"name": "Ruby",
"bytes": "88"
},
{
"name": "Shell",
"bytes": "16564"
},
{
"name": "Tcl",
"bytes": "4974"
},
{
"name": "Thrift",
"bytes": "6979"
},
{
"name": "XQuery",
"bytes": "546"
},
{
"name": "XSLT",
"bytes": "280836"
}
],
"symlink_target": ""
} |
package com.stratio.cassandra.lucene.column
import com.google.common.base.MoreObjects.toStringHelper
/** An immutable sorted list of CQL3 logic [[Column]]s.
*
* @param columns the [[Column]]s composing this
* @author Andres de la Pena `adelapena@stratio.com`
*/
@scala.annotation.varargs
case class Columns(private val columns: List[Column]) extends Traversable[Column] {
/** @constructor create a new empty columns. */
def this() = this(Nil)
/** @inheritdoc */
override def isEmpty: Boolean = columns.isEmpty
/** @inheritdoc */
override def foreach[A](f: Column => A): Unit = columns.foreach(f)
/** Returns a copy of this with the specified column prepended in O(1) time. */
def ::(column: Column): Columns = new Columns(column :: columns)
/** Returns a copy of this with the specified column appended in O(n) time. */
def +(column: Column): Columns = new Columns(columns :+ column)
/** Returns a copy of this with the specified columns appended. */
def ++(columns: Columns): Columns = new Columns(this.columns ++ columns)
/** Returns the value of the first column with the specifed mapper name. */
def valueForField(field: String): Any = columns.find(_.field == field).flatMap(_.value).orNull
/** Runs the specified function over each column with the specified field name. */
def foreachWithMapper[A](field: String)(f: Column => A): Unit = {
val mapper = Column.parseMapperName(field)
columns.foreach(column => if (column.mapper == mapper) f(column))
}
/** Returns a copy of this with the specified column appended. */
def add(cell: String): Columns = this + Column(cell)
/** Returns a copy of this with the specified column appended. */
def add(cell: String, value: Any): Columns = this + Column(cell, value = Option(value))
/** @inheritdoc */
override def toString: String = (toStringHelper(this) /: columns) ((helper, column) =>
helper.add(column.field, column.value)).toString
}
/** Companion object for [[Columns]]. */
object Columns {
/** An empty columns. */
val empty: Columns = new Columns
/** Returns a new empty columns. */
def apply: Columns = empty
/** Returns a new [[Columns]] composed by the specified [[Column]]s. */
def apply(columns: Traversable[Column]): Columns = new Columns(columns.toList)
/** Returns a new [[Columns]] composed by the specified [[Column]]s. */
def apply(columns: Column*): Columns = new Columns(columns.toList)
}
| {
"content_hash": "afadab898742ac3a14e978d75e2652bc",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 96,
"avg_line_length": 36.161764705882355,
"alnum_prop": 0.6880845872305815,
"repo_name": "adelapena/cassandra-lucene-index",
"id": "10edeb49c7d267c1bc39645a5b4d60fa7de5ce37",
"size": "3078",
"binary": false,
"copies": "2",
"ref": "refs/heads/branch-3.0.5",
"path": "plugin/src/main/scala/com/stratio/cassandra/lucene/column/Columns.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package org.apache.activemq.artemis.jms.client;
import javax.jms.InvalidDestinationException;
import javax.jms.InvalidSelectorException;
import javax.jms.JMSException;
import javax.jms.JMSSecurityException;
import org.apache.activemq.artemis.api.core.ActiveMQException;
public final class JMSExceptionHelper
{
public static JMSException convertFromActiveMQException(final ActiveMQException me)
{
JMSException je;
switch (me.getType())
{
case CONNECTION_TIMEDOUT:
je = new JMSException(me.getMessage());
break;
case ILLEGAL_STATE:
je = new javax.jms.IllegalStateException(me.getMessage());
break;
case INTERNAL_ERROR:
je = new JMSException(me.getMessage());
break;
case INVALID_FILTER_EXPRESSION:
je = new InvalidSelectorException(me.getMessage());
break;
case NOT_CONNECTED:
je = new JMSException(me.getMessage());
break;
case OBJECT_CLOSED:
je = new javax.jms.IllegalStateException(me.getMessage());
break;
case QUEUE_DOES_NOT_EXIST:
je = new InvalidDestinationException(me.getMessage());
break;
case QUEUE_EXISTS:
je = new InvalidDestinationException(me.getMessage());
break;
case SECURITY_EXCEPTION:
je = new JMSSecurityException(me.getMessage());
break;
case UNSUPPORTED_PACKET:
je = new javax.jms.IllegalStateException(me.getMessage());
break;
case TRANSACTION_ROLLED_BACK:
je = new javax.jms.TransactionRolledBackException(me.getMessage());
break;
default:
je = new JMSException(me.getMessage());
}
je.setStackTrace(me.getStackTrace());
je.initCause(me);
return je;
}
}
| {
"content_hash": "1a26b062107d3501a0d9d33abbc9fc4b",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 86,
"avg_line_length": 26.438356164383563,
"alnum_prop": 0.6098445595854922,
"repo_name": "ryanemerson/activemq-artemis",
"id": "ae85f56d83ce618f01f9f10c2a2c3bdbfcbe0bb3",
"size": "2729",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/JMSExceptionHelper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5879"
},
{
"name": "C",
"bytes": "2088"
},
{
"name": "C++",
"bytes": "39402"
},
{
"name": "CSS",
"bytes": "17993"
},
{
"name": "HTML",
"bytes": "657633"
},
{
"name": "Java",
"bytes": "23949283"
},
{
"name": "JavaScript",
"bytes": "31054"
},
{
"name": "Python",
"bytes": "3626"
},
{
"name": "Ruby",
"bytes": "3412"
},
{
"name": "Shell",
"bytes": "11252"
}
],
"symlink_target": ""
} |
package seev
import (
"encoding/xml"
"github.com/fgrid/iso20022"
)
type Document04100101 struct {
XMLName xml.Name `xml:"urn:iso:std:iso:20022:tech:xsd:seev.041.001.01 Document"`
Message *CorporateActionInstructionCancellationRequestStatusAdviceV01 `xml:"CorpActnInstrCxlReqStsAdvc"`
}
func (d *Document04100101) AddMessage() *CorporateActionInstructionCancellationRequestStatusAdviceV01 {
d.Message = new(CorporateActionInstructionCancellationRequestStatusAdviceV01)
return d.Message
}
// Scope
// An account servicer sends the CorporateActionInstructionCancellationRequestStatusAdvice message to an account owner or its designated agent to report status of a previously received CorporateActionInstructionCancellationRequest message sent by the account owner.
// This will include the acknowledgement/rejection of a request to cancel an outstanding instruction.
// Usage
// The message may also be used to:
// - re-send a message previously sent (the sub-function of the message is Duplicate),
// - provide a third party with a copy of a message for information (the sub-function of the message is Copy),
// - re-send to a third party a copy of a message for information (the sub-function of the message is Copy Duplicate).
// ISO 15022 - 20022 COEXISTENCE
// This ISO 20022 message is reversed engineered from ISO 15022. Both standards will coexist for a certain number of years. Until this coexistence period ends, the usage of certain data types is restricted to ensure interoperability between ISO 15022 and 20022 users. Compliance to these rules is mandatory in a coexistence environment. The coexistence restrictions are described in a Textual Rule linked to the Message Items they concern. These coexistence textual rules are clearly identified as follows: “CoexistenceXxxxRule”.
type CorporateActionInstructionCancellationRequestStatusAdviceV01 struct {
// Information that unambiguously identifies a CorporateActionInstructionCancellationRequestStatusAdvice message as know by the account servicer.
Identification *iso20022.DocumentIdentification11 `xml:"Id"`
// Identification of a related instruction cancellation request document.
InstructionCancellationRequestIdentification *iso20022.DocumentIdentification9 `xml:"InstrCxlReqId,omitempty"`
// Identification of other documents as well as the document number.
OtherDocumentIdentification []*iso20022.DocumentIdentification14 `xml:"OthrDocId,omitempty"`
// General information about the corporate action event.
CorporateActionGeneralInformation *iso20022.CorporateActionGeneralInformation9 `xml:"CorpActnGnlInf"`
// Provides information about the processing status of the instruction cancellation request.
InstructionCancellationRequestStatus []*iso20022.InstructionCancellationRequestStatus1Choice `xml:"InstrCxlReqSts"`
// Information about the corporate action option.
CorporateActionInstruction *iso20022.CorporateActionOption9 `xml:"CorpActnInstr,omitempty"`
// Provides additional information.
AdditionalInformation *iso20022.CorporateActionNarrative10 `xml:"AddtlInf,omitempty"`
// Party that originated the message, if other than the sender.
MessageOriginator *iso20022.PartyIdentification10Choice `xml:"MsgOrgtr,omitempty"`
// Party that is the final destination of the message, if other than the receiver.
MessageRecipient *iso20022.PartyIdentification10Choice `xml:"MsgRcpt,omitempty"`
// Additional information that can not be captured in the structured fields and/or any other specific block.
Extension []*iso20022.Extension2 `xml:"Xtnsn,omitempty"`
}
func (c *CorporateActionInstructionCancellationRequestStatusAdviceV01) AddIdentification() *iso20022.DocumentIdentification11 {
c.Identification = new(iso20022.DocumentIdentification11)
return c.Identification
}
func (c *CorporateActionInstructionCancellationRequestStatusAdviceV01) AddInstructionCancellationRequestIdentification() *iso20022.DocumentIdentification9 {
c.InstructionCancellationRequestIdentification = new(iso20022.DocumentIdentification9)
return c.InstructionCancellationRequestIdentification
}
func (c *CorporateActionInstructionCancellationRequestStatusAdviceV01) AddOtherDocumentIdentification() *iso20022.DocumentIdentification14 {
newValue := new(iso20022.DocumentIdentification14)
c.OtherDocumentIdentification = append(c.OtherDocumentIdentification, newValue)
return newValue
}
func (c *CorporateActionInstructionCancellationRequestStatusAdviceV01) AddCorporateActionGeneralInformation() *iso20022.CorporateActionGeneralInformation9 {
c.CorporateActionGeneralInformation = new(iso20022.CorporateActionGeneralInformation9)
return c.CorporateActionGeneralInformation
}
func (c *CorporateActionInstructionCancellationRequestStatusAdviceV01) AddInstructionCancellationRequestStatus() *iso20022.InstructionCancellationRequestStatus1Choice {
newValue := new(iso20022.InstructionCancellationRequestStatus1Choice)
c.InstructionCancellationRequestStatus = append(c.InstructionCancellationRequestStatus, newValue)
return newValue
}
func (c *CorporateActionInstructionCancellationRequestStatusAdviceV01) AddCorporateActionInstruction() *iso20022.CorporateActionOption9 {
c.CorporateActionInstruction = new(iso20022.CorporateActionOption9)
return c.CorporateActionInstruction
}
func (c *CorporateActionInstructionCancellationRequestStatusAdviceV01) AddAdditionalInformation() *iso20022.CorporateActionNarrative10 {
c.AdditionalInformation = new(iso20022.CorporateActionNarrative10)
return c.AdditionalInformation
}
func (c *CorporateActionInstructionCancellationRequestStatusAdviceV01) AddMessageOriginator() *iso20022.PartyIdentification10Choice {
c.MessageOriginator = new(iso20022.PartyIdentification10Choice)
return c.MessageOriginator
}
func (c *CorporateActionInstructionCancellationRequestStatusAdviceV01) AddMessageRecipient() *iso20022.PartyIdentification10Choice {
c.MessageRecipient = new(iso20022.PartyIdentification10Choice)
return c.MessageRecipient
}
func (c *CorporateActionInstructionCancellationRequestStatusAdviceV01) AddExtension() *iso20022.Extension2 {
newValue := new(iso20022.Extension2)
c.Extension = append(c.Extension, newValue)
return newValue
}
| {
"content_hash": "e920c998830e871bf256b2be86ecadd7",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 531,
"avg_line_length": 55.256637168141594,
"alnum_prop": 0.8374439461883408,
"repo_name": "fgrid/iso20022",
"id": "239a77ba1c05efc7dbaa4fb7a91cd6b0971f6535",
"size": "6248",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "seev/CorporateActionInstructionCancellationRequestStatusAdviceV01.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "21383920"
}
],
"symlink_target": ""
} |
import {Req} from "@tsed/common";
/**
* Return the serverless.event
* @decorator
*/
export function ServerlessEvent(): ParameterDecorator {
return Req("serverless.event");
}
| {
"content_hash": "a485dd91e307791577ff6965f67daed5",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 55,
"avg_line_length": 20,
"alnum_prop": 0.7055555555555556,
"repo_name": "Romakita/ts-express-decorators",
"id": "e80fd769ded3fd163fc76d55819ad1a5bfb32fbf",
"size": "180",
"binary": false,
"copies": "1",
"ref": "refs/heads/production",
"path": "packages/platform/platform-serverless-http/src/decorators/serverlessEvent.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "EJS",
"bytes": "24557"
},
{
"name": "HTML",
"bytes": "3710"
},
{
"name": "JavaScript",
"bytes": "33370"
},
{
"name": "Shell",
"bytes": "376"
},
{
"name": "TypeScript",
"bytes": "2723318"
}
],
"symlink_target": ""
} |
var DynamicChartController = (function() {
function DynamicChartController(currentTimeseries, el) {
_.extend(this, Backbone.Events);
this.currentTimeseries = currentTimeseries;
this.el = $(el);
this.listenTo(this.currentTimeseries, 'change:color', function() {Backbone.Mediator.publish('chart:currentTimeseries:color:change');});
this.listenTo(this.currentTimeseries, 'add', this.addTimeseries);
this.listenTo(this.currentTimeseries, 'reset', this.loadAll);
this.listenTo(window.settings, 'change:timespan', this.loadAll);
this.listenTo(this.currentTimeseries, 'remove', this.updateDataCollection);
this.listenTo(this.currentTimeseries, 'change:hidden', this.updateDataCollection);
this.build();
this.loadAll();
};
DynamicChartController.prototype.remove = function() {
this.chartView.remove();
this.stopListening();
};
DynamicChartController.prototype.build = function() {
this.currentTimeseriesDataCollection = new TimeseriesDataCollection();
this.chartView = new DynamicChartView({'collection': this.currentTimeseriesDataCollection});
$(this.el).append(this.chartView.render().el);
};
/**
* Synces the Data list with the given meta (e.g. delete/visibility change)
*/
DynamicChartController.prototype.updateDataCollection = function() {
var tsData = this.currentTimeseriesDataCollection;
//for each visible from meta list
this.currentTimeseries.each(function(meta) {
if (!meta.get('hidden')) {
//data list contains this?
if (!tsData.any(function(elem) {return elem.get('timeseriesMetaData').get('id') == meta.get('id');})) {
//no: create, fetch, add
var tsd = new TimeseriesData({'timeseriesMetaData': meta, 'timespan': window.settings.get('timespan')});
tsData.add(tsd);
tsd.fetch();
}
//yes: continue
}
});
var tsMeta = this.currentTimeseries;
//for each from data list: remove, if not in meta list or not visible
tsData.remove(tsData.filter(function(data) {
//true: remove - false: keep
var inMetaListAndVisible = tsMeta.any(function(meta) {
return (meta.get('id') == data.get('timeseriesMetaData').get('id')) && !meta.get('hidden');
});
if (!inMetaListAndVisible) {
data.abort();
}
return !inMetaListAndVisible;
}));
Backbone.Mediator.publish('chart:currentTimeseries:updated');
};
/**
* Adds a timeseries without affecting the rest
*/
DynamicChartController.prototype.addTimeseries = function(meta) {
if (!meta.get('hidden')) {
var tsd = new TimeseriesData({'timeseriesMetaData': meta, 'timespan': window.settings.get('timespan')});
this.currentTimeseriesDataCollection.add(tsd);
tsd.fetch();
}
Backbone.Mediator.publish('chart:currentTimeseries:updated');
};
/**
* Resets the data list (eg. for timespan change)
*/
DynamicChartController.prototype.loadAll = function() {
//add to this.currentTimeseriesDataCollection
var tsData = this.currentTimeseriesDataCollection;
tsData.abortAndReset();
Backbone.Mediator.publish('chart:currentTimeseries:fetchingData');
this.currentTimeseries.each(function(meta) {
if (!meta.get('hidden')) {
var tsd = new TimeseriesData({'timeseriesMetaData': meta, 'timespan': window.settings.get('timespan')});
tsData.add(tsd);
tsd.fetch();
}
});
};
return DynamicChartController;
})(); | {
"content_hash": "02d81f4e83682f7f0204f40fd3c78bce",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 142,
"avg_line_length": 34.66019417475728,
"alnum_prop": 0.6635854341736694,
"repo_name": "52North/sosmobileclient",
"id": "d6d82a1fc80c2b888764a2a059e6e4a2f43f189d",
"size": "3570",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "assets/www/js/controllers/dynamicChartController.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "248382"
},
{
"name": "D",
"bytes": "29690"
},
{
"name": "Java",
"bytes": "28819"
},
{
"name": "JavaScript",
"bytes": "1271740"
}
],
"symlink_target": ""
} |
/*
* <auto-generated>
* This code was generated by a tool.
*
* Changes to this file may cause incorrect behavior and will be lost if
* the code is regenerated.
* </auto-generated>
*/
#import "MOZUApplicationBehavior.h"
@implementation MOZUApplicationBehavior
+ (BOOL)propertyIsOptional:(NSString *)propertyName
{
return YES;
}
@end
| {
"content_hash": "485ecba835c3e293f7f1b655dc33eee3",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 75,
"avg_line_length": 16.565217391304348,
"alnum_prop": 0.6587926509186351,
"repo_name": "Mozu/mozu-ios-sdk",
"id": "8ab88c7e10678820b784aa99d123c2c4e7ab27e2",
"size": "381",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MozuApi/Contracts/AppDev/MOZUApplicationBehavior.m",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "3959621"
},
{
"name": "Ruby",
"bytes": "2433"
}
],
"symlink_target": ""
} |
namespace ui {
void AddUiColorMixer(ColorProvider* provider,
const ColorProviderManager::Key& key) {
const bool dark_mode =
key.color_mode == ColorProviderManager::ColorMode::kDark;
ColorMixer& mixer = provider->AddMixer();
mixer[kColorAvatarHeaderArt] = {kColorMidground};
mixer[kColorAvatarIconGuest] = {kColorSecondaryForeground};
mixer[kColorAvatarIconIncognito] = {kColorPrimaryForeground};
mixer[kColorBubbleBackground] = {kColorPrimaryBackground};
mixer[kColorBubbleBorder] = {kColorMidground};
mixer[kColorBubbleBorderShadowLarge] = {SetAlpha(kColorShadowBase, 0x1A)};
mixer[kColorBubbleBorderShadowSmall] = {SetAlpha(kColorShadowBase, 0x33)};
mixer[kColorBubbleBorderWhenShadowPresent] = {SetAlpha(SK_ColorBLACK, 0x26)};
mixer[kColorBubbleFooterBackground] = {kColorSubtleEmphasisBackground};
mixer[kColorBubbleFooterBorder] = {kColorMidground};
mixer[kColorButtonBackground] = {kColorPrimaryBackground};
mixer[kColorButtonBackgroundPressed] = {kColorButtonBackground};
mixer[kColorButtonBackgroundProminent] = {kColorAccent};
mixer[kColorButtonBackgroundProminentDisabled] = {
kColorSubtleEmphasisBackground};
mixer[kColorButtonBackgroundProminentFocused] = {
kColorButtonBackgroundProminent};
mixer[kColorButtonBorder] = {kColorMidground};
mixer[kColorButtonBorderDisabled] = {kColorSubtleEmphasisBackground};
mixer[kColorButtonForeground] =
PickGoogleColor(kColorAccent, kColorButtonBackground,
color_utils::kMinimumReadableContrastRatio);
mixer[kColorButtonForegroundChecked] = {kColorButtonForeground};
mixer[kColorButtonForegroundDisabled] = {kColorDisabledForeground};
mixer[kColorButtonForegroundProminent] =
GetColorWithMaxContrast(kColorButtonBackgroundProminent);
mixer[kColorButtonForegroundUnchecked] = {kColorSecondaryForeground};
mixer[kColorCustomFrameCaptionForeground] = {SK_ColorWHITE};
mixer[kColorDebugBoundsOutline] = SetAlpha(SK_ColorRED, 0x30);
mixer[kColorDebugContentOutline] = SetAlpha(SK_ColorBLUE, 0x30);
mixer[kColorDialogBackground] = {kColorPrimaryBackground};
mixer[kColorDialogForeground] = {kColorSecondaryForeground};
mixer[kColorDropdownBackground] = {kColorPrimaryBackground};
mixer[kColorDropdownBackgroundSelected] = {kColorMenuSelectionBackground};
mixer[kColorDropdownForeground] = {kColorPrimaryForeground};
mixer[kColorDropdownForegroundSelected] = {kColorPrimaryForeground};
mixer[kColorFocusableBorderFocused] = {kColorItemHighlight};
mixer[kColorFocusableBorderUnfocused] = {kColorMidground};
mixer[kColorFrameActive] = {kColorFrameActiveUnthemed};
mixer[kColorFrameActiveUnthemed] = {
dark_mode ? gfx::kGoogleGrey900 : SkColorSetRGB(0xDE, 0xE1, 0xE6)};
mixer[kColorFrameInactive] = {dark_mode ? gfx::kGoogleGrey800
: gfx::kGoogleGrey200};
mixer[kColorHelpIconActive] = {kColorPrimaryForeground};
mixer[kColorHelpIconInactive] = {kColorSecondaryForeground};
mixer[kColorIcon] = {kColorSecondaryForeground};
mixer[kColorIconDisabled] = SetAlpha(kColorIcon, gfx::kDisabledControlAlpha);
mixer[kColorIconSecondary] = {gfx::kGoogleGrey600};
mixer[kColorLabelForeground] = {kColorPrimaryForeground};
mixer[kColorLabelForegroundDisabled] = {kColorDisabledForeground};
mixer[kColorLabelForegroundSecondary] = {kColorSecondaryForeground};
mixer[kColorLabelSelectionBackground] = {kColorTextSelectionBackground};
mixer[kColorLabelSelectionForeground] = {kColorTextSelectionForeground};
mixer[kColorLinkForeground] =
PickGoogleColor(kColorAccent, kColorDialogBackground,
color_utils::kMinimumReadableContrastRatio);
mixer[kColorLinkForegroundDisabled] = {kColorDisabledForeground};
mixer[kColorLinkForegroundPressed] = {kColorLinkForeground};
mixer[kColorLiveCaptionBubbleBackgroundDefault] = {
SkColorSetA(gfx::kGoogleGrey900, 0xE6)};
mixer[kColorLiveCaptionBubbleButtonIcon] =
ui::DeriveDefaultIconColor(kColorLiveCaptionBubbleForegroundDefault);
mixer[kColorLiveCaptionBubbleButtonIconDisabled] = ui::SetAlpha(
kColorLiveCaptionBubbleButtonIcon, gfx::kDisabledControlAlpha);
mixer[kColorLiveCaptionBubbleForegroundDefault] =
GetColorWithMaxContrast(kColorLiveCaptionBubbleBackgroundDefault);
mixer[kColorLiveCaptionBubbleCheckbox] = PickGoogleColor(
kColorAccent, kColorLiveCaptionBubbleBackgroundDefault, 6.0f);
mixer[kColorLiveCaptionBubbleLink] = {kColorLiveCaptionBubbleCheckbox};
mixer[kColorMenuBackground] = {kColorPrimaryBackground};
mixer[kColorMenuBorder] = {kColorMidground};
mixer[kColorMenuDropmarker] = {kColorPrimaryForeground};
mixer[kColorMenuIcon] = {kColorIcon};
mixer[kColorMenuItemBackgroundAlertedInitial] = SetAlpha(kColorAccent, 0x4D);
mixer[kColorMenuItemBackgroundAlertedTarget] =
SetAlpha(kColorAccent, gfx::kGoogleGreyAlpha200);
mixer[kColorMenuItemBackgroundHighlighted] = {kColorSubtleEmphasisBackground};
mixer[kColorMenuItemBackgroundSelected] = {kColorMenuSelectionBackground};
mixer[kColorMenuItemForeground] = {kColorPrimaryForeground};
mixer[kColorMenuItemForegroundDisabled] = {kColorDisabledForeground};
mixer[kColorMenuItemForegroundHighlighted] = {kColorMenuItemForeground};
mixer[kColorMenuItemForegroundSecondary] = {kColorSecondaryForeground};
mixer[kColorMenuItemForegroundSelected] = {kColorMenuItemForeground};
mixer[kColorMenuSeparator] = {kColorMidground};
mixer[kColorNotificationActionsBackground] = {
kColorNotificationBackgroundActive};
mixer[kColorNotificationBackgroundActive] = {kColorSubtleEmphasisBackground};
mixer[kColorNotificationBackgroundInactive] = {kColorPrimaryBackground};
mixer[kColorNotificationHeaderForeground] = {kColorSecondaryForeground};
mixer[kColorNotificationIconBackground] = {
kColorNotificationHeaderForeground};
mixer[kColorNotificationIconForeground] = {
kColorNotificationBackgroundInactive};
mixer[kColorNotificationImageBackground] = {
kColorNotificationBackgroundActive};
mixer[kColorNotificationInputBackground] = {kColorAccent};
mixer[kColorNotificationInputForeground] =
GetColorWithMaxContrast(kColorNotificationInputBackground);
mixer[kColorNotificationInputPlaceholderForeground] =
SetAlpha(kColorNotificationInputForeground, gfx::kGoogleGreyAlpha700);
mixer[kColorOverlayScrollbarFill] =
SetAlpha(kColorEndpointForeground, gfx::kGoogleGreyAlpha700);
mixer[kColorOverlayScrollbarFillDark] = SetAlpha(
GetColorWithMaxContrast(SK_ColorWHITE), gfx::kGoogleGreyAlpha700);
mixer[kColorOverlayScrollbarFillLight] = SetAlpha(
GetColorWithMaxContrast(SK_ColorBLACK), gfx::kGoogleGreyAlpha700);
mixer[kColorOverlayScrollbarFillHovered] =
SetAlpha(kColorEndpointForeground, gfx::kGoogleGreyAlpha800);
mixer[kColorOverlayScrollbarFillHoveredDark] = SetAlpha(
GetColorWithMaxContrast(SK_ColorWHITE), gfx::kGoogleGreyAlpha800);
mixer[kColorOverlayScrollbarFillHoveredLight] = SetAlpha(
GetColorWithMaxContrast(SK_ColorBLACK), gfx::kGoogleGreyAlpha800);
mixer[kColorOverlayScrollbarStroke] =
SetAlpha(kColorEndpointBackground, gfx::kGoogleGreyAlpha400);
mixer[kColorOverlayScrollbarStrokeDark] =
SetAlpha(GetColorWithMaxContrast(kColorOverlayScrollbarFillDark),
gfx::kGoogleGreyAlpha400);
mixer[kColorOverlayScrollbarStrokeLight] =
SetAlpha(GetColorWithMaxContrast(kColorOverlayScrollbarFillLight),
gfx::kGoogleGreyAlpha400);
mixer[kColorOverlayScrollbarStrokeHovered] =
SetAlpha(kColorEndpointBackground, gfx::kGoogleGreyAlpha500);
mixer[kColorOverlayScrollbarStrokeHoveredDark] =
SetAlpha(GetColorWithMaxContrast(kColorOverlayScrollbarFillHoveredDark),
gfx::kGoogleGreyAlpha500);
mixer[kColorOverlayScrollbarStrokeHoveredLight] =
SetAlpha(GetColorWithMaxContrast(kColorOverlayScrollbarFillHoveredLight),
gfx::kGoogleGreyAlpha500);
mixer[kColorProgressBarPaused] = {kColorDisabledForeground};
mixer[kColorProgressBar] = {kColorAccent};
mixer[kColorSeparator] = {kColorMidground};
mixer[kColorShadowBase] = {dark_mode ? SK_ColorBLACK : gfx::kGoogleGrey800};
mixer[kColorShadowValueAmbientShadowElevationThree] =
SetAlpha(kColorShadowBase, 0x40);
mixer[kColorShadowValueKeyShadowElevationThree] =
SetAlpha(kColorShadowBase, 0x66);
mixer[kColorShadowValueAmbientShadowElevationSixteen] =
SetAlpha(kColorShadowBase, 0x3d);
mixer[kColorShadowValueKeyShadowElevationSixteen] =
SetAlpha(kColorShadowBase, 0x1a);
mixer[kColorSidePanelComboboxBorder] = {SK_ColorTRANSPARENT};
mixer[kColorSidePanelComboboxBackground] = {kColorPrimaryBackground};
mixer[kColorSliderThumb] = {kColorAccent};
mixer[kColorSliderThumbMinimal] = {kColorSecondaryForeground};
mixer[kColorSliderTrack] = {kColorSubtleAccent};
mixer[kColorSliderTrackMinimal] = {kColorMidground};
mixer[kColorSyncInfoBackground] = {kColorSubtleEmphasisBackground};
mixer[kColorSyncInfoBackgroundError] =
SetAlpha(kColorAlertHighSeverity, gfx::kGoogleGreyAlpha100);
mixer[kColorSyncInfoBackgroundPaused] =
SetAlpha(kColorAccent, gfx::kGoogleGreyAlpha100);
{
auto tab_background_base =
PickGoogleColor(kColorAccent, kColorPrimaryBackground, 6.0f);
mixer[kColorTabBackgroundHighlighted] = SetAlpha(tab_background_base, 0x2B);
mixer[kColorTabBackgroundHighlightedFocused] =
SetAlpha(std::move(tab_background_base), 0x53);
}
mixer[kColorTabBorderSelected] = {kColorAccent};
mixer[kColorTabContentSeparator] = {kColorMidground};
mixer[kColorTabForeground] = {kColorSecondaryForeground};
mixer[kColorTabForegroundSelected] =
PickGoogleColor(kColorAccent, kColorDialogBackground,
color_utils::kMinimumReadableContrastRatio);
mixer[kColorTableBackground] = {kColorPrimaryBackground};
mixer[kColorTableBackgroundAlternate] = {kColorTableBackground};
mixer[kColorTableBackgroundSelectedFocused] = {kColorItemSelectionBackground};
mixer[kColorTableBackgroundSelectedUnfocused] = {
kColorTableBackgroundSelectedFocused};
mixer[kColorTableForeground] = {kColorPrimaryForeground};
mixer[kColorTableForegroundSelectedFocused] = {kColorTableForeground};
mixer[kColorTableForegroundSelectedUnfocused] = {
kColorTableForegroundSelectedFocused};
mixer[kColorTableGroupingIndicator] = {kColorItemHighlight};
mixer[kColorTableHeaderBackground] = {kColorTableBackground};
mixer[kColorTableHeaderForeground] = {kColorTableForeground};
mixer[kColorTableHeaderSeparator] = {kColorMidground};
mixer[kColorTextfieldBackground] = {kColorEndpointBackground};
mixer[kColorTextfieldBackgroundDisabled] = {kColorPrimaryBackground};
mixer[kColorTextfieldForeground] = {kColorPrimaryForeground};
mixer[kColorTextfieldForegroundDisabled] = {kColorDisabledForeground};
mixer[kColorTextfieldForegroundPlaceholder] = {
kColorTextfieldForegroundDisabled};
mixer[kColorTextfieldSelectionBackground] = {kColorTextSelectionBackground};
mixer[kColorTextfieldSelectionForeground] = {kColorTextSelectionForeground};
mixer[kColorThrobber] = {kColorAccent};
mixer[kColorThrobberPreconnect] = {kColorSubtleAccent};
mixer[kColorToggleButtonShadow] = {kColorMidground};
mixer[kColorToggleButtonThumbOff] = {kColorSecondaryForeground};
mixer[kColorToggleButtonThumbOn] = {kColorAccent};
if (dark_mode) {
mixer[kColorToggleButtonThumbOff] +=
AlphaBlend(kColorPrimaryForeground, FromTransformInput(), 0x0D);
mixer[kColorToggleButtonThumbOn] +=
AlphaBlend(kColorPrimaryForeground, FromTransformInput(), 0x0D);
}
mixer[kColorToggleButtonTrackOff] = {
dark_mode ? ColorTransform(gfx::kGoogleGrey700) : kColorMidground};
mixer[kColorToggleButtonTrackOn] =
PickGoogleColor(kColorAccent, kColorToggleButtonThumbOn, 2.13f);
mixer[kColorTooltipBackground] = SetAlpha(kColorPrimaryBackground, 0xCC);
mixer[kColorTooltipForeground] = SetAlpha(kColorPrimaryForeground, 0xDE);
mixer[kColorTreeBackground] = {kColorPrimaryBackground};
mixer[kColorTreeNodeBackgroundSelectedFocused] = {
kColorItemSelectionBackground};
mixer[kColorTreeNodeBackgroundSelectedUnfocused] = {
kColorTreeNodeBackgroundSelectedFocused};
mixer[kColorTreeNodeForeground] = {kColorPrimaryForeground};
mixer[kColorTreeNodeForegroundSelectedFocused] = {kColorTreeNodeForeground};
mixer[kColorTreeNodeForegroundSelectedUnfocused] = {
kColorTreeNodeForegroundSelectedFocused};
mixer[kColorWindowBackground] = {kColorPrimaryBackground};
}
} // namespace ui
| {
"content_hash": "d725db40cdfea1e03f8e0c7d5f66973d",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 80,
"avg_line_length": 56.771300448430495,
"alnum_prop": 0.8006319115323854,
"repo_name": "nwjs/chromium.src",
"id": "9f16d549f88563aa00e0e10ee51237342711cff2",
"size": "13129",
"binary": false,
"copies": "1",
"ref": "refs/heads/nw70",
"path": "ui/color/ui_color_mixer.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
"""Internal implementation for declarative."""
from ...schema import Table, Column
from ...orm import mapper, class_mapper, synonym
from ...orm.interfaces import MapperProperty
from ...orm.properties import ColumnProperty, CompositeProperty
from ...orm.attributes import QueryableAttribute
from ...orm.base import _is_mapped_class
from ... import util, exc
from ...util import topological
from ...sql import expression
from ... import event
from . import clsregistry
import collections
import weakref
from sqlalchemy.orm import instrumentation
declared_attr = declarative_props = None
def _declared_mapping_info(cls):
# deferred mapping
if _DeferredMapperConfig.has_cls(cls):
return _DeferredMapperConfig.config_for_cls(cls)
# regular mapping
elif _is_mapped_class(cls):
return class_mapper(cls, configure=False)
else:
return None
def _resolve_for_abstract(cls):
if cls is object:
return None
if _get_immediate_cls_attr(cls, '__abstract__', strict=True):
for sup in cls.__bases__:
sup = _resolve_for_abstract(sup)
if sup is not None:
return sup
else:
return None
else:
return cls
def _get_immediate_cls_attr(cls, attrname, strict=False):
"""return an attribute of the class that is either present directly
on the class, e.g. not on a superclass, or is from a superclass but
this superclass is a mixin, that is, not a descendant of
the declarative base.
This is used to detect attributes that indicate something about
a mapped class independently from any mapped classes that it may
inherit from.
"""
if not issubclass(cls, object):
return None
for base in cls.__mro__:
_is_declarative_inherits = hasattr(base, '_decl_class_registry')
if attrname in base.__dict__ and (
base is cls or
((base in cls.__bases__ if strict else True)
and not _is_declarative_inherits)
):
return getattr(base, attrname)
else:
return None
def _as_declarative(cls, classname, dict_):
global declared_attr, declarative_props
if declared_attr is None:
from .api import declared_attr
declarative_props = (declared_attr, util.classproperty)
if _get_immediate_cls_attr(cls, '__abstract__', strict=True):
return
_MapperConfig.setup_mapping(cls, classname, dict_)
class _MapperConfig(object):
@classmethod
def setup_mapping(cls, cls_, classname, dict_):
defer_map = _get_immediate_cls_attr(
cls_, '_sa_decl_prepare_nocascade', strict=True) or \
hasattr(cls_, '_sa_decl_prepare')
if defer_map:
cfg_cls = _DeferredMapperConfig
else:
cfg_cls = _MapperConfig
cfg_cls(cls_, classname, dict_)
def __init__(self, cls_, classname, dict_):
self.cls = cls_
# dict_ will be a dictproxy, which we can't write to, and we need to!
self.dict_ = dict(dict_)
self.classname = classname
self.mapped_table = None
self.properties = util.OrderedDict()
self.declared_columns = set()
self.column_copies = {}
self._setup_declared_events()
# temporary registry. While early 1.0 versions
# set up the ClassManager here, by API contract
# we can't do that until there's a mapper.
self.cls._sa_declared_attr_reg = {}
self._scan_attributes()
clsregistry.add_class(self.classname, self.cls)
self._extract_mappable_attributes()
self._extract_declared_columns()
self._setup_table()
self._setup_inheritance()
self._early_mapping()
def _early_mapping(self):
self.map()
def _setup_declared_events(self):
if _get_immediate_cls_attr(self.cls, '__declare_last__'):
@event.listens_for(mapper, "after_configured")
def after_configured():
self.cls.__declare_last__()
if _get_immediate_cls_attr(self.cls, '__declare_first__'):
@event.listens_for(mapper, "before_configured")
def before_configured():
self.cls.__declare_first__()
def _scan_attributes(self):
cls = self.cls
dict_ = self.dict_
column_copies = self.column_copies
mapper_args_fn = None
table_args = inherited_table_args = None
tablename = None
for base in cls.__mro__:
class_mapped = base is not cls and \
_declared_mapping_info(base) is not None and \
not _get_immediate_cls_attr(
base, '_sa_decl_prepare_nocascade', strict=True)
if not class_mapped and base is not cls:
self._produce_column_copies(base)
for name, obj in vars(base).items():
if name == '__mapper_args__':
if not mapper_args_fn and (
not class_mapped or
isinstance(obj, declarative_props)
):
# don't even invoke __mapper_args__ until
# after we've determined everything about the
# mapped table.
# make a copy of it so a class-level dictionary
# is not overwritten when we update column-based
# arguments.
mapper_args_fn = lambda: dict(cls.__mapper_args__)
elif name == '__tablename__':
if not tablename and (
not class_mapped or
isinstance(obj, declarative_props)
):
tablename = cls.__tablename__
elif name == '__table_args__':
if not table_args and (
not class_mapped or
isinstance(obj, declarative_props)
):
table_args = cls.__table_args__
if not isinstance(
table_args, (tuple, dict, type(None))):
raise exc.ArgumentError(
"__table_args__ value must be a tuple, "
"dict, or None")
if base is not cls:
inherited_table_args = True
elif class_mapped:
if isinstance(obj, declarative_props):
util.warn("Regular (i.e. not __special__) "
"attribute '%s.%s' uses @declared_attr, "
"but owning class %s is mapped - "
"not applying to subclass %s."
% (base.__name__, name, base, cls))
continue
elif base is not cls:
# we're a mixin, abstract base, or something that is
# acting like that for now.
if isinstance(obj, Column):
# already copied columns to the mapped class.
continue
elif isinstance(obj, MapperProperty):
raise exc.InvalidRequestError(
"Mapper properties (i.e. deferred,"
"column_property(), relationship(), etc.) must "
"be declared as @declared_attr callables "
"on declarative mixin classes.")
elif isinstance(obj, declarative_props):
oldclassprop = isinstance(obj, util.classproperty)
if not oldclassprop and obj._cascading:
dict_[name] = column_copies[obj] = \
ret = obj.__get__(obj, cls)
setattr(cls, name, ret)
else:
if oldclassprop:
util.warn_deprecated(
"Use of sqlalchemy.util.classproperty on "
"declarative classes is deprecated.")
dict_[name] = column_copies[obj] = \
ret = getattr(cls, name)
if isinstance(ret, (Column, MapperProperty)) and \
ret.doc is None:
ret.doc = obj.__doc__
if inherited_table_args and not tablename:
table_args = None
self.table_args = table_args
self.tablename = tablename
self.mapper_args_fn = mapper_args_fn
def _produce_column_copies(self, base):
cls = self.cls
dict_ = self.dict_
column_copies = self.column_copies
# copy mixin columns to the mapped class
for name, obj in vars(base).items():
if isinstance(obj, Column):
if getattr(cls, name) is not obj:
# if column has been overridden
# (like by the InstrumentedAttribute of the
# superclass), skip
continue
elif obj.foreign_keys:
raise exc.InvalidRequestError(
"Columns with foreign keys to other columns "
"must be declared as @declared_attr callables "
"on declarative mixin classes. ")
elif name not in dict_ and not (
'__table__' in dict_ and
(obj.name or name) in dict_['__table__'].c
):
column_copies[obj] = copy_ = obj.copy()
copy_._creation_order = obj._creation_order
setattr(cls, name, copy_)
dict_[name] = copy_
def _extract_mappable_attributes(self):
cls = self.cls
dict_ = self.dict_
our_stuff = self.properties
for k in list(dict_):
if k in ('__table__', '__tablename__', '__mapper_args__'):
continue
value = dict_[k]
if isinstance(value, declarative_props):
value = getattr(cls, k)
elif isinstance(value, QueryableAttribute) and \
value.class_ is not cls and \
value.key != k:
# detect a QueryableAttribute that's already mapped being
# assigned elsewhere in userland, turn into a synonym()
value = synonym(value.key)
setattr(cls, k, value)
if (isinstance(value, tuple) and len(value) == 1 and
isinstance(value[0], (Column, MapperProperty))):
util.warn("Ignoring declarative-like tuple value of attribute "
"%s: possibly a copy-and-paste error with a comma "
"left at the end of the line?" % k)
continue
elif not isinstance(value, (Column, MapperProperty)):
# using @declared_attr for some object that
# isn't Column/MapperProperty; remove from the dict_
# and place the evaluated value onto the class.
if not k.startswith('__'):
dict_.pop(k)
setattr(cls, k, value)
continue
# we expect to see the name 'metadata' in some valid cases;
# however at this point we see it's assigned to something trying
# to be mapped, so raise for that.
elif k == 'metadata':
raise exc.InvalidRequestError(
"Attribute name 'metadata' is reserved "
"for the MetaData instance when using a "
"declarative base class."
)
prop = clsregistry._deferred_relationship(cls, value)
our_stuff[k] = prop
def _extract_declared_columns(self):
our_stuff = self.properties
# set up attributes in the order they were created
our_stuff.sort(key=lambda key: our_stuff[key]._creation_order)
# extract columns from the class dict
declared_columns = self.declared_columns
name_to_prop_key = collections.defaultdict(set)
for key, c in list(our_stuff.items()):
if isinstance(c, (ColumnProperty, CompositeProperty)):
for col in c.columns:
if isinstance(col, Column) and \
col.table is None:
_undefer_column_name(key, col)
if not isinstance(c, CompositeProperty):
name_to_prop_key[col.name].add(key)
declared_columns.add(col)
elif isinstance(c, Column):
_undefer_column_name(key, c)
name_to_prop_key[c.name].add(key)
declared_columns.add(c)
# if the column is the same name as the key,
# remove it from the explicit properties dict.
# the normal rules for assigning column-based properties
# will take over, including precedence of columns
# in multi-column ColumnProperties.
if key == c.key:
del our_stuff[key]
for name, keys in name_to_prop_key.items():
if len(keys) > 1:
util.warn(
"On class %r, Column object %r named "
"directly multiple times, "
"only one will be used: %s" %
(self.classname, name, (", ".join(sorted(keys))))
)
def _setup_table(self):
cls = self.cls
tablename = self.tablename
table_args = self.table_args
dict_ = self.dict_
declared_columns = self.declared_columns
declared_columns = self.declared_columns = sorted(
declared_columns, key=lambda c: c._creation_order)
table = None
if hasattr(cls, '__table_cls__'):
table_cls = util.unbound_method_to_callable(cls.__table_cls__)
else:
table_cls = Table
if '__table__' not in dict_:
if tablename is not None:
args, table_kw = (), {}
if table_args:
if isinstance(table_args, dict):
table_kw = table_args
elif isinstance(table_args, tuple):
if isinstance(table_args[-1], dict):
args, table_kw = table_args[0:-1], table_args[-1]
else:
args = table_args
autoload = dict_.get('__autoload__')
if autoload:
table_kw['autoload'] = True
cls.__table__ = table = table_cls(
tablename, cls.metadata,
*(tuple(declared_columns) + tuple(args)),
**table_kw)
else:
table = cls.__table__
if declared_columns:
for c in declared_columns:
if not table.c.contains_column(c):
raise exc.ArgumentError(
"Can't add additional column %r when "
"specifying __table__" % c.key
)
self.local_table = table
def _setup_inheritance(self):
table = self.local_table
cls = self.cls
table_args = self.table_args
declared_columns = self.declared_columns
for c in cls.__bases__:
c = _resolve_for_abstract(c)
if c is None:
continue
if _declared_mapping_info(c) is not None and \
not _get_immediate_cls_attr(
c, '_sa_decl_prepare_nocascade', strict=True):
self.inherits = c
break
else:
self.inherits = None
if table is None and self.inherits is None and \
not _get_immediate_cls_attr(cls, '__no_table__'):
raise exc.InvalidRequestError(
"Class %r does not have a __table__ or __tablename__ "
"specified and does not inherit from an existing "
"table-mapped class." % cls
)
elif self.inherits:
inherited_mapper = _declared_mapping_info(self.inherits)
inherited_table = inherited_mapper.local_table
inherited_mapped_table = inherited_mapper.mapped_table
if table is None:
# single table inheritance.
# ensure no table args
if table_args:
raise exc.ArgumentError(
"Can't place __table_args__ on an inherited class "
"with no table."
)
# add any columns declared here to the inherited table.
for c in declared_columns:
if c.primary_key:
raise exc.ArgumentError(
"Can't place primary key columns on an inherited "
"class with no table."
)
if c.name in inherited_table.c:
if inherited_table.c[c.name] is c:
continue
raise exc.ArgumentError(
"Column '%s' on class %s conflicts with "
"existing column '%s'" %
(c, cls, inherited_table.c[c.name])
)
inherited_table.append_column(c)
if inherited_mapped_table is not None and \
inherited_mapped_table is not inherited_table:
inherited_mapped_table._refresh_for_new_column(c)
def _prepare_mapper_arguments(self):
properties = self.properties
if self.mapper_args_fn:
mapper_args = self.mapper_args_fn()
else:
mapper_args = {}
# make sure that column copies are used rather
# than the original columns from any mixins
for k in ('version_id_col', 'polymorphic_on',):
if k in mapper_args:
v = mapper_args[k]
mapper_args[k] = self.column_copies.get(v, v)
assert 'inherits' not in mapper_args, \
"Can't specify 'inherits' explicitly with declarative mappings"
if self.inherits:
mapper_args['inherits'] = self.inherits
if self.inherits and not mapper_args.get('concrete', False):
# single or joined inheritance
# exclude any cols on the inherited table which are
# not mapped on the parent class, to avoid
# mapping columns specific to sibling/nephew classes
inherited_mapper = _declared_mapping_info(self.inherits)
inherited_table = inherited_mapper.local_table
if 'exclude_properties' not in mapper_args:
mapper_args['exclude_properties'] = exclude_properties = \
set([c.key for c in inherited_table.c
if c not in inherited_mapper._columntoproperty])
exclude_properties.difference_update(
[c.key for c in self.declared_columns])
# look through columns in the current mapper that
# are keyed to a propname different than the colname
# (if names were the same, we'd have popped it out above,
# in which case the mapper makes this combination).
# See if the superclass has a similar column property.
# If so, join them together.
for k, col in list(properties.items()):
if not isinstance(col, expression.ColumnElement):
continue
if k in inherited_mapper._props:
p = inherited_mapper._props[k]
if isinstance(p, ColumnProperty):
# note here we place the subclass column
# first. See [ticket:1892] for background.
properties[k] = [col] + p.columns
result_mapper_args = mapper_args.copy()
result_mapper_args['properties'] = properties
self.mapper_args = result_mapper_args
def map(self):
self._prepare_mapper_arguments()
if hasattr(self.cls, '__mapper_cls__'):
mapper_cls = util.unbound_method_to_callable(
self.cls.__mapper_cls__)
else:
mapper_cls = mapper
self.cls.__mapper__ = mp_ = mapper_cls(
self.cls,
self.local_table,
**self.mapper_args
)
del self.cls._sa_declared_attr_reg
return mp_
class _DeferredMapperConfig(_MapperConfig):
_configs = util.OrderedDict()
def _early_mapping(self):
pass
@property
def cls(self):
return self._cls()
@cls.setter
def cls(self, class_):
self._cls = weakref.ref(class_, self._remove_config_cls)
self._configs[self._cls] = self
@classmethod
def _remove_config_cls(cls, ref):
cls._configs.pop(ref, None)
@classmethod
def has_cls(cls, class_):
# 2.6 fails on weakref if class_ is an old style class
return isinstance(class_, type) and \
weakref.ref(class_) in cls._configs
@classmethod
def config_for_cls(cls, class_):
return cls._configs[weakref.ref(class_)]
@classmethod
def classes_for_base(cls, base_cls, sort=True):
classes_for_base = [m for m in cls._configs.values()
if issubclass(m.cls, base_cls)]
if not sort:
return classes_for_base
all_m_by_cls = dict(
(m.cls, m)
for m in classes_for_base
)
tuples = []
for m_cls in all_m_by_cls:
tuples.extend(
(all_m_by_cls[base_cls], all_m_by_cls[m_cls])
for base_cls in m_cls.__bases__
if base_cls in all_m_by_cls
)
return list(
topological.sort(
tuples,
classes_for_base
)
)
def map(self):
self._configs.pop(self._cls, None)
return super(_DeferredMapperConfig, self).map()
def _add_attribute(cls, key, value):
"""add an attribute to an existing declarative class.
This runs through the logic to determine MapperProperty,
adds it to the Mapper, adds a column to the mapped Table, etc.
"""
if '__mapper__' in cls.__dict__:
if isinstance(value, Column):
_undefer_column_name(key, value)
cls.__table__.append_column(value)
cls.__mapper__.add_property(key, value)
elif isinstance(value, ColumnProperty):
for col in value.columns:
if isinstance(col, Column) and col.table is None:
_undefer_column_name(key, col)
cls.__table__.append_column(col)
cls.__mapper__.add_property(key, value)
elif isinstance(value, MapperProperty):
cls.__mapper__.add_property(
key,
clsregistry._deferred_relationship(cls, value)
)
elif isinstance(value, QueryableAttribute) and value.key != key:
# detect a QueryableAttribute that's already mapped being
# assigned elsewhere in userland, turn into a synonym()
value = synonym(value.key)
cls.__mapper__.add_property(
key,
clsregistry._deferred_relationship(cls, value)
)
else:
type.__setattr__(cls, key, value)
else:
type.__setattr__(cls, key, value)
def _declarative_constructor(self, **kwargs):
"""A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and
values in ``kwargs``.
Only keys that are present as
attributes of the instance's class are allowed. These could be,
for example, any mapped columns or relationships.
"""
cls_ = type(self)
for k in kwargs:
if not hasattr(cls_, k):
raise TypeError(
"%r is an invalid keyword argument for %s" %
(k, cls_.__name__))
setattr(self, k, kwargs[k])
_declarative_constructor.__name__ = '__init__'
def _undefer_column_name(key, column):
if column.key is None:
column.key = key
if column.name is None:
column.name = key
| {
"content_hash": "f375da1d4ef5765bb2bc41c1287f6051",
"timestamp": "",
"source": "github",
"line_count": 651,
"max_line_length": 79,
"avg_line_length": 38.384024577572966,
"alnum_prop": 0.5178885865215304,
"repo_name": "jburger424/MediaQueueHCI",
"id": "59ebe3722a570b96504c6d55b580615164520389",
"size": "25231",
"binary": false,
"copies": "20",
"ref": "refs/heads/dev",
"path": "m-q-env/lib/python3.4/site-packages/sqlalchemy/ext/declarative/base.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "5939"
},
{
"name": "CSS",
"bytes": "28174"
},
{
"name": "HTML",
"bytes": "28708"
},
{
"name": "JavaScript",
"bytes": "125536"
},
{
"name": "Python",
"bytes": "7754137"
},
{
"name": "Shell",
"bytes": "3720"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "03a685082c6fd8318ae2b26e2b8271d7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 18,
"avg_line_length": 8.384615384615385,
"alnum_prop": 0.6788990825688074,
"repo_name": "mdoering/backbone",
"id": "a1c7fc4e14e6aa27e5ac03005ce0fe0ae01f2c60",
"size": "170",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Lecanoraceae/Lecanora/Lecanora sbarbaroana/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
class Contact < ActiveRecord::Base
validates :name, presence: true, length: { maximum: 50 }
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z/i
validates :email, presence: true , format: { with: VALID_EMAIL_REGEX }
validates :content, presence: true, length: { maximum: 1000 }
end
| {
"content_hash": "1f81247e8b57d17996d55b41f1cd4798",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 72,
"avg_line_length": 38.125,
"alnum_prop": 0.6327868852459017,
"repo_name": "modernscape/practice",
"id": "ca3ac2401b9ae8e828ef0dd66abe504c76f5a80e",
"size": "305",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app/models/contact.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "138774"
},
{
"name": "CoffeeScript",
"bytes": "844"
},
{
"name": "JavaScript",
"bytes": "364652"
},
{
"name": "Ruby",
"bytes": "64354"
}
],
"symlink_target": ""
} |
html,
body {
width: 100%;
height: 100%;
}
body {
background-color: #eceff2;
font-family: 'Microsoft YaHei', sans-serif;
}
.show {
display: block !important;
}
.hide {
display: none !important;
}
.clearfix:after {
content: " ";
display: block;
clear: both;
height: 0;
font-size: 0;
visibility: hidden;
}
.right {
float: right;
}
.error {
border: 1px solid red;
}
header {
width: 100%;
height: 70px;
line-height: 60px;
background: #fff;
padding: 0 20px;
border-bottom: 1px solid #d9dadc;
margin-bottom: 20px;
}
header .inner {
width: 1170px;
margin: 0 auto;
}
header .title {
display: inline-block;
}
header .title .logo {
display: inline-block;
font-size: 36px;
color: #d06868;
font-weight: bold;
}
header .title .name {
font-size: 16px;
color: #262525;
font-weight: bold;
margin-left: 8px;
}
header .user {
display: inline-block;
float: right;
}
header .user .username {
color: #262525;
margin-right: 20px;
}
header .user .username:hover {
text-decoration: none;
}
header .user .logout {
color: #12a3ee;
}
header .user .logout:hover {
text-decoration: underline;
}
.container {
width: 1170px;
border: 1px solid #e5e5e5;
padding: 0;
position: relative;
}
.container:after {
content: " ";
display: block;
clear: both;
height: 0;
font-size: 0;
visibility: hidden;
}
.container:after {
content: " ";
display: block;
clear: both;
height: 0;
font-size: 0;
visibility: hidden;
}
.container .sidebar {
width: 210px;
background: #fff;
height: 100%;
border-right: 1px solid #e5e5e5;
position: absolute;
left: 0;
}
.container .sidebar .nav {
margin-top: 35px;
}
.container .sidebar .nav li {
width: 100%;
height: 38px;
}
.container .sidebar .nav li.active {
border-left: 4px solid #4285f4;
cursor: pointer;
}
.container .sidebar .nav li.active a {
background: #fafbfc;
color: #4285f4;
}
.container .sidebar .nav li a {
border-radius: 0;
text-indent: 20px;
margin: 0;
color: #5a626d;
}
.container .sidebar .nav li a:hover {
background: #fff;
}
.container .main {
background: #fff;
margin-left: 210px;
}
.container .main:after {
content: " ";
display: block;
clear: both;
height: 0;
font-size: 0;
visibility: hidden;
}
.container .main:after {
content: " ";
display: block;
clear: both;
height: 0;
font-size: 0;
visibility: hidden;
}
.magnifier {
width: 231px;
height: 223px;
border: 1px solid #e7e7eb;
padding: 4px 0;
position: absolute;
top: 0;
left: 100%;
text-align: center;
background: #fff;
}
.magnifier img {
height: 100%;
width: 100%;
}
.icon-sort {
display: inline-block;
width: 9px;
height: 14px;
-webkit-background-size: contain;
background-size: contain;
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
background: rgba(0, 0, 0, 0) url("../images/sort_icon.png") no-repeat 0 0;
margin-left: 4px;
vertical-align: middle;
}
.main > h2 {
font-size: 16px;
padding: 30px 30px 15px;
border-bottom: 1px solid #e7e7eb;
}
.wrapper {
padding: 20px 28px;
}
.wrapper .section.productlist table {
width: 100%;
border-collapse: collapse;
border: 1px solid #e7e7eb;
}
.wrapper .section.productlist table thead {
background: #fafbfc;
font-weight: bold;
border: 1px solid #e7e7eb;
}
.wrapper .section.productlist table thead tr {
height: 46px;
}
.wrapper .section.productlist table thead .sort {
cursor: pointer;
}
.wrapper .section.productlist table tr td:first-child {
padding-left: 17px;
}
.wrapper .section.productlist table tbody {
color: #212121;
}
.wrapper .section.productlist table tbody tr {
height: 78px;
border-bottom: 1px solid #e7e7eb;
}
.wrapper .section.productlist table tbody tr:last-child {
border-bottom: none;
}
.wrapper .section.productlist table tbody tr td {
padding: 15px 0;
vertical-align: top;
}
.wrapper .section.productlist table tbody tr .img-column {
width: 90px;
}
.wrapper .section.productlist table tbody tr .name-column p {
width: 230px;
}
.wrapper .section.productlist table .img-box {
width: 50px;
height: 50px;
box-sizing: border-box;
position: relative;
border: 1px solid #e7e7eb;
text-align: center;
cursor: pointer;
}
.wrapper .section.productlist table .img-box img {
width: auto;
height: 100%;
}
.wrapper .section.productlist table .bk-name .name {
color: #212121;
margin-bottom: 10px;
}
.wrapper .section.productlist table .edit,
.wrapper .section.productlist table .delete {
color: #4285f4;
}
.wrapper .section.productlist table .edit {
margin-right: 9px;
}
.newpic {
display: inline-block;
width: 50px;
height: 50px;
color: #d9dadc;
border: 1px dashed #d9dadc;
text-align: center;
line-height: 50px;
position: relative;
overflow: hidden;
}
.newpic:hover {
border-color: #a9a9a9;
color: #a9a9a9;
}
.newpic input {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
cursor: pointer;
}
| {
"content_hash": "7f09d0085485a119fb41f253e963447d",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 76,
"avg_line_length": 18.33210332103321,
"alnum_prop": 0.6650563607085346,
"repo_name": "bestyxie/design",
"id": "ef64d47212748e7917f9631fe53fa950949477eb",
"size": "4968",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/style/pc/public_admin.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "134261"
},
{
"name": "HTML",
"bytes": "97149"
},
{
"name": "JavaScript",
"bytes": "420630"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "babee891f4d8637c9345032ff4c061c2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "f3ee82a6380c8738d82259feebb399b0b5b2022a",
"size": "188",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Myrtales/Melastomataceae/Dissochaeta/Dissochaeta fallax/ Syn. Omphalopus fallax/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
#include "config.h"
#include "compat.h"
#define P11_DEBUG_FLAG P11_DEBUG_LIB
#include "debug.h"
#include "library.h"
#include "virtual.h"
#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#ifdef WITH_FFI
/*
* We use libffi to build closures. Note that even with libffi certain
* platforms do not support using ffi_closure. In this case FFI_CLOSURES will
* not be defined. This is checked in configure.ac
*/
#include "ffi.h"
#ifndef FFI_CLOSURES
#error "FFI_CLOSURES should be checked in configure.ac"
#endif
/* There are 66 functions in PKCS#11, with a maximum of 8 args */
#define MAX_FUNCTIONS 66
#define MAX_ARGS 10
typedef struct {
/* This is first so we can cast between CK_FUNCTION_LIST* and Context* */
CK_FUNCTION_LIST bound;
/* The PKCS#11 functions to call into */
p11_virtual *virt;
p11_destroyer destroyer;
/* A list of our libffi built closures, for cleanup later */
ffi_closure *ffi_closures[MAX_FUNCTIONS];
ffi_cif ffi_cifs[MAX_FUNCTIONS];
int ffi_used;
} Wrapper;
static CK_RV
short_C_GetFunctionStatus (CK_SESSION_HANDLE handle)
{
return CKR_FUNCTION_NOT_PARALLEL;
}
static CK_RV
short_C_CancelFunction (CK_SESSION_HANDLE handle)
{
return CKR_FUNCTION_NOT_PARALLEL;
}
static void
binding_C_GetFunctionList (ffi_cif *cif,
CK_RV *ret,
void* args[],
Wrapper *wrapper)
{
CK_FUNCTION_LIST_PTR_PTR list = *(CK_FUNCTION_LIST_PTR_PTR *)args[0];
if (list == NULL) {
*ret = CKR_ARGUMENTS_BAD;
} else {
*list = &wrapper->bound;
*ret = CKR_OK;
}
}
static void
binding_C_Initialize (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_Initialize (funcs,
*(CK_VOID_PTR *)args[0]);
}
static void
binding_C_Finalize (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_Finalize (funcs,
*(CK_VOID_PTR *)args[0]);
}
static void
binding_C_GetInfo (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_GetInfo (funcs,
*(CK_INFO_PTR *)args[0]);
}
static void
binding_C_GetSlotList (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_GetSlotList (funcs,
*(CK_BBOOL *)args[0],
*(CK_SLOT_ID_PTR *)args[1],
*(CK_ULONG_PTR *)args[2]);
}
static void
binding_C_GetSlotInfo (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_GetSlotInfo (funcs,
*(CK_SLOT_ID *)args[0],
*(CK_SLOT_INFO_PTR *)args[1]);
}
static void
binding_C_GetTokenInfo (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_GetTokenInfo (funcs,
*(CK_SLOT_ID *)args[0],
*(CK_TOKEN_INFO_PTR *)args[1]);
}
static void
binding_C_WaitForSlotEvent (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_WaitForSlotEvent (funcs,
*(CK_FLAGS *)args[0],
*(CK_SLOT_ID_PTR *)args[1],
*(CK_VOID_PTR *)args[2]);
}
static void
binding_C_GetMechanismList (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_GetMechanismList (funcs,
*(CK_SLOT_ID *)args[0],
*(CK_MECHANISM_TYPE_PTR *)args[1],
*(CK_ULONG_PTR *)args[2]);
}
static void
binding_C_GetMechanismInfo (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_GetMechanismInfo (funcs,
*(CK_SLOT_ID *)args[0],
*(CK_MECHANISM_TYPE *)args[1],
*(CK_MECHANISM_INFO_PTR *)args[2]);
}
static void
binding_C_InitToken (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_InitToken (funcs,
*(CK_SLOT_ID *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_BYTE_PTR *)args[3]);
}
static void
binding_C_InitPIN (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_InitPIN (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2]);
}
static void
binding_C_SetPIN (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_SetPIN (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_BYTE_PTR *)args[3],
*(CK_ULONG *)args[4]);
}
static void
binding_C_OpenSession (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_OpenSession (funcs,
*(CK_SLOT_ID *)args[0],
*(CK_FLAGS *)args[1],
*(CK_VOID_PTR *)args[2],
*(CK_NOTIFY *)args[3],
*(CK_SESSION_HANDLE_PTR *)args[4]);
}
static void
binding_C_CloseSession (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_CloseSession (funcs,
*(CK_SESSION_HANDLE *)args[0]);
}
static void
binding_C_CloseAllSessions (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_CloseAllSessions (funcs,
*(CK_SLOT_ID *)args[0]);
}
static void
binding_C_GetSessionInfo (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_GetSessionInfo (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_SESSION_INFO_PTR *)args[1]);
}
static void
binding_C_GetOperationState (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_GetOperationState (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG_PTR *)args[2]);
}
static void
binding_C_SetOperationState (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_SetOperationState (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_OBJECT_HANDLE *)args[3],
*(CK_OBJECT_HANDLE *)args[4]);
}
static void
binding_C_Login (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_Login (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_USER_TYPE *)args[1],
*(CK_BYTE_PTR *)args[2],
*(CK_ULONG *)args[3]);
}
static void
binding_C_Logout (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_Logout (funcs,
*(CK_SESSION_HANDLE *)args[0]);
}
static void
binding_C_CreateObject (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_CreateObject (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_ATTRIBUTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_OBJECT_HANDLE_PTR *)args[3]);
}
static void
binding_C_CopyObject (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_CopyObject (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_OBJECT_HANDLE *)args[1],
*(CK_ATTRIBUTE_PTR *)args[2],
*(CK_ULONG *)args[3],
*(CK_OBJECT_HANDLE_PTR *)args[4]);
}
static void
binding_C_DestroyObject (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_DestroyObject (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_OBJECT_HANDLE *)args[1]);
}
static void
binding_C_GetObjectSize (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_GetObjectSize (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_OBJECT_HANDLE *)args[1],
*(CK_ULONG_PTR *)args[2]);
}
static void
binding_C_GetAttributeValue (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_GetAttributeValue (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_OBJECT_HANDLE *)args[1],
*(CK_ATTRIBUTE_PTR *)args[2],
*(CK_ULONG *)args[3]);
}
static void
binding_C_SetAttributeValue (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_SetAttributeValue (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_OBJECT_HANDLE *)args[1],
*(CK_ATTRIBUTE_PTR *)args[2],
*(CK_ULONG *)args[3]);
}
static void
binding_C_FindObjectsInit (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_FindObjectsInit (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_ATTRIBUTE_PTR *)args[1],
*(CK_ULONG *)args[2]);
}
static void
binding_C_FindObjects (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_FindObjects (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_OBJECT_HANDLE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_ULONG_PTR *)args[3]);
}
static void
binding_C_FindObjectsFinal (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_FindObjectsFinal (funcs,
*(CK_SESSION_HANDLE *)args[0]);
}
static void
binding_C_EncryptInit (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_EncryptInit (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_MECHANISM_PTR *)args[1],
*(CK_OBJECT_HANDLE *)args[2]);
}
static void
binding_C_Encrypt (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_Encrypt (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_BYTE_PTR *)args[3],
*(CK_ULONG_PTR *)args[4]);
}
static void
binding_C_EncryptUpdate (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_EncryptUpdate (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_BYTE_PTR *)args[3],
*(CK_ULONG_PTR *)args[4]);
}
static void
binding_C_EncryptFinal (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_EncryptFinal (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG_PTR *)args[2]);
}
static void
binding_C_DecryptInit (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_DecryptInit (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_MECHANISM_PTR *)args[1],
*(CK_OBJECT_HANDLE *)args[2]);
}
static void
binding_C_Decrypt (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_Decrypt (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_BYTE_PTR *)args[3],
*(CK_ULONG_PTR *)args[4]);
}
static void
binding_C_DecryptUpdate (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_DecryptUpdate (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_BYTE_PTR *)args[3],
*(CK_ULONG_PTR *)args[4]);
}
static void
binding_C_DecryptFinal (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_DecryptFinal (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG_PTR *)args[2]);
}
static void
binding_C_DigestInit (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_DigestInit (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_MECHANISM_PTR *)args[1]);
}
static void
binding_C_Digest (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_Digest (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_BYTE_PTR *)args[3],
*(CK_ULONG_PTR *)args[4]);
}
static void
binding_C_DigestUpdate (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_DigestUpdate (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2]);
}
static void
binding_C_DigestKey (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_DigestKey (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_OBJECT_HANDLE *)args[1]);
}
static void
binding_C_DigestFinal (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_DigestFinal (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG_PTR *)args[2]);
}
static void
binding_C_SignInit (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_SignInit (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_MECHANISM_PTR *)args[1],
*(CK_OBJECT_HANDLE *)args[2]);
}
static void
binding_C_Sign (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_Sign (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_BYTE_PTR *)args[3],
*(CK_ULONG_PTR *)args[4]);
}
static void
binding_C_SignUpdate (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_SignUpdate (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2]);
}
static void
binding_C_SignFinal (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_SignFinal (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG_PTR *)args[2]);
}
static void
binding_C_SignRecoverInit (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_SignRecoverInit (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_MECHANISM_PTR *)args[1],
*(CK_OBJECT_HANDLE *)args[2]);
}
static void
binding_C_SignRecover (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_SignRecover (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_BYTE_PTR *)args[3],
*(CK_ULONG_PTR *)args[4]);
}
static void
binding_C_VerifyInit (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_VerifyInit (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_MECHANISM_PTR *)args[1],
*(CK_OBJECT_HANDLE *)args[2]);
}
static void
binding_C_Verify (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_Verify (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_BYTE_PTR *)args[3],
*(CK_ULONG *)args[4]);
}
static void
binding_C_VerifyUpdate (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_VerifyUpdate (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2]);
}
static void
binding_C_VerifyFinal (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_VerifyFinal (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2]);
}
static void
binding_C_VerifyRecoverInit (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_VerifyRecoverInit (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_MECHANISM_PTR *)args[1],
*(CK_OBJECT_HANDLE *)args[2]);
}
static void
binding_C_VerifyRecover (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_VerifyRecover (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_BYTE_PTR *)args[3],
*(CK_ULONG_PTR *)args[4]);
}
static void
binding_C_DigestEncryptUpdate (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_DigestEncryptUpdate (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_BYTE_PTR *)args[3],
*(CK_ULONG_PTR *)args[4]);
}
static void
binding_C_DecryptDigestUpdate (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_DecryptDigestUpdate (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_BYTE_PTR *)args[3],
*(CK_ULONG_PTR *)args[4]);
}
static void
binding_C_SignEncryptUpdate (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_SignEncryptUpdate (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_BYTE_PTR *)args[3],
*(CK_ULONG_PTR *)args[4]);
}
static void
binding_C_DecryptVerifyUpdate (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_DecryptVerifyUpdate (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2],
*(CK_BYTE_PTR *)args[3],
*(CK_ULONG_PTR *)args[4]);
}
static void
binding_C_GenerateKey (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_GenerateKey (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_MECHANISM_PTR *)args[1],
*(CK_ATTRIBUTE_PTR *)args[2],
*(CK_ULONG *)args[3],
*(CK_OBJECT_HANDLE_PTR *)args[4]);
}
static void
binding_C_GenerateKeyPair (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_GenerateKeyPair (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_MECHANISM_PTR *)args[1],
*(CK_ATTRIBUTE_PTR *)args[2],
*(CK_ULONG *)args[3],
*(CK_ATTRIBUTE_PTR *)args[4],
*(CK_ULONG *)args[5],
*(CK_OBJECT_HANDLE_PTR *)args[6],
*(CK_OBJECT_HANDLE_PTR *)args[7]);
}
static void
binding_C_WrapKey (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_WrapKey (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_MECHANISM_PTR *)args[1],
*(CK_OBJECT_HANDLE *)args[2],
*(CK_OBJECT_HANDLE *)args[3],
*(CK_BYTE_PTR *)args[4],
*(CK_ULONG_PTR *)args[5]);
}
static void
binding_C_UnwrapKey (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_UnwrapKey (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_MECHANISM_PTR *)args[1],
*(CK_OBJECT_HANDLE *)args[2],
*(CK_BYTE_PTR *)args[3],
*(CK_ULONG *)args[4],
*(CK_ATTRIBUTE_PTR *)args[5],
*(CK_ULONG *)args[6],
*(CK_OBJECT_HANDLE_PTR *)args[7]);
}
static void
binding_C_DeriveKey (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_DeriveKey (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_MECHANISM_PTR *)args[1],
*(CK_OBJECT_HANDLE *)args[2],
*(CK_ATTRIBUTE_PTR *)args[3],
*(CK_ULONG *)args[4],
*(CK_OBJECT_HANDLE_PTR *)args[5]);
}
static void
binding_C_SeedRandom (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_SeedRandom (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2]);
}
static void
binding_C_GenerateRandom (ffi_cif *cif,
CK_RV *ret,
void* args[],
CK_X_FUNCTION_LIST *funcs)
{
*ret = funcs->C_GenerateRandom (funcs,
*(CK_SESSION_HANDLE *)args[0],
*(CK_BYTE_PTR *)args[1],
*(CK_ULONG *)args[2]);
}
#endif /* WITH_FFI */
static CK_RV
stack_C_Initialize (CK_X_FUNCTION_LIST *self,
CK_VOID_PTR init_args)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Initialize (funcs, init_args);
}
static CK_RV
stack_C_Finalize (CK_X_FUNCTION_LIST *self,
CK_VOID_PTR reserved)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Finalize (funcs, reserved);
}
static CK_RV
stack_C_GetInfo (CK_X_FUNCTION_LIST *self,
CK_INFO_PTR info)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetInfo (funcs, info);
}
static CK_RV
stack_C_GetSlotList (CK_X_FUNCTION_LIST *self,
CK_BBOOL token_present,
CK_SLOT_ID_PTR slot_list,
CK_ULONG_PTR count)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetSlotList (funcs, token_present, slot_list, count);
}
static CK_RV
stack_C_GetSlotInfo (CK_X_FUNCTION_LIST *self,
CK_SLOT_ID slot_id,
CK_SLOT_INFO_PTR info)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetSlotInfo (funcs, slot_id, info);
}
static CK_RV
stack_C_GetTokenInfo (CK_X_FUNCTION_LIST *self,
CK_SLOT_ID slot_id,
CK_TOKEN_INFO_PTR info)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetTokenInfo (funcs, slot_id, info);
}
static CK_RV
stack_C_GetMechanismList (CK_X_FUNCTION_LIST *self,
CK_SLOT_ID slot_id,
CK_MECHANISM_TYPE_PTR mechanism_list,
CK_ULONG_PTR count)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetMechanismList (funcs, slot_id, mechanism_list, count);
}
static CK_RV
stack_C_GetMechanismInfo (CK_X_FUNCTION_LIST *self,
CK_SLOT_ID slot_id,
CK_MECHANISM_TYPE type,
CK_MECHANISM_INFO_PTR info)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetMechanismInfo (funcs, slot_id, type, info);
}
static CK_RV
stack_C_InitToken (CK_X_FUNCTION_LIST *self,
CK_SLOT_ID slot_id,
CK_UTF8CHAR_PTR pin,
CK_ULONG pin_len,
CK_UTF8CHAR_PTR label)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_InitToken (funcs, slot_id, pin, pin_len, label);
}
static CK_RV
stack_C_OpenSession (CK_X_FUNCTION_LIST *self,
CK_SLOT_ID slot_id,
CK_FLAGS flags,
CK_VOID_PTR application,
CK_NOTIFY notify,
CK_SESSION_HANDLE_PTR session)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_OpenSession (funcs, slot_id, flags, application, notify, session);
}
static CK_RV
stack_C_CloseSession (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_CloseSession (funcs, session);
}
static CK_RV
stack_C_CloseAllSessions (CK_X_FUNCTION_LIST *self,
CK_SLOT_ID slot_id)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_CloseAllSessions (funcs, slot_id);
}
static CK_RV
stack_C_GetSessionInfo (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_SESSION_INFO_PTR info)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetSessionInfo (funcs, session, info);
}
static CK_RV
stack_C_InitPIN (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_UTF8CHAR_PTR pin,
CK_ULONG pin_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_InitPIN (funcs, session, pin, pin_len);
}
static CK_RV
stack_C_SetPIN (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_UTF8CHAR_PTR old_pin,
CK_ULONG old_len,
CK_UTF8CHAR_PTR new_pin,
CK_ULONG new_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SetPIN (funcs, session, old_pin, old_len, new_pin, new_len);
}
static CK_RV
stack_C_GetOperationState (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR operation_state,
CK_ULONG_PTR operation_state_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetOperationState (funcs, session, operation_state, operation_state_len);
}
static CK_RV
stack_C_SetOperationState (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR operation_state,
CK_ULONG operation_state_len,
CK_OBJECT_HANDLE encryption_key,
CK_OBJECT_HANDLE authentication_key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SetOperationState (funcs, session, operation_state, operation_state_len,
encryption_key, authentication_key);
}
static CK_RV
stack_C_Login (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_USER_TYPE user_type,
CK_UTF8CHAR_PTR pin,
CK_ULONG pin_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Login (funcs, session, user_type, pin, pin_len);
}
static CK_RV
stack_C_Logout (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Logout (funcs, session);
}
static CK_RV
stack_C_CreateObject (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_ATTRIBUTE_PTR template,
CK_ULONG count,
CK_OBJECT_HANDLE_PTR object)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_CreateObject (funcs, session, template, count, object);
}
static CK_RV
stack_C_CopyObject (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_OBJECT_HANDLE object,
CK_ATTRIBUTE_PTR template,
CK_ULONG count,
CK_OBJECT_HANDLE_PTR new_object)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_CopyObject (funcs, session, object, template, count, new_object);
}
static CK_RV
stack_C_DestroyObject (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_OBJECT_HANDLE object)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DestroyObject (funcs, session, object);
}
static CK_RV
stack_C_GetObjectSize (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_OBJECT_HANDLE object,
CK_ULONG_PTR size)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetObjectSize (funcs, session, object, size);
}
static CK_RV
stack_C_GetAttributeValue (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_OBJECT_HANDLE object,
CK_ATTRIBUTE_PTR template,
CK_ULONG count)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetAttributeValue (funcs, session, object, template, count);
}
static CK_RV
stack_C_SetAttributeValue (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_OBJECT_HANDLE object,
CK_ATTRIBUTE_PTR template,
CK_ULONG count)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SetAttributeValue (funcs, session, object, template, count);
}
static CK_RV
stack_C_FindObjectsInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_ATTRIBUTE_PTR template,
CK_ULONG count)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_FindObjectsInit (funcs, session, template, count);
}
static CK_RV
stack_C_FindObjects (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_OBJECT_HANDLE_PTR object,
CK_ULONG max_object_count,
CK_ULONG_PTR object_count)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_FindObjects (funcs, session, object, max_object_count, object_count);
}
static CK_RV
stack_C_FindObjectsFinal (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_FindObjectsFinal (funcs, session);
}
static CK_RV
stack_C_EncryptInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_EncryptInit (funcs, session, mechanism, key);
}
static CK_RV
stack_C_Encrypt (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR input,
CK_ULONG input_len,
CK_BYTE_PTR encrypted_data,
CK_ULONG_PTR encrypted_data_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Encrypt (funcs, session, input, input_len,
encrypted_data, encrypted_data_len);
}
static CK_RV
stack_C_EncryptUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR part,
CK_ULONG part_len,
CK_BYTE_PTR encrypted_part,
CK_ULONG_PTR encrypted_part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_EncryptUpdate (funcs, session, part, part_len,
encrypted_part, encrypted_part_len);
}
static CK_RV
stack_C_EncryptFinal (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR last_encrypted_part,
CK_ULONG_PTR last_encrypted_part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_EncryptFinal (funcs, session, last_encrypted_part,
last_encrypted_part_len);
}
static CK_RV
stack_C_DecryptInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DecryptInit (funcs, session, mechanism, key);
}
static CK_RV
stack_C_Decrypt (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR encrypted_data,
CK_ULONG encrypted_data_len,
CK_BYTE_PTR output,
CK_ULONG_PTR output_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Decrypt (funcs, session, encrypted_data, encrypted_data_len,
output, output_len);
}
static CK_RV
stack_C_DecryptUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR encrypted_part,
CK_ULONG encrypted_part_len,
CK_BYTE_PTR part,
CK_ULONG_PTR part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DecryptUpdate (funcs, session, encrypted_part, encrypted_part_len,
part, part_len);
}
static CK_RV
stack_C_DecryptFinal (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR last_part,
CK_ULONG_PTR last_part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DecryptFinal (funcs, session, last_part, last_part_len);
}
static CK_RV
stack_C_DigestInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DigestInit (funcs, session, mechanism);
}
static CK_RV
stack_C_Digest (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR input,
CK_ULONG input_len,
CK_BYTE_PTR digest,
CK_ULONG_PTR digest_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Digest (funcs, session, input, input_len, digest, digest_len);
}
static CK_RV
stack_C_DigestUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR part,
CK_ULONG part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DigestUpdate (funcs, session, part, part_len);
}
static CK_RV
stack_C_DigestKey (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_OBJECT_HANDLE key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DigestKey (funcs, session, key);
}
static CK_RV
stack_C_DigestFinal (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR digest,
CK_ULONG_PTR digest_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DigestFinal (funcs, session, digest, digest_len);
}
static CK_RV
stack_C_SignInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SignInit (funcs, session, mechanism, key);
}
static CK_RV
stack_C_Sign (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR input,
CK_ULONG input_len,
CK_BYTE_PTR signature,
CK_ULONG_PTR signature_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Sign (funcs, session, input, input_len,
signature, signature_len);
}
static CK_RV
stack_C_SignUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR part,
CK_ULONG part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SignUpdate (funcs, session, part, part_len);
}
static CK_RV
stack_C_SignFinal (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR signature,
CK_ULONG_PTR signature_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SignFinal (funcs, session, signature, signature_len);
}
static CK_RV
stack_C_SignRecoverInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SignRecoverInit (funcs, session, mechanism, key);
}
static CK_RV
stack_C_SignRecover (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR input,
CK_ULONG input_len,
CK_BYTE_PTR signature,
CK_ULONG_PTR signature_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SignRecover (funcs, session, input, input_len,
signature, signature_len);
}
static CK_RV
stack_C_VerifyInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_VerifyInit (funcs, session, mechanism, key);
}
static CK_RV
stack_C_Verify (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR input,
CK_ULONG input_len,
CK_BYTE_PTR signature,
CK_ULONG signature_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Verify (funcs, session, input, input_len,
signature, signature_len);
}
static CK_RV
stack_C_VerifyUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR part,
CK_ULONG part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_VerifyUpdate (funcs, session, part, part_len);
}
static CK_RV
stack_C_VerifyFinal (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR signature,
CK_ULONG signature_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_VerifyFinal (funcs, session, signature, signature_len);
}
static CK_RV
stack_C_VerifyRecoverInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_VerifyRecoverInit (funcs, session, mechanism, key);
}
static CK_RV
stack_C_VerifyRecover (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR signature,
CK_ULONG signature_len,
CK_BYTE_PTR input,
CK_ULONG_PTR input_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_VerifyRecover (funcs, session, signature, signature_len,
input, input_len);
}
static CK_RV
stack_C_DigestEncryptUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR part,
CK_ULONG part_len,
CK_BYTE_PTR encrypted_part,
CK_ULONG_PTR encrypted_part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DigestEncryptUpdate (funcs, session, part, part_len,
encrypted_part, encrypted_part_len);
}
static CK_RV
stack_C_DecryptDigestUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR encrypted_part,
CK_ULONG encrypted_part_len,
CK_BYTE_PTR part,
CK_ULONG_PTR part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DecryptDigestUpdate (funcs, session, encrypted_part, encrypted_part_len,
part, part_len);
}
static CK_RV
stack_C_SignEncryptUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR part,
CK_ULONG part_len,
CK_BYTE_PTR encrypted_part,
CK_ULONG_PTR encrypted_part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SignEncryptUpdate (funcs, session, part, part_len,
encrypted_part, encrypted_part_len);
}
static CK_RV
stack_C_DecryptVerifyUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR encrypted_part,
CK_ULONG encrypted_part_len,
CK_BYTE_PTR part,
CK_ULONG_PTR part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DecryptVerifyUpdate (funcs, session, encrypted_part, encrypted_part_len,
part, part_len);
}
static CK_RV
stack_C_GenerateKey (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_ATTRIBUTE_PTR template,
CK_ULONG count,
CK_OBJECT_HANDLE_PTR key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GenerateKey (funcs, session, mechanism, template, count, key);
}
static CK_RV
stack_C_GenerateKeyPair (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_ATTRIBUTE_PTR public_key_template,
CK_ULONG public_key_count,
CK_ATTRIBUTE_PTR private_key_template,
CK_ULONG private_key_count,
CK_OBJECT_HANDLE_PTR public_key,
CK_OBJECT_HANDLE_PTR private_key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GenerateKeyPair (funcs, session, mechanism, public_key_template,
public_key_count, private_key_template,
private_key_count, public_key, private_key);
}
static CK_RV
stack_C_WrapKey (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE wrapping_key,
CK_OBJECT_HANDLE key,
CK_BYTE_PTR wrapped_key,
CK_ULONG_PTR wrapped_key_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_WrapKey (funcs, session, mechanism, wrapping_key, key,
wrapped_key, wrapped_key_len);
}
static CK_RV
stack_C_UnwrapKey (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE unwrapping_key,
CK_BYTE_PTR wrapped_key,
CK_ULONG wrapped_key_len,
CK_ATTRIBUTE_PTR template,
CK_ULONG count,
CK_OBJECT_HANDLE_PTR key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_UnwrapKey (funcs, session, mechanism, unwrapping_key, wrapped_key,
wrapped_key_len, template, count, key);
}
static CK_RV
stack_C_DeriveKey (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE base_key,
CK_ATTRIBUTE_PTR template,
CK_ULONG count,
CK_OBJECT_HANDLE_PTR key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DeriveKey (funcs, session, mechanism, base_key, template, count, key);
}
static CK_RV
stack_C_SeedRandom (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR seed,
CK_ULONG seed_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SeedRandom (funcs, session, seed, seed_len);
}
static CK_RV
stack_C_GenerateRandom (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR random_data,
CK_ULONG random_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GenerateRandom (funcs, session, random_data, random_len);
}
static CK_RV
stack_C_WaitForSlotEvent (CK_X_FUNCTION_LIST *self,
CK_FLAGS flags,
CK_SLOT_ID_PTR slot_id,
CK_VOID_PTR reserved)
{
p11_virtual *virt = (p11_virtual *)self;
CK_X_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_WaitForSlotEvent (funcs, flags, slot_id, reserved);
}
static CK_RV
base_C_Initialize (CK_X_FUNCTION_LIST *self,
CK_VOID_PTR init_args)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Initialize (init_args);
}
static CK_RV
base_C_Finalize (CK_X_FUNCTION_LIST *self,
CK_VOID_PTR reserved)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Finalize (reserved);
}
static CK_RV
base_C_GetInfo (CK_X_FUNCTION_LIST *self,
CK_INFO_PTR info)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetInfo (info);
}
static CK_RV
base_C_GetSlotList (CK_X_FUNCTION_LIST *self,
CK_BBOOL token_present,
CK_SLOT_ID_PTR slot_list,
CK_ULONG_PTR count)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetSlotList (token_present, slot_list, count);
}
static CK_RV
base_C_GetSlotInfo (CK_X_FUNCTION_LIST *self,
CK_SLOT_ID slot_id,
CK_SLOT_INFO_PTR info)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetSlotInfo (slot_id, info);
}
static CK_RV
base_C_GetTokenInfo (CK_X_FUNCTION_LIST *self,
CK_SLOT_ID slot_id,
CK_TOKEN_INFO_PTR info)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetTokenInfo (slot_id, info);
}
static CK_RV
base_C_GetMechanismList (CK_X_FUNCTION_LIST *self,
CK_SLOT_ID slot_id,
CK_MECHANISM_TYPE_PTR mechanism_list,
CK_ULONG_PTR count)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetMechanismList (slot_id, mechanism_list, count);
}
static CK_RV
base_C_GetMechanismInfo (CK_X_FUNCTION_LIST *self,
CK_SLOT_ID slot_id,
CK_MECHANISM_TYPE type,
CK_MECHANISM_INFO_PTR info)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetMechanismInfo (slot_id, type, info);
}
static CK_RV
base_C_InitToken (CK_X_FUNCTION_LIST *self,
CK_SLOT_ID slot_id,
CK_UTF8CHAR_PTR pin,
CK_ULONG pin_len,
CK_UTF8CHAR_PTR label)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_InitToken (slot_id, pin, pin_len, label);
}
static CK_RV
base_C_OpenSession (CK_X_FUNCTION_LIST *self,
CK_SLOT_ID slot_id,
CK_FLAGS flags,
CK_VOID_PTR application,
CK_NOTIFY notify,
CK_SESSION_HANDLE_PTR session)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_OpenSession (slot_id, flags, application, notify, session);
}
static CK_RV
base_C_CloseSession (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_CloseSession (session);
}
static CK_RV
base_C_CloseAllSessions (CK_X_FUNCTION_LIST *self,
CK_SLOT_ID slot_id)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_CloseAllSessions (slot_id);
}
static CK_RV
base_C_GetSessionInfo (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_SESSION_INFO_PTR info)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetSessionInfo (session, info);
}
static CK_RV
base_C_InitPIN (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_UTF8CHAR_PTR pin,
CK_ULONG pin_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_InitPIN (session, pin, pin_len);
}
static CK_RV
base_C_SetPIN (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_UTF8CHAR_PTR old_pin,
CK_ULONG old_len,
CK_UTF8CHAR_PTR new_pin,
CK_ULONG new_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SetPIN (session, old_pin, old_len, new_pin, new_len);
}
static CK_RV
base_C_GetOperationState (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR operation_state,
CK_ULONG_PTR operation_state_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetOperationState (session, operation_state, operation_state_len);
}
static CK_RV
base_C_SetOperationState (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR operation_state,
CK_ULONG operation_state_len,
CK_OBJECT_HANDLE encryption_key,
CK_OBJECT_HANDLE authentication_key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SetOperationState (session, operation_state, operation_state_len,
encryption_key, authentication_key);
}
static CK_RV
base_C_Login (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_USER_TYPE user_type,
CK_UTF8CHAR_PTR pin,
CK_ULONG pin_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Login (session, user_type, pin, pin_len);
}
static CK_RV
base_C_Logout (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Logout (session);
}
static CK_RV
base_C_CreateObject (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_ATTRIBUTE_PTR template,
CK_ULONG count,
CK_OBJECT_HANDLE_PTR object)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_CreateObject (session, template, count, object);
}
static CK_RV
base_C_CopyObject (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_OBJECT_HANDLE object,
CK_ATTRIBUTE_PTR template,
CK_ULONG count,
CK_OBJECT_HANDLE_PTR new_object)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_CopyObject (session, object, template, count, new_object);
}
static CK_RV
base_C_DestroyObject (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_OBJECT_HANDLE object)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DestroyObject (session, object);
}
static CK_RV
base_C_GetObjectSize (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_OBJECT_HANDLE object,
CK_ULONG_PTR size)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetObjectSize (session, object, size);
}
static CK_RV
base_C_GetAttributeValue (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_OBJECT_HANDLE object,
CK_ATTRIBUTE_PTR template,
CK_ULONG count)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GetAttributeValue (session, object, template, count);
}
static CK_RV
base_C_SetAttributeValue (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_OBJECT_HANDLE object,
CK_ATTRIBUTE_PTR template,
CK_ULONG count)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SetAttributeValue (session, object, template, count);
}
static CK_RV
base_C_FindObjectsInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_ATTRIBUTE_PTR template,
CK_ULONG count)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_FindObjectsInit (session, template, count);
}
static CK_RV
base_C_FindObjects (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_OBJECT_HANDLE_PTR object,
CK_ULONG max_object_count,
CK_ULONG_PTR object_count)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_FindObjects (session, object, max_object_count, object_count);
}
static CK_RV
base_C_FindObjectsFinal (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_FindObjectsFinal (session);
}
static CK_RV
base_C_EncryptInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_EncryptInit (session, mechanism, key);
}
static CK_RV
base_C_Encrypt (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR input,
CK_ULONG input_len,
CK_BYTE_PTR encrypted_data,
CK_ULONG_PTR encrypted_data_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Encrypt (session, input, input_len,
encrypted_data, encrypted_data_len);
}
static CK_RV
base_C_EncryptUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR part,
CK_ULONG part_len,
CK_BYTE_PTR encrypted_part,
CK_ULONG_PTR encrypted_part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_EncryptUpdate (session, part, part_len,
encrypted_part, encrypted_part_len);
}
static CK_RV
base_C_EncryptFinal (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR last_encrypted_part,
CK_ULONG_PTR last_encrypted_part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_EncryptFinal (session, last_encrypted_part,
last_encrypted_part_len);
}
static CK_RV
base_C_DecryptInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DecryptInit (session, mechanism, key);
}
static CK_RV
base_C_Decrypt (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR encrypted_data,
CK_ULONG encrypted_data_len,
CK_BYTE_PTR output,
CK_ULONG_PTR output_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Decrypt (session, encrypted_data, encrypted_data_len,
output, output_len);
}
static CK_RV
base_C_DecryptUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR encrypted_part,
CK_ULONG encrypted_part_len,
CK_BYTE_PTR part,
CK_ULONG_PTR part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DecryptUpdate (session, encrypted_part, encrypted_part_len,
part, part_len);
}
static CK_RV
base_C_DecryptFinal (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR last_part,
CK_ULONG_PTR last_part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DecryptFinal (session, last_part, last_part_len);
}
static CK_RV
base_C_DigestInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DigestInit (session, mechanism);
}
static CK_RV
base_C_Digest (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR input,
CK_ULONG input_len,
CK_BYTE_PTR digest,
CK_ULONG_PTR digest_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Digest (session, input, input_len, digest, digest_len);
}
static CK_RV
base_C_DigestUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR part,
CK_ULONG part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DigestUpdate (session, part, part_len);
}
static CK_RV
base_C_DigestKey (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_OBJECT_HANDLE key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DigestKey (session, key);
}
static CK_RV
base_C_DigestFinal (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR digest,
CK_ULONG_PTR digest_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DigestFinal (session, digest, digest_len);
}
static CK_RV
base_C_SignInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SignInit (session, mechanism, key);
}
static CK_RV
base_C_Sign (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR input,
CK_ULONG input_len,
CK_BYTE_PTR signature,
CK_ULONG_PTR signature_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Sign (session, input, input_len,
signature, signature_len);
}
static CK_RV
base_C_SignUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR part,
CK_ULONG part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SignUpdate (session, part, part_len);
}
static CK_RV
base_C_SignFinal (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR signature,
CK_ULONG_PTR signature_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SignFinal (session, signature, signature_len);
}
static CK_RV
base_C_SignRecoverInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SignRecoverInit (session, mechanism, key);
}
static CK_RV
base_C_SignRecover (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR input,
CK_ULONG input_len,
CK_BYTE_PTR signature,
CK_ULONG_PTR signature_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SignRecover (session, input, input_len,
signature, signature_len);
}
static CK_RV
base_C_VerifyInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_VerifyInit (session, mechanism, key);
}
static CK_RV
base_C_Verify (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR input,
CK_ULONG input_len,
CK_BYTE_PTR signature,
CK_ULONG signature_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_Verify (session, input, input_len,
signature, signature_len);
}
static CK_RV
base_C_VerifyUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR part,
CK_ULONG part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_VerifyUpdate (session, part, part_len);
}
static CK_RV
base_C_VerifyFinal (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR signature,
CK_ULONG signature_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_VerifyFinal (session, signature, signature_len);
}
static CK_RV
base_C_VerifyRecoverInit (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_VerifyRecoverInit (session, mechanism, key);
}
static CK_RV
base_C_VerifyRecover (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR signature,
CK_ULONG signature_len,
CK_BYTE_PTR input,
CK_ULONG_PTR input_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_VerifyRecover (session, signature, signature_len,
input, input_len);
}
static CK_RV
base_C_DigestEncryptUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR part,
CK_ULONG part_len,
CK_BYTE_PTR encrypted_part,
CK_ULONG_PTR encrypted_part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DigestEncryptUpdate (session, part, part_len,
encrypted_part, encrypted_part_len);
}
static CK_RV
base_C_DecryptDigestUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR encrypted_part,
CK_ULONG encrypted_part_len,
CK_BYTE_PTR part,
CK_ULONG_PTR part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DecryptDigestUpdate (session, encrypted_part, encrypted_part_len,
part, part_len);
}
static CK_RV
base_C_SignEncryptUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR part,
CK_ULONG part_len,
CK_BYTE_PTR encrypted_part,
CK_ULONG_PTR encrypted_part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SignEncryptUpdate (session, part, part_len,
encrypted_part, encrypted_part_len);
}
static CK_RV
base_C_DecryptVerifyUpdate (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR encrypted_part,
CK_ULONG encrypted_part_len,
CK_BYTE_PTR part,
CK_ULONG_PTR part_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DecryptVerifyUpdate (session, encrypted_part, encrypted_part_len,
part, part_len);
}
static CK_RV
base_C_GenerateKey (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_ATTRIBUTE_PTR template,
CK_ULONG count,
CK_OBJECT_HANDLE_PTR key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GenerateKey (session, mechanism, template, count, key);
}
static CK_RV
base_C_GenerateKeyPair (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_ATTRIBUTE_PTR public_key_template,
CK_ULONG public_key_count,
CK_ATTRIBUTE_PTR private_key_template,
CK_ULONG private_key_count,
CK_OBJECT_HANDLE_PTR public_key,
CK_OBJECT_HANDLE_PTR private_key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GenerateKeyPair (session, mechanism, public_key_template,
public_key_count, private_key_template,
private_key_count, public_key, private_key);
}
static CK_RV
base_C_WrapKey (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE wrapping_key,
CK_OBJECT_HANDLE key,
CK_BYTE_PTR wrapped_key,
CK_ULONG_PTR wrapped_key_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_WrapKey (session, mechanism, wrapping_key, key,
wrapped_key, wrapped_key_len);
}
static CK_RV
base_C_UnwrapKey (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE unwrapping_key,
CK_BYTE_PTR wrapped_key,
CK_ULONG wrapped_key_len,
CK_ATTRIBUTE_PTR template,
CK_ULONG count,
CK_OBJECT_HANDLE_PTR key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_UnwrapKey (session, mechanism, unwrapping_key, wrapped_key,
wrapped_key_len, template, count, key);
}
static CK_RV
base_C_DeriveKey (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_MECHANISM_PTR mechanism,
CK_OBJECT_HANDLE base_key,
CK_ATTRIBUTE_PTR template,
CK_ULONG count,
CK_OBJECT_HANDLE_PTR key)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_DeriveKey (session, mechanism, base_key, template, count, key);
}
static CK_RV
base_C_SeedRandom (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR seed,
CK_ULONG seed_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_SeedRandom (session, seed, seed_len);
}
static CK_RV
base_C_GenerateRandom (CK_X_FUNCTION_LIST *self,
CK_SESSION_HANDLE session,
CK_BYTE_PTR random_data,
CK_ULONG random_len)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_GenerateRandom (session, random_data, random_len);
}
static CK_RV
base_C_WaitForSlotEvent (CK_X_FUNCTION_LIST *self,
CK_FLAGS flags,
CK_SLOT_ID_PTR slot_id,
CK_VOID_PTR reserved)
{
p11_virtual *virt = (p11_virtual *)self;
CK_FUNCTION_LIST *funcs = virt->lower_module;
return funcs->C_WaitForSlotEvent (flags, slot_id, reserved);
}
void
p11_virtual_init (p11_virtual *virt,
CK_X_FUNCTION_LIST *funcs,
void *lower_module,
p11_destroyer lower_destroy)
{
memcpy (virt, funcs, sizeof (CK_X_FUNCTION_LIST));
virt->lower_module = lower_module;
virt->lower_destroy = lower_destroy;
}
void
p11_virtual_uninit (p11_virtual *virt)
{
if (virt->lower_destroy)
(virt->lower_destroy) (virt->lower_module);
}
#ifdef WITH_FFI
typedef struct {
const char *name;
void *binding_function;
void *stack_fallback;
size_t virtual_offset;
void *base_fallback;
size_t module_offset;
ffi_type *types[MAX_ARGS];
} FunctionInfo;
#define STRUCT_OFFSET(struct_type, member) \
((size_t) ((unsigned char *) &((struct_type *) 0)->member))
#define STRUCT_MEMBER_P(struct_p, struct_offset) \
((void *) ((unsigned char *) (struct_p) + (long) (struct_offset)))
#define STRUCT_MEMBER(member_type, struct_p, struct_offset) \
(*(member_type*) STRUCT_MEMBER_P ((struct_p), (struct_offset)))
#define FUNCTION(name) \
#name, binding_C_##name, \
stack_C_##name, STRUCT_OFFSET (CK_X_FUNCTION_LIST, C_##name), \
base_C_##name, STRUCT_OFFSET (CK_FUNCTION_LIST, C_##name)
static const FunctionInfo function_info[] = {
{ FUNCTION (Initialize), { &ffi_type_pointer, NULL } },
{ FUNCTION (Finalize), { &ffi_type_pointer, NULL } },
{ FUNCTION (GetInfo), { &ffi_type_pointer, NULL } },
{ FUNCTION (GetSlotList), { &ffi_type_uchar, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (GetSlotInfo), { &ffi_type_ulong, &ffi_type_pointer, NULL } },
{ FUNCTION (GetTokenInfo), { &ffi_type_ulong, &ffi_type_pointer, NULL } },
{ FUNCTION (WaitForSlotEvent), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (GetMechanismList), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (GetMechanismInfo), { &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, NULL } },
{ FUNCTION (InitToken), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, NULL } },
{ FUNCTION (InitPIN), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (SetPIN), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (OpenSession), { &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (CloseSession), { &ffi_type_ulong, NULL } },
{ FUNCTION (CloseAllSessions), { &ffi_type_ulong, NULL } },
{ FUNCTION (GetSessionInfo), { &ffi_type_ulong, &ffi_type_pointer, NULL } },
{ FUNCTION (GetOperationState), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (SetOperationState), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_ulong, &ffi_type_ulong, NULL } },
{ FUNCTION (Login), { &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (Logout), { &ffi_type_ulong, NULL } },
{ FUNCTION (CreateObject), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, NULL } },
{ FUNCTION (CopyObject), { &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, NULL } },
{ FUNCTION (DestroyObject), { &ffi_type_ulong, &ffi_type_ulong, NULL } },
{ FUNCTION (GetObjectSize), { &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, NULL } },
{ FUNCTION (GetAttributeValue), { &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (SetAttributeValue), { &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (FindObjectsInit), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (FindObjects), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, NULL } },
{ FUNCTION (FindObjectsFinal), { &ffi_type_ulong, NULL } },
{ FUNCTION (EncryptInit), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (Encrypt), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (EncryptUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (EncryptFinal), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (DecryptInit), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (Decrypt), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (DecryptUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (DecryptFinal), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (DigestInit), { &ffi_type_ulong, &ffi_type_pointer, NULL } },
{ FUNCTION (Digest), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (DigestUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (DigestKey), { &ffi_type_ulong, &ffi_type_ulong, NULL } },
{ FUNCTION (DigestFinal), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (SignInit), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (Sign), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (SignUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (SignFinal), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (SignRecoverInit), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (SignRecover), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (VerifyInit), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (Verify), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (VerifyUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (VerifyFinal), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (VerifyRecoverInit), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (VerifyRecover), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (DigestEncryptUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (DecryptDigestUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (SignEncryptUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (DecryptVerifyUpdate), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (GenerateKey), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, NULL } },
{ FUNCTION (GenerateKeyPair), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (WrapKey), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_pointer, NULL } },
{ FUNCTION (UnwrapKey), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, NULL } },
{ FUNCTION (DeriveKey), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, &ffi_type_pointer, NULL } },
{ FUNCTION (SeedRandom), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ FUNCTION (GenerateRandom), { &ffi_type_ulong, &ffi_type_pointer, &ffi_type_ulong, NULL } },
{ 0, }
};
static bool
lookup_fall_through (p11_virtual *virt,
const FunctionInfo *info,
void **bound_func)
{
void *func;
/*
* So the basic concept here is if we have only fall-through functions
* all the way down the stack, then we can just get the actual module
* function, so that calls go right through.
*/
func = STRUCT_MEMBER (void *, virt, info->virtual_offset);
/*
* This is a fall-through function and the stack goes down further, so
* ask the next level down for the
*/
if (func == info->stack_fallback) {
return lookup_fall_through (virt->lower_module, info, bound_func);
/*
* This is a fall-through function at the bottom level of the stack
* so return the function from the module.
*/
} else if (func == info->base_fallback) {
*bound_func = STRUCT_MEMBER (void *, virt->lower_module, info->module_offset);
return true;
}
return false;
}
static bool
bind_ffi_closure (Wrapper *wrapper,
void *binding_data,
void *binding_func,
ffi_type **args,
void **bound_func)
{
ffi_closure *clo;
ffi_cif *cif;
int nargs = 0;
int i = 0;
int ret;
assert (wrapper->ffi_used < MAX_FUNCTIONS);
cif = wrapper->ffi_cifs + wrapper->ffi_used;
/* The number of arguments */
for (i = 0, nargs = 0; args[i] != NULL; i++)
nargs++;
assert (nargs <= MAX_ARGS);
/*
* The failures here are unexpected conditions. There's a chance they
* might occur on other esoteric platforms, so we take a little
* extra care to print relevant debugging info, and return a status,
* so that we can get back useful debug info on platforms that we
* don't have access to.
*/
ret = ffi_prep_cif (cif, FFI_DEFAULT_ABI, nargs, &ffi_type_ulong, args);
if (ret != FFI_OK) {
p11_debug_precond ("ffi_prep_cif failed: %d\n", ret);
return false;
}
clo = ffi_closure_alloc (sizeof (ffi_closure), bound_func);
if (clo == NULL) {
p11_debug_precond ("ffi_closure_alloc failed\n");
return false;
}
ret = ffi_prep_closure_loc (clo, cif, binding_func, binding_data, *bound_func);
if (ret != FFI_OK) {
p11_debug_precond ("ffi_prep_closure_loc failed: %d\n", ret);
return false;
}
wrapper->ffi_closures[wrapper->ffi_used] = clo;
wrapper->ffi_used++;
return true;
}
static bool
init_wrapper_funcs (Wrapper *wrapper)
{
static const ffi_type *get_function_list_args[] = { &ffi_type_pointer, NULL };
const FunctionInfo *info;
CK_X_FUNCTION_LIST *over;
void **bound;
int i;
/* Pointer to where our calls go */
over = &wrapper->virt->funcs;
for (i = 0; function_info[i].name != NULL; i++) {
info = function_info + i;
/* Address to where we're placing the bound function */
bound = &STRUCT_MEMBER (void *, &wrapper->bound, info->module_offset);
/*
* See if we can just shoot straight through to the module function
* without wrapping at all. If all the stacked virtual modules just
* fall through, then this returns the original module function.
*/
if (!lookup_fall_through (wrapper->virt, info, bound)) {
if (!bind_ffi_closure (wrapper, over,
info->binding_function,
(ffi_type **)info->types, bound))
return_val_if_reached (false);
}
}
/* Always bind the C_GetFunctionList function itself */
if (!bind_ffi_closure (wrapper, wrapper,
binding_C_GetFunctionList,
(ffi_type **)get_function_list_args,
(void **)&wrapper->bound.C_GetFunctionList))
return_val_if_reached (false);
/*
* These functions are used as a marker to indicate whether this is
* one of our CK_FUNCTION_LIST_PTR sets of functions or not. These
* functions are defined to always have the same standard implementation
* in PKCS#11 2.x so we don't need to call through to the base for
* these guys.
*/
wrapper->bound.C_CancelFunction = short_C_CancelFunction;
wrapper->bound.C_GetFunctionStatus = short_C_GetFunctionStatus;
return true;
}
static void
uninit_wrapper_funcs (Wrapper *wrapper)
{
int i;
for (i = 0; i < wrapper->ffi_used; i++)
ffi_closure_free (wrapper->ffi_closures[i]);
}
CK_FUNCTION_LIST *
p11_virtual_wrap (p11_virtual *virt,
p11_destroyer destroyer)
{
Wrapper *wrapper;
return_val_if_fail (virt != NULL, NULL);
wrapper = calloc (1, sizeof (Wrapper));
return_val_if_fail (wrapper != NULL, NULL);
wrapper->virt = virt;
wrapper->destroyer = destroyer;
wrapper->bound.version.major = CRYPTOKI_VERSION_MAJOR;
wrapper->bound.version.minor = CRYPTOKI_VERSION_MINOR;
if (!init_wrapper_funcs (wrapper))
return_val_if_reached (NULL);
assert ((void *)wrapper == (void *)&wrapper->bound);
assert (p11_virtual_is_wrapper (&wrapper->bound));
assert (wrapper->bound.C_GetFunctionList != NULL);
return &wrapper->bound;
}
bool
p11_virtual_can_wrap (void)
{
return TRUE;
}
bool
p11_virtual_is_wrapper (CK_FUNCTION_LIST_PTR module)
{
/*
* We use these functions as a marker to indicate whether this is
* one of our CK_FUNCTION_LIST_PTR sets of functions or not. These
* functions are defined to always have the same standard implementation
* in PKCS#11 2.x so we don't need to call through to the base for
* these guys.
*/
return (module->C_GetFunctionStatus == short_C_GetFunctionStatus &&
module->C_CancelFunction == short_C_CancelFunction);
}
void
p11_virtual_unwrap (CK_FUNCTION_LIST_PTR module)
{
Wrapper *wrapper;
return_if_fail (p11_virtual_is_wrapper (module));
/* The bound CK_FUNCTION_LIST_PTR sits at the front of Context */
wrapper = (Wrapper *)module;
/*
* Make sure that the CK_FUNCTION_LIST_PTR is invalid, and that
* p11_virtual_is_wrapper() recognizes this. This is in case the
* destroyer callback tries to do something fancy.
*/
memset (&wrapper->bound, 0xFEEEFEEE, sizeof (wrapper->bound));
if (wrapper->destroyer)
(wrapper->destroyer) (wrapper->virt);
uninit_wrapper_funcs (wrapper);
free (wrapper);
}
#else /* !WITH_FFI */
CK_FUNCTION_LIST *
p11_virtual_wrap (p11_virtual *virt,
p11_destroyer destroyer)
{
assert_not_reached ();
}
bool
p11_virtual_can_wrap (void)
{
return FALSE;
}
bool
p11_virtual_is_wrapper (CK_FUNCTION_LIST_PTR module)
{
return FALSE;
}
void
p11_virtual_unwrap (CK_FUNCTION_LIST_PTR module)
{
assert_not_reached ();
}
#endif /* !WITH_FFI */
CK_X_FUNCTION_LIST p11_virtual_stack = {
{ CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR }, /* version */
stack_C_Initialize,
stack_C_Finalize,
stack_C_GetInfo,
stack_C_GetSlotList,
stack_C_GetSlotInfo,
stack_C_GetTokenInfo,
stack_C_GetMechanismList,
stack_C_GetMechanismInfo,
stack_C_InitToken,
stack_C_InitPIN,
stack_C_SetPIN,
stack_C_OpenSession,
stack_C_CloseSession,
stack_C_CloseAllSessions,
stack_C_GetSessionInfo,
stack_C_GetOperationState,
stack_C_SetOperationState,
stack_C_Login,
stack_C_Logout,
stack_C_CreateObject,
stack_C_CopyObject,
stack_C_DestroyObject,
stack_C_GetObjectSize,
stack_C_GetAttributeValue,
stack_C_SetAttributeValue,
stack_C_FindObjectsInit,
stack_C_FindObjects,
stack_C_FindObjectsFinal,
stack_C_EncryptInit,
stack_C_Encrypt,
stack_C_EncryptUpdate,
stack_C_EncryptFinal,
stack_C_DecryptInit,
stack_C_Decrypt,
stack_C_DecryptUpdate,
stack_C_DecryptFinal,
stack_C_DigestInit,
stack_C_Digest,
stack_C_DigestUpdate,
stack_C_DigestKey,
stack_C_DigestFinal,
stack_C_SignInit,
stack_C_Sign,
stack_C_SignUpdate,
stack_C_SignFinal,
stack_C_SignRecoverInit,
stack_C_SignRecover,
stack_C_VerifyInit,
stack_C_Verify,
stack_C_VerifyUpdate,
stack_C_VerifyFinal,
stack_C_VerifyRecoverInit,
stack_C_VerifyRecover,
stack_C_DigestEncryptUpdate,
stack_C_DecryptDigestUpdate,
stack_C_SignEncryptUpdate,
stack_C_DecryptVerifyUpdate,
stack_C_GenerateKey,
stack_C_GenerateKeyPair,
stack_C_WrapKey,
stack_C_UnwrapKey,
stack_C_DeriveKey,
stack_C_SeedRandom,
stack_C_GenerateRandom,
stack_C_WaitForSlotEvent
};
CK_X_FUNCTION_LIST p11_virtual_base = {
{ CRYPTOKI_VERSION_MAJOR, CRYPTOKI_VERSION_MINOR }, /* version */
base_C_Initialize,
base_C_Finalize,
base_C_GetInfo,
base_C_GetSlotList,
base_C_GetSlotInfo,
base_C_GetTokenInfo,
base_C_GetMechanismList,
base_C_GetMechanismInfo,
base_C_InitToken,
base_C_InitPIN,
base_C_SetPIN,
base_C_OpenSession,
base_C_CloseSession,
base_C_CloseAllSessions,
base_C_GetSessionInfo,
base_C_GetOperationState,
base_C_SetOperationState,
base_C_Login,
base_C_Logout,
base_C_CreateObject,
base_C_CopyObject,
base_C_DestroyObject,
base_C_GetObjectSize,
base_C_GetAttributeValue,
base_C_SetAttributeValue,
base_C_FindObjectsInit,
base_C_FindObjects,
base_C_FindObjectsFinal,
base_C_EncryptInit,
base_C_Encrypt,
base_C_EncryptUpdate,
base_C_EncryptFinal,
base_C_DecryptInit,
base_C_Decrypt,
base_C_DecryptUpdate,
base_C_DecryptFinal,
base_C_DigestInit,
base_C_Digest,
base_C_DigestUpdate,
base_C_DigestKey,
base_C_DigestFinal,
base_C_SignInit,
base_C_Sign,
base_C_SignUpdate,
base_C_SignFinal,
base_C_SignRecoverInit,
base_C_SignRecover,
base_C_VerifyInit,
base_C_Verify,
base_C_VerifyUpdate,
base_C_VerifyFinal,
base_C_VerifyRecoverInit,
base_C_VerifyRecover,
base_C_DigestEncryptUpdate,
base_C_DecryptDigestUpdate,
base_C_SignEncryptUpdate,
base_C_DecryptVerifyUpdate,
base_C_GenerateKey,
base_C_GenerateKeyPair,
base_C_WrapKey,
base_C_UnwrapKey,
base_C_DeriveKey,
base_C_SeedRandom,
base_C_GenerateRandom,
base_C_WaitForSlotEvent
};
| {
"content_hash": "a2240fe2de72056157399125bbd264c8",
"timestamp": "",
"source": "github",
"line_count": 2931,
"max_line_length": 188,
"avg_line_length": 33.77140907540089,
"alnum_prop": 0.5423401761900913,
"repo_name": "Distrotech/p11-kit",
"id": "104ece0f96b67dfb91888ed2d2f6800cc72ae5ee",
"size": "100635",
"binary": false,
"copies": "1",
"ref": "refs/heads/distrotech-p11-kit",
"path": "p11-kit/virtual.c",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "1852403"
},
{
"name": "C++",
"bytes": "15898"
},
{
"name": "CSS",
"bytes": "1696"
},
{
"name": "Objective-C",
"bytes": "115406"
},
{
"name": "PHP",
"bytes": "1349"
},
{
"name": "Shell",
"bytes": "676397"
},
{
"name": "XSLT",
"bytes": "1600"
}
],
"symlink_target": ""
} |
<component name="libraryTable">
<library name="play-services-identity-8.1.0">
<CLASSES>
<root url="file://$PROJECT_DIR$/ParseStarterProject/build/intermediates/exploded-aar/com.google.android.gms/play-services-identity/8.1.0/res" />
<root url="jar://$PROJECT_DIR$/ParseStarterProject/build/intermediates/exploded-aar/com.google.android.gms/play-services-identity/8.1.0/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component> | {
"content_hash": "71091ad6765f78aa2c65c50380bd1a09",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 164,
"avg_line_length": 48.2,
"alnum_prop": 0.7074688796680498,
"repo_name": "Matt-F-Wu/GroceryRunnerNative",
"id": "ff8840c2748fb94a701ac6b94feaa79a7baa3a6f",
"size": "482",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": ".idea/libraries/play_services_identity_8_1_0.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "3223"
},
{
"name": "HTML",
"bytes": "903"
},
{
"name": "Java",
"bytes": "2957752"
}
],
"symlink_target": ""
} |
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Security;
using System.Text;
using Khronos;
#endregion
// ReSharper disable StringLiteralTypo
// ReSharper disable CheckNamespace
// ReSharper disable InconsistentNaming
// ReSharper disable JoinDeclarationAndInitializer
// ReSharper disable InvalidXmlDocComment
// ReSharper disable CommentTypo
namespace OpenGL
{
public partial class Gl
{
/// <summary>
/// [GL] Value of GL_UNPACK_COMPRESSED_BLOCK_WIDTH symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_compressed_texture_pixel_storage", Api = "gl|glcore")]
public const int UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127;
/// <summary>
/// [GL] Value of GL_UNPACK_COMPRESSED_BLOCK_HEIGHT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_compressed_texture_pixel_storage", Api = "gl|glcore")]
public const int UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128;
/// <summary>
/// [GL] Value of GL_UNPACK_COMPRESSED_BLOCK_DEPTH symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_compressed_texture_pixel_storage", Api = "gl|glcore")]
public const int UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129;
/// <summary>
/// [GL] Value of GL_UNPACK_COMPRESSED_BLOCK_SIZE symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_compressed_texture_pixel_storage", Api = "gl|glcore")]
public const int UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A;
/// <summary>
/// [GL] Value of GL_PACK_COMPRESSED_BLOCK_WIDTH symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_compressed_texture_pixel_storage", Api = "gl|glcore")]
public const int PACK_COMPRESSED_BLOCK_WIDTH = 0x912B;
/// <summary>
/// [GL] Value of GL_PACK_COMPRESSED_BLOCK_HEIGHT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_compressed_texture_pixel_storage", Api = "gl|glcore")]
public const int PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C;
/// <summary>
/// [GL] Value of GL_PACK_COMPRESSED_BLOCK_DEPTH symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_compressed_texture_pixel_storage", Api = "gl|glcore")]
public const int PACK_COMPRESSED_BLOCK_DEPTH = 0x912D;
/// <summary>
/// [GL] Value of GL_PACK_COMPRESSED_BLOCK_SIZE symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_compressed_texture_pixel_storage", Api = "gl|glcore")]
public const int PACK_COMPRESSED_BLOCK_SIZE = 0x912E;
/// <summary>
/// [GL] Value of GL_NUM_SAMPLE_COUNTS symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_0", Api = "gles2")]
[RequiredByFeature("GL_ARB_internalformat_query", Api = "gl|glcore")]
[RequiredByFeature("GL_ARB_internalformat_query2", Api = "gl|glcore")]
public const int NUM_SAMPLE_COUNTS = 0x9380;
/// <summary>
/// [GL4] Gl.Get: data returns one value, the minimum alignment in basic machine units of pointers returned
/// fromGl.MapBuffer
/// and Gl.MapBufferRange. This value must be a power of two and must be at least 64.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_map_buffer_alignment", Api = "gl|glcore")]
public const int MIN_MAP_BUFFER_ALIGNMENT = 0x90BC;
/// <summary>
/// [GL4|GLES3.2] Gl.GetProgramInterface: The query is targeted at the set of active atomic counter buffer binding points
/// within program.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_program_interface_query", Api = "gl|glcore")]
[RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int ATOMIC_COUNTER_BUFFER = 0x92C0;
/// <summary>
/// [GL] Value of GL_ATOMIC_COUNTER_BUFFER_BINDING symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1;
/// <summary>
/// [GL] Value of GL_ATOMIC_COUNTER_BUFFER_START symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int ATOMIC_COUNTER_BUFFER_START = 0x92C2;
/// <summary>
/// [GL] Value of GL_ATOMIC_COUNTER_BUFFER_SIZE symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3;
/// <summary>
/// [GL] Value of GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4;
/// <summary>
/// [GL] Value of GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5;
/// <summary>
/// [GL] Value of GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6;
/// <summary>
/// [GL] Value of GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7;
/// <summary>
/// [GL] Value of GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8;
/// <summary>
/// [GL] Value of GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9;
/// <summary>
/// [GL] Value of GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA;
/// <summary>
/// [GL] Value of GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB;
/// <summary>
/// [GL] Value of GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC;
/// <summary>
/// [GLES3.2] Gl.Get: data returns a single value, the maximum number of atomic counter buffers that may be accessed by a
/// tesselation control shader.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_2", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_tessellation_shader", Api = "gles2")]
[RequiredByFeature("GL_OES_tessellation_shader", Api = "gles2")]
public const int MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD;
/// <summary>
/// [GLES3.2] Gl.Get: data returns a single value, the maximum number of atomic counter buffers that may be accessed by a
/// tesselation evaluation shader.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_2", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_tessellation_shader", Api = "gles2")]
[RequiredByFeature("GL_OES_tessellation_shader", Api = "gles2")]
public const int MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE;
/// <summary>
/// [GLES3.2] Gl.Get: data returns a single value, the maximum number of atomic counter buffers that may be accessed by a
/// geometry shader.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_2", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_geometry_shader", Api = "gles2")]
[RequiredByFeature("GL_OES_geometry_shader", Api = "gles2")]
public const int MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF;
/// <summary>
/// [GLES3.2] Gl.Get: data returns a single value, the maximum number of atomic counter buffers that may be accessed by a
/// fragment shader. In GL ES 3.1, the minimum value is 0. in GL ES 3.2, the minimum value is 1.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0;
/// <summary>
/// [GL] Value of GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1;
/// <summary>
/// [GL4|GLES3.2] Gl.Get: data returns a single value, the maximum number of atomic counters available to vertex shaders.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2;
/// <summary>
/// [GL4|GLES3.2] Gl.Get: data returns a single value, the maximum number of atomic counters available to tessellation
/// control shaders.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_2", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_tessellation_shader", Api = "gles2")]
[RequiredByFeature("GL_OES_tessellation_shader", Api = "gles2")]
public const int MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3;
/// <summary>
/// [GL4|GLES3.2] Gl.Get: data returns a single value, the maximum number of atomic counters available to tessellation
/// evaluation shaders.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_2", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_tessellation_shader", Api = "gles2")]
[RequiredByFeature("GL_OES_tessellation_shader", Api = "gles2")]
public const int MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4;
/// <summary>
/// [GL4|GLES3.2] Gl.Get: data returns a single value, the maximum number of atomic counters available to geometry shaders.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_2", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_geometry_shader", Api = "gles2")]
[RequiredByFeature("GL_OES_geometry_shader", Api = "gles2")]
public const int MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5;
/// <summary>
/// <para>
/// [GL4] Gl.Get: data returns a single value, the maximum number of atomic counters available to fragment shaders.
/// </para>
/// <para>
/// [GLES3.2] Gl.Get: data returns a single value, the maximum number of atomic counters available to fragment shaders.
/// In
/// GL ES 3.1, the minimum value is 0. in GL ES 3.2, the minimum value is 8.
/// </para>
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6;
/// <summary>
/// [GL4|GLES3.2] Gl.Get: data returns a single value, the maximum number of atomic counters available to all active
/// shaders.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7;
/// <summary>
/// [GL] Value of GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8;
/// <summary>
/// [GLES3.2] Gl.Get: data returns one value, the maximum number of atomic counter buffer binding points. The value must be
/// at least 1. See Gl.BindBuffer, Gl.BindBufferBase, and Gl.BindBufferRange.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC;
/// <summary>
/// [GL4|GLES3.2] Gl.GetProgram: params returns the number of active attribute atomic counter buffers used by program.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9;
/// <summary>
/// [GL] Value of GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA;
/// <summary>
/// [GL] Value of GL_UNSIGNED_INT_ATOMIC_COUNTER symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public const int UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB;
/// <summary>
/// [GL] Value of GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const uint VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x00000001;
/// <summary>
/// [GL] Value of GL_ELEMENT_ARRAY_BARRIER_BIT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const uint ELEMENT_ARRAY_BARRIER_BIT = 0x00000002;
/// <summary>
/// [GL] Value of GL_UNIFORM_BARRIER_BIT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const uint UNIFORM_BARRIER_BIT = 0x00000004;
/// <summary>
/// [GL] Value of GL_TEXTURE_FETCH_BARRIER_BIT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const uint TEXTURE_FETCH_BARRIER_BIT = 0x00000008;
/// <summary>
/// [GL] Value of GL_SHADER_IMAGE_ACCESS_BARRIER_BIT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const uint SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x00000020;
/// <summary>
/// [GL] Value of GL_COMMAND_BARRIER_BIT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const uint COMMAND_BARRIER_BIT = 0x00000040;
/// <summary>
/// [GL] Value of GL_PIXEL_BUFFER_BARRIER_BIT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const uint PIXEL_BUFFER_BARRIER_BIT = 0x00000080;
/// <summary>
/// [GL] Value of GL_TEXTURE_UPDATE_BARRIER_BIT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const uint TEXTURE_UPDATE_BARRIER_BIT = 0x00000100;
/// <summary>
/// [GL] Value of GL_BUFFER_UPDATE_BARRIER_BIT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const uint BUFFER_UPDATE_BARRIER_BIT = 0x00000200;
/// <summary>
/// [GL] Value of GL_FRAMEBUFFER_BARRIER_BIT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const uint FRAMEBUFFER_BARRIER_BIT = 0x00000400;
/// <summary>
/// [GL] Value of GL_TRANSFORM_FEEDBACK_BARRIER_BIT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const uint TRANSFORM_FEEDBACK_BARRIER_BIT = 0x00000800;
/// <summary>
/// [GL] Value of GL_ATOMIC_COUNTER_BARRIER_BIT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const uint ATOMIC_COUNTER_BARRIER_BIT = 0x00001000;
/// <summary>
/// [GL] Value of GL_ALL_BARRIER_BITS symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const uint ALL_BARRIER_BITS = 0xFFFFFFFF;
/// <summary>
/// [GL] Value of GL_MAX_IMAGE_UNITS symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int MAX_IMAGE_UNITS = 0x8F38;
/// <summary>
/// [GL] Value of GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_ARB_shader_storage_buffer_object", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39;
/// <summary>
/// [GL] Value of GL_IMAGE_BINDING_NAME symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int IMAGE_BINDING_NAME = 0x8F3A;
/// <summary>
/// [GL] Value of GL_IMAGE_BINDING_LEVEL symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int IMAGE_BINDING_LEVEL = 0x8F3B;
/// <summary>
/// [GLES3.2] Gl.Get: data returns one value, corresponding to whether the image bound to the indexed image unit is layered
/// or not.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int IMAGE_BINDING_LAYERED = 0x8F3C;
/// <summary>
/// [GL] Value of GL_IMAGE_BINDING_LAYER symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int IMAGE_BINDING_LAYER = 0x8F3D;
/// <summary>
/// [GL] Value of GL_IMAGE_BINDING_ACCESS symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int IMAGE_BINDING_ACCESS = 0x8F3E;
/// <summary>
/// [GL] Value of GL_IMAGE_1D symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int IMAGE_1D = 0x904C;
/// <summary>
/// [GL] Value of GL_IMAGE_2D symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int IMAGE_2D = 0x904D;
/// <summary>
/// [GL] Value of GL_IMAGE_3D symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int IMAGE_3D = 0x904E;
/// <summary>
/// [GL] Value of GL_IMAGE_2D_RECT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int IMAGE_2D_RECT = 0x904F;
/// <summary>
/// [GL] Value of GL_IMAGE_CUBE symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int IMAGE_CUBE = 0x9050;
/// <summary>
/// [GL] Value of GL_IMAGE_BUFFER symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_2", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
[RequiredByFeature("GL_EXT_texture_buffer", Api = "gles2")]
[RequiredByFeature("GL_OES_texture_buffer", Api = "gles2")]
public const int IMAGE_BUFFER = 0x9051;
/// <summary>
/// [GL] Value of GL_IMAGE_1D_ARRAY symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int IMAGE_1D_ARRAY = 0x9052;
/// <summary>
/// [GL] Value of GL_IMAGE_2D_ARRAY symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int IMAGE_2D_ARRAY = 0x9053;
/// <summary>
/// [GL] Value of GL_IMAGE_CUBE_MAP_ARRAY symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_2", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
[RequiredByFeature("GL_EXT_texture_cube_map_array", Api = "gles2")]
[RequiredByFeature("GL_OES_texture_cube_map_array", Api = "gles2")]
public const int IMAGE_CUBE_MAP_ARRAY = 0x9054;
/// <summary>
/// [GL] Value of GL_IMAGE_2D_MULTISAMPLE symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int IMAGE_2D_MULTISAMPLE = 0x9055;
/// <summary>
/// [GL] Value of GL_IMAGE_2D_MULTISAMPLE_ARRAY symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int IMAGE_2D_MULTISAMPLE_ARRAY = 0x9056;
/// <summary>
/// [GL] Value of GL_INT_IMAGE_1D symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int INT_IMAGE_1D = 0x9057;
/// <summary>
/// [GL] Value of GL_INT_IMAGE_2D symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int INT_IMAGE_2D = 0x9058;
/// <summary>
/// [GL] Value of GL_INT_IMAGE_3D symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int INT_IMAGE_3D = 0x9059;
/// <summary>
/// [GL] Value of GL_INT_IMAGE_2D_RECT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int INT_IMAGE_2D_RECT = 0x905A;
/// <summary>
/// [GL] Value of GL_INT_IMAGE_CUBE symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int INT_IMAGE_CUBE = 0x905B;
/// <summary>
/// [GL] Value of GL_INT_IMAGE_BUFFER symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_2", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
[RequiredByFeature("GL_EXT_texture_buffer", Api = "gles2")]
[RequiredByFeature("GL_OES_texture_buffer", Api = "gles2")]
public const int INT_IMAGE_BUFFER = 0x905C;
/// <summary>
/// [GL] Value of GL_INT_IMAGE_1D_ARRAY symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int INT_IMAGE_1D_ARRAY = 0x905D;
/// <summary>
/// [GL] Value of GL_INT_IMAGE_2D_ARRAY symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int INT_IMAGE_2D_ARRAY = 0x905E;
/// <summary>
/// [GL] Value of GL_INT_IMAGE_CUBE_MAP_ARRAY symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_2", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
[RequiredByFeature("GL_EXT_texture_cube_map_array", Api = "gles2")]
[RequiredByFeature("GL_OES_texture_cube_map_array", Api = "gles2")]
public const int INT_IMAGE_CUBE_MAP_ARRAY = 0x905F;
/// <summary>
/// [GL] Value of GL_INT_IMAGE_2D_MULTISAMPLE symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int INT_IMAGE_2D_MULTISAMPLE = 0x9060;
/// <summary>
/// [GL] Value of GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061;
/// <summary>
/// [GL] Value of GL_UNSIGNED_INT_IMAGE_1D symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int UNSIGNED_INT_IMAGE_1D = 0x9062;
/// <summary>
/// [GL] Value of GL_UNSIGNED_INT_IMAGE_2D symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int UNSIGNED_INT_IMAGE_2D = 0x9063;
/// <summary>
/// [GL] Value of GL_UNSIGNED_INT_IMAGE_3D symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int UNSIGNED_INT_IMAGE_3D = 0x9064;
/// <summary>
/// [GL] Value of GL_UNSIGNED_INT_IMAGE_2D_RECT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int UNSIGNED_INT_IMAGE_2D_RECT = 0x9065;
/// <summary>
/// [GL] Value of GL_UNSIGNED_INT_IMAGE_CUBE symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int UNSIGNED_INT_IMAGE_CUBE = 0x9066;
/// <summary>
/// [GL] Value of GL_UNSIGNED_INT_IMAGE_BUFFER symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_2", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
[RequiredByFeature("GL_EXT_texture_buffer", Api = "gles2")]
[RequiredByFeature("GL_OES_texture_buffer", Api = "gles2")]
public const int UNSIGNED_INT_IMAGE_BUFFER = 0x9067;
/// <summary>
/// [GL] Value of GL_UNSIGNED_INT_IMAGE_1D_ARRAY symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int UNSIGNED_INT_IMAGE_1D_ARRAY = 0x9068;
/// <summary>
/// [GL] Value of GL_UNSIGNED_INT_IMAGE_2D_ARRAY symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int UNSIGNED_INT_IMAGE_2D_ARRAY = 0x9069;
/// <summary>
/// [GL] Value of GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_2", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
[RequiredByFeature("GL_EXT_texture_cube_map_array", Api = "gles2")]
[RequiredByFeature("GL_OES_texture_cube_map_array", Api = "gles2")]
public const int UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A;
/// <summary>
/// [GL] Value of GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B;
/// <summary>
/// [GL] Value of GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C;
/// <summary>
/// [GL] Value of GL_MAX_IMAGE_SAMPLES symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int MAX_IMAGE_SAMPLES = 0x906D;
/// <summary>
/// [GL] Value of GL_IMAGE_BINDING_FORMAT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public const int IMAGE_BINDING_FORMAT = 0x906E;
/// <summary>
/// <para>
/// [GL4] Gl.GetTexParameter: Returns the matching criteria use for the texture when used as an image texture. Can
/// return
/// Gl.IMAGE_FORMAT_COMPATIBILITY_BY_SIZE, Gl.IMAGE_FORMAT_COMPATIBILITY_BY_CLASS or Gl.NONE.
/// </para>
/// <para>
/// [GLES3.2] Gl.GetTexParameter: Returns the single-valued image format compatibility matching criteria. This can be
/// one of
/// Gl.IMAGE_FORMAT_COMPATIBILITY_BY_CLASS or Gl.IMAGE_FORMAT_COMPATIBILITY_BY_SIZE.
/// </para>
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_internalformat_query2", Api = "gl|glcore")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
public const int IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7;
/// <summary>
/// [GL] Value of GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
public const int IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8;
/// <summary>
/// [GL] Value of GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
public const int IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9;
/// <summary>
/// [GLES3.2] Gl.Get: data returns one value, the maximum supported number of image variables in vertex shaders.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
public const int MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA;
/// <summary>
/// [GLES3.2] Gl.Get: data returns one value, the maximum supported number of image variables in tesselation control
/// shaders.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_2", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_tessellation_shader", Api = "gles2")]
[RequiredByFeature("GL_OES_tessellation_shader", Api = "gles2")]
public const int MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB;
/// <summary>
/// [GLES3.2] Gl.Get: data returns one value, the maximum supported number of image variables in tesselation evaluation
/// shaders.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_2", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_tessellation_shader", Api = "gles2")]
[RequiredByFeature("GL_OES_tessellation_shader", Api = "gles2")]
public const int MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC;
/// <summary>
/// [GLES3.2] Gl.Get: data returns one value, the maximum supported number of image variables in geometry shaders.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_2", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_geometry_shader", Api = "gles2")]
[RequiredByFeature("GL_OES_geometry_shader", Api = "gles2")]
public const int MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD;
/// <summary>
/// [GLES3.2] Gl.Get: data returns one value, the maximum supported number of image variables in fragment shaders. In GL ES
/// 3.1, the minimum value is 0. in GL ES 3.2, the minimum value is 4.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
public const int MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE;
/// <summary>
/// [GL] Value of GL_MAX_COMBINED_IMAGE_UNIFORMS symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
public const int MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF;
/// <summary>
/// [GL] Value of GL_COMPRESSED_RGBA_BPTC_UNORM symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_texture_compression_bptc", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_texture_compression_bptc", Api = "gles2")]
public const int COMPRESSED_RGBA_BPTC_UNORM = 0x8E8C;
/// <summary>
/// [GL] Value of GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_texture_compression_bptc", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_texture_compression_bptc", Api = "gles2")]
public const int COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D;
/// <summary>
/// [GL] Value of GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_texture_compression_bptc", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_texture_compression_bptc", Api = "gles2")]
public const int COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E;
/// <summary>
/// [GL] Value of GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT symbol.
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_texture_compression_bptc", Api = "gl|glcore")] [RequiredByFeature("GL_EXT_texture_compression_bptc", Api = "gles2")]
public const int COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F;
/// <summary>
/// <para>
/// [GL4] Gl.GetTexParameter: Returns non-zero if the texture has an immutable format. Textures become immutable if
/// their
/// storage is specified with Gl.TexStorage1D, Gl.TexStorage2D or Gl.TexStorage3D. The initial value is Gl.FALSE.
/// </para>
/// <para>
/// [GLES3.2] Gl.GetTexParameter: Returns a single-value boolean representing the immutability of the texture format
/// and
/// size. initial value is Gl.FALSE. See Gl.TexStorage2D.
/// </para>
/// </summary>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_0", Api = "gles2")]
[RequiredByFeature("GL_SC_VERSION_2_0", Api = "glsc2")]
[RequiredByFeature("GL_ARB_texture_storage", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_texture_storage", Api = "gles1|gles2")]
public const int TEXTURE_IMMUTABLE_FORMAT = 0x912F;
/// <summary>
/// [GL] glDrawArraysInstancedBaseInstance: Binding for glDrawArraysInstancedBaseInstance.
/// </summary>
/// <param name="mode">
/// A <see cref="T:PrimitiveType" />.
/// </param>
/// <param name="first">
/// A <see cref="T:int" />.
/// </param>
/// <param name="count">
/// A <see cref="T:int" />.
/// </param>
/// <param name="primcount">
/// A <see cref="T:int" />.
/// </param>
/// <param name="baseinstance">
/// A <see cref="T:uint" />.
/// </param>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_base_instance", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_base_instance", Api = "gles2")]
public static void DrawArraysInstancedBaseInstance(PrimitiveType mode, int first, int count, int primcount, uint baseinstance)
{
Debug.Assert(Delegates.pglDrawArraysInstancedBaseInstance != null, "pglDrawArraysInstancedBaseInstance not implemented");
Delegates.pglDrawArraysInstancedBaseInstance((int) mode, first, count, primcount, baseinstance);
DebugCheckErrors(null);
}
/// <summary>
/// [GL] glDrawElementsInstancedBaseInstance: Binding for glDrawElementsInstancedBaseInstance.
/// </summary>
/// <param name="mode">
/// A <see cref="T:PrimitiveType" />.
/// </param>
/// <param name="count">
/// A <see cref="T:int" />.
/// </param>
/// <param name="type">
/// A <see cref="T:PrimitiveType" />.
/// </param>
/// <param name="indices">
/// A <see cref="T:IntPtr" />.
/// </param>
/// <param name="primcount">
/// A <see cref="T:int" />.
/// </param>
/// <param name="baseinstance">
/// A <see cref="T:uint" />.
/// </param>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_base_instance", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_base_instance", Api = "gles2")]
public static void DrawElementsInstancedBaseInstance(PrimitiveType mode, int count, PrimitiveType type, IntPtr indices, int primcount, uint baseinstance)
{
Debug.Assert(Delegates.pglDrawElementsInstancedBaseInstance != null, "pglDrawElementsInstancedBaseInstance not implemented");
Delegates.pglDrawElementsInstancedBaseInstance((int) mode, count, (int) type, indices, primcount, baseinstance);
DebugCheckErrors(null);
}
/// <summary>
/// [GL] glDrawElementsInstancedBaseInstance: Binding for glDrawElementsInstancedBaseInstance.
/// </summary>
/// <param name="mode">
/// A <see cref="T:PrimitiveType" />.
/// </param>
/// <param name="count">
/// A <see cref="T:int" />.
/// </param>
/// <param name="type">
/// A <see cref="T:PrimitiveType" />.
/// </param>
/// <param name="indices">
/// A <see cref="T:object" />.
/// </param>
/// <param name="primcount">
/// A <see cref="T:int" />.
/// </param>
/// <param name="baseinstance">
/// A <see cref="T:uint" />.
/// </param>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_base_instance", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_base_instance", Api = "gles2")]
public static void DrawElementsInstancedBaseInstance(PrimitiveType mode, int count, PrimitiveType type, object indices, int primcount, uint baseinstance)
{
GCHandle pin_indices = GCHandle.Alloc(indices, GCHandleType.Pinned);
try
{
DrawElementsInstancedBaseInstance(mode, count, type, pin_indices.AddrOfPinnedObject(), primcount, baseinstance);
}
finally
{
pin_indices.Free();
}
}
/// <summary>
/// [GL] glDrawElementsInstancedBaseVertexBaseInstance: Binding for glDrawElementsInstancedBaseVertexBaseInstance.
/// </summary>
/// <param name="mode">
/// A <see cref="T:PrimitiveType" />.
/// </param>
/// <param name="count">
/// A <see cref="T:int" />.
/// </param>
/// <param name="type">
/// A <see cref="T:PrimitiveType" />.
/// </param>
/// <param name="indices">
/// A <see cref="T:IntPtr" />.
/// </param>
/// <param name="primcount">
/// A <see cref="T:int" />.
/// </param>
/// <param name="basevertex">
/// A <see cref="T:int" />.
/// </param>
/// <param name="baseinstance">
/// A <see cref="T:uint" />.
/// </param>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_base_instance", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_base_instance", Api = "gles2")]
public static void DrawElementsInstancedBaseVertexBaseInstance(PrimitiveType mode, int count, PrimitiveType type, IntPtr indices, int primcount, int basevertex, uint baseinstance)
{
Debug.Assert(Delegates.pglDrawElementsInstancedBaseVertexBaseInstance != null, "pglDrawElementsInstancedBaseVertexBaseInstance not implemented");
Delegates.pglDrawElementsInstancedBaseVertexBaseInstance((int) mode, count, (int) type, indices, primcount, basevertex, baseinstance);
DebugCheckErrors(null);
}
/// <summary>
/// [GL] glDrawElementsInstancedBaseVertexBaseInstance: Binding for glDrawElementsInstancedBaseVertexBaseInstance.
/// </summary>
/// <param name="mode">
/// A <see cref="T:PrimitiveType" />.
/// </param>
/// <param name="count">
/// A <see cref="T:int" />.
/// </param>
/// <param name="type">
/// A <see cref="T:PrimitiveType" />.
/// </param>
/// <param name="indices">
/// A <see cref="T:object" />.
/// </param>
/// <param name="primcount">
/// A <see cref="T:int" />.
/// </param>
/// <param name="basevertex">
/// A <see cref="T:int" />.
/// </param>
/// <param name="baseinstance">
/// A <see cref="T:uint" />.
/// </param>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_base_instance", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_base_instance", Api = "gles2")]
public static void DrawElementsInstancedBaseVertexBaseInstance(PrimitiveType mode, int count, PrimitiveType type, object indices, int primcount, int basevertex, uint baseinstance)
{
GCHandle pin_indices = GCHandle.Alloc(indices, GCHandleType.Pinned);
try
{
DrawElementsInstancedBaseVertexBaseInstance(mode, count, type, pin_indices.AddrOfPinnedObject(), primcount, basevertex, baseinstance);
}
finally
{
pin_indices.Free();
}
}
/// <summary>
/// <para>
/// [GL4|GLES3.2] glGetInternalformativ: retrieve information about implementation-dependent support for internal
/// formats
/// </para>
/// </summary>
/// <param name="target">
/// Indicates the usage of the internal format. <paramref name="target" /> must be Gl.TEXTURE_1D, Gl.TEXTURE_1D_ARRAY,
/// Gl.TEXTURE_2D, Gl.TEXTURE_2D_ARRAY, Gl.TEXTURE_3D, Gl.TEXTURE_CUBE_MAP, Gl.TEXTURE_CUBE_MAP_ARRAY,
/// Gl.TEXTURE_RECTANGLE,
/// Gl.TEXTURE_BUFFER, Gl.RENDERBUFFER, Gl.TEXTURE_2D_MULTISAMPLE or Gl.TEXTURE_2D_MULTISAMPLE_ARRAY.
/// </param>
/// <param name="internalformat">
/// Specifies the internal format about which to retrieve information.
/// </param>
/// <param name="pname">
/// Specifies the type of information to query.
/// </param>
/// <param name="bufSize">
/// Specifies the maximum number of integers of the specified width that may be written to <paramref name="params" /> by
/// the
/// function.
/// </param>
/// <param name="params">
/// Specifies the address of a variable into which to write the retrieved information.
/// </param>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_0", Api = "gles2")]
[RequiredByFeature("GL_ARB_internalformat_query", Api = "gl|glcore")]
public static void GetInternalformat(TextureTarget target, InternalFormat internalformat, InternalFormatPName pname, int bufSize, [Out] int[] @params)
{
unsafe
{
fixed (int* p_params = @params)
{
Debug.Assert(Delegates.pglGetInternalformativ != null, "pglGetInternalformativ not implemented");
Delegates.pglGetInternalformativ((int) target, (int) internalformat, (int) pname, bufSize, p_params);
}
}
DebugCheckErrors(null);
}
/// <summary>
/// <para>
/// [GL4|GLES3.2] glGetInternalformativ: retrieve information about implementation-dependent support for internal
/// formats
/// </para>
/// </summary>
/// <param name="target">
/// Indicates the usage of the internal format. <paramref name="target" /> must be Gl.TEXTURE_1D, Gl.TEXTURE_1D_ARRAY,
/// Gl.TEXTURE_2D, Gl.TEXTURE_2D_ARRAY, Gl.TEXTURE_3D, Gl.TEXTURE_CUBE_MAP, Gl.TEXTURE_CUBE_MAP_ARRAY,
/// Gl.TEXTURE_RECTANGLE,
/// Gl.TEXTURE_BUFFER, Gl.RENDERBUFFER, Gl.TEXTURE_2D_MULTISAMPLE or Gl.TEXTURE_2D_MULTISAMPLE_ARRAY.
/// </param>
/// <param name="internalformat">
/// Specifies the internal format about which to retrieve information.
/// </param>
/// <param name="pname">
/// Specifies the type of information to query.
/// </param>
/// <param name="params">
/// Specifies the address of a variable into which to write the retrieved information.
/// </param>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_0", Api = "gles2")]
[RequiredByFeature("GL_ARB_internalformat_query", Api = "gl|glcore")]
public static void GetInternalformat(TextureTarget target, InternalFormat internalformat, InternalFormatPName pname, [Out] int[] @params)
{
unsafe
{
fixed (int* p_params = @params)
{
Debug.Assert(Delegates.pglGetInternalformativ != null, "pglGetInternalformativ not implemented");
Delegates.pglGetInternalformativ((int) target, (int) internalformat, (int) pname, @params.Length, p_params);
}
}
DebugCheckErrors(null);
}
/// <summary>
/// [GL4] glGetActiveAtomicCounterBufferiv: retrieve information about the set of active atomic counter buffers for a
/// program
/// </summary>
/// <param name="program">
/// The name of a program object from which to retrieve information.
/// </param>
/// <param name="bufferIndex">
/// Specifies index of an active atomic counter buffer.
/// </param>
/// <param name="pname">
/// Specifies which parameter of the atomic counter buffer to retrieve.
/// </param>
/// <param name="params">
/// Specifies the address of a variable into which to write the retrieved information.
/// </param>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
public static void GetActiveAtomicCounterBuffer(uint program, uint bufferIndex, AtomicCounterBufferPName pname, [Out] int[] @params)
{
unsafe
{
fixed (int* p_params = @params)
{
Debug.Assert(Delegates.pglGetActiveAtomicCounterBufferiv != null, "pglGetActiveAtomicCounterBufferiv not implemented");
Delegates.pglGetActiveAtomicCounterBufferiv(program, bufferIndex, (int) pname, p_params);
}
}
DebugCheckErrors(null);
}
/// <summary>
/// <para>
/// [GL4|GLES3.2] glBindImageTexture: bind a level of a texture to an image unit
/// </para>
/// </summary>
/// <param name="unit">
/// Specifies the index of the image unit to which to bind the texture
/// </param>
/// <param name="texture">
/// Specifies the name of the texture to bind to the image unit.
/// </param>
/// <param name="level">
/// Specifies the level of the texture that is to be bound.
/// </param>
/// <param name="layered">
/// Specifies whether a layered texture binding is to be established.
/// </param>
/// <param name="layer">
/// If <paramref name="layered" /> is Gl.FALSE, specifies the layer of <paramref name="texture" /> to be bound to the image
/// unit. Ignored otherwise.
/// </param>
/// <param name="access">
/// Specifies a token indicating the type of access that will be performed on the image.
/// </param>
/// <param name="format">
/// Specifies the format that the elements of the image will be treated as for the purposes of formatted stores.
/// </param>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
public static void BindImageTexture(uint unit, uint texture, int level, bool layered, int layer, BufferAccess access, InternalFormat format)
{
Debug.Assert(Delegates.pglBindImageTexture != null, "pglBindImageTexture not implemented");
Delegates.pglBindImageTexture(unit, texture, level, layered, layer, (int) access, (int) format);
DebugCheckErrors(null);
}
/// <summary>
/// <para>
/// [GL4|GLES3.2] glMemoryBarrier: defines a barrier ordering memory transactions
/// </para>
/// </summary>
/// <param name="barriers">
/// Specifies the barriers to insert.
/// </param>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
public static void MemoryBarrier(MemoryBarrierMask barriers)
{
Debug.Assert(Delegates.pglMemoryBarrier != null, "pglMemoryBarrier not implemented");
Delegates.pglMemoryBarrier((uint) barriers);
DebugCheckErrors(null);
}
/// <summary>
/// [GL] glTexStorage1D: Binding for glTexStorage1D.
/// </summary>
/// <param name="target">
/// A <see cref="T:TextureTarget" />.
/// </param>
/// <param name="levels">
/// A <see cref="T:int" />.
/// </param>
/// <param name="internalformat">
/// A <see cref="T:InternalFormat" />.
/// </param>
/// <param name="width">
/// A <see cref="T:int" />.
/// </param>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_texture_storage", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_texture_storage", Api = "gles1|gles2")]
public static void TexStorage1D(TextureTarget target, int levels, InternalFormat internalformat, int width)
{
Debug.Assert(Delegates.pglTexStorage1D != null, "pglTexStorage1D not implemented");
Delegates.pglTexStorage1D((int) target, levels, (int) internalformat, width);
DebugCheckErrors(null);
}
/// <summary>
/// [GL] glTexStorage2D: Binding for glTexStorage2D.
/// </summary>
/// <param name="target">
/// A <see cref="T:TextureTarget" />.
/// </param>
/// <param name="levels">
/// A <see cref="T:int" />.
/// </param>
/// <param name="internalformat">
/// A <see cref="T:InternalFormat" />.
/// </param>
/// <param name="width">
/// A <see cref="T:int" />.
/// </param>
/// <param name="height">
/// A <see cref="T:int" />.
/// </param>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_0", Api = "gles2")]
[RequiredByFeature("GL_SC_VERSION_2_0", Api = "glsc2")]
[RequiredByFeature("GL_ARB_texture_storage", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_texture_storage", Api = "gles1|gles2")]
public static void TexStorage2D(TextureTarget target, int levels, InternalFormat internalformat, int width, int height)
{
Debug.Assert(Delegates.pglTexStorage2D != null, "pglTexStorage2D not implemented");
Delegates.pglTexStorage2D((int) target, levels, (int) internalformat, width, height);
DebugCheckErrors(null);
}
/// <summary>
/// [GL] glTexStorage3D: Binding for glTexStorage3D.
/// </summary>
/// <param name="target">
/// A <see cref="T:TextureTarget" />.
/// </param>
/// <param name="levels">
/// A <see cref="T:int" />.
/// </param>
/// <param name="internalformat">
/// A <see cref="T:InternalFormat" />.
/// </param>
/// <param name="width">
/// A <see cref="T:int" />.
/// </param>
/// <param name="height">
/// A <see cref="T:int" />.
/// </param>
/// <param name="depth">
/// A <see cref="T:int" />.
/// </param>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_0", Api = "gles2")]
[RequiredByFeature("GL_ARB_texture_storage", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_texture_storage", Api = "gles1|gles2")]
public static void TexStorage3D(TextureTarget target, int levels, InternalFormat internalformat, int width, int height, int depth)
{
Debug.Assert(Delegates.pglTexStorage3D != null, "pglTexStorage3D not implemented");
Delegates.pglTexStorage3D((int) target, levels, (int) internalformat, width, height, depth);
DebugCheckErrors(null);
}
/// <summary>
/// [GL4] glDrawTransformFeedbackInstanced: render multiple instances of primitives using a count derived from a transform
/// feedback object
/// </summary>
/// <param name="mode">
/// Specifies what kind of primitives to render. Symbolic constants Gl.POINTS, Gl.LINE_STRIP, Gl.LINE_LOOP, Gl.LINES,
/// Gl.LINE_STRIP_ADJACENCY, Gl.LINES_ADJACENCY, Gl.TRIANGLE_STRIP, Gl.TRIANGLE_FAN, Gl.TRIANGLES,
/// Gl.TRIANGLE_STRIP_ADJACENCY, Gl.TRIANGLES_ADJACENCY, and Gl.PATCHES are accepted.
/// </param>
/// <param name="id">
/// Specifies the name of a transform feedback object from which to retrieve a primitive count.
/// </param>
/// <param name="primcount">
/// Specifies the number of instances of the geometry to render.
/// </param>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_transform_feedback_instanced", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_draw_transform_feedback", Api = "gles2")]
public static void DrawTransformFeedbackInstanced(PrimitiveType mode, uint id, int primcount)
{
Debug.Assert(Delegates.pglDrawTransformFeedbackInstanced != null, "pglDrawTransformFeedbackInstanced not implemented");
Delegates.pglDrawTransformFeedbackInstanced((int) mode, id, primcount);
DebugCheckErrors(null);
}
/// <summary>
/// [GL4] glDrawTransformFeedbackStreamInstanced: render multiple instances of primitives using a count derived from a
/// specifed stream of a transform feedback object
/// </summary>
/// <param name="mode">
/// Specifies what kind of primitives to render. Symbolic constants Gl.POINTS, Gl.LINE_STRIP, Gl.LINE_LOOP, Gl.LINES,
/// Gl.LINE_STRIP_ADJACENCY, Gl.LINES_ADJACENCY, Gl.TRIANGLE_STRIP, Gl.TRIANGLE_FAN, Gl.TRIANGLES,
/// Gl.TRIANGLE_STRIP_ADJACENCY, Gl.TRIANGLES_ADJACENCY, and Gl.PATCHES are accepted.
/// </param>
/// <param name="id">
/// Specifies the name of a transform feedback object from which to retrieve a primitive count.
/// </param>
/// <param name="stream">
/// Specifies the index of the transform feedback stream from which to retrieve a primitive count.
/// </param>
/// <param name="primcount">
/// Specifies the number of instances of the geometry to render.
/// </param>
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_transform_feedback_instanced", Api = "gl|glcore")]
public static void DrawTransformFeedbackStreamInstanced(PrimitiveType mode, uint id, uint stream, int primcount)
{
Debug.Assert(Delegates.pglDrawTransformFeedbackStreamInstanced != null, "pglDrawTransformFeedbackStreamInstanced not implemented");
Delegates.pglDrawTransformFeedbackStreamInstanced((int) mode, id, stream, primcount);
DebugCheckErrors(null);
}
internal static unsafe partial class Delegates
{
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_base_instance", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_base_instance", Api = "gles2")]
[SuppressUnmanagedCodeSecurity]
internal delegate void glDrawArraysInstancedBaseInstance(int mode, int first, int count, int instancecount, uint baseinstance);
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_base_instance", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_base_instance", Api = "gles2", EntryPoint = "glDrawArraysInstancedBaseInstanceEXT")]
[ThreadStatic]
internal static glDrawArraysInstancedBaseInstance pglDrawArraysInstancedBaseInstance;
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_base_instance", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_base_instance", Api = "gles2")]
[SuppressUnmanagedCodeSecurity]
internal delegate void glDrawElementsInstancedBaseInstance(int mode, int count, int type, IntPtr indices, int instancecount, uint baseinstance);
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_base_instance", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_base_instance", Api = "gles2", EntryPoint = "glDrawElementsInstancedBaseInstanceEXT")]
[ThreadStatic]
internal static glDrawElementsInstancedBaseInstance pglDrawElementsInstancedBaseInstance;
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_base_instance", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_base_instance", Api = "gles2")]
[SuppressUnmanagedCodeSecurity]
internal delegate void glDrawElementsInstancedBaseVertexBaseInstance(int mode, int count, int type, IntPtr indices, int instancecount, int basevertex, uint baseinstance);
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_base_instance", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_base_instance", Api = "gles2", EntryPoint = "glDrawElementsInstancedBaseVertexBaseInstanceEXT")]
[ThreadStatic]
internal static glDrawElementsInstancedBaseVertexBaseInstance pglDrawElementsInstancedBaseVertexBaseInstance;
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_0", Api = "gles2")]
[RequiredByFeature("GL_ARB_internalformat_query", Api = "gl|glcore")]
[SuppressUnmanagedCodeSecurity]
internal delegate void glGetInternalformativ(int target, int internalformat, int pname, int bufSize, int* @params);
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_0", Api = "gles2")] [RequiredByFeature("GL_ARB_internalformat_query", Api = "gl|glcore")] [ThreadStatic]
internal static glGetInternalformativ pglGetInternalformativ;
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")]
[SuppressUnmanagedCodeSecurity]
internal delegate void glGetActiveAtomicCounterBufferiv(uint program, uint bufferIndex, int pname, int* @params);
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_shader_atomic_counters", Api = "gl|glcore")] [ThreadStatic]
internal static glGetActiveAtomicCounterBufferiv pglGetActiveAtomicCounterBufferiv;
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[SuppressUnmanagedCodeSecurity]
internal delegate void glBindImageTexture(uint unit, uint texture, int level, [MarshalAs(UnmanagedType.I1)] bool layered, int layer, int access, int format);
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")] [RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")] [ThreadStatic]
internal static glBindImageTexture pglBindImageTexture;
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store")]
[SuppressUnmanagedCodeSecurity]
internal delegate void glMemoryBarrier(uint barriers);
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_1", Api = "gles2")]
[RequiredByFeature("GL_ARB_shader_image_load_store", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_shader_image_load_store", EntryPoint = "glMemoryBarrierEXT")]
[ThreadStatic]
internal static glMemoryBarrier pglMemoryBarrier;
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_texture_storage", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_texture_storage", Api = "gles1|gles2")]
[SuppressUnmanagedCodeSecurity]
internal delegate void glTexStorage1D(int target, int levels, int internalformat, int width);
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_texture_storage", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_texture_storage", Api = "gles1|gles2", EntryPoint = "glTexStorage1DEXT")]
[ThreadStatic]
internal static glTexStorage1D pglTexStorage1D;
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_0", Api = "gles2")]
[RequiredByFeature("GL_SC_VERSION_2_0", Api = "glsc2")]
[RequiredByFeature("GL_ARB_texture_storage", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_texture_storage", Api = "gles1|gles2")]
[SuppressUnmanagedCodeSecurity]
internal delegate void glTexStorage2D(int target, int levels, int internalformat, int width, int height);
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_0", Api = "gles2")]
[RequiredByFeature("GL_SC_VERSION_2_0", Api = "glsc2")]
[RequiredByFeature("GL_ARB_texture_storage", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_texture_storage", Api = "gles1|gles2", EntryPoint = "glTexStorage2DEXT")]
[ThreadStatic]
internal static glTexStorage2D pglTexStorage2D;
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_0", Api = "gles2")]
[RequiredByFeature("GL_ARB_texture_storage", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_texture_storage", Api = "gles1|gles2")]
[SuppressUnmanagedCodeSecurity]
internal delegate void glTexStorage3D(int target, int levels, int internalformat, int width, int height, int depth);
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ES_VERSION_3_0", Api = "gles2")]
[RequiredByFeature("GL_ARB_texture_storage", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_texture_storage", Api = "gles1|gles2", EntryPoint = "glTexStorage3DEXT")]
[ThreadStatic]
internal static glTexStorage3D pglTexStorage3D;
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_transform_feedback_instanced", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_draw_transform_feedback", Api = "gles2")]
[SuppressUnmanagedCodeSecurity]
internal delegate void glDrawTransformFeedbackInstanced(int mode, uint id, int instancecount);
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_transform_feedback_instanced", Api = "gl|glcore")]
[RequiredByFeature("GL_EXT_draw_transform_feedback", Api = "gles2", EntryPoint = "glDrawTransformFeedbackInstancedEXT")]
[ThreadStatic]
internal static glDrawTransformFeedbackInstanced pglDrawTransformFeedbackInstanced;
[RequiredByFeature("GL_VERSION_4_2")]
[RequiredByFeature("GL_ARB_transform_feedback_instanced", Api = "gl|glcore")]
[SuppressUnmanagedCodeSecurity]
internal delegate void glDrawTransformFeedbackStreamInstanced(int mode, uint id, uint stream, int instancecount);
[RequiredByFeature("GL_VERSION_4_2")] [RequiredByFeature("GL_ARB_transform_feedback_instanced", Api = "gl|glcore")] [ThreadStatic]
internal static glDrawTransformFeedbackStreamInstanced pglDrawTransformFeedbackStreamInstanced;
}
}
} | {
"content_hash": "8402763584aab1a38b08cfd5fb24a8ff",
"timestamp": "",
"source": "github",
"line_count": 1505,
"max_line_length": 193,
"avg_line_length": 51.285049833887044,
"alnum_prop": 0.6130286069651741,
"repo_name": "Cryru/SoulEngine",
"id": "985cc9f57843739e34bc763e180abbeda75b4387",
"size": "77286",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Emotion/Platform/OpenGL/Gl.VERSION_4_2.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "768465"
}
],
"symlink_target": ""
} |
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.facebook.presto.hive.s3;
import com.amazonaws.AmazonWebServiceClient;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.InstanceProfileCredentialsProvider;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.AmazonS3EncryptionClient;
import com.amazonaws.services.s3.S3ClientOptions;
import com.amazonaws.services.s3.model.AmazonS3Exception;
import com.amazonaws.services.s3.model.EncryptionMaterials;
import com.amazonaws.services.s3.model.EncryptionMaterialsProvider;
import com.facebook.presto.hive.s3.PrestoS3FileSystem.UnrecoverableS3OperationException;
import com.google.common.base.Throwables;
import com.google.common.base.VerifyException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.Path;
import org.testng.SkipException;
import org.testng.annotations.Test;
import javax.crypto.spec.SecretKeySpec;
import java.io.IOException;
import java.lang.reflect.Field;
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Map;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_ACCESS_KEY;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_CREDENTIALS_PROVIDER;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_ENCRYPTION_MATERIALS_PROVIDER;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_ENDPOINT;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_KMS_KEY_ID;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_MAX_BACKOFF_TIME;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_MAX_CLIENT_RETRIES;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_MAX_RETRY_TIME;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_PATH_STYLE_ACCESS;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_PIN_CLIENT_TO_CURRENT_REGION;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_SECRET_KEY;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_SIGNER_TYPE;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_STAGING_DIRECTORY;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_USER_AGENT_PREFIX;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_USER_AGENT_SUFFIX;
import static com.facebook.presto.hive.s3.S3ConfigurationUpdater.S3_USE_INSTANCE_CREDENTIALS;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.io.MoreFiles.deleteRecursively;
import static com.google.common.io.RecursiveDeleteOption.ALLOW_INSECURE;
import static io.airlift.testing.Assertions.assertInstanceOf;
import static java.nio.file.Files.createTempDirectory;
import static java.nio.file.Files.createTempFile;
import static org.apache.http.HttpStatus.SC_FORBIDDEN;
import static org.apache.http.HttpStatus.SC_INTERNAL_SERVER_ERROR;
import static org.apache.http.HttpStatus.SC_NOT_FOUND;
import static org.apache.http.HttpStatus.SC_REQUESTED_RANGE_NOT_SATISFIABLE;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
public class TestPrestoS3FileSystem
{
@Test
public void testStaticCredentials()
throws Exception
{
Configuration config = new Configuration();
config.set(S3_ACCESS_KEY, "test_secret_access_key");
config.set(S3_SECRET_KEY, "test_access_key_id");
// the static credentials should be preferred
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
fs.initialize(new URI("s3n://test-bucket/"), config);
assertInstanceOf(getAwsCredentialsProvider(fs), AWSStaticCredentialsProvider.class);
}
}
@Test
public void testCompatibleStaticCredentials()
throws Exception
{
Configuration config = new Configuration();
config.set(S3_ACCESS_KEY, "test_secret_access_key");
config.set(S3_SECRET_KEY, "test_access_key_id");
config.set(S3_ENDPOINT, "test.example.endpoint.com");
config.set(S3_SIGNER_TYPE, "S3SignerType");
// the static credentials should be preferred
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
fs.initialize(new URI("s3a://test-bucket/"), config);
assertInstanceOf(getAwsCredentialsProvider(fs), AWSStaticCredentialsProvider.class);
}
}
@Test(expectedExceptions = VerifyException.class, expectedExceptionsMessageRegExp = "Invalid configuration: either endpoint can be set or S3 client can be pinned to the current region")
public void testEndpointWithPinToCurrentRegionConfiguration()
throws Exception
{
Configuration config = new Configuration();
config.set(S3_ENDPOINT, "test.example.endpoint.com");
config.set(S3_PIN_CLIENT_TO_CURRENT_REGION, "true");
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
fs.initialize(new URI("s3a://test-bucket/"), config);
}
}
@Test
public void testInstanceCredentialsEnabled()
throws Exception
{
Configuration config = new Configuration();
// instance credentials are enabled by default
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
fs.initialize(new URI("s3n://test-bucket/"), config);
assertInstanceOf(getAwsCredentialsProvider(fs), InstanceProfileCredentialsProvider.class);
}
}
@Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = "S3 credentials not configured")
public void testInstanceCredentialsDisabled()
throws Exception
{
Configuration config = new Configuration();
config.setBoolean(S3_USE_INSTANCE_CREDENTIALS, false);
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
fs.initialize(new URI("s3n://test-bucket/"), config);
}
}
@Test
public void testPathStyleAccess()
throws Exception
{
Configuration config = new Configuration();
config.setBoolean(S3_PATH_STYLE_ACCESS, true);
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
fs.initialize(new URI("s3n://test-bucket/"), config);
S3ClientOptions clientOptions = getFieldValue(fs.getS3Client(), AmazonS3Client.class, "clientOptions", S3ClientOptions.class);
assertTrue(clientOptions.isPathStyleAccess());
}
}
@Test
public void testUnderscoreBucket()
throws Exception
{
Configuration config = new Configuration();
config.setBoolean(S3_PATH_STYLE_ACCESS, true);
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
MockAmazonS3 s3 = new MockAmazonS3();
String expectedBucketName = "test-bucket_underscore";
fs.initialize(new URI("s3n://" + expectedBucketName + "/"), config);
fs.setS3Client(s3);
fs.getS3ObjectMetadata(new Path("/test/path"));
assertEquals(expectedBucketName, s3.getGetObjectMetadataRequest().getBucketName());
}
}
@SuppressWarnings({"ResultOfMethodCallIgnored", "OverlyStrongTypeCast", "ConstantConditions"})
@Test
public void testReadRetryCounters()
throws Exception
{
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
int maxRetries = 2;
MockAmazonS3 s3 = new MockAmazonS3();
s3.setGetObjectHttpErrorCode(SC_INTERNAL_SERVER_ERROR);
Configuration configuration = new Configuration();
configuration.set(S3_MAX_BACKOFF_TIME, "1ms");
configuration.set(S3_MAX_RETRY_TIME, "5s");
configuration.setInt(S3_MAX_CLIENT_RETRIES, maxRetries);
fs.initialize(new URI("s3n://test-bucket/"), configuration);
fs.setS3Client(s3);
try (FSDataInputStream inputStream = fs.open(new Path("s3n://test-bucket/test"))) {
inputStream.read();
}
catch (Throwable expected) {
assertInstanceOf(expected, AmazonS3Exception.class);
assertEquals(((AmazonS3Exception) expected).getStatusCode(), SC_INTERNAL_SERVER_ERROR);
assertEquals(PrestoS3FileSystem.getFileSystemStats().getReadRetries().getTotalCount(), maxRetries);
assertEquals(PrestoS3FileSystem.getFileSystemStats().getGetObjectRetries().getTotalCount(), (maxRetries + 1L) * maxRetries);
}
}
}
@SuppressWarnings({"OverlyStrongTypeCast", "ConstantConditions"})
@Test
public void testGetMetadataRetryCounter()
{
int maxRetries = 2;
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
MockAmazonS3 s3 = new MockAmazonS3();
s3.setGetObjectMetadataHttpCode(SC_INTERNAL_SERVER_ERROR);
Configuration configuration = new Configuration();
configuration.set(S3_MAX_BACKOFF_TIME, "1ms");
configuration.set(S3_MAX_RETRY_TIME, "5s");
configuration.setInt(S3_MAX_CLIENT_RETRIES, maxRetries);
fs.initialize(new URI("s3n://test-bucket/"), configuration);
fs.setS3Client(s3);
fs.getS3ObjectMetadata(new Path("s3n://test-bucket/test"));
}
catch (Throwable expected) {
assertInstanceOf(expected, AmazonS3Exception.class);
assertEquals(((AmazonS3Exception) expected).getStatusCode(), SC_INTERNAL_SERVER_ERROR);
assertEquals(PrestoS3FileSystem.getFileSystemStats().getGetMetadataRetries().getTotalCount(), maxRetries);
}
}
@SuppressWarnings("ResultOfMethodCallIgnored")
@Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Failing getObject call with " + SC_NOT_FOUND + ".*")
public void testReadNotFound()
throws Exception
{
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
MockAmazonS3 s3 = new MockAmazonS3();
s3.setGetObjectHttpErrorCode(SC_NOT_FOUND);
fs.initialize(new URI("s3n://test-bucket/"), new Configuration());
fs.setS3Client(s3);
try (FSDataInputStream inputStream = fs.open(new Path("s3n://test-bucket/test"))) {
inputStream.read();
}
}
}
@SuppressWarnings("ResultOfMethodCallIgnored")
@Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Failing getObject call with " + SC_FORBIDDEN + ".*")
public void testReadForbidden()
throws Exception
{
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
MockAmazonS3 s3 = new MockAmazonS3();
s3.setGetObjectHttpErrorCode(SC_FORBIDDEN);
fs.initialize(new URI("s3n://test-bucket/"), new Configuration());
fs.setS3Client(s3);
try (FSDataInputStream inputStream = fs.open(new Path("s3n://test-bucket/test"))) {
inputStream.read();
}
}
}
@Test
public void testCreateWithNonexistentStagingDirectory()
throws Exception
{
java.nio.file.Path stagingParent = createTempDirectory("test");
java.nio.file.Path staging = Paths.get(stagingParent.toString(), "staging");
// stagingParent = /tmp/testXXX
// staging = /tmp/testXXX/staging
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
MockAmazonS3 s3 = new MockAmazonS3();
Configuration conf = new Configuration();
conf.set(S3_STAGING_DIRECTORY, staging.toString());
fs.initialize(new URI("s3n://test-bucket/"), conf);
fs.setS3Client(s3);
FSDataOutputStream stream = fs.create(new Path("s3n://test-bucket/test"));
stream.close();
assertTrue(Files.exists(staging));
}
finally {
deleteRecursively(stagingParent, ALLOW_INSECURE);
}
}
@Test(expectedExceptions = IOException.class, expectedExceptionsMessageRegExp = "Configured staging path is not a directory: .*")
public void testCreateWithStagingDirectoryFile()
throws Exception
{
java.nio.file.Path staging = createTempFile("staging", null);
// staging = /tmp/stagingXXX.tmp
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
MockAmazonS3 s3 = new MockAmazonS3();
Configuration conf = new Configuration();
conf.set(S3_STAGING_DIRECTORY, staging.toString());
fs.initialize(new URI("s3n://test-bucket/"), conf);
fs.setS3Client(s3);
fs.create(new Path("s3n://test-bucket/test"));
}
finally {
Files.deleteIfExists(staging);
}
}
@Test
public void testCreateWithStagingDirectorySymlink()
throws Exception
{
java.nio.file.Path staging = createTempDirectory("staging");
java.nio.file.Path link = Paths.get(staging + ".symlink");
// staging = /tmp/stagingXXX
// link = /tmp/stagingXXX.symlink -> /tmp/stagingXXX
try {
try {
Files.createSymbolicLink(link, staging);
}
catch (UnsupportedOperationException e) {
throw new SkipException("Filesystem does not support symlinks", e);
}
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
MockAmazonS3 s3 = new MockAmazonS3();
Configuration conf = new Configuration();
conf.set(S3_STAGING_DIRECTORY, link.toString());
fs.initialize(new URI("s3n://test-bucket/"), conf);
fs.setS3Client(s3);
FSDataOutputStream stream = fs.create(new Path("s3n://test-bucket/test"));
stream.close();
assertTrue(Files.exists(link));
}
}
finally {
deleteRecursively(link, ALLOW_INSECURE);
deleteRecursively(staging, ALLOW_INSECURE);
}
}
@Test
public void testReadRequestRangeNotSatisfiable()
throws Exception
{
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
MockAmazonS3 s3 = new MockAmazonS3();
s3.setGetObjectHttpErrorCode(SC_REQUESTED_RANGE_NOT_SATISFIABLE);
fs.initialize(new URI("s3n://test-bucket/"), new Configuration());
fs.setS3Client(s3);
try (FSDataInputStream inputStream = fs.open(new Path("s3n://test-bucket/test"))) {
assertEquals(inputStream.read(), -1);
}
}
}
@Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = ".*Failing getObjectMetadata call with " + SC_FORBIDDEN + ".*")
public void testGetMetadataForbidden()
throws Exception
{
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
MockAmazonS3 s3 = new MockAmazonS3();
s3.setGetObjectMetadataHttpCode(SC_FORBIDDEN);
fs.initialize(new URI("s3n://test-bucket/"), new Configuration());
fs.setS3Client(s3);
fs.getS3ObjectMetadata(new Path("s3n://test-bucket/test"));
}
}
@Test
public void testGetMetadataNotFound()
throws Exception
{
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
MockAmazonS3 s3 = new MockAmazonS3();
s3.setGetObjectMetadataHttpCode(SC_NOT_FOUND);
fs.initialize(new URI("s3n://test-bucket/"), new Configuration());
fs.setS3Client(s3);
assertEquals(fs.getS3ObjectMetadata(new Path("s3n://test-bucket/test")), null);
}
}
@Test
public void testEncryptionMaterialsProvider()
throws Exception
{
Configuration config = new Configuration();
config.set(S3_ENCRYPTION_MATERIALS_PROVIDER, TestEncryptionMaterialsProvider.class.getName());
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
fs.initialize(new URI("s3n://test-bucket/"), config);
assertInstanceOf(fs.getS3Client(), AmazonS3EncryptionClient.class);
}
}
@Test
public void testKMSEncryptionMaterialsProvider()
throws Exception
{
Configuration config = new Configuration();
config.set(S3_KMS_KEY_ID, "test-key-id");
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
fs.initialize(new URI("s3n://test-bucket/"), config);
assertInstanceOf(fs.getS3Client(), AmazonS3EncryptionClient.class);
}
}
@Test(expectedExceptions = UnrecoverableS3OperationException.class, expectedExceptionsMessageRegExp = ".*\\Q (Path: /tmp/test/path)\\E")
public void testUnrecoverableS3ExceptionMessage()
{
throw new UnrecoverableS3OperationException(new Path("/tmp/test/path"), new IOException("test io exception"));
}
@Test
public void testCustomCredentialsProvider()
throws Exception
{
Configuration config = new Configuration();
config.set(S3_USE_INSTANCE_CREDENTIALS, "false");
config.set(S3_CREDENTIALS_PROVIDER, TestCredentialsProvider.class.getName());
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
fs.initialize(new URI("s3n://test-bucket/"), config);
assertInstanceOf(getAwsCredentialsProvider(fs), TestCredentialsProvider.class);
}
}
@Test(expectedExceptions = RuntimeException.class, expectedExceptionsMessageRegExp = "Error creating an instance of .*")
public void testCustomCredentialsClassCannotBeFound()
throws Exception
{
Configuration config = new Configuration();
config.set(S3_USE_INSTANCE_CREDENTIALS, "false");
config.set(S3_CREDENTIALS_PROVIDER, "com.example.DoesNotExist");
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
fs.initialize(new URI("s3n://test-bucket/"), config);
}
}
@Test
public void testUserAgentPrefix()
throws Exception
{
String userAgentPrefix = "agent_prefix";
Configuration config = new Configuration();
config.set(S3_USER_AGENT_PREFIX, userAgentPrefix);
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
fs.initialize(new URI("s3n://test-bucket/"), config);
ClientConfiguration clientConfig = getFieldValue(fs.getS3Client(), AmazonWebServiceClient.class, "clientConfiguration", ClientConfiguration.class);
assertEquals(clientConfig.getUserAgentSuffix(), S3_USER_AGENT_SUFFIX);
assertEquals(clientConfig.getUserAgentPrefix(), userAgentPrefix);
}
}
@Test
public void testDefaultS3ClientConfiguration()
throws Exception
{
HiveS3Config defaults = new HiveS3Config();
try (PrestoS3FileSystem fs = new PrestoS3FileSystem()) {
fs.initialize(new URI("s3n://test-bucket/"), new Configuration());
ClientConfiguration config = getFieldValue(fs.getS3Client(), AmazonWebServiceClient.class, "clientConfiguration", ClientConfiguration.class);
assertEquals(config.getMaxErrorRetry(), defaults.getS3MaxErrorRetries());
assertEquals(config.getConnectionTimeout(), defaults.getS3ConnectTimeout().toMillis());
assertEquals(config.getSocketTimeout(), defaults.getS3SocketTimeout().toMillis());
assertEquals(config.getMaxConnections(), defaults.getS3MaxConnections());
assertEquals(config.getUserAgentSuffix(), S3_USER_AGENT_SUFFIX);
assertEquals(config.getUserAgentPrefix(), "");
}
}
private static AWSCredentialsProvider getAwsCredentialsProvider(PrestoS3FileSystem fs)
{
return getFieldValue(fs.getS3Client(), "awsCredentialsProvider", AWSCredentialsProvider.class);
}
private static <T> T getFieldValue(Object instance, String name, Class<T> type)
{
return getFieldValue(instance, instance.getClass(), name, type);
}
@SuppressWarnings("unchecked")
private static <T> T getFieldValue(Object instance, Class<?> clazz, String name, Class<T> type)
{
try {
Field field = clazz.getDeclaredField(name);
checkArgument(field.getType() == type, "expected %s but found %s", type, field.getType());
field.setAccessible(true);
return (T) field.get(instance);
}
catch (ReflectiveOperationException e) {
throw Throwables.propagate(e);
}
}
private static class TestEncryptionMaterialsProvider
implements EncryptionMaterialsProvider
{
private final EncryptionMaterials encryptionMaterials;
public TestEncryptionMaterialsProvider()
{
encryptionMaterials = new EncryptionMaterials(new SecretKeySpec(new byte[] {1, 2, 3}, "AES"));
}
@Override
public void refresh()
{
}
@Override
public EncryptionMaterials getEncryptionMaterials(Map<String, String> materialsDescription)
{
return encryptionMaterials;
}
@Override
public EncryptionMaterials getEncryptionMaterials()
{
return encryptionMaterials;
}
}
private static class TestCredentialsProvider
implements AWSCredentialsProvider
{
@SuppressWarnings("UnusedParameters")
public TestCredentialsProvider(URI uri, Configuration conf) {}
@Override
public AWSCredentials getCredentials()
{
return null;
}
@Override
public void refresh() {}
}
}
| {
"content_hash": "19a2c1bc2d4ee741fca919d5b23f7dd2",
"timestamp": "",
"source": "github",
"line_count": 535,
"max_line_length": 189,
"avg_line_length": 42.31028037383177,
"alnum_prop": 0.6691995052129351,
"repo_name": "yuananf/presto",
"id": "745565116532447d992ebc1b79942337bd17d4dc",
"size": "22636",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "presto-hive/src/test/java/com/facebook/presto/hive/s3/TestPrestoS3FileSystem.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "26770"
},
{
"name": "CSS",
"bytes": "12676"
},
{
"name": "HTML",
"bytes": "55873"
},
{
"name": "Java",
"bytes": "26815676"
},
{
"name": "JavaScript",
"bytes": "201960"
},
{
"name": "Makefile",
"bytes": "6822"
},
{
"name": "PLSQL",
"bytes": "7831"
},
{
"name": "Python",
"bytes": "6568"
},
{
"name": "SQLPL",
"bytes": "8493"
},
{
"name": "Shell",
"bytes": "25939"
},
{
"name": "Thrift",
"bytes": "12038"
}
],
"symlink_target": ""
} |
import com.sun.javadoc.*;
public class X {
public static boolean start(RootDoc root) {
System.out.println("X.start");
return true;
}
}
| {
"content_hash": "720d8d82913d623bbba7e3b15ecd3de0",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 47,
"avg_line_length": 16.2,
"alnum_prop": 0.6049382716049383,
"repo_name": "rokn/Count_Words_2015",
"id": "90d3dca682e73649cab3748117e865794a20784a",
"size": "1218",
"binary": false,
"copies": "81",
"ref": "refs/heads/master",
"path": "testing/openjdk2/langtools/test/tools/javadoc/6176978/X.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "61802"
},
{
"name": "Ruby",
"bytes": "18888605"
}
],
"symlink_target": ""
} |
name 'openvpn'
maintainer 'Xhost Australia'
maintainer_email 'cookbooks@xhost.com.au'
license 'Apache 2.0'
description 'Installs and configures openvpn and includes rake tasks for managing certs.'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '2.1.1'
recipe 'openvpn::default', 'Installs OpenVPN only (no configuration).'
recipe 'openvpn::install', 'Installs OpenVPN only (no configuration).'
recipe 'openvpn::server', 'Installs and configures OpenVPN as a server.'
recipe 'openvpn::client', 'Installs and configures OpenVPN as a client.'
recipe 'openvpn::service', 'Manages the OpenVPN system service.'
recipe 'openvpn::users', 'Sets up openvpn cert/configs for users data bag items.'
recipe 'openvpn::install_bridge_utils', 'Installs bridge utilities for Linux.'
depends 'apt'
depends 'yum', '~> 3.0'
depends 'yum-epel'
supports 'arch'
supports 'centos'
supports 'debian'
supports 'fedora'
supports 'redhat'
supports 'ubuntu'
attribute 'openvpn/config/local',
display_name: 'OpenVPN Local',
description: 'Local interface (ip) to listen on',
default: nil,
recipes: ['openvpn::default', 'openvpn::server']
attribute 'openvpn/config/proto',
display_name: 'OpenVPN Protocol',
description: 'The transport protocol to use for OpenVPN (UDP or TCP)',
default: 'udp',
choice: %w(udp tcp),
recipes: ['openvpn::default', 'openvpn::server', 'openvpn::client']
attribute 'openvpn/type',
display_name: 'OpenVPN Type',
description: 'Server or server-bridge',
default: 'server',
choice: ['server', 'server-bridge'],
recipes: ['openvpn::default', 'openvpn::server']
attribute 'openvpn/subnet',
display_name: 'OpenVPN Subnet',
description: 'Subnet to hand out to clients',
default: '10.8.0.0',
recipes: ['openvpn::default', 'openvpn::server']
attribute 'openvpn/netmask',
display_name: 'OpenVPN Netmask',
description: 'Netmask for clients',
default: '255.255.0.0',
recipes: ['openvpn::default', 'openvpn::server']
attribute 'openvpn/config/port',
display_name: 'OpenVPN Listen Port',
description: 'Port to listen on, defaults to 1194',
default: '1194',
choice: %w(1194 443 80 1024),
recipes: ['openvpn::default', 'openvpn::server']
attribute 'openvpn/gateway',
display_name: 'OpenVPN Gateway FQDN',
description: 'FQDN for the VPN gateway server. Default is vpn.domain',
recipes: ['openvpn::default', 'openvpn::client']
attribute 'openvpn/config/log',
display_name: 'OpenVPN Log File',
description: 'OpenVPN Server log file. Default /var/log/openvpn.log',
default: '/var/log/openvpn.log',
recipes: ['openvpn::default', 'openvpn::server', 'openvpn::client']
attribute 'openvpn/key_dir',
display_name: 'OpenVPN Key Directory',
description: 'Location to store keys, certificates and related files. '\
'Default: /etc/openvpn/keys',
default: '/etc/openvpn/keys',
recipes: ['openvpn::default', 'openvpn::users', 'openvpn::server']
attribute 'openvpn/signing_ca_cert',
display_name: 'OpenVPN CA Certificate',
description: 'CA certificate for signing, default /etc/openvpn/keys/ca.crt',
default: '/etc/openvpn/keys/ca.crt',
recipes: ['openvpn::default', 'openvpn::server']
attribute 'openvpn/signing_ca_key',
display_name: 'OpenVPN CA key',
description: 'CA key for signing, default /etc/openvpn/keys/ca.key',
default: '/etc/openvpn/keys/ca.key',
recipes: ['openvpn::default', 'openvpn::server']
attribute 'openvpn/push_options',
display_name: 'OpenVPN Push DHCP Options',
description: 'An array of DHCP options to push to clients from the server.conf. '\
'Default is empty.',
type: 'array',
recipes: ['openvpn::default', 'openvpn::server']
attribute 'openvpn/push_routes',
display_name: 'OpenVPN Push Routes',
description: 'An array of routes to push to clients from the server.conf. '\
'Default is empty.',
type: 'array',
recipes: ['openvpn::default', 'openvpn::server']
attribute 'openvpn/script_security',
display_name: 'OpenVPN Script Security',
description: 'Script Security setting to use in server config. '\
'Default is 1. The "up" script will not be included if this is 0 or 1. '\
'Set it to 2 to use the "up" script',
default: '1',
recipes: ['openvpn::default', 'openvpn::server']
attribute 'openvpn/configure_default_server',
display_name: 'Configure Default Server',
description: 'Boolean to determine whether the default recipe will create a "conf" '\
'file for the default server. Set to false if you want to use only the '\
'LWRP to create the conf files.',
default: 'true',
recipes: ['openvpn::default', 'openvpn::server', 'openvpn::client']
attribute 'openvpn/key/ca_expire',
display_name: 'OpenVPN Root CA Expiry',
description: 'In how many days should the root CA key expire',
default: '3650',
recipes: ['openvpn::default', 'openvpn::users', 'openvpn::server']
attribute 'openvpn/key/expire',
display_name: 'OpenVPN Certificate Expiry',
description: 'In how many days should certificates expire',
default: '3650',
recipes: ['openvpn::default', 'openvpn::users', 'openvpn::server']
attribute 'openvpn/key/size',
display_name: 'OpenVPN Key Size',
description: 'Default key size, set to 2048 if paranoid but will slow down '\
'TLS negotiation performance',
default: '1024',
recipes: ['openvpn::default', 'openvpn::users', 'openvpn::server']
attribute 'openvpn/key/country',
display_name: 'OpenVPN Certificate Country',
description: 'The country for the TLS certificate',
default: 'US',
recipes: ['openvpn::default', 'openvpn::users', 'openvpn::server']
attribute 'openvpn/key/province',
display_name: 'OpenVPN Certificate Province',
description: 'The province for the TLS certificate',
default: 'CA',
recipes: ['openvpn::default', 'openvpn::users', 'openvpn::server']
attribute 'openvpn/key/city',
display_name: 'OpenVPN Certificate City',
description: 'The city for the TLS certificate',
default: 'San Francisco',
recipes: ['openvpn::default', 'openvpn::users', 'openvpn::server']
attribute 'openvpn/key/org',
display_name: 'OpenVPN Certificate Organization',
description: 'The organization name for the TLS certificate',
default: 'Fort-Funston',
recipes: ['openvpn::default', 'openvpn::users', 'openvpn::server']
attribute 'openvpn/key/email',
display_name: 'OpenVPN Certificate Email',
description: 'The email address for the TLS certificate',
default: 'me@example.com',
recipes: ['openvpn::default', 'openvpn::users', 'openvpn::server']
| {
"content_hash": "1965683b55f0427386be03ef7b94aa18",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 97,
"avg_line_length": 44.98850574712644,
"alnum_prop": 0.5929994890137966,
"repo_name": "zackp30/openvpn",
"id": "7f9fcee9d3930731ba6cac7995f4449e1a58c9a2",
"size": "7828",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "metadata.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "8697"
},
{
"name": "Ruby",
"bytes": "40295"
},
{
"name": "Shell",
"bytes": "13552"
}
],
"symlink_target": ""
} |
title: "24 Days of Hackage: doctest"
---
Testing and documentation. Two words that will make even the most hardened
programmers shudder. Unfortunately, they are ultimately two of the most
important aspects of programming - especially if you want your work to succeed
in the wild. Even if you practice test-driven development religiously, you still
can't rule out writing documentation. If only there was a method to combine the
two...
[Simon Hengel's](http://typeful.net)
[`doctest`](http://hackage.haskell.org/package/doctest) library is one solution
that can ease this pain. Modelled off the
[`doctest`](http://docs.python.org/library/doctest.html) library for Python,
`doctest` embeds tests inside the documentation of modules. The idea is: if
testing requires code to be tested and an expected result, then we can treat
this as an expected interaction at a REPL. So the work required by the
programmer is to enter the input and output of a REPL session. `doctest` then
parses the documentation and runs the code, checking that your expectation
matches reality. If so, then it naturally follows that your documentation is
consistent with what the library does.
`doctest` for Haskell works using [Haddock's](http://haskell.org/haddock)
documentation strings. For example, we can easily check that a `square` function
does indeed square its input:
```haskell
{-| Given an integer, 'square' returns the same number squared:
>>> square 5
25
-}
square :: Int -> Int
square x = x * x
```
To run this, we have two options. One is to simply use the `doctest` executable:
```
> doctest 2013-12-18-square.hs
Examples: 1 Tried: 1 Errors: 0 Failures: 0
```
However, in bigger projects you'll want to integrate doctests into your
[Cabal](http://haskell.org/cabal) file. This means that running `cabal test`
will also run doctests, which makes it harder to forget to run them. To do this,
we just have to build a little executable that calls the `doctest` function:
```haskell
main :: IO ()
main = doctest [ "2013-12-17-square.hs" ]
```
The output of this is the same, but we can now easily integrate this as a
test-suite in a Cabal file.
So far we've only see a simple test of a pure function, but `doctest` can go a
lot further. For example, we might have a function that requires a callback.
In a GHCI session, we might write this callback in a let binding, and we can do
the same in doctest. The function we are testing will work in the IO monad, and
the expected behaviour is to print to standard output. This is naturally
expressed in `doctest` - we just write out what we'd expect to see in GHCI:
```haskell
{-|
>>> :{
let callback name = do
putStrLn $ "Hello. Yes, this is " ++ name
>>> :}
>>> printer "Dog" callback
Dog says:
Hello. Yes, this is Dog
-}
printer :: String -> (String -> IO ()) -> IO ()
printer name callBack = do
putStrLn $ name ++ " says:"
```
Observant readers will not that this isn't quite what it claims - and `doctest`
notices that too:
```
### Failure in 2013-12-18-print.hs:9: expression `printer "Dog" callback'
expected: Dog says:
Hello. Yes, this is Dog
but got: Dog says:
```
Whoops, looks like we forgot to actually call the callback! If we fix that, we
get a happy result from `doctest` once again.
If you're a library author, I highly recommend you give `doctest` ago - it's
usage really is a net win. You get more guarantees that your library is doing
what is expected of it, and you get even more back if you encourage your users
to help write documentation. By writing examples for you, they'll also be
writing test cases - and probably test cases for the things they care about too.
Today's code can be [found on Github](http://github.com/ocharles/blog).
| {
"content_hash": "1c336c1cdbc1ea987d2e4369ec9f8c9d",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 80,
"avg_line_length": 37.76767676767677,
"alnum_prop": 0.7384327360256753,
"repo_name": "ocharles/blog",
"id": "6427c92380c257250d70f9314f27723f9a88fcc8",
"size": "3743",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "posts/2013-12-18-doctest.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "4444"
},
{
"name": "HTML",
"bytes": "7208"
},
{
"name": "Haskell",
"bytes": "120749"
},
{
"name": "JavaScript",
"bytes": "70427"
},
{
"name": "Nix",
"bytes": "887"
},
{
"name": "Smarty",
"bytes": "1006"
}
],
"symlink_target": ""
} |
/**
* Elements that make up the popup.
*/
var container = document.getElementById('popup');
var content = document.getElementById('popup-content');
var closer = document.getElementById('popup-closer');
/**
* Create an overlay to anchor the popup to the map.
*/
var overlay = new ol.Overlay(/** @type {olx.OverlayOptions} */ ({
element: container,
autoPan: true,
autoPanAnimation: {
duration: 250
}
}));
/**
* Add a click handler to hide the popup.
* @return {boolean} Don't follow the href.
*/
closer.onclick = function() {
overlay.setPosition(undefined);
closer.blur();
return false;
};
| {
"content_hash": "ac88621923c3f82ed797a66e374deffd",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 65,
"avg_line_length": 21.275862068965516,
"alnum_prop": 0.6742301458670988,
"repo_name": "mdiener21/python-geospatial-analysis-cookbook",
"id": "0249fcc6928a489c95fa510ba7cf163a1ac70e02",
"size": "617",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ch06/code/ol3/js/popup_handler.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "11938"
},
{
"name": "HTML",
"bytes": "93840"
},
{
"name": "JavaScript",
"bytes": "3639664"
},
{
"name": "Makefile",
"bytes": "2774"
},
{
"name": "PLpgSQL",
"bytes": "13430"
},
{
"name": "Python",
"bytes": "624176"
},
{
"name": "Shell",
"bytes": "4089"
}
],
"symlink_target": ""
} |
namespace WestBlueGolfLeagueWeb.Models
{
using System.CodeDom.Compiler;
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
[GeneratedCode("EntityFramework.Migrations", "6.1.0-30225")]
public sealed partial class EquitableScore : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(EquitableScore));
string IMigrationMetadata.Id
{
get { return "201504132254075_EquitableScore"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
| {
"content_hash": "b2a74cb3c4b387e1ce614d4e3124d7be",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 97,
"avg_line_length": 28.892857142857142,
"alnum_prop": 0.6266996291718171,
"repo_name": "tahoeWolverine/WestBlueGolfLeague",
"id": "dbbb62924b95ea7ab1592ae42b9bc2c0a14d834a",
"size": "831",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "WestBlueGolfLeagueWeb/WestBlueGolfLeagueWeb/Migrations/201504132254075_EquitableScore.Designer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP.NET",
"bytes": "112"
},
{
"name": "Batchfile",
"bytes": "489"
},
{
"name": "C",
"bytes": "427"
},
{
"name": "C#",
"bytes": "455698"
},
{
"name": "CSS",
"bytes": "20364"
},
{
"name": "Classic ASP",
"bytes": "353239"
},
{
"name": "HTML",
"bytes": "1020783"
},
{
"name": "JavaScript",
"bytes": "1930304"
},
{
"name": "Lua",
"bytes": "21406"
},
{
"name": "Objective-C",
"bytes": "598283"
},
{
"name": "PLpgSQL",
"bytes": "8120"
},
{
"name": "Ruby",
"bytes": "648"
}
],
"symlink_target": ""
} |
package com.alibaba.dubbo.governance.web.personal.module.screen;
import com.alibaba.dubbo.governance.service.UserService;
import com.alibaba.dubbo.governance.web.common.module.screen.Restful;
import com.alibaba.dubbo.registry.common.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Map;
public class Passwds extends Restful {
@Autowired
private UserService userDAO;
public void index(Map<String, Object> context) {
}
public boolean create(Map<String, Object> context) {
User user = new User();
user.setOperator(operator);
user.setOperatorAddress(operatorAddress);
user.setPassword((String) context.get("newPassword"));
user.setUsername(operator);
boolean sucess = userDAO.updatePassword(user, (String) context.get("oldPassword"));
if (!sucess)
context.put("message", getMessage("passwd.oldwrong"));
return sucess;
}
}
| {
"content_hash": "cfa3a4555e2df5fe310b84de018e9b74",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 91,
"avg_line_length": 29.454545454545453,
"alnum_prop": 0.7098765432098766,
"repo_name": "way-way/dubbo",
"id": "065674797b166e33cdfaed46b94da4859e5ac307",
"size": "972",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "dubbo-admin/src/main/java/com/alibaba/dubbo/governance/web/personal/module/screen/Passwds.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "3447"
},
{
"name": "CSS",
"bytes": "21097"
},
{
"name": "Java",
"bytes": "5500070"
},
{
"name": "JavaScript",
"bytes": "76109"
},
{
"name": "Lex",
"bytes": "2077"
},
{
"name": "Shell",
"bytes": "7012"
},
{
"name": "Thrift",
"bytes": "668"
}
],
"symlink_target": ""
} |
@charset "utf-8";
/* CSS Document */
#box {
/* Position absolutely, 30px down from the top */
position: absolute;
top: 30px;
/* In my case I'm centering it in the window; do what you like */
margin-left: -100px;
left: 50%;
width: 200px;
/* These are just for my example */
height: 1.25em;
/*border: 1px solid #bbb;*/
text-align: center;
} | {
"content_hash": "804da8190cd4c4de27249ef7b1e3d2cb",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 67,
"avg_line_length": 19.157894736842106,
"alnum_prop": 0.6236263736263736,
"repo_name": "alanh2/Alike-sistemaintegral",
"id": "f8256575e1f63a12ece860294d045b74363c5fcc",
"size": "364",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "assets/css/common.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "14"
},
{
"name": "CSS",
"bytes": "923670"
},
{
"name": "HTML",
"bytes": "478768"
},
{
"name": "JavaScript",
"bytes": "4069163"
},
{
"name": "PHP",
"bytes": "17587825"
}
],
"symlink_target": ""
} |
"""SQL connections, SQL execution and high-level DB-API interface.
The engine package defines the basic components used to interface
DB-API modules with higher-level statement construction,
connection-management, execution and result contexts. The primary
"entry point" class into this package is the Engine and it's public
constructor ``create_engine()``.
This package includes:
base.py
Defines interface classes and some implementation classes which
comprise the basic components used to interface between a DB-API,
constructed and plain-text statements, connections, transactions,
and results.
default.py
Contains default implementations of some of the components defined
in base.py. All current database dialects use the classes in
default.py as base classes for their own database-specific
implementations.
strategies.py
The mechanics of constructing ``Engine`` objects are represented
here. Defines the ``EngineStrategy`` class which represents how
to go from arguments specified to the ``create_engine()``
function, to a fully constructed ``Engine``, including
initialization of connection pooling, dialects, and specific
subclasses of ``Engine``.
threadlocal.py
The ``TLEngine`` class is defined here, which is a subclass of
the generic ``Engine`` and tracks ``Connection`` and
``Transaction`` objects against the identity of the current
thread. This allows certain programming patterns based around
the concept of a "thread-local connection" to be possible.
The ``TLEngine`` is created by using the "threadlocal" engine
strategy in conjunction with the ``create_engine()`` function.
url.py
Defines the ``URL`` class which represents the individual
components of a string URL passed to ``create_engine()``. Also
defines a basic module-loading strategy for the dialect specifier
within a URL.
"""
from .interfaces import (
Connectable,
Dialect,
ExecutionContext,
# backwards compat
Compiled,
TypeCompiler
)
from .base import (
Connection,
Engine,
NestedTransaction,
RootTransaction,
Transaction,
TwoPhaseTransaction,
)
from .result import (
BufferedColumnResultProxy,
BufferedColumnRow,
BufferedRowResultProxy,
FullyBufferedResultProxy,
ResultProxy,
RowProxy,
)
from .util import (
connection_memoize
)
from . import util, strategies
# backwards compat
from ..sql import ddl
default_strategy = 'plain'
def create_engine(*args, **kwargs):
"""Create a new :class:`.Engine` instance.
The standard calling form is to send the URL as the
first positional argument, usually a string
that indicates database dialect and connection arguments::
engine = create_engine("postgresql://scott:tiger@localhost/test")
Additional keyword arguments may then follow it which
establish various options on the resulting :class:`.Engine`
and its underlying :class:`.Dialect` and :class:`.Pool`
constructs::
engine = create_engine("mysql://scott:tiger@hostname/dbname",
encoding='latin1', echo=True)
The string form of the URL is
``dialect[+driver]://user:password@host/dbname[?key=value..]``, where
``dialect`` is a database name such as ``mysql``, ``oracle``,
``postgresql``, etc., and ``driver`` the name of a DBAPI, such as
``psycopg2``, ``pyodbc``, ``cx_oracle``, etc. Alternatively,
the URL can be an instance of :class:`~sqlalchemy.engine.url.URL`.
``**kwargs`` takes a wide variety of options which are routed
towards their appropriate components. Arguments may be specific to
the :class:`.Engine`, the underlying :class:`.Dialect`, as well as the
:class:`.Pool`. Specific dialects also accept keyword arguments that
are unique to that dialect. Here, we describe the parameters
that are common to most :func:`.create_engine()` usage.
Once established, the newly resulting :class:`.Engine` will
request a connection from the underlying :class:`.Pool` once
:meth:`.Engine.connect` is called, or a method which depends on it
such as :meth:`.Engine.execute` is invoked. The :class:`.Pool` in turn
will establish the first actual DBAPI connection when this request
is received. The :func:`.create_engine` call itself does **not**
establish any actual DBAPI connections directly.
.. seealso::
:doc:`/core/engines`
:doc:`/dialects/index`
:ref:`connections_toplevel`
:param case_sensitive=True: if False, result column names
will match in a case-insensitive fashion, that is,
``row['SomeColumn']``.
.. versionchanged:: 0.8
By default, result row names match case-sensitively.
In version 0.7 and prior, all matches were case-insensitive.
:param connect_args: a dictionary of options which will be
passed directly to the DBAPI's ``connect()`` method as
additional keyword arguments. See the example
at :ref:`custom_dbapi_args`.
:param convert_unicode=False: if set to True, sets
the default behavior of ``convert_unicode`` on the
:class:`.String` type to ``True``, regardless
of a setting of ``False`` on an individual
:class:`.String` type, thus causing all :class:`.String`
-based columns
to accommodate Python ``unicode`` objects. This flag
is useful as an engine-wide setting when using a
DBAPI that does not natively support Python
``unicode`` objects and raises an error when
one is received (such as pyodbc with FreeTDS).
See :class:`.String` for further details on
what this flag indicates.
:param creator: a callable which returns a DBAPI connection.
This creation function will be passed to the underlying
connection pool and will be used to create all new database
connections. Usage of this function causes connection
parameters specified in the URL argument to be bypassed.
:param echo=False: if True, the Engine will log all statements
as well as a repr() of their parameter lists to the engines
logger, which defaults to sys.stdout. The ``echo`` attribute of
``Engine`` can be modified at any time to turn logging on and
off. If set to the string ``"debug"``, result rows will be
printed to the standard output as well. This flag ultimately
controls a Python logger; see :ref:`dbengine_logging` for
information on how to configure logging directly.
:param echo_pool=False: if True, the connection pool will log
all checkouts/checkins to the logging stream, which defaults to
sys.stdout. This flag ultimately controls a Python logger; see
:ref:`dbengine_logging` for information on how to configure logging
directly.
:param encoding: Defaults to ``utf-8``. This is the string
encoding used by SQLAlchemy for string encode/decode
operations which occur within SQLAlchemy, **outside of
the DBAPI.** Most modern DBAPIs feature some degree of
direct support for Python ``unicode`` objects,
what you see in Python 2 as a string of the form
``u'some string'``. For those scenarios where the
DBAPI is detected as not supporting a Python ``unicode``
object, this encoding is used to determine the
source/destination encoding. It is **not used**
for those cases where the DBAPI handles unicode
directly.
To properly configure a system to accommodate Python
``unicode`` objects, the DBAPI should be
configured to handle unicode to the greatest
degree as is appropriate - see
the notes on unicode pertaining to the specific
target database in use at :ref:`dialect_toplevel`.
Areas where string encoding may need to be accommodated
outside of the DBAPI include zero or more of:
* the values passed to bound parameters, corresponding to
the :class:`.Unicode` type or the :class:`.String` type
when ``convert_unicode`` is ``True``;
* the values returned in result set columns corresponding
to the :class:`.Unicode` type or the :class:`.String`
type when ``convert_unicode`` is ``True``;
* the string SQL statement passed to the DBAPI's
``cursor.execute()`` method;
* the string names of the keys in the bound parameter
dictionary passed to the DBAPI's ``cursor.execute()``
as well as ``cursor.setinputsizes()`` methods;
* the string column names retrieved from the DBAPI's
``cursor.description`` attribute.
When using Python 3, the DBAPI is required to support
*all* of the above values as Python ``unicode`` objects,
which in Python 3 are just known as ``str``. In Python 2,
the DBAPI does not specify unicode behavior at all,
so SQLAlchemy must make decisions for each of the above
values on a per-DBAPI basis - implementations are
completely inconsistent in their behavior.
:param execution_options: Dictionary execution options which will
be applied to all connections. See
:meth:`~sqlalchemy.engine.Connection.execution_options`
:param implicit_returning=True: When ``True``, a RETURNING-
compatible construct, if available, will be used to
fetch newly generated primary key values when a single row
INSERT statement is emitted with no existing returning()
clause. This applies to those backends which support RETURNING
or a compatible construct, including Postgresql, Firebird, Oracle,
Microsoft SQL Server. Set this to ``False`` to disable
the automatic usage of RETURNING.
:param label_length=None: optional integer value which limits
the size of dynamically generated column labels to that many
characters. If less than 6, labels are generated as
"_(counter)". If ``None``, the value of
``dialect.max_identifier_length`` is used instead.
:param listeners: A list of one or more
:class:`~sqlalchemy.interfaces.PoolListener` objects which will
receive connection pool events.
:param logging_name: String identifier which will be used within
the "name" field of logging records generated within the
"sqlalchemy.engine" logger. Defaults to a hexstring of the
object's id.
:param max_overflow=10: the number of connections to allow in
connection pool "overflow", that is connections that can be
opened above and beyond the pool_size setting, which defaults
to five. this is only used with :class:`~sqlalchemy.pool.QueuePool`.
:param module=None: reference to a Python module object (the module
itself, not its string name). Specifies an alternate DBAPI module to
be used by the engine's dialect. Each sub-dialect references a
specific DBAPI which will be imported before first connect. This
parameter causes the import to be bypassed, and the given module to
be used instead. Can be used for testing of DBAPIs as well as to
inject "mock" DBAPI implementations into the :class:`.Engine`.
:param pool=None: an already-constructed instance of
:class:`~sqlalchemy.pool.Pool`, such as a
:class:`~sqlalchemy.pool.QueuePool` instance. If non-None, this
pool will be used directly as the underlying connection pool
for the engine, bypassing whatever connection parameters are
present in the URL argument. For information on constructing
connection pools manually, see :ref:`pooling_toplevel`.
:param poolclass=None: a :class:`~sqlalchemy.pool.Pool`
subclass, which will be used to create a connection pool
instance using the connection parameters given in the URL. Note
this differs from ``pool`` in that you don't actually
instantiate the pool in this case, you just indicate what type
of pool to be used.
:param pool_logging_name: String identifier which will be used within
the "name" field of logging records generated within the
"sqlalchemy.pool" logger. Defaults to a hexstring of the object's
id.
:param pool_size=5: the number of connections to keep open
inside the connection pool. This used with
:class:`~sqlalchemy.pool.QueuePool` as
well as :class:`~sqlalchemy.pool.SingletonThreadPool`. With
:class:`~sqlalchemy.pool.QueuePool`, a ``pool_size`` setting
of 0 indicates no limit; to disable pooling, set ``poolclass`` to
:class:`~sqlalchemy.pool.NullPool` instead.
:param pool_recycle=-1: this setting causes the pool to recycle
connections after the given number of seconds has passed. It
defaults to -1, or no timeout. For example, setting to 3600
means connections will be recycled after one hour. Note that
MySQL in particular will disconnect automatically if no
activity is detected on a connection for eight hours (although
this is configurable with the MySQLDB connection itself and the
server configuration as well).
:param pool_reset_on_return='rollback': set the "reset on return"
behavior of the pool, which is whether ``rollback()``,
``commit()``, or nothing is called upon connections
being returned to the pool. See the docstring for
``reset_on_return`` at :class:`.Pool`.
.. versionadded:: 0.7.6
:param pool_timeout=30: number of seconds to wait before giving
up on getting a connection from the pool. This is only used
with :class:`~sqlalchemy.pool.QueuePool`.
:param strategy='plain': selects alternate engine implementations.
Currently available are:
* the ``threadlocal`` strategy, which is described in
:ref:`threadlocal_strategy`;
* the ``mock`` strategy, which dispatches all statement
execution to a function passed as the argument ``executor``.
See `example in the FAQ
<http://www.sqlalchemy.org/trac/wiki/FAQ#HowcanIgettheCREATETABLEDROPTABLEoutputasastring>`_.
:param executor=None: a function taking arguments
``(sql, *multiparams, **params)``, to which the ``mock`` strategy will
dispatch all statement execution. Used only by ``strategy='mock'``.
"""
strategy = kwargs.pop('strategy', default_strategy)
strategy = strategies.strategies[strategy]
return strategy.create(*args, **kwargs)
def engine_from_config(configuration, prefix='sqlalchemy.', **kwargs):
"""Create a new Engine instance using a configuration dictionary.
The dictionary is typically produced from a config file where keys
are prefixed, such as sqlalchemy.url, sqlalchemy.echo, etc. The
'prefix' argument indicates the prefix to be searched for.
A select set of keyword arguments will be "coerced" to their
expected type based on string values. In a future release, this
functionality will be expanded and include dialect-specific
arguments.
"""
options = dict((key[len(prefix):], configuration[key])
for key in configuration
if key.startswith(prefix))
options['_coerce_config'] = True
options.update(kwargs)
url = options.pop('url')
return create_engine(url, **options)
__all__ = (
'create_engine',
'engine_from_config',
)
| {
"content_hash": "9b896b61a41721345281c45ff0e8df93",
"timestamp": "",
"source": "github",
"line_count": 366,
"max_line_length": 103,
"avg_line_length": 42.83879781420765,
"alnum_prop": 0.6869698322597104,
"repo_name": "jessekl/flixr",
"id": "99251f63039bd6328313f2ff943cd0a20d0c4503",
"size": "15916",
"binary": false,
"copies": "78",
"ref": "refs/heads/master",
"path": "venv/lib/python2.7/site-packages/sqlalchemy/engine/__init__.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "44245"
},
{
"name": "CSS",
"bytes": "22772"
},
{
"name": "Groff",
"bytes": "73"
},
{
"name": "HTML",
"bytes": "25882"
},
{
"name": "JavaScript",
"bytes": "7403"
},
{
"name": "Mako",
"bytes": "7564"
},
{
"name": "Python",
"bytes": "14303733"
},
{
"name": "Shell",
"bytes": "3763"
},
{
"name": "XSLT",
"bytes": "152770"
}
],
"symlink_target": ""
} |
package org.apereo.cas.services;
import java.util.Collection;
import java.util.Map;
import java.util.Optional;
/**
* This is {@link MultifactorAuthenticationProviderResolver}.
*
* @author Misagh Moayyed
* @since 5.1.0
*/
public interface MultifactorAuthenticationProviderResolver {
/**
* Consolidate providers collection.
* If the provider is multi-instance in the collection, consolidate and flatten.
*
* @param providers the providers
* @return the collection
*/
Collection<MultifactorAuthenticationProvider> flattenProviders(Collection<? extends MultifactorAuthenticationProvider> providers);
/**
* Locate the provider in the collection, and have it match the requested mfa.
* If the provider is multi-instance, resolve based on inner-registered providers.
*
* @param providers the providers
* @param requestMfaMethod the request mfa method
* @return the optional
*/
Optional<MultifactorAuthenticationProvider> resolveProvider(Map<String, MultifactorAuthenticationProvider> providers,
Collection<String> requestMfaMethod);
}
| {
"content_hash": "eb547dda8ba81c2c567e654ea3d090dc",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 134,
"avg_line_length": 34,
"alnum_prop": 0.6974789915966386,
"repo_name": "William-Hill-Online/cas",
"id": "277bc2f48a469a23d0d47ec0988d338217b135a6",
"size": "1190",
"binary": false,
"copies": "12",
"ref": "refs/heads/master",
"path": "api/cas-server-core-api-services/src/main/java/org/apereo/cas/services/MultifactorAuthenticationProviderResolver.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "124789"
},
{
"name": "Groovy",
"bytes": "14150"
},
{
"name": "HTML",
"bytes": "145115"
},
{
"name": "Java",
"bytes": "7584861"
},
{
"name": "JavaScript",
"bytes": "169109"
},
{
"name": "Shell",
"bytes": "16075"
}
],
"symlink_target": ""
} |
import logging
from django.utils.encoding import smart_text
logger = logging.getLogger('rbac_migrations')
def migrate_team(apps, schema_editor):
'''If an orphan team exists that is still active, delete it.'''
Team = apps.get_model('main', 'Team')
for team in Team.objects.iterator():
if team.organization is None:
logger.info(smart_text(u"Deleting orphaned team: {}".format(team.name)))
team.delete()
| {
"content_hash": "f1d549e11ecb63a4cd52f2ba21be5fb9",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 84,
"avg_line_length": 37.25,
"alnum_prop": 0.6756152125279642,
"repo_name": "snahelou/awx",
"id": "7c0db853096bbca1f3d22a8315e1150a465e3ebb",
"size": "456",
"binary": false,
"copies": "2",
"ref": "refs/heads/devel",
"path": "awx/main/migrations/_team_cleanup.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "277672"
},
{
"name": "HTML",
"bytes": "424349"
},
{
"name": "JavaScript",
"bytes": "2903576"
},
{
"name": "Makefile",
"bytes": "20443"
},
{
"name": "Nginx",
"bytes": "2520"
},
{
"name": "PowerShell",
"bytes": "6936"
},
{
"name": "Python",
"bytes": "7328472"
},
{
"name": "Shell",
"bytes": "1068"
}
],
"symlink_target": ""
} |
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Plugins.PushBulletNotifications.Configuration;
namespace MediaBrowser.Plugins.PushBulletNotifications
{
public class Plugin : BasePlugin<PluginConfiguration>
{
public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer)
: base(applicationPaths, xmlSerializer)
{
Instance = this;
}
public override string Name
{
get { return "PushBullet Notifications"; }
}
public override string Description
{
get
{
return "Sends notifications via PushBullet Service.";
}
}
public static Plugin Instance { get; private set; }
}
}
| {
"content_hash": "953c01b30992e191694f46d8f10e6f69",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 87,
"avg_line_length": 27.516129032258064,
"alnum_prop": 0.6424384525205158,
"repo_name": "hamstercat/Emby.Plugins",
"id": "1d8aca153d65604852f39f597ddbd3b898a5abbb",
"size": "855",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "MediaBrowser.Plugins.PushBulletNotifications/Plugin.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "8544445"
},
{
"name": "HTML",
"bytes": "206570"
}
],
"symlink_target": ""
} |
package org.ovirt.engine.api.restapi.resource;
import static org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel;
import java.util.ArrayList;
import javax.ws.rs.WebApplicationException;
import org.junit.Test;
import org.ovirt.engine.api.model.Network;
import org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters;
import org.ovirt.engine.core.common.action.RemoveNetworkParameters;
import org.ovirt.engine.core.common.action.VdcActionType;
import org.ovirt.engine.core.common.queries.IdQueryParameters;
import org.ovirt.engine.core.common.queries.VdcQueryType;
import org.ovirt.engine.core.compat.Guid;
public class BackendNetworkResourceTest
extends AbstractBackendNetworkResourceTest<BackendNetworkResource> {
public BackendNetworkResourceTest() {
super(new BackendNetworkResource(GUIDS[0].toString(), new BackendNetworksResource()));
}
@Test
public void testBadGuid() throws Exception {
control.replay();
try {
new BackendNetworkResource("foo", null);
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
verifyNotFoundException(wae);
}
}
@Test
public void testGetNotFound() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpEntityQueryExpectations(VdcQueryType.GetAllNetworks,
IdQueryParameters.class,
new String[] { "Id" },
new Object[] { Guid.Empty },
new ArrayList<org.ovirt.engine.core.common.businessentities.network.Network>());
control.replay();
try {
resource.get();
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
verifyNotFoundException(wae);
}
}
@Test
public void testGet() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpEntityQueryExpectations(1);
control.replay();
verifyModel(resource.get(), 0);
}
@Test
public void testUpdateNotFound() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpEntityQueryExpectations(VdcQueryType.GetAllNetworks,
IdQueryParameters.class,
new String[] { "Id" },
new Object[] { Guid.Empty },
new ArrayList<org.ovirt.engine.core.common.businessentities.network.Network>());
control.replay();
try {
resource.update(getModel(0));
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
verifyNotFoundException(wae);
}
}
@Test
public void testUpdate() throws Exception {
setUpEntityQueryExpectations(2);
setUriInfo(setUpActionExpectations(VdcActionType.UpdateNetwork,
AddNetworkStoragePoolParameters.class,
new String[] { "StoragePoolId" },
new Object[] { GUIDS[1] },
true,
true));
verifyModel(resource.update(getModel(0)), 0);
}
@Test
public void testUpdateCantDo() throws Exception {
doTestBadUpdate(false, true, CANT_DO);
}
@Test
public void testUpdateFailed() throws Exception {
doTestBadUpdate(true, false, FAILURE);
}
private void doTestBadUpdate(boolean canDo, boolean success, String detail) throws Exception {
setUpEntityQueryExpectations(1);
setUriInfo(setUpActionExpectations(VdcActionType.UpdateNetwork,
AddNetworkStoragePoolParameters.class,
new String[] { "StoragePoolId" },
new Object[] { GUIDS[1] },
canDo,
success));
try {
resource.update(getModel(0));
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
verifyFault(wae, detail);
}
}
@Test
public void testConflictedUpdate() throws Exception {
setUriInfo(setUpBasicUriExpectations());
setUpEntityQueryExpectations(1);
control.replay();
Network model = getModel(1);
model.setId(GUIDS[1].toString());
try {
resource.update(model);
fail("expected WebApplicationException");
} catch (WebApplicationException wae) {
verifyImmutabilityConstraint(wae);
}
}
@Test
public void testRemoveNotFound() throws Exception {
setUpEntityQueryExpectations(
VdcQueryType.GetAllNetworks,
IdQueryParameters.class,
new String[] { "Id" },
new Object[] { Guid.Empty },
new ArrayList<org.ovirt.engine.core.common.businessentities.network.Network>()
);
control.replay();
try {
resource.remove();
fail("expected WebApplicationException");
}
catch (WebApplicationException wae) {
verifyNotFoundException(wae);
}
}
@Test
public void testRemove() throws Exception {
setUpEntityQueryExpectations(2);
setUriInfo(
setUpActionExpectations(
VdcActionType.RemoveNetwork,
RemoveNetworkParameters.class,
new String[] { "Id" },
new Object[] { GUIDS[0] },
true,
true
)
);
verifyRemove(resource.remove());
}
@Test
public void testRemoveNonExistant() throws Exception{
setUpEntityQueryExpectations(
VdcQueryType.GetAllNetworks,
IdQueryParameters.class,
new String[] { "Id" },
new Object[] { Guid.Empty },
new ArrayList<org.ovirt.engine.core.common.businessentities.network.Network>(),
null
);
control.replay();
try {
resource.remove();
fail("expected WebApplicationException");
}
catch (WebApplicationException wae) {
assertNotNull(wae.getResponse());
assertEquals(404, wae.getResponse().getStatus());
}
}
@Test
public void testRemoveCantDo() throws Exception {
doTestBadRemove(false, true, CANT_DO);
}
@Test
public void testRemoveFailed() throws Exception {
doTestBadRemove(true, false, FAILURE);
}
protected void doTestBadRemove(boolean canDo, boolean success, String detail) throws Exception {
setUpEntityQueryExpectations(2);
setUriInfo(
setUpActionExpectations(
VdcActionType.RemoveNetwork,
RemoveNetworkParameters.class,
new String[] { "Id" },
new Object[] { GUIDS[0] },
canDo,
success
)
);
try {
resource.remove();
fail("expected WebApplicationException");
}
catch (WebApplicationException wae) {
verifyFault(wae, detail);
}
}
protected void setUpEntityQueryExpectations(int times) throws Exception {
while (times-- > 0) {
setUpEntityQueryExpectations(VdcQueryType.GetAllNetworks,
IdQueryParameters.class,
new String[] { "Id" },
new Object[] { Guid.Empty },
getEntityList());
}
}
}
| {
"content_hash": "376333817976e06c819d1213d3c378a3",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 117,
"avg_line_length": 34.205128205128204,
"alnum_prop": 0.5614692653673163,
"repo_name": "zerodengxinchao/ovirt-engine",
"id": "7a8065e189e286b79e1d60323ba2ddb6943bc185",
"size": "8004",
"binary": false,
"copies": "6",
"ref": "refs/heads/eayunos-4.2",
"path": "backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendNetworkResourceTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "68312"
},
{
"name": "HTML",
"bytes": "16218"
},
{
"name": "Java",
"bytes": "35067557"
},
{
"name": "JavaScript",
"bytes": "69948"
},
{
"name": "Makefile",
"bytes": "24723"
},
{
"name": "PLSQL",
"bytes": "533"
},
{
"name": "PLpgSQL",
"bytes": "796728"
},
{
"name": "Python",
"bytes": "970860"
},
{
"name": "Roff",
"bytes": "10764"
},
{
"name": "Shell",
"bytes": "163853"
},
{
"name": "XSLT",
"bytes": "54683"
}
],
"symlink_target": ""
} |
{% extends "base.html" %}
{% block sidebar %}
{% endblock %}
{% block header_ext %}
{% endblock %}
{% block content %}
<h1>Error 404 - Page not found</h1>
{% endblock %}
| {
"content_hash": "296f52337213026f6c1c5522cb024983",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 35,
"avg_line_length": 15.727272727272727,
"alnum_prop": 0.5838150289017341,
"repo_name": "emergebtc/evennia",
"id": "0d5979d6e7718bab0e52a4b43e1ac98bf6127fa1",
"size": "173",
"binary": false,
"copies": "18",
"ref": "refs/heads/master",
"path": "evennia/web/templates/prosimii/404.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "19127"
},
{
"name": "Emacs Lisp",
"bytes": "2734"
},
{
"name": "HTML",
"bytes": "13351"
},
{
"name": "JavaScript",
"bytes": "24398"
},
{
"name": "Python",
"bytes": "2055687"
}
],
"symlink_target": ""
} |
package pl.java.scalatech.collection;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multiset;
import lombok.extern.slf4j.Slf4j;
import pl.java.scalatech.common.DataPrepareTest;
@Slf4j
public class OrDefaultTest extends DataPrepareTest {
@Test
public void shouldMapCountOldApproach() {
Map<String, Long> map = new HashMap<>();
for (String s : names) {
Long count = map.get(s);
map.put(s, count == null ? 1L : count + 1);
}
log.info("{}", map);
}
@Test
public void shouldDefaultOrNull() {
Map<String, Long> map = new HashMap<>();
for (String s : names) {
map.put(s, 1 + map.getOrDefault(s, 0L));
}
log.info("{}", map);
}
@Test
public void shouldGuavaMultiMapWork() {
Multiset<String> wordsMultiset = HashMultiset.create();
wordsMultiset.addAll(names);
log.info("{}", wordsMultiset);
}
}
| {
"content_hash": "41bb174b63afbaaeaaa5bf8e9df8d26d",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 63,
"avg_line_length": 25.78048780487805,
"alnum_prop": 0.6158940397350994,
"repo_name": "przodownikR1/java8features",
"id": "6d8b7b842a6d6d015c0345d4ca1e94a65eae2f2f",
"size": "1057",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/pl/java/scalatech/collection/OrDefaultTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "184691"
}
],
"symlink_target": ""
} |
import { Arr, Fun, Optional } from '@ephox/katamari';
import Editor from '../api/Editor';
import * as CaretContainer from '../caret/CaretContainer';
import CaretPosition from '../caret/CaretPosition';
import * as CaretUtils from '../caret/CaretUtils';
import { CaretWalker, HDirection } from '../caret/CaretWalker';
import * as FakeCaretUtils from '../caret/FakeCaretUtils';
import { getPositionsUntilNextLine, getPositionsUntilPreviousLine } from '../caret/LineReader';
import * as LineReader from '../caret/LineReader';
import * as LineUtils from '../caret/LineUtils';
import { LinePosClientRect } from '../caret/LineWalker';
import * as LineWalker from '../caret/LineWalker';
import * as ScrollIntoView from '../dom/ScrollIntoView';
import * as RangeNodes from '../selection/RangeNodes';
import * as ArrUtils from '../util/ArrUtils';
import { isCefAtEdgeSelected } from './CefUtils';
import * as InlineUtils from './InlineUtils';
const moveToRange = (editor: Editor, rng: Range): void => {
editor.selection.setRng(rng);
// Don't reuse the original range as TinyMCE will adjust it
ScrollIntoView.scrollRangeIntoView(editor, editor.selection.getRng());
};
const renderRangeCaretOpt = (editor: Editor, range: Range, scrollIntoView: boolean): Optional<Range> =>
Optional.some(FakeCaretUtils.renderRangeCaret(editor, range, scrollIntoView));
const moveHorizontally = (editor: Editor, direction: HDirection, range: Range, isBefore: (caretPosition: CaretPosition) => boolean,
isAfter: (caretPosition: CaretPosition) => boolean, isElement: (node: Node | null) => node is HTMLElement): Optional<Range> => {
const forwards = direction === HDirection.Forwards;
const caretWalker = CaretWalker(editor.getBody());
const getNextPosFn = Fun.curry(CaretUtils.getVisualCaretPosition, forwards ? caretWalker.next : caretWalker.prev);
const isBeforeFn = forwards ? isBefore : isAfter;
if (!range.collapsed) {
const node = RangeNodes.getSelectedNode(range);
if (isElement(node)) {
return FakeCaretUtils.showCaret(direction, editor, node, direction === HDirection.Backwards, false);
} else if (isCefAtEdgeSelected(editor)) {
const newRange = range.cloneRange();
newRange.collapse(direction === HDirection.Backwards);
return Optional.from(newRange);
}
}
const caretPosition = CaretUtils.getNormalizedRangeEndPoint(direction, editor.getBody(), range);
if (isBeforeFn(caretPosition)) {
return FakeCaretUtils.selectNode(editor, caretPosition.getNode(!forwards) as Element);
}
let nextCaretPosition = getNextPosFn(caretPosition);
const rangeIsInContainerBlock = CaretContainer.isRangeInCaretContainerBlock(range);
if (!nextCaretPosition) {
return rangeIsInContainerBlock ? Optional.some(range) : Optional.none();
} else {
nextCaretPosition = InlineUtils.normalizePosition(forwards, nextCaretPosition);
}
if (isBeforeFn(nextCaretPosition)) {
return FakeCaretUtils.showCaret(direction, editor, nextCaretPosition.getNode(!forwards) as HTMLElement, forwards, false);
}
// Peek ahead for handling of ab|c<span cE=false> -> abc|<span cE=false>
const peekCaretPosition = getNextPosFn(nextCaretPosition);
if (peekCaretPosition && isBeforeFn(peekCaretPosition)) {
if (CaretUtils.isMoveInsideSameBlock(nextCaretPosition, peekCaretPosition)) {
return FakeCaretUtils.showCaret(direction, editor, peekCaretPosition.getNode(!forwards) as HTMLElement, forwards, false);
}
}
if (rangeIsInContainerBlock) {
return renderRangeCaretOpt(editor, nextCaretPosition.toRange(), false);
}
return Optional.none();
};
const moveVertically = (editor: Editor, direction: LineWalker.VDirection, range: Range, isBefore: (caretPosition: CaretPosition) => boolean,
isAfter: (caretPosition: CaretPosition) => boolean, isElement: (node: Node) => node is HTMLElement): Optional<Range> => {
const caretPosition = CaretUtils.getNormalizedRangeEndPoint(direction, editor.getBody(), range);
const caretClientRect = ArrUtils.last(caretPosition.getClientRects());
const forwards = direction === LineWalker.VDirection.Down;
const root = editor.getBody();
if (!caretClientRect) {
return Optional.none();
}
if (isCefAtEdgeSelected(editor)) {
const caretPosition = forwards ? CaretPosition.fromRangeEnd(range) : CaretPosition.fromRangeStart(range);
const getClosestFn = !forwards ? LineReader.getClosestPositionAbove : LineReader.getClosestPositionBelow;
return getClosestFn(root, caretPosition)
.orThunk(() => Optional.from(caretPosition))
.map((pos) => pos.toRange());
}
const walkerFn = forwards ? LineWalker.downUntil : LineWalker.upUntil;
const linePositions = walkerFn(root, LineWalker.isAboveLine(1), caretPosition);
const nextLinePositions = Arr.filter(linePositions, LineWalker.isLine(1));
const clientX = caretClientRect.left;
const nextLineRect = LineUtils.findClosestClientRect(nextLinePositions, clientX);
if (nextLineRect && isElement(nextLineRect.node)) {
const dist1 = Math.abs(clientX - nextLineRect.left);
const dist2 = Math.abs(clientX - nextLineRect.right);
return FakeCaretUtils.showCaret(direction, editor, nextLineRect.node, dist1 < dist2, false);
}
let currentNode;
if (isBefore(caretPosition)) {
currentNode = caretPosition.getNode();
} else if (isAfter(caretPosition)) {
currentNode = caretPosition.getNode(true);
} else {
currentNode = RangeNodes.getSelectedNode(range);
}
if (currentNode) {
const caretPositions = LineWalker.positionsUntil(direction, root, LineWalker.isAboveLine(1), currentNode);
let closestNextLineRect: LinePosClientRect | undefined = LineUtils.findClosestClientRect(Arr.filter(caretPositions, LineWalker.isLine(1)), clientX);
if (closestNextLineRect) {
return renderRangeCaretOpt(editor, closestNextLineRect.position.toRange(), false);
}
closestNextLineRect = ArrUtils.last(Arr.filter(caretPositions, LineWalker.isLine(0)));
if (closestNextLineRect) {
return renderRangeCaretOpt(editor, closestNextLineRect.position.toRange(), false);
}
}
if (nextLinePositions.length === 0) {
return getLineEndPoint(editor, forwards).filter(forwards ? isAfter : isBefore)
.map((pos) => FakeCaretUtils.renderRangeCaret(editor, pos.toRange(), false));
}
return Optional.none();
};
const getLineEndPoint = (editor: Editor, forward: boolean): Optional<CaretPosition> => {
const rng = editor.selection.getRng();
const from = forward ? CaretPosition.fromRangeEnd(rng) : CaretPosition.fromRangeStart(rng);
const host = CaretUtils.getEditingHost(from.container(), editor.getBody());
if (forward) {
const lineInfo = getPositionsUntilNextLine(host, from);
return Arr.last(lineInfo.positions);
} else {
const lineInfo = getPositionsUntilPreviousLine(host, from);
return Arr.head(lineInfo.positions);
}
};
const moveToLineEndPoint = (editor: Editor, forward: boolean, isElementPosition: (pos: CaretPosition) => boolean): boolean =>
getLineEndPoint(editor, forward).filter(isElementPosition).exists((pos) => {
editor.selection.setRng(pos.toRange());
return true;
});
export {
getLineEndPoint,
moveHorizontally,
moveVertically,
moveToLineEndPoint,
moveToRange
};
| {
"content_hash": "99ba22f3044c4ce536ee9ba6c75c0bd2",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 154,
"avg_line_length": 43.57142857142857,
"alnum_prop": 0.7379781420765027,
"repo_name": "tinymce/tinymce",
"id": "82a22ad2c86dbd382272a3aaadd1ab3a6da616a4",
"size": "7320",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "modules/tinymce/src/core/main/ts/keyboard/NavigationUtils.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9733"
},
{
"name": "HTML",
"bytes": "183264"
},
{
"name": "JavaScript",
"bytes": "117530"
},
{
"name": "Less",
"bytes": "182379"
},
{
"name": "TypeScript",
"bytes": "11764279"
}
],
"symlink_target": ""
} |
"""Save and restore variables."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import os.path
import re
import time
from google.protobuf import text_format
from tensorflow.core.protobuf import saver_pb2
from tensorflow.python.eager import context
from tensorflow.python.framework import errors
from tensorflow.python.framework import ops
from tensorflow.python.lib.io import file_io
from tensorflow.python.ops import variable_scope
from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.training import training_util
from tensorflow.python.training.checkpoint_state_pb2 import CheckpointState
from tensorflow.python.util import compat
from tensorflow.python.util import deprecation
from tensorflow.python.util.tf_export import tf_export
def _GetCheckpointFilename(save_dir, latest_filename):
"""Returns a filename for storing the CheckpointState.
Args:
save_dir: The directory for saving and restoring checkpoints.
latest_filename: Name of the file in 'save_dir' that is used
to store the CheckpointState.
Returns:
The path of the file that contains the CheckpointState proto.
"""
if latest_filename is None:
latest_filename = "checkpoint"
return os.path.join(save_dir, latest_filename)
@tf_export(v1=["train.generate_checkpoint_state_proto"])
def generate_checkpoint_state_proto(save_dir,
model_checkpoint_path,
all_model_checkpoint_paths=None,
all_model_checkpoint_timestamps=None,
last_preserved_timestamp=None):
"""Generates a checkpoint state proto.
Args:
save_dir: Directory where the model was saved.
model_checkpoint_path: The checkpoint file.
all_model_checkpoint_paths: List of strings. Paths to all not-yet-deleted
checkpoints, sorted from oldest to newest. If this is a non-empty list,
the last element must be equal to model_checkpoint_path. These paths
are also saved in the CheckpointState proto.
all_model_checkpoint_timestamps: A list of floats, indicating the number of
seconds since the Epoch when each checkpoint was generated.
last_preserved_timestamp: A float, indicating the number of seconds since
the Epoch when the last preserved checkpoint was written, e.g. due to a
`keep_checkpoint_every_n_hours` parameter (see
`tf.contrib.checkpoint.CheckpointManager` for an implementation).
Returns:
CheckpointState proto with model_checkpoint_path and
all_model_checkpoint_paths updated to either absolute paths or
relative paths to the current save_dir.
Raises:
ValueError: If `all_model_checkpoint_timestamps` was provided but its length
does not match `all_model_checkpoint_paths`.
"""
if all_model_checkpoint_paths is None:
all_model_checkpoint_paths = []
if (not all_model_checkpoint_paths or
all_model_checkpoint_paths[-1] != model_checkpoint_path):
logging.info("%s is not in all_model_checkpoint_paths. Manually adding it.",
model_checkpoint_path)
all_model_checkpoint_paths.append(model_checkpoint_path)
if (all_model_checkpoint_timestamps
and (len(all_model_checkpoint_timestamps)
!= len(all_model_checkpoint_paths))):
raise ValueError(
("Checkpoint timestamps, if provided, must match checkpoint paths (got "
"paths %s and timestamps %s)")
% (all_model_checkpoint_paths, all_model_checkpoint_timestamps))
# Relative paths need to be rewritten to be relative to the "save_dir"
# if model_checkpoint_path already contains "save_dir".
if not os.path.isabs(save_dir):
if not os.path.isabs(model_checkpoint_path):
model_checkpoint_path = os.path.relpath(model_checkpoint_path, save_dir)
for i in range(len(all_model_checkpoint_paths)):
p = all_model_checkpoint_paths[i]
if not os.path.isabs(p):
all_model_checkpoint_paths[i] = os.path.relpath(p, save_dir)
coord_checkpoint_proto = CheckpointState(
model_checkpoint_path=model_checkpoint_path,
all_model_checkpoint_paths=all_model_checkpoint_paths,
all_model_checkpoint_timestamps=all_model_checkpoint_timestamps,
last_preserved_timestamp=last_preserved_timestamp)
return coord_checkpoint_proto
@deprecation.deprecated(
date=None,
instructions=("Use `tf.train.CheckpointManager` to manage checkpoints "
"rather than manually editing the Checkpoint proto."))
@tf_export(v1=["train.update_checkpoint_state"])
def update_checkpoint_state(save_dir,
model_checkpoint_path,
all_model_checkpoint_paths=None,
latest_filename=None,
all_model_checkpoint_timestamps=None,
last_preserved_timestamp=None):
"""Updates the content of the 'checkpoint' file.
This updates the checkpoint file containing a CheckpointState
proto.
Args:
save_dir: Directory where the model was saved.
model_checkpoint_path: The checkpoint file.
all_model_checkpoint_paths: List of strings. Paths to all not-yet-deleted
checkpoints, sorted from oldest to newest. If this is a non-empty list,
the last element must be equal to model_checkpoint_path. These paths
are also saved in the CheckpointState proto.
latest_filename: Optional name of the checkpoint file. Default to
'checkpoint'.
all_model_checkpoint_timestamps: Optional list of timestamps (floats,
seconds since the Epoch) indicating when the checkpoints in
`all_model_checkpoint_paths` were created.
last_preserved_timestamp: A float, indicating the number of seconds since
the Epoch when the last preserved checkpoint was written, e.g. due to a
`keep_checkpoint_every_n_hours` parameter (see
`tf.contrib.checkpoint.CheckpointManager` for an implementation).
Raises:
RuntimeError: If any of the model checkpoint paths conflict with the file
containing CheckpointSate.
"""
update_checkpoint_state_internal(
save_dir=save_dir,
model_checkpoint_path=model_checkpoint_path,
all_model_checkpoint_paths=all_model_checkpoint_paths,
latest_filename=latest_filename,
save_relative_paths=False,
all_model_checkpoint_timestamps=all_model_checkpoint_timestamps,
last_preserved_timestamp=last_preserved_timestamp)
def update_checkpoint_state_internal(save_dir,
model_checkpoint_path,
all_model_checkpoint_paths=None,
latest_filename=None,
save_relative_paths=False,
all_model_checkpoint_timestamps=None,
last_preserved_timestamp=None):
"""Updates the content of the 'checkpoint' file.
This updates the checkpoint file containing a CheckpointState
proto.
Args:
save_dir: Directory where the model was saved.
model_checkpoint_path: The checkpoint file.
all_model_checkpoint_paths: List of strings. Paths to all not-yet-deleted
checkpoints, sorted from oldest to newest. If this is a non-empty list,
the last element must be equal to model_checkpoint_path. These paths
are also saved in the CheckpointState proto.
latest_filename: Optional name of the checkpoint file. Default to
'checkpoint'.
save_relative_paths: If `True`, will write relative paths to the checkpoint
state file.
all_model_checkpoint_timestamps: Optional list of timestamps (floats,
seconds since the Epoch) indicating when the checkpoints in
`all_model_checkpoint_paths` were created.
last_preserved_timestamp: A float, indicating the number of seconds since
the Epoch when the last preserved checkpoint was written, e.g. due to a
`keep_checkpoint_every_n_hours` parameter (see
`tf.contrib.checkpoint.CheckpointManager` for an implementation).
Raises:
RuntimeError: If any of the model checkpoint paths conflict with the file
containing CheckpointSate.
"""
# Writes the "checkpoint" file for the coordinator for later restoration.
coord_checkpoint_filename = _GetCheckpointFilename(save_dir, latest_filename)
if save_relative_paths:
if os.path.isabs(model_checkpoint_path):
rel_model_checkpoint_path = os.path.relpath(
model_checkpoint_path, save_dir)
else:
rel_model_checkpoint_path = model_checkpoint_path
rel_all_model_checkpoint_paths = []
for p in all_model_checkpoint_paths:
if os.path.isabs(p):
rel_all_model_checkpoint_paths.append(os.path.relpath(p, save_dir))
else:
rel_all_model_checkpoint_paths.append(p)
ckpt = generate_checkpoint_state_proto(
save_dir,
rel_model_checkpoint_path,
all_model_checkpoint_paths=rel_all_model_checkpoint_paths,
all_model_checkpoint_timestamps=all_model_checkpoint_timestamps,
last_preserved_timestamp=last_preserved_timestamp)
else:
ckpt = generate_checkpoint_state_proto(
save_dir,
model_checkpoint_path,
all_model_checkpoint_paths=all_model_checkpoint_paths,
all_model_checkpoint_timestamps=all_model_checkpoint_timestamps,
last_preserved_timestamp=last_preserved_timestamp)
if coord_checkpoint_filename == ckpt.model_checkpoint_path:
raise RuntimeError("Save path '%s' conflicts with path used for "
"checkpoint state. Please use a different save path." %
model_checkpoint_path)
# Preventing potential read/write race condition by *atomically* writing to a
# file.
file_io.atomic_write_string_to_file(coord_checkpoint_filename,
text_format.MessageToString(ckpt))
@tf_export("train.get_checkpoint_state")
def get_checkpoint_state(checkpoint_dir, latest_filename=None):
"""Returns CheckpointState proto from the "checkpoint" file.
If the "checkpoint" file contains a valid CheckpointState
proto, returns it.
Args:
checkpoint_dir: The directory of checkpoints.
latest_filename: Optional name of the checkpoint file. Default to
'checkpoint'.
Returns:
A CheckpointState if the state was available, None
otherwise.
Raises:
ValueError: if the checkpoint read doesn't have model_checkpoint_path set.
"""
ckpt = None
coord_checkpoint_filename = _GetCheckpointFilename(checkpoint_dir,
latest_filename)
f = None
try:
# Check that the file exists before opening it to avoid
# many lines of errors from colossus in the logs.
if file_io.file_exists(coord_checkpoint_filename):
file_content = file_io.read_file_to_string(
coord_checkpoint_filename)
ckpt = CheckpointState()
text_format.Merge(file_content, ckpt)
if not ckpt.model_checkpoint_path:
raise ValueError("Invalid checkpoint state loaded from "
+ checkpoint_dir)
# For relative model_checkpoint_path and all_model_checkpoint_paths,
# prepend checkpoint_dir.
if not os.path.isabs(ckpt.model_checkpoint_path):
ckpt.model_checkpoint_path = os.path.join(checkpoint_dir,
ckpt.model_checkpoint_path)
for i in range(len(ckpt.all_model_checkpoint_paths)):
p = ckpt.all_model_checkpoint_paths[i]
if not os.path.isabs(p):
ckpt.all_model_checkpoint_paths[i] = os.path.join(checkpoint_dir, p)
except errors.OpError as e:
# It's ok if the file cannot be read
logging.warning("%s: %s", type(e).__name__, e)
logging.warning("%s: Checkpoint ignored", coord_checkpoint_filename)
return None
except text_format.ParseError as e:
logging.warning("%s: %s", type(e).__name__, e)
logging.warning("%s: Checkpoint ignored", coord_checkpoint_filename)
return None
finally:
if f:
f.close()
return ckpt
def _prefix_to_checkpoint_path(prefix, format_version):
"""Returns the pathname of a checkpoint file, given the checkpoint prefix.
For V1 checkpoint, simply returns the prefix itself (the data file). For V2,
returns the pathname to the index file.
Args:
prefix: a string, the prefix of a checkpoint.
format_version: the checkpoint format version that corresponds to the
prefix.
Returns:
The pathname of a checkpoint file, taking into account the checkpoint
format version.
"""
if format_version == saver_pb2.SaverDef.V2:
return prefix + ".index" # The index file identifies a checkpoint.
return prefix # Just the data file.
@tf_export("train.latest_checkpoint")
def latest_checkpoint(checkpoint_dir, latest_filename=None):
"""Finds the filename of latest saved checkpoint file.
Args:
checkpoint_dir: Directory where the variables were saved.
latest_filename: Optional name for the protocol buffer file that
contains the list of most recent checkpoint filenames.
See the corresponding argument to `Saver.save()`.
Returns:
The full path to the latest checkpoint or `None` if no checkpoint was found.
"""
# Pick the latest checkpoint based on checkpoint state.
ckpt = get_checkpoint_state(checkpoint_dir, latest_filename)
if ckpt and ckpt.model_checkpoint_path:
# Look for either a V2 path or a V1 path, with priority for V2.
v2_path = _prefix_to_checkpoint_path(ckpt.model_checkpoint_path,
saver_pb2.SaverDef.V2)
v1_path = _prefix_to_checkpoint_path(ckpt.model_checkpoint_path,
saver_pb2.SaverDef.V1)
if file_io.get_matching_files(v2_path) or file_io.get_matching_files(
v1_path):
return ckpt.model_checkpoint_path
else:
logging.error("Couldn't match files for checkpoint %s",
ckpt.model_checkpoint_path)
return None
@deprecation.deprecated(
date=None,
instructions="Use standard file APIs to check for files with this prefix.")
@tf_export(v1=["train.checkpoint_exists"])
def checkpoint_exists(checkpoint_prefix):
"""Checks whether a V1 or V2 checkpoint exists with the specified prefix.
This is the recommended way to check if a checkpoint exists, since it takes
into account the naming difference between V1 and V2 formats.
Args:
checkpoint_prefix: the prefix of a V1 or V2 checkpoint, with V2 taking
priority. Typically the result of `Saver.save()` or that of
`tf.train.latest_checkpoint()`, regardless of sharded/non-sharded or
V1/V2.
Returns:
A bool, true iff a checkpoint referred to by `checkpoint_prefix` exists.
"""
pathname = _prefix_to_checkpoint_path(checkpoint_prefix,
saver_pb2.SaverDef.V2)
if file_io.get_matching_files(pathname):
return True
elif file_io.get_matching_files(checkpoint_prefix):
return True
else:
return False
@deprecation.deprecated(
date=None,
instructions="Use standard file utilities to get mtimes.")
@tf_export(v1=["train.get_checkpoint_mtimes"])
def get_checkpoint_mtimes(checkpoint_prefixes):
"""Returns the mtimes (modification timestamps) of the checkpoints.
Globs for the checkpoints pointed to by `checkpoint_prefixes`. If the files
exist, collect their mtime. Both V2 and V1 checkpoints are considered, in
that priority.
This is the recommended way to get the mtimes, since it takes into account
the naming difference between V1 and V2 formats.
Args:
checkpoint_prefixes: a list of checkpoint paths, typically the results of
`Saver.save()` or those of `tf.train.latest_checkpoint()`, regardless of
sharded/non-sharded or V1/V2.
Returns:
A list of mtimes (in microseconds) of the found checkpoints.
"""
mtimes = []
def match_maybe_append(pathname):
fnames = file_io.get_matching_files(pathname)
if fnames:
mtimes.append(file_io.stat(fnames[0]).mtime_nsec / 1e9)
return True
return False
for checkpoint_prefix in checkpoint_prefixes:
# Tries V2's metadata file first.
pathname = _prefix_to_checkpoint_path(checkpoint_prefix,
saver_pb2.SaverDef.V2)
if match_maybe_append(pathname):
continue
# Otherwise, tries V1, where the prefix is the complete pathname.
match_maybe_append(checkpoint_prefix)
return mtimes
@deprecation.deprecated(
date=None,
instructions="Use standard file APIs to delete files with this prefix.")
@tf_export(v1=["train.remove_checkpoint"])
def remove_checkpoint(checkpoint_prefix,
checkpoint_format_version=saver_pb2.SaverDef.V2,
meta_graph_suffix="meta"):
"""Removes a checkpoint given by `checkpoint_prefix`.
Args:
checkpoint_prefix: The prefix of a V1 or V2 checkpoint. Typically the result
of `Saver.save()` or that of `tf.train.latest_checkpoint()`, regardless of
sharded/non-sharded or V1/V2.
checkpoint_format_version: `SaverDef.CheckpointFormatVersion`, defaults to
`SaverDef.V2`.
meta_graph_suffix: Suffix for `MetaGraphDef` file. Defaults to 'meta'.
"""
_delete_file_if_exists(
meta_graph_filename(checkpoint_prefix, meta_graph_suffix))
if checkpoint_format_version == saver_pb2.SaverDef.V2:
# V2 has a metadata file and some data files.
_delete_file_if_exists(checkpoint_prefix + ".index")
_delete_file_if_exists(checkpoint_prefix + ".data-?????-of-?????")
else:
# V1, Legacy. Exact match on the data file.
_delete_file_if_exists(checkpoint_prefix)
def _delete_file_if_exists(filespec):
"""Deletes files matching `filespec`."""
for pathname in file_io.get_matching_files(filespec):
file_io.delete_file(pathname)
def meta_graph_filename(checkpoint_filename, meta_graph_suffix="meta"):
"""Returns the meta graph filename.
Args:
checkpoint_filename: Name of the checkpoint file.
meta_graph_suffix: Suffix for `MetaGraphDef` file. Defaults to 'meta'.
Returns:
MetaGraph file name.
"""
# If the checkpoint_filename is sharded, the checkpoint_filename could
# be of format model.ckpt-step#-?????-of-shard#. For example,
# model.ckpt-123456-?????-of-00005, or model.ckpt-123456-00001-of-00002.
basename = re.sub(r"-[\d\?]+-of-\d+$", "", checkpoint_filename)
suffixed_filename = ".".join([basename, meta_graph_suffix])
return suffixed_filename
# TODO(allenl): Allow tf.keras.Model instances in the constructor directly?
@tf_export("train.CheckpointManager")
class CheckpointManager(object):
"""Deletes old checkpoints.
Example usage:
```python
import tensorflow as tf
checkpoint = tf.train.Checkpoint(optimizer=optimizer, model=model)
manager = tf.contrib.checkpoint.CheckpointManager(
checkpoint, directory="/tmp/model", max_to_keep=5)
status = checkpoint.restore(manager.latest_checkpoint)
while True:
# train
manager.save()
```
`CheckpointManager` preserves its own state across instantiations (see the
`__init__` documentation for details). Only one should be active in a
particular directory at a time.
"""
def __init__(self, checkpoint, directory,
max_to_keep, keep_checkpoint_every_n_hours=None):
"""Configure a `CheckpointManager` for use in `directory`.
If a `CheckpointManager` was previously used in `directory`, its
state will be restored. This includes the list of managed checkpoints and
the timestamp bookkeeping necessary to support
`keep_checkpoint_every_n_hours`. The behavior of the new `CheckpointManager`
will be the same as the previous `CheckpointManager`, including cleaning up
existing checkpoints if appropriate.
Checkpoints are only considered for deletion just after a new checkpoint has
been added. At that point, `max_to_keep` checkpoints will remain in an
"active set". Once a checkpoint is preserved by
`keep_checkpoint_every_n_hours` it will not be deleted by this
`CheckpointManager` or any future `CheckpointManager` instantiated in
`directory` (regardless of the new setting of
`keep_checkpoint_every_n_hours`). The `max_to_keep` checkpoints in the
active set may be deleted by this `CheckpointManager` or a future
`CheckpointManager` instantiated in `directory` (subject to its
`max_to_keep` and `keep_checkpoint_every_n_hours` settings).
Args:
checkpoint: The `tf.train.Checkpoint` instance to save and manage
checkpoints for.
directory: The path to a directory in which to write checkpoints. A
special file named "checkpoint" is also written to this directory (in a
human-readable text format) which contains the state of the
`CheckpointManager`.
max_to_keep: An integer, the number of checkpoints to keep. Unless
preserved by `keep_checkpoint_every_n_hours`, checkpoints will be
deleted from the active set, oldest first, until only `max_to_keep`
checkpoints remain. If `None`, no checkpoints are deleted and everything
stays in the active set. Note that `max_to_keep=None` will keep all
checkpoint paths in memory and in the checkpoint state protocol buffer
on disk.
keep_checkpoint_every_n_hours: Upon removal from the active set, a
checkpoint will be preserved if it has been at least
`keep_checkpoint_every_n_hours` since the last preserved checkpoint. The
default setting of `None` does not preserve any checkpoints in this way.
Raises:
ValueError: If `max_to_keep` is not a positive integer.
"""
self._checkpoint = checkpoint
self._save_counter_assign = None
if max_to_keep is not None and max_to_keep <= 0:
raise ValueError(
("Expected a positive integer or `None` for `max_to_max_to_keep`, "
"got %d.")
% (max_to_keep,))
self._max_to_keep = max_to_keep
self._keep_checkpoint_every_n_hours = keep_checkpoint_every_n_hours
self._directory = directory
self._checkpoint_prefix = os.path.join(directory, "ckpt")
recovered_state = get_checkpoint_state(directory)
current_clock = time.time()
self._maybe_delete = collections.OrderedDict()
if recovered_state is None:
self._latest_checkpoint = None
# Set the clock back slightly to avoid race conditions when quckly
# re-creating a CheckpointManager.
self._last_preserved_timestamp = current_clock - 1.
else:
self._latest_checkpoint = recovered_state.model_checkpoint_path
self._last_preserved_timestamp = recovered_state.last_preserved_timestamp
if current_clock < self._last_preserved_timestamp:
# Time seems to have reversed itself. In addition to this warning, we'll
# min() saved checkpoint timestamps with the current time to ensure that
# old checkpoints don't get deleted accidentally.
logging.warning(
("time.time() returned a value %f seconds behind the last "
"preserved checkpoint timestamp.")
% (self._last_preserved_timestamp - current_clock,))
self._last_preserved_timestamp = current_clock
all_timestamps = recovered_state.all_model_checkpoint_timestamps
all_paths = recovered_state.all_model_checkpoint_paths
del recovered_state # Uses modified values from now on
if not all_timestamps:
all_timestamps = [self._last_preserved_timestamp] * len(all_paths)
for filename, timestamp in zip(all_paths, all_timestamps):
timestamp = min(timestamp, current_clock)
if timestamp > self._last_preserved_timestamp:
self._maybe_delete[filename] = timestamp
@property
def latest_checkpoint(self):
"""The prefix of the most recent checkpoint in `directory`.
Equivalent to `tf.train.latest_checkpoint(directory)` where `directory` is
the constructor argument to `CheckpointManager`.
Suitable for passing to `tf.train.Checkpoint.restore` to resume training.
Returns:
The checkpoint prefix. If there are no checkpoints, returns `None`.
"""
return self._latest_checkpoint
@property
def checkpoints(self):
"""A list of managed checkpoints.
Note that checkpoints saved due to `keep_checkpoint_every_n_hours` will not
show up in this list (to avoid ever-growing filename lists).
Returns:
A list of filenames, sorted from oldest to newest.
"""
return list(self._maybe_delete.keys())
def _sweep(self):
"""Deletes or preserves managed checkpoints."""
if not self._max_to_keep:
# Does not update self._last_preserved_timestamp, since everything is kept
# in the active set.
return
while len(self._maybe_delete) > self._max_to_keep:
filename, timestamp = self._maybe_delete.popitem(last=False)
# Even if we're keeping this checkpoint due to
# keep_checkpoint_every_n_hours, we won't reference it to avoid
# infinitely-growing CheckpointState protos.
if (self._keep_checkpoint_every_n_hours
and (timestamp - self._keep_checkpoint_every_n_hours * 3600.
>= self._last_preserved_timestamp)):
self._last_preserved_timestamp = timestamp
continue
_delete_file_if_exists(filename + ".index")
_delete_file_if_exists(filename + ".data-?????-of-?????")
def _record_state(self):
"""Saves the `CheckpointManager`'s state in `directory`."""
filenames, timestamps = zip(*self._maybe_delete.items())
update_checkpoint_state_internal(
self._directory,
model_checkpoint_path=self.latest_checkpoint,
all_model_checkpoint_paths=filenames,
all_model_checkpoint_timestamps=timestamps,
last_preserved_timestamp=self._last_preserved_timestamp,
save_relative_paths=True)
@property
def _prefix(self):
"""A common prefix for all checkpoints saved with this manager.
For example, if `directory` (a constructor argument) were `"/tmp/tf-model"`,
`prefix` would be `"/tmp/tf-model/ckpt"` and checkpoints would generally be
numbered `"/tmp/tf-model/ckpt-1"`, `"/tmp/tf-model/ckpt-2"`, and so on. Each
checkpoint has several associated files
(e.g. `"/tmp/tf-model/ckpt-2.index"`).
Returns:
A string prefix.
"""
return self._checkpoint_prefix
def save(self, checkpoint_number=None):
"""Creates a new checkpoint and manages it.
Args:
checkpoint_number: An optional integer, or an integer-dtype `Variable` or
`Tensor`, used to number the checkpoint. If `None` (default),
checkpoints are numbered using `checkpoint.save_counter`. Even if
`checkpoint_number` is provided, `save_counter` is still incremented. A
user-provided `checkpoint_number` is not incremented even if it is a
`Variable`.
Returns:
The path to the new checkpoint. It is also recorded in the `checkpoints`
and `latest_checkpoint` properies.
"""
# Save counter logic duplicated from tf.train.Checkpoint, soon to diverge
# slightly with a custom numbering option.
if context.executing_eagerly():
save_counter = self._checkpoint.save_counter
save_counter.assign_add(1)
session = None
else:
session = ops.get_default_session()
def _initializing_creator(next_creator, **kwargs):
"""Initialize the save counter if it has been newly created."""
v = next_creator(**kwargs)
session.run(v.initializer)
return v
with variable_scope.variable_creator_scope(_initializing_creator):
save_counter = self._checkpoint.save_counter
if self._save_counter_assign is None:
self._save_counter_assign = save_counter.assign_add(1, read_value=False)
session.run(self._save_counter_assign)
if checkpoint_number is None:
checkpoint_number = save_counter
if not isinstance(checkpoint_number, compat.integral_types):
checkpoint_number = training_util.global_step(
sess=session, global_step_tensor=checkpoint_number)
prefix = "%s-%d" % (self._prefix, checkpoint_number)
save_path = self._checkpoint.write(prefix)
timestamp = time.time()
# If this is an overwritten checkpoint we were previously tracking, delete
# and reinsert it to make sure it goes to the end of the queue.
if save_path in self._maybe_delete:
del self._maybe_delete[save_path]
self._maybe_delete[save_path] = timestamp
self._latest_checkpoint = save_path
self._sweep()
self._record_state()
return save_path
| {
"content_hash": "a1d75fda56d04c98d926616c36739650",
"timestamp": "",
"source": "github",
"line_count": 688,
"max_line_length": 80,
"avg_line_length": 41.93313953488372,
"alnum_prop": 0.6894974003466204,
"repo_name": "kevin-coder/tensorflow-fork",
"id": "131ecf71ba56c4c683bf1748c4681dc28507d829",
"size": "29571",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "tensorflow/python/training/checkpoint_management.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "9117"
},
{
"name": "C",
"bytes": "340300"
},
{
"name": "C++",
"bytes": "39383425"
},
{
"name": "CMake",
"bytes": "194940"
},
{
"name": "Go",
"bytes": "1046987"
},
{
"name": "HTML",
"bytes": "4680032"
},
{
"name": "Java",
"bytes": "567239"
},
{
"name": "Jupyter Notebook",
"bytes": "1940883"
},
{
"name": "LLVM",
"bytes": "6536"
},
{
"name": "Makefile",
"bytes": "48231"
},
{
"name": "Objective-C",
"bytes": "12456"
},
{
"name": "Objective-C++",
"bytes": "94385"
},
{
"name": "PHP",
"bytes": "2140"
},
{
"name": "Perl",
"bytes": "6179"
},
{
"name": "Perl 6",
"bytes": "1357"
},
{
"name": "PureBasic",
"bytes": "25356"
},
{
"name": "Python",
"bytes": "33617202"
},
{
"name": "Ruby",
"bytes": "533"
},
{
"name": "Shell",
"bytes": "425910"
}
],
"symlink_target": ""
} |
PROJECT = $(shell gcloud config get-value project)
DOMAIN ?= hail.is
MONITORING_LATEST = gcr.io/$(PROJECT)/monitoring:latest
MONITORING_IMAGE = gcr.io/$(PROJECT)/monitoring:$(shell docker images -q --no-trunc monitoring:latest | sed -e 's,[^:]*:,,')
PYTHONPATH := $${PYTHONPATH:+$${PYTHONPATH}:}
PYTHON := PYTHONPATH=$(PYTHONPATH)../hail/python:../gear:../web_common python3
.PHONY: check
check:
$(PYTHON) -m flake8 monitoring
$(PYTHON) -m pylint --rcfile ../pylintrc monitoring --score=n
../check-sql.sh
.PHONY: build
build:
$(MAKE) -C ../docker build
-docker pull $(MONITORING_LATEST)
python3 ../ci/jinja2_render.py '{"service_base_image":{"image":"service-base"}}' Dockerfile Dockerfile.out
docker build -f Dockerfile.out -t monitoring --cache-from monitoring,$(MONITORING_LATEST),service-base ..
.PHONY: push
push: build
docker tag monitoring $(MONITORING_LATEST)
docker push $(MONITORING_LATEST)
docker tag monitoring $(MONITORING_IMAGE)
docker push $(MONITORING_IMAGE)
.PHONY: deploy
deploy: push
! [ -z $(NAMESPACE) ] # call this like: make deploy NAMESPACE=default
python3 ../ci/jinja2_render.py '{"code":{"sha":"$(shell git rev-parse --short=12 HEAD)"},"deploy":$(DEPLOY),"default_ns":{"name":"$(NAMESPACE)"},"monitoring_image":{"image":"$(MONITORING_IMAGE)"},"monitoring_database":{"user_secret_name":"sql-monitoring-user-config"},"global":{"project":"$(PROJECT)","zone":"$(ZONE)","domain":"$(DOMAIN)"}}' deployment.yaml deployment.yaml.out
kubectl -n $(NAMESPACE) apply -f deployment.yaml.out
.PHONY: clean
clean:
rm -f Dockerfile.out deployment.yaml.out
| {
"content_hash": "01a8ffb6e06e16b30f75b65dbcac774b",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 378,
"avg_line_length": 41.81578947368421,
"alnum_prop": 0.7042164883574575,
"repo_name": "danking/hail",
"id": "decd1b428aa777a8fb4a6ee77ccbd354e14069d1",
"size": "1589",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "monitoring/Makefile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "7729"
},
{
"name": "C",
"bytes": "289"
},
{
"name": "C++",
"bytes": "171899"
},
{
"name": "CSS",
"bytes": "29124"
},
{
"name": "Dockerfile",
"bytes": "13073"
},
{
"name": "Emacs Lisp",
"bytes": "252"
},
{
"name": "HTML",
"bytes": "151709"
},
{
"name": "Java",
"bytes": "32302"
},
{
"name": "JavaScript",
"bytes": "3309"
},
{
"name": "Jupyter Notebook",
"bytes": "162395"
},
{
"name": "Makefile",
"bytes": "73914"
},
{
"name": "Python",
"bytes": "4149266"
},
{
"name": "R",
"bytes": "3038"
},
{
"name": "SCSS",
"bytes": "9075"
},
{
"name": "Scala",
"bytes": "4426573"
},
{
"name": "Shell",
"bytes": "49103"
},
{
"name": "TeX",
"bytes": "7125"
},
{
"name": "XSLT",
"bytes": "5748"
}
],
"symlink_target": ""
} |
function JobControler() {
function init() {
$(".sched-tree").treeview({
url: "test.php",
collapsed: true,
animated: "medium",
persist: "cookie"
});
var treeElems = $(".execing-jobs");
if (treeElems.length > 0)
{
var execingJobsTree;
for (i=0; i<treeElems.length; i++)
{
$("#"+treeElems[i].id).treeview({
collapsed: true,
animated: "medium",
persist: "cookie"
});
}
}
}
// public methods
return {
init: init
}
}
var job_controller = new JobControler();
// add on-dom-ready event to trigger init function
$(document).ready(job_controller.init);
| {
"content_hash": "716e7ad22a4f02b404a9970a80cd8cdc",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 50,
"avg_line_length": 19.305555555555557,
"alnum_prop": 0.5280575539568345,
"repo_name": "sukritmohan/qfAzkaban",
"id": "63f57dddad09c7881ebc21892b6c79ace15a5005",
"size": "695",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "dist/azkaban/web/static/js/job_controller.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Clojure",
"bytes": "40151"
},
{
"name": "Java",
"bytes": "744238"
},
{
"name": "JavaScript",
"bytes": "516622"
},
{
"name": "Python",
"bytes": "1074"
},
{
"name": "Shell",
"bytes": "2229"
}
],
"symlink_target": ""
} |
function __processArg(obj, key) {
var arg = null;
if (obj) {
arg = obj[key] || null;
delete obj[key];
}
return arg;
}
function Controller() {
function showOptions() {
$.dialog.show();
}
require("/alloy/controllers/BaseController").apply(this, Array.prototype.slice.call(arguments));
this.__controllerPath = "index";
this.args = arguments[0] || {};
if (arguments[0]) {
__processArg(arguments[0], "__parentSymbol");
__processArg(arguments[0], "$model");
__processArg(arguments[0], "__itemTemplate");
}
var $ = this;
var exports = {};
var __defers = {};
$.__views.index = Ti.UI.createWindow({
backgroundColor: "#fff",
fullscreen: false,
exitOnClose: true,
id: "index"
});
$.__views.index && $.addTopLevelView($.__views.index);
var __alloyId1 = [];
__alloyId1.push("Confirm");
__alloyId1.push("Help");
__alloyId1.push("Cancel");
var __alloyId6 = [];
__alloyId6.push("Help");
$.__views.dialog = Ti.UI.createOptionDialog({
options: __alloyId1,
buttonNames: __alloyId6,
id: "dialog",
title: "Delete File?"
});
$.__views.__alloyId9 = Ti.UI.createLabel({
text: "Click for OptionDialog",
id: "__alloyId9"
});
$.__views.index.add($.__views.__alloyId9);
showOptions ? $.addListener($.__views.__alloyId9, "click", showOptions) : __defers["$.__views.__alloyId9!click!showOptions"] = true;
exports.destroy = function() {};
_.extend($, $.__views);
$.index.open();
__defers["$.__views.__alloyId9!click!showOptions"] && $.addListener($.__views.__alloyId9, "click", showOptions);
_.extend($, exports);
}
var Alloy = require("/alloy"), Backbone = Alloy.Backbone, _ = Alloy._;
module.exports = Controller; | {
"content_hash": "a9b6755d511251cce99991c511b07229",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 136,
"avg_line_length": 31.372881355932204,
"alnum_prop": 0.561858454889249,
"repo_name": "brentonhouse/brentonhouse.alloy",
"id": "7f5b02512969a504e9da70b2817bffe5ad0fcefa",
"size": "1851",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "test/apps/testing/ALOY-934/_generated/ios/alloy/controllers/index.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "3828"
},
{
"name": "CoffeeScript",
"bytes": "872"
},
{
"name": "HTML",
"bytes": "5471"
},
{
"name": "JavaScript",
"bytes": "3336722"
},
{
"name": "Python",
"bytes": "5251"
}
],
"symlink_target": ""
} |
using System;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Weapsy.Domain.Languages;
using Weapsy.Domain.Pages;
using Weapsy.Reporting.Pages;
using Weapsy.Reporting.Pages.Queries;
using System.Linq;
using Weapsy.Reporting.Roles.Queries;
using System.Collections.Generic;
using Microsoft.AspNetCore.Identity;
using Weapsy.Cqrs;
using Weapsy.Data.Entities;
using Weapsy.Data.TempIdentity;
using Weapsy.Domain.Roles.DefaultRoles;
using Weapsy.Cqrs.Queries;
namespace Weapsy.Data.Reporting.Pages
{
public class GetPageModuleAdminModelHandler : IQueryHandlerAsync<GetPageModuleAdminModel, PageModuleAdminModel>
{
private readonly IContextFactory _contextFactory;
private readonly IDispatcher _queryDispatcher;
public GetPageModuleAdminModelHandler(IContextFactory contextFactory, IDispatcher queryDispatcher)
{
_contextFactory = contextFactory;
_queryDispatcher = queryDispatcher;
}
public async Task<PageModuleAdminModel> RetrieveAsync(GetPageModuleAdminModel query)
{
using (var context = _contextFactory.Create())
{
var page = GetPage(context, query.SiteId, query.PageId);
if (page == null)
return null;
var pageModule = page.PageModules.FirstOrDefault(x => x.Id == query.PageModuleId);
if (pageModule == null)
return null;
var result = new PageModuleAdminModel
{
PageId = page.Id,
ModuleId = pageModule.ModuleId,
PageModuleId = pageModule.Id,
Title = pageModule.Title,
InheritPermissions = pageModule.InheritPermissions
};
var languages = await context.Languages
.Where(x => x.SiteId == query.SiteId && x.Status != LanguageStatus.Deleted)
.OrderBy(x => x.SortOrder)
.ToListAsync();
foreach (var language in languages)
{
var title = string.Empty;
var existingLocalisation = pageModule
.PageModuleLocalisations
.FirstOrDefault(x => x.LanguageId == language.Id);
if (existingLocalisation != null)
{
title = existingLocalisation.Title;
}
result.PageModuleLocalisations.Add(new PageModuleLocalisationAdminModel
{
PageModuleId = pageModule.Id,
LanguageId = language.Id,
LanguageName = language.Name,
LanguageStatus = language.Status,
Title = title
});
}
foreach (var role in await _queryDispatcher.GetResultAsync<GetAllRoles, IEnumerable<ApplicationRole>>(new GetAllRoles()))
{
var pageModulePermission = new PageModulePermissionModel
{
RoleId = role.Id,
RoleName = role.Name,
Disabled = role.Name == Administrator.Name
};
foreach (PermissionType permisisonType in Enum.GetValues(typeof(PermissionType)))
{
bool selected = pageModule.PageModulePermissions
.FirstOrDefault(x => x.RoleId == role.Id && x.Type == permisisonType) != null;
pageModulePermission.PageModulePermissionTypes.Add(new PageModulePermissionTypeModel
{
Type = permisisonType,
Selected = selected
});
}
result.PageModulePermissions.Add(pageModulePermission);
}
return result;
}
}
private Entities.Page GetPage(WeapsyDbContext context, Guid siteId, Guid pageId)
{
var page = context.Pages
.Include(x => x.PageLocalisations)
.Include(x => x.PagePermissions)
.FirstOrDefault(x => x.SiteId == siteId && x.Id == pageId && x.Status == PageStatus.Active);
if (page == null)
return null;
page.PageModules = context.PageModules
.Include(y => y.PageModuleLocalisations)
.Include(y => y.PageModulePermissions)
.Where(x => x.PageId == pageId && x.Status == PageModuleStatus.Active)
.ToList();
return page;
}
}
}
| {
"content_hash": "6351559750c6dbc3ff4776c96fd6aaa3",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 137,
"avg_line_length": 37.44186046511628,
"alnum_prop": 0.5397515527950311,
"repo_name": "lucabriguglia/weapsy",
"id": "d70124807beeb537295b9202c881a2a307316c22",
"size": "4832",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Weapsy.Data/Reporting/Pages/GetPageModuleAdminModelHandler.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "164682"
},
{
"name": "CSS",
"bytes": "639"
},
{
"name": "HTML",
"bytes": "7659"
},
{
"name": "JavaScript",
"bytes": "68837"
}
],
"symlink_target": ""
} |
extern NSString* const ALPHAFileDataIdentifier;
@interface ALPHAFileSource : ALPHABaseDataSource
@end
| {
"content_hash": "6f4daac4874e576e2b4c7d2fdd1223a1",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 48,
"avg_line_length": 20.8,
"alnum_prop": 0.8461538461538461,
"repo_name": "Legoless/Alpha",
"id": "9ba57231874973ae3f97305b31ca89b1d8d08bf9",
"size": "276",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Alpha/Plugins/File/Sources/ALPHAFileSource.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "6098"
},
{
"name": "Objective-C",
"bytes": "1347891"
},
{
"name": "Ruby",
"bytes": "7464"
}
],
"symlink_target": ""
} |
// This file was automatically generated by informer-gen
package internalinterfaces
import (
versioned "github.com/PaddlePaddle/cloud/go/client/clientset/versioned"
runtime "k8s.io/apimachinery/pkg/runtime"
cache "k8s.io/client-go/tools/cache"
time "time"
)
type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer
// SharedInformerFactory a small interface to allow for adding an informer without an import cycle
type SharedInformerFactory interface {
Start(stopCh <-chan struct{})
InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer
}
| {
"content_hash": "9318d765d119a8c8b172e636ff9b55e5",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 98,
"avg_line_length": 32.10526315789474,
"alnum_prop": 0.8114754098360656,
"repo_name": "PaddlePaddle/cloud",
"id": "8cd3882cc70a07ec95acd31cc048e233da781937",
"size": "1196",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "go/client/informers/externalversions/internalinterfaces/factory_interfaces.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1103"
},
{
"name": "Go",
"bytes": "200594"
},
{
"name": "HTML",
"bytes": "8917"
},
{
"name": "JavaScript",
"bytes": "270250"
},
{
"name": "Python",
"bytes": "150171"
},
{
"name": "Shell",
"bytes": "13748"
}
],
"symlink_target": ""
} |
<?php
namespace app\modules\apps\models;
class DictZhCyXs extends \hightman\xunsearch\ActiveRecord
{
public static function projectName()
{
return "chengyu";
}
} | {
"content_hash": "751b9c77f2244b20cc06ba7c4bb2fb6b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 57,
"avg_line_length": 15.153846153846153,
"alnum_prop": 0.6446700507614214,
"repo_name": "awebc/web_xbf",
"id": "62be9c80b3d91cfb6adca9a1abe77d9f7af077c0",
"size": "197",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "frontend/modules/apps/models/DictZhCyXs.php",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "1541"
},
{
"name": "CSS",
"bytes": "921330"
},
{
"name": "Groff",
"bytes": "233777"
},
{
"name": "HTML",
"bytes": "221365"
},
{
"name": "JavaScript",
"bytes": "1022758"
},
{
"name": "PHP",
"bytes": "415478"
}
],
"symlink_target": ""
} |
r"""
=====================================================================
The Johnson-Lindenstrauss bound for embedding with random projections
=====================================================================
The `Johnson-Lindenstrauss lemma`_ states that any high dimensional
dataset can be randomly projected into a lower dimensional Euclidean
space while controlling the distortion in the pairwise distances.
.. _`Johnson-Lindenstrauss lemma`: https://en.wikipedia.org/wiki/\
Johnson%E2%80%93Lindenstrauss_lemma
"""
import sys
from time import time
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn.random_projection import johnson_lindenstrauss_min_dim
from sklearn.random_projection import SparseRandomProjection
from sklearn.datasets import fetch_20newsgroups_vectorized
from sklearn.datasets import load_digits
from sklearn.metrics.pairwise import euclidean_distances
from sklearn.utils.fixes import parse_version
# `normed` is being deprecated in favor of `density` in histograms
if parse_version(matplotlib.__version__) >= parse_version("2.1"):
density_param = {"density": True}
else:
density_param = {"normed": True}
# %%
# Theoretical bounds
# ==================
# The distortion introduced by a random projection `p` is asserted by
# the fact that `p` is defining an eps-embedding with good probability
# as defined by:
#
# .. math::
# (1 - eps) \|u - v\|^2 < \|p(u) - p(v)\|^2 < (1 + eps) \|u - v\|^2
#
# Where u and v are any rows taken from a dataset of shape (n_samples,
# n_features) and p is a projection by a random Gaussian N(0, 1) matrix
# of shape (n_components, n_features) (or a sparse Achlioptas matrix).
#
# The minimum number of components to guarantees the eps-embedding is
# given by:
#
# .. math::
# n\_components \geq 4 log(n\_samples) / (eps^2 / 2 - eps^3 / 3)
#
#
# The first plot shows that with an increasing number of samples ``n_samples``,
# the minimal number of dimensions ``n_components`` increased logarithmically
# in order to guarantee an ``eps``-embedding.
# range of admissible distortions
eps_range = np.linspace(0.1, 0.99, 5)
colors = plt.cm.Blues(np.linspace(0.3, 1.0, len(eps_range)))
# range of number of samples (observation) to embed
n_samples_range = np.logspace(1, 9, 9)
plt.figure()
for eps, color in zip(eps_range, colors):
min_n_components = johnson_lindenstrauss_min_dim(n_samples_range, eps=eps)
plt.loglog(n_samples_range, min_n_components, color=color)
plt.legend(["eps = %0.1f" % eps for eps in eps_range], loc="lower right")
plt.xlabel("Number of observations to eps-embed")
plt.ylabel("Minimum number of dimensions")
plt.title("Johnson-Lindenstrauss bounds:\nn_samples vs n_components")
plt.show()
# %%
# The second plot shows that an increase of the admissible
# distortion ``eps`` allows to reduce drastically the minimal number of
# dimensions ``n_components`` for a given number of samples ``n_samples``
# range of admissible distortions
eps_range = np.linspace(0.01, 0.99, 100)
# range of number of samples (observation) to embed
n_samples_range = np.logspace(2, 6, 5)
colors = plt.cm.Blues(np.linspace(0.3, 1.0, len(n_samples_range)))
plt.figure()
for n_samples, color in zip(n_samples_range, colors):
min_n_components = johnson_lindenstrauss_min_dim(n_samples, eps=eps_range)
plt.semilogy(eps_range, min_n_components, color=color)
plt.legend(["n_samples = %d" % n for n in n_samples_range], loc="upper right")
plt.xlabel("Distortion eps")
plt.ylabel("Minimum number of dimensions")
plt.title("Johnson-Lindenstrauss bounds:\nn_components vs eps")
plt.show()
# %%
# Empirical validation
# ====================
#
# We validate the above bounds on the 20 newsgroups text document
# (TF-IDF word frequencies) dataset or on the digits dataset:
#
# - for the 20 newsgroups dataset some 500 documents with 100k
# features in total are projected using a sparse random matrix to smaller
# euclidean spaces with various values for the target number of dimensions
# ``n_components``.
#
# - for the digits dataset, some 8x8 gray level pixels data for 500
# handwritten digits pictures are randomly projected to spaces for various
# larger number of dimensions ``n_components``.
#
# The default dataset is the 20 newsgroups dataset. To run the example on the
# digits dataset, pass the ``--use-digits-dataset`` command line argument to
# this script.
if "--use-digits-dataset" in sys.argv:
data = load_digits().data[:500]
else:
data = fetch_20newsgroups_vectorized().data[:500]
# %%
# For each value of ``n_components``, we plot:
#
# - 2D distribution of sample pairs with pairwise distances in original
# and projected spaces as x and y axis respectively.
#
# - 1D histogram of the ratio of those distances (projected / original).
n_samples, n_features = data.shape
print(
"Embedding %d samples with dim %d using various random projections"
% (n_samples, n_features)
)
n_components_range = np.array([300, 1000, 10000])
dists = euclidean_distances(data, squared=True).ravel()
# select only non-identical samples pairs
nonzero = dists != 0
dists = dists[nonzero]
for n_components in n_components_range:
t0 = time()
rp = SparseRandomProjection(n_components=n_components)
projected_data = rp.fit_transform(data)
print(
"Projected %d samples from %d to %d in %0.3fs"
% (n_samples, n_features, n_components, time() - t0)
)
if hasattr(rp, "components_"):
n_bytes = rp.components_.data.nbytes
n_bytes += rp.components_.indices.nbytes
print("Random matrix with size: %0.3fMB" % (n_bytes / 1e6))
projected_dists = euclidean_distances(projected_data, squared=True).ravel()[nonzero]
plt.figure()
min_dist = min(projected_dists.min(), dists.min())
max_dist = max(projected_dists.max(), dists.max())
plt.hexbin(
dists,
projected_dists,
gridsize=100,
cmap=plt.cm.PuBu,
extent=[min_dist, max_dist, min_dist, max_dist],
)
plt.xlabel("Pairwise squared distances in original space")
plt.ylabel("Pairwise squared distances in projected space")
plt.title("Pairwise distances distribution for n_components=%d" % n_components)
cb = plt.colorbar()
cb.set_label("Sample pairs counts")
rates = projected_dists / dists
print("Mean distances rate: %0.2f (%0.2f)" % (np.mean(rates), np.std(rates)))
plt.figure()
plt.hist(rates, bins=50, range=(0.0, 2.0), edgecolor="k", **density_param)
plt.xlabel("Squared distances rate: projected / original")
plt.ylabel("Distribution of samples pairs")
plt.title("Histogram of pairwise distance rates for n_components=%d" % n_components)
# TODO: compute the expected value of eps and add them to the previous plot
# as vertical lines / region
plt.show()
# %%
# We can see that for low values of ``n_components`` the distribution is wide
# with many distorted pairs and a skewed distribution (due to the hard
# limit of zero ratio on the left as distances are always positives)
# while for larger values of n_components the distortion is controlled
# and the distances are well preserved by the random projection.
# %%
# Remarks
# =======
#
# According to the JL lemma, projecting 500 samples without too much distortion
# will require at least several thousands dimensions, irrespective of the
# number of features of the original dataset.
#
# Hence using random projections on the digits dataset which only has 64
# features in the input space does not make sense: it does not allow
# for dimensionality reduction in this case.
#
# On the twenty newsgroups on the other hand the dimensionality can be
# decreased from 56436 down to 10000 while reasonably preserving
# pairwise distances.
| {
"content_hash": "c88e85db167b74ee80d35c7e0d9f687b",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 88,
"avg_line_length": 36.15348837209302,
"alnum_prop": 0.7016595908915476,
"repo_name": "sergeyf/scikit-learn",
"id": "c92920ffb7280ef3d78f41f98ad0cba73ffab990",
"size": "7773",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/miscellaneous/plot_johnson_lindenstrauss_bound.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "42335"
},
{
"name": "C++",
"bytes": "147316"
},
{
"name": "Cython",
"bytes": "718114"
},
{
"name": "Makefile",
"bytes": "1711"
},
{
"name": "Python",
"bytes": "9906683"
},
{
"name": "Shell",
"bytes": "49565"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.