text stringlengths 2 1.04M | meta dict |
|---|---|
<!DOCTYPE html>
<html lang="en">
{% include head.html %}
<body>
{% include navigation.html %}
{% include subscribe_form.html %}
{% include footer.html %}
{% include scripts.html %}
</body>
</html> | {
"content_hash": "7e93b9bcf0b55b9f21a62ef5c2406837",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 36,
"avg_line_length": 14.333333333333334,
"alnum_prop": 0.5953488372093023,
"repo_name": "camp925/camp925.github.io",
"id": "3ef0d36742d8382e71524e1bb665d62b70d1f08a",
"size": "215",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "_layouts/subscribe_layout.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "118326"
},
{
"name": "HTML",
"bytes": "27652"
},
{
"name": "JavaScript",
"bytes": "1896"
},
{
"name": "Ruby",
"bytes": "3338"
}
],
"symlink_target": ""
} |
'use strict';
describe('transaction', function () {
it('should works like pipeline by default', function (done) {
var redis = new Redis();
redis.multi().set('foo', 'transaction').get('foo').exec(function (err, result) {
expect(err).to.eql(null);
expect(result).to.eql([[null, 'OK'], [null, 'transaction']]);
done();
});
});
it('should handle runtime errors correctly', function (done) {
var redis = new Redis();
redis.multi().set('foo', 'bar').lpush('foo', 'abc').exec(function (err, result) {
expect(err).to.eql(null);
expect(result.length).to.eql(2);
expect(result[0]).to.eql([null, 'OK']);
expect(result[1][0]).to.be.instanceof(Error);
expect(result[1][0].toString()).to.match(/wrong kind of value/);
done();
});
});
it('should handle compile-time errors correctly', function (done) {
var redis = new Redis();
redis.multi().set('foo').get('foo').exec(function (err) {
expect(err).to.be.instanceof(Error);
expect(err.toString()).to.match(/Transaction discarded because of previous errors/);
done();
});
});
it('should also support command callbacks', function (done) {
var redis = new Redis();
var pending = 1;
redis.multi().set('foo', 'bar').get('foo', function (err, value) {
pending -= 1;
expect(value).to.eql('QUEUED');
}).exec(function (err, result) {
expect(pending).to.eql(0);
expect(result).to.eql([[null, 'OK'], [null, 'bar']]);
done();
});
});
it('should also handle errors in command callbacks', function (done) {
var redis = new Redis();
var pending = 1;
redis.multi().set('foo', function (err) {
expect(err.toString()).to.match(/wrong number of arguments/);
pending -= 1;
}).exec(function (err) {
expect(err.toString()).to.match(/Transaction discarded because of previous errors/);
if (!pending) {
done();
}
});
});
it('should work without pipeline', function (done) {
var redis = new Redis();
redis.multi({ pipeline: false });
redis.set('foo', 'bar');
redis.get('foo');
redis.exec(function (err, results) {
expect(results).to.eql([[null, 'OK'], [null, 'bar']]);
done();
});
});
describe('transformer', function () {
it('should trigger transformer', function (done) {
var redis = new Redis();
var pending = 2;
var data = { name: 'Bob', age: '17' };
redis.multi().hmset('foo', data).hgetall('foo', function (err, res) {
expect(res).to.eql('QUEUED');
if (!--pending) {
done();
}
}).hgetallBuffer('foo').get('foo').getBuffer('foo').exec(function (err, res) {
expect(res[0][1]).to.eql('OK');
expect(res[1][1]).to.eql(data);
expect(res[2][1]).to.eql({
name: new Buffer('Bob'),
age: new Buffer('17')
});
expect(res[3][0]).to.have.property('message',
'WRONGTYPE Operation against a key holding the wrong kind of value');
expect(res[4][0]).to.have.property('message',
'WRONGTYPE Operation against a key holding the wrong kind of value');
if (!--pending) {
done();
}
});
});
it('should trigger transformer inside pipeline', function (done) {
var redis = new Redis();
var data = { name: 'Bob', age: '17' };
redis.pipeline().hmset('foo', data).multi().typeBuffer('foo')
.hgetall('foo').exec().hgetall('foo').exec(function (err, res) {
expect(res[0][1]).to.eql('OK');
expect(res[1][1]).to.eql('OK');
expect(res[2][1]).to.eql(new Buffer('QUEUED'));
expect(res[3][1]).to.eql('QUEUED');
expect(res[4][1]).to.eql([new Buffer('hash'), data]);
expect(res[5][1]).to.eql(data);
done();
});
});
it('should handle custom transformer exception', function (done) {
var transformError = 'transformer error';
Redis.Command._transformer.reply.get = function () {
throw new Error(transformError);
};
var redis = new Redis();
redis.multi().get('foo').exec(function (err, res) {
expect(res[0][0]).to.have.property('message', transformError);
delete Redis.Command._transformer.reply.get;
done();
});
});
});
describe('#addBatch', function () {
it('should accept commands in constructor', function (done) {
var redis = new Redis();
var pending = 1;
redis.multi([
['set', 'foo', 'bar'],
['get', 'foo', function (err, result) {
expect(result).to.eql('QUEUED');
pending -= 1;
}]
]).exec(function (err, results) {
expect(pending).to.eql(0);
expect(results[1][1]).to.eql('bar');
done();
});
});
});
});
| {
"content_hash": "91ae970e0e0d6041aac303b16affe8ba",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 90,
"avg_line_length": 32.95918367346939,
"alnum_prop": 0.5527347781217751,
"repo_name": "truststamp/S3",
"id": "23e1910fab4c5e218177c05a86b0327f5c71b6db",
"size": "4845",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "node_modules/ioredis/test/functional/transaction.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "5735"
},
{
"name": "HTML",
"bytes": "807"
},
{
"name": "Java",
"bytes": "8612"
},
{
"name": "JavaScript",
"bytes": "1895590"
},
{
"name": "Perl",
"bytes": "12743"
},
{
"name": "Python",
"bytes": "2232"
},
{
"name": "Ruby",
"bytes": "4967"
},
{
"name": "Shell",
"bytes": "10067"
}
],
"symlink_target": ""
} |
package com.luoxiang.weibo.activity;
import android.content.Intent;
import android.widget.Button;
import android.widget.TextView;
import com.luoxiang.weibo.R;
import com.luoxiang.weibo.base.BaseActivity;
import com.luoxiang.weibo.views.ToolBarX;
import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* projectName: WeiBo
* packageName: com.luoxiang.weibo.activity
* className: FirstActivity
* author: Luoxiang
* time: 2016/9/7 9:05
* desc: 测试用第一个activity
*/
public class FirstActivity
extends BaseActivity
{
@Bind(R.id.first)
TextView mFirst;
@Bind(R.id.first_button)
Button mFirstButton;
private ToolBarX mToolBarX;
@Override
protected void initListener() {
}
@Override
protected void initData() {
mToolBarX.setTitle("first title").setSubtitle("sub title").setDisplayHomeAsUpEnabled(true);
}
@Override
protected void initView() {
ButterKnife.bind(this);
mToolBarX = getToolBarX();
}
@Override
protected int getLayoutID() {
return R.layout.activity_first;
}
@OnClick(R.id.first_button)
public void onClick() {
startActivity(new Intent(this , SecondActivity.class));
}
}
| {
"content_hash": "d0b81f00b24bc01a66b47e2004c388a9",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 99,
"avg_line_length": 22.193548387096776,
"alnum_prop": 0.6322674418604651,
"repo_name": "ynztlxdeai/ProjectTemplate",
"id": "59b155069415040eb834c6f15a2b47306a574aab",
"size": "1388",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/luoxiang/weibo/activity/FirstActivity.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "176951"
}
],
"symlink_target": ""
} |
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class HitManager : MonoBehaviour {
Queue<Attack> m_currentAttacks = new Queue<Attack> ();
Queue<Attack> m_attackHistory = new Queue<Attack> ();
public Attack CurrentAttack {
get {
return m_currentAttacks.Peek ();
}
}
public Attack PullAttack {
get {
return m_currentAttacks.Dequeue ();
}
}
public bool HasAttack {
get {
return m_currentAttacks.Count > 0;
}
}
[SerializeField]
bool debug;
[SerializeField]
uint AttackRecordSize = 20;
public void AddAttack (Attack atk) {
#if UNITY_EDITOR
if (debug) {
UnityEngine.Debug.Log ("Recieved attack " + atk.kData.name, gameObject);
}
#endif
if (!m_attackHistory.Contains (atk)) {
UnityEngine.Debug.Log ("Used attack");
m_attackHistory.Enqueue (atk);
m_currentAttacks.Enqueue (atk);
if (m_attackHistory.Count > AttackRecordSize)
m_attackHistory.Dequeue ();
}
#if UNITY_EDITOR
else if (debug) {
UnityEngine.Debug.Log ("Ignored attack");
}
#endif
}
}
| {
"content_hash": "d9981e45f3db8f1f5cc2ad0fa71dd3bf",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 84,
"avg_line_length": 25.632653061224488,
"alnum_prop": 0.5780254777070064,
"repo_name": "UTC-SkillsUSA-2015/SkillsUSA-2015",
"id": "eb28c61811769a145ddff9b4ceb9f355307f67bd",
"size": "1258",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Assets/Scripts/Attacks/HitManager.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "93332"
}
],
"symlink_target": ""
} |
'use strict';
describe('Controller: SegmentationCtrl', function () {
// load the controller's module
beforeEach(module('sparkyApp'));
var SegmentationCtrl,
scope;
// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.$new();
SegmentationCtrl = $controller('SegmentationCtrl', {
$scope: scope
});
}));
it('should attach a list of awesomeThings to the scope', function () {
expect(scope.awesomeThings.length).toBe(3);
});
});
| {
"content_hash": "feb02029247ea0680e071a71cc326c38",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 72,
"avg_line_length": 24.40909090909091,
"alnum_prop": 0.6685288640595903,
"repo_name": "cubefyre/audience-behavior-ui",
"id": "825b9b166ab7e920b2be7ea25487e18e8006b2d6",
"size": "537",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/spec/controllers/segmentation.js",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "19123"
},
{
"name": "HTML",
"bytes": "141015"
},
{
"name": "JavaScript",
"bytes": "263150"
},
{
"name": "Python",
"bytes": "119756"
},
{
"name": "Shell",
"bytes": "745"
}
],
"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 (1.8.0_151) on Sun Mar 17 11:03:41 MST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Package org.wildfly.swarm.config.resource.adapters.resource_adapter (BOM: * : All 2.4.0.Final API)</title>
<meta name="date" content="2019-03-17">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Package org.wildfly.swarm.config.resource.adapters.resource_adapter (BOM: * : All 2.4.0.Final API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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</li>
<li class="navBarCell1Rev">Use</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.4.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/wildfly/swarm/config/resource/adapters/resource_adapter/package-use.html" target="_top">Frames</a></li>
<li><a href="package-use.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Uses of Package org.wildfly.swarm.config.resource.adapters.resource_adapter" class="title">Uses of Package<br>org.wildfly.swarm.config.resource.adapters.resource_adapter</h1>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/package-summary.html">org.wildfly.swarm.config.resource.adapters.resource_adapter</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config.resource.adapters">org.wildfly.swarm.config.resource.adapters</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config.resource.adapters.resource_adapter">org.wildfly.swarm.config.resource.adapters.resource_adapter</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.wildfly.swarm.config.resource.adapters">
<!-- -->
</a>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/package-summary.html">org.wildfly.swarm.config.resource.adapters.resource_adapter</a> used by <a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/package-summary.html">org.wildfly.swarm.config.resource.adapters</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/AdminObjects.html#org.wildfly.swarm.config.resource.adapters">AdminObjects</a>
<div class="block">Specifies an administration object.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/AdminObjectsConsumer.html#org.wildfly.swarm.config.resource.adapters">AdminObjectsConsumer</a> </td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/AdminObjectsSupplier.html#org.wildfly.swarm.config.resource.adapters">AdminObjectsSupplier</a> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/ConfigProperties.html#org.wildfly.swarm.config.resource.adapters">ConfigProperties</a>
<div class="block">A custom defined config property.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/ConfigPropertiesConsumer.html#org.wildfly.swarm.config.resource.adapters">ConfigPropertiesConsumer</a> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/ConfigPropertiesSupplier.html#org.wildfly.swarm.config.resource.adapters">ConfigPropertiesSupplier</a> </td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/ConnectionDefinitions.html#org.wildfly.swarm.config.resource.adapters">ConnectionDefinitions</a>
<div class="block">Specifies a connection definition.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/ConnectionDefinitionsConsumer.html#org.wildfly.swarm.config.resource.adapters">ConnectionDefinitionsConsumer</a> </td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/ConnectionDefinitionsSupplier.html#org.wildfly.swarm.config.resource.adapters">ConnectionDefinitionsSupplier</a> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.wildfly.swarm.config.resource.adapters.resource_adapter">
<!-- -->
</a>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/package-summary.html">org.wildfly.swarm.config.resource.adapters.resource_adapter</a> used by <a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/package-summary.html">org.wildfly.swarm.config.resource.adapters.resource_adapter</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/AdminObjects.html#org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects</a>
<div class="block">Specifies an administration object.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/AdminObjects.AdminObjectsResources.html#org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjects.AdminObjectsResources</a>
<div class="block">Child mutators for AdminObjects</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/AdminObjectsConsumer.html#org.wildfly.swarm.config.resource.adapters.resource_adapter">AdminObjectsConsumer</a> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/ConfigProperties.html#org.wildfly.swarm.config.resource.adapters.resource_adapter">ConfigProperties</a>
<div class="block">A custom defined config property.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/ConfigPropertiesConsumer.html#org.wildfly.swarm.config.resource.adapters.resource_adapter">ConfigPropertiesConsumer</a> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/ConfigPropertiesSupplier.html#org.wildfly.swarm.config.resource.adapters.resource_adapter">ConfigPropertiesSupplier</a> </td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/ConnectionDefinitions.html#org.wildfly.swarm.config.resource.adapters.resource_adapter">ConnectionDefinitions</a>
<div class="block">Specifies a connection definition.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/ConnectionDefinitions.ConnectionDefinitionsResources.html#org.wildfly.swarm.config.resource.adapters.resource_adapter">ConnectionDefinitions.ConnectionDefinitionsResources</a>
<div class="block">Child mutators for ConnectionDefinitions</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/ConnectionDefinitions.FlushStrategy.html#org.wildfly.swarm.config.resource.adapters.resource_adapter">ConnectionDefinitions.FlushStrategy</a> </td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="../../../../../../../org/wildfly/swarm/config/resource/adapters/resource_adapter/class-use/ConnectionDefinitionsConsumer.html#org.wildfly.swarm.config.resource.adapters.resource_adapter">ConnectionDefinitionsConsumer</a> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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</li>
<li class="navBarCell1Rev">Use</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Thorntail API, 2.4.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/wildfly/swarm/config/resource/adapters/resource_adapter/package-use.html" target="_top">Frames</a></li>
<li><a href="package-use.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "312d891f43b70cad4d25f8319389190f",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 436,
"avg_line_length": 51.659919028340084,
"alnum_prop": 0.6847962382445141,
"repo_name": "wildfly-swarm/wildfly-swarm-javadocs",
"id": "456b7e2d4d439aa563741244d9b4543c549feefe",
"size": "12760",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "2.4.0.Final/apidocs/org/wildfly/swarm/config/resource/adapters/resource_adapter/package-use.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
layout: post
date: 2015-09-29
title: "Amelia Sposa Wedding dress Donatela 1/2 Sleeves Chapel Train Aline/Princess"
category: Amelia Sposa
tags: [Amelia Sposa,Aline/Princess ,Bateau,Chapel Train,1/2 Sleeves,Alencon Lace and English Net]
---
### Amelia Sposa Wedding dress Donatela
Just **$309.99**
### 1/2 Sleeves Chapel Train Aline/Princess
<table><tr><td>BRANDS</td><td>Amelia Sposa</td></tr><tr><td>Silhouette</td><td>Aline/Princess </td></tr><tr><td>Neckline</td><td>Bateau</td></tr><tr><td>Hemline/Train</td><td>Chapel Train</td></tr><tr><td>Sleeve</td><td>1/2 Sleeves</td></tr><tr><td>Fabric</td><td>Alencon Lace and English Net</td></tr></table>
<a href="https://www.readybrides.com/en/amelia-sposa/398-wedding-dress-donatela.html"><img src="//img.readybrides.com/1460/wedding-dress-donatela.jpg" alt="Wedding dress Donatela" style="width:100%;" /></a>
<!-- break --><a href="https://www.readybrides.com/en/amelia-sposa/398-wedding-dress-donatela.html"><img src="//img.readybrides.com/1459/wedding-dress-donatela.jpg" alt="Wedding dress Donatela" style="width:100%;" /></a>
Buy it: [https://www.readybrides.com/en/amelia-sposa/398-wedding-dress-donatela.html](https://www.readybrides.com/en/amelia-sposa/398-wedding-dress-donatela.html)
| {
"content_hash": "1a3e789fc3d5b2ed08c73a86caee1751",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 310,
"avg_line_length": 89.14285714285714,
"alnum_prop": 0.7267628205128205,
"repo_name": "HOLEIN/HOLEIN.github.io",
"id": "05296b8ca69fcd3ab44f456dc49e5d6d5135b0ab",
"size": "1252",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2015-09-29-Amelia-Sposa-Wedding-dress-Donatela-12-Sleeves-Chapel-Train-AlinePrincess.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "83876"
},
{
"name": "HTML",
"bytes": "14547"
},
{
"name": "Ruby",
"bytes": "897"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>hammer: 31 s 🏆</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.15.1 / hammer - 1.3.2+8.15</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
hammer
<small>
1.3.2+8.15
<span class="label label-success">31 s 🏆</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-05-30 04:18:43 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-30 04:18:43 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
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.15.1 Formal proof management system
dune 3.2.0 Fast, portable, and opinionated build system
ocaml 4.14.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.14.0 Official release 4.14.0
ocaml-config 2 OCaml Switch Configuration
ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# 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: "General-purpose automated reasoning hammer tool for Coq"
description: """
A general-purpose automated reasoning hammer tool for Coq that combines
learning from previous proofs with the translation of problems to the
logics of automated systems and the reconstruction of successfully found proofs.
"""
build: [make "-j%{jobs}%" "plugin"]
install: [
[make "install-plugin"]
[make "test-plugin"] {with-test}
]
depends: [
"ocaml" { >= "4.08" }
"coq" {>= "8.15" & < "8.16~"}
("conf-g++" {build} | "conf-clang" {build})
"coq-hammer-tactics" {= version}
]
tags: [
"category:Miscellaneous/Coq Extensions"
"keyword:automation"
"keyword:hammer"
"logpath:Hammer.Plugin"
"date:2022-01-23"
]
authors: [
"Lukasz Czajka <lukaszcz@mimuw.edu.pl>"
"Cezary Kaliszyk <cezary.kaliszyk@uibk.ac.at>"
]
url {
src: "https://github.com/lukaszcz/coqhammer/archive/refs/tags/v1.3.2-coq8.15.tar.gz"
checksum: "sha512=0277150c2fd570400693ee1a3e4b2f253fbf7cc4b9997a803bb5e0e3e633352eb8cca2f3e8b1c47e49b9994b73c6f744f31e9e81eac665d1bf7ed4054ef39512"
}
</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.1.3.2+8.15 coq.8.15.1</code></dd>
<dt>Return code</dt>
<dd>0</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>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-hammer.1.3.2+8.15 coq.8.15.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>23 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-hammer.1.3.2+8.15 coq.8.15.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>31 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 992 K</p>
<ul>
<li>709 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/Hammer/Plugin/hammer_plugin.cmxs</code></li>
<li>149 K <code>../ocaml-base-compiler.4.14.0/bin/predict</code></li>
<li>47 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/Hammer/Plugin/hammer_plugin.cmi</code></li>
<li>42 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/Hammer/Plugin/hammer_plugin.cmx</code></li>
<li>19 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/Hammer/Plugin/Hammer.vo</code></li>
<li>17 K <code>../ocaml-base-compiler.4.14.0/bin/htimeout</code></li>
<li>8 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/Hammer/Plugin/hammer_plugin.cmxa</code></li>
<li>1 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/Hammer/Plugin/Hammer.glob</code></li>
<li>1 K <code>../ocaml-base-compiler.4.14.0/lib/coq/user-contrib/Hammer/Plugin/Hammer.v</code></li>
</ul>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq-hammer.1.3.2+8.15</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": "741cd60daabc46ea8c94b4fa3371b54c",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 159,
"avg_line_length": 45.39890710382514,
"alnum_prop": 0.5612662493981705,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "4c262b39d573831dbac720e959ea7b41973684eb",
"size": "8333",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.14.0-2.0.10/released/8.15.1/hammer/1.3.2+8.15.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<title>SplitterJS - Horizontal Splitter Demo</title>
<link href="../../Splitter.css" type="text/css" rel="stylesheet">
<link href="./ThreeHorizontalSplittersDemo.css" rel="stylesheet" type="text/css">
<script src="http://www.requirejs.org/docs/release/2.1.10/minified/require.js" type="text/javascript"></script>
</head>
<body>
<div id=headerDiv class="unselectable"></div>
<div id=topDiv class="unselectable"></div>
<div id=bottomDiv class="unselectable"></div>
<div id=footerDiv class="unselectable"></div>
<div id=headerSplitterDiv class="horizontalSplitter"></div>
<div id=splitterDiv class="horizontalSplitter"></div>
<div id=footerSplitterDiv class="horizontalSplitter"></div>
<script>
require(['../../Splitter'], function (Splitter) {
new Splitter({
elementOne: headerDiv, // Div to the left of the splitter
elementTwo: topDiv, // Div to the right of the splitter
splitter: headerSplitterDiv, // Splitter div
orientation: 'horizontal', // Orientation [vertical | horizontal]
collapse: 'top', // Collapse Direction [left | right | top | bottom | fixed]
placeholderSplitter: false // Use a placeholder splitter on drag
}).Render();
new Splitter({
elementOne: topDiv, // Div to the left of the splitter
elementTwo: bottomDiv, // Div to the right of the splitter
splitter: splitterDiv, // Splitter div
orientation: 'horizontal', // Orientation [vertical | horizontal]
collapse: 'fixed', // Collapse Direction [left | right | top | bottom | fixed]
placeholderSplitter: false // Use a placeholder splitter on drag
}).Render();
new Splitter({
elementOne: bottomDiv, // Div to the left of the splitter
elementTwo: footerDiv, // Div to the right of the splitter
splitter: footerSplitterDiv, // Splitter div
orientation: 'horizontal', // Orientation [vertical | horizontal]
collapse: 'bottom', // Collapse Direction [left | right | top | bottom | fixed]
placeholderSplitter: false // Use a placeholder splitter on drag
}).Render();
});
</script>
</body>
</html> | {
"content_hash": "6fc037ac62a49a62e897e1cb9030c511",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 115,
"avg_line_length": 46.44230769230769,
"alnum_prop": 0.6053830227743271,
"repo_name": "theoutlander/SplitterJS",
"id": "faf439e851025b7d9f221824d621e2787e436ef7",
"size": "2415",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Demo/Horizontal/ThreeHorizontalSplittersDemo.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "5331"
},
{
"name": "JavaScript",
"bytes": "11490"
}
],
"symlink_target": ""
} |
namespace leveldb {
class Env;
Env* NewMemEnv(Env* base_env);
| {
"content_hash": "768e6098201fb184ae21122fdcb54701",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 30,
"avg_line_length": 5.538461538461538,
"alnum_prop": 0.6388888888888888,
"repo_name": "sarakas/hellascoin",
"id": "878663e3e13d4174f2e16bc0f32058f009f19a53",
"size": "175",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/leveldb/helpers/memenv/memenv.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "76325"
},
{
"name": "C++",
"bytes": "2070613"
},
{
"name": "CSS",
"bytes": "1083"
},
{
"name": "IDL",
"bytes": "14363"
},
{
"name": "Objective-C++",
"bytes": "5348"
},
{
"name": "Python",
"bytes": "102523"
},
{
"name": "Shell",
"bytes": "3863"
},
{
"name": "TypeScript",
"bytes": "5239467"
}
],
"symlink_target": ""
} |
[](https://travis-ci.org/abhishekpathak/recommendation-system) [](https://codeclimate.com/github/abhishekpathak/recommendation-system)
# Recommendation System
A simple ALS-based recommendation system working for a dummy SaaS product. This example takes the [Movielens 1M dataset](https://grouplens.org/datasets/movielens/1m/) and makes a movie recommender ([screenshot](/extras/screenshot_product.jpg)). The datasets are pluggable, so this system can be extended to any product.
## System design

## Project structure
* **Recommender** (offline)
* **core** - consists of the engine and other core components.
* **server** - application services that expose the core API over REST.
* **client** - consumes the server APIs and interacts with an admin user.
* **Product** (online)
* **server** - application services doing CRUD to serving database (and interacting with other services if needed).
* **client** - consumes the server APIs and interacts with a consumer.
There is no coupling between Recommender and Product. In addition, all of their sub-components are independent services.
## Design choices/trade-offs
* **Fast but stale recommendations**. Generating recommendations is a slow task. To tackle that, the recommendations are generated offline periodically and stored. While this provides faster response times to the user, the recommendations will not reflect the user's real-time actions.
There are a couple of ways to solve for this:
* **Design the engine to provide real-time recommendations**. Not sure how to do that, since the model needs to be retrained on real-time data before reflecting that in its output, and training is again a slow process. Maybe the model can train on only the new data?
* **Have other services/engines complement the ALS
recommendations** with other real-time recommendations. For example: including more products by the same vendor, or including best-sellers in the same category.
* **Loose coupling** - provides flexibility as each component can be developed and scaled independently. However, this can lead to a lot of chattiness between systems. If the messages need to be passed over a network, the system will suffer from all network-based concerns - latency, reliability etc.
## Coding assumptions
* **The transport layer** - This project uses a transporter object that directly interacts with data stores. In the real world, this would typically be a bunch of pipeline jobs that leverage a messaging system like Kafka.
* **The serving database** - This project uses redis (I was already using it as a message broker), with a quick-and-dirty ORM layer on top. However, a RDBMS is much more suited to the job.
* **The warehouse** - For this project, I've prototyped a warehouse which stores and processes files (each line a json) on the local file system. In the real world, this would typically be a distributed big data processing system such as Hadoop.
| {
"content_hash": "ed100692fa50a6c5fbcf768c6894ce26",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 326,
"avg_line_length": 79.925,
"alnum_prop": 0.7704097591492024,
"repo_name": "abhishekpathak/recommendation-system",
"id": "35cf5afe4f019840e13b39c9d202af4a1ead766d",
"size": "3197",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "174"
},
{
"name": "HTML",
"bytes": "2086"
},
{
"name": "JavaScript",
"bytes": "7381"
},
{
"name": "Python",
"bytes": "83630"
},
{
"name": "Shell",
"bytes": "254"
}
],
"symlink_target": ""
} |
using System;
using Newtonsoft.Json;
using WebExtras.JQPlot.RendererOptions;
namespace WebExtras.JQPlot.SubOptions
{
/// <summary>
/// Title options
/// </summary>
[Serializable]
public class TitleOptions
{
/// <summary>
/// Title text
/// </summary>
public string text;
/// <summary>
/// Whether to show the title
/// </summary>
public bool? show;
/// <summary>
/// css font-family spec for the legend text.
/// </summary>
public string fontFamily;
/// <summary>
/// css font-size spec for the legend text.
/// </summary>
public string fontSize;
/// <summary>
/// css text-align spec for the text.
/// </summary>
public string textAlign;
/// <summary>
/// css color spec for the legend text.
/// </summary>
public string textColor;
/// <summary>
/// A class for creating a DOM element for the title, see $.jqplot.DivTitleRenderer.
/// </summary>
[JsonConverter(typeof(JQPlotEnumStringValueJsonConverter))]
public EJQPlotRenderer? renderer;
/// <summary>
/// renderer specific options passed to the renderer.
/// </summary>
public IRendererOptions rendererOptions;
/// <summary>
/// Default constructor
/// </summary>
/// <param name="text">Chart title text</param>
public TitleOptions(string text)
{
this.text = text;
}
}
}
| {
"content_hash": "f4551b6f35fed8918c02dee6acedd2aa",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 88,
"avg_line_length": 22.8,
"alnum_prop": 0.5823211875843455,
"repo_name": "monemihir/webextras",
"id": "8334da4ee9b21806d349ca9dcfcbf472eeceec03",
"size": "2229",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "trunk/WebExtras/JQPlot/SubOptions/TitleOptions.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "3227"
},
{
"name": "Batchfile",
"bytes": "1610"
},
{
"name": "C#",
"bytes": "1576559"
},
{
"name": "CSS",
"bytes": "577986"
},
{
"name": "HTML",
"bytes": "215168"
},
{
"name": "JavaScript",
"bytes": "881525"
}
],
"symlink_target": ""
} |
namespace BinaryTreeTestInternal
{
class TestType
{
public:
int key1;
int key2;
sprawl::String key3;
int GetKey1() { return key1; }
int GetKey2() { return key2; }
sprawl::String GetKey3() { return key3; }
TestType* operator->(){ return this; }
TestType(int i, int j, sprawl::String const& k)
: key1(i)
, key2(j)
, key3(k)
{
//
}
};
int TestTypeAccessor(TestType* obj)
{
return obj->key2;
}
int TestTypeAccessor2(TestType const& obj)
{
return obj.key2;
}
}
#include <memory>
using BinaryTreeTestInternal::TestType;
using BinaryTreeTestInternal::TestTypeAccessor;
class BinaryTreeTest : public testing::Test
{
protected:
virtual void SetUp() override
{
map.Insert(1, std::shared_ptr<TestType>(new TestType(1, 5, "str1")));
ASSERT_TRUE(map.VerifyProperties<0>());
ASSERT_TRUE(map.VerifyProperties<1>());
ASSERT_TRUE(map.VerifyProperties<2>());
map.Insert(2, std::shared_ptr<TestType>(new TestType(2, 6, "str2")));
ASSERT_TRUE(map.VerifyProperties<0>());
ASSERT_TRUE(map.VerifyProperties<1>());
ASSERT_TRUE(map.VerifyProperties<2>());
map.Insert(3, std::shared_ptr<TestType>(new TestType(3, 7, "str3")));
ASSERT_TRUE(map.VerifyProperties<0>());
ASSERT_TRUE(map.VerifyProperties<1>());
ASSERT_TRUE(map.VerifyProperties<2>());
map.Insert(4, std::shared_ptr<TestType>(new TestType(3, 8, "str4")));
ASSERT_TRUE(map.VerifyProperties<0>());
ASSERT_TRUE(map.VerifyProperties<1>());
ASSERT_TRUE(map.VerifyProperties<2>());
map2.Insert(1, std::shared_ptr<TestType>(new TestType(1, 5, "str1")));
ASSERT_TRUE(map2.VerifyProperties<0>());
ASSERT_TRUE(map2.VerifyProperties<1>());
map2.Insert(2, std::shared_ptr<TestType>(new TestType(2, 6, "str2")));
ASSERT_TRUE(map2.VerifyProperties<0>());
ASSERT_TRUE(map2.VerifyProperties<1>());
map2.Insert(3, std::shared_ptr<TestType>(new TestType(3, 7, "str3")));
ASSERT_TRUE(map2.VerifyProperties<0>());
ASSERT_TRUE(map2.VerifyProperties<1>());
map2.Insert(4, std::shared_ptr<TestType>(new TestType(3, 8, "str4")));
ASSERT_TRUE(map2.VerifyProperties<0>());
ASSERT_TRUE(map2.VerifyProperties<1>());
map3.Insert(1, std::shared_ptr<TestType>(new TestType(1, 5, "str1")));
ASSERT_TRUE(map3.VerifyProperties<0>());
map3.Insert(2, std::shared_ptr<TestType>(new TestType(2, 6, "str2")));
ASSERT_TRUE(map3.VerifyProperties<0>());
map3.Insert(3, std::shared_ptr<TestType>(new TestType(3, 7, "str3")));
ASSERT_TRUE(map3.VerifyProperties<0>());
map3.Insert(4, std::shared_ptr<TestType>(new TestType(3, 8, "str4")));
ASSERT_TRUE(map3.VerifyProperties<0>());
map4.Insert(1, TestType(1, 5, "str1"));
ASSERT_TRUE(map4.VerifyProperties<0>());
ASSERT_TRUE(map4.VerifyProperties<1>());
ASSERT_TRUE(map4.VerifyProperties<2>());
map4.Insert(2, TestType(2, 6, "str2"));
ASSERT_TRUE(map4.VerifyProperties<0>());
ASSERT_TRUE(map4.VerifyProperties<1>());
ASSERT_TRUE(map4.VerifyProperties<2>());
map4.Insert(3, TestType(3, 7, "str3"));
ASSERT_TRUE(map4.VerifyProperties<0>());
ASSERT_TRUE(map4.VerifyProperties<1>());
ASSERT_TRUE(map4.VerifyProperties<2>());
map4.Insert(4, TestType(3, 8, "str4"));
ASSERT_TRUE(map4.VerifyProperties<0>());
ASSERT_TRUE(map4.VerifyProperties<1>());
ASSERT_TRUE(map4.VerifyProperties<2>());
map5.Insert(1, TestType(1, 5, "str1"));
ASSERT_TRUE(map5.VerifyProperties<0>());
ASSERT_TRUE(map5.VerifyProperties<1>());
map5.Insert(2, TestType(2, 6, "str2"));
ASSERT_TRUE(map5.VerifyProperties<0>());
ASSERT_TRUE(map5.VerifyProperties<1>());
map5.Insert(3, TestType(3, 7, "str3"));
ASSERT_TRUE(map5.VerifyProperties<0>());
ASSERT_TRUE(map5.VerifyProperties<1>());
map5.Insert(4, TestType(3, 8, "str4"));
ASSERT_TRUE(map5.VerifyProperties<0>());
ASSERT_TRUE(map5.VerifyProperties<1>());
map6.Insert(1, TestType(1, 5, "str1"));
ASSERT_TRUE(map6.VerifyProperties<0>());
map6.Insert(2, TestType(2, 6, "str2"));
ASSERT_TRUE(map6.VerifyProperties<0>());
map6.Insert(3, TestType(3, 7, "str3"));
ASSERT_TRUE(map6.VerifyProperties<0>());
map6.Insert(4, TestType(3, 8, "str4"));
ASSERT_TRUE(map6.VerifyProperties<0>());
}
sprawl::collections::BinaryTree<
std::shared_ptr<TestType>
, sprawl::KeyAccessor<std::shared_ptr<TestType>, int>
, sprawl::PtrFunctionAccessor<TestType, int, &TestTypeAccessor, std::shared_ptr<TestType>>
, sprawl::PtrMemberAccessor<TestType, sprawl::String, &TestType::GetKey3, std::shared_ptr<TestType>>
> map;
sprawl::collections::BinaryTree<
std::shared_ptr<TestType>
, sprawl::KeyAccessor<std::shared_ptr<TestType>, int>
, sprawl::PtrFunctionAccessor<TestType, int, &TestTypeAccessor, std::shared_ptr<TestType>>
> map2;
sprawl::collections::BinaryTree<
std::shared_ptr<TestType>
, sprawl::KeyAccessor<std::shared_ptr<TestType>, int>
> map3;
sprawl::collections::BinaryTree<
TestType
, sprawl::KeyAccessor<TestType, int>
, sprawl::FunctionAccessor<TestType, int, &TestTypeAccessor>
, sprawl::MemberAccessor<TestType, sprawl::String, &TestType::GetKey3>
> map4;
sprawl::collections::BinaryTree<
TestType
, sprawl::KeyAccessor<TestType, int>
, sprawl::FunctionAccessor<TestType, int, &TestTypeAccessor>
> map5;
sprawl::collections::BinaryTree<
TestType
, sprawl::KeyAccessor<TestType, int>
> map6;
};
TEST_F(BinaryTreeTest, LookupWorks)
{
EXPECT_TRUE(map.Has<0>(1));
EXPECT_TRUE(map.Has<0>(2));
EXPECT_TRUE(map.Has<0>(3));
EXPECT_TRUE(map.Has<0>(4));
EXPECT_TRUE(map.Has<1>(5));
EXPECT_TRUE(map.Has<1>(6));
EXPECT_TRUE(map.Has<1>(7));
EXPECT_TRUE(map.Has<1>(8));
EXPECT_TRUE(map.Has("str1"));
EXPECT_TRUE(map.Has("str2"));
EXPECT_TRUE(map.Has("str3"));
EXPECT_TRUE(map.Has("str4"));
EXPECT_TRUE(map2.Has<0>(1));
EXPECT_TRUE(map2.Has<0>(2));
EXPECT_TRUE(map2.Has<0>(3));
EXPECT_TRUE(map2.Has<0>(4));
EXPECT_TRUE(map2.Has<1>(5));
EXPECT_TRUE(map2.Has<1>(6));
EXPECT_TRUE(map2.Has<1>(7));
EXPECT_TRUE(map2.Has<1>(8));
EXPECT_TRUE(map3.Has(1));
EXPECT_TRUE(map3.Has(2));
EXPECT_TRUE(map3.Has(3));
EXPECT_TRUE(map3.Has(4));
EXPECT_TRUE(map4.Has<0>(1));
EXPECT_TRUE(map4.Has<0>(2));
EXPECT_TRUE(map4.Has<0>(3));
EXPECT_TRUE(map4.Has<0>(4));
EXPECT_TRUE(map4.Has<1>(5));
EXPECT_TRUE(map4.Has<1>(6));
EXPECT_TRUE(map4.Has<1>(7));
EXPECT_TRUE(map4.Has<1>(8));
EXPECT_TRUE(map4.Has("str1"));
EXPECT_TRUE(map4.Has("str2"));
EXPECT_TRUE(map4.Has("str3"));
EXPECT_TRUE(map4.Has("str4"));
EXPECT_TRUE(map5.Has<0>(1));
EXPECT_TRUE(map5.Has<0>(2));
EXPECT_TRUE(map5.Has<0>(3));
EXPECT_TRUE(map5.Has<0>(4));
EXPECT_TRUE(map5.Has<1>(5));
EXPECT_TRUE(map5.Has<1>(6));
EXPECT_TRUE(map5.Has<1>(7));
EXPECT_TRUE(map5.Has<1>(8));
EXPECT_TRUE(map6.Has(1));
EXPECT_TRUE(map6.Has(2));
EXPECT_TRUE(map6.Has(3));
EXPECT_TRUE(map6.Has(4));
}
TEST_F(BinaryTreeTest, EraseWorks)
{
map.Erase<0>(4);
ASSERT_TRUE(map.VerifyProperties<0>());
ASSERT_TRUE(map.VerifyProperties<1>());
ASSERT_TRUE(map.VerifyProperties<2>());
map2.Erase<0>(4);
ASSERT_TRUE(map2.VerifyProperties<0>());
ASSERT_TRUE(map2.VerifyProperties<1>());
map3.Erase(4);
ASSERT_TRUE(map3.VerifyProperties<0>());
map4.Erase<0>(4);
ASSERT_TRUE(map4.VerifyProperties<0>());
ASSERT_TRUE(map4.VerifyProperties<1>());
ASSERT_TRUE(map4.VerifyProperties<2>());
map5.Erase<0>(4);
ASSERT_TRUE(map5.VerifyProperties<0>());
ASSERT_TRUE(map5.VerifyProperties<1>());
map6.Erase(4);
ASSERT_TRUE(map6.VerifyProperties<0>());
EXPECT_EQ(map.end(), map.find<0>(4));
EXPECT_EQ(map.end(), map.find<1>(8));
EXPECT_EQ(map.end(), map.find<2>("str4"));
EXPECT_EQ(map2.end(), map2.find<0>(4));
EXPECT_EQ(map2.end(), map2.find<1>(8));
EXPECT_EQ(map3.end(), map3.find<0>(4));
EXPECT_EQ(map4.end(), map4.find<0>(4));
EXPECT_EQ(map4.end(), map4.find<1>(8));
EXPECT_EQ(map4.end(), map4.find<2>("str4"));
EXPECT_EQ(map5.end(), map5.find<0>(4));
EXPECT_EQ(map5.end(), map5.find<1>(8));
EXPECT_EQ(map6.end(), map6.find<0>(4));
}
TEST_F(BinaryTreeTest, GetWorks)
{
EXPECT_EQ(3, map.Get<0>(3)->key1);
EXPECT_EQ(1, map.Get<1>(5)->key1);
EXPECT_EQ(1, map.Get("str1")->key1);
EXPECT_EQ(3, map2.Get<0>(3)->key1);
EXPECT_EQ(1, map2.Get<1>(5)->key1);
EXPECT_EQ(3, map3.Get<0>(3)->key1);
EXPECT_EQ(3, map4.Get<0>(3)->key1);
EXPECT_EQ(1, map4.Get<1>(5)->key1);
EXPECT_EQ(1, map4.Get("str1")->key1);
EXPECT_EQ(3, map5.Get<0>(3)->key1);
EXPECT_EQ(1, map5.Get<1>(5)->key1);
EXPECT_EQ(3, map6.Get<0>(3)->key1);
}
sprawl::String RandomString()
{
sprawl::StringBuilder builder;
for(int i = 3; i < 8; ++i)
{
builder << char((rand() % (int('z') - int('a'))) + int('a'));
}
return builder.Str();
}
int RandomNumber()
{
return (rand() % 50000) - 25000;
}
TEST_F(BinaryTreeTest, IterationIsOrdered)
{
for(int i = 0; i < 300; ++i)
{
map4.Insert(RandomNumber(), TestType(RandomNumber(), RandomNumber(), RandomString()));
}
int key0 = -50000;
for(auto& it : map4)
{
EXPECT_LT(key0, it.Key<0>());
key0 = it.Key<0>();
}
key0 = -50000;
for(auto it = map4.begin<0>(); it != map4.end<0>(); ++it)
{
EXPECT_LT(key0, it.Key<0>());
key0 = it.Key<0>();
}
int key1 = -50000;
for(auto it = map4.begin<1>(); it != map4.end<1>(); ++it)
{
EXPECT_LT(key1, it.Key<1>());
key1 = it.Key<1>();
}
sprawl::String key2("");
for(auto it = map4.begin<2>(); it != map4.end<2>(); ++it)
{
EXPECT_LT(key2, it.Key<2>());
key2 = it.Key<2>();
}
}
TEST_F(BinaryTreeTest, UpperBoundWorks)
{
sprawl::collections::BinarySet<int> set;
set.Insert(5);
set.Insert(3);
set.Insert(7);
set.Insert(2);
set.Insert(4);
set.Insert(6);
set.Insert(8);
EXPECT_EQ(2, set.UpperBound(1).Value());
EXPECT_EQ(3, set.UpperBound(2).Value());
EXPECT_EQ(4, set.UpperBound(3).Value());
EXPECT_EQ(5, set.UpperBound(4).Value());
EXPECT_EQ(6, set.UpperBound(5).Value());
EXPECT_EQ(7, set.UpperBound(6).Value());
EXPECT_EQ(8, set.UpperBound(7).Value());
EXPECT_EQ(set.end(), set.UpperBound(8));
}
TEST_F(BinaryTreeTest, LowerBoundWorks)
{
sprawl::collections::BinarySet<int> set;
set.Insert(5);
set.Insert(3);
set.Insert(7);
set.Insert(2);
set.Insert(4);
set.Insert(6);
set.Insert(8);
EXPECT_EQ(2, set.LowerBound(1).Value());
EXPECT_EQ(2, set.LowerBound(2).Value());
EXPECT_EQ(3, set.LowerBound(3).Value());
EXPECT_EQ(4, set.LowerBound(4).Value());
EXPECT_EQ(5, set.LowerBound(5).Value());
EXPECT_EQ(6, set.LowerBound(6).Value());
EXPECT_EQ(7, set.LowerBound(7).Value());
EXPECT_EQ(8, set.LowerBound(8).Value());
EXPECT_EQ(set.end(), set.LowerBound(9));
}
TEST(MultiKeyTreeTest, MultipleKeyAccessorsWork)
{
sprawl::collections::BinaryTree<
int
, sprawl::KeyAccessor<int, int>
, sprawl::KeyAccessor<int, sprawl::String>
, sprawl::KeyAccessor<int, double>
> multiKeyMapTest;
multiKeyMapTest.Insert(1, "one", 1.0, 1);
multiKeyMapTest.Insert(2, "two", 2.0, 2);
multiKeyMapTest.Insert(3, "three", 3.0, 3);
multiKeyMapTest.Insert(4, "four", 4.0, 4);
EXPECT_EQ(1, multiKeyMapTest.Get(1));
EXPECT_EQ(1, multiKeyMapTest.Get("one"));
EXPECT_EQ(1, multiKeyMapTest.Get(1.0));
EXPECT_EQ(2, multiKeyMapTest.Get(2));
EXPECT_EQ(2, multiKeyMapTest.Get("two"));
EXPECT_EQ(2, multiKeyMapTest.Get(2.0));
EXPECT_EQ(3, multiKeyMapTest.Get(3));
EXPECT_EQ(3, multiKeyMapTest.Get("three"));
EXPECT_EQ(3, multiKeyMapTest.Get(3.0));
EXPECT_EQ(4, multiKeyMapTest.Get(4));
EXPECT_EQ(4, multiKeyMapTest.Get("four"));
EXPECT_EQ(4, multiKeyMapTest.Get(4.0));
}
//This just tests that these various aliases all compile. It doesn't run since it doesn't actually do anything; functionality's tested above.
void BinaryTreeCompileTest()
{
sprawl::collections::BinaryTree<TestType*, sprawl::KeyAccessor<TestType*, sprawl::String>> compileFailureWithImplicitConstruction;
compileFailureWithImplicitConstruction.Insert("blah", nullptr);
sprawl::collections::BinarySet<sprawl::String> setTest;
setTest.Insert("blah");
sprawl::collections::BasicBinaryTree<sprawl::String, TestType*> basicBinaryTreeCompileTest;
basicBinaryTreeCompileTest.Insert("blah", nullptr);
sprawl::collections::BasicBinaryTree<long, long> copyConstructorTest;
sprawl::collections::BasicBinaryTree<long, long> copyConstructorTest2(copyConstructorTest);
copyConstructorTest2.Insert(0, 0);
copyConstructorTest2.Get(0);
sprawl::collections::FunctionBinaryTree<int, TestType, &TestTypeAccessor> functionBinaryTreeCompileTest;
functionBinaryTreeCompileTest.Insert(TestType(1,2,"hi"));
sprawl::collections::MemberBinaryTree<sprawl::String, TestType, &TestType::GetKey3> memberBinaryTreeCompileTest;
memberBinaryTreeCompileTest.Insert(TestType(1,2,"hi"));
sprawl::collections::PtrMemberBinaryTree<sprawl::String, TestType*, &TestType::GetKey3> ptrMemberBinaryTreeCompileTest;
ptrMemberBinaryTreeCompileTest.Insert(new TestType(1,2,"hi"));
sprawl::collections::PtrFunctionBinaryTree<int, TestType*, &TestTypeAccessor> ptrFunctionBinaryTreeCompileTest;
ptrFunctionBinaryTreeCompileTest.Insert(new TestType(1,2,"hi"));
sprawl::collections::PtrFunctionBinaryTree<int, std::shared_ptr<TestType>, &TestTypeAccessor> sharedPtrFunctionBinaryTreeCompileTest;
sharedPtrFunctionBinaryTreeCompileTest.Insert(std::shared_ptr<TestType>(new TestType(1,2,"hi")));
sprawl::collections::PtrMemberBinaryTree<sprawl::String, std::shared_ptr<TestType>, &TestType::GetKey3> sharedPtrMemberBinaryTreeCompileTest;
sharedPtrMemberBinaryTreeCompileTest.Insert(std::shared_ptr<TestType>(new TestType(1,2,"hi")));
}
| {
"content_hash": "3e2d44dcc24b41c5ed2a375603a35d7f",
"timestamp": "",
"source": "github",
"line_count": 444,
"max_line_length": 142,
"avg_line_length": 30.146396396396398,
"alnum_prop": 0.6884572282405678,
"repo_name": "ShadauxCat/Sprawl",
"id": "23de077839d617bfa574b9aa61420e3c9c1e3751",
"size": "13555",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "UnitTests/UnitTests_BinaryTree.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "23847"
},
{
"name": "C++",
"bytes": "2620177"
},
{
"name": "Python",
"bytes": "8783"
}
],
"symlink_target": ""
} |
package com.hazelcast.jet.impl.serialization;
import com.hazelcast.core.HazelcastInstanceNotActiveException;
import com.hazelcast.internal.serialization.Data;
import com.hazelcast.internal.serialization.DataType;
import com.hazelcast.internal.serialization.InternalSerializationService;
import com.hazelcast.internal.serialization.SerializationService;
import com.hazelcast.internal.serialization.impl.AbstractSerializationService;
import com.hazelcast.internal.serialization.impl.InternalGenericRecord;
import com.hazelcast.internal.serialization.impl.SerializerAdapter;
import com.hazelcast.internal.serialization.impl.portable.PortableContext;
import com.hazelcast.jet.JetException;
import com.hazelcast.nio.serialization.HazelcastSerializationException;
import com.hazelcast.nio.serialization.Serializer;
import com.hazelcast.partition.PartitioningStrategy;
import javax.annotation.Nullable;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import static com.hazelcast.internal.serialization.impl.SerializationUtil.createSerializerAdapter;
import static com.hazelcast.jet.impl.util.ReflectionUtils.loadClass;
import static com.hazelcast.jet.impl.util.ReflectionUtils.newInstance;
import static java.lang.Thread.currentThread;
import static java.util.Collections.emptyMap;
public class DelegatingSerializationService extends AbstractSerializationService {
private final Map<Class<?>, SerializerAdapter> serializersByClass;
private final Map<Integer, SerializerAdapter> serializersById;
private final AbstractSerializationService delegate;
private volatile boolean active;
public DelegatingSerializationService(
Map<Class<?>, ? extends Serializer> serializers,
AbstractSerializationService delegate
) {
super(delegate);
if (serializers.isEmpty()) {
this.serializersByClass = emptyMap();
this.serializersById = emptyMap();
} else {
Map<Class<?>, SerializerAdapter> serializersByClass = new HashMap<>();
Map<Integer, SerializerAdapter> serializersById = new HashMap<>();
serializers.forEach((clazz, serializer) -> {
int typeId = serializer.getTypeId();
String serializerClassName = serializer.getClass().getName();
if (typeId <= 0) {
throw new IllegalArgumentException("Cannot register Serializer[" + serializerClassName + "] - " +
"typeId should be > 0");
}
if (serializersById.containsKey(typeId)) {
Serializer registered = serializersById.get(typeId).getImpl();
throw new IllegalStateException("Cannot register Serializer[" + serializerClassName + "] - " +
registered.getClass().getName() + " has been already registered for type ID: " + typeId);
}
SerializerAdapter serializerAdapter = createSerializerAdapter(serializer);
serializersByClass.put(clazz, serializerAdapter);
serializersById.put(typeId, serializerAdapter);
});
this.serializersByClass = serializersByClass;
this.serializersById = serializersById;
}
this.delegate = delegate;
this.active = true;
}
@Override
public <B extends Data> B toData(Object object, DataType type) {
throw new UnsupportedOperationException();
}
@Override
public <B extends Data> B toData(Object object, DataType type, PartitioningStrategy strategy) {
throw new UnsupportedOperationException();
}
@Override
public <B extends Data> B convertData(Data data, DataType dataType) {
throw new UnsupportedOperationException();
}
@Override
public InternalGenericRecord readAsInternalGenericRecord(Data data) {
throw new UnsupportedOperationException();
}
@Override
public PortableContext getPortableContext() {
return delegate.getPortableContext();
}
@Override
public SerializerAdapter serializerFor(Object object) {
Class<?> clazz = object == null ? null : object.getClass();
SerializerAdapter serializer = null;
if (clazz != null) {
serializer = serializersByClass.get(clazz);
}
if (serializer == null) {
try {
serializer = delegate.serializerFor(object);
} catch (HazelcastSerializationException hse) {
throw serializationException(clazz, hse);
}
}
if (serializer == null) {
throw active ? serializationException(clazz) : new HazelcastInstanceNotActiveException();
}
return serializer;
}
private RuntimeException serializationException(@Nullable Class<?> clazz, Throwable t) {
return new JetException("Unable to serialize instance of " + clazz + ": " +
t.getMessage() + " - Note: You can register a serializer using JobConfig.registerSerializer()", t);
}
private RuntimeException serializationException(@Nullable Class<?> clazz) {
return new JetException("There is no suitable serializer for " + clazz +
", did you register it with JobConfig.registerSerializer()?");
}
@Override
public SerializerAdapter serializerFor(int typeId) {
SerializerAdapter serializer = serializersById.get(typeId);
if (serializer == null) {
try {
serializer = delegate.serializerFor(typeId);
} catch (HazelcastSerializationException hse) {
throw serializationException(typeId, hse);
}
}
if (serializer == null) {
throw active ? serializationException(typeId) : new HazelcastInstanceNotActiveException();
}
return serializer;
}
private RuntimeException serializationException(int typeId, Throwable t) {
return new JetException("Unable to deserialize object for type " + typeId + ": " +
t.getMessage(), t);
}
private RuntimeException serializationException(int typeId) {
return new JetException("There is no suitable de-serializer for type " + typeId + ". "
+ "This exception is likely caused by differences in the serialization configuration between members "
+ "or between clients and members.");
}
@Override
public void dispose() {
active = false;
for (SerializerAdapter serializer : serializersByClass.values()) {
serializer.destroy();
}
}
public static InternalSerializationService from(
SerializationService serializationService,
Map<String, String> serializerConfigs
) {
ClassLoader classLoader = currentThread().getContextClassLoader();
Map<Class<?>, ? extends Serializer> serializers = new HashMap<>();
for (Entry<String, String> entry : serializerConfigs.entrySet()) {
serializers.put(loadClass(classLoader, entry.getKey()), newInstance(classLoader, entry.getValue()));
}
return new DelegatingSerializationService(serializers, (AbstractSerializationService) serializationService);
}
}
| {
"content_hash": "f272424dc0a905717112b4c282f8c8ab",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 118,
"avg_line_length": 40.62222222222222,
"alnum_prop": 0.6745076586433261,
"repo_name": "gurbuzali/hazelcast-jet",
"id": "25508339a6d21cb66591a0afc92f7eebf1a2d87a",
"size": "7937",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "hazelcast-jet-core/src/main/java/com/hazelcast/jet/impl/serialization/DelegatingSerializationService.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1568"
},
{
"name": "Java",
"bytes": "3684048"
},
{
"name": "Shell",
"bytes": "12114"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>deferred plugin test</title>
<link rel="stylesheet" href="../vendor/qunit/qunit.css" type="text/css" charset="utf-8">
<script src="../vendor/qunit/qunit.js" type="text/javascript" charset="utf-8"></script>
<script src="../src/loadrunner.js" type="text/javascript" data-path="modules" charset="utf-8"></script>
<script src="../plugins/defer.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<h1 id="qunit-header">module.js deferred() test</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<script type="text/javascript" charset="utf-8">
module('loading scripts with deferred');
test('should be able to load deferred scripts and them not execute', function() {
stop(2000);
expect(2);
using('javascripts/deferred_scripts.js', function() {
ok(!window.loadedThing);
ok(!window.loadedAnother);
start();
});
});
test('should be able to load deferred scripts and then execute when required', function() {
stop(2000);
expect(3);
using('javascripts/deferred_scripts.js', function() {
using('thing.js', function() {
ok(window.loadedThing);
ok(!window.loadedAnother);
using('another.js', function() {
ok(window.loadedAnother);
start();
});
});
});
});
test('should be able load deferred scripts from a bundle', function() {
expect(2);
stop(2000);
loadrunner.reset();
window.bundleLoadedThing = false;
window.bundleLoadedAnother = false;
using.bundles.push({ 'javascripts/deferred_bundle.js': ['bundled_thing.js', 'bundled_another.js'] });
using('bundled_thing.js', function() {
equals(true, window.bundleLoadedThing);
equals(false, window.bundleLoadedAnother);
start();
});
});
test('should be able load modpath deferred scripts from a bundle', function() {
expect(1);
stop(2000);
loadrunner.reset();
window.bundleLoadedModpath = false;
using.bundles.push({ 'javascripts/deferred_bundle.js': ['$bundled_with_modpath.js'] });
using('$bundled_with_modpath.js', function() {
equals(true, window.bundleLoadedModpath);
start();
});
});
</script>
</body>
</html> | {
"content_hash": "201f063dde65545d38a2dcf9188583a6",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 109,
"avg_line_length": 34.03947368421053,
"alnum_prop": 0.5809818322381136,
"repo_name": "danwrong/loadrunner",
"id": "f609f7c29299e0221576dbf843e6f26fe84ca625",
"size": "2587",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/deferred_test.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "27937"
}
],
"symlink_target": ""
} |
/* Minimise MediaWiki frame */
.mw-rtrc-available #siteNotice,
.mw-rtrc-available .firstHeading,
.mw-rtrc-available #bodyContent {
visibility: hidden;
}
.mw-rtrc-available #ca-talk,
.mw-rtrc-available #p-views,
.mw-rtrc-available #p-cactions,
.mw-rtrc-available #footer,
.mw-rtrc-available #contentSub,
.mw-rtrc-available #catlinks,
.mw-rtrc-available .mw-revdelundel-link {
display: none;
}
/* Wrapper */
.mw-rtrc-wrapper {
position: relative;
background: rgb(247, 246, 248);
border-top: 30px solid #343434;
padding: 0 1em;
font-size: 13px;
line-height: 1.4;
color: #343434;
opacity: 0;
transition: opacity 150ms ease-out 50ms;
}
.mw-rtrc-ready .mw-rtrc-wrapper {
opacity: 1;
}
.mw-rtrc-legend .mw-rtrc-item {
display: inline-block;
padding: 0 0.6em;
}
.mw-rtrc-available #content {
background: rgb(247, 246, 248);
padding: 0;
}
.mw-rtrc-head {
position: absolute;
left: 1em;
right: 1em;
/* See .mw-rtrc-wrapper#border-top */
top: -30px;
line-height: 30px;
text-align: center;
color: #ccc;
/* Avoid overlap with head-links on narrow screens */
padding: 0 11em;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.mw-rtrc-foot {
position: fixed;
left: 0;
bottom: 0;
right: 0;
background: rgba(255, 255, 255, 0.7);
padding: 6px 15px 6px 15px;
border-top: 1px solid #a1cef5;
text-align: center;
color: #343434;
transition: all 150ms ease-out;
transition-property: opacity, background;
}
.mw-rtrc-foot:hover {
background: rgba(255, 255, 255, 1);
}
/* Sidebar overlay */
/* Don't animate initial hide from init(), only after its ready */
.mw-rtrc-ready.mw-rtrc-sidebar-toggleable #mw-panel,
.mw-rtrc-ready.mw-rtrc-sidebar-toggleable #left-navigation,
.mw-rtrc-ready.mw-rtrc-sidebar-toggleable #content,
.mw-rtrc-navtoggle {
transition: transform 250ms ease-out;
}
.mw-rtrc-ready.mw-rtrc-sidebar-toggleable .mw-rtrc-sidebar-cover {
transition: opacity 250ms ease-out;
}
.mw-rtrc-ready.mw-rtrc-sidebar-toggleable #p-personal {
/* When sliding out */
transition: z-index 0ms linear 255ms;
}
.mw-rtrc-ready.mw-rtrc-sidebar-on #p-personal {
/* When sliding in */
transition: z-index 0ms linear 0ms;
}
/* Make the sidebar standalone for transitioning. */
.mw-rtrc-sidebar-toggleable #mw-panel {
background-color: #f6f6f6;
top: 0; /* was 160px */
padding-top: 0; /* was 1em */
width: 11em; /* was 10em with 1em offset from #content */
min-height: 100%;
z-index: 1; /* overlap mw-rtrc-sidebar-cover */
box-shadow: rgba(0, 0, 0, 0.5) 0 0 25px;
will-change: transform;
}
/* flipped */
/* @noflip */
.mw-rtrc-sidebar-toggleable .ltr #mw-panel {
border-right: 1px solid #a7d7f9; /* transferred from #content/border-left */
transform: translate(-105%, 0);
}
.mw-rtrc-sidebar-toggleable #p-logo {
position: static; /* was absolute */
margin-bottom: 1em; /* transferred from #mw-panel/padding-top */
}
/* flipped */
/* @noflip */
.mw-rtrc-sidebar-toggleable .ltr #left-navigation {
margin-left: 1em;
}
/* flipped */
/* @noflip */
.mw-rtrc-sidebar-toggleable .ltr #content {
margin-left: 0;
border-left: 0;
}
.mw-rtrc-sidebar-cover {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
background: #000;
will-change: opacity;
opacity: 0;
pointer-events: none;
}
/* navtoggle is inside #mw-panel and relative to its box */
.mw-rtrc-navtoggle {
position: absolute;
top: 10px;
border: 0 solid #aaa;
width: 10px;
height: 15px;
cursor: pointer;
transform: scaleX(1);
}
/* flipped */
/* @noflip */
.ltr .mw-rtrc-navtoggle {
left: 13.5em;
border-width: 0 0 0 5px;
}
/* arrow */
.mw-rtrc-navtoggle:after {
content: " ";
width: 0;
height: 0;
position: absolute;
border: 5px solid transparent;
top: 50%;
margin-top: -5px;
}
/* flipped */
/* @noflip */
.ltr .mw-rtrc-navtoggle:after {
border-left-color: #333;
margin-left: 5px;
}
.mw-rtrc-sidebar-toggleable #mw-panel:before {
/* cover the space between navtoggle and mw-panel to avoid :hover gaps */
content: "";
position: absolute;
top: 0;
display: block;
width: calc(13em + 30px);
height: 40px;
}
/* flipped */
/* @noflip */
.mw-rtrc-sidebar-toggleable .ltr #mw-panel:before {
left: 0;
}
.mw-rtrc-sidebar-toggleable #mw-panel:hover .mw-rtrc-navtoggle {
border-color: #fff;
transform: scaleX(-1);
}
/* Must specify .ltr/.rtl to match specificity */
.mw-rtrc-sidebar-toggleable .ltr #mw-panel:hover,
.mw-rtrc-sidebar-toggleable .rtl #mw-panel:hover {
z-index: 1;
transform: none;
}
.mw-rtrc-sidebar-on #p-personal {
z-index: 0; /* was 100 */
}
.mw-rtrc-sidebar-on .mw-rtrc-sidebar-cover {
opacity: 0.5;
}
/* Buttons / Links */
.mw-rtrc-head-links {
position: absolute;
top: 0;
}
/* flipped */
/* @noflip */
.ltr .mw-rtrc-head-links {
right: 1em;
}
.mw-rtrc-head-links a {
display: inline-block;
padding: 0 0.6em;
color: #ccc;
}
.mw-rtrc-head-links a:hover {
color: #fff;
text-decoration: none;
background: #555;
}
.mw-rtrc-wrapper .button:active {
position: relative;
top: 1px;
}
.mw-rtrc-wrapper select {
/* Reset Vector's select { vertical-align: top; } */
vertical-align: baseline;
}
.mw-rtrc-wrapper .helpicon {
display: inline-block;
margin: 0 0.3em;
vertical-align: middle;
width: 18px;
height: 18px;
background: url(https://upload.wikimedia.org/wikipedia/commons/5/51/Question-helpbutton.png) no-repeat;
}
.mw-rtrc-nohelp .helpicon {
display: none;
}
.mw-rtrc-wrapper .button:hover,
.mw-rtrc-wrapper .helpicon:hover {
cursor: pointer;
}
.mw-rtrc-head-links a:first-letter,
.mw-rtrc-diff-tools .tab:first-letter {
text-transform: uppercase;
}
/* Settings */
.mw-rtrc-settings {
margin: 0 auto;
min-width: 1000px;
text-align: center;
}
.mw-rtrc-settings fieldset {
display: inline-block;
background: #fff;
border-bottom-left-radius: 11px;
border-bottom-right-radius: 11px;
box-shadow: rgba(200, 200, 200, 1) 0 5px 15px;
text-align: initial;
/* reset mw/fieldset */
margin: 0;
padding: 0;
border: 0;
}
.mw-rtrc-setting-select {
max-width: 80px;
}
.mw-rtrc-settings .panel-group {
display: table;
}
.mw-rtrc-settings .panel-group:first-child {
border-bottom: 1px solid #ddd;
}
.mw-rtrc-settings .panel {
display: table-cell;
width: 1px; /* auto doesn't work, cells will grow now from 1px */
vertical-align: top;
border-right: 1px solid #ddd;
padding: 3px 5px;
white-space: nowrap;
text-align: center;
}
.mw-rtrc-settings .sub-panel {
display: inline-block;
vertical-align: top;
text-align: initial;
padding: 0 5px;
border-right: 1px solid #ddd;
}
.mw-rtrc-settings .sub-panel:first-of-type {
padding-left: 0;
}
.mw-rtrc-settings .sub-panel:last-of-type {
border-right: 0;
padding-right: 0;
}
.mw-rtrc-settings .panel .head {
display: block;
font-weight: bold;
}
.mw-rtrc-settings .panel-group-mini .head {
display: inline-block;
}
.mw-rtrc-settings .button {
padding: 6px 12px;
border-width: 1px;
border-style: solid;
border-radius: 4px;
font-weight: bold;
font-size: 14px;
line-height: 1.42;
color: #fff;
background-color: #357ebd;
border-color: #3071a9;
}
.mw-rtrc-settings .button-small {
padding: 3px 6px;
font-size: 11px;
line-height: 1.5;
border-radius: 3px;
}
.mw-rtrc-settings .button:hover {
background-color: #428bca;
border-color: #428bca;
cursor: pointer;
}
.mw-rtrc-settings .button:active {
box-shadow: inset 0 4px 6px rgba(0, 0, 0, 0.250);
}
.mw-rtrc-settings .button-green {
background-color: #4cae4c;
border-color: #449d44;
}
.mw-rtrc-settings .button-green:hover {
background-color: #5cb85c;
border-color: #5cb85c;
}
.mw-rtrc-settings .button-red {
background-color: #d43f3a;
border-color: #c9302c;
}
.mw-rtrc-settings .button-red:hover {
background-color: #d9534f;
border-color: #d9534f;
}
.mw-rtrc-settings .button[disabled]:hover {
cursor: default;
}
/* Diff frame */
.mw-rtrc-diff {
position: relative;
width: 97%;
margin: 20px auto 15px auto;
padding: 0 1em;
overflow: hidden;
background: #fff;
border-radius: 11px;
box-shadow: rgba(200, 200, 200, 1) 0 5px 15px;
transform-origin: top;
transform: scaleY(1);
max-height: 1000px;
/* When opening, delay the slide until after we reserve the height */
transition: transform 300ms ease-out 200ms, max-height 500ms ease-in;
}
.mw-rtrc-diff-closed {
max-height: 0;
transform: scaleY(0);
/* When closing, no delay for height change since it is naturally behind
while lowering the height hidden in overflow to the actual height */
transition: transform 300ms ease-in, max-height 300ms ease-out;
}
.mw-rtrc-diff-newpage {
max-height: 400px;
}
.mw-rtrc-diff-loading {
opacity: 0.4;
pointer-events: none;
}
.mw-rtrc-diff h3 {
margin: 0 1em 0.5em 0;
border-bottom: 1px solid rgb(247, 246, 248);
font-size: 21px;
font-weight: normal;
white-space: nowrap;
overflow: hidden;
}
.mw-rtrc-diff table.diff {
margin: 0;
width: 100%;
}
.mw-rtrc-diff .mw-revslider-container {
/* Hide broken "Browse history interactively" link. */
display: none;
}
.mw-rtrc-diff-tools {
position: absolute;
top: 0;
right: 2em;
width: 80%;
}
.mw-rtrc-diff-tools .tab {
float: right;
display: block;
font-weight: bold;
margin-left: 3px;
padding: 3px 10px;
background-color:rgb(247, 246, 248);
border-bottom-left-radius: 11px;
border-bottom-right-radius: 11px;
}
.mw-rtrc-diff-tools .tab a:hover {
cursor: pointer;
}
/* Feed */
.mw-rtrc-body {
position: relative;
width: 100%;
margin: 20px auto 70px auto;
}
.mw-rtrc-body.placeholder {
width: 100%;
height: 600px;
background: transparent url(https://upload.wikimedia.org/wikipedia/commons/9/9d/RTRC_Placeholder.png) top center no-repeat;
}
.mw-rtrc-body.placeholder > * {
display: none;
}
.mw-rtrc-feed {
position: relative;
padding: 2em 0;
background: #fff;
font-size: 14px;
border-top-left-radius: 11px;
border-top-right-radius:11px;
box-shadow: rgba(200, 200, 200, 1) 0 5px 15px;
}
.mw-rtrc-feed-update {
position: absolute;
top: 0.5em;
left: 10%;
width: 80%;
font-size: smaller;
text-align: center;
}
#krRTRC_loader {
position: absolute;
top: 0;
right: 0;
}
.mw-rtrc-feed-content {
margin: 0 0 -1.5em 0;
width: 100%;
}
.mw-rtrc-item,
.mw-rtrc-heading {
padding: 0 5px;
white-space: nowrap;
border: 1px solid transparent;
}
.mw-rtrc-item .mw-title {
unicode-bidi: embed;
}
.mw-rtrc-item:nth-child(odd),
.mw-rtrc-heading:nth-child(odd) {
background: #f3f3f3;
}
.mw-rtrc-item.mw-rtrc-item-alert {
background: #ffd5d5;
}
.mw-rtrc-item.mw-rtrc-item-skipped {
background: #d6d9e9;
}
.mw-rtrc-item.mw-rtrc-item-patrolled {
background: #d9e9d6;
}
.mw-rtrc-item.mw-rtrc-item-current {
background: #ffce7b;
border: 1px solid orange;
}
.mw-rtrc-item-alert-rev .mw-rtrc-revscore {
cursor: help;
}
.mw-rtrc-item-alert-user .mw-userlink,
.mw-rtrc-item-alert-rev .mw-rtrc-revscore {
background: url(https://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Nuvola_apps_important.svg/18px-Nuvola_apps_important.svg.png) 0 50% no-repeat;
padding-left: 20px;
}
@media (min-resolution: 2dppx), (min-resolution: 192dpi) {
.mw-rtrc-item-alert-user .mw-userlink,
.mw-rtrc-item-alert-rev .mw-rtrc-revscore {
background-image: url(https://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Nuvola_apps_important.svg/36px-Nuvola_apps_important.svg.png);
background-size: 18px;
}
}
/* Acts like a table with table-rows, using divs to avoid fixed table-layout with forced width and oveflow issues */
.mw-rtrc-item div {
display: inline-block;
overflow: hidden;
padding: 3px 0;
vertical-align: middle;
}
.mw-rtrc-item div[first] { width: 40% }
.mw-rtrc-item div[user] { width: 24% }
.mw-rtrc-item div[comment] { width: 30% }
.mw-rtrc-item .mw-rtrc-meta {
width: 6%;
text-align: right;
}
.mw-rtrc-meta .mw-plusminus {
font-size: smaller;
}
.mw-rtrc-legend {
margin: 5px auto;
padding: 5px 13px;
background: #fff;
border-bottom-left-radius: 11px;
border-bottom-right-radius: 11px;
box-shadow: rgba(200, 200, 200, 1) 0 5px 15px;
}
/* Diff pre-wrap (partially from wikibits/diff.css but there only adds pre-wrap for diffchange */
.mw-rtrc-available table.diff td {
white-space: pre-wrap;
}
/**
* On/Off switch checboxes.
* Based on "iOS 6 style switch checkboxes" by Lea Verou https://lea.verou.me/
*/
.mw-rtrc-settings .switch {
position: absolute;
opacity: 0;
}
/* @noflip */
.mw-rtrc-settings .switch + div {
direction: ltr;
display: inline-block;
vertical-align: middle;
margin: 0 .5em;
width: 3em;
height: 1em;
overflow: hidden;
background: #fff;
background-image: linear-gradient(rgba(0, 0, 0, .1), transparent),
linear-gradient(90deg, #357ebd 50%, transparent 50%);
background-size: 200% 100%;
background-position: 100% 0;
background-origin: border-box;
background-clip: border-box;
border: 1px solid rgba(0, 0, 0, .3);
border-radius: 999px;
box-shadow: 0 .1em .1em rgba(0, 0, 0, .2) inset,
0 .45em 0 .1em rgba(0, 0, 0, .05) inset;
font-size: 150%;
text-align: left;
transition-duration: .4s;
transition-property: padding, width, background-position, text-indent;
}
/* @noflip */
.mw-rtrc-settings .switch:checked + div {
padding-left: 2em;
width: 1em;
background-position: 0 0;
}
/* @noflip */
.mw-rtrc-settings .switch + div:before {
content: 'On';
float: left;
margin: -.1em;
width: 1.65em;
height: 1.65em;
background: #fff;
background-image: linear-gradient(rgba(0, 0, 0, .2), transparent);
border: 1px solid rgba(0,0,0,.35);
border-radius: inherit;
box-shadow: 0 .1em .1em .1em hsla(0, 0%, 100%, .8) inset,
0 0 .5em rgba(0, 0, 0, .3);
color: white;
text-shadow: 0 -1px 1px rgba(0, 0, 0, .3);
text-indent: -2.5em;
}
.mw-rtrc-settings .switch:active + div:before {
background-color: #eee;
}
.mw-rtrc-settings .switch:focus + div {
box-shadow: 0 .1em .1em rgba(0, 0, 0, .2) inset,
0 .45em 0 .1em rgba(0, 0, 0, .05) inset,
0 0 .4em 1px rgba(255, 0, 0, .5);
}
.mw-rtrc-settings .switch + div:before,
.mw-rtrc-settings .switch + div:after {
font: bold 60%/1.9 sans-serif;
text-transform: uppercase;
}
/* @noflip */
.mw-rtrc-settings .switch + div:after {
content: 'Off';
text-align: left;
float: left;
text-indent: .5em;
color: rgba(0, 0, 0, .45);
text-shadow: none;
}
/**
* Manually flipped declarations
* - We set @noflip everywhere because this gadget will
* be stored on-wiki and we need to disable the native flip
* mechanism because we'll deliver one version to all users.
*/
/* @noflip */
.mw-rtrc-sidebar-toggleable .rtl #mw-panel {
border-left: 1px solid #a7d7f9;
transform: translate(105%, 0);
}
/* @noflip */
.mw-rtrc-sidebar-toggleable .rtl #left-navigation {
margin-right: 1em;
}
/* @noflip */
.mw-rtrc-sidebar-toggleable .rtl #content {
margin-right: 0;
border-right: 0;
}
/* @noflip */
.rtl .mw-rtrc-navtoggle {
right: 13.5em;
border-width: 0 5px 0 0;
}
/* @noflip */
.rtl .mw-rtrc-navtoggle:after {
border-right-color: #333;
margin-right: 5px;
}
/* @noflip */
.mw-rtrc-sidebar-toggleable .rtl #mw-panel:before {
right: 0;
}
/* @noflip */
.rtl .mw-rtrc-head-links {
left: 1em;
}
.client-js .skin-vector #t-specialpages::before {
content: "RTRC …";
/* Imitate `.vector-menu-portal .vector-menu-content li` styles.
Padding 0+0.5 instead of 0.25+0.25 because we have to compensate for
being an LI pseudo-element child instead of sibling. */
display: block;
padding: 0 0 0.5em 0;
line-height: 1.125em;
/* Idle styling */
cursor: wait;
opacity: 0.5;
}
/* Ideally we'd use something like `li:not(#t-rtrc) + #t-specialpages::before` above,
but we can't since there may be multiple portlet links inserted this way, so we
have to use sibling (~) instead of adjecent (+). And, when negating a sibling
selector, it doesn't stop matching once #t-rtrc is created as it would simply
keep matching via another sibling instead. */
.client-js .skin-vector #t-rtrc ~ #t-specialpages::before {
display: none;
}
| {
"content_hash": "8e89abcca2b209fe70ffd9cdaf5e2136",
"timestamp": "",
"source": "github",
"line_count": 753,
"max_line_length": 153,
"avg_line_length": 21.07702523240372,
"alnum_prop": 0.6811795097977443,
"repo_name": "Krinkle/mw-gadget-rtrc",
"id": "7ff4ac4d48d0b8ca1b6a9d869bce95eac312ac3c",
"size": "15992",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/rtrc.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "15992"
},
{
"name": "JavaScript",
"bytes": "53108"
}
],
"symlink_target": ""
} |
using GenderPayGap.Core.Models.Downloadable;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Threading.Tasks;
namespace GenderPayGap.Core.Interfaces
{
public interface IFileRepository
{
string RootDir { get; }
Task<IEnumerable<string>> GetDirectoriesAsync(string directoryPath, string searchPattern = null, bool recursive = false);
Task CreateDirectoryAsync(string directoryPath);
Task DeleteFilesAsync(string directoryPath);
Task<bool> GetDirectoryExistsAsync(string directoryPath);
Task<bool> GetFileExistsAsync(string filePath);
Task<DateTime> GetLastWriteTimeAsync(string filePath);
Task<DateTime> GetLastAccessTimeAsync(string filePath);
Task<long> GetFileSizeAsync(string filePath);
Task DeleteFileAsync(string filePath);
Task CopyFileAsync(string sourceFilePath, string destinationFilePath, bool overwrite);
Task RenameFileAsync(string filePath, string newFilename);
Task<IEnumerable<string>> GetFilesAsync(string directoryPath, string searchPattern = null, bool recursive = false);
Task<bool> GetAnyFileExistsAsync(string directoryPath, string searchPattern = null, bool recursive = false);
Task<string> ReadAsync(string filePath);
Task ReadAsync(string filePath, Stream stream);
Task<byte[]> ReadBytesAsync(string filePath);
Task<DataTable> ReadDataTableAsync(string filePath);
Task AppendAsync(string filePath, string text);
Task AppendAsync(string filePath, IEnumerable<string> lines);
Task WriteAsync(string filePath, byte[] bytes);
Task WriteAsync(string filePath, Stream stream);
Task WriteAsync(string filePath, FileInfo uploadFile);
string GetFullPath(string filePath);
Task<IDictionary<string, string>> LoadMetaDataAsync(string filePath);
Task SaveMetaDataAsync(string filePath, IDictionary<string, string> metaData);
Task<string> GetMetaDataAsync(string filePath, string key);
Task SetMetaDataAsync(string filePath, string key, string value);
}
} | {
"content_hash": "456e761e004c8255304e4bcef4501ba2",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 129,
"avg_line_length": 39.49090909090909,
"alnum_prop": 0.7288213627992634,
"repo_name": "DFEAGILEDEVOPS/gender-pay-gap",
"id": "eb718d62d00b987728581a7acb403d42d08b29f8",
"size": "2174",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Beta/GenderPayGap.Core/Interfaces/IFileRepository.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "947"
},
{
"name": "C#",
"bytes": "4414608"
},
{
"name": "CSS",
"bytes": "447292"
},
{
"name": "HTML",
"bytes": "650101"
},
{
"name": "JavaScript",
"bytes": "252420"
}
],
"symlink_target": ""
} |
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
/* eslint-disable jsx-a11y/aria-role */
import * as React from 'react';
import PropTypes from 'prop-types';
import clsx from 'clsx';
import ButtonBase from '../ButtonBase';
import IconButton from '../IconButton';
import withStyles from '../styles/withStyles';
import AccordionContext from '../Accordion/AccordionContext';
export const styles = theme => {
const transition = {
duration: theme.transitions.duration.shortest
};
return {
/* Styles applied to the root element. */
root: {
display: 'flex',
minHeight: 8 * 6,
transition: theme.transitions.create(['min-height', 'background-color'], transition),
padding: theme.spacing(0, 2),
'&:hover:not($disabled)': {
cursor: 'pointer'
},
'&$expanded': {
minHeight: 64
},
'&$focused': {
backgroundColor: theme.palette.action.focus
},
'&$disabled': {
opacity: theme.palette.action.disabledOpacity
}
},
/* Pseudo-class applied to the root element, children wrapper element and `IconButton` component if `expanded={true}`. */
expanded: {},
/* Pseudo-class applied to the root element if `focused={true}`. */
focused: {},
/* Pseudo-class applied to the root element if `disabled={true}`. */
disabled: {},
/* Styles applied to the children wrapper element. */
content: {
display: 'flex',
flexGrow: 1,
transition: theme.transitions.create(['margin'], transition),
margin: '12px 0',
'&$expanded': {
margin: '20px 0'
}
},
/* Styles applied to the `IconButton` component when `expandIcon` is supplied. */
expandIcon: {
transform: 'rotate(0deg)',
transition: theme.transitions.create('transform', transition),
'&:hover': {
// Disable the hover effect for the IconButton,
// because a hover effect should apply to the entire Expand button and
// not only to the IconButton.
backgroundColor: 'transparent'
},
'&$expanded': {
transform: 'rotate(180deg)'
}
}
};
};
const AccordionSummary = /*#__PURE__*/React.forwardRef(function AccordionSummary(props, ref) {
const {
children,
classes,
className,
expandIcon,
IconButtonProps = {},
onBlur,
onClick,
onFocusVisible
} = props,
other = _objectWithoutPropertiesLoose(props, ["children", "classes", "className", "expandIcon", "IconButtonProps", "onBlur", "onClick", "onFocusVisible"]);
const [focusedState, setFocusedState] = React.useState(false);
const handleFocusVisible = event => {
setFocusedState(true);
if (onFocusVisible) {
onFocusVisible(event);
}
};
const handleBlur = event => {
setFocusedState(false);
if (onBlur) {
onBlur(event);
}
};
const {
disabled = false,
expanded,
toggle
} = React.useContext(AccordionContext);
const handleChange = event => {
if (toggle) {
toggle(event);
}
if (onClick) {
onClick(event);
}
};
return /*#__PURE__*/React.createElement(ButtonBase, _extends({
focusRipple: false,
disableRipple: true,
disabled: disabled,
component: "div",
"aria-expanded": expanded,
className: clsx(classes.root, className, disabled && classes.disabled, expanded && classes.expanded, focusedState && classes.focused),
onFocusVisible: handleFocusVisible,
onBlur: handleBlur,
onClick: handleChange,
ref: ref
}, other), /*#__PURE__*/React.createElement("div", {
className: clsx(classes.content, expanded && classes.expanded)
}, children), expandIcon && /*#__PURE__*/React.createElement(IconButton, _extends({
edge: "end",
component: "div",
tabIndex: null,
role: null,
"aria-hidden": true
}, IconButtonProps, {
className: clsx(classes.expandIcon, IconButtonProps.className, expanded && classes.expanded)
}), expandIcon));
});
process.env.NODE_ENV !== "production" ? AccordionSummary.propTypes = {
// ----------------------------- Warning --------------------------------
// | These PropTypes are generated from the TypeScript type definitions |
// | To update them edit the d.ts file and run "yarn proptypes" |
// ----------------------------------------------------------------------
/**
* The content of the accordion summary.
*/
children: PropTypes.node,
/**
* Override or extend the styles applied to the component.
* See [CSS API](#css) below for more details.
*/
classes: PropTypes.object,
/**
* @ignore
*/
className: PropTypes.string,
/**
* The icon to display as the expand indicator.
*/
expandIcon: PropTypes.node,
/**
* Props applied to the `IconButton` element wrapping the expand icon.
*/
IconButtonProps: PropTypes.object,
/**
* @ignore
*/
onBlur: PropTypes.func,
/**
* @ignore
*/
onClick: PropTypes.func,
/**
* @ignore
*/
onFocusVisible: PropTypes.func
} : void 0;
export default withStyles(styles, {
name: 'MuiAccordionSummary'
})(AccordionSummary); | {
"content_hash": "39f6778c6c02a6807f8b15bb9056d83e",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 163,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.6177591463414634,
"repo_name": "cdnjs/cdnjs",
"id": "5876017cd1a926a76c8d63a9fd80dc020814b0af",
"size": "5248",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "ajax/libs/material-ui/5.0.0-alpha.6/es/AccordionSummary/AccordionSummary.js",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using Nethereum.RLP;
namespace Stratis.SmartContracts.CLR.Serialization
{
/// <summary>
/// Serializes method parameters using RLP-encoded byte arrays.
/// </summary>
public class MethodParameterByteSerializer : IMethodParameterSerializer
{
private readonly IContractPrimitiveSerializer primitiveSerializer;
public MethodParameterByteSerializer(IContractPrimitiveSerializer primitiveSerializer)
{
this.primitiveSerializer = primitiveSerializer;
}
public byte[] Serialize(object[] methodParameters)
{
if (methodParameters == null)
throw new ArgumentNullException(nameof(methodParameters));
var result = new List<byte[]>();
foreach (object param in methodParameters)
{
byte[] encoded = this.Encode(param);
result.Add(encoded);
}
return RLP.EncodeList(result.Select(RLP.EncodeElement).ToArray());
}
public object[] Deserialize(byte[] bytes)
{
RLPCollection list = RLP.Decode(bytes);
RLPCollection innerList = (RLPCollection)list[0];
IList<byte[]> encodedParamBytes = innerList.Select(x => x.RLPData).ToList();
var results = new List<object>();
foreach (byte[] encodedParam in encodedParamBytes)
{
object result = this.Decode(encodedParam);
results.Add(result);
}
return results.ToArray();
}
private byte[] Encode(object o)
{
Prefix prefix = Prefix.ForObject(o);
byte[] serializedBytes = this.primitiveSerializer.Serialize(o);
var result = new byte[prefix.Length + serializedBytes.Length];
prefix.CopyTo(result);
serializedBytes.CopyTo(result, prefix.Length);
return result;
}
private object Decode(byte[] bytes)
{
if (bytes == null)
throw new ArgumentNullException(nameof(bytes));
if (bytes.Length == 0)
throw new ArgumentOutOfRangeException(nameof(bytes));
var prefix = new Prefix(bytes[0]);
byte[] paramBytes = bytes.Skip(prefix.Length).ToArray();
return this.primitiveSerializer.Deserialize(prefix.Type, paramBytes);
}
}
} | {
"content_hash": "e28c5deb0d07f1a89316c8b90b6cc99f",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 94,
"avg_line_length": 28.770114942528735,
"alnum_prop": 0.5920894926088693,
"repo_name": "Neurosploit/StratisBitcoinFullNode",
"id": "19dc83a7cfa69d674b9e455514773d8a8f38be1b",
"size": "2505",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "src/Stratis.SmartContracts.CLR/Serialization/MethodParameterByteSerializer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "216"
},
{
"name": "C#",
"bytes": "12434354"
},
{
"name": "CSS",
"bytes": "2127"
},
{
"name": "Dockerfile",
"bytes": "1636"
},
{
"name": "HTML",
"bytes": "2444"
},
{
"name": "PowerShell",
"bytes": "9124"
},
{
"name": "Shell",
"bytes": "3446"
}
],
"symlink_target": ""
} |
package com.ftfl.atm;
import com.ftfl.atm.database.AtmDBSource;
import com.ftfl.atm.uitl.ProfileModel;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class CreateProfileActivity extends Activity {
Button btnSave = null;
EditText etName = null;
EditText etAddress = null;
EditText etBankName = null;
EditText etLatitude = null;
EditText etLongitude = null;
EditText etDeposite = null;
EditText etContactPersonName = null;
EditText etContactPersonNumber = null;
Toast toast = null;
String mName = "";
String mAddress = "";
String mBankName = "";
String mLatitude = "";
String mLongitude = "";
String mDeposite = "";
String mContactName = "";
String mContactNumber = "";
AtmDBSource atmDBSource = new AtmDBSource(this);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_create_profile);
// set the text field id to the variable.
etName = (EditText) findViewById(R.id.createName);
etAddress = (EditText) findViewById(R.id.createAddress);
etBankName = (EditText) findViewById(R.id.createBankName);
etLatitude = (EditText) findViewById(R.id.createLatitude);
etLongitude = (EditText) findViewById(R.id.createLongitude);
etDeposite = (EditText) findViewById(R.id.createDeposite);
etContactPersonName = (EditText) findViewById(R.id.createPersonName);
etContactPersonNumber = (EditText) findViewById(R.id.createPersonNumber);
btnSave = (Button) findViewById(R.id.btnSave);
btnSave.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mName = etName.getText().toString();
mAddress = etAddress.getText().toString();
mBankName = etBankName.getText().toString();
mLatitude = etLatitude.getText().toString();
mLongitude = etLongitude.getText().toString();
mDeposite = etDeposite.getText().toString();
mContactName = etContactPersonName.getText().toString();
mContactNumber = etContactPersonNumber.getText().toString();
// Assign values in the Profile
ProfileModel profileDataInsert = new ProfileModel();
profileDataInsert.setmName(mName);
profileDataInsert.setmAddress(mAddress);
profileDataInsert.setmBankName(mBankName);
profileDataInsert.setmLatitude(mLatitude);
profileDataInsert.setmLongitude(mLongitude);
profileDataInsert.setmDeposite(mDeposite);
profileDataInsert.setmContactPersoneName(mContactName);
profileDataInsert.setmContactPersoneNumber(mContactNumber);
//if update is needed then update otherwise submit
if (atmDBSource.insert(profileDataInsert) == true) {
toast = Toast.makeText(CreateProfileActivity.this, "Successfully Saved.", Toast.LENGTH_LONG);
toast.show();
startActivity(new Intent(CreateProfileActivity.this, ViewProfileActivity.class));
} else {
toast = Toast.makeText(CreateProfileActivity.this, "Not Saved.", Toast.LENGTH_LONG);
toast.show();
}
}
});
}
}
| {
"content_hash": "afbd41f792e8140baacc9f269f5bbf3b",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 98,
"avg_line_length": 32.01,
"alnum_prop": 0.7338331771321462,
"repo_name": "FTFL02-ANDROID/Farya",
"id": "735479427e4a4f73cec90fb339d03dca1cd38c22",
"size": "3201",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ATM/src/com/ftfl/atm/CreateProfileActivity.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "366558"
}
],
"symlink_target": ""
} |
<?php
namespace FCForms;
interface DataStore
{
public function getValue($name, $default, $clearOnRead);
public function setValue($name, $data);
}
| {
"content_hash": "d373c01321508b8846e9be0401845da1",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 60,
"avg_line_length": 15.7,
"alnum_prop": 0.7070063694267515,
"repo_name": "Danack/FirstClassForms",
"id": "6e6477f3a94658364f060e6557ad7678ed7eb2d4",
"size": "157",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/FCForms/DataStore.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "205339"
},
{
"name": "JavaScript",
"bytes": "5182"
},
{
"name": "PHP",
"bytes": "140814"
},
{
"name": "Shell",
"bytes": "1022"
},
{
"name": "Smarty",
"bytes": "9145"
}
],
"symlink_target": ""
} |
<?php
namespace Mage\Customer\Test\Constraint;
use Mage\Customer\Test\Page\CustomerAccountIndex;
use Mage\Customer\Test\Page\CustomerAddress;
use Magento\Mtf\Constraint\AbstractConstraint;
/**
* Assert that deleted customers address is absent in Address Book in Customer Account.
*/
class AssertAddressDeletedFrontend extends AbstractConstraint
{
/* tags */
const SEVERITY = 'low';
/* end tags */
/**
* Expected message.
*/
const EXPECTED_MESSAGE = 'You have no additional address entries in your address book.';
/**
* Asserts that 'Additional Address Entries' contains expected message.
*
* @param CustomerAccountIndex $customerAccountIndex
* @param CustomerAddress $customerAddress
* @return void
*/
public function processAssert(CustomerAccountIndex $customerAccountIndex, CustomerAddress $customerAddress)
{
$customerAccountIndex->open();
$customerAccountIndex->getAccountNavigationBlock()->openNavigationItem('Address Book');
\PHPUnit_Framework_Assert::assertEquals(
self::EXPECTED_MESSAGE,
$customerAddress->getBookBlock()->getAdditionalAddressBlock()->getBlockText(),
'Expected text is absent in Additional Address block.'
);
}
/**
* Returns a string representation of the object.
*
* @return string
*/
public function toString()
{
return 'Deleted address is absent in "Additional Address Entries" block.';
}
}
| {
"content_hash": "6109003d8f1b8a9fd853167c0421054c",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 111,
"avg_line_length": 29.705882352941178,
"alnum_prop": 0.6844884488448845,
"repo_name": "z-v/iboxGento2",
"id": "f93408c2cb9eb180d5220614cad974da3565f7e5",
"size": "2459",
"binary": false,
"copies": "11",
"ref": "refs/heads/master",
"path": "dev/tests/functional/tests/app/Mage/Customer/Test/Constraint/AssertAddressDeletedFrontend.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "20018"
},
{
"name": "ApacheConf",
"bytes": "1187"
},
{
"name": "Batchfile",
"bytes": "1036"
},
{
"name": "CSS",
"bytes": "2077843"
},
{
"name": "HTML",
"bytes": "5840333"
},
{
"name": "JavaScript",
"bytes": "1563785"
},
{
"name": "PHP",
"bytes": "49596017"
},
{
"name": "PowerShell",
"bytes": "1028"
},
{
"name": "Ruby",
"bytes": "288"
},
{
"name": "Shell",
"bytes": "3849"
},
{
"name": "XSLT",
"bytes": "2066"
}
],
"symlink_target": ""
} |
<?php
namespace backend\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\Detail;
/**
* DetailSearch represents the model behind the search form about `common\models\Detail`.
*/
class DetailSearch extends Detail
{
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_or_detail', 'id_order', 'id_dania', 'porcja', 'ilosc', 'telefon'], 'integer'],
[['cena'], 'number'],
[['ulica', 'miasto'], 'safe'],
];
}
/**
* @inheritdoc
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = \common\models\order_detail::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
// grid filtering conditions
$query->andFilterWhere([
'id_or_detail' => $this->id_or_detail,
'id_order' => $this->id_order,
'id_dania' => $this->id_dania,
'porcja' => $this->porcja,
'ilosc' => $this->ilosc,
'cena' => $this->cena,
'telefon' => $this->telefon,
]);
$query->andFilterWhere(['like', 'ulica', $this->ulica])
->andFilterWhere(['like', 'miasto', $this->miasto]);
return $dataProvider;
}
}
| {
"content_hash": "a3e5a572f18fd5dc355618038e392bf4",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 106,
"avg_line_length": 24.805194805194805,
"alnum_prop": 0.5324607329842932,
"repo_name": "mboron93/Projects",
"id": "adbe9090d3b8cd0e172953d526317e1da822691f",
"size": "1910",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "backend/models/DetailSearch.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "1541"
},
{
"name": "CSS",
"bytes": "12388"
},
{
"name": "JavaScript",
"bytes": "11868"
},
{
"name": "PHP",
"bytes": "259939"
}
],
"symlink_target": ""
} |
package io.leopard.jdbc.builder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import io.leopard.jdbc.Jdbc;
import io.leopard.jdbc.SqlUtil;
import io.leopard.lang.Paging;
import io.leopard.lang.PagingImpl;
public class JoinBuilder {
private Integer limitStart;
private Integer limitSize;
private String sql;
private String totalSql;
private String tableName;
private String fieldName;
public JoinBuilder(String tableName) {
this.tableName = tableName;
}
public JoinBuilder join(String sql, String fieldName) {
this.sql = sql;
this.fieldName = fieldName;
return this;
}
public JoinBuilder total(String sql) {
this.totalSql = sql;
return this;
}
public JoinBuilder limit(int start, int size) {
this.limitStart = start;
this.limitSize = size;
return this;
}
public <T> Paging<T> queryForPaging(Jdbc jdbc, Class<T> elementType) {
PagingImpl<T> paging = new PagingImpl<T>();
List<String> set = new ArrayList<String>();
{
List<Map<String, Object>> list = jdbc.queryForMaps(sql, limitStart, limitSize);
if (list != null) {
for (Map<String, Object> map : list) {
String value = map.get(this.fieldName).toString();
set.add(value);
}
}
// Json.printList(list, "list");
int totalCount = jdbc.queryForInt(totalSql);
paging.setTotalCount(totalCount);
paging.setPageSize(limitSize);
}
if (!set.isEmpty()) {
String sql = "select * from " + tableName + " where " + this.fieldName + " in (" + SqlUtil.toIn(set) + ")";
List<T> list = jdbc.queryForList(sql, elementType);
paging.setList(list);
}
return paging;
}
}
| {
"content_hash": "43eee1d25113ca102b8a74695ca1fddd",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 110,
"avg_line_length": 24.328358208955223,
"alnum_prop": 0.694478527607362,
"repo_name": "tanhaichao/leopard-data",
"id": "830c74cef3f6c80984cdd196e3b68b9a7dd1fc46",
"size": "1630",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "leopard-jdbc/src/main/java/io/leopard/jdbc/builder/JoinBuilder.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "747530"
}
],
"symlink_target": ""
} |
public class Abc{
static{
System.out.println("static call");
}
public Abc(){
System.out.println("constructor call");
}
public void method1(int i){
System.out.println("method call, pass = "+i);
}
}
| {
"content_hash": "810bb4cfb6686c2ec36dd07363e0fd81",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 50,
"avg_line_length": 20.181818181818183,
"alnum_prop": 0.6216216216216216,
"repo_name": "dushmis/JavaNativeExample",
"id": "880746b0b873ae01dd49e252ce687dcac083f0b9",
"size": "222",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Abc.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "432"
},
{
"name": "Java",
"bytes": "302"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "22444d15f96e909633988ccabe3db81d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "6d2243f43e23cf928cfe461f8fcb68acc466c991",
"size": "172",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rosaceae/Crataegus/Crataegus tenella/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "mscorlib_System_ValueType3507792607.h"
// System.Collections.Generic.List`1<UnityEngine.Networking.PlayerConnection.PlayerEditorConnectionEvents/MessageTypeSubscribers>
struct List_1_t1660627182;
// UnityEngine.Networking.PlayerConnection.PlayerEditorConnectionEvents/MessageTypeSubscribers
struct MessageTypeSubscribers_t2291506050;
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif
// System.Collections.Generic.List`1/Enumerator<UnityEngine.Networking.PlayerConnection.PlayerEditorConnectionEvents/MessageTypeSubscribers>
struct Enumerator_t1195356856
{
public:
// System.Collections.Generic.List`1<T> System.Collections.Generic.List`1/Enumerator::l
List_1_t1660627182 * ___l_0;
// System.Int32 System.Collections.Generic.List`1/Enumerator::next
int32_t ___next_1;
// System.Int32 System.Collections.Generic.List`1/Enumerator::ver
int32_t ___ver_2;
// T System.Collections.Generic.List`1/Enumerator::current
MessageTypeSubscribers_t2291506050 * ___current_3;
public:
inline static int32_t get_offset_of_l_0() { return static_cast<int32_t>(offsetof(Enumerator_t1195356856, ___l_0)); }
inline List_1_t1660627182 * get_l_0() const { return ___l_0; }
inline List_1_t1660627182 ** get_address_of_l_0() { return &___l_0; }
inline void set_l_0(List_1_t1660627182 * value)
{
___l_0 = value;
Il2CppCodeGenWriteBarrier(&___l_0, value);
}
inline static int32_t get_offset_of_next_1() { return static_cast<int32_t>(offsetof(Enumerator_t1195356856, ___next_1)); }
inline int32_t get_next_1() const { return ___next_1; }
inline int32_t* get_address_of_next_1() { return &___next_1; }
inline void set_next_1(int32_t value)
{
___next_1 = value;
}
inline static int32_t get_offset_of_ver_2() { return static_cast<int32_t>(offsetof(Enumerator_t1195356856, ___ver_2)); }
inline int32_t get_ver_2() const { return ___ver_2; }
inline int32_t* get_address_of_ver_2() { return &___ver_2; }
inline void set_ver_2(int32_t value)
{
___ver_2 = value;
}
inline static int32_t get_offset_of_current_3() { return static_cast<int32_t>(offsetof(Enumerator_t1195356856, ___current_3)); }
inline MessageTypeSubscribers_t2291506050 * get_current_3() const { return ___current_3; }
inline MessageTypeSubscribers_t2291506050 ** get_address_of_current_3() { return &___current_3; }
inline void set_current_3(MessageTypeSubscribers_t2291506050 * value)
{
___current_3 = value;
Il2CppCodeGenWriteBarrier(&___current_3, value);
}
};
#ifdef __clang__
#pragma clang diagnostic pop
#endif
| {
"content_hash": "c3237c2c9972d210d931a6f9b5c695eb",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 140,
"avg_line_length": 34.5375,
"alnum_prop": 0.7332609482446616,
"repo_name": "WestlakeAPC/unity-game",
"id": "b33400252d8cc3ac339843e36270fccd3fbb61b1",
"size": "2765",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Xcode Project/Classes/Native/mscorlib_System_Collections_Generic_List_1_Enumera1195356856.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2203895"
},
{
"name": "C++",
"bytes": "30788244"
},
{
"name": "Objective-C",
"bytes": "60881"
},
{
"name": "Objective-C++",
"bytes": "297711"
},
{
"name": "Shell",
"bytes": "1736"
}
],
"symlink_target": ""
} |
package ca.ulaval.ift6002.sputnik.uat.fakes;
import ca.ulaval.ift6002.sputnik.domain.core.request.*;
import ca.ulaval.ift6002.sputnik.domain.core.user.User;
import java.util.ArrayList;
public class FakeRoomRequestFactory implements RoomRequestFactory {
public RequestIdentifier lastCreatedIdentifier;
@Override
public RoomRequest create(String organizerEmail, int numberOfPeople, int priority) {
RequestIdentifier identifier = RequestIdentifier.create();
lastCreatedIdentifier = identifier;
return new StandardRoomRequest(identifier, Priority.fromInteger(priority), new User(organizerEmail), new ArrayList<>(numberOfPeople));
}
}
| {
"content_hash": "4278a12589587f801a392021dff0dea4",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 142,
"avg_line_length": 37.5,
"alnum_prop": 0.7822222222222223,
"repo_name": "Lorac/RoomReservation",
"id": "9700dbeb10d98e37de4b66cb66470d0fe13d9c9c",
"size": "675",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "uat/src/main/java/ca/ulaval/ift6002/sputnik/uat/fakes/FakeRoomRequestFactory.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "157152"
}
],
"symlink_target": ""
} |
package CPANPLUS::Error;
use strict;
use Log::Message private => 0;;
=pod
=head1 NAME
CPANPLUS::Error - error handling for CPANPLUS
=head1 SYNOPSIS
use CPANPLUS::Error qw[cp_msg cp_error];
=head1 DESCRIPTION
This module provides the error handling code for the CPANPLUS
libraries, and is mainly intended for internal use.
=head1 FUNCTIONS
=head2 cp_msg("message string" [,VERBOSE])
Records a message on the stack, and prints it to C<STDOUT> (or actually
C<$MSG_FH>, see the C<GLOBAL VARIABLES> section below), if the
C<VERBOSE> option is true.
The C<VERBOSE> option defaults to false.
=head2 msg()
An alias for C<cp_msg>.
=head2 cp_error("error string" [,VERBOSE])
Records an error on the stack, and prints it to C<STDERR> (or actually
C<$ERROR_FH>, see the C<GLOBAL VARIABLES> sections below), if the
C<VERBOSE> option is true.
The C<VERBOSE> options defaults to true.
=head2 error()
An alias for C<cp_error>.
=head1 CLASS METHODS
=head2 CPANPLUS::Error->stack()
Retrieves all the items on the stack. Since C<CPANPLUS::Error> is
implemented using C<Log::Message>, consult its manpage for the
function C<retrieve> to see what is returned and how to use the items.
=head2 CPANPLUS::Error->stack_as_string([TRACE])
Returns the whole stack as a printable string. If the C<TRACE> option is
true all items are returned with C<Carp::longmess> output, rather than
just the message.
C<TRACE> defaults to false.
=head2 CPANPLUS::Error->flush()
Removes all the items from the stack and returns them. Since
C<CPANPLUS::Error> is implemented using C<Log::Message>, consult its
manpage for the function C<retrieve> to see what is returned and how
to use the items.
=cut
BEGIN {
use Exporter;
use Params::Check qw[check];
use vars qw[@EXPORT @ISA $ERROR_FH $MSG_FH];
@ISA = 'Exporter';
@EXPORT = qw[cp_error cp_msg error msg];
my $log = new Log::Message;
for my $func ( @EXPORT ) {
no strict 'refs';
my $prefix = 'cp_';
my $name = $func;
$name =~ s/^$prefix//g;
*$func = sub {
my $msg = shift;
### no point storing non-messages
return unless defined $msg;
$log->store(
message => $msg,
tag => uc $name,
level => $prefix . $name,
extra => [@_]
);
};
}
sub flush {
my @foo = $log->flush;
return unless @foo;
return reverse @foo;
}
sub stack {
return $log->retrieve( chrono => 1 );
}
sub stack_as_string {
my $class = shift;
my $trace = shift() ? 1 : 0;
return join $/, map {
'[' . $_->tag . '] [' . $_->when . '] ' .
($trace ? $_->message . ' ' . $_->longmess
: $_->message);
} __PACKAGE__->stack;
}
}
=head1 GLOBAL VARIABLES
=over 4
=item $ERROR_FH
This is the filehandle all the messages sent to C<error()> are being
printed. This defaults to C<*STDERR>.
=item $MSG_FH
This is the filehandle all the messages sent to C<msg()> are being
printed. This default to C<*STDOUT>.
=back
=cut
local $| = 1;
$ERROR_FH = \*STDERR;
$MSG_FH = \*STDOUT;
package # Hide from Pause
Log::Message::Handlers;
use Carp ();
{
sub cp_msg {
my $self = shift;
my $verbose = shift;
### so you don't want us to print the msg? ###
return if defined $verbose && $verbose == 0;
my $old_fh = select $CPANPLUS::Error::MSG_FH;
print '['. $self->tag . '] ' . $self->message . "\n";
select $old_fh;
return;
}
sub cp_error {
my $self = shift;
my $verbose = shift;
### so you don't want us to print the error? ###
return if defined $verbose && $verbose == 0;
my $old_fh = select $CPANPLUS::Error::ERROR_FH;
### is only going to be 1 for now anyway ###
### C::I may not be loaded, so do a can() check first
my $cb = CPANPLUS::Internals->can('_return_all_objects')
? (CPANPLUS::Internals->_return_all_objects)[0]
: undef;
### maybe we didn't initialize an internals object (yet) ###
my $debug = $cb ? $cb->configure_object->get_conf('debug') : 0;
my $msg = '['. $self->tag . '] ' . $self->message . "\n";
### i'm getting this warning in the test suite:
### Ambiguous call resolved as CORE::warn(), qualify as such or
### use & at CPANPLUS/Error.pm line 57.
### no idea where it's coming from, since there's no 'sub warn'
### anywhere to be found, but i'll mark it explicitly nonetheless
### --kane
print $debug ? Carp::shortmess($msg) : $msg . "\n";
select $old_fh;
return;
}
}
1;
# Local variables:
# c-indentation-style: bsd
# c-basic-offset: 4
# indent-tabs-mode: nil
# End:
# vim: expandtab shiftwidth=4:
| {
"content_hash": "be679402a43823b93508f6827e708a0e",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 73,
"avg_line_length": 25.14975845410628,
"alnum_prop": 0.5578179024202843,
"repo_name": "leighpauls/k2cro4",
"id": "968cead5605dd8e6a82dc86e62ecdeca16f2d88a",
"size": "5206",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "third_party/perl/perl/lib/CPANPLUS/Error.pm",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "3062"
},
{
"name": "AppleScript",
"bytes": "25392"
},
{
"name": "Arduino",
"bytes": "464"
},
{
"name": "Assembly",
"bytes": "68131038"
},
{
"name": "C",
"bytes": "242794338"
},
{
"name": "C#",
"bytes": "11024"
},
{
"name": "C++",
"bytes": "353525184"
},
{
"name": "Common Lisp",
"bytes": "3721"
},
{
"name": "D",
"bytes": "1931"
},
{
"name": "Emacs Lisp",
"bytes": "1639"
},
{
"name": "F#",
"bytes": "4992"
},
{
"name": "FORTRAN",
"bytes": "10404"
},
{
"name": "Java",
"bytes": "3845159"
},
{
"name": "JavaScript",
"bytes": "39146656"
},
{
"name": "Lua",
"bytes": "13768"
},
{
"name": "Matlab",
"bytes": "22373"
},
{
"name": "Objective-C",
"bytes": "21887598"
},
{
"name": "PHP",
"bytes": "2344144"
},
{
"name": "Perl",
"bytes": "49033099"
},
{
"name": "Prolog",
"bytes": "2926122"
},
{
"name": "Python",
"bytes": "39863959"
},
{
"name": "R",
"bytes": "262"
},
{
"name": "Racket",
"bytes": "359"
},
{
"name": "Ruby",
"bytes": "304063"
},
{
"name": "Scheme",
"bytes": "14853"
},
{
"name": "Shell",
"bytes": "9195117"
},
{
"name": "Tcl",
"bytes": "1919771"
},
{
"name": "Verilog",
"bytes": "3092"
},
{
"name": "Visual Basic",
"bytes": "1430"
},
{
"name": "eC",
"bytes": "5079"
}
],
"symlink_target": ""
} |
<?php
namespace Example\Controller;
use Silex\Application;
class LoginController
{
protected $app;
public function __construct(Application $app)
{
$this->app = $app;
}
public function loginForm()
{
$params = $this->app['request']->query;
return $this->app['twig']->render('login.twig', [
'username' => $params->get('username'),
'isError' => $params->get('error', false),
]);
}
public function authenticate()
{
$params = $this->app['request']->request;
$username = $params->get('username');
$userId = $this->app['repository.user']->login($username, $params->get('password'));
if (!$userId) {
return $this->app->redirect('/login?username='.$username.'&error=1');
}
if (!$this->app['session']->invalidate()) {
$this->app->abort(500, 'Cannot regenerate session id');
}
$this->app['session']->set('user_id', $userId);
$this->app['session']->set('username', $username);
return $this->app->redirect('/');
}
public function deauthenticate()
{
$this->app['session']->invalidate();
return $this->app->redirect('/');
}
}
| {
"content_hash": "017cea38eab81674e973be9174285e29",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 92,
"avg_line_length": 23.203703703703702,
"alnum_prop": 0.5355147645650439,
"repo_name": "co3k/web-vuln-example",
"id": "463f0fe6ad19e8a1479c1d4a3a21cba06b8ca096",
"size": "1532",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Example/Controller/LoginController.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2379"
},
{
"name": "JavaScript",
"bytes": "129514"
},
{
"name": "Makefile",
"bytes": "335"
},
{
"name": "PHP",
"bytes": "30506"
}
],
"symlink_target": ""
} |
package org.apache.poi.hssf.record.chart;
import org.apache.poi.hssf.record.TestcaseRecordInputStream;
import junit.framework.TestCase;
/**
* Tests the serialization and deserialization of the AxisUsedRecord
* class works correctly. Test data taken directly from a real
* Excel file.
*
* @author Glen Stampoultzis (glens at apache.org)
*/
public final class TestAxisUsedRecord extends TestCase {
byte[] data = new byte[] {
(byte)0x01,(byte)0x00,
};
public void testLoad() {
AxisUsedRecord record = new AxisUsedRecord(TestcaseRecordInputStream.create(0x1046, data));
assertEquals( 1, record.getNumAxis());
assertEquals( 6, record.getRecordSize() );
}
public void testStore()
{
AxisUsedRecord record = new AxisUsedRecord();
record.setNumAxis( (short)1 );
byte [] recordBytes = record.serialize();
assertEquals(recordBytes.length - 4, data.length);
for (int i = 0; i < data.length; i++)
assertEquals("At offset " + i, data[i], recordBytes[i+4]);
}
}
| {
"content_hash": "5d8bf269e3ad40a897bb3b05879f5cc4",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 99,
"avg_line_length": 26.29268292682927,
"alnum_prop": 0.6614100185528757,
"repo_name": "tobyclemson/msci-project",
"id": "f421b4ffc6667e93055095981f48434d2a90e6af",
"size": "2012",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "vendor/poi-3.6/src/testcases/org/apache/poi/hssf/record/chart/TestAxisUsedRecord.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "89867"
},
{
"name": "Ruby",
"bytes": "137019"
}
],
"symlink_target": ""
} |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.17626
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MjpegProcessorTestWP8.Resources
{
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class AppResources
{
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal AppResources()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Resources.ResourceManager ResourceManager
{
get
{
if (object.ReferenceEquals(resourceMan, null))
{
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MjpegProcessorTestWP8.Resources.AppResources", typeof(AppResources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
public static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to LeftToRight.
/// </summary>
public static string ResourceFlowDirection
{
get
{
return ResourceManager.GetString("ResourceFlowDirection", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to us-EN.
/// </summary>
public static string ResourceLanguage
{
get
{
return ResourceManager.GetString("ResourceLanguage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to MY APPLICATION.
/// </summary>
public static string ApplicationTitle
{
get
{
return ResourceManager.GetString("ApplicationTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to button.
/// </summary>
public static string AppBarButtonText
{
get
{
return ResourceManager.GetString("AppBarButtonText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to menu item.
/// </summary>
public static string AppBarMenuItemText
{
get
{
return ResourceManager.GetString("AppBarMenuItemText", resourceCulture);
}
}
}
}
| {
"content_hash": "b60ac0e0e361f4b9acaede0ed6cedc05",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 177,
"avg_line_length": 28.8503937007874,
"alnum_prop": 0.6844978165938864,
"repo_name": "robdobsn/RdCamViewSysTray",
"id": "45cf3aeffcade676af27f00b9a25379ef94b1b14",
"size": "3666",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MJPEG/MjpegProcessorTestWP8/Resources/AppResources.Designer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "2881"
},
{
"name": "C#",
"bytes": "179664"
},
{
"name": "CSS",
"bytes": "232"
},
{
"name": "HTML",
"bytes": "3379"
},
{
"name": "JavaScript",
"bytes": "19666"
}
],
"symlink_target": ""
} |
import { add } from "../fp";
export = add;
| {
"content_hash": "6579d836f83086ce1f49efe5ec73f18e",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 28,
"avg_line_length": 22.5,
"alnum_prop": 0.5333333333333333,
"repo_name": "cripplet/munuc-django",
"id": "5fba875c9e1b54d6587888e4865f23b9acc8a702",
"size": "45",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "functions/node_modules/@types/lodash/fp/add.d.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "21108"
}
],
"symlink_target": ""
} |
package nom.bdezonia.zorbage.type.octonion.highprec;
import java.lang.Integer;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import nom.bdezonia.zorbage.algebra.*;
import nom.bdezonia.zorbage.algorithm.CrossProduct;
import nom.bdezonia.zorbage.algorithm.DotProduct;
import nom.bdezonia.zorbage.algorithm.FixedTransform2b;
import nom.bdezonia.zorbage.algorithm.PerpDotProduct;
import nom.bdezonia.zorbage.algorithm.RModuleAdd;
import nom.bdezonia.zorbage.algorithm.RModuleAssign;
import nom.bdezonia.zorbage.algorithm.RModuleConjugate;
import nom.bdezonia.zorbage.algorithm.RModuleDefaultNorm;
import nom.bdezonia.zorbage.algorithm.RModuleDirectProduct;
import nom.bdezonia.zorbage.algorithm.RModuleEqual;
import nom.bdezonia.zorbage.algorithm.RModuleNegate;
import nom.bdezonia.zorbage.algorithm.RModuleScale;
import nom.bdezonia.zorbage.algorithm.RModuleScaleByDouble;
import nom.bdezonia.zorbage.algorithm.RModuleScaleByHighPrec;
import nom.bdezonia.zorbage.algorithm.RModuleScaleByRational;
import nom.bdezonia.zorbage.algorithm.RModuleSubtract;
import nom.bdezonia.zorbage.algorithm.ScaleHelper;
import nom.bdezonia.zorbage.algorithm.SequenceIsZero;
import nom.bdezonia.zorbage.algorithm.SequencesSimilar;
import nom.bdezonia.zorbage.algorithm.Transform3;
import nom.bdezonia.zorbage.function.Function1;
import nom.bdezonia.zorbage.function.Function2;
import nom.bdezonia.zorbage.function.Function3;
import nom.bdezonia.zorbage.procedure.Procedure1;
import nom.bdezonia.zorbage.procedure.Procedure2;
import nom.bdezonia.zorbage.procedure.Procedure3;
import nom.bdezonia.zorbage.procedure.Procedure4;
import nom.bdezonia.zorbage.type.rational.RationalMember;
import nom.bdezonia.zorbage.type.real.highprec.HighPrecisionMember;
/**
*
* @author Barry DeZonia
*
*/
public class OctonionHighPrecisionRModule
implements
RModule<OctonionHighPrecisionRModule,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionAlgebra,OctonionHighPrecisionMember>,
Constructible1dLong<OctonionHighPrecisionRModuleMember>,
Norm<OctonionHighPrecisionRModuleMember,HighPrecisionMember>,
Products<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionMember, OctonionHighPrecisionMatrixMember>,
DirectProduct<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionMatrixMember>,
ScaleByHighPrec<OctonionHighPrecisionRModuleMember>,
ScaleByRational<OctonionHighPrecisionRModuleMember>,
ScaleByDouble<OctonionHighPrecisionRModuleMember>,
ScaleByOneHalf<OctonionHighPrecisionRModuleMember>,
ScaleByTwo<OctonionHighPrecisionRModuleMember>,
Tolerance<HighPrecisionMember,OctonionHighPrecisionRModuleMember>,
ArrayLikeMethods<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionMember>,
ConstructibleFromBigDecimal<OctonionHighPrecisionRModuleMember>,
ConstructibleFromBigInteger<OctonionHighPrecisionRModuleMember>,
ConstructibleFromDouble<OctonionHighPrecisionRModuleMember>,
ConstructibleFromLong<OctonionHighPrecisionRModuleMember>
{
@Override
public String typeDescription() {
return "Arbitrary precision octonion rmodule";
}
public OctonionHighPrecisionRModule() { }
@Override
public OctonionHighPrecisionRModuleMember construct() {
return new OctonionHighPrecisionRModuleMember();
}
@Override
public OctonionHighPrecisionRModuleMember construct(OctonionHighPrecisionRModuleMember other) {
return new OctonionHighPrecisionRModuleMember(other);
}
@Override
public OctonionHighPrecisionRModuleMember construct(String s) {
return new OctonionHighPrecisionRModuleMember(s);
}
@Override
public OctonionHighPrecisionRModuleMember construct(StorageConstruction s, long d1) {
return new OctonionHighPrecisionRModuleMember(s, d1);
}
@Override
public OctonionHighPrecisionRModuleMember construct(BigDecimal... vals) {
return new OctonionHighPrecisionRModuleMember(vals);
}
@Override
public OctonionHighPrecisionRModuleMember construct(BigInteger... vals) {
return new OctonionHighPrecisionRModuleMember(vals);
}
@Override
public OctonionHighPrecisionRModuleMember construct(double... vals) {
return new OctonionHighPrecisionRModuleMember(vals);
}
@Override
public OctonionHighPrecisionRModuleMember construct(long... vals) {
return new OctonionHighPrecisionRModuleMember(vals);
}
private final Procedure1<OctonionHighPrecisionRModuleMember> ZER =
new Procedure1<OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember a) {
a.primitiveInit();
}
};
@Override
public Procedure1<OctonionHighPrecisionRModuleMember> zero() {
return ZER;
}
private final Procedure2<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> NEG =
new Procedure2<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b) {
RModuleNegate.compute(G.OHP, a, b);
}
};
@Override
public Procedure2<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> negate() {
return NEG;
}
private final Procedure3<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> ADD =
new Procedure3<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b, OctonionHighPrecisionRModuleMember c) {
RModuleAdd.compute(G.OHP, a, b, c);
}
};
@Override
public Procedure3<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> add() {
return ADD;
}
private final Procedure3<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> SUB =
new Procedure3<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b, OctonionHighPrecisionRModuleMember c) {
RModuleSubtract.compute(G.OHP, a, b, c);
}
};
@Override
public Procedure3<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> subtract() {
return SUB;
}
private final Function2<Boolean,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> EQ =
new Function2<Boolean, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public Boolean call(OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b) {
return RModuleEqual.compute(G.OHP, a, b);
}
};
@Override
public Function2<Boolean,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> isEqual() {
return EQ;
}
private final Function2<Boolean,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> NEQ =
new Function2<Boolean, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public Boolean call(OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b) {
return !isEqual().call(a, b);
}
};
@Override
public Function2<Boolean,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> isNotEqual() {
return NEQ;
}
private final Procedure2<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> ASSIGN =
new Procedure2<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember from, OctonionHighPrecisionRModuleMember to) {
RModuleAssign.compute(G.OHP, from, to);
}
};
@Override
public Procedure2<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> assign() {
return ASSIGN;
}
private final Procedure2<OctonionHighPrecisionRModuleMember,HighPrecisionMember> NORM =
new Procedure2<OctonionHighPrecisionRModuleMember, HighPrecisionMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember a, HighPrecisionMember b) {
RModuleDefaultNorm.compute(G.OHP, G.HP, a, b);
}
};
@Override
public Procedure2<OctonionHighPrecisionRModuleMember,HighPrecisionMember> norm() {
return NORM;
}
private final Procedure3<OctonionHighPrecisionMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> SCALE =
new Procedure3<OctonionHighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(OctonionHighPrecisionMember scalar, OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b) {
RModuleScale.compute(G.OHP, scalar, a, b);
}
};
@Override
public Procedure3<OctonionHighPrecisionMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> scale() {
return SCALE;
}
private final Procedure3<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> CROSS =
new Procedure3<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b, OctonionHighPrecisionRModuleMember c) {
CrossProduct.compute(G.OHP_RMOD, G.OHP, a, b, c);
}
};
@Override
public Procedure3<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> crossProduct() {
return CROSS;
}
private final Procedure3<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionMember> DOT =
new Procedure3<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b, OctonionHighPrecisionMember c) {
DotProduct.compute(G.OHP_RMOD, G.OHP, G.HP, a, b, c);
}
};
@Override
public Procedure3<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionMember> dotProduct() {
return DOT;
}
private final Procedure3<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionMember> PERP =
new Procedure3<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b, OctonionHighPrecisionMember c) {
PerpDotProduct.compute(G.OHP_RMOD, G.OHP, a, b, c);
}
};
@Override
public Procedure3<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionMember> perpDotProduct() {
return PERP;
}
private final Procedure4<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> VTRIPLE =
new Procedure4<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b, OctonionHighPrecisionRModuleMember c,
OctonionHighPrecisionRModuleMember d)
{
BigDecimal[] arr = new BigDecimal[3*8];
Arrays.fill(arr, BigDecimal.ZERO);
OctonionHighPrecisionRModuleMember b_cross_c = new OctonionHighPrecisionRModuleMember(arr);
crossProduct().call(b, c, b_cross_c);
crossProduct().call(a, b_cross_c, d);
}
};
@Override
public Procedure4<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> vectorTripleProduct()
{
return VTRIPLE;
}
private final Procedure4<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionMember> STRIPLE =
new Procedure4<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b, OctonionHighPrecisionRModuleMember c,
OctonionHighPrecisionMember d)
{
BigDecimal[] arr = new BigDecimal[3*8];
Arrays.fill(arr, BigDecimal.ZERO);
OctonionHighPrecisionRModuleMember b_cross_c = new OctonionHighPrecisionRModuleMember(arr);
crossProduct().call(b, c, b_cross_c);
dotProduct().call(a, b_cross_c, d);
}
};
@Override
public Procedure4<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionMember> scalarTripleProduct()
{
return STRIPLE;
}
private final Procedure2<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> CONJ =
new Procedure2<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b) {
RModuleConjugate.compute(G.OHP, a, b);
}
};
@Override
public Procedure2<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember> conjugate() {
return CONJ;
}
private final Procedure3<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionMatrixMember> VDP =
new Procedure3<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionMatrixMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b, OctonionHighPrecisionMatrixMember c) {
directProduct().call(a, b, c);
}
};
@Override
public Procedure3<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionMatrixMember> vectorDirectProduct() {
return VDP;
}
private final Procedure3<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionMatrixMember> DP =
new Procedure3<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionMatrixMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember in1, OctonionHighPrecisionRModuleMember in2, OctonionHighPrecisionMatrixMember out) {
RModuleDirectProduct.compute(G.OHP, in1, in2, out);
}
};
@Override
public Procedure3<OctonionHighPrecisionRModuleMember,OctonionHighPrecisionRModuleMember,OctonionHighPrecisionMatrixMember> directProduct()
{
return DP;
}
private final Function1<Boolean, OctonionHighPrecisionRModuleMember> ISZERO =
new Function1<Boolean, OctonionHighPrecisionRModuleMember>()
{
@Override
public Boolean call(OctonionHighPrecisionRModuleMember a) {
return SequenceIsZero.compute(G.OHP, a.rawData());
}
};
@Override
public Function1<Boolean, OctonionHighPrecisionRModuleMember> isZero() {
return ISZERO;
}
private final Procedure3<HighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> SBHP =
new Procedure3<HighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(HighPrecisionMember a, OctonionHighPrecisionRModuleMember b, OctonionHighPrecisionRModuleMember c) {
RModuleScaleByHighPrec.compute(G.OHP, a, b, c);
}
};
@Override
public Procedure3<HighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> scaleByHighPrec() {
return SBHP;
}
private final Procedure3<RationalMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> SBR =
new Procedure3<RationalMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(RationalMember a, OctonionHighPrecisionRModuleMember b, OctonionHighPrecisionRModuleMember c) {
RModuleScaleByRational.compute(G.OHP, a, b, c);
}
};
@Override
public Procedure3<RationalMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> scaleByRational() {
return SBR;
}
private final Procedure3<Double, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> SBD =
new Procedure3<Double, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(Double a, OctonionHighPrecisionRModuleMember b, OctonionHighPrecisionRModuleMember c) {
RModuleScaleByDouble.compute(G.OHP, a, b, c);
}
};
@Override
public Procedure3<Double, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> scaleByDouble() {
return SBD;
}
private final Function3<Boolean, HighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> WITHIN =
new Function3<Boolean, HighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public Boolean call(HighPrecisionMember tol, OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b) {
return SequencesSimilar.compute(G.OHP, tol, a.rawData(), b.rawData());
}
};
@Override
public Function3<Boolean, HighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> within() {
return WITHIN;
}
private final Procedure3<OctonionHighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> ADDS =
new Procedure3<OctonionHighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(OctonionHighPrecisionMember scalar, OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b) {
b.alloc(a.length());
FixedTransform2b.compute(G.OHP, scalar, G.OHP.add(), a.rawData(), b.rawData());
}
};
@Override
public Procedure3<OctonionHighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> addScalar() {
return ADDS;
}
private final Procedure3<OctonionHighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> SUBS =
new Procedure3<OctonionHighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(OctonionHighPrecisionMember scalar, OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b) {
b.alloc(a.length());
FixedTransform2b.compute(G.OHP, scalar, G.OHP.subtract(), a.rawData(), b.rawData());
}
};
@Override
public Procedure3<OctonionHighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> subtractScalar() {
return SUBS;
}
private final Procedure3<OctonionHighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> MULS =
new Procedure3<OctonionHighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(OctonionHighPrecisionMember scalar, OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b) {
b.alloc(a.length());
FixedTransform2b.compute(G.OHP, scalar, G.OHP.multiply(), a.rawData(), b.rawData());
}
};
@Override
public Procedure3<OctonionHighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> multiplyByScalar() {
return MULS;
}
private final Procedure3<OctonionHighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> DIVS =
new Procedure3<OctonionHighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(OctonionHighPrecisionMember scalar, OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b) {
b.alloc(a.length());
FixedTransform2b.compute(G.OHP, scalar, G.OHP.divide(), a.rawData(), b.rawData());
}
};
@Override
public Procedure3<OctonionHighPrecisionMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> divideByScalar() {
return DIVS;
}
private final Procedure3<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> MULTELEM =
new Procedure3<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b, OctonionHighPrecisionRModuleMember c) {
c.alloc(a.length());
Transform3.compute(G.OHP, G.OHP.multiply(), a.rawData(), b.rawData(), c.rawData());
}
};
@Override
public Procedure3<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> multiplyElements() {
return MULTELEM;
}
private final Procedure3<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> DIVELEM =
new Procedure3<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b, OctonionHighPrecisionRModuleMember c) {
c.alloc(a.length());
Transform3.compute(G.OHP, G.OHP.divide(), a.rawData(), b.rawData(), c.rawData());
}
};
@Override
public Procedure3<OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> divideElements() {
return DIVELEM;
}
private final Procedure3<Integer, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> SCB2 =
new Procedure3<Integer, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(Integer numTimes, OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b) {
ScaleHelper.compute(G.OHP_RMOD, G.OHP, new OctonionHighPrecisionMember(BigDecimal.valueOf(2), BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO), numTimes, a, b);
}
};
@Override
public Procedure3<Integer, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> scaleByTwo() {
return SCB2;
}
private final Procedure3<Integer, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> SCBH =
new Procedure3<Integer, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember>()
{
@Override
public void call(Integer numTimes, OctonionHighPrecisionRModuleMember a, OctonionHighPrecisionRModuleMember b) {
ScaleHelper.compute(G.OHP_RMOD, G.OHP, new OctonionHighPrecisionMember(BigDecimal.valueOf(0.5), BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO, BigDecimal.ZERO), numTimes, a, b);
}
};
@Override
public Procedure3<Integer, OctonionHighPrecisionRModuleMember, OctonionHighPrecisionRModuleMember> scaleByOneHalf() {
return SCBH;
}
}
| {
"content_hash": "265d715739a29711928cec9eb6d9d256",
"timestamp": "",
"source": "github",
"line_count": 552,
"max_line_length": 235,
"avg_line_length": 41.79528985507246,
"alnum_prop": 0.8327770794503923,
"repo_name": "bdezonia/zorbage",
"id": "9fba48ce552399055f8a398a4d0f30fd710c39c7",
"size": "24692",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/nom/bdezonia/zorbage/type/octonion/highprec/OctonionHighPrecisionRModule.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "15927379"
},
{
"name": "Shell",
"bytes": "169"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Odd_Occurrences
{
class Program
{
static void Main(string[] args)
{
var text = Console.ReadLine().ToLower().Split(' ');
var wordCount = new Dictionary<string, int>();
foreach (var word in text)
{
if (!wordCount.ContainsKey(word))
{
wordCount[word] = 0;
}
wordCount[word]++;
}
var result = new List<string>();
foreach (var item in wordCount)
{
if (item.Value % 2 != 0)
{
result.Add(item.Key);
}
}
Console.WriteLine(string.Join(", ",result));
}
}
}
| {
"content_hash": "771387a91ff08b6668c8cf015f6dba96",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 63,
"avg_line_length": 22.225,
"alnum_prop": 0.453318335208099,
"repo_name": "vasilchavdarov/SoftUniHomework",
"id": "18c9e25a9778ab1a4d23772b56ed790d50536889",
"size": "891",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Projects/Dictionary Lab/Odd Occurrences/Program.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "203"
},
{
"name": "C#",
"bytes": "965187"
},
{
"name": "CSS",
"bytes": "1026"
},
{
"name": "HTML",
"bytes": "10254"
},
{
"name": "JavaScript",
"bytes": "451176"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ODI helper functions — odi-tools 0.0.1 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="top" title="odi-tools 0.0.1 documentation" href="index.html"/>
<link rel="up" title="Modules" href="modules.html"/>
<link rel="next" title="Calculating background statistics" href="rand_bkg.html"/>
<link rel="prev" title="Reading configuration files" href="odi_cfgparse.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> odi-tools
</a>
<div class="version">
0.0.1
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="install.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="running_qr.html">QuickReduce, ODI-PPA, and odi-tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="example/index.html">An Introduction to working with Quick Reduced Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="basic_usage.html">Basic usage</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">Modules</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="odi_config.html">Python configuration to run odi-tools</a></li>
<li class="toctree-l2"><a class="reference internal" href="odi_cfgparse.html">Reading configuration files</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">ODI helper functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="rand_bkg.html">Calculating background statistics</a></li>
<li class="toctree-l2"><a class="reference internal" href="offlinecats.html">Source catalogs</a></li>
<li class="toctree-l2"><a class="reference internal" href="getfwhm.html">Measuring Stellar FWHM</a></li>
<li class="toctree-l2"><a class="reference internal" href="mask_ota.html">Creating an OTA bad pixel mask</a></li>
<li class="toctree-l2"><a class="reference internal" href="get_gaps.html">Create OTA gaps bad pixel masks</a></li>
<li class="toctree-l2"><a class="reference internal" href="fixwcs.html">Improving WCS solutions</a></li>
<li class="toctree-l2"><a class="reference internal" href="ota_sourcefind.html">Find sources for OTA scaling</a></li>
<li class="toctree-l2"><a class="reference internal" href="full_calibrate.html">Full Calibrate</a></li>
<li class="toctree-l2"><a class="reference internal" href="full_phot.html">Full Phot</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">odi-tools</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li><a href="modules.html">Modules</a> »</li>
<li>ODI helper functions</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/odi_helpers.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="odi-helper-functions">
<h1>ODI helper functions<a class="headerlink" href="#odi-helper-functions" title="Permalink to this headline">¶</a></h1>
<p>These are simple functions used throughout the <code class="docutils literal"><span class="pre">odi-tools</span></code> pipeline.</p>
<span class="target" id="module-odi_helpers"></span><dl class="function">
<dt id="odi_helpers.deg_to_sex">
<code class="descclassname">odi_helpers.</code><code class="descname">deg_to_sex</code><span class="sig-paren">(</span><em>ra</em>, <em>dec</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/odi_helpers.html#deg_to_sex"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#odi_helpers.deg_to_sex" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert an Ra and Dec position in decimal degrees to hexadecimal
:param ra: Ra in decimal degrees
:type ra: float
:param dec: Dec in decimal degrees
:type dec: float</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><ul class="simple">
<li><strong>ra</strong> (<em>str</em>) – Ra in hexadecimal HH:MM:SS</li>
<li><strong>dec</strong> (<em>str</em>) – Dec in hexadecimal DD:MM:SS</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="odi_helpers.get_targ_ra_dec">
<code class="descclassname">odi_helpers.</code><code class="descname">get_targ_ra_dec</code><span class="sig-paren">(</span><em>img</em>, <em>ota</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/odi_helpers.html#get_targ_ra_dec"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#odi_helpers.get_targ_ra_dec" title="Permalink to this definition">¶</a></dt>
<dd><p>Get and return the Ra and Dec of an OTA based on the <code class="docutils literal"><span class="pre">RA</span></code> and <code class="docutils literal"><span class="pre">DEC</span></code>
header cards.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>img</strong> (<em>str</em>) – Name of image</li>
<li><strong>ota</strong> (<em>str</em>) – Name of ota</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><ul class="simple">
<li><strong>ra</strong> (<em>float</em>) – Ra in decimal degrees</li>
<li><strong>dec</strong> (<em>str</em>) – Dec in decimal degrees</li>
</ul>
</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="odi_helpers.imcombine_lists">
<code class="descclassname">odi_helpers.</code><code class="descname">imcombine_lists</code><span class="sig-paren">(</span><em>images</em>, <em>filters</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/odi_helpers.html#imcombine_lists"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#odi_helpers.imcombine_lists" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a list files for OTAs, sorted by filter, that will be later
combined to make a dark sky flat.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>images</strong> (<em>list</em>) – List of images</li>
<li><strong>filters</strong> (<em>list</em>) – List of filters present in the images list</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Nothing is returned by this function. A file will be created for each OTA
following this naming scheme: <code class="docutils literal"><span class="pre">OTA##.SCI.filter.lis</span></code>. For example:
<code class="docutils literal"><span class="pre">OTA22.SCI.odi_g.lis</span></code>. Within each of these files will be a list of
images to combine.</p>
</div>
</dd></dl>
<dl class="function">
<dt id="odi_helpers.reproject_ota">
<code class="descclassname">odi_helpers.</code><code class="descname">reproject_ota</code><span class="sig-paren">(</span><em>img</em>, <em>ota</em>, <em>rad</em>, <em>decd</em>, <em>wcsref</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/odi_helpers.html#reproject_ota"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#odi_helpers.reproject_ota" title="Permalink to this definition">¶</a></dt>
<dd><p>Use the IRAF task <code class="docutils literal"><span class="pre">mscimage</span></code> in the <code class="docutils literal"><span class="pre">mscred</span></code> package to reproject
an OTA to a reference tangent plane with constant pixel scale.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>img</strong> (<em>str</em>) – Name of image being processed</li>
<li><strong>ota</strong> (<em>str</em>) – Name of current <code class="docutils literal"><span class="pre">ota</span></code> being processed in <code class="docutils literal"><span class="pre">img</span></code></li>
<li><strong>rad</strong> (<em>float</em>) – Reference Ra position for reprojection</li>
<li><strong>decd</strong> (<em>float</em>) – Reference Ra position for reprojection</li>
<li><strong>wcfreg</strong> (<em>str</em>) – Name of image and ota to be used as the reference image for <code class="docutils literal"><span class="pre">mscimage</span></code></li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p>Nothing is returned by this function but the reprojected ota is saved to the
<code class="docutils literal"><span class="pre">repreopath</span></code>. The pipeline is setup to use OTA33 of
the first image in the images list as the reference image for this function.</p>
<p>Here is how the <code class="docutils literal"><span class="pre">mscimage</span></code> IRAF parameters are set:</p>
<ul class="last simple">
<li>iraf.mscred.mscimage.format=’image’</li>
<li>iraf.mscred.mscimage.pixmask=’yes’</li>
<li>iraf.mscred.mscimage.verbose=’yes’</li>
<li>iraf.mscred.mscimage.wcssour=’image’</li>
<li>iraf.mscred.mscimage.ref=wcsref</li>
<li>iraf.mscred.mscimage.ra=rad</li>
<li>iraf.mscred.mscimage.dec=decd</li>
<li>iraf.mscred.mscimage.scale=0.11</li>
<li>iraf.mscred.mscimage.rotation=0.0</li>
<li>iraf.mscred.mscimage.blank=-999</li>
<li>iraf.mscred.mscimage.interpo=’poly5’</li>
<li>iraf.mscred.mscimage.minterp=’poly5’</li>
<li>iraf.mscred.mscimage.nxbl=4096</li>
<li>iraf.mscred.mscimage.nybl=4096</li>
<li>iraf.mscred.mscimage.fluxcon=’yes’</li>
<li>iraf.mscred.mscimage(image,imout)</li>
</ul>
</div>
</dd></dl>
<dl class="function">
<dt id="odi_helpers.find_new_bg">
<code class="descclassname">odi_helpers.</code><code class="descname">find_new_bg</code><span class="sig-paren">(</span><em>refimg</em>, <em>filter</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/odi_helpers.html#find_new_bg"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#odi_helpers.find_new_bg" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate a new background level to be added to the OTAs before
stacking</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>refimg</strong> (<em>str</em>) – Reference image for background calculation</li>
<li><strong>filter</strong> (<em>str</em>) – Filter of the reference image</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>sky_med</strong> – Median background level</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">float</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="odi_helpers.make_stack_list">
<code class="descclassname">odi_helpers.</code><code class="descname">make_stack_list</code><span class="sig-paren">(</span><em>object</em>, <em>filter</em>, <em>inst</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/odi_helpers.html#make_stack_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#odi_helpers.make_stack_list" title="Permalink to this definition">¶</a></dt>
<dd><p>Makes a list of images to be stacked using <code class="docutils literal"><span class="pre">stack_images()</span></code>. This list
does not include the guiding OTAs as determined by <code class="docutils literal"><span class="pre">derived_props.txt</span></code>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>object</strong> (<em>str</em>) – Name of object in field</li>
<li><strong>filter</strong> (<em>str</em>) – Filter name of images being stacked</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Produces a file with the following naming scheme <code class="docutils literal"><span class="pre">object+'_'+filter+'_stack.list'</span></code></p>
</div>
</dd></dl>
<dl class="function">
<dt id="odi_helpers.stack_images">
<code class="descclassname">odi_helpers.</code><code class="descname">stack_images</code><span class="sig-paren">(</span><em>stackname</em>, <em>refimg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/odi_helpers.html#stack_images"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#odi_helpers.stack_images" title="Permalink to this definition">¶</a></dt>
<dd><p>Stack the images that are in the list produced by <code class="docutils literal"><span class="pre">make_stack_list</span></code> using
the <code class="docutils literal"><span class="pre">IRAF</span></code> task <code class="docutils literal"><span class="pre">imcombine</span></code>. The following are the parameters used by
<code class="docutils literal"><span class="pre">imcombine</span></code>.</p>
<ul class="simple">
<li>combine=’average’</li>
<li>reject=’none’</li>
<li>offsets=’wcs’</li>
<li>masktype=’goodvalue’</li>
<li>maskval=0</li>
<li>blank=-999</li>
<li>scale=’none’</li>
<li>zero=’none’</li>
<li>lthresh=-900</li>
<li>hthresh=60000</li>
<li>logfile=ota+’_stack.log’</li>
</ul>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>stackname</strong> (<em>str</em>) – Name given to final stacked images</li>
<li><strong>refimg</strong> (<em>str</em>) – Name of reference image used in background calculation</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="odi_helpers.instrument">
<code class="descclassname">odi_helpers.</code><code class="descname">instrument</code><span class="sig-paren">(</span><em>img</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/odi_helpers.html#instrument"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#odi_helpers.instrument" title="Permalink to this definition">¶</a></dt>
<dd><p>A function to grab what version of ODI has been used.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>img</strong> (<em>str</em>) – Name of image</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><strong>instrument_name</strong> – Will return <code class="docutils literal"><span class="pre">5odi</span></code> or <code class="docutils literal"><span class="pre">podi</span></code>.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body">str</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="rand_bkg.html" class="btn btn-neutral float-right" title="Calculating background statistics" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="odi_cfgparse.html" class="btn btn-neutral" title="Reading configuration files" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2017, Owen Boberg, Bill Janesh.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0.0.1',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html> | {
"content_hash": "a8fbe366df700e082ef5f0008c08c9a2",
"timestamp": "",
"source": "github",
"line_count": 444,
"max_line_length": 453,
"avg_line_length": 44.403153153153156,
"alnum_prop": 0.6626426578747147,
"repo_name": "bjanesh/odi-tools",
"id": "413d536a2555a1a4f9c9112197f89b573af2c014",
"size": "19726",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/build/html/odi_helpers.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "273198"
}
],
"symlink_target": ""
} |
package com.orientechnologies.orient.core.storage.cache.local;
import com.orientechnologies.common.collection.closabledictionary.OClosableEntry;
import com.orientechnologies.common.collection.closabledictionary.OClosableLinkedContainer;
import com.orientechnologies.common.concur.lock.OInterruptedException;
import com.orientechnologies.common.concur.lock.OLockManager;
import com.orientechnologies.common.concur.lock.OPartitionedLockManager;
import com.orientechnologies.common.concur.lock.OReadersWriterSpinLock;
import com.orientechnologies.common.directmemory.OByteBufferPool;
import com.orientechnologies.common.directmemory.ODirectMemoryAllocator;
import com.orientechnologies.common.directmemory.ODirectMemoryAllocator.Intention;
import com.orientechnologies.common.directmemory.OPointer;
import com.orientechnologies.common.exception.OException;
import com.orientechnologies.common.io.OIOUtils;
import com.orientechnologies.common.log.OLogManager;
import com.orientechnologies.common.serialization.types.OBinarySerializer;
import com.orientechnologies.common.serialization.types.OIntegerSerializer;
import com.orientechnologies.common.serialization.types.OLongSerializer;
import com.orientechnologies.common.thread.OThreadPoolExecutors;
import com.orientechnologies.common.types.OModifiableBoolean;
import com.orientechnologies.common.util.OQuarto;
import com.orientechnologies.common.util.ORawPair;
import com.orientechnologies.orient.core.command.OCommandOutputListener;
import com.orientechnologies.orient.core.config.OGlobalConfiguration;
import com.orientechnologies.orient.core.exception.ODatabaseException;
import com.orientechnologies.orient.core.exception.OInvalidStorageEncryptionKeyException;
import com.orientechnologies.orient.core.exception.OSecurityException;
import com.orientechnologies.orient.core.exception.OStorageException;
import com.orientechnologies.orient.core.exception.OWriteCacheException;
import com.orientechnologies.orient.core.storage.OChecksumMode;
import com.orientechnologies.orient.core.storage.OStorageAbstract;
import com.orientechnologies.orient.core.storage.cache.OAbstractWriteCache;
import com.orientechnologies.orient.core.storage.cache.OCachePointer;
import com.orientechnologies.orient.core.storage.cache.OPageDataVerificationError;
import com.orientechnologies.orient.core.storage.cache.OWriteCache;
import com.orientechnologies.orient.core.storage.cache.local.doublewritelog.DoubleWriteLog;
import com.orientechnologies.orient.core.storage.fs.AsyncFile;
import com.orientechnologies.orient.core.storage.fs.IOResult;
import com.orientechnologies.orient.core.storage.fs.OFile;
import com.orientechnologies.orient.core.storage.impl.local.OPageIsBrokenListener;
import com.orientechnologies.orient.core.storage.impl.local.paginated.wal.MetaDataRecord;
import com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OLogSequenceNumber;
import com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWriteAheadLog;
import java.io.EOFException;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.lang.ref.WeakReference;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.FileChannel;
import java.nio.file.AtomicMoveNotSupportedException;
import java.nio.file.FileStore;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.nio.file.StandardOpenOption;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.locks.Lock;
import java.util.zip.CRC32;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.ShortBufferException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import net.jpountz.xxhash.XXHash64;
import net.jpountz.xxhash.XXHashFactory;
/**
* Write part of disk cache which is used to collect pages which were changed on read cache and
* store them to the disk in background thread. In current implementation only single background
* thread is used to store all changed data, despite of SSD parallelization capabilities we suppose
* that better to write data in single big chunk by one thread than by many small chunks from many
* threads introducing contention and multi threading overhead. Another reasons for usage of only
* one thread are
*
* <ol>
* <li>That we should give room for readers to read data during data write phase
* <li>It provides much less synchronization overhead
* </ol>
*
* Background thread is running by with predefined intervals. Such approach allows SSD GC to use
* pauses to make some clean up of half empty erase blocks. Also write cache is used for checking of
* free space left on disk and putting of database in "read mode" if space limit is reached and to
* perform fuzzy checkpoints. Write cache holds two different type of pages, pages which are shared
* with read cache and pages which belong only to write cache (so called exclusive pages). Files in
* write cache are accessed by id , there are two types of ids, internal used inside of write cache
* and external used outside of write cache. Presence of two types of ids is caused by the fact that
* read cache is global across all storages but each storage has its own write cache. So all ids of
* files should be global across whole read cache. External id is created from internal id by
* prefixing of internal id (in byte presentation) with bytes of write cache id which is unique
* across all storages opened inside of single JVM. Write cache accepts external ids as file ids and
* converts them to internal ids inside of its methods.
*
* @author Andrey Lomakin (a.lomakin-at-orientdb.com)
* @since 7/23/13
*/
public final class OWOWCache extends OAbstractWriteCache
implements OWriteCache, OCachePointer.WritersListener {
private static final XXHashFactory XX_HASH_FACTORY = XXHashFactory.fastestInstance();
private static final XXHash64 XX_HASH_64 = XX_HASH_FACTORY.hash64();
private static final long XX_HASH_SEED = 0xAEF5634;
private static final String ALGORITHM_NAME = "AES";
private static final String TRANSFORMATION = "AES/CTR/NoPadding";
private static final ThreadLocal<Cipher> CIPHER =
ThreadLocal.withInitial(OWOWCache::getCipherInstance);
/** Extension for the file which contains mapping between file name and file id */
private static final String NAME_ID_MAP_EXTENSION = ".cm";
/** Name for file which contains first version of binary format */
private static final String NAME_ID_MAP_V1 = "name_id_map" + NAME_ID_MAP_EXTENSION;
/**
* Name for file which contains second version of binary format. Second version of format contains
* not only file name which is used in write cache but also file name which is used in file system
* so those two names may be different which allows usage of case sensitive file names.
*/
private static final String NAME_ID_MAP_V2 = "name_id_map_v2" + NAME_ID_MAP_EXTENSION;
/**
* Name for file which contains third version of binary format. Third version of format contains
* not only file name which is used in write cache but also file name which is used in file system
* so those two names may be different which allows usage of case sensitive file names. All this
* information is wrapped by XX_HASH code which followed by content length, so any damaged records
* are filtered out during loading of storage.
*/
private static final String NAME_ID_MAP_V3 = "name_id_map_v3" + NAME_ID_MAP_EXTENSION;
/**
* Name of file temporary which contains third version of binary format. Temporary file is used to
* prevent situation when DB is crashed because of migration to third version of binary format and
* data are lost.
*
* @see #NAME_ID_MAP_V3
* @see #storedNameIdMapToV3()
*/
private static final String NAME_ID_MAP_V3_T = "name_id_map_v3_t" + NAME_ID_MAP_EXTENSION;
/**
* Name of the file which is used to compact file registry on close. All compacted data will be
* written first to this file and then file will be atomically moved on the place of existing
* registry.
*/
private static final String NAME_ID_MAP_V2_BACKUP =
"name_id_map_v2_backup" + NAME_ID_MAP_EXTENSION;
/**
* Maximum length of the row in file registry
*
* @see #NAME_ID_MAP_V3
*/
private static final int MAX_FILE_RECORD_LEN = 16 * 1024;
/** Marks pages which have a checksum stored. */
public static final long MAGIC_NUMBER_WITH_CHECKSUM = 0xFACB03FEL;
/** Marks pages which have a checksum stored and data encrypted */
public static final long MAGIC_NUMBER_WITH_CHECKSUM_ENCRYPTED = 0x1L;
/** Marks pages which have no checksum stored. */
private static final long MAGIC_NUMBER_WITHOUT_CHECKSUM = 0xEF30BCAFL;
/** Marks pages which have no checksum stored but have data encrypted */
private static final long MAGIC_NUMBER_WITHOUT_CHECKSUM_ENCRYPTED = 0x2L;
private static final int MAGIC_NUMBER_OFFSET = 0;
public static final int CHECKSUM_OFFSET = MAGIC_NUMBER_OFFSET + OLongSerializer.LONG_SIZE;
private static final int PAGE_OFFSET_TO_CHECKSUM_FROM =
OLongSerializer.LONG_SIZE + OIntegerSerializer.INT_SIZE;
private static final int CHUNK_SIZE = 64 * 1024 * 1024;
/** Executor which runs in single thread all tasks are related to flush of write cache data. */
private static final ScheduledExecutorService commitExecutor;
static {
commitExecutor =
OThreadPoolExecutors.newSingleThreadScheduledPool(
"OrientDB Write Cache Flush Task", OStorageAbstract.storageThreadGroup);
}
/** Limit of free space on disk after which database will be switched to "read only" mode */
private final long freeSpaceLimit =
OGlobalConfiguration.DISK_CACHE_FREE_SPACE_LIMIT.getValueAsLong() * 1024L * 1024L;
/** Listeners which are called once we detect that some of the pages of files are broken. */
private final List<WeakReference<OPageIsBrokenListener>> pageIsBrokenListeners =
new CopyOnWriteArrayList<>();
/** Path to the storage root directory where all files served by write cache will be stored */
private final Path storagePath;
private final FileStore fileStore;
/**
* Container of all files are managed by write cache. That is special type of container which
* ensures that only limited amount of files is open at the same time and opens closed files upon
* request
*/
private final OClosableLinkedContainer<Long, OFile> files;
/**
* The main storage of pages for write cache. If pages is hold by write cache it should be present
* in this map. Map is ordered by position to speed up flush of pages to the disk
*/
private final ConcurrentHashMap<PageKey, OCachePointer> writeCachePages =
new ConcurrentHashMap<>();
/**
* Storage for the pages which are hold only by write cache and are not shared with read cache.
*/
private final ConcurrentSkipListSet<PageKey> exclusiveWritePages = new ConcurrentSkipListSet<>();
/**
* Container for dirty pages. Dirty pages table is concept taken from ARIES protocol. It contains
* earliest LSNs of operations on each page which is potentially changed but not flushed to the
* disk. It allows us by calculation of minimal LSN contained by this container calculate which
* part of write ahead log may be already truncated. "dirty pages" itself is managed using
* following algorithm.
*
* <ol>
* <li>Just after acquiring the exclusive lock on page we fetch LSN of latest record logged into
* WAL
* <li>If page with given index is absent into table we add it to this container
* </ol>
*
* Because we add last WAL LSN if we are going to modify page, it means that we can calculate
* smallest LSN of operation which is not flushed to the log yet without locking of all operations
* on database. There is may be situation when thread locks the page but did not add LSN to the
* dirty pages table yet. If at the moment of start of iteration over the dirty pages table we
* have a non empty dirty pages table it means that new operation on page will have LSN bigger
* than any LSN already stored in table. If dirty pages table is empty at the moment of iteration
* it means at the moment of start of iteration all page changes were flushed to the disk.
*/
private final ConcurrentHashMap<PageKey, OLogSequenceNumber> dirtyPages =
new ConcurrentHashMap<>();
/**
* Copy of content of {@link #dirtyPages} table at the moment when {@link
* #convertSharedDirtyPagesToLocal()} was called. This field is not thread safe because it is used
* inside of tasks which are running inside of {@link #commitExecutor} thread. It is used to keep
* results of postprocessing of {@link #dirtyPages} table. Every time we invoke {@link
* #convertSharedDirtyPagesToLocal()} all content of dirty pages is removed and copied to current
* field and {@link #localDirtyPagesBySegment} filed. Such approach is possible because {@link
* #dirtyPages} table is filled by many threads but is read only from inside of {@link
* #commitExecutor} thread.
*/
private final HashMap<PageKey, OLogSequenceNumber> localDirtyPages = new HashMap<>();
/**
* Copy of content of {@link #dirtyPages} table sorted by log segment and pages sorted by page
* index.
*
* @see #localDirtyPages for details
*/
private final TreeMap<Long, TreeSet<PageKey>> localDirtyPagesBySegment = new TreeMap<>();
/** Approximate amount of all pages contained by write cache at the moment */
private final AtomicLong writeCacheSize = new AtomicLong();
/** Amount of exclusive pages are hold by write cache. */
private final AtomicLong exclusiveWriteCacheSize = new AtomicLong();
/** Serialized is used to encode/decode names of files are managed by write cache. */
private final OBinarySerializer<String> stringSerializer;
/** Size of single page in cache in bytes. */
private final int pageSize;
/** WAL instance */
private final OWriteAheadLog writeAheadLog;
/**
* Lock manager is used to acquire locks in RW mode for cases when we are going to read or write
* page from write cache.
*/
private final OLockManager<PageKey> lockManager = new OPartitionedLockManager<>();
/**
* We acquire lock managed by this manager in read mode if we need to read data from files, and in
* write mode if we add/remove/truncate file.
*/
private final OReadersWriterSpinLock filesLock = new OReadersWriterSpinLock();
/**
* Mapping between case sensitive file names are used in write cache and file's internal id. Name
* of file in write cache is case sensitive and can be different from file name which is used to
* store file in file system.
*/
private final ConcurrentMap<String, Integer> nameIdMap = new ConcurrentHashMap<>();
/**
* Mapping between file's internal ids and case sensitive file names are used in write cache. Name
* of file in write cache is case sensitive and can be different from file name which is used to
* store file in file system.
*/
private final ConcurrentMap<Integer, String> idNameMap = new ConcurrentHashMap<>();
private final Random fileIdGen = new Random();
/** Path to the file which contains metadata for the files registered in storage. */
private Path nameIdMapHolderPath;
/** Write cache id , which should be unique across all storages. */
private final int id;
/**
* Pool of direct memory <code>ByteBuffer</code>s. We can not use them directly because they do
* not have deallocator.
*/
private final OByteBufferPool bufferPool;
private final String storageName;
private volatile OChecksumMode checksumMode;
/** Error thrown during data flush. Once error registered no more write operations are allowed. */
private Throwable flushError;
/** IV is used for AES encryption */
private final byte[] iv;
/** Key is used for AES encryption */
private final byte[] aesKey;
private final int exclusiveWriteCacheMaxSize;
private final boolean callFsync;
private final int chunkSize;
private final long pagesFlushInterval;
private volatile boolean stopFlush;
private volatile Future<?> flushFuture;
private final ConcurrentHashMap<ExclusiveFlushTask, CountDownLatch> triggeredTasks =
new ConcurrentHashMap<>();
private final int shutdownTimeout;
/** Listeners which are called when exception in background data flush thread is happened. */
private final List<WeakReference<OBackgroundExceptionListener>> backgroundExceptionListeners =
new CopyOnWriteArrayList<>();
/**
* Double write log which is used in write cache to prevent page tearing in case of server crash.
*/
private final DoubleWriteLog doubleWriteLog;
private boolean closed;
public OWOWCache(
final int pageSize,
final OByteBufferPool bufferPool,
final OWriteAheadLog writeAheadLog,
final DoubleWriteLog doubleWriteLog,
final long pagesFlushInterval,
final int shutdownTimeout,
final long exclusiveWriteCacheMaxSize,
final Path storagePath,
final String storageName,
final OBinarySerializer<String> stringSerializer,
final OClosableLinkedContainer<Long, OFile> files,
final int id,
final OChecksumMode checksumMode,
final byte[] iv,
final byte[] aesKey,
final boolean callFsync) {
if (aesKey != null && aesKey.length != 16 && aesKey.length != 24 && aesKey.length != 32) {
throw new OInvalidStorageEncryptionKeyException(
"Invalid length of the encryption key, provided size is " + aesKey.length);
}
if (aesKey != null && iv == null) {
throw new OInvalidStorageEncryptionKeyException("IV can not be null");
}
this.shutdownTimeout = shutdownTimeout;
this.pagesFlushInterval = pagesFlushInterval;
this.iv = iv;
this.aesKey = aesKey;
this.callFsync = callFsync;
filesLock.acquireWriteLock();
try {
this.closed = true;
this.id = id;
this.files = files;
this.chunkSize = CHUNK_SIZE / pageSize;
this.pageSize = pageSize;
this.writeAheadLog = writeAheadLog;
this.bufferPool = bufferPool;
this.checksumMode = checksumMode;
this.exclusiveWriteCacheMaxSize = normalizeMemory(exclusiveWriteCacheMaxSize, pageSize);
this.storagePath = storagePath;
try {
this.fileStore = Files.getFileStore(this.storagePath);
} catch (final IOException e) {
throw OException.wrapException(
new OStorageException("Error during retrieving of file store"), e);
}
this.stringSerializer = stringSerializer;
this.storageName = storageName;
this.doubleWriteLog = doubleWriteLog;
if (pagesFlushInterval > 0) {
flushFuture =
commitExecutor.schedule(
new PeriodicFlushTask(), pagesFlushInterval, TimeUnit.MILLISECONDS);
}
} finally {
filesLock.releaseWriteLock();
}
}
/** Loads files already registered in storage. Has to be called before usage of this cache */
public void loadRegisteredFiles() throws IOException, InterruptedException {
filesLock.acquireWriteLock();
try {
initNameIdMapping();
doubleWriteLog.open(storageName, storagePath, pageSize);
closed = false;
} finally {
filesLock.releaseWriteLock();
}
}
/**
* Adds listener which is triggered if exception is cast inside background flush data thread.
*
* @param listener Listener to trigger
*/
@Override
public void addBackgroundExceptionListener(final OBackgroundExceptionListener listener) {
backgroundExceptionListeners.add(new WeakReference<>(listener));
}
/**
* Removes listener which is triggered if exception is cast inside background flush data thread.
*
* @param listener Listener to remove
*/
@Override
public void removeBackgroundExceptionListener(final OBackgroundExceptionListener listener) {
final List<WeakReference<OBackgroundExceptionListener>> itemsToRemove = new ArrayList<>(1);
for (final WeakReference<OBackgroundExceptionListener> ref : backgroundExceptionListeners) {
final OBackgroundExceptionListener l = ref.get();
if (l != null && l.equals(listener)) {
itemsToRemove.add(ref);
}
}
backgroundExceptionListeners.removeAll(itemsToRemove);
}
/** Fires event about exception is thrown in data flush thread */
private void fireBackgroundDataFlushExceptionEvent(final Throwable e) {
for (final WeakReference<OBackgroundExceptionListener> ref : backgroundExceptionListeners) {
final OBackgroundExceptionListener listener = ref.get();
if (listener != null) {
listener.onException(e);
}
}
}
private static int normalizeMemory(final long maxSize, final int pageSize) {
final long tmpMaxSize = maxSize / pageSize;
if (tmpMaxSize >= Integer.MAX_VALUE) {
return Integer.MAX_VALUE;
} else {
return (int) tmpMaxSize;
}
}
/**
* Directory which contains all files managed by write cache.
*
* @return Directory which contains all files managed by write cache or <code>null</code> in case
* of in memory database.
*/
@Override
public Path getRootDirectory() {
return storagePath;
}
/** @inheritDoc */
@Override
public void addPageIsBrokenListener(final OPageIsBrokenListener listener) {
pageIsBrokenListeners.add(new WeakReference<>(listener));
}
/** @inheritDoc */
@Override
public void removePageIsBrokenListener(final OPageIsBrokenListener listener) {
final List<WeakReference<OPageIsBrokenListener>> itemsToRemove = new ArrayList<>(1);
for (final WeakReference<OPageIsBrokenListener> ref : pageIsBrokenListeners) {
final OPageIsBrokenListener pageIsBrokenListener = ref.get();
if (pageIsBrokenListener == null || pageIsBrokenListener.equals(listener)) {
itemsToRemove.add(ref);
}
}
pageIsBrokenListeners.removeAll(itemsToRemove);
}
private void callPageIsBrokenListeners(final String fileName, final long pageIndex) {
for (final WeakReference<OPageIsBrokenListener> pageIsBrokenListenerWeakReference :
pageIsBrokenListeners) {
final OPageIsBrokenListener listener = pageIsBrokenListenerWeakReference.get();
if (listener != null) {
try {
listener.pageIsBroken(fileName, pageIndex);
} catch (final Exception e) {
OLogManager.instance()
.error(
this,
"Error during notification of page is broken for storage " + storageName,
e);
}
}
}
}
@Override
public long bookFileId(final String fileName) {
filesLock.acquireWriteLock();
try {
checkForClose();
final Integer fileId = nameIdMap.get(fileName);
if (fileId != null) {
if (fileId < 0) {
return composeFileId(id, -fileId);
} else {
throw new OStorageException(
"File " + fileName + " has already been added to the storage");
}
}
while (true) {
final int nextId = fileIdGen.nextInt(Integer.MAX_VALUE - 1) + 1;
if (!idNameMap.containsKey(nextId) && !idNameMap.containsKey(-nextId)) {
nameIdMap.put(fileName, -nextId);
idNameMap.put(-nextId, fileName);
return composeFileId(id, nextId);
}
}
} finally {
filesLock.releaseWriteLock();
}
}
/** @inheritDoc */
@Override
public int pageSize() {
return pageSize;
}
@Override
public long loadFile(final String fileName) throws IOException {
filesLock.acquireWriteLock();
try {
checkForClose();
Integer fileId = nameIdMap.get(fileName);
final OFile fileClassic;
// check that file is already registered
if (!(fileId == null || fileId < 0)) {
final long externalId = composeFileId(id, fileId);
fileClassic = files.get(externalId);
if (fileClassic != null) {
return externalId;
} else {
throw new OStorageException(
"File with given name " + fileName + " only partially registered in storage");
}
}
if (fileId == null) {
while (true) {
final int nextId = fileIdGen.nextInt(Integer.MAX_VALUE - 1) + 1;
if (!idNameMap.containsKey(nextId) && !idNameMap.containsKey(-nextId)) {
fileId = nextId;
break;
}
}
} else {
idNameMap.remove(fileId);
fileId = -fileId;
}
fileClassic = createFileInstance(fileName, fileId);
if (!fileClassic.exists()) {
throw new OStorageException(
"File with name " + fileName + " does not exist in storage " + storageName);
} else {
// REGISTER THE FILE
OLogManager.instance()
.debug(
this,
"File '"
+ fileName
+ "' is not registered in 'file name - id' map, but exists in file system. Registering it");
openFile(fileClassic);
final long externalId = composeFileId(id, fileId);
files.add(externalId, fileClassic);
nameIdMap.put(fileName, fileId);
idNameMap.put(fileId, fileName);
writeNameIdEntry(new NameFileIdEntry(fileName, fileId, fileClassic.getName()), true);
return externalId;
}
} catch (final InterruptedException e) {
throw OException.wrapException(new OStorageException("Load file was interrupted"), e);
} finally {
filesLock.releaseWriteLock();
}
}
@Override
public long addFile(final String fileName) throws IOException {
filesLock.acquireWriteLock();
try {
checkForClose();
Integer fileId = nameIdMap.get(fileName);
final OFile fileClassic;
if (fileId != null && fileId >= 0) {
throw new OStorageException(
"File with name " + fileName + " already exists in storage " + storageName);
}
if (fileId == null) {
while (true) {
final int nextId = fileIdGen.nextInt(Integer.MAX_VALUE - 1) + 1;
if (!idNameMap.containsKey(nextId) && !idNameMap.containsKey(-nextId)) {
fileId = nextId;
break;
}
}
} else {
idNameMap.remove(fileId);
fileId = -fileId;
}
fileClassic = createFileInstance(fileName, fileId);
createFile(fileClassic, callFsync);
final long externalId = composeFileId(id, fileId);
files.add(externalId, fileClassic);
nameIdMap.put(fileName, fileId);
idNameMap.put(fileId, fileName);
writeNameIdEntry(new NameFileIdEntry(fileName, fileId, fileClassic.getName()), true);
return externalId;
} catch (final InterruptedException e) {
throw OException.wrapException(new OStorageException("File add was interrupted"), e);
} finally {
filesLock.releaseWriteLock();
}
}
@Override
public long fileIdByName(final String fileName) {
final Integer intId = nameIdMap.get(fileName);
if (intId == null || intId < 0) {
return -1;
}
return composeFileId(id, intId);
}
@Override
public int internalFileId(final long fileId) {
return extractFileId(fileId);
}
@Override
public long externalFileId(final int fileId) {
return composeFileId(id, fileId);
}
@Override
public Long getMinimalNotFlushedSegment() {
final Future<Long> future = commitExecutor.submit(new FindMinDirtySegment());
try {
return future.get();
} catch (final Exception e) {
throw new IllegalStateException(e);
}
}
@Override
public void updateDirtyPagesTable(
final OCachePointer pointer, final OLogSequenceNumber startLSN) {
final long fileId = pointer.getFileId();
final long pageIndex = pointer.getPageIndex();
final PageKey pageKey = new PageKey(internalFileId(fileId), pageIndex);
OLogSequenceNumber dirtyLSN;
if (startLSN != null) {
dirtyLSN = startLSN;
} else {
dirtyLSN = writeAheadLog.end();
}
if (dirtyLSN == null) {
dirtyLSN = new OLogSequenceNumber(0, 0);
}
dirtyPages.putIfAbsent(pageKey, dirtyLSN);
}
@Override
public void create() {}
@Override
public void open() {}
@Override
public long addFile(final String fileName, long fileId) throws IOException {
filesLock.acquireWriteLock();
try {
checkForClose();
OFile fileClassic;
final Integer existingFileId = nameIdMap.get(fileName);
final int intId = extractFileId(fileId);
if (existingFileId != null && existingFileId >= 0) {
if (existingFileId == intId) {
throw new OStorageException(
"File with name '" + fileName + "'' already exists in storage '" + storageName + "'");
} else {
throw new OStorageException(
"File with given name '"
+ fileName
+ "' already exists but has different id "
+ existingFileId
+ " vs. proposed "
+ fileId);
}
}
fileId = composeFileId(id, intId);
fileClassic = files.get(fileId);
if (fileClassic != null) {
if (!fileClassic.getName().equals(createInternalFileName(fileName, intId))) {
throw new OStorageException(
"File with given id exists but has different name "
+ fileClassic.getName()
+ " vs. proposed "
+ fileName);
}
fileClassic.shrink(0);
if (callFsync) {
fileClassic.synch();
}
} else {
fileClassic = createFileInstance(fileName, intId);
createFile(fileClassic, callFsync);
files.add(fileId, fileClassic);
}
idNameMap.remove(-intId);
nameIdMap.put(fileName, intId);
idNameMap.put(intId, fileName);
writeNameIdEntry(new NameFileIdEntry(fileName, intId, fileClassic.getName()), true);
return fileId;
} catch (final InterruptedException e) {
throw OException.wrapException(new OStorageException("File add was interrupted"), e);
} finally {
filesLock.releaseWriteLock();
}
}
@Override
public boolean checkLowDiskSpace() throws IOException {
final long freeSpace = fileStore.getUsableSpace();
return freeSpace < freeSpaceLimit;
}
@Override
public void syncDataFiles(final long segmentId, final byte[] lastMetadata) throws IOException {
filesLock.acquireReadLock();
try {
checkForClose();
doubleWriteLog.startCheckpoint();
try {
if (lastMetadata != null) {
writeAheadLog.log(new MetaDataRecord(lastMetadata));
}
for (final Integer intId : nameIdMap.values()) {
if (intId < 0) {
continue;
}
if (callFsync) {
final long fileId = composeFileId(id, intId);
final OClosableEntry<Long, OFile> entry = files.acquire(fileId);
try {
final OFile fileClassic = entry.get();
fileClassic.synch();
} finally {
files.release(entry);
}
}
}
writeAheadLog.flush();
writeAheadLog.cutAllSegmentsSmallerThan(segmentId);
doubleWriteLog.truncate();
} finally {
doubleWriteLog.endCheckpoint();
}
} catch (final InterruptedException e) {
throw OException.wrapException(new OStorageException("Fuzzy checkpoint was interrupted"), e);
} finally {
filesLock.releaseReadLock();
}
}
@Override
public void flushTillSegment(final long segmentId) {
final Future<Void> future = commitExecutor.submit(new FlushTillSegmentTask(segmentId));
try {
future.get();
} catch (final Exception e) {
throw ODatabaseException.wrapException(new OStorageException("Error during data flush"), e);
}
}
@Override
public boolean exists(final String fileName) {
filesLock.acquireReadLock();
try {
checkForClose();
final Integer intId = nameIdMap.get(fileName);
if (intId != null && intId >= 0) {
final OFile fileClassic = files.get(externalFileId(intId));
if (fileClassic == null) {
return false;
}
return fileClassic.exists();
}
return false;
} finally {
filesLock.releaseReadLock();
}
}
@Override
public boolean exists(long fileId) {
filesLock.acquireReadLock();
try {
checkForClose();
final int intId = extractFileId(fileId);
fileId = composeFileId(id, intId);
final OFile file = files.get(fileId);
if (file == null) {
return false;
}
return file.exists();
} finally {
filesLock.releaseReadLock();
}
}
@Override
public void restoreModeOn() throws IOException {
filesLock.acquireWriteLock();
try {
checkForClose();
doubleWriteLog.restoreModeOn();
} finally {
filesLock.releaseWriteLock();
}
}
@Override
public void restoreModeOff() {
filesLock.acquireWriteLock();
try {
checkForClose();
doubleWriteLog.restoreModeOff();
} finally {
filesLock.releaseWriteLock();
}
}
@Override
public void checkCacheOverflow() throws InterruptedException {
while (exclusiveWriteCacheSize.get() > exclusiveWriteCacheMaxSize) {
final CountDownLatch cacheBoundaryLatch = new CountDownLatch(1);
final CountDownLatch completionLatch = new CountDownLatch(1);
final ExclusiveFlushTask exclusiveFlushTask =
new ExclusiveFlushTask(cacheBoundaryLatch, completionLatch);
triggeredTasks.put(exclusiveFlushTask, completionLatch);
commitExecutor.submit(exclusiveFlushTask);
cacheBoundaryLatch.await();
}
}
@Override
public void store(final long fileId, final long pageIndex, final OCachePointer dataPointer) {
final int intId = extractFileId(fileId);
filesLock.acquireReadLock();
try {
checkForClose();
final PageKey pageKey = new PageKey(intId, pageIndex);
final Lock groupLock = lockManager.acquireExclusiveLock(pageKey);
try {
final OCachePointer pagePointer = writeCachePages.get(pageKey);
if (pagePointer == null) {
doPutInCache(dataPointer, pageKey);
} else {
assert pagePointer.equals(dataPointer);
}
} finally {
groupLock.unlock();
}
} finally {
filesLock.releaseReadLock();
}
}
private void doPutInCache(final OCachePointer dataPointer, final PageKey pageKey) {
writeCachePages.put(pageKey, dataPointer);
writeCacheSize.incrementAndGet();
dataPointer.setWritersListener(this);
dataPointer.incrementWritersReferrer();
}
@Override
public Map<String, Long> files() {
filesLock.acquireReadLock();
try {
checkForClose();
final Map<String, Long> result = new HashMap<>(1_000);
for (final Map.Entry<String, Integer> entry : nameIdMap.entrySet()) {
if (entry.getValue() > 0) {
result.put(entry.getKey(), composeFileId(id, entry.getValue()));
}
}
return result;
} finally {
filesLock.releaseReadLock();
}
}
@Override
public OCachePointer load(
final long fileId,
final long startPageIndex,
final OModifiableBoolean cacheHit,
final boolean verifyChecksums)
throws IOException {
final int intId = extractFileId(fileId);
filesLock.acquireReadLock();
try {
checkForClose();
final PageKey pageKey = new PageKey(intId, startPageIndex);
final Lock pageLock = lockManager.acquireSharedLock(pageKey);
// check if page already presented in write cache
final OCachePointer pagePointer = writeCachePages.get(pageKey);
// page is not cached load it from file
if (pagePointer == null) {
try {
// load requested page and preload requested amount of pages
final OCachePointer filePagePointer =
loadFileContent(intId, startPageIndex, verifyChecksums);
if (filePagePointer != null) {
filePagePointer.incrementReadersReferrer();
}
return filePagePointer;
} finally {
pageLock.unlock();
}
}
pagePointer.incrementReadersReferrer();
pageLock.unlock();
cacheHit.setValue(true);
return pagePointer;
} finally {
filesLock.releaseReadLock();
}
}
@Override
public int allocateNewPage(final long fileId) throws IOException {
filesLock.acquireReadLock();
try {
checkForClose();
final OClosableEntry<Long, OFile> entry = files.acquire(fileId);
try {
final OFile fileClassic = entry.get();
final long allocatedPosition = fileClassic.allocateSpace(pageSize);
final long allocationIndex = allocatedPosition / pageSize;
final int pageIndex = (int) allocationIndex;
if (pageIndex < 0) {
throw new IllegalStateException("Illegal page index value " + pageIndex);
}
return pageIndex;
} finally {
files.release(entry);
}
} catch (final InterruptedException e) {
throw OException.wrapException(
new OStorageException("Allocation of page was interrupted"), e);
} finally {
filesLock.releaseReadLock();
}
}
@Override
public void addOnlyWriters(final long fileId, final long pageIndex) {
exclusiveWriteCacheSize.incrementAndGet();
exclusiveWritePages.add(new PageKey(extractFileId(fileId), pageIndex));
}
@Override
public void removeOnlyWriters(final long fileId, final long pageIndex) {
exclusiveWriteCacheSize.decrementAndGet();
exclusiveWritePages.remove(new PageKey(extractFileId(fileId), pageIndex));
}
@Override
public void flush(final long fileId) {
final Future<Void> future =
commitExecutor.submit(new FileFlushTask(Collections.singleton(extractFileId(fileId))));
try {
future.get();
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
throw OException.wrapException(new OInterruptedException("File flush was interrupted"), e);
} catch (final Exception e) {
throw OException.wrapException(
new OWriteCacheException("File flush was abnormally terminated"), e);
}
}
@Override
public void flush() {
final Future<Void> future = commitExecutor.submit(new FileFlushTask(nameIdMap.values()));
try {
future.get();
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
throw OException.wrapException(new OInterruptedException("File flush was interrupted"), e);
} catch (final Exception e) {
throw OException.wrapException(
new OWriteCacheException("File flush was abnormally terminated"), e);
}
}
@Override
public long getFilledUpTo(long fileId) {
final int intId = extractFileId(fileId);
fileId = composeFileId(id, intId);
filesLock.acquireReadLock();
try {
checkForClose();
final OClosableEntry<Long, OFile> entry = files.acquire(fileId);
try {
return entry.get().getFileSize() / pageSize;
} finally {
files.release(entry);
}
} catch (final InterruptedException e) {
throw OException.wrapException(
new OStorageException("Calculation of file size was interrupted"), e);
} finally {
filesLock.releaseReadLock();
}
}
@Override
public long getExclusiveWriteCachePagesSize() {
return exclusiveWriteCacheSize.get();
}
@Override
public void deleteFile(final long fileId) throws IOException {
final int intId = extractFileId(fileId);
filesLock.acquireWriteLock();
try {
checkForClose();
final ORawPair<String, String> file;
final Future<ORawPair<String, String>> future =
commitExecutor.submit(new DeleteFileTask(fileId));
try {
file = future.get();
} catch (final InterruptedException e) {
throw OException.wrapException(
new OInterruptedException("File data removal was interrupted"), e);
} catch (final Exception e) {
throw OException.wrapException(
new OWriteCacheException("File data removal was abnormally terminated"), e);
}
if (file != null) {
writeNameIdEntry(new NameFileIdEntry(file.first, -intId, file.second), true);
}
} finally {
filesLock.releaseWriteLock();
}
}
@Override
public void truncateFile(long fileId) throws IOException {
final int intId = extractFileId(fileId);
fileId = composeFileId(id, intId);
filesLock.acquireWriteLock();
try {
checkForClose();
removeCachedPages(intId);
final OClosableEntry<Long, OFile> entry = files.acquire(fileId);
try {
entry.get().shrink(0);
} finally {
files.release(entry);
}
} catch (final InterruptedException e) {
throw OException.wrapException(new OStorageException("File truncation was interrupted"), e);
} finally {
filesLock.releaseWriteLock();
}
}
@Override
public boolean fileIdsAreEqual(final long firsId, final long secondId) {
final int firstIntId = extractFileId(firsId);
final int secondIntId = extractFileId(secondId);
return firstIntId == secondIntId;
}
@Override
public void renameFile(long fileId, final String newFileName) throws IOException {
final int intId = extractFileId(fileId);
fileId = composeFileId(id, intId);
filesLock.acquireWriteLock();
try {
checkForClose();
final OClosableEntry<Long, OFile> entry = files.acquire(fileId);
if (entry == null) {
return;
}
final String oldOsFileName;
final String newOsFileName = createInternalFileName(newFileName, intId);
try {
final OFile file = entry.get();
oldOsFileName = file.getName();
final Path newFile = storagePath.resolve(newOsFileName);
file.renameTo(newFile);
} finally {
files.release(entry);
}
final String oldFileName = idNameMap.get(intId);
nameIdMap.remove(oldFileName);
nameIdMap.put(newFileName, intId);
idNameMap.put(intId, newFileName);
writeNameIdEntry(new NameFileIdEntry(oldFileName, -1, oldOsFileName), false);
writeNameIdEntry(new NameFileIdEntry(newFileName, intId, newOsFileName), true);
} catch (final InterruptedException e) {
throw OException.wrapException(new OStorageException("Rename of file was interrupted"), e);
} finally {
filesLock.releaseWriteLock();
}
}
@Override
public void replaceFileId(final long fileId, final long newFileId) throws IOException {
filesLock.acquireWriteLock();
try {
checkForClose();
final OFile file = files.remove(fileId);
final OFile newFile = files.remove(newFileId);
final int intFileId = extractFileId(fileId);
final int newIntFileId = extractFileId(newFileId);
final String fileName = idNameMap.get(intFileId);
final String newFileName = idNameMap.remove(newIntFileId);
if (!file.isOpen()) {
file.open();
}
if (!newFile.isOpen()) {
newFile.open();
}
// invalidate old entries
writeNameIdEntry(new NameFileIdEntry(fileName, 0, ""), false);
writeNameIdEntry(new NameFileIdEntry(newFileName, 0, ""), false);
// add new one
writeNameIdEntry(new NameFileIdEntry(newFileName, intFileId, file.getName()), true);
file.delete();
files.add(fileId, newFile);
idNameMap.put(intFileId, newFileName);
nameIdMap.remove(fileName);
nameIdMap.put(newFileName, intFileId);
} catch (final InterruptedException e) {
throw OException.wrapException(new OStorageException("Replace of file was interrupted"), e);
} finally {
filesLock.releaseWriteLock();
}
}
private void stopFlush() {
stopFlush = true;
for (final CountDownLatch completionLatch : triggeredTasks.values()) {
try {
if (!completionLatch.await(shutdownTimeout, TimeUnit.MINUTES)) {
throw new OWriteCacheException("Can not shutdown data flush for storage " + storageName);
}
} catch (final InterruptedException e) {
throw OException.wrapException(
new OWriteCacheException(
"Flush of the data for storage " + storageName + " has been interrupted"),
e);
}
}
if (flushFuture != null) {
try {
flushFuture.get(shutdownTimeout, TimeUnit.MINUTES);
} catch (final InterruptedException | CancellationException e) {
// ignore
} catch (final ExecutionException e) {
throw OException.wrapException(
new OWriteCacheException("Error in execution of data flush for storage " + storageName),
e);
} catch (final TimeoutException e) {
throw OException.wrapException(
new OWriteCacheException("Can not shutdown data flush for storage " + storageName), e);
}
}
}
@Override
public long[] close() throws IOException {
flush();
stopFlush();
filesLock.acquireWriteLock();
try {
if (closed) {
return new long[0];
}
closed = true;
final Collection<Integer> fileIds = nameIdMap.values();
final List<Long> closedIds = new ArrayList<>(1_000);
final Map<Integer, String> idFileNameMap = new HashMap<>(1_000);
for (final Integer intId : fileIds) {
if (intId >= 0) {
final long extId = composeFileId(id, intId);
final OFile fileClassic = files.remove(extId);
idFileNameMap.put(intId, fileClassic.getName());
fileClassic.close();
closedIds.add(extId);
}
}
final Path nameIdMapBackupPath = storagePath.resolve(NAME_ID_MAP_V2_BACKUP);
try (final FileChannel nameIdMapHolder =
FileChannel.open(
nameIdMapBackupPath,
StandardOpenOption.CREATE,
StandardOpenOption.READ,
StandardOpenOption.WRITE)) {
nameIdMapHolder.truncate(0);
for (final Map.Entry<String, Integer> entry : nameIdMap.entrySet()) {
final String fileName;
if (entry.getValue() >= 0) {
fileName = idFileNameMap.get(entry.getValue());
} else {
fileName = entry.getKey();
}
writeNameIdEntry(
nameIdMapHolder,
new NameFileIdEntry(entry.getKey(), entry.getValue(), fileName),
false);
}
nameIdMapHolder.force(true);
}
try {
Files.move(
nameIdMapBackupPath,
nameIdMapHolderPath,
StandardCopyOption.REPLACE_EXISTING,
StandardCopyOption.ATOMIC_MOVE);
} catch (AtomicMoveNotSupportedException e) {
Files.move(nameIdMapBackupPath, nameIdMapHolderPath, StandardCopyOption.REPLACE_EXISTING);
}
doubleWriteLog.close();
nameIdMap.clear();
idNameMap.clear();
final long[] ids = new long[closedIds.size()];
int n = 0;
for (final long id : closedIds) {
ids[n] = id;
n++;
}
return ids;
} finally {
filesLock.releaseWriteLock();
}
}
private void checkForClose() {
if (closed) {
throw new OStorageException("Write cache is closed and can not be used");
}
}
@Override
public void close(long fileId, final boolean flush) {
final int intId = extractFileId(fileId);
fileId = composeFileId(id, intId);
filesLock.acquireWriteLock();
try {
checkForClose();
if (flush) {
flush(intId);
} else {
removeCachedPages(intId);
}
if (!files.close(fileId)) {
throw new OStorageException(
"Can not close file with id " + internalFileId(fileId) + " because it is still in use");
}
} finally {
filesLock.releaseWriteLock();
}
}
@Override
public String restoreFileById(final long fileId) throws IOException {
final int intId = extractFileId(fileId);
filesLock.acquireWriteLock();
try {
checkForClose();
for (final Map.Entry<String, Integer> entry : nameIdMap.entrySet()) {
if (entry.getValue() == -intId) {
addFile(entry.getKey(), fileId);
return entry.getKey();
}
}
} finally {
filesLock.releaseWriteLock();
}
return null;
}
@Override
public OPageDataVerificationError[] checkStoredPages(
final OCommandOutputListener commandOutputListener) {
final int notificationTimeOut = 5000;
final List<OPageDataVerificationError> errors = new ArrayList<>(0);
filesLock.acquireWriteLock();
try {
checkForClose();
for (final Integer intId : nameIdMap.values()) {
if (intId < 0) {
continue;
}
checkFileStoredPages(commandOutputListener, notificationTimeOut, errors, intId);
}
return errors.toArray(new OPageDataVerificationError[0]);
} catch (final InterruptedException e) {
throw OException.wrapException(new OStorageException("Thread was interrupted"), e);
} finally {
filesLock.releaseWriteLock();
}
}
private void checkFileStoredPages(
final OCommandOutputListener commandOutputListener,
@SuppressWarnings("SameParameterValue") final int notificationTimeOut,
final List<OPageDataVerificationError> errors,
final Integer intId)
throws InterruptedException {
boolean fileIsCorrect;
final long externalId = composeFileId(id, intId);
final OClosableEntry<Long, OFile> entry = files.acquire(externalId);
final OFile fileClassic = entry.get();
final String fileName = idNameMap.get(intId);
try {
if (commandOutputListener != null) {
commandOutputListener.onMessage("Flashing file " + fileName + "... ");
}
flush(intId);
if (commandOutputListener != null) {
commandOutputListener.onMessage(
"Start verification of content of " + fileName + "file ...\n");
}
long time = System.currentTimeMillis();
final long filledUpTo = fileClassic.getFileSize();
fileIsCorrect = true;
for (long pos = 0; pos < filledUpTo; pos += pageSize) {
boolean checkSumIncorrect = false;
boolean magicNumberIncorrect = false;
final byte[] data = new byte[pageSize];
final OPointer pointer = bufferPool.acquireDirect(true, Intention.CHECK_FILE_STORAGE);
try {
final ByteBuffer byteBuffer = pointer.getNativeByteBuffer();
fileClassic.read(pos, byteBuffer, true);
byteBuffer.rewind();
byteBuffer.get(data);
} finally {
bufferPool.release(pointer);
}
final long magicNumber =
OLongSerializer.INSTANCE.deserializeNative(data, MAGIC_NUMBER_OFFSET);
if (magicNumber != MAGIC_NUMBER_WITH_CHECKSUM
&& magicNumber != MAGIC_NUMBER_WITHOUT_CHECKSUM
&& magicNumber != MAGIC_NUMBER_WITH_CHECKSUM_ENCRYPTED
&& magicNumber != MAGIC_NUMBER_WITHOUT_CHECKSUM_ENCRYPTED) {
magicNumberIncorrect = true;
if (commandOutputListener != null) {
commandOutputListener.onMessage(
"Error: Magic number for page "
+ (pos / pageSize)
+ " in file '"
+ fileName
+ "' does not match!\n");
}
fileIsCorrect = false;
}
if (magicNumber != MAGIC_NUMBER_WITHOUT_CHECKSUM) {
final int storedCRC32 =
OIntegerSerializer.INSTANCE.deserializeNative(data, CHECKSUM_OFFSET);
final CRC32 crc32 = new CRC32();
crc32.update(
data, PAGE_OFFSET_TO_CHECKSUM_FROM, data.length - PAGE_OFFSET_TO_CHECKSUM_FROM);
final int calculatedCRC32 = (int) crc32.getValue();
if (storedCRC32 != calculatedCRC32) {
checkSumIncorrect = true;
if (commandOutputListener != null) {
commandOutputListener.onMessage(
"Error: Checksum for page "
+ (pos / pageSize)
+ " in file '"
+ fileName
+ "' is incorrect!\n");
}
fileIsCorrect = false;
}
}
if (magicNumberIncorrect || checkSumIncorrect) {
errors.add(
new OPageDataVerificationError(
magicNumberIncorrect, checkSumIncorrect, pos / pageSize, fileName));
}
if (commandOutputListener != null
&& System.currentTimeMillis() - time > notificationTimeOut) {
time = notificationTimeOut;
commandOutputListener.onMessage((pos / pageSize) + " pages were processed...\n");
}
}
} catch (final IOException ioe) {
if (commandOutputListener != null) {
commandOutputListener.onMessage(
"Error: Error during processing of file '"
+ fileName
+ "'. "
+ ioe.getMessage()
+ "\n");
}
fileIsCorrect = false;
} finally {
files.release(entry);
}
if (!fileIsCorrect) {
if (commandOutputListener != null) {
commandOutputListener.onMessage(
"Verification of file '" + fileName + "' is finished with errors.\n");
}
} else {
if (commandOutputListener != null) {
commandOutputListener.onMessage(
"Verification of file '" + fileName + "' is successfully finished.\n");
}
}
}
@Override
public long[] delete() throws IOException {
final List<Long> result = new ArrayList<>(1_024);
filesLock.acquireWriteLock();
try {
checkForClose();
for (final int internalFileId : nameIdMap.values()) {
if (internalFileId < 0) {
continue;
}
final long externalId = composeFileId(id, internalFileId);
final ORawPair<String, String> file;
final Future<ORawPair<String, String>> future =
commitExecutor.submit(new DeleteFileTask(externalId));
try {
file = future.get();
} catch (final InterruptedException e) {
throw OException.wrapException(
new OInterruptedException("File data removal was interrupted"), e);
} catch (final Exception e) {
throw OException.wrapException(
new OWriteCacheException("File data removal was abnormally terminated"), e);
}
if (file != null) {
result.add(externalId);
}
}
if (nameIdMapHolderPath != null) {
if (Files.exists(nameIdMapHolderPath)) {
Files.delete(nameIdMapHolderPath);
}
nameIdMapHolderPath = null;
}
} finally {
filesLock.releaseWriteLock();
}
stopFlush();
final long[] fIds = new long[result.size()];
int n = 0;
for (final Long fid : result) {
fIds[n] = fid;
n++;
}
doubleWriteLog.close();
return fIds;
}
@Override
public String fileNameById(final long fileId) {
final int intId = extractFileId(fileId);
return idNameMap.get(intId);
}
@Override
public String nativeFileNameById(final long fileId) {
final OFile fileClassic = files.get(fileId);
if (fileClassic != null) {
return fileClassic.getName();
}
return null;
}
@Override
public int getId() {
return id;
}
private static void openFile(final OFile fileClassic) {
if (fileClassic.exists()) {
if (!fileClassic.isOpen()) {
fileClassic.open();
}
} else {
throw new OStorageException("File " + fileClassic + " does not exist.");
}
}
private static void createFile(final OFile fileClassic, final boolean callFsync)
throws IOException {
if (!fileClassic.exists()) {
fileClassic.create();
} else {
if (!fileClassic.isOpen()) {
fileClassic.open();
}
fileClassic.shrink(0);
}
if (callFsync) {
fileClassic.synch();
}
}
private void initNameIdMapping() throws IOException, InterruptedException {
if (!Files.exists(storagePath)) {
Files.createDirectories(storagePath);
}
final Path nameIdMapHolderV1 = storagePath.resolve(NAME_ID_MAP_V1);
final Path nameIdMapHolderV2 = storagePath.resolve(NAME_ID_MAP_V2);
final Path nameIdMapHolderV3 = storagePath.resolve(NAME_ID_MAP_V3);
if (Files.exists(nameIdMapHolderV1)) {
if (Files.exists(nameIdMapHolderV2)) {
Files.delete(nameIdMapHolderV2);
}
if (Files.exists(nameIdMapHolderV3)) {
Files.delete(nameIdMapHolderV3);
}
try (final FileChannel nameIdMapHolder =
FileChannel.open(nameIdMapHolderV1, StandardOpenOption.WRITE, StandardOpenOption.READ)) {
readNameIdMapV1(nameIdMapHolder);
}
Files.delete(nameIdMapHolderV1);
} else if (Files.exists(nameIdMapHolderV2)) {
if (Files.exists(nameIdMapHolderV3)) {
Files.delete(nameIdMapHolderV3);
}
try (final FileChannel nameIdMapHolder =
FileChannel.open(nameIdMapHolderV2, StandardOpenOption.WRITE, StandardOpenOption.READ)) {
readNameIdMapV2(nameIdMapHolder);
}
Files.delete(nameIdMapHolderV2);
}
nameIdMapHolderPath = nameIdMapHolderV3;
if (Files.exists(nameIdMapHolderPath)) {
try (final FileChannel nameIdMapHolder =
FileChannel.open(
nameIdMapHolderPath, StandardOpenOption.WRITE, StandardOpenOption.READ)) {
readNameIdMapV3(nameIdMapHolder);
}
} else {
storedNameIdMapToV3();
}
}
private void storedNameIdMapToV3() throws IOException {
final Path nameIdMapHolderFileV3T = storagePath.resolve(NAME_ID_MAP_V3_T);
if (Files.exists(nameIdMapHolderFileV3T)) {
Files.delete(nameIdMapHolderFileV3T);
}
final FileChannel v3NameIdMapHolder =
FileChannel.open(
nameIdMapHolderFileV3T,
StandardOpenOption.CREATE,
StandardOpenOption.WRITE,
StandardOpenOption.READ);
for (final Map.Entry<String, Integer> nameIdEntry : nameIdMap.entrySet()) {
if (nameIdEntry.getValue() >= 0) {
final OFile fileClassic = files.get(externalFileId(nameIdEntry.getValue()));
final String fileSystemName = fileClassic.getName();
final NameFileIdEntry nameFileIdEntry =
new NameFileIdEntry(nameIdEntry.getKey(), nameIdEntry.getValue(), fileSystemName);
writeNameIdEntry(v3NameIdMapHolder, nameFileIdEntry, false);
} else {
final NameFileIdEntry nameFileIdEntry =
new NameFileIdEntry(nameIdEntry.getKey(), nameIdEntry.getValue(), "");
writeNameIdEntry(v3NameIdMapHolder, nameFileIdEntry, false);
}
}
v3NameIdMapHolder.force(true);
v3NameIdMapHolder.close();
try {
Files.move(
nameIdMapHolderFileV3T,
storagePath.resolve(NAME_ID_MAP_V3),
StandardCopyOption.ATOMIC_MOVE);
} catch (AtomicMoveNotSupportedException e) {
Files.move(nameIdMapHolderFileV3T, storagePath.resolve(NAME_ID_MAP_V3));
}
}
private OFile createFileInstance(final String fileName, final int fileId) {
final String internalFileName = createInternalFileName(fileName, fileId);
return new AsyncFile(storagePath.resolve(internalFileName), pageSize);
}
private static String createInternalFileName(final String fileName, final int fileId) {
final int extSeparator = fileName.lastIndexOf('.');
String prefix;
if (extSeparator < 0) {
prefix = fileName;
} else if (extSeparator == 0) {
prefix = "";
} else {
prefix = fileName.substring(0, extSeparator);
}
final String suffix;
if (extSeparator < 0 || extSeparator == fileName.length() - 1) {
suffix = "";
} else {
suffix = fileName.substring(extSeparator + 1);
}
prefix = prefix + "_" + fileId;
if (extSeparator >= 0) {
return prefix + "." + suffix;
}
return prefix;
}
/**
* Read information about files are registered inside of write cache/storage File consist of rows
* of variable length which contains following entries:
*
* <ol>
* <li>XX_HASH code of the content of the row excluding first two entries.
* <li>Length of the content of the row excluding of two entries above.
* <li>Internal file id, may be positive or negative depends on whether file is removed or not
* <li>Name of file inside of write cache, this name is case sensitive
* <li>Name of file which is used inside file system it can be different from name of file used
* inside write cache
* </ol>
*/
private void readNameIdMapV3(FileChannel nameIdMapHolder)
throws IOException, InterruptedException {
nameIdMap.clear();
long localFileCounter = -1;
nameIdMapHolder.position(0);
NameFileIdEntry nameFileIdEntry;
final Map<Integer, String> idFileNameMap = new HashMap<>(1_000);
while ((nameFileIdEntry = readNextNameIdEntryV3(nameIdMapHolder)) != null) {
final long absFileId = Math.abs(nameFileIdEntry.fileId);
if (localFileCounter < absFileId) {
localFileCounter = absFileId;
}
if (absFileId != 0) {
nameIdMap.put(nameFileIdEntry.name, nameFileIdEntry.fileId);
idNameMap.put(nameFileIdEntry.fileId, nameFileIdEntry.name);
idFileNameMap.put(nameFileIdEntry.fileId, nameFileIdEntry.fileSystemName);
} else {
nameIdMap.remove(nameFileIdEntry.name);
idNameMap.remove(nameFileIdEntry.fileId);
idFileNameMap.remove(nameFileIdEntry.fileId);
}
}
for (final Map.Entry<String, Integer> nameIdEntry : nameIdMap.entrySet()) {
final int fileId = nameIdEntry.getValue();
if (fileId >= 0) {
final long externalId = composeFileId(id, nameIdEntry.getValue());
if (files.get(externalId) == null) {
final Path path = storagePath.resolve(idFileNameMap.get((nameIdEntry.getValue())));
final AsyncFile file = new AsyncFile(path, pageSize);
if (file.exists()) {
file.open();
files.add(externalId, file);
} else {
idNameMap.remove(fileId);
nameIdMap.put(nameIdEntry.getKey(), -fileId);
idNameMap.put(-fileId, nameIdEntry.getKey());
}
}
}
}
}
/**
* Read information about files are registered inside of write cache/storage File consist of rows
* of variable length which contains following entries:
*
* <ol>
* <li>Internal file id, may be positive or negative depends on whether file is removed or not
* <li>Name of file inside of write cache, this name is case sensitive
* <li>Name of file which is used inside file system it can be different from name of file used
* inside write cache
* </ol>
*/
private void readNameIdMapV2(FileChannel nameIdMapHolder)
throws IOException, InterruptedException {
nameIdMap.clear();
long localFileCounter = -1;
nameIdMapHolder.position(0);
NameFileIdEntry nameFileIdEntry;
final Map<Integer, String> idFileNameMap = new HashMap<>(1_000);
while ((nameFileIdEntry = readNextNameIdEntryV2(nameIdMapHolder)) != null) {
final long absFileId = Math.abs(nameFileIdEntry.fileId);
if (localFileCounter < absFileId) {
localFileCounter = absFileId;
}
if (absFileId != 0) {
nameIdMap.put(nameFileIdEntry.name, nameFileIdEntry.fileId);
idNameMap.put(nameFileIdEntry.fileId, nameFileIdEntry.name);
idFileNameMap.put(nameFileIdEntry.fileId, nameFileIdEntry.fileSystemName);
} else {
nameIdMap.remove(nameFileIdEntry.name);
idNameMap.remove(nameFileIdEntry.fileId);
idFileNameMap.remove(nameFileIdEntry.fileId);
}
}
for (final Map.Entry<String, Integer> nameIdEntry : nameIdMap.entrySet()) {
final int fileId = nameIdEntry.getValue();
if (fileId > 0) {
final long externalId = composeFileId(id, nameIdEntry.getValue());
if (files.get(externalId) == null) {
final Path path = storagePath.resolve(idFileNameMap.get((nameIdEntry.getValue())));
final AsyncFile file = new AsyncFile(path, pageSize);
if (file.exists()) {
file.open();
files.add(externalId, file);
} else {
idNameMap.remove(fileId);
nameIdMap.put(nameIdEntry.getKey(), -fileId);
idNameMap.put(-fileId, nameIdEntry.getKey());
}
}
}
}
}
private void readNameIdMapV1(final FileChannel nameIdMapHolder)
throws IOException, InterruptedException {
// older versions of ODB incorrectly logged file deletions
// some deleted files have the same id
// because we reuse ids of removed files when we re-create them
// we need to fix this situation
final Map<Integer, Set<String>> filesWithNegativeIds = new HashMap<>(1_000);
nameIdMap.clear();
long localFileCounter = -1;
nameIdMapHolder.position(0);
NameFileIdEntry nameFileIdEntry;
while ((nameFileIdEntry = readNextNameIdEntryV1(nameIdMapHolder)) != null) {
final long absFileId = Math.abs(nameFileIdEntry.fileId);
if (localFileCounter < absFileId) {
localFileCounter = absFileId;
}
final Integer existingId = nameIdMap.get(nameFileIdEntry.name);
if (existingId != null && existingId < 0) {
final Set<String> files = filesWithNegativeIds.get(existingId);
if (files != null) {
files.remove(nameFileIdEntry.name);
if (files.isEmpty()) {
filesWithNegativeIds.remove(existingId);
}
}
}
if (nameFileIdEntry.fileId < 0) {
Set<String> files = filesWithNegativeIds.get(nameFileIdEntry.fileId);
if (files == null) {
files = new HashSet<>(8);
files.add(nameFileIdEntry.name);
filesWithNegativeIds.put(nameFileIdEntry.fileId, files);
} else {
files.add(nameFileIdEntry.name);
}
}
nameIdMap.put(nameFileIdEntry.name, nameFileIdEntry.fileId);
idNameMap.put(nameFileIdEntry.fileId, nameFileIdEntry.name);
}
for (final Map.Entry<String, Integer> nameIdEntry : nameIdMap.entrySet()) {
if (nameIdEntry.getValue() >= 0) {
final long externalId = composeFileId(id, nameIdEntry.getValue());
if (files.get(externalId) == null) {
final OFile fileClassic =
new AsyncFile(storagePath.resolve(nameIdEntry.getKey()), pageSize);
if (fileClassic.exists()) {
fileClassic.open();
files.add(externalId, fileClassic);
} else {
final Integer fileId = nameIdMap.get(nameIdEntry.getKey());
if (fileId != null && fileId > 0) {
nameIdMap.put(nameIdEntry.getKey(), -fileId);
idNameMap.remove(fileId);
idNameMap.put(-fileId, nameIdEntry.getKey());
}
}
}
}
}
final Set<String> fixedFiles = new HashSet<>(8);
for (final Map.Entry<Integer, Set<String>> entry : filesWithNegativeIds.entrySet()) {
final Set<String> files = entry.getValue();
if (files.size() > 1) {
idNameMap.remove(entry.getKey());
for (final String fileName : files) {
int fileId;
while (true) {
final int nextId = fileIdGen.nextInt(Integer.MAX_VALUE - 1) + 1;
if (!idNameMap.containsKey(nextId) && !idNameMap.containsKey(-nextId)) {
fileId = nextId;
break;
}
}
nameIdMap.put(fileName, -fileId);
idNameMap.put(-fileId, fileName);
fixedFiles.add(fileName);
}
}
}
if (!fixedFiles.isEmpty()) {
OLogManager.instance()
.warn(
this,
"Removed files "
+ fixedFiles
+ " had duplicated ids. Problem is fixed automatically.");
}
}
private NameFileIdEntry readNextNameIdEntryV1(FileChannel nameIdMapHolder) throws IOException {
try {
ByteBuffer buffer = ByteBuffer.allocate(OIntegerSerializer.INT_SIZE);
OIOUtils.readByteBuffer(buffer, nameIdMapHolder);
buffer.rewind();
final int nameSize = buffer.getInt();
buffer = ByteBuffer.allocate(nameSize + OLongSerializer.LONG_SIZE);
OIOUtils.readByteBuffer(buffer, nameIdMapHolder);
buffer.rewind();
final String name = stringSerializer.deserializeFromByteBufferObject(buffer);
final int fileId = (int) buffer.getLong();
return new NameFileIdEntry(name, fileId);
} catch (final EOFException ignore) {
return null;
}
}
private NameFileIdEntry readNextNameIdEntryV2(FileChannel nameIdMapHolder) throws IOException {
try {
ByteBuffer buffer = ByteBuffer.allocate(2 * OIntegerSerializer.INT_SIZE);
OIOUtils.readByteBuffer(buffer, nameIdMapHolder);
buffer.rewind();
final int fileId = buffer.getInt();
final int nameSize = buffer.getInt();
buffer = ByteBuffer.allocate(nameSize);
OIOUtils.readByteBuffer(buffer, nameIdMapHolder);
buffer.rewind();
final String name = stringSerializer.deserializeFromByteBufferObject(buffer);
buffer = ByteBuffer.allocate(OIntegerSerializer.INT_SIZE);
OIOUtils.readByteBuffer(buffer, nameIdMapHolder);
buffer.rewind();
final int fileNameSize = buffer.getInt();
buffer = ByteBuffer.allocate(fileNameSize);
OIOUtils.readByteBuffer(buffer, nameIdMapHolder);
buffer.rewind();
final String fileName = stringSerializer.deserializeFromByteBufferObject(buffer);
return new NameFileIdEntry(name, fileId, fileName);
} catch (final EOFException ignore) {
return null;
}
}
private NameFileIdEntry readNextNameIdEntryV3(FileChannel nameIdMapHolder) throws IOException {
try {
final int xxHashLen = 8;
final int recordSizeLen = 4;
ByteBuffer buffer = ByteBuffer.allocate(xxHashLen + recordSizeLen);
OIOUtils.readByteBuffer(buffer, nameIdMapHolder);
buffer.rewind();
final long storedXxHash = buffer.getLong();
final int recordLen = buffer.getInt();
if (recordLen > MAX_FILE_RECORD_LEN) {
OLogManager.instance()
.errorNoDb(
this,
"Maximum record length in file registry can not exceed %d bytes. "
+ "But actual record length %d. Storage name : %s",
null,
MAX_FILE_RECORD_LEN,
storageName,
recordLen);
return null;
}
buffer = ByteBuffer.allocate(recordLen);
OIOUtils.readByteBuffer(buffer, nameIdMapHolder);
buffer.rewind();
final long xxHash = XX_HASH_64.hash(buffer, 0, recordLen, XX_HASH_SEED);
if (xxHash != storedXxHash) {
OLogManager.instance()
.errorNoDb(
this, "Hash of the file registry is broken. Storage name : %s", null, storageName);
return null;
}
final int fileId = buffer.getInt();
final String name = stringSerializer.deserializeFromByteBufferObject(buffer);
final String fileName = stringSerializer.deserializeFromByteBufferObject(buffer);
return new NameFileIdEntry(name, fileId, fileName);
} catch (final EOFException ignore) {
return null;
}
}
private void writeNameIdEntry(final NameFileIdEntry nameFileIdEntry, final boolean sync)
throws IOException {
try (final FileChannel nameIdMapHolder =
FileChannel.open(nameIdMapHolderPath, StandardOpenOption.READ, StandardOpenOption.WRITE)) {
writeNameIdEntry(nameIdMapHolder, nameFileIdEntry, sync);
}
}
private void writeNameIdEntry(
final FileChannel nameIdMapHolder, final NameFileIdEntry nameFileIdEntry, final boolean sync)
throws IOException {
final int xxHashSize = 8;
final int recordLenSize = 4;
final int nameSize = stringSerializer.getObjectSize(nameFileIdEntry.name);
final int fileNameSize = stringSerializer.getObjectSize(nameFileIdEntry.fileSystemName);
// file id size + file name + file system name + xx_hash size + record_size size
final ByteBuffer serializedRecord =
ByteBuffer.allocate(
OIntegerSerializer.INT_SIZE + nameSize + fileNameSize + xxHashSize + recordLenSize);
serializedRecord.position(xxHashSize + recordLenSize);
// serialize file id
OIntegerSerializer.INSTANCE.serializeInByteBufferObject(
nameFileIdEntry.fileId, serializedRecord);
// serialize file name
stringSerializer.serializeInByteBufferObject(nameFileIdEntry.name, serializedRecord);
// serialize file system name
stringSerializer.serializeInByteBufferObject(nameFileIdEntry.fileSystemName, serializedRecord);
final int recordLen = serializedRecord.position() - xxHashSize - recordLenSize;
if (recordLen > MAX_FILE_RECORD_LEN) {
throw new OStorageException(
"Maximum record length in file registry can not exceed "
+ MAX_FILE_RECORD_LEN
+ " bytes. But actual record length "
+ recordLen);
}
serializedRecord.putInt(xxHashSize, recordLen);
final long xxHash =
XX_HASH_64.hash(serializedRecord, xxHashSize + recordLenSize, recordLen, XX_HASH_SEED);
serializedRecord.putLong(0, xxHash);
serializedRecord.position(0);
OIOUtils.writeByteBuffer(serializedRecord, nameIdMapHolder, nameIdMapHolder.size());
nameIdMapHolder.write(serializedRecord);
if (sync) {
nameIdMapHolder.force(true);
}
}
private void removeCachedPages(final int fileId) {
final Future<Void> future = commitExecutor.submit(new RemoveFilePagesTask(fileId));
try {
future.get();
} catch (final InterruptedException e) {
throw OException.wrapException(
new OInterruptedException("File data removal was interrupted"), e);
} catch (final Exception e) {
throw OException.wrapException(
new OWriteCacheException("File data removal was abnormally terminated"), e);
}
}
private OCachePointer loadFileContent(
final int internalFileId, final long pageIndex, final boolean verifyChecksums)
throws IOException {
final long fileId = composeFileId(id, internalFileId);
try {
final OClosableEntry<Long, OFile> entry = files.acquire(fileId);
try {
final OFile fileClassic = entry.get();
if (fileClassic == null) {
throw new IllegalArgumentException(
"File with id " + internalFileId + " not found in WOW Cache");
}
final long pagePosition = pageIndex * pageSize;
final long pageEndPosition = pagePosition + pageSize;
// if page is not stored in the file may be page is stored in double write log
if (fileClassic.getFileSize() >= pageEndPosition) {
OPointer pointer = bufferPool.acquireDirect(true, Intention.LOAD_PAGE_FROM_DISK);
ByteBuffer buffer = pointer.getNativeByteBuffer();
assert buffer.position() == 0;
assert buffer.order() == ByteOrder.nativeOrder();
fileClassic.read(pagePosition, buffer, false);
if (verifyChecksums
&& (checksumMode == OChecksumMode.StoreAndVerify
|| checksumMode == OChecksumMode.StoreAndThrow
|| checksumMode == OChecksumMode.StoreAndSwitchReadOnlyMode)) {
// if page is broken inside of data file we check double write log
if (!verifyMagicChecksumAndDecryptPage(buffer, internalFileId, pageIndex)) {
final OPointer doubleWritePointer =
doubleWriteLog.loadPage(internalFileId, (int) pageIndex, bufferPool);
if (doubleWritePointer == null) {
assertPageIsBroken(pageIndex, fileId, pointer);
} else {
bufferPool.release(pointer);
buffer = doubleWritePointer.getNativeByteBuffer();
assert buffer.position() == 0;
pointer = doubleWritePointer;
if (!verifyMagicChecksumAndDecryptPage(buffer, internalFileId, pageIndex)) {
assertPageIsBroken(pageIndex, fileId, pointer);
}
}
}
}
buffer.position(0);
return new OCachePointer(pointer, bufferPool, fileId, (int) pageIndex);
} else {
final OPointer pointer =
doubleWriteLog.loadPage(internalFileId, (int) pageIndex, bufferPool);
if (pointer != null) {
final ByteBuffer buffer = pointer.getNativeByteBuffer();
assert buffer.position() == 0;
if (verifyChecksums
&& (checksumMode == OChecksumMode.StoreAndVerify
|| checksumMode == OChecksumMode.StoreAndThrow
|| checksumMode == OChecksumMode.StoreAndSwitchReadOnlyMode)) {
if (!verifyMagicChecksumAndDecryptPage(buffer, internalFileId, pageIndex)) {
assertPageIsBroken(pageIndex, fileId, pointer);
}
}
}
return null;
}
} finally {
files.release(entry);
}
} catch (final InterruptedException e) {
throw OException.wrapException(new OStorageException("Data load was interrupted"), e);
}
}
private void assertPageIsBroken(long pageIndex, long fileId, OPointer pointer) {
final String message =
"Magic number verification failed for page `"
+ pageIndex
+ "` of `"
+ fileNameById(fileId)
+ "`.";
OLogManager.instance().error(this, "%s", null, message);
if (checksumMode == OChecksumMode.StoreAndThrow) {
bufferPool.release(pointer);
throw new OStorageException(message);
} else if (checksumMode == OChecksumMode.StoreAndSwitchReadOnlyMode) {
dumpStackTrace(message);
callPageIsBrokenListeners(fileNameById(fileId), pageIndex);
}
}
private void addMagicChecksumAndEncryption(
final int intId, final int pageIndex, final ByteBuffer buffer) {
assert buffer.order() == ByteOrder.nativeOrder();
if (checksumMode != OChecksumMode.Off) {
buffer.position(PAGE_OFFSET_TO_CHECKSUM_FROM);
final CRC32 crc32 = new CRC32();
crc32.update(buffer);
final int computedChecksum = (int) crc32.getValue();
buffer.position(CHECKSUM_OFFSET);
buffer.putInt(computedChecksum);
}
if (aesKey != null) {
long magicNumber = buffer.getLong(MAGIC_NUMBER_OFFSET);
long updateCounter = magicNumber >>> 8;
updateCounter++;
if (checksumMode == OChecksumMode.Off) {
magicNumber = (updateCounter << 8) | MAGIC_NUMBER_WITHOUT_CHECKSUM_ENCRYPTED;
} else {
magicNumber = (updateCounter << 8) | MAGIC_NUMBER_WITH_CHECKSUM_ENCRYPTED;
}
buffer.putLong(MAGIC_NUMBER_OFFSET, magicNumber);
doEncryptionDecryption(intId, pageIndex, Cipher.ENCRYPT_MODE, buffer, updateCounter);
} else {
buffer.putLong(
MAGIC_NUMBER_OFFSET,
checksumMode == OChecksumMode.Off
? MAGIC_NUMBER_WITHOUT_CHECKSUM
: MAGIC_NUMBER_WITH_CHECKSUM);
}
}
private void doEncryptionDecryption(
final int intId,
final int pageIndex,
final int mode,
final ByteBuffer buffer,
final long updateCounter) {
try {
final Cipher cipher = CIPHER.get();
final SecretKey aesKey = new SecretKeySpec(this.aesKey, ALGORITHM_NAME);
final byte[] updatedIv = new byte[iv.length];
for (int i = 0; i < OIntegerSerializer.INT_SIZE; i++) {
updatedIv[i] = (byte) (iv[i] ^ ((pageIndex >>> i) & 0xFF));
}
for (int i = 0; i < OIntegerSerializer.INT_SIZE; i++) {
updatedIv[i + OIntegerSerializer.INT_SIZE] =
(byte) (iv[i + OIntegerSerializer.INT_SIZE] ^ ((intId >>> i) & 0xFF));
}
for (int i = 0; i < OLongSerializer.LONG_SIZE - 1; i++) {
updatedIv[i + 2 * OIntegerSerializer.INT_SIZE] =
(byte) (iv[i + 2 * OIntegerSerializer.INT_SIZE] ^ ((updateCounter >>> i) & 0xFF));
}
updatedIv[updatedIv.length - 1] = iv[iv.length - 1];
cipher.init(mode, aesKey, new IvParameterSpec(updatedIv));
final ByteBuffer outBuffer =
ByteBuffer.allocate(buffer.capacity() - CHECKSUM_OFFSET).order(ByteOrder.nativeOrder());
buffer.position(CHECKSUM_OFFSET);
cipher.doFinal(buffer, outBuffer);
buffer.position(CHECKSUM_OFFSET);
outBuffer.position(0);
buffer.put(outBuffer);
} catch (InvalidKeyException e) {
throw OException.wrapException(new OInvalidStorageEncryptionKeyException(e.getMessage()), e);
} catch (InvalidAlgorithmParameterException e) {
throw new IllegalArgumentException("Invalid IV.", e);
} catch (IllegalBlockSizeException | BadPaddingException | ShortBufferException e) {
throw new IllegalStateException("Unexpected exception during CRT encryption.", e);
}
}
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
private boolean verifyMagicChecksumAndDecryptPage(
final ByteBuffer buffer, final int intId, final long pageIndex) {
assert buffer.order() == ByteOrder.nativeOrder();
buffer.position(MAGIC_NUMBER_OFFSET);
final long magicNumber = OLongSerializer.INSTANCE.deserializeFromByteBufferObject(buffer);
if ((aesKey == null && magicNumber != MAGIC_NUMBER_WITH_CHECKSUM)
|| (magicNumber != MAGIC_NUMBER_WITH_CHECKSUM
&& (magicNumber & 0xFF) != MAGIC_NUMBER_WITH_CHECKSUM_ENCRYPTED)) {
if ((aesKey == null && magicNumber != MAGIC_NUMBER_WITHOUT_CHECKSUM)
|| (magicNumber != MAGIC_NUMBER_WITHOUT_CHECKSUM
&& (magicNumber & 0xFF) != MAGIC_NUMBER_WITHOUT_CHECKSUM_ENCRYPTED)) {
return false;
}
if (aesKey != null && (magicNumber & 0xFF) == MAGIC_NUMBER_WITHOUT_CHECKSUM_ENCRYPTED) {
doEncryptionDecryption(
intId, (int) pageIndex, Cipher.DECRYPT_MODE, buffer, magicNumber >>> 8);
}
return true;
}
if (aesKey != null && (magicNumber & 0xFF) == MAGIC_NUMBER_WITH_CHECKSUM_ENCRYPTED) {
doEncryptionDecryption(
intId, (int) pageIndex, Cipher.DECRYPT_MODE, buffer, magicNumber >>> 8);
}
buffer.position(CHECKSUM_OFFSET);
final int storedChecksum = OIntegerSerializer.INSTANCE.deserializeFromByteBufferObject(buffer);
buffer.position(PAGE_OFFSET_TO_CHECKSUM_FROM);
final CRC32 crc32 = new CRC32();
crc32.update(buffer);
final int computedChecksum = (int) crc32.getValue();
return computedChecksum == storedChecksum;
}
private void dumpStackTrace(final String message) {
final StringWriter stringWriter = new StringWriter();
final PrintWriter printWriter = new PrintWriter(stringWriter);
printWriter.println(message);
final Exception exception = new Exception();
exception.printStackTrace(printWriter);
printWriter.flush();
OLogManager.instance().error(this, stringWriter.toString(), null);
}
private void fsyncFiles() throws InterruptedException, IOException {
for (int intFileId : idNameMap.keySet()) {
if (intFileId >= 0) {
final long extFileId = externalFileId(intFileId);
final OClosableEntry<Long, OFile> fileEntry = files.acquire(extFileId);
try {
final OFile fileClassic = fileEntry.get();
fileClassic.synch();
} finally {
files.release(fileEntry);
}
}
}
doubleWriteLog.truncate();
}
private void doRemoveCachePages(int internalFileId) {
final Iterator<Map.Entry<PageKey, OCachePointer>> entryIterator =
writeCachePages.entrySet().iterator();
while (entryIterator.hasNext()) {
final Map.Entry<PageKey, OCachePointer> entry = entryIterator.next();
final PageKey pageKey = entry.getKey();
if (pageKey.fileId == internalFileId) {
final OCachePointer pagePointer = entry.getValue();
final Lock groupLock = lockManager.acquireExclusiveLock(pageKey);
try {
pagePointer.acquireExclusiveLock();
try {
pagePointer.decrementWritersReferrer();
pagePointer.setWritersListener(null);
writeCacheSize.decrementAndGet();
removeFromDirtyPages(pageKey);
} finally {
pagePointer.releaseExclusiveLock();
}
entryIterator.remove();
} finally {
groupLock.unlock();
}
}
}
}
public void setChecksumMode(final OChecksumMode checksumMode) { // for testing purposes only
this.checksumMode = checksumMode;
}
private static final class NameFileIdEntry {
private final String name;
private final int fileId;
private final String fileSystemName;
private NameFileIdEntry(final String name, final int fileId) {
this.name = name;
this.fileId = fileId;
this.fileSystemName = name;
}
private NameFileIdEntry(final String name, final int fileId, final String fileSystemName) {
this.name = name;
this.fileId = fileId;
this.fileSystemName = fileSystemName;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final NameFileIdEntry that = (NameFileIdEntry) o;
if (fileId != that.fileId) {
return false;
}
if (!name.equals(that.name)) {
return false;
}
return fileSystemName.equals(that.fileSystemName);
}
@Override
public int hashCode() {
int result = name.hashCode();
result = 31 * result + fileId;
result = 31 * result + fileSystemName.hashCode();
return result;
}
}
private static final class PageKey implements Comparable<PageKey> {
private final int fileId;
private final long pageIndex;
private PageKey(final int fileId, final long pageIndex) {
this.fileId = fileId;
this.pageIndex = pageIndex;
}
@Override
public int compareTo(final PageKey other) {
if (fileId > other.fileId) {
return 1;
}
if (fileId < other.fileId) {
return -1;
}
return Long.compare(pageIndex, other.pageIndex);
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final PageKey pageKey = (PageKey) o;
if (fileId != pageKey.fileId) {
return false;
}
return pageIndex == pageKey.pageIndex;
}
@Override
public int hashCode() {
int result = fileId;
result = 31 * result + (int) (pageIndex ^ (pageIndex >>> 32));
return result;
}
@Override
public String toString() {
return "PageKey{" + "fileId=" + fileId + ", pageIndex=" + pageIndex + '}';
}
public PageKey previous() {
return pageIndex == -1 ? this : new PageKey(fileId, pageIndex - 1);
}
}
private final class FlushTillSegmentTask implements Callable<Void> {
private final long segmentId;
private FlushTillSegmentTask(final long segmentId) {
this.segmentId = segmentId;
}
@Override
public Void call() throws Exception {
if (flushError != null) {
OLogManager.instance()
.errorNoDb(
this,
"Can not flush data till provided segment because of issue during data write, %s",
null,
flushError.getMessage());
return null;
}
convertSharedDirtyPagesToLocal();
Map.Entry<Long, TreeSet<PageKey>> firstEntry = localDirtyPagesBySegment.firstEntry();
if (firstEntry == null) {
return null;
}
long minDirtySegment = firstEntry.getKey();
while (minDirtySegment < segmentId) {
flushExclusivePagesIfNeeded();
flushWriteCacheFromMinLSN(writeAheadLog.begin().getSegment(), segmentId, chunkSize);
firstEntry = localDirtyPagesBySegment.firstEntry();
if (firstEntry == null) {
return null;
}
minDirtySegment = firstEntry.getKey();
}
return null;
}
private void flushExclusivePagesIfNeeded() throws InterruptedException, IOException {
final long ewcSize = exclusiveWriteCacheSize.get();
assert ewcSize >= 0;
if (ewcSize >= 0.8 * exclusiveWriteCacheMaxSize) {
flushExclusiveWriteCache(null, ewcSize);
}
}
}
private final class ExclusiveFlushTask implements Runnable {
private final CountDownLatch cacheBoundaryLatch;
private final CountDownLatch completionLatch;
private ExclusiveFlushTask(
final CountDownLatch cacheBoundaryLatch, final CountDownLatch completionLatch) {
this.cacheBoundaryLatch = cacheBoundaryLatch;
this.completionLatch = completionLatch;
}
@Override
public void run() {
if (stopFlush) {
return;
}
try {
if (flushError != null) {
OLogManager.instance()
.errorNoDb(
this,
"Can not flush data because of issue during data write, %s",
null,
flushError.getMessage());
return;
}
if (writeCachePages.isEmpty()) {
return;
}
final long ewcSize = exclusiveWriteCacheSize.get();
assert ewcSize >= 0;
if (cacheBoundaryLatch != null && ewcSize <= exclusiveWriteCacheMaxSize) {
cacheBoundaryLatch.countDown();
}
if (ewcSize > exclusiveWriteCacheMaxSize) {
flushExclusiveWriteCache(cacheBoundaryLatch, chunkSize);
}
} catch (final Error | Exception t) {
OLogManager.instance().error(this, "Exception during data flush", t);
OWOWCache.this.fireBackgroundDataFlushExceptionEvent(t);
flushError = t;
} finally {
if (cacheBoundaryLatch != null) {
cacheBoundaryLatch.countDown();
}
if (completionLatch != null) {
completionLatch.countDown();
}
}
}
}
private final class PeriodicFlushTask implements Runnable {
@Override
public void run() {
if (stopFlush) {
return;
}
long flushInterval = pagesFlushInterval;
try {
if (flushError != null) {
OLogManager.instance()
.errorNoDb(
this,
"Can not flush data because of issue during data write, %s",
null,
flushError.getMessage());
return;
}
try {
if (writeCachePages.isEmpty()) {
return;
}
long ewcSize = exclusiveWriteCacheSize.get();
if (ewcSize >= 0) {
flushExclusiveWriteCache(null, Math.min(ewcSize, 4L * chunkSize));
if (exclusiveWriteCacheSize.get() > 0) {
flushInterval = 1;
}
}
final OLogSequenceNumber begin = writeAheadLog.begin();
final OLogSequenceNumber end = writeAheadLog.end();
final long segments = end.getSegment() - begin.getSegment() + 1;
if (segments > 1) {
convertSharedDirtyPagesToLocal();
Map.Entry<Long, TreeSet<PageKey>> firstSegment = localDirtyPagesBySegment.firstEntry();
if (firstSegment != null) {
final long firstSegmentIndex = firstSegment.getKey();
if (firstSegmentIndex < end.getSegment()) {
flushWriteCacheFromMinLSN(firstSegmentIndex, firstSegmentIndex + 1, chunkSize);
}
}
firstSegment = localDirtyPagesBySegment.firstEntry();
if (firstSegment != null && firstSegment.getKey() < end.getSegment()) {
flushInterval = 1;
}
}
} catch (final Error | Exception t) {
OLogManager.instance().error(this, "Exception during data flush", t);
OWOWCache.this.fireBackgroundDataFlushExceptionEvent(t);
flushError = t;
}
} finally {
if (flushInterval > 0 && !stopFlush) {
flushFuture = commitExecutor.schedule(this, flushInterval, TimeUnit.MILLISECONDS);
}
}
}
}
final class FindMinDirtySegment implements Callable<Long> {
@Override
public Long call() {
if (flushError != null) {
OLogManager.instance()
.errorNoDb(
this,
"Can not calculate minimum LSN because of issue during data write, %s",
null,
flushError.getMessage());
return null;
}
convertSharedDirtyPagesToLocal();
if (localDirtyPagesBySegment.isEmpty()) {
return null;
}
return localDirtyPagesBySegment.firstKey();
}
}
private void convertSharedDirtyPagesToLocal() {
for (final Map.Entry<PageKey, OLogSequenceNumber> entry : dirtyPages.entrySet()) {
final OLogSequenceNumber localLSN = localDirtyPages.get(entry.getKey());
if (localLSN == null || localLSN.compareTo(entry.getValue()) > 0) {
localDirtyPages.put(entry.getKey(), entry.getValue());
final long segment = entry.getValue().getSegment();
TreeSet<PageKey> pages = localDirtyPagesBySegment.get(segment);
if (pages == null) {
pages = new TreeSet<>();
pages.add(entry.getKey());
localDirtyPagesBySegment.put(segment, pages);
} else {
pages.add(entry.getKey());
}
}
}
for (final Map.Entry<PageKey, OLogSequenceNumber> entry : localDirtyPages.entrySet()) {
dirtyPages.remove(entry.getKey(), entry.getValue());
}
}
private void removeFromDirtyPages(final PageKey pageKey) {
dirtyPages.remove(pageKey);
final OLogSequenceNumber lsn = localDirtyPages.remove(pageKey);
if (lsn != null) {
final long segment = lsn.getSegment();
final TreeSet<PageKey> pages = localDirtyPagesBySegment.get(segment);
assert pages != null;
final boolean removed = pages.remove(pageKey);
if (pages.isEmpty()) {
localDirtyPagesBySegment.remove(segment);
}
assert removed;
}
}
private void flushWriteCacheFromMinLSN(
final long segStart, final long segEnd, final int pagesFlushLimit)
throws InterruptedException, IOException {
// first we try to find page which contains the oldest not flushed changes
// that is needed to allow to compact WAL as earlier as possible
convertSharedDirtyPagesToLocal();
int copiedPages = 0;
List<List<OQuarto<Long, ByteBuffer, OPointer, OCachePointer>>> chunks = new ArrayList<>(16);
ArrayList<OQuarto<Long, ByteBuffer, OPointer, OCachePointer>> chunk = new ArrayList<>(16);
long currentSegment = segStart;
int chunksSize = 0;
OLogSequenceNumber maxFullLogLSN = null;
flushCycle:
while (chunksSize < pagesFlushLimit) {
final TreeSet<PageKey> segmentPages = localDirtyPagesBySegment.get(currentSegment);
if (segmentPages == null) {
currentSegment++;
if (currentSegment >= segEnd) {
break;
}
continue;
}
final Iterator<PageKey> lsnPagesIterator = segmentPages.iterator();
final List<PageKey> pageKeysToFlush = new ArrayList<>(pagesFlushLimit);
while (lsnPagesIterator.hasNext() && pageKeysToFlush.size() < pagesFlushLimit - chunksSize) {
final PageKey pageKey = lsnPagesIterator.next();
pageKeysToFlush.add(pageKey);
}
long lastPageIndex = -1;
long lastFileId = -1;
for (final PageKey pageKey : pageKeysToFlush) {
if (lastFileId == -1) {
if (!chunk.isEmpty()) {
throw new IllegalStateException("Chunk is not empty !");
}
} else {
if (lastPageIndex == -1) {
throw new IllegalStateException("Last page index is -1");
}
if (lastFileId != pageKey.fileId || lastPageIndex != pageKey.pageIndex - 1) {
if (!chunk.isEmpty()) {
chunks.add(chunk);
chunksSize += chunk.size();
chunk = new ArrayList<>();
}
}
}
final OCachePointer pointer = writeCachePages.get(pageKey);
if (pointer == null) {
// we marked page as dirty but did not put it in cache yet
if (!chunk.isEmpty()) {
chunks.add(chunk);
}
break flushCycle;
}
if (pointer.tryAcquireSharedLock()) {
final long version;
final OLogSequenceNumber fullLogLSN;
final OPointer directPointer =
bufferPool.acquireDirect(false, Intention.COPY_PAGE_DURING_FLUSH);
final ByteBuffer copy = directPointer.getNativeByteBuffer();
assert copy.position() == 0;
try {
version = pointer.getVersion();
final ByteBuffer buffer = pointer.getBufferDuplicate();
fullLogLSN = pointer.getEndLSN();
assert buffer != null;
buffer.position(0);
copy.position(0);
copy.put(buffer);
removeFromDirtyPages(pageKey);
copiedPages++;
} finally {
pointer.releaseSharedLock();
}
if (fullLogLSN != null
&& (maxFullLogLSN == null || fullLogLSN.compareTo(maxFullLogLSN) > 0)) {
maxFullLogLSN = fullLogLSN;
}
copy.position(0);
chunk.add(new OQuarto<>(version, copy, directPointer, pointer));
if (chunksSize + chunk.size() >= pagesFlushLimit) {
if (!chunk.isEmpty()) {
chunks.add(chunk);
chunksSize += chunk.size();
chunk = new ArrayList<>();
}
lastPageIndex = -1;
lastFileId = -1;
} else {
lastPageIndex = pageKey.pageIndex;
lastFileId = pageKey.fileId;
}
} else {
if (!chunk.isEmpty()) {
chunks.add(chunk);
chunksSize += chunk.size();
chunk = new ArrayList<>();
}
maxFullLogLSN = null;
lastPageIndex = -1;
lastFileId = -1;
}
}
if (!chunk.isEmpty()) {
chunks.add(chunk);
chunksSize += chunk.size();
chunk = new ArrayList<>();
}
}
final int flushedPages = flushPages(chunks, maxFullLogLSN);
if (copiedPages != flushedPages) {
throw new IllegalStateException(
"Copied pages (" + copiedPages + " ) != flushed pages (" + flushedPages + ")");
}
}
private int flushPages(
final List<List<OQuarto<Long, ByteBuffer, OPointer, OCachePointer>>> chunks,
final OLogSequenceNumber fullLogLSN)
throws InterruptedException, IOException {
if (chunks.isEmpty()) {
return 0;
}
if (fullLogLSN != null) {
OLogSequenceNumber flushedLSN = writeAheadLog.getFlushedLsn();
while (flushedLSN == null || flushedLSN.compareTo(fullLogLSN) < 0) {
writeAheadLog.flush();
flushedLSN = writeAheadLog.getFlushedLsn();
}
}
final boolean fsyncFiles;
int flushedPages = 0;
final OPointer[] containerPointers = new OPointer[chunks.size()];
final ByteBuffer[] containerBuffers = new ByteBuffer[chunks.size()];
final int[] chunkPositions = new int[chunks.size()];
final int[] chunkFileIds = new int[chunks.size()];
final Map<Long, List<ORawPair<Long, ByteBuffer>>> buffersByFileId = new HashMap<>();
try {
for (int i = 0; i < chunks.size(); i++) {
final List<OQuarto<Long, ByteBuffer, OPointer, OCachePointer>> chunk = chunks.get(i);
flushedPages += chunk.size();
final OPointer containerPointer =
ODirectMemoryAllocator.instance()
.allocate(
chunk.size() * pageSize,
false,
Intention.ALLOCATE_CHUNK_TO_WRITE_DATA_IN_BATCH);
final ByteBuffer containerBuffer = containerPointer.getNativeByteBuffer();
containerPointers[i] = containerPointer;
containerBuffers[i] = containerBuffer;
assert containerBuffer.position() == 0;
for (final OQuarto<Long, ByteBuffer, OPointer, OCachePointer> quarto : chunk) {
final ByteBuffer buffer = quarto.two;
final OCachePointer pointer = quarto.four;
addMagicChecksumAndEncryption(
extractFileId(pointer.getFileId()), pointer.getPageIndex(), buffer);
buffer.position(0);
containerBuffer.put(buffer);
}
final OQuarto<Long, ByteBuffer, OPointer, OCachePointer> firstPage = chunk.get(0);
final OCachePointer firstCachePointer = firstPage.four;
final long fileId = firstCachePointer.getFileId();
final int pageIndex = firstCachePointer.getPageIndex();
final List<ORawPair<Long, ByteBuffer>> fileBuffers =
buffersByFileId.computeIfAbsent(fileId, (id) -> new ArrayList<>());
fileBuffers.add(new ORawPair<>(((long) pageIndex) * pageSize, containerBuffer));
chunkPositions[i] = pageIndex;
chunkFileIds[i] = internalFileId(fileId);
}
fsyncFiles = doubleWriteLog.write(containerBuffers, chunkFileIds, chunkPositions);
final List<OClosableEntry<Long, OFile>> acquiredFiles =
new ArrayList<>(buffersByFileId.size());
final List<IOResult> ioResults = new ArrayList<>(buffersByFileId.size());
final Iterator<Map.Entry<Long, List<ORawPair<Long, ByteBuffer>>>> filesIterator =
buffersByFileId.entrySet().iterator();
Map.Entry<Long, List<ORawPair<Long, ByteBuffer>>> entry = null;
// acquire as much files as possible and flush data
while (true) {
if (entry == null) {
if (filesIterator.hasNext()) {
entry = filesIterator.next();
} else {
break;
}
}
final OClosableEntry<Long, OFile> fileEntry = files.tryAcquire(entry.getKey());
if (fileEntry != null) {
final OFile file = fileEntry.get();
final List<ORawPair<Long, ByteBuffer>> bufferList = entry.getValue();
ioResults.add(file.write(bufferList));
acquiredFiles.add(fileEntry);
entry = null;
} else {
assert ioResults.size() == acquiredFiles.size();
if (!ioResults.isEmpty()) {
for (final IOResult ioResult : ioResults) {
ioResult.await();
}
for (final OClosableEntry<Long, OFile> closableEntry : acquiredFiles) {
files.release(closableEntry);
}
ioResults.clear();
acquiredFiles.clear();
} else {
Thread.yield();
}
}
}
assert ioResults.size() == acquiredFiles.size();
if (!ioResults.isEmpty()) {
for (final IOResult ioResult : ioResults) {
ioResult.await();
}
for (final OClosableEntry<Long, OFile> closableEntry : acquiredFiles) {
files.release(closableEntry);
}
}
} finally {
for (final OPointer containerPointer : containerPointers) {
if (containerPointer != null) {
ODirectMemoryAllocator.instance().deallocate(containerPointer);
}
}
}
if (fsyncFiles) {
fsyncFiles();
}
for (final List<OQuarto<Long, ByteBuffer, OPointer, OCachePointer>> chunk : chunks) {
for (final OQuarto<Long, ByteBuffer, OPointer, OCachePointer> chunkPage : chunk) {
final OCachePointer pointer = chunkPage.four;
final PageKey pageKey =
new PageKey(internalFileId(pointer.getFileId()), pointer.getPageIndex());
final long version = chunkPage.one;
final Lock lock = lockManager.acquireExclusiveLock(pageKey);
try {
if (!pointer.tryAcquireSharedLock()) {
continue;
}
try {
if (version == pointer.getVersion()) {
writeCachePages.remove(pageKey);
writeCacheSize.decrementAndGet();
pointer.decrementWritersReferrer();
pointer.setWritersListener(null);
}
} finally {
pointer.releaseSharedLock();
}
} finally {
lock.unlock();
}
bufferPool.release(chunkPage.three);
}
}
return flushedPages;
}
private void flushExclusiveWriteCache(final CountDownLatch latch, long pagesToFlush)
throws InterruptedException, IOException {
final Iterator<PageKey> iterator = exclusiveWritePages.iterator();
int flushedPages = 0;
int copiedPages = 0;
final long ewcSize = exclusiveWriteCacheSize.get();
pagesToFlush = Math.min(Math.max(pagesToFlush, chunkSize), ewcSize);
List<List<OQuarto<Long, ByteBuffer, OPointer, OCachePointer>>> chunks = new ArrayList<>(16);
List<OQuarto<Long, ByteBuffer, OPointer, OCachePointer>> chunk = new ArrayList<>(16);
if (latch != null && ewcSize <= exclusiveWriteCacheMaxSize) {
latch.countDown();
}
OLogSequenceNumber maxFullLogLSN = null;
int chunksSize = 0;
flushCycle:
while (chunksSize < pagesToFlush) {
long lastFileId = -1;
long lastPageIndex = -1;
while (chunksSize + chunk.size() < pagesToFlush) {
if (!iterator.hasNext()) {
if (!chunk.isEmpty()) {
chunks.add(chunk);
}
break flushCycle;
}
final PageKey pageKey = iterator.next();
final OCachePointer pointer = writeCachePages.get(pageKey);
final long version;
if (pointer == null) {
iterator.remove();
} else {
if (pointer.tryAcquireSharedLock()) {
final OLogSequenceNumber fullLSN;
final OPointer directPointer =
bufferPool.acquireDirect(false, Intention.COPY_PAGE_DURING_EXCLUSIVE_PAGE_FLUSH);
final ByteBuffer copy = directPointer.getNativeByteBuffer();
assert copy.position() == 0;
try {
version = pointer.getVersion();
final ByteBuffer buffer = pointer.getBufferDuplicate();
fullLSN = pointer.getEndLSN();
assert buffer != null;
buffer.position(0);
copy.position(0);
copy.put(buffer);
removeFromDirtyPages(pageKey);
copiedPages++;
} finally {
pointer.releaseSharedLock();
}
if (fullLSN != null
&& (maxFullLogLSN == null || maxFullLogLSN.compareTo(fullLSN) < 0)) {
maxFullLogLSN = fullLSN;
}
copy.position(0);
if (!chunk.isEmpty()) {
if (lastFileId != pointer.getFileId()
|| lastPageIndex != pointer.getPageIndex() - 1) {
chunks.add(chunk);
chunksSize += chunk.size();
chunk = new ArrayList<>();
if (chunksSize - flushedPages >= this.chunkSize) {
flushedPages += flushPages(chunks, maxFullLogLSN);
chunks.clear();
if (latch != null
&& exclusiveWriteCacheSize.get() <= exclusiveWriteCacheMaxSize) {
latch.countDown();
}
maxFullLogLSN = null;
}
}
}
chunk.add(new OQuarto<>(version, copy, directPointer, pointer));
lastFileId = pointer.getFileId();
lastPageIndex = pointer.getPageIndex();
} else {
if (!chunk.isEmpty()) {
chunks.add(chunk);
chunksSize += chunk.size();
chunk = new ArrayList<>();
}
if (chunksSize - flushedPages >= this.chunkSize) {
flushedPages += flushPages(chunks, maxFullLogLSN);
chunks.clear();
if (latch != null && exclusiveWriteCacheSize.get() <= exclusiveWriteCacheMaxSize) {
latch.countDown();
}
maxFullLogLSN = null;
}
lastFileId = -1;
lastPageIndex = -1;
}
}
}
if (!chunk.isEmpty()) {
chunks.add(chunk);
chunksSize += chunk.size();
chunk = new ArrayList<>();
if (chunksSize - flushedPages >= this.chunkSize) {
flushedPages += flushPages(chunks, maxFullLogLSN);
chunks.clear();
maxFullLogLSN = null;
if (latch != null && exclusiveWriteCacheSize.get() <= exclusiveWriteCacheMaxSize) {
latch.countDown();
}
}
}
}
flushedPages += flushPages(chunks, maxFullLogLSN);
if (copiedPages != flushedPages) {
throw new IllegalStateException(
"Copied pages (" + copiedPages + " ) != flushed pages (" + flushedPages + ")");
}
}
private final class FileFlushTask implements Callable<Void> {
private final Set<Integer> fileIdSet;
private FileFlushTask(final Collection<Integer> fileIds) {
this.fileIdSet = new HashSet<>(fileIds);
}
@Override
public Void call() throws Exception {
if (flushError != null) {
OLogManager.instance()
.errorNoDb(
this,
"Can not flush file data because of issue during data write, %s",
null,
flushError.getMessage());
return null;
}
writeAheadLog.flush();
final TreeSet<PageKey> pagesToFlush = new TreeSet<>();
for (final Map.Entry<PageKey, OCachePointer> entry : writeCachePages.entrySet()) {
final PageKey pageKey = entry.getKey();
if (fileIdSet.contains(pageKey.fileId)) {
pagesToFlush.add(pageKey);
}
}
OLogSequenceNumber maxLSN = null;
final List<List<OQuarto<Long, ByteBuffer, OPointer, OCachePointer>>> chunks =
new ArrayList<>(chunkSize);
for (final PageKey pageKey : pagesToFlush) {
if (fileIdSet.contains(pageKey.fileId)) {
final OCachePointer pagePointer = writeCachePages.get(pageKey);
final Lock pageLock = lockManager.acquireExclusiveLock(pageKey);
try {
if (!pagePointer.tryAcquireSharedLock()) {
continue;
}
try {
final ByteBuffer buffer = pagePointer.getBufferDuplicate();
final OPointer directPointer = bufferPool.acquireDirect(false, Intention.FILE_FLUSH);
final ByteBuffer copy = directPointer.getNativeByteBuffer();
assert copy.position() == 0;
assert buffer != null;
buffer.position(0);
copy.put(buffer);
final OLogSequenceNumber endLSN = pagePointer.getEndLSN();
if (endLSN != null && (maxLSN == null || endLSN.compareTo(maxLSN) > 0)) {
maxLSN = endLSN;
}
chunks.add(
Collections.singletonList(
new OQuarto<>(pagePointer.getVersion(), copy, directPointer, pagePointer)));
removeFromDirtyPages(pageKey);
} finally {
pagePointer.releaseSharedLock();
}
} finally {
pageLock.unlock();
}
if (chunks.size() >= 4 * chunkSize) {
flushPages(chunks, maxLSN);
chunks.clear();
}
}
}
flushPages(chunks, maxLSN);
if (callFsync) {
for (final int iFileId : fileIdSet) {
final long finalId = composeFileId(id, iFileId);
final OClosableEntry<Long, OFile> entry = files.acquire(finalId);
if (entry != null) {
try {
entry.get().synch();
} finally {
files.release(entry);
}
}
}
}
return null;
}
}
private static Cipher getCipherInstance() {
try {
return Cipher.getInstance(TRANSFORMATION);
} catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
throw OException.wrapException(
new OSecurityException("Implementation of encryption " + TRANSFORMATION + " is absent"),
e);
}
}
private final class RemoveFilePagesTask implements Callable<Void> {
private final int fileId;
private RemoveFilePagesTask(final int fileId) {
this.fileId = fileId;
}
@Override
public Void call() {
doRemoveCachePages(fileId);
return null;
}
}
private final class DeleteFileTask implements Callable<ORawPair<String, String>> {
private final long externalFileId;
private DeleteFileTask(long externalFileId) {
this.externalFileId = externalFileId;
}
@Override
public ORawPair<String, String> call() throws Exception {
final int internalFileId = extractFileId(externalFileId);
final long fileId = composeFileId(id, internalFileId);
doRemoveCachePages(internalFileId);
final OFile fileClassic = files.remove(fileId);
if (fileClassic != null) {
if (fileClassic.exists()) {
fileClassic.delete();
}
final String name = idNameMap.get(internalFileId);
idNameMap.remove(internalFileId);
nameIdMap.put(name, -internalFileId);
idNameMap.put(-internalFileId, name);
return new ORawPair<>(fileClassic.getName(), name);
}
return null;
}
}
}
| {
"content_hash": "73ba4845988dc0ec781918dd7d1b6273",
"timestamp": "",
"source": "github",
"line_count": 3569,
"max_line_length": 112,
"avg_line_length": 32.337629588119924,
"alnum_prop": 0.6429518338488732,
"repo_name": "orientechnologies/orientdb",
"id": "50c825705c510e38b8f27181b2c05070b3332403",
"size": "116145",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "core/src/main/java/com/orientechnologies/orient/core/storage/cache/local/OWOWCache.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "19302"
},
{
"name": "Dockerfile",
"bytes": "705"
},
{
"name": "Gnuplot",
"bytes": "1245"
},
{
"name": "Groovy",
"bytes": "7913"
},
{
"name": "HTML",
"bytes": "5750"
},
{
"name": "Java",
"bytes": "26588383"
},
{
"name": "JavaScript",
"bytes": "259"
},
{
"name": "PLpgSQL",
"bytes": "54881"
},
{
"name": "Shell",
"bytes": "33650"
}
],
"symlink_target": ""
} |
package eu.atos.sla.service.rest.helpers;
import java.io.ByteArrayOutputStream;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.core.HttpHeaders;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import eu.atos.sla.dao.IProviderDAO;
import eu.atos.sla.datamodel.IProvider;
import eu.atos.sla.datamodel.bean.Provider;
import eu.atos.sla.service.rest.helpers.exception.HelperException;
import eu.atos.sla.service.rest.helpers.exception.HelperException.Code;
import eu.atos.sla.util.IModelConverter;
/**
*
*/
@Deprecated
@Service
@Transactional
public class ProviderHelper {
private static Logger logger = LoggerFactory.getLogger(ProviderHelper.class);
@Autowired
public IProviderDAO providerDAO;
@Autowired
private IModelConverter modelConverter;
public ProviderHelper() {
}
private boolean doesProviderExistsInRepository(String uuid) {
if (this.providerDAO.getByUUID(uuid) != null)
return true;
else
return false;
}
private String printProviderToXML(IProvider provider) throws JAXBException {
eu.atos.sla.parser.data.Provider providerXML = modelConverter.getProviderXML(provider);
JAXBContext jaxbContext = JAXBContext
.newInstance(eu.atos.sla.parser.data.Provider.class);
Marshaller marshaller = jaxbContext.createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
ByteArrayOutputStream out = new ByteArrayOutputStream();
marshaller.marshal(providerXML, out);
return out.toString();
}
private String printProvidersToXML(List<IProvider> providers)
throws JAXBException {
StringBuilder xmlResponse = new StringBuilder();
xmlResponse.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
xmlResponse.append("<collection href=\"/providers\">\n");
xmlResponse.append("<items offset=\"0\" total=\"" + providers.size()
+ "\">\n");
for (IProvider provider : providers) {
xmlResponse.append(printProviderToXML(provider));
}
xmlResponse.append("</items>\n");
xmlResponse.append("</collection>\n");
return xmlResponse.toString();
}
public String getProviders() throws HelperException {
logger.debug("StartOf getProviders");
try{
List<IProvider> providers = new ArrayList<IProvider>();
providers = this.providerDAO.getAll();
if (providers.size() != 0){
String str = printProvidersToXML(providers);
logger.debug("EndOf getEnforcements");
return str;
}else{
logger.debug("EndOf getEnforcements");
throw new HelperException(Code.DB_DELETED, "There are no providers in the SLA Repository Database");
}
} catch (JAXBException e) {
logger.error("Error in getProviders " , e);
throw new HelperException(Code.PARSER, "Error when parsing :" + e.getMessage() );
}
}
public String getProviderByUUID(String uuid) throws HelperException {
logger.debug("StartOf getProviderByUUID uuid:"+uuid);
try{
IProvider provider = new Provider();
provider = this.providerDAO.getByUUID(uuid);
String str = null;
if (provider != null)
str = printProviderToXML(provider);
logger.debug("EndOf getProviderByUUID");
return str;
} catch (JAXBException e) {
logger.error("Error in getEnforcementJobByUUID " , e);
throw new HelperException(Code.PARSER, "Error when creating enforcementJob parsing file:" + e.getMessage() );
}
}
public String createProvider(HttpHeaders hh, String uriInfo,
String payload) throws HelperException {
logger.debug("StartOf createProvider payload:"+payload);
try {
eu.atos.sla.parser.data.Provider providerXML = null;
JAXBContext jaxbContext = JAXBContext.newInstance(eu.atos.sla.parser.data.Provider.class);
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
providerXML = (eu.atos.sla.parser.data.Provider) jaxbUnmarshaller.unmarshal(new StringReader(payload));
IProvider provider = new Provider();
IProvider stored = new Provider();
if (providerXML != null) {
if (!doesProviderExistsInRepository(providerXML.getUuid())) {
provider = modelConverter.getProviderFromProviderXML(providerXML);
stored = providerDAO.save(provider);
} else {
throw new HelperException(Code.DB_EXIST, "Provider with id:"
+ providerXML.getUuid()
+ " already exists in the SLA Repository Database");
}
}
if (stored != null) {
logger.debug("EndOf createProvider");
String location = uriInfo + "/" + stored.getUuid();
return location;
} else
logger.debug("EndOf createProvider");
throw new HelperException(Code.INTERNAL, "Error when creating provider the SLA Repository Database");
} catch (JAXBException e) {
logger.error("Error in createProvider " , e);
throw new HelperException(Code.PARSER, "Error when creating provider parsing file:" + e.getMessage() );
}
}
}
| {
"content_hash": "b682f3a9ba12d4b0a7163007642ff398",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 121,
"avg_line_length": 34.94285714285714,
"alnum_prop": 0.6335241210139002,
"repo_name": "MicheleGuerriero/SeaCloudsPlatform",
"id": "2f71bf918bec1182109e3b62a1f73aa7a9398c3c",
"size": "6769",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "sla/sla-core/sla-service/src/main/java/eu/atos/sla/service/rest/helpers/ProviderHelper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2589"
},
{
"name": "CSS",
"bytes": "6997"
},
{
"name": "HTML",
"bytes": "66785"
},
{
"name": "Java",
"bytes": "2214267"
},
{
"name": "JavaScript",
"bytes": "60488"
},
{
"name": "PHP",
"bytes": "905"
},
{
"name": "Python",
"bytes": "1493"
},
{
"name": "Ruby",
"bytes": "1292"
},
{
"name": "Shell",
"bytes": "23889"
}
],
"symlink_target": ""
} |
package io.reactivex.rxjava3.internal.operators.observable;
import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.*;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
import io.reactivex.rxjava3.disposables.Disposable;
import org.junit.Test;
import org.mockito.Mockito;
import org.reactivestreams.Subscription;
import io.reactivex.rxjava3.core.*;
import io.reactivex.rxjava3.functions.Function;
import io.reactivex.rxjava3.internal.functions.Functions;
import io.reactivex.rxjava3.observers.TestObserver;
import io.reactivex.rxjava3.schedulers.Schedulers;
import io.reactivex.rxjava3.testsupport.TestHelper;
public class ObservableOnErrorResumeNextTest extends RxJavaTest {
@Test
public void resumeNextWithSynchronousExecution() {
final AtomicReference<Throwable> receivedException = new AtomicReference<>();
Observable<String> w = Observable.unsafeCreate(new ObservableSource<String>() {
@Override
public void subscribe(Observer<? super String> observer) {
observer.onSubscribe(Disposable.empty());
observer.onNext("one");
observer.onError(new Throwable("injected failure"));
observer.onNext("two");
observer.onNext("three");
}
});
Function<Throwable, Observable<String>> resume = new Function<Throwable, Observable<String>>() {
@Override
public Observable<String> apply(Throwable t1) {
receivedException.set(t1);
return Observable.just("twoResume", "threeResume");
}
};
Observable<String> observable = w.onErrorResumeNext(resume);
Observer<String> observer = TestHelper.mockObserver();
observable.subscribe(observer);
verify(observer, Mockito.never()).onError(any(Throwable.class));
verify(observer, times(1)).onComplete();
verify(observer, times(1)).onNext("one");
verify(observer, Mockito.never()).onNext("two");
verify(observer, Mockito.never()).onNext("three");
verify(observer, times(1)).onNext("twoResume");
verify(observer, times(1)).onNext("threeResume");
assertNotNull(receivedException.get());
}
@Test
public void resumeNextWithAsyncExecution() {
final AtomicReference<Throwable> receivedException = new AtomicReference<>();
Subscription s = mock(Subscription.class);
TestObservable w = new TestObservable(s, "one");
Function<Throwable, Observable<String>> resume = new Function<Throwable, Observable<String>>() {
@Override
public Observable<String> apply(Throwable t1) {
receivedException.set(t1);
return Observable.just("twoResume", "threeResume");
}
};
Observable<String> o = Observable.unsafeCreate(w).onErrorResumeNext(resume);
Observer<String> observer = TestHelper.mockObserver();
o.subscribe(observer);
try {
w.t.join();
} catch (InterruptedException e) {
fail(e.getMessage());
}
verify(observer, Mockito.never()).onError(any(Throwable.class));
verify(observer, times(1)).onComplete();
verify(observer, times(1)).onNext("one");
verify(observer, Mockito.never()).onNext("two");
verify(observer, Mockito.never()).onNext("three");
verify(observer, times(1)).onNext("twoResume");
verify(observer, times(1)).onNext("threeResume");
assertNotNull(receivedException.get());
}
/**
* Test that when a function throws an exception this is propagated through onError.
*/
@Test
public void functionThrowsError() {
Subscription s = mock(Subscription.class);
TestObservable w = new TestObservable(s, "one");
Function<Throwable, Observable<String>> resume = new Function<Throwable, Observable<String>>() {
@Override
public Observable<String> apply(Throwable t1) {
throw new RuntimeException("exception from function");
}
};
Observable<String> o = Observable.unsafeCreate(w).onErrorResumeNext(resume);
Observer<String> observer = TestHelper.mockObserver();
o.subscribe(observer);
try {
w.t.join();
} catch (InterruptedException e) {
fail(e.getMessage());
}
// we should get the "one" value before the error
verify(observer, times(1)).onNext("one");
// we should have received an onError call on the Observer since the resume function threw an exception
verify(observer, times(1)).onError(any(Throwable.class));
verify(observer, times(0)).onComplete();
}
@Test
public void mapResumeAsyncNext() {
// Trigger multiple failures
Observable<String> w = Observable.just("one", "fail", "two", "three", "fail");
// Introduce map function that fails intermittently (Map does not prevent this when the Observer is a
// rx.operator incl onErrorResumeNextViaObservable)
w = w.map(new Function<String, String>() {
@Override
public String apply(String s) {
if ("fail".equals(s)) {
throw new RuntimeException("Forced Failure");
}
System.out.println("BadMapper:" + s);
return s;
}
});
Observable<String> o = w.onErrorResumeNext(new Function<Throwable, Observable<String>>() {
@Override
public Observable<String> apply(Throwable t1) {
return Observable.just("twoResume", "threeResume").subscribeOn(Schedulers.computation());
}
});
Observer<String> observer = TestHelper.mockObserver();
TestObserver<String> to = new TestObserver<>(observer);
o.subscribe(to);
to.awaitDone(5, TimeUnit.SECONDS);
verify(observer, Mockito.never()).onError(any(Throwable.class));
verify(observer, times(1)).onComplete();
verify(observer, times(1)).onNext("one");
verify(observer, Mockito.never()).onNext("two");
verify(observer, Mockito.never()).onNext("three");
verify(observer, times(1)).onNext("twoResume");
verify(observer, times(1)).onNext("threeResume");
}
static class TestObservable implements ObservableSource<String> {
final String[] values;
Thread t;
TestObservable(Subscription s, String... values) {
this.values = values;
}
@Override
public void subscribe(final Observer<? super String> observer) {
System.out.println("TestObservable subscribed to ...");
observer.onSubscribe(Disposable.empty());
t = new Thread(new Runnable() {
@Override
public void run() {
try {
System.out.println("running TestObservable thread");
for (String s : values) {
System.out.println("TestObservable onNext: " + s);
observer.onNext(s);
}
throw new RuntimeException("Forced Failure");
} catch (Throwable e) {
observer.onError(e);
}
}
});
System.out.println("starting TestObservable thread");
t.start();
System.out.println("done starting TestObservable thread");
}
}
@Test
public void backpressure() {
TestObserver<Integer> to = new TestObserver<>();
Observable.range(0, 100000)
.onErrorResumeNext(new Function<Throwable, Observable<Integer>>() {
@Override
public Observable<Integer> apply(Throwable t1) {
return Observable.just(1);
}
})
.observeOn(Schedulers.computation())
.map(new Function<Integer, Integer>() {
int c;
@Override
public Integer apply(Integer t1) {
if (c++ <= 1) {
// slow
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
return t1;
}
})
.subscribe(to);
to.awaitDone(5, TimeUnit.SECONDS);
to.assertNoErrors();
}
@Test
public void badOtherSource() {
TestHelper.checkBadSourceObservable(new Function<Observable<Integer>, Object>() {
@Override
public Object apply(Observable<Integer> o) throws Exception {
return Observable.error(new IOException())
.onErrorResumeNext(Functions.justFunction(o));
}
}, false, 1, 1, 1);
}
}
| {
"content_hash": "1c73f7a28d70684ad301426ee07bea91",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 111,
"avg_line_length": 35.808429118773944,
"alnum_prop": 0.5766103145730794,
"repo_name": "reactivex/rxjava",
"id": "ed3e8dc57103a8c762a363f5c16e3085d153892e",
"size": "9949",
"binary": false,
"copies": "2",
"ref": "refs/heads/3.x",
"path": "src/test/java/io/reactivex/rxjava3/internal/operators/observable/ObservableOnErrorResumeNextTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "12875"
},
{
"name": "Java",
"bytes": "16361730"
},
{
"name": "Shell",
"bytes": "3148"
}
],
"symlink_target": ""
} |
v0.1.9 (2016-08-10)
===================
- Fix Julia v0.5 deprecation warnings
- Add flexibility in Fortran compiler (UNIX only) in build script
v0.1.8 (2016-02-29)
===================
- Enable precompilation on v0.4
- Use BinDeps download command on Windows in build script.
v0.1.7 (2015-09-28)
===================
- Fix v0.4 deprecation warnings
- Add `call` methods as synonyms for `evaluate()` on v0.4+,
allowing syntax such as `spline(x)`.
v0.1.6 (2015-07-27)
===================
- New download location for windows binaries.
v0.1.5 (2015-06-08)
===================
- Adds `integrate` and `roots` methods for `Spline1D`.
- Widen allowed argument types to `AbstractArray` in spline construction
and evaluation. Internally, arguments are converted to Float64 arrays (if
needed).
v0.1.4 (2015-03-23)
===================
- Fix v0.4 deprecation warnings
- Add `__init__` method to enable precompilation.
v0.1.3 (2014-12-01)
===================
- Fix bug in Spline2D(::Vector, ::Vector, ::Vector) where an error
code from the Fortran library indicating that the second work array is too
small was not being handled.
- add show() method for Spline1D
- add derivative() method for Spline1D
v0.1.2 (2014-11-07)
===================
- Add support for Windows by downloading a compiled dll.
v0.1.1 (2014-10-27)
===================
- Fix Makefile bug in OS X build.
v0.1.0 (2014-10-24)
===================
Initial release.
| {
"content_hash": "4a9bd6e49c41a0670916c2f8108b8928",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 76,
"avg_line_length": 23.65573770491803,
"alnum_prop": 0.6216216216216216,
"repo_name": "JuliaPackageMirrors/Dierckx.jl",
"id": "d3fdf9e9b0d536878a525ba6b78fa1dda5fd5c3e",
"size": "1443",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "NEWS.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Julia",
"bytes": "30556"
},
{
"name": "Python",
"bytes": "1499"
}
],
"symlink_target": ""
} |
<?php
namespace GoogleMoviesClient\Exceptions;
use GoogleMoviesClient\HttpClient\Request;
use GoogleMoviesClient\HttpClient\Response;
/**
* Class TmdbApiException.
*/
class HttpRequestException extends \Exception
{
/**
* @var int
*/
protected $code;
/**
* @var string
*/
protected $message;
/**
* @var Request
*/
protected $request;
/**
* @var Response
*/
protected $response;
/**
* Create the exception.
*
* @param string $message
* @param int $code
* @param Request|null $request
* @param Response|null $response
*/
public function __construct($code, $message, $request = null, $response = null)
{
$this->code = $code;
$this->message = $message;
$this->request = $request;
$this->response = $response;
}
/**
* @return Request
*/
public function getRequest()
{
return $this->request;
}
/**
* @param Request $request
*
* @return $this
*/
public function setRequest($request)
{
$this->request = $request;
return $this;
}
/**
* @return Response
*/
public function getResponse()
{
return $this->response;
}
/**
* @param Response $response
*
* @return $this
*/
public function setResponse($response)
{
$this->response = $response;
return $this;
}
}
| {
"content_hash": "f17349f41c8ea3cb08efd264497ea16c",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 83,
"avg_line_length": 16.921348314606742,
"alnum_prop": 0.5252324037184595,
"repo_name": "okaufmann/google-movies-client",
"id": "d5213d405e6fcf507a9b7a4cacf5ca5dbc755746",
"size": "1825",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/GoogleMoviesClient/Exceptions/HttpRequestException.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "83558"
}
],
"symlink_target": ""
} |
function PointObjectManager(layer, textureManager)
{
RendererObjectManager.call(this, layer, textureManager);
var NUM_STARS_IN_TEXTURE = 2;
// Small sets of point aren't worth breaking up into regions.
// Right now, I'm arbitrarily setting the threshold to 200.
var MINIMUM_NUM_POINTS_FOR_REGIONS = 200;
function RegionData ()
{
// TODO(jpowell): This is a convenient hack until the catalog tells us the
// region for all of its sources. Remove this once we add that.
this.sources = [];
this.mVertexBuffer = new VertexBuffer(true);
this.mColorBuffer = new NightVisionColorBuffer(true);
this.mTexCoordBuffer = new TexCoordBuffer(true);
this.mIndexBuffer = new IndexBuffer(true);
}
// Should we compute the regions for the points?
// If false, we just put them in the catchall region.
var COMPUTE_REGIONS = true;
var mNumPoints = 0;
var mSkyRegions = new SkyRegionMap();
var mTextureRef = null;
// We want to initialize the labels of a sky region to an empty set of data.
mSkyRegions.setRegionDataFactory({
construct : function () { return new RegionData(); }
});
this.updateObjects = function (points, updateType)
{
var onlyUpdatePoints = true;
// We only care about updates to positions, ignore any other updates.
if (updateType.Reset)
{
onlyUpdatePoints = false;
}
else if (updateType.UpdatePositions)
{
// Sanity check: make sure the number of points is unchanged.
if (points.length != mNumPoints)
{
Log.e("PointObjectManager",
"Updating PointObjectManager a different number of points: update had " +
points.length + " vs " + mNumPoints + " before");
return;
}
}
else
{
return;
}
mNumPoints = points.length;
mSkyRegions.clear();
if (COMPUTE_REGIONS)
{
// Find the region for each point, and put it in a separate list
// for that region.
points.forEach(function (point)
{
var region = points.length < MINIMUM_NUM_POINTS_FOR_REGIONS
? SkyRegionMap.CATCHALL_REGION_ID
: SkyRegionMap.getObjectRegion(point.getLocation());
mSkyRegions.getRegionData(region).sources.push(point);
});
}
else
{
mSkyRegions.getRegionData(SkyRegionMap.CATCHALL_REGION_ID).sources = points;
}
// Generate the resources for all of the regions.
mSkyRegions.getDataForAllRegions().forEach(function (data)
{
var numVertices = 4 * data.sources.length;
var numIndices = 6 * data.sources.length;
data.mVertexBuffer.reset(numVertices);
data.mColorBuffer.reset(numVertices);
data.mTexCoordBuffer.reset(numVertices);
data.mIndexBuffer.reset(numIndices);
var up = new Vector3(0, 1, 0);
// By inspecting the perspective projection matrix, you can show that,
// to have a quad at the center of the screen to be of size k by k
// pixels, the width and height are both:
// k * tan(fovy / 2) / screenHeight
// This is not difficult to derive. Look at the transformation matrix
// in SkyRenderer if you're interested in seeing why this is true.
// I'm arbitrarily deciding that at a 60 degree field of view, and 480
// pixels high, a size of 1 means "1 pixel," so calculate sizeFactor
// based on this. These numbers mostly come from the fact that that's
// what I think looks reasonable.
var fovyInRadians = 60 * MathUtil.PI / 180.0;
var sizeFactor = MathUtil.tan(fovyInRadians * 0.5) / 480;
var bottomLeftPos = new Vector3(0, 0, 0);
var topLeftPos = new Vector3(0, 0, 0);
var bottomRightPos = new Vector3(0, 0, 0);
var topRightPos = new Vector3(0, 0, 0);
var su = new Vector3(0, 0, 0);
var sv = new Vector3(0, 0, 0);
var index = 0;
var starWidthInTexels = 1.0 / NUM_STARS_IN_TEXTURE;
data.sources.forEach(function (p)
{
var color = 0xff000000 | p.getColor(); // Force alpha to 0xff
var bottomLeft = index++;
var topLeft = index++;
var bottomRight = index++;
var topRight = index++;
// First triangle
data.mIndexBuffer.addIndex(bottomLeft);
data.mIndexBuffer.addIndex(topLeft);
data.mIndexBuffer.addIndex(bottomRight);
// Second triangle
data.mIndexBuffer.addIndex(topRight);
data.mIndexBuffer.addIndex(bottomRight);
data.mIndexBuffer.addIndex(topLeft);
var starIndex = p.getPointShape();//.getImageIndex();
var texOffsetU = starWidthInTexels * starIndex;
data.mTexCoordBuffer.addTexCoords(texOffsetU, 1);
data.mTexCoordBuffer.addTexCoords(texOffsetU, 0);
data.mTexCoordBuffer.addTexCoords(texOffsetU + starWidthInTexels, 1);
data.mTexCoordBuffer.addTexCoords(texOffsetU + starWidthInTexels, 0);
var pos = p.getLocation();
var u = VectorUtil.normalized(VectorUtil.crossProduct(pos, up));
var v = VectorUtil.crossProduct(u, pos);
var s = p.getSize() * sizeFactor;
su.assign(s*u.x, s*u.y, s*u.z);
sv.assign(s*v.x, s*v.y, s*v.z);
bottomLeftPos.assign(pos.x - su.x - sv.x, pos.y - su.y - sv.y, pos.z - su.z - sv.z);
topLeftPos.assign(pos.x - su.x + sv.x, pos.y - su.y + sv.y, pos.z - su.z + sv.z);
bottomRightPos.assign(pos.x + su.x - sv.x, pos.y + su.y - sv.y, pos.z + su.z - sv.z);
topRightPos.assign(pos.x + su.x + sv.x, pos.y + su.y + sv.y, pos.z + su.z + sv.z);
// Add the vertices
data.mVertexBuffer.addPoint(bottomLeftPos);
data.mColorBuffer.addColor(color);
data.mVertexBuffer.addPoint(topLeftPos);
data.mColorBuffer.addColor(color);
data.mVertexBuffer.addPoint(bottomRightPos);
data.mColorBuffer.addColor(color);
data.mVertexBuffer.addPoint(topRightPos);
data.mColorBuffer.addColor(color);
});
Log.i("PointObjectManager",
"Vertices: " + data.mVertexBuffer.size() + ", Indices: " + data.mIndexBuffer.size());
data.sources = null;
});
}
this.reload = function (gl, fullReload)
{
mTextureRef = this.textureManager().getTextureFromResource(gl, R.drawable.stars_texture);
mSkyRegions.getDataForAllRegions().forEach( function (data)
{
data.mVertexBuffer.reload();
data.mColorBuffer.reload();
data.mTexCoordBuffer.reload();
data.mIndexBuffer.reload();
});
}
this.drawInternal = function (gl)
{
var shader = this.getRenderState().getTCVShader();
gl.useProgram(shader.sp);
gl.uniformMatrix4fv(shader.matrix, false, this.getRenderState().getTransformToDeviceMatrix().getFloatArray());
//gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
//gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
//gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
//gl.glEnable(GL10.GL_CULL_FACE);
//gl.glFrontFace(GL10.GL_CW);
//gl.glCullFace(GL10.GL_BACK);
//gl.glEnable(GL10.GL_ALPHA_TEST);
//gl.glAlphaFunc(GL10.GL_GREATER, 0.5);
gl.enable(gl.BLEND);
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
//gl.glEnable(GL10.GL_TEXTURE_2D);
mTextureRef.bind(gl);
//gl.glTexEnvf(GL10.GL_TEXTURE_ENV, GL10.GL_TEXTURE_ENV_MODE, GL10.GL_MODULATE);
// Render all of the active sky regions.
var nightVisionMode = this.getRenderState().getNightVisionMode();
var activeRegions = this.getRenderState().getActiveSkyRegions();
var activeRegionData = mSkyRegions.getDataForActiveRegions(activeRegions);
activeRegionData.forEach (function (data)
{
if (data.mVertexBuffer.size() == 0)
{
return;
}
gl.enableVertexAttribArray(shader.pos);
data.mVertexBuffer.set(gl);
gl.vertexAttribPointer(shader.pos, 3, gl.FLOAT, false, 0, 0);
gl.enableVertexAttribArray(shader.color);
data.mColorBuffer.set(gl, nightVisionMode);
gl.vertexAttribPointer(shader.color, 4, gl.FLOAT, false, 0, 0);
gl.enableVertexAttribArray(shader.texCoord);
data.mTexCoordBuffer.set(gl);
gl.vertexAttribPointer(shader.texCoord, 2, gl.FLOAT, false, 0, 0);
data.mIndexBuffer.draw(gl, gl.TRIANGLES);
});
gl.disable(gl.BLEND);
//gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY);
//gl.glDisable(GL10.GL_TEXTURE_2D);
//gl.glDisable(GL10.GL_ALPHA_TEST);
}
}
| {
"content_hash": "5e6d5c1be17b04ea01afbf7fae58db1f",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 112,
"avg_line_length": 32.149193548387096,
"alnum_prop": 0.6943434090053932,
"repo_name": "Codes4Fun/starweb",
"id": "944c83f6f4a68babaae0264468772d2f2d6f8b86",
"size": "7974",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "renderer/PointObjectManager.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "27694"
},
{
"name": "JavaScript",
"bytes": "218216"
}
],
"symlink_target": ""
} |
#include <assert.h>
#include "cuddAux.h"
/* Function Prototypes *
DdNode *cuddauxIsVarInRecur(DdManager* manager, DdNode* f, DdNode* Var);
/**Function********************************************************************
Synopsis [Membership of a variable to the support of a BDD/ADD]
Description [Tells wether a variable appear in the decision diagram
of a function.]
SideEffects [None]
SeeAlso []
******************************************************************************
int
Cuddaux_IsVarIn(DdManager* dd, DdNode* f, DdNode* var)
{
assert(Cudd_Regular(var));
return (cuddauxIsVarInRecur(dd,f,var) == DD_ONE(dd));
}
/**Function********************************************************************
Synopsis [Performs the recursive step of Cuddaux_IsVarIn.]
Description [Performs the recursive step of Cuddaux_IsVarIn. var is
supposed to be a BDD projection function. Returns the logical one or
zero.]
SideEffects [None]
SeeAlso []
******************************************************************************
DdNode*
cuddauxIsVarInRecur(DdManager* manager, DdNode* f, DdNode* Var)
{
DdNode *zero,*one, *F, *res;
int topV,topF;
one = DD_ONE(manager);
zero = Cudd_Not(one);
F = Cudd_Regular(f);
if (cuddIsConstant(F)) return zero;
if (Var==F) return(one);
topV = Var->index;
topF = F->index;
if (topF == topV) return(one);
if (cuddI(manager,topV) < cuddI(manager,topF)) return(zero);
res = cuddCacheLookup2(manager,cuddauxIsVarInRecur, F, Var);
if (res != NULL) return(res);
res = cuddauxIsVarInRecur(manager,cuddT(F),Var);
if (res==zero){
res = cuddauxIsVarInRecur(manager,cuddE(F),Var);
}
cuddCacheInsert2(manager,cuddauxIsVarInRecur,F,Var,res);
return(res);
}
*/
| {
"content_hash": "6f1691edeaae053e6a963522a0598acc",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 79,
"avg_line_length": 26.727272727272727,
"alnum_prop": 0.5736961451247166,
"repo_name": "juliansf/rltl2ba",
"id": "bf33f0edbee050b890b90108ed88df73953432dc",
"size": "1764",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/cudd/cuddAux.c",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "6605143"
},
{
"name": "C++",
"bytes": "321914"
},
{
"name": "CSS",
"bytes": "4198"
},
{
"name": "Groff",
"bytes": "28514"
},
{
"name": "HTML",
"bytes": "3662440"
},
{
"name": "Lua",
"bytes": "1508"
},
{
"name": "Makefile",
"bytes": "74455"
},
{
"name": "OCaml",
"bytes": "1412068"
},
{
"name": "Shell",
"bytes": "4798"
},
{
"name": "Standard ML",
"bytes": "4268"
}
],
"symlink_target": ""
} |
- Start eswiss
#### Authors: 1
- Matthew Lean ([@mattlean](https://github.com/mattlean))
| {
"content_hash": "49d01eb85ca1656b38244ff80e8c54e7",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 57,
"avg_line_length": 18.2,
"alnum_prop": 0.6593406593406593,
"repo_name": "IsaacLean/bolt-ui",
"id": "db2f297639cc523ace137f84832db36016e4e147",
"size": "151",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CHANGELOG.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2080"
},
{
"name": "HTML",
"bytes": "502"
},
{
"name": "JavaScript",
"bytes": "13650"
}
],
"symlink_target": ""
} |
using System;
using System.Diagnostics;
using System.Drawing;
using System.Runtime.InteropServices;
using DShowNET;
namespace DirectX.Capture
{
/// <summary>
/// Capabilities of the video device such as
/// min/max frame size and frame rate.
/// </summary>
public class VideoCapabilities
{
// ------------------ Properties --------------------
/// <summary> Native size of the incoming video signal. This is the largest signal the filter can digitize with every pixel remaining unique. Read-only. </summary>
public Size InputSize;
/// <summary> Minimum supported frame size. Read-only. </summary>
public Size MinFrameSize;
/// <summary> Maximum supported frame size. Read-only. </summary>
public Size MaxFrameSize;
/// <summary> Granularity of the output width. This value specifies the increments that are valid between MinFrameSize and MaxFrameSize. Read-only. </summary>
public int FrameSizeGranularityX;
/// <summary> Granularity of the output height. This value specifies the increments that are valid between MinFrameSize and MaxFrameSize. Read-only. </summary>
public int FrameSizeGranularityY;
/// <summary> Minimum supported frame rate. Read-only. </summary>
public double MinFrameRate;
/// <summary> Maximum supported frame rate. Read-only. </summary>
public double MaxFrameRate;
// ----------------- Constructor ---------------------
/// <summary> Retrieve capabilities of a video device </summary>
internal VideoCapabilities(IAMStreamConfig videoStreamConfig)
{
if ( videoStreamConfig == null )
throw new ArgumentNullException( "videoStreamConfig" );
AMMediaType mediaType = null;
VideoStreamConfigCaps caps = null;
IntPtr pCaps = IntPtr.Zero;
IntPtr pMediaType;
try
{
// Ensure this device reports capabilities
int c, size;
int hr = videoStreamConfig.GetNumberOfCapabilities( out c, out size );
if ( hr != 0 ) Marshal.ThrowExceptionForHR( hr );
if ( c <= 0 )
throw new NotSupportedException( "This video device does not report capabilities." );
if ( size > Marshal.SizeOf( typeof( VideoStreamConfigCaps ) ) )
throw new NotSupportedException( "Unable to retrieve video device capabilities. This video device requires a larger VideoStreamConfigCaps structure." );
if ( c > 1 )
Debug.WriteLine("This video device supports " + c + " capability structures. Only the first structure will be used." );
// Alloc memory for structure
pCaps = Marshal.AllocCoTaskMem( Marshal.SizeOf( typeof( VideoStreamConfigCaps ) ) );
// Retrieve first (and hopefully only) capabilities struct
hr = videoStreamConfig.GetStreamCaps( 0, out pMediaType, pCaps );
if ( hr != 0 ) Marshal.ThrowExceptionForHR( hr );
// Convert pointers to managed structures
mediaType = (AMMediaType) Marshal.PtrToStructure( pMediaType, typeof( AMMediaType ) );
caps = (VideoStreamConfigCaps) Marshal.PtrToStructure( pCaps, typeof( VideoStreamConfigCaps ) );
// Extract info
InputSize = caps.InputSize;
MinFrameSize = caps.MinOutputSize;
MaxFrameSize = caps.MaxOutputSize;
FrameSizeGranularityX = caps.OutputGranularityX;
FrameSizeGranularityY = caps.OutputGranularityY;
MinFrameRate = (double)10000000 / caps.MaxFrameInterval;
MaxFrameRate = (double)10000000 / caps.MinFrameInterval;
}
finally
{
if ( pCaps != IntPtr.Zero )
Marshal.FreeCoTaskMem( pCaps ); pCaps = IntPtr.Zero;
if ( mediaType != null )
DsUtils.FreeAMMediaType( mediaType ); mediaType = null;
}
}
}
}
| {
"content_hash": "22e281c6ad19caab2ca5f8c21be74150",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 165,
"avg_line_length": 37.526315789473685,
"alnum_prop": 0.7051893408134642,
"repo_name": "mind0n/hive",
"id": "6f0b39b4ff6a09f2afdafe60f6f6fd837c776a56",
"size": "3805",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Cache/Samples/Cam/DxCamera/DirectX.Capture/VideoCapabilities.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "670329"
},
{
"name": "ActionScript",
"bytes": "7830"
},
{
"name": "ApacheConf",
"bytes": "47"
},
{
"name": "Batchfile",
"bytes": "18096"
},
{
"name": "C",
"bytes": "19746409"
},
{
"name": "C#",
"bytes": "258148996"
},
{
"name": "C++",
"bytes": "48534520"
},
{
"name": "CSS",
"bytes": "933736"
},
{
"name": "ColdFusion",
"bytes": "10780"
},
{
"name": "GLSL",
"bytes": "3935"
},
{
"name": "HTML",
"bytes": "4631854"
},
{
"name": "Java",
"bytes": "10881"
},
{
"name": "JavaScript",
"bytes": "10250558"
},
{
"name": "Logos",
"bytes": "1526844"
},
{
"name": "MAXScript",
"bytes": "18182"
},
{
"name": "Mathematica",
"bytes": "1166912"
},
{
"name": "Objective-C",
"bytes": "2937200"
},
{
"name": "PHP",
"bytes": "81898"
},
{
"name": "Perl",
"bytes": "9496"
},
{
"name": "PowerShell",
"bytes": "44339"
},
{
"name": "Python",
"bytes": "188058"
},
{
"name": "Shell",
"bytes": "758"
},
{
"name": "Smalltalk",
"bytes": "5818"
},
{
"name": "TypeScript",
"bytes": "50090"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Backend.ViewModels
{
public class PaymentViewModel
{
public int Id { get; set; }
public int AssocId { get; set; }
public string Month { get; set; }
public int Year { get; set; }
public bool Paid { get; set; }
public string DatePaid { get; set; }
}
}
| {
"content_hash": "9f82327d10cc149268afc69780525ab5",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 44,
"avg_line_length": 24.333333333333332,
"alnum_prop": 0.6278538812785388,
"repo_name": "isboat/ibunionportal",
"id": "889e8a0e173e525b620a589bdb6d6c559c6fdd95",
"size": "440",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/PortalBackend/Backend.ViewModels/PaymentViewModel.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "307"
},
{
"name": "C#",
"bytes": "481469"
},
{
"name": "CSS",
"bytes": "7806"
},
{
"name": "HTML",
"bytes": "26866"
},
{
"name": "JavaScript",
"bytes": "111317"
}
],
"symlink_target": ""
} |
from ._abstract import AbstractScraper
class EthanChlebowski(AbstractScraper):
@classmethod
def host(cls):
return "ethanchlebowski.com"
def author(self):
return self.schema.author()
def title(self):
return self.schema.title()
def category(self):
return self.schema.category()
def total_time(self):
return self.schema.total_time()
def yields(self):
return self.schema.yields()
def image(self):
return self.schema.image()
def ingredients(self):
return self.schema.ingredients()
def instructions(self):
return self.schema.instructions()
def ratings(self):
return None
def cuisine(self):
return None
def description(self):
return self.soup.head.find("meta", {"property": "og:description"})["content"]
| {
"content_hash": "a5e2d7b11aba05573f6405ff62f45f31",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 85,
"avg_line_length": 21.45,
"alnum_prop": 0.6305361305361306,
"repo_name": "hhursev/recipe-scraper",
"id": "d555c438dc5a654f4cbf2a821612dc76f9cb8c66",
"size": "858",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "recipe_scrapers/ethanchlebowski.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "88554"
}
],
"symlink_target": ""
} |
module Fog
module Compute
class Aliyun
class Real
# Describe disks.
#
# ==== Parameters
# * options<~hash>
# * :diskIds - arry of diskId, the length of arry should less than or equal to 100.
# * :instanceId - id of the instance
# * :diskType - Default 'all'.Can be set to all | system | data
# * :category - Default 'all'. Can be set to all | cloud | cloud_efficiency | cloud_ssd | ephemeral | ephemeral_ssd
# * :state - status of the disk. Default 'All'. Can be set to In_use | Available | Attaching | Detaching | Creating | ReIniting | All
# * :snapshotId - id of snapshot which used to create disk.
# * :name - name of disk
# * :portable - If ture, can exist dependently,which means it can be mount or umont in available zones.
# Else, it must be created or destroyed with a instance.
# The value for ocal disks and system disks on the cloud and cloud disks paid by month must be false.
# * :delWithIns - If ture, the disk will be released when the instance is released.
# * :delAutoSna - If ture, the auto created snapshot will be destroyed when the disk is destroyed
# * :enAutoSna - Whether the disk apply the auto snapshot strategy.
# * :diskChargeType - Prepaid | Postpaid
# ==== Returns
# * response<~Excon::Response>:
# * body<~Hash>:
# * 'RequestId'<~String> - Id of the request
# * 'Disks'<~Hash> - list of Disk,and the parameter of disk refer to the Volume model
#
# {Aliyun API Reference}[https://docs.aliyun.com/?spm=5176.100054.3.1.DGkmH7#/pub/ecs/open-api/disk&describedisks]
def list_disks(options = {})
action = 'DescribeDisks'
sigNonce = randonStr
time = Time.new.utc
parameters = defaultParameters(action, sigNonce, time)
pathUrl = defaultAliyunUri(action, sigNonce, time)
pageNumber = options[:pageNumber]
pageSize = options[:pageSize]
instanceId = options[:instanceId]
diskIds = options[:diskIds]
diskType = options[:diskType]
category = options[:category]
state = options[:state]
snapshotId = options[:snapshotId]
name = options[:name]
portable = options[:portable]
delWithIns = options[:deleteWithInstance]
delAutoSna = options[:deleteAutoSnapshot]
enAutoSna = options[:enableAutoSnapshot]
diskChargeType = options[:diskChargeType]
if diskChargeType
parameters['DiskChargeType'] = diskChargeType
pathUrl += '&DiskChargeType='
pathUrl += diskChargeType
end
if enAutoSna
parameters['EnableAutoSnapshot'] = enAutoSna
pathUrl += '&EnableAutoSnapshot='
pathUrl += enAutoSna
end
if delAutoSna
parameters['DeleteAutoSnapshot'] = delAutoSna
pathUrl += '&DeleteAutoSnapshot='
pathUrl += delAutoSna
end
if delWithIns
parameters['DeleteWithInstance'] = delWithIns
pathUrl += '&DeleteWithInstance='
pathUrl += delWithIns
end
if portable
parameters['Portable'] = portable
pathUrl += '&Portable='
pathUrl += portable
end
if name
parameters['DiskName'] = name
pathUrl += '&DiskName='
pathUrl += name
end
if snapshotId
parameters['SnapshotId'] = snapshotId
pathUrl += '&SnapshotId='
pathUrl += snapshotId
end
if state
parameters['Status'] = state
pathUrl += '&Status='
pathUrl += state
end
if category
parameters['DiskType'] = diskType
pathUrl += '&DiskType='
pathUrl += diskType
end
if category
parameters['Category'] = category
pathUrl += '&Category='
pathUrl += category
end
if instanceId
parameters['InstanceId'] = instanceId
pathUrl += '&InstanceId='
pathUrl += instanceId
end
if diskIds
parameters['DiskIds'] = Fog::JSON.encode(diskIds)
pathUrl += '&DiskIds='
pathUrl += Fog::JSON.encode(diskIds)
end
if pageNumber
parameters['PageNumber'] = pageNumber
pathUrl += '&PageNumber='
pathUrl += pageNumber
end
pageSize = options[:pageSize]
pageSize ||= '50'
parameters['PageSize'] = pageSize
pathUrl += '&PageSize='
pathUrl += pageSize
signature = sign(@aliyun_accesskey_secret, parameters)
pathUrl += '&Signature='
pathUrl += signature
request(
expects: [200, 203],
method: 'GET',
path: pathUrl
)
end
end
end
end
end
| {
"content_hash": "f1459a0fabc7d2fa183a9983842f437e",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 145,
"avg_line_length": 34.78666666666667,
"alnum_prop": 0.5421617477960905,
"repo_name": "fog/fog-aliyun",
"id": "1cc8b7ec8da207bf24379819710be71f0789cd66",
"size": "5249",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/fog/aliyun/requests/compute/list_disks.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "251663"
},
{
"name": "Shell",
"bytes": "115"
}
],
"symlink_target": ""
} |
function initialize() {
//Setup Google Map
var myLatlng = new google.maps.LatLng(17.7850,-12.4183);
var light_grey_style = [{"featureType":"landscape","stylers":[{"saturation":-100},{"lightness":65},{"visibility":"on"}]},{"featureType":"poi","stylers":[{"saturation":-100},{"lightness":51},{"visibility":"simplified"}]},{"featureType":"road.highway","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"road.arterial","stylers":[{"saturation":-100},{"lightness":30},{"visibility":"on"}]},{"featureType":"road.local","stylers":[{"saturation":-100},{"lightness":40},{"visibility":"on"}]},{"featureType":"transit","stylers":[{"saturation":-100},{"visibility":"simplified"}]},{"featureType":"administrative.province","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":-25},{"saturation":-100}]},{"featureType":"water","elementType":"geometry","stylers":[{"hue":"#ffff00"},{"lightness":-25},{"saturation":-97}]}];
var myOptions = {
zoom: 2,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
position: google.maps.ControlPosition.LEFT_BOTTOM
},
styles: light_grey_style
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
//Setup markerCluster
var markerClusterOptions = {
minimumClusterSize: 5
}
var markerCluster = new MarkerClusterer(map, [], markerClusterOptions);
if(io !== undefined) {
// Storage for WebSocket connections
var socket = io.connect('/');
// This listens on the "twitter-steam" channel and data is
// received everytime a new tweet is receieved.
socket.on('twitter-stream', function (data) {
//Create the location of the tweet
var tweetLocation = new google.maps.LatLng(data.lng,data.lat);
//Flash a dot onto the map quickly
var image = "css/small-dot-icon.png";
var marker = new google.maps.Marker({
position: tweetLocation,
map: map
});
markerCluster.addMarker(marker);
});
// Listens for a success response from the server to
// say the connection was successful.
socket.on("connected", function(r) {
//Now that we are connected to the server let's tell
//the server we are ready to start receiving tweets.
socket.emit("start tweets");
});
}
} | {
"content_hash": "ed4e6030d04030b84ce873cd96746c71",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 907,
"avg_line_length": 45.58181818181818,
"alnum_prop": 0.6577582768248903,
"repo_name": "udaysagar2177/twitter-streaming-nodejs",
"id": "2df5fc4b2466f2a017d980c3bec25659e17cd28b",
"size": "2507",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/js/twitterStream.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1979"
},
{
"name": "HTML",
"bytes": "3487"
},
{
"name": "JavaScript",
"bytes": "7455"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "4615f988f30271bdbd1d5575ba4cd580",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "e4b28a007da35b09cfe18e9286be0a58ff74fd23",
"size": "190",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Verbenaceae/Priva/Priva carolinensis/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package org.apache.ignite.internal.processors.query.h2.sql;
import java.io.Serializable;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import javax.cache.CacheException;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.cache.CacheMode;
import org.apache.ignite.cache.affinity.AffinityKey;
import org.apache.ignite.cache.query.SqlFieldsQuery;
import org.apache.ignite.cache.query.SqlQuery;
import org.apache.ignite.cache.query.annotations.QuerySqlField;
import org.apache.ignite.cache.query.annotations.QuerySqlFunction;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.testframework.GridTestUtils;
import org.junit.Ignore;
import org.junit.Test;
/**
* Base set of queries to compare query results from h2 database instance and mixed ignite caches (replicated and partitioned)
* which have the same data models and data content.
*/
public class BaseH2CompareQueryTest extends AbstractH2CompareQueryTest {
/** Org count. */
public static final int ORG_CNT = 30;
/** Address count. */
public static final int ADDR_CNT = 10;
/** Person count. */
public static final int PERS_CNT = 50;
/** Product count. */
public static final int PROD_CNT = 100;
/** Purchase count. */
public static final int PURCH_CNT = PROD_CNT * 5;
/** */
protected static final String ORG = "org";
/** */
protected static final String PERS = "pers";
/** */
protected static final String PURCH = "purch";
/** */
protected static final String PROD = "prod";
/** */
protected static final String ADDR = "addr";
/** Cache org. */
private static IgniteCache<Integer, Organization> cacheOrg;
/** Cache pers. */
private static IgniteCache<AffinityKey, Person> cachePers;
/** Cache purch. */
private static IgniteCache<AffinityKey, Purchase> cachePurch;
/** Cache prod. */
private static IgniteCache<Integer, Product> cacheProd;
/** Cache address. */
private static IgniteCache<Integer, Address> cacheAddr;
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(gridName);
cfg.setCacheConfiguration(
cacheConfiguration(ORG, CacheMode.PARTITIONED, Integer.class, Organization.class),
cacheConfiguration(PERS, CacheMode.PARTITIONED, AffinityKey.class, Person.class),
cacheConfiguration(PURCH, CacheMode.PARTITIONED, AffinityKey.class, Purchase.class),
cacheConfiguration(PROD, CacheMode.REPLICATED, Integer.class, Product.class),
cacheConfiguration(ADDR, CacheMode.REPLICATED, Integer.class, Address.class));
return cfg;
}
/** {@inheritDoc} */
@Override protected void afterTestsStopped() throws Exception {
super.afterTestsStopped();
cacheOrg = null;
cachePers = null;
cachePurch = null;
cacheProd = null;
cacheAddr = null;
}
/** {@inheritDoc} */
@Override protected void createCaches() {
cacheOrg = jcache(
ignite,
cacheConfiguration(ORG, CacheMode.PARTITIONED, Integer.class, Organization.class),
ORG,
Integer.class,
Organization.class
);
cachePers = ignite.cache(PERS);
cachePurch = ignite.cache(PURCH);
cacheProd = ignite.cache(PROD);
cacheAddr = ignite.cache(ADDR);
}
/** {@inheritDoc} */
@Override protected void initCacheAndDbData() throws SQLException {
int idGen = 0;
// Organizations.
List<Organization> organizations = new ArrayList<>();
for (int i = 0; i < ORG_CNT; i++) {
int id = idGen++;
Organization org = new Organization(id, "Org" + id);
organizations.add(org);
cacheOrg.put(org.id, org);
insertInDb(org);
}
// Adresses.
List<Address> addreses = new ArrayList<>();
for (int i = 0; i < ADDR_CNT; i++) {
int id = idGen++;
Address addr = new Address(id, "Addr" + id);
addreses.add(addr);
cacheAddr.put(addr.id, addr);
insertInDb(addr);
}
// Persons.
List<Person> persons = new ArrayList<>();
for (int i = 0; i < PERS_CNT; i++) {
int id = idGen++;
Person person = new Person(id, organizations.get(i % organizations.size()),
"name" + id, "lastName" + id, id * 100.0, addreses.get(i % addreses.size()));
// Add a Person without lastname.
if (id == organizations.size() + 1)
person.lastName = null;
persons.add(person);
cachePers.put(person.key(), person);
insertInDb(person);
}
// Products.
List<Product> products = new ArrayList<>();
for (int i = 0; i < PROD_CNT; i++) {
int id = idGen++;
Product product = new Product(id, "Product" + id, id * 1000);
products.add(product);
cacheProd.put(product.id, product);
insertInDb(product);
}
// Purchases.
for (int i = 0; i < PURCH_CNT; i++) {
int id = idGen++;
Person person = persons.get(i % persons.size());
Purchase purchase = new Purchase(id, products.get(i % products.size()), person.orgId, person);
cachePurch.put(purchase.key(), purchase);
insertInDb(purchase);
}
}
/** {@inheritDoc} */
@Override protected void checkAllDataEquals() throws Exception {
compareQueryRes0(cacheOrg, "select _key, _val, id, name from \"org\".Organization");
compareQueryRes0(cachePers, "select _key, _val, id, firstName, lastName, orgId, salary from \"pers\".Person");
compareQueryRes0(cachePurch, "select _key, _val, id, personId, productId, organizationId from \"purch\".Purchase");
compareQueryRes0(cacheProd, "select _key, _val, id, name, price from \"prod\".Product");
}
/**
*
*/
@Test
public void testSelectStar() {
assertEquals(1, cachePers.query(new SqlQuery<AffinityKey<?>, Person>(
Person.class, "\t\r\n select \n*\t from Person limit 1")).getAll().size());
GridTestUtils.assertThrows(log, new Callable<Object>() {
@Override public Object call() throws Exception {
cachePers.query(new SqlQuery(Person.class, "SELECT firstName from PERSON"));
return null;
}
}, CacheException.class, null);
}
/**
* @throws Exception If failed.
*/
@Test
public void testInvalidQuery() throws Exception {
final SqlFieldsQuery sql = new SqlFieldsQuery("SELECT firstName from Person where id <> ? and orgId <> ?");
GridTestUtils.assertThrows(log, new Callable<Object>() {
@Override public Object call() throws Exception {
cachePers.query(sql.setArgs(3)).getAll();
return null;
}
}, CacheException.class, "Invalid number of query parameters");
}
/**
* @throws Exception If failed.
*/
@Ignore("https://issues.apache.org/jira/browse/IGNITE-705")
@Test
public void testAllExamples() throws Exception {
// compareQueryRes0("select ? limit ? offset ?");
// compareQueryRes0("select cool1()");
// compareQueryRes0("select cool1() z");
//
// compareQueryRes0("select b,a from table0('aaa', 100)");
// compareQueryRes0("select * from table0('aaa', 100)");
// compareQueryRes0("select * from table0('aaa', 100) t0");
// compareQueryRes0("select x.a, y.b from table0('aaa', 100) x natural join table0('bbb', 100) y");
// compareQueryRes0("select * from table0('aaa', 100) x join table0('bbb', 100) y on x.a=y.a and x.b = 'bbb'");
// compareQueryRes0("select * from table0('aaa', 100) x left join table0('bbb', 100) y on x.a=y.a and x.b = 'bbb'");
// compareQueryRes0("select * from table0('aaa', 100) x left join table0('bbb', 100) y on x.a=y.a where x.b = 'bbb'");
// compareQueryRes0("select * from table0('aaa', 100) x left join table0('bbb', 100) y where x.b = 'bbb'");
final String addStreet = "Addr" + ORG_CNT + 1;
List<List<?>> res = compareQueryRes0(cachePers,
"select avg(old) from \"pers\".Person left join \"addr\".Address " +
" on Person.addrId = Address.id where lower(Address.street) = lower(?)", addStreet);
assertNotSame(0, res);
compareQueryRes0(cachePers,
"select avg(old) from \"pers\".Person join \"addr\".Address on Person.addrId = Address.id " +
"where lower(Address.street) = lower(?)", addStreet);
compareQueryRes0(cachePers,
"select avg(old) from \"pers\".Person left join \"addr\".Address " +
"where Person.addrId = Address.id " +
"and lower(Address.street) = lower(?)", addStreet);
compareQueryRes0(cachePers,
"select avg(old) from \"pers\".Person, \"addr\".Address where Person.addrId = Address.id " +
"and lower(Address.street) = lower(?)", addStreet);
compareQueryRes0(cachePers, "select firstName, date from \"pers\".Person");
compareQueryRes0(cachePers, "select distinct firstName, date from \"pers\".Person");
final String star = " _key, _val, id, firstName, lastName, orgId, salary, addrId, old, date ";
compareQueryRes0(cachePers, "select " + star + " from \"pers\".Person p");
compareQueryRes0(cachePers, "select " + star + " from \"pers\".Person");
compareQueryRes0(cachePers, "select distinct " + star + " from \"pers\".Person");
compareQueryRes0(cachePers, "select p.firstName, date from \"pers\".Person p");
compareQueryRes0(cachePers, "select p._key, p._val, p.id, p.firstName, p.lastName, " +
"p.orgId, p.salary, p.addrId, p.old, " +
" p.date, a._key, a._val, a.id, a.street" +
" from \"pers\".Person p, \"addr\".Address a");
// compareQueryRes0("select p.* from \"part\".Person p, \"repl\".Address a");
// compareQueryRes0("select person.* from \"part\".Person, \"repl\".Address a");
// compareQueryRes0("select p.*, street from \"part\".Person p, \"repl\".Address a");
compareQueryRes0(cachePers, "select p.firstName, a.street from \"pers\".Person p, \"addr\".Address a");
compareQueryRes0(cachePers, "select distinct p.firstName, a.street from \"pers\".Person p, " +
"\"addr\".Address a");
compareQueryRes0(cachePers, "select distinct firstName, street from \"pers\".Person, " +
"\"addr\".Address group by firstName, street ");
compareQueryRes0(cachePers, "select distinct firstName, street from \"pers\".Person, " +
"\"addr\".Address");
// TODO uncomment and investigate (Rows count has to be equal.: Expected :2500, Actual :900)
//compareQueryRes0(
// "select p1.firstName, a2.street from \"part\".Person p1, \"repl\".Address a1, \"part\".Person p2, \"repl\".Address a2"
//);
//TODO look at it (org.h2.jdbc.JdbcSQLException: Feature not supported: "VARCHAR +" // at H2)
// compareQueryRes0("select p.firstName n, a.street s from \"part\".Person p, \"repl\".Address a");
compareQueryRes0(cachePers, "select p.firstName, 1 as i, 'aaa' s from \"pers\".Person p");
// compareQueryRes0("select p.firstName + 'a', 1 * 3 as i, 'aaa' s, -p.old, -p.old as old from \"part\".Person p");
// compareQueryRes0("select p.firstName || 'a' + p.firstName, (p.old * 3) % p.old - p.old / p.old, p.firstName = 'aaa', " +
// " p.firstName is p.firstName, p.old > 0, p.old >= 0, p.old < 0, p.old <= 0, p.old <> 0, p.old is not p.old, " +
// " p.old is null, p.old is not null " +
// " from \"part\".Person p");
compareQueryRes0(cachePers, "select p.firstName from \"pers\".Person p where firstName <> 'ivan'");
compareQueryRes0(cachePers, "select p.firstName from \"pers\".Person p where firstName like 'i%'");
compareQueryRes0(cachePers, "select p.firstName from \"pers\".Person p where firstName regexp 'i%'");
compareQueryRes0(cachePers, "select p.firstName from \"pers\".Person p, \"addr\".Address a " +
"where p.firstName <> 'ivan' and a.id > 10 or not (a.id = 100)");
compareQueryRes0(cachePers, "select case p.firstName " +
"when 'a' then 1 when 'a' then 2 end as a from \"pers\".Person p");
compareQueryRes0(cachePers, "select case p.firstName " +
"when 'a' then 1 when 'a' then 2 else -1 end as a from \"pers\".Person p");
compareQueryRes0(cachePers, "select abs(p.old) from \"pers\".Person p");
compareQueryRes0(cachePers, "select cast(p.old as numeric(10, 2)) from \"pers\".Person p");
compareQueryRes0(cachePers, "select cast(p.old as numeric(10, 2)) z from \"pers\".Person p");
compareQueryRes0(cachePers, "select cast(p.old as numeric(10, 2)) as z from \"pers\".Person p");
// TODO analyse
// compareQueryRes0("select " + star + " from \"part\".Person p where p.firstName in ('a', 'b', '_' + RAND())"); // test ConditionIn
// test ConditionInConstantSet
compareQueryRes0(cachePers, "select " + star + " from \"pers\".Person p where p.firstName in ('a', 'b', 'c')");
compareQueryRes0(cachePers, "select " + star + " from \"pers\".Person p " +
"where p.firstName in (select a.street from \"addr\".Address a)"); // test ConditionInConstantSet
compareQueryRes0(cachePers, "select (select a.street from \"addr\".Address a " +
"where a.id = p.addrId) from \"pers\".Person p"); // test ConditionInConstantSet
compareQueryRes0(cachePers, "select p.firstName, ? from \"pers\".Person p " +
"where firstName regexp ? and p.old < ?", 10, "Iv*n", 40);
compareQueryRes0(cachePers, "select count(*) as a from \"pers\".Person");
compareQueryRes0(cachePers, "select count(*) as a, count(p.*), count(p.firstName) " +
"from \"pers\".Person p");
compareQueryRes0(cachePers, "select count(distinct p.firstName) " +
"from \"pers\".Person p");
compareQueryRes0(cachePers, "select p.firstName, avg(p.old), max(p.old) " +
"from \"pers\".Person p group by p.firstName");
compareQueryRes0(cachePers, "select p.firstName n, avg(p.old) a, max(p.old) m " +
"from \"pers\".Person p group by p.firstName");
compareQueryRes0(cachePers, "select p.firstName n, avg(p.old) a, max(p.old) m " +
"from \"pers\".Person p group by n");
compareQueryRes0(cachePers, "select p.firstName n, avg(p.old) a, max(p.old) m " +
"from \"pers\".Person p group by p.addrId, p.firstName");
compareQueryRes0(cachePers, "select p.firstName n, avg(p.old) a, max(p.old) m " +
"from \"pers\".Person p group by p.firstName, p.addrId");
compareQueryRes0(cachePers, "select p.firstName n, max(p.old) + min(p.old) / count(distinct p.old) " +
"from \"pers\".Person p group by p.firstName");
compareQueryRes0(cachePers, "select p.firstName n, max(p.old) maxOld, min(p.old) minOld " +
"from \"pers\".Person p group by p.firstName having maxOld > 10 and min(p.old) < 1");
compareQueryRes0(cachePers, "select p.firstName n, avg(p.old) a, max(p.old) m " +
"from \"pers\".Person p group by p.firstName order by n");
compareQueryRes0(cachePers, "select p.firstName n, avg(p.old) a, max(p.old) m " +
"from \"pers\".Person p group by p.firstName order by p.firstName");
compareQueryRes0(cachePers, "select p.firstName n, avg(p.old) a, max(p.old) m " +
"from \"pers\".Person p group by p.firstName order by p.firstName, m");
compareQueryRes0(cachePers, "select p.firstName n, avg(p.old) a, max(p.old) m " +
"from \"pers\".Person p group by p.firstName order by p.firstName, max(p.old) desc");
compareQueryRes0(cachePers, "select p.firstName n, avg(p.old) a, max(p.old) m " +
"from \"pers\".Person p group by p.firstName order by p.firstName nulls first");
compareQueryRes0(cachePers, "select p.firstName n, avg(p.old) a, max(p.old) m " +
"from \"pers\".Person p group by p.firstName order by p.firstName nulls last");
compareQueryRes0(cachePers, "select p.firstName n from \"pers\".Person p order by p.old + 10");
compareQueryRes0(cachePers, "select p.firstName n from \"pers\".Person p " +
"order by p.old + 10, p.firstName");
compareQueryRes0(cachePers, "select p.firstName n from \"pers\".Person p " +
"order by p.old + 10, p.firstName desc");
compareQueryRes0(cachePers, "select p.firstName n from \"pers\".Person p, " +
"(select a.street from \"addr\".Address a where a.street is not null)");
compareQueryRes0(cachePers, "select street from \"pers\".Person p, " +
"(select a.street from \"addr\".Address a where a.street is not null) ");
compareQueryRes0(cachePers, "select addr.street from \"pers\".Person p, " +
"(select a.street from \"addr\".Address a where a.street is not null) addr");
compareQueryRes0(cachePers, "select p.firstName n from \"pers\".Person p order by p.old + 10");
compareQueryRes0(cachePers, "select 'foo' as bar union select 'foo' as bar");
compareQueryRes0(cachePers, "select 'foo' as bar union all select 'foo' as bar");
// compareQueryRes0("select count(*) as a from Person union select count(*) as a from Address");
// compareQueryRes0("select old, count(*) as a from Person group by old union select 1, count(*) as a from Address");
// compareQueryRes0("select name from Person MINUS select street from Address");
// compareQueryRes0("select name from Person EXCEPT select street from Address");
// compareQueryRes0("select name from Person INTERSECT select street from Address");
// compareQueryRes0("select name from Person UNION select street from Address limit 5");
// compareQueryRes0("select name from Person UNION select street from Address limit ?");
// compareQueryRes0("select name from Person UNION select street from Address limit ? offset ?");
// compareQueryRes0("(select name from Person limit 4) UNION (select street from Address limit 1) limit ? offset ?");
// compareQueryRes0("(select 2 a) union all (select 1) order by 1");
// compareQueryRes0("(select 2 a) union all (select 1) order by a desc nulls first limit ? offset ?");
}
/**
* @throws Exception If failed.
*/
@Test
public void testParamSubstitution() throws Exception {
compareQueryRes0(cachePers, "select ? from \"pers\".Person", "Some arg");
}
/**
* @throws SQLException If failed.
*/
@Test
public void testAggregateOrderBy() throws SQLException {
compareOrderedQueryRes0(cachePers, "select firstName name, count(*) cnt from \"pers\".Person " +
"group by name order by cnt, name desc");
}
/**
* @throws Exception If failed.
*/
@Test
public void testNullParamSubstitution() throws Exception {
List<List<?>> rs1 = compareQueryRes0(cachePers, "select ? from \"pers\".Person", null);
// Ensure we find something.
assertFalse(rs1.isEmpty());
}
/**
*
*/
@Test
public void testUnion() throws SQLException {
String base = "select _val v from \"pers\".Person";
compareQueryRes0(cachePers, base + " union all " + base);
compareQueryRes0(cachePers, base + " union " + base);
base = "select firstName||lastName name, salary from \"pers\".Person";
assertEquals(PERS_CNT * 2, compareOrderedQueryRes0(cachePers, base + " union all " + base + " order by salary desc").size());
assertEquals(PERS_CNT, compareOrderedQueryRes0(cachePers, base + " union " + base + " order by salary desc").size());
}
/**
* @throws Exception If failed.
*/
@Test
public void testEmptyResult() throws Exception {
compareQueryRes0(cachePers, "select id from \"pers\".Person where 0 = 1");
}
/**
* @throws Exception If failed.
*/
@Test
public void testSqlQueryWithAggregation() throws Exception {
compareQueryRes0(cachePers, "select avg(salary) from \"pers\".Person, \"org\".Organization " +
"where Person.orgId = Organization.id and " +
"lower(Organization.name) = lower(?)", "Org1");
}
/**
* @throws Exception If failed.
*/
@Test
public void testSqlFieldsQuery() throws Exception {
compareQueryRes0(cachePers, "select concat(firstName, ' ', lastName) from \"pers\".Person");
}
/**
* @throws Exception If failed.
*/
@Test
public void testSqlFieldsQueryWithJoin() throws Exception {
compareQueryRes0(cachePers, "select concat(firstName, ' ', lastName), "
+ "Organization.name from \"pers\".Person, \"org\".Organization where "
+ "Person.orgId = Organization.id");
}
/**
* @throws Exception If failed.
*/
@Test
public void testOrdered() throws Exception {
compareOrderedQueryRes0(cachePers, "select firstName, lastName" +
" from \"pers\".Person" +
" order by lastName, firstName");
}
/**
* @throws Exception If failed.
*/
@Test
public void testSimpleJoin() throws Exception {
// Have expected results.
compareQueryRes0(cachePers, String.format("select id, firstName, lastName" +
" from \"%s\".Person" +
" where Person.id = ?", cachePers.getName()), 3);
// Ignite cache return 0 results...
compareQueryRes0(cachePers, "select pe.firstName" +
" from \"pers\".Person pe join \"purch\".Purchase pu on pe.id = pu.personId " +
" where pe.id = ?", 3);
}
/**
* @throws Exception If failed.
*/
@Test
public void testSimpleReplicatedSelect() throws Exception {
compareQueryRes0(cacheProd, "select id, name from \"prod\".Product");
}
/**
* @throws Exception If failed.
*/
@Test
public void testCrossCache() throws Exception {
compareQueryRes0(cachePers, "select firstName, lastName" +
" from \"pers\".Person, \"purch\".Purchase" +
" where Person.id = Purchase.personId");
compareQueryRes0(cachePers, "select concat(firstName, ' ', lastName), Product.name " +
" from \"pers\".Person, \"purch\".Purchase, \"prod\".Product " +
" where Person.id = Purchase.personId and Purchase.productId = Product.id" +
" group by Product.id");
compareQueryRes0(cachePers, "select concat(firstName, ' ', lastName), count (Product.id) " +
" from \"pers\".Person, \"purch\".Purchase, \"prod\".Product " +
" where Person.id = Purchase.personId and Purchase.productId = Product.id" +
" group by Product.id");
}
/** {@inheritDoc} */
@Override protected Statement initializeH2Schema() throws SQLException {
Statement st = super.initializeH2Schema();
st.execute("CREATE SCHEMA \"org\"");
st.execute("CREATE SCHEMA \"pers\"");
st.execute("CREATE SCHEMA \"prod\"");
st.execute("CREATE SCHEMA \"purch\"");
st.execute("CREATE SCHEMA \"addr\"");
st.execute("create table \"org\".ORGANIZATION" +
" (_key int not null," +
" _val other not null," +
" id int unique," +
" name varchar(255))");
st.execute("create table \"pers\".PERSON" +
" (_key other not null ," +
" _val other not null ," +
" id int unique, " +
" firstName varchar(255), " +
" lastName varchar(255)," +
" orgId int not null," +
" salary double," +
" addrId int," +
" old int," +
" date Date )");
st.execute("create table \"prod\".PRODUCT" +
" (_key int not null ," +
" _val other not null ," +
" id int unique, " +
" name varchar(255), " +
" price int)");
st.execute("create table \"purch\".PURCHASE" +
" (_key other not null ," +
" _val other not null ," +
" id int unique, " +
" personId int, " +
" organizationId int, " +
" productId int)");
st.execute("create table \"addr\".ADDRESS" +
" (_key int not null ," +
" _val other not null ," +
" id int unique, " +
" street varchar(255))");
conn.commit();
return st;
}
/**
* Insert {@link Organization} at h2 database.
*
* @param org Organization.
* @throws SQLException If exception.
*/
private void insertInDb(Organization org) throws SQLException {
try (PreparedStatement st = conn.prepareStatement(
"insert into \"org\".ORGANIZATION (_key, _val, id, name) values(?, ?, ?, ?)")) {
st.setObject(1, org.id);
st.setObject(2, org);
st.setObject(3, org.id);
st.setObject(4, org.name);
st.executeUpdate();
}
}
/**
* Insert {@link Person} at h2 database.
*
* @param p Person.
* @throws SQLException If exception.
*/
private void insertInDb(Person p) throws SQLException {
try (PreparedStatement st = conn.prepareStatement("insert into \"pers\".PERSON " +
"(_key, _val, id, firstName, lastName, orgId, salary, addrId, old, date) values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")) {
st.setObject(1, p.key());
st.setObject(2, p);
st.setObject(3, p.id);
st.setObject(4, p.firstName);
st.setObject(5, p.lastName);
st.setObject(6, p.orgId);
st.setObject(7, p.salary);
st.setObject(8, p.addrId);
st.setObject(9, p.old);
st.setObject(10, p.date);
st.executeUpdate();
}
}
/**
* Insert {@link Product} at h2 database.
*
* @param p Product.
* @throws SQLException If exception.
*/
private void insertInDb(Product p) throws SQLException {
try (PreparedStatement st = conn.prepareStatement(
"insert into \"prod\".PRODUCT (_key, _val, id, name, price) values(?, ?, ?, ?, ?)")) {
st.setObject(1, p.id);
st.setObject(2, p);
st.setObject(3, p.id);
st.setObject(4, p.name);
st.setObject(5, p.price);
st.executeUpdate();
}
}
/**
* Insert {@link Purchase} at h2 database.
*
* @param p Purchase.
* @throws SQLException If exception.
*/
private void insertInDb(Purchase p) throws SQLException {
try (PreparedStatement st = conn.prepareStatement(
"insert into \"purch\".PURCHASE (_key, _val, id, personId, productId, organizationId) values(?, ?, ?, ?, ?, ?)")) {
st.setObject(1, p.key());
st.setObject(2, p);
st.setObject(3, p.id);
st.setObject(4, p.personId);
st.setObject(5, p.productId);
st.setObject(6, p.organizationId);
st.executeUpdate();
}
}
/**
* Insert {@link Address} at h2 database.
*
* @param a Address.
* @throws SQLException If exception.
*/
private void insertInDb(Address a) throws SQLException {
try (PreparedStatement st = conn.prepareStatement(
"insert into \"addr\".ADDRESS (_key, _val, id, street) values(?, ?, ?, ?)")) {
st.setObject(1, a.id);
st.setObject(2, a);
st.setObject(3, a.id);
st.setObject(4, a.street);
st.executeUpdate();
}
}
/** */
@QuerySqlFunction
public static int cool1() {
return 1;
}
/** */
@QuerySqlFunction
public static ResultSet table0(Connection c, String a, int b) throws SQLException {
return c.createStatement().executeQuery("select '" + a + "' as a, " + b + " as b");
}
/**
* Person class. Stored at partitioned cache.
*/
private static class Person implements Serializable {
/** Person ID (indexed). */
@QuerySqlField(index = true)
private int id;
/** Organization ID (indexed). */
@QuerySqlField(index = true)
private int orgId;
/** First name (not-indexed). */
@QuerySqlField
private String firstName;
/** Last name (not indexed). */
@QuerySqlField
private String lastName;
/** Salary (indexed). */
@QuerySqlField(index = true)
private double salary;
/** Address Id (indexed). */
@QuerySqlField(index = true)
private int addrId;
/** Date. */
@QuerySqlField(index = true)
public Date date = new Date(System.currentTimeMillis());
/** Old. */
@QuerySqlField(index = true)
public int old = 17;
/**
* Constructs person record.
*
* @param org Organization.
* @param firstName First name.
* @param lastName Last name.
* @param salary Salary.
*/
Person(int id, Organization org, String firstName, String lastName, double salary, Address addr) {
this.id = id;
this.firstName = firstName;
this.lastName = lastName;
this.salary = salary;
orgId = org.id;
addrId = addr.id;
}
/**
* @return Custom affinity key to guarantee that person is always collocated with organization.
*/
public AffinityKey<Integer> key() {
return new AffinityKey<>(id, orgId);
}
/** {@inheritDoc} */
@Override public boolean equals(Object o) {
return this == o || o instanceof Person && id == ((Person)o).id;
}
/** {@inheritDoc} */
@Override public int hashCode() {
return id;
}
/** {@inheritDoc} */
@Override public String toString() {
return "Person [firstName=" + firstName +
", lastName=" + lastName +
", id=" + id +
", orgId=" + orgId +
", salary=" + salary +
", addrId=" + addrId + ']';
}
}
/**
* Organization class. Stored at partitioned cache.
*/
private static class Organization implements Serializable {
/** Organization ID (indexed). */
@QuerySqlField(index = true)
private int id;
/** Organization name (indexed). */
@QuerySqlField(index = true)
private String name;
/**
* Create Organization.
*
* @param id Organization ID.
* @param name Organization name.
*/
Organization(int id, String name) {
this.id = id;
this.name = name;
}
/** {@inheritDoc} */
@Override public boolean equals(Object o) {
return this == o || o instanceof Organization && id == ((Organization)o).id;
}
/** {@inheritDoc} */
@Override public int hashCode() {
return id;
}
/** {@inheritDoc} */
@Override public String toString() {
return "Organization [id=" + id + ", name=" + name + ']';
}
}
/**
* Product class. Stored at replicated cache.
*/
private static class Product implements Serializable {
/** Primary key. */
@QuerySqlField(index = true)
private int id;
/** Product name. */
@QuerySqlField
private String name;
/** Product price */
@QuerySqlField
private int price;
/**
* Create Product.
*
* @param id Product ID.
* @param name Product name.
* @param price Product price.
*/
Product(int id, String name, int price) {
this.id = id;
this.name = name;
this.price = price;
}
/** {@inheritDoc} */
@Override public boolean equals(Object o) {
return this == o || o instanceof Product && id == ((Product)o).id;
}
/** {@inheritDoc} */
@Override public int hashCode() {
return id;
}
/** {@inheritDoc} */
@Override public String toString() {
return "Product [id=" + id + ", name=" + name + ", price=" + price + ']';
}
}
/**
* Purchase class. Stored at partitioned cache.
*/
private static class Purchase implements Serializable {
/** Primary key. */
@QuerySqlField(index = true)
private int id;
/** Product ID. */
@QuerySqlField
private int productId;
/** Person ID. */
@QuerySqlField
private int personId;
/** Organization id. */
@QuerySqlField
private int organizationId;
/**
* Create Purchase.
* @param id Purchase ID.
* @param product Purchase product.
* @param organizationId Organization Id.
* @param person Purchase person.
*/
Purchase(int id, Product product, int organizationId, Person person) {
this.id = id;
productId = product.id;
personId = person.id;
this.organizationId = organizationId;
}
/**
* @return Custom affinity key to guarantee that purchase is always collocated with person.
*/
public AffinityKey<Integer> key() {
return new AffinityKey<>(id, organizationId);
}
/** {@inheritDoc} */
@Override public boolean equals(Object o) {
return this == o || o instanceof Purchase && id == ((Purchase)o).id;
}
/** {@inheritDoc} */
@Override public int hashCode() {
return id;
}
/** {@inheritDoc} */
@Override public String toString() {
return "Purchase [id=" + id + ", productId=" + productId + ", personId=" + personId + ']';
}
}
/**
* Address class. Stored at replicated cache.
*/
private static class Address implements Serializable {
/** */
@QuerySqlField(index = true)
private int id;
/** */
@QuerySqlField(index = true)
private String street;
/** */
Address(int id, String street) {
this.id = id;
this.street = street;
}
/** {@inheritDoc} */
@Override public boolean equals(Object o) {
return this == o || o instanceof Address && id == ((Address)o).id;
}
/** {@inheritDoc} */
@Override public int hashCode() {
return id;
}
/** {@inheritDoc} */
@Override public String toString() {
return "Address [id=" + id + ", street=" + street + ']';
}
}
}
| {
"content_hash": "959fb425f365bd8763039f3c2294d922",
"timestamp": "",
"source": "github",
"line_count": 976,
"max_line_length": 139,
"avg_line_length": 36.896516393442624,
"alnum_prop": 0.5722973535864041,
"repo_name": "apache/ignite",
"id": "973d1abf509020d5a8f7d761cd424fd7e226cc8b",
"size": "36813",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/sql/BaseH2CompareQueryTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "55118"
},
{
"name": "C",
"bytes": "7601"
},
{
"name": "C#",
"bytes": "7749887"
},
{
"name": "C++",
"bytes": "4522204"
},
{
"name": "CMake",
"bytes": "54473"
},
{
"name": "Dockerfile",
"bytes": "12067"
},
{
"name": "FreeMarker",
"bytes": "18828"
},
{
"name": "HTML",
"bytes": "14341"
},
{
"name": "Java",
"bytes": "50663394"
},
{
"name": "JavaScript",
"bytes": "1085"
},
{
"name": "Jinja",
"bytes": "33639"
},
{
"name": "Makefile",
"bytes": "932"
},
{
"name": "PHP",
"bytes": "11079"
},
{
"name": "PowerShell",
"bytes": "9247"
},
{
"name": "Python",
"bytes": "336150"
},
{
"name": "Scala",
"bytes": "425434"
},
{
"name": "Shell",
"bytes": "311819"
}
],
"symlink_target": ""
} |
import unittest
from unittest import mock
from parameterized import parameterized
from airflow.api.common.experimental.trigger_dag import _trigger_dag
from airflow.exceptions import AirflowException
from airflow.models import DAG, DagRun
from airflow.utils import timezone
from tests.test_utils import db
class TestTriggerDag(unittest.TestCase):
def setUp(self) -> None:
db.clear_db_runs()
def tearDown(self) -> None:
db.clear_db_runs()
@mock.patch('airflow.models.DagBag')
def test_trigger_dag_dag_not_found(self, dag_bag_mock):
dag_bag_mock.dags = {}
with self.assertRaises(AirflowException):
_trigger_dag('dag_not_found', dag_bag_mock)
@mock.patch('airflow.api.common.experimental.trigger_dag.DagRun', spec=DagRun)
@mock.patch('airflow.models.DagBag')
def test_trigger_dag_dag_run_exist(self, dag_bag_mock, dag_run_mock):
dag_id = "dag_run_exist"
dag = DAG(dag_id)
dag_bag_mock.dags = [dag_id]
dag_bag_mock.get_dag.return_value = dag
dag_run_mock.find.return_value = DagRun()
with self.assertRaises(AirflowException):
_trigger_dag(dag_id, dag_bag_mock)
@mock.patch('airflow.models.DAG')
@mock.patch('airflow.api.common.experimental.trigger_dag.DagRun', spec=DagRun)
@mock.patch('airflow.models.DagBag')
def test_trigger_dag_include_subdags(self, dag_bag_mock, dag_run_mock, dag_mock):
dag_id = "trigger_dag"
dag_bag_mock.dags = [dag_id]
dag_bag_mock.get_dag.return_value = dag_mock
dag_run_mock.find.return_value = None
dag1 = mock.MagicMock(subdags=[])
dag2 = mock.MagicMock(subdags=[])
dag_mock.subdags = [dag1, dag2]
triggers = _trigger_dag(dag_id, dag_bag_mock)
self.assertEqual(3, len(triggers))
@mock.patch('airflow.models.DAG')
@mock.patch('airflow.api.common.experimental.trigger_dag.DagRun', spec=DagRun)
@mock.patch('airflow.models.DagBag')
def test_trigger_dag_include_nested_subdags(self, dag_bag_mock, dag_run_mock, dag_mock):
dag_id = "trigger_dag"
dag_bag_mock.dags = [dag_id]
dag_bag_mock.get_dag.return_value = dag_mock
dag_run_mock.find.return_value = None
dag1 = mock.MagicMock(subdags=[])
dag2 = mock.MagicMock(subdags=[dag1])
dag_mock.subdags = [dag1, dag2]
triggers = _trigger_dag(dag_id, dag_bag_mock)
self.assertEqual(3, len(triggers))
@mock.patch('airflow.models.DagBag')
def test_trigger_dag_with_too_early_start_date(self, dag_bag_mock):
dag_id = "trigger_dag_with_too_early_start_date"
dag = DAG(dag_id, default_args={'start_date': timezone.datetime(2016, 9, 5, 10, 10, 0)})
dag_bag_mock.dags = [dag_id]
dag_bag_mock.get_dag.return_value = dag
with self.assertRaises(ValueError):
_trigger_dag(dag_id, dag_bag_mock, execution_date=timezone.datetime(2015, 7, 5, 10, 10, 0))
@mock.patch('airflow.models.DagBag')
def test_trigger_dag_with_valid_start_date(self, dag_bag_mock):
dag_id = "trigger_dag_with_valid_start_date"
dag = DAG(dag_id, default_args={'start_date': timezone.datetime(2016, 9, 5, 10, 10, 0)})
dag_bag_mock.dags = [dag_id]
dag_bag_mock.get_dag.return_value = dag
dag_bag_mock.dags_hash = {}
triggers = _trigger_dag(dag_id, dag_bag_mock, execution_date=timezone.datetime(2018, 7, 5, 10, 10, 0))
assert len(triggers) == 1
@parameterized.expand(
[
(None, {}),
({"foo": "bar"}, {"foo": "bar"}),
('{"foo": "bar"}', {"foo": "bar"}),
]
)
@mock.patch('airflow.models.DagBag')
def test_trigger_dag_with_conf(self, conf, expected_conf, dag_bag_mock):
dag_id = "trigger_dag_with_conf"
dag = DAG(dag_id)
dag_bag_mock.dags = [dag_id]
dag_bag_mock.get_dag.return_value = dag
dag_bag_mock.dags_hash = {}
triggers = _trigger_dag(dag_id, dag_bag_mock, conf=conf)
self.assertEqual(triggers[0].conf, expected_conf)
| {
"content_hash": "dbd3c095acb93058f0e71d6387d3a49e",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 110,
"avg_line_length": 37.77981651376147,
"alnum_prop": 0.6301602719766877,
"repo_name": "mrkm4ntr/incubator-airflow",
"id": "9fb772d3576f9079419be933b8d73160a58f9b2c",
"size": "4906",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "tests/api/common/experimental/test_trigger_dag.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "22581"
},
{
"name": "Dockerfile",
"bytes": "31475"
},
{
"name": "HCL",
"bytes": "3786"
},
{
"name": "HTML",
"bytes": "221101"
},
{
"name": "JavaScript",
"bytes": "32643"
},
{
"name": "Jupyter Notebook",
"bytes": "2933"
},
{
"name": "Mako",
"bytes": "1339"
},
{
"name": "Python",
"bytes": "14407542"
},
{
"name": "Shell",
"bytes": "541811"
}
],
"symlink_target": ""
} |
package ch.heigvd.amt.amtproject.entities;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
@Entity
@NamedQueries({
@NamedQuery(name = "Account.testConnection", query = "SELECT u FROM Account u WHERE u.email = :username and u.password = :password")
})
public class Account extends AbstractEntity<Long> {
@Column(nullable = false, unique = true)
@Pattern(regexp = "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\."
+ "[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@"
+ "(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?",
message = "{invalid.email}")
private String email;
@NotNull
private String firstName;
@NotNull
private String lastName;
@NotNull
private String password;
@OneToMany(mappedBy = "account")
private List<Application> applications;
public Account() {
}
public Account(String email, String firstName, String lastName, String password) {
this.email = email;
this.firstName = firstName;
this.lastName = lastName;
this.password = password;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public List<Application> getApplications() {
return applications;
}
public void setApplications(List<Application> applications) {
this.applications = applications;
}
}
| {
"content_hash": "94ec9ce67803a31b26a52212c4e99b1e",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 136,
"avg_line_length": 24.813953488372093,
"alnum_prop": 0.6298031865042174,
"repo_name": "D34D10CK/Teaching-HEIGVD-AMT-2015-Project",
"id": "7ca09fad834ae135eee5333f3dc62ca7d8cefe94",
"size": "2134",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "AMTProject/src/main/java/ch/heigvd/amt/amtproject/entities/Account.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "21936"
},
{
"name": "HTML",
"bytes": "32224"
},
{
"name": "Java",
"bytes": "122761"
},
{
"name": "JavaScript",
"bytes": "86073"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "2283fb4514e134f0054637b569b6ba97",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "9352218561825c019317648d3c729d568b700233",
"size": "199",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Iridaceae/Lapeirousia/Lapeirousia pyramidalis/ Syn. Meristostigma bracteatum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
/**
* The Retained Evaluators example.
*/
package org.apache.reef.examples.retained_eval;
| {
"content_hash": "3149c08cbcceb50dfc7fc0cc3082f413",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 47,
"avg_line_length": 18.6,
"alnum_prop": 0.7311827956989247,
"repo_name": "beysims/reef",
"id": "842b659d73863758a5ee116768ab4831469837f0",
"size": "901",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lang/java/reef-examples/src/main/java/org/apache/reef/examples/retained_eval/package-info.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "986"
},
{
"name": "C#",
"bytes": "2055097"
},
{
"name": "C++",
"bytes": "114359"
},
{
"name": "Java",
"bytes": "3606102"
},
{
"name": "PowerShell",
"bytes": "6426"
},
{
"name": "Shell",
"bytes": "7597"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Hl7.Fhir.Serialization;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Hl7.Fhir.Tests
{
public class XmlAssert
{
public static void AreSame(XDocument expected, XDocument actual)
{
areSame(actual.Root.Name.LocalName, expected.Root, actual.Root);
}
public static void AreSame(string expected, string actual)
{
XDocument exp = FhirParser.XDocumentFromXml(expected);
XDocument act = FhirParser.XDocumentFromXml(actual);
AreSame(exp, act);
}
private static void areSame(string context, XElement expected, XElement actual)
{
if (expected.Name.ToString() != actual.Name.ToString())
throw new AssertFailedException(String.Format("Expected element '{0}', actual '{1}' at '{2}'",
expected.Name.ToString(), actual.Name.ToString(), context));
if (expected.Attributes().Count() != actual.Attributes().Count())
throw new AssertFailedException(
String.Format("Number of attributes are not the same in element '{0}'",context));
foreach (XAttribute attr in expected.Attributes())
{
if (actual.Attribute(attr.Name) == null)
throw new AssertFailedException(
String.Format("Expected attribute '{0}' not found in element '{1}'", attr.Name.ToString(),
context));
if (actual.Attribute(attr.Name).Value != attr.Value)
throw new AssertFailedException(
String.Format("Attributes '{0}' are not the same at {1}. Expected: '{2}', actual '{3}'",
attr.Name.ToString(), context, attr.Value, actual.Value));
}
if (expected.Elements().Count() != actual.Elements().Count())
throw new AssertFailedException(
String.Format("Number of child elements are not the same at '{0}'", context));
//int elemNr = 0;
//var result = expected.Elements().Zip(actual.Elements(), (ex,ac)=> { areSame(context + "." + ex.Name.LocalName +
// String.Format("[{0}]",elemNr++), ex,ac); return true; } );
var expectedList = expected.Elements().ToArray();
var actualList = expected.Elements().ToArray();
for(int elemNr=0; elemNr < expectedList.Count(); elemNr++)
{
var ex = expectedList[elemNr];
var ac = actualList[elemNr];
areSame(context + "." + ex.Name.LocalName + String.Format("[{0}]", elemNr), ex, ac);
}
}
}
}
| {
"content_hash": "2cb99a2ec32472cf57d5de2d1425d372",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 125,
"avg_line_length": 38.78378378378378,
"alnum_prop": 0.5595818815331011,
"repo_name": "Bomberlt/fhir-net-api",
"id": "dadac7eba7a348f1d4954ee573a57e3baed06841",
"size": "3136",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Hl7.Fhir.Core.Tests/XmlAssert.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C#",
"bytes": "4515220"
},
{
"name": "PowerShell",
"bytes": "418"
}
],
"symlink_target": ""
} |
create table if not exists log (
created datetime,
facility varchar(30),
level int,
severity varchar(10),
message text,
module varchar(20),
func varchar(50),
lineno int,
exception text,
process int,
thread text,
thread_name text
)
| {
"content_hash": "04e3b14ddf817573957365aadc639043",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 32,
"avg_line_length": 19.928571428571427,
"alnum_prop": 0.6344086021505376,
"repo_name": "laurivosandi/certidude",
"id": "66fe6d0726672bbbb52cbb7e1ab94c5196a660fa",
"size": "279",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "certidude/sql/mysql/log_tables.sql",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1975"
},
{
"name": "HTML",
"bytes": "49742"
},
{
"name": "JavaScript",
"bytes": "26756"
},
{
"name": "PLSQL",
"bytes": "552"
},
{
"name": "PowerShell",
"bytes": "3496"
},
{
"name": "Python",
"bytes": "287173"
},
{
"name": "Shell",
"bytes": "38036"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>DateRangePicker - sap.ui.webc.main</title>
<script src="shared-config.js"></script>
<script src="../../../../../resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.webc.main"
data-sap-ui-resourceroots='{
"qunit.internal.acc": "../../../../../test-resources/sap/ui/core/qunit/internal/acc"
}'>
</script>
<script>
sap.ui.getCore().attachInit(function() {
sap.ui.require([
"sap/ui/webc/main/DateRangePicker",
"sap/ui/webc/main/Button"
], function(
DateRangePicker, Button
) {
var oDateRangePicker0Button = new Button({
text: "closePicker",
click: function(oEvent) {
console.log("Calling closePicker...");
var result = oDateRangePicker.closePicker();
console.log("... closePicker returned: ", result);
}
});
oDateRangePicker0Button.placeAt("methodButtons");
var oDateRangePicker1Button = new Button({
text: "formatValue",
click: function(oEvent) {
console.log("Calling formatValue...");
var result = oDateRangePicker.formatValue();
console.log("... formatValue returned: ", result);
}
});
oDateRangePicker1Button.placeAt("methodButtons");
var oDateRangePicker2Button = new Button({
text: "isInValidRange",
click: function(oEvent) {
console.log("Calling isInValidRange...");
var result = oDateRangePicker.isInValidRange();
console.log("... isInValidRange returned: ", result);
}
});
oDateRangePicker2Button.placeAt("methodButtons");
var oDateRangePicker3Button = new Button({
text: "isOpen",
click: function(oEvent) {
console.log("Calling isOpen...");
var result = oDateRangePicker.isOpen();
console.log("... isOpen returned: ", result);
}
});
oDateRangePicker3Button.placeAt("methodButtons");
var oDateRangePicker4Button = new Button({
text: "isValid",
click: function(oEvent) {
console.log("Calling isValid...");
var result = oDateRangePicker.isValid();
console.log("... isValid returned: ", result);
}
});
oDateRangePicker4Button.placeAt("methodButtons");
var oDateRangePicker5Button = new Button({
text: "openPicker",
click: function(oEvent) {
console.log("Calling openPicker...");
var result = oDateRangePicker.openPicker();
console.log("... openPicker returned: ", result);
}
});
oDateRangePicker5Button.placeAt("methodButtons");
var oDateRangePicker6Button = new Button({
text: "getDateValue",
click: function(oEvent) {
console.log("Calling getDateValue...");
var result = oDateRangePicker.getDateValue();
console.log("... getDateValue returned: ", result);
}
});
oDateRangePicker6Button.placeAt("methodButtons");
var oDateRangePicker7Button = new Button({
text: "getDateValueUTC",
click: function(oEvent) {
console.log("Calling getDateValueUTC...");
var result = oDateRangePicker.getDateValueUTC();
console.log("... getDateValueUTC returned: ", result);
}
});
oDateRangePicker7Button.placeAt("methodButtons");
var oDateRangePicker8Button = new Button({
text: "getEndDateValue",
click: function(oEvent) {
console.log("Calling getEndDateValue...");
var result = oDateRangePicker.getEndDateValue();
console.log("... getEndDateValue returned: ", result);
}
});
oDateRangePicker8Button.placeAt("methodButtons");
var oDateRangePicker9Button = new Button({
text: "getStartDateValue",
click: function(oEvent) {
console.log("Calling getStartDateValue...");
var result = oDateRangePicker.getStartDateValue();
console.log("... getStartDateValue returned: ", result);
}
});
oDateRangePicker9Button.placeAt("methodButtons");
var oDateRangePicker = new DateRangePicker({
placeholder: "This is my placeholder value",
value: "Control value",
valueState: "Warning",
valueStateMessage: "Value State Message",
change: function(oEvent) {
console.log("Event change fired for DateRangePicker with parameters: ", oEvent.getParameters());
},
input: function(oEvent) {
console.log("Event input fired for DateRangePicker with parameters: ", oEvent.getParameters());
}
});
oDateRangePicker.placeAt("testControl");
});
});
</script>
</head>
<body id="body" class="sapUiBody">
<div id="methodButtons"></div>
<br><br>
<div id="testControl"></div>
</body>
</html> | {
"content_hash": "b969b9567da34f9517b8a27c80cb65b7",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 120,
"avg_line_length": 37.44642857142857,
"alnum_prop": 0.4724209187728501,
"repo_name": "SAP/openui5",
"id": "a3e4d4f5f9e4ca3f23a9ca386e8618d91f3ba938",
"size": "6291",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/sap.ui.webc.main/test/sap/ui/webc/main/DateRangePicker.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "294216"
},
{
"name": "Gherkin",
"bytes": "17201"
},
{
"name": "HTML",
"bytes": "6443688"
},
{
"name": "Java",
"bytes": "83398"
},
{
"name": "JavaScript",
"bytes": "109546491"
},
{
"name": "Less",
"bytes": "8741757"
},
{
"name": "TypeScript",
"bytes": "20918"
}
],
"symlink_target": ""
} |
const path = require('path');
const chalk = require('chalk');
const log = console.log; // eslint-disable-line
const multi_entry = require('rollup-plugin-multi-entry');
const commonjs = require('rollup-plugin-commonjs');
const node_resolve = require('rollup-plugin-node-resolve');
const postcss = require('rollup-plugin-postcss');
const buble = require('rollup-plugin-buble');
const uglify = require('rollup-plugin-uglify');
const frappe_html = require('./frappe-html-plugin');
const production = process.env.FRAPPE_ENV === 'production';
const {
assets_path,
bench_path,
get_public_path,
get_app_path,
get_build_json
} = require('./rollup.utils');
function get_rollup_options(output_file, input_files) {
if (output_file.endsWith('.js')) {
return get_rollup_options_for_js(output_file, input_files);
} else if(output_file.endsWith('.css')) {
return get_rollup_options_for_css(output_file, input_files);
}
}
function get_rollup_options_for_js(output_file, input_files) {
const plugins = [
// enables array of inputs
multi_entry(),
// .html -> .js
frappe_html(),
// ES6 -> ES5
buble({
objectAssign: 'Object.assign',
transforms: {
dangerousForOf: true
},
exclude: [path.resolve(bench_path, '**/*.css'), path.resolve(bench_path, '**/*.less')]
}),
commonjs(),
node_resolve(),
production && uglify()
];
return {
inputOptions: {
input: input_files,
plugins: plugins,
context: 'window',
external: ['jquery'],
onwarn({ code, message, loc, frame }) {
// skip warnings
if (['EVAL', 'SOURCEMAP_BROKEN', 'NAMESPACE_CONFLICT'].includes(code)) return;
if (loc) {
log(`${loc.file} (${loc.line}:${loc.column}) ${message}`);
if (frame) log(frame);
} else {
log(chalk.yellow.underline(code), ':', message);
}
}
},
outputOptions: {
file: path.resolve(assets_path, output_file),
format: 'iife',
name: 'Rollup',
globals: {
'jquery': 'window.jQuery'
},
sourcemap: true
}
};
}
function get_rollup_options_for_css(output_file, input_files) {
const output_path = path.resolve(assets_path, output_file);
const minimize_css = output_path.startsWith('css/') && production;
const plugins = [
// enables array of inputs
multi_entry(),
// less -> css
postcss({
extract: output_path,
use: [['less', {
// import other less/css files starting from these folders
paths: [
path.resolve(get_public_path('frappe'), 'less')
]
}], 'sass'],
include: [
path.resolve(bench_path, '**/*.less'),
path.resolve(bench_path, '**/*.scss'),
path.resolve(bench_path, '**/*.css')
],
minimize: minimize_css
})
];
return {
inputOptions: {
input: input_files,
plugins: plugins,
onwarn(warning) {
// skip warnings
if (['EMPTY_BUNDLE'].includes(warning.code)) return;
// console.warn everything else
log(chalk.yellow.underline(warning.code), ':', warning.message);
}
},
outputOptions: {
// this file is always empty, remove it later?
file: path.resolve(assets_path, `css/rollup.manifest.css`),
format: 'cjs'
}
};
}
function get_options_for(app) {
const build_json = get_build_json(app);
if (!build_json) return [];
return Object.keys(build_json)
.map(output_file => {
if (output_file.endsWith('libs.min.js')) return null;
const input_files = build_json[output_file]
.map(input_file => {
let prefix = get_app_path(app);
if (input_file.startsWith('node_modules/')) {
prefix = path.resolve(get_app_path(app), '..');
}
return path.resolve(prefix, input_file);
});
return Object.assign(
get_rollup_options(output_file, input_files), {
output_file
});
})
.filter(Boolean);
}
module.exports = {
get_options_for
};
| {
"content_hash": "48352bcdf29eee362673506707041724",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 89,
"avg_line_length": 24.80263157894737,
"alnum_prop": 0.6347480106100796,
"repo_name": "chdecultot/frappe",
"id": "be0152706e70ebfe2919880398274ac9e2e35627",
"size": "3770",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "rollup/config.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "440872"
},
{
"name": "HTML",
"bytes": "196064"
},
{
"name": "JavaScript",
"bytes": "1884702"
},
{
"name": "Makefile",
"bytes": "99"
},
{
"name": "Python",
"bytes": "2207816"
},
{
"name": "Shell",
"bytes": "517"
}
],
"symlink_target": ""
} |
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Rendering;
using Umbraco.Cms.Core.Models.Blocks;
using Umbraco.Cms.Core.Models.PublishedContent;
namespace Umbraco.Extensions;
public static class BlockGridTemplateExtensions
{
public const string DefaultFolder = "blockgrid/";
public const string DefaultTemplate = "default";
public const string DefaultItemsTemplate = "items";
public const string DefaultItemAreasTemplate = "areas";
public static async Task<IHtmlContent> GetBlockGridHtmlAsync(this IHtmlHelper html, BlockGridModel? model, string template = DefaultTemplate)
{
if (model?.Count == 0)
{
return new HtmlString(string.Empty);
}
var view = $"{DefaultFolder}{template}";
return await html.PartialAsync(view, model);
}
public static async Task<IHtmlContent> GetBlockGridHtmlAsync(this IHtmlHelper html, IPublishedProperty property, string template = DefaultTemplate)
=> await GetBlockGridHtmlAsync(html, property.GetValue() as BlockGridModel, template);
public static async Task<IHtmlContent> GetBlockGridHtmlAsync(this IHtmlHelper html, IPublishedContent contentItem, string propertyAlias)
=> await GetBlockGridHtmlAsync(html, contentItem, propertyAlias, DefaultTemplate);
public static async Task<IHtmlContent> GetBlockGridHtmlAsync(this IHtmlHelper html, IPublishedContent contentItem, string propertyAlias, string template)
{
ArgumentNullException.ThrowIfNull(propertyAlias);
if (string.IsNullOrWhiteSpace(propertyAlias))
{
throw new ArgumentException(
"Value can't be empty or consist only of white-space characters.",
nameof(propertyAlias));
}
IPublishedProperty? prop = contentItem.GetProperty(propertyAlias);
if (prop == null)
{
throw new InvalidOperationException("No property type found with alias " + propertyAlias);
}
return await GetBlockGridHtmlAsync(html, prop.GetValue() as BlockGridModel, template);
}
public static async Task<IHtmlContent> GetBlockGridItemsHtmlAsync(this IHtmlHelper html, IEnumerable<BlockGridItem> items, string template = DefaultItemsTemplate)
=> await html.PartialAsync($"{DefaultFolder}{template}", items);
public static async Task<IHtmlContent> GetBlockGridItemAreasHtmlAsync(this IHtmlHelper html, BlockGridItem item, string template = DefaultItemAreasTemplate)
=> await html.PartialAsync($"{DefaultFolder}{template}", item);
}
| {
"content_hash": "b3fc1c112f73bce444491d043f9ab7ea",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 166,
"avg_line_length": 45.175438596491226,
"alnum_prop": 0.7316504854368931,
"repo_name": "abryukhov/Umbraco-CMS",
"id": "4cae63426bfeea859ac8e92c24639e21fdda67d7",
"size": "2635",
"binary": false,
"copies": "3",
"ref": "refs/heads/v10/contrib",
"path": "src/Umbraco.Web.Common/Extensions/BlockGridTemplateExtensions.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "16182634"
},
{
"name": "CSS",
"bytes": "20943"
},
{
"name": "Dockerfile",
"bytes": "1349"
},
{
"name": "HTML",
"bytes": "1376922"
},
{
"name": "JavaScript",
"bytes": "4774243"
},
{
"name": "Less",
"bytes": "744095"
},
{
"name": "Smalltalk",
"bytes": "1"
},
{
"name": "TypeScript",
"bytes": "186621"
}
],
"symlink_target": ""
} |
package jodd.petite.tst5;
public class Solar2 {
public Planet planetProvider() {
return new Planet();
}
} | {
"content_hash": "13ef18f20c0abc355b0989c4d0a8454c",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 33,
"avg_line_length": 12.444444444444445,
"alnum_prop": 0.7053571428571429,
"repo_name": "wsldl123292/jodd",
"id": "9dfc880c35af7805368d353b7263731e78146176",
"size": "187",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "jodd-petite/src/test/java/jodd/petite/tst5/Solar2.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Groovy",
"bytes": "3780"
},
{
"name": "HTML",
"bytes": "4127593"
},
{
"name": "Java",
"bytes": "5436830"
},
{
"name": "Python",
"bytes": "29538"
},
{
"name": "Shell",
"bytes": "3838"
}
],
"symlink_target": ""
} |
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE LambdaCase #-}
module Language.Paradocs.MonadStorage where
import Prelude hiding (lookup)
import Control.Applicative
import Control.Monad.Reader
import Control.Bool
import qualified Data.Hashable as Hashable
import qualified Data.HashMap.Strict as HashMap
import qualified System.Directory as Directory
class Monad m => MonadStorage m where
maybeReadFile :: FilePath -> m (Maybe String)
instance MonadStorage IO where
maybeReadFile path =
ifThenElseM
(Directory.doesFileExist path)
(Just <$> readFile path)
(return Nothing)
instance MonadStorage (HashMapStorage String String) where
maybeReadFile = lookup
newtype HashMapStorage k v a
= HashMapStorage
{
unHashMapStorage :: (Reader (HashMap.HashMap k v) a)
}
deriving (Functor, Applicative, Monad, MonadReader (HashMap.HashMap k v))
lookup :: (Eq k, Hashable.Hashable k) => k -> HashMapStorage k v (Maybe v)
lookup k = HashMap.lookup k <$> ask
runHashMapStorage :: forall k v a. (Eq k, Hashable.Hashable k) => HashMapStorage k v a -> HashMap.HashMap k v -> a
runHashMapStorage = runReader . unHashMapStorage
| {
"content_hash": "134b24b1d1a53eba0c47035b825c5625",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 114,
"avg_line_length": 35.24390243902439,
"alnum_prop": 0.6484429065743945,
"repo_name": "pasberth/paradocs",
"id": "acf33363928e3564926a1be119e9752cd9a7a86d",
"size": "1445",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Language/Paradocs/MonadStorage.hs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1372"
},
{
"name": "Haskell",
"bytes": "50551"
},
{
"name": "JavaScript",
"bytes": "2939"
},
{
"name": "Ruby",
"bytes": "338"
}
],
"symlink_target": ""
} |
class Match < ApplicationRecord
has_many :participants, dependent: :destroy
accepts_nested_attributes_for :participants
belongs_to :phase
validates_presence_of :from, :until, :place, :phase
validate do
unless self.from < self.until
self.errors.add(:until, "must be after from")
end
end
end
| {
"content_hash": "6459a8ad6777a05bc1d102f400c4f769",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 53,
"avg_line_length": 26.416666666666668,
"alnum_prop": 0.7160883280757098,
"repo_name": "kandanda/Server",
"id": "fd805d292cc202fe5f537a76089605c9d2207035",
"size": "317",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/models/match.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "20542"
},
{
"name": "CoffeeScript",
"bytes": "29"
},
{
"name": "Gherkin",
"bytes": "1115"
},
{
"name": "HTML",
"bytes": "18240"
},
{
"name": "JavaScript",
"bytes": "1246"
},
{
"name": "Ruby",
"bytes": "92197"
},
{
"name": "Shell",
"bytes": "642"
}
],
"symlink_target": ""
} |
#include "gamerecorderproxy.h"
void GameRecorderProxy::connectSignal(){
QObject::connect(this,SIGNAL(sendMessage(QString,QString,QString,QString,QString)),player,SLOT(receiveMessage(QString,QString,QString,QString,QString)));
QObject::connect(player,SIGNAL(sendMessage(QString,QString,QString,QString,QString)),this,SLOT(receiveMessage(QString,QString,QString,QString,QString)));
QObject::connect(this,SIGNAL(sendGameMessage(QVariant)),this->item,SLOT(showMessage(QVariant)));
}
void GameRecorderProxy::receiveMessage(QString str1, QString str2, QString str3, QString str4, QString str5){
if(str1=="sendGameMessage")
emit sendGameMessage(QVariant(str2));
}
| {
"content_hash": "e9b3c74281df50a78e79308124d33782",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 157,
"avg_line_length": 52.69230769230769,
"alnum_prop": 0.7839416058394161,
"repo_name": "GeminiLab/OOPLRS",
"id": "10c6fcc47247cbd0b7545248430889dd1b6c97ca",
"size": "687",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/gamerecorderproxy.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "480"
},
{
"name": "C",
"bytes": "120"
},
{
"name": "C++",
"bytes": "180536"
},
{
"name": "QML",
"bytes": "38984"
},
{
"name": "QMake",
"bytes": "3675"
}
],
"symlink_target": ""
} |
module.exports =
angular.module('app.navbar', [])
.directive('navbar', function() {
return {
restrict: 'A',
replace: true,
templateUrl: 'scripts/navbar/navbar.html',
controller: 'NavbarController'
}
})
require('./navbar_controller'); | {
"content_hash": "5f0103a7e4c1d9ac7437b86a6a5e4ade",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 46,
"avg_line_length": 21.166666666666668,
"alnum_prop": 0.65748031496063,
"repo_name": "vanife/ng-game",
"id": "80d7c740f7b7973eceee0579b4f3314a97bd2356",
"size": "254",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "client/src/scripts/navbar/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "16287"
},
{
"name": "HTML",
"bytes": "6203"
},
{
"name": "JavaScript",
"bytes": "103852"
},
{
"name": "Shell",
"bytes": "752"
}
],
"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 (1.8.0_05) on Tue Feb 02 23:09:47 CET 2016 -->
<title>Polygon (libgdx API)</title>
<meta name="date" content="2016-02-02">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Polygon (libgdx API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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="class-use/Polygon.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">
libgdx API
<style>
body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt }
pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif }
h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%; font-weight:bold }
.TableHeadingColor { background:#EEEEFF; }
a { text-decoration:none }
a:hover { text-decoration:underline }
a:link, a:visited { color:blue }
table { border:0px }
.TableRowColor td:first-child { border-left:1px solid black }
.TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black }
hr { border:0px; border-bottom:1px solid #333366; }
</style>
</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/badlogic/gdx/math/Plane.PlaneSide.html" title="enum in com.badlogic.gdx.math"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../com/badlogic/gdx/math/Polyline.html" title="class in com.badlogic.gdx.math"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/badlogic/gdx/math/Polygon.html" target="_top">Frames</a></li>
<li><a href="Polygon.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.badlogic.gdx.math</div>
<h2 title="Class Polygon" class="title">Class Polygon</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.badlogic.gdx.math.Polygon</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../com/badlogic/gdx/math/Shape2D.html" title="interface in com.badlogic.gdx.math">Shape2D</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">Polygon</span>
extends java.lang.Object
implements <a href="../../../../com/badlogic/gdx/math/Shape2D.html" title="interface in com.badlogic.gdx.math">Shape2D</a></pre>
<div class="block">Encapsulates a 2D polygon defined by it's vertices relative to an origin point (default of 0, 0).</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" 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><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#Polygon--">Polygon</a></span>()</code>
<div class="block">Constructs a new polygon with no vertices.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#Polygon-float:A-">Polygon</a></span>(float[] vertices)</code>
<div class="block">Constructs a new polygon from a float array of parts of vertex points.</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="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#area--">area</a></span>()</code>
<div class="block">Returns the area contained within the polygon.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#contains-float-float-">contains</a></span>(float x,
float y)</code>
<div class="block">Returns whether an x, y pair is contained within the polygon.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#contains-com.badlogic.gdx.math.Vector2-">contains</a></span>(<a href="../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2</a> point)</code>
<div class="block">Returns whether the given point is contained within the shape.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#dirty--">dirty</a></span>()</code>
<div class="block">Sets the polygon's world vertices to be recalculated when calling <a href="../../../../com/badlogic/gdx/math/Polygon.html#getTransformedVertices--"><code>getTransformedVertices</code></a>.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math">Rectangle</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#getBoundingRectangle--">getBoundingRectangle</a></span>()</code>
<div class="block">Returns an axis-aligned bounding box of this polygon.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#getOriginX--">getOriginX</a></span>()</code>
<div class="block">Returns the x-coordinate of the polygon's origin point.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#getOriginY--">getOriginY</a></span>()</code>
<div class="block">Returns the y-coordinate of the polygon's origin point.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#getRotation--">getRotation</a></span>()</code>
<div class="block">Returns the total rotation applied to the polygon.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#getScaleX--">getScaleX</a></span>()</code>
<div class="block">Returns the total horizontal scaling applied to the polygon.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#getScaleY--">getScaleY</a></span>()</code>
<div class="block">Returns the total vertical scaling applied to the polygon.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>float[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#getTransformedVertices--">getTransformedVertices</a></span>()</code>
<div class="block">Calculates and returns the vertices of the polygon after scaling, rotation, and positional translations have been applied,
as they are position within the world.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>float[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#getVertices--">getVertices</a></span>()</code>
<div class="block">Returns the polygon's local vertices without scaling or rotation and without being offset by the polygon position.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#getX--">getX</a></span>()</code>
<div class="block">Returns the x-coordinate of the polygon's position within the world.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#getY--">getY</a></span>()</code>
<div class="block">Returns the y-coordinate of the polygon's position within the world.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#rotate-float-">rotate</a></span>(float degrees)</code>
<div class="block">Applies additional rotation to the polygon by the supplied degrees.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#scale-float-">scale</a></span>(float amount)</code>
<div class="block">Applies additional scaling to the polygon by the supplied amount.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#setOrigin-float-float-">setOrigin</a></span>(float originX,
float originY)</code>
<div class="block">Sets the origin point to which all of the polygon's local vertices are relative to.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#setPosition-float-float-">setPosition</a></span>(float x,
float y)</code>
<div class="block">Sets the polygon's position within the world.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#setRotation-float-">setRotation</a></span>(float degrees)</code>
<div class="block">Sets the polygon to be rotated by the supplied degrees.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#setScale-float-float-">setScale</a></span>(float scaleX,
float scaleY)</code>
<div class="block">Sets the amount of scaling to be applied to the polygon.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#setVertices-float:A-">setVertices</a></span>(float[] vertices)</code>
<div class="block">Sets the polygon's local vertices relative to the origin point, without any scaling, rotating or translations being applied.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/badlogic/gdx/math/Polygon.html#translate-float-float-">translate</a></span>(float x,
float y)</code>
<div class="block">Translates the polygon's position by the specified horizontal and vertical amounts.</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.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Polygon--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Polygon</h4>
<pre>public Polygon()</pre>
<div class="block">Constructs a new polygon with no vertices.</div>
</li>
</ul>
<a name="Polygon-float:A-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Polygon</h4>
<pre>public Polygon(float[] vertices)</pre>
<div class="block">Constructs a new polygon from a float array of parts of vertex points.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertices</code> - an array where every even element represents the horizontal part of a point, and the following element
representing the vertical part</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if less than 6 elements, representing 3 points, are provided</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="getVertices--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVertices</h4>
<pre>public float[] getVertices()</pre>
<div class="block">Returns the polygon's local vertices without scaling or rotation and without being offset by the polygon position.</div>
</li>
</ul>
<a name="getTransformedVertices--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTransformedVertices</h4>
<pre>public float[] getTransformedVertices()</pre>
<div class="block">Calculates and returns the vertices of the polygon after scaling, rotation, and positional translations have been applied,
as they are position within the world.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>vertices scaled, rotated, and offset by the polygon position.</dd>
</dl>
</li>
</ul>
<a name="setOrigin-float-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setOrigin</h4>
<pre>public void setOrigin(float originX,
float originY)</pre>
<div class="block">Sets the origin point to which all of the polygon's local vertices are relative to.</div>
</li>
</ul>
<a name="setPosition-float-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPosition</h4>
<pre>public void setPosition(float x,
float y)</pre>
<div class="block">Sets the polygon's position within the world.</div>
</li>
</ul>
<a name="setVertices-float:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setVertices</h4>
<pre>public void setVertices(float[] vertices)</pre>
<div class="block">Sets the polygon's local vertices relative to the origin point, without any scaling, rotating or translations being applied.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>vertices</code> - float array where every even element represents the x-coordinate of a vertex, and the proceeding element
representing the y-coordinate.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.IllegalArgumentException</code> - if less than 6 elements, representing 3 points, are provided</dd>
</dl>
</li>
</ul>
<a name="translate-float-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>translate</h4>
<pre>public void translate(float x,
float y)</pre>
<div class="block">Translates the polygon's position by the specified horizontal and vertical amounts.</div>
</li>
</ul>
<a name="setRotation-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setRotation</h4>
<pre>public void setRotation(float degrees)</pre>
<div class="block">Sets the polygon to be rotated by the supplied degrees.</div>
</li>
</ul>
<a name="rotate-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rotate</h4>
<pre>public void rotate(float degrees)</pre>
<div class="block">Applies additional rotation to the polygon by the supplied degrees.</div>
</li>
</ul>
<a name="setScale-float-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setScale</h4>
<pre>public void setScale(float scaleX,
float scaleY)</pre>
<div class="block">Sets the amount of scaling to be applied to the polygon.</div>
</li>
</ul>
<a name="scale-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>scale</h4>
<pre>public void scale(float amount)</pre>
<div class="block">Applies additional scaling to the polygon by the supplied amount.</div>
</li>
</ul>
<a name="dirty--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>dirty</h4>
<pre>public void dirty()</pre>
<div class="block">Sets the polygon's world vertices to be recalculated when calling <a href="../../../../com/badlogic/gdx/math/Polygon.html#getTransformedVertices--"><code>getTransformedVertices</code></a>.</div>
</li>
</ul>
<a name="area--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>area</h4>
<pre>public float area()</pre>
<div class="block">Returns the area contained within the polygon.</div>
</li>
</ul>
<a name="getBoundingRectangle--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBoundingRectangle</h4>
<pre>public <a href="../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math">Rectangle</a> getBoundingRectangle()</pre>
<div class="block">Returns an axis-aligned bounding box of this polygon.
Note the returned Rectangle is cached in this polygon, and will be reused if this Polygon is changed.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this polygon's bounding box <a href="../../../../com/badlogic/gdx/math/Rectangle.html" title="class in com.badlogic.gdx.math"><code>Rectangle</code></a></dd>
</dl>
</li>
</ul>
<a name="contains-float-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>contains</h4>
<pre>public boolean contains(float x,
float y)</pre>
<div class="block">Returns whether an x, y pair is contained within the polygon.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/math/Shape2D.html#contains-float-float-">contains</a></code> in interface <code><a href="../../../../com/badlogic/gdx/math/Shape2D.html" title="interface in com.badlogic.gdx.math">Shape2D</a></code></dd>
</dl>
</li>
</ul>
<a name="contains-com.badlogic.gdx.math.Vector2-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>contains</h4>
<pre>public boolean contains(<a href="../../../../com/badlogic/gdx/math/Vector2.html" title="class in com.badlogic.gdx.math">Vector2</a> point)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../com/badlogic/gdx/math/Shape2D.html#contains-com.badlogic.gdx.math.Vector2-">Shape2D</a></code></span></div>
<div class="block">Returns whether the given point is contained within the shape.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../com/badlogic/gdx/math/Shape2D.html#contains-com.badlogic.gdx.math.Vector2-">contains</a></code> in interface <code><a href="../../../../com/badlogic/gdx/math/Shape2D.html" title="interface in com.badlogic.gdx.math">Shape2D</a></code></dd>
</dl>
</li>
</ul>
<a name="getX--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getX</h4>
<pre>public float getX()</pre>
<div class="block">Returns the x-coordinate of the polygon's position within the world.</div>
</li>
</ul>
<a name="getY--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getY</h4>
<pre>public float getY()</pre>
<div class="block">Returns the y-coordinate of the polygon's position within the world.</div>
</li>
</ul>
<a name="getOriginX--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOriginX</h4>
<pre>public float getOriginX()</pre>
<div class="block">Returns the x-coordinate of the polygon's origin point.</div>
</li>
</ul>
<a name="getOriginY--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOriginY</h4>
<pre>public float getOriginY()</pre>
<div class="block">Returns the y-coordinate of the polygon's origin point.</div>
</li>
</ul>
<a name="getRotation--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRotation</h4>
<pre>public float getRotation()</pre>
<div class="block">Returns the total rotation applied to the polygon.</div>
</li>
</ul>
<a name="getScaleX--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getScaleX</h4>
<pre>public float getScaleX()</pre>
<div class="block">Returns the total horizontal scaling applied to the polygon.</div>
</li>
</ul>
<a name="getScaleY--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getScaleY</h4>
<pre>public float getScaleY()</pre>
<div class="block">Returns the total vertical scaling applied to the polygon.</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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="class-use/Polygon.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">libgdx API</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/badlogic/gdx/math/Plane.PlaneSide.html" title="enum in com.badlogic.gdx.math"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../com/badlogic/gdx/math/Polyline.html" title="class in com.badlogic.gdx.math"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/badlogic/gdx/math/Polygon.html" target="_top">Frames</a></li>
<li><a href="Polygon.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>
<div style="font-size:9pt"><i>
Copyright © 2010-2013 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)
</i></div>
</small></p>
</body>
</html>
| {
"content_hash": "85fffeee567974314b6862be544d668c",
"timestamp": "",
"source": "github",
"line_count": 701,
"max_line_length": 391,
"avg_line_length": 39.63338088445079,
"alnum_prop": 0.6624554583738257,
"repo_name": "JFixby/libgdx-nightly",
"id": "f3ed02a3ac070e4acf543e7f8a92e8c6420f95b3",
"size": "27783",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gdx-nightly/docs/api/com/badlogic/gdx/math/Polygon.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "12808"
},
{
"name": "HTML",
"bytes": "44095638"
},
{
"name": "JavaScript",
"bytes": "827"
}
],
"symlink_target": ""
} |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Copyright (c) 2015-2016 The Bitcoin Unlimited developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "script/standard.h"
#include "pubkey.h"
#include "script/script.h"
#include "util.h"
#include "utilstrencodings.h"
#include <boost/foreach.hpp>
using namespace std;
typedef vector<unsigned char> valtype;
bool fAcceptDatacarrier = DEFAULT_ACCEPT_DATACARRIER;
unsigned nMaxDatacarrierBytes = MAX_OP_RETURN_RELAY;
CScriptID::CScriptID(const CScript& in) : uint160(Hash160(in.begin(), in.end())) {}
const char* GetTxnOutputType(txnouttype t)
{
switch (t)
{
case TX_NONSTANDARD: return "nonstandard";
case TX_PUBKEY: return "pubkey";
case TX_PUBKEYHASH: return "pubkeyhash";
case TX_SCRIPTHASH: return "scripthash";
case TX_MULTISIG: return "multisig";
case TX_NULL_DATA: return "nulldata";
}
return NULL;
}
/**
* Return public keys or hashes from scriptPubKey, for 'standard' transaction types.
*/
bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsigned char> >& vSolutionsRet)
{
// Templates
static multimap<txnouttype, CScript> mTemplates;
if (mTemplates.empty())
{
// Standard tx, sender provides pubkey, receiver adds signature
mTemplates.insert(make_pair(TX_PUBKEY, CScript() << OP_PUBKEY << OP_CHECKSIG));
// Bitcoin address tx, sender provides hash of pubkey, receiver provides signature and pubkey
mTemplates.insert(make_pair(TX_PUBKEYHASH, CScript() << OP_DUP << OP_HASH160 << OP_PUBKEYHASH << OP_EQUALVERIFY << OP_CHECKSIG));
// Sender provides N pubkeys, receivers provides M signatures
mTemplates.insert(make_pair(TX_MULTISIG, CScript() << OP_SMALLINTEGER << OP_PUBKEYS << OP_SMALLINTEGER << OP_CHECKMULTISIG));
}
vSolutionsRet.clear();
// Shortcut for pay-to-script-hash, which are more constrained than the other types:
// it is always OP_HASH160 20 [20 byte hash] OP_EQUAL
if (scriptPubKey.IsPayToScriptHash())
{
typeRet = TX_SCRIPTHASH;
vector<unsigned char> hashBytes(scriptPubKey.begin()+2, scriptPubKey.begin()+22);
vSolutionsRet.push_back(hashBytes);
return true;
}
// Provably prunable, data-carrying output
//
// So long as script passes the IsUnspendable() test and all but the first
// byte passes the IsPushOnly() test we don't care what exactly is in the
// script.
if (scriptPubKey.size() >= 1 && scriptPubKey[0] == OP_RETURN && scriptPubKey.IsPushOnly(scriptPubKey.begin()+1)) {
typeRet = TX_NULL_DATA;
return true;
}
// Scan templates
const CScript& script1 = scriptPubKey;
BOOST_FOREACH(const PAIRTYPE(txnouttype, CScript)& tplate, mTemplates)
{
const CScript& script2 = tplate.second;
vSolutionsRet.clear();
opcodetype opcode1, opcode2;
vector<unsigned char> vch1, vch2;
// Compare
CScript::const_iterator pc1 = script1.begin();
CScript::const_iterator pc2 = script2.begin();
while (true)
{
if (pc1 == script1.end() && pc2 == script2.end())
{
// Found a match
typeRet = tplate.first;
if (typeRet == TX_MULTISIG)
{
// Additional checks for TX_MULTISIG:
unsigned char m = vSolutionsRet.front()[0];
unsigned char n = vSolutionsRet.back()[0];
if (m < 1 || n < 1 || m > n || vSolutionsRet.size()-2 != n)
return false;
}
return true;
}
if (!script1.GetOp(pc1, opcode1, vch1))
break;
if (!script2.GetOp(pc2, opcode2, vch2))
break;
// Template matching opcodes:
if (opcode2 == OP_PUBKEYS)
{
while (vch1.size() >= 33 && vch1.size() <= 65)
{
vSolutionsRet.push_back(vch1);
if (!script1.GetOp(pc1, opcode1, vch1))
break;
}
if (!script2.GetOp(pc2, opcode2, vch2))
break;
// Normal situation is to fall through
// to other if/else statements
}
if (opcode2 == OP_PUBKEY)
{
if (vch1.size() < 33 || vch1.size() > 65)
break;
vSolutionsRet.push_back(vch1);
}
else if (opcode2 == OP_PUBKEYHASH)
{
if (vch1.size() != sizeof(uint160))
break;
vSolutionsRet.push_back(vch1);
}
else if (opcode2 == OP_SMALLINTEGER)
{ // Single-byte small integer pushed onto vSolutions
if (opcode1 == OP_0 ||
(opcode1 >= OP_1 && opcode1 <= OP_16))
{
char n = (char)CScript::DecodeOP_N(opcode1);
vSolutionsRet.push_back(valtype(1, n));
}
else
break;
}
else if (opcode1 != opcode2 || vch1 != vch2)
{
// Others must match exactly
break;
}
}
}
vSolutionsRet.clear();
typeRet = TX_NONSTANDARD;
return false;
}
bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet)
{
vector<valtype> vSolutions;
txnouttype whichType;
if (!Solver(scriptPubKey, whichType, vSolutions))
return false;
if (whichType == TX_PUBKEY)
{
CPubKey pubKey(vSolutions[0]);
if (!pubKey.IsValid())
return false;
addressRet = pubKey.GetID();
return true;
}
else if (whichType == TX_PUBKEYHASH)
{
addressRet = CKeyID(uint160(vSolutions[0]));
return true;
}
else if (whichType == TX_SCRIPTHASH)
{
addressRet = CScriptID(uint160(vSolutions[0]));
return true;
}
// Multisig txns have more than one address...
return false;
}
bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vector<CTxDestination>& addressRet, int& nRequiredRet)
{
addressRet.clear();
typeRet = TX_NONSTANDARD;
vector<valtype> vSolutions;
if (!Solver(scriptPubKey, typeRet, vSolutions))
return false;
if (typeRet == TX_NULL_DATA){
// This is data, not addresses
return false;
}
if (typeRet == TX_MULTISIG)
{
nRequiredRet = vSolutions.front()[0];
for (unsigned int i = 1; i < vSolutions.size()-1; i++)
{
CPubKey pubKey(vSolutions[i]);
if (!pubKey.IsValid())
continue;
CTxDestination address = pubKey.GetID();
addressRet.push_back(address);
}
if (addressRet.empty())
return false;
}
else
{
nRequiredRet = 1;
CTxDestination address;
if (!ExtractDestination(scriptPubKey, address))
return false;
addressRet.push_back(address);
}
return true;
}
namespace
{
class CScriptVisitor : public boost::static_visitor<bool>
{
private:
CScript *script;
public:
CScriptVisitor(CScript *scriptin) { script = scriptin; }
bool operator()(const CNoDestination &dest) const {
script->clear();
return false;
}
bool operator()(const CKeyID &keyID) const {
script->clear();
*script << OP_DUP << OP_HASH160 << ToByteVector(keyID) << OP_EQUALVERIFY << OP_CHECKSIG;
return true;
}
bool operator()(const CScriptID &scriptID) const {
script->clear();
*script << OP_HASH160 << ToByteVector(scriptID) << OP_EQUAL;
return true;
}
};
}
CScript GetScriptForDestination(const CTxDestination& dest)
{
CScript script;
boost::apply_visitor(CScriptVisitor(&script), dest);
return script;
}
CScript GetScriptForRawPubKey(const CPubKey& pubKey)
{
return CScript() << std::vector<unsigned char>(pubKey.begin(), pubKey.end()) << OP_CHECKSIG;
}
CScript GetScriptForMultisig(int nRequired, const std::vector<CPubKey>& keys)
{
CScript script;
script << CScript::EncodeOP_N(nRequired);
BOOST_FOREACH(const CPubKey& key, keys)
script << ToByteVector(key);
script << CScript::EncodeOP_N(keys.size()) << OP_CHECKMULTISIG;
return script;
}
| {
"content_hash": "7d77005ddf6bcd142debedf966683598",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 137,
"avg_line_length": 30.54736842105263,
"alnum_prop": 0.5806340454858718,
"repo_name": "marlengit/BitcoinUnlimited",
"id": "be6a0c305a9b7ab7114f8c2c39bef4a5ec862404",
"size": "8706",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/script/standard.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "673068"
},
{
"name": "C++",
"bytes": "4721435"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "HTML",
"bytes": "50621"
},
{
"name": "Java",
"bytes": "2100"
},
{
"name": "M4",
"bytes": "171508"
},
{
"name": "Makefile",
"bytes": "98953"
},
{
"name": "Objective-C",
"bytes": "5785"
},
{
"name": "Objective-C++",
"bytes": "7360"
},
{
"name": "Protocol Buffer",
"bytes": "2308"
},
{
"name": "Python",
"bytes": "756383"
},
{
"name": "QMake",
"bytes": "2020"
},
{
"name": "Roff",
"bytes": "3821"
},
{
"name": "Shell",
"bytes": "36574"
}
],
"symlink_target": ""
} |
//@exclude
'use strict';
/* jshint unused:false */
//@endexclude
var sortBuilder = (function() {
var sortBuilder = {};
/**
* Sets ascending direction to sort param
* @return {RequestParamsBuilder} RequestParamsBuilder
*/
sortBuilder.asc = function(field) {
this.params.sort = this.params.sort || {};
this.params.sort[field] = corbel.Resources.sort.ASC;
return this;
};
/**
* Sets descending direction to sort param
* @return {RequestParamsBuilder} RequestParamsBuilder
*/
sortBuilder.desc = function(field) {
this.params.sort = this.params.sort || {};
this.params.sort[field] = corbel.Resources.sort.DESC;
return this;
};
return sortBuilder;
})(); | {
"content_hash": "03045391e1afbc78ec4d01903b7b7a7f",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 61,
"avg_line_length": 23.84375,
"alnum_prop": 0.6146788990825688,
"repo_name": "jscMR/corbel-js",
"id": "aab93b67b20fd2951f29c755131098e27529a84c",
"size": "763",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/request-params/sort-builder.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "1629"
},
{
"name": "JavaScript",
"bytes": "775723"
}
],
"symlink_target": ""
} |
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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.
// ----------------------------------------------------------------------------------
using System;
using System.Globalization;
using System.Management.Automation;
using System.Net;
using System.Security.Permissions;
using Microsoft.Azure.Commands.DataFactoryV2.Models;
using Microsoft.Azure.Commands.DataFactoryV2.Properties;
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
namespace Microsoft.Azure.Commands.DataFactoryV2
{
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "DataFactoryV2", DefaultParameterSetName = ParameterSetNames.ByFactoryName, SupportsShouldProcess = true), OutputType(typeof(void))]
public class RemoveAzureDataFactoryCommand : DataFactoryBaseCmdlet
{
[Parameter(ParameterSetName = ParameterSetNames.ByFactoryName, Position = 0, Mandatory = true,
HelpMessage = Constants.HelpResourceGroup)]
[ResourceGroupCompleter()]
[ValidateNotNullOrEmpty]
public string ResourceGroupName { get; set; }
[Parameter(ParameterSetName = ParameterSetNames.ByFactoryName, Position = 1, Mandatory = true,
HelpMessage = Constants.HelpFactoryName)]
[Alias("DataFactoryName")]
[ValidateNotNullOrEmpty]
public string Name { get; set; }
[Parameter(ParameterSetName = ParameterSetNames.ByFactoryObject, Position = 0, Mandatory = true, ValueFromPipeline = true,
HelpMessage = Constants.HelpFactoryObject)]
[ValidateNotNullOrEmpty]
public PSDataFactory InputObject { get; set; }
[Parameter(ParameterSetName = ParameterSetNames.ByResourceId, Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true,
HelpMessage = Constants.HelpResourceId)]
[ValidateNotNullOrEmpty]
public string ResourceId { get; set; }
[Parameter(Mandatory = false, HelpMessage = Constants.HelpDontAskConfirmation)]
public SwitchParameter Force { get; set; }
[EnvironmentPermission(SecurityAction.Demand, Unrestricted = true)]
public override void ExecuteCmdlet()
{
if (ParameterSetName.Equals(ParameterSetNames.ByFactoryObject, StringComparison.OrdinalIgnoreCase))
{
Name = InputObject.DataFactoryName;
ResourceGroupName = InputObject.ResourceGroupName;
}
else if (ParameterSetName.Equals(ParameterSetNames.ByResourceId, StringComparison.OrdinalIgnoreCase))
{
var parsedResourceId = new ResourceIdentifier(ResourceId);
Name = parsedResourceId.ResourceName;
ResourceGroupName = parsedResourceId.ResourceGroupName;
}
ConfirmAction(
Force.IsPresent,
string.Format(
CultureInfo.InvariantCulture,
Resources.DataFactoryConfirmationMessage,
Name,
ResourceGroupName),
string.Format(
CultureInfo.InvariantCulture,
Resources.DataFactoryRemoving,
Name,
ResourceGroupName),
Name,
ExecuteDelete);
}
public void ExecuteDelete()
{
HttpStatusCode response = DataFactoryClient.DeleteDataFactory(ResourceGroupName, Name);
if (response == HttpStatusCode.NoContent)
{
WriteWarning(string.Format(CultureInfo.InvariantCulture, Resources.DataFactoryNotFound, Name,
ResourceGroupName));
}
}
}
}
| {
"content_hash": "1379c24b8a3b71ee3a0de48117ee976c",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 210,
"avg_line_length": 45.22680412371134,
"alnum_prop": 0.6498746295874174,
"repo_name": "AzureAutomationTeam/azure-powershell",
"id": "fca9a0fc814d0d750b55894858d0bd2c09d61d71",
"size": "4389",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "src/ResourceManager/DataFactoryV2/Commands.DataFactoryV2/DataFactories/RemoveAzureDataFactoryCommand.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "14962309"
},
{
"name": "HTML",
"bytes": "209"
},
{
"name": "JavaScript",
"bytes": "4979"
},
{
"name": "PHP",
"bytes": "41"
},
{
"name": "PowerShell",
"bytes": "691666"
},
{
"name": "Python",
"bytes": "20483"
},
{
"name": "Shell",
"bytes": "15168"
}
],
"symlink_target": ""
} |
gcmContextData *context; // Context to keep track of the RSX buffer.
VideoResolution res; // Screen Resolution
u32 *buffer[2]; // The buffer we will be drawing into
u32 offset[2]; // The offset of the buffers in RSX memory
u32 *depth_buffer; // Depth buffer. We aren't using it but the ps3 crashes if we don't have it
u32 depth_offset;
int pitch;
int depth_pitch;
// Initilize and rsx
void init_screen() {
// Allocate a 1Mb buffer, alligned to a 1Mb boundary to be our shared IO memory with the RSX.
void *host_addr = memalign(1024*1024, 1024*1024);
assert(host_addr != NULL);
// Initilise Reality, which sets up the command buffer and shared IO memory
context = realityInit(0x10000, 1024*1024, host_addr);
assert(context != NULL);
VideoState state;
assert(videoGetState(0, 0, &state) == 0); // Get the state of the display
assert(state.state == 0); // Make sure display is enabled
// Get the current resolution
assert(videoGetResolution(state.displayMode.resolution, &res) == 0);
pitch = 4 * res.width; // each pixel is 4 bytes
depth_pitch = 4 * res.width; // And each value in the depth buffer is a 16 bit float
// Configure the buffer format to xRGB
VideoConfiguration vconfig;
memset(&vconfig, 0, sizeof(VideoConfiguration));
vconfig.resolution = state.displayMode.resolution;
vconfig.format = VIDEO_BUFFER_FORMAT_XRGB;
vconfig.pitch = pitch;
assert(videoConfigure(0, &vconfig, NULL, 0) == 0);
assert(videoGetState(0, 0, &state) == 0);
s32 buffer_size = pitch * res.height;
s32 depth_buffer_size = depth_pitch * res.height;
printf("buffers will be 0x%x bytes\n", buffer_size);
gcmSetFlipMode(GCM_FLIP_VSYNC); // Wait for VSYNC to flip
// Allocate two buffers for the RSX to draw to the screen (double buffering)
buffer[0] = rsxMemAlign(16, buffer_size);
buffer[1] = rsxMemAlign(16, buffer_size);
assert(buffer[0] != NULL && buffer[1] != NULL);
depth_buffer = rsxMemAlign(16, depth_buffer_size * 4);
assert(realityAddressToOffset(buffer[0], &offset[0]) == 0);
assert(realityAddressToOffset(buffer[1], &offset[1]) == 0);
// Setup the display buffers
assert(gcmSetDisplayBuffer(0, offset[0], pitch, res.width, res.height) == 0);
assert(gcmSetDisplayBuffer(1, offset[1], pitch, res.width, res.height) == 0);
assert(realityAddressToOffset(depth_buffer, &depth_offset) == 0);
gcmResetFlipStatus();
flip(1);
}
void waitFlip() { // Block the PPU thread untill the previous flip operation has finished.
while(gcmGetFlipStatus() != 0)
usleep(200);
gcmResetFlipStatus();
}
void flip(s32 buffer) {
assert(gcmSetFlip(context, buffer) == 0);
realityFlushBuffer(context);
gcmSetWaitFlip(context); // Prevent the RSX from continuing until the flip has finished.
}
void setupRenderTarget(u32 currentBuffer) {
// Set the color0 target to point at the offset of our current surface
realitySetRenderSurface(context, REALITY_SURFACE_COLOR0, REALITY_RSX_MEMORY,
offset[currentBuffer], pitch);
// Setup depth buffer
realitySetRenderSurface(context, REALITY_SURFACE_ZETA, REALITY_RSX_MEMORY,
depth_offset, depth_pitch);
// Choose color0 as the render target and tell the rsx about the surface format.
realitySelectRenderTarget(context, REALITY_TARGET_0,
REALITY_TARGET_FORMAT_COLOR_X8R8G8B8 |
REALITY_TARGET_FORMAT_ZETA_Z24S8 |
REALITY_TARGET_FORMAT_TYPE_LINEAR,
res.width, res.height, 0, 0);
}
| {
"content_hash": "0bea56bf661e695112b23b404f224da7",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 94,
"avg_line_length": 35.54736842105263,
"alnum_prop": 0.7266804856381404,
"repo_name": "andoma/PSL1GHT",
"id": "888baaebecbb9eec721f0ad49db56e27875de777",
"size": "3599",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "samples/video/msgdialog/source/rsxutil.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "2289"
},
{
"name": "C",
"bytes": "297188"
},
{
"name": "C++",
"bytes": "13030"
},
{
"name": "Makefile",
"bytes": "13757"
},
{
"name": "Objective-C",
"bytes": "376"
}
],
"symlink_target": ""
} |
package org.elasticsearch.index.translog;
import org.apache.lucene.index.Term;
import org.apache.lucene.index.TwoPhaseCommit;
import org.apache.lucene.store.AlreadyClosedException;
import org.apache.lucene.util.Accountable;
import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.RamUsageEstimator;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.bytes.ReleasablePagedBytesReference;
import org.elasticsearch.common.io.stream.ReleasableBytesStreamOutput;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Streamable;
import org.elasticsearch.common.lease.Releasables;
import org.elasticsearch.common.lucene.uid.Versions;
import org.elasticsearch.common.util.BigArrays;
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
import org.elasticsearch.common.util.concurrent.FutureUtils;
import org.elasticsearch.common.util.concurrent.ReleasableLock;
import org.elasticsearch.index.VersionType;
import org.elasticsearch.index.engine.Engine;
import org.elasticsearch.index.shard.AbstractIndexShardComponent;
import org.elasticsearch.index.shard.IndexShardComponent;
import java.io.Closeable;
import java.io.EOFException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* A Translog is a per index shard component that records all non-committed index operations in a durable manner.
* In Elasticsearch there is one Translog instance per {@link org.elasticsearch.index.engine.InternalEngine}. The engine
* records the current translog generation {@link Translog#getGeneration()} in it's commit metadata using {@link #TRANSLOG_GENERATION_KEY}
* to reference the generation that contains all operations that have not yet successfully been committed to the engines lucene index.
* Additionally, since Elasticsearch 2.0 the engine also records a {@link #TRANSLOG_UUID_KEY} with each commit to ensure a strong association
* between the lucene index an the transaction log file. This UUID is used to prevent accidential recovery from a transaction log that belongs to a
* different engine.
* <p>
* Each Translog has only one translog file open at any time referenced by a translog generation ID. This ID is written to a <tt>translog.ckp</tt> file that is designed
* to fit in a single disk block such that a write of the file is atomic. The checkpoint file is written on each fsync operation of the translog and records the number of operations
* written, the current tranlogs file generation and it's fsynced offset in bytes.
* </p>
* <p>
* When a translog is opened the checkpoint is use to retrieve the latest translog file generation and subsequently to open the last written file to recovery operations.
* The {@link org.elasticsearch.index.translog.Translog.TranslogGeneration} on {@link TranslogConfig#getTranslogGeneration()} given when the translog is opened is compared against
* the latest generation and all consecutive translog files singe the given generation and the last generation in the checkpoint will be recovered and preserved until the next
* generation is committed using {@link Translog#commit()}. In the common case the translog file generation in the checkpoint and the generation passed to the translog on creation are
* the same. The only situation when they can be different is when an actual translog commit fails in between {@link Translog#prepareCommit()} and {@link Translog#commit()}. In such a case
* the currently being committed translog file will not be deleted since it's commit was not successful. Yet, a new/current translog file is already opened at that point such that there is more than
* one translog file present. Such an uncommitted translog file always has a <tt>translog-${gen}.ckp</tt> associated with it which is an fsynced copy of the it's last <tt>translog.ckp</tt> such that in
* disaster recovery last fsynced offsets, number of operation etc. are still preserved.
* </p>
*/
public class Translog extends AbstractIndexShardComponent implements IndexShardComponent, Closeable, TwoPhaseCommit {
/*
* TODO
* - we might need something like a deletion policy to hold on to more than one translog eventually (I think sequence IDs needs this) but we can refactor as we go
* - use a simple BufferedOutputStream to write stuff and fold BufferedTranslogWriter into it's super class... the tricky bit is we need to be able to do random access reads even from the buffer
* - we need random exception on the FileSystem API tests for all this.
* - we need to page align the last write before we sync, we can take advantage of ensureSynced for this since we might have already fsynced far enough
*/
public static final String TRANSLOG_GENERATION_KEY = "translog_generation";
public static final String TRANSLOG_UUID_KEY = "translog_uuid";
public static final String TRANSLOG_FILE_PREFIX = "translog-";
public static final String TRANSLOG_FILE_SUFFIX = ".tlog";
public static final String CHECKPOINT_SUFFIX = ".ckp";
public static final String CHECKPOINT_FILE_NAME = "translog" + CHECKPOINT_SUFFIX;
static final Pattern PARSE_STRICT_ID_PATTERN = Pattern.compile("^" + TRANSLOG_FILE_PREFIX + "(\\d+)(\\.tlog)$");
// the list of translog readers is guaranteed to be in order of translog generation
private final List<TranslogReader> readers = new ArrayList<>();
private volatile ScheduledFuture<?> syncScheduler;
// this is a concurrent set and is not protected by any of the locks. The main reason
// is that is being accessed by two separate classes (additions & reading are done by Translog, remove by View when closed)
private final Set<View> outstandingViews = ConcurrentCollections.newConcurrentSet();
private BigArrays bigArrays;
protected final ReleasableLock readLock;
protected final ReleasableLock writeLock;
private final Path location;
private TranslogWriter current;
private final static long NOT_SET_GENERATION = -1; // -1 is safe as it will not cause a translog deletion.
private volatile long currentCommittingGeneration = NOT_SET_GENERATION;
private volatile long lastCommittedTranslogFileGeneration = NOT_SET_GENERATION;
private final AtomicBoolean closed = new AtomicBoolean();
private final TranslogConfig config;
private final String translogUUID;
/**
* Creates a new Translog instance. This method will create a new transaction log unless the given {@link TranslogConfig} has
* a non-null {@link org.elasticsearch.index.translog.Translog.TranslogGeneration}. If the generation is null this method
* us destructive and will delete all files in the translog path given.
*
* @see TranslogConfig#getTranslogPath()
*/
public Translog(TranslogConfig config) throws IOException {
super(config.getShardId(), config.getIndexSettings());
this.config = config;
TranslogGeneration translogGeneration = config.getTranslogGeneration();
if (translogGeneration == null || translogGeneration.translogUUID == null) { // legacy case
translogUUID = Strings.randomBase64UUID();
} else {
translogUUID = translogGeneration.translogUUID;
}
bigArrays = config.getBigArrays();
ReadWriteLock rwl = new ReentrantReadWriteLock();
readLock = new ReleasableLock(rwl.readLock());
writeLock = new ReleasableLock(rwl.writeLock());
this.location = config.getTranslogPath();
Files.createDirectories(this.location);
try {
if (translogGeneration != null) {
final Checkpoint checkpoint = readCheckpoint();
final Path nextTranslogFile = location.resolve(getFilename(checkpoint.generation + 1));
final Path currentCheckpointFile = location.resolve(getCommitCheckpointFileName(checkpoint.generation));
// this is special handling for error condition when we create a new writer but we fail to bake
// the newly written file (generation+1) into the checkpoint. This is still a valid state
// we just need to cleanup before we continue
// we hit this before and then blindly deleted the new generation even though we managed to bake it in and then hit this:
// https://discuss.elastic.co/t/cannot-recover-index-because-of-missing-tanslog-files/38336 as an example
//
// For this to happen we must have already copied the translog.ckp file into translog-gen.ckp so we first check if that file exists
// if not we don't even try to clean it up and wait until we fail creating it
assert Files.exists(nextTranslogFile) == false || Files.size(nextTranslogFile) <= TranslogWriter.getHeaderLength(translogUUID) : "unexpected translog file: [" + nextTranslogFile + "]";
if (Files.exists(currentCheckpointFile) // current checkpoint is already copied
&& Files.deleteIfExists(nextTranslogFile)) { // delete it and log a warning
logger.warn("deleted previously created, but not yet committed, next generation [{}]. This can happen due to a tragic exception when creating a new generation", nextTranslogFile.getFileName());
}
this.readers.addAll(recoverFromFiles(translogGeneration, checkpoint));
if (readers.isEmpty()) {
throw new IllegalStateException("at least one reader must be recovered");
}
boolean success = false;
try {
current = createWriter(checkpoint.generation + 1);
this.lastCommittedTranslogFileGeneration = translogGeneration.translogFileGeneration;
success = true;
} finally {
// we have to close all the recovered ones otherwise we leak file handles here
// for instance if we have a lot of tlog and we can't create the writer we keep on holding
// on to all the uncommitted tlog files if we don't close
if (success == false) {
IOUtils.closeWhileHandlingException(readers);
}
}
} else {
IOUtils.rm(location);
logger.debug("wipe translog location - creating new translog");
Files.createDirectories(location);
final long generation = 1;
Checkpoint checkpoint = new Checkpoint(0, 0, generation);
Checkpoint.write(location.resolve(CHECKPOINT_FILE_NAME), checkpoint, StandardOpenOption.WRITE, StandardOpenOption.CREATE_NEW);
current = createWriter(generation);
this.lastCommittedTranslogFileGeneration = NOT_SET_GENERATION;
}
// now that we know which files are there, create a new current one.
} catch (Throwable t) {
// close the opened translog files if we fail to create a new translog...
IOUtils.closeWhileHandlingException(current);
IOUtils.closeWhileHandlingException(readers);
throw t;
}
}
/** recover all translog files found on disk */
private final ArrayList<TranslogReader> recoverFromFiles(TranslogGeneration translogGeneration, Checkpoint checkpoint) throws IOException {
boolean success = false;
ArrayList<TranslogReader> foundTranslogs = new ArrayList<>();
final Path tempFile = Files.createTempFile(location, TRANSLOG_FILE_PREFIX, TRANSLOG_FILE_SUFFIX); // a temp file to copy checkpoint to - note it must be in on the same FS otherwise atomic move won't work
boolean tempFileRenamed = false;
try (ReleasableLock lock = writeLock.acquire()) {
logger.debug("open uncommitted translog checkpoint {}", checkpoint);
final String checkpointTranslogFile = getFilename(checkpoint.generation);
for (long i = translogGeneration.translogFileGeneration; i < checkpoint.generation; i++) {
Path committedTranslogFile = location.resolve(getFilename(i));
if (Files.exists(committedTranslogFile) == false) {
throw new IllegalStateException("translog file doesn't exist with generation: " + i + " lastCommitted: " + lastCommittedTranslogFileGeneration + " checkpoint: " + checkpoint.generation + " - translog ids must be consecutive");
}
final TranslogReader reader = openReader(committedTranslogFile, Checkpoint.read(location.resolve(getCommitCheckpointFileName(i))));
foundTranslogs.add(reader);
logger.debug("recovered local translog from checkpoint {}", checkpoint);
}
foundTranslogs.add(openReader(location.resolve(checkpointTranslogFile), checkpoint));
Path commitCheckpoint = location.resolve(getCommitCheckpointFileName(checkpoint.generation));
if (Files.exists(commitCheckpoint)) {
Checkpoint checkpointFromDisk = Checkpoint.read(commitCheckpoint);
if (checkpoint.equals(checkpointFromDisk) == false) {
throw new IllegalStateException("Checkpoint file " + commitCheckpoint.getFileName() + " already exists but has corrupted content expected: " + checkpoint + " but got: " + checkpointFromDisk);
}
} else {
// we first copy this into the temp-file and then fsync it followed by an atomic move into the target file
// that way if we hit a disk-full here we are still in an consistent state.
Files.copy(location.resolve(CHECKPOINT_FILE_NAME), tempFile, StandardCopyOption.REPLACE_EXISTING);
IOUtils.fsync(tempFile, false);
Files.move(tempFile, commitCheckpoint, StandardCopyOption.ATOMIC_MOVE);
tempFileRenamed = true;
// we only fsync the directory the tempFile was already fsynced
IOUtils.fsync(commitCheckpoint.getParent(), true);
}
success = true;
} finally {
if (success == false) {
IOUtils.closeWhileHandlingException(foundTranslogs);
}
if (tempFileRenamed == false) {
try {
Files.delete(tempFile);
} catch (IOException ex) {
logger.warn("failed to delete temp file {}", ex, tempFile);
}
}
}
return foundTranslogs;
}
TranslogReader openReader(Path path, Checkpoint checkpoint) throws IOException {
FileChannel channel = FileChannel.open(path, StandardOpenOption.READ);
try {
assert Translog.parseIdFromFileName(path) == checkpoint.generation : "expected generation: " + Translog.parseIdFromFileName(path) + " but got: " + checkpoint.generation;
TranslogReader reader = TranslogReader.open(channel, path, checkpoint, translogUUID);
channel = null;
return reader;
} finally {
IOUtils.close(channel);
}
}
/**
* Extracts the translog generation from a file name.
*
* @throws IllegalArgumentException if the path doesn't match the expected pattern.
*/
public static long parseIdFromFileName(Path translogFile) {
final String fileName = translogFile.getFileName().toString();
final Matcher matcher = PARSE_STRICT_ID_PATTERN.matcher(fileName);
if (matcher.matches()) {
try {
return Long.parseLong(matcher.group(1));
} catch (NumberFormatException e) {
throw new IllegalStateException("number formatting issue in a file that passed PARSE_STRICT_ID_PATTERN: " + fileName + "]", e);
}
}
throw new IllegalArgumentException("can't parse id from file: " + fileName);
}
/** Returns {@code true} if this {@code Translog} is still open. */
public boolean isOpen() {
return closed.get() == false;
}
@Override
public void close() throws IOException {
if (closed.compareAndSet(false, true)) {
try (ReleasableLock lock = writeLock.acquire()) {
try {
current.sync();
} finally {
closeFilesIfNoPendingViews();
}
} finally {
FutureUtils.cancel(syncScheduler);
logger.debug("translog closed");
}
}
}
/**
* Returns all translog locations as absolute paths.
* These paths don't contain actual translog files they are
* directories holding the transaction logs.
*/
public Path location() {
return location;
}
/**
* Returns the generation of the current transaction log.
*/
public long currentFileGeneration() {
try (ReleasableLock lock = readLock.acquire()) {
return current.getGeneration();
}
}
/**
* Returns the number of operations in the transaction files that aren't committed to lucene..
*/
public int totalOperations() {
return totalOperations(lastCommittedTranslogFileGeneration);
}
/**
* Returns the size in bytes of the translog files that aren't committed to lucene.
*/
public long sizeInBytes() {
return sizeInBytes(lastCommittedTranslogFileGeneration);
}
/**
* Returns the number of operations in the transaction files that aren't committed to lucene..
*/
private int totalOperations(long minGeneration) {
try (ReleasableLock ignored = readLock.acquire()) {
ensureOpen();
return Stream.concat(readers.stream(), Stream.of(current))
.filter(r -> r.getGeneration() >= minGeneration)
.mapToInt(BaseTranslogReader::totalOperations)
.sum();
}
}
/**
* Returns the size in bytes of the translog files that aren't committed to lucene.
*/
private long sizeInBytes(long minGeneration) {
try (ReleasableLock ignored = readLock.acquire()) {
ensureOpen();
return Stream.concat(readers.stream(), Stream.of(current))
.filter(r -> r.getGeneration() >= minGeneration)
.mapToLong(BaseTranslogReader::sizeInBytes)
.sum();
}
}
TranslogWriter createWriter(long fileGeneration) throws IOException {
TranslogWriter newFile;
try {
newFile = TranslogWriter.create(shardId, translogUUID, fileGeneration, location.resolve(getFilename(fileGeneration)), getChannelFactory(), config.getBufferSize());
} catch (IOException e) {
throw new TranslogException(shardId, "failed to create new translog file", e);
}
return newFile;
}
/**
* Read the Operation object from the given location. This method will try to read the given location from
* the current or from the currently committing translog file. If the location is in a file that has already
* been closed or even removed the method will return <code>null</code> instead.
*/
public Translog.Operation read(Location location) {
try (ReleasableLock lock = readLock.acquire()) {
final BaseTranslogReader reader;
final long currentGeneration = current.getGeneration();
if (currentGeneration == location.generation) {
reader = current;
} else if (readers.isEmpty() == false && readers.get(readers.size() - 1).getGeneration() == location.generation) {
reader = readers.get(readers.size() - 1);
} else if (currentGeneration < location.generation) {
throw new IllegalStateException("location generation [" + location.generation + "] is greater than the current generation [" + currentGeneration + "]");
} else {
return null;
}
return reader.read(location);
} catch (IOException e) {
throw new ElasticsearchException("failed to read source from translog location " + location, e);
}
}
/**
* Adds a delete / index operations to the transaction log.
*
* @see org.elasticsearch.index.translog.Translog.Operation
* @see Index
* @see org.elasticsearch.index.translog.Translog.Delete
*/
public Location add(Operation operation) throws IOException {
final ReleasableBytesStreamOutput out = new ReleasableBytesStreamOutput(bigArrays);
try {
final BufferedChecksumStreamOutput checksumStreamOutput = new BufferedChecksumStreamOutput(out);
final long start = out.position();
out.skip(RamUsageEstimator.NUM_BYTES_INT);
writeOperationNoSize(checksumStreamOutput, operation);
final long end = out.position();
final int operationSize = (int) (end - RamUsageEstimator.NUM_BYTES_INT - start);
out.seek(start);
out.writeInt(operationSize);
out.seek(end);
final ReleasablePagedBytesReference bytes = out.bytes();
try (ReleasableLock lock = readLock.acquire()) {
ensureOpen();
Location location = current.add(bytes);
assert assertBytesAtLocation(location, bytes);
return location;
}
} catch (AlreadyClosedException | IOException ex) {
closeOnTragicEvent(ex);
throw ex;
} catch (Throwable e) {
closeOnTragicEvent(e);
throw new TranslogException(shardId, "Failed to write operation [" + operation + "]", e);
} finally {
Releasables.close(out.bytes());
}
}
boolean assertBytesAtLocation(Translog.Location location, BytesReference expectedBytes) throws IOException {
// tests can override this
ByteBuffer buffer = ByteBuffer.allocate(location.size);
current.readBytes(buffer, location.translogLocation);
return new BytesArray(buffer.array()).equals(expectedBytes);
}
/**
* Snapshots the current transaction log allowing to safely iterate over the snapshot.
* Snapshots are fixed in time and will not be updated with future operations.
*/
public Snapshot newSnapshot() {
return createSnapshot(Long.MIN_VALUE);
}
private Snapshot createSnapshot(long minGeneration) {
try (ReleasableLock ignored = readLock.acquire()) {
ensureOpen();
Snapshot[] snapshots = Stream.concat(readers.stream(), Stream.of(current))
.filter(reader -> reader.getGeneration() >= minGeneration)
.map(BaseTranslogReader::newSnapshot).toArray(Snapshot[]::new);
return new MultiSnapshot(snapshots);
}
}
/**
* Returns a view into the current translog that is guaranteed to retain all current operations
* while receiving future ones as well
*/
public Translog.View newView() {
try (ReleasableLock lock = readLock.acquire()) {
ensureOpen();
View view = new View(lastCommittedTranslogFileGeneration);
outstandingViews.add(view);
return view;
}
}
/**
* Sync's the translog.
*/
public void sync() throws IOException {
try (ReleasableLock lock = readLock.acquire()) {
if (closed.get() == false) {
current.sync();
}
} catch (Throwable ex) {
closeOnTragicEvent(ex);
throw ex;
}
}
public boolean syncNeeded() {
try (ReleasableLock lock = readLock.acquire()) {
return current.syncNeeded();
}
}
/** package private for testing */
public static String getFilename(long generation) {
return TRANSLOG_FILE_PREFIX + generation + TRANSLOG_FILE_SUFFIX;
}
static String getCommitCheckpointFileName(long generation) {
return TRANSLOG_FILE_PREFIX + generation + CHECKPOINT_SUFFIX;
}
/**
* Ensures that the given location has be synced / written to the underlying storage.
*
* @return Returns <code>true</code> iff this call caused an actual sync operation otherwise <code>false</code>
*/
public boolean ensureSynced(Location location) throws IOException {
try (ReleasableLock lock = readLock.acquire()) {
if (location.generation == current.getGeneration()) { // if we have a new one it's already synced
ensureOpen();
return current.syncUpTo(location.translogLocation + location.size);
}
} catch (Throwable ex) {
closeOnTragicEvent(ex);
throw ex;
}
return false;
}
private void closeOnTragicEvent(Throwable ex) {
if (current.getTragicException() != null) {
try {
close();
} catch (AlreadyClosedException inner) {
// don't do anything in this case. The AlreadyClosedException comes from TranslogWriter and we should not add it as suppressed because
// will contain the Exception ex as cause. See also https://github.com/elastic/elasticsearch/issues/15941
} catch (Exception inner) {
assert (ex != inner.getCause());
ex.addSuppressed(inner);
}
}
}
/**
* return stats
*/
public TranslogStats stats() {
// acquire lock to make the two numbers roughly consistent (no file change half way)
try (ReleasableLock lock = readLock.acquire()) {
return new TranslogStats(totalOperations(), sizeInBytes());
}
}
private boolean isReferencedGeneration(long generation) { // used to make decisions if a file can be deleted
return generation >= lastCommittedTranslogFileGeneration;
}
public TranslogConfig getConfig() {
return config;
}
/**
* a view into the translog, capturing all translog file at the moment of creation
* and updated with any future translog.
*/
/**
* a view into the translog, capturing all translog file at the moment of creation
* and updated with any future translog.
*/
public class View implements Closeable {
AtomicBoolean closed = new AtomicBoolean();
final long minGeneration;
View(long minGeneration) {
this.minGeneration = minGeneration;
}
/** this smallest translog generation in this view */
public long minTranslogGeneration() {
return minGeneration;
}
/**
* The total number of operations in the view.
*/
public int totalOperations() {
return Translog.this.totalOperations(minGeneration);
}
/**
* Returns the size in bytes of the files behind the view.
*/
public long sizeInBytes() {
return Translog.this.sizeInBytes(minGeneration);
}
/** create a snapshot from this view */
public Snapshot snapshot() {
ensureOpen();
return Translog.this.createSnapshot(minGeneration);
}
void ensureOpen() {
if (closed.get()) {
throw new AlreadyClosedException("View is already closed");
}
}
@Override
public void close() throws IOException {
if (closed.getAndSet(true) == false) {
logger.trace("closing view starting at translog [{}]", minTranslogGeneration());
boolean removed = outstandingViews.remove(this);
assert removed : "View was never set but was supposed to be removed";
trimUnreferencedReaders();
closeFilesIfNoPendingViews();
}
}
}
public static class Location implements Accountable, Comparable<Location> {
public final long generation;
public final long translogLocation;
public final int size;
Location(long generation, long translogLocation, int size) {
this.generation = generation;
this.translogLocation = translogLocation;
this.size = size;
}
@Override
public long ramBytesUsed() {
return RamUsageEstimator.NUM_BYTES_OBJECT_HEADER + 2 * RamUsageEstimator.NUM_BYTES_LONG + RamUsageEstimator.NUM_BYTES_INT;
}
@Override
public Collection<Accountable> getChildResources() {
return Collections.emptyList();
}
@Override
public String toString() {
return "[generation: " + generation + ", location: " + translogLocation + ", size: " + size + "]";
}
@Override
public int compareTo(Location o) {
if (generation == o.generation) {
return Long.compare(translogLocation, o.translogLocation);
}
return Long.compare(generation, o.generation);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Location location = (Location) o;
if (generation != location.generation) {
return false;
}
if (translogLocation != location.translogLocation) {
return false;
}
return size == location.size;
}
@Override
public int hashCode() {
int result = Long.hashCode(generation);
result = 31 * result + Long.hashCode(translogLocation);
result = 31 * result + size;
return result;
}
}
/**
* A snapshot of the transaction log, allows to iterate over all the transaction log operations.
*/
public interface Snapshot {
/**
* The total number of operations in the translog.
*/
int totalOperations();
/**
* Returns the next operation in the snapshot or <code>null</code> if we reached the end.
*/
Translog.Operation next() throws IOException;
}
/**
* A generic interface representing an operation performed on the transaction log.
* Each is associated with a type.
*/
public interface Operation extends Streamable {
enum Type {
@Deprecated
CREATE((byte) 1),
INDEX((byte) 2),
DELETE((byte) 3);
private final byte id;
private Type(byte id) {
this.id = id;
}
public byte id() {
return this.id;
}
public static Type fromId(byte id) {
switch (id) {
case 1:
return CREATE;
case 2:
return INDEX;
case 3:
return DELETE;
default:
throw new IllegalArgumentException("No type mapped for [" + id + "]");
}
}
}
Type opType();
long estimateSize();
Source getSource();
}
public static class Source {
public final BytesReference source;
public final String routing;
public final String parent;
public final long timestamp;
public final long ttl;
public Source(BytesReference source, String routing, String parent, long timestamp, long ttl) {
this.source = source;
this.routing = routing;
this.parent = parent;
this.timestamp = timestamp;
this.ttl = ttl;
}
}
public static class Index implements Operation {
public static final int SERIALIZATION_FORMAT = 6;
private String id;
private String type;
private long version = Versions.MATCH_ANY;
private VersionType versionType = VersionType.INTERNAL;
private BytesReference source;
private String routing;
private String parent;
private long timestamp;
private long ttl;
public Index() {
}
public Index(Engine.Index index) {
this.id = index.id();
this.type = index.type();
this.source = index.source();
this.routing = index.routing();
this.parent = index.parent();
this.version = index.version();
this.timestamp = index.timestamp();
this.ttl = index.ttl();
this.versionType = index.versionType();
}
public Index(String type, String id, byte[] source) {
this.type = type;
this.id = id;
this.source = new BytesArray(source);
}
@Override
public Type opType() {
return Type.INDEX;
}
@Override
public long estimateSize() {
return ((id.length() + type.length()) * 2) + source.length() + 12;
}
public String type() {
return this.type;
}
public String id() {
return this.id;
}
public String routing() {
return this.routing;
}
public String parent() {
return this.parent;
}
public long timestamp() {
return this.timestamp;
}
public long ttl() {
return this.ttl;
}
public BytesReference source() {
return this.source;
}
public long version() {
return this.version;
}
public VersionType versionType() {
return versionType;
}
@Override
public Source getSource() {
return new Source(source, routing, parent, timestamp, ttl);
}
@Override
public void readFrom(StreamInput in) throws IOException {
int version = in.readVInt(); // version
id = in.readString();
type = in.readString();
source = in.readBytesReference();
try {
if (version >= 1) {
if (in.readBoolean()) {
routing = in.readString();
}
}
if (version >= 2) {
if (in.readBoolean()) {
parent = in.readString();
}
}
if (version >= 3) {
this.version = in.readLong();
}
if (version >= 4) {
this.timestamp = in.readLong();
}
if (version >= 5) {
this.ttl = in.readLong();
}
if (version >= 6) {
this.versionType = VersionType.fromValue(in.readByte());
}
} catch (Exception e) {
throw new ElasticsearchException("failed to read [" + type + "][" + id + "]", e);
}
assert versionType.validateVersionForWrites(version);
}
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(SERIALIZATION_FORMAT);
out.writeString(id);
out.writeString(type);
out.writeBytesReference(source);
if (routing == null) {
out.writeBoolean(false);
} else {
out.writeBoolean(true);
out.writeString(routing);
}
if (parent == null) {
out.writeBoolean(false);
} else {
out.writeBoolean(true);
out.writeString(parent);
}
out.writeLong(version);
out.writeLong(timestamp);
out.writeLong(ttl);
out.writeByte(versionType.getValue());
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Index index = (Index) o;
if (version != index.version ||
timestamp != index.timestamp ||
ttl != index.ttl ||
id.equals(index.id) == false ||
type.equals(index.type) == false ||
versionType != index.versionType ||
source.equals(index.source) == false) {
return false;
}
if (routing != null ? !routing.equals(index.routing) : index.routing != null) {
return false;
}
return !(parent != null ? !parent.equals(index.parent) : index.parent != null);
}
@Override
public int hashCode() {
int result = id.hashCode();
result = 31 * result + type.hashCode();
result = 31 * result + Long.hashCode(version);
result = 31 * result + versionType.hashCode();
result = 31 * result + source.hashCode();
result = 31 * result + (routing != null ? routing.hashCode() : 0);
result = 31 * result + (parent != null ? parent.hashCode() : 0);
result = 31 * result + Long.hashCode(timestamp);
result = 31 * result + Long.hashCode(ttl);
return result;
}
@Override
public String toString() {
return "Index{" +
"id='" + id + '\'' +
", type='" + type + '\'' +
'}';
}
}
public static class Delete implements Operation {
public static final int SERIALIZATION_FORMAT = 2;
private Term uid;
private long version = Versions.MATCH_ANY;
private VersionType versionType = VersionType.INTERNAL;
public Delete() {
}
public Delete(Engine.Delete delete) {
this(delete.uid());
this.version = delete.version();
this.versionType = delete.versionType();
}
public Delete(Term uid) {
this.uid = uid;
}
public Delete(Term uid, long version, VersionType versionType) {
this.uid = uid;
this.version = version;
this.versionType = versionType;
}
@Override
public Type opType() {
return Type.DELETE;
}
@Override
public long estimateSize() {
return ((uid.field().length() + uid.text().length()) * 2) + 20;
}
public Term uid() {
return this.uid;
}
public long version() {
return this.version;
}
public VersionType versionType() {
return this.versionType;
}
@Override
public Source getSource() {
throw new IllegalStateException("trying to read doc source from delete operation");
}
@Override
public void readFrom(StreamInput in) throws IOException {
int version = in.readVInt(); // version
uid = new Term(in.readString(), in.readString());
if (version >= 1) {
this.version = in.readLong();
}
if (version >= 2) {
this.versionType = VersionType.fromValue(in.readByte());
}
assert versionType.validateVersionForWrites(version);
}
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeVInt(SERIALIZATION_FORMAT);
out.writeString(uid.field());
out.writeString(uid.text());
out.writeLong(version);
out.writeByte(versionType.getValue());
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Delete delete = (Delete) o;
return version == delete.version &&
uid.equals(delete.uid) &&
versionType == delete.versionType;
}
@Override
public int hashCode() {
int result = uid.hashCode();
result = 31 * result + Long.hashCode(version);
result = 31 * result + versionType.hashCode();
return result;
}
@Override
public String toString() {
return "Delete{" +
"uid=" + uid +
'}';
}
}
public enum Durability {
/**
* Async durability - translogs are synced based on a time interval.
*/
ASYNC,
/**
* Request durability - translogs are synced for each high levle request (bulk, index, delete)
*/
REQUEST;
}
private static void verifyChecksum(BufferedChecksumStreamInput in) throws IOException {
// This absolutely must come first, or else reading the checksum becomes part of the checksum
long expectedChecksum = in.getChecksum();
long readChecksum = in.readInt() & 0xFFFF_FFFFL;
if (readChecksum != expectedChecksum) {
throw new TranslogCorruptedException("translog stream is corrupted, expected: 0x" +
Long.toHexString(expectedChecksum) + ", got: 0x" + Long.toHexString(readChecksum));
}
}
/**
* Reads a list of operations written with {@link #writeOperations(StreamOutput, List)}
*/
public static List<Operation> readOperations(StreamInput input) throws IOException {
ArrayList<Operation> operations = new ArrayList<>();
int numOps = input.readInt();
final BufferedChecksumStreamInput checksumStreamInput = new BufferedChecksumStreamInput(input);
for (int i = 0; i < numOps; i++) {
operations.add(readOperation(checksumStreamInput));
}
return operations;
}
static Translog.Operation readOperation(BufferedChecksumStreamInput in) throws IOException {
Translog.Operation operation;
try {
final int opSize = in.readInt();
if (opSize < 4) { // 4byte for the checksum
throw new AssertionError("operation size must be at least 4 but was: " + opSize);
}
in.resetDigest(); // size is not part of the checksum!
if (in.markSupported()) { // if we can we validate the checksum first
// we are sometimes called when mark is not supported this is the case when
// we are sending translogs across the network with LZ4 compression enabled - currently there is no way s
// to prevent this unfortunately.
in.mark(opSize);
in.skip(opSize - 4);
verifyChecksum(in);
in.reset();
}
Translog.Operation.Type type = Translog.Operation.Type.fromId(in.readByte());
operation = newOperationFromType(type);
operation.readFrom(in);
verifyChecksum(in);
} catch (EOFException e) {
throw new TruncatedTranslogException("reached premature end of file, translog is truncated", e);
} catch (AssertionError | Exception e) {
throw new TranslogCorruptedException("translog corruption while reading from stream", e);
}
return operation;
}
/**
* Writes all operations in the given iterable to the given output stream including the size of the array
* use {@link #readOperations(StreamInput)} to read it back.
*/
public static void writeOperations(StreamOutput outStream, List<Operation> toWrite) throws IOException {
final ReleasableBytesStreamOutput out = new ReleasableBytesStreamOutput(BigArrays.NON_RECYCLING_INSTANCE);
try {
outStream.writeInt(toWrite.size());
final BufferedChecksumStreamOutput checksumStreamOutput = new BufferedChecksumStreamOutput(out);
for (Operation op : toWrite) {
out.reset();
final long start = out.position();
out.skip(RamUsageEstimator.NUM_BYTES_INT);
writeOperationNoSize(checksumStreamOutput, op);
long end = out.position();
int operationSize = (int) (out.position() - RamUsageEstimator.NUM_BYTES_INT - start);
out.seek(start);
out.writeInt(operationSize);
out.seek(end);
ReleasablePagedBytesReference bytes = out.bytes();
bytes.writeTo(outStream);
}
} finally {
Releasables.close(out.bytes());
}
}
public static void writeOperationNoSize(BufferedChecksumStreamOutput out, Translog.Operation op) throws IOException {
// This BufferedChecksumStreamOutput remains unclosed on purpose,
// because closing it closes the underlying stream, which we don't
// want to do here.
out.resetDigest();
out.writeByte(op.opType().id());
op.writeTo(out);
long checksum = out.getChecksum();
out.writeInt((int) checksum);
}
/**
* Returns a new empty translog operation for the given {@link Translog.Operation.Type}
*/
static Translog.Operation newOperationFromType(Translog.Operation.Type type) throws IOException {
switch (type) {
case CREATE:
// the deserialization logic in Index was identical to that of Create when create was deprecated
return new Index();
case DELETE:
return new Translog.Delete();
case INDEX:
return new Index();
default:
throw new IOException("No type for [" + type + "]");
}
}
@Override
public void prepareCommit() throws IOException {
try (ReleasableLock lock = writeLock.acquire()) {
ensureOpen();
if (currentCommittingGeneration != NOT_SET_GENERATION) {
throw new IllegalStateException("already committing a translog with generation: " + currentCommittingGeneration);
}
currentCommittingGeneration = current.getGeneration();
TranslogReader currentCommittingTranslog = current.closeIntoReader();
readers.add(currentCommittingTranslog);
Path checkpoint = location.resolve(CHECKPOINT_FILE_NAME);
assert Checkpoint.read(checkpoint).generation == currentCommittingTranslog.getGeneration();
Path commitCheckpoint = location.resolve(getCommitCheckpointFileName(currentCommittingTranslog.getGeneration()));
Files.copy(checkpoint, commitCheckpoint);
IOUtils.fsync(commitCheckpoint, false);
IOUtils.fsync(commitCheckpoint.getParent(), true);
// create a new translog file - this will sync it and update the checkpoint data;
current = createWriter(current.getGeneration() + 1);
logger.trace("current translog set to [{}]", current.getGeneration());
} catch (Throwable t) {
IOUtils.closeWhileHandlingException(this); // tragic event
throw t;
}
}
@Override
public void commit() throws IOException {
try (ReleasableLock lock = writeLock.acquire()) {
ensureOpen();
if (currentCommittingGeneration == NOT_SET_GENERATION) {
prepareCommit();
}
assert currentCommittingGeneration != NOT_SET_GENERATION;
assert readers.stream().filter(r -> r.getGeneration() == currentCommittingGeneration).findFirst().isPresent()
: "reader list doesn't contain committing generation [" + currentCommittingGeneration + "]";
lastCommittedTranslogFileGeneration = current.getGeneration(); // this is important - otherwise old files will not be cleaned up
currentCommittingGeneration = NOT_SET_GENERATION;
trimUnreferencedReaders();
}
}
void trimUnreferencedReaders() {
try (ReleasableLock ignored = writeLock.acquire()) {
if (closed.get()) {
// we're shutdown potentially on some tragic event - don't delete anything
return;
}
long minReferencedGen = outstandingViews.stream().mapToLong(View::minTranslogGeneration).min().orElse(Long.MAX_VALUE);
minReferencedGen = Math.min(lastCommittedTranslogFileGeneration, minReferencedGen);
final long finalMinReferencedGen = minReferencedGen;
List<TranslogReader> unreferenced = readers.stream().filter(r -> r.getGeneration() < finalMinReferencedGen).collect(Collectors.toList());
for (final TranslogReader unreferencedReader : unreferenced) {
Path translogPath = unreferencedReader.path();
logger.trace("delete translog file - not referenced and not current anymore {}", translogPath);
IOUtils.closeWhileHandlingException(unreferencedReader);
IOUtils.deleteFilesIgnoringExceptions(translogPath,
translogPath.resolveSibling(getCommitCheckpointFileName(unreferencedReader.getGeneration())));
}
readers.removeAll(unreferenced);
}
}
void closeFilesIfNoPendingViews() throws IOException {
try (ReleasableLock ignored = writeLock.acquire()) {
if (closed.get() && outstandingViews.isEmpty()) {
logger.trace("closing files. translog is closed and there are no pending views");
ArrayList<Closeable> toClose = new ArrayList<>(readers);
toClose.add(current);
IOUtils.close(toClose);
}
}
}
@Override
public void rollback() throws IOException {
ensureOpen();
close();
}
/**
* References a transaction log generation
*/
public final static class TranslogGeneration {
public final String translogUUID;
public final long translogFileGeneration;
public TranslogGeneration(String translogUUID, long translogFileGeneration) {
this.translogUUID = translogUUID;
this.translogFileGeneration = translogFileGeneration;
}
}
/**
* Returns the current generation of this translog. This corresponds to the latest uncommitted translog generation
*/
public TranslogGeneration getGeneration() {
try (ReleasableLock lock = writeLock.acquire()) {
return new TranslogGeneration(translogUUID, currentFileGeneration());
}
}
/**
* Returns <code>true</code> iff the given generation is the current gbeneration of this translog
*/
public boolean isCurrent(TranslogGeneration generation) {
try (ReleasableLock lock = writeLock.acquire()) {
if (generation != null) {
if (generation.translogUUID.equals(translogUUID) == false) {
throw new IllegalArgumentException("commit belongs to a different translog: " + generation.translogUUID + " vs. " + translogUUID);
}
return generation.translogFileGeneration == currentFileGeneration();
}
}
return false;
}
long getFirstOperationPosition() { // for testing
return current.getFirstOperationOffset();
}
private void ensureOpen() {
if (closed.get()) {
throw new AlreadyClosedException("translog is already closed", current.getTragicException());
}
}
/**
* The number of currently open views
*/
int getNumOpenViews() {
return outstandingViews.size();
}
TranslogWriter.ChannelFactory getChannelFactory() {
return TranslogWriter.ChannelFactory.DEFAULT;
}
/**
* If this {@code Translog} was closed as a side-effect of a tragic exception,
* e.g. disk full while flushing a new segment, this returns the root cause exception.
* Otherwise (no tragic exception has occurred) it returns null.
*/
public Throwable getTragicException() {
return current.getTragicException();
}
/** Reads and returns the current checkpoint */
final Checkpoint readCheckpoint() throws IOException {
return Checkpoint.read(location.resolve(CHECKPOINT_FILE_NAME));
}
}
| {
"content_hash": "0ce7332e548a8f4aae0b4fab686716fb",
"timestamp": "",
"source": "github",
"line_count": 1329,
"max_line_length": 246,
"avg_line_length": 40.581640331075995,
"alnum_prop": 0.610108838744368,
"repo_name": "jbertouch/elasticsearch",
"id": "5a4438f426dd2c180cbb9056dee996782b1ff410",
"size": "54721",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "core/src/main/java/org/elasticsearch/index/translog/Translog.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "8172"
},
{
"name": "Batchfile",
"bytes": "11683"
},
{
"name": "Emacs Lisp",
"bytes": "3341"
},
{
"name": "FreeMarker",
"bytes": "45"
},
{
"name": "Groovy",
"bytes": "208816"
},
{
"name": "HTML",
"bytes": "5595"
},
{
"name": "Java",
"bytes": "33336597"
},
{
"name": "Perl",
"bytes": "6923"
},
{
"name": "Python",
"bytes": "75439"
},
{
"name": "Ruby",
"bytes": "1917"
},
{
"name": "Shell",
"bytes": "90887"
}
],
"symlink_target": ""
} |
<?xml version="1.0"?>
<package>
<name>pose_filter</name>
<version>0.0.0</version>
<description>The pose_filter package</description>
<author email="dfk@eecs.berkeley.edu">David Fridovich-Keil</author>
<maintainer email="dfk@eecs.berkeley.edu">David Fridovich-Keil</maintainer>
<license>none</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<run_depend>roscpp</run_depend>
</package>
| {
"content_hash": "4a3dc7949ec9d08ed9b179dbf1ea75dc",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 77,
"avg_line_length": 27.875,
"alnum_prop": 0.7242152466367713,
"repo_name": "dfridovi/ROS",
"id": "5d1bdf6f39dc2c118506165882e9af4358c21bb0",
"size": "446",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/pose_filter/package.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "13505"
},
{
"name": "C++",
"bytes": "481879"
},
{
"name": "CMake",
"bytes": "47228"
},
{
"name": "Python",
"bytes": "2858"
}
],
"symlink_target": ""
} |
//-----------------------------------NOTICE----------------------------------//
// Some of this file is automatically filled in by a Python script. Only //
// add custom code in the designated areas or it will be overwritten during //
// the next update. //
//-----------------------------------NOTICE----------------------------------//
#ifndef _NIBSPLINEINTERPOLATOR_H_
#define _NIBSPLINEINTERPOLATOR_H_
//--BEGIN FILE HEAD CUSTOM CODE--//
//--END CUSTOM CODE--//
#include "NiInterpolator.h"
// Include structures
#include "../Ref.h"
namespace Niflib {
// Forward define of referenced NIF objects
class NiBSplineData;
class NiBSplineBasisData;
class NiBSplineInterpolator;
typedef Ref<NiBSplineInterpolator> NiBSplineInterpolatorRef;
/*! For interpolators storing data via a B-spline. */
class NiBSplineInterpolator : public NiInterpolator {
public:
/*! Constructor */
NIFLIB_API NiBSplineInterpolator();
/*! Destructor */
NIFLIB_API virtual ~NiBSplineInterpolator();
/*!
* A constant value which uniquly identifies objects of this type.
*/
NIFLIB_API static const Type TYPE;
/*!
* A factory function used during file reading to create an instance of this type of object.
* \return A pointer to a newly allocated instance of this type of object.
*/
NIFLIB_API static NiObject * Create();
/*!
* Summarizes the information contained in this object in English.
* \param[in] verbose Determines whether or not detailed information about large areas of data will be printed out.
* \return A string containing a summary of the information within the object in English. This is the function that Niflyze calls to generate its analysis, so the output is the same.
*/
NIFLIB_API virtual string asString( bool verbose = false ) const;
/*!
* Used to determine the type of a particular instance of this object.
* \return The type constant for the actual type of the object.
*/
NIFLIB_API virtual const Type & GetType() const;
/***Begin Example Naive Implementation****
// Animation start time.
// \return The current value.
float GetStartTime() const;
// Animation start time.
// \param[in] value The new value.
void SetStartTime( float value );
// Animation stop time.
// \return The current value.
float GetStopTime() const;
// Animation stop time.
// \param[in] value The new value.
void SetStopTime( float value );
// Refers to NiBSplineData.
// \return The current value.
Ref<NiBSplineData > GetSplineData() const;
// Refers to NiBSplineData.
// \param[in] value The new value.
void SetSplineData( Ref<NiBSplineData > value );
// Refers to NiBSPlineBasisData.
// \return The current value.
Ref<NiBSplineBasisData > GetBasisData() const;
// Refers to NiBSPlineBasisData.
// \param[in] value The new value.
void SetBasisData( Ref<NiBSplineBasisData > value );
****End Example Naive Implementation***/
//--BEGIN MISC CUSTOM CODE--//
/*!
* Retrieves the animation start time.
* \return The animation start time
*/
NIFLIB_API float GetStartTime() const;
/*!
* Sets the animation start time.
* \param[in] value The new animation start time
*/
NIFLIB_API void SetStartTime( float value );
/*!
* Retrieves the animation stop time.
* \return The animation stop time
*/
NIFLIB_API float GetStopTime() const;
/*!
* Sets the animation stop time.
* \param[in] value The new animation stop time
*/
NIFLIB_API void SetStopTime( float value );
/*!
* Gets the NiBSplineData used by this interpolator.
* \return the NiBSplineData used by this interpolator.
*/
NIFLIB_API Ref<NiBSplineData > GetSplineData() const;
/*!
* Sets the NiBSplineData used by this interpolator.
* \param[in] value The NiBSplineData used by this interpolator.
*/
NIFLIB_API void SetSplineData( NiBSplineData * value );
/*!
* Gets the NiBSplineBasisData used by this interpolator.
* \return the NiBSplineBasisData used by this interpolator.
*/
NIFLIB_API Ref<NiBSplineBasisData > GetBasisData() const;
/*!
* Sets the SetBasisData used by this interpolator.
* \param[in] value The SetBasisData used by this interpolator.
*/
NIFLIB_API void SetBasisData( NiBSplineBasisData * value );
protected:
// internal method for bspline calculation in child classes
static void bspline(int n, int t, int l, float *control, float *output, int num_output);
//--END CUSTOM CODE--//
protected:
/*! Animation start time. */
float startTime;
/*! Animation stop time. */
float stopTime;
/*! Refers to NiBSplineData. */
Ref<NiBSplineData > splineData;
/*! Refers to NiBSPlineBasisData. */
Ref<NiBSplineBasisData > basisData;
public:
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual void Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info );
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual void Write( ostream& out, const map<NiObjectRef,unsigned int> & link_map, list<NiObject *> & missing_link_stack, const NifInfo & info ) const;
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual void FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, list<NiObjectRef> & missing_link_stack, const NifInfo & info );
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual list<NiObjectRef> GetRefs() const;
/*! NIFLIB_HIDDEN function. For internal use only. */
NIFLIB_HIDDEN virtual list<NiObject *> GetPtrs() const;
};
//--BEGIN FILE FOOT CUSTOM CODE--//
//--END CUSTOM CODE--//
} //End Niflib namespace
#endif
| {
"content_hash": "1aba7dee8aad50df82d7efee0533cd62",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 184,
"avg_line_length": 31.870056497175142,
"alnum_prop": 0.6949122496011345,
"repo_name": "figment/niflib",
"id": "23b61947dd0aba1f9f5b75f75bda572365c4731a",
"size": "5755",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "include/obj/NiBSplineInterpolator.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "393"
},
{
"name": "C++",
"bytes": "5559387"
},
{
"name": "CMake",
"bytes": "13336"
},
{
"name": "HTML",
"bytes": "485"
},
{
"name": "Objective-C",
"bytes": "10426"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "5b1b2b8ecc7e239028a17d28b1e66745",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "444b95cee819cf181d62675b0d2221c1f5f35abe",
"size": "188",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Cladoniaceae/Cladonia/Cladonia decorticata/ Syn. Capitularia decorticata/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
// Copyright 2022 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import './analyses_table.css';
import { useState } from 'react';
import { useQuery } from 'react-query';
import Alert from '@mui/material/Alert';
import AlertTitle from '@mui/material/AlertTitle';
import Box from '@mui/material/Box';
import CircularProgress from '@mui/material/CircularProgress';
import Paper from '@mui/material/Paper';
import Table from '@mui/material/Table';
import TableBody from '@mui/material/TableBody';
import TableCell from '@mui/material/TableCell';
import TableContainer from '@mui/material/TableContainer';
import TableHead from '@mui/material/TableHead';
import TablePagination from '@mui/material/TablePagination';
import TableRow from '@mui/material/TableRow';
import Typography from '@mui/material/Typography';
import { AnalysisTableRow } from './analysis_table_row/analysis_table_row';
import { NoDataMessageRow } from '../no_data_message_row/no_data_message_row';
import {
Analysis,
getLUCIBisectionService,
ListAnalysesRequest,
} from '../../services/luci_bisection';
interface DisplayedRowsLabelProps {
from: number;
}
export const ListAnalysesTable = () => {
// TODO: implement sorting & filtering for certain columns
// The current page of analyses
const [page, setPage] = useState<number>(0);
// The page size to use when querying for analyses, and also the number
// of rows to display in the table
const [pageSize, setPageSize] = useState<number>(25);
// A record of page tokens to get the next page of results; the key is the
// index of the record to continue from
// TODO: update the key once more query parameters are added
const [pageTokens, setPageTokens] = useState<Map<number, string>>(
new Map<number, string>([[0, '']])
);
const bisectionService = getLUCIBisectionService();
const {
isLoading,
isError,
data: response,
error,
isFetching,
isPreviousData,
} = useQuery(
['listAnalyses', page, pageSize],
async () => {
const startIndex = page * pageSize;
const request: ListAnalysesRequest = {
pageSize: pageSize,
pageToken: pageTokens.get(startIndex) || '',
};
return await bisectionService.listAnalyses(request);
},
{
keepPreviousData: true,
onSuccess: (response) => {
// Record the page token for the next page of analyses
if (response.nextPageToken != null) {
const nextPageStartIndex = (page + 1) * pageSize;
setPageTokens(
new Map(pageTokens.set(nextPageStartIndex, response.nextPageToken))
);
}
},
}
);
const analyses: Analysis[] = response?.analyses || [];
const handleChangePage = (_: React.MouseEvent | null, newPage: number) => {
setPage(newPage);
};
const handleChangeRowsPerPage = (
event: React.ChangeEvent<HTMLInputElement>
) => {
// Set the new page size then reset to the first page of results
setPageSize(parseInt(event.target.value, 10));
setPage(0);
};
const labelDisplayedRows = ({ from }: DisplayedRowsLabelProps) => {
if (analyses) {
return `${from}-${from + analyses.length - 1}`;
}
return '';
};
if (isLoading) {
return (
<Box display='flex' justifyContent='center' alignItems='center'>
<CircularProgress />
</Box>
);
}
if (isError || analyses === undefined) {
return (
<div className='section'>
<Alert severity='error'>
<AlertTitle>Failed to load analyses</AlertTitle>
{/* TODO: display more error detail for input issues e.g.
Build not found, No analysis for that build, etc */}
An error occurred when querying for existing analyses:
<Box sx={{ padding: '1rem' }}>{`${error}`}</Box>
</Alert>
</div>
);
}
const nextPageToken = pageTokens.get((page + 1) * pageSize);
const isLastPage = nextPageToken === undefined || nextPageToken === '';
return (
<>
<TableContainer className='analyses-table-container' component={Paper}>
<Table className='analyses-table' size='small'>
<TableHead>
<TableRow>
<TableCell>Buildbucket ID</TableCell>
<TableCell>Created time</TableCell>
<TableCell>Status</TableCell>
<TableCell>Failure type</TableCell>
<TableCell>Duration</TableCell>
<TableCell>Builder</TableCell>
<TableCell>Culprit CL</TableCell>
</TableRow>
</TableHead>
<TableBody>
{analyses.length > 0 ? (
analyses.map((analysis) => (
<AnalysisTableRow
key={analysis.analysisId}
analysis={analysis}
/>
))
) : (
<NoDataMessageRow message='No analyses found' columns={7} />
)}
</TableBody>
</Table>
</TableContainer>
{analyses.length > 0 && (
<>
{!isFetching || !isPreviousData ? (
<TablePagination
component='div'
count={-1}
page={page}
onPageChange={handleChangePage}
rowsPerPage={pageSize}
rowsPerPageOptions={[25, 50, 100, 200]}
onRowsPerPageChange={handleChangeRowsPerPage}
labelDisplayedRows={labelDisplayedRows}
// disable the "next" button if there are no more analyses
nextIconButtonProps={{ disabled: isLastPage }}
/>
) : (
<Box
sx={{ padding: '1rem' }}
display='flex'
justifyContent='right'
alignItems='center'
>
<CircularProgress size='1.25rem' />
<Box sx={{ paddingLeft: '1rem' }}>
<Typography variant='caption'>Fetching analyses...</Typography>
</Box>
</Box>
)}
</>
)}
</>
);
};
| {
"content_hash": "3c28c15896c2963467a2938683126539",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 79,
"avg_line_length": 32.28921568627451,
"alnum_prop": 0.6075603461363291,
"repo_name": "luci/luci-go",
"id": "2c79a456f14f9f95c47ecfc9f8883c89d244374a",
"size": "6587",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "bisection/frontend/ui/src/components/analyses_tables/list_analyses_table.tsx",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "25460"
},
{
"name": "Go",
"bytes": "10674259"
},
{
"name": "HTML",
"bytes": "658081"
},
{
"name": "JavaScript",
"bytes": "18433"
},
{
"name": "Makefile",
"bytes": "2862"
},
{
"name": "Python",
"bytes": "49205"
},
{
"name": "Shell",
"bytes": "20986"
},
{
"name": "TypeScript",
"bytes": "110221"
}
],
"symlink_target": ""
} |
package net.sf.mmm.util.component.base;
/**
* This type is a collection of spring XML configuration files for the entire project.
*
* @deprecated Spring XML config is dead. Migrate to code configuration (and spring-boot).
* @author Joerg Hohwiller (hohwille at users.sourceforge.net)
* @since 4.0.0
*/
@Deprecated
public interface SpringConfigs {
/** The Spring XML configuration of {@code mmm-util-core}. */
String SPRING_XML_UTIL_CORE = "/net/sf/mmm/util/beans-util-core.xml";
/** The Spring XML configuration of {@code mmm-search} (and {@code mmm-search-engine}). */
String SPRING_XML_SEARCH = "/net/sf/mmm/search/beans-search.xml";
/** The Spring XML configuration of {@code mmm-search-indexer}. */
String SPRING_XML_SEARCH_INDEXER = "/net/sf/mmm/search/indexer/beans-search-indexer.xml";
/** The Spring XML configuration of {@code mmm-content-parser}. */
String SPRING_XML_CONTENT_PARSER = "/net/sf/mmm/content/parser/beans-content-parser.xml";
}
| {
"content_hash": "75f4826ce811e9bfec35b2b6d8cda3a4",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 92,
"avg_line_length": 37.73076923076923,
"alnum_prop": 0.7176350662589195,
"repo_name": "m-m-m/util",
"id": "21842fb1a4b7c8bc806af22159b4fe305e94f9ad",
"size": "1109",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/src/main/java/net/sf/mmm/util/component/base/SpringConfigs.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "116"
},
{
"name": "HTML",
"bytes": "57"
},
{
"name": "Java",
"bytes": "4988376"
}
],
"symlink_target": ""
} |
rangy.createModule("SaveRestore", ["WrappedRange"], function(api, module) {
var dom = api.dom;
var markerTextChar = "\ufeff";
function gEBI(id, doc) {
return (doc || document).getElementById(id);
}
function insertRangeBoundaryMarker(range, atStart) {
var markerId = "selectionBoundary_" + (+new Date()) + "_" + ("" + Math.random()).slice(2);
var markerEl;
var doc = dom.getDocument(range.startContainer);
// Clone the Range and collapse to the appropriate boundary point
var boundaryRange = range.cloneRange();
boundaryRange.collapse(atStart);
// Create the marker element containing a single invisible character using DOM methods and insert it
markerEl = doc.createElementNS("http://www.w3.org/1999/xhtml", "span");
markerEl.id = markerId;
markerEl.style.lineHeight = "0";
markerEl.style.display = "none";
markerEl.className = "rangySelectionBoundary";
markerEl.appendChild(doc.createTextNode(markerTextChar));
boundaryRange.insertNode(markerEl);
boundaryRange.detach();
return markerEl;
}
function setRangeBoundary(doc, range, markerId, atStart) {
var markerEl = gEBI(markerId, doc);
if (markerEl) {
range[atStart ? "setStartBefore" : "setEndBefore"](markerEl);
markerEl.parentNode.removeChild(markerEl);
} else {
module.warn("Marker element has been removed. Cannot restore selection.");
}
}
function compareRanges(r1, r2) {
return r2.compareBoundaryPoints(r1.START_TO_START, r1);
}
function saveRange(range, backward) {
var startEl, endEl, doc = api.DomRange.getRangeDocument(range), text = range.toString();
if (range.collapsed) {
endEl = insertRangeBoundaryMarker(range, false);
return {
document: doc,
markerId: endEl.id,
collapsed: true
};
} else {
endEl = insertRangeBoundaryMarker(range, false);
startEl = insertRangeBoundaryMarker(range, true);
return {
document: doc,
startMarkerId: startEl.id,
endMarkerId: endEl.id,
collapsed: false,
backward: backward,
toString: function() {
return "original text: '" + text + "', new text: '" + range.toString() + "'";
}
};
}
}
function restoreRange(rangeInfo, normalize) {
var doc = rangeInfo.document;
if (typeof normalize == "undefined") {
normalize = true;
}
var range = api.createRange(doc);
if (rangeInfo.collapsed) {
var markerEl = gEBI(rangeInfo.markerId, doc);
if (markerEl) {
markerEl.style.display = "inline";
var previousNode = markerEl.previousSibling;
// Workaround for issue 17
if (previousNode && previousNode.nodeType == 3) {
markerEl.parentNode.removeChild(markerEl);
range.collapseToPoint(previousNode, previousNode.length);
} else {
range.collapseBefore(markerEl);
markerEl.parentNode.removeChild(markerEl);
}
} else {
module.warn("Marker element has been removed. Cannot restore selection.");
}
} else {
setRangeBoundary(doc, range, rangeInfo.startMarkerId, true);
setRangeBoundary(doc, range, rangeInfo.endMarkerId, false);
}
if (normalize) {
range.normalizeBoundaries();
}
return range;
}
function saveRanges(ranges, backward) {
var rangeInfos = [], range, doc;
// Order the ranges by position within the DOM, latest first, cloning the array to leave the original untouched
ranges = ranges.slice(0);
ranges.sort(compareRanges);
for (var i = 0, len = ranges.length; i < len; ++i) {
rangeInfos[i] = saveRange(ranges[i], backward);
}
// Now that all the markers are in place and DOM manipulation over, adjust each range's boundaries to lie
// between its markers
for (i = len - 1; i >= 0; --i) {
range = ranges[i];
doc = api.DomRange.getRangeDocument(range);
if (range.collapsed) {
range.collapseAfter(gEBI(rangeInfos[i].markerId, doc));
} else {
range.setEndBefore(gEBI(rangeInfos[i].endMarkerId, doc));
range.setStartAfter(gEBI(rangeInfos[i].startMarkerId, doc));
}
}
return rangeInfos;
}
function saveSelection(win) {
if (!api.isSelectionValid(win)) {
module.warn("Cannot save selection. This usually happens when the selection is collapsed and the selection document has lost focus.");
return null;
}
var sel = api.getSelection(win);
var ranges = sel.getAllRanges();
var backward = (ranges.length == 1 && sel.isBackward());
var rangeInfos = saveRanges(ranges, backward);
// Ensure current selection is unaffected
if (backward) {
sel.setSingleRange(ranges[0], "backward");
} else {
sel.setRanges(ranges);
}
return {
win: win,
rangeInfos: rangeInfos,
restored: false
};
}
function restoreRanges(rangeInfos) {
var ranges = [];
// Ranges are in reverse order of appearance in the DOM. We want to restore earliest first to avoid
// normalization affecting previously restored ranges.
var rangeCount = rangeInfos.length;
for (var i = rangeCount - 1; i >= 0; i--) {
ranges[i] = restoreRange(rangeInfos[i], true);
}
return ranges;
}
function restoreSelection(savedSelection, preserveDirection) {
if (!savedSelection.restored) {
var rangeInfos = savedSelection.rangeInfos;
var sel = api.getSelection(savedSelection.win);
var ranges = restoreRanges(rangeInfos), rangeCount = rangeInfos.length;
if (rangeCount == 1 && preserveDirection && api.features.selectionHasExtend && rangeInfos[0].backward) {
sel.removeAllRanges();
sel.addRange(ranges[0], true);
} else {
sel.setRanges(ranges);
}
savedSelection.restored = true;
}
}
function removeMarkerElement(doc, markerId) {
var markerEl = gEBI(markerId, doc);
if (markerEl) {
markerEl.parentNode.removeChild(markerEl);
}
}
function removeMarkers(savedSelection) {
var rangeInfos = savedSelection.rangeInfos;
for (var i = 0, len = rangeInfos.length, rangeInfo; i < len; ++i) {
rangeInfo = rangeInfos[i];
if (rangeInfo.collapsed) {
removeMarkerElement(savedSelection.doc, rangeInfo.markerId);
} else {
removeMarkerElement(savedSelection.doc, rangeInfo.startMarkerId);
removeMarkerElement(savedSelection.doc, rangeInfo.endMarkerId);
}
}
}
api.util.extend(api, {
saveRange: saveRange,
restoreRange: restoreRange,
saveRanges: saveRanges,
restoreRanges: restoreRanges,
saveSelection: saveSelection,
restoreSelection: restoreSelection,
removeMarkerElement: removeMarkerElement,
removeMarkers: removeMarkers
});
});
| {
"content_hash": "6eb87b798e92004730c876e14a334c51",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 146,
"avg_line_length": 34.972972972972975,
"alnum_prop": 0.5750901597114889,
"repo_name": "ravn-no/readium-shared-js",
"id": "324087c7d9ab92bdafefe659511758c1360b0f69",
"size": "8163",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "lib/rangy/rangy-selectionsaverestore.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "3885"
},
{
"name": "HTML",
"bytes": "3418"
},
{
"name": "JavaScript",
"bytes": "4095365"
}
],
"symlink_target": ""
} |
#ifndef STRINGSTREAM_EXT_H
#define STRINGSTREAM_EXT_H
#include "dtoolbase.h"
#ifdef HAVE_PYTHON
#include "extension.h"
#include "stringStream.h"
#include "py_panda.h"
/**
* This class defines the extension methods for StringStream, which are called
* instead of any C++ methods with the same prototype.
*/
template<>
class Extension<StringStream> : public ExtensionBase<StringStream> {
public:
void __init__(PyObject *source);
PyObject *get_data();
void set_data(PyObject *data);
};
#endif // HAVE_PYTHON
#endif // STRINGSTREAM_EXT_H
| {
"content_hash": "bbc1feedf710f24a83eb7d0d0069f176",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 78,
"avg_line_length": 19.103448275862068,
"alnum_prop": 0.720216606498195,
"repo_name": "brakhane/panda3d",
"id": "a19a4b3a3693b2095bbab6b66a301af17468d034",
"size": "908",
"binary": false,
"copies": "15",
"ref": "refs/heads/master",
"path": "panda/src/downloader/stringStream_ext.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "4004"
},
{
"name": "C",
"bytes": "6395016"
},
{
"name": "C++",
"bytes": "31193551"
},
{
"name": "Emacs Lisp",
"bytes": "166274"
},
{
"name": "Groff",
"bytes": "3106"
},
{
"name": "HTML",
"bytes": "8081"
},
{
"name": "Java",
"bytes": "3777"
},
{
"name": "JavaScript",
"bytes": "7003"
},
{
"name": "Logos",
"bytes": "5504"
},
{
"name": "MAXScript",
"bytes": "1745"
},
{
"name": "NSIS",
"bytes": "91955"
},
{
"name": "Nemerle",
"bytes": "4403"
},
{
"name": "Objective-C",
"bytes": "30065"
},
{
"name": "Objective-C++",
"bytes": "300394"
},
{
"name": "Perl",
"bytes": "206982"
},
{
"name": "Perl6",
"bytes": "30636"
},
{
"name": "Puppet",
"bytes": "2627"
},
{
"name": "Python",
"bytes": "5530601"
},
{
"name": "Rebol",
"bytes": "421"
},
{
"name": "Shell",
"bytes": "55940"
},
{
"name": "Visual Basic",
"bytes": "136"
}
],
"symlink_target": ""
} |
require 'spec_helper'
describe 'peco' do
let(:pre_condition) { "class homebrew {}" }
it { should contain_class('peco') }
it { should contain_package('peco') }
end
| {
"content_hash": "275c107db4634b29960a2f1cebd2e8d2",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 45,
"avg_line_length": 19.11111111111111,
"alnum_prop": 0.6511627906976745,
"repo_name": "rekotan/puppet-peco",
"id": "88dda81d0e107bba999e7821ef7296ef8523c073",
"size": "172",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/classes/peco_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Puppet",
"bytes": "91"
},
{
"name": "Ruby",
"bytes": "597"
},
{
"name": "Shell",
"bytes": "416"
}
],
"symlink_target": ""
} |
<?php
/*# declare(strict_types=1); */
namespace Phossa2\Shared\Extension;
/**
* ExtensionInterface
*
* @package Phossa2\Shared
* @author Hong Zhang <phossa@126.com>
* @version 2.0.23
* @since 2.0.23 added
*/
interface ExtensionInterface
{
/**
* Array of method names this extension provides
*
* @return string[]
* @access public
* @api
*/
public function methodsAvailable()/*# : array */;
/**
* Boot or prepare this extension for the server
*
* @param ExtensionAwareInterface $server
* @access public
* @api
*/
public function boot(ExtensionAwareInterface $server);
}
| {
"content_hash": "1d143f025f892d5f4242e24ddaf75bf0",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 58,
"avg_line_length": 19.38235294117647,
"alnum_prop": 0.6145675265553869,
"repo_name": "phossa2/shared",
"id": "ecea41d9bc5119ae61e234cabfee4b64bde3f594",
"size": "891",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Shared/Extension/ExtensionInterface.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "169198"
}
],
"symlink_target": ""
} |
var expected = {
'username' : /^[a-zA-Z][a-zA-Z0-9-_\.]{1,20}$/,
'email' : /^[^@]{1,255}@[^@]{1,255}$/,
'email_repeat': /.*/,
'password' : /^.{5,511}$/,
'password_repeat': /.*/
}
module.exports = function (m, session) {
var socket = session.socket;
socket.on("register", function (data) {
console.log("Processing Register..");
socket.emit('userarea', {'contents': 'Processing Registration..'});
console.log(data);
try {
var result = m.form.process(expected, data);
} catch (e) {
console.log("Register Error:", e);
socket.emit('register', {'status': "(1) No Bueno."});
return;
}
m.db.clients.findOne({
username: result.username
}, function (err, user) {
socket.emit('userarea', {'contents': '<script src="/utils"></script><fieldset data-src="/userarea/loginOrRegister"></fieldset>'});
if (err) {
socket.emit('register', {'status': "(2) No Bueno."});
}
if (user !== null) {
socket.emit('register', {'status': "(3) Username already exists."});
return;
} else {
m.db.clients.insert({
username: result.username,
email: result.email,
password: m.form.hash(result.password),
}, function (err, user) {
session.user = user
session.event.emit('logged_in', true);
m.event.emit('activity', {
"username": result.username,
"activity": "Registerred"
});
});
}
});
});
};
| {
"content_hash": "d7c9f8c4c1e1ade5d7f30edcf982c2ec",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 133,
"avg_line_length": 28.958333333333332,
"alnum_prop": 0.5798561151079137,
"repo_name": "s-p-n/SimpServe",
"id": "a80723b18d7d24cdb8acc4dbdef6a36253b8ca2f",
"size": "1390",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "private/channels/register.js",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "2931"
},
{
"name": "HTML",
"bytes": "4640"
},
{
"name": "JavaScript",
"bytes": "18823"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<meta name="author" content="Xiang Zhu" />
<title>Preprocessed Adult Height GWAS Summary Data</title>
<script src="site_libs/header-attrs-2.3/header-attrs.js"></script>
<script src="site_libs/jquery-1.11.3/jquery.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="site_libs/bootstrap-3.3.5/css/flatly.min.css" rel="stylesheet" />
<script src="site_libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<script src="site_libs/jqueryui-1.11.4/jquery-ui.min.js"></script>
<link href="site_libs/tocify-1.9.1/jquery.tocify.css" rel="stylesheet" />
<script src="site_libs/tocify-1.9.1/jquery.tocify.js"></script>
<script src="site_libs/navigation-1.1/tabsets.js"></script>
<script src="site_libs/accessible-code-block-0.0.1/empty-anchor.js"></script>
<link href="site_libs/font-awesome-5.1.0/css/all.css" rel="stylesheet" />
<link href="site_libs/font-awesome-5.1.0/css/v4-shims.css" rel="stylesheet" />
<link rel="icon" href="https://github.com/workflowr/workflowr-assets/raw/master/img/reproducible.png">
<!-- Add a small amount of space between sections. -->
<style type="text/css">
div.section {
padding-top: 12px;
}
</style>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css" data-origin="pandoc">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
color: #aaaaaa;
}
pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { color: #ff0000; font-weight: bold; } /* Alert */
code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
code span.at { color: #7d9029; } /* Attribute */
code span.bn { color: #40a070; } /* BaseN */
code span.bu { } /* BuiltIn */
code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
code span.ch { color: #4070a0; } /* Char */
code span.cn { color: #880000; } /* Constant */
code span.co { color: #60a0b0; font-style: italic; } /* Comment */
code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
code span.do { color: #ba2121; font-style: italic; } /* Documentation */
code span.dt { color: #902000; } /* DataType */
code span.dv { color: #40a070; } /* DecVal */
code span.er { color: #ff0000; font-weight: bold; } /* Error */
code span.ex { } /* Extension */
code span.fl { color: #40a070; } /* Float */
code span.fu { color: #06287e; } /* Function */
code span.im { } /* Import */
code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
code span.kw { color: #007020; font-weight: bold; } /* Keyword */
code span.op { color: #666666; } /* Operator */
code span.ot { color: #007020; } /* Other */
code span.pp { color: #bc7a00; } /* Preprocessor */
code span.sc { color: #4070a0; } /* SpecialChar */
code span.ss { color: #bb6688; } /* SpecialString */
code span.st { color: #4070a0; } /* String */
code span.va { color: #19177c; } /* Variable */
code span.vs { color: #4070a0; } /* VerbatimString */
code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
var sheets = document.styleSheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
try { var rules = sheets[i].cssRules; } catch (e) { continue; }
for (var j = 0; j < rules.length; j++) {
var rule = rules[j];
// check if there is a div.sourceCode rule
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") continue;
var style = rule.style.cssText;
// check if color or background-color is set
if (rule.style.color === '' && rule.style.backgroundColor === '') continue;
// replace div.sourceCode by a pre.sourceCode rule
sheets[i].deleteRule(j);
sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
}
}
})();
</script>
<style type="text/css">
pre:not([class]) {
background-color: white;
}
</style>
<style type="text/css">
h1 {
font-size: 34px;
}
h1.title {
font-size: 38px;
}
h2 {
font-size: 30px;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 18px;
}
h5 {
font-size: 16px;
}
h6 {
font-size: 12px;
}
.table th:not([align]) {
text-align: left;
}
</style>
<style type = "text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
code {
color: inherit;
background-color: rgba(0, 0, 0, 0.04);
}
img {
max-width:100%;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
summary {
display: list-item;
}
</style>
<style type="text/css">
/* padding for bootstrap navbar */
body {
padding-top: 51px;
padding-bottom: 40px;
}
/* offset scroll position for anchor links (for fixed navbar) */
.section h1 {
padding-top: 56px;
margin-top: -56px;
}
.section h2 {
padding-top: 56px;
margin-top: -56px;
}
.section h3 {
padding-top: 56px;
margin-top: -56px;
}
.section h4 {
padding-top: 56px;
margin-top: -56px;
}
.section h5 {
padding-top: 56px;
margin-top: -56px;
}
.section h6 {
padding-top: 56px;
margin-top: -56px;
}
.dropdown-submenu {
position: relative;
}
.dropdown-submenu>.dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
border-radius: 0 6px 6px 6px;
}
.dropdown-submenu:hover>.dropdown-menu {
display: block;
}
.dropdown-submenu>a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #cccccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
border-left-color: #ffffff;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left>.dropdown-menu {
left: -100%;
margin-left: 10px;
border-radius: 6px 0 6px 6px;
}
</style>
<script>
// manage active state of menu based on current page
$(document).ready(function () {
// active menu anchor
href = window.location.pathname
href = href.substr(href.lastIndexOf('/') + 1)
if (href === "")
href = "index.html";
var menuAnchor = $('a[href="' + href + '"]');
// mark it active
menuAnchor.parent().addClass('active');
// if it's got a parent navbar menu mark it active as well
menuAnchor.closest('li.dropdown').addClass('active');
});
</script>
<!-- tabsets -->
<style type="text/css">
.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
background: white;
border: 1px solid #ddd;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs > li.active:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
content: "";
border: none;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs > li.active {
display: block;
}
.tabset-dropdown > .nav-tabs > li > a,
.tabset-dropdown > .nav-tabs > li > a:focus,
.tabset-dropdown > .nav-tabs > li > a:hover {
border: none;
display: inline-block;
border-radius: 4px;
background-color: transparent;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}
.tabset-dropdown > .nav-tabs > li {
display: none;
}
</style>
<!-- code folding -->
<style type="text/css">
#TOC {
margin: 25px 0px 20px 0px;
}
@media (max-width: 768px) {
#TOC {
position: relative;
width: 100%;
}
}
@media print {
.toc-content {
/* see https://github.com/w3c/csswg-drafts/issues/4434 */
float: right;
}
}
.toc-content {
padding-left: 30px;
padding-right: 40px;
}
div.main-container {
max-width: 1200px;
}
div.tocify {
width: 20%;
max-width: 260px;
max-height: 85%;
}
@media (min-width: 768px) and (max-width: 991px) {
div.tocify {
width: 25%;
}
}
@media (max-width: 767px) {
div.tocify {
width: 100%;
max-width: none;
}
}
.tocify ul, .tocify li {
line-height: 20px;
}
.tocify-subheader .tocify-item {
font-size: 0.90em;
}
.tocify .list-group-item {
border-radius: 0px;
}
</style>
</head>
<body>
<div class="container-fluid main-container">
<!-- setup 3col/9col grid for toc_float and main content -->
<div class="row-fluid">
<div class="col-xs-12 col-sm-4 col-md-3">
<div id="TOC" class="tocify">
</div>
</div>
<div class="toc-content col-xs-12 col-sm-8 col-md-9">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">rss</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">Home</a>
</li>
<li>
<a href="setup.html">Setup</a>
</li>
<li>
<a href="function.html">Functions</a>
</li>
<li>
<a href="example.html">Examples</a>
</li>
<li>
<a href="faq.html">FAQ</a>
</li>
<li>
<a href="news.html">News</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/stephenslab/rss">
<span class="fa fa-github"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
<div class="fluid-row" id="header">
<h1 class="title toc-ignore">Preprocessed Adult Height GWAS Summary Data</h1>
<h4 class="author">Xiang Zhu</h4>
</div>
<p>
<button type="button" class="btn btn-default btn-workflowr btn-workflowr-report" data-toggle="collapse" data-target="#workflowr-report">
<span class="glyphicon glyphicon-list" aria-hidden="true"></span> workflowr <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span>
</button>
</p>
<div id="workflowr-report" class="collapse">
<ul class="nav nav-tabs">
<li class="active">
<a data-toggle="tab" href="#summary">Summary</a>
</li>
<li>
<a data-toggle="tab" href="#checks"> Checks <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> </a>
</li>
<li>
<a data-toggle="tab" href="#versions">Past versions</a>
</li>
</ul>
<div class="tab-content">
<div id="summary" class="tab-pane fade in active">
<p>
<strong>Last updated:</strong> 2020-06-24
</p>
<p>
<strong>Checks:</strong> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> 2 <span class="glyphicon glyphicon-exclamation-sign text-danger" aria-hidden="true"></span> 0
</p>
<p>
<strong>Knit directory:</strong> <code>rss/</code> <span class="glyphicon glyphicon-question-sign" aria-hidden="true" title="This is the local directory in which the code in this file was executed."> </span>
</p>
<p>
This reproducible <a href="http://rmarkdown.rstudio.com">R Markdown</a> analysis was created with <a
href="https://github.com/jdblischak/workflowr">workflowr</a> (version 1.6.2). The <em>Checks</em> tab describes the reproducibility checks that were applied when the results were created. The <em>Past versions</em> tab lists the development history.
</p>
<hr>
</div>
<div id="checks" class="tab-pane fade">
<div id="workflowr-checks" class="panel-group">
<div class="panel panel-default">
<div class="panel-heading">
<p class="panel-title">
<a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongRMarkdownfilestronguptodate"> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> <strong>R Markdown file:</strong> up-to-date </a>
</p>
</div>
<div id="strongRMarkdownfilestronguptodate" class="panel-collapse collapse">
<div class="panel-body">
<p>Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.</p>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<p class="panel-title">
<a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongRepositoryversionstrongahrefhttpsgithubcomstephenslabrsstree1e806afd56f7e541f351cd53e2a8cbf4b1af63aatargetblank1e806afa"> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> <strong>Repository version:</strong> <a href="https://github.com/stephenslab/rss/tree/1e806afd56f7e541f351cd53e2a8cbf4b1af63aa" target="_blank">1e806af</a> </a>
</p>
</div>
<div id="strongRepositoryversionstrongahrefhttpsgithubcomstephenslabrsstree1e806afd56f7e541f351cd53e2a8cbf4b1af63aatargetblank1e806afa" class="panel-collapse collapse">
<div class="panel-body">
<p>
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
</p>
<p>
The results in this page were generated with repository version <a href="https://github.com/stephenslab/rss/tree/1e806afd56f7e541f351cd53e2a8cbf4b1af63aa" target="_blank">1e806af</a>. See the <em>Past versions</em> tab to see a history of the changes made to the R Markdown and HTML files.
</p>
<p>
Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use <code>wflow_publish</code> or <code>wflow_git_commit</code>). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
</p>
<pre><code>
Ignored files:
Ignored: .Rproj.user/
Ignored: .spelling
Ignored: examples/example5/.Rhistory
Ignored: examples/example5/Aseg_chr16.mat
Ignored: examples/example5/example5_simulated_data.mat
Ignored: examples/example5/example5_simulated_results.mat
Ignored: examples/example5/ibd2015_path2641_genes_results.mat
Untracked files:
Untracked: docs_old/
Unstaged changes:
Modified: rmd/_site.yml
</code></pre>
<p>
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
</p>
</div>
</div>
</div>
</div>
<hr>
</div>
<div id="versions" class="tab-pane fade">
<p>
These are the previous versions of the repository in which changes were made to the R Markdown (<code>rmd/height2014_data.Rmd</code>) and HTML (<code>docs/height2014_data.html</code>) files. If you’ve configured a remote Git repository (see <code>?wflow_git_remote</code>), click on the hyperlinks in the table below to view the files as they were in that past version.
</p>
<div class="table-responsive">
<table class="table table-condensed table-hover">
<thead>
<tr>
<th>
File
</th>
<th>
Version
</th>
<th>
Author
</th>
<th>
Date
</th>
<th>
Message
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
html
</td>
<td>
<a href="https://rawcdn.githack.com/stephenslab/rss/aa569b213e655a8dfc7f82f9c9c2abc6753d9d30/docs/height2014_data.html" target="_blank">aa569b2</a>
</td>
<td>
Xiang Zhu
</td>
<td>
2020-06-23
</td>
<td>
Build site.
</td>
</tr>
<tr>
<td>
Rmd
</td>
<td>
<a href="https://github.com/stephenslab/rss/blob/c4df22a4d4f3b1b7b0905986bcd72dd83f5c5de3/rmd/height2014_data.Rmd" target="_blank">c4df22a</a>
</td>
<td>
Xiang Zhu
</td>
<td>
2020-06-23
</td>
<td>
wflow_publish(“rmd/height2014_data.Rmd”)
</td>
</tr>
</tbody>
</table>
</div>
<hr>
</div>
</div>
</div>
<p>This page provides information on the preprocessed adult height genome-wide association study (GWAS) summary statistics and estimated linkage disequilibrium (LD) matrices, which were created and analyzed in the following publication.</p>
<blockquote>
<p>Zhu, Xiang; Stephens, Matthew. Bayesian large-scale multiple regression with summary statistics from genome-wide association studies. Ann. Appl. Stat. 11 (2017), no. 3, 1561–1592. <a href="https://projecteuclid.org/euclid.aoas/1507168840">DOI:10.1214/17-AOAS1046</a>.</p>
</blockquote>
<p>This dataset is publicly available at <a href="https://doi.org/10.5281/zenodo.1443565" class="uri">https://doi.org/10.5281/zenodo.1443565</a>, and can be referenced in a journal’s “Data availability” section as <a href="https://doi.org/10.5281/zenodo.1443565"><img src="https://zenodo.org/badge/DOI/10.5281/zenodo.1443565.svg" alt="DOI" /></a></p>
<p>If you find this dataset useful in your research, please kindly cite the publication listed above, <a href="https://projecteuclid.org/euclid.aoas/1507168840">Zhu and Stephens (2017)</a>.</p>
<div id="gwas-summary-statistics" class="section level2">
<h2>GWAS summary statistics</h2>
<p>The folder <code>mat_files</code> contains the GWAS summary statistics for each of the 22 autosomes.</p>
<div class="sourceCode" id="cb1"><pre class="sourceCode matlab"><code class="sourceCode matlab"><span id="cb1-1"><a href="#cb1-1"></a><span class="op">>></span> <span class="va">load</span> <span class="va">mat_files</span><span class="op">/</span><span class="va">height2014</span>.<span class="va">chr22</span>.<span class="va">mat</span><span class="op">;</span></span>
<span id="cb1-2"><a href="#cb1-2"></a><span class="op">>></span> <span class="va">whos</span></span>
<span id="cb1-3"><a href="#cb1-3"></a> <span class="va">Name</span> <span class="va">Size</span> <span class="va">Bytes</span> <span class="va">Class</span> <span class="va">Attributes</span></span>
<span id="cb1-4"><a href="#cb1-4"></a></span>
<span id="cb1-5"><a href="#cb1-5"></a> <span class="va">H</span> <span class="fl">15599</span><span class="va">x758</span> <span class="fl">94592336</span> <span class="va">double</span></span>
<span id="cb1-6"><a href="#cb1-6"></a> <span class="va">Nsnp</span> <span class="fl">15599</span><span class="va">x1</span> <span class="fl">62396</span> <span class="va">int32</span></span>
<span id="cb1-7"><a href="#cb1-7"></a> <span class="va">betahat</span> <span class="fl">15599</span><span class="va">x1</span> <span class="fl">124792</span> <span class="va">double</span></span>
<span id="cb1-8"><a href="#cb1-8"></a> <span class="va">chr</span> <span class="fl">15599</span><span class="va">x1</span> <span class="fl">62396</span> <span class="va">int32</span></span>
<span id="cb1-9"><a href="#cb1-9"></a> <span class="va">cummap</span> <span class="fl">15599</span><span class="va">x1</span> <span class="fl">124792</span> <span class="va">double</span></span>
<span id="cb1-10"><a href="#cb1-10"></a> <span class="va">pos18</span> <span class="fl">15599</span><span class="va">x1</span> <span class="fl">62396</span> <span class="va">int32</span></span>
<span id="cb1-11"><a href="#cb1-11"></a> <span class="va">pos19</span> <span class="fl">15599</span><span class="va">x1</span> <span class="fl">62396</span> <span class="va">int32</span></span>
<span id="cb1-12"><a href="#cb1-12"></a> <span class="va">se</span> <span class="fl">15599</span><span class="va">x1</span> <span class="fl">124792</span> <span class="va">double</span></span></code></pre></div>
<p>Most variables above are self-explanatory. The single-SNP GWAS summary statistics <code>{betahat, se}</code> are published in <a href="https://www.ncbi.nlm.nih.gov/pubmed/25282103">Wood et al. (2014)</a>. The matrix <code>H</code> contains the phased haplotypes of 379 European ancestry individuals in the <a href="https://www.ncbi.nlm.nih.gov/pubmed/20981092">1000 Genomes Project Phase 1</a>. The vector <code>cummap</code> contains the genetic map of <a href="https://www.ncbi.nlm.nih.gov/pubmed/17943122">HapMap Release 24</a> European-ancestry population. Note that <code>{betahat, se, H}</code> must use the SAME way of coding alleles; otherwise RSS results will be severely distorted.</p>
</div>
<div id="estimated-ld-matrices" class="section level2">
<h2>Estimated LD matrices</h2>
<p>The folder <code>estimated_ld_sparse</code> contains the estimated LD matrices for each of the 22 autosomes. The estimation method is detailed in <a href="https://projecteuclid.org/euclid.aoas/1287409368">Wen and Stephens (2010)</a>, and is implemented by <a href="https://github.com/stephenslab/rss/blob/master/misc/get_corr.m"><code>get_corr.m</code></a>.</p>
<p>Files <code>R.chr*.mat</code> were generated by setting <code>cutoff=1e-8</code> in <a href="https://github.com/stephenslab/rss/blob/master/misc/get_corr.m"><code>get_corr.m</code></a>. Files <code>R.chr*.3.mat</code> were generated by setting <code>cutoff=1e-3</code>. These LD matrices are stored as sparse matrices to save space.</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode matlab"><code class="sourceCode matlab"><span id="cb2-1"><a href="#cb2-1"></a><span class="op">>></span> <span class="va">load</span> <span class="va">estimated_ld_sparse</span><span class="op">/</span><span class="va">R</span>.<span class="va">chr22</span>.<span class="va">mat</span><span class="op">;</span></span>
<span id="cb2-2"><a href="#cb2-2"></a><span class="op">>></span> <span class="va">whos</span> <span class="va">R</span></span>
<span id="cb2-3"><a href="#cb2-3"></a> <span class="va">Name</span> <span class="va">Size</span> <span class="va">Bytes</span> <span class="va">Class</span> <span class="va">Attributes</span></span>
<span id="cb2-4"><a href="#cb2-4"></a></span>
<span id="cb2-5"><a href="#cb2-5"></a> <span class="va">R</span> <span class="fl">15599</span><span class="va">x15599</span> <span class="fl">592534032</span> <span class="va">double</span> <span class="va">sparse</span></span></code></pre></div>
<p>Of note, if you run RSS MCMC programs (<a href="https://github.com/stephenslab/rss/tree/master/src"><code>rss/src</code></a>) with these LD data, please first convert them to full matrices: <code>R=full(R)</code>. I recommend using full LD matrices in MCMC because each iteration of MCMC involves multiple matrix indexing operations (i.e. sampling SNPs to include in or exclude from the current regression model), and based on my experiments, full matrix indexing is much faster than sparse matrix indexing (at least in MATLAB).</p>
<p>However, if you run RSS VB programs (<a href="https://github.com/stephenslab/rss/tree/master/src_vb"><code>rss/src_vb</code></a>) with these LD data, please do NOT convert them to full matrices. Indeed, RSS VB programs require that input LD matrices must be sparse.</p>
</div>
<!-- Adjust MathJax settings so that all math formulae are shown using
TeX fonts only; see
http://docs.mathjax.org/en/latest/configuration.html. This will make
the presentation more consistent at the cost of the webpage sometimes
taking slightly longer to load. Note that this only works because the
footer is added to webpages before the MathJax javascript. -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
"HTML-CSS": { availableFonts: ["TeX"] }
});
</script>
</div>
</div>
</div>
<script>
// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
bootstrapStylePandocTables();
});
</script>
<!-- tabsets -->
<script>
$(document).ready(function () {
window.buildTabsets("TOC");
});
$(document).ready(function () {
$('.tabset-dropdown > .nav-tabs > li').click(function () {
$(this).parent().toggleClass('nav-tabs-open')
});
});
</script>
<!-- code folding -->
<script>
$(document).ready(function () {
// move toc-ignore selectors from section div to header
$('div.section.toc-ignore')
.removeClass('toc-ignore')
.children('h1,h2,h3,h4,h5').addClass('toc-ignore');
// establish options
var options = {
selectors: "h1,h2,h3",
theme: "bootstrap3",
context: '.toc-content',
hashGenerator: function (text) {
return text.replace(/[.\\/?&!#<>]/g, '').replace(/\s/g, '_');
},
ignoreSelector: ".toc-ignore",
scrollTo: 0
};
options.showAndHide = true;
options.smoothScroll = true;
// tocify
var toc = $("#TOC").tocify(options).data("toc-tocify");
});
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>
| {
"content_hash": "d21ad674db3683907c745489cb89e6c1",
"timestamp": "",
"source": "github",
"line_count": 764,
"max_line_length": 698,
"avg_line_length": 34.65837696335078,
"alnum_prop": 0.6701159409343254,
"repo_name": "stephenslab/rss",
"id": "dd4a8febfeaf5e6419f5e24d8e24fe3569937fda",
"size": "26500",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/height2014_data.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "14053"
},
{
"name": "MATLAB",
"bytes": "240055"
},
{
"name": "R",
"bytes": "130775"
},
{
"name": "Shell",
"bytes": "1878"
}
],
"symlink_target": ""
} |
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
return array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\SerializerBundle\JMSSerializerBundle($this),
new AC\KalinkaBundle\ACKalinkaBundle(),
new AC\KalinkaBundle\Tests\Fixtures\FixtureBundle\FixtureBundle()
);
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config.yml');
}
/**
* @return string
*/
public function getCacheDir()
{
return sys_get_temp_dir().'/ACKalinkaBundleTests/cache';
}
/**
* @return string
*/
public function getLogDir()
{
return sys_get_temp_dir().'/ACKalinkaBundleTests/logs';
}
}
| {
"content_hash": "2f72835b0c47fbeffa5cbd09a101197e",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 80,
"avg_line_length": 26.45,
"alnum_prop": 0.6455576559546313,
"repo_name": "AmericanCouncils/kalinka-bundle",
"id": "05fe70cae59dd9acb047d7aa4dbc6763fdbf39c5",
"size": "1058",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Tests/Fixtures/app/AppKernel.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "41082"
}
],
"symlink_target": ""
} |
package org.drools.core.reteoo;
import org.drools.core.common.InternalFactHandle;
import org.drools.core.common.InternalWorkingMemory;
import org.drools.core.spi.PropagationContext;
import org.drools.core.util.index.TupleList;
import java.util.Arrays;
/**
* A parent class for all specific LeftTuple specializations
*
*/
public class BaseLeftTuple extends BaseTuple implements LeftTuple {
private static final long serialVersionUID = 540l;
private int index;
private LeftTuple parent;
// left and right tuples in parent
private LeftTuple leftParent;
private RightTuple rightParent;
private LeftTuple rightParentPrevious;
private LeftTuple rightParentNext;
// children
private LeftTuple firstChild;
private LeftTuple lastChild;
// node memory
protected TupleList memory;
private LeftTuple peer;
private short stagedTypeForQueries;
public BaseLeftTuple() {
// constructor needed for serialisation
}
// ------------------------------------------------------------
// Constructors
// ------------------------------------------------------------
public BaseLeftTuple(InternalFactHandle factHandle,
Sink sink,
boolean leftTupleMemoryEnabled) {
setFactHandle( factHandle );
this.sink = sink;
if ( leftTupleMemoryEnabled ) {
factHandle.addTupleInPosition( this );
}
}
public BaseLeftTuple(InternalFactHandle factHandle,
LeftTuple leftTuple,
Sink sink) {
setFactHandle( factHandle );
this.index = leftTuple.getIndex() + 1;
this.parent = leftTuple;
this.sink = sink;
}
public BaseLeftTuple(LeftTuple leftTuple,
Sink sink,
PropagationContext pctx,
boolean leftTupleMemoryEnabled) {
this.index = leftTuple.getIndex();
this.parent = leftTuple;
setPropagationContext( pctx );
if ( leftTupleMemoryEnabled ) {
this.leftParent = leftTuple;
if ( leftTuple.getLastChild() != null ) {
this.handlePrevious = leftTuple.getLastChild();
this.handlePrevious.setHandleNext( this );
} else {
leftTuple.setFirstChild( this );
}
leftTuple.setLastChild( this );
}
this.sink = sink;
}
public BaseLeftTuple(LeftTuple leftTuple,
RightTuple rightTuple,
Sink sink) {
this.index = leftTuple.getIndex() + 1;
this.parent = leftTuple;
setFactHandle( rightTuple.getFactHandle() );
setPropagationContext( rightTuple.getPropagationContext() );
this.leftParent = leftTuple;
// insert at the end f the list
if ( leftTuple.getLastChild() != null ) {
this.handlePrevious = leftTuple.getLastChild();
this.handlePrevious.setHandleNext( this );
} else {
leftTuple.setFirstChild( this );
}
leftTuple.setLastChild( this );
// insert at the end of the list
this.rightParent = rightTuple;
if ( rightTuple.getLastChild() != null ) {
this.rightParentPrevious = rightTuple.getLastChild();
this.rightParentPrevious.setRightParentNext( this );
} else {
rightTuple.setFirstChild( this );
}
rightTuple.setLastChild( this );
this.sink = sink;
}
public BaseLeftTuple(LeftTuple leftTuple,
RightTuple rightTuple,
Sink sink,
boolean leftTupleMemoryEnabled) {
this( leftTuple,
rightTuple,
null,
null,
sink,
leftTupleMemoryEnabled );
}
public BaseLeftTuple(LeftTuple leftTuple,
RightTuple rightTuple,
LeftTuple currentLeftChild,
LeftTuple currentRightChild,
Sink sink,
boolean leftTupleMemoryEnabled) {
setFactHandle( rightTuple.getFactHandle() );
this.index = leftTuple.getIndex() + 1;
this.parent = leftTuple;
setPropagationContext( rightTuple.getPropagationContext() );
if ( leftTupleMemoryEnabled ) {
this.leftParent = leftTuple;
this.rightParent = rightTuple;
if( currentLeftChild == null ) {
// insert at the end of the list
if ( leftTuple.getLastChild() != null ) {
this.handlePrevious = leftTuple.getLastChild();
this.handlePrevious.setHandleNext( this );
} else {
leftTuple.setFirstChild( this );
}
leftTuple.setLastChild( this );
} else {
// insert before current child
this.handleNext = currentLeftChild;
this.handlePrevious = currentLeftChild.getHandlePrevious();
currentLeftChild.setHandlePrevious( this );
if( this.handlePrevious == null ) {
this.leftParent.setFirstChild( this );
} else {
this.handlePrevious.setHandleNext( this );
}
}
if( currentRightChild == null ) {
// insert at the end of the list
if ( rightTuple.getLastChild() != null ) {
this.rightParentPrevious = rightTuple.getLastChild();
this.rightParentPrevious.setRightParentNext( this );
} else {
rightTuple.setFirstChild( this );
}
rightTuple.setLastChild( this );
} else {
// insert before current child
this.rightParentNext = currentRightChild;
this.rightParentPrevious = currentRightChild.getRightParentPrevious();
currentRightChild.setRightParentPrevious( this );
if( this.rightParentPrevious == null ) {
this.rightParent.setFirstChild( this );
} else {
this.rightParentPrevious.setRightParentNext( this );
}
}
}
this.sink = sink;
}
@Override
public void reAdd() {
getFactHandle().addLastLeftTuple( this );
}
@Override
public void reAddLeft() {
// The parent can never be the FactHandle (root LeftTuple) as that is handled by reAdd()
// make sure we aren't already at the end
if ( this.handleNext != null ) {
if ( this.handlePrevious != null ) {
// remove the current LeftTuple from the middle of the chain
this.handlePrevious.setHandleNext( this.handleNext );
this.handleNext.setHandlePrevious( this.handlePrevious );
} else {
if( this.leftParent.getFirstChild() == this ) {
// remove the current LeftTuple from start start of the chain
this.leftParent.setFirstChild( getHandleNext() );
}
this.handleNext.setHandlePrevious( null );
}
// re-add to end
this.handlePrevious = this.leftParent.getLastChild();
this.handlePrevious.setHandleNext( this );
this.leftParent.setLastChild( this );
this.handleNext = null;
}
}
@Override
public void reAddRight() {
// make sure we aren't already at the end
if ( this.rightParentNext != null ) {
if ( this.rightParentPrevious != null ) {
// remove the current LeftTuple from the middle of the chain
this.rightParentPrevious.setRightParentNext( this.rightParentNext );
this.rightParentNext.setRightParentPrevious( this.rightParentPrevious );
} else {
if( this.rightParent.getFirstChild() == this ) {
// remove the current LeftTuple from the start of the chain
this.rightParent.setFirstChild( this.rightParentNext );
}
this.rightParentNext.setRightParentPrevious( null );
}
// re-add to end
this.rightParentPrevious = this.rightParent.getLastChild();
this.rightParentPrevious.setRightParentNext( this );
this.rightParent.setLastChild( this );
this.rightParentNext = null;
}
}
@Override
public void unlinkFromLeftParent() {
LeftTuple previousParent = getHandlePrevious();
LeftTuple nextParent = getHandleNext();
if ( previousParent != null && nextParent != null ) {
//remove from middle
this.handlePrevious.setHandleNext( nextParent );
this.handleNext.setHandlePrevious( previousParent );
} else if ( nextParent != null ) {
//remove from first
if ( this.leftParent != null ) {
this.leftParent.setFirstChild( nextParent );
} else {
// This is relevant to the root node and only happens at rule removal time
getFactHandle().removeLeftTuple( this );
}
nextParent.setHandlePrevious( null );
} else if ( previousParent != null ) {
//remove from end
if ( this.leftParent != null ) {
this.leftParent.setLastChild( previousParent );
} else {
// relevant to the root node, as here the parent is the FactHandle, only happens at rule removal time
getFactHandle().removeLeftTuple( this );
}
previousParent.setHandleNext( null );
} else {
// single remaining item, no previous or next
if( leftParent != null ) {
this.leftParent.setFirstChild( null );
this.leftParent.setLastChild( null );
} else {
// it is a root tuple - only happens during rule removal
getFactHandle().removeLeftTuple( this );
}
}
this.leftParent = null;
this.handlePrevious = null;
this.handleNext = null;
}
@Override
public void unlinkFromRightParent() {
if ( this.rightParent == null ) {
// no right parent;
return;
}
LeftTuple previousParent = this.rightParentPrevious;
LeftTuple nextParent = this.rightParentNext;
if ( previousParent != null && nextParent != null ) {
// remove from middle
this.rightParentPrevious.setRightParentNext( this.rightParentNext );
this.rightParentNext.setRightParentPrevious( this.rightParentPrevious );
} else if ( nextParent != null ) {
// remove from the start
this.rightParent.setFirstChild( nextParent );
nextParent.setRightParentPrevious( null );
} else if ( previousParent != null ) {
// remove from end
this.rightParent.setLastChild( previousParent );
previousParent.setRightParentNext( null );
} else {
// single remaining item, no previous or next
this.rightParent.setFirstChild( null );
this.rightParent.setLastChild( null );
}
this.rightParent = null;
this.rightParentPrevious = null;
this.rightParentNext = null;
}
@Override
public int getIndex() {
return this.index;
}
@Override
public LeftTupleSink getTupleSink() {
return (LeftTupleSink)sink;
}
/* Had to add the set method because sink adapters must override
* the tuple sink set when the tuple was created.
*/
@Override
public void setLeftTupleSink( LeftTupleSink sink ) {
this.sink = sink;
}
@Override
public LeftTuple getLeftParent() {
return leftParent;
}
@Override
public void setLeftParent(LeftTuple leftParent) {
this.leftParent = leftParent;
}
@Override
public LeftTuple getHandlePrevious() {
return (LeftTuple) handlePrevious;
}
@Override
public LeftTuple getHandleNext() {
return (LeftTuple) handleNext;
}
@Override
public RightTuple getRightParent() {
return rightParent;
}
@Override
public void setRightParent(RightTuple rightParent) {
this.rightParent = rightParent;
}
@Override
public LeftTuple getRightParentPrevious() {
return rightParentPrevious;
}
@Override
public void setRightParentPrevious(LeftTuple rightParentLeft) {
this.rightParentPrevious = rightParentLeft;
}
@Override
public LeftTuple getRightParentNext() {
return rightParentNext;
}
@Override
public void setRightParentNext(LeftTuple rightParentRight) {
this.rightParentNext = rightParentRight;
}
@Override
public InternalFactHandle get(int index) {
LeftTuple entry = this;
while ( entry != null && ( entry.getIndex() != index || entry.getFactHandle() == null ) ) {
entry = entry.getParent();
}
return entry == null ? null : entry.getFactHandle();
}
public InternalFactHandle[] toFactHandles() {
InternalFactHandle[] handles = new InternalFactHandle[this.index + 1];
LeftTuple entry = this;
while ( entry != null ) {
if ( entry.getFactHandle() != null ) {
// eval, not, exists have no right input
handles[entry.getIndex()] = entry.getFactHandle();
}
entry = entry.getParent();
}
return handles;
}
public Object[] toObjects() {
Object[] objs = new Object[this.index + 1];
LeftTuple entry = this;
while ( entry != null ) {
if ( entry.getFactHandle() != null ) {
// eval, not, exists have no right input
objs[entry.getIndex()] = entry.getFactHandle().getObject();
}
entry = entry.getParent();
}
return objs;
}
public void clearBlocker() {
throw new UnsupportedOperationException();
}
@Override
public void setBlocker(RightTuple blocker) {
throw new UnsupportedOperationException();
}
@Override
public RightTuple getBlocker() {
throw new UnsupportedOperationException();
}
@Override
public LeftTuple getBlockedPrevious() {
throw new UnsupportedOperationException();
}
@Override
public void setBlockedPrevious(LeftTuple blockerPrevious) {
throw new UnsupportedOperationException();
}
@Override
public LeftTuple getBlockedNext() {
throw new UnsupportedOperationException();
}
@Override
public void setBlockedNext(LeftTuple blockerNext) {
throw new UnsupportedOperationException();
}
@Override
public String toString() {
final StringBuilder buffer = new StringBuilder();
LeftTuple entry = this;
while ( entry != null ) {
//buffer.append( entry.handle );
buffer.append(entry.getFactHandle());
if ( entry.getParent() != null ) {
buffer.append("\n");
}
entry = entry.getParent();
}
return buffer.toString();
}
@Override
public int hashCode() {
return getFactHandle() == null ? 0 : getFactHandle().hashCode();
}
@Override
public boolean equals(Object object) {
if (object == this) {
return true;
}
if (!(object instanceof LeftTuple)) {
return false;
}
LeftTuple other = ( (LeftTuple) object );
// A LeftTuple is only the same if it has the same hashCode, factId and parent
if ( this.hashCode() != other.hashCode() || getFactHandle() != other.getFactHandle() ) {
return false;
}
if ( this.parent == null ) {
return (other.getParent() == null);
} else {
return this.parent.equals( other.getParent() );
}
}
@Override
public int size() {
return this.index + 1;
}
@Override
public LeftTuple getFirstChild() {
return firstChild;
}
@Override
public void setFirstChild(LeftTuple firstChild) {
this.firstChild = firstChild;
}
@Override
public LeftTuple getLastChild() {
return lastChild;
}
@Override
public void setLastChild(LeftTuple lastChild) {
this.lastChild = lastChild;
}
@Override
public TupleList getMemory() {
return this.memory;
}
@Override
public void setMemory(TupleList memory) {
this.memory = memory;
}
@Override
public LeftTuple getStagedNext() {
return (LeftTuple) stagedNext;
}
@Override
public LeftTuple getStagedPrevious() {
return (LeftTuple) stagedPrevious;
}
@Override
public void clearStaged() {
super.clearStaged();
if (getContextObject() == Boolean.TRUE) {
setContextObject( null );
}
}
@Override
public LeftTuple getPeer() {
return peer;
}
@Override
public void setPeer(LeftTuple peer) {
this.peer = peer;
}
@Override
public LeftTuple getSubTuple(final int elements) {
LeftTuple entry = this;
if ( elements <= this.size() ) {
final int lastindex = elements - 1;
while ( entry.getIndex() != lastindex || entry.getFactHandle() == null ) {
entry = entry.getParent();
}
}
return entry;
}
@Override
public LeftTuple getParent() {
return parent;
}
protected String toExternalString() {
StringBuilder builder = new StringBuilder();
builder.append( String.format( "%08X", System.identityHashCode( this ) ) ).append( ":" );
int[] ids = new int[this.index+1];
LeftTuple entry = this;
while( entry != null ) {
ids[entry.getIndex()] = entry.getFactHandle().getId();
entry = entry.getParent();
}
builder.append( Arrays.toString( ids ) )
.append( " sink=" )
.append( this.sink.getClass().getSimpleName() )
.append( "(" ).append( sink.getId() ).append( ")" );
return builder.toString();
}
@Override
public void clear() {
super.clear();
this.memory = null;
}
public void initPeer(BaseLeftTuple original, LeftTupleSink sink) {
this.index = original.index;
this.parent = original.parent;
setFactHandle( original.getFactHandle() );
setPropagationContext( original.getPropagationContext() );
this.sink = sink;
}
@Override
public Object getObject(int index) {
return get(index).getObject();
}
@Override
public ObjectTypeNode.Id getInputOtnId() {
return sink != null ? getTupleSink().getLeftInputOtnId() : null;
}
@Override
public LeftTupleSource getTupleSource() {
return sink != null ? getTupleSink().getLeftTupleSource() : null;
}
@Override
public void retractTuple( PropagationContext context, InternalWorkingMemory workingMemory ) {
getTupleSink().retractLeftTuple( this, context, workingMemory );
}
public short getStagedTypeForQueries() {
return stagedTypeForQueries;
}
public void setStagedTypeForQueries( short stagedTypeForQueries ) {
this.stagedTypeForQueries = stagedTypeForQueries;
}
public boolean isStagedOnRight() {
return false;
}
}
| {
"content_hash": "5559e831eb1b154eed1c844e35587cc2",
"timestamp": "",
"source": "github",
"line_count": 644,
"max_line_length": 117,
"avg_line_length": 31.496894409937887,
"alnum_prop": 0.5640406231512523,
"repo_name": "sutaakar/drools",
"id": "f603e41c88d4308754db11f3de638d1be6f3716f",
"size": "20904",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "drools-core/src/main/java/org/drools/core/reteoo/BaseLeftTuple.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "14216"
},
{
"name": "Batchfile",
"bytes": "2554"
},
{
"name": "CSS",
"bytes": "1412"
},
{
"name": "GAP",
"bytes": "197080"
},
{
"name": "HTML",
"bytes": "9298"
},
{
"name": "Java",
"bytes": "28490800"
},
{
"name": "Protocol Buffer",
"bytes": "13855"
},
{
"name": "Python",
"bytes": "4555"
},
{
"name": "Ruby",
"bytes": "491"
},
{
"name": "Shell",
"bytes": "1120"
},
{
"name": "Standard ML",
"bytes": "82260"
},
{
"name": "XSLT",
"bytes": "24302"
}
],
"symlink_target": ""
} |
from django.db import models
from django.utils import timezone
import datetime
# Create your models here.
class Question(models.Model):
question_text = models.CharField(max_length = 200)
pub_date = models.DateTimeField('date published')
def __str__(self):
return self.question_text
def was_published_recently(self):
return (timezone.now() -datetime.timedelta(days = 1)) <= self.pub_date <= timezone.now()
was_published_recently.admin_order_field = 'pub_date'
was_published_recently.boolean = True
was_published_recently.short_description = 'Published recently?'
question_text.short_description = 'Question'
pub_date.short_description = 'Published Date'
class Choice(models.Model):
question = models.ForeignKey(Question)
choice_text = models.CharField(max_length = 200)
votes = models.IntegerField(default = 0)
def __str__(self):
return self.choice_text | {
"content_hash": "ab798c3ee5f43a4d6e6a194f2760d493",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 97,
"avg_line_length": 32.275862068965516,
"alnum_prop": 0.7040598290598291,
"repo_name": "LoopSun/PythonWay",
"id": "10246668659f7ad3333713c3422d9b8968b79f7e",
"size": "936",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "GetYourStar/DjangoProj/packets/polls/models.py",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "222"
},
{
"name": "HTML",
"bytes": "3355"
},
{
"name": "Python",
"bytes": "59983"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.asciipic</groupId>
<artifactId>asciipic</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>asciipic</name>
<description>AsciiPic Core Module</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.3.RELEASE</version>
<relativePath/>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.6.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.java.dev.javacc</groupId>
<artifactId>javacc</artifactId>
<version>7.0.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project> | {
"content_hash": "dd6d55ac63214e7636addd52946725b2",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 108,
"avg_line_length": 33.486486486486484,
"alnum_prop": 0.5968523002421308,
"repo_name": "AlexandruTudose/asciipic",
"id": "856d2270f6f4bd5b60acdadbc6c0347ff2c50175",
"size": "2478",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "asciipic/pom.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1305"
},
{
"name": "HTML",
"bytes": "8353"
},
{
"name": "Java",
"bytes": "236944"
},
{
"name": "JavaScript",
"bytes": "11867"
}
],
"symlink_target": ""
} |
package org.apache.logging.log4j.spi;
import java.lang.ref.WeakReference;
import java.net.URL;
import java.util.Properties;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.status.StatusLogger;
/**
* Model class for a Log4j 2 provider. The properties in this class correspond to the properties used in a
* {@code META-INF/log4j-provider.properties} file. Note that this class is automatically created by Log4j and should
* not be used by providers.
*/
public class Provider {
/**
* Property name to set for a Log4j 2 provider to specify the priority of this implementation.
*/
public static final String FACTORY_PRIORITY = "FactoryPriority";
/**
* Property name to set to the implementation of {@link org.apache.logging.log4j.spi.ThreadContextMap}.
*/
public static final String THREAD_CONTEXT_MAP = "ThreadContextMap";
/**
* Property name to set to the implementation of {@link org.apache.logging.log4j.spi.LoggerContextFactory}.
*/
public static final String LOGGER_CONTEXT_FACTORY = "LoggerContextFactory";
private static final Integer DEFAULT_PRIORITY = Integer.valueOf(-1);
private static final Logger LOGGER = StatusLogger.getLogger();
private final Integer priority;
private final String className;
private final String threadContextMap;
private final URL url;
private final WeakReference<ClassLoader> classLoader;
public Provider(final Properties props, final URL url, final ClassLoader classLoader) {
this.url = url;
this.classLoader = new WeakReference<>(classLoader);
final String weight = props.getProperty(FACTORY_PRIORITY);
priority = weight == null ? DEFAULT_PRIORITY : Integer.valueOf(weight);
className = props.getProperty(LOGGER_CONTEXT_FACTORY);
threadContextMap = props.getProperty(THREAD_CONTEXT_MAP);
}
/**
* Gets the priority (natural ordering) of this Provider.
*
* @return the priority of this Provider
*/
public Integer getPriority() {
return priority;
}
/**
* Gets the class name of the {@link org.apache.logging.log4j.spi.LoggerContextFactory} implementation of this
* Provider.
*
* @return the class name of a LoggerContextFactory implementation
*/
public String getClassName() {
return className;
}
/**
* Loads the {@link org.apache.logging.log4j.spi.LoggerContextFactory} class specified by this Provider.
*
* @return the LoggerContextFactory implementation class or {@code null} if there was an error loading it
*/
public Class<? extends LoggerContextFactory> loadLoggerContextFactory() {
if (className == null) {
return null;
}
ClassLoader loader = classLoader.get();
if (loader == null) {
return null;
}
try {
final Class<?> clazz = loader.loadClass(className);
if (LoggerContextFactory.class.isAssignableFrom(clazz)) {
return clazz.asSubclass(LoggerContextFactory.class);
}
} catch (final Exception e) {
LOGGER.error("Unable to create class {} specified in {}", className, url.toString(), e);
}
return null;
}
/**
* Gets the class name of the {@link org.apache.logging.log4j.spi.ThreadContextMap} implementation of this Provider.
*
* @return the class name of a ThreadContextMap implementation
*/
public String getThreadContextMap() {
return threadContextMap;
}
/**
* Loads the {@link org.apache.logging.log4j.spi.ThreadContextMap} class specified by this Provider.
*
* @return the ThreadContextMap implementation class or {@code null} if there was an error loading it
*/
public Class<? extends ThreadContextMap> loadThreadContextMap() {
if (threadContextMap == null) {
return null;
}
ClassLoader loader = classLoader.get();
if (loader == null) {
return null;
}
try {
final Class<?> clazz = loader.loadClass(threadContextMap);
if (ThreadContextMap.class.isAssignableFrom(clazz)) {
return clazz.asSubclass(ThreadContextMap.class);
}
} catch (final Exception e) {
LOGGER.error("Unable to create class {} specified in {}", threadContextMap, url.toString(), e);
}
return null;
}
/**
* Gets the URL containing this Provider's Log4j details.
*
* @return the URL corresponding to the Provider {@code META-INF/log4j-provider.properties} file
*/
public URL getUrl() {
return url;
}
@Override
public String toString() {
String result = "Provider[";
if (priority != DEFAULT_PRIORITY) {
result += "priority=" + priority + ", ";
}
if (threadContextMap != null) {
result += "threadContextMap=" + threadContextMap + ", ";
}
if (className != null) {
result += "className=" + className + ", ";
}
result += "url=" + url;
final ClassLoader loader = classLoader.get();
if (loader == null) {
result += ", classLoader=null(not reachable)";
} else {
result += ", classLoader=" + loader;
}
result += "]";
return result;
}
}
| {
"content_hash": "ad328ece57921674f1a4c329f86af3ff",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 120,
"avg_line_length": 35.16774193548387,
"alnum_prop": 0.6297926985874152,
"repo_name": "lburgazzoli/apache-logging-log4j2",
"id": "837f5011176a0c080c29086e086431d56eabb98e",
"size": "6251",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "log4j-api/src/main/java/org/apache/logging/log4j/spi/Provider.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1024"
},
{
"name": "CSS",
"bytes": "3981"
},
{
"name": "Groovy",
"bytes": "198"
},
{
"name": "Java",
"bytes": "6349226"
},
{
"name": "JavaScript",
"bytes": "59116"
},
{
"name": "Shell",
"bytes": "861"
}
],
"symlink_target": ""
} |
taurus
======
TAURUS is a WordPress Framework. Includes utility functions such as UI controls, metabox, post type. You can create a wordpress theme so easy.
| {
"content_hash": "9a5ee4cde7d8812e4d46eb65d9b0bddc",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 142,
"avg_line_length": 39.5,
"alnum_prop": 0.7658227848101266,
"repo_name": "TaurusFramework/taurus",
"id": "7e4578ebcde7958ebc7ab3de724b52045c0dbd18",
"size": "158",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<groupId>com.google.apis</groupId>
<artifactId>google-api-services-blogger</artifactId>
<version>v3-rev20190917-1.29.2</version>
<name>Blogger API v3-rev20190917-1.29.2</name>
<packaging>jar</packaging>
<inceptionYear>2011</inceptionYear>
<organization>
<name>Google</name>
<url>http://www.google.com/</url>
</organization>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.9.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>com.google.api.services.blogger</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<doclint>none</doclint>
<doctitle>Blogger API ${project.version}</doctitle>
<windowtitle>Blogger API ${project.version}</windowtitle>
<links>
<link>http://docs.oracle.com/javase/7/docs/api</link>
<link>https://googleapis.dev/java/google-http-client/1.29.2/</link>
<link>https://googleapis.dev/java/google-oauth-client/1.29.2/</link>
<link>https://googleapis.dev/java/google-api-client/1.29.2/</link>
</links>
</configuration>
</plugin>
</plugins>
<sourceDirectory>.</sourceDirectory>
<resources>
<resource>
<directory>./resources</directory>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.33.1</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project> | {
"content_hash": "6d5ca7a67b46cf0c879846a5be70454b",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 201,
"avg_line_length": 30.84516129032258,
"alnum_prop": 0.5772850868019243,
"repo_name": "googleapis/google-api-java-client-services",
"id": "e57aa3df65930282d22ef6a0305b50892370148b",
"size": "4781",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "clients/google-api-services-blogger/v3/1.29.2/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
namespace Nimbles\App\Config\Exception;
use Nimbles\App\Config\Exception;
/**
* @category Nimbles
* @package Nimbles-App
* @subpackage Config
* @copyright Copyright (c) 2010 Nimbles Framework (http://nimbl.es)
* @license http://nimbl.es/license/mit MIT License
* @version $Id$
*
* @uses \Nimbles\App\Exception
*/
class InvalidValue extends Exception {}
| {
"content_hash": "f7ca7c94f7adc2dc4b764a162b72c2d7",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 69,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.6820512820512821,
"repo_name": "nimbles/Framework",
"id": "66db19a2b7657eb4f7df72589438c58b563a4a65",
"size": "813",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Lib/Nimbles/App/Config/Exception/InvalidValue.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "244"
},
{
"name": "PHP",
"bytes": "554781"
}
],
"symlink_target": ""
} |
https://using-redux.gatsbyjs.org/
Gatsby example site that shows use of redux.
| {
"content_hash": "6f1683d2e23741a86e54db841add32fe",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 44,
"avg_line_length": 26.666666666666668,
"alnum_prop": 0.775,
"repo_name": "mickeyreiss/gatsby",
"id": "1ced99cc7e9f6008d7fe47d481c3c67baa59680b",
"size": "89",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/using-redux/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "53694"
},
{
"name": "HTML",
"bytes": "118528"
},
{
"name": "JavaScript",
"bytes": "846072"
},
{
"name": "Shell",
"bytes": "1317"
}
],
"symlink_target": ""
} |
import os
import subprocess
import benchmark.util as Util
import benchmark.tools.template
import benchmark.result as result
class Tool(benchmark.tools.template.BaseTool):
"""
This class serves as tool adaptor for LLBMC
"""
def getExecutable(self):
return Util.findExecutable('lib/native/x86_64-linux/llbmc')
def getVersion(self, executable):
return subprocess.Popen([executable, '--version'],
stdout=subprocess.PIPE).communicate()[0].splitlines()[2][8:18]
def getName(self):
return 'LLBMC'
def getCmdline(self, executable, options, sourcefile):
# compile sourcefile with clang
self.prepSourcefile = self._prepareSourcefile(sourcefile)
return [executable] + options + [self.prepSourcefile]
def _prepareSourcefile(self, sourcefile):
clangExecutable = Util.findExecutable('clang')
newFilename = sourcefile + ".o"
subprocess.Popen([clangExecutable,
'-c',
'-emit-llvm',
'-std=gnu89',
'-m32',
sourcefile,
'-O0',
'-o',
newFilename,
'-w'],
stdout=subprocess.PIPE).wait()
return newFilename
def getStatus(self, returncode, returnsignal, output, isTimeout):
status = result.STR_UNKNOWN
for line in output.splitlines():
if 'Error detected.' in line:
status = result.STR_FALSE_LABEL
elif 'No error detected.' in line:
status = result.STR_TRUE
# delete tmp-files
try:
os.remove(self.prepSourcefile)
except OSError, e:
print "Could not remove file " + self.prepSourcefile + "! Maybe clang call failed"
pass
return status
def addColumnValues(self, output, columns):
"""
This method adds the values that the user requested to the column objects.
If a value is not found, it should be set to '-'.
If not supported, this method does not need to get overridden.
"""
pass
| {
"content_hash": "7852e7ff4deaf9a86bf973716fcdd55b",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 94,
"avg_line_length": 29.77922077922078,
"alnum_prop": 0.5503706934147405,
"repo_name": "TommesDee/cpachecker",
"id": "63ccf6c007eaf7c4eea84a4f0ee66f7845d2ba79",
"size": "2293",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "scripts/benchmark/tools/llbmc.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "26296962"
},
{
"name": "C++",
"bytes": "1832"
},
{
"name": "CSS",
"bytes": "25"
},
{
"name": "Java",
"bytes": "8113113"
},
{
"name": "PHP",
"bytes": "36129"
},
{
"name": "Perl",
"bytes": "6690"
},
{
"name": "Python",
"bytes": "275076"
},
{
"name": "Shell",
"bytes": "16666"
}
],
"symlink_target": ""
} |
package io.jboot.components.cache.redis;
import io.jboot.app.config.annotation.ConfigModel;
import io.jboot.support.redis.JbootRedisConfig;
/**
* JbootRedis 缓存的配置文件
*/
@ConfigModel(prefix = "jboot.cache.redis")
public class JbootRedisCacheConfig extends JbootRedisConfig {
/**
* 全局的key前缀,所有缓存的key都会自动添加该前缀
*/
private String globalKeyPrefix;
public String getGlobalKeyPrefix() {
return globalKeyPrefix;
}
public void setGlobalKeyPrefix(String globalKeyPrefix) {
this.globalKeyPrefix = globalKeyPrefix;
}
}
| {
"content_hash": "82be22980525d6d0bdf16fc2dfdb3284",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 61,
"avg_line_length": 21.692307692307693,
"alnum_prop": 0.725177304964539,
"repo_name": "yangfuhai/jboot",
"id": "05ad4d43aa1c358af7088e0bf7553acb9ac1d386",
"size": "1264",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/io/jboot/components/cache/redis/JbootRedisCacheConfig.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "10366"
},
{
"name": "Java",
"bytes": "2394166"
}
],
"symlink_target": ""
} |
include Helpers::ChefHelper
include T('default/module')
def init
@cookbook_statistics = YARD::CLI::Stats.new(false).statistics_hash
recipe_parts = %I[recipes attributes resources libraries]
sections [:cookbook_title, :metadata, :docstring, :generated_docs, recipe_parts]
end
| {
"content_hash": "846cbb1108c52a2cf5fb95c2e4200cb7",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 82,
"avg_line_length": 31.444444444444443,
"alnum_prop": 0.7632508833922261,
"repo_name": "chefdoc/yard-chefdoc",
"id": "f67c13b1d7004ec8095e6a3760c2bd58939d841d",
"size": "283",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "templates/default/cookbook/html/setup.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "777"
},
{
"name": "HTML",
"bytes": "9387"
},
{
"name": "Ruby",
"bytes": "35352"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
Svensk bot. Tidskr. 2(4): 383 (1908)
#### Original name
Phloeospora borealis Lind & Vleugel
### Remarks
null | {
"content_hash": "cd2d23e7629b884b28586b1127bc132d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 36,
"avg_line_length": 13.23076923076923,
"alnum_prop": 0.6976744186046512,
"repo_name": "mdoering/backbone",
"id": "de6bb33688a50edc4961018b03a5fc00726ac5cd",
"size": "231",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Dothideomycetes/Capnodiales/Mycosphaerellaceae/Phloeospora/Phloeospora borealis/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "23f4fc8f00c6ddb4ff8c692897e6c2d1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "ed9f5c8c6ee3da18abe54cf6364bbe3318cc5c9a",
"size": "175",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Gagnebina/Gagnebina lutescens/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
// ///////////////////////////////////////////////////////////////////////////////////////////
// Description: DictionaryExtensions class
// Author: Ben Moore
// Created date: 07/05/2015
// Copyright: Donky Networks Ltd 2015
// ///////////////////////////////////////////////////////////////////////////////////////////
using System.Collections.Generic;
namespace Donky.Core.Framework.Extensions
{
/// <summary>
/// Extension methods for dictionaries.
/// </summary>
public static class DictionaryExtensions
{
/// <summary>
/// Gets the specified value from the dictionary, or returns the default value if the key is not found.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="source">The source.</param>
/// <param name="key">The key.</param>
/// <param name="defaultValue">The default value.</param>
/// <returns></returns>
public static T ValueOrDefault<T>(this Dictionary<string, object> source, string key, T defaultValue)
{
return source.ContainsKey(key)
? (T) source[key]
: defaultValue;
}
/// <summary>
/// Returns the specified item from the dictionary as an Dictionary of string/object.
/// </summary>
/// <param name="source">The source.</param>
/// <param name="key">The key.</param>
/// <remarks>
/// Useful for navigating generic objects that have been deserialsed from JSON.
/// </remarks>
public static Dictionary<string, object> ChildObject(this Dictionary<string, object> source, string key)
{
return (Dictionary<string, object>) source[key];
}
/// <summary>
/// Values the specified key.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="source">The source.</param>
/// <param name="key">The key.</param>
/// <returns></returns>
public static T Value<T>(this Dictionary<string, object> source, string key)
{
return (T) source[key];
}
}
} | {
"content_hash": "c24ddacf731ef4185094352a3b873e5c",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 106,
"avg_line_length": 34.29824561403509,
"alnum_prop": 0.5805626598465473,
"repo_name": "Donky-Network/DonkySDK-Xamarin-Modular",
"id": "29b4fd08ede244dd9a475a550f634e37bbf7b730",
"size": "3058",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Donky.Core/Core/Framework/Extensions/DictionaryExtensions.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1485"
},
{
"name": "C#",
"bytes": "658225"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.glacier.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
* <p>
* Provides options to create a vault.
* </p>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateVaultRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The <code>AccountId</code> value is the AWS account ID. This value must match the AWS account ID associated with
* the credentials used to sign the request. You can either specify an AWS account ID or optionally a single '
* <code>-</code>' (hyphen), in which case Amazon S3 Glacier uses the AWS account ID associated with the credentials
* used to sign the request. If you specify your account ID, do not include any hyphens ('-') in the ID.
* </p>
*/
private String accountId;
/**
* <p>
* The name of the vault.
* </p>
*/
private String vaultName;
/**
* Default constructor for CreateVaultRequest object. Callers should use the setter or fluent setter (with...)
* methods to initialize the object after creating it.
*/
public CreateVaultRequest() {
}
/**
* Constructs a new CreateVaultRequest object. Callers should use the setter or fluent setter (with...) methods to
* initialize any additional object members.
*
* @param vaultName
* The name of the vault.
*/
public CreateVaultRequest(String vaultName) {
setVaultName(vaultName);
}
/**
* Constructs a new CreateVaultRequest object. Callers should use the setter or fluent setter (with...) methods to
* initialize any additional object members.
*
* @param accountId
* The <code>AccountId</code> value is the AWS account ID. This value must match the AWS account ID
* associated with the credentials used to sign the request. You can either specify an AWS account ID or
* optionally a single '<code>-</code>' (hyphen), in which case Amazon S3 Glacier uses the AWS account ID
* associated with the credentials used to sign the request. If you specify your account ID, do not include
* any hyphens ('-') in the ID.
* @param vaultName
* The name of the vault.
*/
public CreateVaultRequest(String accountId, String vaultName) {
setAccountId(accountId);
setVaultName(vaultName);
}
/**
* <p>
* The <code>AccountId</code> value is the AWS account ID. This value must match the AWS account ID associated with
* the credentials used to sign the request. You can either specify an AWS account ID or optionally a single '
* <code>-</code>' (hyphen), in which case Amazon S3 Glacier uses the AWS account ID associated with the credentials
* used to sign the request. If you specify your account ID, do not include any hyphens ('-') in the ID.
* </p>
*
* @param accountId
* The <code>AccountId</code> value is the AWS account ID. This value must match the AWS account ID
* associated with the credentials used to sign the request. You can either specify an AWS account ID or
* optionally a single '<code>-</code>' (hyphen), in which case Amazon S3 Glacier uses the AWS account ID
* associated with the credentials used to sign the request. If you specify your account ID, do not include
* any hyphens ('-') in the ID.
*/
public void setAccountId(String accountId) {
this.accountId = accountId;
}
/**
* <p>
* The <code>AccountId</code> value is the AWS account ID. This value must match the AWS account ID associated with
* the credentials used to sign the request. You can either specify an AWS account ID or optionally a single '
* <code>-</code>' (hyphen), in which case Amazon S3 Glacier uses the AWS account ID associated with the credentials
* used to sign the request. If you specify your account ID, do not include any hyphens ('-') in the ID.
* </p>
*
* @return The <code>AccountId</code> value is the AWS account ID. This value must match the AWS account ID
* associated with the credentials used to sign the request. You can either specify an AWS account ID or
* optionally a single '<code>-</code>' (hyphen), in which case Amazon S3 Glacier uses the AWS account ID
* associated with the credentials used to sign the request. If you specify your account ID, do not include
* any hyphens ('-') in the ID.
*/
public String getAccountId() {
return this.accountId;
}
/**
* <p>
* The <code>AccountId</code> value is the AWS account ID. This value must match the AWS account ID associated with
* the credentials used to sign the request. You can either specify an AWS account ID or optionally a single '
* <code>-</code>' (hyphen), in which case Amazon S3 Glacier uses the AWS account ID associated with the credentials
* used to sign the request. If you specify your account ID, do not include any hyphens ('-') in the ID.
* </p>
*
* @param accountId
* The <code>AccountId</code> value is the AWS account ID. This value must match the AWS account ID
* associated with the credentials used to sign the request. You can either specify an AWS account ID or
* optionally a single '<code>-</code>' (hyphen), in which case Amazon S3 Glacier uses the AWS account ID
* associated with the credentials used to sign the request. If you specify your account ID, do not include
* any hyphens ('-') in the ID.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateVaultRequest withAccountId(String accountId) {
setAccountId(accountId);
return this;
}
/**
* <p>
* The name of the vault.
* </p>
*
* @param vaultName
* The name of the vault.
*/
public void setVaultName(String vaultName) {
this.vaultName = vaultName;
}
/**
* <p>
* The name of the vault.
* </p>
*
* @return The name of the vault.
*/
public String getVaultName() {
return this.vaultName;
}
/**
* <p>
* The name of the vault.
* </p>
*
* @param vaultName
* The name of the vault.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateVaultRequest withVaultName(String vaultName) {
setVaultName(vaultName);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAccountId() != null)
sb.append("AccountId: ").append(getAccountId()).append(",");
if (getVaultName() != null)
sb.append("VaultName: ").append(getVaultName());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateVaultRequest == false)
return false;
CreateVaultRequest other = (CreateVaultRequest) obj;
if (other.getAccountId() == null ^ this.getAccountId() == null)
return false;
if (other.getAccountId() != null && other.getAccountId().equals(this.getAccountId()) == false)
return false;
if (other.getVaultName() == null ^ this.getVaultName() == null)
return false;
if (other.getVaultName() != null && other.getVaultName().equals(this.getVaultName()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
hashCode = prime * hashCode + ((getVaultName() == null) ? 0 : getVaultName().hashCode());
return hashCode;
}
@Override
public CreateVaultRequest clone() {
return (CreateVaultRequest) super.clone();
}
}
| {
"content_hash": "d5cf72584dc44823db1dd50e20e75e62",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 120,
"avg_line_length": 38.55309734513274,
"alnum_prop": 0.6310111327900838,
"repo_name": "aws/aws-sdk-java",
"id": "855105780fabdf6f22934b4748feedf81dc9d25e",
"size": "9293",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-glacier/src/main/java/com/amazonaws/services/glacier/model/CreateVaultRequest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<html>
<head>
<title>XACML Version 3.0 Conformance Tests (draft)</title>
</head>
<body>
<h1>XACML Version 3.0 Conformance Tests (draft)</h1>
<listing>
Version: 0.5, January 2014
Contributors: Anne Anderson, Satoshi Hada, John Merrells, Jin Peng, Seth Proctor, Argyn Kuketayev, Glenn Griffin
</listing>
This document describes and provides links to a suite of tests
intended to aid implementers in conforming to the <a
href="http://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.doc">
eXtensible Access Control Markup Language (XACML) Version 3.0 OASIS Standard</a>.
<h2>Contents</h2>
<ol TYPE=I>
<li><a href="#Description of tests"> Description of Tests
</a>
<ol TYPE=A>
<li><a href="#Test Case Groupings">Test Case Groupings</a>
<li><a href="#How to Use the Tests">How to Use the Tests</a>
<li><a href="#Preparing Tests for Execution">Preparing
Tests for Execution</a>
<li><a href="#Contributions of New Tests">Contributions
of New Tests</a>
<li><a href="#Bugs in the Tests">Bugs in the Tests</a>
</ol>
<li><a href="#Mandatory-to-Implement Functionality Tests">
Mandatory-to-Implement Functionality Tests </a>
<ol TYPE=A>
<li><a href="#Attribute References"> Attribute References </a>
<li><a href="#Target Matching"> Target Matching </a>
<li><a href="#Function Evaluation"> Function Evaluation </a>
<li><a href="#Combining Algorithms"> Combining Algorithms </a>
<li><a href="#Schema components"> Schema components </a>
<li><a href="#Release 3.0 Features"> Release 3.0 Features </a>
</ol>
<li><a href="#Optional, but Normative Functionality Tests">
Optional, but Normative Functionality Tests </a>
<ol TYPE=A>
<li><a href="#Obligations"> Obligations </a>
<li><a href="#DefaultsType"> DefaultsType </a>
<li><a href="#Hierarchical Resources"> Hierarchical Resources </a>
<li><a href="#<ResourceContent> Element"> <ResourceContent> Element </a>
<li><a href="#Multiple Decisions"> Multiple Decisions </a>
<li><a href="#Attribute Selectors"> Attribute Selectors </a>
<li><a href="#Non-mandatory Functions"> Non-mandatory Functions </a>
</ol>
<li><a href="#Identifiers planned for future deprecation">
Identifiers planned for future deprecation </a>
<ol TYPE=I >
<li><A href="#Description of Deprecated Identifiers Tests">Description of Deprecated Identifiers Tests </A>
<li><a href="#Deprecated Mandatory-to-Implement Functionality Tests">Deprecated Mandatory-to-Implement Functionality Tests </a>
<ol TYPE=A>
<li><a href="#Deprecated Attribute References"> Deprecated Attribute References </a>
<li><a href="#Deprecated Target Matching"> Deprecated Target Matching </a>
<li><a href="#Deprecated Function Evaluation"> Deprecated Function Evaluation </a>
<li><a href="#Deprecated Combining Algorithms"> Deprecated Combining Algorithms </a>
<li><a href="#Deprecated Schema components"> Deprecated Schema components </a>
</ol>
<li><a href="#Deprecated Optional, but Normative Functionality Tests">Deprecated Optional, but Normative Functionality Tests</a>
<ol TYPE=A>
<li><a href="#Deprecated Obligations"> Deprecated Obligations </a>
<li><a href="#Deprecated DefaultsType"> Deprecated DefaultsType </a>
<li><a href="#Deprecated Hierarchical Resources"> Deprecated Hierarchical Resources </a>
<li><a href="#Deprecated <ResourceContent> Element"> Deprecated <ResourceContent> Element </a>
<li><a href="#Deprecated Multiple Decisions"> Deprecated Multiple Decisions </a>
<li><a href="#Deprecated Attribute Selectors"> Deprecated Attribute Selectors </a>
<li><a href="#Deprecated Non-mandatory Functions"> Deprecated Non-mandatory Functions </a>
</ol>
</ol>
</ol>
<hr>
<ol TYPE=I>
<h2><li><a name="Description of tests"> Description of Tests </a></h2>
These tests are provided as an aid in achieving conformance to
the <a
href="http://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.doc"><i>
eXtensible Access Control Markup Language (XACML) Version 3.0
OASIS Standard</i></a>. The tests may aid in determining whether
an implementation is correctly interpreting the intent of the
XACML Version 3.0 specification, and may provide a basic level of
interoperability testing.<p>
These tests are <b>non-normative</b> and do not constitute a full
test of conformance to the XACML Version 3.0 Standard. A full
description of the requirements for conformance is included in
<i>Section 10. Conformance</i> of the <a
href="http://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.doc">
XACML Version 3.0 specification</a>. There is no OASIS- or XACML
TC- sponsored <i>branding</i> or certification program for
XACML.<p>
<!--
Except for those tests marked <a
href="#EXPERIMENTAL">EXPERIMENTAL</a>, all the tests in this
suite have undergone successful execution and review by multiple
XACML implementers and others, and thus represent some level of
consensus as to the intent of the XACML Version 1.0 Standard.<p>
-->
<h2>IMPORTANT NOTE</h2>
The tests in this suite were converted to comply with XACML 3.0 from
<a href="http://www.oasis-open.org/committees/download.php/6076/ConformanceTests.zip">
the conformance test suite for XACML 1.0 and 1.1</a>. Initial conversion was done by using pattern
matching/replacement scripts. All tests passed schema validation sucessfully against the normative
schema for
<a href="http://docs.oasis-open.org/xacml/3.0/xacml-core-v3-schema-wd-17.xsd">XSD</a> of XACML 3.0.
These tests have been run against one implementation and adjusted as needed to match the 3.0 specification.<p>
<h2>IMPORTANT NOTE (2)</h2>
This document may not be complete. There may be tests in the test suite that are not listed here.
The tests for new 3.0 features and deprecated items may be missing here but included in the directory of tests.
<h3>History of changes since XACML 2.0</h3>
Version 0.1<br/>
<ul>
<li>empty Target element is allowed in XACML 2.0
<li>AnySubject and other Any* elements in the Target are not allowed in XACML 2.0
<li>Environment element is required in Target for Request in XACML 2.0
<li>FunctionId is not allowed in Condition element in XACML 2.0
<li>IssueInstant attribute is not allowed in Attribute in XACML 2.0
<li>IIIASpecial.txt is removed, because AttributeAssignment element has AttributeValue in XACML 2.0.
<li>IIIGSpecial.txt is removed, because in XACML 2.0 it's defined that <xacml-context:Request>
is the context node for xpath expressions.
</ul>
Version 0.2<br/>
<ul>
<li>Remove DataType attribute from AttributeValue elements in *Request.xml files.
Data types should be specified in the parent Attribute element.
<li>Replace regexp-string-match in *Policy.xml files with string-regexp-match.
In XACML 2.0 this function's urn was changed to make it more consistent with names of
similar functions. Thanks to Ryan Eberhard for reporting this discrepancy in the
test suite.
</ul>
Version 0.3<br/>
<ul>
<li>Fix typos in policy combining algorithm urns. These typos were a result of
a bug in the scripts, which were used to convert XACML 1.0 conformance tests
to XACML 2.0. Thanks to Ryan Eberhard for reporting this bug in the
test suite.
</ul>
Version 0.4<br/>
<ul>
<li>IIC086-IIC091: change some attribute types to string.
<li>IIA004, IIA005 - these files contained intentional errors, which were accidentally "fixed"
when converting to xacml 2.0. Errors are reintroduced.
<li>IID029, IID030, IIE001, IIE002 - these files were not converted properly to
to xacml 2.0: Condition had FunctionId attribute. This bug was first reported by Frederic Deleon.
</ul>
Version 0.5<br/>
<ul>
<li>Included tests for new 3.0 features
<li>Added tests to exercise features from previous versions that were not exercised in any existing tests
<li>Added separate tests for Idenfiers planned for deprecation.
</ul>
<ol TYPE=A>
<h3><li><a name="Test Case Groupings">Test Case Groupings</a></h3>
Tests are divided into those that exercise
<i>Mandatory-to-Implement</i> functionality and those that
exercise <i>Optional, but normative</i> functionality.
There is also a separate section for tests of <a href="#Identifiers planned for future deprecation">Identifiers planned for future deprecation</a>.
All
implementations that claim conformance to the <i>eXtensible Access
Control Markup Language (XACML) Version 2.0 OASIS Standard</i>
<b>MUST</b> support all Mandatory-to-Implement functionality as
described in the <a
href="http://docs.oasis-open.org/xacml/3.0/xacml-3.0-core-spec-os-en.doc">
XACML Version 3.0 specification</a>.
Conforming implementations <b>MAY</b> additionally support
various Optional functionality areas.<p>
Tests are divided into groups based on the primary area of
functionality or schema being exercised.<p>
Each test case consists of three XML documents (or sets of documents):<p>
<ol TYPE=1>
<li>An XACML Request
<li>An XACML Policy or set of Policy documents
<li>An XACML Response
</ol>
<p>
Each XML document is named according to the section of this
document in which it occurs. For example, the XML
documents for the test in Part II (Mandatory to
implement), Section B (Target Matching), Test Case 8 (Case:
match: multiple actions) are named:<p>
<ul>
<li>IIB008Request.xml
<li>IIB008Policy.xml
<li>IIB008Response.xml
</ul>
<P>
The documents for <a href="#Identifiers planned for future deprecation">Identifiers planned for future deprecation</a>
use slightly different names. See that section for more details.
<P>
Tests for new 3.0 features are generally numbered starting with 300 rather than following the numbers of previous tests.
This was done to avoid potential conflicts, to keep the new 3.0 tests separate, and because in some cases the logical number for a test was already in use.
For example, the new Rule-level ordered-deny-override tests would logically have been related to the existing IID001 & IID002 (unordered) deny-override tests,
but all of the numbers in that vicinity are already taken.
<P>
Also, numbers in a group may not be consecutive. For example IID330-IID333 followed by IID340-IID343.
This is not necessarily especially meaningful. In this case the two groups are testing deny-unless-permit and permit-unless-deny which are mirror images of each other
so it was easier to copy a group of tests and mass-edit them than creating tests exactly in sequence.
<BR>
However, the gaps do provide spaces for future growth.
<h3><li><a name="How to Use the Tests">How to Use the Tests</a></h3>
An implementation of an XACML Policy Decision Point (PDP) should
be able to:<p>
<ol TYPE=1>
<li>Accept the given Request, or input <a href="#consistent with"><i>consistent with</i></a> the
given Request, as input.
<li>Accept the given Policy or Policies (these files may
contain one or more XACML Policies or PolicySets) as input.
<li>Produce the given Response, or output <a href="#consistent with">
<i>consistent with</i></a> the given Response, as output.
</ol>
<p>
<a name="consistent with">Explanation of <i>consistent with</i></a>:<p>
<blockquote>
The request and response used in executing these tests need not
be instances of the XACML Context Schema. The request and
response should, however, contain exactly the same information as
the given Request and Response file, and should exercise the XACML
policy evaluation functionality that the test is intended to
exercise. It should be possible, at least conceptually, to
mechanically convert the request and response used in the
implementation to the given XACML Request and Response
instances.<p>
</blockquote>
<h3><li><a name="Preparing Tests for Execution">Preparing Tests for Execution</a></h3>
In general, for each test,<p>
<ol>
<li>Either,
<ol TYPE=a>
<li>store the <code>*Policy.xml</code> file for the given
test in the repository you use for policies, such that the
specified <code>*Policy.xml</code> is the only policy that will
be retrieved by the PDP, or
<li> configure the PDP with the
<code>*Policy.xml</code> file as its initial policy.
</ol><p>
<li>Send the <code>*Request.xml</code> file (or its semantic
equivalent in your system) to the Context Handler component of
the XACML PDP via your access control decision request
API.<p>
<li>Compare the result returned from the PDP with the specified
<code>*Response.xml</code> file (or its semantic equivalent in
your system).<p>
<li>The test passes if your system's result is semantically
equivalent to the specified <code>*Response.xml</code> file.<p>
</ol>
Some of the tests have <i>special instructions</i> associated
with them. They modify the instructions given above for the
given test.<p>
<h3><li><a name="Contributions of New Tests">Contributions of New
Tests</a></h3>
Any XACML implementer may contribute additional conformance
tests</a> by submitting them to the <a
href="mailto:xacml-comment@lists.oasis-open.org">
xacml-comment@lists.oasis-open.org </a> mailing list. Such
contributions will be incorporated into the test suite on the next
update.<p>
While this suite of tests is non-normative, we hope the suite
will represent a general consensus as to the intent of the XACML
Version 2.0 Standard. For this reason, contributed tests are
marked <font color="red">**EXPERIMENTAL**</font></a>
until the tests have undergone successful review and use, defined
as follows:<p>
<ol>
<li> a reasonable review period has elapsed since submission, and
<li> several implementers have reported successful execution of
these tests to
<a href="mailto:xacml-comment@lists.oasis-open.org">
xacml-comment@lists.oasis-open.org,</a> and
<li> no objections to the test have been reported to the
xacml-comment mailing list.
</ol><p>
Once the tests have undergone successful review and use, then the
<font color="red">**EXPERIMENTAL**</font></a> status will be
removed.<p>
If an objection is reported on the xacml-comment mailing list to
an <font
color="red">**EXPERIMENTAL**</font> test during the review
period, then the test will be removed from the test suite on the
next update unless the XACML TC upholds the objection. It is up
to the test submitter to request review by the TC, and it is up
to the TC to decide whether or not to review a test.<p>
If an objection is reported to a test that is no longer <font
color="red">**EXPERIMENTAL**</font></a>, the objection is treated
as a bug. See <a href="#Bugs in the Tests"> Bugs in the
Tests </a> for a
description of how bugs are handled.<p>
<h3><li><a name="Bugs in the Tests">Bugs in the Tests</a></h3>
Following are the known bugs:<p>
<ol>
<li>The <Description> in many *Policy.xml files is incorrect:
instead of "read or write Bart Simpson's medical record", the
description should say "perform any action on any
resource".
</ol><p>
If you believe any test does not correctly interpret the intent
of the <a
href="http://docs.oasis-open.org/xacml/2.0/access_control-xacml-2.0-core-spec-os.pdf">
eXtensible Access Control Markup Language (XACML) Version 2.0 OASIS Standard</a>, or if you find any
additional errors in these tests, please submit a report to the
<a href="mailto:xacml-comment@lists.oasis-open.org">
xacml-comment@lists.oasis-open.org</a> mailing list. Absent any
objections to a bug report, minor bugs
may be fixed at the test editor's discretion in the next test
suite update.<p>
Major or controversial bugs reported against non-<a
href="#Contributions of New Tests"><font
color="red">**EXPERIMENTAL**</font></a>
tests will be reviewed by the XACML TC. If the TC agrees that
the test does not conform to the intent of the XACML Version 2.0
Standard, then the test will be modified or removed as
appropriate on the next test suite update.<p>
Major or controversial bugs reported against tests marked <a
href="#Contributions of New Tests"><font
color="red">**EXPERIMENTAL**</font></a> will be treated as an
<i>objection</i> to the test. See
<a href="#Contributions of New Tests"> Contributions of New Tests
</a> for the handling of such objections.<p>
Periodically, an updated copy of the entire Conformance Test
Suite, containing all corrections to date, will be posted to the
XACML TC Web Site.
<!--
Anyone may request to have updates to the
full Conformance Test Suite directly e-mailed to them at the same
time that the update is submitted to the XACML TC web site
maintainer: e-mail a request to <a
href="mailto:Anne.Anderson@Sun.COM"> Anne.Anderson@Sun.COM </a>.
Please be aware that this is a large e-mail :-).
-->
<p>
</ol>
<hr>
<h2><li><a name="Mandatory-to-Implement Functionality Tests">
Mandatory-to-Implement Functionality Tests </a></h2>
This section contains tests of all mandatory-to-implement
functionality. All implementations that conform to the XACML
Version 2.0 Standard should pass all these tests except as
explained in any associated <i>Special Instructions
(<code><test ID>Special.txt</code>)</i> file.<p>
<ol TYPE=A>
<h3><li><a name="Attribute References"> Attribute References </a></h3>
These tests exercise referencing of attribute values in the
Request by a policy.<p>
<ol>
<li>Case: Simple type attribute element present in Request
<i><a href="IIA001Request.xml">Request</a>,<a href="IIA001Policy.xml">Policy</a>,<a href="IIA001Response.xml">Response</a></i>
<li>Case: Simple type attribute element not present in
original decision Request, but retrievable from
Attribute repository
<i><a href="IIA002Request.xml">Request</a>,<a
href="IIA002Policy.xml">Policy</a>,<a
href="IIA002Response.xml">Response</a>,
<a href="IIA002Special.txt">Special Instructions</a></i>
<li>Case: Simple type attribute element not present in
Request and not retrievable by Attribute Authority
<i><a href="IIA003Request.xml">Request</a>,<a
href="IIA003Policy.xml">Policy</a>,<a
href="IIA003Response.xml">Response</a></i>
<li>Case: <i>INVALID</i> syntax for Attribute Designator
<i><a href="IIA004Request.xml">Request</a>,<a
href="IIA004Policy.xml">Policy</a>,<a
href="IIA004Response.xml">Response</a>,<a
href="IIA004Special.txt">Special Instructions</a></i>
<li>Case: <i>INVALID</i> syntax for Request attribute
<i><a href="IIA005Request.xml">Request</a>,<a
href="IIA005Policy.xml">Policy</a>,<a
href="IIA005Response.xml">Response</a></i>
<li>Case: TRUE: "MustBePresent" XML attribute in Target Designator
<i><a href="IIA006Request.xml">Request</a>,<a
href="IIA006Policy.xml">Policy</a>,<a
href="IIA006Response.xml">Response</a></i>
<li>Case: FALSE: "MustBePresent" XML attribute in Target Designator
<i><a href="IIA007Request.xml">Request</a>,<a
href="IIA007Policy.xml">Policy</a>,<a
href="IIA007Response.xml">Response</a></i>
<li>Case: TRUE: "MustBePresent" XML attribute in Condition Designator
<i><a href="IIA008Request.xml">Request</a>,<a
href="IIA008Policy.xml">Policy</a>,<a
href="IIA008Response.xml">Response</a></i>
<li>Case: FALSE: "MustBePresent" XML attribute in Condition Designator
<i><a href="IIA009Request.xml">Request</a>,<a
href="IIA009Policy.xml">Policy</a>,<a
href="IIA009Response.xml">Response</a></i>
<li>Case: Permit: Multiple attributes match except for DataType
<i><a href="IIA010Request.xml">Request</a>,<a
href="IIA010Policy.xml">Policy</a>,<a
href="IIA010Response.xml">Response</a></i>
<li>Case: Indeterminate: Multiple attributes match except for DataType
<i><a href="IIA011Request.xml">Request</a>,<a
href="IIA011Policy.xml">Policy</a>,<a
href="IIA011Response.xml">Response</a></i>
<li>Case: Permit: Multiple subjects with same subject-category:
different attribute in each
<i><a href="IIA012Request.xml">Request</a>,<a
href="IIA012Policy.xml">Policy</a>,<a
href="IIA012Response.xml">Response</a></i>
<li>Case: Indeterminate: Multiple subjects with same
subject-category: same attributes in each
<i><a href="IIA013Request.xml">Request</a>,<a
href="IIA013Policy.xml">Policy</a>,<a
href="IIA013Response.xml">Response</a></i>
<li>Case: Permit: SubjectAttributeDesignator with
SubjectCategory XML attribute
<i><a href="IIA014Request.xml">Request</a>,<a
href="IIA014Policy.xml">Policy</a>,<a
href="IIA014Response.xml">Response</a></i>
<li>Case: Permit: SubjectAttributeDesignator without
SubjectCategory XML attribute
<i><a href="IIA015Request.xml">Request</a>,<a
href="IIA015Policy.xml">Policy</a>,<a
href="IIA015Response.xml">Response</a></i>
<li>Case: explicit environment:current-time attribute. Updates: Rule description is modified
to match the condition. Aug 11, 2005 - Argyn Kuketayev.
<i><a href="IIA016Request.xml">Request</a>,<a
href="IIA016Policy.xml">Policy</a>,<a
href="IIA016Response.xml">Response</a></i>
<li>Case: implicit environment:current-time attribute
<i><a href="IIA017Request.xml">Request</a>,<a
href="IIA017Policy.xml">Policy</a>,<a
href="IIA017Response.xml">Response</a></i>
<li>Case: explicit environment:current-date attribute
<i><a href="IIA018Request.xml">Request</a>,<a
href="IIA018Policy.xml">Policy</a>,<a
href="IIA018Response.xml">Response</a></i>
<li>Case: implicit environment:current-date attribute
<i><a href="IIA019Request.xml">Request</a>,<a
href="IIA019Policy.xml">Policy</a>,<a
href="IIA019Response.xml">Response</a></i>
<li>Case: explicit environment:current-dateTime attribute
<i><a href="IIA020Request.xml">Request</a>,<a
href="IIA020Policy.xml">Policy</a>,<a
href="IIA020Response.xml">Response</a></i>
<li>Case: implicit environment:current-dateTime attribute
<i><a href="IIA021Request.xml">Request</a>,<a
href="IIA021Policy.xml">Policy</a>,<a
href="IIA021Response.xml">Response</a></i>
<li>Case: Test that all DataTypes with IncludeInResult=true show up in result<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIA022Request.xml">Request</a>,<a href="IIA022Policy.xml">Policy</a>,<a href="IIA022Response.xml">Response</a>,<a href="IIA022Response.json"> JSON Response</a></i>
<li>Case: Test that all DataTypes as Arrays (same Category, AttributeId, Issuer, DataType) with IncludeInResult=true show up in result.
ALSO test that selection works with array of values.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIA023Request.xml">Request</a>,<a href="IIA023Policy.xml">Policy</a>,<a href="IIA023Response.xml">Response</a></i>
<li>Case: Test all DataTypes as Arrays (same Category, AttributeId, Issuer, DIFFERENT DataType) with IncludeInResult=true.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIA024Request.xml">Request</a>,<a href="IIA024Policy.xml">Policy</a>,<a href="IIA024Response.xml">Response</a></i>
</ol>
<h3><li><a name="Target Matching"> Target Matching </a></h3>
These tests exercise various forms of Target matching.<p>
<ol>
<li>Case: match: anySubject, anyResource, anyAction
<i><a href="IIB001Request.xml">Request</a>,<a href="IIB001Policy.xml">Policy</a>,<a href="IIB001Response.xml">Response</a></i>
<p>
<li>Case: match: anySubject, anyResource, specified Action value
<i><a href="IIB002Request.xml">Request</a>,<a href="IIB002Policy.xml">Policy</a>,<a href="IIB002Response.xml">Response</a></i>
<li>Case: no match: anySubject, anyResource, specified Action value
<i><a href="IIB003Request.xml">Request</a>,<a href="IIB003Policy.xml">Policy</a>,<a href="IIB003Response.xml">Response</a></i>
<li>Case: match: anySubject, anyResource, two specified Action attributes
<i><a href="IIB004Request.xml">Request</a>,<a href="IIB004Policy.xml">Policy</a>,<a href="IIB004Response.xml">Response</a></i>
<li>Case: no match: anySubject, anyResource, two specified Action attributes
<i><a href="IIB005Request.xml">Request</a>,<a href="IIB005Policy.xml">Policy</a>,<a href="IIB005Response.xml">Response</a></i>
<li>Case: match: impliedAction
<i><a href="IIB006Request.xml">Request</a>,<a href="IIB006Policy.xml">Policy</a>,<a href="IIB006Response.xml">Response</a></i>
<li>Case: no match: impliedAction
<i><a href="IIB007Request.xml">Request</a>,<a href="IIB007Policy.xml">Policy</a>,<a href="IIB007Response.xml">Response</a></i>
<li>Case: match: multiple actions
<i><a href="IIB008Request.xml">Request</a>,<a href="IIB008Policy.xml">Policy</a>,<a href="IIB008Response.xml">Response</a></i>
<li>Case: no match: multiple actions
<i><a href="IIB009Request.xml">Request</a>,<a href="IIB009Policy.xml">Policy</a>,<a href="IIB009Response.xml">Response</a></i>
<p>
<li>Case: match: Subject with specific SubjectCategory
<i><a href="IIB010Request.xml">Request</a>,<a href="IIB010Policy.xml">Policy</a>,<a href="IIB010Response.xml">Response</a></i>
<li>Case: no match: Subject with specific SubjectCategory
<i><a href="IIB011Request.xml">Request</a>,<a href="IIB011Policy.xml">Policy</a>,<a href="IIB011Response.xml">Response</a></i>
<li>Case: match: Subject with specific SubjectId value
<i><a href="IIB012Request.xml">Request</a>,<a href="IIB012Policy.xml">Policy</a>,<a href="IIB012Response.xml">Response</a></i>
<li>Case: no match: Subject with specific SubjectID value
<i><a href="IIB013Request.xml">Request</a>,<a href="IIB013Policy.xml">Policy</a>,<a href="IIB013Response.xml">Response</a></i>
<li>Case: match: Subject with non-string SubjectId DataType and value
<i><a href="IIB014Request.xml">Request</a>,<a href="IIB014Policy.xml">Policy</a>,<a href="IIB014Response.xml">Response</a></i>
<li>Case: no match: Subject with non-string SubjectId DataType and value
<i><a href="IIB015Request.xml">Request</a>,<a href="IIB015Policy.xml">Policy</a>,<a href="IIB015Response.xml">Response</a></i>
<li>Case: match: Subject with specific KeyInfo value
<i><a href="IIB016Request.xml">Request</a>,<a href="IIB016Policy.xml">Policy</a>,<a href="IIB016Response.xml">Response</a></i>
<li>Case: no match: Subject with specific KeyInfo value
<i><a href="IIB017Request.xml">Request</a>,<a href="IIB017Policy.xml">Policy</a>,<a href="IIB017Response.xml">Response</a></i>
<li>Case: match: Subject AttributeId
<i><a href="IIB018Request.xml">Request</a>,<a href="IIB018Policy.xml">Policy</a>,<a href="IIB018Response.xml">Response</a></i>
<li>Case: no match: Subject AttributeId
<i><a href="IIB019Request.xml">Request</a>,<a href="IIB019Policy.xml">Policy</a>,<a href="IIB019Response.xml">Response</a></i>
<li>Case: match: Subject AttributeId and Issuer
<i><a href="IIB020Request.xml">Request</a>,<a href="IIB020Policy.xml">Policy</a>,<a href="IIB020Response.xml">Response</a></i>
<li>Case: no match: Subject AttributeId and Issuer
<i><a href="IIB021Request.xml">Request</a>,<a href="IIB021Policy.xml">Policy</a>,<a href="IIB021Response.xml">Response</a></i>
<li>Case: match: Subject AttributeId and IssueInstant
<i><a href="IIB022Request.xml">Request</a>,<a href="IIB022Policy.xml">Policy</a>,<a href="IIB022Response.xml">Response</a></i>
<li>Case: no match: Subject AttributeId and IssueInstant
<i><a href="IIB023Request.xml">Request</a>,<a href="IIB023Policy.xml">Policy</a>,<a href="IIB023Response.xml">Response</a></i>
<li>Case: match: Subject AttributeId, Issuer, and IssueInstant
<i><a href="IIB024Request.xml">Request</a>,<a href="IIB024Policy.xml">Policy</a>,<a href="IIB024Response.xml">Response</a></i>
<li>Case: no match: Subject AttributeId, Issuer, and IssueInstant
<i><a href="IIB025Request.xml">Request</a>,<a href="IIB025Policy.xml">Policy</a>,<a href="IIB025Response.xml">Response</a></i>
<li>Case: match: Subject identifier value and attribute value
<i><a href="IIB026Request.xml">Request</a>,<a href="IIB026Policy.xml">Policy</a>,<a href="IIB026Response.xml">Response</a></i>
<li>Case: no match: Subject identifier value and attribute value
<i><a href="IIB027Request.xml">Request</a>,<a href="IIB027Policy.xml">Policy</a>,<a href="IIB027Response.xml">Response</a></i>
<li>Case: match: multiple Subjects
<i><a href="IIB028Request.xml">Request</a>,<a href="IIB028Policy.xml">Policy</a>,<a href="IIB028Response.xml">Response</a></i>
<li>Case: no match: multiple Subjects
<i><a href="IIB029Request.xml">Request</a>,<a href="IIB029Policy.xml">Policy</a>,<a href="IIB029Response.xml">Response</a></i>
<p>
<li>Case: match: ResourceId
<i><a href="IIB030Request.xml">Request</a>,<a href="IIB030Policy.xml">Policy</a>,<a href="IIB030Response.xml">Response</a></i>
<li>Case: no match: ResourceId
<i><a href="IIB031Request.xml">Request</a>,<a href="IIB031Policy.xml">Policy</a>,<a href="IIB031Response.xml">Response</a></i>
<li>Case: match: ResourceId with specific DataType
<i><a href="IIB032Request.xml">Request</a>,<a href="IIB032Policy.xml">Policy</a>,<a href="IIB032Response.xml">Response</a></i>
<li>Case: no match: ResourceId with specific DataType
<i><a href="IIB033Request.xml">Request</a>,<a href="IIB033Policy.xml">Policy</a>,<a href="IIB033Response.xml">Response</a></i>
<li>Case: match: Resource AttributeId
<i><a href="IIB034Request.xml">Request</a>,<a href="IIB034Policy.xml">Policy</a>,<a href="IIB034Response.xml">Response</a></i>
<li>Case: no match: Resource AttributeId
<i><a href="IIB035Request.xml">Request</a>,<a href="IIB035Policy.xml">Policy</a>,<a href="IIB035Response.xml">Response</a></i>
<li>Case: match: Resource AttributeId and Issuer
<i><a href="IIB036Request.xml">Request</a>,<a href="IIB036Policy.xml">Policy</a>,<a href="IIB036Response.xml">Response</a></i>
<li>Case: no match: Resource AttributeId and Issuer
<i><a href="IIB037Request.xml">Request</a>,<a href="IIB037Policy.xml">Policy</a>,<a href="IIB037Response.xml">Response</a></i>
<li>Case: match: Resource AttributeId and IssueInstant
<i><a href="IIB038Request.xml">Request</a>,<a href="IIB038Policy.xml">Policy</a>,<a href="IIB038Response.xml">Response</a></i>
<li>Case: no match: Resource AttributeId and IssueInstant
<i><a href="IIB039Request.xml">Request</a>,<a href="IIB039Policy.xml">Policy</a>,<a href="IIB039Response.xml">Response</a></i>
<li>Case: match: Resource AttributeId, Issuer, and IssueInstant
<i><a href="IIB040Request.xml">Request</a>,<a href="IIB040Policy.xml">Policy</a>,<a href="IIB040Response.xml">Response</a></i>
<li>Case: no match: Resource AttributeId, Issuer, and IssueInstant
<i><a href="IIB041Request.xml">Request</a>,<a href="IIB041Policy.xml">Policy</a>,<a href="IIB041Response.xml">Response</a></i>
<li>Case: match: Resource identifier value and attribute value
<i><a href="IIB042Request.xml">Request</a>,<a href="IIB042Policy.xml">Policy</a>,<a href="IIB042Response.xml">Response</a></i>
<li>Case: no match: Resource identifier value and attribute value
<i><a href="IIB043Request.xml">Request</a>,<a href="IIB043Policy.xml">Policy</a>,<a href="IIB043Response.xml">Response</a></i>
<li>Case: match: multiple resources
<i><a href="IIB044Request.xml">Request</a>,<a href="IIB044Policy.xml">Policy</a>,<a href="IIB044Response.xml">Response</a></i>
<li>Case: no match: multiple resources
<i><a href="IIB045Request.xml">Request</a>,<a href="IIB045Policy.xml">Policy</a>,<a href="IIB045Response.xml">Response</a></i>
<p>
<li>Case: match: specified Subject and Resource
<i><a href="IIB046Request.xml">Request</a>,<a href="IIB046Policy.xml">Policy</a>,<a href="IIB046Response.xml">Response</a></i>
<li>Case: no match: specified Subject and Resource
<i><a href="IIB047Request.xml">Request</a>,<a href="IIB047Policy.xml">Policy</a>,<a href="IIB047Response.xml">Response</a></i>
<li>Case: match: specified Subject, Action
<i><a href="IIB048Request.xml">Request</a>,<a href="IIB048Policy.xml">Policy</a>,<a href="IIB048Response.xml">Response</a></i>
<li>Case: no match: specified Subject, Action
<i><a href="IIB049Request.xml">Request</a>,<a href="IIB049Policy.xml">Policy</a>,<a href="IIB049Response.xml">Response</a></i>
<li>Case: match: specified Resource, Action
<i><a href="IIB050Request.xml">Request</a>,<a href="IIB050Policy.xml">Policy</a>,<a href="IIB050Response.xml">Response</a></i>
<li>Case: no match: specified Resource, Action
<i><a href="IIB051Request.xml">Request</a>,<a href="IIB051Policy.xml">Policy</a>,<a href="IIB051Response.xml">Response</a></i>
<li>Case: match: specified Subject, Resource, Action
<i><a href="IIB052Request.xml">Request</a>,<a href="IIB052Policy.xml">Policy</a>,<a href="IIB052Response.xml">Response</a></i>
<li>Case: no match: specified Subject, Resource, Action
<i><a href="IIB053Request.xml">Request</a>,<a href="IIB053Policy.xml">Policy</a>,<a href="IIB053Response.xml">Response</a></i>
</ol>
<P>
Tests for Release 3.0 functionality.
<P>
<ol start=300>
<li>Case: Target Matching: Enhanced Target (succeed)<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIB300Request.xml">Request</a>,<a href="IIB300Policy.xml">Policy</a>,<a href="IIB300Response.xml">Response</a></i>
<li>Case: Target Matching: Enhanced Target (fail)<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIB301Request.xml">Request</a>,<a href="IIB301Policy.xml">Policy</a>,<a href="IIB301Response.xml">Response</a></i>
</ol>
<h3><li><a name="Function Evaluation"> Function Evaluation </a></h3>
These tests exercise each of the mandatory-to-implement functions.<p>
<ol>
<b>GENERAL APPLY TESTS</b>
<li>Case: Apply with Apply argument
<i><a href="IIC001Request.xml">Request</a>,<a href="IIC001Policy.xml">Policy</a>,<a href="IIC001Response.xml">Response</a></i>
<li>Case: Apply with AttributeValue argument
<i><a href="IIC002Request.xml">Request</a>,<a href="IIC002Policy.xml">Policy</a>,<a href="IIC002Response.xml">Response</a></i>
<li>Case: Apply with single-element bag where function expects primitive type
<i><a href="IIC003Request.xml">Request</a>,
<a href="IIC003Policy.xml">Policy</a>,
<a href="IIC003Response.xml">Response</a>,
<a href="IIC003Special.txt">Special Instructions</a></i>
<li>Case: Apply with SubjectAttributeDesignator argument
<i><a href="IIC004Request.xml">Request</a>,<a href="IIC004Policy.xml">Policy</a>,<a href="IIC004Response.xml">Response</a></i>
<li>Case: Apply with ResourceAttributeDesignator argument
<i><a href="IIC005Request.xml">Request</a>,<a href="IIC005Policy.xml">Policy</a>,<a href="IIC005Response.xml">Response</a></i>
<li>Case: Apply with ActionAttributeDesignator argument
<i><a href="IIC006Request.xml">Request</a>,<a href="IIC006Policy.xml">Policy</a>,<a href="IIC006Response.xml">Response</a></i>
<li>Case: Apply with EnvironmentAttributeDesignator argument
<i><a href="IIC007Request.xml">Request</a>,<a href="IIC007Policy.xml">Policy</a>,<a href="IIC007Response.xml">Response</a></i>
<li>Case: Apply with empty bag argument
<i><a href="IIC008Request.xml">Request</a>,<a href="IIC008Policy.xml">Policy</a>,<a href="IIC008Response.xml">Response</a></i>
<li>Case: Apply with multiple-element bag argument
<i><a href="IIC009Request.xml">Request</a>,<a href="IIC009Policy.xml">Policy</a>,<a href="IIC009Response.xml">Response</a></i>
<li>Case: true: Condition Evaluation
<i><a href="IIC010Request.xml">Request</a>,<a href="IIC010Policy.xml">Policy</a>,<a href="IIC010Response.xml">Response</a></i>
<li>Case: false: Condition Evaluation
<i><a href="IIC011Request.xml">Request</a>,<a href="IIC011Policy.xml">Policy</a>,<a href="IIC011Response.xml">Response</a></i>
<li>Case: ERROR: Condition Evaluation - non-boolean datatype
<i><a href="IIC012Request.xml">Request</a>,<a
href="IIC012Policy.xml">Policy</a>,<a
href="IIC012Response.xml">Response</a>,
<a href="IIC012Special.txt">Special Instructions</a></i>
<p>
<b>ARITHMETIC FUNCTIONS</b>
<li>Case: function:integer-add
<i><a href="IIC013Request.xml">Request</a>,<a href="IIC013Policy.xml">Policy</a>,<a href="IIC013Response.xml">Response</a></i>
<li>Case: ERROR: function:integer-add - non-integer datatype
<i><a href="IIC014Request.xml">Request</a>,<a
href="IIC014Policy.xml">Policy</a>,<a
href="IIC014Response.xml">Response</a>,
<a href="IIC014Special.txt">Special Instructions</a></i>
<li>Case: function:double-add
<i><a href="IIC015Request.xml">Request</a>,<a href="IIC015Policy.xml">Policy</a>,<a href="IIC015Response.xml">Response</a></i>
<li>Case: function:integer-subtract
<i><a href="IIC016Request.xml">Request</a>,<a href="IIC016Policy.xml">Policy</a>,<a href="IIC016Response.xml">Response</a></i>
<li>Case: function:double-subtract
<i><a href="IIC017Request.xml">Request</a>,<a href="IIC017Policy.xml">Policy</a>,<a href="IIC017Response.xml">Response</a></i>
<li>Case: function:integer-multiply
<i><a href="IIC018Request.xml">Request</a>,<a href="IIC018Policy.xml">Policy</a>,<a href="IIC018Response.xml">Response</a></i>
<li>Case: function:double-multiply
<i><a href="IIC019Request.xml">Request</a>,<a href="IIC019Policy.xml">Policy</a>,<a href="IIC019Response.xml">Response</a></i>
<li>Case: function:integer-divide
<i><a href="IIC020Request.xml">Request</a>,<a href="IIC020Policy.xml">Policy</a>,<a href="IIC020Response.xml">Response</a></i>
<li>Case: function:double-divide
<i><a href="IIC021Request.xml">Request</a>,<a href="IIC021Policy.xml">Policy</a>,<a href="IIC021Response.xml">Response</a></i>
<li>Case: function:integer-mod
<i><a href="IIC022Request.xml">Request</a>,<a href="IIC022Policy.xml">Policy</a>,<a href="IIC022Response.xml">Response</a></i>
<li>Case: function:double-mod: IIC023*.xml: TEST DELETED
<li>Case: function:round
<i><a href="IIC024Request.xml">Request</a>,<a href="IIC024Policy.xml">Policy</a>,<a href="IIC024Response.xml">Response</a></i>
<li>Case: function:floor
<i><a href="IIC025Request.xml">Request</a>,<a href="IIC025Policy.xml">Policy</a>,<a href="IIC025Response.xml">Response</a></i>
<li>Case: function:integer-abs
<i><a href="IIC026Request.xml">Request</a>,<a href="IIC026Policy.xml">Policy</a>,<a href="IIC026Response.xml">Response</a></i>
<li>Case: function:double-abs
<i><a href="IIC027Request.xml">Request</a>,<a
href="IIC027Policy.xml">Policy</a>,<a
href="IIC027Response.xml">Response</a></i>
<p>
<b>ARITHMETIC CONVERSION FUNCTIONS</b>
<li>Case: function:double-to-integer
<i><a href="IIC028Request.xml">Request</a>,<a href="IIC028Policy.xml">Policy</a>,<a href="IIC028Response.xml">Response</a></i>
<li>Case: function:integer-to-double
<i><a href="IIC029Request.xml">Request</a>,<a href="IIC029Policy.xml">Policy</a>,<a href="IIC029Response.xml">Response</a></i>
<p>
<b>EQUALITY FUNCTIONS</b>
<li>Case: true: function:integer-equal
<i><a href="IIC030Request.xml">Request</a>,<a href="IIC030Policy.xml">Policy</a>,<a href="IIC030Response.xml">Response</a></i>
<li>Case: false: function:integer-equal
<i><a href="IIC031Request.xml">Request</a>,<a href="IIC031Policy.xml">Policy</a>,<a href="IIC031Response.xml">Response</a></i>
<li>Case: true: function:double-equal
<i><a href="IIC032Request.xml">Request</a>,<a href="IIC032Policy.xml">Policy</a>,<a href="IIC032Response.xml">Response</a></i>
<li>Case: false: function:double-equal
<i><a href="IIC033Request.xml">Request</a>,<a href="IIC033Policy.xml">Policy</a>,<a href="IIC033Response.xml">Response</a></i>
<li>Case: true: function:boolean-equal
<i><a href="IIC034Request.xml">Request</a>,<a href="IIC034Policy.xml">Policy</a>,<a href="IIC034Response.xml">Response</a></i>
<li>Case: false: function:boolean-equal
<i><a href="IIC035Request.xml">Request</a>,<a href="IIC035Policy.xml">Policy</a>,<a href="IIC035Response.xml">Response</a></i>
<li>Case: true: function:string-equal
<i><a href="IIC036Request.xml">Request</a>,<a href="IIC036Policy.xml">Policy</a>,<a href="IIC036Response.xml">Response</a></i>
<li>Case: false: function:string-equal
<i><a href="IIC037Request.xml">Request</a>,<a href="IIC037Policy.xml">Policy</a>,<a href="IIC037Response.xml">Response</a></i>
<li>Case: true: function:rfc822Name-equal
<i><a href="IIC038Request.xml">Request</a>,<a href="IIC038Policy.xml">Policy</a>,<a href="IIC038Response.xml">Response</a></i>
<li>Case: false: function:rfc822Name-equal
<i><a href="IIC039Request.xml">Request</a>,<a href="IIC039Policy.xml">Policy</a>,<a href="IIC039Response.xml">Response</a></i>
<li>Case: true: function:x500Name-equal
<i><a href="IIC040Request.xml">Request</a>,<a href="IIC040Policy.xml">Policy</a>,<a href="IIC040Response.xml">Response</a></i>
<li>Case: false: function:x500Name-equal
<i><a href="IIC041Request.xml">Request</a>,<a href="IIC041Policy.xml">Policy</a>,<a href="IIC041Response.xml">Response</a></i>
<li>Case: true: function:date-equal
<i><a href="IIC042Request.xml">Request</a>,<a href="IIC042Policy.xml">Policy</a>,<a href="IIC042Response.xml">Response</a></i>
<li>Case: false: function:date-equal
<i><a href="IIC043Request.xml">Request</a>,<a href="IIC043Policy.xml">Policy</a>,<a href="IIC043Response.xml">Response</a></i>
<li>Case: true: function:time-equal
<i><a href="IIC044Request.xml">Request</a>,<a href="IIC044Policy.xml">Policy</a>,<a href="IIC044Response.xml">Response</a></i>
<li>Case: false: function:time-equal
<i><a href="IIC045Request.xml">Request</a>,<a href="IIC045Policy.xml">Policy</a>,<a href="IIC045Response.xml">Response</a></i>
<li>Case: true: function:dateTime-equal
<i><a href="IIC046Request.xml">Request</a>,<a href="IIC046Policy.xml">Policy</a>,<a href="IIC046Response.xml">Response</a></i>
<li>Case: false: function:dateTime-equal
<i><a href="IIC047Request.xml">Request</a>,<a href="IIC047Policy.xml">Policy</a>,<a href="IIC047Response.xml">Response</a></i>
<li>Case: true: function:hexBinary-equal
<i><a href="IIC048Request.xml">Request</a>,<a href="IIC048Policy.xml">Policy</a>,<a href="IIC048Response.xml">Response</a></i>
<li>Case: false: function:hexBinary-equal
<i><a href="IIC049Request.xml">Request</a>,<a href="IIC049Policy.xml">Policy</a>,<a href="IIC049Response.xml">Response</a></i>
<li>Case: true: function:base64Binary-equal
<i><a href="IIC050Request.xml">Request</a>,<a href="IIC050Policy.xml">Policy</a>,<a href="IIC050Response.xml">Response</a></i>
<li>Case: false: function:base64Binary-equal
<i><a href="IIC051Request.xml">Request</a>,<a href="IIC051Policy.xml">Policy</a>,<a href="IIC051Response.xml">Response</a></i>
<li>Case: true: function:anyURI-equal
<i><a href="IIC052Request.xml">Request</a>,<a href="IIC052Policy.xml">Policy</a>,<a href="IIC052Response.xml">Response</a></i>
<li>Case: false: function:anyURI-equal
<i><a href="IIC053Request.xml">Request</a>,<a href="IIC053Policy.xml">Policy</a>,<a href="IIC053Response.xml">Response</a></i>
<li>Case: true: function:QName-equal: IIC054*.xml: TEST DELETED
<li>Case: false: function:QName-equal: IIC055*.xml: TEST DELETED
<p>
<b>See also <a href="#DURATION-EQUALS TESTS">DURATION-EQUALS TESTS</a> below.</b>
<p>
<b>String-regexp-match FUNCTION</b>
<li>Case: true: function:string-regexp-match
<i><a href="IIC056Request.xml">Request</a>,<a href="IIC056Policy.xml">Policy</a>,<a href="IIC056Response.xml">Response</a></i>
<li>Case: false: function:string-regexp-match
<i><a href="IIC057Request.xml">
Request</a>,<a href="IIC057Policy.xml">Policy</a>,<a
href="IIC057Response.xml">Response</a></i>
<p>
<b>COMPARISON FUNCTIONS: GREATER THAN, GREATER THAN OR EQUAL</b>
<li>Case: true: function:integer-greater-than
<i><a href="IIC058Request.xml">Request</a>,<a href="IIC058Policy.xml">Policy</a>,<a href="IIC058Response.xml">Response</a></i>
<li>Case: false: function:integer-greater-than
<i><a href="IIC059Request.xml">Request</a>,<a href="IIC059Policy.xml">Policy</a>,<a href="IIC059Response.xml">Response</a></i>
<li>Case: true: function:double-greater-than
<i><a href="IIC060Request.xml">Request</a>,<a href="IIC060Policy.xml">Policy</a>,<a href="IIC060Response.xml">Response</a></i>
<li>Case: false: function:double-greater-than
<i><a href="IIC061Request.xml">Request</a>,<a href="IIC061Policy.xml">Policy</a>,<a href="IIC061Response.xml">Response</a></i>
<li>Case: true: function:string-greater-than
<i><a href="IIC062Request.xml">Request</a>,<a href="IIC062Policy.xml">Policy</a>,<a href="IIC062Response.xml">Response</a></i>
<li>Case: false: function:string-greater-than
<i><a href="IIC063Request.xml">Request</a>,<a href="IIC063Policy.xml">Policy</a>,<a href="IIC063Response.xml">Response</a></i>
<li>Case: true: function:date-greater-than
<i><a href="IIC064Request.xml">Request</a>,<a href="IIC064Policy.xml">Policy</a>,<a href="IIC064Response.xml">Response</a></i>
<li>Case: false: function:date-greater-than
<i><a href="IIC065Request.xml">Request</a>,<a href="IIC065Policy.xml">Policy</a>,<a href="IIC065Response.xml">Response</a></i>
<li>Case: true: function:time-greater-than
<i><a href="IIC066Request.xml">Request</a>,<a href="IIC066Policy.xml">Policy</a>,<a href="IIC066Response.xml">Response</a></i>
<li>Case: false: function:time-greater-than
<i><a href="IIC067Request.xml">Request</a>,<a href="IIC067Policy.xml">Policy</a>,<a href="IIC067Response.xml">Response</a></i>
<li>Case: true: function:dateTime-greater-than
<i><a href="IIC068Request.xml">Request</a>,<a href="IIC068Policy.xml">Policy</a>,<a href="IIC068Response.xml">Response</a></i>
<li>Case: false: function:dateTime-greater-than
<i><a href="IIC069Request.xml">Request</a>,<a href="IIC069Policy.xml">Policy</a>,<a href="IIC069Response.xml">Response</a></i>
<li>Case: true: function:integer-greater-than-or-equal
<i><a href="IIC070Request.xml">Request</a>,<a href="IIC070Policy.xml">Policy</a>,<a href="IIC070Response.xml">Response</a></i>
<li>Case: false: function:integer-greater-than-or-equal
<i><a href="IIC071Request.xml">Request</a>,<a href="IIC071Policy.xml">Policy</a>,<a href="IIC071Response.xml">Response</a></i>
<li>Case: true: function:double-greater-than-or-equal
<i><a href="IIC072Request.xml">Request</a>,<a href="IIC072Policy.xml">Policy</a>,<a href="IIC072Response.xml">Response</a></i>
<li>Case: false: function:double-greater-than-or-equal
<i><a href="IIC073Request.xml">Request</a>,<a href="IIC073Policy.xml">Policy</a>,<a href="IIC073Response.xml">Response</a></i>
<li>Case: true: function:string-greater-than-or-equal
<i><a href="IIC074Request.xml">Request</a>,<a href="IIC074Policy.xml">Policy</a>,<a href="IIC074Response.xml">Response</a></i>
<li>Case: false: function:string-greater-than-or-equal
<i><a href="IIC075Request.xml">Request</a>,<a href="IIC075Policy.xml">Policy</a>,<a href="IIC075Response.xml">Response</a></i>
<li>Case: true: function:date-greater-than-or-equal
<i><a href="IIC076Request.xml">Request</a>,<a href="IIC076Policy.xml">Policy</a>,<a href="IIC076Response.xml">Response</a></i>
<li>Case: false: function:date-greater-than-or-equal
<i><a href="IIC077Request.xml">Request</a>,<a href="IIC077Policy.xml">Policy</a>,<a href="IIC077Response.xml">Response</a></i>
<li>Case: true: function:time-greater-than-or-equal
<i><a href="IIC078Request.xml">Request</a>,<a href="IIC078Policy.xml">Policy</a>,<a href="IIC078Response.xml">Response</a></i>
<li>Case: false: function:time-greater-than-or-equal
<i><a href="IIC079Request.xml">Request</a>,<a href="IIC079Policy.xml">Policy</a>,<a href="IIC079Response.xml">Response</a></i>
<li>Case: true: function:dateTime-greater-than-or-equal
<i><a href="IIC080Request.xml">Request</a>,<a href="IIC080Policy.xml">Policy</a>,<a href="IIC080Response.xml">Response</a></i>
<li>Case: false: function:dateTime-greater-than-or-equal
<i><a href="IIC081Request.xml">Request</a>,<a
href="IIC081Policy.xml">Policy</a>,<a
href="IIC081Response.xml">Response</a></i>
<p>
<b>rfc822Name and x500Name MATCHING FUNCTIONS</b>
<li>Case: true: function:rfc822Name-match
<i><a href="IIC082Request.xml">Request</a>,<a href="IIC082Policy.xml">Policy</a>,<a href="IIC082Response.xml">Response</a></i>
<li>Case: false: function:rfc822Name-match
<i><a href="IIC083Request.xml">Request</a>,<a href="IIC083Policy.xml">Policy</a>,<a href="IIC083Response.xml">Response</a></i>
<li>Case: true: function:x500Name-match
<i><a href="IIC084Request.xml">Request</a>,<a href="IIC084Policy.xml">Policy</a>,<a href="IIC084Response.xml">Response</a></i>
<li>Case: false: function:x500Name-match
<i><a href="IIC085Request.xml">Request</a>,<a
href="IIC085Policy.xml">Policy</a>,<a
href="IIC085Response.xml">Response</a></i>
<p>
<b>LOGICAL FUNCTIONS</b>
<li>Case: true: function:and
<i><a href="IIC086Request.xml">Request</a>,<a href="IIC086Policy.xml">Policy</a>,<a href="IIC086Response.xml">Response</a></i>
<li>Case: false: function:and
<i><a href="IIC087Request.xml">Request</a>,<a href="IIC087Policy.xml">Policy</a>,<a href="IIC087Response.xml">Response</a></i>
<li>Case: true: function:ordered-and: IIC088*.xml: TEST DELETED
<li>Case: false: function:ordered-and: IIC089*.xml: TEST DELETED
<li>Case: true: function:or
<i><a href="IIC090Request.xml">Request</a>,<a href="IIC090Policy.xml">Policy</a>,<a href="IIC090Response.xml">Response</a></i>
<li>Case: false: function:or
<i><a href="IIC091Request.xml">Request</a>,<a href="IIC091Policy.xml">Policy</a>,<a href="IIC091Response.xml">Response</a></i>
<li>Case: true: function:ordered-or: IIC092*.xml: TEST DELETED
<li>Case: false: function:ordered-or: IIC093*.xml: TEST DELETED
<li>Case: true: function:n-of
<i><a href="IIC094Request.xml">Request</a>,<a href="IIC094Policy.xml">Policy</a>,<a href="IIC094Response.xml">Response</a></i>
<li>Case: false: function:n-of
<i><a href="IIC095Request.xml">Request</a>,<a href="IIC095Policy.xml">Policy</a>,<a href="IIC095Response.xml">Response</a></i>
<li>Case: true: function:not
<i><a href="IIC096Request.xml">Request</a>,<a href="IIC096Policy.xml">Policy</a>,<a href="IIC096Response.xml">Response</a></i>
<li>Case: false: function:not
<i><a href="IIC097Request.xml">Request</a>,<a href="IIC097Policy.xml">Policy</a>,<a href="IIC097Response.xml">Response</a></i>
<li>Case: true: function:present: IIC098*.xml: TEST DELETED
<li>Case: false: function:present: IIC099*.xml: TEST DELETED
<p>
<b>STRING NORMALIZATION FUNCTIONS</b>
<li>Case: function:string-normalize-space
<i><a href="IIC100Request.xml">Request</a>,<a href="IIC100Policy.xml">Policy</a>,<a href="IIC100Response.xml">Response</a></i>
<li>Case: function:string-normalize-to-lower-case
<i><a href="IIC101Request.xml">Request</a>,<a href="IIC101Policy.xml">Policy</a>,<a href="IIC101Response.xml">Response</a></i>
<p>
<b>DURATION FUNCTIONS</b>
<li>Case: function:dateTime-add-dayTimeDuration
<i><a href="IIC102Request.xml">Request</a>,<a href="IIC102Policy.xml">Policy</a>,<a href="IIC102Response.xml">Response</a></i>
<li>Case: function:dateTime-add-yearMonthDuration
<i><a href="IIC103Request.xml">Request</a>,<a href="IIC103Policy.xml">Policy</a>,<a href="IIC103Response.xml">Response</a></i>
<li>Case: function:dateTime-subtract-dayTimeDuration
<i><a href="IIC104Request.xml">Request</a>,<a href="IIC104Policy.xml">Policy</a>,<a href="IIC104Response.xml">Response</a></i>
<li>Case: function:dateTime-subtract-yearMonthDuration
<i><a href="IIC105Request.xml">Request</a>,<a href="IIC105Policy.xml">Policy</a>,<a href="IIC105Response.xml">Response</a></i>
<li>Case: function:date-add-yearMonthDuration
<i><a href="IIC106Request.xml">Request</a>,<a href="IIC106Policy.xml">Policy</a>,<a href="IIC106Response.xml">Response</a></i>
<li>Case: function:date-subtract-yearMonthDuration
<i><a href="IIC107Request.xml">Request</a>,<a href="IIC107Policy.xml">Policy</a>,<a href="IIC107Response.xml">Response</a></i>
<p>
<b>See also <a href="#DURATION-EQUALS TESTS">DURATION-EQUALS TESTS</a> below.</b>
<p>
<b>COMPARISON FUNCTIONS: LESS THAN, LESS THAN OR EQUAL</b>
<li>Case: function:string-less-than
<i><a href="IIC108Request.xml">Request</a>,<a href="IIC108Policy.xml">Policy</a>,<a href="IIC108Response.xml">Response</a></i>
<li>Case: function:string-less-than-or-equal
<i><a href="IIC109Request.xml">Request</a>,<a href="IIC109Policy.xml">Policy</a>,<a href="IIC109Response.xml">Response</a></i>
<li>Case: function:integer-less-than
<i><a href="IIC110Request.xml">Request</a>,<a href="IIC110Policy.xml">Policy</a>,<a href="IIC110Response.xml">Response</a></i>
<li>Case: function:double-less-than
<i><a href="IIC111Request.xml">Request</a>,<a href="IIC111Policy.xml">Policy</a>,<a href="IIC111Response.xml">Response</a></i>
<li>Case: function:integer-less-than-or-equal
<i><a href="IIC112Request.xml">Request</a>,<a href="IIC112Policy.xml">Policy</a>,<a href="IIC112Response.xml">Response</a></i>
<li>Case: function:double-less-than-or-equal
<i><a href="IIC113Request.xml">Request</a>,<a href="IIC113Policy.xml">Policy</a>,<a href="IIC113Response.xml">Response</a></i>
<li>Case: function:time-less-than
<i><a href="IIC114Request.xml">Request</a>,<a href="IIC114Policy.xml">Policy</a>,<a href="IIC114Response.xml">Response</a></i>
<li>Case: function:time-less-than-or-equal
<i><a href="IIC115Request.xml">Request</a>,<a href="IIC115Policy.xml">Policy</a>,<a href="IIC115Response.xml">Response</a></i>
<li>Case: function:dateTime-less-than
<i><a href="IIC116Request.xml">Request</a>,<a href="IIC116Policy.xml">Policy</a>,<a href="IIC116Response.xml">Response</a></i>
<li>Case: function:dateTime-less-than-or-equal
<i><a href="IIC117Request.xml">Request</a>,<a href="IIC117Policy.xml">Policy</a>,<a href="IIC117Response.xml">Response</a></i>
<li>Case: function:date-less-than
<i><a href="IIC118Request.xml">Request</a>,<a href="IIC118Policy.xml">Policy</a>,<a href="IIC118Response.xml">Response</a></i>
<li>Case: function:date-less-than-or-equal
<i><a href="IIC119Request.xml">Request</a>,<a href="IIC119Policy.xml">Policy</a>,<a href="IIC119Response.xml">Response</a></i>
<p>
<b>BAG FUNCTIONS</b>
<li>Case: function:string-bag-size
<i><a href="IIC120Request.xml">Request</a>,<a href="IIC120Policy.xml">Policy</a>,<a href="IIC120Response.xml">Response</a></i>
<li>Case: function:string-bag
<i><a href="IIC121Request.xml">Request</a>,<a href="IIC121Policy.xml">Policy</a>,<a href="IIC121Response.xml">Response</a></i>
<li>Case: function:boolean-one-and-only
<i><a href="IIC122Request.xml">Request</a>,<a href="IIC122Policy.xml">Policy</a>,<a href="IIC122Response.xml">Response</a></i>
<li>Case: function:boolean-bag-size
<i><a href="IIC123Request.xml">Request</a>,<a href="IIC123Policy.xml">Policy</a>,<a href="IIC123Response.xml">Response</a></i>
<li>Case: function:boolean-is-in
<i><a href="IIC124Request.xml">Request</a>,<a href="IIC124Policy.xml">Policy</a>,<a href="IIC124Response.xml">Response</a></i>
<li>Case: function:boolean-bag
<i><a href="IIC125Request.xml">Request</a>,<a href="IIC125Policy.xml">Policy</a>,<a href="IIC125Response.xml">Response</a></i>
<li>Case: function:integer-bag-size
<i><a href="IIC126Request.xml">Request</a>,<a href="IIC126Policy.xml">Policy</a>,<a href="IIC126Response.xml">Response</a></i>
<li>Case: function:integer-is-in
<i><a href="IIC127Request.xml">Request</a>,<a href="IIC127Policy.xml">Policy</a>,<a href="IIC127Response.xml">Response</a></i>
<li>Case: function:integer-bag
<i><a href="IIC128Request.xml">Request</a>,<a href="IIC128Policy.xml">Policy</a>,<a href="IIC128Response.xml">Response</a></i>
<li>Case: function:double-bag-size
<i><a href="IIC129Request.xml">Request</a>,<a href="IIC129Policy.xml">Policy</a>,<a href="IIC129Response.xml">Response</a></i>
<li>Case: function:double-is-in
<i><a href="IIC130Request.xml">Request</a>,<a href="IIC130Policy.xml">Policy</a>,<a href="IIC130Response.xml">Response</a></i>
<li>Case: function:double-bag
<i><a href="IIC131Request.xml">Request</a>,<a href="IIC131Policy.xml">Policy</a>,<a href="IIC131Response.xml">Response</a></i>
<li>Case: function:date-bag-size
<i><a href="IIC132Request.xml">Request</a>,<a href="IIC132Policy.xml">Policy</a>,<a href="IIC132Response.xml">Response</a></i>
<li>Case: function:date-is-in
<i><a href="IIC133Request.xml">Request</a>,<a href="IIC133Policy.xml">Policy</a>,<a href="IIC133Response.xml">Response</a></i>
<li>Case: function:date-bag
<i><a href="IIC134Request.xml">Request</a>,<a href="IIC134Policy.xml">Policy</a>,<a href="IIC134Response.xml">Response</a></i>
<li>Case: function:time-bag-size
<i><a href="IIC135Request.xml">Request</a>,<a href="IIC135Policy.xml">Policy</a>,<a href="IIC135Response.xml">Response</a></i>
<li>Case: function:time-is-in
<i><a href="IIC136Request.xml">Request</a>,<a href="IIC136Policy.xml">Policy</a>,<a href="IIC136Response.xml">Response</a></i>
<li>Case: function:time-bag
<i><a href="IIC137Request.xml">Request</a>,<a href="IIC137Policy.xml">Policy</a>,<a href="IIC137Response.xml">Response</a></i>
<li>Case: function:dateTime-bag-size
<i><a href="IIC138Request.xml">Request</a>,<a href="IIC138Policy.xml">Policy</a>,<a href="IIC138Response.xml">Response</a></i>
<li>Case: function:dateTime-is-in
<i><a href="IIC139Request.xml">Request</a>,<a href="IIC139Policy.xml">Policy</a>,<a href="IIC139Response.xml">Response</a></i>
<li>Case: function:dateTime-bag
<i><a href="IIC140Request.xml">Request</a>,<a href="IIC140Policy.xml">Policy</a>,<a href="IIC140Response.xml">Response</a></i>
<li>Case: function:anyURI-bag-size
<i><a href="IIC141Request.xml">Request</a>,<a href="IIC141Policy.xml">Policy</a>,<a href="IIC141Response.xml">Response</a></i>
<li>Case: function:anyURI-is-in
<i><a href="IIC142Request.xml">Request</a>,<a href="IIC142Policy.xml">Policy</a>,<a href="IIC142Response.xml">Response</a></i>
<li>Case: function:anyURI-bag
<i><a href="IIC143Request.xml">Request</a>,<a href="IIC143Policy.xml">Policy</a>,<a href="IIC143Response.xml">Response</a></i>
<li>Case: function:hexBinary-bag-size
<i><a href="IIC144Request.xml">Request</a>,<a href="IIC144Policy.xml">Policy</a>,<a href="IIC144Response.xml">Response</a></i>
<li>Case: function:hexBinary-is-in
<i><a href="IIC145Request.xml">Request</a>,<a href="IIC145Policy.xml">Policy</a>,<a href="IIC145Response.xml">Response</a></i>
<li>Case: function:hexBinary-bag
<i><a href="IIC146Request.xml">Request</a>,<a href="IIC146Policy.xml">Policy</a>,<a href="IIC146Response.xml">Response</a></i>
<li>Case: function:base64Binary-bag-size
<i><a href="IIC147Request.xml">Request</a>,<a href="IIC147Policy.xml">Policy</a>,<a href="IIC147Response.xml">Response</a></i>
<li>Case: function:base64Binary-is-in
<i><a href="IIC148Request.xml">Request</a>,<a href="IIC148Policy.xml">Policy</a>,<a href="IIC148Response.xml">Response</a></i>
<li>Case: function:base64Binary-bag
<i><a href="IIC149Request.xml">Request</a>,<a href="IIC149Policy.xml">Policy</a>,<a href="IIC149Response.xml">Response</a></i>
<li>Case: function:dayTimeDuration-one-and-only
<i><a href="IIC150Request.xml">Request</a>,<a href="IIC150Policy.xml">Policy</a>,<a href="IIC150Response.xml">Response</a></i>
<li>Case: function:dayTimeDuration-bag-size
<i><a href="IIC151Request.xml">Request</a>,<a href="IIC151Policy.xml">Policy</a>,<a href="IIC151Response.xml">Response</a></i>
<li>Case: function:dayTimeDuration-is-in
<i><a href="IIC152Request.xml">Request</a>,<a href="IIC152Policy.xml">Policy</a>,<a href="IIC152Response.xml">Response</a></i>
<li>Case: function:dayTimeDuration-bag
<i><a href="IIC153Request.xml">Request</a>,<a href="IIC153Policy.xml">Policy</a>,<a href="IIC153Response.xml">Response</a></i>
<li>Case: function:yearMonthDuration-one-and-only
<i><a href="IIC154Request.xml">Request</a>,<a href="IIC154Policy.xml">Policy</a>,<a href="IIC154Response.xml">Response</a></i>
<li>Case: function:yearMonthDuration-bag-size
<i><a href="IIC155Request.xml">Request</a>,<a href="IIC155Policy.xml">Policy</a>,<a href="IIC155Response.xml">Response</a></i>
<li>Case: function:yearMonthDuration-is-in
<i><a href="IIC156Request.xml">Request</a>,<a href="IIC156Policy.xml">Policy</a>,<a href="IIC156Response.xml">Response</a></i>
<li>Case: function:yearMonthDuration-bag
<i><a href="IIC157Request.xml">Request</a>,<a href="IIC157Policy.xml">Policy</a>,<a href="IIC157Response.xml">Response</a></i>
<li>Case: function:x500Name-bag-size
<i><a href="IIC158Request.xml">Request</a>,<a href="IIC158Policy.xml">Policy</a>,<a href="IIC158Response.xml">Response</a></i>
<li>Case: function:x500Name-is-in
<i><a href="IIC159Request.xml">Request</a>,<a href="IIC159Policy.xml">Policy</a>,<a href="IIC159Response.xml">Response</a></i>
<li>Case: function:x500Name-bag
<i><a href="IIC160Request.xml">Request</a>,<a href="IIC160Policy.xml">Policy</a>,<a href="IIC160Response.xml">Response</a></i>
<li>Case: function:rfc822Name-bag-size
<i><a href="IIC161Request.xml">Request</a>,<a href="IIC161Policy.xml">Policy</a>,<a href="IIC161Response.xml">Response</a></i>
<li>Case: function:rfc822Name-is-in
<i><a href="IIC162Request.xml">Request</a>,<a href="IIC162Policy.xml">Policy</a>,<a href="IIC162Response.xml">Response</a></i>
<li>Case: function:rfc822Name-bag
<i><a href="IIC163Request.xml">Request</a>,<a href="IIC163Policy.xml">Policy</a>,<a href="IIC163Response.xml">Response</a></i>
<p>
<b>HIGHER-ORDER BAG FUNCTIONS</b>
<li>Case: function:any-of
<i><a href="IIC164Request.xml">Request</a>,<a href="IIC164Policy.xml">Policy</a>,<a href="IIC164Response.xml">Response</a></i>
<li>Case: function:all-of
<i><a href="IIC165Request.xml">Request</a>,<a href="IIC165Policy.xml">Policy</a>,<a href="IIC165Response.xml">Response</a></i>
<li>Case: function:any-of-any
<i><a href="IIC166Request.xml">Request</a>,<a href="IIC166Policy.xml">Policy</a>,<a href="IIC166Response.xml">Response</a></i>
<li>Case: function:all-of-any
<i><a href="IIC167Request.xml">Request</a>,<a href="IIC167Policy.xml">Policy</a>,<a href="IIC167Response.xml">Response</a></i>
<li>Case: function:any-of-all
<i><a href="IIC168Request.xml">Request</a>,<a href="IIC168Policy.xml">Policy</a>,<a href="IIC168Response.xml">Response</a></i>
<li>Case: function:all-of-all
<i><a href="IIC169Request.xml">Request</a>,<a href="IIC169Policy.xml">Policy</a>,<a href="IIC169Response.xml">Response</a></i>
<li>Case: function:map
<i><a href="IIC170Request.xml">Request</a>,<a href="IIC170Policy.xml">Policy</a>,<a href="IIC170Response.xml">Response</a></i>
<p>
<b>SET FUNCTIONS</b>
<li>Case: function:string-intersection
<i><a href="IIC171Request.xml">Request</a>,<a href="IIC171Policy.xml">Policy</a>,<a href="IIC171Response.xml">Response</a></i>
<li>Case: function:string-at-least-one-member-of
<i><a href="IIC172Request.xml">Request</a>,<a href="IIC172Policy.xml">Policy</a>,<a href="IIC172Response.xml">Response</a></i>
<li>Case: function:string-union
<i><a href="IIC173Request.xml">Request</a>,<a href="IIC173Policy.xml">Policy</a>,<a href="IIC173Response.xml">Response</a></i>
<li>Case: function:string-subset
<i><a href="IIC174Request.xml">Request</a>,<a href="IIC174Policy.xml">Policy</a>,<a href="IIC174Response.xml">Response</a></i>
<li>Case: function:string-set-equals
<i><a href="IIC175Request.xml">Request</a>,<a href="IIC175Policy.xml">Policy</a>,<a href="IIC175Response.xml">Response</a></i>
<li>Case: function:boolean-intersection
<i><a href="IIC176Request.xml">Request</a>,<a href="IIC176Policy.xml">Policy</a>,<a href="IIC176Response.xml">Response</a></i>
<li>Case: function:boolean-at-least-one-member-of
<i><a href="IIC177Request.xml">Request</a>,<a href="IIC177Policy.xml">Policy</a>,<a href="IIC177Response.xml">Response</a></i>
<li>Case: function:boolean-union
<i><a href="IIC178Request.xml">Request</a>,<a href="IIC178Policy.xml">Policy</a>,<a href="IIC178Response.xml">Response</a></i>
<li>Case: function:boolean-subset
<i><a href="IIC179Request.xml">Request</a>,<a href="IIC179Policy.xml">Policy</a>,<a href="IIC179Response.xml">Response</a></i>
<li>Case: function:boolean-set-equals
<i><a href="IIC180Request.xml">Request</a>,<a href="IIC180Policy.xml">Policy</a>,<a href="IIC180Response.xml">Response</a></i>
<li>Case: function:integer-intersection
<i><a href="IIC181Request.xml">Request</a>,<a href="IIC181Policy.xml">Policy</a>,<a href="IIC181Response.xml">Response</a></i>
<li>Case: function:integer-at-least-one-member-of
<i><a href="IIC182Request.xml">Request</a>,<a href="IIC182Policy.xml">Policy</a>,<a href="IIC182Response.xml">Response</a></i>
<li>Case: function:integer-union
<i><a href="IIC183Request.xml">Request</a>,<a href="IIC183Policy.xml">Policy</a>,<a href="IIC183Response.xml">Response</a></i>
<li>Case: function:integer-subset
<i><a href="IIC184Request.xml">Request</a>,<a href="IIC184Policy.xml">Policy</a>,<a href="IIC184Response.xml">Response</a></i>
<li>Case: function:integer-set-equals
<i><a href="IIC185Request.xml">Request</a>,<a href="IIC185Policy.xml">Policy</a>,<a href="IIC185Response.xml">Response</a></i>
<li>Case: function:double-intersection
<i><a href="IIC186Request.xml">Request</a>,<a href="IIC186Policy.xml">Policy</a>,<a href="IIC186Response.xml">Response</a></i>
<li>Case: function:double-at-least-one-member-of
<i><a href="IIC187Request.xml">Request</a>,<a href="IIC187Policy.xml">Policy</a>,<a href="IIC187Response.xml">Response</a></i>
<li>Case: function:double-union
<i><a href="IIC188Request.xml">Request</a>,<a href="IIC188Policy.xml">Policy</a>,<a href="IIC188Response.xml">Response</a></i>
<li>Case: function:double-subset
<i><a href="IIC189Request.xml">Request</a>,<a href="IIC189Policy.xml">Policy</a>,<a href="IIC189Response.xml">Response</a></i>
<li>Case: function:double-set-equals
<i><a href="IIC190Request.xml">Request</a>,<a href="IIC190Policy.xml">Policy</a>,<a href="IIC190Response.xml">Response</a></i>
<li>Case: function:date-intersection
<i><a href="IIC191Request.xml">Request</a>,<a href="IIC191Policy.xml">Policy</a>,<a href="IIC191Response.xml">Response</a></i>
<li>Case: function:date-at-least-one-member-of
<i><a href="IIC192Request.xml">Request</a>,<a href="IIC192Policy.xml">Policy</a>,<a href="IIC192Response.xml">Response</a></i>
<li>Case: function:date-union
<i><a href="IIC193Request.xml">Request</a>,<a href="IIC193Policy.xml">Policy</a>,<a href="IIC193Response.xml">Response</a></i>
<li>Case: function:date-subset
<i><a href="IIC194Request.xml">Request</a>,<a href="IIC194Policy.xml">Policy</a>,<a href="IIC194Response.xml">Response</a></i>
<li>Case: function:date-set-equals
<i><a href="IIC195Request.xml">Request</a>,<a href="IIC195Policy.xml">Policy</a>,<a href="IIC195Response.xml">Response</a></i>
<li>Case: function:time-intersection
<i><a href="IIC196Request.xml">Request</a>,<a href="IIC196Policy.xml">Policy</a>,<a href="IIC196Response.xml">Response</a></i>
<li>Case: function:time-at-least-one-member-of
<i><a href="IIC197Request.xml">Request</a>,<a href="IIC197Policy.xml">Policy</a>,<a href="IIC197Response.xml">Response</a></i>
<li>Case: function:time-union
<i><a href="IIC198Request.xml">Request</a>,<a href="IIC198Policy.xml">Policy</a>,<a href="IIC198Response.xml">Response</a></i>
<li>Case: function:time-subset
<i><a href="IIC199Request.xml">Request</a>,<a href="IIC199Policy.xml">Policy</a>,<a href="IIC199Response.xml">Response</a></i>
<li>Case: function:time-set-equals
<i><a href="IIC200Request.xml">Request</a>,<a href="IIC200Policy.xml">Policy</a>,<a href="IIC200Response.xml">Response</a></i>
<li>Case: function:dateTime-intersection
<i><a href="IIC201Request.xml">Request</a>,<a href="IIC201Policy.xml">Policy</a>,<a href="IIC201Response.xml">Response</a></i>
<li>Case: function:dateTime-at-least-one-member-of
<i><a href="IIC202Request.xml">Request</a>,<a href="IIC202Policy.xml">Policy</a>,<a href="IIC202Response.xml">Response</a></i>
<li>Case: function:dateTime-union
<i><a href="IIC203Request.xml">Request</a>,<a href="IIC203Policy.xml">Policy</a>,<a href="IIC203Response.xml">Response</a></i>
<li>Case: function:dateTime-subset
<i><a href="IIC204Request.xml">Request</a>,<a href="IIC204Policy.xml">Policy</a>,<a href="IIC204Response.xml">Response</a></i>
<li>Case: function:dateTime-set-equals
<i><a href="IIC205Request.xml">Request</a>,<a href="IIC205Policy.xml">Policy</a>,<a href="IIC205Response.xml">Response</a></i>
<li>Case: function:anyURI-intersection
<i><a href="IIC206Request.xml">Request</a>,<a href="IIC206Policy.xml">Policy</a>,<a href="IIC206Response.xml">Response</a></i>
<li>Case: function:anyURI-at-least-one-member-of
<i><a href="IIC207Request.xml">Request</a>,<a href="IIC207Policy.xml">Policy</a>,<a href="IIC207Response.xml">Response</a></i>
<li>Case: function:anyURI-union
<i><a href="IIC208Request.xml">Request</a>,<a href="IIC208Policy.xml">Policy</a>,<a href="IIC208Response.xml">Response</a></i>
<li>Case: function:anyURI-subset
<i><a href="IIC209Request.xml">Request</a>,<a href="IIC209Policy.xml">Policy</a>,<a href="IIC209Response.xml">Response</a></i>
<li>Case: function:anyURI-set-equals
<i><a href="IIC210Request.xml">Request</a>,<a href="IIC210Policy.xml">Policy</a>,<a href="IIC210Response.xml">Response</a></i>
<li>Case: function:x500Name-intersection
<i><a href="IIC211Request.xml">Request</a>,<a href="IIC211Policy.xml">Policy</a>,<a href="IIC211Response.xml">Response</a></i>
<li>Case: function:x500Name-at-least-one-member-of
<i><a href="IIC212Request.xml">Request</a>,<a href="IIC212Policy.xml">Policy</a>,<a href="IIC212Response.xml">Response</a></i>
<li>Case: function:x500Name-union
<i><a href="IIC213Request.xml">Request</a>,<a href="IIC213Policy.xml">Policy</a>,<a href="IIC213Response.xml">Response</a></i>
<li>Case: function:x500Name-subset
<i><a href="IIC214Request.xml">Request</a>,<a href="IIC214Policy.xml">Policy</a>,<a href="IIC214Response.xml">Response</a></i>
<li>Case: function:x500Name-set-equals
<i><a href="IIC215Request.xml">Request</a>,<a href="IIC215Policy.xml">Policy</a>,<a href="IIC215Response.xml">Response</a></i>
<li>Case: function:rfc822Name-intersection
<i><a href="IIC216Request.xml">Request</a>,<a href="IIC216Policy.xml">Policy</a>,<a href="IIC216Response.xml">Response</a></i>
<li>Case: function:rfc822Name-at-least-one-member-of
<i><a href="IIC217Request.xml">Request</a>,<a href="IIC217Policy.xml">Policy</a>,<a href="IIC217Response.xml">Response</a></i>
<li>Case: function:rfc822Name-union
<i><a href="IIC218Request.xml">Request</a>,<a href="IIC218Policy.xml">Policy</a>,<a href="IIC218Response.xml">Response</a></i>
<li>Case: function:rfc822Name-subset
<i><a href="IIC219Request.xml">Request</a>,<a href="IIC219Policy.xml">Policy</a>,<a href="IIC219Response.xml">Response</a></i>
<li>Case: function:rfc822Name-set-equals
<i><a href="IIC220Request.xml">Request</a>,<a href="IIC220Policy.xml">Policy</a>,<a href="IIC220Response.xml">Response</a></i>
<li>Case: function:hexBinary-intersection
<i><a href="IIC221Request.xml">Request</a>,<a href="IIC221Policy.xml">Policy</a>,<a href="IIC221Response.xml">Response</a></i>
<li>Case: function:hexBinary-at-least-one-member-of
<i><a href="IIC222Request.xml">Request</a>,<a href="IIC222Policy.xml">Policy</a>,<a href="IIC222Response.xml">Response</a></i>
<li>Case: function:hexBinary-union
<i><a href="IIC223Request.xml">Request</a>,<a href="IIC223Policy.xml">Policy</a>,<a href="IIC223Response.xml">Response</a></i>
<li>Case: function:hexBinary-subset
<i><a href="IIC224Request.xml">Request</a>,<a href="IIC224Policy.xml">Policy</a>,<a href="IIC224Response.xml">Response</a></i>
<li>Case: function:hexBinary-set-equals
<i><a href="IIC225Request.xml">Request</a>,<a href="IIC225Policy.xml">Policy</a>,<a href="IIC225Response.xml">Response</a></i>
<li>Case: function:base64Binary-intersection
<i><a href="IIC226Request.xml">Request</a>,<a href="IIC226Policy.xml">Policy</a>,<a href="IIC226Response.xml">Response</a></i>
<li>Case: function:base64Binary-at-least-one-member-of
<i><a href="IIC227Request.xml">Request</a>,<a href="IIC227Policy.xml">Policy</a>,<a href="IIC227Response.xml">Response</a></i>
<li>Case: function:base64Binary-union
<i><a href="IIC228Request.xml">Request</a>,<a href="IIC228Policy.xml">Policy</a>,<a href="IIC228Response.xml">Response</a></i>
<li>Case: function:base64Binary-subset
<i><a href="IIC229Request.xml">Request</a>,<a href="IIC229Policy.xml">Policy</a>,<a href="IIC229Response.xml">Response</a></i>
<li>Case: function:base64Binary-set-equals
<i><a href="IIC230Request.xml">Request</a>,<a
href="IIC230Policy.xml">Policy</a>,<a
href="IIC230Response.xml">Response</a></i>
<p>
<b><a name="DURATION-EQUALS TESTS">DURATION-EQUALS TESTS</a></b>
<p>
<li>Case: function:dayTimeDuration-equals<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Anne Anderson <Anne.Anderson@Sun.COM>. Added to this
test suite 27 February 2003.<br>
<i><a href="IIC231Request.xml">Request</a>,<a
href="IIC231Policy.xml">Policy</a>,<a
href="IIC231Response.xml">Response</a></i>
<li>Case: function:yearMonthDuration-equals<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Anne Anderson <Anne.Anderson@Sun.COM>. Added to this
test suite 27 February 2003.<br>
<i><a href="IIC232Request.xml">Request</a>,<a
href="IIC232Policy.xml">Policy</a>,<a
href="IIC232Response.xml">Response</a></i>
</ol>
<P>
Tests for Release 3.0 functionality.
<p>
<ol start=300>
<li>Case: FunctionEvaluation: string-starts-with - true<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC300Request.xml">Request</a>,<a href="IIC300Policy.xml">Policy</a>,<a href="IIC300Response.xml">Response</a></i>
<li>Case: FunctionEvaluation: string-starts-with - false<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC301Request.xml">Request</a>,<a href="IIC301Policy.xml">Policy</a>,<a href="IIC301Response.xml">Response</a></i>
<li>Case: FunctionEvaluation: anyURI-starts-with - true<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC302Request.xml">Request</a>,<a href="IIC302Policy.xml">Policy</a>,<a href="IIC302Response.xml">Response</a></i>
<li>Case: FunctionEvaluation: anyURI-starts-with - false<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC303Request.xml">Request</a>,<a href="IIC303Policy.xml">Policy</a>,<a href="IIC303Response.xml">Response</a></i>
</ol>
<ol start=310>
<li>Case: FunctionEvaluation: string-ends-with - true<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC310Request.xml">Request</a>,<a href="IIC310Policy.xml">Policy</a>,<a href="IIC310Response.xml">Response</a></i>
<li>Case: FunctionEvaluation: string-ends-with - false<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC311Request.xml">Request</a>,<a href="IIC311Policy.xml">Policy</a>,<a href="IIC311Response.xml">Response</a></i>
<li>Case: FunctionEvaluation: anyURI-ends-with - true<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC312Request.xml">Request</a>,<a href="IIC312Policy.xml">Policy</a>,<a href="IIC312Response.xml">Response</a></i>
<li>Case: FunctionEvaluation: anyURI-ends-with - false<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC313Request.xml">Request</a>,<a href="IIC313Policy.xml">Policy</a>,<a href="IIC313Response.xml">Response</a></i>
</ol>
<ol start=320>
<li>Case: FunctionEvaluation: string-contains - true<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC320Request.xml">Request</a>,<a href="IIC320Policy.xml">Policy</a>,<a href="IIC320Response.xml">Response</a></i>
<li>Case: FunctionEvaluation: string-contains - false<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC321Request.xml">Request</a>,<a href="IIC321Policy.xml">Policy</a>,<a href="IIC321Response.xml">Response</a></i>
<li>Case: FunctionEvaluation: anyURI-contains - true<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC322Request.xml">Request</a>,<a href="IIC322Policy.xml">Policy</a>,<a href="IIC322Response.xml">Response</a></i>
<li>Case: FunctionEvaluation: anyURI-contains - false<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC323Request.xml">Request</a>,<a href="IIC323Policy.xml">Policy</a>,<a href="IIC323Response.xml">Response</a></i>
</ol>
<ol start=330>
<li>Case: FunctionEvaluation: string-substring - take section in middle of string<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC330Request.xml">Request</a>,<a href="IIC330Policy.xml">Policy</a>,<a href="IIC330Response.xml">Response</a></i>
<li>Case: FunctionEvaluation: string-substring - take section from middle to end of string<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC331Request.xml">Request</a>,<a href="IIC331Policy.xml">Policy</a>,<a href="IIC331Response.xml">Response</a></i>
<li>Case: FunctionEvaluation: string-substring - bad start location<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC332Request.xml">Request</a>,<a href="IIC332Policy.xml">Policy</a>,<a href="IIC332Response.xml">Response</a></i>
<li>Case: FunctionEvaluation: anuURI-substring - take section in middle of URI<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC333Request.xml">Request</a>,<a href="IIC333Policy.xml">Policy</a>,<a href="IIC333Response.xml">Response</a></i>
<li>Case: FunctionEvaluation: anuURI-substring - take section from middle to end of URI<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC334Request.xml">Request</a>,<a href="IIC334Policy.xml">Policy</a>,<a href="IIC334Response.xml">Response</a></i>
<li>Case: FunctionEvaluation: anuURI-substring - bad start location<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC335Request.xml">Request</a>,<a href="IIC335Policy.xml">Policy</a>,<a href="IIC335Response.xml">Response</a></i>
</ol>
<ol start=340>
<li>Case: Function Evaluation - Set Functions: dayTimeDuration-intersection<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC340Request.xml">Request</a>,<a href="IIC340Policy.xml">Policy</a>,<a href="IIC340Response.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: dayTimeDuration-at-least-one-member-of<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC341Request.xml">Request</a>,<a href="IIC341Policy.xml">Policy</a>,<a href="IIC341Response.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: dayTimeDuration-union<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC342Request.xml">Request</a>,<a href="IIC342Policy.xml">Policy</a>,<a href="IIC342Response.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: dayTimeDuration-subset<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC343Request.xml">Request</a>,<a href="IIC343Policy.xml">Policy</a>,<a href="IIC343Response.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: dayTimeDuration-set-equals<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC344Request.xml">Request</a>,<a href="IIC344Policy.xml">Policy</a>,<a href="IIC344Response.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: yearMonthDuration-intersection<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC345Request.xml">Request</a>,<a href="IIC345Policy.xml">Policy</a>,<a href="IIC345Response.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: yearMonthDuration-at-least-one-member-of<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC346Request.xml">Request</a>,<a href="IIC346Policy.xml">Policy</a>,<a href="IIC346Response.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: yearMonthDuration-union<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC347Request.xml">Request</a>,<a href="IIC347Policy.xml">Policy</a>,<a href="IIC347Response.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: yearMonthDuration-subset<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC348Request.xml">Request</a>,<a href="IIC348Policy.xml">Policy</a>,<a href="IIC348Response.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: dayTimeDuration-subset<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC349Request.xml">Request</a>,<a href="IIC349Policy.xml">Policy</a>,<a href="IIC349Response.xml">Response</a></i>
<li>Case: Test that special value NaN for data type double is handled by both Policy and Request.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC350Request.xml">Request</a>,<a href="IIC350Policy.xml">Policy</a>,<a href="IIC350Response.xml">Response</a></i>
<li>Case: Test that special value INF for data type double is handled by Policy and Request.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC351Request.xml">Request</a>,<a href="IIC351Policy.xml">Policy</a>,<a href="IIC351Response.xml">Response</a></i>
<li>Case: Test that special value -INF for data type double is handled by Policy and Request.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC352Request.xml">Request</a>,<a href="IIC352Policy.xml">Policy</a>,<a href="IIC352Response.xml">Response</a></i>
<li>Case: Test that special value NaN is not the same as special value INF.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC353Request.xml">Request</a>,<a href="IIC353Policy.xml">Policy</a>,<a href="IIC353Response.xml">Response</a></i>
<li>Case: Test that special value NaN is not the same as special value INF<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC354Request.xml">Request</a>,<a href="IIC354Policy.xml">Policy</a>,<a href="IIC354Response.xml">Response</a></i>
<li>Case: Test that special value NaN is not the same as special value INF<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC355Request.xml">Request</a>,<a href="IIC355Policy.xml">Policy</a>,<a href="IIC355Response.xml">Response</a></i>
<li>Case: Test that a numeric value is less than special value INF<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC356Request.xml">Request</a>,<a href="IIC356Policy.xml">Policy</a>,<a href="IIC356Response.xml">Response</a></i>
<li>Case: Test that a numeric value is less than special value INF<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC357Request.xml">Request</a>,<a href="IIC357Policy.xml">Policy</a>,<a href="IIC357Response.xml">Response</a></i>
<li>Case: Arithmetic on NaN returns NaN.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC358Request.xml">Request</a>,<a href="IIC358Policy.xml">Policy</a>,<a href="IIC358Response.xml">Response</a></i>
<li>Case: Arithmetic on INF returns INF.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIC359Request.xml">Request</a>,<a href="IIC359Policy.xml">Policy</a>,<a href="IIC359Response.xml">Response</a></i>
</ol>
<h3><li><a name="Combining Algorithms"> Combining Algorithms </a></h3>
These tests exercise each of the mandatory Combining
Algorithms.<p>
<ol>
<li>Case: Permit: RuleCombiningAlgorithm DenyOverrides
<i><a href="IID001Request.xml">Request</a>,<a href="IID001Policy.xml">Policy</a>,<a href="IID001Response.xml">Response</a></i>
<li>Case: Deny: RuleCombiningAlgorithm DenyOverrides
<i><a href="IID002Request.xml">Request</a>,<a href="IID002Policy.xml">Policy</a>,<a href="IID002Response.xml">Response</a></i>
<li>Case: NotApplicable: RuleCombiningAlgorithm DenyOverrides
<i><a href="IID003Request.xml">Request</a>,<a href="IID003Policy.xml">Policy</a>,<a href="IID003Response.xml">Response</a></i>
<li>Case: Indeterminate: RuleCombiningAlgorithm DenyOverrides
<i><a href="IID004Request.xml">Request</a>,<a href="IID004Policy.xml">Policy</a>,<a href="IID004Response.xml">Response</a></i>
<li>Case: Permit: PolicyCombiningAlgorithm DenyOverrides
<i><a href="IID005Request.xml">Request</a>,<a href="IID005Policy.xml">Policy</a>,<a href="IID005Response.xml">Response</a></i>
<li>Case: Deny: PolicyCombiningAlgorithm DenyOverrides
<i><a href="IID006Request.xml">Request</a>,<a href="IID006Policy.xml">Policy</a>,<a href="IID006Response.xml">Response</a></i>
<li>Case: NotApplicable: PolicyCombiningAlgorithm DenyOverrides
<i><a href="IID007Request.xml">Request</a>,<a href="IID007Policy.xml">Policy</a>,<a href="IID007Response.xml">Response</a></i>
<li>Case: Another Deny (can't return Indeterminate): PolicyCombiningAlgorithm DenyOverrides
<i><a href="IID008Request.xml">Request</a>,<a href="IID008Policy.xml">Policy</a>,<a href="IID008Response.xml">Response</a></i>
<li>Case: Permit: RuleCombiningAlgorithm PermitOverrides
<i><a href="IID009Request.xml">Request</a>,<a href="IID009Policy.xml">Policy</a>,<a href="IID009Response.xml">Response</a></i>
<li>Case: Deny: RuleCombiningAlgorithm PermitOverrides
<i><a href="IID010Request.xml">Request</a>,<a href="IID010Policy.xml">Policy</a>,<a href="IID010Response.xml">Response</a></i>
<li>Case: NotApplicable: RuleCombiningAlgorithm PermitOverrides
<i><a href="IID011Request.xml">Request</a>,<a href="IID011Policy.xml">Policy</a>,<a href="IID011Response.xml">Response</a></i>
<li>Case: Indeterminate: RuleCombiningAlgorithm PermitOverrides
<i><a href="IID012Request.xml">Request</a>,<a href="IID012Policy.xml">Policy</a>,<a href="IID012Response.xml">Response</a></i>
<li>Case: Permit: PolicyCombiningAlgorithm PermitOverrides
<i><a href="IID013Request.xml">Request</a>,<a href="IID013Policy.xml">Policy</a>,<a href="IID013Response.xml">Response</a></i>
<li>Case: Deny: PolicyCombiningAlgorithm PermitOverrides
<i><a href="IID014Request.xml">Request</a>,<a href="IID014Policy.xml">Policy</a>,<a href="IID014Response.xml">Response</a></i>
<li>Case: NotApplicable: PolicyCombiningAlgorithm PermitOverrides
<i><a href="IID015Request.xml">Request</a>,<a href="IID015Policy.xml">Policy</a>,<a href="IID015Response.xml">Response</a></i>
<li>Case: Indeterminate: PolicyCombiningAlgorithm PermitOverrides
<i><a href="IID016Request.xml">Request</a>,<a href="IID016Policy.xml">Policy</a>,<a href="IID016Response.xml">Response</a></i>
<li>Case: Permit: RuleCombiningAlgorithm FirstApplicable
<i><a href="IID017Request.xml">Request</a>,<a href="IID017Policy.xml">Policy</a>,<a href="IID017Response.xml">Response</a></i>
<li>Case: Deny: RuleCombiningAlgorithm FirstApplicable
<i><a href="IID018Request.xml">Request</a>,<a href="IID018Policy.xml">Policy</a>,<a href="IID018Response.xml">Response</a></i>
<li>Case: NotApplicable: RuleCombiningAlgorithm FirstApplicable
<i><a href="IID019Request.xml">Request</a>,<a href="IID019Policy.xml">Policy</a>,<a href="IID019Response.xml">Response</a></i>
<li>Case: Indeterminate: RuleCombiningAlgorithm FirstApplicable
<i><a href="IID020Request.xml">Request</a>,<a href="IID020Policy.xml">Policy</a>,<a href="IID020Response.xml">Response</a></i>
<li>Case: Permit: PolicyCombiningAlgorithm FirstApplicable
<i><a href="IID021Request.xml">Request</a>,<a href="IID021Policy.xml">Policy</a>,<a href="IID021Response.xml">Response</a></i>
<li>Case: Deny: PolicyCombiningAlgorithm FirstApplicable
<i><a href="IID022Request.xml">Request</a>,<a href="IID022Policy.xml">Policy</a>,<a href="IID022Response.xml">Response</a></i>
<li>Case: NotApplicable: PolicyCombiningAlgorithm FirstApplicable
<i><a href="IID023Request.xml">Request</a>,<a href="IID023Policy.xml">Policy</a>,<a href="IID023Response.xml">Response</a></i>
<li>Case: Indeterminate: PolicyCombiningAlgorithm FirstApplicable
<i><a href="IID024Request.xml">Request</a>,<a href="IID024Policy.xml">Policy</a>,<a href="IID024Response.xml">Response</a></i>
<li>Case: Permit: PolicyCombiningAlgorithm OnlyOneApplicablePolicy
<i><a href="IID025Request.xml">Request</a>,<a href="IID025Policy.xml">Policy</a>,<a href="IID025Response.xml">Response</a></i>
<li>Case: Deny: PolicyCombiningAlgorithm OnlyOneApplicablePolicy
<i><a href="IID026Request.xml">Request</a>,<a href="IID026Policy.xml">Policy</a>,<a href="IID026Response.xml">Response</a></i>
<li>Case: NotApplicable: PolicyCombiningAlgorithm OnlyOneApplicablePolicy
<i><a href="IID027Request.xml">Request</a>,<a href="IID027Policy.xml">Policy</a>,<a href="IID027Response.xml">Response</a></i>
<li>Case: Indeterminate: PolicyCombiningAlgorithm OnlyOneApplicablePolicy
<i><a href="IID028Request.xml">Request</a>,<a href="IID028Policy.xml">Policy</a>,<a href="IID028Response.xml">Response</a></i>
<li>Case: Permit: Multiple initial policies, but only one applies
<i><a href="IID029Request.xml">Request</a>,
<a href="IID029Policy1.xml">Policy1</a>,
<a href="IID029Policy2.xml">Policy2</a>,
<a href="IID029Response.xml">Response</a>,
<a href="IID029Special.txt">Special Instructions</a></i>
<li>Case: Indeterminate: Multiple initial policies, more than one
applies
<i><a href="IID030Request.xml">Request</a>,
<a href="IID030Policy1.xml">Policy1</a>,
<a href="IID030Policy2.xml">Policy2</a>,
<a href="IID030Response.xml">Response</a>,
<a href="IID030Special.txt">Special Instructions</a></i>
</ol>
<P>
Tests for Release 3.0 functionality.
<p>
<ol start=300>
<li>Case: Response from 3.0 Policy-level permit-overrides should differ from 1.0 response for rules that return:
NOTAPPLICABLE, NOTAPPLICABLE, INDETERMINATE, DENY<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID300Request.xml">Request</a>,<a href="IID300Policy.xml">Policy</a>,<a href="IID300Response.xml">Response</a></i>
<li>Case: Permit: RuleCombiningAlgorithm Ordered DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID301Request.xml">Request</a>,<a href="IID301Policy.xml">Policy</a>,<a href="IID301Response.xml">Response</a></i>
<li>Case: Deny: RuleCombiningAlgorithm Ordered DenyOverrides
Also tests Dynamic Expressions in Obligations and Advice attached to Rules<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID302Request.xml">Request</a>,<a href="IID302Policy.xml">Policy</a>,<a href="IID302Response.xml">Response</a></i>
<li>Case: Deny: RuleCombiningAlgorithm Ordered DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID303Request.xml">Request</a>,<a href="IID303Policy.xml">Policy</a>,<a href="IID303Response.xml">Response</a></i>
<li>Case: NotApplicable: RuleCombiningAlgorithm Ordered DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID304Request.xml">Request</a>,<a href="IID304Policy.xml">Policy</a>,<a href="IID304Response.xml">Response</a></i>
<li>Case: Indeterminate: RuleCombiningAlgorithm DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID305Request.xml">Request</a>,<a href="IID305Policy.xml">Policy</a>,<a href="IID305Response.xml">Response</a></i>
<li>Case: Permit: PolicyCombiningAlgorithm Ordered DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID306Request.xml">Request</a>,<a href="IID306Policy.xml">Policy</a>,<a href="IID306Response.xml">Response</a></i>
<li>Case: Deny: PolicyCombiningAlgorithm DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID307Request.xml">Request</a>,<a href="IID307Policy.xml">Policy</a>,<a href="IID307Response.xml">Response</a></i>
<li>Case: Deny: PolicyCombiningAlgorithm Ordered DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID308Request.xml">Request</a>,<a href="IID308Policy.xml">Policy</a>,<a href="IID308Response.xml">Response</a></i>
<li>Case: NotApplicable: PolicyCombiningAlgorithm Ordered DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID309Request.xml">Request</a>,<a href="IID309Policy.xml">Policy</a>,<a href="IID309Response.xml">Response</a></i>
<li>Case: Another Deny (can't return Indeterminate): PolicyCombiningAlgorithm Ordered DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID310Request.xml">Request</a>,<a href="IID310Policy.xml">Policy</a>,<a href="IID310Response.xml">Response</a></i>
<li>Case: Permit: RuleCombiningAlgorithm Ordered PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID311Request.xml">Request</a>,<a href="IID311Policy.xml">Policy</a>,<a href="IID311Response.xml">Response</a></i>
<li>Case: Permit: RuleCombiningAlgorithm Ordered PermitOverrides
Also tests Dynamic Expressions in Obligations and Advice attached to Rules<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID312Request.xml">Request</a>,<a href="IID312Policy.xml">Policy</a>,<a href="IID312Response.xml">Response</a></i>
<li>Case: Deny: RuleCombiningAlgorithm Ordered PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID313Request.xml">Request</a>,<a href="IID313Policy.xml">Policy</a>,<a href="IID313Response.xml">Response</a></i>
<li>Case: Deny: RuleCombiningAlgorithm Ordered PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID314Request.xml">Request</a>,<a href="IID314Policy.xml">Policy</a>,<a href="IID314Response.xml">Response</a></i>
<li>Case: Indeterminate: RuleCombiningAlgorithm Ordered PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID315Request.xml">Request</a>,<a href="IID315Policy.xml">Policy</a>,<a href="IID315Response.xml">Response</a></i>
<li>Case: Permit: PolicyCombiningAlgorithm Ordered PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID316Request.xml">Request</a>,<a href="IID316Policy.xml">Policy</a>,<a href="IID316Response.xml">Response</a></i>
<li>Case: Permit: PolicyCombiningAlgorithm Ordered PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID317Request.xml">Request</a>,<a href="IID317Policy.xml">Policy</a>,<a href="IID317Response.xml">Response</a></i>
<li>Case: Deny: PolicyCombiningAlgorithm Ordered PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID318Request.xml">Request</a>,<a href="IID318Policy.xml">Policy</a>,<a href="IID318Response.xml">Response</a></i>
<li>Case: NotApplicable: PolicyCombiningAlgorithm Ordered PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID319Request.xml">Request</a>,<a href="IID319Policy.xml">Policy</a>,<a href="IID319Response.xml">Response</a></i>
<li>Case: Indeterminate: PolicyCombiningAlgorithm Ordered PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID320Request.xml">Request</a>,<a href="IID320Policy.xml">Policy</a>,<a href="IID320Response.xml">Response</a></i>
</ol>
<ol start=330>
<li>Case: Combining Algorithms: Policy-level deny-unless-permit without permit<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID330Request.xml">Request</a>,<a href="IID330Policy.xml">Policy</a>,<a href="IID330Response.xml">Response</a></i>
<li>Case: Combining Algorithms: Policy-level deny-unless-permit with permit after deny<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID331Request.xml">Request</a>,<a href="IID331Policy.xml">Policy</a>,<a href="IID331Response.xml">Response</a></i>
<li>Case: Combining Algorithms: Rule-level deny-unless-permit without permit<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID332Request.xml">Request</a>,<a href="IID332Policy.xml">Policy</a>,<a href="IID332Response.xml">Response</a></i>
<li>Case: Combining Algorithms: Rule-level deny-unless-permit with permit after deny<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID333Request.xml">Request</a>,<a href="IID333Policy.xml">Policy</a>,<a href="IID333Response.xml">Response</a></i>
</ol>
<ol start=340>
<li>Case: Combining Algorithms: Policy-level permit-unless-deny without deny<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID340Request.xml">Request</a>,<a href="IID340Policy.xml">Policy</a>,<a href="IID340Response.xml">Response</a></i>
<li>Case: Combining Algorithms: Policy-level permit-unless-deny with deny after permit<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID341Request.xml">Request</a>,<a href="IID341Policy.xml">Policy</a>,<a href="IID341Response.xml">Response</a></i>
<li>Case: Combining Algorithms: Rule-level permit-unless-deny without deny<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID342Request.xml">Request</a>,<a href="IID342Policy.xml">Policy</a>,<a href="IID342Response.xml">Response</a></i>
<li>Case: Combining Algorithms: Rule-level permit-unless-deny with deny after permit<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IID343Request.xml">Request</a>,<a href="IID343Policy.xml">Policy</a>,<a href="IID343Response.xml">Response</a></i>
</ol>
<h3><li><a name="Schema components"> Schema components </a></h3>
This section lists test cases for certain elements of the
schema not exercised by test cases above.<p>
<ol>
<li>Case: policy element PolicySetIdReference
<i><a href="IIE001Request.xml">Request</a>,<a
href="IIE001Policy.xml">Policy</a>,<a
href="IIE001PolicyId1.xml">PolicyId1</a>,<a
href="IIE001PolicySetId1.xml">PolicySetId1</a>,<a
href="IIE001Response.xml">Response</a>,<a
href="IIE001Special.txt">Special Instructions</a></i>
<li>Case: policy element PolicyIdReference
<i><a href="IIE002Request.xml">Request</a>,<a
href="IIE002Policy.xml">Policy</a>,<a
href="IIE002PolicyId1.xml">PolicyId1</a>,<a
href="IIE002PolicySetId1.xml">PolicySetId1</a>,<a
href="IIE002Response.xml">Response</a>,<a
href="IIE002Special.txt">Special Instructions</a></i>
<li>Case: PolicyIdReference to invalid, but non-evaluated, Policy<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Anne Anderson <Anne.Anderson@Sun.COM>. Added to this
test suite 27 February 2003.<br>
<i><a href="IIE003Request.xml">Request</a>,<a
href="IIE003Policy.xml">Policy</a>,<a
href="IIE003PolicyId1.xml">PolicyId1</a>,<a
href="IIE003PolicyId2.xml">PolicyId2</a>,<a
href="IIE003Response.xml">Response</a>,<a
href="IIE003Special.txt">Special Instructions</a></i>
</ol>
<h3><li><a name="Release 3.0 Features"> Release 3.0 Features </a></h3>
This section lists test cases for new features in Release 3.0
not exercised by test cases above.<p>
<ol start=300>
<li>Case: new 3.0 feature: Content node may be on any category, not just Resources<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIF300Request.xml">Request</a>,<a href="IIF300Policy.xml">Policy</a>,<a href="IIF300Response.xml">Response</a></i>
<li>Case: new 3.0 feature: Custom Categories; check they are found in XPaths and in AttributeDesignators<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIF301Request.xml">Request</a>,<a href="IIF301Policy.xml">Policy</a>,<a href="IIF301Response.xml">Response</a></i>
</ol>
<ol start=310>
<li>Case: new 3.0 feature: MaxDelegationDepth on Policy<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIF310Request.xml">Request</a>,<a href="IIF310Policy.xml">Policy</a>,<a href="IIF310Response.xml">Response</a></i>
<li>Case: new 3.0 feature: MaxDelegationDepth on PolicySet<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIF311Request.xml">Request</a>,<a href="IIF311Policy.xml">Policy</a>,<a href="IIF311Response.xml">Response</a></i>
</ol>
</ol>
<hr>
<h2><li><a name="Optional, but Normative Functionality Tests">
Optional, but Normative Functionality Tests </a></h2>
These tests exercise areas of functionality that are not
mandatory-to-implement, but that are normative when implemented.
Submissions of tests for this section are invited.<p>
<ol TYPE=A>
<h3><li><a name="Obligations"> Obligations </a></h3>
<p>
These tests exercise obligations (<a href="IIIASpecial.txt">Special Instructions</a>).
</p>
<ol>
<p>
For rule combining algorithms:
</p>
<li>Case: Permit: RuleCombiningAlgorithm DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA001Request.xml">Request</a>,<a href="IIIA001Policy.xml">Policy</a>,<a href="IIIA001Response.xml">Response</a></i>
<li>Case: Deny: RuleCombiningAlgorithm DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA002Request.xml">Request</a>,<a href="IIIA002Policy.xml">Policy</a>,<a href="IIIA002Response.xml">Response</a></i>
<li>Case: NotApplicable: RuleCombiningAlgorithm DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA003Request.xml">Request</a>,<a href="IIIA003Policy.xml">Policy</a>,<a href="IIIA003Response.xml">Response</a></i>
<li>Case: Indeterminate: RuleCombiningAlgorithm DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA004Request.xml">Request</a>,<a href="IIIA004Policy.xml">Policy</a>,<a href="IIIA004Response.xml">Response</a></i>
<li>Case: Permit: RuleCombiningAlgorithm PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA005Request.xml">Request</a>,<a href="IIIA005Policy.xml">Policy</a>,<a href="IIIA005Response.xml">Response</a></i>
<li>Case: Deny: RuleCombiningAlgorithm PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA006Request.xml">Request</a>,<a href="IIIA006Policy.xml">Policy</a>,<a href="IIIA006Response.xml">Response</a></i>
<li>Case: NotApplicable: RuleCombiningAlgorithm PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA007Request.xml">Request</a>,<a href="IIIA007Policy.xml">Policy</a>,<a href="IIIA007Response.xml">Response</a></i>
<li>Case: Indeterminate: RuleCombiningAlgorithm PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA008Request.xml">Request</a>,<a href="IIIA008Policy.xml">Policy</a>,<a href="IIIA008Response.xml">Response</a></i>
<li>Case: Permit: RuleCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA009Request.xml">Request</a>,<a href="IIIA009Policy.xml">Policy</a>,<a href="IIIA009Response.xml">Response</a></i>
<li>Case: Deny: RuleCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA010Request.xml">Request</a>,<a href="IIIA010Policy.xml">Policy</a>,<a href="IIIA010Response.xml">Response</a></i>
<li>Case: NotApplicable: RuleCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA011Request.xml">Request</a>,<a href="IIIA011Policy.xml">Policy</a>,<a href="IIIA011Response.xml">Response</a></i>
<li>Case: Indeterminate: RuleCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA012Request.xml">Request</a>,<a href="IIIA012Policy.xml">Policy</a>,<a href="IIIA012Response.xml">Response</a></i>
<p>
For policy combining algorithms:
</p>
<li>Case: Permit: PolicyCombiningAlgorithm DenyOverrides <br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA013Request.xml">Request</a>,<a href="IIIA013Policy.xml">Policy</a>,<a href="IIIA013Response.xml">Response</a></i>
<li>Case: Deny: PolicyCombiningAlgorithm DenyOverrides <br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA014Request.xml">Request</a>,<a href="IIIA014Policy.xml">Policy</a>,<a href="IIIA014Response.xml">Response</a></i>
<li>Case: NotApplicable: PolicyCombiningAlgorithm DenyOverrides <br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA015Request.xml">Request</a>,<a href="IIIA015Policy.xml">Policy</a>,<a href="IIIA015Response.xml">Response</a></i>
<li>Case: AnotherDeny (can't return Indeterminate): PolicyCombiningAlgorithm DenyOverrides <br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA016Request.xml">Request</a>,<a href="IIIA016Policy.xml">Policy</a>,<a href="IIIA016Response.xml">Response</a></i>
<li>Case: Permit: PolicyCombiningAlgorithm PermitOverrides <br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA017Request.xml">Request</a>,<a href="IIIA017Policy.xml">Policy</a>,<a href="IIIA017Response.xml">Response</a></i>
<li>Case: Deny: PolicyCombiningAlgorithm PermitOverrides <br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA018Request.xml">Request</a>,<a href="IIIA018Policy.xml">Policy</a>,<a href="IIIA018Response.xml">Response</a></i>
<li>Case: NotApplicable: PolicyCombiningAlgorithm PermitOverrides <br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA019Request.xml">Request</a>,<a href="IIIA019Policy.xml">Policy</a>,<a href="IIIA019Response.xml">Response</a></i>
<li>Case: Indeterminate: PolicyCombiningAlgorithm PermitOverrides <br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA020Request.xml">Request</a>,<a href="IIIA020Policy.xml">Policy</a>,<a href="IIIA020Response.xml">Response</a></i>
<li>Case: Permit: PolicyCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA021Request.xml">Request</a>,<a href="IIIA021Policy.xml">Policy</a>,<a href="IIIA021Response.xml">Response</a></i>
<li>Case: Deny: PolicyCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA022Request.xml">Request</a>,<a href="IIIA022Policy.xml">Policy</a>,<a href="IIIA022Response.xml">Response</a></i>
<li>Case: NotApplicable: PolicyCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA023Request.xml">Request</a>,<a href="IIIA023Policy.xml">Policy</a>,<a href="IIIA023Response.xml">Response</a></i>
<li>Case: Indeterminate: PolicyCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA024Request.xml">Request</a>,<a href="IIIA024Policy.xml">Policy</a>,<a href="IIIA024Response.xml">Response</a></i>
<li>Case: Permit: PolicyCombiningAlgorithm OnlyOneApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA025Request.xml">Request</a>,<a href="IIIA025Policy.xml">Policy</a>,<a href="IIIA025Response.xml">Response</a></i>
<li>Case: Deny: PolicyCombiningAlgorithm OnlyOneApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA026Request.xml">Request</a>,<a href="IIIA026Policy.xml">Policy</a>,<a href="IIIA026Response.xml">Response</a></i>
<li>Case: NotApplicable: PolicyCombiningAlgorithm OnlyOneApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA027Request.xml">Request</a>,<a href="IIIA027Policy.xml">Policy</a>,<a href="IIIA027Response.xml">Response</a></i>
<li>Case: Indeterminate: PolicyCombiningAlgorithm OnlyOneApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 11 March 2003, updated 25 March 2004 (fixed a bug reported by Seth Proctor).<br>
<i><a href="IIIA028Request.xml">Request</a>,<a href="IIIA028Policy.xml">Policy</a>,<a href="IIIA028Response.xml">Response</a></i>
</ol>
<ol start=30>
<li>Case: Test Obligations on Policy, Case: Permit: RuleCombiningAlgorithm DenyOverrides Testing XPathExpressions in Obligations<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA030Request.xml">Request</a>,<a href="IIIA030Policy.xml">Policy</a>,<a href="IIIA030Response.xml">Response</a></i>
</ol>
<p>
Tests for Release 3.0 functionality.
<p>
<ol start=301>
<li>Case: Test Advices on Rules, Case: Permit: RuleCombiningAlgorithm DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA301Request.xml">Request</a>,<a href="IIIA301Policy.xml">Policy</a>,<a href="IIIA301Response.xml">Response</a></i>
<li>Case: Test Advices on Rules, Case: Deny: RuleCombiningAlgorithm DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA302Request.xml">Request</a>,<a href="IIIA302Policy.xml">Policy</a>,<a href="IIIA302Response.xml">Response</a></i>
<li>Case: Test Advices on Rules, Case: NotApplicable: RuleCombiningAlgorithm DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA303Request.xml">Request</a>,<a href="IIIA303Policy.xml">Policy</a>,<a href="IIIA303Response.xml">Response</a></i>
<li>Case: test Advices on Rules, Case: Indeterminate: RuleCombiningAlgorithm DenyOverridess<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA304Request.xml">Request</a>,<a href="IIIA304Policy.xml">Policy</a>,<a href="IIIA304Response.xml">Response</a></i>
<li>Case: test Advices on Rules, Case: Permit: RuleCombiningAlgorithm PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA305Request.xml">Request</a>,<a href="IIIA305Policy.xml">Policy</a>,<a href="IIIA305Response.xml">Response</a></i>
<li>Case: test Advices on Rules, Case: Deny: RuleCombiningAlgorithm PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA306Request.xml">Request</a>,<a href="IIIA306Policy.xml">Policy</a>,<a href="IIIA306Response.xml">Response</a></i>
<li>Case: test Advices on Rules, Case: NotApplicable: RuleCombiningAlgorithm PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA307Request.xml">Request</a>,<a href="IIIA307Policy.xml">Policy</a>,<a href="IIIA307Response.xml">Response</a></i>
<li>Case: test Advices on Rules, Case: Indeterminate: RuleCombiningAlgorithm PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA308Request.xml">Request</a>,<a href="IIIA308Policy.xml">Policy</a>,<a href="IIIA308Response.xml">Response</a></i>
<li>Case: test Advices on Rules, Case: Permit: RuleCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA309Request.xml">Request</a>,<a href="IIIA309Policy.xml">Policy</a>,<a href="IIIA309Response.xml">Response</a></i>
<li>Case: test Advices on Rules, Case: Deny: RuleCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA310Request.xml">Request</a>,<a href="IIIA310Policy.xml">Policy</a>,<a href="IIIA310Response.xml">Response</a></i>
<li>Case: test Advices on Rules, Case: NotApplicable: RuleCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA311Request.xml">Request</a>,<a href="IIIA311Policy.xml">Policy</a>,<a href="IIIA311Response.xml">Response</a></i>
<li>Case: test Advices on Rules, Case: Indeterminate: RuleCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA312Request.xml">Request</a>,<a href="IIIA312Policy.xml">Policy</a>,<a href="IIIA312Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: Permit: PolicyCombiningAlgorithm DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA313Request.xml">Request</a>,<a href="IIIA313Policy.xml">Policy</a>,<a href="IIIA313Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: Deny: PolicyCombiningAlgorithm DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA314Request.xml">Request</a>,<a href="IIIA314Policy.xml">Policy</a>,<a href="IIIA314Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: NotApplicable: PolicyCombiningAlgorithm DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA315Request.xml">Request</a>,<a href="IIIA315Policy.xml">Policy</a>,<a href="IIIA315Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: AnotherDeny (can't return Indeterminate): PolicyCombiningAlgorithm DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA316Request.xml">Request</a>,<a href="IIIA316Policy.xml">Policy</a>,<a href="IIIA316Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: Permit: PolicyCombiningAlgorithm PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA317Request.xml">Request</a>,<a href="IIIA317Policy.xml">Policy</a>,<a href="IIIA317Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: Deny: PolicyCombiningAlgorithm PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA318Request.xml">Request</a>,<a href="IIIA318Policy.xml">Policy</a>,<a href="IIIA318Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: NotApplicable: PolicyCombiningAlgorithm PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA319Request.xml">Request</a>,<a href="IIIA319Policy.xml">Policy</a>,<a href="IIIA319Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: Indeterminate: PolicyCombiningAlgorithm PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA320Request.xml">Request</a>,<a href="IIIA320Policy.xml">Policy</a>,<a href="IIIA320Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: Permit: PolicyCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA321Request.xml">Request</a>,<a href="IIIA321Policy.xml">Policy</a>,<a href="IIIA321Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: Deny: PolicyCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA322Request.xml">Request</a>,<a href="IIIA322Policy.xml">Policy</a>,<a href="IIIA322Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: NotApplicable: PolicyCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA323Request.xml">Request</a>,<a href="IIIA323Policy.xml">Policy</a>,<a href="IIIA323Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: Indeterminate: PolicyCombiningAlgorithm FirstApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA324Request.xml">Request</a>,<a href="IIIA324Policy.xml">Policy</a>,<a href="IIIA324Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: Permit: PolicyCombiningAlgorithm OnlyOneApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA325Request.xml">Request</a>,<a href="IIIA325Policy.xml">Policy</a>,<a href="IIIA325Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: Deny: PolicyCombiningAlgorithm OnlyOneApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA326Request.xml">Request</a>,<a href="IIIA326Policy.xml">Policy</a>,<a href="IIIA326Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: NotApplicable: PolicyCombiningAlgorithm OnlyOneApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA327Request.xml">Request</a>,<a href="IIIA327Policy.xml">Policy</a>,<a href="IIIA327Response.xml">Response</a></i>
<li>Case: test Advices on Policies, Case: Indeterminate: PolicyCombiningAlgorithm OnlyOneApplicable<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA328Request.xml">Request</a>,<a href="IIIA328Policy.xml">Policy</a>,<a href="IIIA328Response.xml">Response</a></i>
<li>Case: Test Advice on Rules where Advice is actually attached to the Rule itself, Case: Permit: RuleCombiningAlgorithm DenyOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA329Request.xml">Request</a>,<a href="IIIA329Policy.xml">Policy</a>,<a href="IIIA329Response.xml">Response</a></i>
<li>Case: Test Advices on Rules, Case: Permit: RuleCombiningAlgorithm DenyOverrides. XPAthExpression returned in Advice<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA330Request.xml">Request</a>,<a href="IIIA330Policy.xml">Policy</a>,<a href="IIIA330Response.xml">Response</a></i>
</ol>
<p>
<ol start=340>
<li>Case: Test returned Attributes, Obligations and Advice with NaN, INF and -INF special double values<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIA340Request.xml">Request</a>,<a href="IIIA340Policy.xml">Policy</a>,<a href="IIIA340Response.xml">Response</a></i>
</ol>
<p>
<h3><li><a name="DefaultsType"> DefaultsType </a></h3>
<ol>
<li>Case: PolicySetDefaults XPathVersion
<li>Case: PolicyDefaults XPathVersion
<li>Case: PolicyDefaults XPathVersion differs from parent
PolicySetDefaults XPathVersion
</ol>
<h3><li><a name="Hierarchical Resources"> Hierarchical Resources </a></h3>
<p>
These tests exercise policy evaluation for hierarchical resources (<a href="IIICSpecial.txt">Special Instructions</a>).
</p>
<ol>
<li>Case: Scope="Immediate"<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 26 February 2003.<br>
<i><a href="IIIC001Request.xml">Request</a>,<a
href="IIIC001Policy.xml">Policy</a>,<a
href="IIIC001Response.xml">Response</a></i>
<li>Case: Scope="Children"<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 26 February 2003.<br>
<i><a href="IIIC002Request.xml">Request</a>,<a href="IIIC002Policy.xml">Policy</a>,<a href="IIIC002Response.xml">Response</a></i>
<li>Case: Scope="Descendants"<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 26 February 2003.<br>
<i><a href="IIIC003Request.xml">Request</a>,<a href="IIIC003Policy.xml">Policy</a>,<a href="IIIC003Response.xml">Response</a></i>
</ol>
<h3><li><a name="<ResourceContent> Element">
<ResourceContent> Element </a></h3>
<ol>
</ol>
<h3><li><a name="Multiple Decisions"> Multiple Decisions </a></h3>
<ol start=301>
<li>Case: test Multiple Decisions with The use of the multiple:content-selector attribute in Attributes elements<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIE301Request.xml">Request</a>,<a href="IIIE301Policy.xml">Policy</a>,<a href="IIIE301Response.xml">Response</a></i>
<li>Case: test Multiple Decisions with The use of multiple instances of an Attributes element with the same category ID<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIE302Request.xml">Request</a>,<a href="IIIE302Policy.xml">Policy</a>,<a href="IIIE302Response.xml">Response</a></i>
<li>Case: test Multiple Decisions with The use of the MultiRequests element in a Request<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIE303Request.xml">Request</a>,<a href="IIIE303Policy.xml">Policy</a>,<a href="IIIE303Response.xml">Response</a>,<a href="IIIE303Response.json">JSON Response</a></i>
</ol>
<h3><li><a name="Attribute Selectors"> Attribute Selectors </a></h3>
<p>
These tests exercise attribute selectors (<a href="IIIFSpecial.txt">Special Instructions</a>).
</p>
<ol>
<li>Case: PRESENT: "MustBePresent" attribute in Target Attribute Selector<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 4 March 2003, updated 11 March 2003<br>
<i><a href="IIIF001Request.xml">Request</a>,<a
href="IIIF001Policy.xml">Policy</a>,<a
href="IIIF001Response.xml">Response</a></i>
<li>Case: MISSING: "MustBePresent" attribute in Target Attribute Selector<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 4 March 2003, updated 11 March 2003.<br>
Fix/modification for IIIF002Request.xml contributed by John Merrells
<merrells@jiffysoftware.com>. Added to this test suite
11 March 2003.<br>
<i><a href="IIIF002Request.xml">Request</a>,<a
href="IIIF002Policy.xml">Policy</a>,<a
href="IIIF002Response.xml">Response</a></i>
<li>Case: PRESENT: "MustBePresent" attribute in Condition Attribute Selector<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 4 March 2003, updated 11 March 2003.<br>
<i><a href="IIIF003Request.xml">Request</a>,<a
href="IIIF003Policy.xml">Policy</a>,<a
href="IIIF003Response.xml">Response</a></i>
<li>Case: MISSING: "MustBePresent" attribute in Condition Attribute Selector<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 4 March 2003, updated 11 March 2003.<br>
<i><a href="IIIF004Request.xml">Request</a>,<a
href="IIIF004Policy.xml">Policy</a>,<a
href="IIIF004Response.xml">Response</a></i>
<li>Case: Syntax error in XPath expression <br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 4 March 2003, updated 11 March 2003, updated 2 March 2004 (fixed a bug reported by Jin Peng).<br>
<i><a href="IIIF005Request.xml">Request</a>,<a
href="IIIF005Policy.xml">Policy</a>,<a
href="IIIF005Response.xml">Response</a></i>
<li>Case: Attribute Selector in PolicySet Target <br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 4 March 2003, updated 11 March 2003.<br>
<i><a href="IIIF006Request.xml">Request</a>,<a
href="IIIF006Policy.xml">Policy</a>,<a
href="IIIF006Response.xml">Response</a></i>
<li>Case: Relative XPath expressions in Attribute Selector<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 21 March 2003.<br>
<i><a href="IIIF007Request.xml">Request</a>,<a
href="IIIF007Policy.xml">Policy</a>,<a
href="IIIF007Response.xml">Response</a></i>
</ol>
<h3><li><a name="Non-mandatory Functions">Non-mandatory Functions </a></h3>
<p>
These tests exercise each of the non-mandatory functions</p>
<ol>
<li>Case: xpath-node-count<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 4 March 2003, updated 19 August 2003.<br>
<i><a href="IIIG001Request.xml">Request</a>,<a href="IIIG001Policy.xml">Policy</a>,<a href="IIIG001Response.xml">Response</a></i>
<li>Case: true: xpath-node-equal<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 4 March 2003, updated 19 August 2003.<br>
<i><a href="IIIG002Request.xml">Request</a>,<a href="IIIG002Policy.xml">Policy</a>,<a href="IIIG002Response.xml">Response</a></i>
<li>Case: false: xpath-node-equal<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 4 March 2003, updated 19 August 2003.<br>
<i><a href="IIIG003Request.xml">Request</a>,<a href="IIIG003Policy.xml">Policy</a>,<a href="IIIG003Response.xml">Response</a></i>
<li>Case: true: xpath-node-match<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 4 March 2003, updated 19 August 2003.<br>
<i><a href="IIIG004Request.xml">Request</a>,<a href="IIIG004Policy.xml">Policy</a>,<a href="IIIG004Response.xml">Response</a></i>
<li>Case: false: xpath-node-match<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 4 March 2003, updated 19 August 2003.<br>
<i><a href="IIIG005Request.xml">Request</a>,<a href="IIIG005Policy.xml">Policy</a>,<a href="IIIG005Response.xml">Response</a></i>
<li>Case: <a href="IIIG006Special.txt">Relative XPath expressions</a> in XPath-based functions<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a><br>
Contributed by Satoshi Hada <SATOSHIH@jp.ibm.com>. Added to this
test suite 21 March 2003, updated 19 August 2003.<br>
<i><a href="IIIG006Request.xml">Request</a>,<a
href="IIIG006Policy.xml">Policy</a>,<a
href="IIIG006Response.xml">Response</a>,<a
href="IIIG006Special.txt">Special Instructions</a></i>
</ol>
<p>
<ol start=301>
<li>Case: ReturnPolicyIdList test with Policy result (no PolicySets)<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIG300Request.xml">Request</a>,<a href="IIIG300Policy.xml">Policy</a>,<a href="IIIG300Response.xml">Response</a></i>
<li>Case: ReturnPolicyIdList test with PolicySet result (no Policys)<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIG301Request.xml">Request</a>,<a href="IIIG301Policy.xml">Policy</a>,<a href="IIIG301Response.xml">Response</a></i>
</ol>
</ol>
<hr>
<h2><li><a name="Identifiers planned for future deprecation">
Identifiers planned for future deprecation </a></h2>
(In other document systems such as JavaDoc the word "deprecated" means currently implemented but do not use because it may be removed in the future.
Since that is the meaning of the phrase "planned for future deprecation" in 10.2.9 of the 3.0 specification,
the word "deprecated" is used interchangeably with the longer phrase in this section.)
<ol TYPE="I">
<H3><LI><A name="Description of Deprecated Identifiers Tests">Description of Deprecated Identifiers Tests</A></H3>
These tests exercise features using Identifiers that are planned for deprecation.
While <I>planned</I> for deprecation they are still mandatory to implement in a 3.0 complient PDP.
<P>
The one exception is the three xpath-node functions.
These functions are marked as Optional.
Since the semantics have changed (XPath root is now the <Context> element rather than the <Request>)
and the specification does not state which semantics are to be used in a 3.0 system receiving these requests,
the following functions are not included in these tests:
<ul>
<LI>urn:oasis:names:tc:xacml:1.0:function:xpath-node-count
<LI>urn:oasis:names:tc:xacml:1.0:function:xpath-node-equal
<LI>urn:oasis:names:tc:xacml:1.0:function:xpath-node-match
</ul>
<p>
<h3>Document Naming</h3>
The features that are planned for future deprecation
are usually related to newer versions of same feature.
To indicate that relationship the tests are named the same as those in the previous sections but with a "d" appended to show it is "deprecated".
For example, the XML
documents for the test in Part II (Mandatory to
implement), Section C (Duration Functions), Test Case 2
(Case: function:dateTime-add-dayTimeDuration)
using the new 3.0 dayTimeDuration IDs are named:<p>
<ul>
<li>IIC102Request.xml
<li>IIC102Policy.xml
<li>IIC102Response.xml
</ul>
and the version of the same test using the deprecated Identifiers are named:<P>
<ul>
<li>IIC102dRequest.xml
<li>IIC102dPolicy.xml
<li>IIC102dResponse.xml
</ul>
<P>
To reduce confusion these tests are placed in a separate sub-directory under the directory containing the 3.0 test files.
<h3><LI> <a name="#Deprecated Mandatory-to-Implement Functionality Tests">Deprecated Mandatory-to-Implement Functionality Tests</a></h3>
<ol TYPE=A>
<h3><li><a name="#Deprecated Attribute References"> Deprecated Attribute References </a>(<a href="#Attribute References"> Attribute References </a>)</h3>
<h3><li><a name="#Deprecated Target Matching"> Deprecated Target Matching </a> (<a href="#Target Matching"> Target Matching </a>)</h3>
<h3><li><a name="#Deprecated Function Evaluation"> Deprecated Function Evaluation </a> (<a href="#Function Evaluation"> Function Evaluation </a>)</h3>
<ol start=102>
<li>Case: Deprecated dayTimeDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC102dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC102dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC102dResponse.xml">Response</a></i>
<li>Case: Deprecated yearMonthDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC103dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC103dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC103dResponse.xml">Response</a></i>
<li>Case: Deprecated dayTimeDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC104dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC104dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC104dResponse.xml">Response</a></i>
<li>Case: Deprecated yearMonthDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC105dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC105dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC105dResponse.xml">Response</a></i>
<li>Case: Deprecated yearMonthDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC106dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC106dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC106dResponse.xml">Response</a></i>
<li>Case: Deprecated yearMonthDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC107dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC107dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC107dResponse.xml">Response</a></i>
</ol>
<p>
<ol start=150>
<li>Case: Deprecated dayTimeDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC150dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC150dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC150dResponse.xml">Response</a></i>
<li>Case: Deprecated dayTimeDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC151dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC151dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC151dResponse.xml">Response</a></i>
<li>Case: Deprecated dayTimeDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC152dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC152dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC152dResponse.xml">Response</a></i>
<li>Case: Deprecated dayTimeDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC153dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC153dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC153dResponse.xml">Response</a></i>
<li>Case: Deprecated yearMonthDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC154dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC154dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC154dResponse.xml">Response</a></i>
<li>Case: Deprecated yearMonthDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC155dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC155dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC155dResponse.xml">Response</a></i>
<li>Case: Deprecated yearMonthDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC156dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC156dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC156dResponse.xml">Response</a></i>
<li>Case: Deprecated yearMonthDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC157dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC157dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC157dResponse.xml">Response</a></i>
</ol>
<p>
<ol start=164>
<li>Case: Function Evaluation - Higher Order Bag Functions: Case: function:any-of DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC164dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC164dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC164dResponse.xml">Response</a></i>
<li>Case: Function Evaluation - Higher Order Bag Functions: Case: function:all-of DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC165dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC165dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC165dResponse.xml">Response</a></i>
<li>Case: Function Evaluation - Higher Order Bag Functions: Case: function:any-of-any DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC166dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC166dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC166dResponse.xml">Response</a></i>
</ol>
<p>
<ol start=170>
<li>Case: Function Evaluation - Higher Order Bag Functions: Case: function:map DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC170dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC170dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC170dResponse.xml">Response</a></i>
</ol>
<p>
<ol start=231>
<li>Case: Deprecated dayTimeDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC231dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC231dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC231dResponse.xml">Response</a></i>
<li>Case: Deprecated dayTimeDuration id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC232dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC232dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC232dResponse.xml">Response</a></i>
</ol>
<p>
<ol start=340>
<li>Case: Function Evaluation - Set Functions: dayTimeDuration-intersection DEPRECATEDon id.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC340dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC340dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC340dResponse.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: dayTimeDuration-at-least-one-member-of DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC341dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC341dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC341dResponse.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: dayTimeDuration-union DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC342dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC342dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC342dResponse.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: dayTimeDuration-subset DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC343dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC343dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC343dResponse.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: dayTimeDuration-set-equals DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC344dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC344dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC344dResponse.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: yearMonthDuration-intersection DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC345dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC345dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC345dResponse.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: yearMonthDuration-at-least-one-member-of DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC346dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC346dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC346dResponse.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: yearMonthDuration-union DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC347dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC347dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC347dResponse.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: yearMonthDuration-subset DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC348dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC348dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC348dResponse.xml">Response</a></i>
<li>Case: Function Evaluation - Set Functions: yearMonthDuration-set-equals DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC349dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC349dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC349dResponse.xml">Response</a></i>
<li>Case: test deprecated uri-string-concatenate.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIC350dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIC350dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIC350dResponse.xml">Response</a></i>
</ol>
<h3><li><a name="#Deprecated Combining Algorithms"> Deprecated Combining Algorithms </a> (<a href="#Combining Algorithms"> Combining Algorithms </a>)</h3>
<ol start=1>
<li>Case: Permit: RuleCombiningAlgorithm DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID001dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID001dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID001dResponse.xml">Response</a></i>
<li>Case: Deny: RuleCombiningAlgorithm DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID002dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID002dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID002dResponse.xml">Response</a></i>
<li>Case: Deprecated Overrides test.<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID003dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID003dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID003dResponse.xml">Response</a></i>
<li>Case: Indeterminate: RuleCombiningAlgorithm DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID004dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID004dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID004dResponse.xml">Response</a></i>
<li>Case: Permit: PolicyCombiningAlgorithm DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID005dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID005dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID005dResponse.xml">Response</a></i>
<li>Case: NotApplicable: PolicyCombiningAlgorithm DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID006dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID006dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID006dResponse.xml">Response</a></i>
<li>Case: NotApplicable: PolicyCombiningAlgorithm DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID007dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID007dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID007dResponse.xml">Response</a></i>
<li>Case: Another Deny (can't return Indeterminate): PolicyCombiningAlgorithm DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID008dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID008dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID008dResponse.xml">Response</a></i>
<li>Case: Permit: RuleCombiningAlgorithm PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID009dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID009dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID009dResponse.xml">Response</a></i>
<li>Case: Deny: RuleCombiningAlgorithm PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID010dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID010dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID010dResponse.xml">Response</a></i>
<li>Case: Deny: RuleCombiningAlgorithm PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID011dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID011dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID011dResponse.xml">Response</a></i>
<li>Case: Indeterminate: RuleCombiningAlgorithm PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID012dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID012dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID012dResponse.xml">Response</a></i>
<li>Case: Permit: PolicyCombiningAlgorithm PermitOverrides<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID013dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID013dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID013dResponse.xml">Response</a></i>
<li>Case: Deny: PolicyCombiningAlgorithm PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID014dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID014dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID014dResponse.xml">Response</a></i>
<li>Case: NotApplicable: PolicyCombiningAlgorithm PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID015dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID015dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID015dResponse.xml">Response</a></i>
<li>Case: Indeterminate: PolicyCombiningAlgorithm PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID016dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID016dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID016dResponse.xml">Response</a></i>
</ol>
<p>
<ol start=300>
<li>Case: Response from 1.0 Policy-level permit-overrides should differ from 3.0 response for rules that return:
NOTAPPLICABLE, NOTAPPLICABLE, INDETERMINATE, DENY DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID300dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID300dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID300dResponse.xml">Response</a></i>
<li>Case: Permit: RuleCombiningAlgorithm Ordered DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID301dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID301dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID301dResponse.xml">Response</a></i>
<li>Case: Deny: RuleCombiningAlgorithm Ordered DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID302dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID302dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID302dResponse.xml">Response</a></i>
</ol>
<p>
<ol start=304>
<li>Case: NotApplicable: RuleCombiningAlgorithm Ordered DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID304dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID304dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID304dResponse.xml">Response</a></i>
<li>Case: Indeterminate: RuleCombiningAlgorithm Ordered DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID305dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID305dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID305dResponse.xml">Response</a></i>
<li>Case: Permit: PolicyCombiningAlgorithm DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID306dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID306dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID306dResponse.xml">Response</a></i>
<li>Case: Deny: PolicyCombiningAlgorithm Ordered DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID307dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID307dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID307dResponse.xml">Response</a></i>
<li>Case: Deny: PolicyCombiningAlgorithm Ordered DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID308dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID308dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID308dResponse.xml">Response</a></i>
<li>Case: NotApplicable: PolicyCombiningAlgorithm Ordered DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID309dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID309dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID309dResponse.xml">Response</a></i>
<li>Case: Another Deny (can't return Indeterminate): PolicyCombiningAlgorithm Ordered DenyOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID310dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID310dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID310dResponse.xml">Response</a></i>
<li>Case: Permit: RuleCombiningAlgorithm Ordered PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID311dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID311dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID311dResponse.xml">Response</a></i>
</ol>
<p>
<ol start=313>
<li>Case: Deny: RuleCombiningAlgorithm Ordered PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID313dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID313dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID313dResponse.xml">Response</a></i>
<li>Case: Deny: RuleCombiningAlgorithm Ordered PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID314dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID314dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID314dResponse.xml">Response</a></i>
<li>Case: Indeterminate: RuleCombiningAlgorithm Ordered PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID315dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID315dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID315dResponse.xml">Response</a></i>
<li>Case: Permit: PolicyCombiningAlgorithm Ordered PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID316dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID316dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID316dResponse.xml">Response</a></i>
<li>Case: Permit: PolicyCombiningAlgorithm Ordered PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID317dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID317dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID317dResponse.xml">Response</a></i>
<li>Case: Deny: PolicyCombiningAlgorithm Ordered PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID318dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID318dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID318dResponse.xml">Response</a></i>
<li>Case: NotApplicable: PolicyCombiningAlgorithm Ordered PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID319dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID319dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID319dResponse.xml">Response</a></i>
<li>Case: Indeterminate: PolicyCombiningAlgorithm Ordered PermitOverrides DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IID320dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IID320dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IID320dResponse.xml">Response</a></i>
</ol>
<h3><li><a name="#Deprecated Schema components"> Deprecated Schema components </a> (<a href="#Schema components"> Schema components </a>)</h3>
</ol>
<h3><li><a name="#Deprecated Optional, but Normative Functionality Tests">Deprecated Optional, but Normative Functionality Tests</a></h3>
<ol TYPE=A>
<h3><li><a name="#Deprecated Obligations"> Deprecated Obligations </a> (<a href="#Obligations"> Obligations </a>)</h3>
<h3><li><a name="#Deprecated DefaultsType"> Deprecated DefaultsType </a> (<a href="#DefaultsType"> DefaultsType </a>)</h3>
<h3><li><a name="#Deprecated Hierarchical Resources"> Deprecated Hierarchical Resources </a> (<a href="#Hierarchical Resources"> Hierarchical Resources </a>)</h3>
<h3><li><a name="#Deprecated <ResourceContent> Element"> Deprecated <ResourceContent> Element </a> (<a href="#<ResourceContent> Element"> <ResourceContent> Element </a>)</h3>
<h3><li><a name="#Deprecated Multiple Decisions"> Deprecated Multiple Decisions </a> (<a href="#Multiple Decisions"> Multiple Decisions </a>)</h3>
<h3><li><a name="#Deprecated Attribute Selectors"> Deprecated Attribute Selectors </a> (<a href="#Attribute Selectors"> Attribute Selectors </a>)</h3>
<h3><li><a name="#Deprecated Non-mandatory Functions"> Deprecated Non-mandatory Functions </a> (<a href="#Non-mandatory Functions"> Non-mandatory Functions </a>)</h3>
<ol start=1>
<li>Case: Non-mandatory Functions: Case: xpath-node-count DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIIG001dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIIG001dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIIG001dResponse.xml">Response</a></i>
<li>Case: Non-mandatory Functions: Case: true: xpath-node-equal DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIIG002dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIIG002dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIIG002dResponse.xml">Response</a></i>
<li>Case: Non-mandatory Functions: Case: false: xpath-node-equal DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIIG003dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIIG003dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIIG003dResponse.xml">Response</a></i>
<li>Case: Non-mandatory Functions: Case: true: xpath-node-match DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIIG004dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIIG004dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIIG004dResponse.xml">Response</a></i>
<li>Case: Non-mandatory Functions: Case: false: xpath-node-match DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIIG005dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIIG005dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIIG005dResponse.xml">Response</a></i>
<li>Case: Non-mandatory Functions: Case: Relative XPath expressions in XPath-based functions DEPRECATED<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="xacml3.0-deprecated/IIIG006dRequest.xml">Request</a>,<a href="xacml3.0-deprecated/IIIG006dPolicy.xml">Policy</a>,<a href="xacml3.0-deprecated/IIIG006dResponse.xml">Response</a></i>
</ol>
</ol>
</ol>
<hr>
</body>
</html>
<ol start=300>
<li>Case: false: xpath-node-equal<br>
<a href="#Contributions of New Tests">
<font color="red">**EXPERIMENTAL**</font></a>
Contributed by Glenn Griffin <glenngriffin@research.att.com>. Added to this
test suite March 2014.<br>
<i><a href="IIIG003Request.xml">Request</a>,<a href="IIIG003Policy.xml">Policy</a>,<a href="IIIG003Response.xml">Response</a></i>
| {
"content_hash": "937ad2e3ed1e619b23b2905991fbe934",
"timestamp": "",
"source": "github",
"line_count": 2959,
"max_line_length": 200,
"avg_line_length": 65.23014531936465,
"alnum_prop": 0.7024339951092138,
"repo_name": "att/XACML",
"id": "302245391870083ab47ecdade505230f29cdaffc",
"size": "193016",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "XACML-PDP/src/test/resources/testsets/conformance/xacml3.0-ct-v.0.4/ConformanceTests.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1492"
},
{
"name": "HTML",
"bytes": "193016"
},
{
"name": "Java",
"bytes": "4635186"
},
{
"name": "PLpgSQL",
"bytes": "198552"
},
{
"name": "TSQL",
"bytes": "568124"
}
],
"symlink_target": ""
} |
package org.ovirt.engine.api.restapi.types;
import java.util.ArrayList;
import org.ovirt.engine.api.model.BootProtocol;
import org.ovirt.engine.api.model.HostNIC;
import org.ovirt.engine.api.model.IP;
import org.ovirt.engine.api.model.IpAddressAssignment;
import org.ovirt.engine.api.model.IpAddressAssignments;
import org.ovirt.engine.api.model.Network;
import org.ovirt.engine.api.model.NetworkAttachment;
import org.ovirt.engine.api.restapi.utils.CustomPropertiesParser;
import org.ovirt.engine.api.restapi.utils.GuidUtils;
import org.ovirt.engine.core.common.businessentities.network.HostNetworkQos;
import org.ovirt.engine.core.common.businessentities.network.IPv4Address;
import org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol;
public class NetworkAttachmentMapper {
@Mapping(from = NetworkAttachment.class,
to = org.ovirt.engine.core.common.businessentities.network.NetworkAttachment.class)
public static org.ovirt.engine.core.common.businessentities.network.NetworkAttachment map(NetworkAttachment model,
org.ovirt.engine.core.common.businessentities.network.NetworkAttachment template) {
org.ovirt.engine.core.common.businessentities.network.NetworkAttachment entity = template == null ?
new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment() :
template;
if (model.isSetId()) {
entity.setId(GuidUtils.asGuid(model.getId()));
}
if (model.isSetNetwork()) {
Network networkModel = model.getNetwork();
if (networkModel.isSetId()) {
entity.setNetworkId(GuidUtils.asGuid(networkModel.getId()));
}
if (networkModel.isSetName()) {
entity.setNetworkName(networkModel.getName());
}
}
if (model.isSetHostNic()) {
HostNIC hostNic = model.getHostNic();
if (hostNic.isSetId()) {
entity.setNicId(GuidUtils.asGuid(hostNic.getId()));
} else {
entity.setNicId(null);
}
if (hostNic.isSetName()) {
entity.setNicName(hostNic.getName());
} else {
entity.setNicName(null);
}
}
if (model.isSetProperties()) {
entity.setProperties(CustomPropertiesParser.toMap(model.getProperties()));
}
if (model.isSetIpAddressAssignments()) {
entity.setIpConfiguration(new org.ovirt.engine.core.common.businessentities.network.IpConfiguration());
IpAddressAssignments ipAddressAssignments = model.getIpAddressAssignments();
entity.getIpConfiguration().setIPv4Addresses(new ArrayList<IPv4Address>());
for (IpAddressAssignment ipAddressAssignment : ipAddressAssignments.getIpAddressAssignments()) {
entity.getIpConfiguration().getIPv4Addresses().add(mapIpAddressAssignment(ipAddressAssignment));
}
}
if (model.isSetQos()) {
entity.setHostNetworkQos((HostNetworkQos) QosMapper.map(model.getQos(), null));
}
return entity;
}
private static IPv4Address mapIpAddressAssignment(IpAddressAssignment ipAddressAssignment) {
IPv4Address iPv4Address = new IPv4Address();
if (ipAddressAssignment.isSetAssignmentMethod()) {
NetworkBootProtocol assignmentMethod =
BootProtocolMapper.map(BootProtocol.fromValue(ipAddressAssignment.getAssignmentMethod()),
null);
iPv4Address.setBootProtocol(assignmentMethod);
}
if (ipAddressAssignment.isSetIp()) {
if (ipAddressAssignment.getIp().isSetAddress()) {
iPv4Address.setAddress(ipAddressAssignment.getIp().getAddress());
}
if (ipAddressAssignment.getIp().isSetGateway()) {
iPv4Address.setGateway(ipAddressAssignment.getIp().getGateway());
}
if (ipAddressAssignment.getIp().isSetNetmask()) {
iPv4Address.setNetmask(ipAddressAssignment.getIp().getNetmask());
}
}
return iPv4Address;
}
@Mapping(from = org.ovirt.engine.core.common.businessentities.network.NetworkAttachment.class,
to = NetworkAttachment.class)
public static NetworkAttachment map(org.ovirt.engine.core.common.businessentities.network.NetworkAttachment entity,
NetworkAttachment template) {
NetworkAttachment model =
template == null ? new NetworkAttachment() : template;
if (entity.getId() != null) {
model.setId(entity.getId().toString());
}
if (entity.getNetworkId() != null) {
getModelNetwork(model).setId(entity.getNetworkId().toString());
}
if (entity.getNetworkName() != null) {
if (model.getNetwork() == null) {
model.setNetwork(new Network());
}
model.getNetwork().setName(entity.getNetworkName());
}
if (entity.getNicId() != null) {
getModelHostNic(model).setId(entity.getNicId().toString());
}
if (entity.hasProperties()) {
model.setProperties(CustomPropertiesParser.fromMap(entity.getProperties()));
}
org.ovirt.engine.core.common.businessentities.network.IpConfiguration entityIpConfiguration =
entity.getIpConfiguration();
if (entityIpConfiguration != null && !entityIpConfiguration.getIPv4Addresses().isEmpty()) {
model.setIpAddressAssignments(new IpAddressAssignments());
for (IPv4Address iPv4Address : entityIpConfiguration.getIPv4Addresses()) {
model.getIpAddressAssignments().getIpAddressAssignments().add(mapIpAddressAssignment(iPv4Address));
}
}
if (entity.getReportedConfigurations() != null) {
model.setReportedConfigurations(ReportedConfigurationsMapper.map(entity.getReportedConfigurations(), null));
}
if (entity.getHostNetworkQos() != null) {
model.setQos(QosMapper.map(entity.getHostNetworkQos(), null));
}
return model;
}
private static IpAddressAssignment mapIpAddressAssignment(IPv4Address iPv4Address) {
IpAddressAssignment ipAddressAssignment = new IpAddressAssignment();
IP ip = new IP();
if (iPv4Address.getAddress() != null) {
ip.setAddress(iPv4Address.getAddress());
}
if (iPv4Address.getGateway() != null) {
ip.setGateway(iPv4Address.getGateway());
}
if (iPv4Address.getNetmask() != null) {
ip.setNetmask(iPv4Address.getNetmask());
}
ipAddressAssignment.setIp(ip);
BootProtocol assignmentMethod = BootProtocolMapper.map(iPv4Address.getBootProtocol(), null);
ipAddressAssignment.setAssignmentMethod(assignmentMethod == null ? null : assignmentMethod.value());
return ipAddressAssignment;
}
private static HostNIC getModelHostNic(NetworkAttachment model) {
HostNIC hostNic = model.getHostNic();
if (hostNic == null) {
hostNic = new HostNIC();
model.setHostNic(hostNic);
}
return hostNic;
}
private static Network getModelNetwork(NetworkAttachment model) {
Network network = model.getNetwork();
if (network == null) {
network = new Network();
model.setNetwork(network);
}
return network;
}
}
| {
"content_hash": "ae1e2973d6e480a06a84e01831b1e920",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 120,
"avg_line_length": 39.25257731958763,
"alnum_prop": 0.6451739986868024,
"repo_name": "walteryang47/ovirt-engine",
"id": "7d8f1e396e83d42b362d3f5e4df6d2967f90f2fa",
"size": "7615",
"binary": false,
"copies": "6",
"ref": "refs/heads/eayunos-4.2",
"path": "backend/manager/modules/restapi/types/src/main/java/org/ovirt/engine/api/restapi/types/NetworkAttachmentMapper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "68312"
},
{
"name": "HTML",
"bytes": "16218"
},
{
"name": "Java",
"bytes": "35067647"
},
{
"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": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.