text stringlengths 2 1.04M | meta dict |
|---|---|
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Parsers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Parsers.Tests
{
[TestClass()]
public class ParsersTests
{
/// <summary>
/// 空ソース判定のテスト
/// </summary>
[TestMethod()]
public void EmptyParserTest()
{
Assert.IsTrue(new EmptyParser<char>().Parse(new StringContext("")));
Assert.IsFalse(new EmptyParser<char>().Parse(new StringContext("test")));
}
/// <summary>
/// 任意の1文字マッチのテスト
/// </summary>
[TestMethod()]
public void AnyParserTest()
{
StringContext context = new StringContext("test");
Parser<char> parser = new AnyParser<char>();
Assert.IsTrue(parser.Parse(context));
Assert.IsTrue(parser.Parse(context));
Assert.IsTrue(parser.Parse(context));
Assert.IsTrue(parser.Parse(context));
Assert.IsTrue(context.IsEmpty);
}
/// <summary>
/// 1文字マッチのテスト
/// </summary>
[TestMethod()]
public void CharParserTest()
{
StringContext context = new StringContext("test");
Assert.IsTrue(new CharParser<char>('t').Parse(context));
Assert.IsTrue(new CharParser<char>('e').Parse(context));
Assert.IsTrue(new CharParser<char>('s').Parse(context));
Assert.IsTrue(new CharParser<char>('t').Parse(context));
Assert.IsTrue(context.IsEmpty);
}
/// <summary>
/// 文字列マッチのテスト
/// </summary>
[TestMethod()]
public void StringParserTest()
{
StringContext context = new StringContext("test");
Assert.IsTrue(new StringParser<char>("te").Parse(context));
Assert.IsTrue(new StringParser<char>("st").Parse(context));
Assert.IsTrue(context.IsEmpty);
context = new StringContext("test");
Assert.IsFalse(new StringParser<char>("tesp").Parse(context));
Assert.IsTrue(new StringParser<char>("test").Parse(context));
Assert.IsTrue(context.IsEmpty);
context = new StringContext("test");
Assert.IsFalse(new StringParser<char>("testa").Parse(context));
Assert.IsTrue(new StringParser<char>("test").Parse(context));
Assert.IsTrue(context.IsEmpty);
context = new StringContext("");
Assert.IsFalse(new StringParser<char>("test").Parse(context));
Assert.IsTrue(context.IsEmpty);
}
/// <summary>
/// 文字範囲マッチのテスト
/// </summary>
[TestMethod()]
public void RangeParserTest()
{
StringContext context = new StringContext("test");
Assert.IsTrue(new RangeParser<char>('a', 'z').Parse(context));
Assert.IsTrue(new StringParser<char>("est").Parse(context));
context = new StringContext("test");
Assert.IsFalse(new RangeParser<char>('A', 'Z').Parse(context));
Assert.IsTrue(new StringParser<char>("test").Parse(context));
// 範囲未満・範囲より大のどちらでもfalse
context = new StringContext("B");
Assert.IsFalse(new RangeParser<char>('A', 'A').Parse(context));
Assert.IsFalse(new RangeParser<char>('C', 'C').Parse(context));
Assert.IsTrue(new RangeParser<char>('B', 'B').Parse(context));
// 範囲の上限・下限どちらでもtrue
Assert.IsTrue(new RangeParser<char>('A', 'B').Parse(new StringContext("B")));
Assert.IsTrue(new RangeParser<char>('B', 'C').Parse(new StringContext("B")));
context = new StringContext("");
Assert.IsFalse(new RangeParser<char>('A', 'Z').Parse(context));
Assert.IsTrue(context.IsEmpty);
}
/// <summary>
/// 文字集合マッチのテスト
/// </summary>
[TestMethod()]
public void SetParserTest()
{
StringContext context = new StringContext("test");
Assert.IsTrue(new SetParser<char>('t', 'e', 's').Parse(context));
Assert.IsTrue(new SetParser<char>('t', 'e', 's').Parse(context));
Assert.IsTrue(new SetParser<char>('t', 'e', 's').Parse(context));
Assert.IsTrue(new SetParser<char>('t', 'e', 's').Parse(context));
Assert.IsFalse(new SetParser<char>('t', 'e', 's').Parse(context));
Assert.IsTrue(context.IsEmpty);
Assert.IsFalse(new SetParser<char>('a', 'b', 'c').Parse(new StringContext("test")));
context = new StringContext("");
Assert.IsFalse(new SetParser<char>('a', 'b', 'c').Parse(context));
Assert.IsTrue(context.IsEmpty);
Assert.IsFalse(new SetParser<char>().Parse(context));
Assert.IsTrue(context.IsEmpty);
}
/// <summary>
/// 存在確認Parserのテスト
/// </summary>
[TestMethod()]
public void ExistParserTest()
{
StringContext context = new StringContext("test");
Assert.IsTrue(new ExistParser<char>(new CharParser<char>('t')).Parse(context));
Assert.IsFalse(new ExistParser<char>(new CharParser<char>('e')).Parse(context));
Assert.IsTrue(new StringParser<char>("test").Parse(context));
}
/// <summary>
/// 非存在確認Parserのテスト
/// </summary>
[TestMethod()]
public void NotExistParserTest()
{
StringContext context = new StringContext("test");
Assert.IsFalse(new NotExistParser<char>(new CharParser<char>('t')).Parse(context));
Assert.IsTrue(new NotExistParser<char>(new CharParser<char>('e')).Parse(context));
Assert.IsTrue(new StringParser<char>("test").Parse(context));
}
/// <summary>
/// オプションParserのテスト
/// </summary>
[TestMethod()]
public void OptionalParserTest()
{
Parser<char> parser = new OptionalParser<char>(new CharParser<char>('t'));
StringContext context = new StringContext("test");
Assert.IsTrue(parser.Parse(context));
Assert.AreEqual(1, context.Position);
// 成功するが位置は進まない
Assert.IsTrue(parser.Parse(context));
Assert.AreEqual(1, context.Position);
Assert.IsTrue(parser.Parse(context));
Assert.AreEqual(1, context.Position);
}
/// <summary>
/// 0回以上繰り返しParserのテスト
/// </summary>
[TestMethod()]
public void ZeroOrMoreParserTest()
{
Parser<char> parser = new ZeroOrMoreParser<char>(new CharParser<char>('t'));
StringContext context = new StringContext("tttest");
Assert.IsTrue(parser.Parse(context));
Assert.AreEqual(3, context.Position);
// 成功するが位置は進まない
Assert.IsTrue(parser.Parse(context));
Assert.AreEqual(3, context.Position);
Assert.IsTrue(parser.Parse(context));
Assert.AreEqual(3, context.Position);
Assert.IsTrue(parser.Parse(context));
Assert.AreEqual(3, context.Position);
}
/// <summary>
/// 1回以上繰り返しParserのテスト
/// </summary>
[TestMethod()]
public void OneOrMoreParserTest()
{
Parser<char> parser = new OneOrMoreParser<char>(new CharParser<char>('t'));
StringContext context = new StringContext("tttest");
Assert.IsTrue(parser.Parse(context));
Assert.AreEqual(3, context.Position);
Assert.IsFalse(parser.Parse(context));
Assert.AreEqual(3, context.Position);
}
/// <summary>
/// 連接Parserのテスト
/// </summary>
[TestMethod()]
public void SequenceParserTest()
{
// tとeの連接
Parser<char> parser = new SequenceParser<char>(new CharParser<char>('t'), new CharParser<char>('e'));
StringContext context = new StringContext("test");
Assert.IsTrue(parser.Parse(context));
Assert.IsTrue(new StringParser<char>("st").Parse(context));
Assert.IsTrue(context.IsEmpty);
context = new StringContext("tset");
Assert.IsFalse(parser.Parse(context));
Assert.IsTrue(new StringParser<char>("tset").Parse(context));
Assert.IsTrue(context.IsEmpty);
}
/// <summary>
/// 選択Parserのテスト
/// </summary>
[TestMethod()]
public void ChoiceParserTest()
{
// tとeの選択
Parser<char> parser = new ChoiceParser<char>(new CharParser<char>('t'), new CharParser<char>('e'));
StringContext context = new StringContext("test");
Assert.IsTrue(parser.Parse(context));
Assert.IsTrue(parser.Parse(context));
Assert.IsFalse(parser.Parse(context));
Assert.IsTrue(new StringParser<char>("st").Parse(context));
Assert.IsTrue(context.IsEmpty);
context = new StringContext("etst");
Assert.IsTrue(parser.Parse(context));
Assert.IsTrue(parser.Parse(context));
Assert.IsFalse(parser.Parse(context));
Assert.IsTrue(new StringParser<char>("st").Parse(context));
Assert.IsTrue(context.IsEmpty);
}
/// <summary>
/// NodeParserのテスト
/// </summary>
[TestMethod()]
public void NodeParserTest()
{
Parser<Char> parser = new NodeParser<char>(100, new SequenceParser<char>(
new CharParser<char>('t'),
new NodeParser<char>(200, new CharParser<char>('e')),
new CharParser<char>('s')
)
);
StringContext context = new StringContext("test");
Assert.IsTrue(parser.Parse(context));
Assert.AreEqual(context.Position, 3);
Assert.AreEqual(context.Nodes.Count(), 1);
Node node = context.Nodes.First();
Assert.AreEqual(node.Tag, 100);
Assert.AreEqual(node.Begin, 0);
Assert.AreEqual(node.End, 3);
Assert.AreEqual(node.Children.Count(), 1);
Node child = node.Children.First();
Assert.AreEqual(child.Tag, 200);
Assert.AreEqual(child.Begin, 1);
Assert.AreEqual(child.End, 2);
Assert.AreEqual(child.Children.Count(), 0);
}
/// <summary>
/// NodeParserのBacktrack時のテスト
/// </summary>
[TestMethod()]
public void NodeParserBacktrackTest()
{
Parser<Char> parser = new ChoiceParser<char>(
new NodeParser<char>(100, new StringParser<char>("tess")),
new NodeParser<char>(200, new StringParser<char>("test")));
StringContext context = new StringContext("test");
Assert.IsTrue(parser.Parse(context));
Assert.AreEqual(context.Position, 4);
Assert.AreEqual(context.Nodes.Count(), 1);
Node node = context.Nodes.First();
Assert.AreEqual(node.Tag, 200);
Assert.AreEqual(node.Begin, 0);
Assert.AreEqual(node.End, 4);
Assert.AreEqual(node.Children.Count(), 0);
}
}
} | {
"content_hash": "32bd43345f34cdc74f4f632bf92ef930",
"timestamp": "",
"source": "github",
"line_count": 306,
"max_line_length": 113,
"avg_line_length": 37.552287581699346,
"alnum_prop": 0.5590462100774519,
"repo_name": "scienceagora4dim/cube4d",
"id": "25aef592a667e4de6524222bba553edcfed52486",
"size": "11881",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cube4d.CSharpTests/Assets/scripts/parser/ParserTests.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "115231"
},
{
"name": "GLSL",
"bytes": "6632"
}
],
"symlink_target": ""
} |
import GLM from "grimoirejs-math/ref/GLM";
import Matrix from "grimoirejs-math/ref/Matrix";
import Quaternion from "grimoirejs-math/ref/Quaternion";
import Vector3 from "grimoirejs-math/ref/Vector3";
import Vector4 from "grimoirejs-math/ref/Vector4";
import Component from "grimoirejs/ref/Node/Component";
import IAttributeDeclaration from "grimoirejs/ref/Node/IAttributeDeclaration";
import CameraComponent from "./CameraComponent";
const {mat4, vec3, vec4} = GLM;
/**
* シーン中に存在する物体の変形を司るコンポーネント
* このコンポーネントによって物体の座標や回転量、拡大料などが定義されます。
* シーン中の全ての物体は必ずこのコンポーネントを含まなければなりません。
*/
export default class TransformComponent extends Component {
public static attributes: { [key: string]: IAttributeDeclaration } = {
/**
* この物体の座標
*/
position: {
converter: "Vector3",
default: [0, 0, 0],
},
/**
* この物体の回転量
*/
rotation: {
converter: "Rotation3",
default: [0, 0, 0, 1],
},
/**
* この物体の拡大率
*/
scale: {
converter: "Vector3",
default: [1, 1, 1],
},
};
/**
* Source vector to be multiplied with global transform to calculate forward direction of attached object.
*/
private static _forwardBase: Vector4 = new Vector4(0, 0, -1, 0);
/**
* Source vector to be multiplied with global transform to calculate up direction of attached object.
*/
private static _upBase: Vector4 = new Vector4(0, 1, 0, 0);
/**
* Source vector to be multiplied with global transform to calculate right direction of attached object.
*/
private static _rightBase: Vector4 = new Vector4(1, 0, 0, 0);
/**
* Local transform matrix representing scaling,rotation and translation of attached object.
* @return {[type]} [description]
*/
public localTransform: Matrix = new Matrix();
public scale: Vector3;
public position: Vector3;
public rotation: Quaternion;
/**
* The children transform should be notified when this transform was updated.
* @type {TransformComponent[]}
*/
private _children: TransformComponent[] = [];
/**
* The reference to parent TransformComponent.
* When this object is root object of contained scene, this value should be null.
* @type {TransformComponent}
*/
private _parentTransform: TransformComponent;
/**
* Calculation cache to
* @return {[type]} [description]
*/
private _cachePVM: Matrix = new Matrix();
private _cacheVM: Matrix = new Matrix();
/**
* Cache of forward direction of this object
*/
private _forward: Vector3 = new Vector3([0, 0, -1, 0]);
/**
* Cache of up direction of this object.
*/
private _up: Vector3 = new Vector3([0, 1, 0, 0]);
/**
* Cache of right direction of this object.
*/
private _right: Vector3 = new Vector3([1, 0, 0, 0]);
private _globalPosition: Vector3 = new Vector3([0, 0, 0]);
private _globalScale: Vector3 = new Vector3([1, 1, 1]);
private _matrixTransformMode = false;
private _updatedTransform = true;
private _globalTransform: Matrix = new Matrix();
private _globalTransformInverse: Matrix;
/**
* Global transform that consider parent transform and local transform
* @return {[type]} [description]
*/
public get globalTransform(): Matrix {
this._updateTransform();
return this._globalTransform;
}
public get globalTransformInverse(): Matrix {
if (!this._globalTransformInverse) {
this._globalTransformInverse = Matrix.inverse(this.globalTransform);
}else {
this._updateTransform();
}
return this._globalTransformInverse;
}
public get globalPosition(): Vector3 {
this._updateTransform();
return this._globalPosition;
}
public get globalScale(): Vector3 {
this._updateTransform();
return this._globalScale;
}
public get forward(): Vector3 {
this._updateTransform();
return this._forward;
}
public get up(): Vector3 {
this._updateTransform();
return this._up;
}
public get right(): Vector3 {
this._updateTransform();
return this._right;
}
public calcPVM(camera: CameraComponent): Matrix {
mat4.mul(this._cachePVM.rawElements, camera.ProjectionViewMatrix.rawElements, this.globalTransform.rawElements);
return this._cachePVM;
}
public calcVM(camera: CameraComponent): Matrix {
mat4.mul(this._cacheVM.rawElements, camera.ViewMatrix.rawElements, this.globalTransform.rawElements);
return this._cacheVM;
}
public $awake(): void {
// register observers
this.getAttributeRaw("position").watch((v) => {
this.notifyUpdateTransform();
});
this.getAttributeRaw("rotation").watch((v) => {
this.notifyUpdateTransform();
});
this.getAttributeRaw("scale").watch((v) => {
this.notifyUpdateTransform();
});
// assign attribute values to field
this.__bindAttributes();
}
public $mount(): void {
this._parentTransform = this.node.parent.getComponent(TransformComponent);
if (this._parentTransform) {
this._parentTransform._children.push(this);
}
this._updateTransform();
}
public $unmount(): void {
if (this._parentTransform) {
this._parentTransform._children.splice(this._parentTransform._children.indexOf(this), 1);
this._parentTransform = null;
}
}
public notifyUpdateTransform(): void {
if (!this._updatedTransform) {
this._updatedTransform = true;
this._children.forEach(c => c.notifyUpdateTransform());
}
}
public applyMatrix(mat: Matrix): void {
this.setAttribute("scale", mat.getScaling());
this.setAttribute("rotation", mat.getRotation());
this.setAttribute("position", mat.getTranslation());
}
private _updateTransform(noDirectionalUpdate?: boolean): void {
if (!this._updatedTransform) {
return;
}
this._updatedTransform = false;
mat4.fromRotationTranslationScale(this.localTransform.rawElements, this.rotation.rawElements, this.position.rawElements, this.scale.rawElements);
this._updateGlobalTransform(noDirectionalUpdate);
}
/**
* Update global transoform.
*/
private _updateGlobalTransform(noDirectionalUpdate?: boolean): void {
if (!this._parentTransform) {
mat4.copy(this._globalTransform.rawElements, this.localTransform.rawElements);
} else {
mat4.mul(this._globalTransform.rawElements, this._parentTransform.globalTransform.rawElements, this.localTransform.rawElements);
}
if (this._globalTransformInverse) { // Once globalTransformInverse was requested from the other class, this will be updated after that frame
mat4.invert(this._globalTransformInverse.rawElements, this._globalTransform.rawElements);
}
if (!noDirectionalUpdate) {
this._updateDirections();
}
this._updateGlobalProperty();
this.node.emit("transformUpdated", this);
}
private _updateDirections(): void {
vec4.transformMat4(this._forward.rawElements, TransformComponent._forwardBase.rawElements, this.globalTransform.rawElements);
vec4.transformMat4(this._up.rawElements, TransformComponent._upBase.rawElements, this.globalTransform.rawElements);
vec4.transformMat4(this._right.rawElements, TransformComponent._rightBase.rawElements, this.globalTransform.rawElements);
}
private _updateGlobalProperty(): void {
if (!this._parentTransform) {
vec3.copy(this._globalPosition.rawElements, this.position.rawElements);
vec3.copy(this._globalScale.rawElements, this.scale.rawElements);
} else {
vec3.transformMat4(this._globalPosition.rawElements, this.position.rawElements, this._parentTransform.globalTransform.rawElements);
vec3.transformMat4(this._globalScale.rawElements, this.scale.rawElements, this._parentTransform.globalTransform.rawElements); // TODO buggy
}
}
}
| {
"content_hash": "bc5e9b3e6830d8ed1e20a97342cdfed5",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 149,
"avg_line_length": 30.865079365079364,
"alnum_prop": 0.6914373875032142,
"repo_name": "GrimoireGL/grimoirejs-fundamental",
"id": "cb856db0701674c6a96e7ed65efc6a95ea49a314",
"size": "8014",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Components/TransformComponent.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "GLSL",
"bytes": "2847"
},
{
"name": "HTML",
"bytes": "478"
},
{
"name": "JavaScript",
"bytes": "8720"
},
{
"name": "Shell",
"bytes": "635"
},
{
"name": "TypeScript",
"bytes": "347457"
}
],
"symlink_target": ""
} |
"""Representing and manipulating email headers via custom objects.
This module provides an implementation of the HeaderRegistry API.
The implementation is designed to flexibly follow RFC5322 rules.
Eventually HeaderRegistry will be a public API, but it isn't yet,
and will probably change some before that happens.
"""
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from future.builtins import super
from future.builtins import str
from future.utils import text_to_native_str
from future.backports.email import utils
from future.backports.email import errors
from future.backports.email import _header_value_parser as parser
class Address(object):
def __init__(self, display_name='', username='', domain='', addr_spec=None):
"""Create an object represeting a full email address.
An address can have a 'display_name', a 'username', and a 'domain'. In
addition to specifying the username and domain separately, they may be
specified together by using the addr_spec keyword *instead of* the
username and domain keywords. If an addr_spec string is specified it
must be properly quoted according to RFC 5322 rules; an error will be
raised if it is not.
An Address object has display_name, username, domain, and addr_spec
attributes, all of which are read-only. The addr_spec and the string
value of the object are both quoted according to RFC5322 rules, but
without any Content Transfer Encoding.
"""
# This clause with its potential 'raise' may only happen when an
# application program creates an Address object using an addr_spec
# keyword. The email library code itself must always supply username
# and domain.
if addr_spec is not None:
if username or domain:
raise TypeError("addrspec specified when username and/or "
"domain also specified")
a_s, rest = parser.get_addr_spec(addr_spec)
if rest:
raise ValueError("Invalid addr_spec; only '{}' "
"could be parsed from '{}'".format(
a_s, addr_spec))
if a_s.all_defects:
raise a_s.all_defects[0]
username = a_s.local_part
domain = a_s.domain
self._display_name = display_name
self._username = username
self._domain = domain
@property
def display_name(self):
return self._display_name
@property
def username(self):
return self._username
@property
def domain(self):
return self._domain
@property
def addr_spec(self):
"""The addr_spec (username@domain) portion of the address, quoted
according to RFC 5322 rules, but with no Content Transfer Encoding.
"""
nameset = set(self.username)
if len(nameset) > len(nameset - parser.DOT_ATOM_ENDS):
lp = parser.quote_string(self.username)
else:
lp = self.username
if self.domain:
return lp + '@' + self.domain
if not lp:
return '<>'
return lp
def __repr__(self):
return "Address(display_name={!r}, username={!r}, domain={!r})".format(
self.display_name, self.username, self.domain)
def __str__(self):
nameset = set(self.display_name)
if len(nameset) > len(nameset - parser.SPECIALS):
disp = parser.quote_string(self.display_name)
else:
disp = self.display_name
if disp:
addr_spec = '' if self.addr_spec == '<>' else self.addr_spec
return "{} <{}>".format(disp, addr_spec)
return self.addr_spec
def __eq__(self, other):
if type(other) != type(self):
return False
return (self.display_name == other.display_name and
self.username == other.username and
self.domain == other.domain)
class Group(object):
def __init__(self, display_name=None, addresses=None):
"""Create an object representing an address group.
An address group consists of a display_name followed by colon and an
list of addresses (see Address) terminated by a semi-colon. The Group
is created by specifying a display_name and a possibly empty list of
Address objects. A Group can also be used to represent a single
address that is not in a group, which is convenient when manipulating
lists that are a combination of Groups and individual Addresses. In
this case the display_name should be set to None. In particular, the
string representation of a Group whose display_name is None is the same
as the Address object, if there is one and only one Address object in
the addresses list.
"""
self._display_name = display_name
self._addresses = tuple(addresses) if addresses else tuple()
@property
def display_name(self):
return self._display_name
@property
def addresses(self):
return self._addresses
def __repr__(self):
return "Group(display_name={!r}, addresses={!r}".format(
self.display_name, self.addresses)
def __str__(self):
if self.display_name is None and len(self.addresses) == 1:
return str(self.addresses[0])
disp = self.display_name
if disp is not None:
nameset = set(disp)
if len(nameset) > len(nameset - parser.SPECIALS):
disp = parser.quote_string(disp)
adrstr = ", ".join(str(x) for x in self.addresses)
adrstr = ' ' + adrstr if adrstr else adrstr
return "{}:{};".format(disp, adrstr)
def __eq__(self, other):
if type(other) != type(self):
return False
return (self.display_name == other.display_name and
self.addresses == other.addresses)
# Header Classes #
class BaseHeader(str):
"""Base class for message headers.
Implements generic behavior and provides tools for subclasses.
A subclass must define a classmethod named 'parse' that takes an unfolded
value string and a dictionary as its arguments. The dictionary will
contain one key, 'defects', initialized to an empty list. After the call
the dictionary must contain two additional keys: parse_tree, set to the
parse tree obtained from parsing the header, and 'decoded', set to the
string value of the idealized representation of the data from the value.
(That is, encoded words are decoded, and values that have canonical
representations are so represented.)
The defects key is intended to collect parsing defects, which the message
parser will subsequently dispose of as appropriate. The parser should not,
insofar as practical, raise any errors. Defects should be added to the
list instead. The standard header parsers register defects for RFC
compliance issues, for obsolete RFC syntax, and for unrecoverable parsing
errors.
The parse method may add additional keys to the dictionary. In this case
the subclass must define an 'init' method, which will be passed the
dictionary as its keyword arguments. The method should use (usually by
setting them as the value of similarly named attributes) and remove all the
extra keys added by its parse method, and then use super to call its parent
class with the remaining arguments and keywords.
The subclass should also make sure that a 'max_count' attribute is defined
that is either None or 1. XXX: need to better define this API.
"""
def __new__(cls, name, value):
kwds = {'defects': []}
cls.parse(value, kwds)
if utils._has_surrogates(kwds['decoded']):
kwds['decoded'] = utils._sanitize(kwds['decoded'])
self = str.__new__(cls, kwds['decoded'])
# del kwds['decoded']
self.init(name, **kwds)
return self
def init(self, name, **_3to2kwargs):
defects = _3to2kwargs['defects'];
del _3to2kwargs['defects']
parse_tree = _3to2kwargs['parse_tree'];
del _3to2kwargs['parse_tree']
self._name = name
self._parse_tree = parse_tree
self._defects = defects
@property
def name(self):
return self._name
@property
def defects(self):
return tuple(self._defects)
def __reduce__(self):
return (
_reconstruct_header,
(
self.__class__.__name__,
self.__class__.__bases__,
str(self),
),
self.__dict__)
@classmethod
def _reconstruct(cls, value):
return str.__new__(cls, value)
def fold(self, **_3to2kwargs):
policy = _3to2kwargs['policy'];
del _3to2kwargs['policy']
"""Fold header according to policy.
The parsed representation of the header is folded according to
RFC5322 rules, as modified by the policy. If the parse tree
contains surrogateescaped bytes, the bytes are CTE encoded using
the charset 'unknown-8bit".
Any non-ASCII characters in the parse tree are CTE encoded using
charset utf-8. XXX: make this a policy setting.
The returned value is an ASCII-only string possibly containing linesep
characters, and ending with a linesep character. The string includes
the header name and the ': ' separator.
"""
# At some point we need to only put fws here if it was in the source.
header = parser.Header([
parser.HeaderLabel([
parser.ValueTerminal(self.name, 'header-name'),
parser.ValueTerminal(':', 'header-sep')]),
parser.CFWSList([parser.WhiteSpaceTerminal(' ', 'fws')]),
self._parse_tree])
return header.fold(policy=policy)
def _reconstruct_header(cls_name, bases, value):
return type(text_to_native_str(cls_name), bases, {})._reconstruct(value)
class UnstructuredHeader(object):
max_count = None
value_parser = staticmethod(parser.get_unstructured)
@classmethod
def parse(cls, value, kwds):
kwds['parse_tree'] = cls.value_parser(value)
kwds['decoded'] = str(kwds['parse_tree'])
class UniqueUnstructuredHeader(UnstructuredHeader):
max_count = 1
class DateHeader(object):
"""Header whose value consists of a single timestamp.
Provides an additional attribute, datetime, which is either an aware
datetime using a timezone, or a naive datetime if the timezone
in the input string is -0000. Also accepts a datetime as input.
The 'value' attribute is the normalized form of the timestamp,
which means it is the output of format_datetime on the datetime.
"""
max_count = None
# This is used only for folding, not for creating 'decoded'.
value_parser = staticmethod(parser.get_unstructured)
@classmethod
def parse(cls, value, kwds):
if not value:
kwds['defects'].append(errors.HeaderMissingRequiredValue())
kwds['datetime'] = None
kwds['decoded'] = ''
kwds['parse_tree'] = parser.TokenList()
return
if isinstance(value, str):
value = utils.parsedate_to_datetime(value)
kwds['datetime'] = value
kwds['decoded'] = utils.format_datetime(kwds['datetime'])
kwds['parse_tree'] = cls.value_parser(kwds['decoded'])
def init(self, *args, **kw):
self._datetime = kw.pop('datetime')
super().init(*args, **kw)
@property
def datetime(self):
return self._datetime
class UniqueDateHeader(DateHeader):
max_count = 1
class AddressHeader(object):
max_count = None
@staticmethod
def value_parser(value):
address_list, value = parser.get_address_list(value)
assert not value, 'this should not happen'
return address_list
@classmethod
def parse(cls, value, kwds):
if isinstance(value, str):
# We are translating here from the RFC language (address/mailbox)
# to our API language (group/address).
kwds['parse_tree'] = address_list = cls.value_parser(value)
groups = []
for addr in address_list.addresses:
groups.append(Group(addr.display_name,
[Address(mb.display_name or '',
mb.local_part or '',
mb.domain or '')
for mb in addr.all_mailboxes]))
defects = list(address_list.all_defects)
else:
# Assume it is Address/Group stuff
if not hasattr(value, '__iter__'):
value = [value]
groups = [Group(None, [item]) if not hasattr(item, 'addresses')
else item
for item in value]
defects = []
kwds['groups'] = groups
kwds['defects'] = defects
kwds['decoded'] = ', '.join([str(item) for item in groups])
if 'parse_tree' not in kwds:
kwds['parse_tree'] = cls.value_parser(kwds['decoded'])
def init(self, *args, **kw):
self._groups = tuple(kw.pop('groups'))
self._addresses = None
super().init(*args, **kw)
@property
def groups(self):
return self._groups
@property
def addresses(self):
if self._addresses is None:
self._addresses = tuple([address for group in self._groups
for address in group.addresses])
return self._addresses
class UniqueAddressHeader(AddressHeader):
max_count = 1
class SingleAddressHeader(AddressHeader):
@property
def address(self):
if len(self.addresses) != 1:
raise ValueError(("value of single address header {} is not "
"a single address").format(self.name))
return self.addresses[0]
class UniqueSingleAddressHeader(SingleAddressHeader):
max_count = 1
class MIMEVersionHeader(object):
max_count = 1
value_parser = staticmethod(parser.parse_mime_version)
@classmethod
def parse(cls, value, kwds):
kwds['parse_tree'] = parse_tree = cls.value_parser(value)
kwds['decoded'] = str(parse_tree)
kwds['defects'].extend(parse_tree.all_defects)
kwds['major'] = None if parse_tree.minor is None else parse_tree.major
kwds['minor'] = parse_tree.minor
if parse_tree.minor is not None:
kwds['version'] = '{}.{}'.format(kwds['major'], kwds['minor'])
else:
kwds['version'] = None
def init(self, *args, **kw):
self._version = kw.pop('version')
self._major = kw.pop('major')
self._minor = kw.pop('minor')
super().init(*args, **kw)
@property
def major(self):
return self._major
@property
def minor(self):
return self._minor
@property
def version(self):
return self._version
class ParameterizedMIMEHeader(object):
# Mixin that handles the params dict. Must be subclassed and
# a property value_parser for the specific header provided.
max_count = 1
@classmethod
def parse(cls, value, kwds):
kwds['parse_tree'] = parse_tree = cls.value_parser(value)
kwds['decoded'] = str(parse_tree)
kwds['defects'].extend(parse_tree.all_defects)
if parse_tree.params is None:
kwds['params'] = {}
else:
# The MIME RFCs specify that parameter ordering is arbitrary.
kwds['params'] = dict((utils._sanitize(name).lower(),
utils._sanitize(value))
for name, value in parse_tree.params)
def init(self, *args, **kw):
self._params = kw.pop('params')
super().init(*args, **kw)
@property
def params(self):
return self._params.copy()
class ContentTypeHeader(ParameterizedMIMEHeader):
value_parser = staticmethod(parser.parse_content_type_header)
def init(self, *args, **kw):
super().init(*args, **kw)
self._maintype = utils._sanitize(self._parse_tree.maintype)
self._subtype = utils._sanitize(self._parse_tree.subtype)
@property
def maintype(self):
return self._maintype
@property
def subtype(self):
return self._subtype
@property
def content_type(self):
return self.maintype + '/' + self.subtype
class ContentDispositionHeader(ParameterizedMIMEHeader):
value_parser = staticmethod(parser.parse_content_disposition_header)
def init(self, *args, **kw):
super().init(*args, **kw)
cd = self._parse_tree.content_disposition
self._content_disposition = cd if cd is None else utils._sanitize(cd)
@property
def content_disposition(self):
return self._content_disposition
class ContentTransferEncodingHeader(object):
max_count = 1
value_parser = staticmethod(parser.parse_content_transfer_encoding_header)
@classmethod
def parse(cls, value, kwds):
kwds['parse_tree'] = parse_tree = cls.value_parser(value)
kwds['decoded'] = str(parse_tree)
kwds['defects'].extend(parse_tree.all_defects)
def init(self, *args, **kw):
super().init(*args, **kw)
self._cte = utils._sanitize(self._parse_tree.cte)
@property
def cte(self):
return self._cte
# The header factory #
_default_header_map = {
'subject': UniqueUnstructuredHeader,
'date': UniqueDateHeader,
'resent-date': DateHeader,
'orig-date': UniqueDateHeader,
'sender': UniqueSingleAddressHeader,
'resent-sender': SingleAddressHeader,
'to': UniqueAddressHeader,
'resent-to': AddressHeader,
'cc': UniqueAddressHeader,
'resent-cc': AddressHeader,
'bcc': UniqueAddressHeader,
'resent-bcc': AddressHeader,
'from': UniqueAddressHeader,
'resent-from': AddressHeader,
'reply-to': UniqueAddressHeader,
'mime-version': MIMEVersionHeader,
'content-type': ContentTypeHeader,
'content-disposition': ContentDispositionHeader,
'content-transfer-encoding': ContentTransferEncodingHeader,
}
class HeaderRegistry(object):
"""A header_factory and header registry."""
def __init__(self, base_class=BaseHeader, default_class=UnstructuredHeader,
use_default_map=True):
"""Create a header_factory that works with the Policy API.
base_class is the class that will be the last class in the created
header class's __bases__ list. default_class is the class that will be
used if "name" (see __call__) does not appear in the registry.
use_default_map controls whether or not the default mapping of names to
specialized classes is copied in to the registry when the factory is
created. The default is True.
"""
self.registry = {}
self.base_class = base_class
self.default_class = default_class
if use_default_map:
self.registry.update(_default_header_map)
def map_to_type(self, name, cls):
"""Register cls as the specialized class for handling "name" headers.
"""
self.registry[name.lower()] = cls
def __getitem__(self, name):
cls = self.registry.get(name.lower(), self.default_class)
return type(text_to_native_str('_' + cls.__name__), (cls, self.base_class), {})
def __call__(self, name, value):
"""Create a header instance for header 'name' from 'value'.
Creates a header instance by creating a specialized class for parsing
and representing the specified header by combining the factory
base_class with a specialized class from the registry or the
default_class, and passing the name and value to the constructed
class's constructor.
"""
return self[name](name, value)
| {
"content_hash": "c0f9a590f70d49c542c94c62e0316e63",
"timestamp": "",
"source": "github",
"line_count": 580,
"max_line_length": 87,
"avg_line_length": 34.855172413793106,
"alnum_prop": 0.619608231104076,
"repo_name": "thonkify/thonkify",
"id": "0fcb97e4db4e101283e868549389e79d6bee6878",
"size": "20216",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/lib/future/backports/email/headerregistry.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "10460214"
},
{
"name": "Shell",
"bytes": "1470"
}
],
"symlink_target": ""
} |
<?php
namespace App\Modules\Themes\Listeners;
use App\Modules\Core\Events\InstallSeedEvent;
use App\Modules\Themes\Models\Theme;
class InstallSeedListener
{
/**
* Handle the event.
*
* @param OrderShipped $event
* @return void
*/
public function handle(InstallSeedEvent $event)
{
$theme = new Theme;
$theme->name = 'Default';
$theme->user_id = 1;
$theme->status = 1;
$theme->custom = 0;
$theme->save();
}
}
| {
"content_hash": "119ef7d2181736da29b20ef7e8130a45",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 51,
"avg_line_length": 18,
"alnum_prop": 0.5773809523809523,
"repo_name": "adaptcms/AdaptCMS",
"id": "b9b5a11124fd82e489ad937f29feabbe3a668365",
"size": "504",
"binary": false,
"copies": "1",
"ref": "refs/heads/4.0",
"path": "app/Modules/Themes/Listeners/InstallSeedListener.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "217695"
},
{
"name": "HTML",
"bytes": "300854"
},
{
"name": "JavaScript",
"bytes": "1181402"
},
{
"name": "PHP",
"bytes": "431913"
},
{
"name": "Vue",
"bytes": "45757"
}
],
"symlink_target": ""
} |
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class server_datatables extends CI_Controller {
public $uri_privileged;
function __construct() {
parent::__construct();
// To load the CI benchmark and memory usage profiler - set 1==1.
if (1 == 2) {
$sections = array(
'benchmarks' => TRUE, 'memory_usage' => TRUE,
'config' => FALSE, 'controller_info' => FALSE, 'get' => FALSE, 'post' => FALSE, 'queries' => FALSE,
'uri_string' => FALSE, 'http_headers' => FALSE, 'session_data' => FALSE
);
$this->output->set_profiler_sections($sections);
$this->output->enable_profiler(TRUE);
}
// IMPORTANT! This global must be defined BEFORE the flexi auth library is loaded!
// It is used as a global that is accessible via both models and both libraries, without it, flexi auth will not work.
$this->auth = new stdClass;
// Load 'standard' flexi auth library by default.
$this->load->library('flexi_auth');
// Check user is logged in as an admin.
// For security, admin users should always sign in via Password rather than 'Remember me'.
if (!$this->flexi_auth->is_logged_in_via_password()) {
// Set a custom error message.
$this->flexi_auth->set_error_message('You must login as an admin to access this area.', TRUE);
$this->session->set_flashdata('message', $this->flexi_auth->get_messages());
redirect('auth');
}
// Note: This is only included to create base urls for purposes of this demo only and are not necessarily considered as 'Best practice'.
$this->load->vars('base_url', base_url());
$this->load->vars('includes_dir', base_url() . 'includes/');
$this->load->vars('current_url', $this->uri->uri_to_assoc(1));
// Define a global variable to store data that is then used by the end view page.
$this->data = null;
// get user data
$user_data = $this->flexi_auth->get_user_by_id($this->flexi_auth->get_user_id())->row();
$this->data['designation'] = $user_data->ugrp_name;
$this->data['user_name'] = $user_data->upro_first_name . ' ' . $user_data->upro_last_name;
// load product model
$this->load->model('admin/requisition_model');
// Load Menu Model
$this->load->model('admin/menu_model');
//get uri segment for active menu
$this->data['uri_3'] = $this->uri->segment(3);
$this->data['uri_2'] = $this->uri->segment(2);
$this->data['uri_1'] = $this->uri->segment(1);
$this->data['sub_menu'] = $this->data['uri_1'].'/'.$this->data['uri_2'].'/'.$this->data['uri_3'];
$this->data['menu'] = $this->data['uri_2'];
// Get User Privilege
$check_slash = substr($this->data['sub_menu'], -1);
$check_slash = ($check_slash == "/")?$this->data['sub_menu']:$this->data['sub_menu']."/";
$check_slash = str_replace("//","/",$check_slash);
$this->uri_privileged = $this->menu_model->get_privilege_name($check_slash);
$this->data['menu_title'] = $this->uri_privileged;
}
/*
|------------------------------------------------
| start: get_requisition function
|------------------------------------------------
|
| This function get requisition and search requisition
| via ajax
|
*/
function get_requisition() {
//echo '<pre>'; print_r($this->input->post()); die();
// database column for searching
$db_column = array('r.requisition_id', 'r.requisition_num', 'r.date_req', 'r.date_req_until', 'r.approving_authority', 'r.is_approved', 'r.status', 'c.category');
// load requisition model
$this->load->model('admin/requisition_model');
// *****************************************
// start: get all requitision or search requisition
// *****************************************
$db_where_column = array();
$db_where_value = array();
$db_where_column_or = array('r.status', 'r.status', 'r.status', 'r.status');
$db_where_value_or = array(1, 2, 3 ,4);
$db_limit = array();
$db_order = array();
/***** start: record length and start *****/
if($this->input->post('length') != '-1') {
$db_limit['limit'] = $this->input->post('length');
$db_limit['pageStart'] = $this->input->post('start');
}
// end: get data order by
/***** start: get data order by *****/
$order = $this->input->post('order');
if($order) {
foreach($order as $key => $get_order) {
$db_order[$key]['title'] = $db_column[$get_order['column']-1];
$db_order[$key]['order_by'] = $get_order['dir'];
}
}
// end: get data order by
/***** start: top search data by equal to *****/
if($this->input->post('top_search_like')) {
foreach($this->input->post('top_search_like') as $key => $search_val) {
if(preg_match('/prod/', $key)) {
$search_key = substr($key, 5);
if(!empty($search_val)) {
$db_where_column[] = $search_key . ' LIKE';
$db_where_value[] = '%' . $search_val . '%';
}
}
}
}
if($this->input->post('top_search')) {
foreach($this->input->post('top_search') as $key => $search_val) {
if(preg_match('/prod/', $key)) {
$search_key = substr($key, 5);
if($search_val!="") {
$db_where_column[] = $search_key;
$db_where_value[] = $search_val;
}
}
}
}
// end: top search data by equal to
/***** start: search data by like *****/
$search = $this->input->post('search');
if($search['value'] != '') {
foreach($db_column as $value) {
$db_where_column_or[] = $value . ' LIKE';
$db_where_value_or[] = '%' . $search['value'] . '%';
}
}
// end: search data by like
$dataRecord = $this->requisition_model->get_requisition($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or, $db_limit, $db_order);
$dataCount = $this->requisition_model->get_requisition($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or);
// end: get all requisitions or search requisition
$dt_column = array('category', 'requisition_num', 'description', 'date_req', 'date_req_until', 'project_name', 'location_name', 'approving_authority_name', 'is_approved');
$data = array();
$i = 0;
if($dataRecord) {
$view = "admin/requisition/view/";
$edit = "";//"admin/requisition/edit/";
$remove = "";//"admin/requisition/delete_requisition/";
$btn_arr_responce = $this->create_action_array($view,$edit,$remove);
foreach($dataRecord as $key => $value) {
$btn_array_checked_checkbox = "admin/product/delete_checked_checkbox/";
$checkbox = "";
/*if(!$this->flexi_auth->is_privileged($this->menu_model->get_privilege_name($btn_array_checked_checkbox))){
$checkbox="disabled";
}
$data[$i][] = '<div class="checkbox-table"><label>
<input type="checkbox" '.$checkbox.' name="requisition['.$value['requisition_id'].']" class="flat-grey deleteThis">
</label></div>';*/
$data[$i][] = $i+1;
foreach($dt_column as $get_dt_column) {
if($get_dt_column == 'is_approved'){
if ($value[$get_dt_column] == 1) {
$data[$i][] = 'Approved';
}
else if ($value[$get_dt_column] == 2) {
$data[$i][] = 'Rejected';
}
else {
$data[$i][] = 'Not Approved';
}
}
else if($get_dt_column == 'date_req'){
$data[$i][] = date("d/M/Y", strtotime($value[$get_dt_column]));
}
else if($get_dt_column == 'date_req_until'){
$data[$i][] = date("d/M/Y", strtotime($value[$get_dt_column]));
}
else {
$data[$i][] = $value[$get_dt_column];
}
}
/***** start: delete and edit button *****/
$action_btn = '';
$action_btn .= '<div class="visible-md visible-lg hidden-sm hidden-xs">';
$action_btn .= $this->create_action_buttons($btn_arr_responce,$value['requisition_id']);
$action_btn .= '</div>';
$data[$i][] = $action_btn;
// end: delete and edit button
$i++;
}
}
$this->data['datatable']['draw'] = $this->input->post('draw');
$this->data['datatable']['recordsTotal'] = count($dataCount);
$this->data['datatable']['recordsFiltered'] = count($dataCount);
$this->data['datatable']['data'] = $data;
//echo '<pre>'; print_r($this->data['datatable']); die();
echo json_encode($this->data['datatable']);
}
/*---- end: get_product function ----*/
function get_rfqs(){
// database column for searching
$db_column = array('r.rfq_id', 'r.rfq_num', 'r.rfq_date', 'r.due_date', 'r.status');
// load product model
$this->load->model('admin/Quotation_model');
// *****************************************
// start: get all requitision or search requisition
// *****************************************
$db_where_column = array();
$db_where_value = array();
$db_where_column_or = array('r.status', 'r.status', 'r.status', 'r.status');
$db_where_value_or = array(1, 3, 4, 5);
$db_limit = array();
$db_order = array();
/***** start: record length and start *****/
if($this->input->post('length') != '-1') {
$db_limit['limit'] = $this->input->post('length');
$db_limit['pageStart'] = $this->input->post('start');
}
// end: get data order by
/***** start: get data order by *****/
$order = $this->input->post('order');
if($order) {
foreach($order as $key => $get_order) {
$db_order[$key]['title'] = $db_column[$get_order['column']-1];
$db_order[$key]['order_by'] = $get_order['dir'];
}
}
// end: get data order by
/***** start: top search data by equal to *****/
if($this->input->post('top_search_like')) {
foreach($this->input->post('top_search_like') as $key => $search_val) {
if(preg_match('/prod/', $key)) {
$search_key = substr($key, 5);
if(!empty($search_val)) {
$db_where_column[] = $search_key . ' LIKE';
$db_where_value[] = '%' . $search_val . '%';
}
}
}
}
if($this->input->post('top_search')) {
foreach($this->input->post('top_search') as $key => $search_val) {
if(preg_match('/prod/', $key)) {
$search_key = substr($key, 5);
if($search_val!="") {
$db_where_column[] = $search_key;
$db_where_value[] = $search_val;
}
}
}
}
// end: top search data by equal to
/***** start: search data by like *****/
$search = $this->input->post('search');
if($search['value'] != '') {
foreach($db_column as $value) {
$db_where_column_or[] = $value . ' LIKE';
$db_where_value_or[] = '%' . $search['value'] . '%';
}
}
// end: search data by like
$dataRecord = $this->Quotation_model->get_all_rfqs($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or, $db_limit, $db_order);
$dataCount = $this->Quotation_model->get_all_rfqs($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or);
// end: get all requisitions or search requisition
$dt_column = array('rfq_num', 'rfq_date', 'due_date', 'status');
$data = array();
$i = 0;
if($dataRecord) {
$view = "admin/rfq/view/";
$edit = "";//"admin/requisition/edit/";
$remove = "";//"admin/requisition/delete_requisition/";
$btn_arr_responce = $this->create_action_array($view,$edit,$remove);
foreach($dataRecord as $key => $value) {
/*$btn_array_checked_checkbox = "admin/product/delete_checked_checkbox/";
$checkbox = "";
if(!$this->flexi_auth->is_privileged($this->menu_model->get_privilege_name($btn_array_checked_checkbox))){
$checkbox="disabled";
}
$data[$i][] = '<div class="checkbox-table"><label>
<input type="checkbox" '.$checkbox.' name="rfq['.$value['rfq_id'].']" class="flat-grey deleteThis">
</label></div>';*/
$data[$i][] = $i+1;
foreach($dt_column as $get_dt_column) {
if($get_dt_column == 'status'){
if ($value[$get_dt_column] == $this->config->item('activeFlag')) {
$data[$i][] = 'Approved';
}
else if ($value[$get_dt_column] == $this->config->item('inactiveFlag')) {
$data[$i][] = 'Rejected';
}
else if ($value[$get_dt_column] == $this->config->item('sentFlag')) {
$data[$i][] = 'Sent to Vendors';
}
else if ($value[$get_dt_column] == $this->config->item('receivedFlag')) {
$data[$i][] = 'Received from Vendors';
}
else if ($value[$get_dt_column] == $this->config->item('addedComparative')) {
$data[$i][] = 'Comparative Added';
}
else {
$data[$i][] = '-';
}
}
else if($get_dt_column == 'rfq_date'){
$data[$i][] = date("d/M/Y", strtotime($value[$get_dt_column]));
}
else if($get_dt_column == 'due_date'){
$data[$i][] = date("d/M/Y", strtotime($value[$get_dt_column]));
}
else {
$data[$i][] = $value[$get_dt_column];
}
}
/***** start: delete and edit button *****/
$action_btn = '';
$action_btn .= '<div class="visible-md visible-lg hidden-sm hidden-xs">';
//$action_btn .= $this->create_action_buttons($btn_arr_responce,$value['rfq_id']);
$rfq_id = $value['rfq_id'];
$action_btn .= '
<a href="'.base_url().'admin/rfq/view/'.$rfq_id.'" class="" data-placement="top" data-original-title="View Detail" > <i class="glyphicon glyphicon-eye-open"></i> </a>';
$action_btn .= '</div>';
$data[$i][] = $action_btn;
// end: delete and edit button
$i++;
}
}
$this->data['datatable']['draw'] = $this->input->post('draw');
$this->data['datatable']['recordsTotal'] = count($dataCount);
$this->data['datatable']['recordsFiltered'] = count($dataCount);
$this->data['datatable']['data'] = $data;
//echo '<pre>'; print_r($this->data['datatable']); die();
echo json_encode($this->data['datatable']);
}
function get_comparatives(){
// database column for searching
$db_column = array('r.rfq_id', 'r.rfq_num', 'r.rfq_date', 'r.due_date', 'r.status', 'v.vendor_name');
// load product model
$this->load->model('admin/Quotation_model');
$this->load->model('admin/Purchase_model');
// *****************************************
// start: get all requitision or search requisition
// *****************************************
$db_where_column = array();
$db_where_value = array();
$db_where_column_or = array('r.status');
$db_where_value_or = array(5);
$db_limit = array();
$db_order = array();
/***** start: record length and start *****/
if($this->input->post('length') != '-1') {
$db_limit['limit'] = $this->input->post('length');
$db_limit['pageStart'] = $this->input->post('start');
}
// end: get data order by
/***** start: get data order by *****/
$order = $this->input->post('order');
if($order) {
foreach($order as $key => $get_order) {
$db_order[$key]['title'] = $db_column[$get_order['column']-1];
$db_order[$key]['order_by'] = $get_order['dir'];
}
}
// end: get data order by
/***** start: top search data by equal to *****/
if($this->input->post('top_search_like')) {
foreach($this->input->post('top_search_like') as $key => $search_val) {
if(preg_match('/prod/', $key)) {
$search_key = substr($key, 5);
if(!empty($search_val)) {
$db_where_column[] = $search_key . ' LIKE';
$db_where_value[] = '%' . $search_val . '%';
}
}
}
}
if($this->input->post('top_search')) {
foreach($this->input->post('top_search') as $key => $search_val) {
if(preg_match('/prod/', $key)) {
$search_key = substr($key, 5);
if($search_val!="") {
$db_where_column[] = $search_key;
$db_where_value[] = $search_val;
}
}
}
}
// end: top search data by equal to
/***** start: search data by like *****/
$search = $this->input->post('search');
if($search['value'] != '') {
foreach($db_column as $value) {
$db_where_column_or[] = $value . ' LIKE';
$db_where_value_or[] = '%' . $search['value'] . '%';
}
}
// end: search data by like
$dataRecord = $this->Quotation_model->get_all_comparatives($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or, $db_limit, $db_order);
$dataCount = $this->Quotation_model->get_all_comparatives($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or);
// end: get all requisitions or search requisition
$dt_column = array('rfq_num', 'rfq_date', 'due_date', 'vendor_name');
$data = array();
$i = 0;
if($dataRecord) {
$view = "admin/rfq/view/";
$edit = "";//"admin/requisition/edit/";
$remove = "";//"admin/requisition/delete_requisition/";
$btn_arr_responce = $this->create_action_array($view,$edit,$remove);
foreach($dataRecord as $key => $value) {
$db_where_column_or_po = array('rfq.rfq_id');
$db_where_value_or_po = array($value['rfq_id']);
$poCount = $this->Purchase_model->get_orders($db_where_column_po, $db_where_value_po, $db_where_column_or_po, $db_where_value_or_po);
/*$btn_array_checked_checkbox = "admin/product/delete_checked_checkbox/";
$checkbox = "";
if(!$this->flexi_auth->is_privileged($this->menu_model->get_privilege_name($btn_array_checked_checkbox))){
$checkbox="disabled";
}
$data[$i][] = '<div class="checkbox-table"><label>
<input type="checkbox" '.$checkbox.' name="rfq['.$value['rfq_id'].']" class="flat-grey deleteThis">
</label></div>';*/
$data[$i][] = $i+1;
foreach($dt_column as $get_dt_column) {
if($get_dt_column == 'rfq_date'){
$data[$i][] = date("d/M/Y", strtotime($value[$get_dt_column]));
}
else if($get_dt_column == 'due_date'){
$data[$i][] = date("d/M/Y", strtotime($value[$get_dt_column]));
}
else {
$data[$i][] = $value[$get_dt_column];
}
}
/***** start: delete and edit button *****/
$action_btn = '';
$action_btn .= '<div class="visible-md visible-lg hidden-sm hidden-xs">';
//$action_btn .= $this->create_action_buttons($btn_arr_responce,$value['rfq_id']);
$rfq_id = $value['rfq_id'];
//$action_btn .= '
//<a href="'.base_url().'admin/rfq/view/'.$rfq_id.'" class="" data-placement="top" data-original-title="View Detail" > <i class="glyphicon glyphicon-eye-open"></i> </a>';
if (count($poCount) === 0) {
$action_btn .= '
<a href="'.base_url().'admin/purchase_order/add/'.$rfq_id.'" class="" data-placement="top" data-original-title="Create Purchase Order" > Create Purchase Order </a> | ';
}
$action_btn .= '
<a href="'.base_url().'admin/comparative_quotation/generate_comparative/'.$rfq_id.'" class="" data-placement="top" data-original-title="Generate Comparison" > <i class="glyphicon glyphicon-save"></i> </a>';
$action_btn .= '</div>';
$data[$i][] = $action_btn;
// end: delete and edit button
$i++;
}
}
$this->data['datatable']['draw'] = $this->input->post('draw');
$this->data['datatable']['recordsTotal'] = count($dataCount);
$this->data['datatable']['recordsFiltered'] = count($dataCount);
$this->data['datatable']['data'] = $data;
//echo '<pre>'; print_r($this->data['datatable']); die();
echo json_encode($this->data['datatable']);
}
/*
|------------------------------------------------
| start: get_product_for_order function
|------------------------------------------------
|
| This function get product and search product
| via ajax
|
*/
function get_product_for_order() {
// database column for searching
$db_column = array('', 'p.product_id', 'p.product_title', 'p.product_model', 'p.product_quantity', 'p.product_org_price', 'p.discount_value');
// load product model
$this->load->model('admin/product_model');
// *****************************************
// start: get all product or search product
// *****************************************
$db_where_column = array();
$db_where_value = array();
$db_where_column_or = array();
$db_where_value_or = array();
$db_limit = array();
$db_order = array();
/* * *** start: record length and start **** */
if ($this->input->post('length') != '-1') {
$db_limit['limit'] = $this->input->post('length');
$db_limit['pageStart'] = $this->input->post('start');
}
// end: get data order by
/* * *** start: get data order by **** */
$order = $this->input->post('order');
if ($order) {
foreach ($order as $key => $get_order) {
$db_order[$key]['title'] = $db_column[$get_order['column']];
$db_order[$key]['order_by'] = $get_order['dir'];
}
}
// end: get data order by
/* * *** start: top search data by equal to **** */
if ($this->input->post('top_search')) {
foreach ($this->input->post('top_search') as $key => $search_val) {
if (preg_match('/prod/', $key)) {
$search_key = substr($key, 5);
if (!empty($search_val)) {
$db_where_column[] = $search_key;
$db_where_value[] = $search_val;
}
}
}
}
// end: top search data by equal to
/* * *** start: search data by like **** */
$search = $this->input->post('search');
if ($search['value'] != '') {
foreach ($db_column as $value) {
$db_where_column_or[] = $value . ' LIKE';
$db_where_value_or[] = '%' . $search['value'] . '%';
}
}
// end: search data by like
$dataRecord = $this->product_model->get_product($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or, $db_limit, $db_order);
$dataCount = $this->product_model->get_product($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or);
// end: get all product or search product
$dt_column = array('img_name', 'product_id', 'product_title', 'product_model', 'product_quantity', 'product_org_price', 'discount_value');
$data = array();
$i = 0;
if ($dataRecord) {
$view = "admin/product/view_product_detail/";
$edit = "admin/product/edit_product/";
$remove = "admin/product/delete_product/";
//$btn_arr_responce = $this->create_action_array($view,$edit,$remove);
foreach ($dataRecord as $key => $value) {
//echo '<pre>'; print_r($value); die;
$discount = $value['product_org_price'] - $value['discount_value'];
foreach ($dt_column as $get_dt_column) {
if ($get_dt_column == 'img_name') {
$image_name = "upload/product/thumbnail_50/" . $value[$get_dt_column];
//if ($value[$get_dt_column]) {
if($value[$get_dt_column] != "" && file_exists($image_name)) {
$product_img = '<a class="group1" href="' . base_url() . 'upload/product/' . $value[$get_dt_column] . '" title="">';
$product_img .= '<img src="' . base_url() . 'upload/product/thumbnail_50/' . $value[$get_dt_column] . '" class="img-responsive" alt=""/>';
$product_img .= '</a>';
$data[$i][] = $product_img;
} else
$data[$i][] = '<img src="' . base_url() . 'includes/admin/images/no-image.png" alt="image"/>';
}
else if ($get_dt_column == 'product_title') {
$data[$i][] = '<a href="' . base_url() . 'admin/product/view_product_detail/' . $value['product_id'] . '">' . $value[$get_dt_column] . '</a>';
} else if ($get_dt_column == 'product_quantity') {
$data[$i][] = ($value[$get_dt_column] <= 0) ? 'Out of Stock' : $value[$get_dt_column];
$disable = ($value[$get_dt_column] <= 0) ? 'disabled' : '';
} else if ($get_dt_column == 'discount_value') {
$data[$i][] = number_format($discount, 2); //($value[$get_dt_column] <= 0) ? 'Out of Stock' : $value[$get_dt_column];
} else if ($get_dt_column == 'product_org_price') {
$data[$i][] = number_format($value[$get_dt_column], 2);
} else {
$data[$i][] = $value[$get_dt_column];
}
}
/* * *** start: delete and edit button **** */
$action_btn = '';
$action_btn .= '<div class="visible-md visible-lg hidden-sm hidden-xs">';
// $action_btn .= $this->create_action_buttons($btn_arr_responce,$value['product_id']);
$action_btn .= '<button onclick="add_cart(' . $value["product_id"] . ',' . $value["product_quantity"] . ')" class="' . $disable . ' btn btn-xs btn-bricky btn-teal tooltips add_cart" data-product_id="' . $value["product_id"] . '" data-product_quantity="' . $value["product_quantity"] . '" data-placement="top">Add To Cart</button>';
$action_btn .= '</div>';
$data[$i][] = $action_btn;
// end: delete and edit button
$i++;
}
}
$this->data['datatable']['draw'] = $this->input->post('draw');
$this->data['datatable']['recordsTotal'] = count($dataCount);
$this->data['datatable']['recordsFiltered'] = count($dataCount);
$this->data['datatable']['data'] = $data;
//echo '<pre>'; print_r($this->data['datatable']); die();
echo json_encode($this->data['datatable']);
}
/*---- end: get_product_for_order function ----*/
/*
|------------------------------------------------
| start: get_payment_request function
|------------------------------------------------
|
| This function get product and search product
| via ajax
|
*/
function get_payment_request() {
// database column for searching
$db_column = array('pr.*', 'r.requisition_num', 'r.description');
// load product model
$this->load->model('admin/payment_model');
// *****************************************
// start: get all product or search product
// *****************************************
$db_where_column = array();
$db_where_value = array();
$db_where_column_or = array();
$db_where_value_or = array();
$db_limit = array();
$db_order = array();
/* * *** start: record length and start **** */
if ($this->input->post('length') != '-1') {
$db_limit['limit'] = $this->input->post('length');
$db_limit['pageStart'] = $this->input->post('start');
}
// end: get data order by
/* * *** start: get data order by **** */
$order = $this->input->post('order');
if ($order) {
foreach ($order as $key => $get_order) {
$db_order[$key]['title'] = $db_column[$get_order['column']];
$db_order[$key]['order_by'] = $get_order['dir'];
}
}
// end: get data order by
/* * *** start: top search data by equal to **** */
if ($this->input->post('top_search')) {
foreach ($this->input->post('top_search') as $key => $search_val) {
if (preg_match('/prod/', $key)) {
$search_key = substr($key, 5);
if (!empty($search_val)) {
$db_where_column[] = $search_key;
$db_where_value[] = $search_val;
}
}
}
}
// end: top search data by equal to
/* * *** start: search data by like **** */
$search = $this->input->post('search');
if ($search['value'] != '') {
foreach ($db_column as $value) {
$db_where_column_or[] = $value . ' LIKE';
$db_where_value_or[] = '%' . $search['value'] . '%';
}
}
// end: search data by like
$dataRecord = $this->payment_model->get_prs($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or, $db_limit, $db_order);
$dataCount = $this->payment_model->get_prs($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or);
// end: get all product or search product
$dt_column = array('requisition_num', 'description', 'pr_date', 'payment_mode', 'payment_purpose');
$data = array();
$i = 0;
if ($dataRecord) {
$data[$i][] = $i+1;
//$btn_arr_responce = $this->create_action_array($view,$edit,$remove);
foreach ($dataRecord as $key => $value) {
foreach ($dt_column as $get_dt_column) {
if($get_dt_column == 'pr_date'){
$data[$i][] = date("d/M/Y", strtotime($value[$get_dt_column]));
} else {
$data[$i][] = $value[$get_dt_column];
}
}
/* * *** start: delete and edit button **** */
$action_btn .= '<div class="visible-md visible-lg hidden-sm hidden-xs">';
//$action_btn .= $this->create_action_buttons($btn_arr_responce,$value['rfq_id']);
$pr_id = $value['pr_id'];
//$action_btn .= '
//<a href="'.base_url().'admin/rfq/view/'.$rfq_id.'" class="" data-placement="top" data-original-title="View Detail" > <i class="glyphicon glyphicon-eye-open"></i> </a>';
$action_btn .= '
<a href="'.base_url().'admin/payment_request/generate_pr_pdf/'.$pr_id.'" class="" data-placement="top" data-original-title="Generate Payment Request" > <i class="glyphicon glyphicon-save"></i> </a>';
$action_btn .= '</div>';
$data[$i][] = $action_btn;
// end: delete and edit button
$i++;
}
}
$this->data['datatable']['draw'] = $this->input->post('draw');
$this->data['datatable']['recordsTotal'] = count($dataCount);
$this->data['datatable']['recordsFiltered'] = count($dataCount);
$this->data['datatable']['data'] = $data;
//echo '<pre>'; print_r($this->data['datatable']); die();
echo json_encode($this->data['datatable']);
}
/*---- end: get_payment_request function ----*/
/* =============================================================== */
/*
|------------------------------------------------
| start: get_category function
|------------------------------------------------
|
| This function get product and search product
| via ajax
|
*/
function get_category() {
// database column for searching
$db_column = array('c.cat_title');
// load product model
$this->load->model('admin/category_model');
// *****************************************
// start: get all product or search product
// *****************************************
$db_where_column = array();
$db_where_value = array();
$db_where_column_or = array();
$db_where_value_or = array();
$db_limit = array();
$db_order = array();
/***** start: record length and start *****/
if($this->input->post('length') != '-1') {
//$db_limit['limit'] = $this->input->post('length');
//$db_limit['pageStart'] = $this->input->post('start');
}
// end: get data order by
/***** start: get data order by *****/
$order = $this->input->post('order');
//echo '<pre>'; print_r($order); die;
if($order) {
foreach($order as $key => $get_order) {
$db_order[$key]['title'] = $db_column[$get_order['column']-1];
$db_order[$key]['order_by'] = $get_order['dir'];
}
}
// end: get data order by
/***** start: search data by equal to *****/
if($this->input->post('top_search')) {
foreach($this->input->post('top_search') as $key => $search_val) {
if(preg_match('/cat/', $key)) {
$search_key = substr($key, 4);
if(!empty($search_val)) {
$db_where_column[] = $search_key . ' LIKE';
$db_where_value[] = '%' . $search_val . '%';
}
}
}
}
// end: search data by equal to
/***** start: search data by like *****/
$search = $this->input->post('search');
if($search['value'] != '') {
foreach($db_column as $value) {
$db_where_column_or[] = $value . ' LIKE';
$db_where_value_or[] = '%' . $search['value'] . '%';
}
}
// end: search data by like
$dataRecord = $this->category_model->get_category($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or, $db_limit, $db_order);
$dataCount = $this->category_model->get_category($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or);
// end: get all product or search product
//echo count($dataRecord); die();
// start: set array and find parent of child
$ref = array();
$items = array();
$data = array();
if($dataRecord){
$view_child_category_link = "admin/category/add_category_child/";
$view_child_category = $this->menu_model->get_privilege_name($view_child_category_link);
$edit = "admin/category/edit_category/";
$remove = "admin/category/delete_category/";
$btn_arr_responce = $this->create_action_array($view_child_category,$edit,$remove);
foreach($dataRecord as $category) {
$thisRef = &$ref[$category['cat_id']];
$thisRef['cat_id'] = $category['cat_id'];
$thisRef['cat_parent'] = $category['cat_parent_id'];
$thisRef['cat_title'] = $category['cat_title'];
if ($category['cat_parent_id'] == 0) {
$items[$category['cat_id']] = &$thisRef;
} else {
$ref[$category['cat_parent_id']]['child'][$category['cat_id']] = &$thisRef;
}
}
$dataRecord = $this->get_category_child($items);
// end: set array and find parent of child
$dataCount = $dataRecord;
if($this->input->post('length') != '-1') {
$dataRecord = array_slice( $dataRecord, $this->input->post('start'), $this->input->post('length') );
}
// count category
//echo $dataCount = count($dataRecord);
//die();
$dt_column = array('cat_title');
//$data = array();
$i = 0;
if($dataRecord) {
foreach($dataRecord as $key => $value) {
$data[$i][] = "CAT_".$value['cat_id'];
foreach($dt_column as $get_dt_column) {
$data[$i][] = $value[$get_dt_column];
}
/***** start: add new child button *****/
$add_child_btn = '';
$add_child_btn .= '<div class="visible-md visible-lg hidden-sm hidden-xs">';
(isset($view_child_category) && $view_child_category != "")?$add_child_btn .= '<a href="'.base_url().$view_child_category_link.$value['cat_id'].'" class="" data-placement="top" data-original-title="Add Child Category">Add Child Category</a>':$add_child_btn .= 'No Privilege to Add Child Category';
$add_child_btn .= '</div>';
$data[$i][] = $add_child_btn;
// end: add new child button
/***** start: delete and edit button *****/
$action_btn = '';
$action_btn .= '<div class="visible-md visible-lg hidden-sm hidden-xs">';
$action_btn .= $this->create_action_buttons($btn_arr_responce,$value['cat_id']);
$action_btn .= '</div>';
$data[$i][] = $action_btn;
// end: delete and edit button
$i++;
}
}}
$this->data['datatable']['draw'] = $this->input->post('draw');
$this->data['datatable']['recordsTotal'] = count($dataCount);
$this->data['datatable']['recordsFiltered'] = count($dataCount);
$this->data['datatable']['data'] = $data;
// echo '<pre>'; print_r($data); die();
echo json_encode($this->data['datatable']);
}
/*---- end: get_category function ----*/
/* =============================================================== */
/*
|------------------------------------------------
| start: get_category_child function
|------------------------------------------------
|
| This function set child parent relation of category
|
*/
function get_category_child($items, $cat_label = null) {
foreach ($items as $key => $value) {
if($cat_label && $value['cat_parent'] != 0) {
$this->cat_tree[$value['cat_id']]['cat_title'] = $cat_label.' > '.$value['cat_title'];
$this->cat_tree[$value['cat_id']]['cat_id'] = $value['cat_id'];
$cat = $cat_label.' > '.$value['cat_title'];
}
else {
$this->cat_tree[$value['cat_id']]['cat_title'] = $value['cat_title'];
$this->cat_tree[$value['cat_id']]['cat_id'] = $value['cat_id'];
$cat = $value['cat_title'];
}
if (array_key_exists('child', $value)) {
$this->get_category_child($value['child'], $cat);
}
}
return $this->cat_tree;
}
/*---- end: get_category_child function ----*/
/* =============================================================== */
/*
|------------------------------------------------
| start: get_custom_fields function
|------------------------------------------------
|
| This function get custom fields and search custom fields
| via ajax
|
*/
function get_custom_fields() {
//echo '<pre>'; print_r($this->input->post()); die();
// database column for searching
$db_column = array('cf.field_title', 'cf.field_type', '', 'cf.category_id', 'cf.is_active');
// load product model
$this->load->model('admin/customfields_model');
// *****************************************
// start: get all product or search product
// *****************************************
$db_where_column = array();
$db_where_value = array();
$db_where_column_or = array();
$db_where_value_or = array();
$db_limit = array();
$db_order = array();
/***** start: record length and start *****/
if($this->input->post('length') != '-1') {
$db_limit['limit'] = $this->input->post('length');
$db_limit['pageStart'] = $this->input->post('start');
}
// end: get data order by
/***** start: get data order by *****/
$order = $this->input->post('order');
if($order) {
foreach($order as $key => $get_order) {
$db_order[$key]['title'] = $db_column[$get_order['column']-1];
$db_order[$key]['order_by'] = $get_order['dir'];
}
}
// end: get data order by
/***** start: top search data by equal to *****/
/*if($this->input->post('top_search_like')) {
foreach($this->input->post('top_search_like') as $key => $search_val) {
if(preg_match('/custom/', $key)) {
$search_key = substr($key, 7);
if(!empty($search_val)) {
$db_where_column[] = $search_key . ' LIKE';
$db_where_value[] = '%' . $search_val . '%';
}
}
}
}*/
if($this->input->post('top_search')) {
foreach($this->input->post('top_search') as $key => $search_val) {
if(preg_match('/custom/', $key)) {
$search_key = substr($key, 7);
if(!empty($search_val)) {
$db_where_column[] = $search_key;
$db_where_value[] = $search_val;
}
}
}
}
// end: top search data by equal to
/***** start: search data by like *****/
$search = $this->input->post('search');
if($search['value'] != '') {
foreach($db_column as $value) {
$db_where_column_or[] = $value . ' LIKE';
$db_where_value_or[] = '%' . $search['value'] . '%';
}
}
// end: search data by like
$dataRecord = $this->customfields_model->get_custom_fields($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or, $db_limit, $db_order);
$dataCount = $this->customfields_model->get_custom_fields($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or);
// end: get all product or search product
$dt_column = array('field_title', 'field_type', 'field_value', 'cat_title', 'is_active');
$data = array();
$i = 0;
if($dataRecord) {
$view = NULL;
$edit = "admin/customfields/edit_custom_fields/";
$remove = "admin/customfields/delete_custom_fields/";
$btn_arr_responce = $this->create_action_array($view,$edit,$remove);
foreach($dataRecord as $key => $value) {
$data[$i][] = '<div class="checkbox-table"><label>
<input type="checkbox" name="product['.$value['id'].']" class="flat-grey deleteThis">
</label></div>';
foreach($dt_column as $get_dt_column) {
if($get_dt_column == 'field_value') {
$field_title = str_replace(" ", "_", strtolower($value['field_title']));
$field_values = explode(",",$value['field_value']);
$custom_field_preview = '';
if($value['field_type'] == "Dropdown" && $value['field_value'] != ""){
$custom_field_preview .= '<select name="'.$field_title.'" class="product_cat_id form-control">';
$custom_field_preview .= '<option>-- Select '.$value['field_title'].' --</option>';
foreach($field_values as $get_value){
$custom_field_preview .= '<option value="' . $get_value . '">' . $get_value . '</option>';
}
$custom_field_preview .= '</select>';
}
else if($value['field_type'] == "Textbox") {
$custom_field_preview .= '<input type="text" name="'.$field_title.'" placeholder="'.$value['field_placeholder'].'">';
}
else if($value['field_type'] == "Textarea") {
$custom_field_preview .= '<textarea name="'.$field_title.'" placeholder="'.$value['field_placeholder'].'" ></textarea>';
}
else if($value['field_type'] == "Checkbox" && $value['field_value'] != "") {
foreach($field_values as $get_value) {
$custom_field_preview .= '<input type="checkbox" class="form-control preview_box" name="'.$field_title.'" value="'.$get_value.'"> '.$get_value;
}
}
else if($value['field_type'] == "Radio" && $value['field_value'] != ""){
foreach($field_values as $get_value) {
$custom_field_preview .= '<input type="radio" name="'.$field_title.'" class="form-control preview_box" value="'.$get_value.'>"> '.$get_value;
}
}
$data[$i][] = $custom_field_preview;
}
else {
$data[$i][] = $value[$get_dt_column];
}
}
/***** start: delete and edit button *****/
$action_btn = '';
$action_btn .= '<div class="visible-md visible-lg hidden-sm hidden-xs">';
// Check user has privileges to View product, else display a message to notify the user they do not have valid privileges.
//if($this->flexi_auth->is_privileged('View Product Detail'))
//$action_btn .= '<a href="'.base_url().'admin/product/view_product_detail/'.$value['product_id'].'" class="edit_btn btn btn-xs btn-teal tooltips" data-placement="top" data-original-title="View"><i class="fa fa-arrow-circle-right"></i></a>';
$action_btn .= $this->create_action_buttons($btn_arr_responce,$value['id']);
$action_btn .= '</div>';
$data[$i][] = $action_btn;
// end: delete and edit button
$i++;
}
}
$this->data['datatable']['draw'] = $this->input->post('draw');
$this->data['datatable']['recordsTotal'] = count($dataCount);
$this->data['datatable']['recordsFiltered'] = count($dataCount);
$this->data['datatable']['data'] = $data;
//echo '<pre>'; print_r($this->data['datatable']); die();
echo json_encode($this->data['datatable']);
}
/*---- end: get_custom_fields function ----*/
/*
|------------------------------------------------
| start: get_orders function
|------------------------------------------------
|
| This function get order and search custom order
| via ajax
|
*/
function get_orders($status = null) {
//echo '<pre>'; print_r($this->input->post()); die();
// database column for searching
$db_column = array('o.order_id', 'o.order_created_date', 'c.customer_first_name', 'c.customer_last_name', 'o.prod_ordered_total', 'os.status_name', 'smsData');
//$db_column = array('o.order_id', 'o.order_created_date', 'c.customer_id','c.customer_first_name', 'c.customer_last_name', 'o.prod_ordered_total', 'o.order_status', 'smsData');
// load product model
$this->load->model('admin/order_model');
// *****************************************
// start: get all product or search product
// *****************************************
$db_where_column = array();
$db_where_value = array();
$db_where_column_or = array();
$db_where_value_or = array();
$db_limit = array();
$db_order = array();
/***** start: record length and start *****/
if($this->input->post('length') != '-1') {
$db_limit['limit'] = $this->input->post('length');
$db_limit['pageStart'] = $this->input->post('start');
}
// end: get data order by
/***** start: get data order by *****/
$order = $this->input->post('order');
if($order) {
foreach($order as $key => $get_order) {
if($get_order['column'] >= 4) {
$db_order[$key]['title'] = $db_column[$get_order['column']];
$db_order[$key]['order_by'] = $get_order['dir'];
}
else {
$db_order[$key]['title'] = $db_column[$get_order['column']-1];
$db_order[$key]['order_by'] = $get_order['dir'];
}
}
}
// end: get data order by
/***** start: top search data by equal to *****/
if($this->input->post('top_search_like')) {
//echo '<pre>';
foreach($this->input->post('top_search_like') as $key => $search_val) {
if(preg_match('/order/', $key)) { //echo 'REHMAN'; echo '<br />';
$search_key = substr($key, 6);
if(!empty($search_val)) {
if($search_key == "order_created_date"){
// Change the date format to get exact date for searching
$search_val = date("Y-m-d", strtotime($search_val));
}
$db_where_column[] = 'o.'.$search_key . ' LIKE';
$db_where_value[] = '%' . $search_val . '%';
}
}
if(preg_match('/cus/', $key)) { //echo 'ZIA'; echo '<br />';
$search_key = substr($key, 4);
if(!empty($search_val)) {
if($search_key == 'customer_name')
$db_where_column[] = "concat(c.customer_first_name , ' ' , c.customer_last_name) LIKE";
else
$db_where_column[] = 'c.'.$search_key . ' LIKE';
$db_where_value[] = '%' . $search_val . '%';
}
}
}
}
//echo '<pre>'; print_r($db_where_column);
//echo '<pre>'; print_r($db_where_value);
if($this->input->post('top_search')) {
foreach($this->input->post('top_search') as $key => $search_val) {
if(preg_match('/order/', $key)) { //echo 'REHMAN 11'; echo '<br />';
$search_key = substr($key, 6);
if(!empty($search_val)) {
if($search_key == 'order_status'){
$search_val =$this->order_model->getOrderStatusByName($search_val);
}
if($search_key == 'order_created_date') {
$db_where_column[] = 'o.'.$search_key.' LIKE';
$db_where_value[] = date("Y-m-d", strtotime($search_val)) . '%';
}
else {
$db_where_column[] = 'o.'.$search_key;
$db_where_value[] = $search_val;
}
}
}
}
}
//die();
// end: top search data by equal to
/***** start: search data by like *****/
$search = $this->input->post('search');
if($search['value'] != '') {
foreach($db_column as $value) {
$db_where_column_or[] = $value . ' LIKE';
$db_where_value_or[] = '%' . $search['value'] . '%';
}
}
// end: search data by like
$dataRecord = $this->order_model->get_order($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or, $db_limit, $db_order);
$dataCount = $this->order_model->get_order($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or);
// end: get all product or search product
//$dt_column = array('order_id', 'order_created_date', 'customer_first_name', 'prod_ordered_total', 'order_status', 'smsData');
$dt_column = array('order_id', 'order_created_date', 'customer_first_name', 'prod_ordered_total', 'status_name', 'smsData');
$data = array();
$i = 0;
if($dataRecord) {
$view = NULL;
$edit = "admin/order/edit_order/";
$remove = "admin/order/delete_order/";
$btn_arr_responce = $this->create_action_array($view,$edit,$remove);
foreach($dataRecord as $key => $value) {
$btn_array_checked_checkbox = "admin/order/delete_checked_checkbox/";
$checkbox = "";
if(!$this->flexi_auth->is_privileged($this->menu_model->get_privilege_name($btn_array_checked_checkbox))){
$checkbox="disabled";
}
$data[$i][] = '<div class="checkbox-table"><label>
<input type="checkbox" '.$checkbox.' name="product['.$value['order_id'].']" class="flat-grey deleteThis">
</label></div>';
foreach($dt_column as $get_dt_column) {
if($get_dt_column == 'order_created_date') {
$data[$i][] = date("d-m-Y", strtotime($value['order_created_date']));
}
else if($get_dt_column == 'customer_first_name') {
$data[$i][] = $value['customer_first_name'] . ' ' . $value['customer_last_name'];
}
else if($get_dt_column == 'prod_ordered_total') {
$data[$i][] = number_format($value['prod_ordered_total'], 2);
}
else if($get_dt_column == 'smsData') {
$sms_status = "";
if ($value['smsData']) {
foreach ($value['smsData'] as $recoardKey => $sms_record) {
if ($sms_record['action'] == 'sendmessage') {
$sms_status = "Sent";
}
if ($sms_record['action'] == 'receivemessage') {
$sms_status = "Confirmed";
}
}
}
$data[$i][] = $sms_status;
}
else {
$data[$i][] = $value[$get_dt_column];
}
}
/***** start: delete and edit button *****/
$action_btn = '';
$action_btn .= '<div class="visible-md visible-lg hidden-sm hidden-xs">';
$btn_array_view = "admin/order/view_detail/";
if($this->flexi_auth->is_privileged($this->menu_model->get_privilege_name($btn_array_view)))
$action_btn .= '<a href="'.base_url().'admin/order/view_detail/'.$value['customer_id'].'/'. $value['order_id'].'" class="edit_btn btn btn-xs btn-teal tooltips" data-placement="top" data-original-title="View"><i class="fa fa-arrow-circle-right"></i></a>';
$action_btn .= $this->create_action_buttons($btn_arr_responce,$value['order_id']);
/*
// Check user has privileges to View order, else display a message to notify the user they do not have valid privileges.
if($this->flexi_auth->is_privileged('View Order'))
$action_btn .= '<a href="'.base_url().'admin/order/view_detail/'.$value['customer_id'].'/'. $value['order_id'].'" class="edit_btn btn btn-xs btn-teal tooltips" data-placement="top" data-original-title="View"><i class="fa fa-arrow-circle-right"></i></a>';
// Check user has privileges to edit order, else display a message to notify the user they do not have valid privileges.
if($this->flexi_auth->is_privileged('Edit Order'))
$action_btn .= '<a href="'.base_url().'admin/order/edit_order/'.$value['order_id'].'" class="edit_btn btn btn-xs btn-teal tooltips" data-placement="top" data-original-title="Edit"><i class="fa fa-edit"></i></a>';
// Check user has privileges to delete order, else display a message to notify the user they do not have valid privileges.
if($this->flexi_auth->is_privileged('Delete Order'))
$action_btn .= '<a href="'.base_url().'admin/order/delete_order/'.$value['order_id'].'" class="btn btn-xs btn-bricky tooltips" data-placement="top" data-original-title="Remove"><i class="fa fa-times fa fa-white"></i></a>';
*/
$action_btn .= '</div>';
$data[$i][] = $action_btn;
// end: delete and edit button
$i++;
}
}
$this->data['datatable']['draw'] = $this->input->post('draw');
$this->data['datatable']['recordsTotal'] = count($dataCount);
$this->data['datatable']['recordsFiltered'] = count($dataCount);
$this->data['datatable']['data'] = $data;
//echo '<pre>'; print_r($this->data['datatable']); die();
echo json_encode($this->data['datatable']);
}
/*---- end: get_orders function ----*/
/*
|------------------------------------------------
| start: get_customers function
|------------------------------------------------
|
| This function get customer and search customer
| via ajax
|
*/
function get_customers() {
//echo '<pre>'; print_r($this->input->post()); die();
// database column for searching
$db_column = array('customer_id', 'customer_first_name', 'customer_last_name', 'customer_email', 'customer_contact_no', 'customer_address');
// load customer model
$this->load->model('admin/customer_model');
// *****************************************
// start: get all customer or search customer
// *****************************************
$db_where_column = array();
$db_where_value = array();
$db_where_column_or = array();
$db_where_value_or = array();
$db_limit = array();
$db_order = array();
/***** start: record length and start *****/
if($this->input->post('length') != '-1') {
$db_limit['limit'] = $this->input->post('length');
$db_limit['pageStart'] = $this->input->post('start');
}
/***** start: get data order by *****/
$order = $this->input->post('order');
if($order) {
foreach($order as $key => $get_order) {
if($get_order['column']-1 >= 3) {
$db_order[$key]['title'] = $db_column[$get_order['column']];
$db_order[$key]['order_by'] = $get_order['dir'];
}
else {
$db_order[$key]['title'] = $db_column[$get_order['column']-1];
$db_order[$key]['order_by'] = $get_order['dir'];
}
}
}
// end: get data order by
/***** start: top search data by equal to *****/
if($this->input->post('top_search_like')) {
//echo '<pre>';
foreach($this->input->post('top_search_like') as $key => $search_val) {
if(preg_match('/value/', $key)) { // Search By ID and Contact#
$search_key = substr($key, 6);
if(!empty($search_val)) {
$db_where_column[] = $search_key . ' LIKE';
$db_where_value[] = '%' . $search_val . '%';
}
}else if(preg_match('/cus/', $key)) { //Search By Name
$search_key = substr($key, 4);
if(!empty($search_val)) {
if($search_key == 'customer_name')
$db_where_column[] = "concat(customer_first_name , ' ' , customer_last_name) LIKE";
else
$db_where_column[] = $search_key . ' LIKE';
$db_where_value[] = '%' . $search_val . '%';
}
}
}
}
// end: search data by like
$dataRecord = $this->customer_model->get_customer($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or, $db_limit, $db_order);
$dataCount = $this->customer_model->get_customer($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or);
// end: get all product or search product
$dt_column = array('customer_id', 'customer_name', 'customer_email', 'customer_contact_no', 'customer_address', 'created_date');
$data = array();
$i = 0;
if($dataRecord) {
$view = "admin/customer/view_detail/";
$edit = "admin/customer/edit_customer/";
$remove = "admin/customer/delete_customer/";
$btn_arr_responce = $this->create_action_array($view,$edit,$remove);
foreach($dataRecord as $key => $value) {
$btn_array_checked_checkbox = "admin/customer/delete_checked_checkbox/";
$checkbox = "";
if(!$this->flexi_auth->is_privileged($this->menu_model->get_privilege_name($btn_array_checked_checkbox))){
$checkbox="disabled";
}
$data[$i][] = '<div class="checkbox-table"><label>
<input type="checkbox" '.$checkbox.' name="customer['.$value['customer_id'].']" class="flat-grey deleteThis">
</label></div>';
foreach($dt_column as $get_dt_column) {
if ($get_dt_column == 'customer_name') {
$data[$i][] = $value['customer_first_name'] . ' ' . $value['customer_last_name'];
} else if($get_dt_column == 'created_date') {
$data[$i][] = date("d-m-Y", strtotime($value['created_date']));
}
else {
$data[$i][] = $value[$get_dt_column];
}
}
/***** start: delete and edit button *****/
$action_btn = '';
$action_btn .= '<div class="visible-md visible-lg hidden-sm hidden-xs">';
$action_btn .= $this->create_action_buttons($btn_arr_responce,$value['customer_id']);
$action_btn .= '</div>';
$data[$i][] = $action_btn;
// end: delete and edit button
$i++;
}
}
$this->data['datatable']['draw'] = $this->input->post('draw');
$this->data['datatable']['recordsTotal'] = count($dataCount);
$this->data['datatable']['recordsFiltered'] = count($dataCount);
$this->data['datatable']['data'] = $data;
//echo '<pre>'; print_r($this->data['datatable']); die();
echo json_encode($this->data['datatable']);
}
/*---- end: get_orders function ----*/
function get_purchase_orders(){
// database column for searching
$db_column = array('po.vendor_id', 'po.po_date', 'po.delivery_date', 'po.po_num', 'po.delivery_address', 'po.status');
// load purchase model
$this->load->model('admin/Purchase_model');
// *****************************************
// start: get all requitision or search requisition
// *****************************************
$db_where_column = array();
$db_where_value = array();
$db_where_column_or = array('po.status', 'po.status', 'po.status');
$db_where_value_or = array(1, 3, 4);
$db_limit = array();
$db_order = array();
/***** start: record length and start *****/
if($this->input->post('length') != '-1') {
$db_limit['limit'] = $this->input->post('length');
$db_limit['pageStart'] = $this->input->post('start');
}
// end: get data order by
/***** start: get data order by *****/
$order = $this->input->post('order');
if($order) {
foreach($order as $key => $get_order) {
$db_order[$key]['title'] = $db_column[$get_order['column']-1];
$db_order[$key]['order_by'] = $get_order['dir'];
}
}
// end: get data order by
/***** start: top search data by equal to *****/
if($this->input->post('top_search_like')) {
foreach($this->input->post('top_search_like') as $key => $search_val) {
if(preg_match('/prod/', $key)) {
$search_key = substr($key, 5);
if(!empty($search_val)) {
$db_where_column[] = $search_key . ' LIKE';
$db_where_value[] = '%' . $search_val . '%';
}
}
}
}
if($this->input->post('top_search')) {
foreach($this->input->post('top_search') as $key => $search_val) {
if(preg_match('/prod/', $key)) {
$search_key = substr($key, 5);
if($search_val!="") {
$db_where_column[] = $search_key;
$db_where_value[] = $search_val;
}
}
}
}
// end: top search data by equal to
/***** start: search data by like *****/
$search = $this->input->post('search');
if($search['value'] != '') {
foreach($db_column as $value) {
$db_where_column_or[] = $value . ' LIKE';
$db_where_value_or[] = '%' . $search['value'] . '%';
}
}
// end: search data by like
$dataRecord = $this->Purchase_model->get_orders($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or, $db_limit, $db_order);
$dataCount = $this->Purchase_model->get_orders($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or);
// end: get all orders or search purchase orders
$dt_column = array('po_date', 'delivery_date', 'description', 'vendor_name', 'delivery_address');
$data = array();
$i = 0;
if($dataRecord) {
$view = "admin/purchase_order/view/";
$edit = "";//"admin/requisition/edit/";
$remove = "";//"admin/requisition/delete_requisition/";
$btn_arr_responce = $this->create_action_array($view,$edit,$remove);
foreach($dataRecord as $key => $value) {
/*$btn_array_checked_checkbox = "admin/product/delete_checked_checkbox/";
$checkbox = "";
if(!$this->flexi_auth->is_privileged($this->menu_model->get_privilege_name($btn_array_checked_checkbox))){
$checkbox="disabled";
}
$data[$i][] = '<div class="checkbox-table"><label>
<input type="checkbox" '.$checkbox.' name="rfq['.$value['rfq_id'].']" class="flat-grey deleteThis">
</label></div>';*/
$data[$i][] = $i+1;
foreach($dt_column as $get_dt_column) {
if($get_dt_column == 'po_date'){
$data[$i][] = date("d/M/Y", strtotime($value[$get_dt_column]));
} else if($get_dt_column == 'delivery_date'){
if(!empty($value[$get_dt_column]) && $value[$get_dt_column] != "0000-00-00"){
$data[$i][] = date("d/M/Y", strtotime($value[$get_dt_column]));
} else{
$data[$i][] = "N/A";
}
}
else {
$data[$i][] = $value[$get_dt_column];
}
}
/***** start: delete and edit button *****/
$action_btn = '';
$action_btn .= '<div class="visible-md visible-lg hidden-sm hidden-xs">';
//$action_btn .= $this->create_action_buttons($btn_arr_responce,$value['rfq_id']);
$po_id = $value['po_id'];
if ($value['status'] == $this->config->item('activeFlag')) {
$action_btn .= '<a href="'.base_url().'admin/grn/add/'.$po_id.'" class="" data-placement="top" data-original-title="Add Goods Receiving" > Add Grn </a> | ';
}
$action_btn .= '
<a href="'.base_url().'admin/purchase_order/generate_order_pdf/'.$po_id.'" class="" data-placement="top" data-original-title="Generate Order" > <i class="glyphicon glyphicon-save"></i> </a>';
$action_btn .= '</div>';
$data[$i][] = $action_btn;
// end: delete and edit button
$i++;
}
}
$this->data['datatable']['draw'] = $this->input->post('draw');
$this->data['datatable']['recordsTotal'] = count($dataCount);
$this->data['datatable']['recordsFiltered'] = count($dataCount);
$this->data['datatable']['data'] = $data;
//echo '<pre>'; print_r($this->data['datatable']); die();
echo json_encode($this->data['datatable']);
}
function get_grns(){
// database column for searching
$db_column = array('grn.vendor_id', 'grn.grn_date', 'grno.grn', 'grn.delivery_challan_no', 'grn.receiving_location');
// load purchase model
$this->load->model('admin/Grn_model');
// *****************************************
// start: get all requitision or search requisition
// *****************************************
$db_where_column = array();
$db_where_value = array();
$db_where_column_or = array('grn.status', 'grn.status', 'grn.status');
$db_where_value_or = array(1, 3, 4);
$db_limit = array();
$db_order = array();
/***** start: record length and start *****/
if($this->input->post('length') != '-1') {
$db_limit['limit'] = $this->input->post('length');
$db_limit['pageStart'] = $this->input->post('start');
}
// end: get data order by
/***** start: get data order by *****/
$order = $this->input->post('order');
if($order) {
foreach($order as $key => $get_order) {
$db_order[$key]['title'] = $db_column[$get_order['column']-1];
$db_order[$key]['order_by'] = $get_order['dir'];
}
}
// end: get data order by
/***** start: top search data by equal to *****/
if($this->input->post('top_search_like')) {
foreach($this->input->post('top_search_like') as $key => $search_val) {
if(preg_match('/prod/', $key)) {
$search_key = substr($key, 5);
if(!empty($search_val)) {
$db_where_column[] = $search_key . ' LIKE';
$db_where_value[] = '%' . $search_val . '%';
}
}
}
}
if($this->input->post('top_search')) {
foreach($this->input->post('top_search') as $key => $search_val) {
if(preg_match('/prod/', $key)) {
$search_key = substr($key, 5);
if($search_val!="") {
$db_where_column[] = $search_key;
$db_where_value[] = $search_val;
}
}
}
}
// end: top search data by equal to
/***** start: search data by like *****/
$search = $this->input->post('search');
if($search['value'] != '') {
foreach($db_column as $value) {
$db_where_column_or[] = $value . ' LIKE';
$db_where_value_or[] = '%' . $search['value'] . '%';
}
}
// end: search data by like
$dataRecord = $this->Grn_model->get_grn($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or, $db_limit, $db_order);
$dataCount = $this->Grn_model->get_grn($db_where_column, $db_where_value, $db_where_column_or, $db_where_value_or);
// end: get all Grns or search Grns
$dt_column = array('grn_date', 'grn_num', 'delivery_challan_no', 'receiving_location', 'description', 'vendor_name');
$data = array();
$i = 0;
if($dataRecord) {
$view = "admin/grn/view/";
$edit = "";//"admin/requisition/edit/";
$remove = "";//"admin/requisition/delete_requisition/";
$btn_arr_responce = $this->create_action_array($view,$edit,$remove);
foreach($dataRecord as $key => $value) {
/*$btn_array_checked_checkbox = "admin/product/delete_checked_checkbox/";
$checkbox = "";
if(!$this->flexi_auth->is_privileged($this->menu_model->get_privilege_name($btn_array_checked_checkbox))){
$checkbox="disabled";
}
$data[$i][] = '<div class="checkbox-table"><label>
<input type="checkbox" '.$checkbox.' name="rfq['.$value['rfq_id'].']" class="flat-grey deleteThis">
</label></div>';*/
$data[$i][] = $i+1;
foreach($dt_column as $get_dt_column) {
if($get_dt_column == 'grn_date'){
$data[$i][] = date("d/M/Y", strtotime($value[$get_dt_column]));
}
else {
$data[$i][] = $value[$get_dt_column];
}
}
/***** start: delete and edit button *****/
$action_btn = '';
$action_btn .= '<div class="visible-md visible-lg hidden-sm hidden-xs">';
//$action_btn .= $this->create_action_buttons($btn_arr_responce,$value['rfq_id']);
$grn_id = $value['grn_id'];
if ($value['status'] == $this->config->item('activeFlag')) {
$action_btn .= '
<a href="'.base_url().'admin/Payment_request/add/'.$grn_id.'" class="" data-placement="top" data-original-title="" > Create Payment Request </a> | ';
}
$action_btn .= '
<a href="'.base_url().'admin/grn/generate_grn_pdf/'.$grn_id.'" class="" data-placement="top" data-original-title="Generate Grn Report" > <i class="glyphicon glyphicon-save"></i> </a>';
$action_btn .= '</div>';
$data[$i][] = $action_btn;
// end: delete and edit button
$i++;
}
}
$this->data['datatable']['draw'] = $this->input->post('draw');
$this->data['datatable']['recordsTotal'] = count($dataCount);
$this->data['datatable']['recordsFiltered'] = count($dataCount);
$this->data['datatable']['data'] = $data;
//echo '<pre>'; print_r($this->data['datatable']); die();
echo json_encode($this->data['datatable']);
}
function get_vendors(){
// load vendor model
$this->load->model('admin/Vendor_model');
$dataRecord = $this->Vendor_model->get_vendor();
$dataCount = $this->Vendor_model->get_vendor();
// end: get all Vendors
$dt_column = array('category', 'vendor_name', 'vendor_address', 'vendor_date', 'location_name');
$data = array();
$i = 0;
if($dataRecord) {
$view = "";
$edit = "";//"admin/requisition/edit/";
$remove = "admin/vendor/delete_vendor/";
$btn_arr_responce = $this->create_action_array($view,$edit,$remove);
foreach($dataRecord as $key => $value) {
foreach($dt_column as $get_dt_column) {
if($get_dt_column == 'vendor_date'){
$data[$i][] = date("d/M/Y", strtotime($value[$get_dt_column]));
}
else {
$data[$i][] = $value[$get_dt_column];
}
}
/***** start: delete and edit button *****/
$action_btn = '';
$action_btn .= '<div class="visible-md visible-lg hidden-sm hidden-xs">';
$action_btn .= $this->create_action_buttons($btn_arr_responce,$value['vendor_id']);
$vendor_id = $value['vendor_id'];
$action_btn .= '</div>';
$data[$i][] = $action_btn;
// end: delete and edit button
$i++;
}
}
$this->data['datatable']['draw'] = $this->input->post('draw');
$this->data['datatable']['recordsTotal'] = count($dataCount);
$this->data['datatable']['recordsFiltered'] = count($dataCount);
$this->data['datatable']['data'] = $data;
//echo '<pre>'; print_r($this->data['datatable']); die();
echo json_encode($this->data['datatable']);
}
function create_action_array($view_url,$edit_url,$delete_url){
$btn_array = array();
if($view_url)
$btn_array["View"]["action"] = $view_url ;
if($edit_url)
$btn_array["Edit"]["action"] = $edit_url ;
if($delete_url)
$btn_array["Remove"]["action"] = $delete_url ;
return $this->menu_model->get_privilege_name($btn_array);
}
function create_action_buttons($data,$id){
$action_btn = "";
$icon_classes = '';
foreach ($data as $keys => $record) {
// Dynamic Work for the previliges
if ($keys == 'View') {
$icon_classes = 'glyphicon glyphicon-eye-open';
}
else if ($keys == 'Edit') {
$icon_classes = 'glyphicon glyphicon-edit';
}
else if ($keys == 'Download') {
$icon_classes = 'glyphicon glyphicon-save';
}
else {
$link_text = $keys;
}
if ($this->flexi_auth->is_privileged($record['title']))
$action_btn .= '<a href="' . base_url() . $record['action'] . $id . '" class="' . $record['aClass'] . '" data-placement="top" data-original-title="' . $keys . '"><i class="' . $record['iClass'] . ' ' . $icon_classes . '"></i>' . $link_text . '</a> ';
}
return $action_btn;
}
}
?> | {
"content_hash": "801a9a1aea0f228879a52b24f9b87c3e",
"timestamp": "",
"source": "github",
"line_count": 2159,
"max_line_length": 347,
"avg_line_length": 40.169059749884205,
"alnum_prop": 0.43258575958489476,
"repo_name": "akhokhar/eProcurement-Application",
"id": "e6caa3aa4fa7882a1023666900c2b5c35ea0eceb",
"size": "86725",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/controllers/admin/Server_datatables.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "15982"
},
{
"name": "ApacheConf",
"bytes": "1554"
},
{
"name": "C",
"bytes": "2283"
},
{
"name": "CSS",
"bytes": "1856628"
},
{
"name": "CoffeeScript",
"bytes": "162875"
},
{
"name": "Go",
"bytes": "8967"
},
{
"name": "HTML",
"bytes": "18655031"
},
{
"name": "JavaScript",
"bytes": "11421153"
},
{
"name": "Makefile",
"bytes": "927"
},
{
"name": "PHP",
"bytes": "3712712"
},
{
"name": "Python",
"bytes": "18514"
},
{
"name": "Shell",
"bytes": "10219"
},
{
"name": "Smarty",
"bytes": "29850"
}
],
"symlink_target": ""
} |
NG_DOCS={
"sections": {
"api": "F9 Angular Scrabble API"
},
"pages": [
{
"section": "api",
"id": "api.dataApi",
"shortName": "api.dataApi",
"type": "service",
"moduleName": "api",
"shortDescription": "A service for data api calls",
"keywords": "api calls comma-separated data dataapi dictionary getdata legal list method request result returns scrabble service values"
},
{
"section": "api",
"id": "components.Tile",
"shortName": "components.Tile",
"type": "object",
"moduleName": "components",
"shortDescription": "A Class which holds a Letter and Score properties",
"keywords": "a-z api class components holds letter object properties score scrabble tile tiles"
},
{
"section": "api",
"id": "components.Word",
"shortName": "components.Word",
"type": "object",
"moduleName": "components",
"shortDescription": "An object containing a Scrabble word and it's score",
"keywords": "api components object score scrabble valid word"
},
{
"section": "api",
"id": "dictionary.DictionaryService",
"shortName": "dictionary.DictionaryService",
"type": "service",
"moduleName": "dictionary",
"shortDescription": "A Service for a Dictionary ",
"keywords": "api array csv dataapi dictionary dictionaryservice loads service turns"
},
{
"section": "api",
"id": "f9-angular-scrabble",
"shortName": "f9-angular-scrabble",
"type": "overview",
"moduleName": "f9-angular-scrabble",
"shortDescription": "An Ionic Application for to practise finding the best word from a set of tiles ",
"keywords": "angular api application best f9-angular-scrabble finding flux ionic overview practise set tiles word"
},
{
"section": "api",
"id": "fsm.StateMachineService",
"shortName": "fsm.StateMachineService",
"type": "service",
"moduleName": "fsm",
"shortDescription": "A Service for a Finite State Machine ",
"keywords": "api best create finish finite fsm https initial initialise javascript-state-machine machine makeready method paused play playing ready reset resetting service sets statemachine statemachineservice tiles word wrapper"
},
{
"section": "api",
"id": "fsm.StateMachineService:states",
"shortName": "states",
"type": "object",
"moduleName": "fsm",
"shortDescription": "A constant which holds 'FSM states'",
"keywords": "api constant fsm holds initial object statemachineservice"
},
{
"section": "api",
"id": "game.GameService",
"shortName": "game.GameService",
"type": "service",
"moduleName": "game",
"shortDescription": "A Service for the Game Related operations",
"keywords": "$log _setup actions amount api array bag callee collection creates dictionary ensure error function functions game gameservice gethand init initialise items letter letters method number operations order performs promise randomises ready removes replay required reset returns scrabble scrabbleservice selection service sets setupletterbag tiles updates updateuserselection user variety"
},
{
"section": "api",
"id": "game.GameService:rules",
"shortName": "rules",
"type": "object",
"moduleName": "game",
"shortDescription": "A constant which holds 'Game values'",
"keywords": "achive api bingo bingo_score constant full game gameservice holds length max_tiles number object player rules score set tiles values"
},
{
"section": "api",
"id": "lodash.f9-angular-scrabble._",
"shortName": "lodash.f9-angular-scrabble._",
"type": "service",
"moduleName": "lodash.f9-angular-scrabble",
"shortDescription": "Wrapper and extension for the Lodash Library",
"keywords": "api extension f9-angular-scrabble library lodash service wrapper"
},
{
"section": "api",
"id": "model.store:MyStore",
"shortName": "MyStore",
"type": "service",
"moduleName": "model",
"shortDescription": "A Flux Data Store",
"keywords": "api data flux model service store"
},
{
"section": "api",
"id": "modules.bestWord:f9BestWord",
"shortName": "f9BestWord",
"type": "directive",
"moduleName": "modules",
"shortDescription": "Responsible for displaying the Scrabble word with the highest score",
"keywords": "_createtiles ae api array bestword creates directive displaying fsm game gameservice highest method modules object objects responsible score scrabble scrabbleservice set statemachineservice supplied tile tiles word"
},
{
"section": "api",
"id": "modules.controls:f9Controls",
"shortName": "f9Controls",
"type": "directive",
"moduleName": "modules",
"shortDescription": "A Directive responsible for the Game Controls ",
"keywords": "$log ae angular api buttons control controller controls controlscontroller directive directives flow fsm game gameservice hidden logging method methods modules operations responsible service statemachineservice static"
},
{
"section": "api",
"id": "modules.tile:f9Tile",
"shortName": "f9Tile",
"type": "directive",
"moduleName": "modules",
"shortDescription": "Displays a single Scrabble tile",
"keywords": "ae api directive displays modules scrabble single tile"
},
{
"section": "api",
"id": "modules.tiles:f9Tiles",
"shortName": "f9Tiles",
"type": "directive",
"moduleName": "modules",
"shortDescription": "Displays a set of Scrabble tiles, which can be dragged to create a chosen word ",
"keywords": "ae api chosen create directive displays dragged fsm game gameservice informs items method modules scrabble selected service set statemachineservice tiles update word"
},
{
"section": "api",
"id": "modules.timer:f9Timer",
"shortName": "f9Timer",
"type": "directive",
"moduleName": "modules",
"shortDescription": "Displays a Count Down Timer",
"keywords": "ae api count directive displays game gameservice modules timer"
},
{
"section": "api",
"id": "modules.timer:f9TimerService",
"shortName": "f9TimerService",
"type": "service",
"moduleName": "modules",
"shortDescription": "A Service for a Clock or Timer ",
"keywords": "$log _inittimer _oncomplete _ontick actions angular api callbacks clock complete creates event flux good handles https instantiates interval large list logger method methods__oncomplete methods__ontick modules redraw relaying relays returns service sets static tick time timer times tock wrapper"
},
{
"section": "api",
"id": "scrabble.ScrabbleService",
"shortName": "scrabble.ScrabbleService",
"type": "service",
"moduleName": "scrabble",
"shortDescription": "A Service for Scrabble operations ",
"keywords": "$http _findbestword actor aggregated api array bag best collection complete components createletterbag creates data dataapi deal dictionary distribution empty evaluate exist f9-angular-scrabble finds getdictionary gethand gettilescore getwordscore highest html-scrabble https instantiates js legal letter letterbagisempty letters lodash method number operations pick promise remaining requested responsibility result return returns score scoring scrabble scrabbleservice search service set simply supplied tile tiles true type word"
},
{
"section": "api",
"id": "scrabblewords.Scrabble:WordFinderService",
"shortName": "WordFinderService",
"type": "service",
"moduleName": "scrabblewords",
"shortDescription": "A Service responsible for finding the possible words ",
"keywords": "_getwords api calls collection finding finds hand initialises letters list lodash makewordfinder method responsible return returns scrabble scrabblewords selection service underscore valid wordfinderservice wordlist"
}
],
"apis": {
"api": true
},
"__file": "_FAKE_DEST_/js/docs-setup.js",
"__options": {
"startPage": "/api/f9-angular-scrabble",
"scripts": [
"js/angular.min.js",
"js/angular-animate.min.js",
"js/marked.js",
"js/bower_components/flux-angular/release/flux-angular.js",
"js/bower_components/tock/tock.min.js",
"js/jakesgordon/state-machine.js"
],
"styles": [],
"title": "F9 Angular Scrabble API",
"html5Mode": true,
"editExample": true,
"navTemplate": false,
"navContent": "",
"navTemplateData": {},
"loadDefaults": {
"angular": true,
"angularAnimate": true,
"marked": true
}
},
"html5Mode": true,
"editExample": true,
"startPage": "/api/f9-angular-scrabble",
"scripts": [
"js/angular.min.js",
"js/angular-animate.min.js",
"js/marked.js",
"js/bower_components/flux-angular/release/flux-angular.js",
"js/bower_components/tock/tock.min.js",
"js/jakesgordon/state-machine.js"
]
}; | {
"content_hash": "2a8f8738734daebbb4a062732f9cce87",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 551,
"avg_line_length": 42.629629629629626,
"alnum_prop": 0.6575803649000869,
"repo_name": "russellf9/f9-angular-scrabble",
"id": "b080ab4035c966fabdcd0b59f0ff58612c004110",
"size": "9208",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/js/docs-setup.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "260844"
},
{
"name": "HTML",
"bytes": "6657"
},
{
"name": "JavaScript",
"bytes": "2401376"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sergi.fastcocktail">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden"
android:label="@string/app_name"
android:screenOrientation="behind"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".DialegOpcions"
android:label="@string/title_activity_dialeg_opcions"
android:theme="@style/Theme.MyDialog" />
<activity
android:name=".DialegPredeterminats"
android:label="@string/title_activity_dialeg_predeterminats"
android:theme="@style/Base.Theme.AppCompat.Light.Dialog" />
<activity
android:name=".ComandesActivity"
android:label="@string/title_activity_comandes"
android:theme="@style/AppTheme.NoActionBar"></activity>
</application>
</manifest>
| {
"content_hash": "f58a308c5b7f0239a18cbc97f9d5babd",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 76,
"avg_line_length": 40.891891891891895,
"alnum_prop": 0.6014540647719762,
"repo_name": "xavi19/AndroidFastCocktail",
"id": "78ddb63c4d7136c891e92b94f39728c714d55311",
"size": "1513",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "FastCocktail/app/src/main/AndroidManifest.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "41285"
}
],
"symlink_target": ""
} |
import { MonoTypeOperatorFunction, SubscribableOrPromise } from '../types';
/**
* Ignores source values for a duration determined by another Observable, then
* emits the most recent value from the source Observable, then repeats this
* process.
*
* <span class="informal">It's like {@link auditTime}, but the silencing
* duration is determined by a second Observable.</span>
*
* <img src="./img/audit.png" width="100%">
*
* `audit` is similar to `throttle`, but emits the last value from the silenced
* time window, instead of the first value. `audit` emits the most recent value
* from the source Observable on the output Observable as soon as its internal
* timer becomes disabled, and ignores source values while the timer is enabled.
* Initially, the timer is disabled. As soon as the first source value arrives,
* the timer is enabled by calling the `durationSelector` function with the
* source value, which returns the "duration" Observable. When the duration
* Observable emits a value or completes, the timer is disabled, then the most
* recent source value is emitted on the output Observable, and this process
* repeats for the next source value.
*
* @example <caption>Emit clicks at a rate of at most one click per second</caption>
* var clicks = Rx.Observable.fromEvent(document, 'click');
* var result = clicks.audit(ev => Rx.Observable.interval(1000));
* result.subscribe(x => console.log(x));
*
* @see {@link auditTime}
* @see {@link debounce}
* @see {@link delayWhen}
* @see {@link sample}
* @see {@link throttle}
*
* @param {function(value: T): SubscribableOrPromise} durationSelector A function
* that receives a value from the source Observable, for computing the silencing
* duration, returned as an Observable or a Promise.
* @return {Observable<T>} An Observable that performs rate-limiting of
* emissions from the source Observable.
* @method audit
* @owner Observable
*/
export declare function audit<T>(durationSelector: (value: T) => SubscribableOrPromise<any>): MonoTypeOperatorFunction<T>;
| {
"content_hash": "ad4503b51627bb7cf6c0d206e6e365a5",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 122,
"avg_line_length": 49,
"alnum_prop": 0.7400388726919339,
"repo_name": "mrtequino/JSW",
"id": "f2860e6a75875dba5391aca5a550954de84f8b81",
"size": "2058",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "nodejs/observables-rxjs/node_modules/rxjs/internal/operators/audit.d.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "243783"
},
{
"name": "HTML",
"bytes": "137440"
},
{
"name": "Java",
"bytes": "360339"
},
{
"name": "JavaScript",
"bytes": "93395"
},
{
"name": "TypeScript",
"bytes": "291910"
},
{
"name": "Vue",
"bytes": "14811"
}
],
"symlink_target": ""
} |
<?php
namespace Google\Service\AdExchangeBuyerII\Resource;
use Google\Service\AdExchangeBuyerII\ListFilteredBidsResponse;
/**
* The "filteredBids" collection of methods.
* Typical usage is:
* <code>
* $adexchangebuyer2Service = new Google\Service\AdExchangeBuyerII(...);
* $filteredBids = $adexchangebuyer2Service->filteredBids;
* </code>
*/
class BiddersAccountsFilterSetsFilteredBids extends \Google\Service\Resource
{
/**
* List all reasons for which bids were filtered, with the number of bids
* filtered for each reason.
* (filteredBids.listBiddersAccountsFilterSetsFilteredBids)
*
* @param string $filterSetName Name of the filter set that should be applied to
* the requested metrics. For example: - For a bidder-level filter set for
* bidder 123: `bidders/123/filterSets/abc` - For an account-level filter set
* for the buyer account representing bidder 123:
* `bidders/123/accounts/123/filterSets/abc` - For an account-level filter set
* for the child seat buyer account 456 whose bidder is 123:
* `bidders/123/accounts/456/filterSets/abc`
* @param array $optParams Optional parameters.
*
* @opt_param int pageSize Requested page size. The server may return fewer
* results than requested. If unspecified, the server will pick an appropriate
* default.
* @opt_param string pageToken A token identifying a page of results the server
* should return. Typically, this is the value of
* ListFilteredBidsResponse.nextPageToken returned from the previous call to the
* filteredBids.list method.
* @return ListFilteredBidsResponse
*/
public function listBiddersAccountsFilterSetsFilteredBids($filterSetName, $optParams = [])
{
$params = ['filterSetName' => $filterSetName];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], ListFilteredBidsResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(BiddersAccountsFilterSetsFilteredBids::class, 'Google_Service_AdExchangeBuyerII_Resource_BiddersAccountsFilterSetsFilteredBids');
| {
"content_hash": "0c4a4bbbf86733a1bc9043ea71f17e0d",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 141,
"avg_line_length": 42.48,
"alnum_prop": 0.751412429378531,
"repo_name": "googleapis/google-api-php-client-services",
"id": "3c7e1bd5dabad5f2edce94e522c9fc7b1074d6cc",
"size": "2714",
"binary": false,
"copies": "6",
"ref": "refs/heads/main",
"path": "src/AdExchangeBuyerII/Resource/BiddersAccountsFilterSetsFilteredBids.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "PHP",
"bytes": "55414116"
},
{
"name": "Python",
"bytes": "427325"
},
{
"name": "Shell",
"bytes": "787"
}
],
"symlink_target": ""
} |
using EspaceClient.BackOffice.Silverlight.ViewModels.References.Entite;
using EspaceClient.BackOffice.Silverlight.ViewModels.References.Entite.Tabs.Details;
namespace EspaceClient.BackOffice.Silverlight.ViewModels.ModelBuilders.References.Entite.Details
{
public interface IModelBuilderInformation
{
InformationViewModel Build(EntiteEntityViewModel entiteEntityViewModel);
}
}
| {
"content_hash": "b2b8292427afe3ced3effcd84fff7b74",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 96,
"avg_line_length": 39.8,
"alnum_prop": 0.8366834170854272,
"repo_name": "apo-j/Projects_Working",
"id": "aaa53754813cfbd5c857b52ce9ad3293b6185173",
"size": "398",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "EC/espace-client-dot-net/EspaceClient.BackOffice.Silverlight.ViewModels/ModelBuilders/References/Entite/Details/IModelBuilderInformation.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "16118"
},
{
"name": "Batchfile",
"bytes": "1096"
},
{
"name": "C#",
"bytes": "27262375"
},
{
"name": "CSS",
"bytes": "8474090"
},
{
"name": "Groff",
"bytes": "2101703"
},
{
"name": "HTML",
"bytes": "4910101"
},
{
"name": "JavaScript",
"bytes": "20716565"
},
{
"name": "PHP",
"bytes": "9283"
},
{
"name": "XSLT",
"bytes": "930531"
}
],
"symlink_target": ""
} |
/* Generated by camel build tools - do NOT edit this file! */
package org.apache.camel.component.zookeepermaster;
import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
import org.apache.camel.spi.PropertyConfigurerGetter;
import org.apache.camel.spi.ConfigurerStrategy;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
import org.apache.camel.util.CaseInsensitiveMap;
import org.apache.camel.support.component.PropertyConfigurerSupport;
/**
* Generated by camel build tools - do NOT edit this file!
*/
@SuppressWarnings("unchecked")
public class MasterEndpointConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {
@Override
public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
MasterEndpoint target = (MasterEndpoint) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "bridgeerrorhandler":
case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
case "exceptionhandler":
case "exceptionHandler": target.setExceptionHandler(property(camelContext, org.apache.camel.spi.ExceptionHandler.class, value)); return true;
case "exchangepattern":
case "exchangePattern": target.setExchangePattern(property(camelContext, org.apache.camel.ExchangePattern.class, value)); return true;
case "synchronous": target.setSynchronous(property(camelContext, boolean.class, value)); return true;
default: return false;
}
}
@Override
public Class<?> getOptionType(String name, boolean ignoreCase) {
switch (ignoreCase ? name.toLowerCase() : name) {
case "bridgeerrorhandler":
case "bridgeErrorHandler": return boolean.class;
case "exceptionhandler":
case "exceptionHandler": return org.apache.camel.spi.ExceptionHandler.class;
case "exchangepattern":
case "exchangePattern": return org.apache.camel.ExchangePattern.class;
case "synchronous": return boolean.class;
default: return null;
}
}
@Override
public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
MasterEndpoint target = (MasterEndpoint) obj;
switch (ignoreCase ? name.toLowerCase() : name) {
case "bridgeerrorhandler":
case "bridgeErrorHandler": return target.isBridgeErrorHandler();
case "exceptionhandler":
case "exceptionHandler": return target.getExceptionHandler();
case "exchangepattern":
case "exchangePattern": return target.getExchangePattern();
case "synchronous": return target.isSynchronous();
default: return null;
}
}
}
| {
"content_hash": "48dee51a2ee7cd46c748d1a7dee95365",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 149,
"avg_line_length": 44.625,
"alnum_prop": 0.7251400560224089,
"repo_name": "nicolaferraro/camel",
"id": "de5811a4171a834cfc1379cb99d378b5f0146a40",
"size": "2856",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "components/camel-zookeeper-master/src/generated/java/org/apache/camel/component/zookeepermaster/MasterEndpointConfigurer.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Apex",
"bytes": "6521"
},
{
"name": "Batchfile",
"bytes": "2353"
},
{
"name": "CSS",
"bytes": "5472"
},
{
"name": "Elm",
"bytes": "10852"
},
{
"name": "FreeMarker",
"bytes": "8015"
},
{
"name": "Groovy",
"bytes": "14479"
},
{
"name": "HTML",
"bytes": "916625"
},
{
"name": "Java",
"bytes": "82748568"
},
{
"name": "JavaScript",
"bytes": "100326"
},
{
"name": "Makefile",
"bytes": "513"
},
{
"name": "Shell",
"bytes": "17240"
},
{
"name": "TSQL",
"bytes": "28835"
},
{
"name": "Tcl",
"bytes": "4974"
},
{
"name": "Thrift",
"bytes": "6979"
},
{
"name": "XQuery",
"bytes": "546"
},
{
"name": "XSLT",
"bytes": "275257"
}
],
"symlink_target": ""
} |
package org.apache.spark.sql.hive.execution
import java.io.{DataInput, DataOutput, File, PrintWriter}
import java.util.{ArrayList, Arrays, Properties}
import org.apache.hadoop.conf.Configuration
import org.apache.hadoop.hive.ql.exec.UDF
import org.apache.hadoop.hive.ql.udf.{UDAFPercentile, UDFType}
import org.apache.hadoop.hive.ql.udf.generic._
import org.apache.hadoop.hive.ql.udf.generic.GenericUDF.DeferredObject
import org.apache.hadoop.hive.serde2.{AbstractSerDe, SerDeStats}
import org.apache.hadoop.hive.serde2.objectinspector.{ObjectInspector, ObjectInspectorFactory}
import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory
import org.apache.hadoop.io.{LongWritable, Writable}
import org.apache.spark.sql.{AnalysisException, QueryTest, Row}
import org.apache.spark.sql.catalyst.plans.logical.Project
import org.apache.spark.sql.execution.command.FunctionsCommand
import org.apache.spark.sql.functions.max
import org.apache.spark.sql.hive.test.TestHiveSingleton
import org.apache.spark.sql.internal.SQLConf
import org.apache.spark.sql.test.SQLTestUtils
import org.apache.spark.util.Utils
case class Fields(f1: Int, f2: Int, f3: Int, f4: Int, f5: Int)
// Case classes for the custom UDF's.
case class IntegerCaseClass(i: Int)
case class ListListIntCaseClass(lli: Seq[(Int, Int, Int)])
case class StringCaseClass(s: String)
case class ListStringCaseClass(l: Seq[String])
/**
* A test suite for Hive custom UDFs.
*/
class HiveUDFSuite extends QueryTest with TestHiveSingleton with SQLTestUtils {
import spark.udf
import spark.implicits._
test("spark sql udf test that returns a struct") {
udf.register("getStruct", (_: Int) => Fields(1, 2, 3, 4, 5))
assert(sql(
"""
|SELECT getStruct(1).f1,
| getStruct(1).f2,
| getStruct(1).f3,
| getStruct(1).f4,
| getStruct(1).f5 FROM src LIMIT 1
""".stripMargin).head() === Row(1, 2, 3, 4, 5))
}
test("SPARK-4785 When called with arguments referring column fields, PMOD throws NPE") {
checkAnswer(
sql("SELECT PMOD(CAST(key as INT), 10) FROM src LIMIT 1"),
Row(8)
)
}
test("hive struct udf") {
withTable("hiveUDFTestTable") {
sql(
"""
|CREATE TABLE hiveUDFTestTable (
| pair STRUCT<id: INT, value: INT>
|)
|PARTITIONED BY (partition STRING)
|ROW FORMAT SERDE '%s'
|STORED AS SEQUENCEFILE
""".
stripMargin.format(classOf[PairSerDe].getName))
val location = Utils.getSparkClassLoader.getResource("data/files/testUDF").getFile
sql(s"""
ALTER TABLE hiveUDFTestTable
ADD IF NOT EXISTS PARTITION(partition='testUDF')
LOCATION '$location'""")
sql(s"CREATE TEMPORARY FUNCTION testUDF AS '${classOf[PairUDF].getName}'")
sql("SELECT testUDF(pair) FROM hiveUDFTestTable")
sql("DROP TEMPORARY FUNCTION IF EXISTS testUDF")
}
}
test("Max/Min on named_struct") {
checkAnswer(sql(
"""
|SELECT max(named_struct(
| "key", key,
| "value", value)).value FROM src
""".stripMargin), Seq(Row("val_498")))
checkAnswer(sql(
"""
|SELECT min(named_struct(
| "key", key,
| "value", value)).value FROM src
""".stripMargin), Seq(Row("val_0")))
// nested struct cases
checkAnswer(sql(
"""
|SELECT max(named_struct(
| "key", named_struct(
"key", key,
"value", value),
| "value", value)).value FROM src
""".stripMargin), Seq(Row("val_498")))
checkAnswer(sql(
"""
|SELECT min(named_struct(
| "key", named_struct(
"key", key,
"value", value),
| "value", value)).value FROM src
""".stripMargin), Seq(Row("val_0")))
}
test("SPARK-6409 UDAF Average test") {
sql(s"CREATE TEMPORARY FUNCTION test_avg AS '${classOf[GenericUDAFAverage].getName}'")
checkAnswer(
sql("SELECT test_avg(1), test_avg(substr(value,5)) FROM src"),
Seq(Row(1.0, 260.182)))
sql("DROP TEMPORARY FUNCTION IF EXISTS test_avg")
hiveContext.reset()
}
test("SPARK-2693 udaf aggregates test") {
checkAnswer(sql("SELECT percentile(key, 1) FROM src LIMIT 1"),
sql("SELECT max(key) FROM src").collect().toSeq)
checkAnswer(sql("SELECT percentile(key, array(1, 1)) FROM src LIMIT 1"),
sql("SELECT array(max(key), max(key)) FROM src").collect().toSeq)
}
test("SPARK-16228 Percentile needs explicit cast to double") {
sql("select percentile(value, cast(0.5 as double)) from values 1,2,3 T(value)")
sql("select percentile_approx(value, cast(0.5 as double)) from values 1.0,2.0,3.0 T(value)")
sql("select percentile(value, 0.5) from values 1,2,3 T(value)")
sql("select percentile_approx(value, 0.5) from values 1.0,2.0,3.0 T(value)")
}
test("Generic UDAF aggregates") {
checkAnswer(sql(
"""
|SELECT percentile_approx(2, 0.99999),
| sum(distinct 1),
| count(distinct 1,2,3,4) FROM src LIMIT 1
""".stripMargin), sql("SELECT 2, 1, 1 FROM src LIMIT 1").collect().toSeq)
checkAnswer(sql(
"""
|SELECT ceiling(percentile_approx(distinct key, 0.99999)),
| count(distinct key),
| sum(distinct key),
| count(distinct 1),
| sum(distinct 1),
| sum(1) FROM src LIMIT 1
""".stripMargin),
sql(
"""
|SELECT max(key),
| count(distinct key),
| sum(distinct key),
| 1, 1, sum(1) FROM src LIMIT 1
""".stripMargin).collect().toSeq)
checkAnswer(sql(
"""
|SELECT ceiling(percentile_approx(distinct key, 0.9 + 0.09999)),
| count(distinct key), sum(distinct key),
| count(distinct 1), sum(distinct 1),
| sum(1) FROM src LIMIT 1
""".stripMargin),
sql("SELECT max(key), count(distinct key), sum(distinct key), 1, 1, sum(1) FROM src LIMIT 1")
.collect().toSeq)
checkAnswer(sql("SELECT ceiling(percentile_approx(key, 0.99999D)) FROM src LIMIT 1"),
sql("SELECT max(key) FROM src LIMIT 1").collect().toSeq)
checkAnswer(sql("SELECT percentile_approx(100.0D, array(0.9D, 0.9D)) FROM src LIMIT 1"),
sql("SELECT array(100, 100) FROM src LIMIT 1").collect().toSeq)
}
test("UDFIntegerToString") {
val testData = spark.sparkContext.parallelize(
IntegerCaseClass(1) :: IntegerCaseClass(2) :: Nil).toDF()
testData.createOrReplaceTempView("integerTable")
val udfName = classOf[UDFIntegerToString].getName
sql(s"CREATE TEMPORARY FUNCTION testUDFIntegerToString AS '$udfName'")
checkAnswer(
sql("SELECT testUDFIntegerToString(i) FROM integerTable"),
Seq(Row("1"), Row("2")))
sql("DROP TEMPORARY FUNCTION IF EXISTS testUDFIntegerToString")
hiveContext.reset()
}
test("UDFToListString") {
val testData = spark.sparkContext.parallelize(StringCaseClass("") :: Nil).toDF()
testData.createOrReplaceTempView("inputTable")
sql(s"CREATE TEMPORARY FUNCTION testUDFToListString AS '${classOf[UDFToListString].getName}'")
checkAnswer(
sql("SELECT testUDFToListString(s) FROM inputTable"),
Seq(Row(Seq("data1", "data2", "data3"))))
sql("DROP TEMPORARY FUNCTION IF EXISTS testUDFToListString")
hiveContext.reset()
}
test("UDFToListInt") {
val testData = spark.sparkContext.parallelize(StringCaseClass("") :: Nil).toDF()
testData.createOrReplaceTempView("inputTable")
sql(s"CREATE TEMPORARY FUNCTION testUDFToListInt AS '${classOf[UDFToListInt].getName}'")
checkAnswer(
sql("SELECT testUDFToListInt(s) FROM inputTable"),
Seq(Row(Seq(1, 2, 3))))
sql("DROP TEMPORARY FUNCTION IF EXISTS testUDFToListInt")
hiveContext.reset()
}
test("UDFToStringIntMap") {
val testData = spark.sparkContext.parallelize(StringCaseClass("") :: Nil).toDF()
testData.createOrReplaceTempView("inputTable")
sql(s"CREATE TEMPORARY FUNCTION testUDFToStringIntMap " +
s"AS '${classOf[UDFToStringIntMap].getName}'")
checkAnswer(
sql("SELECT testUDFToStringIntMap(s) FROM inputTable"),
Seq(Row(Map("key1" -> 1, "key2" -> 2, "key3" -> 3))))
sql("DROP TEMPORARY FUNCTION IF EXISTS testUDFToStringIntMap")
hiveContext.reset()
}
test("UDFToIntIntMap") {
val testData = spark.sparkContext.parallelize(StringCaseClass("") :: Nil).toDF()
testData.createOrReplaceTempView("inputTable")
sql(s"CREATE TEMPORARY FUNCTION testUDFToIntIntMap " +
s"AS '${classOf[UDFToIntIntMap].getName}'")
checkAnswer(
sql("SELECT testUDFToIntIntMap(s) FROM inputTable"),
Seq(Row(Map(1 -> 1, 2 -> 1, 3 -> 1))))
sql("DROP TEMPORARY FUNCTION IF EXISTS testUDFToIntIntMap")
hiveContext.reset()
}
test("UDFToListMapStringListInt") {
val testData = spark.sparkContext.parallelize(StringCaseClass("") :: Nil).toDF()
testData.createOrReplaceTempView("inputTable")
sql(s"CREATE TEMPORARY FUNCTION testUDFToListMapStringListInt " +
s"AS '${classOf[UDFToListMapStringListInt].getName}'")
checkAnswer(
sql("SELECT testUDFToListMapStringListInt(s) FROM inputTable"),
Seq(Row(Seq(Map("a" -> Seq(1, 2), "b" -> Seq(3, 4))))))
sql("DROP TEMPORARY FUNCTION IF EXISTS testUDFToListMapStringListInt")
hiveContext.reset()
}
test("UDFRawList") {
val testData = spark.sparkContext.parallelize(StringCaseClass("") :: Nil).toDF()
testData.createOrReplaceTempView("inputTable")
sql(s"CREATE TEMPORARY FUNCTION testUDFRawList " +
s"AS '${classOf[UDFRawList].getName}'")
val err = intercept[AnalysisException](sql("SELECT testUDFRawList(s) FROM inputTable"))
assert(err.getMessage.contains(
"Raw list type in java is unsupported because Spark cannot infer the element type."))
sql("DROP TEMPORARY FUNCTION IF EXISTS testUDFRawList")
hiveContext.reset()
}
test("UDFRawMap") {
val testData = spark.sparkContext.parallelize(StringCaseClass("") :: Nil).toDF()
testData.createOrReplaceTempView("inputTable")
sql(s"CREATE TEMPORARY FUNCTION testUDFRawMap " +
s"AS '${classOf[UDFRawMap].getName}'")
val err = intercept[AnalysisException](sql("SELECT testUDFRawMap(s) FROM inputTable"))
assert(err.getMessage.contains(
"Raw map type in java is unsupported because Spark cannot infer key and value types."))
sql("DROP TEMPORARY FUNCTION IF EXISTS testUDFRawMap")
hiveContext.reset()
}
test("UDFWildcardList") {
val testData = spark.sparkContext.parallelize(StringCaseClass("") :: Nil).toDF()
testData.createOrReplaceTempView("inputTable")
sql(s"CREATE TEMPORARY FUNCTION testUDFWildcardList " +
s"AS '${classOf[UDFWildcardList].getName}'")
val err = intercept[AnalysisException](sql("SELECT testUDFWildcardList(s) FROM inputTable"))
assert(err.getMessage.contains(
"Collection types with wildcards (e.g. List<?> or Map<?, ?>) are unsupported " +
"because Spark cannot infer the data type for these type parameters."))
sql("DROP TEMPORARY FUNCTION IF EXISTS testUDFWildcardList")
hiveContext.reset()
}
test("UDFListListInt") {
val testData = spark.sparkContext.parallelize(
ListListIntCaseClass(Nil) ::
ListListIntCaseClass(Seq((1, 2, 3))) ::
ListListIntCaseClass(Seq((4, 5, 6), (7, 8, 9))) :: Nil).toDF()
testData.createOrReplaceTempView("listListIntTable")
sql(s"CREATE TEMPORARY FUNCTION testUDFListListInt AS '${classOf[UDFListListInt].getName}'")
checkAnswer(
sql("SELECT testUDFListListInt(lli) FROM listListIntTable"),
Seq(Row(0), Row(2), Row(13)))
sql("DROP TEMPORARY FUNCTION IF EXISTS testUDFListListInt")
hiveContext.reset()
}
test("UDFListString") {
val testData = spark.sparkContext.parallelize(
ListStringCaseClass(Seq("a", "b", "c")) ::
ListStringCaseClass(Seq("d", "e")) :: Nil).toDF()
testData.createOrReplaceTempView("listStringTable")
sql(s"CREATE TEMPORARY FUNCTION testUDFListString AS '${classOf[UDFListString].getName}'")
checkAnswer(
sql("SELECT testUDFListString(l) FROM listStringTable"),
Seq(Row("a,b,c"), Row("d,e")))
sql("DROP TEMPORARY FUNCTION IF EXISTS testUDFListString")
hiveContext.reset()
}
test("UDFStringString") {
val testData = spark.sparkContext.parallelize(
StringCaseClass("world") :: StringCaseClass("goodbye") :: Nil).toDF()
testData.createOrReplaceTempView("stringTable")
sql(s"CREATE TEMPORARY FUNCTION testStringStringUDF AS '${classOf[UDFStringString].getName}'")
checkAnswer(
sql("SELECT testStringStringUDF(\"hello\", s) FROM stringTable"),
Seq(Row("hello world"), Row("hello goodbye")))
checkAnswer(
sql("SELECT testStringStringUDF(\"\", testStringStringUDF(\"hello\", s)) FROM stringTable"),
Seq(Row(" hello world"), Row(" hello goodbye")))
sql("DROP TEMPORARY FUNCTION IF EXISTS testStringStringUDF")
hiveContext.reset()
}
test("UDFTwoListList") {
val testData = spark.sparkContext.parallelize(
ListListIntCaseClass(Nil) ::
ListListIntCaseClass(Seq((1, 2, 3))) ::
ListListIntCaseClass(Seq((4, 5, 6), (7, 8, 9))) ::
Nil).toDF()
testData.createOrReplaceTempView("TwoListTable")
sql(s"CREATE TEMPORARY FUNCTION testUDFTwoListList AS '${classOf[UDFTwoListList].getName}'")
checkAnswer(
sql("SELECT testUDFTwoListList(lli, lli) FROM TwoListTable"),
Seq(Row("0, 0"), Row("2, 2"), Row("13, 13")))
sql("DROP TEMPORARY FUNCTION IF EXISTS testUDFTwoListList")
hiveContext.reset()
}
test("non-deterministic children of UDF") {
withUserDefinedFunction("testStringStringUDF" -> true, "testGenericUDFHash" -> true) {
// HiveSimpleUDF
sql(s"CREATE TEMPORARY FUNCTION testStringStringUDF AS '${classOf[UDFStringString].getName}'")
val df1 = sql("SELECT testStringStringUDF(rand(), \"hello\")")
assert(!df1.logicalPlan.asInstanceOf[Project].projectList.forall(_.deterministic))
// HiveGenericUDF
sql(s"CREATE TEMPORARY FUNCTION testGenericUDFHash AS '${classOf[GenericUDFHash].getName}'")
val df2 = sql("SELECT testGenericUDFHash(rand())")
assert(!df2.logicalPlan.asInstanceOf[Project].projectList.forall(_.deterministic))
}
}
test("Hive UDFs with insufficient number of input arguments should trigger an analysis error") {
withTempView("testUDF") {
Seq((1, 2)).toDF("a", "b").createOrReplaceTempView("testUDF")
def testErrorMsgForFunc(funcName: String, className: String): Unit = {
withUserDefinedFunction(funcName -> true) {
sql(s"CREATE TEMPORARY FUNCTION $funcName AS '$className'")
val message = intercept[AnalysisException] {
sql(s"SELECT $funcName() FROM testUDF")
}.getMessage
assert(message.contains(s"No handler for UDF/UDAF/UDTF '$className'"))
}
}
// HiveSimpleUDF
testErrorMsgForFunc("testUDFTwoListList", classOf[UDFTwoListList].getName)
// HiveGenericUDF
testErrorMsgForFunc("testUDFAnd", classOf[GenericUDFOPAnd].getName)
// Hive UDAF
testErrorMsgForFunc("testUDAFPercentile", classOf[UDAFPercentile].getName)
// AbstractGenericUDAFResolver
testErrorMsgForFunc("testUDAFAverage", classOf[GenericUDAFAverage].getName)
// AbstractGenericUDAFResolver
testErrorMsgForFunc("testUDTFExplode", classOf[GenericUDTFExplode].getName)
}
}
test("Hive UDF in group by") {
withTempView("tab1") {
Seq(Tuple1(1451400761)).toDF("test_date").createOrReplaceTempView("tab1")
sql(s"CREATE TEMPORARY FUNCTION testUDFToDate AS '${classOf[GenericUDFToDate].getName}'")
val count = sql("select testUDFToDate(cast(test_date as timestamp))" +
" from tab1 group by testUDFToDate(cast(test_date as timestamp))").count()
sql("DROP TEMPORARY FUNCTION IF EXISTS testUDFToDate")
assert(count == 1)
}
}
test("SPARK-11522 select input_file_name from non-parquet table") {
withTempDir { tempDir =>
// EXTERNAL OpenCSVSerde table pointing to LOCATION
val file1 = new File(tempDir + "/data1")
Utils.tryWithResource(new PrintWriter(file1)) { writer =>
writer.write("1,2")
}
val file2 = new File(tempDir + "/data2")
Utils.tryWithResource(new PrintWriter(file2)) { writer =>
writer.write("1,2")
}
sql(
s"""CREATE EXTERNAL TABLE csv_table(page_id INT, impressions INT)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde'
WITH SERDEPROPERTIES (
\"separatorChar\" = \",\",
\"quoteChar\" = \"\\\"\",
\"escapeChar\" = \"\\\\\")
LOCATION '${tempDir.toURI}'
""")
val answer1 =
sql("SELECT input_file_name() FROM csv_table").head().getString(0)
assert(answer1.contains("data1") || answer1.contains("data2"))
val count1 = sql("SELECT input_file_name() FROM csv_table").distinct().count()
assert(count1 == 2)
sql("DROP TABLE csv_table")
// EXTERNAL pointing to LOCATION
sql(
s"""CREATE EXTERNAL TABLE external_t5 (c1 int, c2 int)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
LOCATION '${tempDir.toURI}'
""")
val answer2 =
sql("SELECT input_file_name() as file FROM external_t5").head().getString(0)
assert(answer1.contains("data1") || answer1.contains("data2"))
val count2 = sql("SELECT input_file_name() as file FROM external_t5").distinct().count
assert(count2 == 2)
sql("DROP TABLE external_t5")
}
withTempDir { tempDir =>
// External parquet pointing to LOCATION
val parquetLocation = s"${tempDir.toURI}/external_parquet"
sql("SELECT 1, 2").write.parquet(parquetLocation)
sql(
s"""CREATE EXTERNAL TABLE external_parquet(c1 int, c2 int)
STORED AS PARQUET
LOCATION '$parquetLocation'
""")
val answer3 =
sql("SELECT input_file_name() as file FROM external_parquet").head().getString(0)
assert(answer3.contains("external_parquet"))
val count3 = sql("SELECT input_file_name() as file FROM external_parquet").distinct().count
assert(count3 == 1)
sql("DROP TABLE external_parquet")
}
// Non-External parquet pointing to /tmp/...
sql("CREATE TABLE parquet_tmp STORED AS parquet AS SELECT 1, 2")
val answer4 =
sql("SELECT input_file_name() as file FROM parquet_tmp").head().getString(0)
assert(answer4.contains("parquet_tmp"))
val count4 = sql("SELECT input_file_name() as file FROM parquet_tmp").distinct().count
assert(count4 == 1)
sql("DROP TABLE parquet_tmp")
}
test("Hive Stateful UDF") {
withUserDefinedFunction("statefulUDF" -> true, "statelessUDF" -> true) {
sql(s"CREATE TEMPORARY FUNCTION statefulUDF AS '${classOf[StatefulUDF].getName}'")
sql(s"CREATE TEMPORARY FUNCTION statelessUDF AS '${classOf[StatelessUDF].getName}'")
val testData = spark.range(10).repartition(1)
// Expected Max(s) is 10 as statefulUDF returns the sequence number starting from 1.
checkAnswer(testData.selectExpr("statefulUDF() as s").agg(max($"s")), Row(10))
// Expected Max(s) is 5 as statefulUDF returns the sequence number starting from 1,
// and the data is evenly distributed into 2 partitions.
checkAnswer(testData.repartition(2)
.selectExpr("statefulUDF() as s").agg(max($"s")), Row(5))
// Expected Max(s) is 1, as stateless UDF is deterministic and foldable and replaced
// by constant 1 by ConstantFolding optimizer.
checkAnswer(testData.selectExpr("statelessUDF() as s").agg(max($"s")), Row(1))
}
}
test("Show persistent functions") {
val testData = spark.sparkContext.parallelize(StringCaseClass("") :: Nil).toDF()
withTempView("inputTable") {
testData.createOrReplaceTempView("inputTable")
withUserDefinedFunction("testUDFToListInt" -> false) {
val numFunc = spark.catalog.listFunctions().count()
sql(s"CREATE FUNCTION testUDFToListInt AS '${classOf[UDFToListInt].getName}'")
assert(spark.catalog.listFunctions().count() == numFunc + 1)
checkAnswer(
sql("SELECT testUDFToListInt(s) FROM inputTable"),
Seq(Row(Seq(1, 2, 3))))
assert(sql("show functions").count() ==
numFunc + FunctionsCommand.virtualOperators.size + 1)
assert(spark.catalog.listFunctions().count() == numFunc + 1)
}
}
}
test("Temp function has dots in the names") {
withUserDefinedFunction("test_avg" -> false, "`default.test_avg`" -> true) {
sql(s"CREATE FUNCTION test_avg AS '${classOf[GenericUDAFAverage].getName}'")
checkAnswer(sql("SELECT test_avg(1)"), Row(1.0))
// temp function containing dots in the name
spark.udf.register("default.test_avg", () => { Math.random() + 2})
assert(sql("SELECT `default.test_avg`()").head().getDouble(0) >= 2.0)
checkAnswer(sql("SELECT test_avg(1)"), Row(1.0))
}
}
test("Call the function registered in the not-current database") {
Seq("true", "false").foreach { caseSensitive =>
withSQLConf(SQLConf.CASE_SENSITIVE.key -> caseSensitive) {
withDatabase("dAtABaSe1") {
sql("CREATE DATABASE dAtABaSe1")
withUserDefinedFunction("dAtABaSe1.test_avg" -> false) {
sql(s"CREATE FUNCTION dAtABaSe1.test_avg AS '${classOf[GenericUDAFAverage].getName}'")
checkAnswer(sql("SELECT dAtABaSe1.test_avg(1)"), Row(1.0))
}
val message = intercept[AnalysisException] {
sql("SELECT dAtABaSe1.unknownFunc(1)")
}.getMessage
assert(message.contains("Undefined function: 'unknownFunc'") &&
message.contains("nor a permanent function registered in the database 'dAtABaSe1'"))
}
}
}
}
test("UDTF") {
withUserDefinedFunction("udtf_count2" -> true) {
sql(s"ADD JAR ${hiveContext.getHiveFile("TestUDTF.jar").getCanonicalPath}")
// The function source code can be found at:
// https://cwiki.apache.org/confluence/display/Hive/DeveloperGuide+UDTF
sql(
"""
|CREATE TEMPORARY FUNCTION udtf_count2
|AS 'org.apache.spark.sql.hive.execution.GenericUDTFCount2'
""".stripMargin)
checkAnswer(
sql("SELECT key, cc FROM src LATERAL VIEW udtf_count2(value) dd AS cc"),
Row(97, 500) :: Row(97, 500) :: Nil)
checkAnswer(
sql("SELECT udtf_count2(a) FROM (SELECT 1 AS a FROM src LIMIT 3) t"),
Row(3) :: Row(3) :: Nil)
}
}
test("permanent UDTF") {
withUserDefinedFunction("udtf_count_temp" -> false) {
sql(
s"""
|CREATE FUNCTION udtf_count_temp
|AS 'org.apache.spark.sql.hive.execution.GenericUDTFCount2'
|USING JAR '${hiveContext.getHiveFile("TestUDTF.jar").toURI}'
""".stripMargin)
checkAnswer(
sql("SELECT key, cc FROM src LATERAL VIEW udtf_count_temp(value) dd AS cc"),
Row(97, 500) :: Row(97, 500) :: Nil)
checkAnswer(
sql("SELECT udtf_count_temp(a) FROM (SELECT 1 AS a FROM src LIMIT 3) t"),
Row(3) :: Row(3) :: Nil)
}
}
test("SPARK-25768 constant argument expecting Hive UDF") {
withTempView("inputTable") {
spark.range(10).createOrReplaceTempView("inputTable")
withUserDefinedFunction("testGenericUDAFPercentileApprox" -> false) {
val numFunc = spark.catalog.listFunctions().count()
sql(s"CREATE FUNCTION testGenericUDAFPercentileApprox AS '" +
s"${classOf[GenericUDAFPercentileApprox].getName}'")
checkAnswer(
sql("SELECT testGenericUDAFPercentileApprox(id, 0.5) FROM inputTable"),
Seq(Row(4.0)))
}
}
}
test("SPARK-28012 Hive UDF supports struct type foldable expression") {
withUserDefinedFunction("testUDFStructType" -> false) {
// Simulate a hive udf that supports struct parameters
sql("CREATE FUNCTION testUDFStructType AS '" +
s"${classOf[GenericUDFArray].getName}'")
checkAnswer(
sql("SELECT testUDFStructType(named_struct('name', 'xx', 'value', 1))[0].value"),
Seq(Row(1)))
}
}
}
class TestPair(x: Int, y: Int) extends Writable with Serializable {
def this() = this(0, 0)
var entry: (Int, Int) = (x, y)
override def write(output: DataOutput): Unit = {
output.writeInt(entry._1)
output.writeInt(entry._2)
}
override def readFields(input: DataInput): Unit = {
val x = input.readInt()
val y = input.readInt()
entry = (x, y)
}
}
class PairSerDe extends AbstractSerDe {
override def initialize(p1: Configuration, p2: Properties): Unit = {}
override def getObjectInspector: ObjectInspector = {
ObjectInspectorFactory
.getStandardStructObjectInspector(
Arrays.asList("pair"),
Arrays.asList(ObjectInspectorFactory.getStandardStructObjectInspector(
Arrays.asList("id", "value"),
Arrays.asList(PrimitiveObjectInspectorFactory.javaIntObjectInspector,
PrimitiveObjectInspectorFactory.javaIntObjectInspector))
))
}
override def getSerializedClass: Class[_ <: Writable] = classOf[TestPair]
override def getSerDeStats: SerDeStats = null
override def serialize(p1: scala.Any, p2: ObjectInspector): Writable = null
override def deserialize(value: Writable): AnyRef = {
val pair = value.asInstanceOf[TestPair]
val row = new ArrayList[ArrayList[AnyRef]]
row.add(new ArrayList[AnyRef](2))
row.get(0).add(Integer.valueOf(pair.entry._1))
row.get(0).add(Integer.valueOf(pair.entry._2))
row
}
}
class PairUDF extends GenericUDF {
override def initialize(p1: Array[ObjectInspector]): ObjectInspector =
ObjectInspectorFactory.getStandardStructObjectInspector(
Arrays.asList("id", "value"),
Arrays.asList(PrimitiveObjectInspectorFactory.javaIntObjectInspector,
PrimitiveObjectInspectorFactory.javaIntObjectInspector)
)
override def evaluate(args: Array[DeferredObject]): AnyRef = {
Integer.valueOf(args(0).get.asInstanceOf[TestPair].entry._2)
}
override def getDisplayString(p1: Array[String]): String = ""
}
@UDFType(stateful = true)
class StatefulUDF extends UDF {
private val result = new LongWritable(0)
def evaluate(): LongWritable = {
result.set(result.get() + 1)
result
}
}
class StatelessUDF extends UDF {
private val result = new LongWritable(0)
def evaluate(): LongWritable = {
result.set(result.get() + 1)
result
}
}
| {
"content_hash": "9d5370a6b1c37832c5537858c36b2d13",
"timestamp": "",
"source": "github",
"line_count": 735,
"max_line_length": 100,
"avg_line_length": 36.73061224489796,
"alnum_prop": 0.6539245101307553,
"repo_name": "caneGuy/spark",
"id": "aa694ea274d756cfa29c97ddd500e47eea2cdb91",
"size": "27797",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUDFSuite.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "42807"
},
{
"name": "Batchfile",
"bytes": "31085"
},
{
"name": "C",
"bytes": "1493"
},
{
"name": "CSS",
"bytes": "26884"
},
{
"name": "Dockerfile",
"bytes": "8809"
},
{
"name": "HTML",
"bytes": "70197"
},
{
"name": "HiveQL",
"bytes": "1823426"
},
{
"name": "Java",
"bytes": "3462014"
},
{
"name": "JavaScript",
"bytes": "196653"
},
{
"name": "Makefile",
"bytes": "9397"
},
{
"name": "PLpgSQL",
"bytes": "192166"
},
{
"name": "PowerShell",
"bytes": "3856"
},
{
"name": "Python",
"bytes": "2893819"
},
{
"name": "R",
"bytes": "1183271"
},
{
"name": "Roff",
"bytes": "15758"
},
{
"name": "SQLPL",
"bytes": "3603"
},
{
"name": "Scala",
"bytes": "28568135"
},
{
"name": "Shell",
"bytes": "201165"
},
{
"name": "Thrift",
"bytes": "33605"
},
{
"name": "q",
"bytes": "146878"
}
],
"symlink_target": ""
} |
#ifndef __LINUX_FUNCTIONFS_H__
#define __LINUX_FUNCTIONFS_H__ 1
#include <linux/types.h>
#include <linux/ioctl.h>
#include <linux/usb/ch9.h>
enum {
FUNCTIONFS_DESCRIPTORS_MAGIC = 1,
FUNCTIONFS_STRINGS_MAGIC = 2
};
#ifndef __KERNEL__
/* Descriptor of an non-audio endpoint */
struct usb_endpoint_descriptor_no_audio {
__u8 bLength;
__u8 bDescriptorType;
__u8 bEndpointAddress;
__u8 bmAttributes;
__le16 wMaxPacketSize;
__u8 bInterval;
} __attribute__((packed));
/*
* All numbers must be in little endian order.
*/
struct usb_functionfs_descs_head {
__le32 magic;
__le32 length;
__le32 fs_count;
__le32 hs_count;
} __attribute__((packed));
/*
* Descriptors format:
*
* | off | name | type | description |
* |-----+-----------+--------------+--------------------------------------|
* | 0 | magic | LE32 | FUNCTIONFS_{FS,HS}_DESCRIPTORS_MAGIC |
* | 4 | length | LE32 | length of the whole data chunk |
* | 8 | fs_count | LE32 | number of full-speed descriptors |
* | 12 | hs_count | LE32 | number of high-speed descriptors |
* | 16 | fs_descrs | Descriptor[] | list of full-speed descriptors |
* | | hs_descrs | Descriptor[] | list of high-speed descriptors |
*
* descs are just valid USB descriptors and have the following format:
*
* | off | name | type | description |
* |-----+-----------------+------+--------------------------|
* | 0 | bLength | U8 | length of the descriptor |
* | 1 | bDescriptorType | U8 | descriptor type |
* | 2 | payload | | descriptor's payload |
*/
struct usb_functionfs_strings_head {
__le32 magic;
__le32 length;
__le32 str_count;
__le32 lang_count;
} __attribute__((packed));
/*
* Strings format:
*
* | off | name | type | description |
* |-----+------------+-----------------------+----------------------------|
* | 0 | magic | LE32 | FUNCTIONFS_STRINGS_MAGIC |
* | 4 | length | LE32 | length of the data chunk |
* | 8 | str_count | LE32 | number of strings |
* | 12 | lang_count | LE32 | number of languages |
* | 16 | stringtab | StringTab[lang_count] | table of strings per lang |
*
* For each language there is one stringtab entry (ie. there are lang_count
* stringtab entires). Each StringTab has following format:
*
* | off | name | type | description |
* |-----+---------+-------------------+------------------------------------|
* | 0 | lang | LE16 | language code |
* | 2 | strings | String[str_count] | array of strings in given language |
*
* For each string there is one strings entry (ie. there are str_count
* string entries). Each String is a NUL terminated string encoded in
* UTF-8.
*/
#endif
/*
* Events are delivered on the ep0 file descriptor, when the user mode driver
* reads from this file descriptor after writing the descriptors. Don't
* stop polling this descriptor.
*/
enum usb_functionfs_event_type {
FUNCTIONFS_BIND,
FUNCTIONFS_UNBIND,
FUNCTIONFS_ENABLE,
FUNCTIONFS_DISABLE,
FUNCTIONFS_SETUP,
FUNCTIONFS_SUSPEND,
FUNCTIONFS_RESUME
};
/* NOTE: this structure must stay the same size and layout on
* both 32-bit and 64-bit kernels.
*/
struct usb_functionfs_event {
union {
/* SETUP: packet; DATA phase i/o precedes next event
*(setup.bmRequestType & USB_DIR_IN) flags direction */
struct usb_ctrlrequest setup;
} __attribute__((packed)) u;
/* enum usb_functionfs_event_type */
__u8 type;
__u8 _pad[3];
} __attribute__((packed));
/* Endpoint ioctls */
/* The same as in gadgetfs */
/* IN transfers may be reported to the gadget driver as complete
* when the fifo is loaded, before the host reads the data;
* OUT transfers may be reported to the host's "client" driver as
* complete when they're sitting in the FIFO unread.
* THIS returns how many bytes are "unclaimed" in the endpoint fifo
* (needed for precise fault handling, when the hardware allows it)
*/
#define FUNCTIONFS_FIFO_STATUS _IO('g', 1)
/* discards any unclaimed data in the fifo. */
#define FUNCTIONFS_FIFO_FLUSH _IO('g', 2)
/* resets endpoint halt+toggle; used to implement set_interface.
* some hardware (like pxa2xx) can't support this.
*/
#define FUNCTIONFS_CLEAR_HALT _IO('g', 3)
/* Specific for functionfs */
/*
* Returns reverse mapping of an interface. Called on EP0. If there
* is no such interface returns -EDOM. If function is not active
* returns -ENODEV.
*/
#define FUNCTIONFS_INTERFACE_REVMAP _IO('g', 128)
/*
* Returns real bEndpointAddress of an endpoint. If function is not
* active returns -ENODEV.
*/
#define FUNCTIONFS_ENDPOINT_REVMAP _IO('g', 129)
#ifdef __KERNEL__
struct ffs_data;
struct usb_composite_dev;
struct usb_configuration;
static int functionfs_init(void) __attribute__((warn_unused_result));
static void functionfs_cleanup(void);
static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev)
__attribute__((warn_unused_result, nonnull));
static void functionfs_unbind(struct ffs_data *ffs)
__attribute__((nonnull));
static int functionfs_bind_config(struct usb_composite_dev *cdev,
struct usb_configuration *c,
struct ffs_data *ffs)
__attribute__((warn_unused_result, nonnull));
static int functionfs_ready_callback(struct ffs_data *ffs)
__attribute__((warn_unused_result, nonnull));
static void functionfs_closed_callback(struct ffs_data *ffs)
__attribute__((nonnull));
static void *functionfs_acquire_dev_callback(const char *dev_name)
__attribute__((warn_unused_result, nonnull));
static void functionfs_release_dev_callback(struct ffs_data *ffs_data)
__attribute__((nonnull));
#endif
#endif
| {
"content_hash": "424f6bf1fb3529f2d82f60132af00078",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 80,
"avg_line_length": 29.691542288557216,
"alnum_prop": 0.6074061662198391,
"repo_name": "endplay/omniplay",
"id": "a843d085136459974720cc6c9f5149406c6877c6",
"size": "5968",
"binary": false,
"copies": "130",
"ref": "refs/heads/master",
"path": "linux-lts-quantal-3.5.0/include/linux/usb/functionfs.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "ASP",
"bytes": "4528"
},
{
"name": "Assembly",
"bytes": "17491433"
},
{
"name": "Awk",
"bytes": "79791"
},
{
"name": "Batchfile",
"bytes": "903"
},
{
"name": "C",
"bytes": "444772157"
},
{
"name": "C++",
"bytes": "10631343"
},
{
"name": "GDB",
"bytes": "17950"
},
{
"name": "HTML",
"bytes": "47935"
},
{
"name": "Java",
"bytes": "2193"
},
{
"name": "Lex",
"bytes": "44513"
},
{
"name": "M4",
"bytes": "9029"
},
{
"name": "Makefile",
"bytes": "1758605"
},
{
"name": "Objective-C",
"bytes": "5278898"
},
{
"name": "Perl",
"bytes": "649746"
},
{
"name": "Perl 6",
"bytes": "1101"
},
{
"name": "Python",
"bytes": "585875"
},
{
"name": "RPC",
"bytes": "97869"
},
{
"name": "Roff",
"bytes": "2522798"
},
{
"name": "Scilab",
"bytes": "21433"
},
{
"name": "Shell",
"bytes": "426172"
},
{
"name": "TeX",
"bytes": "283872"
},
{
"name": "UnrealScript",
"bytes": "6143"
},
{
"name": "XS",
"bytes": "1240"
},
{
"name": "Yacc",
"bytes": "93190"
},
{
"name": "sed",
"bytes": "9202"
}
],
"symlink_target": ""
} |
package CodeMonkey.genetic;
public interface GeneFactory< G extends Gene > {
public G make( );
}
| {
"content_hash": "a798778dced3ea7bfb6c79b3684ce498",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 48,
"avg_line_length": 14.428571428571429,
"alnum_prop": 0.7227722772277227,
"repo_name": "DweebsUnited/CodeMonkey",
"id": "7e2ed33633eb5e53db0a6b53ad46046b6291570f",
"size": "101",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "java/CodeMonkey/src/CodeMonkey/genetic/GeneFactory.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "718"
},
{
"name": "C++",
"bytes": "2748240"
},
{
"name": "CMake",
"bytes": "11221"
},
{
"name": "CSS",
"bytes": "896"
},
{
"name": "GLSL",
"bytes": "1116"
},
{
"name": "HTML",
"bytes": "887"
},
{
"name": "Java",
"bytes": "132732"
},
{
"name": "Makefile",
"bytes": "23824"
},
{
"name": "Meson",
"bytes": "246"
},
{
"name": "Objective-C",
"bytes": "810"
},
{
"name": "Processing",
"bytes": "205574"
},
{
"name": "Python",
"bytes": "65902"
},
{
"name": "Shell",
"bytes": "6253"
}
],
"symlink_target": ""
} |
package org.elasticsearch.xpack.ql.expression.gen.processor;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.io.stream.Writeable.Reader;
import org.elasticsearch.test.AbstractWireSerializingTestCase;
import org.elasticsearch.xpack.ql.expression.predicate.logical.BinaryLogicProcessorTests;
import org.elasticsearch.xpack.ql.expression.predicate.operator.arithmetic.BinaryArithmeticProcessorTests;
import org.elasticsearch.xpack.ql.expression.predicate.operator.comparison.BinaryComparisonProcessorTests;
import org.elasticsearch.xpack.ql.expression.processor.Processors;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;
public class ChainingProcessorTests extends AbstractWireSerializingTestCase<ChainingProcessor> {
public static ChainingProcessor randomComposeProcessor() {
return new ChainingProcessor(randomProcessor(), randomProcessor());
}
@Override
protected NamedWriteableRegistry getNamedWriteableRegistry() {
return new NamedWriteableRegistry(Processors.getNamedWriteables());
}
@Override
protected ChainingProcessor createTestInstance() {
return randomComposeProcessor();
}
@Override
protected Reader<ChainingProcessor> instanceReader() {
return ChainingProcessor::new;
}
@Override
protected ChainingProcessor mutateInstance(ChainingProcessor instance) throws IOException {
@SuppressWarnings("unchecked")
Supplier<ChainingProcessor> supplier = randomFrom(
() -> new ChainingProcessor(
instance.first(), randomValueOtherThan(instance.second(), () -> randomProcessor())),
() -> new ChainingProcessor(
randomValueOtherThan(instance.first(), () -> randomProcessor()), instance.second()));
return supplier.get();
}
public static Processor randomProcessor() {
List<Supplier<Processor>> options = new ArrayList<>();
options.add(ChainingProcessorTests::randomComposeProcessor);
options.add(BinaryLogicProcessorTests::randomProcessor);
options.add(BinaryArithmeticProcessorTests::randomProcessor);
options.add(BinaryComparisonProcessorTests::randomProcessor);
return randomFrom(options).get();
}
}
| {
"content_hash": "ee737303f1c805c2bb806b2bc5982487",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 106,
"avg_line_length": 42.089285714285715,
"alnum_prop": 0.7530759439966058,
"repo_name": "robin13/elasticsearch",
"id": "aa4a59d81ea5fd91ece1e22435291deda86e9f12",
"size": "2609",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/expression/gen/processor/ChainingProcessorTests.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "11082"
},
{
"name": "Batchfile",
"bytes": "14049"
},
{
"name": "Emacs Lisp",
"bytes": "3341"
},
{
"name": "FreeMarker",
"bytes": "45"
},
{
"name": "Groovy",
"bytes": "315863"
},
{
"name": "HTML",
"bytes": "3399"
},
{
"name": "Java",
"bytes": "40107206"
},
{
"name": "Perl",
"bytes": "7271"
},
{
"name": "Python",
"bytes": "54437"
},
{
"name": "Shell",
"bytes": "108937"
}
],
"symlink_target": ""
} |
<?php
namespace Tamayo\LaravelScoutElastic\Engines;
use Laravel\Scout\Builder;
use Laravel\Scout\Engines\Engine;
use Elasticsearch\Client as Elastic;
use Illuminate\Database\Eloquent\Collection;
class ElasticsearchEngine extends Engine
{
/**
* Elastic client.
*
* @var Elastic
*/
protected $elastic;
/**
* Create a new engine instance.
*
* @param \Elasticsearch\Client $elastic
* @return void
*/
public function __construct(Elastic $elastic)
{
$this->elastic = $elastic;
}
public function lazyMap(Builder $builder, $results, $model)
{
return Collection::make($results['hits']['hits'])->map(function ($hit) use ($model) {
return $model->newFromBuilder($hit['_source']);
});
}
public function createIndex($name, array $options = [])
{
$params = [
'index' => $name,
];
if (isset($options['shards'])) {
$params['body']['settings']['number_of_shards'] = $options['shards'];
}
if (isset($options['replicas'])) {
$params['body']['settings']['number_of_replicas'] = $options['replicas'];
}
$this->elastic->indices()->create($params);
}
public function deleteIndex($name)
{
$this->elastic->indices()->delete(['index' => $name]);
}
/**
* Update the given model in the index.
*
* @param Collection $models
* @return void
*/
public function update($models)
{
if ($models->isEmpty()) {
return;
}
$params['body'] = [];
$models->each(function ($model) use (&$params) {
$params['body'][] = [
'update' => [
'_id' => $model->getScoutKey(),
'_index' => $model->searchableAs(),
'_type' => get_class($model),
]
];
$params['body'][] = [
'doc' => $model->toSearchableArray(),
'doc_as_upsert' => true
];
});
$this->elastic->bulk($params);
}
/**
* Remove the given model from the index.
*
* @param Collection $models
* @return void
*/
public function delete($models)
{
$params['body'] = [];
$models->each(function ($model) use (&$params) {
$params['body'][] = [
'delete' => [
'_id' => $model->getKey(),
'_index' => $model->searchableAs(),
'_type' => get_class($model),
]
];
});
$this->elastic->bulk($params);
}
/**
* Perform the given search on the engine.
*
* @param Builder $builder
* @return mixed
*/
public function search(Builder $builder)
{
return $this->performSearch($builder, array_filter([
'numericFilters' => $this->filters($builder),
'size' => $builder->limit,
]));
}
/**
* Perform the given search on the engine.
*
* @param Builder $builder
* @param int $perPage
* @param int $page
* @return mixed
*/
public function paginate(Builder $builder, $perPage, $page)
{
$result = $this->performSearch($builder, [
'numericFilters' => $this->filters($builder),
'from' => (($page * $perPage) - $perPage),
'size' => $perPage,
]);
$result['nbPages'] = $result['hits']['total'] / $perPage;
return $result;
}
/**
* Perform the given search on the engine.
*
* @param Builder $builder
* @param array $options
* @return mixed
*/
protected function performSearch(Builder $builder, array $options = [])
{
$params = [
'index' => $builder->model->searchableAs(),
'type' => get_class($builder->model),
'body' => [
'query' => [
'bool' => [
'must' => [['query_string' => ['query' => "*{$builder->query}*"]]]
]
]
]
];
if ($sort = $this->sort($builder)) {
$params['body']['sort'] = $sort;
}
if (isset($options['from'])) {
$params['body']['from'] = $options['from'];
}
if (isset($options['size'])) {
$params['body']['size'] = $options['size'];
}
if (isset($options['numericFilters']) && count($options['numericFilters'])) {
$params['body']['query']['bool']['must'] = array_merge(
$params['body']['query']['bool']['must'],
$options['numericFilters']
);
}
if ($builder->callback) {
return call_user_func(
$builder->callback,
$this->elastic,
$builder->query,
$params
);
}
return $this->elastic->search($params);
}
/**
* Get the filter array for the query.
*
* @param Builder $builder
* @return array
*/
protected function filters(Builder $builder)
{
return collect($builder->wheres)->map(function ($value, $key) {
if (is_array($value)) {
return ['terms' => [$key => $value]];
}
return ['match_phrase' => [$key => $value]];
})->values()->all();
}
/**
* Pluck and return the primary keys of the given results.
*
* @param mixed $results
* @return \Illuminate\Support\Collection
*/
public function mapIds($results)
{
return collect($results['hits']['hits'])->pluck('_id')->values();
}
/**
* Map the given results to instances of the given model.
*
* @param \Laravel\Scout\Builder $builder
* @param mixed $results
* @param \Illuminate\Database\Eloquent\Model $model
* @return Collection
*/
public function map(Builder $builder, $results, $model)
{
if ($results['hits']['total'] === 0) {
return $model->newCollection();
}
$keys = collect($results['hits']['hits'])->pluck('_id')->values()->all();
$modelIdPositions = array_flip($keys);
return $model->getScoutModelsByIds(
$builder,
$keys
)->filter(function ($model) use ($keys) {
return in_array($model->getScoutKey(), $keys);
})->sortBy(function ($model) use ($modelIdPositions) {
return $modelIdPositions[$model->getScoutKey()];
})->values();
}
/**
* Get the total count from a raw result returned by the engine.
*
* @param mixed $results
* @return int
*/
public function getTotalCount($results)
{
return $results['hits']['total'];
}
/**
* Flush all of the model's records from the engine.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @return void
*/
public function flush($model)
{
$model->newQuery()
->orderBy($model->getKeyName())
->unsearchable();
}
/**
* Generates the sort if theres any.
*
* @param Builder $builder
* @return array|null
*/
protected function sort($builder)
{
if (count($builder->orders) == 0) {
return null;
}
return collect($builder->orders)->map(function ($order) {
return [$order['column'] => $order['direction']];
})->toArray();
}
}
| {
"content_hash": "a9f5a7d93e0e9802539a8e92abaefd62",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 93,
"avg_line_length": 25.929054054054053,
"alnum_prop": 0.48351791530944627,
"repo_name": "ErickTamayo/laravel-scout-elastic",
"id": "1603b45ad3e72ece15ee4f3477aabef8d5e9b9d7",
"size": "7675",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Engines/ElasticsearchEngine.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "449573"
}
],
"symlink_target": ""
} |
/*
* SearchInput module
*/
INSERT INTO cuyahoga_moduletype ([name], assemblyname, classname, path, editpath, inserttimestamp, updatetimestamp)
VALUES ('SearchInput', 'Cuyahoga.Modules', 'Cuyahoga.Modules.Search.SearchInputModule', 'Modules/Search/SearchInput.ascx', NULL, '2005-10-20 14:36:28.324', '2005-10-20 14:36:28.324')
go
/*
* Search results settings
*/
DECLARE @moduletypeid int
SELECT @moduletypeid = moduletypeid FROM cuyahoga_moduletype WHERE [name] = 'Search'
INSERT INTO cuyahoga_modulesetting (moduletypeid, [name], friendlyname, settingdatatype, iscustomtype, isrequired)
VALUES (@moduletypeid, 'RESULTS_PER_PAGE', 'Results per page', 'System.Int32', 0, 1)
INSERT INTO cuyahoga_modulesetting (moduletypeid, [name], friendlyname, settingdatatype, iscustomtype, isrequired)
VALUES (@moduletypeid, 'SHOW_INPUT_PANEL', 'Show search input box', 'System.Boolean', 0, 0)
GO
INSERT INTO cuyahoga_sectionsetting (sectionid, name, value)
SELECT sectionid, 'RESULTS_PER_PAGE', '10'
FROM cuyahoga_section s
INNER JOIN cuyahoga_moduletype m on m.moduletypeid = s.moduletypeid
WHERE m.Name = 'Search'
GO
/*
* Version
*/
UPDATE cuyahoga_version SET major = 1, minor = 0, patch = 0 WHERE assembly = 'Cuyahoga.Modules'
go | {
"content_hash": "40ebcf4c3872ab28afb3b8f4aec742c1",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 182,
"avg_line_length": 38.60606060606061,
"alnum_prop": 0.7315541601255887,
"repo_name": "cuyahogaproject/cuyahoga-1",
"id": "7da59bfa7b6437bfd7f367e5aaef014a1d4e15cd",
"size": "1274",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Web/Install/Modules/Database/mssql2000/1.0.0.sql",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "196611"
},
{
"name": "C#",
"bytes": "941492"
},
{
"name": "CSS",
"bytes": "91926"
},
{
"name": "JavaScript",
"bytes": "300125"
},
{
"name": "SQL",
"bytes": "306384"
}
],
"symlink_target": ""
} |
package org.springframework.osgi.service.exporter.support;
import org.springframework.osgi.core.enums.StaticLabeledEnum;
import org.springframework.osgi.util.internal.ClassUtils;
/**
* Enum-like class indicatin class exporters available to
* {@link OsgiServiceFactoryBean} for registering object as OSGi services.
*
* @author Costin Leau
*/
public abstract class AutoExport extends StaticLabeledEnum {
/** Do not export anything */
public static final AutoExport DISABLED = new AutoExport(0, "DISABLED") {
private static final long serialVersionUID = -8297270116184239840L;
private final Class[] clazz = new Class[0];
Class[] getExportedClasses(Class targetClass) {
return clazz;
}
};
/**
* Export all interfaces (and their hierarchy) implemented by the given
* class
*/
public static final AutoExport INTERFACES = new AutoExport(1, "INTERFACES") {
private static final long serialVersionUID = -8336152449611885031L;
public Class[] getExportedClasses(Class targetClass) {
return ClassUtils.getClassHierarchy(targetClass, ClassUtils.INCLUDE_INTERFACES);
}
};
/**
* Export the class hierarchy (all classes inherited by the given target
* excluding Object.class)
*/
public static final AutoExport CLASS_HIERARCHY = new AutoExport(2, "CLASS_HIERARCHY") {
private static final long serialVersionUID = 6464782616822538297L;
public Class[] getExportedClasses(Class targetClass) {
return ClassUtils.getClassHierarchy(targetClass, ClassUtils.INCLUDE_CLASS_HIERARCHY);
}
};
/**
* Export every class, inherited or implemented by the given target. Similar
* to {@link #CLASS_HIERARCHY} + {@link #INTERFACES}
*/
public static final AutoExport ALL_CLASSES = new AutoExport(3, "ALL_CLASSES") {
private static final long serialVersionUID = -6628398711158262852L;
public Class[] getExportedClasses(Class targetClass) {
return ClassUtils.getClassHierarchy(targetClass, ClassUtils.INCLUDE_ALL_CLASSES);
}
};
/**
* Determines the exported classes given a certain target class.
*
* @param targetClass class to be exported into OSGi
* @return array of classes that will be published for the OSGi service.
*/
abstract Class[] getExportedClasses(Class targetClass);
/**
* Constructs a new <code>AutoExport</code> instance.
*
* @param code
* @param label
*/
private AutoExport(int code, String label) {
super(code, label);
}
}
| {
"content_hash": "e4e060d553b06083cad8d127d3d01c10",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 88,
"avg_line_length": 28,
"alnum_prop": 0.7150793650793651,
"repo_name": "BeamFoundry/spring-osgi",
"id": "e2927e0e5bccebb467a90b113c44095f80aca4b5",
"size": "3157",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spring-dm/core/src/main/java/org/springframework/osgi/service/exporter/support/AutoExport.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "27277"
},
{
"name": "Java",
"bytes": "2517744"
},
{
"name": "XSLT",
"bytes": "39288"
}
],
"symlink_target": ""
} |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace RibbonGallery.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
| {
"content_hash": "6f8a777267ff460952fa294336773745",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 151,
"avg_line_length": 41.07692307692308,
"alnum_prop": 0.5823970037453183,
"repo_name": "ComponentFactory/Krypton",
"id": "af4efea91ef5197f4ad39a3b7ad9df5de9d796bc",
"size": "1070",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/Krypton Ribbon Examples/Ribbon Gallery/Properties/Settings.Designer.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C#",
"bytes": "19637203"
}
],
"symlink_target": ""
} |
package org.bisen.chatamari.model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
*
* @author asikprad
*/
@Entity
@Table(name = "user")
public class BlogUser implements Serializable {
@Id
@Column(name = "email")
private String email;
@Column(name = "full_name")
String fullName;
public BlogUser() {
}
public BlogUser(String email, String fullName) {
this.email = email;
this.fullName = fullName;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getFullName() {
return fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public void setFullName(String firstName, String lastName) {
this.fullName = firstName + lastName;
}
}
| {
"content_hash": "81e1eae0f903e6c184f0d777a4a8f9f0",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 64,
"avg_line_length": 19.566037735849058,
"alnum_prop": 0.6104146576663452,
"repo_name": "bisenorg/chatamari",
"id": "283200c07ed05a85dbd82863ae0182915080e574",
"size": "1644",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/bisen/chatamari/model/BlogUser.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "4682"
},
{
"name": "HTML",
"bytes": "48627"
},
{
"name": "Java",
"bytes": "46554"
},
{
"name": "Shell",
"bytes": "1163"
}
],
"symlink_target": ""
} |
/*
* remote-file-test.js: Tests for LocalFile repository.
*
* (C) 2010, Nodejitsu Inc.
*
*/
var assert = require('assert'),
fs = require('fs'),
path = require('path'),
exec = require('child_process').exec,
vows = require('vows'),
helpers = require('../helpers'),
haibu = require('../../lib/haibu');
var app = {
"name": "test",
"user": "marak",
"repository": {
"type": "local",
"directory": path.join(__dirname, '..', 'fixtures', 'repositories', 'local-file'),
},
"scripts": {
"start": "server.js"
}
};
vows.describe('haibu/repositories/local-file').addBatch(helpers.requireInit()).addBatch({
"When using haibu": {
"an instance of the LocalFile repository": {
topic: function () {
return haibu.repository.create(app);
},
"should be a valid repository": function (localFile) {
assert.instanceOf(localFile, haibu.repository.Repository);
assert.isFunction(localFile.init);
assert.isFunction(localFile.fetch);
},
"the fetch() method": {
topic: function (localFile) {
localFile.fetch(this.callback);
},
"should find the local app directory": function (err, localFile) {
try {
assert.isNotNull(fs.statSync(localFile));
}
catch (ex) {
// If this operation fails, fail the test
assert.isNull(ex);
}
}
},
"the init() method": {
topic: function (localFile) {
var self = this;
if (!(localFile instanceof haibu.repository.Repository)) return localFile;
exec('rm -rf ' + path.join(localFile.appDir, '*'), function (err) {
localFile.mkdir(function (err, created) {
if (err) self.callback(err);
localFile.init(self.callback);
});
});
},
"should install to the specified location": function (err, success, files) {
assert.isNull(err);
assert.isArray(files);
}
}
}
}
}).export(module); | {
"content_hash": "ec9e9e9f85e95d72f75ad7d7d96e1f30",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 91,
"avg_line_length": 30,
"alnum_prop": 0.5394366197183098,
"repo_name": "nodejitsu/haibu",
"id": "759cff4eafd706930e05a35eb7217db1f96a767e",
"size": "2130",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "test/repositories/local-file-test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "7235"
},
{
"name": "JavaScript",
"bytes": "152869"
},
{
"name": "Shell",
"bytes": "1308"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "3cde30718dff83edbdb4368152b6a585",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "c6271cb21fe9d088720a563ba022f3070aac2504",
"size": "178",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Serapias/Serapias alberti/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package Stay
* @since Stay 1.0
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
<?php do_action( 'before' ); ?>
<header id="masthead" class="site-header" role="banner">
<hgroup>
<?php
$header_image = get_header_image();
if ( ! empty( $header_image ) ) { ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />
</a>
<?php } ?>
<?php stay_the_site_logo(); ?>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
</hgroup>
<?php get_sidebar( 'header' ); ?>
<?php if ( has_nav_menu( 'secondary' ) ) : ?>
<nav role="navigation" class="site-navigation secondary-navigation">
<?php wp_nav_menu( array( 'theme_location' => 'secondary' ) ); ?>
</nav>
<?php endif; ?>
<nav id="site-navigation" class="navigation-main" role="navigation">
<h1 class="menu-toggle"><?php _e( 'Menu', 'stay' ); ?></h1>
<div class="assistive-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'stay' ); ?>"><?php _e( 'Skip to content', 'stay' ); ?></a></div>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'container_id' => 'primary-nav-container' ) ); ?>
<?php
//Repeat top navigation to be displayed in mobile dropdown
wp_nav_menu( array( 'theme_location' => 'secondary', 'fallback_cb' => false, 'container_id' => 'mobile-top-nav-container' ) );
?>
</nav><!-- #site-navigation -->
<div class="clear"></div>
</header><!-- #masthead -->
<div id="main" class="site-main">
| {
"content_hash": "ab1a17560599d44d97e428ca252b8a09",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 195,
"avg_line_length": 40.546875,
"alnum_prop": 0.5884393063583815,
"repo_name": "keynetic/kpress",
"id": "d0db10d557559a12978b432f5660b3c6e5d4618a",
"size": "2595",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "content/themes/stay-wpcom/header.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2375494"
},
{
"name": "HTML",
"bytes": "12275"
},
{
"name": "JavaScript",
"bytes": "5303340"
},
{
"name": "Modelica",
"bytes": "879"
},
{
"name": "PHP",
"bytes": "20662503"
},
{
"name": "Ruby",
"bytes": "6055"
},
{
"name": "Shell",
"bytes": "185"
},
{
"name": "Smarty",
"bytes": "67"
}
],
"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 Wed Sep 05 03:08:39 MST 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>PropertyConsumer (BOM: * : All 2.2.0.Final API)</title>
<meta name="date" content="2018-09-05">
<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="PropertyConsumer (BOM: * : All 2.2.0.Final API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":18};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default 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/PropertyConsumer.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">Thorntail API, 2.2.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/wildfly/swarm/config/management/Property.html" title="class in org.wildfly.swarm.config.management"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../org/wildfly/swarm/config/management/PropertySupplier.html" title="interface in org.wildfly.swarm.config.management"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/wildfly/swarm/config/management/PropertyConsumer.html" target="_top">Frames</a></li>
<li><a href="PropertyConsumer.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>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.wildfly.swarm.config.management</div>
<h2 title="Interface PropertyConsumer" class="title">Interface PropertyConsumer<T extends <a href="../../../../../org/wildfly/swarm/config/management/Property.html" title="class in org.wildfly.swarm.config.management">Property</a><T>></h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Functional Interface:</dt>
<dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd>
</dl>
<hr>
<br>
<pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true" title="class or interface in java.lang">@FunctionalInterface</a>
public interface <span class="typeNameLabel">PropertyConsumer<T extends <a href="../../../../../org/wildfly/swarm/config/management/Property.html" title="class in org.wildfly.swarm.config.management">Property</a><T>></span></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== 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="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default 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>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/config/management/PropertyConsumer.html#accept-T-">accept</a></span>(<a href="../../../../../org/wildfly/swarm/config/management/PropertyConsumer.html" title="type parameter in PropertyConsumer">T</a> value)</code>
<div class="block">Configure a pre-constructed instance of Property resource</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>default <a href="../../../../../org/wildfly/swarm/config/management/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.management">PropertyConsumer</a><<a href="../../../../../org/wildfly/swarm/config/management/PropertyConsumer.html" title="type parameter in PropertyConsumer">T</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/config/management/PropertyConsumer.html#andThen-org.wildfly.swarm.config.management.PropertyConsumer-">andThen</a></span>(<a href="../../../../../org/wildfly/swarm/config/management/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.management">PropertyConsumer</a><<a href="../../../../../org/wildfly/swarm/config/management/PropertyConsumer.html" title="type parameter in PropertyConsumer">T</a>> after)</code> </td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="accept-org.wildfly.swarm.config.management.Property-">
<!-- -->
</a><a name="accept-T-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>accept</h4>
<pre>void accept(<a href="../../../../../org/wildfly/swarm/config/management/PropertyConsumer.html" title="type parameter in PropertyConsumer">T</a> value)</pre>
<div class="block">Configure a pre-constructed instance of Property resource</div>
</li>
</ul>
<a name="andThen-org.wildfly.swarm.config.management.PropertyConsumer-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>andThen</h4>
<pre>default <a href="../../../../../org/wildfly/swarm/config/management/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.management">PropertyConsumer</a><<a href="../../../../../org/wildfly/swarm/config/management/PropertyConsumer.html" title="type parameter in PropertyConsumer">T</a>> andThen(<a href="../../../../../org/wildfly/swarm/config/management/PropertyConsumer.html" title="interface in org.wildfly.swarm.config.management">PropertyConsumer</a><<a href="../../../../../org/wildfly/swarm/config/management/PropertyConsumer.html" title="type parameter in PropertyConsumer">T</a>> after)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<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/PropertyConsumer.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">Thorntail API, 2.2.0.Final</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/wildfly/swarm/config/management/Property.html" title="class in org.wildfly.swarm.config.management"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../org/wildfly/swarm/config/management/PropertySupplier.html" title="interface in org.wildfly.swarm.config.management"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/wildfly/swarm/config/management/PropertyConsumer.html" target="_top">Frames</a></li>
<li><a href="PropertyConsumer.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>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2018 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "4c9568f8685462922daa936820d612fc",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 648,
"avg_line_length": 45.104838709677416,
"alnum_prop": 0.6537636331128196,
"repo_name": "wildfly-swarm/wildfly-swarm-javadocs",
"id": "d65c93df0cad0c9adca53f67d637509a7c610221",
"size": "11186",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "2.2.0.Final/apidocs/org/wildfly/swarm/config/management/PropertyConsumer.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
#ifndef sitkImageFileWriter_h
#define sitkImageFileWriter_h
#include "sitkMacro.h"
#include "sitkImage.h"
#include "sitkMemberFunctionFactory.h"
#include "sitkIO.h"
#include "sitkProcessObject.h"
#include <memory>
namespace itk {
// Forward declaration for pointer
class ImageIOBase;
template<class T>
class SmartPointer;
namespace simple {
/** \class ImageFileWriter
* \brief Write out a SimpleITK image to the specified file location
*
* This writer tries to write the image out using the image's type to the
* location specified in FileName. If writing fails, an ITK exception is
* thrown.
*
* \sa itk::simple::WriteImage for the procedural interface
*/
class SITKIO_EXPORT ImageFileWriter :
public ProcessObject
{
public:
using Self = ImageFileWriter;
// list of pixel types supported
using PixelIDTypeList = NonLabelPixelIDTypeList;
~ImageFileWriter() override;
ImageFileWriter();
/** Print ourselves to string */
std::string ToString() const override;
/** return user readable name of the filter */
std::string GetName() const override { return std::string("ImageFileWriter"); }
/** \brief Get a vector of the names of registered itk ImageIOs
*/
virtual std::vector<std::string> GetRegisteredImageIOs() const;
/** \brief Enable compression if available for file type.
*
* These methods Set/Get/Toggle the UseCompression flag which
* gets passed to image file's itk::ImageIO object. This is
* only a request as not all file formats support compression.
* @{ */
SITK_RETURN_SELF_TYPE_HEADER SetUseCompression( bool UseCompression );
bool GetUseCompression( ) const;
SITK_RETURN_SELF_TYPE_HEADER UseCompressionOn( ) { return this->SetUseCompression(true); }
SITK_RETURN_SELF_TYPE_HEADER UseCompressionOff( ) { return this->SetUseCompression(false); }
/** @} */
/** \brief A hint for the amount of compression to be applied during writing.
*
* After compression is enabled and if the itk::ImageIO support this option, then this value may be used. The range is
* dependent upon the compression algorithm used. It is generally 0-100 for JPEG like lossy compression and 0-9
* for lossless zip or LZW like compression algorithms. Please see the specific itk::ImageIO for details.
* @{ */
SITK_RETURN_SELF_TYPE_HEADER SetCompressionLevel(int);
int GetCompressionLevel() const;
/** @} */
/** \brief A compression algorithm hint
*
* The default is an empty string which enables the default compression of the ImageIO if compression is enabled.
* If the string identifier is not known a warning is produced and the default compressor is used. Please see the
* itk::ImageIO for details.
* @{ */
SITK_RETURN_SELF_TYPE_HEADER SetCompressor(const std::string &);
std::string GetCompressor();
/** @} */
/** \brief Set/Get name of ImageIO to use
*
* An option to override the automatically detected ImageIO used
* to write the image. The available ImageIOs are listed by the
* GetRegisteredImageIOs method. If the ImageIO can not be
* constructed an exception will be generated.
*
* The default value is an empty string (""). This indicates
* that the ImageIO will be automatically determined by the ITK
* ImageIO factory mechanism.
* @{
*/
virtual SITK_RETURN_SELF_TYPE_HEADER SetImageIO(const std::string &imageio);
virtual std::string GetImageIO( ) const;
/* @} */
/** \brief Use the original study/series/frame of reference.
*
* These methods Set/Get/Toggle the KeepOriginalImageUID flag which
* gets passed to image file's itk::ImageIO object. This is
* relevant only for the DICOM file format, configuring the writer
* to use the information in the image's meta-data dictionary or
* to create new study/series/frame of reference values.
* @{ */
SITK_RETURN_SELF_TYPE_HEADER SetKeepOriginalImageUID( bool KeepOriginalImageUID );
bool GetKeepOriginalImageUID( ) const;
SITK_RETURN_SELF_TYPE_HEADER KeepOriginalImageUIDOn( ) { return this->SetKeepOriginalImageUID(true); }
SITK_RETURN_SELF_TYPE_HEADER KeepOriginalImageUIDOff( ) { return this->SetKeepOriginalImageUID(false); }
/** @} */
SITK_RETURN_SELF_TYPE_HEADER SetFileName ( const std::string &fileName );
std::string GetFileName() const;
SITK_RETURN_SELF_TYPE_HEADER Execute ( const Image& );
SITK_RETURN_SELF_TYPE_HEADER Execute ( const Image& , const std::string &inFileName, bool useCompression, int compressionLevel );
private:
itk::SmartPointer<ImageIOBase> GetImageIOBase(const std::string &fileName);
template <class T> Self& ExecuteInternal ( const Image& );
bool m_UseCompression;
int m_CompressionLevel;
std::string m_Compressor;
std::string m_FileName;
bool m_KeepOriginalImageUID;
std::string m_ImageIOName;
// function pointer type
typedef Self& (Self::*MemberFunctionType)( const Image& );
// friend to get access to executeInternal member
friend struct detail::MemberFunctionAddressor<MemberFunctionType>;
std::unique_ptr<detail::MemberFunctionFactory<MemberFunctionType> > m_MemberFactory;
};
/**
* \brief WriteImage is a procedural interface to the ImageFileWriter.
* class which is convenient for many image writing tasks.
*
* \param image the input image to be written
* \param fileName the filename of an Image e.g. "cthead.mha"
* \param useCompression request to compress the written file
* \param compressionLevel a hint for the amount of compression to
* be applied during writing
*
* \sa itk::simple::ImageFileWriter for writing a single file.
*/
SITKIO_EXPORT void WriteImage (const Image& image,
const std::string &fileName,
bool useCompression=false,
int compressionLevel=-1);
}
}
#endif
| {
"content_hash": "99ab2c3163e11a091b406a24b8669247",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 135,
"avg_line_length": 36.83625730994152,
"alnum_prop": 0.6675662803619622,
"repo_name": "richardbeare/SimpleITK",
"id": "3f77cde5f4f2fe5564afa6f60adc55d0fbfb6de0",
"size": "7039",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "Code/IO/include/sitkImageFileWriter.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "32664"
},
{
"name": "C#",
"bytes": "5324"
},
{
"name": "C++",
"bytes": "1933234"
},
{
"name": "CMake",
"bytes": "265951"
},
{
"name": "CSS",
"bytes": "31103"
},
{
"name": "Dockerfile",
"bytes": "1074"
},
{
"name": "HTML",
"bytes": "3744"
},
{
"name": "Java",
"bytes": "7242"
},
{
"name": "Lua",
"bytes": "25805"
},
{
"name": "Makefile",
"bytes": "145"
},
{
"name": "Python",
"bytes": "199006"
},
{
"name": "R",
"bytes": "54684"
},
{
"name": "SWIG",
"bytes": "2602002"
},
{
"name": "Shell",
"bytes": "109644"
},
{
"name": "Tcl",
"bytes": "3501"
}
],
"symlink_target": ""
} |
import _plotly_utils.basevalidators
class Q1SrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="q1src", parent_name="box", **kwargs):
super(Q1SrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.pop("edit_type", "none"),
**kwargs,
)
| {
"content_hash": "2bbcdabe25c28be8b1fd3f6446c42874",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 73,
"avg_line_length": 34.90909090909091,
"alnum_prop": 0.609375,
"repo_name": "plotly/plotly.py",
"id": "7b097f7f6640fea0c2ebaf412f777699ddb7f8f6",
"size": "384",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/python/plotly/plotly/validators/box/_q1src.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "545"
},
{
"name": "JavaScript",
"bytes": "2074"
},
{
"name": "PostScript",
"bytes": "565328"
},
{
"name": "Python",
"bytes": "31506317"
},
{
"name": "TypeScript",
"bytes": "71337"
}
],
"symlink_target": ""
} |
'''
Cleans up old searches and rebuilds search fields cache
'''
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from datetime import datetime, timedelta, date
import django.utils.timezone
from server.models import *
from search.models import *
from inventory.models import *
import server.utils as utils
import datetime
import server.utils
class Command(BaseCommand):
help = 'Cleans up old searches and rebuilds search fields cache'
def handle(self, *args, **options):
old_searches = SavedSearch.objects.filter(created__lt=datetime.datetime.today()-datetime.timedelta(days=30), save_search=False)
old_searches.delete()
search_fields = []
skip_fields = [
'id',
'machine_group',
'report',
'activity',
'errors',
'warnings',
'install_log',
'puppet_errors',
'install_log_hash'
]
inventory_fields = [
'Name',
'Bundle ID',
'Bundle Name',
'Path'
]
facts = Fact.objects.values('fact_name').distinct()
conditions = Condition.objects.values('condition_name').distinct()
plugin_sript_rows = PluginScriptRow.objects.values('pluginscript_name', 'submission__plugin').distinct()
app_versions = Application.objects.values('name', 'bundleid').distinct()
old_cache = SearchFieldCache.objects.all()
old_cache.delete()
for f in Machine._meta.fields:
if f.name not in skip_fields:
cached_item = SearchFieldCache(search_model='Machine', search_field=f.name)
search_fields.append(cached_item)
if server.utils.is_postgres() == False:
cached_item.save()
for fact in facts:
cached_item = SearchFieldCache(search_model='Facter', search_field=fact['fact_name'])
search_fields.append(cached_item)
if server.utils.is_postgres() == False:
cached_item.save()
for condition in conditions:
cached_item = SearchFieldCache(search_model='Condition', search_field=condition['condition_name'])
search_fields.append(cached_item)
if server.utils.is_postgres() == False:
cached_item.save()
for row in plugin_sript_rows:
string = '%s=>%s' %(row['submission__plugin'], row['pluginscript_name'])
cached_item = SearchFieldCache(search_model='External Script', search_field=string)
search_fields.append(cached_item)
if server.utils.is_postgres() == False:
cached_item.save()
for inventory_field in inventory_fields:
cached_item = SearchFieldCache(search_model='Application Inventory', search_field=inventory_field)
search_fields.append(cached_item)
if server.utils.is_postgres() == False:
cached_item.save()
for app in app_versions:
string = '%s=>%s' %(app['name'], app['bundleid'])
cached_item = SearchFieldCache(search_model='Application Version', search_field=string)
search_fields.append(cached_item)
if server.utils.is_postgres() == False:
cached_item.save()
if server.utils.is_postgres() == True:
SearchFieldCache.objects.bulk_create(search_fields)
# make sure this in an int:
try:
int(settings.INACTIVE_UNDEPLOYED)
if settings.INACTIVE_UNDEPLOYED > 0:
now = django.utils.timezone.now()
inactive_days = now - timedelta(days=settings.INACTIVE_UNDEPLOYED)
machines_to_inactive = Machines.deployed_objects.all().filter(last_checkin__gte=inactive_days).update(deployed=False)
except:
pass
| {
"content_hash": "43b73ce46201aacb5b4be81906623103",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 135,
"avg_line_length": 38.42156862745098,
"alnum_prop": 0.6047461087011993,
"repo_name": "erikng/sal",
"id": "588a3ef56ddb479fd3f448c3bcdd3a8bff07e157",
"size": "3919",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "search/management/commands/search_maintenance.py",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "254975"
},
{
"name": "HTML",
"bytes": "248381"
},
{
"name": "JavaScript",
"bytes": "1148377"
},
{
"name": "Makefile",
"bytes": "2208"
},
{
"name": "Nginx",
"bytes": "1946"
},
{
"name": "Python",
"bytes": "757954"
},
{
"name": "Shell",
"bytes": "5922"
}
],
"symlink_target": ""
} |
+++
title = "Frequently Asked Question"
aliases = ["/faq"]
+++
## My writes are getting stuck. Why?
**Update: With the new `Value(func(v []byte))` API, this deadlock can no longer
happen.**
The following is true for users on Badger v1.x.
This can happen if a long running iteration with `Prefetch` is set to false, but
a `Item::Value` call is made internally in the loop. That causes Badger to
acquire read locks over the value log files to avoid value log GC removing the
file from underneath. As a side effect, this also blocks a new value log GC
file from being created, when the value log file boundary is hit.
Please see Github issues [#293](https://github.com/dgraph-io/badger/issues/293)
and [#315](https://github.com/dgraph-io/badger/issues/315).
There are multiple workarounds during iteration:
1. Use `Item::ValueCopy` instead of `Item::Value` when retrieving value.
1. Set `Prefetch` to true. Badger would then copy over the value and release the
file lock immediately.
1. When `Prefetch` is false, don't call `Item::Value` and do a pure key-only
iteration. This might be useful if you just want to delete a lot of keys.
1. Do the writes in a separate transaction after the reads.
## My writes are really slow. Why?
Are you creating a new transaction for every single key update, and waiting for
it to `Commit` fully before creating a new one? This will lead to very low
throughput.
We have created `WriteBatch` API which provides a way to batch up
many updates into a single transaction and `Commit` that transaction using
callbacks to avoid blocking. This amortizes the cost of a transaction really
well, and provides the most efficient way to do bulk writes.
```go
wb := db.NewWriteBatch()
defer wb.Cancel()
for i := 0; i < N; i++ {
err := wb.Set(key(i), value(i), 0) // Will create txns as needed.
handle(err)
}
handle(wb.Flush()) // Wait for all txns to finish.
```
Note that `WriteBatch` API does not allow any reads. For read-modify-write
workloads, you should be using the `Transaction` API.
## I don't see any disk writes. Why?
If you're using Badger with `SyncWrites=false`, then your writes might not be written to value log
and won't get synced to disk immediately. Writes to LSM tree are done inmemory first, before they
get compacted to disk. The compaction would only happen once `MaxTableSize` has been reached. So, if
you're doing a few writes and then checking, you might not see anything on disk. Once you `Close`
the database, you'll see these writes on disk.
## Reverse iteration doesn't give me the right results.
Just like forward iteration goes to the first key which is equal or greater than the SEEK key, reverse iteration goes to the first key which is equal or lesser than the SEEK key. Therefore, SEEK key would not be part of the results. You can typically add a `0xff` byte as a suffix to the SEEK key to include it in the results. See the following issues: [#436](https://github.com/dgraph-io/badger/issues/436) and [#347](https://github.com/dgraph-io/badger/issues/347).
## Which instances should I use for Badger?
We recommend using instances which provide local SSD storage, without any limit
on the maximum IOPS. In AWS, these are storage optimized instances like i3. They
provide local SSDs which clock 100K IOPS over 4KB blocks easily.
## I'm getting a closed channel error. Why?
```
panic: close of closed channel
panic: send on closed channel
```
If you're seeing panics like above, this would be because you're operating on a closed DB. This can happen, if you call `Close()` before sending a write, or multiple times. You should ensure that you only call `Close()` once, and all your read/write operations finish before closing.
## Are there any Go specific settings that I should use?
We *highly* recommend setting a high number for `GOMAXPROCS`, which allows Go to
observe the full IOPS throughput provided by modern SSDs. In Dgraph, we have set
it to 128. For more details, [see this
thread](https://groups.google.com/d/topic/golang-nuts/jPb_h3TvlKE/discussion).
## Are there any Linux specific settings that I should use?
We recommend setting `max file descriptors` to a high number depending upon the expected size of
your data. On Linux and Mac, you can check the file descriptor limit with `ulimit -n -H` for the
hard limit and `ulimit -n -S` for the soft limit. A soft limit of `65535` is a good lower bound.
You can adjust the limit as needed.
## I see "manifest has unsupported version: X (we support Y)" error.
This error means you have a badger directory which was created by an older version of badger and
you're trying to open in a newer version of badger. The underlying data format can change across
badger versions and users will have to migrate their data directory.
Badger data can be migrated from version X of badger to version Y of badger by following the steps
listed below.
Assume you were on badger v1.6.0 and you wish to migrate to v2.0.0 version.
1. Install badger version v1.6.0
- `cd $GOPATH/src/github.com/dgraph-io/badger`
- `git checkout v1.6.0`
- `cd badger && go install`
This should install the old badger binary in your $GOBIN.
2. Create Backup
- `badger backup --dir path/to/badger/directory -f badger.backup`
3. Install badger version v2.0.0
- `cd $GOPATH/src/github.com/dgraph-io/badger`
- `git checkout v2.0.0`
- `cd badger && go install`
This should install new badger binary in your $GOBIN
4. Restore data from backup
- `badger restore --dir path/to/new/badger/directory -f badger.backup`
This will create a new directory on `path/to/new/badger/directory` and add badger data in
newer format to it.
NOTE - The above steps shouldn't cause any data loss but please ensure the new data is valid before
deleting the old badger directory.
## Why do I need gcc to build badger? Does badger need CGO?
Badger does not directly use CGO but it relies on https://github.com/DataDog/zstd library for
zstd compression and the library requires `gcc/cgo`. You can build badger without cgo by running
`CGO_ENABLED=0 go build`. This will build badger without the support for ZSTD compression algorithm.
As of Badger versions [v2.2007.4](https://github.com/dgraph-io/badger/releases/tag/v2.2007.4) and
[v3.2103.1](https://github.com/dgraph-io/badger/releases/tag/v3.2103.1) the DataDog ZSTD library
was replaced by pure Golang version and CGO is no longer required. The new library is
[backwards compatible in nearly all cases](https://discuss.dgraph.io/t/use-pure-go-zstd-implementation/8670/10):
> Yes they are compatible both ways. The only exception is 0 bytes of input which will give
> 0 bytes output with the Go zstd. But you already have the zstd.WithZeroFrames(true) which
> will wrap 0 bytes in a header so it can be fed to DD zstd. This will of course only be relevant
> when downgrading.
| {
"content_hash": "cd9f34965168f381aa6eccd304db3a18",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 467,
"avg_line_length": 48.49295774647887,
"alnum_prop": 0.7519604995643334,
"repo_name": "dgraph-io/badger",
"id": "ed2e06bfb0a3d9798384be92405effaaf58083a3",
"size": "6886",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "docs/content/faq/index.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "1005704"
},
{
"name": "Makefile",
"bytes": "2628"
},
{
"name": "Shell",
"bytes": "5820"
}
],
"symlink_target": ""
} |
using System;
namespace WilliamsonFamily.Models.User
{
public interface IUserRepository : IModelLoader<IUser, string>, IModelFactory<IUser>, IModelPersister<IUser>
{
}
} | {
"content_hash": "1d2799b90bca8a7a49b127738b937569",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 112,
"avg_line_length": 23.75,
"alnum_prop": 0.7210526315789474,
"repo_name": "sgwill/familyblog",
"id": "11282b4aaf6dc889cbd69635b66c904ca5a91325",
"size": "192",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Libraries/WilliamsonFamily.Models/User/IUserRepository.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "223"
},
{
"name": "Batchfile",
"bytes": "636"
},
{
"name": "C#",
"bytes": "475178"
},
{
"name": "CSS",
"bytes": "30099"
},
{
"name": "CoffeeScript",
"bytes": "1789"
},
{
"name": "HTML",
"bytes": "34068"
},
{
"name": "JavaScript",
"bytes": "182568"
},
{
"name": "PowerShell",
"bytes": "3573"
}
],
"symlink_target": ""
} |
Note: As of 2022, **Greenworks has no active maintainer and is no longer in active development**. While **many games continue to use greenworks successfully in production**, depending on your needs, you might want to consider alternatives:
* https://github.com/Spacetech/greenworks - A greenworks fork which seems to have better workshop support and is context-aware but does not seem to have automated builds.
* https://github.com/ceifa/steamworks.js - A greenworks alternative built on Rust, it's unclear what the feature set is.
* https://github.com/greenworksjs/greenworks - A community attempt at reviving greenworks - did not go past the planning stages yet.
Feel free to add a PR for other alternatives. Again, [many projects](https://github.com/greenheartgames/greenworks/wiki/Apps-games-using-greenworks) use greenworks successfully, so this might still be your best choice.
---
# Greenworks
* Greenworks is a [node.js addon](https://nodejs.org/api/addons.html) that
allows you to integrate your HTML5 game (or app) with
[Steamworks](https://partner.steamgames.com/) by exposing a number of
Steamworks APIs to JavaScript.
* Greenworks was originally developed by
[Greenheart Games](http://www.greenheartgames.com) to enable Steam integration
in [Game Dev Tycoon](http://www.greenheartgames.com/app/game-dev-tycoon/).
Since then, it has been open-sourced and is
[used in many other projects](https://github.com/greenheartgames/greenworks/wiki/Apps-games-using-greenworks).
* Currently Greenworks supports:
* node v0.8, v0.10, v0.12, v4, v5, v6, v7, v8, v9 and v10
* NW.js v0.8, v0.11+
* Electron v1.0.0+
* Steam SDK v1.42
* Greenworks is built using [Native Abstractions for Node.js](https://github.com/nodejs/nan) to
support different node versions.
* The project is currently funded by Greenheart Games and other
donors.
## Download
Prebuilt binaries of Greenworks for NW.js & Electron can be found on
the [releases](https://github.com/greenheartgames/greenworks/releases) page.
You can also download [daily automated builds](https://greenworks-prebuilds.armaldio.xyz/) for a variety of platforms (electron, nw.js, node) and systems (Windows, Mac Linux - 32/64 bit). This is site is graciously provided by [@armaldio](https://github.com/armaldio).
## Documentation
Guides and the API references are located in [docs](docs) directory.
## License
Greenworks is published under the MIT license. See the [license file](https://github.com/greenheartgames/greenworks/blob/master/LICENSE) for details.
## Twitter
If you use Greenworks, please let us know at
[@GreenheartGames](https://twitter.com/GreenheartGames)
and feel free to add your product to our
[product list](https://github.com/greenheartgames/greenworks/wiki/Apps-games-using-greenworks).
| {
"content_hash": "7abe8c0d7953b7f62b418e61afdecf6d",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 268,
"avg_line_length": 53.40384615384615,
"alnum_prop": 0.772416276557436,
"repo_name": "greenheartgames/greenworks",
"id": "a7ce015a7eba8354fe6616b397ec7a74eda8b7cc",
"size": "2777",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "readme.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "761"
},
{
"name": "C++",
"bytes": "194615"
},
{
"name": "JavaScript",
"bytes": "11461"
},
{
"name": "Python",
"bytes": "18815"
},
{
"name": "Shell",
"bytes": "51"
}
],
"symlink_target": ""
} |
<html>
<!-- Mirrored from www.math.iisc.ernet.in/seminars2009/jan02.htm by HTTrack Website Copier/3.x [XR&CO'2013], Mon, 15 Feb 2016 03:54:53 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=UTF-8" /><!-- /Added by HTTrack -->
<head><title>Seminar</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script language="JavaScript">
<!--
function SymError()
{
return true;
}
window.onerror = SymError;
var SymRealWinOpen = window.open;
function SymWinOpen(url, name, attributes)
{
return (new Object());
}
window.open = SymWinOpen;
//-->
</script>
<script charset="utf-8" id="injection_graph_func" src="dec17_files/injection_graph_func.html"></script></head><body bgcolor="#ffffff">
<p style="margin-top: -2px; margin-bottom: -2px;" align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>
<font color="#008000">Department of Mathematics</font></b></font></p>
<p style="margin-top: -2px; margin-bottom: -2px;" align="center"><b>
<font color="#008000" face="Verdana, Arial, Helvetica, sans-serif" size="2">
Indian Institute of Science</font></b></p>
<p style="margin-top: -2px; margin-bottom: -2px;" align="center"><b>
<font color="#008000" face="Verdana, Arial, Helvetica, sans-serif" size="2">
Bangalore 560 012</font></b></p>
<p style="margin-top: -2px; margin-bottom: -2px;" align="center"> </p>
<p style="margin-top: -2px; margin-bottom: -2px;" align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>
<font color="#ff00ff">SEMINAR</font></b></font></p>
<p> </p>
<table style="border-collapse: collapse;" id="AutoNumber1" border="0" bordercolor="#111111" cellspacing="1" height="201" width="100%">
<tbody><tr>
<td align="left" height="35" valign="top" width="16%">
<p style="margin-top: -2px; margin-bottom: -2px;"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>
Speaker</b> </font>
</p></td>
<td align="left" height="35" valign="top" width="2%">
<p style="margin-top: -2px; margin-bottom: -2px;">
<font face="Verdana" size="2"><b>
:</b> </font>
</p></td>
<td align="left" height="35" width="100%">
<pre><font face="Verdana">Dr. Gautam Iyer</font></pre>
</td>
</tr>
<tr>
<td align="left" height="35" valign="top" width="16%">
<b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Affiliation</font></b></td>
<td align="left" height="35" valign="top" width="2%">
<b><font face="Verdana" size="2">:</font></b></td>
<td align="left" height="35" valign="top" width="100%">
<font face="Verdana" size="2">Stanford University</font></td>
</tr>
<tr>
<td align="left" height="31" valign="top" width="16%">
<p style="margin-top: -2px; margin-bottom: -2px;"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>
Subject Area</b></font></p></td>
<td align="left" height="31" valign="top" width="2%">
<p style="margin-top: -2px; margin-bottom: -2px;">
<font face="Verdana" size="2"><b>
:</b> </font>
</p></td>
<td align="left" height="31" width="100%">
<p style="margin-top: -2px; margin-bottom: -2px;">
<font face="Verdana" size="2">Mathematics</font></p>
<p style="margin-top: -2px; margin-bottom: -2px;"> </p></td>
</tr>
<tr>
<td align="left" height="31" valign="top" width="16%">
<p style="margin-top: -2px; margin-bottom: -2px;"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>
Venue</b></font></p></td>
<td align="left" height="31" valign="top" width="2%">
<p style="margin-top: -2px; margin-bottom: -2px;">
<font face="Verdana" size="2"><b>
:</b> </font>
</p></td>
<td align="left" height="31" width="100%">
<p style="margin-top: -2px; margin-bottom: -2px;">
<font face="Verdana" size="2">Lecture Hall - I, Dept of Mathematics</font></p>
<p style="margin-top: -2px; margin-bottom: -2px;"> </p></td>
</tr>
<tr>
<td align="left" height="31" valign="top" width="16%">
<p style="margin-top: -2px; margin-bottom: -2px;"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>
Time</b> </font>
</p></td>
<td align="left" height="31" valign="top" width="2%">
<p style="margin-top: -2px; margin-bottom: -2px;">
<font face="Verdana" size="2"><b>
:</b> </font>
</p></td>
<td align="left" height="31" width="100%">
<p style="margin-top: -2px; margin-bottom: -2px;">
<font face="Verdana" size="2">2.30 pm</font></p>
<p style="margin-top: -2px; margin-bottom: -2px;"> </p></td>
</tr>
<tr>
<td align="left" height="35" valign="top" width="16%">
<p style="margin-top: -2px; margin-bottom: -2px;"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>
Date</b> </font></p></td>
<td align="left" height="35" valign="top" width="2%">
<p style="margin-top: -2px; margin-bottom: -2px;">
<font face="Verdana" size="2"><b>
:</b> </font>
</p></td>
<td align="left" height="35" width="100%">
<pre><font face="Verdana">Jan 2,2009 (Friday)</font></pre>
</td>
</tr>
<tr>
<td align="left" height="1" valign="top" width="16%">
<p style="margin-top: -2px; margin-bottom: -2px;"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>
Title</b></font></p></td>
<td align="left" height="1" valign="top" width="2%">
<p style="margin-top: -2px; margin-bottom: -2px;">
<font face="Verdana" size="2"><b>
:</b> </font>
</p></td>
<td align="left" height="1" width="100%">
<pre><font face="Verdana">Stochastic Lagrangian Particle systems for the Navier-Stokes and Burgers equations</font></pre>
</td>
</tr>
<tr>
<td align="left" height="9" valign="top" width="16%">
<b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Abstract</font></b></td>
<td align="left" height="9" valign="top" width="2%">
<b><font face="Verdana" size="2">:</font></b></td>
<td align="left" height="9" width="100%">
<p align="justify"><font face="Verdana" size="2">I will introduce an exact
stochastic representation for certain non-linear transport equations (e.g.
3D-Navier-Stokes, Burgers) based on noisy Lagrangian paths, and use this
to construct a (stochastic) particle system for the Navier-Stokes
equations. On any fixed time interval, this particle system converges to
the Navier-Stokes equations as the number of particles goes to infinity.<br>
<br>
Curiously, a similar system for the (viscous) Burgers equations shocks
almost surely in finite time. This happens because these particle systems
exhibit a curious energy dissipation on long time intervals. I will describe
a resetting procedure by which these shocks can (surprisingly!) be avoided,
and thus obtain convergence<br>
to the viscous Burgers equations on long time intervals</font></p>
<p align="justify"> </p></td>
</tr>
</tbody></table>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script>
<script language="JavaScript">
<!--
var SymRealOnLoad;
var SymRealOnUnload;
function SymOnUnload()
{
window.open = SymWinOpen;
if(SymRealOnUnload != null)
SymRealOnUnload();
}
function SymOnLoad()
{
if(SymRealOnLoad != null)
SymRealOnLoad();
window.open = SymRealWinOpen;
SymRealOnUnload = window.onunload;
window.onunload = SymOnUnload;
}
SymRealOnLoad = window.onload;
window.onload = SymOnLoad;
//-->
</script></body>
<!-- Mirrored from www.math.iisc.ernet.in/seminars2009/jan02.htm by HTTrack Website Copier/3.x [XR&CO'2013], Mon, 15 Feb 2016 03:54:53 GMT -->
</html>
| {
"content_hash": "7dcfc8569796b83f2aeccb1665913f43",
"timestamp": "",
"source": "github",
"line_count": 915,
"max_line_length": 142,
"avg_line_length": 19.45464480874317,
"alnum_prop": 0.665580585360373,
"repo_name": "siddhartha-gadgil/www.math.iisc.ernet.in",
"id": "232fc85b36208af6bccc76fca795a0b890e66fad",
"size": "17801",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "seminars2009/jan02.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "16646"
},
{
"name": "HTML",
"bytes": "7363807"
},
{
"name": "JavaScript",
"bytes": "14188"
}
],
"symlink_target": ""
} |
<?php
class TestingAccessWrapperTest extends MediaWikiTestCase {
protected $raw;
protected $wrapped;
function setUp() {
parent::setUp();
require_once __DIR__ . '/../data/helpers/WellProtectedClass.php';
$this->raw = new WellProtectedClass();
$this->wrapped = TestingAccessWrapper::newFromObject( $this->raw );
}
function testGetProperty() {
$this->assertSame( 1, $this->wrapped->property );
$this->assertSame( 42, $this->wrapped->privateProperty );
$this->assertSame( 9000, $this->wrapped->privateParentProperty );
}
function testSetProperty() {
$this->wrapped->property = 10;
$this->assertSame( 10, $this->wrapped->property );
$this->assertSame( 10, $this->raw->getProperty() );
$this->wrapped->privateProperty = 11;
$this->assertSame( 11, $this->wrapped->privateProperty );
$this->assertSame( 11, $this->raw->getPrivateProperty() );
$this->wrapped->privateParentProperty = 12;
$this->assertSame( 12, $this->wrapped->privateParentProperty );
$this->assertSame( 12, $this->raw->getPrivateParentProperty() );
}
function testCallMethod() {
$this->wrapped->incrementPropertyValue();
$this->assertSame( 2, $this->wrapped->property );
$this->assertSame( 2, $this->raw->getProperty() );
$this->wrapped->incrementPrivatePropertyValue();
$this->assertSame( 43, $this->wrapped->privateProperty );
$this->assertSame( 43, $this->raw->getPrivateProperty() );
$this->wrapped->incrementPrivateParentPropertyValue();
$this->assertSame( 9001, $this->wrapped->privateParentProperty );
$this->assertSame( 9001, $this->raw->getPrivateParentProperty() );
}
function testCallMethodTwoArgs() {
$this->assertSame( 'two', $this->wrapped->whatSecondArg( 'one', 'two' ) );
}
}
| {
"content_hash": "6e7299379e95cddd1dbafe44ee77cefa",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 76,
"avg_line_length": 33.19230769230769,
"alnum_prop": 0.6958285052143685,
"repo_name": "owen-kellie-smith/mediawiki",
"id": "fc54afae338176802b00370c7db6151f6359800b",
"size": "1726",
"binary": false,
"copies": "37",
"ref": "refs/heads/master",
"path": "wiki/tests/phpunit/includes/TestingAccessWrapperTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "405"
},
{
"name": "Batchfile",
"bytes": "45"
},
{
"name": "CSS",
"bytes": "522322"
},
{
"name": "Cucumber",
"bytes": "33293"
},
{
"name": "HTML",
"bytes": "26024"
},
{
"name": "JavaScript",
"bytes": "3615192"
},
{
"name": "Lua",
"bytes": "478"
},
{
"name": "Makefile",
"bytes": "8898"
},
{
"name": "PHP",
"bytes": "21628114"
},
{
"name": "PLSQL",
"bytes": "61551"
},
{
"name": "PLpgSQL",
"bytes": "31212"
},
{
"name": "Perl",
"bytes": "27998"
},
{
"name": "Python",
"bytes": "17169"
},
{
"name": "Ruby",
"bytes": "69896"
},
{
"name": "SQLPL",
"bytes": "2159"
},
{
"name": "Shell",
"bytes": "31740"
}
],
"symlink_target": ""
} |
struct PointerSetNode {
Int32 next; // A pointer to the next node in this bucket (relative to the PointerSet's heap).
void *key; // The key for this node.
};
/// <summary>
/// The internal implementation of a PointerSet.
/// </summary>
struct PointerSetInt {
Int32 *buckets; // The buckets contain pointers into the heap, indexed by masked hash code.
struct PointerSetNode *heap; // The heap, which holds all of the keys as Node structs.
Int32 mask; // The current size of both the heap and buckets. Always equal to 2^n - 1 for some n.
Int32 firstFree; // The first free node in the heap (successive free nodes follow the 'next' pointers).
Int32 count; // The number of allocated nodes in the heap.
};
//-------------------------------------------------------------------------------------------------
// Public type declarations
/// <summary>
/// A set of pointers, with constant lookup times.
/// </summary>
typedef struct PointerSetStruct {
struct PointerSetInt _opaque;
} *PointerSet;
/// <summary>
/// A "cloner" function for pointers in a PointerSet, that is, a function that can make a perfect
/// deep copy of a value in the set.
/// </summary>
/// <param name="key">The key that is to be cloned.</param>
/// <param name="param">A custom user-provided parameter that may help with the cloning.</param>
/// <returns>The cloned value.</returns>
typedef void *(*PointerSet_KeyCloner)(void *key, void *param);
//-------------------------------------------------------------------------------------------------
// External parts of the implementation
SMILE_API_FUNC Int32 PointerSetInt_Append(struct PointerSetInt *pointerSet, void *key);
SMILE_API_FUNC void **PointerSet_GetAll(PointerSet pointerSet);
SMILE_API_FUNC void *PointerSet_GetFirst(PointerSet pointerSet);
SMILE_API_FUNC void PointerSet_ClearWithSize(PointerSet pointerSet, Int32 newSize);
SMILE_API_FUNC Bool PointerSet_Remove(PointerSet pointerSet, void *key);
SMILE_API_FUNC PointerSet PointerSet_Clone(PointerSet pointerSet, PointerSet_KeyCloner keyCloner, void *param);
SMILE_API_FUNC DictStats PointerSet_ComputeStats(PointerSet pointerSet);
//-------------------------------------------------------------------------------------------------
// Inline parts of the implementation
/// <summary>
/// Construct a new, empty pointer set, and control its allocation behavior.
/// </summary>
/// <param name="newSize">The initial allocation size of the set, which is the number of
/// items the set can hold without it needing to invoke another reallocation.</param>
/// <returns>The new, empty set.</returns>
Inline PointerSet PointerSet_CreateWithSize(Int32 newSize)
{
PointerSet pointerSet;
pointerSet = (PointerSet)GC_MALLOC_STRUCT(struct PointerSetInt);
if (pointerSet == NULL) Smile_Abort_OutOfMemory();
PointerSet_ClearWithSize(pointerSet, newSize);
return pointerSet;
}
/// <summary>
/// Construct a new, empty set.
/// </summary>
/// <returns>The new, empty set.</returns>
Inline PointerSet PointerSet_Create(void)
{
return PointerSet_CreateWithSize(16);
}
/// <summary>
/// Delete all keys in the set, resetting it back to an initial state.
/// </summary>
Inline void PointerSet_Clear(PointerSet pointerSet)
{
PointerSet_ClearWithSize(pointerSet, 16);
}
/// <summary>
/// Determine if the given key exists in the set.
/// </summary>
/// <param name="pointerSet">A pointer to the set.</param>
/// <param name="key">The key to search for.</param>
/// <returns>True if the key was found, False if the key was not found.</returns>
Inline Bool PointerSet_Contains(PointerSet pointerSet, void *key)
{
SMILE_DICT_SEARCH(struct PointerSetInt, struct PointerSetNode, Int32,
pointerSet, ((Int32)((PtrInt)key >> 3)), node->key == key,
{
return True;
},
{
return False;
})
}
/// <summary>
/// Add a new key to the set. If the key already exists, this will fail.
/// </summary>
/// <param name="pointerSet">A pointer to the set.</param>
/// <param name="key">The key to add.</param>
/// <returns>True if the key was successfully added, False if the key already existed.</returns>
Inline Bool PointerSet_Add(PointerSet pointerSet, void *key)
{
SMILE_DICT_SEARCH(struct PointerSetInt, struct PointerSetNode, Int32,
pointerSet, ((Int32)((PtrInt)key >> 3)), node->key == key,
{
return False;
},
{
PointerSetInt_Append((struct PointerSetInt *)pointerSet, key);
return True;
})
}
/// <summary>
/// Get the number of keys in the set.
/// </summary>
/// <param name="pointerSet">A pointer to the set.</param>
/// <returns>The number of key/value pairs in the set.</returns>
Inline Int32 PointerSet_Count(PointerSet pointerSet)
{
return ((struct PointerSetInt *)pointerSet)->count;
}
#endif | {
"content_hash": "69a9ed68b1d581ebd3e3303926c0ef70",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 111,
"avg_line_length": 35.54135338345865,
"alnum_prop": 0.6756928284324095,
"repo_name": "seanofw/smile",
"id": "c5107c482752a8698569ddc10f22c424549735b3",
"size": "5175",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "smilelib/include/smile/dict/pointerset.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "1C Enterprise",
"bytes": "1573"
},
{
"name": "Assembly",
"bytes": "91"
},
{
"name": "Batchfile",
"bytes": "164"
},
{
"name": "C",
"bytes": "20893940"
},
{
"name": "C#",
"bytes": "64632"
},
{
"name": "C++",
"bytes": "329238"
},
{
"name": "CMake",
"bytes": "1753"
},
{
"name": "Makefile",
"bytes": "51153"
},
{
"name": "Objective-C",
"bytes": "334742"
},
{
"name": "PHP",
"bytes": "4522"
},
{
"name": "Perl",
"bytes": "44277"
},
{
"name": "Shell",
"bytes": "4203"
}
],
"symlink_target": ""
} |
package org.mimosaframework.orm.resolve;
public interface FunctionActionResolve extends ActionResolve {
}
| {
"content_hash": "22baa3967fe74f21d9dadb094c7d387e",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 62,
"avg_line_length": 26.75,
"alnum_prop": 0.8504672897196262,
"repo_name": "yangankang/mimosa",
"id": "8711a9ff245def1023662b082fb502760373a494",
"size": "107",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "mimosa-orm/src/main/java/org/mimosaframework/orm/resolve/FunctionActionResolve.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "2910419"
}
],
"symlink_target": ""
} |
<?php include 'inc/config.php'; ?>
<?php include 'inc/template_start.php'; ?>
<?php include 'inc/page_head.php'; ?>
<!-- Page content -->
<div id="page-content">
<!-- Table Responsive Header -->
<div class="content-header">
<div class="header-section">
<h1>
<i class="gi gi-iphone"></i>Responsive Tables<br><small>Play nice on various screen sizes!</small>
</h1>
</div>
</div>
<ul class="breadcrumb breadcrumb-top">
<li>Tables</li>
<li><a href="">Responsive</a></li>
</ul>
<!-- END Table Responsive Header -->
<!-- Responsive Full Block -->
<div class="block">
<!-- Responsive Full Title -->
<div class="block-title">
<h2><strong>Full Table</strong> Responsive</h2>
</div>
<!-- END Responsive Full Title -->
<!-- Responsive Full Content -->
<p>The first way to make a table responsive, is to wrap it with <code><div class="table-responsive"></div></code>. This way the table will be horizontally scrollable and all the data will be accessible on smaller screens (< 768px). Try resizing your browser window to check it live!</p>
<div class="table-responsive">
<table class="table table-vcenter table-striped">
<thead>
<tr>
<th style="width: 150px;" class="text-center"><i class="gi gi-user"></i></th>
<th>Client</th>
<th>Email</th>
<th>Subscription</th>
<th style="width: 150px;" class="text-center">Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center"><img src="img/placeholders/avatars/avatar<?php echo rand(1, 16); ?>.jpg" alt="avatar" class="img-circle"></td>
<td><a href="page_ready_user_profile.php">client1</a></td>
<td>client1@example.com</td>
<td><a href="javascript:void(0)" class="label label-warning">Trial</a></td>
<td class="text-center">
<div class="btn-group btn-group-xs">
<a href="javascript:void(0)" data-toggle="tooltip" title="Edit" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="javascript:void(0)" data-toggle="tooltip" title="Delete" class="btn btn-danger"><i class="fa fa-times"></i></a>
</div>
</td>
</tr>
<tr>
<td class="text-center"><img src="img/placeholders/avatars/avatar<?php echo rand(1, 16); ?>.jpg" alt="avatar" class="img-circle"></td>
<td><a href="page_ready_user_profile.php">client2</a></td>
<td>client2@example.com</td>
<td><a href="javascript:void(0)" class="label label-success">VIP</a></td>
<td class="text-center">
<div class="btn-group btn-group-xs">
<a href="javascript:void(0)" data-toggle="tooltip" title="Edit" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="javascript:void(0)" data-toggle="tooltip" title="Delete" class="btn btn-danger"><i class="fa fa-times"></i></a>
</div>
</td>
</tr>
<tr>
<td class="text-center"><img src="img/placeholders/avatars/avatar<?php echo rand(1, 16); ?>.jpg" alt="avatar" class="img-circle"></td>
<td><a href="page_ready_user_profile.php">client3</a></td>
<td>client3@example.com</td>
<td><a href="javascript:void(0)" class="label label-info">Business</a></td>
<td class="text-center">
<div class="btn-group btn-group-xs">
<a href="javascript:void(0)" data-toggle="tooltip" title="Edit" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="javascript:void(0)" data-toggle="tooltip" title="Delete" class="btn btn-danger"><i class="fa fa-times"></i></a>
</div>
</td>
</tr>
<tr>
<td class="text-center"><img src="img/placeholders/avatars/avatar<?php echo rand(1, 16); ?>.jpg" alt="avatar" class="img-circle"></td>
<td><a href="page_ready_user_profile.php">client4</a></td>
<td>client4@example.com</td>
<td><a href="javascript:void(0)" class="label label-success">VIP</a></td>
<td class="text-center">
<div class="btn-group btn-group-xs">
<a href="javascript:void(0)" data-toggle="tooltip" title="Edit" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="javascript:void(0)" data-toggle="tooltip" title="Delete" class="btn btn-danger"><i class="fa fa-times"></i></a>
</div>
</td>
</tr>
<tr>
<td class="text-center"><img src="img/placeholders/avatars/avatar<?php echo rand(1, 16); ?>.jpg" alt="avatar" class="img-circle"></td>
<td><a href="page_ready_user_profile.php">client5</a></td>
<td>client5@example.com</td>
<td><a href="javascript:void(0)" class="label label-primary">Personal</a></td>
<td class="text-center">
<div class="btn-group btn-group-xs">
<a href="javascript:void(0)" data-toggle="tooltip" title="Edit" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="javascript:void(0)" data-toggle="tooltip" title="Delete" class="btn btn-danger"><i class="fa fa-times"></i></a>
</div>
</td>
</tr>
<tr>
<td class="text-center"><img src="img/placeholders/avatars/avatar<?php echo rand(1, 16); ?>.jpg" alt="avatar" class="img-circle"></td>
<td><a href="page_ready_user_profile.php">client6</a></td>
<td>client6@example.com</td>
<td><a href="javascript:void(0)" class="label label-info">Business</a></td>
<td class="text-center">
<div class="btn-group btn-group-xs">
<a href="javascript:void(0)" data-toggle="tooltip" title="Edit" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="javascript:void(0)" data-toggle="tooltip" title="Delete" class="btn btn-danger"><i class="fa fa-times"></i></a>
</div>
</td>
</tr>
<tr>
<td class="text-center"><img src="img/placeholders/avatars/avatar<?php echo rand(1, 16); ?>.jpg" alt="avatar" class="img-circle"></td>
<td><a href="page_ready_user_profile.php">client7</a></td>
<td>client7@example.com</td>
<td><a href="javascript:void(0)" class="label label-primary">Personal</a></td>
<td class="text-center">
<div class="btn-group btn-group-xs">
<a href="javascript:void(0)" data-toggle="tooltip" title="Edit" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="javascript:void(0)" data-toggle="tooltip" title="Delete" class="btn btn-danger"><i class="fa fa-times"></i></a>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- END Responsive Full Content -->
</div>
<!-- END Responsive Full Block -->
<!-- Responsive Partial Block -->
<div class="block">
<!-- Responsive Partial Title -->
<div class="block-title">
<h2><strong>Partial Table</strong> Responsive</h2>
</div>
<!-- END Responsive Partial Title -->
<!-- Responsive Partial Content -->
<p>The second way is to use specific CSS classes for hiding columns in various screen resolutions. This way you can hide the less important columns and keep the most valuable on mobiles. At the following example the <strong>Subscription</strong> column isn't visible on small and extra small screens and <strong>Email</strong> column isn't visible on extra small screens. Try resizing your browser window to check it live!</p>
<table class="table table-vcenter table-striped">
<thead>
<tr>
<th style="width: 150px;" class="text-center"><i class="gi gi-user"></i></th>
<th>Client</th>
<th class="hidden-xs">Email</th>
<th class="hidden-sm hidden-xs">Subscription</th>
<th style="width: 150px;" class="text-center">Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center"><img src="img/placeholders/avatars/avatar<?php echo rand(1, 16); ?>.jpg" alt="avatar" class="img-circle"></td>
<td><a href="page_ready_user_profile.php">client1</a></td>
<td class="hidden-xs">client1@example.com</td>
<td class="hidden-sm hidden-xs"><a href="javascript:void(0)" class="label label-warning">Trial</a></td>
<td class="text-center">
<div class="btn-group btn-group-xs">
<a href="javascript:void(0)" data-toggle="tooltip" title="Edit" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="javascript:void(0)" data-toggle="tooltip" title="Delete" class="btn btn-danger"><i class="fa fa-times"></i></a>
</div>
</td>
</tr>
<tr>
<td class="text-center"><img src="img/placeholders/avatars/avatar<?php echo rand(1, 16); ?>.jpg" alt="avatar" class="img-circle"></td>
<td><a href="page_ready_user_profile.php">client2</a></td>
<td class="hidden-xs">client2@example.com</td>
<td class="hidden-sm hidden-xs"><a href="javascript:void(0)" class="label label-success">VIP</a></td>
<td class="text-center">
<div class="btn-group btn-group-xs">
<a href="javascript:void(0)" data-toggle="tooltip" title="Edit" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="javascript:void(0)" data-toggle="tooltip" title="Delete" class="btn btn-danger"><i class="fa fa-times"></i></a>
</div>
</td>
</tr>
<tr>
<td class="text-center"><img src="img/placeholders/avatars/avatar<?php echo rand(1, 16); ?>.jpg" alt="avatar" class="img-circle"></td>
<td><a href="page_ready_user_profile.php">client3</a></td>
<td class="hidden-xs">client3@example.com</td>
<td class="hidden-sm hidden-xs"><a href="javascript:void(0)" class="label label-info">Business</a></td>
<td class="text-center">
<div class="btn-group btn-group-xs">
<a href="javascript:void(0)" data-toggle="tooltip" title="Edit" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="javascript:void(0)" data-toggle="tooltip" title="Delete" class="btn btn-danger"><i class="fa fa-times"></i></a>
</div>
</td>
</tr>
<tr>
<td class="text-center"><img src="img/placeholders/avatars/avatar<?php echo rand(1, 16); ?>.jpg" alt="avatar" class="img-circle"></td>
<td><a href="page_ready_user_profile.php">client4</a></td>
<td class="hidden-xs">client4@example.com</td>
<td class="hidden-sm hidden-xs"><a href="javascript:void(0)" class="label label-success">VIP</a></td>
<td class="text-center">
<div class="btn-group btn-group-xs">
<a href="javascript:void(0)" data-toggle="tooltip" title="Edit" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="javascript:void(0)" data-toggle="tooltip" title="Delete" class="btn btn-danger"><i class="fa fa-times"></i></a>
</div>
</td>
</tr>
<tr>
<td class="text-center"><img src="img/placeholders/avatars/avatar<?php echo rand(1, 16); ?>.jpg" alt="avatar" class="img-circle"></td>
<td><a href="page_ready_user_profile.php">client5</a></td>
<td class="hidden-xs">client5@example.com</td>
<td class="hidden-sm hidden-xs"><a href="javascript:void(0)" class="label label-primary">Personal</a></td>
<td class="text-center">
<div class="btn-group btn-group-xs">
<a href="javascript:void(0)" data-toggle="tooltip" title="Edit" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="javascript:void(0)" data-toggle="tooltip" title="Delete" class="btn btn-danger"><i class="fa fa-times"></i></a>
</div>
</td>
</tr>
<tr>
<td class="text-center"><img src="img/placeholders/avatars/avatar<?php echo rand(1, 16); ?>.jpg" alt="avatar" class="img-circle"></td>
<td><a href="page_ready_user_profile.php">client6</a></td>
<td class="hidden-xs">client6@example.com</td>
<td class="hidden-sm hidden-xs"><a href="javascript:void(0)" class="label label-info">Business</a></td>
<td class="text-center">
<div class="btn-group btn-group-xs">
<a href="javascript:void(0)" data-toggle="tooltip" title="Edit" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="javascript:void(0)" data-toggle="tooltip" title="Delete" class="btn btn-danger"><i class="fa fa-times"></i></a>
</div>
</td>
</tr>
<tr>
<td class="text-center"><img src="img/placeholders/avatars/avatar<?php echo rand(1, 16); ?>.jpg" alt="avatar" class="img-circle"></td>
<td><a href="page_ready_user_profile.php">client7</a></td>
<td class="hidden-xs">client7@example.com</td>
<td class="hidden-sm hidden-xs"><a href="javascript:void(0)" class="label label-primary">Personal</a></td>
<td class="text-center">
<div class="btn-group btn-group-xs">
<a href="javascript:void(0)" data-toggle="tooltip" title="Edit" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="javascript:void(0)" data-toggle="tooltip" title="Delete" class="btn btn-danger"><i class="fa fa-times"></i></a>
</div>
</td>
</tr>
</tbody>
</table>
<!-- Responsive Classes -->
<p>Below you can find all the available classes you can use to make your tables responsive. These classes also work with most HTML elements, so you can make them visible only on the screens you want, too.</p>
<div class="table-responsive">
<table class="table table-borderless table-condensed text-center">
<thead>
<tr>
<th></th>
<th class="text-center">
Extra small devices<br>
<small>Phones (<768px)</small>
</th>
<th class="text-center">
Small devices<br>
<small>Tablets (≥768px)</small>
</th>
<th class="text-center">
Medium devices<br>
<small>Desktops (≥992px)</small>
</th>
<th class="text-center">
Large devices<br>
<small>Desktops (≥1200px)</small>
</th>
</tr>
</thead>
<tbody>
<tr>
<th><code>.visible-xs</code></th>
<td class="success"><i class="fa fa-check text-success"></i></td>
<td><i class="fa fa-times text-danger"></i></td>
<td><i class="fa fa-times text-danger"></i></td>
<td><i class="fa fa-times text-danger"></i></td>
</tr>
<tr>
<th><code>.visible-sm</code></th>
<td><i class="fa fa-times text-danger"></i></td>
<td class="success"><i class="fa fa-check text-success"></i></td>
<td><i class="fa fa-times text-danger"></i></td>
<td><i class="fa fa-times text-danger"></i></td>
</tr>
<tr>
<th><code>.visible-md</code></th>
<td><i class="fa fa-times text-danger"></i></td>
<td><i class="fa fa-times text-danger"></i></td>
<td class="success"><i class="fa fa-check text-success"></i></td>
<td><i class="fa fa-times text-danger"></i></td>
</tr>
<tr>
<th><code>.visible-lg</code></th>
<td><i class="fa fa-times text-danger"></i></td>
<td><i class="fa fa-times text-danger"></i></td>
<td><i class="fa fa-times text-danger"></i></td>
<td class="success"><i class="fa fa-check text-success"></i></td>
</tr>
</tbody>
<tbody>
<tr>
<th><code>.hidden-xs</code></th>
<td><i class="fa fa-times text-danger"></i></td>
<td class="success"><i class="fa fa-check text-success"></i></td>
<td class="success"><i class="fa fa-check text-success"></i></td>
<td class="success"><i class="fa fa-check text-success"></i></td>
</tr>
<tr>
<th><code>.hidden-sm</code></th>
<td class="success"><i class="fa fa-check text-success"></i></td>
<td><i class="fa fa-times text-danger"></i></td>
<td class="success"><i class="fa fa-check text-success"></i></td>
<td class="success"><i class="fa fa-check text-success"></i></td>
</tr>
<tr>
<th><code>.hidden-md</code></th>
<td class="success"><i class="fa fa-check text-success"></i></td>
<td class="success"><i class="fa fa-check text-success"></i></td>
<td><i class="fa fa-times text-danger"></i></td>
<td class="success"><i class="fa fa-check text-success"></i></td>
</tr>
<tr>
<th><code>.hidden-lg</code></th>
<td class="success"><i class="fa fa-check text-success"></i></td>
<td class="success"><i class="fa fa-check text-success"></i></td>
<td class="success"><i class="fa fa-check text-success"></i></td>
<td><i class="fa fa-times text-danger"></i></td>
</tr>
</tbody>
</table>
</div>
<!-- END Responsive Classes -->
<!-- END Responsive Partial Content -->
</div>
<!-- END Responsive Partial Block -->
</div>
<!-- END Page Content -->
<?php include 'inc/page_footer.php'; ?>
<?php include 'inc/template_scripts.php'; ?>
<?php include 'inc/template_end.php'; ?> | {
"content_hash": "11ca4f9bde9a7929d7a0d873011531bc",
"timestamp": "",
"source": "github",
"line_count": 338,
"max_line_length": 434,
"avg_line_length": 63.28698224852071,
"alnum_prop": 0.46510214576223646,
"repo_name": "mansuang/ManFinanceBundle",
"id": "acf793e6b35ca4f9dcd7635d705d01efc13ef44f",
"size": "21391",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Man/FinanceBundle/Resources/public/proui/page_tables_responsive.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "707128"
},
{
"name": "JavaScript",
"bytes": "133173"
},
{
"name": "PHP",
"bytes": "1443264"
}
],
"symlink_target": ""
} |
"""A thin wrapper around datastore query RPC calls.
This provides wrappers around the internal only datastore_pb library and is
designed to be the lowest-level API to be used by all Python datastore client
libraries for executing queries. It provides a layer of protection so the actual
RPC syntax can change without affecting client libraries.
Any class, function, field or argument starting with an '_' is for INTERNAL use
only and should not be used by developers!
"""
__all__ = ['Batch',
'Batcher',
'CompositeFilter',
'CompositeOrder',
'CorrelationFilter',
'Cursor',
'FetchOptions',
'FilterPredicate',
'Order',
'PropertyFilter',
'PropertyOrder',
'Query',
'QueryOptions',
'ResultsIterator',
'make_filter',
'apply_query',
'inject_results']
import base64
import collections
import pickle
from google.net.proto import ProtocolBuffer
from google.appengine.datastore import entity_pb
from google.appengine.api import datastore_errors
from google.appengine.api import datastore_types
from google.appengine.api.search import geo_util
from google.appengine.datastore import datastore_index
from google.appengine.datastore import datastore_pb
from google.appengine.datastore import datastore_pbs
from google.appengine.datastore import datastore_rpc
if datastore_pbs._CLOUD_DATASTORE_ENABLED:
from google.appengine.datastore.datastore_pbs import googledatastore
class _BaseComponent(object):
"""A base class for query components.
Currently just implements basic == and != functions.
"""
def __eq__(self, other):
if self.__class__ is not other.__class__:
return NotImplemented
return self is other or self.__dict__ == other.__dict__
def __ne__(self, other):
equal = self.__eq__(other)
if equal is NotImplemented:
return equal
return not equal
def make_filter(name, op, values):
"""Constructs a FilterPredicate from the given name, op and values.
Args:
name: A non-empty string, the name of the property to filter.
op: One of PropertyFilter._OPERATORS.keys(), the operator to use.
values: A supported value, the value to compare against.
Returns:
if values is a list, a CompositeFilter that uses AND to combine all
values, otherwise a PropertyFilter for the single value.
Raises:
datastore_errors.BadPropertyError: if the property name is invalid.
datastore_errors.BadValueError: if the property did not validate correctly
or the value was an empty list.
Other exception types (like OverflowError): if the property value does not
meet type-specific criteria.
"""
datastore_types.ValidateProperty(name, values)
properties = datastore_types.ToPropertyPb(name, values)
if isinstance(properties, list):
filters = [PropertyFilter(op, prop) for prop in properties]
return CompositeFilter(CompositeFilter.AND, filters)
else:
return PropertyFilter(op, properties)
def _make_key_value_map(entity, property_names):
"""Extracts key values from the given entity.
Args:
entity: The entity_pb.EntityProto to extract values from.
property_names: The names of the properties from which to extract values.
Returns:
A dict mapping property names to a lists of key values.
"""
value_map = dict((name, []) for name in property_names)
for prop in entity.property_list():
if prop.name() in value_map:
value_map[prop.name()].append(
datastore_types.PropertyValueToKeyValue(prop.value()))
if datastore_types.KEY_SPECIAL_PROPERTY in value_map:
value_map[datastore_types.KEY_SPECIAL_PROPERTY] = [
datastore_types.ReferenceToKeyValue(entity.key())]
return value_map
class _PropertyComponent(_BaseComponent):
"""A component that operates on a specific set of properties."""
def _get_prop_names(self):
"""Returns a set of property names used by the filter."""
raise NotImplementedError
class FilterPredicate(_PropertyComponent):
"""An abstract base class for all query filters.
All sub-classes must be immutable as these are often stored without creating a
defensive copy.
"""
def __call__(self, entity):
"""Applies the filter predicate to the given entity.
Args:
entity: the datastore_pb.EntityProto to test.
Returns:
True if the given entity matches the filter, False otherwise.
"""
return self._apply(_make_key_value_map(entity, self._get_prop_names()))
def _apply(self, key_value_map):
"""Apply the given component to the comparable value map.
A filter matches a list of values if at least one value in the list
matches the filter, for example:
'prop: [1, 2]' matches both 'prop = 1' and 'prop = 2' but not 'prop = 3'
Note: the values are actually represented as tuples whose first item
encodes the type; see datastore_types.PropertyValueToKeyValue().
Args:
key_value_map: A dict mapping property names to a list of
comparable values.
Return:
A boolean indicating if the given map matches the filter.
"""
raise NotImplementedError
def _prune(self, key_value_map):
"""Removes values from the given map that do not match the filter.
When doing a scan in the datastore, only index values that match the filters
are seen. When multiple values that point to the same entity are seen, the
entity only appears where the first value is found. This function removes
all values that don't match the query so that the first value in the map
is the same one the datastore would see first.
Args:
key_value_map: the comparable value map from which to remove
values. Does not need to contain values for all filtered properties.
Returns:
A value that evaluates to False if every value in a single list was
completely removed. This effectively applies the filter but is less
efficient than _apply().
"""
raise NotImplementedError
def _to_pb(self):
"""Internal only function to generate a pb."""
raise NotImplementedError(
'This filter only supports in memory operations (%r)' % self)
def _to_pbs(self):
"""Internal only function to generate a list of pbs."""
return [self._to_pb()]
def _to_pb_v1(self, adapter):
"""Internal only function to generate a v1 pb.
Args:
adapter: A datastore_rpc.AbstractAdapter
"""
raise NotImplementedError(
'This filter only supports in memory operations (%r)' % self)
class _SinglePropertyFilter(FilterPredicate):
"""Base class for a filter that operates on a single property."""
def _get_prop_name(self):
"""Returns the name of the property being filtered."""
raise NotImplementedError
def _apply_to_value(self, value):
"""Apply the filter to the given value.
Args:
value: The comparable value to check.
Returns:
A boolean indicating if the given value matches the filter.
"""
raise NotImplementedError
def _get_prop_names(self):
return set([self._get_prop_name()])
def _apply(self, value_map):
for other_value in value_map[self._get_prop_name()]:
if self._apply_to_value(other_value):
return True
return False
def _prune(self, value_map):
if self._get_prop_name() not in value_map:
return True
values = [value for value in value_map[self._get_prop_name()]
if self._apply_to_value(value)]
value_map[self._get_prop_name()] = values
return bool(values)
class PropertyFilter(_SinglePropertyFilter):
"""An immutable filter predicate that constrains a single property."""
_OPERATORS = {
'<': datastore_pb.Query_Filter.LESS_THAN,
'<=': datastore_pb.Query_Filter.LESS_THAN_OR_EQUAL,
'>': datastore_pb.Query_Filter.GREATER_THAN,
'>=': datastore_pb.Query_Filter.GREATER_THAN_OR_EQUAL,
'=': datastore_pb.Query_Filter.EQUAL,
}
_OPERATORS_INVERSE = dict((value, key)
for key, value in _OPERATORS.iteritems())
_OPERATORS_TO_PYTHON_OPERATOR = {
datastore_pb.Query_Filter.LESS_THAN: '<',
datastore_pb.Query_Filter.LESS_THAN_OR_EQUAL: '<=',
datastore_pb.Query_Filter.GREATER_THAN: '>',
datastore_pb.Query_Filter.GREATER_THAN_OR_EQUAL: '>=',
datastore_pb.Query_Filter.EQUAL: '==',
}
_INEQUALITY_OPERATORS = frozenset(['<', '<=', '>', '>='])
_INEQUALITY_OPERATORS_ENUM = frozenset([
datastore_pb.Query_Filter.LESS_THAN,
datastore_pb.Query_Filter.LESS_THAN_OR_EQUAL,
datastore_pb.Query_Filter.GREATER_THAN,
datastore_pb.Query_Filter.GREATER_THAN_OR_EQUAL,
])
_UPPERBOUND_INEQUALITY_OPERATORS = frozenset(['<', '<='])
def __init__(self, op, value):
"""Constructor.
Args:
op: A string representing the operator to use.
value: A entity_pb.Property, the property and value to compare against.
Raises:
datastore_errors.BadArgumentError if op has an unsupported value or value
is not an entity_pb.Property.
"""
if op not in self._OPERATORS:
raise datastore_errors.BadArgumentError('unknown operator: %r' % (op,))
if not isinstance(value, entity_pb.Property):
raise datastore_errors.BadArgumentError(
'value argument should be entity_pb.Property (%r)' % (value,))
super(PropertyFilter, self).__init__()
self._filter = datastore_pb.Query_Filter()
self._filter.set_op(self._OPERATORS[op])
self._filter.add_property().CopyFrom(value)
@property
def op(self):
raw_op = self._filter.op()
return self._OPERATORS_INVERSE.get(raw_op, str(raw_op))
@property
def value(self):
return self._filter.property(0)
def __repr__(self):
prop = self.value
name = prop.name()
value = datastore_types.FromPropertyPb(prop)
return '%s(%r, <%r, %r>)' % (self.__class__.__name__, self.op, name, value)
def _get_prop_name(self):
return self._filter.property(0).name()
def _apply_to_value(self, value):
if not hasattr(self, '_cmp_value'):
if self._filter.op() == datastore_pb.Query_Filter.EXISTS:
return True
self._cmp_value = datastore_types.PropertyValueToKeyValue(
self._filter.property(0).value())
self._condition = ('value %s self._cmp_value' %
self._OPERATORS_TO_PYTHON_OPERATOR[self._filter.op()])
return eval(self._condition)
def _has_inequality(self):
"""Returns True if the filter predicate contains inequalities filters."""
return self._filter.op() in self._INEQUALITY_OPERATORS_ENUM
@classmethod
def _from_pb(cls, filter_pb):
self = cls.__new__(cls)
self._filter = filter_pb
return self
def _to_pb(self):
"""Returns the internal only pb representation."""
return self._filter
def _to_pb_v1(self, adapter):
"""Returns a googledatastore.Filter representation of the filter.
Args:
adapter: A datastore_rpc.AbstractAdapter
"""
filter_pb = googledatastore.Filter()
prop_filter_pb = filter_pb.property_filter
adapter.get_query_converter()._v3_filter_to_v1_property_filter(
self._filter, prop_filter_pb)
return filter_pb
def __getstate__(self):
raise pickle.PicklingError(
'Pickling of datastore_query.PropertyFilter is unsupported.')
def __eq__(self, other):
if self.__class__ is not other.__class__:
if other.__class__ is _PropertyRangeFilter:
return [self._filter] == other._to_pbs()
return NotImplemented
return self._filter == other._filter
class _PropertyRangeFilter(_SinglePropertyFilter):
"""A filter predicate that represents a range of values.
Since we allow multi-valued properties there is a large difference between
"x > 0 AND x < 1" and "0 < x < 1." An entity with x = [-1, 2] will match the
first but not the second.
Since the datastore only allows a single inequality filter, multiple
in-equality filters are merged into a single range filter in the
datastore (unlike equality filters). This class is used by
datastore_query.CompositeFilter to implement the same logic.
"""
_start_key_value = None
_end_key_value = None
@datastore_rpc._positional(1)
def __init__(self, start=None, start_incl=True, end=None, end_incl=True):
"""Constructs a range filter using start and end properties.
Args:
start: A entity_pb.Property to use as a lower bound or None to indicate
no lower bound.
start_incl: A boolean that indicates if the lower bound is inclusive.
end: A entity_pb.Property to use as an upper bound or None to indicate
no upper bound.
end_incl: A boolean that indicates if the upper bound is inclusive.
"""
if start is not None and not isinstance(start, entity_pb.Property):
raise datastore_errors.BadArgumentError(
'start argument should be entity_pb.Property (%r)' % (start,))
if end is not None and not isinstance(end, entity_pb.Property):
raise datastore_errors.BadArgumentError(
'start argument should be entity_pb.Property (%r)' % (end,))
if start and end and start.name() != end.name():
raise datastore_errors.BadArgumentError(
'start and end arguments must be on the same property (%s != %s)' %
(start.name(), end.name()))
if not start and not end:
raise datastore_errors.BadArgumentError(
'Unbounded ranges are not supported.')
super(_PropertyRangeFilter, self).__init__()
self._start = start
self._start_incl = start_incl
self._end = end
self._end_incl = end_incl
@classmethod
def from_property_filter(cls, prop_filter):
op = prop_filter._filter.op()
if op == datastore_pb.Query_Filter.GREATER_THAN:
return cls(start=prop_filter._filter.property(0), start_incl=False)
elif op == datastore_pb.Query_Filter.GREATER_THAN_OR_EQUAL:
return cls(start=prop_filter._filter.property(0))
elif op == datastore_pb.Query_Filter.LESS_THAN:
return cls(end=prop_filter._filter.property(0), end_incl=False)
elif op == datastore_pb.Query_Filter.LESS_THAN_OR_EQUAL:
return cls(end=prop_filter._filter.property(0))
else:
raise datastore_errors.BadArgumentError(
'Unsupported operator (%s)' % (op,))
def intersect(self, other):
"""Returns a filter representing the intersection of self and other."""
if isinstance(other, PropertyFilter):
other = self.from_property_filter(other)
elif not isinstance(other, _PropertyRangeFilter):
raise datastore_errors.BadArgumentError(
'other argument should be a _PropertyRangeFilter (%r)' % (other,))
if other._get_prop_name() != self._get_prop_name():
raise datastore_errors.BadArgumentError(
'other argument must be on the same property (%s != %s)' %
(other._get_prop_name(), self._get_prop_name()))
start_source = None
if other._start:
if self._start:
result = cmp(self._get_start_key_value(), other._get_start_key_value())
if result == 0:
result = cmp(other._start_incl, self._start_incl)
if result > 0:
start_source = self
elif result < 0:
start_source = other
else:
start_source = other
elif self._start:
start_source = self
end_source = None
if other._end:
if self._end:
result = cmp(self._get_end_key_value(), other._get_end_key_value())
if result == 0:
result = cmp(self._end_incl, other._end_incl)
if result < 0:
end_source = self
elif result > 0:
end_source = other
else:
end_source = other
elif self._end:
end_source = self
if start_source:
if end_source in (start_source, None):
return start_source
result = _PropertyRangeFilter(start=start_source._start,
start_incl=start_source._start_incl,
end=end_source._end,
end_incl=end_source._end_incl)
result._start_key_value = start_source._start_key_value
result._end_key_value = end_source._end_key_value
return result
else:
return end_source or self
def _get_start_key_value(self):
if self._start_key_value is None:
self._start_key_value = datastore_types.PropertyValueToKeyValue(
self._start.value())
return self._start_key_value
def _get_end_key_value(self):
if self._end_key_value is None:
self._end_key_value = datastore_types.PropertyValueToKeyValue(
self._end.value())
return self._end_key_value
def _apply_to_value(self, value):
"""Apply the filter to the given value.
Args:
value: The comparable value to check.
Returns:
A boolean indicating if the given value matches the filter.
"""
if self._start:
result = cmp(self._get_start_key_value(), value)
if result > 0 or (result == 0 and not self._start_incl):
return False
if self._end:
result = cmp(self._get_end_key_value(), value)
if result < 0 or (result == 0 and not self._end_incl):
return False
return True
def _get_prop_name(self):
if self._start:
return self._start.name()
if self._end:
return self._end.name()
assert False
def _to_pbs(self):
pbs = []
if self._start:
if self._start_incl:
op = datastore_pb.Query_Filter.GREATER_THAN_OR_EQUAL
else:
op = datastore_pb.Query_Filter.GREATER_THAN
pb = datastore_pb.Query_Filter()
pb.set_op(op)
pb.add_property().CopyFrom(self._start)
pbs.append(pb)
if self._end:
if self._end_incl:
op = datastore_pb.Query_Filter.LESS_THAN_OR_EQUAL
else:
op = datastore_pb.Query_Filter.LESS_THAN
pb = datastore_pb.Query_Filter()
pb.set_op(op)
pb.add_property().CopyFrom(self._end)
pbs.append(pb)
return pbs
def _to_pb_v1(self, adapter):
"""Returns a googledatastore.Filter representation of the filter.
Args:
adapter: A datastore_rpc.AbstractAdapter.
"""
filter_pb = googledatastore.Filter()
composite_filter = filter_pb.composite_filter
composite_filter.op = googledatastore.CompositeFilter.AND
if self._start:
if self._start_incl:
op = googledatastore.PropertyFilter.GREATER_THAN_OR_EQUAL
else:
op = googledatastore.PropertyFilter.GREATER_THAN
pb = composite_filter.filters.add().property_filter
pb.op = op
pb.property.name = self._start.name()
adapter.get_entity_converter().v3_property_to_v1_value(
self._start, True, pb.value)
if self._end:
if self._end_incl:
op = googledatastore.PropertyFilter.LESS_THAN_OR_EQUAL
else:
op = googledatastore.PropertyFilter.LESS_THAN
pb = composite_filter.filters.add().property_filter
pb.op = op
pb.property.name = self._end.name()
adapter.get_entity_converter().v3_property_to_v1_value(
self._end, True, pb.value)
return filter_pb
def __getstate__(self):
raise pickle.PicklingError(
'Pickling of %r is unsupported.' % self)
def __eq__(self, other):
if self.__class__ is not other.__class__:
return NotImplemented
return (self._start == other._start and
self._end == other._end and
(self._start_incl == other._start_incl or self._start is None) and
(self._end_incl == other._end_incl or self._end is None))
class _PropertyExistsFilter(FilterPredicate):
"""A FilterPredicate that matches entities containing specific properties.
Only works as an in-memory filter. Used internally to filter out entities
that don't have all properties in a given Order.
"""
def __init__(self, names):
super(_PropertyExistsFilter, self).__init__()
self._names = frozenset(names)
def _apply(self, value_map):
for name in self._names:
if not value_map.get(name):
return False
return True
def _get_prop_names(self):
return self._names
def _prune(self, _):
raise NotImplementedError
def __getstate__(self):
raise pickle.PicklingError(
'Pickling of %r is unsupported.' % self)
class CorrelationFilter(FilterPredicate):
"""A filter that isolates correlated values and applies a sub-filter on them.
This filter assumes that every property used by the sub-filter should be
grouped before being passed to the sub-filter. The default grouping puts
each value in its own group. Consider:
e = {a: [1, 2], b: [2, 1, 3], c: 4}
A correlation filter with a sub-filter that operates on (a, b) will be tested
against the following 3 sets of values:
{a: 1, b: 2}
{a: 2, b: 1}
{b: 3}
In this case CorrelationFilter('a = 2 AND b = 2') won't match this entity but
CorrelationFilter('a = 2 AND b = 1') will. To apply an uncorrelated filter on
c, the filter must be applied in parallel to the correlation filter. For
example:
CompositeFilter(AND, [CorrelationFilter('a = 2 AND b = 1'), 'c = 3'])
If 'c = 3' was included in the correlation filter, c would be grouped as well.
This would result in the following values:
{a: 1, b: 2, c: 3}
{a: 2, b: 1}
{b: 3}
If any set of correlated values match the sub-filter then the entity matches
the correlation filter.
"""
def __init__(self, subfilter):
"""Constructor.
Args:
subfilter: A FilterPredicate to apply to the correlated values
"""
self._subfilter = subfilter
@property
def subfilter(self):
return self._subfilter
def __repr__(self):
return '%s(%r)' % (self.__class__.__name__, self.subfilter)
def _apply(self, value_map):
base_map = dict((prop, []) for prop in self._get_prop_names())
value_maps = []
for prop in base_map:
grouped = self._group_values(prop, value_map[prop])
while len(value_maps) < len(grouped):
value_maps.append(base_map.copy())
for value, map in zip(grouped, value_maps):
map[prop] = value
return self._apply_correlated(value_maps)
def _apply_correlated(self, value_maps):
"""Applies sub-filter to the correlated value maps.
The default implementation matches when any value_map in value_maps
matches the sub-filter.
Args:
value_maps: A list of correlated value_maps.
Returns:
True if any the entity matches the correlation filter.
"""
for map in value_maps:
if self._subfilter._apply(map):
return True
return False
def _group_values(self, prop, values):
"""A function that groups the given values.
Override this function to introduce custom grouping logic. The default
implementation assumes each value belongs in its own group.
Args:
prop: The name of the property who's values are being grouped.
values: A list of opaque values.
Returns:
A list of lists of grouped values.
"""
return [[value] for value in values]
def _get_prop_names(self):
return self._subfilter._get_prop_names()
class CompositeFilter(FilterPredicate):
"""An immutable filter predicate that combines other predicates.
This class proactively merges sub-filters that are combined using the same
operator. For example:
CompositeFilter(AND, [f1, f2, CompositeFilter(AND, [f3, f4]), f5, f6])
is equivalent to:
CompositeFilter(AND, [f1, f2, f3, f4, f5, f6])
Currently filters can only be combined using an AND operator.
"""
AND = 'and'
_OPERATORS = frozenset([AND])
def __init__(self, op, filters):
"""Constructor.
Args:
op: The operator to use to combine the given filters
filters: A list of one or more filters to combine
Raises:
datastore_errors.BadArgumentError if op is not in CompsiteFilter.OPERATORS
or filters is not a non-empty list containing only FilterPredicates.
"""
if not op in self._OPERATORS:
raise datastore_errors.BadArgumentError('unknown operator (%s)' % (op,))
if not filters or not isinstance(filters, (list, tuple)):
raise datastore_errors.BadArgumentError(
'filters argument should be a non-empty list (%r)' % (filters,))
super(CompositeFilter, self).__init__()
self._op = op
flattened = []
for f in filters:
if isinstance(f, CompositeFilter) and f._op == self._op:
flattened.extend(f._filters)
elif isinstance(f, FilterPredicate):
flattened.append(f)
else:
raise datastore_errors.BadArgumentError(
'filters argument must be a list of FilterPredicates, found (%r)' %
(f,))
if op == self.AND:
filters = flattened
flattened = []
ineq_map = {}
for f in filters:
if (isinstance(f, _PropertyRangeFilter) or
(isinstance(f, PropertyFilter) and f._has_inequality())):
name = f._get_prop_name()
index = ineq_map.get(name)
if index is not None:
range_filter = flattened[index]
flattened[index] = range_filter.intersect(f)
else:
if isinstance(f, PropertyFilter):
range_filter = _PropertyRangeFilter.from_property_filter(f)
else:
range_filter = f
ineq_map[name] = len(flattened)
flattened.append(range_filter)
else:
flattened.append(f)
self._filters = tuple(flattened)
@property
def op(self):
return self._op
@property
def filters(self):
return self._filters
def __repr__(self):
op = self.op
if op == self.AND:
op = 'AND'
else:
op = str(op)
return '%s(%s, %r)' % (self.__class__.__name__, op, list(self.filters))
def _get_prop_names(self):
names = set()
for f in self._filters:
names |= f._get_prop_names()
return names
def _apply(self, value_map):
if self._op == self.AND:
for f in self._filters:
if not f._apply(value_map):
return False
return True
raise NotImplementedError
def _prune(self, value_map):
if self._op == self.AND:
matches = collections.defaultdict(set)
for f in self._filters:
props = f._get_prop_names()
local_value_map = dict((k, v) for k, v in value_map.iteritems()
if k in props)
if not f._prune(local_value_map):
return False
for (prop, values) in local_value_map.iteritems():
matches[prop].update(values)
for prop, value_set in matches.iteritems():
value_map[prop] = sorted(value_set)
return True
raise NotImplementedError
def _to_pbs(self):
"""Returns the internal only pb representation."""
pbs = []
for f in self._filters:
pbs.extend(f._to_pbs())
return pbs
def _to_pb_v1(self, adapter):
"""Returns a googledatastore.Filter.
Args:
adapter: A datastore_rpc.AbstractAdapter
"""
if not self._filters:
return None
if len(self._filters) == 1:
return self._filters[0]._to_pb_v1(adapter)
pb = googledatastore.Filter()
comp_pb = pb.composite_filter
if self.op == self.AND:
comp_pb.op = googledatastore.CompositeFilter.AND
else:
raise datastore_errors.BadArgumentError(
'Datastore V4 only supports CompositeFilter with AND operator.')
for f in self._filters:
comp_pb.filters.add().CopyFrom(f._to_pb_v1(adapter))
return pb
def __eq__(self, other):
if self.__class__ is other.__class__:
return super(CompositeFilter, self).__eq__(other)
if len(self._filters) == 1:
result = self._filters[0].__eq__(other)
if result is NotImplemented and hasattr(other, '__eq__'):
return other.__eq__(self._filters[0])
return result
return NotImplemented
class _IgnoreFilter(_SinglePropertyFilter):
"""A filter that removes all entities with the given keys."""
def __init__(self, key_value_set):
super(_IgnoreFilter, self).__init__()
self._keys = key_value_set
def _get_prop_name(self):
return datastore_types.KEY_SPECIAL_PROPERTY
def _apply_to_value(self, value):
return value not in self._keys
class _DedupingFilter(_IgnoreFilter):
"""A filter that removes duplicate keys."""
def __init__(self, key_value_set=None):
super(_DedupingFilter, self).__init__(key_value_set or set())
def _apply_to_value(self, value):
if super(_DedupingFilter, self)._apply_to_value(value):
self._keys.add(value)
return True
return False
class Order(_PropertyComponent):
"""A base class that represents a sort order on a query.
All sub-classes must be immutable as these are often stored without creating a
defensive copying.
This class can be used as either the cmp or key arg in sorted() or
list.sort(). To provide a stable ordering a trailing key ascending order is
always used.
"""
@datastore_rpc._positional(1)
def reversed(self, group_by=None):
"""Constructs an order representing the reverse of the current order.
This function takes into account the effects of orders on properties not in
the group_by clause of a query. For example, consider:
SELECT A, First(B) ... GROUP BY A ORDER BY A, B
Changing the order of B would effect which value is listed in the 'First(B)'
column which would actually change the results instead of just reversing
them.
Args:
group_by: If specified, only orders on properties in group_by will be
reversed.
Returns:
A new order representing the reverse direction.
"""
raise NotImplementedError
def _key(self, lhs_value_map):
"""Creates a key for the given value map."""
raise NotImplementedError
def _cmp(self, lhs_value_map, rhs_value_map):
"""Compares the given value maps."""
raise NotImplementedError
def _to_pb(self):
"""Internal only function to generate a filter pb."""
raise NotImplementedError
def _to_pb_v1(self, adapter):
"""Internal only function to generate a v1 filter pb.
Args:
adapter: A datastore_rpc.AbstractAdapter
"""
raise NotImplementedError
def key_for_filter(self, filter_predicate):
if filter_predicate:
return lambda x: self.key(x, filter_predicate)
return self.key
def cmp_for_filter(self, filter_predicate):
if filter_predicate:
return lambda x, y: self.cmp(x, y, filter_predicate)
return self.cmp
def key(self, entity, filter_predicate=None):
"""Constructs a "key" value for the given entity based on the current order.
This function can be used as the key argument for list.sort() and sorted().
Args:
entity: The entity_pb.EntityProto to convert
filter_predicate: A FilterPredicate used to prune values before comparing
entities or None.
Returns:
A key value that identifies the position of the entity when sorted by
the current order.
"""
names = self._get_prop_names()
names.add(datastore_types.KEY_SPECIAL_PROPERTY)
if filter_predicate is not None:
names |= filter_predicate._get_prop_names()
value_map = _make_key_value_map(entity, names)
if filter_predicate is not None:
filter_predicate._prune(value_map)
return (self._key(value_map),
value_map[datastore_types.KEY_SPECIAL_PROPERTY])
def cmp(self, lhs, rhs, filter_predicate=None):
"""Compares the given values taking into account any filters.
This function can be used as the cmp argument for list.sort() and sorted().
This function is slightly more efficient that Order.key when comparing two
entities, however it is much less efficient when sorting a list of entities.
Args:
lhs: An entity_pb.EntityProto
rhs: An entity_pb.EntityProto
filter_predicate: A FilterPredicate used to prune values before comparing
entities or None.
Returns:
An integer <, = or > 0 representing the operator that goes in between lhs
and rhs that to create a true statement.
"""
names = self._get_prop_names()
if filter_predicate is not None:
names |= filter_predicate._get_prop_names()
lhs_value_map = _make_key_value_map(lhs, names)
rhs_value_map = _make_key_value_map(rhs, names)
if filter_predicate is not None:
filter_predicate._prune(lhs_value_map)
filter_predicate._prune(rhs_value_map)
result = self._cmp(lhs_value_map, rhs_value_map)
if result:
return result
if not lhs.has_key() and not rhs.has_key():
return 0
lhs_key = (lhs_value_map.get(datastore_types.KEY_SPECIAL_PROPERTY) or
datastore_types.ReferenceToKeyValue(lhs.key()))
rhs_key = (rhs_value_map.get(datastore_types.KEY_SPECIAL_PROPERTY) or
datastore_types.ReferenceToKeyValue(rhs.key()))
return cmp(lhs_key, rhs_key)
class _ReverseOrder(_BaseComponent):
"""Reverses the comparison for the given object."""
def __init__(self, obj):
"""Constructor for _ReverseOrder.
Args:
obj: Any comparable and hashable object.
"""
super(_ReverseOrder, self).__init__()
self._obj = obj
def __hash__(self):
return hash(self._obj)
def __cmp__(self, other):
assert self.__class__ == other.__class__, (
'A datastore_query._ReverseOrder object can only be compared to '
'an object of the same type.')
return -cmp(self._obj, other._obj)
class PropertyOrder(Order):
"""An immutable class that represents a sort order for a single property."""
ASCENDING = datastore_pb.Query_Order.ASCENDING
DESCENDING = datastore_pb.Query_Order.DESCENDING
_DIRECTIONS = frozenset([ASCENDING, DESCENDING])
def __init__(self, prop, direction=ASCENDING):
"""Constructor.
Args:
prop: the name of the prop by which to sort.
direction: the direction in which to sort the given prop.
Raises:
datastore_errors.BadArgumentError if the prop name or direction is
invalid.
"""
datastore_types.ValidateString(prop,
'prop',
datastore_errors.BadArgumentError)
if not direction in self._DIRECTIONS:
raise datastore_errors.BadArgumentError('unknown direction: %r' %
(direction,))
super(PropertyOrder, self).__init__()
self.__order = datastore_pb.Query_Order()
self.__order.set_property(prop.encode('utf-8'))
self.__order.set_direction(direction)
@property
def prop(self):
return self.__order.property()
@property
def direction(self):
return self.__order.direction()
def __repr__(self):
name = self.prop
direction = self.direction
extra = ''
if direction == self.DESCENDING:
extra = ', DESCENDING'
name = repr(name).encode('utf-8')[1:-1]
return '%s(<%s>%s)' % (self.__class__.__name__, name, extra)
@datastore_rpc._positional(1)
def reversed(self, group_by=None):
if group_by and self.__order.property() not in group_by:
return self
if self.__order.direction() == self.ASCENDING:
return PropertyOrder(self.__order.property().decode('utf-8'),
self.DESCENDING)
else:
return PropertyOrder(self.__order.property().decode('utf-8'),
self.ASCENDING)
def _get_prop_names(self):
return set([self.__order.property()])
def _key(self, lhs_value_map):
lhs_values = lhs_value_map[self.__order.property()]
if not lhs_values:
raise datastore_errors.BadArgumentError(
'Missing value for property (%s)' % self.__order.property())
if self.__order.direction() == self.ASCENDING:
return min(lhs_values)
else:
return _ReverseOrder(max(lhs_values))
def _cmp(self, lhs_value_map, rhs_value_map):
lhs_values = lhs_value_map[self.__order.property()]
rhs_values = rhs_value_map[self.__order.property()]
if not lhs_values and not rhs_values:
return 0
if not lhs_values:
raise datastore_errors.BadArgumentError(
'LHS missing value for property (%s)' % self.__order.property())
if not rhs_values:
raise datastore_errors.BadArgumentError(
'RHS missing value for property (%s)' % self.__order.property())
if self.__order.direction() == self.ASCENDING:
return cmp(min(lhs_values), min(rhs_values))
else:
return cmp(max(rhs_values), max(lhs_values))
@classmethod
def _from_pb(cls, order_pb):
self = cls.__new__(cls)
self.__order = order_pb
return self
def _to_pb(self):
"""Returns the internal only pb representation."""
return self.__order
def _to_pb_v1(self, adapter):
"""Returns a googledatastore.PropertyOrder representation of the order.
Args:
adapter: A datastore_rpc.AbstractAdapter.
"""
v1_order = googledatastore.PropertyOrder()
adapter.get_query_converter().v3_order_to_v1_order(self.__order, v1_order)
return v1_order
def __getstate__(self):
raise pickle.PicklingError(
'Pickling of datastore_query.PropertyOrder is unsupported.')
class CompositeOrder(Order):
"""An immutable class that represents a sequence of Orders.
This class proactively flattens sub-orders that are of type CompositeOrder.
For example:
CompositeOrder([O1, CompositeOrder([02, 03]), O4])
is equivalent to:
CompositeOrder([O1, 02, 03, O4])
"""
def __init__(self, orders):
"""Constructor.
Args:
orders: A list of Orders which are applied in order.
"""
if not isinstance(orders, (list, tuple)):
raise datastore_errors.BadArgumentError(
'orders argument should be list or tuple (%r)' % (orders,))
super(CompositeOrder, self).__init__()
flattened = []
for order in orders:
if isinstance(order, CompositeOrder):
flattened.extend(order._orders)
elif isinstance(order, Order):
flattened.append(order)
else:
raise datastore_errors.BadArgumentError(
'orders argument should only contain Order (%r)' % (order,))
self._orders = tuple(flattened)
@property
def orders(self):
return self._orders
def __repr__(self):
return '%s(%r)' % (self.__class__.__name__, list(self.orders))
@datastore_rpc._positional(1)
def reversed(self, group_by=None):
return CompositeOrder([order.reversed(group_by=group_by)
for order in self._orders])
def _get_prop_names(self):
names = set()
for order in self._orders:
names |= order._get_prop_names()
return names
def _key(self, lhs_value_map):
result = []
for order in self._orders:
result.append(order._key(lhs_value_map))
return tuple(result)
def _cmp(self, lhs_value_map, rhs_value_map):
for order in self._orders:
result = order._cmp(lhs_value_map, rhs_value_map)
if result != 0:
return result
return 0
def size(self):
"""Returns the number of sub-orders the instance contains."""
return len(self._orders)
def _to_pbs(self):
"""Returns an ordered list of internal only pb representations."""
return [order._to_pb() for order in self._orders]
def _to_pb_v1(self, adapter):
"""Returns an ordered list of googledatastore.PropertyOrder.
Args:
adapter: A datastore_rpc.AbstractAdapter
"""
return [order._to_pb_v1(adapter) for order in self._orders]
def __eq__(self, other):
if self.__class__ is other.__class__:
return super(CompositeOrder, self).__eq__(other)
if len(self._orders) == 1:
result = self._orders[0].__eq__(other)
if result is NotImplemented and hasattr(other, '__eq__'):
return other.__eq__(self._orders[0])
return result
return NotImplemented
class FetchOptions(datastore_rpc.Configuration):
"""An immutable class that contains all options for fetching results.
These options apply to any request that pulls results from a query.
This class reserves the right to define configuration options of any name
except those that start with 'user_'. External subclasses should only define
function or variables with names that start with in 'user_'.
Options are set by passing keyword arguments to the constructor corresponding
to the configuration options defined below and in datastore_rpc.Configuration.
This object can be used as the default config for a datastore_rpc.Connection
but in that case some options will be ignored, see option documentation below
for details.
"""
@datastore_rpc.ConfigOption
def produce_cursors(value):
"""If a Cursor should be returned with the fetched results.
Raises:
datastore_errors.BadArgumentError if value is not a bool.
"""
if not isinstance(value, bool):
raise datastore_errors.BadArgumentError(
'produce_cursors argument should be bool (%r)' % (value,))
return value
@datastore_rpc.ConfigOption
def offset(value):
"""The number of results to skip before returning the first result.
Only applies to the first request it is used with and is ignored if present
on datastore_rpc.Connection.config.
Raises:
datastore_errors.BadArgumentError if value is not a integer or is less
than zero.
"""
datastore_types.ValidateInteger(value,
'offset',
datastore_errors.BadArgumentError,
zero_ok=True)
return value
@datastore_rpc.ConfigOption
def batch_size(value):
"""The number of results to attempt to retrieve in a batch.
Raises:
datastore_errors.BadArgumentError if value is not a integer or is not
greater than zero.
"""
datastore_types.ValidateInteger(value,
'batch_size',
datastore_errors.BadArgumentError)
return value
class QueryOptions(FetchOptions):
"""An immutable class that contains all options for running a query.
This class contains options that control execution process (deadline,
batch_size, read_policy, etc) and what part of the query results are returned
(keys_only, projection, offset, limit, etc) Options that control the contents
of the query results are specified on the datastore_query.Query directly.
This class reserves the right to define configuration options of any name
except those that start with 'user_'. External subclasses should only define
function or variables with names that start with in 'user_'.
Options are set by passing keyword arguments to the constructor corresponding
to the configuration options defined below and in FetchOptions and
datastore_rpc.Configuration.
This object can be used as the default config for a datastore_rpc.Connection
but in that case some options will be ignored, see below for details.
"""
ORDER_FIRST = datastore_pb.Query.ORDER_FIRST
ANCESTOR_FIRST = datastore_pb.Query.ANCESTOR_FIRST
FILTER_FIRST = datastore_pb.Query.FILTER_FIRST
_HINTS = frozenset([ORDER_FIRST, ANCESTOR_FIRST, FILTER_FIRST])
@datastore_rpc.ConfigOption
def keys_only(value):
"""If the query should only return keys.
Raises:
datastore_errors.BadArgumentError if value is not a bool.
"""
if not isinstance(value, bool):
raise datastore_errors.BadArgumentError(
'keys_only argument should be bool (%r)' % (value,))
return value
@datastore_rpc.ConfigOption
def projection(value):
"""A list or tuple of property names to project.
If None, the entire entity is returned.
Specifying a projection:
- may change the index requirements for the given query;
- will cause a partial entity to be returned;
- will cause only entities that contain those properties to be returned;
A partial entities only contain the property name and value for properties
in the projection (meaning and multiple will not be set). They will also
only contain a single value for any multi-valued property. However, if a
multi-valued property is specified in the order, an inequality property, or
the projected properties, the entity will be returned multiple times. Once
for each unique combination of values.
However, projection queries are significantly faster than normal queries.
Raises:
datastore_errors.BadArgumentError if value is empty or not a list or tuple
of strings.
"""
if isinstance(value, list):
value = tuple(value)
elif not isinstance(value, tuple):
raise datastore_errors.BadArgumentError(
'projection argument should be a list or tuple (%r)' % (value,))
if not value:
raise datastore_errors.BadArgumentError(
'projection argument cannot be empty')
for prop in value:
if not isinstance(prop, basestring):
raise datastore_errors.BadArgumentError(
'projection argument should contain only strings (%r)' % (prop,))
return value
@datastore_rpc.ConfigOption
def limit(value):
"""Limit on the number of results to return.
Raises:
datastore_errors.BadArgumentError if value is not an integer or is less
than zero.
"""
datastore_types.ValidateInteger(value,
'limit',
datastore_errors.BadArgumentError,
zero_ok=True)
return value
@datastore_rpc.ConfigOption
def prefetch_size(value):
"""Number of results to attempt to return on the initial request.
Raises:
datastore_errors.BadArgumentError if value is not an integer or is not
greater than zero.
"""
datastore_types.ValidateInteger(value,
'prefetch_size',
datastore_errors.BadArgumentError,
zero_ok=True)
return value
@datastore_rpc.ConfigOption
def start_cursor(value):
"""Cursor to use a start position.
Ignored if present on datastore_rpc.Connection.config.
Raises:
datastore_errors.BadArgumentError if value is not a Cursor.
"""
if not isinstance(value, Cursor):
raise datastore_errors.BadArgumentError(
'start_cursor argument should be datastore_query.Cursor (%r)' %
(value,))
return value
@datastore_rpc.ConfigOption
def end_cursor(value):
"""Cursor to use as an end position.
Ignored if present on datastore_rpc.Connection.config.
Raises:
datastore_errors.BadArgumentError if value is not a Cursor.
"""
if not isinstance(value, Cursor):
raise datastore_errors.BadArgumentError(
'end_cursor argument should be datastore_query.Cursor (%r)' %
(value,))
return value
@datastore_rpc.ConfigOption
def hint(value):
"""Hint on how the datastore should plan the query.
Raises:
datastore_errors.BadArgumentError if value is not a known hint.
"""
if value not in QueryOptions._HINTS:
raise datastore_errors.BadArgumentError('Unknown query hint (%r)' %
(value,))
return value
class Cursor(_BaseComponent):
"""An immutable class that represents a relative position in a query.
The position denoted by a Cursor is relative to a result in a query even
if the result has been removed from the given query. Usually to position
immediately after the last result returned by a batch.
A cursor should only be used on a query with an identical signature to the
one that produced it or on a query with its sort order reversed.
"""
@datastore_rpc._positional(1)
def __init__(self, urlsafe=None, _cursor_bytes=None):
"""Constructor.
A Cursor constructed with no arguments points the first result of any
query. If such a Cursor is used as an end_cursor no results will ever be
returned.
"""
super(Cursor, self).__init__()
if urlsafe is not None:
if _cursor_bytes is not None:
raise datastore_errors.BadArgumentError(
'Can only specify one of urlsafe and _cursor_bytes')
_cursor_bytes = self._urlsafe_to_bytes(urlsafe)
if _cursor_bytes is not None:
self.__cursor_bytes = _cursor_bytes
else:
self.__cursor_bytes = ''
def __repr__(self):
arg = self.to_websafe_string()
if arg:
arg = '<%s>' % arg
return '%s(%s)' % (self.__class__.__name__, arg)
def reversed(self):
"""DEPRECATED. It is no longer necessary to call reversed() on cursors.
A cursor returned by a query may also be used in a query whose sort order
has been reversed. This method returns a copy of the original cursor.
"""
return Cursor(_cursor_bytes=self.__cursor_bytes)
def to_bytes(self):
"""Serialize cursor as a byte string."""
return self.__cursor_bytes
@staticmethod
def from_bytes(cursor):
"""Gets a Cursor given its byte string serialized form.
The serialized form of a cursor may change in a non-backwards compatible
way. In this case cursors must be regenerated from a new Query request.
Args:
cursor: A serialized cursor as returned by .to_bytes.
Returns:
A Cursor.
Raises:
datastore_errors.BadValueError if the cursor argument does not represent a
serialized cursor.
"""
return Cursor(_cursor_bytes=cursor)
def urlsafe(self):
"""Serialize cursor as a websafe string.
Returns:
A base64-encoded serialized cursor.
"""
return base64.urlsafe_b64encode(self.to_bytes())
to_websafe_string = urlsafe
@staticmethod
def from_websafe_string(cursor):
"""Gets a Cursor given its websafe serialized form.
The serialized form of a cursor may change in a non-backwards compatible
way. In this case cursors must be regenerated from a new Query request.
Args:
cursor: A serialized cursor as returned by .to_websafe_string.
Returns:
A Cursor.
Raises:
datastore_errors.BadValueError if the cursor argument is not a string
type of does not represent a serialized cursor.
"""
decoded_bytes = Cursor._urlsafe_to_bytes(cursor)
return Cursor.from_bytes(decoded_bytes)
@staticmethod
def _urlsafe_to_bytes(cursor):
if not isinstance(cursor, basestring):
raise datastore_errors.BadValueError(
'cursor argument should be str or unicode (%r)' % (cursor,))
try:
decoded_bytes = base64.b64decode(
str(cursor).replace('-', '+').replace('_', '/'))
except (ValueError, TypeError), e:
raise datastore_errors.BadValueError(
'Invalid cursor %s. Details: %s' % (cursor, e))
return decoded_bytes
def advance(self, offset, query, conn):
"""Advances a Cursor by the given offset.
Args:
offset: The amount to advance the current query.
query: A Query identical to the one this cursor was created from.
conn: The datastore_rpc.Connection to use.
Returns:
A new cursor that is advanced by offset using the given query.
"""
datastore_types.ValidateInteger(offset,
'offset',
datastore_errors.BadArgumentError)
if not isinstance(query, Query):
raise datastore_errors.BadArgumentError(
'query argument should be datastore_query.Query (%r)' % (query,))
query_options = QueryOptions(
start_cursor=self, offset=offset, limit=0, produce_cursors=True)
return query.run(conn, query_options).next_batch(
Batcher.AT_LEAST_OFFSET).cursor(0)
def __setstate__(self, state):
if '_Cursor__compiled_cursor' in state:
self.__cursor_bytes = state['_Cursor__compiled_cursor'].Encode()
else:
self.__dict__ = state
class _QueryKeyFilter(_BaseComponent):
"""A class that implements the key filters available on a Query."""
@datastore_rpc._positional(1)
def __init__(self, app=None, namespace=None, kind=None, ancestor=None):
"""Constructs a _QueryKeyFilter.
If app/namespace and ancestor are not defined, the app/namespace set in the
environment is used.
Args:
app: a string representing the required app id or None.
namespace: a string representing the required namespace or None.
kind: a string representing the required kind or None.
ancestor: a entity_pb.Reference representing the required ancestor or
None.
Raises:
datastore_erros.BadArgumentError if app and ancestor.app() do not match or
an unexpected type is passed in for any argument.
"""
if kind is not None:
datastore_types.ValidateString(
kind, 'kind', datastore_errors.BadArgumentError)
if ancestor is not None:
if not isinstance(ancestor, entity_pb.Reference):
raise datastore_errors.BadArgumentError(
'ancestor argument should be entity_pb.Reference (%r)' %
(ancestor,))
if app is None:
app = ancestor.app()
elif app != ancestor.app():
raise datastore_errors.BadArgumentError(
'ancestor argument should match app ("%r" != "%r")' %
(ancestor.app(), app))
if namespace is None:
namespace = ancestor.name_space()
elif namespace != ancestor.name_space():
raise datastore_errors.BadArgumentError(
'ancestor argument should match namespace ("%r" != "%r")' %
(ancestor.name_space(), namespace))
pb = entity_pb.Reference()
pb.CopyFrom(ancestor)
ancestor = pb
self.__ancestor = ancestor
self.__path = ancestor.path().element_list()
else:
self.__ancestor = None
self.__path = None
super(_QueryKeyFilter, self).__init__()
self.__app = datastore_types.ResolveAppId(app).encode('utf-8')
self.__namespace = (
datastore_types.ResolveNamespace(namespace).encode('utf-8'))
self.__kind = kind and kind.encode('utf-8')
@property
def app(self):
return self.__app
@property
def namespace(self):
return self.__namespace
@property
def kind(self):
return self.__kind
@property
def ancestor(self):
return self.__ancestor
def __call__(self, entity_or_reference):
"""Apply the filter.
Accepts either an entity or a reference to avoid the need to extract keys
from entities when we have a list of entities (which is a common case).
Args:
entity_or_reference: Either an entity_pb.EntityProto or
entity_pb.Reference.
"""
if isinstance(entity_or_reference, entity_pb.Reference):
key = entity_or_reference
elif isinstance(entity_or_reference, entity_pb.EntityProto):
key = entity_or_reference.key()
else:
raise datastore_errors.BadArgumentError(
'entity_or_reference argument must be an entity_pb.EntityProto ' +
'or entity_pb.Reference (%r)' % (entity_or_reference))
return (key.app() == self.__app and
key.name_space() == self.__namespace and
(not self.__kind or
key.path().element_list()[-1].type() == self.__kind) and
(not self.__path or
key.path().element_list()[0:len(self.__path)] == self.__path))
def _to_pb(self):
"""Returns an internal pb representation."""
pb = datastore_pb.Query()
pb.set_app(self.__app)
datastore_types.SetNamespace(pb, self.__namespace)
if self.__kind is not None:
pb.set_kind(self.__kind)
if self.__ancestor:
ancestor = pb.mutable_ancestor()
ancestor.CopyFrom(self.__ancestor)
return pb
def _to_pb_v1(self, adapter):
"""Returns a v1 internal proto representation of the query key filter.
Args:
adapter: A datastore_rpc.AbstractAdapter.
Returns:
A tuple (googledatastore.RunQueryRequest, googledatastore.Filter).
The second tuple value is a Filter representing the ancestor portion of the
query. If there is no ancestor constraint, this value will be None
"""
pb = googledatastore.RunQueryRequest()
partition_id = pb.partition_id
partition_id.project_id = (
adapter.get_entity_converter().app_to_project_id(self.__app))
if self.__namespace:
partition_id.namespace_id = self.__namespace
if self.__kind is not None:
pb.query.kind.add().name = self.__kind
ancestor_filter = None
if self.__ancestor:
ancestor_filter = googledatastore.Filter()
ancestor_prop_filter = ancestor_filter.property_filter
ancestor_prop_filter.op = (
googledatastore.PropertyFilter.HAS_ANCESTOR)
prop_pb = ancestor_prop_filter.property
prop_pb.name = datastore_types.KEY_SPECIAL_PROPERTY
adapter.get_entity_converter().v3_to_v1_key(
self.ancestor,
ancestor_prop_filter.value.key_value)
return pb, ancestor_filter
class _BaseQuery(_BaseComponent):
"""A base class for query implementations."""
def run(self, conn, query_options=None):
"""Runs the query using provided datastore_rpc.Connection.
Args:
conn: The datastore_rpc.Connection to use
query_options: Optional query options to use
Returns:
A Batcher that implicitly fetches query results asynchronously.
Raises:
datastore_errors.BadArgumentError if any of the arguments are invalid.
"""
return Batcher(query_options, self.run_async(conn, query_options))
def run_async(self, conn, query_options=None):
"""Runs the query using the provided datastore_rpc.Connection.
Args:
conn: the datastore_rpc.Connection on which to run the query.
query_options: Optional QueryOptions with which to run the query.
Returns:
An async object that can be used to grab the first Batch. Additional
batches can be retrieved by calling Batch.next_batch/next_batch_async.
Raises:
datastore_errors.BadArgumentError if any of the arguments are invalid.
"""
raise NotImplementedError
def __getstate__(self):
raise pickle.PicklingError(
'Pickling of %r is unsupported.' % self)
class Query(_BaseQuery):
"""An immutable class that represents a query signature.
A query signature consists of a source of entities (specified as app,
namespace and optionally kind and ancestor) as well as a FilterPredicate,
grouping and a desired ordering.
"""
@datastore_rpc._positional(1)
def __init__(self, app=None, namespace=None, kind=None, ancestor=None,
filter_predicate=None, group_by=None, order=None):
"""Constructor.
Args:
app: Optional app to query, derived from the environment if not specified.
namespace: Optional namespace to query, derived from the environment if
not specified.
kind: Optional kind to query.
ancestor: Optional ancestor to query, an entity_pb.Reference.
filter_predicate: Optional FilterPredicate by which to restrict the query.
order: Optional Order in which to return results.
group_by: Optional list of properties to group the results by.
Raises:
datastore_errors.BadArgumentError if any argument is invalid.
"""
super(Query, self).__init__()
if filter_predicate is not None and not isinstance(filter_predicate,
FilterPredicate):
raise datastore_errors.BadArgumentError(
'filter_predicate should be datastore_query.FilterPredicate (%r)' %
(filter_predicate,))
if isinstance(order, CompositeOrder):
if order.size() == 0:
order = None
elif isinstance(order, Order):
order = CompositeOrder([order])
elif order is not None:
raise datastore_errors.BadArgumentError(
'order should be Order (%r)' % (order,))
if group_by is not None:
if isinstance(group_by, list):
group_by = tuple(group_by)
elif not isinstance(group_by, tuple):
raise datastore_errors.BadArgumentError(
'group_by argument should be a list or tuple (%r)' % (group_by,))
if not group_by:
raise datastore_errors.BadArgumentError(
'group_by argument cannot be empty')
for prop in group_by:
if not isinstance(prop, basestring):
raise datastore_errors.BadArgumentError(
'group_by argument should contain only strings (%r)' % (prop,))
self._key_filter = _QueryKeyFilter(app=app, namespace=namespace, kind=kind,
ancestor=ancestor)
self._order = order
self._filter_predicate = filter_predicate
self._group_by = group_by
@property
def app(self):
return self._key_filter.app
@property
def namespace(self):
return self._key_filter.namespace
@property
def kind(self):
return self._key_filter.kind
@property
def ancestor(self):
return self._key_filter.ancestor
@property
def filter_predicate(self):
return self._filter_predicate
@property
def order(self):
return self._order
@property
def group_by(self):
return self._group_by
def __repr__(self):
args = []
args.append('app=%r' % self.app)
ns = self.namespace
if ns:
args.append('namespace=%r' % ns)
kind = self.kind
if kind is not None:
args.append('kind=%r' % kind)
ancestor = self.ancestor
if ancestor is not None:
websafe = base64.urlsafe_b64encode(ancestor.Encode())
args.append('ancestor=<%s>' % websafe)
filter_predicate = self.filter_predicate
if filter_predicate is not None:
args.append('filter_predicate=%r' % filter_predicate)
order = self.order
if order is not None:
args.append('order=%r' % order)
group_by = self.group_by
if group_by is not None:
args.append('group_by=%r' % (group_by,))
return '%s(%s)' % (self.__class__.__name__, ', '.join(args))
def run_async(self, conn, query_options=None):
if not isinstance(conn, datastore_rpc.BaseConnection):
raise datastore_errors.BadArgumentError(
'conn should be a datastore_rpc.BaseConnection (%r)' % (conn,))
if not QueryOptions.is_configuration(query_options):
query_options = QueryOptions(config=query_options)
start_cursor = query_options.start_cursor
if not start_cursor and query_options.produce_cursors:
start_cursor = Cursor()
if conn._api_version == datastore_rpc._CLOUD_DATASTORE_V1:
req = self._to_pb_v1(conn, query_options)
else:
req = self._to_pb(conn, query_options)
return Batch.create_async(self, query_options, conn, req,
start_cursor=start_cursor)
@classmethod
def _from_pb(cls, query_pb):
kind = query_pb.has_kind() and query_pb.kind().decode('utf-8') or None
ancestor = query_pb.has_ancestor() and query_pb.ancestor() or None
filter_predicate = None
if query_pb.filter_size() > 0:
filter_predicate = CompositeFilter(
CompositeFilter.AND,
[PropertyFilter._from_pb(filter_pb)
for filter_pb in query_pb.filter_list()])
order = None
if query_pb.order_size() > 0:
order = CompositeOrder([PropertyOrder._from_pb(order_pb)
for order_pb in query_pb.order_list()])
group_by = None
if query_pb.group_by_property_name_size() > 0:
group_by = tuple(name.decode('utf-8')
for name in query_pb.group_by_property_name_list())
return Query(app=query_pb.app().decode('utf-8'),
namespace=query_pb.name_space().decode('utf-8'),
kind=kind,
ancestor=ancestor,
filter_predicate=filter_predicate,
order=order,
group_by=group_by)
def _to_pb_v1(self, conn, query_options):
"""Returns a googledatastore.RunQueryRequest."""
v1_req, v1_ancestor_filter = self._key_filter._to_pb_v1(conn.adapter)
v1_query = v1_req.query
if self.filter_predicate:
filter_predicate_pb = self._filter_predicate._to_pb_v1(conn.adapter)
if self.filter_predicate and v1_ancestor_filter:
comp_filter_pb = v1_query.filter.composite_filter
comp_filter_pb.operator = googledatastore.CompositeFilter.AND
comp_filter_pb.filter.add().CopyFrom(filter_predicate_pb)
comp_filter_pb.filter.add().CopyFrom(v1_ancestor_filter)
elif self.filter_predicate:
v1_query.filter.CopyFrom(filter_predicate_pb)
elif v1_ancestor_filter:
v1_query.filter.CopyFrom(v1_ancestor_filter)
if self._order:
for order in self._order._to_pb_v1(conn.adapter):
v1_query.order.add().CopyFrom(order)
if QueryOptions.keys_only(query_options, conn.config):
prop_ref_pb = v1_query.projection.add().property
prop_ref_pb.name = datastore_pbs.PROPERTY_NAME_KEY
projection = QueryOptions.projection(query_options, conn.config)
self._validate_projection_and_group_by(projection, self._group_by)
if projection:
for prop in projection:
prop_ref_pb = v1_query.projection.add().property
prop_ref_pb.name = prop
if self._group_by:
for group_by in self._group_by:
v1_query.distinct_on.add().name = group_by
limit = QueryOptions.limit(query_options, conn.config)
if limit is not None:
v1_query.limit.value = limit
count = QueryOptions.batch_size(query_options, conn.config)
if count is None:
count = QueryOptions.prefetch_size(query_options, conn.config)
if count is not None:
pass
if query_options.offset:
v1_query.offset = query_options.offset
if query_options.start_cursor is not None:
v1_query.start_cursor = query_options.start_cursor.to_bytes()
if query_options.end_cursor is not None:
v1_query.end_cursor = query_options.end_cursor.to_bytes()
conn._set_request_read_policy(v1_req, query_options)
conn._set_request_transaction(v1_req)
return v1_req
def _to_pb(self, conn, query_options):
"""Returns the internal only pb representation."""
pb = self._key_filter._to_pb()
if self._filter_predicate:
for f in self._filter_predicate._to_pbs():
pb.add_filter().CopyFrom(f)
if self._order:
for order in self._order._to_pbs():
pb.add_order().CopyFrom(order)
if QueryOptions.keys_only(query_options, conn.config):
pb.set_keys_only(True)
projection = QueryOptions.projection(query_options, conn.config)
self._validate_projection_and_group_by(projection, self._group_by)
if projection:
pb.property_name_list().extend(projection)
if self._group_by:
pb.group_by_property_name_list().extend(self._group_by)
if QueryOptions.produce_cursors(query_options, conn.config):
pb.set_compile(True)
limit = QueryOptions.limit(query_options, conn.config)
if limit is not None:
pb.set_limit(limit)
count = QueryOptions.prefetch_size(query_options, conn.config)
if count is None:
count = QueryOptions.batch_size(query_options, conn.config)
if count is not None:
pb.set_count(count)
if query_options.offset:
pb.set_offset(query_options.offset)
if query_options.start_cursor is not None:
try:
pb.mutable_compiled_cursor().ParseFromString(
query_options.start_cursor.to_bytes())
except ProtocolBuffer.ProtocolBufferDecodeError:
raise datastore_errors.BadValueError('invalid cursor')
if query_options.end_cursor is not None:
try:
pb.mutable_end_compiled_cursor().ParseFromString(
query_options.end_cursor.to_bytes())
except ProtocolBuffer.ProtocolBufferDecodeError:
raise datastore_errors.BadValueError('invalid cursor')
if ((query_options.hint == QueryOptions.ORDER_FIRST and pb.order_size()) or
(query_options.hint == QueryOptions.ANCESTOR_FIRST and
pb.has_ancestor()) or
(query_options.hint == QueryOptions.FILTER_FIRST and
pb.filter_size() > 0)):
pb.set_hint(query_options.hint)
conn._set_request_read_policy(pb, query_options)
conn._set_request_transaction(pb)
return pb
def _validate_projection_and_group_by(self, projection, group_by):
"""Validates that a query's projection and group by match.
Args:
projection: A set of string property names in the projection.
group_by: A set of string property names in the group by.
Raises:
datastore_errors.BadRequestError: if the projection and group
by sets are not equal.
"""
if projection:
if group_by:
extra = set(projection) - set(group_by)
if extra:
raise datastore_errors.BadRequestError(
'projections includes properties not in the group_by argument: %s'
% extra)
elif group_by:
raise datastore_errors.BadRequestError(
'cannot specify group_by without a projection')
def apply_query(query, entities):
"""Performs the given query on a set of in-memory entities.
This function can perform queries impossible in the datastore (e.g a query
with multiple inequality filters on different properties) because all
operations are done in memory. For queries that can also be executed on the
the datastore, the results produced by this function may not use the same
implicit ordering as the datastore. To ensure compatibility, explicit
ordering must be used (e.g. 'ORDER BY ineq_prop, ..., __key__').
Order by __key__ should always be used when a consistent result is desired
(unless there is a sort order on another globally unique property).
Args:
query: a datastore_query.Query to apply
entities: a list of entity_pb.EntityProto on which to apply the query.
Returns:
A list of entity_pb.EntityProto contain the results of the query.
"""
if not isinstance(query, Query):
raise datastore_errors.BadArgumentError(
'query argument must be a datastore_query.Query (%r)' % (query,))
if not isinstance(entities, list):
raise datastore_errors.BadArgumentError(
'entities argument must be a list (%r)' % (entities,))
filtered_entities = filter(query._key_filter, entities)
if not query._order:
if query._filter_predicate:
return filter(query._filter_predicate, filtered_entities)
return filtered_entities
names = query._order._get_prop_names()
if query._filter_predicate:
names |= query._filter_predicate._get_prop_names()
exists_filter = _PropertyExistsFilter(names)
value_maps = []
for entity in filtered_entities:
value_map = _make_key_value_map(entity, names)
if exists_filter._apply(value_map) and (
not query._filter_predicate or
query._filter_predicate._prune(value_map)):
value_map['__entity__'] = entity
value_maps.append(value_map)
value_maps.sort(query._order._cmp)
return [value_map['__entity__'] for value_map in value_maps]
class _AugmentedQuery(_BaseQuery):
"""A query that combines a datastore query with in-memory filters/results."""
@datastore_rpc._positional(2)
def __init__(self, query, in_memory_results=None, in_memory_filter=None,
max_filtered_count=None):
"""Constructor for _AugmentedQuery.
Do not call directly. Use the utility functions instead (e.g.
datastore_query.inject_results)
Args:
query: A datastore_query.Query object to augment.
in_memory_results: a list of pre- sorted and filtered result to add to the
stream of datastore results or None .
in_memory_filter: a set of in-memory filters to apply to the datastore
results or None.
max_filtered_count: the maximum number of datastore entities that will be
filtered out by in_memory_filter if known.
"""
if not isinstance(query, Query):
raise datastore_errors.BadArgumentError(
'query argument should be datastore_query.Query (%r)' % (query,))
if (in_memory_filter is not None and
not isinstance(in_memory_filter, FilterPredicate)):
raise datastore_errors.BadArgumentError(
'in_memory_filter argument should be ' +
'datastore_query.FilterPredicate (%r)' % (in_memory_filter,))
if (in_memory_results is not None and
not isinstance(in_memory_results, list)):
raise datastore_errors.BadArgumentError(
'in_memory_results argument should be a list of' +
'datastore_pv.EntityProto (%r)' % (in_memory_results,))
datastore_types.ValidateInteger(max_filtered_count,
'max_filtered_count',
empty_ok=True,
zero_ok=True)
self._query = query
self._max_filtered_count = max_filtered_count
self._in_memory_filter = in_memory_filter
self._in_memory_results = in_memory_results
@property
def app(self):
return self._query._key_filter.app
@property
def namespace(self):
return self._query._key_filter.namespace
@property
def kind(self):
return self._query._key_filter.kind
@property
def ancestor(self):
return self._query._key_filter.ancestor
@property
def filter_predicate(self):
return self._query._filter_predicate
@property
def order(self):
return self._query._order
@property
def group_by(self):
return self._query._group_by
def run_async(self, conn, query_options=None):
if not isinstance(conn, datastore_rpc.BaseConnection):
raise datastore_errors.BadArgumentError(
'conn should be a datastore_rpc.BaseConnection (%r)' % (conn,))
if not QueryOptions.is_configuration(query_options):
query_options = QueryOptions(config=query_options)
if self._query._order:
changes = {'keys_only': False}
else:
changes = {}
if self._in_memory_filter or self._in_memory_results:
in_memory_offset = query_options.offset
in_memory_limit = query_options.limit
if in_memory_limit is not None:
if self._in_memory_filter is None:
changes['limit'] = in_memory_limit
elif self._max_filtered_count is not None:
changes['limit'] = in_memory_limit + self._max_filtered_count
else:
changes['limit'] = None
if in_memory_offset:
changes['offset'] = None
if changes.get('limit', None) is not None:
changes['limit'] += in_memory_offset
else:
in_memory_offset = None
else:
in_memory_offset = None
in_memory_limit = None
modified_query_options = QueryOptions(config=query_options, **changes)
if conn._api_version == datastore_rpc._CLOUD_DATASTORE_V1:
req = self._query._to_pb_v1(conn, modified_query_options)
else:
req = self._query._to_pb(conn, modified_query_options)
start_cursor = query_options.start_cursor
if not start_cursor and query_options.produce_cursors:
start_cursor = Cursor()
return _AugmentedBatch.create_async(self, modified_query_options, conn, req,
in_memory_offset=in_memory_offset,
in_memory_limit=in_memory_limit,
start_cursor=start_cursor)
@datastore_rpc._positional(1)
def inject_results(query, updated_entities=None, deleted_keys=None):
"""Creates a query object that will inject changes into results.
Args:
query: The datastore_query.Query to augment
updated_entities: A list of entity_pb.EntityProto's that have been updated
and should take priority over any values returned by query.
deleted_keys: A list of entity_pb.Reference's for entities that have been
deleted and should be removed from query results.
Returns:
A datastore_query.AugmentedQuery if in memory filtering is required,
query otherwise.
"""
if not isinstance(query, Query):
raise datastore_errors.BadArgumentError(
'query argument should be datastore_query.Query (%r)' % (query,))
overridden_keys = set()
if deleted_keys is not None:
if not isinstance(deleted_keys, list):
raise datastore_errors.BadArgumentError(
'deleted_keys argument must be a list (%r)' % (deleted_keys,))
deleted_keys = filter(query._key_filter, deleted_keys)
for key in deleted_keys:
overridden_keys.add(datastore_types.ReferenceToKeyValue(key))
if updated_entities is not None:
if not isinstance(updated_entities, list):
raise datastore_errors.BadArgumentError(
'updated_entities argument must be a list (%r)' % (updated_entities,))
updated_entities = filter(query._key_filter, updated_entities)
for entity in updated_entities:
overridden_keys.add(datastore_types.ReferenceToKeyValue(entity.key()))
updated_entities = apply_query(query, updated_entities)
else:
updated_entities = []
if not overridden_keys:
return query
return _AugmentedQuery(query,
in_memory_filter=_IgnoreFilter(overridden_keys),
in_memory_results=updated_entities,
max_filtered_count=len(overridden_keys))
class _BatchShared(object):
"""Data shared among the batches of a query."""
def __init__(self, query, query_options, conn,
augmented_query=None, initial_offset=None):
self.__query = query
self.__query_options = query_options
self.__conn = conn
self.__augmented_query = augmented_query
self.__was_first_result_processed = False
if initial_offset is None:
initial_offset = query_options.offset or 0
self.__expected_offset = initial_offset
self.__remaining_limit = query_options.limit
@property
def query(self):
return self.__query
@property
def query_options(self):
return self.__query_options
@property
def conn(self):
return self.__conn
@property
def augmented_query(self):
return self.__augmented_query
@property
def keys_only(self):
return self.__keys_only
@property
def compiled_query(self):
return self.__compiled_query
@property
def expected_offset(self):
return self.__expected_offset
@property
def remaining_limit(self):
return self.__remaining_limit
@property
def index_list(self):
"""Returns the list of indexes used by the query.
Possibly None when the adapter does not implement pb_to_index.
"""
return self.__index_list
def process_batch(self, batch):
if self.conn._api_version == datastore_rpc._CLOUD_DATASTORE_V1:
skipped_results = batch.skipped_results
num_results = len(batch.entity_results)
else:
skipped_results = batch.skipped_results()
num_results = batch.result_size()
self.__expected_offset -= skipped_results
if self.__remaining_limit is not None:
self.__remaining_limit -= num_results
if not self.__was_first_result_processed:
self.__was_first_result_processed = True
if self.conn._api_version == datastore_rpc._CLOUD_DATASTORE_V1:
result_type = batch.entity_result_type
self.__keys_only = result_type == googledatastore.EntityResult.KEY_ONLY
self.__compiled_query = None
self.__index_list = None
else:
self.__keys_only = batch.keys_only()
if batch.has_compiled_query():
self.__compiled_query = batch.compiled_query
else:
self.__compiled_query = None
try:
self.__index_list = [self.__conn.adapter.pb_to_index(index_pb)
for index_pb in batch.index_list()]
except NotImplementedError:
self.__index_list = None
class Batch(object):
"""A batch of results returned by a query.
This class contains a batch of results returned from the datastore and
relevant metadata. This metadata includes:
query: The query that produced this batch
query_options: The QueryOptions used to run the query. This does not
contained any options passed to the .next_batch() call that created the
current batch.
start_cursor, end_cursor: These are the cursors that can be used
with a query to re-fetch this batch. They can also be used to
find all entities before or after the given batch (by use start_cursor as
an end cursor or vice versa). start_cursor can also be advanced to
point to a position within the batch using Cursor.advance().
skipped_results: the number of result skipped because of the offset
given to the request that generated it. This can be set either on
the original Query.run() request or in subsequent .next_batch() calls.
more_results: If this is true there are more results that can be retrieved
either by .next_batch() or Batcher.next().
This class is also able to fetch the next batch of the query using
.next_batch(). As batches of results must be fetched serially, .next_batch()
can only be called once. Additional calls to .next_batch() will return None.
When there are no more batches .next_batch() will return None as well. Note
that batches returned by iterating over Batcher will always return None for
.next_batch() as the Bather handles fetching the next batch automatically.
A Batch typically represents the result of a single RPC request. The datastore
operates on a "best effort" basis so the batch returned by .next_batch()
or Query.run_async().get_result() may not have satisfied the requested offset
or number of results (specified through FetchOptions.offset and
FetchOptions.batch_size respectively). To satisfy these restrictions
additional batches may be needed (with FetchOptions that specify the remaining
offset or results needed). The Batcher class hides these limitations.
"""
__skipped_cursor = None
__end_cursor = None
@classmethod
@datastore_rpc._positional(5)
def create_async(cls, query, query_options, conn, req,
start_cursor):
batch_shared = _BatchShared(query, query_options, conn)
batch0 = cls(batch_shared, start_cursor=start_cursor)
return batch0._make_query_rpc_call(query_options, req)
@datastore_rpc._positional(2)
def __init__(self, batch_shared, start_cursor=Cursor()):
"""Constructor.
This class is constructed in stages (one when an RPC is sent and another
when an rpc is completed) and should not be constructed directly!!
Use Query.run_async().get_result() to create a Batch or Query.run()
to use a batcher.
This constructor does not perform verification.
Args:
batch_shared: Data shared between batches for a a single query run.
start_cursor: Optional cursor pointing before this batch.
"""
self._batch_shared = batch_shared
self.__start_cursor = start_cursor
@property
def query_options(self):
"""The QueryOptions used to retrieve the first batch."""
return self._batch_shared.query_options
@property
def query(self):
"""The query the current batch came from."""
return self._batch_shared.query
@property
def results(self):
"""A list of entities in this batch."""
return self.__results
@property
def keys_only(self):
"""Whether the entities in this batch only contain keys."""
return self._batch_shared.keys_only
@property
def index_list(self):
"""Returns the list of indexes used to peform this batch's query.
Possibly None when the adapter does not implement pb_to_index.
"""
return self._batch_shared.index_list
@property
def start_cursor(self):
"""A cursor that points to the position just before the current batch."""
return self.__start_cursor
@property
def end_cursor(self):
"""A cursor that points to the position just after the current batch."""
return self.__end_cursor
@property
def skipped_results(self):
"""The number of results skipped because of an offset in the request.
An offset is satisfied before any results are returned. The start_cursor
points to the position in the query before the skipped results.
"""
return self._skipped_results
@property
def more_results(self):
"""Whether more results can be retrieved from the query."""
return self.__more_results
def next_batch(self, fetch_options=None):
"""Synchronously get the next batch or None if there are no more batches.
Args:
fetch_options: Optional fetch options to use when fetching the next batch.
Merged with both the fetch options on the original call and the
connection.
Returns:
A new Batch of results or None if either the next batch has already been
fetched or there are no more results.
"""
async = self.next_batch_async(fetch_options)
if async is None:
return None
return async.get_result()
def _compiled_query(self):
return self._batch_shared.compiled_query
def cursor(self, index):
"""Gets the cursor that points just after the result at index - 1.
The index is relative to first result in .results. Since start_cursor
points to the position before the first skipped result, the range of
indexes this function supports is limited to
[-skipped_results, len(results)].
For example, using start_cursor=batch.cursor(i) and
end_cursor=batch.cursor(j) will return the results found in
batch.results[i:j]. Note that any result added in the range (i-1, j]
will appear in the new query's results.
Warning: Any index in the range (-skipped_results, 0) may cause
continuation to miss or duplicate results if outside a transaction.
Args:
index: An int, the index relative to the first result before which the
cursor should point.
Returns:
A Cursor that points to a position just after the result index - 1,
which if used as a start_cursor will cause the first result to be
batch.result[index].
"""
if not isinstance(index, (int, long)):
raise datastore_errors.BadArgumentError(
'index argument should be entity_pb.Reference (%r)' % (index,))
if not -self._skipped_results <= index <= len(self.__results):
raise datastore_errors.BadArgumentError(
'index argument must be in the inclusive range [%d, %d]' %
(-self._skipped_results, len(self.__results)))
if index == -self._skipped_results:
return self.__start_cursor
elif (index == 0 and
self.__skipped_cursor):
return self.__skipped_cursor
elif index > 0 and self.__result_cursors:
return self.__result_cursors[index - 1]
elif index == len(self.__results):
return self.__end_cursor
else:
return self.__start_cursor.advance(index + self._skipped_results,
self._batch_shared.query,
self._batch_shared.conn)
def next_batch_async(self, fetch_options=None):
"""Asynchronously get the next batch or None if there are no more batches.
Args:
fetch_options: Optional fetch options to use when fetching the next batch.
Merged with both the fetch options on the original call and the
connection.
Returns:
An async object that can be used to get the next Batch or None if either
the next batch has already been fetched or there are no more results.
"""
if not self.__datastore_cursor:
return None
fetch_options, next_batch = self._make_next_batch(fetch_options)
if (fetch_options is not None and
not FetchOptions.is_configuration(fetch_options)):
raise datastore_errors.BadArgumentError('Invalid fetch options.')
config = self._batch_shared.query_options.merge(fetch_options)
conn = next_batch._batch_shared.conn
requested_offset = 0
if fetch_options is not None and fetch_options.offset is not None:
requested_offset = fetch_options.offset
if conn._api_version == datastore_rpc._CLOUD_DATASTORE_V1:
if self._batch_shared.expected_offset != requested_offset:
raise datastore_errors.BadArgumentError(
'Cannot request the next batch with a different offset than '
' expected. Expected: %s, Got: %s.'
% (self._batch_shared.expected_offset, requested_offset))
limit = self._batch_shared.remaining_limit
next_options = QueryOptions(offset=self._batch_shared.expected_offset,
limit=limit,
start_cursor=self.__datastore_cursor)
config = config.merge(next_options)
result = next_batch._make_query_rpc_call(
config,
self._batch_shared.query._to_pb_v1(conn, config))
else:
result = next_batch._make_next_rpc_call(config,
self._to_pb(fetch_options))
self.__datastore_cursor = None
return result
def _to_pb(self, fetch_options=None):
req = datastore_pb.NextRequest()
if FetchOptions.produce_cursors(fetch_options,
self._batch_shared.query_options,
self._batch_shared.conn.config):
req.set_compile(True)
count = FetchOptions.batch_size(fetch_options,
self._batch_shared.query_options,
self._batch_shared.conn.config)
if count is not None:
req.set_count(count)
if fetch_options is not None and fetch_options.offset:
req.set_offset(fetch_options.offset)
req.mutable_cursor().CopyFrom(self.__datastore_cursor)
return req
def _extend(self, next_batch):
"""Combines the current batch with the next one. Called by batcher."""
self.__datastore_cursor = next_batch.__datastore_cursor
next_batch.__datastore_cursor = None
self.__more_results = next_batch.__more_results
if not self.__results:
self.__skipped_cursor = next_batch.__skipped_cursor
self.__results.extend(next_batch.__results)
self.__result_cursors.extend(next_batch.__result_cursors)
self.__end_cursor = next_batch.__end_cursor
self._skipped_results += next_batch._skipped_results
def _make_query_rpc_call(self, config, req):
"""Makes a RunQuery call that will modify the instance.
Args:
config: The datastore_rpc.Configuration to use for the call.
req: The request to send with the call.
Returns:
A UserRPC object that can be used to fetch the result of the RPC.
"""
_api_version = self._batch_shared.conn._api_version
if _api_version == datastore_rpc._CLOUD_DATASTORE_V1:
return self._batch_shared.conn._make_rpc_call(
config, 'RunQuery', req, googledatastore.RunQueryResponse(),
self.__v1_run_query_response_hook)
return self._batch_shared.conn._make_rpc_call(config, 'RunQuery', req,
datastore_pb.QueryResult(),
self.__query_result_hook)
def _make_next_rpc_call(self, config, req):
"""Makes a Next call that will modify the instance.
Args:
config: The datastore_rpc.Configuration to use for the call.
req: The request to send with the call.
Returns:
A UserRPC object that can be used to fetch the result of the RPC.
"""
return self._batch_shared.conn._make_rpc_call(config, 'Next', req,
datastore_pb.QueryResult(),
self.__query_result_hook)
_need_index_header = 'The suggested index for this query is:'
def __v1_run_query_response_hook(self, rpc):
try:
self._batch_shared.conn.check_rpc_success(rpc)
except datastore_errors.NeedIndexError:
raise
batch = rpc.response.batch
self._batch_shared.process_batch(batch)
if batch.skipped_cursor:
self.__skipped_cursor = Cursor(_cursor_bytes=batch.skipped_cursor)
self.__result_cursors = [Cursor(_cursor_bytes=result.cursor)
for result in batch.entity_results
if result.cursor]
if batch.end_cursor:
self.__end_cursor = Cursor(_cursor_bytes=batch.end_cursor)
self._skipped_results = batch.skipped_results
if batch.more_results == googledatastore.QueryResultBatch.NOT_FINISHED:
self.__more_results = True
self.__datastore_cursor = self.__end_cursor or self.__skipped_cursor
else:
self._end()
self.__results = self._process_v1_results(batch.entity_results)
return self
def __query_result_hook(self, rpc):
"""Internal method used as get_result_hook for RunQuery/Next operation."""
try:
self._batch_shared.conn.check_rpc_success(rpc)
except datastore_errors.NeedIndexError, exc:
if isinstance(rpc.request, datastore_pb.Query):
_, kind, ancestor, props = datastore_index.CompositeIndexForQuery(
rpc.request)
props = datastore_index.GetRecommendedIndexProperties(props)
yaml = datastore_index.IndexYamlForQuery(kind, ancestor, props)
xml = datastore_index.IndexXmlForQuery(kind, ancestor, props)
raise datastore_errors.NeedIndexError(
'\n'.join([str(exc), self._need_index_header, yaml]),
original_message=str(exc), header=self._need_index_header,
yaml_index=yaml, xml_index=xml)
raise
query_result = rpc.response
self._batch_shared.process_batch(query_result)
if query_result.has_skipped_results_compiled_cursor():
self.__skipped_cursor = Cursor(
_cursor_bytes=query_result.skipped_results_compiled_cursor().Encode())
self.__result_cursors = [Cursor(_cursor_bytes=result.Encode())
for result in
query_result.result_compiled_cursor_list()]
if query_result.has_compiled_cursor():
self.__end_cursor = Cursor(
_cursor_bytes=query_result.compiled_cursor().Encode())
self._skipped_results = query_result.skipped_results()
if query_result.more_results():
self.__datastore_cursor = query_result.cursor()
self.__more_results = True
else:
self._end()
self.__results = self._process_results(query_result.result_list())
return self
def _end(self):
"""Changes the internal state so that no more batches can be produced."""
self.__datastore_cursor = None
self.__more_results = False
def _make_next_batch(self, fetch_options):
"""Creates the object to store the next batch.
Args:
fetch_options: The datastore_query.FetchOptions passed in by the user or
None.
Returns:
A tuple containing the fetch options that should be used internally and
the object that should be used to contain the next batch.
"""
return fetch_options, Batch(self._batch_shared,
start_cursor=self.__end_cursor)
def _process_results(self, results):
"""Converts the datastore results into results returned to the user.
Args:
results: A list of entity_pb.EntityProto's returned by the datastore
Returns:
A list of results that should be returned to the user.
"""
converter = self._batch_shared.conn.adapter.pb_to_query_result
return [converter(result, self._batch_shared.query_options)
for result in results]
def _process_v1_results(self, results):
"""Converts the datastore results into results returned to the user.
Args:
results: A list of googledatastore.EntityResults.
Returns:
A list of results that should be returned to the user.
"""
converter = self._batch_shared.conn.adapter.pb_v1_to_query_result
return [converter(result.entity, self._batch_shared.query_options)
for result in results]
def __getstate__(self):
raise pickle.PicklingError(
'Pickling of datastore_query.Batch is unsupported.')
class _AugmentedBatch(Batch):
"""A batch produced by a datastore_query._AugmentedQuery."""
@classmethod
@datastore_rpc._positional(5)
def create_async(cls, augmented_query, query_options, conn, req,
in_memory_offset, in_memory_limit, start_cursor):
initial_offset = 0 if in_memory_offset is not None else None
batch_shared = _BatchShared(augmented_query._query,
query_options,
conn,
augmented_query,
initial_offset=initial_offset)
batch0 = cls(batch_shared,
in_memory_offset=in_memory_offset,
in_memory_limit=in_memory_limit,
start_cursor=start_cursor)
return batch0._make_query_rpc_call(query_options, req)
@datastore_rpc._positional(2)
def __init__(self, batch_shared,
in_memory_offset=None,
in_memory_limit=None,
next_index=0,
start_cursor=Cursor()):
"""A Constructor for datastore_query._AugmentedBatch.
Constructed by datastore_query._AugmentedQuery. Should not be called
directly.
"""
super(_AugmentedBatch, self).__init__(batch_shared,
start_cursor=start_cursor)
self.__in_memory_offset = in_memory_offset
self.__in_memory_limit = in_memory_limit
self.__next_index = next_index
@property
def query(self):
"""The query the current batch came from."""
return self._batch_shared.augmented_query
def cursor(self, index):
raise NotImplementedError
def _extend(self, next_batch):
super(_AugmentedBatch, self)._extend(next_batch)
self.__in_memory_limit = next_batch.__in_memory_limit
self.__in_memory_offset = next_batch.__in_memory_offset
self.__next_index = next_batch.__next_index
def _process_v1_results(self, results):
"""Process V4 results by converting to V3 and calling _process_results."""
v3_results = []
is_projection = bool(self.query_options.projection)
for v1_result in results:
v3_entity = entity_pb.EntityProto()
self._batch_shared.conn.adapter.get_entity_converter().v1_to_v3_entity(
v1_result.entity, v3_entity, is_projection)
v3_results.append(v3_entity)
return self._process_results(v3_results)
def _process_results(self, results):
in_memory_filter = self._batch_shared.augmented_query._in_memory_filter
if in_memory_filter:
results = filter(in_memory_filter, results)
in_memory_results = self._batch_shared.augmented_query._in_memory_results
if in_memory_results and self.__next_index < len(in_memory_results):
original_query = super(_AugmentedBatch, self).query
if original_query._order:
if results:
next_result = in_memory_results[self.__next_index]
next_key = original_query._order.key(next_result)
i = 0
while i < len(results):
result = results[i]
result_key = original_query._order.key(result)
while next_key <= result_key:
results.insert(i, next_result)
i += 1
self.__next_index += 1
if self.__next_index >= len(in_memory_results):
break
next_result = in_memory_results[self.__next_index]
next_key = original_query._order.key(next_result)
i += 1
elif results or not super(_AugmentedBatch, self).more_results:
results = in_memory_results + results
self.__next_index = len(in_memory_results)
if self.__in_memory_offset:
assert not self._skipped_results
offset = min(self.__in_memory_offset, len(results))
if offset:
self._skipped_results += offset
self.__in_memory_offset -= offset
results = results[offset:]
if self.__in_memory_limit is not None:
results = results[:self.__in_memory_limit]
self.__in_memory_limit -= len(results)
if self.__in_memory_limit <= 0:
self._end()
return super(_AugmentedBatch, self)._process_results(results)
def _make_next_batch(self, fetch_options):
in_memory_offset = FetchOptions.offset(fetch_options)
augmented_query = self._batch_shared.augmented_query
if in_memory_offset and (augmented_query._in_memory_filter or
augmented_query._in_memory_results):
fetch_options = FetchOptions(offset=0)
else:
in_memory_offset = None
return (fetch_options,
_AugmentedBatch(self._batch_shared,
in_memory_offset=in_memory_offset,
in_memory_limit=self.__in_memory_limit,
start_cursor=self.end_cursor,
next_index=self.__next_index))
class Batcher(object):
"""A class that implements the Iterator interface for Batches.
Typically constructed by a call to Query.run().
The class hides the "best effort" nature of the datastore by potentially
making multiple requests to the datastore and merging the resulting batches.
This is accomplished efficiently by prefetching results and mixing both
non-blocking and blocking calls to the datastore as needed.
Iterating through batches is almost always more efficient than pulling all
results at once as RPC latency is hidden by asynchronously prefetching
results.
The batches produce by this class cannot be used to fetch the next batch
(through Batch.next_batch()) as before the current batch is returned the
request for the next batch has already been sent.
"""
ASYNC_ONLY = None
AT_LEAST_OFFSET = 0
AT_LEAST_ONE = object()
def __init__(self, query_options, first_async_batch):
"""Constructor.
Although this class can be manually constructed, it is preferable to use
Query.run(query_options).
Args:
query_options: The QueryOptions used to create the first batch.
first_async_batch: The first batch produced by
Query.run_async(query_options).
"""
self.__next_batch = first_async_batch
self.__initial_offset = QueryOptions.offset(query_options) or 0
self.__skipped_results = 0
def next(self):
"""Get the next batch. See .next_batch()."""
return self.next_batch(self.AT_LEAST_ONE)
def next_batch(self, min_batch_size):
"""Get the next batch.
The batch returned by this function cannot be used to fetch the next batch
(through Batch.next_batch()). Instead this function will always return None.
To retrieve the next batch use .next() or .next_batch(N).
This function may return a batch larger than min_to_fetch, but will never
return smaller unless there are no more results.
Special values can be used for min_batch_size:
ASYNC_ONLY - Do not perform any synchrounous fetches from the datastore
even if the this produces a batch with no results.
AT_LEAST_OFFSET - Only pull enough results to satifiy the offset.
AT_LEAST_ONE - Pull batches until at least one result is returned.
Args:
min_batch_size: The minimum number of results to retrieve or one of
(ASYNC_ONLY, AT_LEAST_OFFSET, AT_LEAST_ONE)
Returns:
The next Batch of results.
"""
if min_batch_size in (Batcher.ASYNC_ONLY, Batcher.AT_LEAST_OFFSET,
Batcher.AT_LEAST_ONE):
exact = False
else:
exact = True
datastore_types.ValidateInteger(min_batch_size,
'min_batch_size',
datastore_errors.BadArgumentError)
if not self.__next_batch:
raise StopIteration
batch = self.__next_batch.get_result()
self.__next_batch = None
self.__skipped_results += batch.skipped_results
if min_batch_size is not Batcher.ASYNC_ONLY:
if min_batch_size is Batcher.AT_LEAST_ONE:
min_batch_size = 1
needed_results = min_batch_size - len(batch.results)
while (batch.more_results and
(self.__skipped_results < self.__initial_offset or
needed_results > 0)):
if batch.query_options.batch_size:
batch_size = max(batch.query_options.batch_size, needed_results)
elif exact:
batch_size = needed_results
else:
batch_size = None
self.__next_batch = batch.next_batch_async(FetchOptions(
offset=max(0, self.__initial_offset - self.__skipped_results),
batch_size=batch_size))
next_batch = self.__next_batch.get_result()
self.__next_batch = None
self.__skipped_results += next_batch.skipped_results
needed_results = max(0, needed_results - len(next_batch.results))
batch._extend(next_batch)
self.__next_batch = batch.next_batch_async()
return batch
def __getstate__(self):
raise pickle.PicklingError(
'Pickling of datastore_query.Batcher is unsupported.')
def __iter__(self):
return self
class ResultsIterator(object):
"""An iterator over the results from Batches obtained from a Batcher.
ResultsIterator implements Python's iterator protocol, so results can be
accessed with the for-statement:
> it = ResultsIterator(Query(kind='Person').run())
> for person in it:
> print 'Hi, %s!' % person['name']
At any time ResultsIterator.cursor() can be used to grab the Cursor that
points just after the last result returned by the iterator.
"""
__current_batch = None
__current_pos = 0
__last_cursor = None
def __init__(self, batcher):
"""Constructor.
Args:
batcher: A datastore_query.Batcher
"""
if not isinstance(batcher, Batcher):
raise datastore_errors.BadArgumentError(
'batcher argument should be datastore_query.Batcher (%r)' %
(batcher,))
self.__batcher = batcher
def index_list(self):
"""Returns the list of indexes used to perform the query.
Possibly None when the adapter does not implement pb_to_index.
"""
return self._ensure_current_batch().index_list
def cursor(self):
"""Returns a cursor that points just after the last result returned.
If next() throws an exception, this function returns the end_cursor from
the last successful batch or throws the same exception if no batch was
successful.
"""
return (self.__last_cursor or
self._ensure_current_batch().cursor(self.__current_pos))
def _ensure_current_batch(self):
if not self.__current_batch:
self.__current_batch = self.__batcher.next_batch(Batcher.AT_LEAST_OFFSET)
self.__current_pos = 0
return self.__current_batch
def _compiled_query(self):
"""Returns the compiled query associated with the iterator.
Internal only do not use.
"""
return self._ensure_current_batch()._compiled_query()
def next(self):
"""Returns the next query result."""
while (not self.__current_batch or
self.__current_pos >= len(self.__current_batch.results)):
try:
next_batch = self.__batcher.next_batch(Batcher.AT_LEAST_OFFSET)
except:
if self.__current_batch:
self.__last_cursor = self.__current_batch.end_cursor
raise
self.__current_pos = 0
self.__current_batch = next_batch
result = self.__current_batch.results[self.__current_pos]
self.__current_pos += 1
return result
def __iter__(self):
return self
| {
"content_hash": "9107fe9364155b5c6de2bd527633da19",
"timestamp": "",
"source": "github",
"line_count": 3307,
"max_line_length": 80,
"avg_line_length": 32.57332930148171,
"alnum_prop": 0.6540475306349796,
"repo_name": "gauribhoite/personfinder",
"id": "c76cd3040e08bd93d54e767341d290938cfcd39a",
"size": "108324",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "env/google_appengine/google/appengine/datastore/datastore_query.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "423"
},
{
"name": "Batchfile",
"bytes": "5005"
},
{
"name": "C",
"bytes": "413819"
},
{
"name": "CSS",
"bytes": "330448"
},
{
"name": "Emacs Lisp",
"bytes": "4733"
},
{
"name": "HTML",
"bytes": "720955"
},
{
"name": "JavaScript",
"bytes": "1072023"
},
{
"name": "Makefile",
"bytes": "16086"
},
{
"name": "PHP",
"bytes": "2582470"
},
{
"name": "Python",
"bytes": "60243792"
},
{
"name": "Shell",
"bytes": "7491"
},
{
"name": "TeX",
"bytes": "60219"
},
{
"name": "VimL",
"bytes": "5645"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>huffman: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.7.1+2 / huffman - 8.14.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
huffman
<small>
8.14.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-09-10 09:25:57 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-09-10 09:25:57 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-ocamlbuild base OCamlbuild binary and libraries distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.7.1+2 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.02.3 The OCaml compiler (virtual package)
ocaml-base-compiler 4.02.3 Official 4.02.3 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "palmskog@gmail.com"
homepage: "https://github.com/coq-community/huffman"
dev-repo: "git+https://github.com/coq-community/huffman.git"
bug-reports: "https://github.com/coq-community/huffman/issues"
doc: "https://coq-community.org/huffman/"
license: "LGPL-2.1-or-later"
synopsis: "Coq proof of the correctness of the Huffman coding algorithm"
description: """
This projects contains a Coq proof of the correctness of the Huffman coding algorithm,
as described in David A. Huffman's paper A Method for the Construction of Minimum-Redundancy
Codes, Proc. IRE, pp. 1098-1101, September 1952."""
build: [make "-j%{jobs}%"]
install: [make "install"]
depends: [
"coq" {>= "8.12" & < "8.16~"}
]
tags: [
"category:Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs of algorithms"
"category:Miscellaneous/Extracted Programs/Combinatorics"
"keyword:data compression"
"keyword:code"
"keyword:huffman tree"
"logpath:Huffman"
"date:2021-12-19"
]
authors: [
"Laurent Théry"
]
url {
src: "https://github.com/coq-community/huffman/archive/v8.14.0.tar.gz"
checksum: "sha512=fba207ccad7b605d38fde4eb1e1469a8814532b9c74e95022f3a6e4e30002a7a9451c9a28c8b735250345dbab0997522843a08e760442ccdac1040e5d5392a9e"
}
</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-huffman.8.14.0 coq.8.7.1+2</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1+2).
The following dependencies couldn't be met:
- coq-huffman -> coq >= 8.12 -> ocaml >= 4.05.0
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-huffman.8.14.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "22c25cc0ba5262d68f6f6044f6ad38f9",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 159,
"avg_line_length": 42.2,
"alnum_prop": 0.5588354773188896,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "4633307468cdde27e2aaa8e2c8c5452251458242",
"size": "7411",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.02.3-2.0.6/released/8.7.1+2/huffman/8.14.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
//
// CWUUSignUpPhonePwdViewController.m
// TestUI
//
// Created by 大新 on 2017/2/22.
// Copyright © 2017年 ColorWood. All rights reserved.
//
#import "CWUUSignUpPhonePwdViewController.h"
#import "CWUUSignUpCodeViewController.h"
#import <JKCategories.h>
@interface CWUUSignUpPhonePwdViewController ()<
CWUUCodeViewControllerDelegate
>
@property (nonatomic, strong) CWUUSignUpCodeViewController * m_signUpWithCode;
@end
@implementation CWUUSignUpPhonePwdViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"注册";
[self.m_view.m_btnConfirm setTitle:@"下一步" forState:UIControlStateNormal];
}
#pragma mark - 事件
-(BOOL) onNext{
if ([super onNext]) {
[self.navigationController pushViewController:self.m_signUpWithCode animated:YES];
}
return YES;
}
#pragma mark - 属性
-(CWUUSignUpCodeViewController*)m_signUpWithCode{
if (!_m_signUpWithCode) {
_m_signUpWithCode = [CWUUSignUpCodeViewController new];
_m_signUpWithCode.delegate = self;
_m_signUpWithCode.m_phone = [self.m_view.m_fieldPhone.text jk_trimmingWhitespace];
_m_signUpWithCode.m_pwd = [self.m_view.m_fieldPwd.text jk_trimmingWhitespace];
}
return _m_signUpWithCode;
}
#pragma mark - CWUUSignUpCodeViewController 的代理
/**
* 注册成功,需要自动返回
*/
- (void)CWUUCodeViewControllerDelegate_success{
if ([self.delegate respondsToSelector:@selector(CWUUPhonePwdViewControllerDelegate_success)]) {
[self.delegate CWUUPhonePwdViewControllerDelegate_success];
}
}
@end
| {
"content_hash": "0b90de0b93bdc752831f7387ace0877f",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 99,
"avg_line_length": 23.82089552238806,
"alnum_prop": 0.6992481203007519,
"repo_name": "gs01md/ColorfulWoodUIUser",
"id": "bc29e092eb0315363ba54ee585b15d10d0495ba3",
"size": "1649",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "TestUI/TestUI/MineUI/CWUUSignUpPhonePwdViewController.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2784"
},
{
"name": "Objective-C",
"bytes": "2395345"
},
{
"name": "Ruby",
"bytes": "1271"
},
{
"name": "Shell",
"bytes": "13674"
},
{
"name": "Swift",
"bytes": "598185"
}
],
"symlink_target": ""
} |
A chat application without servers - using only AWS Lambda, S3, DynamoDB and SNS
## Live Demo
http://lambda-chat.s3-website-us-west-2.amazonaws.com/
Please don't send a million messages through here - it does cost us money and we will turn it off if it is abused.
## How it works
<pre> ◎ ◎
◡
│(1)
│ ┏━━━━━━━━━━━━━━━━━━┓
│ ┃ ┃
│ (2) ┃ Google OAuth2 ┃ (4)
│ ┌─────────────▶┃ API ┃◀────────────┐
│ │ ┃ ┃ │
│ │ ┗━━━━━━━━━━━━━━━━━━┛ │
▼ ▼ ┏━━━━━━━━━━━━━━━━━━┓
┏━━━━━━━━━━━━━━━━━━┓ ┃ ┃
┃ ┃ (3) ┃ AWS STS ┃
┌─▶┃ Website ┃◀──────────────────────────▶┃ AWS Web ID Fed ┃
│ ┃ ┃ ┃ ┃
│ ┗━━━━━━━━━━━━━━━━━━┛ ┗━━━━━━━━━━━━━━━━━━┛
│ │
│ │ ┏━━━━━━━━━━━━━━━━━━┓
│ │ ┃ ┃
│ └───────▶┃ SNS Topic ┃
│ (5) ┃ ┃
│ ┗━━━━━━━━━━━━━━━━━━┛
│ │
│ │ ┏━━━━━━━━━━━━━━━━━━┓
│ │ ┃ ┃
│ └──────▶┃ Lambda fn1 ┃
│ (6) ┃ ┃
│ ┗━━━━━━━━━━━━━━━━━━┛
│ │
│ │ ┏━━━━━━━━━━━━━━━━━━┓
│ │ ┃ ┃
│ └─────▶┃ DynamoDB Table ┃
│ (7) ┃ ┃
│ ┗━━━━━━━━━━━━━━━━━━┛
│ │
│ ┏━━━━━━━━━━━━━━━━━━┓ │
│ ┃ ┃ │
│ ┃ Lambda fn2 ┃◀─────────┘
│ ┃ ┃ (8)
│ ┗━━━━━━━━━━━━━━━━━━┛
│ │
│ ┏━━━━━━━━━━━━━━━━━━┓ │
│ ┃ ┃ │
└────────────┃ S3 Object ┃◀─────────────┘
(10) ┃ ┃ (9)
┗━━━━━━━━━━━━━━━━━━┛
Created with Monodraw
</pre>
1. The user opens their browser and go to the website which is hosted entirely on S3
2. The user signs in with their Google account and gets back an `id_token`
3. Using AWS Web Identity Federation in the Javascript SDK, the `id_token` is sent to get temporary AWS credentials from STS.
4. STS verifies the token with Google
5. The users types in a message, hits ENTER, and the website publishes the message to an SNS Topic.
6. A Lambda function is trigged by the SNS message, which gets the contents of the message, and...
7. Stores the message in a DynamoDB table
8. The process of adding a new chat message to the DynamoDB table triggers another Lambda function. This requires the currently-in-preview DynamoDB Streams feature. This second Lambda function reads the last 20 messages from DynamoDB, and...
9. Writes them to an S3 object in JSON format
10. The website polls the S3 object every second, and updates the chat box with any new messages it finds.
## Getting Started
There is a lot involved here, but we have tried to make it as easy as possible for you to follow along.
### Get the code
git clone git@github.com:cloudnative/lambda-chat.git
cd lambda-chat
### Config
cp config.example.yml config.yml
The only thing to edit at this point is the name of the S3 bucket to put the website in as bucket names are globally unique.
s3_bucket: my-lambda-chat-bucket
### Google OAuth
To be able to use AWS Web Identity Federation, you will need to create a new Google Project and create credentials.
1. Go to: https://console.developers.google.com/project
1. Create a new project
1. Enable **Google+ API**
1. Create OAuth 2 credentials. Leave the Javascript Origin empty for now
1. Edit `config.yml` and set `google_oauth_client_id` to your Client ID
### AWS Resources
#### Prerequisites
You will need Python 2.7. On OSX using brew
brew install python
Now we need a few Python libraries
pip install -r requirements.txt
#### CloudFormation
There is a script called `resources.py` which will generate a CloudFormation template to bring up the AWS resources needed to run Lambda Chat.
You can see the template by running
./resources.py cf
If you are happy with that, the script can also launch the CloudFormation Stack. To create it in N. Virginia, run:
./resources.py launch --region=us-east-1
The script returns quickly because it is now up to CloudFormation to bring up the AWS resources. Login to the AWS Web Console and go to the CloudFormation section in that region. Select the `Lambda-Chat` stack, then click on the **Events** tab to see the progress and check for errors.
Once the stack is complete, run:
./resources.py output --region=us-east-1
and add these values to your `config.yml` file.
#### Website
The files needed to run the website need to be in S3. To get them there:
cd s3-website
./update.sh
You can run this command as many times as you like, particularly if you are editing the files to see what is happening.
The script tells you the URL of the website. Open that up in your browser.
#### Lambda functions
To help with the AWS Lambda side of things, we are using
[kappa](https://github.com/garnaat/kappa). Kappa is a CLI tool that helps with
the details of creating and managing AWS Lambda applications. You must install
kappa before proceeding. You can install it from PyPI using pip:
% pip install kappa
or you can clone the kappa repo and install locally:
% git clone git@github.com:garnaat/kappa.git
% cd kappa
% pip install -r requirements.txt
% python setup.py install
Next, you must edit the config.yml files in the lambda/sns directory and the
lambda/dynamodb directories. The config.yml files have comments which direct
you to the parts that need to be changed.
Now create the components required for the SNS->DynamoDB Lambda function:
1. cd lambda/sns
1. run ``kappa config.yml create``
1. run ``kappa config.yml invoke``. This will call the AWS Lambda function
synchronously with test data and return the log data to the console.
1. run ``kappa config.yml add_event_sources``. This will connect the SNS topic
to your AWS Lambda function.
Finally, you need to create the components requried for the DynamoDB->S3 Lambda
function:
1. cd lambda/dynamodb
1. run ``kappa config.yml create``
1. run ``kappa config.yml invoke``. This will call the AWS Lambda function
synchronously with test data and return the log data to the console.
1. run ``kappa config.yml add_event_sources``. This will connect the DynamoDB
stream to your AWS Lambda function.
### Usage
1. Go to the URL returned by the `update.sh` script, and login with your Google account.
1. Use like any other chat application :-)
## Updating
You should feel free to mess around with this and update parts of it with your own code. If you do, please [let us know](https://twitter.com/intent/tweet?text=I%20am%20having%20fun%20with%20Lambda%20Chat.%20Thanks%20@CloudNativeIO).
When you are making changes to the website, you can push them to S3 by running:
cd s3-website
./update.sh
For modifications to the AWS Lambda functions, run:
% kappa config.yml update_code
in the corresponding lambda directory.
## Clean up
Delete the CloudFormation stack
./resources.py delete --region=us-east-1
Delete the Lambda functions
% kappa config.yml delete
in the corresponding lambda directory. This will delete the AWS Lambda
function, remove the event source mappings, and delete the IAM role.
## Reading, resources and other stuff
- [AWS Web Identity Federation playground](https://web-identity-federation-playground.s3.amazonaws.com/index.html)
- [Building Dynamic Dashboards Using Lambda and DynamoDB Streams: Part 1](https://medium.com/aws-activate-startup-blog/building-dynamic-dashboards-using-lambda-and-dynamodb-streams-part-1-217e2318ae17)
- [Kappa](https://github.com/garnaat/kappa)
- [Troposphere](https://github.com/cloudtools/troposphere)
| {
"content_hash": "3b2d3c8ced1f2aabb746d7defc86b4c6",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 285,
"avg_line_length": 39.00877192982456,
"alnum_prop": 0.5480098943107713,
"repo_name": "fjpelaezm/lambda-chat",
"id": "0bf1c80d16e1cd94f9879aafe4c63b9111cc745f",
"size": "10018",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "595"
},
{
"name": "HTML",
"bytes": "37028"
},
{
"name": "JavaScript",
"bytes": "10147"
},
{
"name": "Python",
"bytes": "9442"
},
{
"name": "Shell",
"bytes": "3373"
}
],
"symlink_target": ""
} |
"""
Title: The Sequential model
Author: [fchollet](https://twitter.com/fchollet)
Date created: 2020/04/12
Last modified: 2020/04/12
Description: Complete guide to the Sequential model.
"""
"""
## Setup
"""
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
"""
## When to use a Sequential model
A `Sequential` model is appropriate for **a plain stack of layers**
where each layer has **exactly one input tensor and one output tensor**.
Schematically, the following `Sequential` model:
"""
# Define Sequential model with 3 layers
model = keras.Sequential(
[
layers.Dense(2, activation="relu", name="layer1"),
layers.Dense(3, activation="relu", name="layer2"),
layers.Dense(4, name="layer3"),
]
)
# Call model on a test input
x = tf.ones((3, 3))
y = model(x)
"""
is equivalent to this function:
"""
# Create 3 layers
layer1 = layers.Dense(2, activation="relu", name="layer1")
layer2 = layers.Dense(3, activation="relu", name="layer2")
layer3 = layers.Dense(4, name="layer3")
# Call layers on a test input
x = tf.ones((3, 3))
y = layer3(layer2(layer1(x)))
"""
A Sequential model is **not appropriate** when:
- Your model has multiple inputs or multiple outputs
- Any of your layers has multiple inputs or multiple outputs
- You need to do layer sharing
- You want non-linear topology (e.g. a residual connection, a multi-branch
model)
"""
"""
## Creating a Sequential model
You can create a Sequential model by passing a list of layers to the Sequential
constructor:
"""
model = keras.Sequential(
[
layers.Dense(2, activation="relu"),
layers.Dense(3, activation="relu"),
layers.Dense(4),
]
)
"""
Its layers are accessible via the `layers` attribute:
"""
model.layers
"""
You can also create a Sequential model incrementally via the `add()` method:
"""
model = keras.Sequential()
model.add(layers.Dense(2, activation="relu"))
model.add(layers.Dense(3, activation="relu"))
model.add(layers.Dense(4))
"""
Note that there's also a corresponding `pop()` method to remove layers:
a Sequential model behaves very much like a list of layers.
"""
model.pop()
print(len(model.layers)) # 2
"""
Also note that the Sequential constructor accepts a `name` argument, just like
any layer or model in Keras. This is useful to annotate TensorBoard graphs
with semantically meaningful names.
"""
model = keras.Sequential(name="my_sequential")
model.add(layers.Dense(2, activation="relu", name="layer1"))
model.add(layers.Dense(3, activation="relu", name="layer2"))
model.add(layers.Dense(4, name="layer3"))
"""
## Specifying the input shape in advance
Generally, all layers in Keras need to know the shape of their inputs
in order to be able to create their weights. So when you create a layer like
this, initially, it has no weights:
"""
layer = layers.Dense(3)
layer.weights # Empty
"""
It creates its weights the first time it is called on an input, since the shape
of the weights depends on the shape of the inputs:
"""
# Call layer on a test input
x = tf.ones((1, 4))
y = layer(x)
layer.weights # Now it has weights, of shape (4, 3) and (3,)
"""
Naturally, this also applies to Sequential models. When you instantiate a
Sequential model without an input shape, it isn't "built": it has no weights
(and calling
`model.weights` results in an error stating just this). The weights are created
when the model first sees some input data:
"""
model = keras.Sequential(
[
layers.Dense(2, activation="relu"),
layers.Dense(3, activation="relu"),
layers.Dense(4),
]
) # No weights at this stage!
# At this point, you can't do this:
# model.weights
# You also can't do this:
# model.summary()
# Call the model on a test input
x = tf.ones((1, 4))
y = model(x)
print("Number of weights after calling the model:", len(model.weights)) # 6
"""
Once a model is "built", you can call its `summary()` method to display its
contents:
"""
model.summary()
"""
However, it can be very useful when building a Sequential model incrementally
to be able to display the summary of the model so far, including the current
output shape. In this case, you should start your model by passing an `Input`
object to your model, so that it knows its input shape from the start:
"""
model = keras.Sequential()
model.add(keras.Input(shape=(4,)))
model.add(layers.Dense(2, activation="relu"))
model.summary()
"""
Note that the `Input` object is not displayed as part of `model.layers`, since
it isn't a layer:
"""
model.layers
"""
A simple alternative is to just pass an `input_shape` argument to your first
layer:
"""
model = keras.Sequential()
model.add(layers.Dense(2, activation="relu", input_shape=(4,)))
model.summary()
"""
Models built with a predefined input shape like this always have weights (even
before seeing any data) and always have a defined output shape.
In general, it's a recommended best practice to always specify the input shape
of a Sequential model in advance if you know what it is.
"""
"""
## A common debugging workflow: `add()` + `summary()`
When building a new Sequential architecture, it's useful to incrementally stack
layers with `add()` and frequently print model summaries. For instance, this
enables you to monitor how a stack of `Conv2D` and `MaxPooling2D` layers is
downsampling image feature maps:
"""
model = keras.Sequential()
model.add(keras.Input(shape=(250, 250, 3))) # 250x250 RGB images
model.add(layers.Conv2D(32, 5, strides=2, activation="relu"))
model.add(layers.Conv2D(32, 3, activation="relu"))
model.add(layers.MaxPooling2D(3))
# Can you guess what the current output shape is at this point? Probably not.
# Let's just print it:
model.summary()
# The answer was: (40, 40, 32), so we can keep downsampling...
model.add(layers.Conv2D(32, 3, activation="relu"))
model.add(layers.Conv2D(32, 3, activation="relu"))
model.add(layers.MaxPooling2D(3))
model.add(layers.Conv2D(32, 3, activation="relu"))
model.add(layers.Conv2D(32, 3, activation="relu"))
model.add(layers.MaxPooling2D(2))
# And now?
model.summary()
# Now that we have 4x4 feature maps, time to apply global max pooling.
model.add(layers.GlobalMaxPooling2D())
# Finally, we add a classification layer.
model.add(layers.Dense(10))
"""
Very practical, right?
"""
"""
## What to do once you have a model
Once your model architecture is ready, you will want to:
- Train your model, evaluate it, and run inference. See our
[guide to training & evaluation with the built-in loops](
/guides/training_with_built_in_methods/)
- Save your model to disk and restore it. See our
[guide to serialization & saving](/guides/serialization_and_saving/).
- Speed up model training by leveraging multiple GPUs. See our
[guide to multi-GPU and distributed training](https://keras.io/guides/distributed_training/).
"""
"""
## Feature extraction with a Sequential model
Once a Sequential model has been built, it behaves like a [Functional API
model](/guides/functional_api/). This means that every layer has an `input`
and `output` attribute. These attributes can be used to do neat things, like
quickly
creating a model that extracts the outputs of all intermediate layers in a
Sequential model:
"""
initial_model = keras.Sequential(
[
keras.Input(shape=(250, 250, 3)),
layers.Conv2D(32, 5, strides=2, activation="relu"),
layers.Conv2D(32, 3, activation="relu"),
layers.Conv2D(32, 3, activation="relu"),
]
)
feature_extractor = keras.Model(
inputs=initial_model.inputs,
outputs=[layer.output for layer in initial_model.layers],
)
# Call feature extractor on test input.
x = tf.ones((1, 250, 250, 3))
features = feature_extractor(x)
"""
Here's a similar example that only extract features from one layer:
"""
initial_model = keras.Sequential(
[
keras.Input(shape=(250, 250, 3)),
layers.Conv2D(32, 5, strides=2, activation="relu"),
layers.Conv2D(32, 3, activation="relu", name="my_intermediate_layer"),
layers.Conv2D(32, 3, activation="relu"),
]
)
feature_extractor = keras.Model(
inputs=initial_model.inputs,
outputs=initial_model.get_layer(name="my_intermediate_layer").output,
)
# Call feature extractor on test input.
x = tf.ones((1, 250, 250, 3))
features = feature_extractor(x)
"""
## Transfer learning with a Sequential model
Transfer learning consists of freezing the bottom layers in a model and only training
the top layers. If you aren't familiar with it, make sure to read our [guide
to transfer learning](/guides/transfer_learning/).
Here are two common transfer learning blueprint involving Sequential models.
First, let's say that you have a Sequential model, and you want to freeze all
layers except the last one. In this case, you would simply iterate over
`model.layers` and set `layer.trainable = False` on each layer, except the
last one. Like this:
```python
model = keras.Sequential([
keras.Input(shape=(784)),
layers.Dense(32, activation='relu'),
layers.Dense(32, activation='relu'),
layers.Dense(32, activation='relu'),
layers.Dense(10),
])
# Presumably you would want to first load pre-trained weights.
model.load_weights(...)
# Freeze all layers except the last one.
for layer in model.layers[:-1]:
layer.trainable = False
# Recompile and train (this will only update the weights of the last layer).
model.compile(...)
model.fit(...)
```
Another common blueprint is to use a Sequential model to stack a pre-trained
model and some freshly initialized classification layers. Like this:
```python
# Load a convolutional base with pre-trained weights
base_model = keras.applications.Xception(
weights='imagenet',
include_top=False,
pooling='avg')
# Freeze the base model
base_model.trainable = False
# Use a Sequential model to add a trainable classifier on top
model = keras.Sequential([
base_model,
layers.Dense(1000),
])
# Compile & train
model.compile(...)
model.fit(...)
```
If you do transfer learning, you will probably find yourself frequently using
these two patterns.
"""
"""
That's about all you need to know about Sequential models!
To find out more about building models in Keras, see:
- [Guide to the Functional API](/guides/functional_api/)
- [Guide to making new Layers & Models via subclassing](
/guides/making_new_layers_and_models_via_subclassing/)
"""
| {
"content_hash": "02ff84bc2c1749608a9c1a531800a32d",
"timestamp": "",
"source": "github",
"line_count": 379,
"max_line_length": 93,
"avg_line_length": 27.4221635883905,
"alnum_prop": 0.7160588857885115,
"repo_name": "keras-team/keras-io",
"id": "9f2505b91c10b067869fb4d5c3a1bcd54bf6b49a",
"size": "10393",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "guides/sequential_model.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "15929"
},
{
"name": "Dockerfile",
"bytes": "188"
},
{
"name": "HTML",
"bytes": "21968"
},
{
"name": "Jupyter Notebook",
"bytes": "718942"
},
{
"name": "Makefile",
"bytes": "193"
},
{
"name": "Python",
"bytes": "680865"
}
],
"symlink_target": ""
} |
(function() {
'use strict';
angular
.module('app.translate')
.run(translateRun)
;
translateRun.$inject = ['$rootScope', '$translate'];
function translateRun($rootScope, $translate){
// Internationalization
// ----------------------
$rootScope.language = {
// Handles language dropdown
listIsOpen: false,
// list of available languages
available: {
'en': 'English',
'zh_cn': '简体中文',
},
// display always the current ui language
init: function () {
var proposedLanguage = $translate.proposedLanguage() || $translate.use();
var preferredLanguage = $translate.preferredLanguage(); // we know we have set a preferred one in app.config
$rootScope.language.selected = $rootScope.language.available[ (proposedLanguage || preferredLanguage) ];
},
set: function (localeId) {
// Set the new idiom
$translate.use(localeId);
// save a reference for the current language
$rootScope.language.selected = $rootScope.language.available[localeId];
// finally toggle dropdown
$rootScope.language.listIsOpen = ! $rootScope.language.listIsOpen;
}
};
$rootScope.language.init();
}
})();
| {
"content_hash": "95a4b0fd234a837661653d2cf584a6c8",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 118,
"avg_line_length": 32.976190476190474,
"alnum_prop": 0.5552346570397112,
"repo_name": "amorwilliams/gsoops",
"id": "a061507455d2f5517f00fa9461bc41f4f350bebd",
"size": "1393",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/master/js/modules/translate/translate.run.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "660718"
},
{
"name": "HTML",
"bytes": "110733"
},
{
"name": "JavaScript",
"bytes": "2482224"
},
{
"name": "Protocol Buffer",
"bytes": "441"
},
{
"name": "Python",
"bytes": "521960"
},
{
"name": "Shell",
"bytes": "400"
}
],
"symlink_target": ""
} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function set_except_failure</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Contract 1.0.0">
<link rel="up" href="../../reference.html#header.boost.contract.core.exception_hpp" title="Header <boost/contract/core/exception.hpp>">
<link rel="prev" href="postcondition_failure.html" title="Function postcondition_failure">
<link rel="next" href="get_except_failure.html" title="Function get_except_failure">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="postcondition_failure.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../reference.html#header.boost.contract.core.exception_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="get_except_failure.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.contract.set_except_failure"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function set_except_failure</span></h2>
<p>boost::contract::set_except_failure — Set failure handler for exception guarantees. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../reference.html#header.boost.contract.core.exception_hpp" title="Header <boost/contract/core/exception.hpp>">boost/contract/core/exception.hpp</a>>
</span>
<span class="identifier">from_failure_handler</span> <span class="keyword">const</span> <span class="special">&</span>
<span class="identifier">set_except_failure</span><span class="special">(</span><span class="identifier">from_failure_handler</span> <span class="keyword">const</span> <span class="special">&</span> f<span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm39271"></a><h2>Description</h2>
<p>Set a new failure handler and returns it.</p>
<p><span class="bold"><strong>Throws:</strong></span> This is declared <code class="computeroutput">noexcept</code> (or <code class="computeroutput">throw()</code> before C++11).</p>
<p>
</p>
<p><span class="bold"><strong>See Also:</strong></span></p>
<p> <a class="link" href="../../boost_contract/advanced.html#boost_contract.advanced.throw_on_failures__and__noexcept__" title="Throw on Failures (and noexcept)"> Throw on Failure</a>, <a class="link" href="../../boost_contract/tutorial.html#boost_contract.tutorial.exception_guarantees" title="Exception Guarantees"> Exception Guarantees</a> </p>
<p>
</p>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">f</code></span></p></td>
<td><p>New failure handler functor to set.</p></td>
</tr></tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>Same failure handler functor <code class="computeroutput">f</code> passed as parameter (e.g., for concatenating function calls).</p></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2008-2019 Lorenzo Caminiti<p>
Distributed under the Boost Software License, Version 1.0 (see accompanying
file LICENSE_1_0.txt or a copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="postcondition_failure.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../reference.html#header.boost.contract.core.exception_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="get_except_failure.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| {
"content_hash": "a96cfe2e5a319f0943aa14ede949f477",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 494,
"avg_line_length": 61.67777777777778,
"alnum_prop": 0.6613222842731039,
"repo_name": "arangodb/arangodb",
"id": "6f30de1de78cddd5f8e73bd51cf7a6630afc1a26",
"size": "5556",
"binary": false,
"copies": "3",
"ref": "refs/heads/devel",
"path": "3rdParty/boost/1.78.0/libs/contract/doc/html/boost/contract/set_except_failure.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "61827"
},
{
"name": "C",
"bytes": "311036"
},
{
"name": "C++",
"bytes": "35149373"
},
{
"name": "CMake",
"bytes": "387268"
},
{
"name": "CSS",
"bytes": "210549"
},
{
"name": "EJS",
"bytes": "232160"
},
{
"name": "HTML",
"bytes": "23114"
},
{
"name": "JavaScript",
"bytes": "33841256"
},
{
"name": "LLVM",
"bytes": "15003"
},
{
"name": "NASL",
"bytes": "381737"
},
{
"name": "NSIS",
"bytes": "47138"
},
{
"name": "Pascal",
"bytes": "75391"
},
{
"name": "Perl",
"bytes": "9811"
},
{
"name": "PowerShell",
"bytes": "6806"
},
{
"name": "Python",
"bytes": "190515"
},
{
"name": "SCSS",
"bytes": "255542"
},
{
"name": "Shell",
"bytes": "133576"
},
{
"name": "TypeScript",
"bytes": "179074"
},
{
"name": "Yacc",
"bytes": "79620"
}
],
"symlink_target": ""
} |
"""
flask
~~~~~
A microframework based on Werkzeug. It's extensively documented
and follows best practice patterns.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
__version__ = '0.7.2'
# utilities we import from Werkzeug and Jinja2 that are unused
# in the module but are exported as public interface.
from werkzeug import abort, redirect
from jinja2 import Markup, escape
from .app import Flask, Request, Response
from .config import Config
from .helpers import url_for, jsonify, json_available, flash, \
send_file, send_from_directory, get_flashed_messages, \
get_template_attribute, make_response, safe_join
from .globals import current_app, g, request, session, _request_ctx_stack
from .ctx import has_request_context
from .module import Module
from .blueprints import Blueprint
from .templating import render_template, render_template_string
from .session import Session
# the signals
from .signals import signals_available, template_rendered, request_started, \
request_finished, got_request_exception, request_tearing_down
# only import json if it's available
if json_available:
from .helpers import json
| {
"content_hash": "58b73ba2add47374b5f4040f865843e7",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 77,
"avg_line_length": 32.513513513513516,
"alnum_prop": 0.7522859517871987,
"repo_name": "rabc/Gitmark",
"id": "0f1b97e3aa6905e6929f39df5c1dadf95d2b1eb7",
"size": "1227",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "flask/__init__.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "89510"
},
{
"name": "JavaScript",
"bytes": "7203"
},
{
"name": "Python",
"bytes": "1776747"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Camping")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Camping")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("88a7e468-0966-42f4-8e90-7b6451a98184")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"content_hash": "c9aebded56e5783f6b0c8c98b9beb400",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 38.52777777777778,
"alnum_prop": 0.7433309300648883,
"repo_name": "AnaKostadinova/Programming-Fundamentals-C-Sharp-Exercises",
"id": "8f164dca9da4080a2e82e16b8447ef314cf22189",
"size": "1390",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "LINQ/Camping/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "336216"
}
],
"symlink_target": ""
} |
static int loveGetVersion(lua_State *L) { // love.getVersion()
lua_pushstring(L, LOVE_VERSION);
return 1;
}
int initLoveSystem(lua_State *L);
int initLoveGraphics(lua_State *L);
int initLoveTimer(lua_State *L);
int initLoveKeyboard(lua_State *L);
int initLoveMouse(lua_State *L);
int initLoveJoystick(lua_State *L);
int initLoveWindow(lua_State *L);
int initLoveEvent(lua_State *L);
int initLoveAudio(lua_State *L);
int initLoveFilesystem(lua_State *L);
int initSocket(lua_State * L);
int initImageClass(lua_State *L);
int initFontClass(lua_State *L);
int initSourceClass(lua_State *L);
int initFileClass(lua_State *L);
int initQuadClass(lua_State *L);
int initJoystickClass(lua_State *L);
int initSocketClass(lua_State *L);
int initCanvasClass(lua_State *L);
int initLove(lua_State *L) {
// Thanks to rxi for this https://github.com/rxi/lovedos/blob/master/src/love.c
int i;
int (*classes[])(lua_State *L) = {
initImageClass,
initFontClass,
initSourceClass,
initQuadClass,
initFileClass,
initJoystickClass,
initSocketClass,
initCanvasClass,
NULL,
};
for (i = 0; classes[i]; i++) {
classes[i](L);
lua_pop(L, 1);
}
luaL_Reg reg[] = {
{ "getVersion", loveGetVersion },
{ 0, 0 },
};
luaL_newlib(L, reg);
struct { char *name; int (*fn)(lua_State *L); } mods[] = {
{ "system", initLoveSystem },
{ "graphics", initLoveGraphics },
{ "timer", initLoveTimer },
{ "keyboard", initLoveKeyboard },
{ "mouse", initLoveMouse },
{ "joystick", initLoveJoystick },
{ "window", initLoveWindow },
{ "event", initLoveEvent },
{ "audio", initLoveAudio },
{ "filesystem", initLoveFilesystem },
{ 0 },
};
for (i = 0; mods[i].name; i++) {
mods[i].fn(L);
lua_setfield(L, -2, mods[i].name);
}
return 1;
}
| {
"content_hash": "3e2f40e6490a865452e9a24c2a889daf",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 80,
"avg_line_length": 22.775,
"alnum_prop": 0.645993413830955,
"repo_name": "VideahGams/LovePotion",
"id": "4e99fde7f332b7e4436aedaa8bb357e4e7da39f5",
"size": "3079",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "source/modules/love.c",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "781928"
},
{
"name": "C++",
"bytes": "182544"
},
{
"name": "Lua",
"bytes": "21154"
},
{
"name": "Makefile",
"bytes": "19865"
},
{
"name": "Shell",
"bytes": "4709"
}
],
"symlink_target": ""
} |
package org.apache.causeway.persistence.jdo.applib;
import org.springframework.context.annotation.Configuration;
/**
* @since 2.0 {@index}
*/
@Configuration
public class CausewayModulePersistenceJdoApplib {
}
| {
"content_hash": "28f04d1de95d13f08fc40e45abf7acf0",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 60,
"avg_line_length": 19.454545454545453,
"alnum_prop": 0.7850467289719626,
"repo_name": "apache/isis",
"id": "5c70c8ba2de33d0dcab6bc90c2a7164fe52458dd",
"size": "1039",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "persistence/jdo/applib/src/main/java/org/apache/causeway/persistence/jdo/applib/CausewayModulePersistenceJdoApplib.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "152495"
},
{
"name": "Clean",
"bytes": "8063"
},
{
"name": "Gherkin",
"bytes": "412"
},
{
"name": "Groovy",
"bytes": "15585"
},
{
"name": "HTML",
"bytes": "268010"
},
{
"name": "Handlebars",
"bytes": "337"
},
{
"name": "Java",
"bytes": "17242597"
},
{
"name": "JavaScript",
"bytes": "271368"
},
{
"name": "Kotlin",
"bytes": "1913258"
},
{
"name": "Rich Text Format",
"bytes": "2150674"
},
{
"name": "Shell",
"bytes": "102821"
},
{
"name": "TypeScript",
"bytes": "275"
}
],
"symlink_target": ""
} |
#ifndef _INITLB_H_
#define _INITLB_H_
#include "helper.h"
#define FLUID 0
#define NO_SLIP 1
#define MOVING_WALL 2
/* reads the parameters for the lid driven cavity scenario from a config file */
int readParameters(
int *xlength, /* reads domain size. Parameter name: "xlength" */
double *tau, /* relaxation parameter tau. Parameter name: "tau" */
double *velocityWall, /* velocity of the lid. Parameter name: "characteristicvelocity" */
int *timesteps, /* number of timesteps. Parameter name: "timesteps" */
int *timestepsPerPlotting, /* timesteps between subsequent VTK plots. Parameter name: "vtkoutput" */
int argc, /* number of arguments. Should equal 2 (program + name of config file */
char *argv[] /* argv[1] shall contain the path to the config file */
);
/* initialises the particle distribution functions and the flagfield */
void initialiseFields(double *collideField, double *streamField,int *flagField, int xlength);
#endif
| {
"content_hash": "6680633b44f26849499f5e406e1f3eb7",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 113,
"avg_line_length": 44.32,
"alnum_prop": 0.6299638989169675,
"repo_name": "grantathon/computational_fluid_dynamics",
"id": "dc36627fabc44c8e17a855d9242769a7c1dbb77d",
"size": "1108",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "02_assignment/initLB.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "605774"
},
{
"name": "C++",
"bytes": "94467157"
},
{
"name": "JavaScript",
"bytes": "2842"
},
{
"name": "Makefile",
"bytes": "984"
},
{
"name": "Matlab",
"bytes": "1367"
},
{
"name": "Perl",
"bytes": "6080"
},
{
"name": "Shell",
"bytes": "2289"
},
{
"name": "TeX",
"bytes": "6359"
}
],
"symlink_target": ""
} |
class Task < ActiveRecord::Base
belongs_to :project
attr_accessible :content, :name
end
| {
"content_hash": "285356a210afad6b6fc2945106ed5a08",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 33,
"avg_line_length": 23,
"alnum_prop": 0.75,
"repo_name": "tonytonyjan/tj_rails_extension",
"id": "3a19ddc6fb61ece6edbaf88acf7eff9ce7cd46a0",
"size": "92",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/dummy/app/models/task.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "1350"
},
{
"name": "Ruby",
"bytes": "39901"
}
],
"symlink_target": ""
} |
#ifndef BOOST_RANDOM_UNIFORM_SMALLINT_HPP
#define BOOST_RANDOM_UNIFORM_SMALLINT_HPP
#include <cassert>
#include <iostream>
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/uniform_01.hpp>
#include <boost/detail/workaround.hpp>
namespace boost {
// uniform integer distribution on a small range [min, max]
/**
* The distribution function uniform_smallint models a \random_distribution.
* On each invocation, it returns a random integer value uniformly distributed
* in the set of integer numbers {min, min+1, min+2, ..., max}. It assumes
* that the desired range (max-min+1) is small compared to the range of the
* underlying source of random numbers and thus makes no attempt to limit
* quantization errors.
*
* Let r<sub>out</sub>=(max-min+1) the desired range of integer numbers, and
* let r<sub>base</sub> be the range of the underlying source of random
* numbers. Then, for the uniform distribution, the theoretical probability
* for any number i in the range r<sub>out</sub> will be p<sub>out</sub>(i) =
* 1/r<sub>out</sub>. Likewise, assume a uniform distribution on r<sub>base</sub> for
* the underlying source of random numbers, i.e. p<sub>base</sub>(i) =
* 1/r<sub>base</sub>. Let p<sub>out_s</sub>(i) denote the random
* distribution generated by @c uniform_smallint. Then the sum over all
* i in r<sub>out</sub> of (p<sub>out_s</sub>(i)/p<sub>out</sub>(i) - 1)<sup>2</sup>
* shall not exceed r<sub>out</sub>/r<sub>base</sub><sup>2</sup>
* (r<sub>base</sub> mod r<sub>out</sub>)(r<sub>out</sub> -
* r<sub>base</sub> mod r<sub>out</sub>).
*
* The template parameter IntType shall denote an integer-like value type.
*
* Note: The property above is the square sum of the relative differences
* in probabilities between the desired uniform distribution
* p<sub>out</sub>(i) and the generated distribution p<sub>out_s</sub>(i).
* The property can be fulfilled with the calculation
* (base_rng mod r<sub>out</sub>), as follows: Let r = r<sub>base</sub> mod
* r<sub>out</sub>. The base distribution on r<sub>base</sub> is folded onto the
* range r<sub>out</sub>. The numbers i < r have assigned (r<sub>base</sub>
* div r<sub>out</sub>)+1 numbers of the base distribution, the rest has
* only (r<sub>base</sub> div r<sub>out</sub>). Therefore,
* p<sub>out_s</sub>(i) = ((r<sub>base</sub> div r<sub>out</sub>)+1) /
* r<sub>base</sub> for i < r and p<sub>out_s</sub>(i) = (r<sub>base</sub>
* div r<sub>out</sub>)/r<sub>base</sub> otherwise. Substituting this in the
* above sum formula leads to the desired result.
*
* Note: The upper bound for (r<sub>base</sub> mod r<sub>out</sub>)
* (r<sub>out</sub> - r<sub>base</sub> mod r<sub>out</sub>) is
* r<sub>out</sub><sup>2</sup>/4. Regarding the upper bound for the
* square sum of the relative quantization error of
* r<sub>out</sub><sup>3</sup>/(4*r<sub>base</sub><sup>2</sup>), it
* seems wise to either choose r<sub>base</sub> so that r<sub>base</sub> >
* 10*r<sub>out</sub><sup>2</sup> or ensure that r<sub>base</sub> is
* divisible by r<sub>out</sub>.
*/
template<class IntType = int>
class uniform_smallint
{
public:
typedef IntType input_type;
typedef IntType result_type;
/**
* Constructs a @c uniform_smallint. @c min and @c max are the
* lower and upper bounds of the output range, respectively.
*/
explicit uniform_smallint(IntType min_arg = 0, IntType max_arg = 9)
: _min(min_arg), _max(max_arg)
{
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
// MSVC fails BOOST_STATIC_ASSERT with std::numeric_limits at class scope
BOOST_STATIC_ASSERT(std::numeric_limits<IntType>::is_integer);
#endif
}
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _min; }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _max; }
void reset() { }
template<class Engine>
result_type operator()(Engine& eng)
{
typedef typename Engine::result_type base_result;
base_result _range = static_cast<base_result>(_max-_min)+1;
base_result _factor = 1;
// LCGs get bad when only taking the low bits.
// (probably put this logic into a partial template specialization)
// Check how many low bits we can ignore before we get too much
// quantization error.
base_result r_base = (eng.max)() - (eng.min)();
if(r_base == (std::numeric_limits<base_result>::max)()) {
_factor = 2;
r_base /= 2;
}
r_base += 1;
if(r_base % _range == 0) {
// No quantization effects, good
_factor = r_base / _range;
} else {
// carefully avoid overflow; pessimizing here
for( ; r_base/_range/32 >= _range; _factor *= 2)
r_base /= 2;
}
return static_cast<result_type>(((eng() - (eng.min)()) / _factor) % _range + _min);
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const uniform_smallint& ud)
{
os << ud._min << " " << ud._max;
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, uniform_smallint& ud)
{
is >> std::ws >> ud._min >> std::ws >> ud._max;
return is;
}
#endif
private:
result_type _min;
result_type _max;
};
} // namespace boost
#endif // BOOST_RANDOM_UNIFORM_SMALLINT_HPP
| {
"content_hash": "01298cdb9b72ea1f9c32bfc62ec30f77",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 87,
"avg_line_length": 39.145833333333336,
"alnum_prop": 0.6537165158772397,
"repo_name": "pennwin2013/netsvr",
"id": "93c7b63dc4fadc9b737510d16f653cb53191642f",
"size": "6178",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "include/boost/random/uniform_smallint.hpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "67355"
},
{
"name": "C++",
"bytes": "52439988"
},
{
"name": "Python",
"bytes": "2525"
}
],
"symlink_target": ""
} |
package options
import (
"fmt"
"reflect"
"testing"
"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/util/diff"
cliflag "k8s.io/component-base/cli/flag"
)
func newKubeletServerOrDie() *KubeletServer {
s, err := NewKubeletServer()
if err != nil {
panic(err)
}
return s
}
// TestRoundTrip ensures that flag values from the Kubelet can be serialized
// to arguments and then read back and have the same value. Also catches cases
// where the default value reported by the flag is not actually allowed to be
// specified.
func TestRoundTrip(t *testing.T) {
testCases := []struct {
name string
inputFlags func() *KubeletServer
outputFlags func() *KubeletServer
flagDefaulter func(*pflag.FlagSet)
skipDefault bool
err bool
expectArgs bool
}{
{
name: "default flags are eliminated",
inputFlags: newKubeletServerOrDie,
outputFlags: newKubeletServerOrDie,
flagDefaulter: newKubeletServerOrDie().AddFlags,
err: false,
expectArgs: false,
},
{
name: "default flag values round trip",
inputFlags: newKubeletServerOrDie,
outputFlags: newKubeletServerOrDie,
flagDefaulter: func(*pflag.FlagSet) {},
err: false,
expectArgs: true,
},
{
name: "nil address does not fail for optional argument",
inputFlags: func() *KubeletServer {
s := newKubeletServerOrDie()
s.HealthzBindAddress = ""
return s
},
outputFlags: func() *KubeletServer {
s := newKubeletServerOrDie()
s.HealthzBindAddress = ""
return s
},
flagDefaulter: func(*pflag.FlagSet) {},
err: false,
expectArgs: true,
},
}
for _, testCase := range testCases {
modifiedFlags := testCase.inputFlags()
args := asArgs(modifiedFlags.AddFlags, testCase.flagDefaulter)
if testCase.expectArgs != (len(args) > 0) {
t.Errorf("%s: unexpected args: %v", testCase.name, args)
continue
}
t.Logf("%s: args: %v", testCase.name, args)
flagSet := pflag.NewFlagSet("output", pflag.ContinueOnError)
outputFlags := testCase.outputFlags()
outputFlags.AddFlags(flagSet)
if err := flagSet.Parse(args); err != nil {
if !testCase.err {
t.Errorf("%s: unexpected flag error: %v", testCase.name, err)
}
continue
}
if !reflect.DeepEqual(modifiedFlags, outputFlags) {
t.Errorf("%s: flags did not round trip: %s", testCase.name, diff.ObjectReflectDiff(modifiedFlags, outputFlags))
continue
}
}
}
func asArgs(fn, defaultFn func(*pflag.FlagSet)) []string {
fs := pflag.NewFlagSet("extended", pflag.ContinueOnError)
fn(fs)
defaults := pflag.NewFlagSet("defaults", pflag.ContinueOnError)
defaultFn(defaults)
var args []string
fs.VisitAll(func(flag *pflag.Flag) {
// if the flag implements cliflag.OmitEmpty and the value is Empty, then just omit it from the command line
if omit, ok := flag.Value.(cliflag.OmitEmpty); ok && omit.Empty() {
return
}
s := flag.Value.String()
// if the flag has the same value as the default, we can omit it without changing the meaning of the command line
var defaultValue string
if defaultFlag := defaults.Lookup(flag.Name); defaultFlag != nil {
defaultValue = defaultFlag.Value.String()
if s == defaultValue {
return
}
}
// if the flag is a string slice, each element is specified with an independent flag invocation
if values, err := fs.GetStringSlice(flag.Name); err == nil {
for _, s := range values {
args = append(args, fmt.Sprintf("--%s=%s", flag.Name, s))
}
} else {
if len(s) == 0 {
s = defaultValue
}
args = append(args, fmt.Sprintf("--%s=%s", flag.Name, s))
}
})
return args
}
func TestValidateKubeletFlags(t *testing.T) {
tests := []struct {
name string
error bool
labels map[string]string
}{
{
name: "Invalid kubernetes.io label",
error: true,
labels: map[string]string{
"beta.kubernetes.io/metadata-proxy-ready": "true",
},
},
{
name: "Valid label outside of kubernetes.io and k8s.io",
error: false,
labels: map[string]string{
"cloud.google.com/metadata-proxy-ready": "true",
},
},
{
name: "Empty label list",
error: false,
labels: map[string]string{},
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
err := ValidateKubeletFlags(&KubeletFlags{
NodeLabels: tt.labels,
})
if tt.error && err == nil {
t.Errorf("ValidateKubeletFlags should have failed with labels: %+v", tt.labels)
}
if !tt.error && err != nil {
t.Errorf("ValidateKubeletFlags should not have failed with labels: %+v", tt.labels)
}
})
}
}
| {
"content_hash": "89beadc4d0b3b41467d32d9df3cabaf1",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 115,
"avg_line_length": 26.751445086705203,
"alnum_prop": 0.6570872947277442,
"repo_name": "micahhausler/kubernetes",
"id": "3c23c774b68b343189b687ee12b06ec7549900b5",
"size": "5197",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cmd/kubelet/app/options/options_test.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "833"
},
{
"name": "C",
"bytes": "3902"
},
{
"name": "Dockerfile",
"bytes": "50154"
},
{
"name": "Go",
"bytes": "59609994"
},
{
"name": "HTML",
"bytes": "128"
},
{
"name": "Lua",
"bytes": "17200"
},
{
"name": "Makefile",
"bytes": "65781"
},
{
"name": "PowerShell",
"bytes": "146411"
},
{
"name": "Python",
"bytes": "23849"
},
{
"name": "Shell",
"bytes": "1773569"
},
{
"name": "sed",
"bytes": "1262"
}
],
"symlink_target": ""
} |
<?php
require_once 'Services/OpenStreetMap.php';
$id = 1707362;
$osm = new Services_OpenStreetMap();
$relation = $osm->getRelation($id);
file_put_contents("relation.$id.xml", $relation->getXml());
?>
| {
"content_hash": "22a147932fd65979684071971a89e44b",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 59,
"avg_line_length": 22.444444444444443,
"alnum_prop": 0.693069306930693,
"repo_name": "kenguest/Services_Openstreetmap",
"id": "8e8333727532ffd9a154defad8ace9096ddea0a7",
"size": "202",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/getandsaverelation.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "HTML",
"bytes": "13591"
},
{
"name": "PHP",
"bytes": "329247"
}
],
"symlink_target": ""
} |
<!doctype html>
<head>
<meta charset="utf-8">
<title>Couch Audio Recorder</title>
<link type="text/css" href="css/bootstrap.min.css" rel="stylesheet" />
<link type="text/css" href="skin/couchaudiorecorder.default.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="js/jquery.couch.js"></script>
<script type="text/javascript" src="js/jquery.jplayer.min.js"></script>
<script type="text/javascript" src="js/jquery.couchaudiorecorder.js"></script>
<script type="text/javascript" src="js/jquery.couchaudiostreamer.js"></script>
<script type="text/javascript">
$(function() {
jQuery.couch.urlPrefix = 'api';
var db = $.couch.db('');
var hash = location.hash;
if (hash) {
var docId = hash.substring(1);
var stream = 'audio/'+ docId +'/stream.m3u8';
$('.istream').html('<a href="audio/'+ docId +'/stream.m3u8">here you go!</a>');
$('.player').couchaudiostreamer({
db : db,
stream: docId
});
}
});
</script>
</head>
<body>
<div class="container">
<ul class="breadcrumb">
<li><a href=".">Home</a> <span class="divider">/</span></li>
<li class="active">Stream</li>
</ul>
<h2>Stream</h2>
<div class="alert-message block-message info">
<span class="label warning">Warning</span> <em>This is pre-alpha software.</em> Data, may be deleted at anytime.
Follow us :
<a href="https://github.com/ryanramage/couch-audio-recorder">github</a>,
<a href="http://twitter.com/eckoit">twitter</a>.
By <a href="http://eckoit.com">eckoit</a>
</div>
<div class="row">
<div class="span16 player">
</div>
</div>
<div class="row">
<div class="span10">
Want a HLS (iphone, ipad, iTouch) stream?
<span class="istream"></span>
</div>
</div>
</div>
</body>
</html> | {
"content_hash": "46ec896a2656feffb93147e9ea1b0409",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 124,
"avg_line_length": 32.028985507246375,
"alnum_prop": 0.5248868778280543,
"repo_name": "ryanramage/couch-audio-recorder",
"id": "06c99826ea5e5555fbeca50a77a010de9b376705",
"size": "2210",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "html/stream.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "111336"
},
{
"name": "JavaScript",
"bytes": "81524"
}
],
"symlink_target": ""
} |
package com.hazelcast.internal.jmx;
import com.hazelcast.core.ISemaphore;
/**
* Management bean for {@link com.hazelcast.core.ISemaphore}
*/
@ManagedDescription("ISemaphore")
public class SemaphoreMBean extends HazelcastMBean<ISemaphore> {
protected SemaphoreMBean(ISemaphore managedObject, ManagementService service) {
super(managedObject, service);
objectName = service.createObjectName("ISemaphore", managedObject.getName());
}
@ManagedAnnotation("name")
public String getName() {
return managedObject.getName();
}
@ManagedAnnotation("available")
public int getAvailable() {
return managedObject.availablePermits();
}
@ManagedAnnotation(value = "drain", operation = true)
@ManagedDescription("Acquire and return all permits that are immediately available")
public int drain() {
return managedObject.drainPermits();
}
@ManagedAnnotation(value = "reduce", operation = true)
@ManagedDescription("Shrinks the number of available permits by the indicated reduction. Does not block")
public void reduce(int reduction) {
managedObject.reducePermits(reduction);
}
@ManagedAnnotation(value = "release", operation = true)
@ManagedDescription("Releases the given number of permits, increasing the number of available permits by that amount")
public void release(int permits) {
managedObject.release(permits);
}
@ManagedAnnotation("partitionKey")
@ManagedDescription("the partitionKey")
public String getPartitionKey() {
return managedObject.getPartitionKey();
}
}
| {
"content_hash": "928b2c31f15e3cf5ffd724a82839b647",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 122,
"avg_line_length": 31.941176470588236,
"alnum_prop": 0.7139349294045426,
"repo_name": "tombujok/hazelcast",
"id": "33d6709b55b8d0d4f7d0608ede209bc1d8c5f422",
"size": "2254",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "hazelcast/src/main/java/com/hazelcast/internal/jmx/SemaphoreMBean.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1449"
},
{
"name": "Java",
"bytes": "33147517"
},
{
"name": "Shell",
"bytes": "12286"
}
],
"symlink_target": ""
} |
package de.intarsys.tools.preferences;
import de.intarsys.tools.event.Event;
import de.intarsys.tools.event.EventType;
public class PreferencesChangeEvent extends Event {
public static final EventType ID = new EventType(
PreferencesChangeEvent.class.getName());
private String key;
private String newValue;
public PreferencesChangeEvent(Object source) {
super(source);
}
public String getKey() {
return key;
}
public String getNewValue() {
return newValue;
}
@Override
public EventType getEventType() {
return ID;
}
public void setKey(String key) {
this.key = key;
}
public void setNewValue(String newValue) {
this.newValue = newValue;
}
}
| {
"content_hash": "0b5a1ce080d3f1759eb6fc8c95ce11cf",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 51,
"avg_line_length": 17.487179487179485,
"alnum_prop": 0.7375366568914956,
"repo_name": "intarsys/runtime",
"id": "4a1518cc9266c152328e636106ae4f2aee92d4f8",
"size": "2232",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/de/intarsys/tools/preferences/PreferencesChangeEvent.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "2772267"
}
],
"symlink_target": ""
} |
package org.pdfextractor.restapi.log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.concurrent.atomic.AtomicLong;
public class LoggingFilter extends OncePerRequestFilter {
protected static final Logger logger = LoggerFactory.getLogger(LoggingFilter.class);
private static final String REQUEST_PREFIX = "Request: ";
private static final String RESPONSE_PREFIX = "Response: ";
private AtomicLong id = new AtomicLong(1);
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, final FilterChain filterChain) throws ServletException, IOException {
if (log(request)) {
long requestId = id.incrementAndGet();
request = new RequestWrapper(requestId, request);
response = new ResponseWrapper(requestId, response);
}
try {
super.doFilter(request, response, filterChain);
// filterChain.doFilter(request, response);
// response.flushBuffer();
} finally {
if (log(request)) {
logRequest(request);
logResponse((ResponseWrapper) response);
}
}
}
private boolean log(final HttpServletRequest request) {
return logger.isInfoEnabled() && request.getRequestURI().contains("/rest/") && !request.getRequestURI().contains("poller");
}
private void logRequest(final HttpServletRequest request) {
StringBuilder msg = new StringBuilder();
msg.append(REQUEST_PREFIX);
if (request instanceof RequestWrapper) {
msg.append("request_id=").append(((RequestWrapper) request).getId()).append("; ");
}
HttpSession session = request.getSession(false);
if (session != null) {
msg.append("session id=").append(session.getId()).append("; ");
}
if (request.getContentType() != null) {
msg.append("content type=").append(request.getContentType()).append("; ");
}
if (request.getMethod() != null) {
msg.append("method=").append(request.getMethod()).append("; ");
}
msg.append("uri=").append(request.getRequestURI());
if (request.getQueryString() != null) {
msg.append('?').append(request.getQueryString());
}
if (request instanceof RequestWrapper && isJson(request)) {
RequestWrapper requestWrapper = (RequestWrapper) request;
try {
String charEncoding = requestWrapper.getCharacterEncoding() != null ? requestWrapper.getCharacterEncoding() : "UTF-8";
msg.append("; payload=").append(new String(requestWrapper.toByteArray(), charEncoding));
} catch (UnsupportedEncodingException e) {
logger.warn("Failed to parse request payload", e);
}
}
logger.info(msg.toString());
}
private void logResponse(final ResponseWrapper response) {
StringBuilder msg = new StringBuilder();
msg.append(RESPONSE_PREFIX);
msg.append("request_id=").append((response.getId()));
msg.append("; status=").append(response.getStatus());
HttpStatus status = HttpStatus.valueOf(response.getStatus());
if (status != null) {
msg.append(' ').append(status.getReasonPhrase());
}
if (isJson(response)) {
msg.append("; payload=");
try {
byte[] ba = response.toByteArray();
msg.append(new String(ba, response.getCharacterEncoding()));
} catch (UnsupportedEncodingException e) {
msg.append("Error occured");
logger.warn("Failed to parse response payload", e);
}
}
logger.info(msg.toString());
}
private boolean isJson(HttpServletRequest request) {
return request.getContentType() != null && request.getContentType().equals("application/json");
}
private boolean isJson(ResponseWrapper response) {
return response.getContentType() != null && response.getContentType().equals("application/json");
}
}
| {
"content_hash": "242fdb520f31829f4750c5112bd1e572",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 160,
"avg_line_length": 35.04385964912281,
"alnum_prop": 0.7254067584480601,
"repo_name": "kveskimae/pdfextractor",
"id": "61a24f6235234beb1e62054453b286c52ab73699",
"size": "5176",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "restapi/src/main/java/org/pdfextractor/restapi/log/LoggingFilter.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8365"
},
{
"name": "HTML",
"bytes": "152490"
},
{
"name": "Java",
"bytes": "297800"
},
{
"name": "JavaScript",
"bytes": "78384"
}
],
"symlink_target": ""
} |
<html>
<head>
<title>Docs for page DataType.php</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
<tr>
<td class="header_top">PHPExcel_Cell</td>
</tr>
<tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt="" /></td></tr>
<tr>
<td class="header_menu">
[ <a href="../classtrees_PHPExcel_Cell.html" class="menu">class tree: PHPExcel_Cell</a> ]
[ <a href="../elementindex_PHPExcel_Cell.html" class="menu">index: PHPExcel_Cell</a> ]
[ <a href="../elementindex.html" class="menu">all elements</a> ]
</td>
</tr>
<tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt="" /></td></tr>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="200" class="menu">
<b>Packages:</b><br />
<a href="../li_PHPExcel.html">PHPExcel</a><br />
<a href="../li_PHPExcel_Cell.html">PHPExcel_Cell</a><br />
<a href="../li_PHPExcel_Reader.html">PHPExcel_Reader</a><br />
<a href="../li_PHPExcel_Shared.html">PHPExcel_Shared</a><br />
<a href="../li_PHPExcel_Style.html">PHPExcel_Style</a><br />
<a href="../li_PHPExcel_Worksheet.html">PHPExcel_Worksheet</a><br />
<a href="../li_PHPExcel_Worksheet_Drawing.html">PHPExcel_Worksheet_Drawing</a><br />
<a href="../li_PHPExcel_Writer.html">PHPExcel_Writer</a><br />
<a href="../li_PHPExcel_Writer_Excel2007.html">PHPExcel_Writer_Excel2007</a><br />
<br /><br />
<b>Files:</b><br />
<div class="package">
<a href="../PHPExcel_Cell/_Classes_PHPExcel_Cell_DataType_php.html"> DataType.php
</a><br>
</div><br />
<b>Classes:</b><br />
<div class="package">
<a href="../PHPExcel_Cell/PHPExcel_Cell_DataType.html">PHPExcel_Cell_DataType</a><br />
<a href="../PHPExcel_Cell/PHPExcel_Style.html">PHPExcel_Style</a><br />
</div>
</td>
<td>
<table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">
<h1>Procedural File: DataType.php</h1>
Source Location: /PHPExcel/Cell/DataType.php<br /><br />
<br>
<br>
<div class="contents">
<h2>Classes:</h2>
<dt><a href="../PHPExcel_Cell/PHPExcel_Cell_DataType.html">PHPExcel_Cell_DataType</a></dt>
<dd>PHPExcel_Cell_DataType</dd>
</div><br /><br />
<h2>Page Details:</h2>
PHPExcel
Copyright (c) 2006 - 2007 PHPExcel, Maarten Balliauw
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.<br /><br /><p>PHPExcel
Copyright (c) 2006 - 2007 PHPExcel, Maarten Balliauw
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</p><br /><br /><br />
<h4>Tags:</h4>
<div class="tags">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td><b>filesource:</b> </td><td><a href="..//__filesource/fsource_PHPExcel_Cell__PHPExcelCellDataType.php.html">Source Code for this file</a></td>
</tr>
<tr>
<td><b>version:</b> </td><td>##VERSION##, ##DATE##</td>
</tr>
<tr>
<td><b>license:</b> </td><td><a href="http://www.gnu.org/licenses/lgpl.txt">LGPL</a></td>
</tr>
<tr>
<td><b>copyright:</b> </td><td>Copyright (c) 2006 - 2007 PHPExcel (http://www.codeplex.com/PHPExcel)</td>
</tr>
</table>
</div>
<br /><br />
<br /><br />
<br /><br />
<br />
<div class="credit">
<hr />
Documentation generated on Mon, 23 Apr 2007 12:51:14 +0200 by <a href="http://www.phpdoc.org">phpDocumentor 1.3.0RC3</a>
</div>
</td></tr></table>
</td>
</tr>
</table>
</body>
</html> | {
"content_hash": "3bba2944b10484d98e51db95d6589b60",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 249,
"avg_line_length": 44.00961538461539,
"alnum_prop": 0.6233340616124099,
"repo_name": "ALTELMA/OfficeEquipmentManager",
"id": "cc7769902c8cd7d4a1552d799e8a0cc61a3c8b01",
"size": "4577",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "application/libraries/PHPExcel/branches/v1.2.0/Documentation/PHPExcel_Cell/_Classes_PHPExcel_Cell_DataType_php.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "209"
},
{
"name": "Batchfile",
"bytes": "7424"
},
{
"name": "CSS",
"bytes": "6892"
},
{
"name": "HTML",
"bytes": "1547796"
},
{
"name": "JavaScript",
"bytes": "11472"
},
{
"name": "PHP",
"bytes": "79520483"
}
],
"symlink_target": ""
} |
package alluxio.client.cli.fs.command;
import alluxio.SystemPropertyRule;
import alluxio.client.file.FileSystemTestUtils;
import alluxio.client.cli.fs.AbstractFileSystemShellTest;
import alluxio.client.cli.fs.FileSystemShellUtilsTest;
import alluxio.grpc.WritePType;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import java.io.Closeable;
import java.io.File;
import java.util.HashMap;
/**
* Tests for copyToLocal command.
*/
public final class CopyToLocalCommandIntegrationTest extends AbstractFileSystemShellTest {
/** Rule to create a new temporary folder during each test. */
@Rule
public TemporaryFolder mTestFolder = new TemporaryFolder();
@Test
public void copyToLocalDir() throws Exception {
String testDir = FileSystemShellUtilsTest.resetFileHierarchy(mFileSystem);
int ret =
mFsShell.run("copyToLocal", testDir, mLocalAlluxioCluster.getAlluxioHome() + "/testDir");
Assert.assertEquals(0, ret);
fileReadTest("/testDir/foo/foobar1", 10);
fileReadTest("/testDir/foo/foobar2", 20);
fileReadTest("/testDir/bar/foobar3", 30);
fileReadTest("/testDir/foobar4", 40);
}
@Test
public void copyToLocalRelativePathDir() throws Exception {
FileSystemTestUtils.createByteFile(mFileSystem, "/testFile", WritePType.MUST_CACHE, 10);
HashMap<String, String> sysProps = new HashMap<>();
sysProps.put("user.dir", mTestFolder.getRoot().getAbsolutePath());
try (Closeable p = new SystemPropertyRule(sysProps).toResource()) {
File localDir = mTestFolder.newFolder("localDir");
localDir.mkdir();
mFsShell.run("copyToLocal", "/testFile", "localDir");
Assert.assertEquals("Copied /testFile to file://" + mTestFolder.getRoot().getAbsolutePath()
+ "/localDir/testFile" + "\n", mOutput.toString());
}
}
@Test
public void copyToLocalLarge() throws Exception {
// Divide by 2 to avoid issues with async eviction.
copyToLocalWithBytes(SIZE_BYTES / 2);
}
@Test
public void copyToLocal() throws Exception {
copyToLocalWithBytes(10);
}
@Test
public void copyToLocalWildcardExistingDir() throws Exception {
String testDir = FileSystemShellUtilsTest.resetFileHierarchy(mFileSystem);
new File(mLocalAlluxioCluster.getAlluxioHome() + "/testDir").mkdir();
int ret = mFsShell.run("copyToLocal", testDir + "/*/foo*",
mLocalAlluxioCluster.getAlluxioHome() + "/testDir");
Assert.assertEquals(0, ret);
fileReadTest("/testDir/foobar1", 10);
fileReadTest("/testDir/foobar2", 20);
fileReadTest("/testDir/foobar3", 30);
}
@Test
public void copyToLocalWildcardHier() throws Exception {
String testDir = FileSystemShellUtilsTest.resetFileHierarchy(mFileSystem);
int ret = mFsShell
.run("copyToLocal", testDir + "/*", mLocalAlluxioCluster.getAlluxioHome() + "/testDir");
Assert.assertEquals(0, ret);
fileReadTest("/testDir/foo/foobar1", 10);
fileReadTest("/testDir/foo/foobar2", 20);
fileReadTest("/testDir/bar/foobar3", 30);
fileReadTest("/testDir/foobar4", 40);
}
@Test
public void copyToLocalWildcardNotDir() throws Exception {
String testDir = FileSystemShellUtilsTest.resetFileHierarchy(mFileSystem);
new File(mLocalAlluxioCluster.getAlluxioHome() + "/testDir").mkdir();
new File(mLocalAlluxioCluster.getAlluxioHome() + "/testDir/testFile").createNewFile();
int ret = mFsShell.run("copyToLocal", testDir + "/*/foo*",
mLocalAlluxioCluster.getAlluxioHome() + "/testDir/testFile");
Assert.assertEquals(-1, ret);
}
@Test
public void copyToLocalWildcard() throws Exception {
String testDir = FileSystemShellUtilsTest.resetFileHierarchy(mFileSystem);
int ret = mFsShell.run("copyToLocal", testDir + "/*/foo*",
mLocalAlluxioCluster.getAlluxioHome() + "/testDir");
Assert.assertEquals(0, ret);
fileReadTest("/testDir/foobar1", 10);
fileReadTest("/testDir/foobar2", 20);
fileReadTest("/testDir/foobar3", 30);
}
@Test
public void copyToLocalRelativePath() throws Exception {
HashMap<String, String> sysProps = new HashMap<>();
sysProps.put("user.dir", mTestFolder.getRoot().getAbsolutePath());
try (Closeable p = new SystemPropertyRule(sysProps).toResource()) {
FileSystemTestUtils.createByteFile(mFileSystem, "/testFile", WritePType.MUST_CACHE, 10);
mFsShell.run("copyToLocal", "/testFile", ".");
Assert.assertEquals("Copied /testFile to file://" + mTestFolder.getRoot().getAbsolutePath()
+ "/testFile" + "\n", mOutput.toString());
mOutput.reset();
mFsShell.run("copyToLocal", "/testFile", "./testFile");
Assert.assertEquals("Copied /testFile to file://" + mTestFolder.getRoot().getAbsolutePath()
+ "/testFile" + "\n", mOutput.toString());
}
}
@Test
public void parseOption() {
FileSystemTestUtils.createByteFile(mFileSystem, "/testFile", WritePType.MUST_CACHE,
10);
int ret = mFsShell.run("copyToLocal", "--buffersize", "1024", "/testFile",
mLocalAlluxioCluster.getAlluxioHome() + "/testFile");
Assert.assertEquals(0, ret);
}
}
| {
"content_hash": "5266e13fa524e05525c54dc514bbfc08",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 97,
"avg_line_length": 37.81021897810219,
"alnum_prop": 0.7046332046332047,
"repo_name": "madanadit/alluxio",
"id": "66c1d0c2fdd4c31c49f1a7fb4169e0615edb35c1",
"size": "5692",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/src/test/java/alluxio/client/cli/fs/command/CopyToLocalCommandIntegrationTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "10148"
},
{
"name": "Dockerfile",
"bytes": "2050"
},
{
"name": "Go",
"bytes": "24612"
},
{
"name": "HTML",
"bytes": "7039"
},
{
"name": "Java",
"bytes": "10202856"
},
{
"name": "JavaScript",
"bytes": "2801"
},
{
"name": "Python",
"bytes": "11519"
},
{
"name": "Roff",
"bytes": "5919"
},
{
"name": "Ruby",
"bytes": "19547"
},
{
"name": "Shell",
"bytes": "156163"
},
{
"name": "Smarty",
"bytes": "516"
},
{
"name": "TypeScript",
"bytes": "258402"
}
],
"symlink_target": ""
} |
package org.ike.wechat.core.menu.bean.selfmenu;
import com.google.gson.Gson;
import java.util.List;
/**
* Class Name: SelfMenuInfo
* Create Date: 2016/6/26 15:23
* Creator: Xuejia
* Version: v1.0
* Updater:
* Date Time:
* Description: 菜单信息实体类
*/
public class SelfMenuInfo {
private List<SelfButton> button; // 自定义按钮组
public List<SelfButton> getSelfButton() {
return button;
}
public void setSelfButton(List<SelfButton> selfButton) {
this.button = selfButton;
}
@Override
public String toString() {
return new Gson().toJson(this);
}
}
| {
"content_hash": "25b843eae95371a817ab5e33bfdf8f81",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 60,
"avg_line_length": 18.575757575757574,
"alnum_prop": 0.6476345840130505,
"repo_name": "xuejiacore/IkeChat",
"id": "955a318e598745bbe994cf1dd8fcacfdcf85482d",
"size": "827",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "IkeChat/src/main/java/org/ike/wechat/core/menu/bean/selfmenu/SelfMenuInfo.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "310029"
}
],
"symlink_target": ""
} |
package org.consensusj.exchange;
import javax.money.convert.ExchangeRateProvider;
/**
* ExchangeRateProvider extension that allows an observer to be notified of exchange rate updates
*/
public interface ObservableExchangeRateProvider extends ExchangeRateProvider {
void registerExchangeRateObserver(CurrencyUnitPair pair, ExchangeRateObserver observer);
void start();
void stop();
}
| {
"content_hash": "e629ea72dcd08d508608231f4876bde5",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 97,
"avg_line_length": 33.25,
"alnum_prop": 0.8070175438596491,
"repo_name": "msgilligan/bitcoinj-addons",
"id": "b56868feb1981f09837acbfb474b5997a9681019",
"size": "399",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "consensusj-exchange/src/main/java/org/consensusj/exchange/ObservableExchangeRateProvider.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "812"
},
{
"name": "Groovy",
"bytes": "110854"
},
{
"name": "HTML",
"bytes": "3367"
},
{
"name": "Java",
"bytes": "249846"
},
{
"name": "JavaScript",
"bytes": "1938"
},
{
"name": "Shell",
"bytes": "1127"
}
],
"symlink_target": ""
} |
<?php
/**
* Live Mailbox - PHPUnit tests.
*
* Runs tests on a live mailbox
*
* @author BAPCLTD-Marv
*/
declare(strict_types=1);
namespace PhpImap;
use ParagonIE\HiddenString\HiddenString;
/**
* @psalm-type MAILBOX_ARGS = array{
* 0:HiddenString,
* 1:HiddenString,
* 2:HiddenString,
* 3:string,
* 4?:string
* }
*/
trait LiveMailboxTestingTrait
{
/**
* Provides constructor arguments for a live mailbox.
*
* @psalm-return array{'CI ENV'?: array{0: \ParagonIE\HiddenString\HiddenString, 1: \ParagonIE\HiddenString\HiddenString, 2: \ParagonIE\HiddenString\HiddenString, 3: string}}
*
* @return (\ParagonIE\HiddenString\HiddenString|string)[][]
*/
public function MailBoxProvider(): array
{
$sets = [];
$imapPath = \getenv('PHPIMAP_IMAP_PATH');
$login = \getenv('PHPIMAP_LOGIN');
$password = \getenv('PHPIMAP_PASSWORD');
if (\is_string($imapPath) && \is_string($login) && \is_string($password)) {
$sets['CI ENV'] = [new HiddenString($imapPath), new HiddenString($login), new HiddenString($password, true, true), \sys_get_temp_dir()];
}
return $sets;
}
/**
* Get instance of Mailbox, pre-set to a random mailbox.
*
* @param string $attachmentsDir
* @param string $serverEncoding
*
* @return (Mailbox|\ParagonIE\HiddenString\HiddenString|string)[]
*
* @psalm-return array{0: Mailbox, 1: string, 2: \ParagonIE\HiddenString\HiddenString}
*/
protected function getMailbox(HiddenString $imapPath, HiddenString $login, HiddenString $password, $attachmentsDir, $serverEncoding = 'UTF-8'): array
{
$mailbox = new Mailbox($imapPath->getString(), $login->getString(), $password->getString(), $attachmentsDir, $serverEncoding);
$random = 'test-box-'.\date('c').\bin2hex(\random_bytes(4));
$mailbox->createMailbox($random);
$mailbox->switchMailbox($random, false);
return [$mailbox, $random, $imapPath];
}
/**
* @psalm-param MAILBOX_ARGS $mailbox_args
*
* @return mixed[]
*
* @psalm-return array{0:Mailbox, 1:string, 2:HiddenString}
*/
protected function getMailboxFromArgs(array $mailbox_args): array
{
[$path, $username, $password, $attachments_dir] = $mailbox_args;
return $this->getMailbox(
$path,
$username,
$password,
$attachments_dir,
$mailbox_args[4] ?? 'UTF-8'
);
}
}
| {
"content_hash": "b7c7ecaaee4e7223ff4a9066b1b9c0d5",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 178,
"avg_line_length": 28.122222222222224,
"alnum_prop": 0.6084551560647965,
"repo_name": "barbushin/php-imap",
"id": "3c084347ed7ae136e9481e9745a3505ffcf66d8d",
"size": "2531",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/unit/LiveMailboxTestingTrait.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "229603"
}
],
"symlink_target": ""
} |
package greedy;
import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
/**
* Question: http://www.geeksforgeeks.org/job-sequencing-problem-set-1-greedy-algorithm/
*/
public class JobSequencing {
public static int maxProfit(Integer[][] jobs) {
int profit = 0;
Arrays.sort(jobs, Comparator.comparing(o -> o[0]));
PriorityQueue<Integer[]> queue = new PriorityQueue<>(Comparator.comparing(o -> o[1]));
for (int i = 0; i < jobs.length; i++) {
int k = jobs[i][0];
if (queue.size() >= k && jobs[i][1] > queue.peek()[1]) {
queue.poll();
queue.offer(jobs[i]);
} else if (queue.size() < k) {
queue.offer(jobs[i]);
}
}
while (!queue.isEmpty()) {
profit += queue.poll()[1];
}
return profit;
}
}
| {
"content_hash": "edd6d8ec824ff46744fb84e31c1017fd",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 94,
"avg_line_length": 29.032258064516128,
"alnum_prop": 0.5333333333333333,
"repo_name": "scaffeinate/crack-the-code",
"id": "bf2995bcfa1b27ddd9c4996e7b74b51a9b577c25",
"size": "900",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "geeks-for-geeks/src/greedy/JobSequencing.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "800083"
},
{
"name": "Roff",
"bytes": "471"
}
],
"symlink_target": ""
} |
@class HouseDetailMemberModel;
@interface HouseDetailMemberCell : UITableViewCell
//静态构造方法
+ (instancetype)myHouseDetailMemberCellWithTableView: (UITableView *)tableView;
@property (nonatomic, strong) HouseDetailMemberModel *model; //模型属性
@end
| {
"content_hash": "ef2e5f78609e6e3df5805c60c4bac97b",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 79,
"avg_line_length": 40.666666666666664,
"alnum_prop": 0.8319672131147541,
"repo_name": "CQTWProgramme/cqtw",
"id": "f7ea7c5ea3f79a5963f3a6a040fa7542ad3b57ec",
"size": "427",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SkyNet/Class/Home/AccessControl/View/HouseDetailMemberCell.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "412"
},
{
"name": "Objective-C",
"bytes": "1608694"
}
],
"symlink_target": ""
} |
NO_OBJ=
FILESDIR= ${SHAREDIR}/bsdconfig/usermgmt
FILES= group_input.subr user_input.subr
beforeinstall:
mkdir -p ${DESTDIR}${FILESDIR}
.include <bsd.prog.mk>
| {
"content_hash": "29204c12d22f61062008b2f5acd37ea2",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 40,
"avg_line_length": 18.11111111111111,
"alnum_prop": 0.7361963190184049,
"repo_name": "dplbsd/soc2013",
"id": "cd69b3d901eec28a39905407148d3616248c5b03",
"size": "273",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "head/usr.sbin/bsdconfig/usermgmt/share/Makefile",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "AGS Script",
"bytes": "62471"
},
{
"name": "Assembly",
"bytes": "4478661"
},
{
"name": "Awk",
"bytes": "278525"
},
{
"name": "Batchfile",
"bytes": "20417"
},
{
"name": "C",
"bytes": "383420305"
},
{
"name": "C++",
"bytes": "72796771"
},
{
"name": "CSS",
"bytes": "109748"
},
{
"name": "ChucK",
"bytes": "39"
},
{
"name": "D",
"bytes": "3784"
},
{
"name": "DIGITAL Command Language",
"bytes": "10640"
},
{
"name": "DTrace",
"bytes": "2311027"
},
{
"name": "Emacs Lisp",
"bytes": "65902"
},
{
"name": "EmberScript",
"bytes": "286"
},
{
"name": "Forth",
"bytes": "184405"
},
{
"name": "GAP",
"bytes": "72156"
},
{
"name": "Groff",
"bytes": "32248806"
},
{
"name": "HTML",
"bytes": "6749816"
},
{
"name": "IGOR Pro",
"bytes": "6301"
},
{
"name": "Java",
"bytes": "112547"
},
{
"name": "KRL",
"bytes": "4950"
},
{
"name": "Lex",
"bytes": "398817"
},
{
"name": "Limbo",
"bytes": "3583"
},
{
"name": "Logos",
"bytes": "187900"
},
{
"name": "Makefile",
"bytes": "3551839"
},
{
"name": "Mathematica",
"bytes": "9556"
},
{
"name": "Max",
"bytes": "4178"
},
{
"name": "Module Management System",
"bytes": "817"
},
{
"name": "NSIS",
"bytes": "3383"
},
{
"name": "Objective-C",
"bytes": "836351"
},
{
"name": "PHP",
"bytes": "6649"
},
{
"name": "Perl",
"bytes": "5530761"
},
{
"name": "Perl6",
"bytes": "41802"
},
{
"name": "PostScript",
"bytes": "140088"
},
{
"name": "Prolog",
"bytes": "29514"
},
{
"name": "Protocol Buffer",
"bytes": "61933"
},
{
"name": "Python",
"bytes": "299247"
},
{
"name": "R",
"bytes": "764"
},
{
"name": "Rebol",
"bytes": "738"
},
{
"name": "Ruby",
"bytes": "45958"
},
{
"name": "Scilab",
"bytes": "197"
},
{
"name": "Shell",
"bytes": "10501540"
},
{
"name": "SourcePawn",
"bytes": "463194"
},
{
"name": "SuperCollider",
"bytes": "80208"
},
{
"name": "Tcl",
"bytes": "80913"
},
{
"name": "TeX",
"bytes": "719821"
},
{
"name": "VimL",
"bytes": "22201"
},
{
"name": "XS",
"bytes": "25451"
},
{
"name": "XSLT",
"bytes": "31488"
},
{
"name": "Yacc",
"bytes": "1857830"
}
],
"symlink_target": ""
} |
#ifndef HKP_CONSTRAINT_CHAIN_LENGTH_UTIL_H
#define HKP_CONSTRAINT_CHAIN_LENGTH_UTIL_H
#include <Physics2012/Dynamics/Constraint/Chain/hkpConstraintChainInstance.h>
#include <Physics2012/Dynamics/Constraint/Chain/BallSocket/hkpBallSocketChainData.h>
#include <Physics2012/Dynamics/Entity/hkpRigidBodyCinfo.h>
class hkpConstraintChainInstance;
class hkpBallSocketChainData;
class hkpConstraintChainLengthUtil
{
public:
HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR(HK_MEMORY_CLASS_DEMO, hkpConstraintChainLengthUtil);
struct RopeInfo
{
HK_DECLARE_NONVIRTUAL_CLASS_ALLOCATOR(HK_MEMORY_CLASS_DEMO, hkpConstraintChainLengthUtil::RopeInfo);
hkVector4 m_settings; // cableCrossSection, materialDensity, segmentLength, materialStretchingConstant
hkSimdReal m_inertiaMultiplier;
RopeInfo()
{
m_settings.set( 28.0f * 1e-4f, // [m2]
6.7f * 1e3f, // [kg/m3]
0.30f, // [m]
280.0f * 1e6f); // [N]
m_inertiaMultiplier = hkSimdReal_1;
}
HK_FORCE_INLINE const hkSimdReal getCableCrossSection() const { return m_settings.getComponent<0>(); }
HK_FORCE_INLINE const hkSimdReal getMaterialDensity() const { return m_settings.getComponent<1>(); }
HK_FORCE_INLINE const hkSimdReal getSegmentLength() const { return m_settings.getComponent<2>(); }
HK_FORCE_INLINE const hkSimdReal getMaterialStretching() const { return m_settings.getComponent<3>(); }
};
RopeInfo m_ropeInfo;
hkVector4 m_pivotOnCrane;
hkpRigidBodyCinfo m_segmentCinfo;
hkpConstraintChainInstance* m_instance;
hkSimdReal m_currentUnstretchedLength;
int m_numLoadBodies;
private:
hkpConstraintChainLengthUtil(); // only allow creation via create functions.
public:
// Creates rope from hook, to crane pivot. Sets the unstretched length of the rope to the exact distance from load to crane pivot.
// A length rope of at least two segmentLengths is needed, otherwise it should auto add extra segments.
hkpConstraintChainLengthUtil(const RopeInfo& info, hkpRigidBody* craneBody, hkVector4Parameter pivotOnCrane, hkVector4Parameter ropeEndInWorld);
~hkpConstraintChainLengthUtil();
void attachHook(hkpRigidBody* hookBody, hkVector4Parameter pivotOnHook);
void attachLoad(hkpRigidBody* loadBody, hkVector4Parameter pivotOnLoad, hkVector4Parameter pivotOnHook);
void detachHookOrLoad();
HK_FORCE_INLINE const hkSimdReal getUnstretchedLength() { return m_currentUnstretchedLength; }
void setUnstretchedLength(hkSimdRealParameter length);
void updatePivotOnStretchedRope(); // just use the stretch above. simple. // consider also multiplying the inertia of the topmost element to compensate for the longer arm.
void updateChainProperties(hkSimdRealParameter solverStepDeltaTime, int numSolverMicroSteps, hkSimdRealParameter solverTau);
void getRopeBodies(hkArray<hkpRigidBody*>& ropeBodies);
hkpBallSocketChainData* getChainData() { return (hkpBallSocketChainData*)m_instance->getData(); }
const hkpBallSocketChainData* getChainData() const { return (const hkpBallSocketChainData*)m_instance->getData(); }
const hkVector4 getSegmentAPivot() const { hkVector4 p; p.setMul(hkVector4::getConstant<HK_QUADREAL_0010>(), hkSimdReal_Inv2 * m_ropeInfo.getSegmentLength()); return p; }
const hkVector4 getSegmentBPivot() const { hkVector4 p; p.setMul(hkVector4::getConstant<HK_QUADREAL_0010>(),-hkSimdReal_Inv2 * m_ropeInfo.getSegmentLength()); return p; }
int getNumSegments(hkSimdRealParameter length) const;
const hkVector4 getLastSegmentAPivot() const;
const hkSimdReal getStretchAtCraneLess1() const;
const hkSimdReal getStretchAtCrane() const;
private:
void updateConstraintInstanceBaseEntities(hkpConstraintChainInstance* chain);
};
#endif // HKP_CONSTRAINT_CHAIN_LENGTH_UTIL_H
/*
* Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20140907)
*
* Confidential Information of Havok. (C) Copyright 1999-2014
* Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
* Logo, and the Havok buzzsaw logo are trademarks of Havok. Title, ownership
* rights, and intellectual property rights in the Havok software remain in
* Havok and/or its suppliers.
*
* Use of this software for evaluation purposes is subject to and indicates
* acceptance of the End User licence Agreement for this product. A copy of
* the license is included with this software and is also available at www.havok.com/tryhavok.
*
*/
| {
"content_hash": "6beaf3ca79518a194e9f4e5c69467238",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 173,
"avg_line_length": 38.582608695652176,
"alnum_prop": 0.771692585080009,
"repo_name": "wobbier/source3-engine",
"id": "fa9688e274223dbd2eafffb0a6ad8d66a65fb928",
"size": "4952",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ThirdParty/Havok/include/Physics2012/Dynamics/Constraint/Util/hkpConstraintChainLengthUtil.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "3557979"
},
{
"name": "C++",
"bytes": "14933752"
},
{
"name": "Objective-C",
"bytes": "28588"
},
{
"name": "Shell",
"bytes": "1260"
}
],
"symlink_target": ""
} |
var config = require("./config.json");
var Discord = require("discord.js");
var bot = new Discord.Client();
var stringArgv = require('string-argv');
var humanizeDuration = require('humanize-duration');
var Youtube = require("youtube-api");
Youtube.authenticate({
type: "oauth",
refresh_token: config.youtube.refreshToken,
client_id: config.youtube.clientId,
client_secret: config.youtube.clientSecret,
redirect_url: config.youtube.redirectUrl
});
var TTTplayerlist = [];
var CSGOplayerlist = [];
bot.login(config.token);
bot.on('ready', () => {
var game = new Discord.Game({name : "!info", type : 1});
var pres = new Discord.Presence({status : "online", game : game});
bot.user.setPresence(pres);
console.log('I am ready!');
});
bot.on("message", msg => {
if (msg.author.bot) return;
if (!msg.guild) {
msg.reply('Please send Message in Guild!');
return;
}
var prefix = "!";
var args = stringArgv.parseArgsStringToArgv(msg.content);
var cmd = "";
if(args != undefined && args.length > 0){
var cmd = args[0].toLowerCase();
}
args = args.filter(a => a !== cmd);
addYoutubeVideoToPlaylist("music", msg, config.youtube.playlistId);
if(cmd.startsWith(prefix + "info")){
var ut = humanizeDuration(Math.round(bot.uptime / 1000)*1000);
msg.reply("If you found a bug or have a nice idea, please contact me or create an issue on GitHub!\n- Mail: " + config.mail + "\n- Repository: " + config.repo + "\n - Bot-Uptime: " + ut + "\n - Youtube-Playlist: https://www.youtube.com/playlist?list=" + config.youtube.playlistId + "\n - Commands: \n**!ttt [add *username*]** - prints question/players and adds you [or the username] to the TTT-playerlist\n**!ttt rm [*username*]** - removes you [or the username] from the TTT-playerlist\n**!ttt clear** - clears the TTT-playerlist\n**!csgo [add *username*]** - prints question/players and adds you [or the username] to the CS:GO-playerlist\n**!csgo rm [*username*]** - removes you [or the username] from the CS:GO-playerlist\n**!csgo clear** - clears the CS:GO-playerlist\n**!pin** - copies the last message to #pinned\n**!pin n** - copies the nth last message from the most recent one to #pinned\n**!pin ID** - copies the message with ID to #pinned\n**!applaus** - send Merkel-Meme\n\n");
}
else if(cmd.startsWith(prefix + "ttt")){
var func = args[0];
if(args[1]){
name = args[1];
}
else if(args[0] && args[0] != "rm" && args[0] != "clear"){
name = args[0];
}
else {
name = msg.author.username;
}
var usr = {name: name, date: Date.now()};
if(TTTplayerlist.length > 0){
var ms = Date.now() - TTTplayerlist[TTTplayerlist.length - 1].date;
if(ms > 28800000){
TTTplayerlist = [];
msg.reply("TTT-Playerlist cleared because the last entry was 8 hours ago.");
}
else {
var msgs = Array.from(msg.channel.messages.values());
msgs = msgs.filter(x => x.author.username == bot.user.username
&& x.content.startsWith('Do you want to play Garry'));
if(msgs.length > 0){
msgs.forEach(x => x.delete());
}
}
}
msg.delete();
TTTplayerlist = TTTplayerlist.filter(e => e.name !== name);
switch (func) {
case "rm":
printPlayerlist(msg, "Garry's Mod - Trouble in Terrorist Town", TTTplayerlist);
break;
case "clear":
TTTplayerlist = [];
break;
default:
TTTplayerlist.push(usr);
printPlayerlist(msg, "Garry's Mod - Trouble in Terrorist Town", TTTplayerlist);
break;
}
}
else if(cmd.startsWith(prefix + "csgo")){
var func = args[0];
if(args[1]){
name = args[1];
}
else if(args[0] && args[0] != "rm" && args[0] != "clear"){
name = args[0];
}
else {
name = msg.author.username;
}
var usr = {name: name, date: Date.now()};
if(CSGOplayerlist.length > 0){
var ms = Date.now() - CSGOplayerlist[CSGOplayerlist.length - 1].date;
if(ms > 28800000){
CSGOplayerlist = [];
msg.reply("CSGOPlayerlist cleared because the last entry was 8 hours ago.");
}
else {
var msgs = Array.from(msg.channel.messages.values());
msgs = msgs.filter(x => x.author.username == bot.user.username
&& x.content.startsWith('Do you want to play Counter Strike'));
if(msgs.length > 0){
msgs.forEach(x => x.delete());
}
}
}
msg.delete();
CSGOplayerlist = CSGOplayerlist.filter(e => e.name !== name);
switch (func) {
case "rm":
printPlayerlist(msg, "Counter Strike: Global Offensive", CSGOplayerlist);
break;
case "clear":
CSGOplayerlist = [];
break;
default:
CSGOplayerlist.push(usr);
printPlayerlist(msg, "Counter Strike: Global Offensive", CSGOplayerlist);
break;
}
}
else if(cmd.startsWith(prefix + "pin")){
if(args[0] && args[0] > 100){
var msgID = args[0];
msg.channel.fetchMessage(args[0])
.then(message => {
pinMessage(msg, message);
})
.catch(err => {
msg.reply("ERROR: " + err);
});
}
else if(args[0] && args[0] < 100) {
var steps = parseInt(args[0]) + 1;
var messages = msg.channel.messages.array();
var message = messages[messages.length - steps];
pinMessage(msg, message);
}
else {
var messages = msg.channel.messages.array();
var message = messages[messages.length - 2];
pinMessage(msg, message);
}
}
else if(cmd.startsWith(prefix + "applaus")){
msg.channel.sendFile("https://s-media-cache-ak0.pinimg.com/originals/89/1d/5c/891d5c08d30e39688f83f1bff67348a2.jpg", "applaus.jpg");
}
});
function pinMessage (msg, message) {
var pinned = msg.guild.channels.find("id", config.pinnedID);
if(pinned && msg && message){
var attachments = message.attachments.array()
var content = '"' + message.content + '" - ' + message.author.username;
attachments.forEach(attachment => {
content = content + "\n" + attachment.url;
});
pinned.sendMessage(content);
}
else {
var output = "";
if(!msg){
output = output + "msg ";
}
if(!message){
output = output + "message ";
}
if(!pinned){
output = output + "pinned ";
}
msg.reply(output + " not found!");
}
}
function printPlayerlist (msg, name, playerlist) {
msg.channel.sendMessage("Do you want to play " + name + "? Playerlist [" + playerlist.length + "]:\n" + printPlayerlistEntries(playerlist));
}
function printPlayerlistEntries(arr) {
var str = "";
arr.forEach(e => {
var date = new Date(e.date);
str = str.concat(" - " + e.name + "\n");
});
return str;
}
function addYoutubeVideoToPlaylist(channelname, msg, playlistid){
if(msg.channel.name == channelname){
if(msg.content.includes("youtu")){
var match = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/.exec(msg.content);
if(match != undefined && match.length > 0){
var id = /(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i.exec(match[0])
if(id != undefined && id.length > 0){
id = id[1];
var req = Youtube.playlistItems.list(
{
part: "snippet",
playlistId: playlistid
},
(err, data) => {
if (err){
msg.reply("ERROR: Youtube.playListItems.list: " + err + data);
return;
}
var ids = [];
data.items.forEach(i => {
ids.push(i.snippet.resourceId.videoId);
});
if(ids.indexOf(id) == -1){
Youtube.playlistItems.insert({
part: "snippet",
resource: {
snippet: {
playlistId: playlistid,
resourceId: {
kind: "youtube#video",
videoId: id
}
}
}
}, (err, data) => {
if (err){
msg.reply("Youtube.playlistItems.insert: " + err + data);
return;
}
});
}
});
}
}
}
}
} | {
"content_hash": "0437c61ed5c0de5d516c099e10684c14",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 994,
"avg_line_length": 28.847014925373134,
"alnum_prop": 0.6074246539904281,
"repo_name": "darkson95/Discocks",
"id": "a93976e9f7e9e21aa1b9ffa82fe1de3d7158a43f",
"size": "7731",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "7731"
}
],
"symlink_target": ""
} |
<?php
namespace SilverStripe\CMS\Controllers;
use Page;
use SilverStripe\Admin\LeftAndMain;
use SilverStripe\CampaignAdmin\AddToCampaignHandler;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Control\Controller;
use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\HTTPResponse;
use SilverStripe\Forms\Form;
use SilverStripe\ORM\ArrayLib;
use SilverStripe\ORM\FieldType\DBHTMLText;
use SilverStripe\ORM\ValidationResult;
/**
* @package cms
*/
class CMSPageEditController extends CMSMain
{
private static $url_segment = 'pages/edit';
private static $url_rule = '/$Action/$ID/$OtherID';
private static $url_priority = 41;
private static $required_permission_codes = 'CMS_ACCESS_CMSMain';
private static $allowed_actions = [
'AddToCampaignForm',
];
public function getClientConfig()
{
return ArrayLib::array_merge_recursive(parent::getClientConfig(), [
'form' => [
'AddToCampaignForm' => [
'schemaUrl' => $this->Link('schema/AddToCampaignForm'),
],
'editorInternalLink' => [
'schemaUrl' => LeftAndMain::singleton()
->Link('methodSchema/Modals/editorInternalLink'),
],
'editorAnchorLink' => [
'schemaUrl' => LeftAndMain::singleton()
->Link('methodSchema/Modals/editorAnchorLink/:pageid'),
],
],
]);
}
/**
* Action handler for adding pages to a campaign
*
* @param array $data
* @param Form $form
* @return DBHTMLText|HTTPResponse
*/
public function addtocampaign($data, $form)
{
$id = $data['ID'];
$record = \Page::get()->byID($id);
$handler = AddToCampaignHandler::create($this, $record);
$results = $handler->addToCampaign($record, $data);
if (is_null($results)) {
return null;
}
if ($this->getSchemaRequested()) {
// Send extra "message" data with schema response
$extraData = ['message' => $results];
$schemaId = Controller::join_links($this->Link('schema/AddToCampaignForm'), $id);
return $this->getSchemaResponse($schemaId, $form, null, $extraData);
}
return $results;
}
/**
* Url handler for add to campaign form
*
* @param HTTPRequest $request
* @return Form
*/
public function AddToCampaignForm($request)
{
// Get ID either from posted back value, or url parameter
$id = $request->param('ID') ?: $request->postVar('ID');
return $this->getAddToCampaignForm($id);
}
/**
* @param int $id
* @return Form
*/
public function getAddToCampaignForm($id)
{
// Get record-specific fields
$record = SiteTree::get()->byID($id);
if (!$record) {
$this->httpError(404, _t(
__CLASS__ . '.ErrorNotFound',
'That {Type} couldn\'t be found',
'',
['Type' => Page::singleton()->i18n_singular_name()]
));
return null;
}
if (!$record->canView()) {
$this->httpError(403, _t(
__CLASS__.'.ErrorItemPermissionDenied',
'It seems you don\'t have the necessary permissions to add {ObjectTitle} to a campaign',
'',
['ObjectTitle' => Page::singleton()->i18n_singular_name()]
));
return null;
}
$handler = AddToCampaignHandler::create($this, $record);
$form = $handler->Form($record);
$form->setValidationResponseCallback(function (ValidationResult $errors) use ($form, $id) {
$schemaId = Controller::join_links($this->Link('schema/AddToCampaignForm'), $id);
return $this->getSchemaResponse($schemaId, $form, $errors);
});
return $form;
}
}
| {
"content_hash": "cd37a9d40d7b69757b4c5d9d58a06f27",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 104,
"avg_line_length": 30.24812030075188,
"alnum_prop": 0.5602783992045737,
"repo_name": "silverstripe/silverstripe-cms",
"id": "9e8c47764508924792af6d021d5e717fc6e0bd8b",
"size": "4023",
"binary": false,
"copies": "1",
"ref": "refs/heads/4",
"path": "code/Controllers/CMSPageEditController.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Gherkin",
"bytes": "38314"
},
{
"name": "JavaScript",
"bytes": "204088"
},
{
"name": "PHP",
"bytes": "751900"
},
{
"name": "SCSS",
"bytes": "6182"
},
{
"name": "Scheme",
"bytes": "22139"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="groups_10.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
| {
"content_hash": "4d72517a2bfdf001862c24f14e3d9b4c",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 121,
"avg_line_length": 39.11538461538461,
"alnum_prop": 0.7059980334316618,
"repo_name": "lucasbrsa/OpenCV-3.2",
"id": "ddd822ff0db91045b5b2084f4d975557459265c3",
"size": "1017",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/3.2/search/groups_10.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "320592"
},
{
"name": "C#",
"bytes": "12756"
},
{
"name": "C++",
"bytes": "499322"
},
{
"name": "CMake",
"bytes": "244871"
},
{
"name": "Makefile",
"bytes": "344335"
},
{
"name": "Python",
"bytes": "7735"
},
{
"name": "Visual Basic",
"bytes": "13139"
}
],
"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.
// ----------------------------------------------------------------------------------
namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
{
using System;
using System.Management.Automation;
/// <summary>
/// Base class for resource lock management cmdlets.
/// </summary>
public abstract class ResourceLockManagementCmdletBase : ResourceManagerCmdletBase
{
/// <summary>
/// The resource group level resource lock.
/// </summary>
internal const string ScopeLevelLock = "A lock at the specified scope.";
/// <summary>
/// The resource group level resource lock.
/// </summary>
internal const string ResourceGroupResourceLevelLock = "A lock at the resource group resource scope.";
/// <summary>
/// The subscription level resource lock.
/// </summary>
internal const string SubscriptionResourceLevelLock = "A lock at the subscription resource scope.";
/// <summary>
/// The tenant level resource lock patameter set.
/// </summary>
internal const string TenantResourceLevelLock = "A lock at the tenant resource scope.";
/// <summary>
/// The resource group lock parametere set.
/// </summary>
internal const string ResourceGroupLevelLock = "A lock at the resource group scope.";
/// <summary>
/// The subscription lock parameter set.
/// </summary>
internal const string SubscriptionLevelLock = "A lock at the subscription scope.";
/// <summary>
/// Gets or sets the scope.
/// </summary>
[Alias("Id")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ScopeLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The scope. e.g. to specify a database '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaserName}', to specify a resoruce group: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'")]
[ValidateNotNullOrEmpty]
public string Scope { get; set; }
/// <summary>
/// Gets or sets the extension resource name parameter.
/// </summary>
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource name. e.g. to specify a database MyServer/MyDatabase.")]
[ValidateNotNullOrEmpty]
public string ResourceName { get; set; }
/// <summary>
/// Gets or sets the resource type parameter.
/// </summary>
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource type. e.g. Microsoft.Sql/Servers/Databases.")]
[ValidateNotNullOrEmpty]
public string ResourceType { get; set; }
/// <summary>
/// Gets or sets the subscription id parameter.
/// </summary>
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = false, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The subscription to use.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = false, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The subscription to use.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.SubscriptionLevelLock, Mandatory = false, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The subscription to use.")]
[ValidateNotNullOrEmpty]
public Guid? SubscriptionId { get; set; }
/// <summary>
/// Gets or sets the resource group name parameter.
/// </summary>
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupResourceLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")]
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.ResourceGroupLevelLock, Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "The resource group name.")]
[ValidateNotNullOrEmpty]
public string ResourceGroupName { get; set; }
/// <summary>
/// Gets or sets the tenant level parameter.
/// </summary>
[Parameter(ParameterSetName = ResourceLockManagementCmdletBase.TenantResourceLevelLock, Mandatory = true, HelpMessage = "Indicates that this is a tenant level operation.")]
public SwitchParameter TenantLevel { get; set; }
/// <summary>
/// Initializes the default subscription id if needed.
/// </summary>
protected override void OnProcessRecord()
{
if (string.IsNullOrWhiteSpace(this.Scope) && this.SubscriptionId == null && !this.TenantLevel)
{
this.SubscriptionId = this.Profile.Context.Subscription.Id;
}
base.OnProcessRecord();
}
}
} | {
"content_hash": "9df451bf861b60844855c5fc4a3b6aa2",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 439,
"avg_line_length": 58.94017094017094,
"alnum_prop": 0.6889501160092807,
"repo_name": "kagamsft/azure-powershell",
"id": "8a02e36c0f5efd2f38849efe7d2c0194c090f97b",
"size": "6898",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/ResourceLockManagementCmdletBase.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "15118"
},
{
"name": "C#",
"bytes": "19360314"
},
{
"name": "HTML",
"bytes": "209"
},
{
"name": "JavaScript",
"bytes": "4979"
},
{
"name": "PHP",
"bytes": "41"
},
{
"name": "PowerShell",
"bytes": "1304704"
},
{
"name": "Shell",
"bytes": "50"
}
],
"symlink_target": ""
} |
using System;
using Stranne.BooliLib.Models;
using Stranne.BooliLib.Tests.Json;
using Stranne.BooliLib.Tests.Models;
using Xunit;
namespace Stranne.BooliLib.Tests.JsonParsing
{
[Trait("Area", "Json")]
public class ListingsSingleJsonTest : BaseJsonTest
{
protected override JsonFile JsonFile => JsonFile.ListingsSingle;
public static TheoryData TestParameters => new TheoryData<string, object>
{
{ "Listings", 1 },
{ "Listings[0].BooliId", 2338291 },
{ "Listings[0].ListPrice", 4675000d },
{ "Listings[0].Published", new DateTimeOffset(2017, 05, 26, 15, 21, 30, new TimeSpan(2, 0, 0)) },
{ "Listings[0].Source.Id", 1499 },
{ "Listings[0].Source.Name", "BOSTHLM" },
{ "Listings[0].Source.Url", "http://www.bosthlm.se/" },
{ "Listings[0].Source.Type", "Broker" },
{ "Listings[0].Location.NamedAreas", 1 },
{ "Listings[0].Location.NamedAreas[0]", "Vasastan" },
{ "Listings[0].Location.Address.StreetAddress", "Roslagsgatan 23" },
{ "Listings[0].Location.Address.City", null },
{ "Listings[0].Location.Region.MunicipalityName", "Stockholm" },
{ "Listings[0].Location.Region.CountyName", "Stockholms län" },
{ "Listings[0].Location.Position.Latitude", 59.34733169d },
{ "Listings[0].Location.Position.Longitude", 18.05882873d },
{ "Listings[0].Location.Position.IsApproximate", null },
{ "Listings[0].Location.Distance.Ocean", null },
{ "Listings[0].ObjectType", ObjectType.Lägenhet },
{ "Listings[0].IsNewConstruction", true },
{ "Listings[0].Rooms", 2f },
{ "Listings[0].LivingArea", 50.5f },
{ "Listings[0].AdditionalArea", null },
{ "Listings[0].PlotArea", null },
{ "Listings[0].Rent", 2382f },
{ "Listings[0].Floor", 3f },
{ "Listings[0].ApartmentNumber", null },
{ "Listings[0].ConstructionYear", null },
{ "Listings[0].Url", "https://www.booli.se/annons/2338291" },
{ "Listings[0].Pageviews", 55 }
};
[Theory, MemberData(nameof(TestParameters))]
public void ListingsSingleJsonParsing(string property, object expected)
{
TestValue<ListingsRoot>(property, expected);
}
}
}
| {
"content_hash": "97a43b95aab1eba21c09ca2d7cc44aee",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 109,
"avg_line_length": 42.666666666666664,
"alnum_prop": 0.5736019736842105,
"repo_name": "stranne/BooliLib",
"id": "eb5e1a376985a9a3cbd1abb0d5d8e32ff188a479",
"size": "2436",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Stranne.BooliLib.Tests/JsonParsing/ListingsSingleJsonTest.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "132291"
},
{
"name": "PowerShell",
"bytes": "1136"
}
],
"symlink_target": ""
} |
package com.sequenceiq.it.cloudbreak.action.v4.environment;
import com.sequenceiq.it.cloudbreak.EnvironmentClient;
import com.sequenceiq.it.cloudbreak.action.Action;
import com.sequenceiq.it.cloudbreak.context.TestContext;
import com.sequenceiq.it.cloudbreak.dto.environment.EnvironmentTestDto;
import com.sequenceiq.it.cloudbreak.log.Log;
public class EnvironmentListAction implements Action<EnvironmentTestDto, EnvironmentClient> {
@Override
public EnvironmentTestDto action(TestContext testContext, EnvironmentTestDto testDto, EnvironmentClient environmentClient) throws Exception {
testDto.setResponseSimpleEnvSet(
environmentClient.getDefaultClient()
.environmentV1Endpoint()
.list().getResponses());
Log.whenJson("Environment list response: ", testDto.getResponse());
return testDto;
}
} | {
"content_hash": "f3e16e6c931d5b43f21fe1c6d9bfacc1",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 145,
"avg_line_length": 44.8,
"alnum_prop": 0.7511160714285714,
"repo_name": "hortonworks/cloudbreak",
"id": "4826143bdda8c0c31d91552cbb8933c25ceab76a",
"size": "896",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "integration-test/src/main/java/com/sequenceiq/it/cloudbreak/action/v4/environment/EnvironmentListAction.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "7535"
},
{
"name": "Dockerfile",
"bytes": "9586"
},
{
"name": "Fluent",
"bytes": "10"
},
{
"name": "FreeMarker",
"bytes": "395982"
},
{
"name": "Groovy",
"bytes": "523"
},
{
"name": "HTML",
"bytes": "9917"
},
{
"name": "Java",
"bytes": "55250904"
},
{
"name": "JavaScript",
"bytes": "47923"
},
{
"name": "Jinja",
"bytes": "190660"
},
{
"name": "Makefile",
"bytes": "8537"
},
{
"name": "PLpgSQL",
"bytes": "1830"
},
{
"name": "Perl",
"bytes": "17726"
},
{
"name": "Python",
"bytes": "29898"
},
{
"name": "SaltStack",
"bytes": "222692"
},
{
"name": "Scala",
"bytes": "11168"
},
{
"name": "Shell",
"bytes": "416225"
}
],
"symlink_target": ""
} |
<template name="MasterLayout">
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navigationbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">miniPIMS</a>
</div>
<div class="collapse navbar-collapse" id="navigationbar">
<ul class="nav navbar-nav navbar-right">
<li>{{#linkTo route="home"}}Home{{/linkTo}}</li>
<li>{{#linkTo route="patientsList"}}Patients{{/linkTo}}</li>
<li>{{#linkTo route="createPatient"}}Create a New Patient{{/linkTo}}</li>
</ul>
</div>
</div>
</nav>
<div class="container" style="margin-top:40px">
{{> yield}}
</div>
<nav class="navbar navbar-default navbar-fixed-bottom">
<div class="container">
<ul class="nav navbar-nav navbar-right">
<li>©IDEXX Laboratories - Built with Meteor</li>
</ul>
</div>
</nav>
</template>
| {
"content_hash": "fc546e6ee659b491cc2003c186edcb01",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 104,
"avg_line_length": 38.25,
"alnum_prop": 0.5890522875816994,
"repo_name": "TransWebT/miniPIMS",
"id": "9f94d6b3b9c0d0c1687c8dd9d29146e284a597d3",
"size": "1224",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/client/templates/layouts/master_layout/master_layout.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "788"
},
{
"name": "HTML",
"bytes": "3068"
},
{
"name": "JavaScript",
"bytes": "8500"
},
{
"name": "Shell",
"bytes": "698"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ipc: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / extra-dev</a></li>
<li class="active"><a href="">dev / ipc - 8.7.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
ipc
<small>
8.7.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-03-10 06:33:29 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-03-10 06:33:29 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 dev Formal proof management system
dune 3.0.3 Fast, portable, and opinionated build system
ocaml 4.08.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.08.1 Official release 4.08.1
ocaml-config 1 OCaml Switch Configuration
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: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/ipc"
license: "Unknown"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/IPC"]
depends: [
"ocaml"
"coq" {>= "8.7" & < "8.8~"}
]
tags: [
"keyword: intuitionistic logic"
"keyword: proof search"
"keyword: proof-as-programs"
"keyword: correct-by-construction"
"keyword: program verification"
"keyword: program extraction"
"category: Mathematics/Logic/Foundations"
"category: Computer Science/Decision Procedures and Certified Algorithms/Decision procedures"
"category: Miscellaneous/Extracted Programs/Decision procedures"
]
authors: [ "Klaus Weich" ]
bug-reports: "https://github.com/coq-contribs/ipc/issues"
dev-repo: "git+https://github.com/coq-contribs/ipc.git"
synopsis: "Intuitionistic Propositional Checker"
description: """
This development treats proof search in intuitionistic propositional logic,
a fragment of any constructive type theory. We present new and more
efficient decision procedures for intuitionistic propositional
logic. They themselves are given by (non-formal) constructive proofs.
We take one of them to demonstrate that constructive type theory can
be used in practice to develop a real, efficient, but error-free proof
searcher. This was done by formally proving the decidability of
intuitionistic propositional logic in Coq; the proof searcher was
automatically extracted."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/ipc/archive/v8.7.0.tar.gz"
checksum: "md5=2decb894bffbd256b5b0e6d042da2ae1"
}
</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-ipc.8.7.0 coq.dev</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is dev).
The following dependencies couldn't be met:
- coq-ipc -> coq < 8.8~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-ipc.8.7.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "c6a35f7b1570fd51b5f3e415f31c98e3",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 159,
"avg_line_length": 42.05464480874317,
"alnum_prop": 0.569516632016632,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "74a55d046b4c5ad0274ca9a64acd7320c41da3b6",
"size": "7721",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.08.1-2.0.5/extra-dev/dev/ipc/8.7.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<recipeml version="0.5">
<recipe>
<head>
<title>Acapulco Chicken (En Escabeche)</title>
<categories>
<cat>Poultry</cat></categories>
<yield>6</yield></head>
<ingredients>
<ing>
<amt>
<qty>2</qty>
<unit>cups</unit></amt>
<item>Unsalted chicken broth; defatted</item></ing>
<ing>
<amt>
<qty>1</qty>
<unit>tablespoon</unit></amt>
<item>Olive oil</item></ing>
<ing>
<amt>
<qty>2</qty>
<unit>teaspoons</unit></amt>
<item>Ground cumin</item></ing>
<ing>
<amt>
<qty>2</qty>
<unit>tablespoons</unit></amt>
<item>Pickling spice</item></ing>
<ing>
<amt>
<qty>1/2</qty>
<unit/></amt>
<item>Red bell pepper; sliced</item></ing>
<ing>
<amt>
<qty>1</qty>
<unit>pound</unit></amt>
<item>Boneless chicken breast halves</item></ing>
<ing>
<amt>
<qty>1/2</qty>
<unit/></amt>
<item>Yellow bell pepper; sliced</item></ing>
<ing>
<amt>
<qty>2</qty>
<unit>tablespoons</unit></amt>
<item>Minced jalapeno chili with seeds</item></ing>
<ing>
<amt>
<qty>1</qty>
<unit/></amt>
<item>Onion; halved, thinly sliced</item></ing>
<ing>
<amt>
<qty>1/3</qty>
<unit>cups</unit></amt>
<item>Rice wine vinegar</item></ing>
<ing>
<amt>
<qty>1/4</qty>
<unit>cups</unit></amt>
<item>Fresh cilantro leaves</item></ing>
<ing>
<amt>
<qty>3</qty>
<unit>large</unit></amt>
<item>Garlic cloves; minced</item></ing>
<ing>
<amt>
<qty/>
<unit/></amt>
<item>Baked (no oil) tortilla chips</item></ing></ingredients>
<directions>
<step> Boil broth and pickling spice in heavy large saucepan ten minutes. Strain
and return liquid to saucepan. Add chicken, onion, vinegar, garlic, oil
and cumin to pan. Simmer over very low heat until chicken is just cooked
through, about ten minutes. Transfer chicken and onions to shallow dish.
Top with bell peppers and minced chilli. Boil cooking liquid until reduced
to 2/3 c, about ten minutes. Pour liquid over chicken and let cool 30
minutes. Add cilantro to chicken mixture. Cover and refrigerate until well
chilled, turning chicken occasionally, about 4 hours (can be prepared one
day ahead). Slice chicken and transfer to plates. Top with marinated
vegetables and some of the juices. Pass tortilla chips to use as "pushers."
130 calories per serving, 4 g fat, 72 mg sodium, 44 mg cholesterol. From
Bon Appetit's Light & Easy Mar '93.
Makes 6 servings
Date: 6/28/96 7:27 AM
From: dlassiter@atsva.com
MC-Recipe Digest V1 #133
From the MasterCook recipe list. Downloaded from Glen's MM Recipe Archive,
http://www.erols.com/hosey.
</step></directions></recipe></recipeml>
| {
"content_hash": "ea71b81a1ad5538dd60a4f12c0ef7ca5",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 87,
"avg_line_length": 31.99009900990099,
"alnum_prop": 0.5484370164035902,
"repo_name": "coogle/coogle-recipes",
"id": "d08818d2b953b6342653e284d7a481aac055c62d",
"size": "3231",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "extras/recipes/Acapulco_Chicken_(En_Escabeche).xml",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Blade",
"bytes": "70365"
},
{
"name": "CSS",
"bytes": "2508"
},
{
"name": "HTML",
"bytes": "1294"
},
{
"name": "JavaScript",
"bytes": "1133"
},
{
"name": "PHP",
"bytes": "130922"
},
{
"name": "Puppet",
"bytes": "23814"
},
{
"name": "SCSS",
"bytes": "1015"
},
{
"name": "Shell",
"bytes": "3538"
},
{
"name": "Vue",
"bytes": "559"
}
],
"symlink_target": ""
} |
module Gleam
class Preference < Gleam::Base
serialize :value
belongs_to :account, :class_name => 'Gleam::Account', :inverse_of => :preferences
end
end
| {
"content_hash": "b468b59ee49314429057bc97585e3fb6",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 85,
"avg_line_length": 23.428571428571427,
"alnum_prop": 0.6829268292682927,
"repo_name": "bewitchingme/gleam",
"id": "b0d931773d1444d514e9fe69efd1ccceb607f67c",
"size": "164",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/models/gleam/preference.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "19950"
},
{
"name": "CoffeeScript",
"bytes": "1283"
},
{
"name": "HTML",
"bytes": "13849"
},
{
"name": "JavaScript",
"bytes": "596"
},
{
"name": "Ruby",
"bytes": "40808"
}
],
"symlink_target": ""
} |
package org.apache.camel.builder.endpoint.dsl;
import java.util.Map;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
import org.apache.camel.ExchangePattern;
import org.apache.camel.LoggingLevel;
import org.apache.camel.builder.EndpointConsumerBuilder;
import org.apache.camel.builder.EndpointProducerBuilder;
import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
import org.apache.camel.spi.ExceptionHandler;
import org.apache.camel.spi.PollingConsumerPollStrategy;
/**
* Use ElSql to define SQL queries. Extends the SQL Component.
*
* Generated by camel build tools - do NOT edit this file!
*/
@Generated("org.apache.camel.maven.packaging.EndpointDslMojo")
public interface ElsqlEndpointBuilderFactory {
/**
* Builder for endpoint consumers for the ElSQL component.
*/
public interface ElsqlEndpointConsumerBuilder
extends
EndpointConsumerBuilder {
default AdvancedElsqlEndpointConsumerBuilder advanced() {
return (AdvancedElsqlEndpointConsumerBuilder) this;
}
/**
* Whether to allow using named parameters in the queries.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: common
*/
default ElsqlEndpointConsumerBuilder allowNamedParameters(
boolean allowNamedParameters) {
doSetProperty("allowNamedParameters", allowNamedParameters);
return this;
}
/**
* Whether to allow using named parameters in the queries.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: true
* Group: common
*/
default ElsqlEndpointConsumerBuilder allowNamedParameters(
String allowNamedParameters) {
doSetProperty("allowNamedParameters", allowNamedParameters);
return this;
}
/**
* To use a vendor specific com.opengamma.elsql.ElSqlConfig.
*
* The option is a:
* <code>org.apache.camel.component.elsql.ElSqlDatabaseVendor</code>
* type.
*
* Group: common
*/
default ElsqlEndpointConsumerBuilder databaseVendor(
ElSqlDatabaseVendor databaseVendor) {
doSetProperty("databaseVendor", databaseVendor);
return this;
}
/**
* To use a vendor specific com.opengamma.elsql.ElSqlConfig.
*
* The option will be converted to a
* <code>org.apache.camel.component.elsql.ElSqlDatabaseVendor</code>
* type.
*
* Group: common
*/
default ElsqlEndpointConsumerBuilder databaseVendor(
String databaseVendor) {
doSetProperty("databaseVendor", databaseVendor);
return this;
}
/**
* Sets the DataSource to use to communicate with the database.
*
* The option is a: <code>javax.sql.DataSource</code> type.
*
* Group: common
*/
default ElsqlEndpointConsumerBuilder dataSource(Object dataSource) {
doSetProperty("dataSource", dataSource);
return this;
}
/**
* Sets the DataSource to use to communicate with the database.
*
* The option will be converted to a <code>javax.sql.DataSource</code>
* type.
*
* Group: common
*/
default ElsqlEndpointConsumerBuilder dataSource(String dataSource) {
doSetProperty("dataSource", dataSource);
return this;
}
/**
* Sets the reference to a DataSource to lookup from the registry, to
* use for communicating with the database.
*
* The option is a: <code>java.lang.String</code> type.
*
* Group: common
*/
@Deprecated
default ElsqlEndpointConsumerBuilder dataSourceRef(String dataSourceRef) {
doSetProperty("dataSourceRef", dataSourceRef);
return this;
}
/**
* Specify the full package and class name to use as conversion when
* outputType=SelectOne.
*
* The option is a: <code>java.lang.String</code> type.
*
* Group: common
*/
default ElsqlEndpointConsumerBuilder outputClass(String outputClass) {
doSetProperty("outputClass", outputClass);
return this;
}
/**
* Store the query result in a header instead of the message body. By
* default, outputHeader == null and the query result is stored in the
* message body, any existing content in the message body is discarded.
* If outputHeader is set, the value is used as the name of the header
* to store the query result and the original message body is preserved.
*
* The option is a: <code>java.lang.String</code> type.
*
* Group: common
*/
default ElsqlEndpointConsumerBuilder outputHeader(String outputHeader) {
doSetProperty("outputHeader", outputHeader);
return this;
}
/**
* Make the output of consumer or producer to SelectList as List of Map,
* or SelectOne as single Java object in the following way: a) If the
* query has only single column, then that JDBC Column object is
* returned. (such as SELECT COUNT( ) FROM PROJECT will return a Long
* object. b) If the query has more than one column, then it will return
* a Map of that result. c) If the outputClass is set, then it will
* convert the query result into an Java bean object by calling all the
* setters that match the column names. It will assume your class has a
* default constructor to create instance with. d) If the query resulted
* in more than one rows, it throws an non-unique result exception.
* StreamList streams the result of the query using an Iterator. This
* can be used with the Splitter EIP in streaming mode to process the
* ResultSet in streaming fashion.
*
* The option is a:
* <code>org.apache.camel.component.sql.SqlOutputType</code> type.
*
* Default: SelectList
* Group: common
*/
default ElsqlEndpointConsumerBuilder outputType(SqlOutputType outputType) {
doSetProperty("outputType", outputType);
return this;
}
/**
* Make the output of consumer or producer to SelectList as List of Map,
* or SelectOne as single Java object in the following way: a) If the
* query has only single column, then that JDBC Column object is
* returned. (such as SELECT COUNT( ) FROM PROJECT will return a Long
* object. b) If the query has more than one column, then it will return
* a Map of that result. c) If the outputClass is set, then it will
* convert the query result into an Java bean object by calling all the
* setters that match the column names. It will assume your class has a
* default constructor to create instance with. d) If the query resulted
* in more than one rows, it throws an non-unique result exception.
* StreamList streams the result of the query using an Iterator. This
* can be used with the Splitter EIP in streaming mode to process the
* ResultSet in streaming fashion.
*
* The option will be converted to a
* <code>org.apache.camel.component.sql.SqlOutputType</code> type.
*
* Default: SelectList
* Group: common
*/
default ElsqlEndpointConsumerBuilder outputType(String outputType) {
doSetProperty("outputType", outputType);
return this;
}
/**
* The separator to use when parameter values is taken from message body
* (if the body is a String type), to be inserted at # placeholders.
* Notice if you use named parameters, then a Map type is used instead.
* The default value is comma.
*
* The option is a: <code>char</code> type.
*
* Default: ,
* Group: common
*/
default ElsqlEndpointConsumerBuilder separator(char separator) {
doSetProperty("separator", separator);
return this;
}
/**
* The separator to use when parameter values is taken from message body
* (if the body is a String type), to be inserted at # placeholders.
* Notice if you use named parameters, then a Map type is used instead.
* The default value is comma.
*
* The option will be converted to a <code>char</code> type.
*
* Default: ,
* Group: common
*/
default ElsqlEndpointConsumerBuilder separator(String separator) {
doSetProperty("separator", separator);
return this;
}
/**
* Sets whether to break batch if onConsume failed.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder breakBatchOnConsumeFail(
boolean breakBatchOnConsumeFail) {
doSetProperty("breakBatchOnConsumeFail", breakBatchOnConsumeFail);
return this;
}
/**
* Sets whether to break batch if onConsume failed.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder breakBatchOnConsumeFail(
String breakBatchOnConsumeFail) {
doSetProperty("breakBatchOnConsumeFail", breakBatchOnConsumeFail);
return this;
}
/**
* Allows for bridging the consumer to the Camel routing Error Handler,
* which mean any exceptions occurred while the consumer is trying to
* pickup incoming messages, or the likes, will now be processed as a
* message and handled by the routing Error Handler. By default the
* consumer will use the org.apache.camel.spi.ExceptionHandler to deal
* with exceptions, that will be logged at WARN or ERROR level and
* ignored.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder bridgeErrorHandler(
boolean bridgeErrorHandler) {
doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
return this;
}
/**
* Allows for bridging the consumer to the Camel routing Error Handler,
* which mean any exceptions occurred while the consumer is trying to
* pickup incoming messages, or the likes, will now be processed as a
* message and handled by the routing Error Handler. By default the
* consumer will use the org.apache.camel.spi.ExceptionHandler to deal
* with exceptions, that will be logged at WARN or ERROR level and
* ignored.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder bridgeErrorHandler(
String bridgeErrorHandler) {
doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
return this;
}
/**
* Sets an expected update count to validate when using onConsume.
*
* The option is a: <code>int</code> type.
*
* Default: -1
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder expectedUpdateCount(
int expectedUpdateCount) {
doSetProperty("expectedUpdateCount", expectedUpdateCount);
return this;
}
/**
* Sets an expected update count to validate when using onConsume.
*
* The option will be converted to a <code>int</code> type.
*
* Default: -1
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder expectedUpdateCount(
String expectedUpdateCount) {
doSetProperty("expectedUpdateCount", expectedUpdateCount);
return this;
}
/**
* Sets the maximum number of messages to poll.
*
* The option is a: <code>int</code> type.
*
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder maxMessagesPerPoll(
int maxMessagesPerPoll) {
doSetProperty("maxMessagesPerPoll", maxMessagesPerPoll);
return this;
}
/**
* Sets the maximum number of messages to poll.
*
* The option will be converted to a <code>int</code> type.
*
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder maxMessagesPerPoll(
String maxMessagesPerPoll) {
doSetProperty("maxMessagesPerPoll", maxMessagesPerPoll);
return this;
}
/**
* After processing each row then this query can be executed, if the
* Exchange was processed successfully, for example to mark the row as
* processed. The query can have parameter.
*
* The option is a: <code>java.lang.String</code> type.
*
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder onConsume(String onConsume) {
doSetProperty("onConsume", onConsume);
return this;
}
/**
* After processing the entire batch, this query can be executed to bulk
* update rows etc. The query cannot have parameters.
*
* The option is a: <code>java.lang.String</code> type.
*
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder onConsumeBatchComplete(
String onConsumeBatchComplete) {
doSetProperty("onConsumeBatchComplete", onConsumeBatchComplete);
return this;
}
/**
* After processing each row then this query can be executed, if the
* Exchange failed, for example to mark the row as failed. The query can
* have parameter.
*
* The option is a: <code>java.lang.String</code> type.
*
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder onConsumeFailed(
String onConsumeFailed) {
doSetProperty("onConsumeFailed", onConsumeFailed);
return this;
}
/**
* Sets whether empty resultset should be allowed to be sent to the next
* hop. Defaults to false. So the empty resultset will be filtered out.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder routeEmptyResultSet(
boolean routeEmptyResultSet) {
doSetProperty("routeEmptyResultSet", routeEmptyResultSet);
return this;
}
/**
* Sets whether empty resultset should be allowed to be sent to the next
* hop. Defaults to false. So the empty resultset will be filtered out.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder routeEmptyResultSet(
String routeEmptyResultSet) {
doSetProperty("routeEmptyResultSet", routeEmptyResultSet);
return this;
}
/**
* If the polling consumer did not poll any files, you can enable this
* option to send an empty message (no body) instead.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder sendEmptyMessageWhenIdle(
boolean sendEmptyMessageWhenIdle) {
doSetProperty("sendEmptyMessageWhenIdle", sendEmptyMessageWhenIdle);
return this;
}
/**
* If the polling consumer did not poll any files, you can enable this
* option to send an empty message (no body) instead.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder sendEmptyMessageWhenIdle(
String sendEmptyMessageWhenIdle) {
doSetProperty("sendEmptyMessageWhenIdle", sendEmptyMessageWhenIdle);
return this;
}
/**
* Enables or disables transaction. If enabled then if processing an
* exchange failed then the consumer breaks out processing any further
* exchanges to cause a rollback eager.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder transacted(boolean transacted) {
doSetProperty("transacted", transacted);
return this;
}
/**
* Enables or disables transaction. If enabled then if processing an
* exchange failed then the consumer breaks out processing any further
* exchanges to cause a rollback eager.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder transacted(String transacted) {
doSetProperty("transacted", transacted);
return this;
}
/**
* Sets how resultset should be delivered to route. Indicates delivery
* as either a list or individual object. defaults to true.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder useIterator(boolean useIterator) {
doSetProperty("useIterator", useIterator);
return this;
}
/**
* Sets how resultset should be delivered to route. Indicates delivery
* as either a list or individual object. defaults to true.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: true
* Group: consumer
*/
default ElsqlEndpointConsumerBuilder useIterator(String useIterator) {
doSetProperty("useIterator", useIterator);
return this;
}
/**
* The number of subsequent error polls (failed due some error) that
* should happen before the backoffMultipler should kick-in.
*
* The option is a: <code>int</code> type.
*
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder backoffErrorThreshold(
int backoffErrorThreshold) {
doSetProperty("backoffErrorThreshold", backoffErrorThreshold);
return this;
}
/**
* The number of subsequent error polls (failed due some error) that
* should happen before the backoffMultipler should kick-in.
*
* The option will be converted to a <code>int</code> type.
*
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder backoffErrorThreshold(
String backoffErrorThreshold) {
doSetProperty("backoffErrorThreshold", backoffErrorThreshold);
return this;
}
/**
* The number of subsequent idle polls that should happen before the
* backoffMultipler should kick-in.
*
* The option is a: <code>int</code> type.
*
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder backoffIdleThreshold(
int backoffIdleThreshold) {
doSetProperty("backoffIdleThreshold", backoffIdleThreshold);
return this;
}
/**
* The number of subsequent idle polls that should happen before the
* backoffMultipler should kick-in.
*
* The option will be converted to a <code>int</code> type.
*
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder backoffIdleThreshold(
String backoffIdleThreshold) {
doSetProperty("backoffIdleThreshold", backoffIdleThreshold);
return this;
}
/**
* To let the scheduled polling consumer backoff if there has been a
* number of subsequent idles/errors in a row. The multiplier is then
* the number of polls that will be skipped before the next actual
* attempt is happening again. When this option is in use then
* backoffIdleThreshold and/or backoffErrorThreshold must also be
* configured.
*
* The option is a: <code>int</code> type.
*
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder backoffMultiplier(
int backoffMultiplier) {
doSetProperty("backoffMultiplier", backoffMultiplier);
return this;
}
/**
* To let the scheduled polling consumer backoff if there has been a
* number of subsequent idles/errors in a row. The multiplier is then
* the number of polls that will be skipped before the next actual
* attempt is happening again. When this option is in use then
* backoffIdleThreshold and/or backoffErrorThreshold must also be
* configured.
*
* The option will be converted to a <code>int</code> type.
*
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder backoffMultiplier(
String backoffMultiplier) {
doSetProperty("backoffMultiplier", backoffMultiplier);
return this;
}
/**
* Milliseconds before the next poll.
*
* The option is a: <code>long</code> type.
*
* Default: 500
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder delay(long delay) {
doSetProperty("delay", delay);
return this;
}
/**
* Milliseconds before the next poll.
*
* The option will be converted to a <code>long</code> type.
*
* Default: 500
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder delay(String delay) {
doSetProperty("delay", delay);
return this;
}
/**
* If greedy is enabled, then the ScheduledPollConsumer will run
* immediately again, if the previous run polled 1 or more messages.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder greedy(boolean greedy) {
doSetProperty("greedy", greedy);
return this;
}
/**
* If greedy is enabled, then the ScheduledPollConsumer will run
* immediately again, if the previous run polled 1 or more messages.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder greedy(String greedy) {
doSetProperty("greedy", greedy);
return this;
}
/**
* Milliseconds before the first poll starts.
*
* The option is a: <code>long</code> type.
*
* Default: 1000
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder initialDelay(long initialDelay) {
doSetProperty("initialDelay", initialDelay);
return this;
}
/**
* Milliseconds before the first poll starts.
*
* The option will be converted to a <code>long</code> type.
*
* Default: 1000
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder initialDelay(String initialDelay) {
doSetProperty("initialDelay", initialDelay);
return this;
}
/**
* Specifies a maximum limit of number of fires. So if you set it to 1,
* the scheduler will only fire once. If you set it to 5, it will only
* fire five times. A value of zero or negative means fire forever.
*
* The option is a: <code>long</code> type.
*
* Default: 0
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder repeatCount(long repeatCount) {
doSetProperty("repeatCount", repeatCount);
return this;
}
/**
* Specifies a maximum limit of number of fires. So if you set it to 1,
* the scheduler will only fire once. If you set it to 5, it will only
* fire five times. A value of zero or negative means fire forever.
*
* The option will be converted to a <code>long</code> type.
*
* Default: 0
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder repeatCount(String repeatCount) {
doSetProperty("repeatCount", repeatCount);
return this;
}
/**
* The consumer logs a start/complete log line when it polls. This
* option allows you to configure the logging level for that.
*
* The option is a: <code>org.apache.camel.LoggingLevel</code> type.
*
* Default: TRACE
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder runLoggingLevel(
LoggingLevel runLoggingLevel) {
doSetProperty("runLoggingLevel", runLoggingLevel);
return this;
}
/**
* The consumer logs a start/complete log line when it polls. This
* option allows you to configure the logging level for that.
*
* The option will be converted to a
* <code>org.apache.camel.LoggingLevel</code> type.
*
* Default: TRACE
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder runLoggingLevel(
String runLoggingLevel) {
doSetProperty("runLoggingLevel", runLoggingLevel);
return this;
}
/**
* Allows for configuring a custom/shared thread pool to use for the
* consumer. By default each consumer has its own single threaded thread
* pool.
*
* The option is a:
* <code>java.util.concurrent.ScheduledExecutorService</code> type.
*
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder scheduledExecutorService(
ScheduledExecutorService scheduledExecutorService) {
doSetProperty("scheduledExecutorService", scheduledExecutorService);
return this;
}
/**
* Allows for configuring a custom/shared thread pool to use for the
* consumer. By default each consumer has its own single threaded thread
* pool.
*
* The option will be converted to a
* <code>java.util.concurrent.ScheduledExecutorService</code> type.
*
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder scheduledExecutorService(
String scheduledExecutorService) {
doSetProperty("scheduledExecutorService", scheduledExecutorService);
return this;
}
/**
* To use a cron scheduler from either camel-spring or camel-quartz
* component.
*
* The option is a: <code>java.lang.String</code> type.
*
* Default: none
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder scheduler(String scheduler) {
doSetProperty("scheduler", scheduler);
return this;
}
/**
* To configure additional properties when using a custom scheduler or
* any of the Quartz, Spring based scheduler.
*
* The option is a: <code>java.util.Map<java.lang.String,
* java.lang.Object></code> type.
* The option is multivalued, and you can use the
* schedulerProperties(String, Object) method to add a value (call the
* method multiple times to set more values).
*
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder schedulerProperties(
String key,
Object value) {
doSetMultiValueProperty("schedulerProperties", "scheduler." + key, value);
return this;
}
/**
* To configure additional properties when using a custom scheduler or
* any of the Quartz, Spring based scheduler.
*
* The option is a: <code>java.util.Map<java.lang.String,
* java.lang.Object></code> type.
* The option is multivalued, and you can use the
* schedulerProperties(String, Object) method to add a value (call the
* method multiple times to set more values).
*
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder schedulerProperties(Map values) {
doSetMultiValueProperties("schedulerProperties", "scheduler.", values);
return this;
}
/**
* Whether the scheduler should be auto started.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder startScheduler(
boolean startScheduler) {
doSetProperty("startScheduler", startScheduler);
return this;
}
/**
* Whether the scheduler should be auto started.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: true
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder startScheduler(
String startScheduler) {
doSetProperty("startScheduler", startScheduler);
return this;
}
/**
* Time unit for initialDelay and delay options.
*
* The option is a: <code>java.util.concurrent.TimeUnit</code> type.
*
* Default: MILLISECONDS
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder timeUnit(TimeUnit timeUnit) {
doSetProperty("timeUnit", timeUnit);
return this;
}
/**
* Time unit for initialDelay and delay options.
*
* The option will be converted to a
* <code>java.util.concurrent.TimeUnit</code> type.
*
* Default: MILLISECONDS
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder timeUnit(String timeUnit) {
doSetProperty("timeUnit", timeUnit);
return this;
}
/**
* Controls if fixed delay or fixed rate is used. See
* ScheduledExecutorService in JDK for details.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder useFixedDelay(boolean useFixedDelay) {
doSetProperty("useFixedDelay", useFixedDelay);
return this;
}
/**
* Controls if fixed delay or fixed rate is used. See
* ScheduledExecutorService in JDK for details.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: true
* Group: scheduler
*/
default ElsqlEndpointConsumerBuilder useFixedDelay(String useFixedDelay) {
doSetProperty("useFixedDelay", useFixedDelay);
return this;
}
}
/**
* Advanced builder for endpoint consumers for the ElSQL component.
*/
public interface AdvancedElsqlEndpointConsumerBuilder
extends
EndpointConsumerBuilder {
default ElsqlEndpointConsumerBuilder basic() {
return (ElsqlEndpointConsumerBuilder) this;
}
/**
* To let the consumer use a custom ExceptionHandler. Notice if the
* option bridgeErrorHandler is enabled then this option is not in use.
* By default the consumer will deal with exceptions, that will be
* logged at WARN or ERROR level and ignored.
*
* The option is a: <code>org.apache.camel.spi.ExceptionHandler</code>
* type.
*
* Group: consumer (advanced)
*/
default AdvancedElsqlEndpointConsumerBuilder exceptionHandler(
ExceptionHandler exceptionHandler) {
doSetProperty("exceptionHandler", exceptionHandler);
return this;
}
/**
* To let the consumer use a custom ExceptionHandler. Notice if the
* option bridgeErrorHandler is enabled then this option is not in use.
* By default the consumer will deal with exceptions, that will be
* logged at WARN or ERROR level and ignored.
*
* The option will be converted to a
* <code>org.apache.camel.spi.ExceptionHandler</code> type.
*
* Group: consumer (advanced)
*/
default AdvancedElsqlEndpointConsumerBuilder exceptionHandler(
String exceptionHandler) {
doSetProperty("exceptionHandler", exceptionHandler);
return this;
}
/**
* Sets the exchange pattern when the consumer creates an exchange.
*
* The option is a: <code>org.apache.camel.ExchangePattern</code> type.
*
* Group: consumer (advanced)
*/
default AdvancedElsqlEndpointConsumerBuilder exchangePattern(
ExchangePattern exchangePattern) {
doSetProperty("exchangePattern", exchangePattern);
return this;
}
/**
* Sets the exchange pattern when the consumer creates an exchange.
*
* The option will be converted to a
* <code>org.apache.camel.ExchangePattern</code> type.
*
* Group: consumer (advanced)
*/
default AdvancedElsqlEndpointConsumerBuilder exchangePattern(
String exchangePattern) {
doSetProperty("exchangePattern", exchangePattern);
return this;
}
/**
* A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing
* you to provide your custom implementation to control error handling
* usually occurred during the poll operation before an Exchange have
* been created and being routed in Camel.
*
* The option is a:
* <code>org.apache.camel.spi.PollingConsumerPollStrategy</code> type.
*
* Group: consumer (advanced)
*/
default AdvancedElsqlEndpointConsumerBuilder pollStrategy(
PollingConsumerPollStrategy pollStrategy) {
doSetProperty("pollStrategy", pollStrategy);
return this;
}
/**
* A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing
* you to provide your custom implementation to control error handling
* usually occurred during the poll operation before an Exchange have
* been created and being routed in Camel.
*
* The option will be converted to a
* <code>org.apache.camel.spi.PollingConsumerPollStrategy</code> type.
*
* Group: consumer (advanced)
*/
default AdvancedElsqlEndpointConsumerBuilder pollStrategy(
String pollStrategy) {
doSetProperty("pollStrategy", pollStrategy);
return this;
}
/**
* Allows to plugin to use a custom
* org.apache.camel.component.sql.SqlProcessingStrategy to execute
* queries when the consumer has processed the rows/batch.
*
* The option is a:
* <code>org.apache.camel.component.sql.SqlProcessingStrategy</code>
* type.
*
* Group: consumer (advanced)
*/
default AdvancedElsqlEndpointConsumerBuilder processingStrategy(
Object processingStrategy) {
doSetProperty("processingStrategy", processingStrategy);
return this;
}
/**
* Allows to plugin to use a custom
* org.apache.camel.component.sql.SqlProcessingStrategy to execute
* queries when the consumer has processed the rows/batch.
*
* The option will be converted to a
* <code>org.apache.camel.component.sql.SqlProcessingStrategy</code>
* type.
*
* Group: consumer (advanced)
*/
default AdvancedElsqlEndpointConsumerBuilder processingStrategy(
String processingStrategy) {
doSetProperty("processingStrategy", processingStrategy);
return this;
}
/**
* If enabled then the populateStatement method from
* org.apache.camel.component.sql.SqlPrepareStatementStrategy is always
* invoked, also if there is no expected parameters to be prepared. When
* this is false then the populateStatement is only invoked if there is
* 1 or more expected parameters to be set; for example this avoids
* reading the message body/headers for SQL queries with no parameters.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder alwaysPopulateStatement(
boolean alwaysPopulateStatement) {
doSetProperty("alwaysPopulateStatement", alwaysPopulateStatement);
return this;
}
/**
* If enabled then the populateStatement method from
* org.apache.camel.component.sql.SqlPrepareStatementStrategy is always
* invoked, also if there is no expected parameters to be prepared. When
* this is false then the populateStatement is only invoked if there is
* 1 or more expected parameters to be set; for example this avoids
* reading the message body/headers for SQL queries with no parameters.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder alwaysPopulateStatement(
String alwaysPopulateStatement) {
doSetProperty("alwaysPopulateStatement", alwaysPopulateStatement);
return this;
}
/**
* Whether the endpoint should use basic property binding (Camel 2.x) or
* the newer property binding with additional capabilities.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder basicPropertyBinding(
boolean basicPropertyBinding) {
doSetProperty("basicPropertyBinding", basicPropertyBinding);
return this;
}
/**
* Whether the endpoint should use basic property binding (Camel 2.x) or
* the newer property binding with additional capabilities.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder basicPropertyBinding(
String basicPropertyBinding) {
doSetProperty("basicPropertyBinding", basicPropertyBinding);
return this;
}
/**
* To use a specific configured ElSqlConfig. It may be better to use the
* databaseVendor option instead.
*
* The option is a: <code>com.opengamma.elsql.ElSqlConfig</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder elSqlConfig(
Object elSqlConfig) {
doSetProperty("elSqlConfig", elSqlConfig);
return this;
}
/**
* To use a specific configured ElSqlConfig. It may be better to use the
* databaseVendor option instead.
*
* The option will be converted to a
* <code>com.opengamma.elsql.ElSqlConfig</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder elSqlConfig(
String elSqlConfig) {
doSetProperty("elSqlConfig", elSqlConfig);
return this;
}
/**
* If set greater than zero, then Camel will use this count value of
* parameters to replace instead of querying via JDBC metadata API. This
* is useful if the JDBC vendor could not return correct parameters
* count, then user may override instead.
*
* The option is a: <code>int</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder parametersCount(
int parametersCount) {
doSetProperty("parametersCount", parametersCount);
return this;
}
/**
* If set greater than zero, then Camel will use this count value of
* parameters to replace instead of querying via JDBC metadata API. This
* is useful if the JDBC vendor could not return correct parameters
* count, then user may override instead.
*
* The option will be converted to a <code>int</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder parametersCount(
String parametersCount) {
doSetProperty("parametersCount", parametersCount);
return this;
}
/**
* Specifies a character that will be replaced to in SQL query. Notice,
* that it is simple String.replaceAll() operation and no SQL parsing is
* involved (quoted strings will also change).
*
* The option is a: <code>java.lang.String</code> type.
*
* Default: #
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder placeholder(
String placeholder) {
doSetProperty("placeholder", placeholder);
return this;
}
/**
* Allows to plugin to use a custom
* org.apache.camel.component.sql.SqlPrepareStatementStrategy to control
* preparation of the query and prepared statement.
*
* The option is a:
* <code>org.apache.camel.component.sql.SqlPrepareStatementStrategy</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder prepareStatementStrategy(
Object prepareStatementStrategy) {
doSetProperty("prepareStatementStrategy", prepareStatementStrategy);
return this;
}
/**
* Allows to plugin to use a custom
* org.apache.camel.component.sql.SqlPrepareStatementStrategy to control
* preparation of the query and prepared statement.
*
* The option will be converted to a
* <code>org.apache.camel.component.sql.SqlPrepareStatementStrategy</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder prepareStatementStrategy(
String prepareStatementStrategy) {
doSetProperty("prepareStatementStrategy", prepareStatementStrategy);
return this;
}
/**
* Sets whether synchronous processing should be strictly used, or Camel
* is allowed to use asynchronous processing (if supported).
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder synchronous(
boolean synchronous) {
doSetProperty("synchronous", synchronous);
return this;
}
/**
* Sets whether synchronous processing should be strictly used, or Camel
* is allowed to use asynchronous processing (if supported).
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder synchronous(
String synchronous) {
doSetProperty("synchronous", synchronous);
return this;
}
/**
* Configures the Spring JdbcTemplate with the key/values from the Map.
*
* The option is a: <code>java.util.Map<java.lang.String,
* java.lang.Object></code> type.
* The option is multivalued, and you can use the
* templateOptions(String, Object) method to add a value (call the
* method multiple times to set more values).
*
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder templateOptions(
String key,
Object value) {
doSetMultiValueProperty("templateOptions", "template." + key, value);
return this;
}
/**
* Configures the Spring JdbcTemplate with the key/values from the Map.
*
* The option is a: <code>java.util.Map<java.lang.String,
* java.lang.Object></code> type.
* The option is multivalued, and you can use the
* templateOptions(String, Object) method to add a value (call the
* method multiple times to set more values).
*
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder templateOptions(Map values) {
doSetMultiValueProperties("templateOptions", "template.", values);
return this;
}
/**
* Sets whether to use placeholder and replace all placeholder
* characters with sign in the SQL queries.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder usePlaceholder(
boolean usePlaceholder) {
doSetProperty("usePlaceholder", usePlaceholder);
return this;
}
/**
* Sets whether to use placeholder and replace all placeholder
* characters with sign in the SQL queries.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: true
* Group: advanced
*/
default AdvancedElsqlEndpointConsumerBuilder usePlaceholder(
String usePlaceholder) {
doSetProperty("usePlaceholder", usePlaceholder);
return this;
}
}
/**
* Builder for endpoint producers for the ElSQL component.
*/
public interface ElsqlEndpointProducerBuilder
extends
EndpointProducerBuilder {
default AdvancedElsqlEndpointProducerBuilder advanced() {
return (AdvancedElsqlEndpointProducerBuilder) this;
}
/**
* Whether to allow using named parameters in the queries.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: common
*/
default ElsqlEndpointProducerBuilder allowNamedParameters(
boolean allowNamedParameters) {
doSetProperty("allowNamedParameters", allowNamedParameters);
return this;
}
/**
* Whether to allow using named parameters in the queries.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: true
* Group: common
*/
default ElsqlEndpointProducerBuilder allowNamedParameters(
String allowNamedParameters) {
doSetProperty("allowNamedParameters", allowNamedParameters);
return this;
}
/**
* To use a vendor specific com.opengamma.elsql.ElSqlConfig.
*
* The option is a:
* <code>org.apache.camel.component.elsql.ElSqlDatabaseVendor</code>
* type.
*
* Group: common
*/
default ElsqlEndpointProducerBuilder databaseVendor(
ElSqlDatabaseVendor databaseVendor) {
doSetProperty("databaseVendor", databaseVendor);
return this;
}
/**
* To use a vendor specific com.opengamma.elsql.ElSqlConfig.
*
* The option will be converted to a
* <code>org.apache.camel.component.elsql.ElSqlDatabaseVendor</code>
* type.
*
* Group: common
*/
default ElsqlEndpointProducerBuilder databaseVendor(
String databaseVendor) {
doSetProperty("databaseVendor", databaseVendor);
return this;
}
/**
* Sets the DataSource to use to communicate with the database.
*
* The option is a: <code>javax.sql.DataSource</code> type.
*
* Group: common
*/
default ElsqlEndpointProducerBuilder dataSource(Object dataSource) {
doSetProperty("dataSource", dataSource);
return this;
}
/**
* Sets the DataSource to use to communicate with the database.
*
* The option will be converted to a <code>javax.sql.DataSource</code>
* type.
*
* Group: common
*/
default ElsqlEndpointProducerBuilder dataSource(String dataSource) {
doSetProperty("dataSource", dataSource);
return this;
}
/**
* Sets the reference to a DataSource to lookup from the registry, to
* use for communicating with the database.
*
* The option is a: <code>java.lang.String</code> type.
*
* Group: common
*/
@Deprecated
default ElsqlEndpointProducerBuilder dataSourceRef(String dataSourceRef) {
doSetProperty("dataSourceRef", dataSourceRef);
return this;
}
/**
* Specify the full package and class name to use as conversion when
* outputType=SelectOne.
*
* The option is a: <code>java.lang.String</code> type.
*
* Group: common
*/
default ElsqlEndpointProducerBuilder outputClass(String outputClass) {
doSetProperty("outputClass", outputClass);
return this;
}
/**
* Store the query result in a header instead of the message body. By
* default, outputHeader == null and the query result is stored in the
* message body, any existing content in the message body is discarded.
* If outputHeader is set, the value is used as the name of the header
* to store the query result and the original message body is preserved.
*
* The option is a: <code>java.lang.String</code> type.
*
* Group: common
*/
default ElsqlEndpointProducerBuilder outputHeader(String outputHeader) {
doSetProperty("outputHeader", outputHeader);
return this;
}
/**
* Make the output of consumer or producer to SelectList as List of Map,
* or SelectOne as single Java object in the following way: a) If the
* query has only single column, then that JDBC Column object is
* returned. (such as SELECT COUNT( ) FROM PROJECT will return a Long
* object. b) If the query has more than one column, then it will return
* a Map of that result. c) If the outputClass is set, then it will
* convert the query result into an Java bean object by calling all the
* setters that match the column names. It will assume your class has a
* default constructor to create instance with. d) If the query resulted
* in more than one rows, it throws an non-unique result exception.
* StreamList streams the result of the query using an Iterator. This
* can be used with the Splitter EIP in streaming mode to process the
* ResultSet in streaming fashion.
*
* The option is a:
* <code>org.apache.camel.component.sql.SqlOutputType</code> type.
*
* Default: SelectList
* Group: common
*/
default ElsqlEndpointProducerBuilder outputType(SqlOutputType outputType) {
doSetProperty("outputType", outputType);
return this;
}
/**
* Make the output of consumer or producer to SelectList as List of Map,
* or SelectOne as single Java object in the following way: a) If the
* query has only single column, then that JDBC Column object is
* returned. (such as SELECT COUNT( ) FROM PROJECT will return a Long
* object. b) If the query has more than one column, then it will return
* a Map of that result. c) If the outputClass is set, then it will
* convert the query result into an Java bean object by calling all the
* setters that match the column names. It will assume your class has a
* default constructor to create instance with. d) If the query resulted
* in more than one rows, it throws an non-unique result exception.
* StreamList streams the result of the query using an Iterator. This
* can be used with the Splitter EIP in streaming mode to process the
* ResultSet in streaming fashion.
*
* The option will be converted to a
* <code>org.apache.camel.component.sql.SqlOutputType</code> type.
*
* Default: SelectList
* Group: common
*/
default ElsqlEndpointProducerBuilder outputType(String outputType) {
doSetProperty("outputType", outputType);
return this;
}
/**
* The separator to use when parameter values is taken from message body
* (if the body is a String type), to be inserted at # placeholders.
* Notice if you use named parameters, then a Map type is used instead.
* The default value is comma.
*
* The option is a: <code>char</code> type.
*
* Default: ,
* Group: common
*/
default ElsqlEndpointProducerBuilder separator(char separator) {
doSetProperty("separator", separator);
return this;
}
/**
* The separator to use when parameter values is taken from message body
* (if the body is a String type), to be inserted at # placeholders.
* Notice if you use named parameters, then a Map type is used instead.
* The default value is comma.
*
* The option will be converted to a <code>char</code> type.
*
* Default: ,
* Group: common
*/
default ElsqlEndpointProducerBuilder separator(String separator) {
doSetProperty("separator", separator);
return this;
}
/**
* Enables or disables batch mode.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: producer
*/
default ElsqlEndpointProducerBuilder batch(boolean batch) {
doSetProperty("batch", batch);
return this;
}
/**
* Enables or disables batch mode.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: producer
*/
default ElsqlEndpointProducerBuilder batch(String batch) {
doSetProperty("batch", batch);
return this;
}
/**
* Whether the producer should be started lazy (on the first message).
* By starting lazy you can use this to allow CamelContext and routes to
* startup in situations where a producer may otherwise fail during
* starting and cause the route to fail being started. By deferring this
* startup to be lazy then the startup failure can be handled during
* routing messages via Camel's routing error handlers. Beware that when
* the first message is processed then creating and starting the
* producer may take a little time and prolong the total processing time
* of the processing.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: producer
*/
default ElsqlEndpointProducerBuilder lazyStartProducer(
boolean lazyStartProducer) {
doSetProperty("lazyStartProducer", lazyStartProducer);
return this;
}
/**
* Whether the producer should be started lazy (on the first message).
* By starting lazy you can use this to allow CamelContext and routes to
* startup in situations where a producer may otherwise fail during
* starting and cause the route to fail being started. By deferring this
* startup to be lazy then the startup failure can be handled during
* routing messages via Camel's routing error handlers. Beware that when
* the first message is processed then creating and starting the
* producer may take a little time and prolong the total processing time
* of the processing.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: producer
*/
default ElsqlEndpointProducerBuilder lazyStartProducer(
String lazyStartProducer) {
doSetProperty("lazyStartProducer", lazyStartProducer);
return this;
}
/**
* If set, will ignore the results of the SQL query and use the existing
* IN message as the OUT message for the continuation of processing.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: producer
*/
default ElsqlEndpointProducerBuilder noop(boolean noop) {
doSetProperty("noop", noop);
return this;
}
/**
* If set, will ignore the results of the SQL query and use the existing
* IN message as the OUT message for the continuation of processing.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: producer
*/
default ElsqlEndpointProducerBuilder noop(String noop) {
doSetProperty("noop", noop);
return this;
}
/**
* Whether to use the message body as the SQL and then headers for
* parameters. If this option is enabled then the SQL in the uri is not
* used. Note that query parameters in the message body are represented
* by a question mark instead of a # symbol.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: producer
*/
default ElsqlEndpointProducerBuilder useMessageBodyForSql(
boolean useMessageBodyForSql) {
doSetProperty("useMessageBodyForSql", useMessageBodyForSql);
return this;
}
/**
* Whether to use the message body as the SQL and then headers for
* parameters. If this option is enabled then the SQL in the uri is not
* used. Note that query parameters in the message body are represented
* by a question mark instead of a # symbol.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: producer
*/
default ElsqlEndpointProducerBuilder useMessageBodyForSql(
String useMessageBodyForSql) {
doSetProperty("useMessageBodyForSql", useMessageBodyForSql);
return this;
}
}
/**
* Advanced builder for endpoint producers for the ElSQL component.
*/
public interface AdvancedElsqlEndpointProducerBuilder
extends
EndpointProducerBuilder {
default ElsqlEndpointProducerBuilder basic() {
return (ElsqlEndpointProducerBuilder) this;
}
/**
* If enabled then the populateStatement method from
* org.apache.camel.component.sql.SqlPrepareStatementStrategy is always
* invoked, also if there is no expected parameters to be prepared. When
* this is false then the populateStatement is only invoked if there is
* 1 or more expected parameters to be set; for example this avoids
* reading the message body/headers for SQL queries with no parameters.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder alwaysPopulateStatement(
boolean alwaysPopulateStatement) {
doSetProperty("alwaysPopulateStatement", alwaysPopulateStatement);
return this;
}
/**
* If enabled then the populateStatement method from
* org.apache.camel.component.sql.SqlPrepareStatementStrategy is always
* invoked, also if there is no expected parameters to be prepared. When
* this is false then the populateStatement is only invoked if there is
* 1 or more expected parameters to be set; for example this avoids
* reading the message body/headers for SQL queries with no parameters.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder alwaysPopulateStatement(
String alwaysPopulateStatement) {
doSetProperty("alwaysPopulateStatement", alwaysPopulateStatement);
return this;
}
/**
* Whether the endpoint should use basic property binding (Camel 2.x) or
* the newer property binding with additional capabilities.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder basicPropertyBinding(
boolean basicPropertyBinding) {
doSetProperty("basicPropertyBinding", basicPropertyBinding);
return this;
}
/**
* Whether the endpoint should use basic property binding (Camel 2.x) or
* the newer property binding with additional capabilities.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder basicPropertyBinding(
String basicPropertyBinding) {
doSetProperty("basicPropertyBinding", basicPropertyBinding);
return this;
}
/**
* To use a specific configured ElSqlConfig. It may be better to use the
* databaseVendor option instead.
*
* The option is a: <code>com.opengamma.elsql.ElSqlConfig</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder elSqlConfig(
Object elSqlConfig) {
doSetProperty("elSqlConfig", elSqlConfig);
return this;
}
/**
* To use a specific configured ElSqlConfig. It may be better to use the
* databaseVendor option instead.
*
* The option will be converted to a
* <code>com.opengamma.elsql.ElSqlConfig</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder elSqlConfig(
String elSqlConfig) {
doSetProperty("elSqlConfig", elSqlConfig);
return this;
}
/**
* If set greater than zero, then Camel will use this count value of
* parameters to replace instead of querying via JDBC metadata API. This
* is useful if the JDBC vendor could not return correct parameters
* count, then user may override instead.
*
* The option is a: <code>int</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder parametersCount(
int parametersCount) {
doSetProperty("parametersCount", parametersCount);
return this;
}
/**
* If set greater than zero, then Camel will use this count value of
* parameters to replace instead of querying via JDBC metadata API. This
* is useful if the JDBC vendor could not return correct parameters
* count, then user may override instead.
*
* The option will be converted to a <code>int</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder parametersCount(
String parametersCount) {
doSetProperty("parametersCount", parametersCount);
return this;
}
/**
* Specifies a character that will be replaced to in SQL query. Notice,
* that it is simple String.replaceAll() operation and no SQL parsing is
* involved (quoted strings will also change).
*
* The option is a: <code>java.lang.String</code> type.
*
* Default: #
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder placeholder(
String placeholder) {
doSetProperty("placeholder", placeholder);
return this;
}
/**
* Allows to plugin to use a custom
* org.apache.camel.component.sql.SqlPrepareStatementStrategy to control
* preparation of the query and prepared statement.
*
* The option is a:
* <code>org.apache.camel.component.sql.SqlPrepareStatementStrategy</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder prepareStatementStrategy(
Object prepareStatementStrategy) {
doSetProperty("prepareStatementStrategy", prepareStatementStrategy);
return this;
}
/**
* Allows to plugin to use a custom
* org.apache.camel.component.sql.SqlPrepareStatementStrategy to control
* preparation of the query and prepared statement.
*
* The option will be converted to a
* <code>org.apache.camel.component.sql.SqlPrepareStatementStrategy</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder prepareStatementStrategy(
String prepareStatementStrategy) {
doSetProperty("prepareStatementStrategy", prepareStatementStrategy);
return this;
}
/**
* Sets whether synchronous processing should be strictly used, or Camel
* is allowed to use asynchronous processing (if supported).
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder synchronous(
boolean synchronous) {
doSetProperty("synchronous", synchronous);
return this;
}
/**
* Sets whether synchronous processing should be strictly used, or Camel
* is allowed to use asynchronous processing (if supported).
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder synchronous(
String synchronous) {
doSetProperty("synchronous", synchronous);
return this;
}
/**
* Configures the Spring JdbcTemplate with the key/values from the Map.
*
* The option is a: <code>java.util.Map<java.lang.String,
* java.lang.Object></code> type.
* The option is multivalued, and you can use the
* templateOptions(String, Object) method to add a value (call the
* method multiple times to set more values).
*
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder templateOptions(
String key,
Object value) {
doSetMultiValueProperty("templateOptions", "template." + key, value);
return this;
}
/**
* Configures the Spring JdbcTemplate with the key/values from the Map.
*
* The option is a: <code>java.util.Map<java.lang.String,
* java.lang.Object></code> type.
* The option is multivalued, and you can use the
* templateOptions(String, Object) method to add a value (call the
* method multiple times to set more values).
*
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder templateOptions(Map values) {
doSetMultiValueProperties("templateOptions", "template.", values);
return this;
}
/**
* Sets whether to use placeholder and replace all placeholder
* characters with sign in the SQL queries.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder usePlaceholder(
boolean usePlaceholder) {
doSetProperty("usePlaceholder", usePlaceholder);
return this;
}
/**
* Sets whether to use placeholder and replace all placeholder
* characters with sign in the SQL queries.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: true
* Group: advanced
*/
default AdvancedElsqlEndpointProducerBuilder usePlaceholder(
String usePlaceholder) {
doSetProperty("usePlaceholder", usePlaceholder);
return this;
}
}
/**
* Builder for endpoint for the ElSQL component.
*/
public interface ElsqlEndpointBuilder
extends
ElsqlEndpointConsumerBuilder,
ElsqlEndpointProducerBuilder {
default AdvancedElsqlEndpointBuilder advanced() {
return (AdvancedElsqlEndpointBuilder) this;
}
/**
* Whether to allow using named parameters in the queries.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: common
*/
default ElsqlEndpointBuilder allowNamedParameters(
boolean allowNamedParameters) {
doSetProperty("allowNamedParameters", allowNamedParameters);
return this;
}
/**
* Whether to allow using named parameters in the queries.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: true
* Group: common
*/
default ElsqlEndpointBuilder allowNamedParameters(
String allowNamedParameters) {
doSetProperty("allowNamedParameters", allowNamedParameters);
return this;
}
/**
* To use a vendor specific com.opengamma.elsql.ElSqlConfig.
*
* The option is a:
* <code>org.apache.camel.component.elsql.ElSqlDatabaseVendor</code>
* type.
*
* Group: common
*/
default ElsqlEndpointBuilder databaseVendor(
ElSqlDatabaseVendor databaseVendor) {
doSetProperty("databaseVendor", databaseVendor);
return this;
}
/**
* To use a vendor specific com.opengamma.elsql.ElSqlConfig.
*
* The option will be converted to a
* <code>org.apache.camel.component.elsql.ElSqlDatabaseVendor</code>
* type.
*
* Group: common
*/
default ElsqlEndpointBuilder databaseVendor(String databaseVendor) {
doSetProperty("databaseVendor", databaseVendor);
return this;
}
/**
* Sets the DataSource to use to communicate with the database.
*
* The option is a: <code>javax.sql.DataSource</code> type.
*
* Group: common
*/
default ElsqlEndpointBuilder dataSource(Object dataSource) {
doSetProperty("dataSource", dataSource);
return this;
}
/**
* Sets the DataSource to use to communicate with the database.
*
* The option will be converted to a <code>javax.sql.DataSource</code>
* type.
*
* Group: common
*/
default ElsqlEndpointBuilder dataSource(String dataSource) {
doSetProperty("dataSource", dataSource);
return this;
}
/**
* Sets the reference to a DataSource to lookup from the registry, to
* use for communicating with the database.
*
* The option is a: <code>java.lang.String</code> type.
*
* Group: common
*/
@Deprecated
default ElsqlEndpointBuilder dataSourceRef(String dataSourceRef) {
doSetProperty("dataSourceRef", dataSourceRef);
return this;
}
/**
* Specify the full package and class name to use as conversion when
* outputType=SelectOne.
*
* The option is a: <code>java.lang.String</code> type.
*
* Group: common
*/
default ElsqlEndpointBuilder outputClass(String outputClass) {
doSetProperty("outputClass", outputClass);
return this;
}
/**
* Store the query result in a header instead of the message body. By
* default, outputHeader == null and the query result is stored in the
* message body, any existing content in the message body is discarded.
* If outputHeader is set, the value is used as the name of the header
* to store the query result and the original message body is preserved.
*
* The option is a: <code>java.lang.String</code> type.
*
* Group: common
*/
default ElsqlEndpointBuilder outputHeader(String outputHeader) {
doSetProperty("outputHeader", outputHeader);
return this;
}
/**
* Make the output of consumer or producer to SelectList as List of Map,
* or SelectOne as single Java object in the following way: a) If the
* query has only single column, then that JDBC Column object is
* returned. (such as SELECT COUNT( ) FROM PROJECT will return a Long
* object. b) If the query has more than one column, then it will return
* a Map of that result. c) If the outputClass is set, then it will
* convert the query result into an Java bean object by calling all the
* setters that match the column names. It will assume your class has a
* default constructor to create instance with. d) If the query resulted
* in more than one rows, it throws an non-unique result exception.
* StreamList streams the result of the query using an Iterator. This
* can be used with the Splitter EIP in streaming mode to process the
* ResultSet in streaming fashion.
*
* The option is a:
* <code>org.apache.camel.component.sql.SqlOutputType</code> type.
*
* Default: SelectList
* Group: common
*/
default ElsqlEndpointBuilder outputType(SqlOutputType outputType) {
doSetProperty("outputType", outputType);
return this;
}
/**
* Make the output of consumer or producer to SelectList as List of Map,
* or SelectOne as single Java object in the following way: a) If the
* query has only single column, then that JDBC Column object is
* returned. (such as SELECT COUNT( ) FROM PROJECT will return a Long
* object. b) If the query has more than one column, then it will return
* a Map of that result. c) If the outputClass is set, then it will
* convert the query result into an Java bean object by calling all the
* setters that match the column names. It will assume your class has a
* default constructor to create instance with. d) If the query resulted
* in more than one rows, it throws an non-unique result exception.
* StreamList streams the result of the query using an Iterator. This
* can be used with the Splitter EIP in streaming mode to process the
* ResultSet in streaming fashion.
*
* The option will be converted to a
* <code>org.apache.camel.component.sql.SqlOutputType</code> type.
*
* Default: SelectList
* Group: common
*/
default ElsqlEndpointBuilder outputType(String outputType) {
doSetProperty("outputType", outputType);
return this;
}
/**
* The separator to use when parameter values is taken from message body
* (if the body is a String type), to be inserted at # placeholders.
* Notice if you use named parameters, then a Map type is used instead.
* The default value is comma.
*
* The option is a: <code>char</code> type.
*
* Default: ,
* Group: common
*/
default ElsqlEndpointBuilder separator(char separator) {
doSetProperty("separator", separator);
return this;
}
/**
* The separator to use when parameter values is taken from message body
* (if the body is a String type), to be inserted at # placeholders.
* Notice if you use named parameters, then a Map type is used instead.
* The default value is comma.
*
* The option will be converted to a <code>char</code> type.
*
* Default: ,
* Group: common
*/
default ElsqlEndpointBuilder separator(String separator) {
doSetProperty("separator", separator);
return this;
}
}
/**
* Advanced builder for endpoint for the ElSQL component.
*/
public interface AdvancedElsqlEndpointBuilder
extends
AdvancedElsqlEndpointConsumerBuilder,
AdvancedElsqlEndpointProducerBuilder {
default ElsqlEndpointBuilder basic() {
return (ElsqlEndpointBuilder) this;
}
/**
* If enabled then the populateStatement method from
* org.apache.camel.component.sql.SqlPrepareStatementStrategy is always
* invoked, also if there is no expected parameters to be prepared. When
* this is false then the populateStatement is only invoked if there is
* 1 or more expected parameters to be set; for example this avoids
* reading the message body/headers for SQL queries with no parameters.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder alwaysPopulateStatement(
boolean alwaysPopulateStatement) {
doSetProperty("alwaysPopulateStatement", alwaysPopulateStatement);
return this;
}
/**
* If enabled then the populateStatement method from
* org.apache.camel.component.sql.SqlPrepareStatementStrategy is always
* invoked, also if there is no expected parameters to be prepared. When
* this is false then the populateStatement is only invoked if there is
* 1 or more expected parameters to be set; for example this avoids
* reading the message body/headers for SQL queries with no parameters.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder alwaysPopulateStatement(
String alwaysPopulateStatement) {
doSetProperty("alwaysPopulateStatement", alwaysPopulateStatement);
return this;
}
/**
* Whether the endpoint should use basic property binding (Camel 2.x) or
* the newer property binding with additional capabilities.
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder basicPropertyBinding(
boolean basicPropertyBinding) {
doSetProperty("basicPropertyBinding", basicPropertyBinding);
return this;
}
/**
* Whether the endpoint should use basic property binding (Camel 2.x) or
* the newer property binding with additional capabilities.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder basicPropertyBinding(
String basicPropertyBinding) {
doSetProperty("basicPropertyBinding", basicPropertyBinding);
return this;
}
/**
* To use a specific configured ElSqlConfig. It may be better to use the
* databaseVendor option instead.
*
* The option is a: <code>com.opengamma.elsql.ElSqlConfig</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder elSqlConfig(Object elSqlConfig) {
doSetProperty("elSqlConfig", elSqlConfig);
return this;
}
/**
* To use a specific configured ElSqlConfig. It may be better to use the
* databaseVendor option instead.
*
* The option will be converted to a
* <code>com.opengamma.elsql.ElSqlConfig</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder elSqlConfig(String elSqlConfig) {
doSetProperty("elSqlConfig", elSqlConfig);
return this;
}
/**
* If set greater than zero, then Camel will use this count value of
* parameters to replace instead of querying via JDBC metadata API. This
* is useful if the JDBC vendor could not return correct parameters
* count, then user may override instead.
*
* The option is a: <code>int</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder parametersCount(int parametersCount) {
doSetProperty("parametersCount", parametersCount);
return this;
}
/**
* If set greater than zero, then Camel will use this count value of
* parameters to replace instead of querying via JDBC metadata API. This
* is useful if the JDBC vendor could not return correct parameters
* count, then user may override instead.
*
* The option will be converted to a <code>int</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder parametersCount(
String parametersCount) {
doSetProperty("parametersCount", parametersCount);
return this;
}
/**
* Specifies a character that will be replaced to in SQL query. Notice,
* that it is simple String.replaceAll() operation and no SQL parsing is
* involved (quoted strings will also change).
*
* The option is a: <code>java.lang.String</code> type.
*
* Default: #
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder placeholder(String placeholder) {
doSetProperty("placeholder", placeholder);
return this;
}
/**
* Allows to plugin to use a custom
* org.apache.camel.component.sql.SqlPrepareStatementStrategy to control
* preparation of the query and prepared statement.
*
* The option is a:
* <code>org.apache.camel.component.sql.SqlPrepareStatementStrategy</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder prepareStatementStrategy(
Object prepareStatementStrategy) {
doSetProperty("prepareStatementStrategy", prepareStatementStrategy);
return this;
}
/**
* Allows to plugin to use a custom
* org.apache.camel.component.sql.SqlPrepareStatementStrategy to control
* preparation of the query and prepared statement.
*
* The option will be converted to a
* <code>org.apache.camel.component.sql.SqlPrepareStatementStrategy</code> type.
*
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder prepareStatementStrategy(
String prepareStatementStrategy) {
doSetProperty("prepareStatementStrategy", prepareStatementStrategy);
return this;
}
/**
* Sets whether synchronous processing should be strictly used, or Camel
* is allowed to use asynchronous processing (if supported).
*
* The option is a: <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder synchronous(boolean synchronous) {
doSetProperty("synchronous", synchronous);
return this;
}
/**
* Sets whether synchronous processing should be strictly used, or Camel
* is allowed to use asynchronous processing (if supported).
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: false
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder synchronous(String synchronous) {
doSetProperty("synchronous", synchronous);
return this;
}
/**
* Configures the Spring JdbcTemplate with the key/values from the Map.
*
* The option is a: <code>java.util.Map<java.lang.String,
* java.lang.Object></code> type.
* The option is multivalued, and you can use the
* templateOptions(String, Object) method to add a value (call the
* method multiple times to set more values).
*
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder templateOptions(
String key,
Object value) {
doSetMultiValueProperty("templateOptions", "template." + key, value);
return this;
}
/**
* Configures the Spring JdbcTemplate with the key/values from the Map.
*
* The option is a: <code>java.util.Map<java.lang.String,
* java.lang.Object></code> type.
* The option is multivalued, and you can use the
* templateOptions(String, Object) method to add a value (call the
* method multiple times to set more values).
*
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder templateOptions(Map values) {
doSetMultiValueProperties("templateOptions", "template.", values);
return this;
}
/**
* Sets whether to use placeholder and replace all placeholder
* characters with sign in the SQL queries.
*
* The option is a: <code>boolean</code> type.
*
* Default: true
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder usePlaceholder(
boolean usePlaceholder) {
doSetProperty("usePlaceholder", usePlaceholder);
return this;
}
/**
* Sets whether to use placeholder and replace all placeholder
* characters with sign in the SQL queries.
*
* The option will be converted to a <code>boolean</code> type.
*
* Default: true
* Group: advanced
*/
default AdvancedElsqlEndpointBuilder usePlaceholder(
String usePlaceholder) {
doSetProperty("usePlaceholder", usePlaceholder);
return this;
}
}
/**
* Proxy enum for
* <code>org.apache.camel.component.elsql.ElSqlDatabaseVendor</code> enum.
*/
enum ElSqlDatabaseVendor {
Default,
Postgres,
HSql,
MySql,
Oracle,
SqlServer2008,
Veritca;
}
/**
* Proxy enum for <code>org.apache.camel.component.sql.SqlOutputType</code>
* enum.
*/
enum SqlOutputType {
SelectOne,
SelectList,
StreamList;
}
public interface ElsqlBuilders {
/**
* ElSQL (camel-elsql)
* Use ElSql to define SQL queries. Extends the SQL Component.
*
* Category: database,sql
* Since: 2.16
* Maven coordinates: org.apache.camel:camel-elsql
*
* Syntax: <code>elsql:elsqlName:resourceUri</code>
*
* Path parameter: elsqlName (required)
* The name of the elsql to use (is NAMED in the elsql file)
*
* Path parameter: resourceUri
* The resource file which contains the elsql SQL statements to use. You
* can specify multiple resources separated by comma. The resources are
* loaded on the classpath by default, you can prefix with file: to load
* from file system. Notice you can set this option on the component and
* then you do not have to configure this on the endpoint.
*
* @param path elsqlName:resourceUri
*/
default ElsqlEndpointBuilder elsql(String path) {
return ElsqlEndpointBuilderFactory.endpointBuilder("elsql", path);
}
/**
* ElSQL (camel-elsql)
* Use ElSql to define SQL queries. Extends the SQL Component.
*
* Category: database,sql
* Since: 2.16
* Maven coordinates: org.apache.camel:camel-elsql
*
* Syntax: <code>elsql:elsqlName:resourceUri</code>
*
* Path parameter: elsqlName (required)
* The name of the elsql to use (is NAMED in the elsql file)
*
* Path parameter: resourceUri
* The resource file which contains the elsql SQL statements to use. You
* can specify multiple resources separated by comma. The resources are
* loaded on the classpath by default, you can prefix with file: to load
* from file system. Notice you can set this option on the component and
* then you do not have to configure this on the endpoint.
*
* @param componentName to use a custom component name for the endpoint
* instead of the default name
* @param path elsqlName:resourceUri
*/
default ElsqlEndpointBuilder elsql(String componentName, String path) {
return ElsqlEndpointBuilderFactory.endpointBuilder(componentName, path);
}
}
static ElsqlEndpointBuilder endpointBuilder(
String componentName,
String path) {
class ElsqlEndpointBuilderImpl extends AbstractEndpointBuilder implements ElsqlEndpointBuilder, AdvancedElsqlEndpointBuilder {
public ElsqlEndpointBuilderImpl(String path) {
super(componentName, path);
}
}
return new ElsqlEndpointBuilderImpl(path);
}
} | {
"content_hash": "74797767f23e3458ae0c3a46f2a44a76",
"timestamp": "",
"source": "github",
"line_count": 2407,
"max_line_length": 134,
"avg_line_length": 39.41171582883257,
"alnum_prop": 0.5898233260246247,
"repo_name": "DariusX/camel",
"id": "23c5887f584440cf3559c75572f77571f112cfbe",
"size": "95666",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/ElsqlEndpointBuilderFactory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Apex",
"bytes": "6521"
},
{
"name": "Batchfile",
"bytes": "2353"
},
{
"name": "CSS",
"bytes": "17204"
},
{
"name": "Elm",
"bytes": "10852"
},
{
"name": "FreeMarker",
"bytes": "8015"
},
{
"name": "Groovy",
"bytes": "14479"
},
{
"name": "HTML",
"bytes": "909437"
},
{
"name": "Java",
"bytes": "82050070"
},
{
"name": "JavaScript",
"bytes": "102432"
},
{
"name": "Makefile",
"bytes": "513"
},
{
"name": "Shell",
"bytes": "17240"
},
{
"name": "TSQL",
"bytes": "28692"
},
{
"name": "Tcl",
"bytes": "4974"
},
{
"name": "Thrift",
"bytes": "6979"
},
{
"name": "XQuery",
"bytes": "546"
},
{
"name": "XSLT",
"bytes": "271473"
}
],
"symlink_target": ""
} |
package com.sequenceiq.environment.api.v1.environment.model;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.sequenceiq.environment.api.doc.environment.EnvironmentModelDescription;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ApiModel(value = "EnvironmentNetworkAzureV1Params")
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(Include.NON_NULL)
public class EnvironmentNetworkAzureParams {
@Size(max = 255)
@ApiModelProperty(value = EnvironmentModelDescription.AZURE_NETWORK_ID, required = true)
private String networkId;
@Size(max = 255)
@ApiModelProperty(value = EnvironmentModelDescription.AZURE_RESOURCE_GROUP_NAME, required = true)
private String resourceGroupName;
@Size(max = 255)
@ApiModelProperty(value = EnvironmentModelDescription.AZURE_PRIVATE_DNS_ZONE_ID)
private String databasePrivateDnsZoneId;
@NotNull
@ApiModelProperty(EnvironmentModelDescription.AZURE_NO_PUBLIC_IP)
private Boolean noPublicIp;
public String getNetworkId() {
return networkId;
}
public void setNetworkId(String networkId) {
this.networkId = networkId;
}
public String getResourceGroupName() {
return resourceGroupName;
}
public void setResourceGroupName(String resourceGroupName) {
this.resourceGroupName = resourceGroupName;
}
public Boolean getNoPublicIp() {
return noPublicIp;
}
public void setNoPublicIp(Boolean noPublicIp) {
this.noPublicIp = noPublicIp;
}
public String getDatabasePrivateDnsZoneId() {
return databasePrivateDnsZoneId;
}
public void setDatabasePrivateDnsZoneId(String databasePrivateDnsZoneId) {
this.databasePrivateDnsZoneId = databasePrivateDnsZoneId;
}
@Override
public String toString() {
return "EnvironmentNetworkAzureParams{" +
"networkId='" + networkId + '\'' +
", resourceGroupName='" + resourceGroupName + '\'' +
", databasePrivateDnsZoneId='" + databasePrivateDnsZoneId + '\'' +
", noPublicIp=" + noPublicIp +
'}';
}
public static final class EnvironmentNetworkAzureParamsBuilder {
private String networkId;
private String resourceGroupName;
private Boolean noPublicIp;
private String databasePrivateDnsZoneId;
private EnvironmentNetworkAzureParamsBuilder() {
}
public static EnvironmentNetworkAzureParamsBuilder anEnvironmentNetworkAzureParams() {
return new EnvironmentNetworkAzureParamsBuilder();
}
public EnvironmentNetworkAzureParamsBuilder withNetworkId(String networkId) {
this.networkId = networkId;
return this;
}
public EnvironmentNetworkAzureParamsBuilder withResourceGroupName(String resourceGroupName) {
this.resourceGroupName = resourceGroupName;
return this;
}
public EnvironmentNetworkAzureParamsBuilder withNoPublicIp(Boolean noPublicIp) {
this.noPublicIp = noPublicIp;
return this;
}
public EnvironmentNetworkAzureParamsBuilder withDatabasePrivateDnsZoneId(String databasePrivateDnsZoneId) {
this.databasePrivateDnsZoneId = databasePrivateDnsZoneId;
return this;
}
public EnvironmentNetworkAzureParams build() {
EnvironmentNetworkAzureParams environmentNetworkAzureParams = new EnvironmentNetworkAzureParams();
environmentNetworkAzureParams.setNetworkId(networkId);
environmentNetworkAzureParams.setResourceGroupName(resourceGroupName);
environmentNetworkAzureParams.setNoPublicIp(noPublicIp);
environmentNetworkAzureParams.setDatabasePrivateDnsZoneId(databasePrivateDnsZoneId);
return environmentNetworkAzureParams;
}
}
}
| {
"content_hash": "ea61580e9601a6e7b2c7f7b1c0747771",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 115,
"avg_line_length": 33.9349593495935,
"alnum_prop": 0.7156205079060853,
"repo_name": "hortonworks/cloudbreak",
"id": "eab4246a0f98adc3f71d73b0e4ce781014e64d74",
"size": "4174",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "environment-api/src/main/java/com/sequenceiq/environment/api/v1/environment/model/EnvironmentNetworkAzureParams.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "7535"
},
{
"name": "Dockerfile",
"bytes": "9586"
},
{
"name": "Fluent",
"bytes": "10"
},
{
"name": "FreeMarker",
"bytes": "395982"
},
{
"name": "Groovy",
"bytes": "523"
},
{
"name": "HTML",
"bytes": "9917"
},
{
"name": "Java",
"bytes": "55250904"
},
{
"name": "JavaScript",
"bytes": "47923"
},
{
"name": "Jinja",
"bytes": "190660"
},
{
"name": "Makefile",
"bytes": "8537"
},
{
"name": "PLpgSQL",
"bytes": "1830"
},
{
"name": "Perl",
"bytes": "17726"
},
{
"name": "Python",
"bytes": "29898"
},
{
"name": "SaltStack",
"bytes": "222692"
},
{
"name": "Scala",
"bytes": "11168"
},
{
"name": "Shell",
"bytes": "416225"
}
],
"symlink_target": ""
} |
{%- set breadcrumbdelim = breadcrumbdelim is not defined and ' »' or breadcrumbdelim %}
{%- set reldelim = reldelim is not defined and '|' or reldelim %}
{%- macro breadcrumbs() %}
<ul id="breadcrumbs">
{% if pagename != 'index' %}
{%- block rootrellink %}
<li><a href="{{ pathto('index') }}">{{ docstitle }}</a>{{ breadcrumbdelim }}</li>
{%- endblock %}
{%- for parent in parents %}
<li><a href="{{ parent.link|e }}" accesskey="U">{{ parent.title }}</a>{{ breadcrumbdelim }}</li>
{%- endfor %}
<li>{{ title|striptags }}</li>
{%- else %}
<li>{{ docstitle }}</li>
{%- endif %}
</ul>
{%- endmacro %}
{%- macro rellinkbar() %}
<ul id="relatedlinks" class="selfclear">
{%- for rellink in rellinks %}
<li{% if loop.first %} class="first"{% endif %}>
<a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags }}"
accesskey="{{ rellink[2] }}">{{ rellink[3] }}</a>
{%- if not loop.first %}{{ reldelim }}{% endif %}</li>
{%- endfor %}
{%- block relbaritems %}{% endblock %}
</ul>
{%- endmacro %}
{%- macro sidebar() %}
{%- if builder != 'htmlhelp' %}
<div id="sidebar"{%- if pagename not in ['index', 'search'] %} class="sidebar-offcanvas contrast col-sm-4 sidebar-offcanvas" {%- else %} class="sidebar-offcanvas col-sm-4 sidebar-offcanvas" {%- endif %} id="sidebar" role="navigation">
<div>
<form id="quick-search" action="search.html" method="get" style="width: 100%;">
<fieldset>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
<input id="quick-search-query" type="text" name="q" accessKey="q" name="searchQuery.queryString" size="25" value="Search Documentation…" size="20" tabindex="3" onblur="if(this.value=='') this.value='Search Documentation…';" onfocus="if(this.value=='Search Documentation…') this.value='';" />
</fieldset>
</form>
<div class="btn-group-vertical" id="docs_toc">
<button type="button" class="btn btn-default"><a href="/docs/">User Manual</a></button>
<button type="button" class="btn btn-default"><a href="/technical/">Technical Manual</a></button>
<button type="button" class="btn btn-default"><a href="/manpages/">Man Pages</a></button>
<button type="button" class="btn btn-default"><a href="/workshop/">Workshop</a></button>
</div>
{%- if display_toc %}
<h3 class="pngfix">Table Of Contents</h3>
{%- block sidebartoc %}
{{ toc }}
<div class="section-footer"></div>
</div>
{%- endblock %}
{%- endif %}
{%- block sidebarrel %}
{%- if (prev or next) %}
<div class="section continue_reading">
<h3>Continue Reading</h3>
<ul>
{%- if prev %}
<li>Previous: <a href="{{ prev.link|e }}" title="previous chapter">{{ prev.title }}</a></li>
{%- endif %}
{%- if next %}
<li>Next: <a href="{{ next.link|e }}" title="next chapter">{{ next.title }}</a></li>
{%- endif %}
</ul>
</div>
{%- endif %}
{%- endblock %}
{%- if sourcename %}
<div class="section">
<h3>This Page</h3>
<ul class="this-page-menu">
{%- if builder == 'web' %}
<li><a href="#comments">Comments ({{ comments|length }} so far)</a></li>
<li><a href="{{ pathto('@edit/' + sourcename)|e }}">Suggest Change</a></li>
<li><a href="{{ pathto('@source/' + sourcename)|e }}">Show Source</a></li>
{%- elif builder == 'html' %}
<li><a href="{{ pathto('_sources/' + sourcename, true)|e }}">Show Source</a></li>
{%- endif %}
</ul>
</div>
<div class="section">
<h3>License</h3>
<p>This project is licensed under the <a href="https://github.com/locationtech/geogig/blob/master/LICENSE.txt">Eclipse License</a>.</p>
</div>
{%- endif %}
{%- if customsidebar %}
{{ rendertemplate(customsidebar) }}
{%- endif %}
{%- block sidebarsearch %}{%- endblock %}
</div><!-- /#sidebar -->
{%- endif %}
{%- endmacro -%}
{%- block doctype -%}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
{%- endblock %}
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, maximum-scale=1">
{{ metatags }}
{%- if not embedded %}
{%- set titlesuffix = " — "|safe + docstitle|e %}
{%- else %}
{%- set titlesuffix = "" %}
{%- endif %}
<title>{{ title|striptags }}{{ titlesuffix }}</title>
{%- block basecss %}
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,700italic,800italic,300,700,600,800,400' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Cantarell:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="{{ pathto('_static/screen.css', 1) }}" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="{{ pathto('_static/print.css', 1) }}" type="text/css" media="print" />
<!--[if IE]>
<link rel="stylesheet" href="{{ pathto('_static/blueprint/ie.css', 1) }}" type="text/css" media="screen, projection" />
<![endif]-->
{%- endblock %}
{%- if builder == 'web' %}
<link rel="stylesheet" href="{{ pathto('index') }}?do=stylesheet{%
if in_admin_panel %}&admin=yes{% endif %}" type="text/css" />
{%- for link, type, title in page_links %}
<link rel="alternate" type="{{ type|e(true) }}" title="{{ title|e(true) }}" href="{{ link|e(true) }}" />
{%- endfor %}
{%- else %}
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/bootstrap.min.css', 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/offcanvas.css', 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
{%- endif %}
{%- if builder != 'htmlhelp' %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '{{ pathto("", 1) }}',
VERSION: '{{ release }}',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '{{ file_suffix }}'
};
</script>
{%- if use_opensearch %}
<link rel="search" type="application/opensearchdescription+xml"
title="Search within {{ docstitle }}"
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
{%- endif %}
{%- if favicon %}
<link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/>
{%- endif %}
{%- endif %}
{%- block linktags %}
{%- if hasdoc('about') %}
<link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" />
{%- endif %}
{%- if hasdoc('genindex') %}
<link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
{%- endif %}
{%- if hasdoc('search') %}
<link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
{%- endif %}
{%- if hasdoc('copyright') %}
<link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
{%- endif %}
<link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
{%- if parents %}
<link rel="up" title="{{ parents[-1].title|striptags }}" href="{{ parents[-1].link|e }}" />
{%- endif %}
{%- if next %}
<link rel="next" title="{{ next.title|striptags }}" href="{{ next.link|e }}" />
{%- endif %}
{%- if prev %}
<link rel="prev" title="{{ prev.title|striptags }}" href="{{ prev.link|e }}" />
{%- endif %}
{%- endblock %}
{%- block extrahead %}{% endblock %}
</head>
<body class="{{pagename}}">
<div id="blacktop"></div>
<header id="masthead">
<div class="navbar">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://geogig.org"><h1>GeoGig</h1></a>
</div>
<div class="navbar-collapse collapse navbar-right">
<ul class="nav navbar-nav">
<li><a href="http://geogig.org/#install">Get Started</a></li>
<li><a href="http://geogig.org/docs/index.html">Documentation</a></li>
<li><a href="https://github.com/locationtech/geogig">On Github</a></li>
</ul>
</div><!--/.navbar-collapse -->
</div>
</div>
</header>
<section class="subheading hidden-xs">
<div class="container">
<div class="row">
<div class="col-md-8">
<p class="byline">A Tool for Geospatial Data Management</p>
</div>
</div>
</div>
</section>
<a name="top"></a>
<div id="main">
<div class="wrap selfclear">
<div id="content">
<div class="container">
<div class="row row-offcanvas row-offcanvas-right">
<div class="col-md-8">
<div class="row pull-right">
<div class="visible-sm visible-xs" id="menu-btn">
<button class="btn btn-blue btn-sm"type="button" data-toggle="offcanvas">
<span class="btn-text active">Menu →</span>
<span class="btn-back">← Back</span>
</button>
</div>
</div>
{%- block breadcrumbbar %}{{ breadcrumbs() }}{% endblock %}
{%- block rellinkbar %}{{ rellinkbar() }}{% endblock %}
{%- block document %}
{% block body %}{% endblock %}
{%- endblock %}
{%- if (prev or next) %}
<div class="selfclear pagination-nav">
{%- if prev %}
<div class="leftwise"><strong>Previous</strong>: <a href="{{ prev.link|e }}" title="previous chapter">{{ prev.title }}</a></div>
{%- endif %}
{%- if next %}
<div class="rightwise"><strong>Next</strong>: <a href="{{ next.link|e }}" title="next chapter">{{ next.title }}</a></div>
{%- endif %}
</div>
{%- endif %}
<p class="centered-text"><a href="#top"><img src="{{ pathto('_static/arrow_up.png', 1) }}" alt="back to top"/></a></p>
</div><!-- /#content> -->
{%- block sidebar %}{{ sidebar() }}{% endblock %}
</div><!-- /.wrap> -->
</div>
</div>
</div><!-- /#main -->
{%- block footer %}
<footer>
<div class="container">
<div class="row">
<div class=""><p class="repo-owner"><a href="https://github.com/locationtech/geogig">GeoGig</a> is maintained by <a href="https://github.com/boundlessgeo"><img src="{{ pathto('_static/Boundless_Logo.png', 1) }}" alt="Boundless"></a></p></div>
</div>
</div>
</footer>
{%- endblock %}
<script type="text/javascript" src="{{ pathto('_static/jquery.js', 1) }}"></script>
<script type="text/javascript" src="{{ pathto('_static/jquery-migrate-min.js', 1) }}"></script>
<script type="text/javascript" src="{{ pathto('_static/bootstrap.js', 1) }}" ></script>
<script type="text/javascript" src="{{ pathto('_static/underscore.js', 1) }}"></script>
<script type="text/javascript" src="{{ pathto('_static/doctools.js', 1) }}"></script>
<script type="text/javascript" src="{{ pathto('_static/searchtools.js', 1) }}"></script>
<script type="text/javascript" src="{{ pathto('searchindex.js', 1) }}"></script>
<script>
$(document).ready(function() {
$('[data-toggle=offcanvas]').click(function(e) {
e.stopPropagation();
$('.row-offcanvas').toggleClass('active');
$('.btn-back').toggleClass('active');
$('.btn-text').toggleClass('active');
});
$('.list-group-item').click(function(e) {
e.stopPropagation();
$('.row-offcanvas').toggleClass('active');
$('.btn-back').toggleClass('active');
$('.btn-text').toggleClass('active');
});
});
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-3879903-19']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>
| {
"content_hash": "158aa34a3beeaff8d96a667f36f953fe",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 324,
"avg_line_length": 41.701298701298704,
"alnum_prop": 0.5439115540330115,
"repo_name": "tsauerwein/geogig",
"id": "ba7f16db8d5d14f2c4875f37a7e91711502db04e",
"size": "12844",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "doc/themes/geogig_docs/layout.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "861"
},
{
"name": "Cucumber",
"bytes": "145383"
},
{
"name": "HTML",
"bytes": "63037"
},
{
"name": "Java",
"bytes": "4938842"
},
{
"name": "Shell",
"bytes": "1883"
}
],
"symlink_target": ""
} |
import { moduleFor, test } from 'ember-qunit';
moduleFor('controller:ships', 'Unit | Controller | ships', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.subject();
assert.ok(controller);
});
| {
"content_hash": "cf20c921bc02a012caa5ff9e098458ea",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 61,
"avg_line_length": 28.833333333333332,
"alnum_prop": 0.6820809248554913,
"repo_name": "roscorcoran/ship-chip",
"id": "f91aa8bb556666590171e2184fce54642ff01694",
"size": "346",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "client/tests/unit/controllers/ships-test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "19051"
},
{
"name": "HTML",
"bytes": "5117"
},
{
"name": "JavaScript",
"bytes": "28277"
},
{
"name": "Shell",
"bytes": "798"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>pymatgen.command_line.gulp_caller module — pymatgen 2019.10.16 documentation</title>
<link rel="stylesheet" href="_static/proBlue.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></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/language_data.js"></script>
<script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33990148-1']);
_gaq.push(['_trackPageview']);
</script>
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pymatgen 2019.10.16 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-pymatgen.command_line.gulp_caller">
<span id="pymatgen-command-line-gulp-caller-module"></span><h1>pymatgen.command_line.gulp_caller module<a class="headerlink" href="#module-pymatgen.command_line.gulp_caller" title="Permalink to this headline">¶</a></h1>
<p>Interface with command line GULP.
<a class="reference external" href="http://projects.ivec.org">http://projects.ivec.org</a>
WARNING: you need to have GULP installed on your system.</p>
<dl class="class">
<dt id="pymatgen.command_line.gulp_caller.BuckinghamPotential">
<em class="property">class </em><code class="sig-name descname">BuckinghamPotential</code><span class="sig-paren">(</span><em class="sig-param">bush_lewis_flag</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#BuckinghamPotential"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.BuckinghamPotential" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Generate the Buckingham Potential Table from the bush.lib and lewis.lib.</p>
<p>Ref:
T.S.Bush, J.D.Gale, C.R.A.Catlow and P.D. Battle, J. Mater Chem.,
4, 831-837 (1994).
G.V. Lewis and C.R.A. Catlow, J. Phys. C: Solid State Phys., 18,
1149-1161 (1985)</p>
</dd></dl>
<dl class="class">
<dt id="pymatgen.command_line.gulp_caller.GulpCaller">
<em class="property">class </em><code class="sig-name descname">GulpCaller</code><span class="sig-paren">(</span><em class="sig-param">cmd='gulp'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#GulpCaller"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.GulpCaller" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Class to run gulp from commandline</p>
<p>Initialize with the executable if not in the standard path</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>cmd</strong> – Command. Defaults to gulp.</p>
</dd>
</dl>
<dl class="method">
<dt id="pymatgen.command_line.gulp_caller.GulpCaller.run">
<code class="sig-name descname">run</code><span class="sig-paren">(</span><em class="sig-param">gin</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#GulpCaller.run"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.GulpCaller.run" title="Permalink to this definition">¶</a></dt>
<dd><p>Run GULP using the gin as input</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>gin</strong> – GULP input string</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>GULP output string</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>gout</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="exception">
<dt id="pymatgen.command_line.gulp_caller.GulpConvergenceError">
<em class="property">exception </em><code class="sig-name descname">GulpConvergenceError</code><span class="sig-paren">(</span><em class="sig-param">msg=''</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#GulpConvergenceError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.GulpConvergenceError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p>
<p>Exception class for GULP.
Raised when proper convergence is not reached in Mott-Littleton
defect energy optimisation procedure in GULP</p>
</dd></dl>
<dl class="exception">
<dt id="pymatgen.command_line.gulp_caller.GulpError">
<em class="property">exception </em><code class="sig-name descname">GulpError</code><span class="sig-paren">(</span><em class="sig-param">msg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#GulpError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.GulpError" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">Exception</span></code></p>
<p>Exception class for GULP.
Raised when the GULP gives an error</p>
</dd></dl>
<dl class="class">
<dt id="pymatgen.command_line.gulp_caller.GulpIO">
<em class="property">class </em><code class="sig-name descname">GulpIO</code><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#GulpIO"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.GulpIO" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>To generate GULP input and process output</p>
<dl class="method">
<dt id="pymatgen.command_line.gulp_caller.GulpIO.buckingham_input">
<code class="sig-name descname">buckingham_input</code><span class="sig-paren">(</span><em class="sig-param">structure</em>, <em class="sig-param">keywords</em>, <em class="sig-param">library=None</em>, <em class="sig-param">uc=True</em>, <em class="sig-param">valence_dict=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#GulpIO.buckingham_input"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.GulpIO.buckingham_input" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets a GULP input for an oxide structure and buckingham potential
from library.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – pymatgen.core.structure.Structure</p></li>
<li><p><strong>keywords</strong> – GULP first line keywords.</p></li>
<li><p><strong>library</strong> (<em>Default=None</em>) – File containing the species and potential.</p></li>
<li><p><strong>uc</strong> (<em>Default=True</em>) – Unit Cell Flag.</p></li>
<li><p><strong>valence_dict</strong> – {El: valence}</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.command_line.gulp_caller.GulpIO.buckingham_potential">
<code class="sig-name descname">buckingham_potential</code><span class="sig-paren">(</span><em class="sig-param">structure</em>, <em class="sig-param">val_dict=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#GulpIO.buckingham_potential"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.GulpIO.buckingham_potential" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate species, buckingham, and spring options for an oxide structure
using the parameters in default libraries.</p>
<dl class="simple">
<dt>Ref:</dt><dd><ol class="arabic simple">
<li><p>G.V. Lewis and C.R.A. Catlow, J. Phys. C: Solid State Phys.,
18, 1149-1161 (1985)</p></li>
<li><p>T.S.Bush, J.D.Gale, C.R.A.Catlow and P.D. Battle,
J. Mater Chem., 4, 831-837 (1994)</p></li>
</ol>
</dd>
</dl>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – pymatgen.core.structure.Structure</p></li>
<li><p><strong>val_dict</strong> (<em>Needed if structure is not charge neutral</em>) – {El:valence}
dict, where El is element.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.command_line.gulp_caller.GulpIO.get_energy">
<code class="sig-name descname">get_energy</code><span class="sig-paren">(</span><em class="sig-param">gout</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#GulpIO.get_energy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.GulpIO.get_energy" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pymatgen.command_line.gulp_caller.GulpIO.get_relaxed_structure">
<code class="sig-name descname">get_relaxed_structure</code><span class="sig-paren">(</span><em class="sig-param">gout</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#GulpIO.get_relaxed_structure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.GulpIO.get_relaxed_structure" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pymatgen.command_line.gulp_caller.GulpIO.keyword_line">
<code class="sig-name descname">keyword_line</code><span class="sig-paren">(</span><em class="sig-param">*args</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#GulpIO.keyword_line"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.GulpIO.keyword_line" title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if the input args are proper gulp keywords and
generates the 1st line of gulp input. Full keywords are expected.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>*args</strong> – 1st line keywords</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.command_line.gulp_caller.GulpIO.library_line">
<code class="sig-name descname">library_line</code><span class="sig-paren">(</span><em class="sig-param">file_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#GulpIO.library_line"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.GulpIO.library_line" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies GULP library file to read species and potential parameters.
If using library don’t specify species and potential
in the input file and vice versa. Make sure the elements of
structure are in the library file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>file_name</strong> – Name of GULP library file</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>GULP input string specifying library option</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.command_line.gulp_caller.GulpIO.specie_potential_lines">
<code class="sig-name descname">specie_potential_lines</code><span class="sig-paren">(</span><em class="sig-param">structure</em>, <em class="sig-param">potential</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#GulpIO.specie_potential_lines"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.GulpIO.specie_potential_lines" title="Permalink to this definition">¶</a></dt>
<dd><p>Generates GULP input specie and potential string for pymatgen
structure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – pymatgen.core.structure.Structure object</p></li>
<li><p><strong>potential</strong> – String specifying the type of potential used</p></li>
<li><p><strong>**kwargs</strong> – Additional parameters related to potential. For
potential == “buckingham”,
anion_shell_flg (default = False):
If True, anions are considered polarizable.
anion_core_chrg=float
anion_shell_chrg=float
cation_shell_flg (default = False):
If True, cations are considered polarizable.
cation_core_chrg=float
cation_shell_chrg=float</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>string containing specie and potential specification for gulp
input.</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.command_line.gulp_caller.GulpIO.structure_lines">
<code class="sig-name descname">structure_lines</code><span class="sig-paren">(</span><em class="sig-param">structure</em>, <em class="sig-param">cell_flg=True</em>, <em class="sig-param">frac_flg=True</em>, <em class="sig-param">anion_shell_flg=True</em>, <em class="sig-param">cation_shell_flg=False</em>, <em class="sig-param">symm_flg=True</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#GulpIO.structure_lines"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.GulpIO.structure_lines" title="Permalink to this definition">¶</a></dt>
<dd><p>Generates GULP input string corresponding to pymatgen structure.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – pymatgen Structure object</p></li>
<li><p><strong>cell_flg</strong> (<em>default = True</em>) – Option to use lattice parameters.</p></li>
<li><p><strong>fractional_flg</strong> (<em>default = True</em>) – If True, fractional coordinates
are used. Else, cartesian coodinates in Angstroms are used.
<strong>**</strong>
GULP convention is to use fractional coordinates for periodic
structures and cartesian coordinates for non-periodic
structures.
<strong>**</strong></p></li>
<li><p><strong>anion_shell_flg</strong> (<em>default = True</em>) – If True, anions are considered
polarizable.</p></li>
<li><p><strong>cation_shell_flg</strong> (<em>default = False</em>) – If True, cations are
considered polarizable.</p></li>
<li><p><strong>symm_flg</strong> (<em>default = True</em>) – If True, symmetry information is also
written.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>string containing structure for GULP input</p>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.command_line.gulp_caller.GulpIO.tersoff_input">
<code class="sig-name descname">tersoff_input</code><span class="sig-paren">(</span><em class="sig-param">structure</em>, <em class="sig-param">periodic=False</em>, <em class="sig-param">uc=True</em>, <em class="sig-param">*keywords</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#GulpIO.tersoff_input"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.GulpIO.tersoff_input" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets a GULP input with Tersoff potential for an oxide structure</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – pymatgen.core.structure.Structure</p></li>
<li><p><strong>periodic</strong> (<em>Default=False</em>) – Flag denoting whether periodic
boundary conditions are used</p></li>
<li><p><strong>library</strong> (<em>Default=None</em>) – File containing the species and potential.</p></li>
<li><p><strong>uc</strong> (<em>Default=True</em>) – Unit Cell Flag.</p></li>
<li><p><strong>keywords</strong> – GULP first line keywords.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pymatgen.command_line.gulp_caller.GulpIO.tersoff_potential">
<code class="sig-name descname">tersoff_potential</code><span class="sig-paren">(</span><em class="sig-param">structure</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#GulpIO.tersoff_potential"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.GulpIO.tersoff_potential" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate the species, tersoff potential lines for an oxide structure</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>structure</strong> – pymatgen.core.structure.Structure</p>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pymatgen.command_line.gulp_caller.TersoffPotential">
<em class="property">class </em><code class="sig-name descname">TersoffPotential</code><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#TersoffPotential"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.TersoffPotential" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Generate Tersoff Potential Table from “OxideTersoffPotentialentials” file</p>
</dd></dl>
<dl class="function">
<dt id="pymatgen.command_line.gulp_caller.get_energy_buckingham">
<code class="sig-name descname">get_energy_buckingham</code><span class="sig-paren">(</span><em class="sig-param">structure</em>, <em class="sig-param">gulp_cmd='gulp'</em>, <em class="sig-param">keywords=('optimise'</em>, <em class="sig-param">'conp'</em>, <em class="sig-param">'qok')</em>, <em class="sig-param">valence_dict=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#get_energy_buckingham"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.get_energy_buckingham" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the energy of a structure using Buckingham potential.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – pymatgen.core.structure.Structure</p></li>
<li><p><strong>gulp_cmd</strong> – GULP command if not in standard place</p></li>
<li><p><strong>keywords</strong> – GULP first line keywords</p></li>
<li><p><strong>valence_dict</strong> – {El: valence}. Needed if the structure is not charge
neutral.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pymatgen.command_line.gulp_caller.get_energy_relax_structure_buckingham">
<code class="sig-name descname">get_energy_relax_structure_buckingham</code><span class="sig-paren">(</span><em class="sig-param">structure</em>, <em class="sig-param">gulp_cmd='gulp'</em>, <em class="sig-param">keywords=('optimise'</em>, <em class="sig-param">'conp')</em>, <em class="sig-param">valence_dict=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#get_energy_relax_structure_buckingham"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.get_energy_relax_structure_buckingham" title="Permalink to this definition">¶</a></dt>
<dd><p>Relax a structure and compute the energy using Buckingham potential.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – pymatgen.core.structure.Structure</p></li>
<li><p><strong>gulp_cmd</strong> – GULP command if not in standard place</p></li>
<li><p><strong>keywords</strong> – GULP first line keywords</p></li>
<li><p><strong>valence_dict</strong> – {El: valence}. Needed if the structure is not charge
neutral.</p></li>
</ul>
</dd>
</dl>
</dd></dl>
<dl class="function">
<dt id="pymatgen.command_line.gulp_caller.get_energy_tersoff">
<code class="sig-name descname">get_energy_tersoff</code><span class="sig-paren">(</span><em class="sig-param">structure</em>, <em class="sig-param">gulp_cmd='gulp'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pymatgen/command_line/gulp_caller.html#get_energy_tersoff"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pymatgen.command_line.gulp_caller.get_energy_tersoff" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the energy of a structure using Tersoff potential.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>structure</strong> – pymatgen.core.structure.Structure</p></li>
<li><p><strong>gulp_cmd</strong> – GULP command if not in standard place</p></li>
</ul>
</dd>
</dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/pymatgen.command_line.gulp_caller.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">pymatgen 2019.10.16 documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2011, Pymatgen Development Team.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.0.
</div>
<div class="footer">This page uses <a href="http://analytics.google.com/">
Google Analytics</a> to collect statistics. You can disable it by blocking
the JavaScript coming from www.google-analytics.com.
<script type="text/javascript">
(function() {
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ?
'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
})();
</script>
</div>
</body>
</html> | {
"content_hash": "8ff61aae1dbd21d9595b9f759cd607bb",
"timestamp": "",
"source": "github",
"line_count": 400,
"max_line_length": 670,
"avg_line_length": 62.22,
"alnum_prop": 0.7025072324011572,
"repo_name": "tschaume/pymatgen",
"id": "ba3c8149720570a6d26b7f75057d6990d8759c4e",
"size": "24992",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/pymatgen.command_line.gulp_caller.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "5100"
},
{
"name": "CSS",
"bytes": "7550"
},
{
"name": "Common Lisp",
"bytes": "3029065"
},
{
"name": "Dockerfile",
"bytes": "277"
},
{
"name": "HTML",
"bytes": "827"
},
{
"name": "Makefile",
"bytes": "5573"
},
{
"name": "Perl",
"bytes": "229104"
},
{
"name": "Propeller Spin",
"bytes": "15152267"
},
{
"name": "Python",
"bytes": "7560590"
},
{
"name": "Roff",
"bytes": "4298591"
},
{
"name": "Shell",
"bytes": "711"
}
],
"symlink_target": ""
} |
def h_index(citations)
lbound, ubound = 0, citations.size - 1
while ubound >= lbound
m = (ubound + lbound) / 2
case citations[m] <=> citations.size - m
when -1; lbound = m + 1
when 1; ubound = m - 1
when 0; return citations[m]
end
end
citations.size - ubound - 1
end
| {
"content_hash": "a0ee6dc257fb096e5749ed3f1622b9ec",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 44,
"avg_line_length": 20.266666666666666,
"alnum_prop": 0.5921052631578947,
"repo_name": "shemerey/coderepo",
"id": "81f5cdc98ab1e6574581af715a2488edc08fc4ed",
"size": "537",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "algorithms/h_index_ii.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "2413"
},
{
"name": "Ruby",
"bytes": "298898"
},
{
"name": "SQLPL",
"bytes": "685"
},
{
"name": "Shell",
"bytes": "2947"
}
],
"symlink_target": ""
} |
**Namespace:** [OfficeDevPnP.Core.UPAWebService](OfficeDevPnP.Core.UPAWebService.md)
**Assembly:** OfficeDevPnP.Core.dll
## Syntax
```C#
public ValueData()
```
## See also
- [ValueData](OfficeDevPnP.Core.UPAWebService.ValueData.md)
- [OfficeDevPnP.Core.UPAWebService](OfficeDevPnP.Core.UPAWebService.md)
| {
"content_hash": "c76d197b47fadf33e70b2b39d1368ce3",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 86,
"avg_line_length": 28.363636363636363,
"alnum_prop": 0.75,
"repo_name": "PaoloPia/PnP-Guidance",
"id": "e2f5a1979ed6aea6940ab34a9345bde4d8f66d38",
"size": "343",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "sitescore/OfficeDevPnP.Core.UPAWebService.ValueData.ctor1.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PowerShell",
"bytes": "783"
}
],
"symlink_target": ""
} |
package net.goldenspiral.fetlifeoss.sync;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import net.goldenspiral.fetlifeoss.FetLife;
import net.goldenspiral.fetlifeoss.bus.CountsReceivedEvent;
import net.goldenspiral.fetlifeoss.rest.model.Counts;
import net.goldenspiral.fetlifeoss.util.Log;
import java.util.Calendar;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
/**
* Created by malachi on 10/11/15.
*/
public class PeriodicSync
extends BroadcastReceiver
{
private static final String TAG = PeriodicSync.class.getSimpleName();
public static final String ARG_ENABLED = PeriodicSync.class.getName() + ":enabled";
private static final String ARG_PERIODIC = PeriodicSync.class.getName() + ":periodic";
private static int REQUEST_CODE = -1;
private static PendingIntent pendingIntent = null;
private static long syncIntervalInMS = 1000 * 60 * 60;
private CountsReceivedEvent lastEvent;
public static Intent createIntent(Context context, boolean syncEnabled)
{
Intent intent = new Intent(context, PeriodicSync.class);
intent.putExtra(ARG_ENABLED, true);
return intent;
}
/**
* This method is called when the BroadcastReceiver is receiving an Intent
* broadcast. During this time you can use the other methods on
* BroadcastReceiver to view/modify the current result values. This method
* is always called within the main thread of its process, unless you
* explicitly asked for it to be scheduled on a different thread using
* {@link Context#registerReceiver(BroadcastReceiver,
* IntentFilter, String, Handler)}. When it runs on the main
* thread you should
* never perform long-running operations in it (there is a timeout of
* 10 seconds that the system allows before considering the receiver to
* be blocked and a candidate to be killed). You cannot launch a popup dialog
* in your implementation of onReceive().
* <p/>
* <p><b>If this BroadcastReceiver was launched through a <receiver> tag,
* then the object is no longer alive after returning from this
* function.</b> This means you should not perform any operations that
* return a result to you asynchronously -- in particular, for interacting
* with services, you should use
* {@link Context#startService(Intent)} instead of
* {@link Context#bindService(Intent, ServiceConnection, int)}. If you wish
* to interact with a service that is already running, you can use
* {@link #peekService}.
* <p/>
* <p>The Intent filters used in {@link Context#registerReceiver}
* and in application manifests are <em>not</em> guaranteed to be exclusive. They
* are hints to the operating system about how to find suitable recipients. It is
* possible for senders to force delivery to specific recipients, bypassing filter
* resolution. For this reason, {@link #onReceive(Context, Intent) onReceive()}
* implementations should respond only to known actions, ignoring any unexpected
* Intents that they may receive.
*
* @param context The Context in which the receiver is running.
* @param intent The Intent being received.
*/
@Override
public void onReceive(Context context, Intent intent)
{
// @TODO if(FetLife.isSyncEnabled())
if(hasFlag(intent, ARG_ENABLED)) {
// Sent by applications settings to change enabled state
setAlarmEnabled(context, intent.getBooleanExtra(ARG_ENABLED, false));
}else if(hasFlag(intent, ARG_PERIODIC)){
sync(context);
}else{
// Sent by boot completion
setAlarmEnabled(context, true);
}
}
private boolean hasFlag(Intent intent, String flag)
{
if(intent == null) return false;
return (intent.hasExtra(flag) && intent.getBooleanExtra(flag, false));
}
private void sync(final Context context)
{
// @TODO FetLifeAccountManager.validate() on 302
FetLife.getServer().counts()
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Subscriber<Counts>() {
@Override
public void onCompleted() {
setAlarmEnabled(context, true);
}
@Override
public void onError(Throwable e) {
// @TODO better error handling... maybe via notification?
Log.d(TAG, "Unable to sync counts with server. Disabling alarm.: %s", e.getMessage() );
setAlarmEnabled(context, false);
}
@Override
public void onNext(Counts counts) {
lastEvent = new CountsReceivedEvent(counts);
FetLife.getBus().post(lastEvent);
}
});
}
public void setAlarmEnabled(Context context, boolean enable) {
final AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
if(!enable)
{
if(pendingIntent != null)
am.cancel(pendingIntent);
return;
}
final Calendar cal = Calendar.getInstance();
// @TODO make this a setting
cal.add(Calendar.MINUTE, 1);
Intent intent = new Intent(context, getClass());
intent.putExtra(ARG_PERIODIC, true);
// @TODO any other setup?
if(REQUEST_CODE == -1) REQUEST_CODE = hashCode();
pendingIntent = PendingIntent.getBroadcast(context, REQUEST_CODE, intent, PendingIntent.FLAG_UPDATE_CURRENT);
// @TODO move intervalInMS to settings
am.setInexactRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), syncIntervalInMS, pendingIntent);
}
}
| {
"content_hash": "b04a784a180a5279a0427270b3265b38",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 117,
"avg_line_length": 41.204081632653065,
"alnum_prop": 0.6638599966980353,
"repo_name": "xcjs/fetlife-oss",
"id": "98df27a8dd1bc7f646c783d2c5715238828b9912",
"size": "7310",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/net/goldenspiral/fetlifeoss/sync/PeriodicSync.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "232246"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>e-okul.org Satılıktır | domain, alanadı, alan, adı</title><meta name="description" content="e-okul.org alan adı satlıktır. Alanadını satın almak istiyorsanız sitemizi ziyaret edebilirsiniz. Teklif formunu doldurarak, teklif gönderebilirsiniz." /> <meta name="keywords" content="e-okul ,e-okul.org ,alanadı, domain, satlıktır, alan,adı, alanadi,pazar,uzantı,blog,bilgisi,diğer">
<meta name="owner" content="Rehber Bilişim" />
<meta name="copyright" content="(c) 2016" />
<meta name="robots" content="index,follow">
<meta name="content-language" content="tr">
<link rel="canonical" href="https://www.e-okul.org/" />
<link rel="icon" href="https://www.alanadipazar.com/upload/themes/tema1/assets/img/favicon.ico">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="https://www.alanadipazar.com/upload/themes/tema1/assets/css/style.css" >
<link rel="stylesheet" type="text/css" href='https://fonts.googleapis.com/css?family=Source+Sans+Pro' /><!-- Google Font -->
<link rel="stylesheet" type="text/css" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<!--[if lt IE 9]>
<script type="text/javascript" src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script type="text/javascript" src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-12" itemscope itemtype ="https://schema.org/Product">
<h1 class="alanAdi" itemprop="name"><a href="/">e-okul.org</a><span id="sale-tag"></span></h1>
</div>
</div>
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-7">
<div class="panel panel-default">
<div class="panel-heading"><h2>e-okul.org hakkında</h2></div>
<div class="panel-body">
<h3>e-okul.org satılıktır!</h3>
<p>Alan adı, yani, diğer bir adı ile domain, bir projenin veya bir firmanın kendini internette temsil etmesi için gerekli en önemli unsurlardan birisidir.<br />
Siz de internet sitenizin sizi en iyi şekilde temsil etmesini istiyorsanız; alan adı seçerken fiyatından çok, size kazandıracağı prestiji düşünmelisiniz.<br />
Eğer e-okul.org sizin için uygun bir alan adı ise hemen bizimle iletişime geçebilirsiniz.</p>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<div class="iletisim">
<div class="col-sm-4 adi text-right">
<i class="fa fa-user"></i> Mehmet ÖZDEMİR </div>
<div class="col-sm-3 telefon text-center" rel="nofollow">
<i class="fa fa-phone"></i> +90 505 229 9 522 </div>
<div class="col-sm-5 mail text-left" rel="nofollow">
<i class="fa fa-envelope"></i> satis<!-- >@. -->@<!-- >@. -->alanadipazar<!-- >@. -->.<!-- >@. -->com </div>
</div>
<div class="row">
<div class="col-md-6 col-sm-6 nasil"><a class="btn btn-primary btn-block" href="javascript:void(0);" data-toggle="modal" data-target="#aciklamaModal"><i class="fa fa-question-circle"></i> Nasıl Alacağım?</a></div>
<form type="GET" action="">
<div class="col-md-6 col-sm-6 satinal"><a class="btn btn-success btn-block btn-alt" rel="nofollow" href="https://www.alanadipazar.com/e-okul.org#teklif" target="_blank"><i class="fa fa-shopping-cart"></i> Satın Al / Teklif Ver</a></div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="panel panel-default">
<!-- Default panel contents -->
<div class="panel-heading"><h2>Domain Bilgisi</h2></div>
<ul class="list-group">
<li class="list-group-item">Kayıt Tarihi: 13 Ekim 2015</li>
<li class="list-group-item">Firma: İHS</li>
<li class="list-group-item">Alexa: <span id="alexa"><i class="fa fa-spinner fa-spin"></i></span></li>
<li class="list-group-item">Ücret: Teklif Veriniz</li>
<li class="list-group-item">Hit: 8380 ziyaret</li>
</ul>
</div>
<div class="panel panel-default">
<div class="panel-heading"><h2>Uzantı Bilgisi</h2></div>
<ul class="list-group">
<li class="list-group-item">e-okul.com <span class="badge small" id="txcomuz"><i class="fa fa-spinner fa-spin"></i></span></li>
<li class="list-group-item">e-okul.net <span class="badge small" id="txnetuz"><i class="fa fa-spinner fa-spin"></i></span></li>
<li class="list-group-item">e-okul.org <span class="badge small" id="txorguz"><i class="fa fa-spinner fa-spin"></i></span></li>
<li class="list-group-item">e-okul.info <span class="badge small" id="txinfouz"><i class="fa fa-spinner fa-spin"></i></span></li>
</ul>
</div>
</div>
<div class="col-md-1"></div>
</div>
</div> <!-- /container -->
<footer class="footer">
<div class="container">
<div class="col-md-8 col-xs-5 footerYazi">
</div>
<div class="col-md-4 col-xs-7">
<ul class="social list-inline">
<li><a href="https://www.facebook.com/alanadipazar" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Facebook sayfamız"><i class="fa fa-facebook"></i></a></li>
<li><a href="https://www.twitter.com/alanadipazar" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Twitter sayfamız"><i class="fa fa-twitter"></i></a></li>
<li class="last-item"><a href="http://www.google.com/+alanadipazar" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Google+ sayfamız"><i class="fa fa-google-plus"></i></a></li>
</ul>
</div>
</div>
</footer>
<div class="modal fade" id="aciklamaModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Domaini satın alma nasıl?</h4>
</div>
<div class="modal-body">
<p><strong>Seçenek 1: </strong><br> <a rel="nofollow" href="https://www.alanadipazar.com/e-okul.org#teklif">Buradaki</a> teklif formunu doldurarak domaini satın almak için teklifinizi bize iletebilirsiniz.</p>
<p><strong>Seçenek 2: </strong><br> +90 505 229 9 522 telefon numarasını arayarak bize telefonla ulaşabilirsiniz.</p>
<p><strong>Seçenek 3: </strong><br> satis<!-- >@. -->@<!-- >@. -->alanadipazar<!-- >@. -->.<!-- >@. -->com mail adresine teklifinizi mail atarak teklifinizi iletebilirsiniz.</p>
<h3>Anlaşma durumunda transfer nasıl yapılıyor?</h3>
<div class="alert alert-info">Tüm transfer işlemleri domain ücretini hesabımıza yatırdıktan sonra gerçekleşmektedir.</div>
<p><strong>Seçenek 1: </strong><br> Domainin kayıtlı olduğu firmaya ait size ait kullanıcı bilgilerinizi bize yollayarak transfer işlemini birkaç dakikada gerçekleştiriyoruz</p>
<p><strong>Seçenek 2: </strong><br> Domaini farklı bir firmada ki hesabınıza aktarmak için size domain transfer kodunu yolluyoruz ve dilediğiniz firmaya aktarabiliyorsunuz.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Kapat</button>
</div>
</div>
</div>
</div>
<noscript>Your browser does not support JavaScript!</noscript>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script type="text/javascript" src="https://www.alanadipazar.com/upload/themes/tema1/assets/js/jquery.min.js"><\/script>')</script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://www.alanadipazar.com/upload/themes/tema1/assets/js/jquery.backstretch.min.js"></script>
<script>
$(document).ready(function ()
{
alexaCek();
whoisCek();
$.backstretch([
"https://www.alanadipazar.com/upload/slideshow/coffeejpg7my2f.jpg","https://www.alanadipazar.com/upload/slideshow/domejpgk9otz.jpg","https://www.alanadipazar.com/upload/slideshow/bg-city-lightsjpgze24l.jpg","https://www.alanadipazar.com/upload/slideshow/pot-holderjpgk2omw.jpg","https://www.alanadipazar.com/upload/slideshow/bg-mountainsjpg0dlxo.jpg", ], {
fade: 750,
duration: 10000
});
});
function alexaCek()
{
$.ajax({
url: "https://www.alanadipazar.com"+"/alexa/e-okul.org",
type: "GET",
contentType: "application/json",
dataType: 'jsonp',
jsonp: "callback",
success: function (result) {
var obj = $.parseJSON( result );
$("#alexa").html(obj.sonuc);
},
error: function (error) {
$("#alexa").html("N/A");
}
});
}
function whoisCek()
{
$.ajax({
type: "GET",
url: "https://www.alanadipazar.com/whois/e-okul.org",
jsonp: "callback",
dataType: 'jsonp',
}).success(function(data) {
var obj = $.parseJSON( data );
var a = obj.durum;
if(a=="hata") { $("#txcomuz").text("??"); $("#txnetuz").text("??"); $("#txorguz").text("??"); $("#txinfouz").text("??");}
else { $("#txcomuz").text(obj.com); $("#txnetuz").text(obj.net); $("#txorguz").text(obj.org); $("#txinfouz").text(obj.info);}
});
}
</script>
</body>
</html>
| {
"content_hash": "b74ed282ad86af0e7007fa703403ca2a",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 392,
"avg_line_length": 58.923469387755105,
"alnum_prop": 0.582647848298554,
"repo_name": "todor-dk/HTML-Renderer",
"id": "aef40c4987cb8548e87ea062e1d54eb42835e8ba",
"size": "11641",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/Testing/HtmlRenderer.ExperimentalApp/Data/Files/e okul/817A2613B3E9BC007A8339963A8B103B.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "690"
},
{
"name": "Batchfile",
"bytes": "7229"
},
{
"name": "C#",
"bytes": "2654781"
},
{
"name": "HTML",
"bytes": "2938670481"
},
{
"name": "JavaScript",
"bytes": "51318"
},
{
"name": "PowerShell",
"bytes": "2715"
}
],
"symlink_target": ""
} |
package edu.ucsb.cs56.w15.drawings.jstaahl.advanced;
import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.JPanel;
import javax.swing.JComponent;
// the four tools things we'll use to draw
import java.awt.geom.Line2D; // single lines
import java.awt.geom.Ellipse2D; // ellipses and circles
import java.awt.geom.Rectangle2D; // for the bounding box
import java.awt.Rectangle; // squares and rectangles
import java.awt.geom.GeneralPath; // combinations of lines and curves
import java.awt.geom.AffineTransform; // translation, rotation, scale
import java.awt.Shape; // general class for shapes
import java.awt.Color; // class for Colors
/**
Some static methods for transforming objects that implement
the java.awt.Shape interface
@author Phill Conrad
@version for UCSB CS56, S12
@see java.awt.Shape
*/
public class ShapeTransforms
{
/** A static method to flip a shape horizontally
*
* @param s A shape (could be a Rectangle, GeneralPath, etc.--anything
* that implements the Shape interface )
* @return A copy of the Shape, flipped vertically
*/
public static Shape horizontallyFlippedCopyOf(Shape s)
{ return scaledCopyOf(s, -1, 1);}
/** A static method to flip a shape horizontally
*
* @param s A shape (could be a Rectangle, GeneralPath, etc.--anything
* that implements the Shape interface )
* @return A copy of the Shape, flipped vertically
*/
public static Shape verticallyFlippedCopyOf(Shape s)
{ return scaledCopyOf(s, 1, -1); }
/** A static method to translate a shape
*
* @param s A shape (could be a Rectangle, GeneralPath, etc.--anything
* that implements the Shape interface )
* @param tx how far to translate in x direction
* @param ty how far to translate in y direction
* @return A copy of the Shape, translated
*/
public static Shape translatedCopyOf(Shape s, double tx, double ty)
{
AffineTransform af = new AffineTransform();
af.translate(tx, ty);
return af.createTransformedShape(s);
}
/** A static method to scale a shape with respect to the upper left hand corner of its bounding box.
*
* @param s A shape (could be a Rectangle, GeneralPath, etc.--anything
* that implements the Shape interface )
* @return A copy of the Shape, scaled with respect to its upper left corner */
public static Shape scaledCopyOf(Shape s, double sx, double sy)
{
AffineTransform af = new AffineTransform();
Rectangle2D box = s.getBounds2D();
double x = box.getX();
double y = box.getY();
// Note: the transformations get applied IN REVERSE ORDER!
af.translate(x,y);
af.scale(sx, sy);
af.translate(-x, -y);
return af.createTransformedShape(s);
}
/** A static method to scale a shape with respect to the lower left hand corner of its bounding box.
*
* @param s A shape (could be a Rectangle, GeneralPath, etc.--anything
* that implements the Shape interface )
* @return A copy of the Shape, scaled with respect to its upper left corner */
public static Shape scaledCopyOfLL(Shape s, double sx, double sy)
{
AffineTransform af = new AffineTransform();
Rectangle2D box = s.getBounds2D();
double x = box.getX();
double y = box.getY() + box.getHeight();
// Note: the transformations get applied IN REVERSE ORDER!
af.translate(x,y);
af.scale(sx, sy);
af.translate(-x, -y);
return af.createTransformedShape(s);
}
/** A static method to rotate a shape around its center
*
* @param s A shape (could be a Rectangle, GeneralPath, etc.--anything
* that implements the Shape interface )
* @return A copy of the Shape, rotated around its center */
public static Shape rotatedCopyOf(Shape s, double angleInRadians)
{
AffineTransform af = new AffineTransform();
Rectangle2D box = s.getBounds2D();
double cx = box.getCenterX();
double cy = box.getCenterY();
// NOTE: The transformations get applied IN REVERSE ORDER
af.translate(cx,cy);
af.rotate(angleInRadians);
af.translate(-cx, -cy);
return af.createTransformedShape(s);
}
}
| {
"content_hash": "af75df5c52c7be998f3e2807462b48f9",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 104,
"avg_line_length": 32.26315789473684,
"alnum_prop": 0.6716383127476113,
"repo_name": "UCSB-CS56-W15/W15-lab04",
"id": "aebe81b22d2287b819123df31d8d88c4c1ed3b50",
"size": "4291",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/edu/ucsb/cs56/w15/drawings/jstaahl/advanced/ShapeTransforms.java",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "2143555"
}
],
"symlink_target": ""
} |
package sample.actuator;
import java.util.Map;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.autoconfigure.LocalManagementPort;
import org.springframework.boot.autoconfigure.security.SecurityProperties;
import org.springframework.boot.context.web.LocalServerPort;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringRunner;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Integration tests for separate management and main service ports.
*
* @author Dave Syer
*/
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = {
"management.port=0", "management.context-path=/admin" })
@DirtiesContext
public class ManagementPortAndPathSampleActuatorApplicationTests {
@Autowired
private SecurityProperties security;
@LocalServerPort
private int port = 9010;
@LocalManagementPort
private int managementPort = 9011;
@Test
public void testHome() throws Exception {
@SuppressWarnings("rawtypes")
ResponseEntity<Map> entity = new TestRestTemplate("user", getPassword())
.getForEntity("http://localhost:" + this.port, Map.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
@SuppressWarnings("unchecked")
Map<String, Object> body = entity.getBody();
assertThat(body.get("message")).isEqualTo("Hello Phil");
}
@Test
public void testMetrics() throws Exception {
testHome(); // makes sure some requests have been made
@SuppressWarnings("rawtypes")
ResponseEntity<Map> entity = new TestRestTemplate().getForEntity(
"http://localhost:" + this.managementPort + "/admin/metrics", Map.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED);
}
@Test
public void testHealth() throws Exception {
ResponseEntity<String> entity = new TestRestTemplate().getForEntity(
"http://localhost:" + this.managementPort + "/admin/health",
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
assertThat(entity.getBody()).contains("\"status\":\"UP\"");
}
@Test
public void testMissing() throws Exception {
ResponseEntity<String> entity = new TestRestTemplate("user", getPassword())
.getForEntity(
"http://localhost:" + this.managementPort + "/admin/missing",
String.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
assertThat(entity.getBody()).contains("\"status\":404");
}
@Test
public void testErrorPage() throws Exception {
@SuppressWarnings("rawtypes")
ResponseEntity<Map> entity = new TestRestTemplate()
.getForEntity("http://localhost:" + this.port + "/error", Map.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR);
@SuppressWarnings("unchecked")
Map<String, Object> body = entity.getBody();
assertThat(body.get("status")).isEqualTo(999);
}
@Test
public void testManagementErrorPage() throws Exception {
@SuppressWarnings("rawtypes")
ResponseEntity<Map> entity = new TestRestTemplate().getForEntity(
"http://localhost:" + this.managementPort + "/error", Map.class);
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
@SuppressWarnings("unchecked")
Map<String, Object> body = entity.getBody();
assertThat(body.get("status")).isEqualTo(999);
}
private String getPassword() {
return this.security.getUser().getPassword();
}
}
| {
"content_hash": "5d09c086b4f3666e9beda77768387d4a",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 81,
"avg_line_length": 34.92660550458716,
"alnum_prop": 0.7612293144208038,
"repo_name": "izeye/spring-boot",
"id": "cf7df0c151316fde3ec285a97f8e4fc9d50898f7",
"size": "4427",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementPortAndPathSampleActuatorApplicationTests.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "6954"
},
{
"name": "CSS",
"bytes": "5769"
},
{
"name": "FreeMarker",
"bytes": "2116"
},
{
"name": "Groovy",
"bytes": "44968"
},
{
"name": "HTML",
"bytes": "69819"
},
{
"name": "Java",
"bytes": "9172430"
},
{
"name": "JavaScript",
"bytes": "37789"
},
{
"name": "Ruby",
"bytes": "1305"
},
{
"name": "SQLPL",
"bytes": "40170"
},
{
"name": "Shell",
"bytes": "20385"
},
{
"name": "Smarty",
"bytes": "3276"
},
{
"name": "XSLT",
"bytes": "33894"
}
],
"symlink_target": ""
} |
package apiserver
import (
"fmt"
"strings"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/apimachinery/pkg/version"
"k8s.io/apiserver/pkg/registry/rest"
genericapiserver "k8s.io/apiserver/pkg/server"
restclient "k8s.io/client-go/rest"
"github.com/cert-manager/cert-manager/pkg/acme/webhook"
whapi "github.com/cert-manager/cert-manager/pkg/acme/webhook/apis/acme/v1alpha1"
"github.com/cert-manager/cert-manager/pkg/acme/webhook/registry/challengepayload"
)
var (
Scheme = runtime.NewScheme()
Codecs = serializer.NewCodecFactory(Scheme)
)
func init() {
whapi.AddToScheme(Scheme)
// we need to add the options to empty v1
// TODO fix the server code to avoid this
metav1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
// TODO: keep the generic API server from wanting this
unversioned := schema.GroupVersion{Group: "", Version: "v1"}
Scheme.AddUnversionedTypes(unversioned,
&metav1.Status{},
&metav1.APIVersions{},
&metav1.APIGroupList{},
&metav1.APIGroup{},
&metav1.APIResourceList{},
&metav1.ListOptions{},
&metav1.GetOptions{},
&metav1.PatchOptions{},
&metav1.DeleteOptions{},
&metav1.CreateOptions{},
&metav1.UpdateOptions{},
)
}
type Config struct {
GenericConfig *genericapiserver.RecommendedConfig
ExtraConfig ExtraConfig
restConfig *restclient.Config
}
type ExtraConfig struct {
// SolverGroup is the API name for solvers configured in this apiserver.
// This should typically be something like 'acmesolvers.example.org'
SolverGroup string
// Solvers is a list of challenge solvers registered for this apiserver.
Solvers []webhook.Solver
}
// ChallengeServer contains state for a webhook cluster apiserver.
type ChallengeServer struct {
GenericAPIServer *genericapiserver.GenericAPIServer
}
type completedConfig struct {
GenericConfig genericapiserver.CompletedConfig
ExtraConfig *ExtraConfig
restConfig *restclient.Config
}
type CompletedConfig struct {
// Embed a private pointer that cannot be instantiated outside of this package.
*completedConfig
}
// Complete fills in any fields not set that are required to have valid data. It's mutating the receiver.
func (c *Config) Complete() CompletedConfig {
completedCfg := completedConfig{
c.GenericConfig.Complete(),
&c.ExtraConfig,
c.restConfig,
}
completedCfg.GenericConfig.Version = &version.Info{
Major: "1",
Minor: "1",
}
return CompletedConfig{&completedCfg}
}
// New returns a new instance of AdmissionServer from the given config.
func (c completedConfig) New() (*ChallengeServer, error) {
genericServer, err := c.GenericConfig.New("challenge-server", genericapiserver.NewEmptyDelegate()) // completion is done in Complete, no need for a second time
if err != nil {
return nil, err
}
s := &ChallengeServer{
GenericAPIServer: genericServer,
}
if c.restConfig == nil {
c.restConfig, err = restclient.InClusterConfig()
if err != nil {
return nil, err
}
}
// TODO we're going to need a later k8s.io/apiserver so that we can get discovery to list a different group version for
// our endpoint which we'll use to back some custom storage which will consume the AdmissionReview type and give back the correct response
apiGroupInfo := genericapiserver.APIGroupInfo{
VersionedResourcesStorageMap: map[string]map[string]rest.Storage{},
// TODO unhardcode this. It was hardcoded before, but we need to re-evaluate
OptionsExternalVersion: &schema.GroupVersion{Version: "v1alpha1"},
Scheme: Scheme,
ParameterCodec: metav1.ParameterCodec,
NegotiatedSerializer: Codecs,
}
for _, solver := range solversByName(c.ExtraConfig.Solvers...) {
challengeHandler := challengepayload.NewREST(solver)
v1alpha1storage, ok := apiGroupInfo.VersionedResourcesStorageMap["v1alpha1"]
if !ok {
v1alpha1storage = map[string]rest.Storage{}
}
gvr := metav1.GroupVersionResource{
Group: c.ExtraConfig.SolverGroup,
Version: "v1alpha1",
Resource: solver.Name(),
}
apiGroupInfo.PrioritizedVersions = appendUniqueGroupVersion(apiGroupInfo.PrioritizedVersions, schema.GroupVersion{
Group: gvr.Group,
Version: gvr.Version,
})
v1alpha1storage[gvr.Resource] = challengeHandler
apiGroupInfo.VersionedResourcesStorageMap[gvr.Version] = v1alpha1storage
}
if err := s.GenericAPIServer.InstallAPIGroup(&apiGroupInfo); err != nil {
return nil, err
}
for i := range c.ExtraConfig.Solvers {
solver := c.ExtraConfig.Solvers[i]
postStartName := postStartHookName(solver)
if len(postStartName) == 0 {
continue
}
s.GenericAPIServer.AddPostStartHookOrDie(postStartName,
func(context genericapiserver.PostStartHookContext) error {
return solver.Initialize(c.restConfig, context.StopCh)
},
)
}
return s, nil
}
func postStartHookName(hook webhook.Solver) string {
var ns []string
ns = append(ns, fmt.Sprintf("solver-%s", hook.Name()))
if len(ns) == 0 {
return ""
}
return strings.Join(append(ns, "init"), "-")
}
func appendUniqueGroupVersion(slice []schema.GroupVersion, elems ...schema.GroupVersion) []schema.GroupVersion {
m := map[schema.GroupVersion]bool{}
for _, gv := range slice {
m[gv] = true
}
for _, e := range elems {
m[e] = true
}
out := make([]schema.GroupVersion, 0, len(m))
for gv := range m {
out = append(out, gv)
}
return out
}
func solversByName(solvers ...webhook.Solver) map[string]webhook.Solver {
ret := map[string]webhook.Solver{}
for _, s := range solvers {
ret[s.Name()] = s
}
return ret
}
| {
"content_hash": "821ba1dd8af4ff2efcf6afc9e43d525c",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 160,
"avg_line_length": 27.788177339901477,
"alnum_prop": 0.7356851622052828,
"repo_name": "cert-manager/cert-manager",
"id": "acfc12b21ea5b3f0a2ec77525e2ee1fb2e1b2a21",
"size": "6212",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "pkg/acme/webhook/apiserver/apiserver.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "1527"
},
{
"name": "Go",
"bytes": "4795605"
},
{
"name": "Makefile",
"bytes": "114314"
},
{
"name": "Mustache",
"bytes": "7541"
},
{
"name": "Python",
"bytes": "7134"
},
{
"name": "Shell",
"bytes": "83388"
}
],
"symlink_target": ""
} |
package com.linkedin.thirdeye.datalayer.pojo;
import com.linkedin.thirdeye.api.DimensionMap;
import java.util.ArrayList;
import java.util.List;
public class GroupedAnomalyResultsBean extends AbstractBean {
private long alertConfigId;
private DimensionMap dimensions = new DimensionMap();
private List<Long> anomalyResultsId = new ArrayList<>();
// the max endTime among all its merged anomaly results
private long endTime;
private boolean isNotified = false;
public long getAlertConfigId() {
return alertConfigId;
}
public void setAlertConfigId(long alertConfigId) {
this.alertConfigId = alertConfigId;
}
public DimensionMap getDimensions() {
return dimensions;
}
public void setDimensions(DimensionMap dimensions) {
this.dimensions = dimensions;
}
public List<Long> getAnomalyResultsId() {
return anomalyResultsId;
}
public void setAnomalyResultsId(List<Long> anomalyResultsId) {
this.anomalyResultsId = anomalyResultsId;
}
public long getEndTime() {
return endTime;
}
public void setEndTime(long endTime) {
this.endTime = endTime;
}
public boolean isNotified() {
return isNotified;
}
public void setNotified(boolean notified) {
isNotified = notified;
}
}
| {
"content_hash": "a8757b1267c512e1fbbc155383eb329b",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 64,
"avg_line_length": 22.553571428571427,
"alnum_prop": 0.7363420427553444,
"repo_name": "apucher/pinot",
"id": "920df1595549c8cc4b515abe6cbbc85f5766fbfc",
"size": "1900",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "thirdeye/thirdeye-pinot/src/main/java/com/linkedin/thirdeye/datalayer/pojo/GroupedAnomalyResultsBean.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "4620"
},
{
"name": "Batchfile",
"bytes": "7738"
},
{
"name": "CSS",
"bytes": "925082"
},
{
"name": "FreeMarker",
"bytes": "243834"
},
{
"name": "HTML",
"bytes": "274305"
},
{
"name": "Java",
"bytes": "14420303"
},
{
"name": "JavaScript",
"bytes": "5189610"
},
{
"name": "Makefile",
"bytes": "8076"
},
{
"name": "Python",
"bytes": "36574"
},
{
"name": "Shell",
"bytes": "51677"
},
{
"name": "Thrift",
"bytes": "5028"
}
],
"symlink_target": ""
} |
'use strict';
var pkg = require('./package.json');
var repeating = require('./');
var argv = process.argv.slice(2);
function help() {
console.log([
'',
' ' + pkg.description,
'',
' Usage',
' $ repeating <string> <count>',
'',
' Example',
' $ repeating \'unicorn \' 2',
' unicorn unicorn'
].join('\n'));
}
if (process.argv.indexOf('--help') !== -1) {
help();
return;
}
if (process.argv.indexOf('--version') !== -1) {
console.log(pkg.version);
return;
}
if (!argv[1]) {
console.error('You have to define how many times to repeat the string.');
process.exit(1);
}
console.log(repeating(argv[0], Number(argv[1])));
| {
"content_hash": "a3caffbf39ae10e845cd05a3b66cbc28",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 77,
"avg_line_length": 20.914285714285715,
"alnum_prop": 0.51775956284153,
"repo_name": "startinggravity/lean-drupal",
"id": "ac56510f4c36a254e7ddf95e21f81ab57ef19366",
"size": "752",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "node_modules/gulp-gh-pages/node_modules/gulp-util/node_modules/dateformat/node_modules/meow/node_modules/indent-string/node_modules/repeating/cli.js",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "150346"
},
{
"name": "HTML",
"bytes": "78596"
},
{
"name": "JavaScript",
"bytes": "601112"
}
],
"symlink_target": ""
} |
#pragma once
#include <aws/wafv2/WAFV2_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/wafv2/model/ManagedRuleGroupVersion.h>
#include <utility>
namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;
namespace Utils
{
namespace Json
{
class JsonValue;
} // namespace Json
} // namespace Utils
namespace WAFV2
{
namespace Model
{
class AWS_WAFV2_API ListAvailableManagedRuleGroupVersionsResult
{
public:
ListAvailableManagedRuleGroupVersionsResult();
ListAvailableManagedRuleGroupVersionsResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
ListAvailableManagedRuleGroupVersionsResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
/**
* <p>When you request a list of objects with a <code>Limit</code> setting, if the
* number of objects that are still available for retrieval exceeds the limit, WAF
* returns a <code>NextMarker</code> value in the response. To retrieve the next
* batch of objects, provide the marker from the prior call in your next
* request.</p>
*/
inline const Aws::String& GetNextMarker() const{ return m_nextMarker; }
/**
* <p>When you request a list of objects with a <code>Limit</code> setting, if the
* number of objects that are still available for retrieval exceeds the limit, WAF
* returns a <code>NextMarker</code> value in the response. To retrieve the next
* batch of objects, provide the marker from the prior call in your next
* request.</p>
*/
inline void SetNextMarker(const Aws::String& value) { m_nextMarker = value; }
/**
* <p>When you request a list of objects with a <code>Limit</code> setting, if the
* number of objects that are still available for retrieval exceeds the limit, WAF
* returns a <code>NextMarker</code> value in the response. To retrieve the next
* batch of objects, provide the marker from the prior call in your next
* request.</p>
*/
inline void SetNextMarker(Aws::String&& value) { m_nextMarker = std::move(value); }
/**
* <p>When you request a list of objects with a <code>Limit</code> setting, if the
* number of objects that are still available for retrieval exceeds the limit, WAF
* returns a <code>NextMarker</code> value in the response. To retrieve the next
* batch of objects, provide the marker from the prior call in your next
* request.</p>
*/
inline void SetNextMarker(const char* value) { m_nextMarker.assign(value); }
/**
* <p>When you request a list of objects with a <code>Limit</code> setting, if the
* number of objects that are still available for retrieval exceeds the limit, WAF
* returns a <code>NextMarker</code> value in the response. To retrieve the next
* batch of objects, provide the marker from the prior call in your next
* request.</p>
*/
inline ListAvailableManagedRuleGroupVersionsResult& WithNextMarker(const Aws::String& value) { SetNextMarker(value); return *this;}
/**
* <p>When you request a list of objects with a <code>Limit</code> setting, if the
* number of objects that are still available for retrieval exceeds the limit, WAF
* returns a <code>NextMarker</code> value in the response. To retrieve the next
* batch of objects, provide the marker from the prior call in your next
* request.</p>
*/
inline ListAvailableManagedRuleGroupVersionsResult& WithNextMarker(Aws::String&& value) { SetNextMarker(std::move(value)); return *this;}
/**
* <p>When you request a list of objects with a <code>Limit</code> setting, if the
* number of objects that are still available for retrieval exceeds the limit, WAF
* returns a <code>NextMarker</code> value in the response. To retrieve the next
* batch of objects, provide the marker from the prior call in your next
* request.</p>
*/
inline ListAvailableManagedRuleGroupVersionsResult& WithNextMarker(const char* value) { SetNextMarker(value); return *this;}
/**
* <p>The versions that are currently available for the specified managed rule
* group. </p>
*/
inline const Aws::Vector<ManagedRuleGroupVersion>& GetVersions() const{ return m_versions; }
/**
* <p>The versions that are currently available for the specified managed rule
* group. </p>
*/
inline void SetVersions(const Aws::Vector<ManagedRuleGroupVersion>& value) { m_versions = value; }
/**
* <p>The versions that are currently available for the specified managed rule
* group. </p>
*/
inline void SetVersions(Aws::Vector<ManagedRuleGroupVersion>&& value) { m_versions = std::move(value); }
/**
* <p>The versions that are currently available for the specified managed rule
* group. </p>
*/
inline ListAvailableManagedRuleGroupVersionsResult& WithVersions(const Aws::Vector<ManagedRuleGroupVersion>& value) { SetVersions(value); return *this;}
/**
* <p>The versions that are currently available for the specified managed rule
* group. </p>
*/
inline ListAvailableManagedRuleGroupVersionsResult& WithVersions(Aws::Vector<ManagedRuleGroupVersion>&& value) { SetVersions(std::move(value)); return *this;}
/**
* <p>The versions that are currently available for the specified managed rule
* group. </p>
*/
inline ListAvailableManagedRuleGroupVersionsResult& AddVersions(const ManagedRuleGroupVersion& value) { m_versions.push_back(value); return *this; }
/**
* <p>The versions that are currently available for the specified managed rule
* group. </p>
*/
inline ListAvailableManagedRuleGroupVersionsResult& AddVersions(ManagedRuleGroupVersion&& value) { m_versions.push_back(std::move(value)); return *this; }
/**
* <p>The name of the version that's currently set as the default. </p>
*/
inline const Aws::String& GetCurrentDefaultVersion() const{ return m_currentDefaultVersion; }
/**
* <p>The name of the version that's currently set as the default. </p>
*/
inline void SetCurrentDefaultVersion(const Aws::String& value) { m_currentDefaultVersion = value; }
/**
* <p>The name of the version that's currently set as the default. </p>
*/
inline void SetCurrentDefaultVersion(Aws::String&& value) { m_currentDefaultVersion = std::move(value); }
/**
* <p>The name of the version that's currently set as the default. </p>
*/
inline void SetCurrentDefaultVersion(const char* value) { m_currentDefaultVersion.assign(value); }
/**
* <p>The name of the version that's currently set as the default. </p>
*/
inline ListAvailableManagedRuleGroupVersionsResult& WithCurrentDefaultVersion(const Aws::String& value) { SetCurrentDefaultVersion(value); return *this;}
/**
* <p>The name of the version that's currently set as the default. </p>
*/
inline ListAvailableManagedRuleGroupVersionsResult& WithCurrentDefaultVersion(Aws::String&& value) { SetCurrentDefaultVersion(std::move(value)); return *this;}
/**
* <p>The name of the version that's currently set as the default. </p>
*/
inline ListAvailableManagedRuleGroupVersionsResult& WithCurrentDefaultVersion(const char* value) { SetCurrentDefaultVersion(value); return *this;}
private:
Aws::String m_nextMarker;
Aws::Vector<ManagedRuleGroupVersion> m_versions;
Aws::String m_currentDefaultVersion;
};
} // namespace Model
} // namespace WAFV2
} // namespace Aws
| {
"content_hash": "f66f49534292c660b60864072a7d22a4",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 163,
"avg_line_length": 41.09090909090909,
"alnum_prop": 0.7008068714211348,
"repo_name": "aws/aws-sdk-cpp",
"id": "98d5c8594b519909e30fcdb043bafe9dac3a0f8a",
"size": "7803",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "aws-cpp-sdk-wafv2/include/aws/wafv2/model/ListAvailableManagedRuleGroupVersionsResult.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "309797"
},
{
"name": "C++",
"bytes": "476866144"
},
{
"name": "CMake",
"bytes": "1245180"
},
{
"name": "Dockerfile",
"bytes": "11688"
},
{
"name": "HTML",
"bytes": "8056"
},
{
"name": "Java",
"bytes": "413602"
},
{
"name": "Python",
"bytes": "79245"
},
{
"name": "Shell",
"bytes": "9246"
}
],
"symlink_target": ""
} |
#if defined(USE_TI_UIIPADPOPOVER) || defined(USE_TI_UIIPADSPLITWINDOW)
#import "TiViewProxy.h"
#import "TiViewController.h"
//The iPadPopoverProxy should be seen more as like a window or such, because
//The popover controller will contain the viewController, which has the view.
//If the view had the logic, you get some nasty dependency loops.
@interface TiUIiPadPopoverProxy : TiViewProxy<UIPopoverControllerDelegate,TiUIViewController> {
@private
UIPopoverController *popoverController;
UINavigationController *navigationController;
TiViewController *viewController;
//We need to hold onto this information for whenever the status bar rotates.
TiViewProxy *popoverView;
CGRect popoverRect;
BOOL animated;
UIPopoverArrowDirection directions;
BOOL isShowing;
BOOL isDismissing;
NSCondition* closingCondition;
}
//Because the Popover isn't meant to be placed in anywhere specific,
@property(nonatomic,readonly) UIPopoverController *popoverController;
@property(nonatomic,readwrite,retain) TiViewController *viewController;
@property(nonatomic,readwrite,retain) TiViewProxy *popoverView;
-(UINavigationController *)navigationController;
-(void)updatePopover:(NSNotification *)notification;
-(void)updatePopoverNow;
@end
#endif | {
"content_hash": "56c368a1ce3005b6398018f6ee5fb495",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 95,
"avg_line_length": 29.25581395348837,
"alnum_prop": 0.8076311605723371,
"repo_name": "myleftboot/includeActivity",
"id": "8c0814787a2ec86762fa738e318575c96da554e9",
"size": "1583",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "build/iphone/Classes/TiUIiPadPopoverProxy.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "144407"
},
{
"name": "C++",
"bytes": "52728"
},
{
"name": "JavaScript",
"bytes": "1164"
},
{
"name": "Matlab",
"bytes": "2005"
},
{
"name": "Objective-C",
"bytes": "3303482"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "4bf91e276afb373b5fe95aa706ec2d6b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "196bddd8c53c06ce82409b8e2d6ddbd152ebcc00",
"size": "189",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Campanulaceae/Siphocampylus/Siphocampylus adhaerens/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="2.5" client="site" method="upgrade">
<name>Community - Quick Search Module</name>
<author>JomSocial Team</author>
<creationDate>April 2013</creationDate>
<copyright>Copyright (C) 2008 - 2013 JomSocial. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<authorEmail>support@jomsocial.com</authorEmail>
<authorUrl>http://www.jomsocial.com</authorUrl>
<version>3.0.5.2</version>
<description>Community Quick Search</description>
<files>
<filename module="mod_community_quicksearch">mod_community_quicksearch.php</filename>
<filename>mod_community_quicksearch.xml</filename>
<folder>tmpl</folder>
</files>
<config>
<fields name="params">
<fieldset name="basic">
<field name="moduleclass_sfx" type="text" default="cModule cFrontPage-Search app-box" label="Module Class Suffix" description="PARAMMODULECLASSSUFFIX" />
</fieldset>
</fields>
</config>
</extension>
| {
"content_hash": "ba4a014289bc320653ec4b836ff6ac51",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 157,
"avg_line_length": 40.07692307692308,
"alnum_prop": 0.7159309021113244,
"repo_name": "deywibkiss/jooinworld",
"id": "283520be91d36a34a8d2c8f9c623ce0b3f92c1c4",
"size": "1042",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/mod_community_quicksearch/mod_community_quicksearch.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1306396"
},
{
"name": "JavaScript",
"bytes": "2564138"
},
{
"name": "PHP",
"bytes": "10451869"
}
],
"symlink_target": ""
} |
package org.apache.kafka.streams.state;
import org.apache.kafka.common.utils.Bytes;
/**
* A store supplier that can be used to create one or more {@link KeyValueStore KeyValueStore<Bytes, byte[]>} instances of type <Byte, byte[]>.
*
* For any stores implementing the {@link KeyValueStore KeyValueStore<Bytes, byte[]>} interface, null value bytes are considered as "not exist". This means:
*
* 1. Null value bytes in put operations should be treated as delete.
* 2. If the key does not exist, get operations should return null value bytes.
*/
public interface KeyValueBytesStoreSupplier extends StoreSupplier<KeyValueStore<Bytes, byte[]>> {
} | {
"content_hash": "e76a5f599f0eb11ce85876b92ad7f4f1",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 156,
"avg_line_length": 41.125,
"alnum_prop": 0.7537993920972644,
"repo_name": "mihbor/kafka",
"id": "ee645b10ffa734dba806d1129688782e7da326f2",
"size": "1456",
"binary": false,
"copies": "3",
"ref": "refs/heads/trunk",
"path": "streams/src/main/java/org/apache/kafka/streams/state/KeyValueBytesStoreSupplier.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "26635"
},
{
"name": "Dockerfile",
"bytes": "5117"
},
{
"name": "HTML",
"bytes": "3739"
},
{
"name": "Java",
"bytes": "14509836"
},
{
"name": "Python",
"bytes": "751957"
},
{
"name": "Scala",
"bytes": "5624897"
},
{
"name": "Shell",
"bytes": "93010"
},
{
"name": "XSLT",
"bytes": "7116"
}
],
"symlink_target": ""
} |
layout: "docs"
page_title: "Common Ansible Options - Provisioning"
sidebar_current: "provisioning-ansible-common"
description: |-
This page details the common options to the Vagrant Ansible provisioners.
---
# Shared Ansible Options
The following options are available to both Vagrant Ansible provisioners:
- [`ansible`](/docs/provisioning/ansible.html)
- [`ansible_local`](/docs/provisioning/ansible_local.html)
These options get passed to the `ansible-playbook` command that ships with Ansible, either via command line arguments or environment variables, depending on Ansible own capabilities.
Some of these options are for advanced usage only and should not be used unless you understand their purpose.
- `become` (boolean) - Perform all the Ansible playbook tasks [as another user](http://docs.ansible.com/ansible/become.html), different from the user used to log into the guest system.
The default value is `false`.
- `become_user` (string) - Set the default username to be used by the Ansible `become` [privilege escalation](http://docs.ansible.com/ansible/become.html) mechanism.
By default this option is not set, and the Ansible default value (`root`) will be used.
- `compatibility_mode` (string) - Set the **minimal** version of Ansible to be supported. Vagrant will only use parameters that are compatible with the given version.
Possible values:
- `"auto"` _(Vagrant will automatically select the optimal compatibility mode by checking the Ansible version currently available)_
- `"1.8"` _(Ansible versions prior to 1.8 should mostly work well, but some options might not be supported)_
- `"2.0"` _(The generated Ansible inventory will be incompatible with Ansible 1.x)_
By default this option is set to `"auto"`. If Vagrant is not able to detect any supported Ansible version, it will fall back on the compatibility mode `"1.8"` with a warning.
Vagrant will error if the specified compatibility mode is incompatible with the current Ansible version.
<div class="alert alert-warning">
<strong>Attention:</strong>
Vagrant doesn't perform any validation between the `compatibility_mode` value and the value of the [`version`](#version) option.
</div>
<div class="alert alert-info">
<strong>Compatibility Note:</strong>
This option was introduced in Vagrant 2.0. The behavior of previous Vagrant versions can be simulated by setting the `compatibility_mode` to `"1.8"`.
</div>
- `config_file` (string) - The path to an [Ansible Configuration file](https://docs.ansible.com/intro_configuration.html).
By default, this option is not set, and Ansible will [search for a possible configuration file in some default locations](/docs/provisioning/ansible_intro.html#ANSIBLE_CONFIG).
- `extra_vars` (string or hash) - Pass additional variables (with highest priority) to the playbook.
This parameter can be a path to a JSON or YAML file, or a hash.
Example:
```ruby
ansible.extra_vars = {
ntp_server: "pool.ntp.org",
nginx: {
port: 8008,
workers: 4
}
}
```
These variables take the highest precedence over any other variables.
- `galaxy_command` (template string) - The command pattern used to install Galaxy roles when `galaxy_role_file` is set.
The following (optional) placeholders can be used in this command pattern:
- `%{role_file}` is replaced by the absolute path to the `galaxy_role_file` option
- `%{roles_path}` is
- replaced by the absolute path to the `galaxy_roles_path` option when such option is defined, or
- replaced by the absolute path to a `roles` subdirectory sitting in the `playbook` parent directory.
By default, this option is set to
`ansible-galaxy install --role-file=%{role_file} --roles-path=%{roles_path} --force`
- `galaxy_role_file` (string) - The path to the Ansible Galaxy role file.
By default, this option is set to `nil` and Galaxy support is then disabled.
Note: if an absolute path is given, the `ansible_local` provisioner will assume that it corresponds to the exact location on the guest system.
- `galaxy_roles_path` (string) - The path to the directory where Ansible Galaxy roles must be installed
By default, this option is set to `nil`, which means that the Galaxy roles will be installed in a `roles` subdirectory located in the parent directory of the `playbook` file.
- `groups` (hash) - Set of inventory groups to be included in the [auto-generated inventory file](/docs/provisioning/ansible_intro.html).
Example:
```ruby
ansible.groups = {
"web" => ["vm1", "vm2"],
"db" => ["vm3"]
}
```
Example with [group variables](https://docs.ansible.com/ansible/intro_inventory.html#group-variables):
```ruby
ansible.groups = {
"atlanta" => ["host1", "host2"],
"atlanta:vars" => {"ntp_server" => "ntp.atlanta.example.com",
"proxy" => "proxy.atlanta.example.com"}
}
```
Notes:
- Alphanumeric patterns are not supported (e.g. `db-[a:f]`, `vm[01:10]`).
- This option has no effect when the `inventory_path` option is defined.
- `host_vars` (hash) - Set of inventory host variables to be included in the [auto-generated inventory file](https://docs.ansible.com/ansible/intro_inventory.html#host-variables).
Example:
```ruby
ansible.host_vars = {
"host1" => {"http_port" => 80,
"maxRequestsPerChild" => 808},
"comments" => "text with spaces",
"host2" => {"http_port" => 303,
"maxRequestsPerChild" => 909}
}
```
Note: This option has no effect when the `inventory_path` option is defined.
- `inventory_path` (string) - The path to an Ansible inventory resource (e.g. a [static inventory file](https://docs.ansible.com/intro_inventory.html), a [dynamic inventory script](https://docs.ansible.com/intro_dynamic_inventory.html) or even [multiple inventories stored in the same directory](https://docs.ansible.com/intro_dynamic_inventory.html#using-multiple-inventory-sources)).
By default, this option is disabled and Vagrant generates an inventory based on the `Vagrantfile` information.
- `limit` (string or array of strings) - Set of machines or groups from the inventory file to further control which hosts [are affected](https://docs.ansible.com/glossary.html#limit-groups).
The default value is set to the machine name (taken from `Vagrantfile`) to ensure that `vagrant provision` command only affect the expected machine.
Setting `limit = "all"` can be used to make Ansible connect to all machines from the inventory file.
- `playbook_command` (string) - The command used to run playbooks.
The default value is `ansible-playbook`
- `raw_arguments` (array of strings) - a list of additional `ansible-playbook` arguments.
It is an *unsafe wildcard* that can be used to apply Ansible options that are not (yet) supported by this Vagrant provisioner. As of Vagrant 1.7, `raw_arguments` has the highest priority and its values can potentially override or break other Vagrant settings.
Examples:
- `['--check', '-M', '/my/modules']`
- `["--connection=paramiko", "--forks=10"]`
<div class="alert alert-warn">
<strong>Attention:</strong>
The `ansible` provisioner does not support whitespace characters in `raw_arguments` elements. Therefore **don't write** something like `["-c paramiko"]`, which will result with an invalid `" paramiko"` parameter value.
</div>
- `skip_tags` (string or array of strings) - Only plays, roles and tasks that [*do not match* these values will be executed](https://docs.ansible.com/playbooks_tags.html).
- `start_at_task` (string) - The task name where the [playbook execution will start](https://docs.ansible.com/playbooks_startnstep.html#start-at-task).
- `sudo` (boolean) - Backwards compatible alias for the [`become`](#become) option.
<div class="alert alert-warning">
<strong>Deprecation:</strong>
The `sudo` option is deprecated and will be removed in a future release. Please use the [**`become`**](#become) option instead.
</div>
- `sudo_user` (string) - Backwards compatible alias for the [`become_user`](#become_user) option.
<div class="alert alert-warning">
<strong>Deprecation:</strong>
The `sudo_user` option is deprecated and will be removed in a future release. Please use the [**`become_user`**](#become_user) option instead.
</div>
- `tags` (string or array of strings) - Only plays, roles and tasks [tagged with these values will be executed](https://docs.ansible.com/playbooks_tags.html) .
- `vault_password_file` (string) - The path of a file containing the password used by [Ansible Vault](https://docs.ansible.com/playbooks_vault.html#vault).
- `verbose` (boolean or string) - Set Ansible's verbosity to obtain detailed logging
Default value is `false` (minimal verbosity).
Examples: `true` (equivalent to `v`), `-vvv` (equivalent to `vvv`), `vvvv`.
Note that when the `verbose` option is enabled, the `ansible-playbook` command used by Vagrant will be displayed.
- `version` (string) - The expected Ansible version.
This option is disabled by default.
When an Ansible version is defined (e.g. `"2.1.6.0"`), the Ansible provisioner will be executed only if Ansible is installed at the requested version.
When this option is set to `"latest"`, no version check is applied.
<div class="alert alert-info">
<strong>Tip:</strong>
With the `ansible_local` provisioner, it is currently possible to use this option to specify which version of Ansible must be automatically installed, but <strong>only</strong> in combination with the [**`install_mode`**](/docs/provisioning/ansible_local.html#install_mode) set to <strong>`:pip`</strong>.
</div>
| {
"content_hash": "785becbadbb06a56c59ce8cbf4806cb3",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 385,
"avg_line_length": 49.3134328358209,
"alnum_prop": 0.7069209039548022,
"repo_name": "crashlytics/vagrant",
"id": "28848b40422db24800d48f3cf5b6ce6595ce1924",
"size": "9916",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "website/source/docs/provisioning/ansible_common.html.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "18665"
},
{
"name": "Emacs Lisp",
"bytes": "420"
},
{
"name": "HTML",
"bytes": "120661"
},
{
"name": "JavaScript",
"bytes": "1797"
},
{
"name": "Makefile",
"bytes": "535"
},
{
"name": "PowerShell",
"bytes": "44911"
},
{
"name": "Ruby",
"bytes": "2969134"
},
{
"name": "Shell",
"bytes": "16204"
},
{
"name": "Vim script",
"bytes": "309"
}
],
"symlink_target": ""
} |
package cn.jsprun.service;
import java.util.List;
import cn.jsprun.dao.CreditslogDao;
import cn.jsprun.domain.Creditslog;
import cn.jsprun.utils.BeanFactory;
public class CreditslogService {
public boolean insertCreditslog(Creditslog creditslog){
CreditslogDao credisDao = (CreditslogDao)BeanFactory.getBean("creditslogDao");
return credisDao.insertCreditslog(creditslog);
}
public boolean modifyCreditslog(Creditslog creditslog){
CreditslogDao credisDao = (CreditslogDao)BeanFactory.getBean("creditslogDao");
return credisDao.modifyCreditslog(creditslog);
}
public boolean deleteCreditslog(Creditslog creditslog){
CreditslogDao credisDao = (CreditslogDao)BeanFactory.getBean("creditslogDao");
return credisDao.deleteCreditslog(creditslog);
}
public List<Creditslog> findAllCreditslog(){
CreditslogDao credisDao = (CreditslogDao)BeanFactory.getBean("creditslogDao");
return credisDao.findAllCreditslog();
}
public List<Creditslog> findAllCreditslogByOperation(String []operation){
CreditslogDao credisDao = (CreditslogDao)BeanFactory.getBean("creditslogDao");
return credisDao.findAllCreditslogByOperation(operation);
}
public List<Creditslog> findCreditslogByKeys(String keyword){
CreditslogDao credisDao = (CreditslogDao)BeanFactory.getBean("creditslogDao");
return credisDao.findCreditslogByKeys(keyword);
}
public List<Creditslog> findCreditslogByUid(int uid,int maxrow){
CreditslogDao credisDao = (CreditslogDao)BeanFactory.getBean("creditslogDao");
return credisDao.findCreditslogByUid(uid,maxrow);
}
public List<Creditslog> findCreditsLogByHql(String hql,int startrow,int maxrow){
CreditslogDao credisDao = (CreditslogDao)BeanFactory.getBean("creditslogDao");
return credisDao.findCreditsLogByHql(hql, startrow, maxrow);
}
public int findCreditslogCountbyHql(String hql){
CreditslogDao credisDao = (CreditslogDao)BeanFactory.getBean("creditslogDao");
return credisDao.findCreditslogCountbyHql(hql);
}
}
| {
"content_hash": "7752f5a1ce6fe1bf1ee543b7152ec215",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 81,
"avg_line_length": 45.674418604651166,
"alnum_prop": 0.8151731160896131,
"repo_name": "TinghuanWang/source",
"id": "c77d503a0e0049e5bbbc48b198c3cf256b46a005",
"size": "1964",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/cn/jsprun/service/CreditslogService.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "164786"
},
{
"name": "HTML",
"bytes": "8447"
},
{
"name": "Java",
"bytes": "9948032"
},
{
"name": "JavaScript",
"bytes": "176147"
}
],
"symlink_target": ""
} |
require 'spec_helper'
describe Thetvdbrb do
it 'has a version number' do
expect(Thetvdbrb::VERSION).not_to be nil
end
it 'does something useful' do
expect(false).to eq(true)
end
end
| {
"content_hash": "dc45181fd7dcaf0c0906e45552494626",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 44,
"avg_line_length": 18.181818181818183,
"alnum_prop": 0.7,
"repo_name": "chansuke/thetvdbrb",
"id": "c48172c9cfa4b75aadebf071f70851ae190386a4",
"size": "200",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/thetvdbrb_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "2868"
},
{
"name": "Shell",
"bytes": "115"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<title>Calculadora de Enlaces Satelitales | Universidad de Pamplona</title>
<meta charset="UTF-8">
<!-- Le decimos al navegador que nuestra web esta optimizada para moviles -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<script src="../js/calculos.js">
</script>
<!-- Cargamos el CSS -->
<link type="text/css" rel="stylesheet" href="../css/materialize.css" media="screen,projection" />
<link type="text/css" rel="stylesheet" href="../css/custom.css" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<nav class="blue darken-4">
<a href="#" class="brand-logo right titulo3-nav">Downlink</a>
<ul id="slide-out" class="side-nav">
<li><a href="inicio.html"><i class="material-icons left">store</i>Inicio</a></li>
<li><a href="teoria.html"><i class="material-icons left">info</i>Teoria</a></li>
<li><a href="calculos.html"><i class="material-icons left">subtitles</i>Calculos</a></li>
<li><a href="recursos.html"><i class="material-icons left">receipt</i>Recursos</a></li>
</ul>
<a href="#" data-activates="slide-out" class="button-collapse show-on-large"><i class="mdi-navigation-menu"></i></a>
</nav>
<main>
<section id="contacto" class="contacto">
<div class="row">
<div class="col s12 m7">
<div class="card">
<h1 class="titulo1">Ganancia de transmision (Gtx)</h1>
<img src="../img/formulas/gtxdown.png" />
<ul class="collapsible" data-collapsible="expandable">
<li>
<div class="collapsible-header"><i class="material-icons">filter_drama</i>Acerca</div>
<div class="collapsible-body"><p>La ganancia de una antena se define como la relación entre la densidad de potencia radiada en una dirección y la densidad de potencia que radiaría una antena isotrópica, a igualdad de distancias y potencias entregadas a la antena.
Se habla de la potencia que entrega la antena.</p></div>
</li>
<li>
<div class="collapsible-header">η = Eficiencia Satelite</div>
<div class="collapsible-body"><p>La eficiencia se puede definir como la relación entre la potencia radiada por una antena y la potencia entregada a la misma.
La eficiencia es un número comprendido entre 0 y 1; Se debe colocar entre (0.00 a 1) porciento..</p></div>
</li>
<li>
<div class="collapsible-header">Θ = Angulo de Antena </div>
<div class="collapsible-body"><p>Ancho del haz en el patrón de radiación (grados).</p></div>
</li>
</ul>
<form class="col s12" name="formulario">
<div class="row">
<div class="col s6">
<input type="text" class="validate" id="satelitedown" value="" maxlength="4">
<label for="">η=Eficiencia Satelite</label>
<span id="satelitedown_0" style="display: none;"> Requerido</span>
</div>
</div>
<div class="row">
<div class="col s6">
<input type="text" class="validate" id="anguloantena" value="" maxlength="3">
<label for="">Θ= Angulo de Antena</label>
<span id="anguloantena_1" style="display: none;"> Requerido</span>
</div>
</div>
<button class="btn waves-effect waves-light" type="button" onclick="gananciaAntenaBajando()" name="actionpire" id="actionpire">Calcular
<i class="mdi-content-send right"></i>
</button><span id="antenareceptora" align="center" style="margin-left: 25%;"></span>
</form>
<div class="card-action">
<a href="recursos.html">Ayuda</a>
</div>
</div>
</div>
</div>
</section>
<section id="contacto" class="contacto">
<div class="row">
<div class="col s12 m6">
<div class="card">
<h1 class="titulo1">Potencia de transmision (Ptx)</h1>
<img src="../img/formulas/ptx.png" />
<ul class="collapsible" data-collapsible="expandable">
<li>
<div class="collapsible-header"><i class="material-icons">filter_drama</i>Acerca</div>
<div class="collapsible-body"><p>Cuanto mayor sea la potencia de transmisión, el tiempo más corto de espera, se puede definir como la magnitud que atraviesa el medio de transmisión en el proceso de downlink usa una potencia diferente y en general este valor es dado en (Watts) pero se debe manejar en la ecuación en (dB)</p></div>
</li> <ul>
<form class="col s12" name="formpotenciatxdown">
<div class="row">
<div class="col s6">
<input type="text" class="validate" id="downpotenciatx" value="">
<label for="">Ptx = Potencia</label>
<span id="potenciatxdown_0" style="display: none;"> Requerido</span>
</div>
</div>
<button class="btn waves-effect waves-light" type="button" onclick="calculopotenciatxdown()" name="actionpire" id="actionpire">Calcular
<i class="mdi-content-send right"></i>
</button>
<span id="potenciatxdown" align="center" style="margin-left: 25%;"></span>
</form>
</div>
</div>
</div>
</section>
<section id="contacto" class="contacto">
<div class="row">
<div class="col s12 m7">
<div class="card">
<h1 class="titulo1">Potencia isotropica radiada equivalente (PIRE)</h1>
<img src="../img/formulas/pire.png" />
<ul class="collapsible" data-collapsible="expandable">
<li>
<div class="collapsible-header"><i class="material-icons">filter_drama</i>Acerca</div>
<div class="collapsible-body"><p>La Potencia Isotrópica Radiada Equivalente, es la cantidad de potencia que emitiría una antena
isotrópica teórica (es decir, aquella que distribuye la potencia exactamente igual en todas direcciones).</p></div>
</li>
<li>
<div class="collapsible-header">Ptx = Potencia de Antena</div>
<div class="collapsible-body"><p>Cuanto mayor sea la potencia de transmisión, el tiempo más corto de espera, se puede definir como la magnitud que atraviesa el medio de transmisión en el proceso de downlink usa una potencia diferente
y en general este valor es dado en (Watts) pero se debe manejar en la ecuación en (dB)</p></div>
</li>
<li>
<div class="collapsible-header">Gtx = Ganancia de Antena</div>
<div class="collapsible-body"><p>se define como la relación
entre la densidad de
potencia radiada en una dirección
y la densidad de potencia que
radiaría una antena isotrópica, a igualdad de distancias
y potencias entregadas a la antena. Se habla de la potencia que entrega la antena</p></div>
</li>
</ul>
<form class="col s12" name="formpiredown" id="formpiredown">
<div class="row">
<div class=" col s6">
<input type="text" class="validate" id="potxdown" value="">
<label for="">Potencia de Antena:</label>
<span id="potxdown_0" style="display: none;"> Requerido</span>
</div>
</div>
<div class="row">
<div class="col s6">
<input type="text" class="validate" id="ganancdown" value="">
<label for="">Ganancia de Antena (dBI):</label>
<span id="ganancdown_1" style="display: none;"> Requerido</span>
</div>
</div>
<button class="btn waves-effect waves-light" type="button" onclick="getPireDown()" name="actionpire" id="actionpire">Calcular
<i class="mdi-content-send right"></i>
</button><span id="valpiredown" align="center" style="margin-left: 25%;"></span>
</form>
<div class="card-action">
<a href="recursos.html">Ayuda</a>
</div>
</div>
</div>
</div>
</section>
<section id="contacto" class="contacto">
<div class="row">
<div class="col s12 m7">
<div class="card">
<h1 class="titulo1">Densidad de Flujo (Φ)</h1>
<img src="../img/formulas/Omax.png"/>
<ul class="collapsible" data-collapsible="expandable">
<li>
<div class="collapsible-header"><i class="material-icons">filter_drama</i>Acerca</div>
<div class="collapsible-body"><p>El nivel de señal de una onda incidente de una antena de satélite se mide por la densidad de flujo de potencia
(expresada en vatios por metro cuadrado) del frente de onda que se aproxima.
</p></div>
</li>
<li>
<div class="collapsible-header">Ptx = Potencia de Antena</div>
<div class="collapsible-body"><p>Cuanto mayor sea la potencia de transmisión, el tiempo más corto de espera,
se puede definir como la magnitud que atraviesa el medio de transmisión</p></div>
</li>
<li>
<div class="collapsible-header">Gtx = Ganancia de Antena</div>
<div class="collapsible-body"><p>Se define como la relación
entre la densidad de
potencia radiada en una dirección
y la densidad de potencia que
radiaría una antena isotrópica, a igualdad de distancias
y potencias entregadas a la antena. Se habla de la potencia que entrega la antena</p></div>
</li>
<li>
<div class="collapsible-header">R = Distancia</div>
<div class="collapsible-body"><p>Distancia del satélite desde un punto en tierra</p></div>
</li>
</ul>
<form class="col s12" name="densidaddown" id="densidaddown">
<div class="row">
<!-- Dropdown Trigger -->
<!-- Dropdown Structure -->
<div class="col s6">
<input type="text" class="validate" id="potantenadown" value="">
<label for="">Potencia de Antena </label>
<span id="potantenadown_0" style="display: none;"> Requerido</span>
</div>
</div>
<div class="row">
<div class="col s6">
<input type="text" class="validate" id="gaindown" value="">
<label for="">Ganancia de Antena</label>
<span id="gaindown_1" style="display: none;"> Requerido</span>
</div>
</div>
<div class="row">
<div class="col s6">
<input type="text" class="validate" id="distanciadown" value="">
<label for="">Distancia Kmts</label>
<span id="distanciadown_2" style="display: none;"> Requerido</span>
</div>
</div>
<button class="btn waves-effect waves-light" type="button" onclick="densidadMaximaDown()" name="actionpire" id="actionpire">Calcular
<i class="mdi-content-send right"></i>
</button><span id="valdensitydown" align="center" style="margin-left: 25%;"></span>
</form>
<div class="card-action">
<a href="recursos.html">Ayuda</a>
</div>
</div>
</div>
</div>
</section>
<section id="contacto" class="contacto">
<div class="row">
<div class="col s12 m7">
<div class="card">
<h1 class="titulo1">Perdida en el espacio libre (FSL)</h1>
<img src="../img/formulas/fsl.png" />
<ul class="collapsible" data-collapsible="expandable">
<li>
<div class="collapsible-header"><i class="material-icons">filter_drama</i>Acerca</div>
<div class="collapsible-body"><p>La potencia de la señal se reduce por el ensanchamiento del frente de onda en lo que se conoce como Pérdida en el Espacio Libre, La potencia de la señal
se distribuye sobre un frente de onda de área cada vez mayor a medida que nos alejamos del transmisor,
por lo que la densidad de potencia disminuye.</p></div>
</li>
<li>
<div class="collapsible-header">D = Distancia</div>
<div class="collapsible-body"><p>Distancia del satélite desde un punto en tierra</p></div>
</li>
<li>
<div class="collapsible-header">F = Frecuencia</div>
<div class="collapsible-body"><p>Magnitud que mide el número de repeticiones por unidad de tiempo de cualquier fenómeno o suceso periódico</p></div>
</li>
</ul>
<form class="col s12" name="formulario">
<div class="row">
<div class="col s6">
<input type="text" class="validate" id="distancia1down" value="">
<label for="">Distancia en KMts</label>
<span id="distancia1down_0" style="display: none;"> Requerido</span>
</div>
</div>
<div class="row">
<div class="col s6">
<input type="text" class="validate" id="frecuencia1down" value="">
<label for="">Frecuencia en MegaHertz</label>
<span id="frecuencia1down_1" style="display: none;"> Requerido</span>
</div>
</div>
<button class="btn waves-effect waves-light" type="button" onclick="fslDown()" name="actionpire" id="actionpire">Calcular
<i class="mdi-content-send right"></i>
</button><span id="vfsl1down" align="center" style="margin-left: 25%;"></span>
</form>
<div class="card-action">
<a href="recursos.html">Ayuda</a>
</div>
</div>
</div>
</div>
</section>
</main>
<div class="card">
<div class="row">
<div class="col s12">
<h1 align="left" class="titulo1">Completar calculos de DownLink
<a href="down-two.html" class="btn-floating btn-large waves-effect waves-light red">
<i class="material-icons">send</i>
</a>
</h1>
</div>
</div>
</div>
<footer class="page-footer blue darken-4">
<div class="footer-copyright">
<div class="container">
Universidad de Pamplona - Colombia
<a class="grey-text text-lighten-4 right" href="http://www.unipamplona.edu.co/">Web</a>
</div>
</div>
</footer>
<!-- Cargamos jQuery y materialize js -->
<script type="text/javascript" src="../js/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="../js/materialize.js"></script>
<script type="text/javascript" src="../js/feel.js"></script>
</body> | {
"content_hash": "0f3bb4c2854a3d787576487aa74285de",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 362,
"avg_line_length": 63.72530864197531,
"alnum_prop": 0.4167675691383736,
"repo_name": "Luda16/satellite-link",
"id": "c78b55af40f9a810a8108365870deaad75e4fcd0",
"size": "20689",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pages/down-one.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "14652"
},
{
"name": "C++",
"bytes": "5765"
},
{
"name": "CSS",
"bytes": "196735"
},
{
"name": "HTML",
"bytes": "156625"
},
{
"name": "Java",
"bytes": "17539"
},
{
"name": "JavaScript",
"bytes": "284965"
},
{
"name": "Objective-C",
"bytes": "72800"
}
],
"symlink_target": ""
} |
package org.scalatest
package exceptions
import org.scalactic.Requirements._
import org.scalactic.exceptions.NullArgumentException
import org.scalactic.source
import StackDepthExceptionHelper.posOrElseStackDepthFun
/**
* Exception that indicates a property check failed.
*
* @param messageFun a function that returns a detail message (not optional) for this <code>PropertyCheckFailedException</code>.
* @param cause an optional cause, the <code>Throwable</code> that caused this <code>PropertyCheckFailedException</code> to be thrown.
* @param posOrStackDepthFun either a source position or a function that returns the depth in the stack trace of this exception at which the line of test code that failed resides.
* @param payload an optional payload, which ScalaTest will include in a resulting <code>TestFailed</code> event
* @param undecoratedMessage just a short message that has no redundancy with args, labels, etc. The regular "message" has everything in it.
* @param args the argument values that caused the property check to fail.
* @param optionalArgNames an optional list of string names for the arguments.
*
* @throws NullArgumentException if any parameter is <code>null</code> or <code>Some(null)</code>.
*
* @author Bill Venners
*/
abstract class PropertyCheckFailedException(
messageFun: StackDepthException => String,
cause: Option[Throwable],
posOrStackDepthFun: Either[source.Position, StackDepthException => Int],
payload: Option[Any],
val undecoratedMessage: String,
val args: List[Any],
optionalArgNames: Option[List[String]]
) extends TestFailedException((sde: StackDepthException) => Some(messageFun(sde)), cause, posOrStackDepthFun, payload, Vector.empty) {
/**
* Constructs a <code>PropertyCheckFailedException</code> with given error message function, optional cause, stack depth function,
* optional payload, undecorated message, arguments values and optional argument names.
*
* @param messageFun a function that returns a detail message (not optional) for this <code>PropertyCheckFailedException</code>
* @param cause an optional cause, the <code>Throwable</code> that caused this <code>PropertyCheckFailedException</code> to be thrown.
* @param failedCodeStackDepthFun a function that returns the depth in the stack trace of this exception at which the line of test code that failed resides
* @param payload an optional payload, which ScalaTest will include in a resulting <code>TestFailed</code> event
* @param undecoratedMessage just a short message that has no redundancy with args, labels, etc. The regular "message" has everything in it.
* @param args the argument values that caused the property check to fail.
* @param optionalArgNames an optional list of string names for the arguments.
*/
def this(
messageFun: StackDepthException => String,
cause: Option[Throwable],
failedCodeStackDepthFun: StackDepthException => Int,
payload: Option[Any],
undecoratedMessage: String,
args: List[Any],
optionalArgNames: Option[List[String]]
) = this(messageFun, cause, Right(failedCodeStackDepthFun), payload, undecoratedMessage, args, optionalArgNames)
requireNonNull(
messageFun, cause, posOrStackDepthFun, undecoratedMessage, args,
optionalArgNames)
cause match {
case Some(null) => throw new NullArgumentException("cause was a Some(null)")
case _ =>
}
optionalArgNames match {
case Some(null) => throw new NullArgumentException("optionalArgNames was a Some(null)")
case _ =>
}
/**
* A list of names for the arguments that caused the property check to fail.
*
* <p>
* If the <code>optionalArgNames</code> class parameter is defined, this method returns
* the <code>List[String]</code> contained in the <code>Some</code>. Otherwise, it returns
* a list that gives <code>"arg0"</code> for the zeroeth argument, <code>"arg1"</code> for the
* first argument, <code>"arg2"</code> for the second argument, and so on.
* </p>
*/
def argNames: List[String] =
optionalArgNames match {
case Some(argNames) => argNames
case None => (for (idx <- 0 until args.length) yield { "arg" + idx }).toList
}
}
| {
"content_hash": "09de6b1a72e94c5bf4f5fa39c3f43073",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 179,
"avg_line_length": 48.45977011494253,
"alnum_prop": 0.7447817836812144,
"repo_name": "scalatest/scalatest",
"id": "4edd8cd2136756828a7e5d6bc650f27efe1b6590",
"size": "4816",
"binary": false,
"copies": "3",
"ref": "refs/heads/main",
"path": "jvm/core/src/main/scala/org/scalatest/exceptions/PropertyCheckFailedException.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "14110"
},
{
"name": "Java",
"bytes": "48211"
},
{
"name": "JavaScript",
"bytes": "19211"
},
{
"name": "Roff",
"bytes": "518"
},
{
"name": "Scala",
"bytes": "30174450"
},
{
"name": "Shell",
"bytes": "11947"
}
],
"symlink_target": ""
} |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="ro_RO" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Aleacoin</source>
<translation>Despre Aleacoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>Aleacoin</b> version</source>
<translation>Versiune <b>Aleacoin</b></translation>
</message>
<message>
<location line="+41"/>
<source>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The Aleacoin developers</source>
<translation>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The Aleacoin developers</translation>
</message>
<message>
<location line="+15"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation>
Acesta este un software experimental.
Distribuit sub licența MIT/X11, vezi fișierul însoțitor COPYING sau http://www.opensource.org/licenses/mit-license.php.
Acest produs include programe dezvoltate de către OpenSSL Project pentru a fi folosite în OpenSSL Toolkit (http://www.openssl.org/) și programe criptografice scrise de către Eric Young (eay@cryptsoft.com) și programe UPnP scrise de către Thomas Bernard.</translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Agendă</translation>
</message>
<message>
<location line="+22"/>
<source>Double-click to edit address or label</source>
<translation>Dublu-click pentru a edita adresa sau eticheta</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Creează o adresă nouă</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Copiază adresa selectată în clipboard</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation>Adresă nouă</translation>
</message>
<message>
<location line="-46"/>
<source>These are your Aleacoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation>Acestea sunt adresele Aleacoin pentru a primi plăți. Poate doriți sa dați o adresa noua fiecarui expeditor pentru a putea ține evidența la cine efectuează plăti.</translation>
</message>
<message>
<location line="+60"/>
<source>&Copy Address</source>
<translation>&Copiază adresa</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>Arată cod &QR</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a Aleacoin address</source>
<translation>Semnează un mesaj pentru a dovedi că dețineti o adresă Aleacoin</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>Semnează &Mesajul</translation>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation>Sterge adresele curent selectate din lista</translation>
</message>
<message>
<location line="-14"/>
<source>Verify a message to ensure it was signed with a specified Aleacoin address</source>
<translation>Verifică un mesaj pentru a vă asigura că a fost semnat cu o anumită adresă Aleacoin</translation>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation>&Verifică mesajul</translation>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>Ște&rge</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+65"/>
<source>Copy &Label</source>
<translation>Copiază &eticheta</translation>
</message>
<message>
<location line="+2"/>
<source>&Edit</source>
<translation>&Editează</translation>
</message>
<message>
<location line="+250"/>
<source>Export Address Book Data</source>
<translation>Exportă datele din Agendă</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Valori separate prin virgulă (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Eroare la exportare</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Nu s-a putut scrie în fișier %1.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Etichetă</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresă</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(fără etichetă)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>Dialogul pentru fraza de acces</translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Introdu fraza de acces</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Frază de acces nouă</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Repetă noua frază de acces</translation>
</message>
<message>
<location line="+33"/>
<source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source>
<translation>Servește pentru a dezactiva sendmoneyl atunci când sistemul de operare este compromis. Nu oferă nicio garanție reală.</translation>
</message>
<message>
<location line="+3"/>
<source>For staking only</source>
<translation>Doar pentru staking</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+35"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Introdu noua parolă a portofelului electronic.<br/>Te rog folosește <b>minim 10 caractere aleatoare</b>, sau <b>minim 8 cuvinte</b>.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Criptează portofelul</translation>
</message>
<message>
<location line="+7"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Această acțiune necesită fraza ta de acces pentru deblocarea portofelului.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Deblochează portofelul</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Această acțiune necesită fraza ta de acces pentru decriptarea portofelului.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Decriptează portofelul.</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Schimbă fraza de acces</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Introdu vechea și noua parolă pentru portofel.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Confirmă criptarea portofelului</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</b>!</source>
<translation>Atentie: Daca encriptezi portofelul si iti uiti parola, <b>VEI PIERDE TOATA MONEDELE</b>!</translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Sunteţi sigur că doriţi să criptaţi portofelul electronic?</translation>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation>IMPORTANT: Orice copie de siguranta facuta in prealabil portofelului dumneavoastra ar trebui inlocuita cu cea generata cel mai recent fisier criptat al portofelului. Pentru siguranta, copiile de siguranta vechi ale portofelului ne-criptat vor deveni inutile de indata ce veti incepe folosirea noului fisier criptat al portofelului.</translation>
</message>
<message>
<location line="+103"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>Atentie! Caps Lock este pornit</translation>
</message>
<message>
<location line="-133"/>
<location line="+60"/>
<source>Wallet encrypted</source>
<translation>Portofel criptat</translation>
</message>
<message>
<location line="-58"/>
<source>Aleacoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source>
<translation>Aleacoin se va inchide pentru a termina procesul de encriptie. Amintiți-vă, criptarea portofelul dumneavoastră nu poate proteja pe deplin monedele dvs. de a fi furate de infectarea cu malware a computerului.</translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+44"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Criptarea portofelului a eșuat</translation>
</message>
<message>
<location line="-56"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Criptarea portofelului a eșuat din cauza unei erori interne. Portofelul tău nu a fost criptat.</translation>
</message>
<message>
<location line="+7"/>
<location line="+50"/>
<source>The supplied passphrases do not match.</source>
<translation>Frazele de acces introduse nu se potrivesc.</translation>
</message>
<message>
<location line="-38"/>
<source>Wallet unlock failed</source>
<translation>Deblocarea portofelului a eșuat</translation>
</message>
<message>
<location line="+1"/>
<location line="+12"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Fraza de acces introdusă pentru decriptarea portofelului a fost incorectă.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Decriptarea portofelului a eșuat</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Parola portofelului electronic a fost schimbată.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+282"/>
<source>Sign &message...</source>
<translation>Semnează &mesaj...</translation>
</message>
<message>
<location line="+251"/>
<source>Synchronizing with network...</source>
<translation>Se sincronizează cu rețeaua...</translation>
</message>
<message>
<location line="-319"/>
<source>&Overview</source>
<translation>&Imagine de ansamblu</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Arată o stare generală de ansamblu a portofelului</translation>
</message>
<message>
<location line="+17"/>
<source>&Transactions</source>
<translation>&Tranzacții</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Răsfoiește istoricul tranzacțiilor</translation>
</message>
<message>
<location line="+5"/>
<source>&Address Book</source>
<translation>Agendă</translation>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Editează lista de adrese si etichete stocate</translation>
</message>
<message>
<location line="-13"/>
<source>&Receive coins</source>
<translation>Primește monede</translation>
</message>
<message>
<location line="+1"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Arată lista de adrese pentru primire plăți</translation>
</message>
<message>
<location line="-7"/>
<source>&Send coins</source>
<translation>&Trimite monede</translation>
</message>
<message>
<location line="+35"/>
<source>E&xit</source>
<translation>&Ieșire</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Închide aplicația</translation>
</message>
<message>
<location line="+6"/>
<source>Show information about Aleacoin</source>
<translation>Arată informații despre Aleacoin</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>Despre &Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Arată informații despre Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Setări...</translation>
</message>
<message>
<location line="+4"/>
<source>&Encrypt Wallet...</source>
<translation>Criptează portofelul electronic...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>&Fă o copie de siguranță a portofelului...</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>S&chimbă parola...</translation>
</message>
<message numerus="yes">
<location line="+259"/>
<source>~%n block(s) remaining</source>
<translation><numerusform>~%n bloc rămas</numerusform><numerusform>~%n blocuri rămase</numerusform><numerusform>~%n blocuri rămase</numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation>Descărcat %1 din %2 blocuri din istoricul tranzacțiilor(%3% terminat).</translation>
</message>
<message>
<location line="-256"/>
<source>&Export...</source>
<translation>&Exportă</translation>
</message>
<message>
<location line="-64"/>
<source>Send coins to a Aleacoin address</source>
<translation>Trimite monede către o adresă Aleacoin</translation>
</message>
<message>
<location line="+47"/>
<source>Modify configuration options for Aleacoin</source>
<translation>Modifică opțiuni de configurare pentru Aleacoin</translation>
</message>
<message>
<location line="+18"/>
<source>Export the data in the current tab to a file</source>
<translation>Exportă datele din tab-ul curent într-un fișier</translation>
</message>
<message>
<location line="-14"/>
<source>Encrypt or decrypt wallet</source>
<translation>Criptează sau decriptează portofelul</translation>
</message>
<message>
<location line="+3"/>
<source>Backup wallet to another location</source>
<translation>Creează o copie de rezervă a portofelului într-o locație diferită</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Schimbă fraza de acces folosită pentru criptarea portofelului</translation>
</message>
<message>
<location line="+10"/>
<source>&Debug window</source>
<translation>Fereastră &debug</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Deschide consola de debug și diagnosticare</translation>
</message>
<message>
<location line="-5"/>
<source>&Verify message...</source>
<translation>&Verifică mesajul...</translation>
</message>
<message>
<location line="-202"/>
<source>Aleacoin</source>
<translation>Aleacoin</translation>
</message>
<message>
<location line="+0"/>
<source>Wallet</source>
<translation>Portofelul</translation>
</message>
<message>
<location line="+180"/>
<source>&About Aleacoin</source>
<translation>Despre Aleacoin</translation>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation>Arata/Ascunde</translation>
</message>
<message>
<location line="+9"/>
<source>Unlock wallet</source>
<translation>Deblochează portofelul</translation>
</message>
<message>
<location line="+1"/>
<source>&Lock Wallet</source>
<translation>Blochează portofelul</translation>
</message>
<message>
<location line="+1"/>
<source>Lock wallet</source>
<translation>Blochează portofelul</translation>
</message>
<message>
<location line="+35"/>
<source>&File</source>
<translation>&Fișier</translation>
</message>
<message>
<location line="+8"/>
<source>&Settings</source>
<translation>&Setări</translation>
</message>
<message>
<location line="+8"/>
<source>&Help</source>
<translation>A&jutor</translation>
</message>
<message>
<location line="+12"/>
<source>Tabs toolbar</source>
<translation>Bara de file</translation>
</message>
<message>
<location line="+8"/>
<source>Actions toolbar</source>
<translation>Bara de instrumente Actiuni</translation>
</message>
<message>
<location line="+13"/>
<location line="+9"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location line="+0"/>
<location line="+60"/>
<source>Aleacoin client</source>
<translation>Clientul Aleacoin</translation>
</message>
<message numerus="yes">
<location line="+75"/>
<source>%n active connection(s) to Aleacoin network</source>
<translation><numerusform>%n conexiune activă la reteaua Aleacoin</numerusform><numerusform>%n conexiuni active la reteaua Aleacoin</numerusform><numerusform>%n conexiuni active la reteaua Aleacoin</numerusform></translation>
</message>
<message>
<location line="+40"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation>Descărcat %1 blocuri din istoricul tranzacțiilor.</translation>
</message>
<message>
<location line="+413"/>
<source>Staking.<br>Your weight is %1<br>Network weight is %2<br>Expected time to earn reward is %3</source>
<translation>Staking. <br>Greutatea este %1<br>Greutatea retelei este %2<br>Timp estimat pentru a castiga recompensa este %3</translation>
</message>
<message>
<location line="+6"/>
<source>Not staking because wallet is locked</source>
<translation>Nu este in modul stake deoarece portofelul este blocat</translation>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is offline</source>
<translation>Nu este in modul stake deoarece portofelul este offline</translation>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is syncing</source>
<translation>Nu este in modul stake deoarece portofelul se sincronizeaza</translation>
</message>
<message>
<location line="+2"/>
<source>Not staking because you don't have mature coins</source>
<translation>Nu este in modul stake deoarece nu sunt destule monede maturate</translation>
</message>
<message numerus="yes">
<location line="-403"/>
<source>%n second(s) ago</source>
<translation><numerusform>%n secundă în urmă</numerusform><numerusform>%n secunde în urmă</numerusform><numerusform>%n secunde în urmă</numerusform></translation>
</message>
<message>
<location line="-312"/>
<source>About Aleacoin card</source>
<translation>Despre cardul Aleacoin</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Aleacoin card</source>
<translation>Arată informații despre card Aleacoin</translation>
</message>
<message>
<location line="+18"/>
<source>&Unlock Wallet...</source>
<translation>&Deblochează portofelul</translation>
</message>
<message numerus="yes">
<location line="+297"/>
<source>%n minute(s) ago</source>
<translation><numerusform>%n minut în urmă</numerusform><numerusform>%n minute în urmă</numerusform><numerusform>%n minute în urmă</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s) ago</source>
<translation><numerusform>%n oră în urmă</numerusform><numerusform>%n ore în urmă</numerusform><numerusform>%n ore în urmă</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s) ago</source>
<translation><numerusform>%n zi în urmă</numerusform><numerusform>%n zile în urmă</numerusform><numerusform>%n zile în urmă</numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Up to date</source>
<translation>Actualizat</translation>
</message>
<message>
<location line="+7"/>
<source>Catching up...</source>
<translation>Se actualizează...</translation>
</message>
<message>
<location line="+10"/>
<source>Last received block was generated %1.</source>
<translation>Ultimul bloc primit a fost generat %1.</translation>
</message>
<message>
<location line="+59"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation>Această tranzactie este peste limita admisa. Puteți sa trimiteți pentru o taxa de 1%, care este pentru nodurile care proceseaza tranzactia si ajuta la sprijinirea retelei. Vrei să plătești taxa?</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm transaction fee</source>
<translation>Confirmă comisinoul tranzacției</translation>
</message>
<message>
<location line="+27"/>
<source>Sent transaction</source>
<translation>Tranzacție expediată</translation>
</message>
<message>
<location line="+1"/>
<source>Incoming transaction</source>
<translation>Tranzacție recepționată</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Data: %1
Suma: %2
Tipul: %3
Adresa: %4
</translation>
</message>
<message>
<location line="+100"/>
<location line="+15"/>
<source>URI handling</source>
<translation>Manipulare URI</translation>
</message>
<message>
<location line="-15"/>
<location line="+15"/>
<source>URI can not be parsed! This can be caused by an invalid Aleacoin address or malformed URI parameters.</source>
<translation>URI nu poate fi parsatt! Cauza poate fi o adresa Aleacoin invalidă sau parametrii URI malformați.</translation>
</message>
<message>
<location line="+18"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Portofelul este <b>criptat</b> iar în momentul de față este <b>deblocat</b></translation>
</message>
<message>
<location line="+10"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Portofelul este <b>criptat</b> iar în momentul de față este <b>blocat</b></translation>
</message>
<message>
<location line="+25"/>
<source>Backup Wallet</source>
<translation>Fă o copie de siguranță a portofelului</translation>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation>Date portofel(*.dat)</translation>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation>Copia de rezerva a esuat</translation>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation>Eroare la încercarea de a salva datele portofelului în noua locaţie.</translation>
</message>
<message numerus="yes">
<location line="+76"/>
<source>%n second(s)</source>
<translation><numerusform>%n secundă</numerusform><numerusform>%n secunde</numerusform><numerusform>%n secunde</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s)</source>
<translation><numerusform>%n minut</numerusform><numerusform>%n minute</numerusform><numerusform>%n minute</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s)</source>
<translation><numerusform>%n oră</numerusform><numerusform>%n ore</numerusform><numerusform>%n ore</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation><numerusform>%n zi</numerusform><numerusform>%n zile</numerusform><numerusform>%n zile</numerusform></translation>
</message>
<message>
<location line="+18"/>
<source>Not staking</source>
<translation>Not staking</translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+109"/>
<source>A fatal error occurred. Aleacoin can no longer continue safely and will quit.</source>
<translation>A apărut o eroare fatală. Aleacoin nu mai poate continua în condiții de siguranță și va iesi.</translation>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+90"/>
<source>Network Alert</source>
<translation>Alertă rețea</translation>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="+14"/>
<source>Coin Control</source>
<translation>Controlează moneda</translation>
</message>
<message>
<location line="+31"/>
<source>Quantity:</source>
<translation>Cantitate:</translation>
</message>
<message>
<location line="+32"/>
<source>Bytes:</source>
<translation>Octeţi:</translation>
</message>
<message>
<location line="+48"/>
<source>Amount:</source>
<translation>Sumă:</translation>
</message>
<message>
<location line="+32"/>
<source>Priority:</source>
<translation>Prioritate:</translation>
</message>
<message>
<location line="+48"/>
<source>Fee:</source>
<translation>Taxa:</translation>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation>Ieşire minimă: </translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="+551"/>
<source>no</source>
<translation>nu</translation>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="+51"/>
<source>After Fee:</source>
<translation>După taxe:</translation>
</message>
<message>
<location line="+35"/>
<source>Change:</source>
<translation>Schimb:</translation>
</message>
<message>
<location line="+69"/>
<source>(un)select all</source>
<translation>(de)selectaţi tot</translation>
</message>
<message>
<location line="+13"/>
<source>Tree mode</source>
<translation>Modul arborescent</translation>
</message>
<message>
<location line="+16"/>
<source>List mode</source>
<translation>Modul lista</translation>
</message>
<message>
<location line="+45"/>
<source>Amount</source>
<translation>Sumă</translation>
</message>
<message>
<location line="+5"/>
<source>Label</source>
<translation>Etichetă</translation>
</message>
<message>
<location line="+5"/>
<source>Address</source>
<translation>Adresă</translation>
</message>
<message>
<location line="+5"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+5"/>
<source>Confirmations</source>
<translation>Confirmări</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed</source>
<translation>Confirmat</translation>
</message>
<message>
<location line="+5"/>
<source>Priority</source>
<translation>Prioritate</translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="-515"/>
<source>Copy address</source>
<translation>Copiază adresa</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Copiază eticheta</translation>
</message>
<message>
<location line="+1"/>
<location line="+26"/>
<source>Copy amount</source>
<translation>Copiază suma</translation>
</message>
<message>
<location line="-25"/>
<source>Copy transaction ID</source>
<translation>Copiază ID tranzacție</translation>
</message>
<message>
<location line="+24"/>
<source>Copy quantity</source>
<translation>Copiaţi quantitea</translation>
</message>
<message>
<location line="+2"/>
<source>Copy fee</source>
<translation>Copiaţi taxele</translation>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation>Copiaţi după taxe</translation>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation>Copiaţi octeţi</translation>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation>Copiaţi prioritatea</translation>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation>Copiaţi ieşire minimă:</translation>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation>Copiaţi schimb</translation>
</message>
<message>
<location line="+317"/>
<source>highest</source>
<translation>cel mai mare</translation>
</message>
<message>
<location line="+1"/>
<source>high</source>
<translation>mare</translation>
</message>
<message>
<location line="+1"/>
<source>medium-high</source>
<translation>marime medie</translation>
</message>
<message>
<location line="+1"/>
<source>medium</source>
<translation>mediu</translation>
</message>
<message>
<location line="+4"/>
<source>low-medium</source>
<translation>mediu-scazut</translation>
</message>
<message>
<location line="+1"/>
<source>low</source>
<translation>scazut</translation>
</message>
<message>
<location line="+1"/>
<source>lowest</source>
<translation>cel mai scazut</translation>
</message>
<message>
<location line="+155"/>
<source>DUST</source>
<translation>DUST</translation>
</message>
<message>
<location line="+0"/>
<source>yes</source>
<translation>da</translation>
</message>
<message>
<location line="+10"/>
<source>This label turns red, if the transaction size is bigger than 10000 bytes.
This means a fee of at least %1 per kb is required.
Can vary +/- 1 Byte per input.</source>
<translation>Aceasta eticheta se inroseste daca marimea tranzactiei este mai mare de 10000 bytes.
Acest lucru inseamna ca este nevoie de o taxa de cel putin %1 pe kb
Poate varia +/- 1 Byte pe imput.</translation>
</message>
<message>
<location line="+1"/>
<source>Transactions with higher priority get more likely into a block.
This label turns red, if the priority is smaller than "medium".
This means a fee of at least %1 per kb is required.</source>
<translation>Tranzacțiile cu prioritate mai mare ajunge mult mai probabil într-un bloc
Aceasta eticheta se inroseste daca prioritatea este mai mica decat "medium"
Acest lucru inseamna ca este necesar un comision cel putin de %1 pe kB</translation>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if any recipient receives an amount smaller than %1.
This means a fee of at least %2 is required.
Amounts below 0.546 times the minimum relay fee are shown as DUST.</source>
<translation>Aceasta eticheta se inroseste daca oricare din contacte primeste o suma mai mica decat %1.
Acest lucru inseamna ca un comision de cel putin %2 este necesar.
Sume mai mici decat 0.546 ori minimul comisionului de relay sunt afisate ca DUST</translation>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if the change is smaller than %1.
This means a fee of at least %2 is required.</source>
<translation>Această eticheta se înroseste dacă schimbul este mai mic de %1.
Acest lucru înseamnă că o taxă de cel puțin %2 este necesară</translation>
</message>
<message>
<location line="+37"/>
<location line="+66"/>
<source>(no label)</source>
<translation>(fără etichetă)</translation>
</message>
<message>
<location line="-9"/>
<source>change from %1 (%2)</source>
<translation>schimbă la %1(%2)</translation>
</message>
<message>
<location line="+1"/>
<source>(change)</source>
<translation>(schimb)</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Editează adresa</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Etichetă</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>Eticheta asociată cu această intrare în agendă</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Adresă</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation>Adresa asociată cu această intrare în agendă. Acest lucru poate fi modificat numai pentru adresele de trimitere.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+20"/>
<source>New receiving address</source>
<translation>Noua adresă de primire</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Noua adresă de trimitere</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Editează adresa de primire</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Editează adresa de trimitere</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Adresa introdusă "%1" se află deja în lista de adrese.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid Aleacoin address.</source>
<translation>Adresa introdusă "%1" nu este o adresă Aleacoin validă</translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Portofelul nu a putut fi deblocat.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Generarea noii chei a eșuat.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+420"/>
<location line="+12"/>
<source>Aleacoin-Qt</source>
<translation>Aleacoin-Qt</translation>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation>versiune</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation>Utilizare:</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation>Optiuni linie de comanda</translation>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation>Setări UI</translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation>Setează limba, de exemplu: "de_DE" (inițial: setare locală)</translation>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation>Pornește miniaturizat</translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation>Afișează ecran splash la pornire (implicit: 1)</translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Setări</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&Principal</translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source>
<translation>Comision de tranzacție opțional pe kB, care vă ajută ca tranzacțiile sa fie procesate rapid. Majoritatea tranzactiilor sunt de 1 kB. Comision de 0.01 recomandat</translation>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>Plăteşte comision pentru tranzacţie &f</translation>
</message>
<message>
<location line="+31"/>
<source>Reserved amount does not participate in staking and is therefore spendable at any time.</source>
<translation>Suma rezervată nu participă la maturare și, prin urmare, se poate cheltui în orice moment.</translation>
</message>
<message>
<location line="+15"/>
<source>Reserve</source>
<translation>Rezervă</translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start Aleacoin after logging in to the system.</source>
<translation>Pornește Aleacoin imdiat după logarea în sistem</translation>
</message>
<message>
<location line="+3"/>
<source>&Start Aleacoin on system login</source>
<translation>$Pornește Aleacoin la logarea în sistem</translation>
</message>
<message>
<location line="+7"/>
<source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>
<translation>Detașați bloc și baze de date de adrese la închidere. Acest lucru înseamnă că pot fi mutate într-u alt director de date, dar incetineste închiderea. Portofelul este întotdeauna detașat.</translation>
</message>
<message>
<location line="+3"/>
<source>&Detach databases at shutdown</source>
<translation>&Detasaza baza de date la inchidere</translation>
</message>
<message>
<location line="+21"/>
<source>&Network</source>
<translation>&Retea</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the Aleacoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Deschide automat portul pentru cientul Aleacoin pe router. Aces lucru este posibil doara daca routerul suporta UPnP si este activat</translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Mapeaza portul folosind &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the Aleacoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation>Conecteaza la reteaua Aleacoin prinr-un proxy SOCKS(ex. cand te conectezi prin Tor)</translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation>Conectează-te printr-un proxy socks</translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>Proxy &IP:</translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>Adresa IP a proxy-ului(ex. 127.0.0.1)</translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>&Port:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Portul pe care se concetează proxy serverul (de exemplu: 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>SOCKS &Versiune:</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>Versiunea SOCKS a proxiului (ex. 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&Fereastra</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Afişează doar un icon in tray la ascunderea ferestrei</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&M Ascunde în tray în loc de taskbar</translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>Ascunde fereastra în locul părăsirii programului în momentul închiderii ferestrei. Când acestă opţiune e activă, aplicaţia se va opri doar în momentul selectării comenzii Quit din menu.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>&i Ascunde fereastra în locul închiderii programului</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>&Afişare</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>Interfata & limba userului</translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting Aleacoin.</source>
<translation>Limba interfeței utilizator poate fi setat aici. Această setare va avea efect după repornirea Aleacoin.</translation>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>&Unitatea de măsură pentru afişarea sumelor:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Alege subdiviziunea folosită la afişarea interfeţei şi la trimiterea de bitcoin.</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show Aleacoin addresses in the transaction list or not.</source>
<translation>Dacă să arate adrese Aleacoin din lista de tranzacție sau nu.</translation>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>&Afişează adresele în lista de tranzacţii</translation>
</message>
<message>
<location line="+7"/>
<source>Whether to show coin control features or not.</source>
<translation>Dacă să se afişeze controlul caracteristicilor monedei sau nu.</translation>
</message>
<message>
<location line="+3"/>
<source>Display coin &control features (experts only!)</source>
<translation>Afiseaza &caracteristiclei de control ale monedei(numai experti!)</translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>& OK</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>& Renunta</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation>&Aplica</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+55"/>
<source>default</source>
<translation>Initial</translation>
</message>
<message>
<location line="+149"/>
<location line="+9"/>
<source>Warning</source>
<translation>Avertizare</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting Aleacoin.</source>
<translation>Aceasta setare va avea efect dupa repornirea Aleacoin.</translation>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>Adresa bitcoin pe care a-ti specificat-o este invalida</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Form</translation>
</message>
<message>
<location line="+33"/>
<location line="+231"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Aleacoin network after a connection is established, but this process has not completed yet.</source>
<translation>Informatia afisata poate fi depasita. Portofel se sincronizează automat cu rețeaua Aleacoin după ce se stabilește o conexiune, dar acest proces nu s-a finalizat încă.</translation>
</message>
<message>
<location line="-160"/>
<source>Stake:</source>
<translation>Stake:</translation>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation>Neconfirmat:</translation>
</message>
<message>
<location line="-107"/>
<source>Wallet</source>
<translation>Portofel</translation>
</message>
<message>
<location line="+49"/>
<source>Spendable:</source>
<translation>Cheltuibil:</translation>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation>Balanța ta curentă de cheltuieli</translation>
</message>
<message>
<location line="+71"/>
<source>Immature:</source>
<translation>Nematurizat:</translation>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation>Balanta minata care nu s-a maturizat inca</translation>
</message>
<message>
<location line="+20"/>
<source>Total:</source>
<translation>Total:</translation>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation>Balanța totală curentă</translation>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Tranzacții recente</b></translation>
</message>
<message>
<location line="-108"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation>Total al tranzacțiilor care nu au fost confirmate încă și nu contează față de balanța curentă</translation>
</message>
<message>
<location line="-29"/>
<source>Total of coins that was staked, and do not yet count toward the current balance</source>
<translation>Totalul de monede care au fost in stake si nu sunt numarate in balanta curenta</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+113"/>
<location line="+1"/>
<source>out of sync</source>
<translation>Nu este sincronizat</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation>Dialog cod QR</translation>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation>Cerere de plată</translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>Cantitate:</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>Etichetă</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>Mesaj:</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>&Salvează ca...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation>Eroare la codarea URl-ului în cod QR.</translation>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation>Suma introdusă nu este validă, vă rugăm să verificați.</translation>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation>URI rezultat este prea lung, încearcă să reduci textul pentru etichetă / mesaj.</translation>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation>Salvează codul QR</translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation>Imagini PNG(*png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>Nume client</translation>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+348"/>
<source>N/A</source>
<translation>N/A</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>Versiune client</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>&Informație</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation>Foloseste versiunea OpenSSL</translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation>Durata pornirii</translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Rețea</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>Numărul de conexiuni</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation>Pe testnet</translation>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>Lanț de blocuri</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Numărul curent de blocuri</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation>Blocurile totale estimate</translation>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation>Data ultimului bloc</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>&Deschide</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation>Optiuni linii de comandă</translation>
</message>
<message>
<location line="+7"/>
<source>Show the Aleacoin-Qt help message to get a list with possible Aleacoin command-line options.</source>
<translation>Afișa mesajul de ajutor Aleacoin-Qt pentru a obține o listă cu posibile opțiuni de linie de comandă Aleacoin.</translation>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation>&Arată</translation>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>&Consolă</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation>Construit la data</translation>
</message>
<message>
<location line="-104"/>
<source>Aleacoin - Debug window</source>
<translation>Aleacoin - fereastră depanare</translation>
</message>
<message>
<location line="+25"/>
<source>Aleacoin Core</source>
<translation>Aleacoin Core</translation>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation>Loguri debug</translation>
</message>
<message>
<location line="+7"/>
<source>Open the Aleacoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation>Deschideti fisierul de depanare Aleacoin din folderul curent. Acest lucru poate dura cateva secunde pentru fisiere de log mari.</translation>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Curăță consola</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-33"/>
<source>Welcome to the Aleacoin RPC console.</source>
<translation>Bine ati venit la consola Aleacoin RPC.</translation>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>Foloseste sagetile sus si jos pentru a naviga in istoric si <b>Ctrl-L</b> pentru a curata.</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>Scrie <b>help</b> pentru a vedea comenzile disponibile</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+182"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Trimite monede</translation>
</message>
<message>
<location line="+76"/>
<source>Coin Control Features</source>
<translation>Caracteristici control ale monedei</translation>
</message>
<message>
<location line="+20"/>
<source>Inputs...</source>
<translation>Intrări</translation>
</message>
<message>
<location line="+7"/>
<source>automatically selected</source>
<translation>Selectie automatică</translation>
</message>
<message>
<location line="+19"/>
<source>Insufficient funds!</source>
<translation>Fonduri insuficiente!</translation>
</message>
<message>
<location line="+77"/>
<source>Quantity:</source>
<translation>Cantitate:</translation>
</message>
<message>
<location line="+22"/>
<location line="+35"/>
<source>0</source>
<translation>0</translation>
</message>
<message>
<location line="-19"/>
<source>Bytes:</source>
<translation>Octeţi:</translation>
</message>
<message>
<location line="+51"/>
<source>Amount:</source>
<translation>Sumă:</translation>
</message>
<message>
<location line="+22"/>
<location line="+86"/>
<location line="+86"/>
<location line="+32"/>
<source>0.00 ALEA</source>
<translation>123.456 ALEA {0.00 ?}</translation>
</message>
<message>
<location line="-191"/>
<source>Priority:</source>
<translation>Prioritate:</translation>
</message>
<message>
<location line="+19"/>
<source>medium</source>
<translation>mediu</translation>
</message>
<message>
<location line="+32"/>
<source>Fee:</source>
<translation>Taxa:</translation>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation>Ieşire minimă: </translation>
</message>
<message>
<location line="+19"/>
<source>no</source>
<translation>nu</translation>
</message>
<message>
<location line="+32"/>
<source>After Fee:</source>
<translation>După taxe:</translation>
</message>
<message>
<location line="+35"/>
<source>Change</source>
<translation>Schimbă:</translation>
</message>
<message>
<location line="+50"/>
<source>custom change address</source>
<translation>personalizează schimbarea adresei</translation>
</message>
<message>
<location line="+106"/>
<source>Send to multiple recipients at once</source>
<translation>Trimite simultan către mai mulți destinatari</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>&Adaugă destinatar</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation>Scoateți toate câmpuirile de tranzacții</translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>Șterge &tot</translation>
</message>
<message>
<location line="+28"/>
<source>Balance:</source>
<translation>Balanță:</translation>
</message>
<message>
<location line="+16"/>
<source>123.456 ALEA</source>
<translation>123.456 ALEA</translation>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Confirmă operațiunea de trimitere</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>&S Trimite</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-173"/>
<source>Enter a Aleacoin address (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</source>
<translation>Introduceți o adresă Aleacoin(ex:Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</translation>
</message>
<message>
<location line="+15"/>
<source>Copy quantity</source>
<translation>Copiaţi quantitea</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Copiază suma</translation>
</message>
<message>
<location line="+1"/>
<source>Copy fee</source>
<translation>Copiaţi taxele</translation>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation>Copiaţi după taxe</translation>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation>Copiaţi octeţi</translation>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation>Copiaţi prioritatea</translation>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation>Copiaţi ieşire minimă:</translation>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation>Copiaţi schimb</translation>
</message>
<message>
<location line="+86"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> to %2 (%3)</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Confirmă trimiterea de monede</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation>Sunteți sigur că doriți să trimiteți %1?</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation>și</translation>
</message>
<message>
<location line="+29"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>Adresa destinatarului nu este validă, vă rugăm să o verificaţi.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Suma de plată trebuie să fie mai mare decât 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>Suma depășește soldul contului.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Totalul depășește soldul contului dacă se include și plata comisionului de %1.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>S-a descoperit o adresă care figurează de două ori. Expedierea se poate realiza către fiecare adresă doar o singură dată pe operațiune.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed.</source>
<translation>Eroare: crearea tranzacției a eșuat.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Eroare: tranzacția a fost respinsă. Acest lucru s-ar putea întâmpla în cazul în care unele dintre monedele din portofel au fost deja cheltuite, cum si cum ați utilizat o copie a wallet.dat și monedele au fost cheltuite în copie dar nu au fost marcate ca și cheltuite aici.</translation>
</message>
<message>
<location line="+251"/>
<source>WARNING: Invalid Aleacoin address</source>
<translation>Atenție: Adresă Aleacoin invalidă</translation>
</message>
<message>
<location line="+13"/>
<source>(no label)</source>
<translation>(fără etichetă)</translation>
</message>
<message>
<location line="+4"/>
<source>WARNING: unknown change address</source>
<translation>ATENTIE: adresa schimb necunoscuta</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation>Formular</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>Su&mă:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>Plătește că&tre:</translation>
</message>
<message>
<location line="+24"/>
<location filename="../sendcoinsentry.cpp" line="+25"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Introdu o etichetă pentru această adresă pentru a fi adăugată în lista ta de adrese</translation>
</message>
<message>
<location line="+9"/>
<source>&Label:</source>
<translation>&Etichetă:</translation>
</message>
<message>
<location line="+18"/>
<source>The address to send the payment to (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</source>
<translation>Adresa catre care trimiteti plata(ex. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</translation>
</message>
<message>
<location line="+10"/>
<source>Choose address from address book</source>
<translation>Alegeti adresa din agenda</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>Lipește adresa din clipboard</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation>Scoateti acest destinatar</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a Aleacoin address (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</source>
<translation>Introduceți o adresă Aleacoin(ex:Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation>Semnatura- Semneaza/verifica un mesaj</translation>
</message>
<message>
<location line="+13"/>
<location line="+124"/>
<source>&Sign Message</source>
<translation>Semneaza Mesajul</translation>
</message>
<message>
<location line="-118"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation>Puteti semna mesaje cu adresa dumneavoastra pentru a demostra ca sunteti proprietarul lor. Aveti grija sa nu semnati nimic vag, deoarece atacurile de tip phishing va pot pacali sa le transferati identitatea. Semnati numai declaratiile detaliate cu care sunteti deacord.</translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</source>
<translation>Adresa cu care semnati mesajul(ex. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</translation>
</message>
<message>
<location line="+10"/>
<location line="+203"/>
<source>Choose an address from the address book</source>
<translation>Alegeti o adresa din agenda</translation>
</message>
<message>
<location line="-193"/>
<location line="+203"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-193"/>
<source>Paste address from clipboard</source>
<translation>Lipiţi adresa copiată in clipboard.</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation>Introduce mesajul pe care vrei sa il semnezi, aici.</translation>
</message>
<message>
<location line="+24"/>
<source>Copy the current signature to the system clipboard</source>
<translation>Copiaza semnatura curenta in clipboard-ul sistemului</translation>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this Aleacoin address</source>
<translation>Semnează un mesaj pentru a dovedi că dețineti o adresă Aleacoin</translation>
</message>
<message>
<location line="+17"/>
<source>Reset all sign message fields</source>
<translation>Reseteaza toate spatiile mesajelor semnate.</translation>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>Şterge &tot</translation>
</message>
<message>
<location line="-87"/>
<location line="+70"/>
<source>&Verify Message</source>
<translation>Verifica mesajul</translation>
</message>
<message>
<location line="-64"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation>Introduceti adresa de semnatura, mesajul (asigurati-va ca ati copiat spatiile, taburile etc. exact) si semnatura dedesubt pentru a verifica mesajul. Aveti grija sa nu cititi mai mult in semnatura decat mesajul in sine, pentru a evita sa fiti pacaliti de un atac de tip man-in-the-middle.</translation>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</source>
<translation>Adresa cu care a fost semnat mesajul(ex. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</translation>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified Aleacoin address</source>
<translation>Verifică un mesaj pentru a vă asigura că a fost semnat cu o anumită adresă Aleacoin</translation>
</message>
<message>
<location line="+17"/>
<source>Reset all verify message fields</source>
<translation>Reseteaza toate spatiile mesajelor semnate.</translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a Aleacoin address (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</source>
<translation>Introduceți o adresă Aleacoin(ex:Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Click "Semneaza msajul" pentru a genera semnatura</translation>
</message>
<message>
<location line="+3"/>
<source>Enter Aleacoin signature</source>
<translation>Introduceti semnatura Aleacoin</translation>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>Adresa introdusa nu este valida</translation>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation>Te rugam verifica adresa si introduce-o din nou</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation>Adresa introdusa nu se refera la o cheie.</translation>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation>Blocarea portofelului a fost intrerupta</translation>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation>Cheia privata pentru adresa introdusa nu este valida.</translation>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>Semnarea mesajului a esuat</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>Mesaj Semnat!</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>Aceasta semnatura nu a putut fi decodata</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>Verifica semnatura si incearca din nou</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>Semnatura nu seamana!</translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>Verificarea mesajului a esuat</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>Mesaj verificat</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+19"/>
<source>Open until %1</source>
<translation>Deschis până la %1</translation>
</message>
<message numerus="yes">
<location line="-2"/>
<source>Open for %n block(s)</source>
<translation><numerusform>Deschde pentru încă %1 bloc</numerusform><numerusform>Deschde pentru încă %1 blocuri</numerusform><numerusform>Deschde pentru încă %1 blocuri</numerusform></translation>
</message>
<message>
<location line="+8"/>
<source>conflicted</source>
<translation>conflictual</translation>
</message>
<message>
<location line="+2"/>
<source>%1/offline</source>
<translation>%1/deconectat</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/neconfirmat</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 confirmări</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>Stare</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation><numerusform>, distribuit prin %n nod</numerusform><numerusform>, distribuit prin %n noduri</numerusform><numerusform>, distribuit prin %n de noduri</numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation>Sursa</translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>Generat</translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>De la</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>Către</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation>Adresa posedata</translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>etichetă</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Credit</translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation><numerusform>se maturizează în încă %n bloc</numerusform><numerusform>se maturizează în încă %n blocuri</numerusform><numerusform>se maturizează în încă %n de blocuri</numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>nu este acceptat</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Debit</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Comisionul tranzacţiei</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Suma netă</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Mesaj</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Comentarii</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>ID-ul tranzactiei</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 110 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation>Monedele generate trebuie să se maturizeze 510 blocuri înainte de a fi cheltuite. Când ați generat acest bloc, a fost trimis la rețea pentru a fi adăugat la lanțul de blocuri. În cazul în care nu reușește să intre în lanț, starea sa se va schimba in "nu a fost acceptat", și nu va putea fi cheltuit. Acest lucru se poate întâmpla din când în când, dacă un alt nod generează un bloc cu câteva secunde inaintea blocului tau.</translation>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation>Informatii pentru debug</translation>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>Tranzacţie</translation>
</message>
<message>
<location line="+5"/>
<source>Inputs</source>
<translation>Intrari</translation>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Sumă</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>Adevarat!</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>Fals!</translation>
</message>
<message>
<location line="-211"/>
<source>, has not been successfully broadcast yet</source>
<translation>, nu s-a propagat încă</translation>
</message>
<message>
<location line="+35"/>
<source>unknown</source>
<translation>necunoscut</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Detaliile tranzacției</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Acest panou afișează o descriere detaliată a tranzacției</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+226"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Tipul</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresa</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Cantitate</translation>
</message>
<message>
<location line="+60"/>
<source>Open until %1</source>
<translation>Deschis până la %1</translation>
</message>
<message>
<location line="+12"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Confirmat (%1 confirmări)</translation>
</message>
<message numerus="yes">
<location line="-15"/>
<source>Open for %n more block(s)</source>
<translation><numerusform>Deschis pentru încă %1 bloc</numerusform><numerusform>Deschis pentru încă %1 blocuri</numerusform><numerusform>Deschis pentru încă %1 de blocuri</numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Offline</source>
<translation>Deconectat</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed</source>
<translation>Neconfirmat</translation>
</message>
<message>
<location line="+3"/>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation>Confirmare (%1 dintre %2 confirmări recomandate)</translation>
</message>
<message>
<location line="+6"/>
<source>Conflicted</source>
<translation>Conflictual</translation>
</message>
<message>
<location line="+3"/>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation>Nematurate(%1 confirmari, vor fi valabile dupa %2)</translation>
</message>
<message>
<location line="+3"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Acest bloc nu a fost recepționat de niciun alt nod și probabil nu va fi acceptat!</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Generat dar neacceptat</translation>
</message>
<message>
<location line="+42"/>
<source>Received with</source>
<translation>Recepționat cu</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Primit de la</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Trimis către</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Plată către tine</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Produs</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(n/a)</translation>
</message>
<message>
<location line="+190"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Starea tranzacției. Treci cu mausul peste acest câmp pentru afișarea numărului de confirmări.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Data și ora la care a fost recepționată tranzacția.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Tipul tranzacției.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Adresa de destinație a tranzacției.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Suma extrasă sau adăugată la sold.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+55"/>
<location line="+16"/>
<source>All</source>
<translation>Toate</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Astăzi</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Săptămâna aceasta</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Luna aceasta</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Luna trecută</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Anul acesta</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Între...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Recepționat cu</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Trimis către</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Către tine</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Produs</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Altele</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Introdu adresa sau eticheta pentru căutare</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Cantitatea minimă</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Copiază adresa</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Copiază eticheta</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Copiază suma</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation>Copiază ID tranzacție</translation>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Editează eticheta</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>Arată detaliile tranzacției</translation>
</message>
<message>
<location line="+144"/>
<source>Export Transaction Data</source>
<translation>Exporta datele trazactiei</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Fișier text cu valori separate prin virgulă (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Confirmat</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Tipul</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Etichetă</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Adresă</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Sumă</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>Eroare la exportare</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Nu s-a putut scrie în fișier %1.</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Interval:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>către</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+206"/>
<source>Sending...</source>
<translation>Se trimite...</translation>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+33"/>
<source>Aleacoin version</source>
<translation>Versiune Aleacoin</translation>
</message>
<message>
<location line="+1"/>
<source>Usage:</source>
<translation>Uz:</translation>
</message>
<message>
<location line="+1"/>
<source>Send command to -server or aleacoind</source>
<translation>Trimite comanda catre server sau aleacoind</translation>
</message>
<message>
<location line="+1"/>
<source>List commands</source>
<translation>Listă de comenzi</translation>
</message>
<message>
<location line="+1"/>
<source>Get help for a command</source>
<translation>Ajutor pentru o comandă</translation>
</message>
<message>
<location line="+2"/>
<source>Options:</source>
<translation>Setări:</translation>
</message>
<message>
<location line="+2"/>
<source>Specify configuration file (default: aleacoin.conf)</source>
<translation>Specifica fisier de configurare(implicit: aleacoin.conf)</translation>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: aleacoind.pid)</source>
<translation>Speficica fisier pid(implicit: aleacoin.pid)</translation>
</message>
<message>
<location line="+2"/>
<source>Specify wallet file (within data directory)</source>
<translation>Specifică fișierul wallet (în dosarul de date)</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Specifică dosarul de date</translation>
</message>
<message>
<location line="+2"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Setează mărimea cache a bazei de date în megabiți (implicit: 25)</translation>
</message>
<message>
<location line="+1"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation>Setează mărimea cache a bazei de date în megabiți (implicit: 100)</translation>
</message>
<message>
<location line="+6"/>
<source>Listen for connections on <port> (default: 15714 or testnet: 25714)</source>
<translation>Ascultă pentru conectări pe <port> (implicit: 15714 sau testnet: 25714) </translation>
</message>
<message>
<location line="+1"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Menține cel mult <n> conexiuni cu partenerii (implicit: 125)</translation>
</message>
<message>
<location line="+3"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>Conectează-te la nod pentru a obține adresele partenerilor, și apoi deconectează-te</translation>
</message>
<message>
<location line="+1"/>
<source>Specify your own public address</source>
<translation>Specifică adresa ta publică</translation>
</message>
<message>
<location line="+5"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation>Leaga la o adresa data. Utilizeaza notatie [host]:port pt IPv6</translation>
</message>
<message>
<location line="+2"/>
<source>Stake your coins to support network and gain reward (default: 1)</source>
<translation>Pune monedele in modul stake pentru a ajuta reteaua si a castiva bonusuri(implicit: 1)</translation>
</message>
<message>
<location line="+5"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Prag pentru deconectarea partenerilor care nu funcționează corect (implicit: 100)</translation>
</message>
<message>
<location line="+1"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Numărul de secunde pentru a preveni reconectarea partenerilor care nu funcționează corect (implicit: 86400)</translation>
</message>
<message>
<location line="-44"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation>A intervenit o eroare in timp ce se seta portul RPC %u pentru ascultare pe IPv4: %s</translation>
</message>
<message>
<location line="+51"/>
<source>Detach block and address databases. Increases shutdown time (default: 0)</source>
<translation>Detaseaza bloc si baza de date de adrese. Creste timpul de inchidere(implicit:0)</translation>
</message>
<message>
<location line="+109"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation>Eroare: tranzacția a fost respinsă. Acest lucru s-ar putea întâmpla în cazul în care unele dintre monedele din portofel au fost deja cheltuite, cum si cum ați utilizat o copie a wallet.dat și monedele au fost cheltuite în copie dar nu au fost marcate ca și cheltuite aici.</translation>
</message>
<message>
<location line="-5"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source>
<translation>Eroare: Această tranzacție necesită un comision de tranzacție de cel puțin %s din cauza valorii sale, complexitate, sau utilizarea de fonduri recent primite</translation>
</message>
<message>
<location line="-87"/>
<source>Listen for JSON-RPC connections on <port> (default: 15715 or testnet: 25715)</source>
<translation>Ascultă pentru conexiuni JSON-RPC pe <port> (implicit:15715 sau testnet: 25715)</translation>
</message>
<message>
<location line="-11"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Se acceptă comenzi din linia de comandă și comenzi JSON-RPC</translation>
</message>
<message>
<location line="+101"/>
<source>Error: Transaction creation failed </source>
<translation>Eroare: crearea tranzacției a eșuat.</translation>
</message>
<message>
<location line="-5"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation>Eroare: portofel blocat, tranzactia nu s-a creat</translation>
</message>
<message>
<location line="-8"/>
<source>Importing blockchain data file.</source>
<translation>Se importa fisierul blockchain</translation>
</message>
<message>
<location line="+1"/>
<source>Importing bootstrap blockchain data file.</source>
<translation>Se importa fisierul bootstrap blockchain</translation>
</message>
<message>
<location line="-88"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Rulează în fundal ca un demon și acceptă comenzi</translation>
</message>
<message>
<location line="+1"/>
<source>Use the test network</source>
<translation>Utilizează rețeaua de test</translation>
</message>
<message>
<location line="-24"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>Acceptă conexiuni din afară (implicit: 1 dacă nu se folosește -proxy sau -connect)</translation>
</message>
<message>
<location line="-38"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation>A intervenit o eroare in timp ce se seta portul RPC %u pentru ascultare pe IPv6, reintoarcere la IPv4: %s</translation>
</message>
<message>
<location line="+117"/>
<source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source>
<translation>Eroare la inițializarea mediu de baze de date %s! Pentru a recupera, SALVATI ACEL DIRECTORr, apoi scoateți totul din el, cu excepția wallet.dat.</translation>
</message>
<message>
<location line="-20"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation>Setati valoarea maxima a prioritate mare/taxa scazuta in bytes(implicit: 27000)</translation>
</message>
<message>
<location line="+11"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>Atentie: setarea -paytxfee este foarte ridicata! Aceasta este taxa tranzactiei pe care o vei plati daca trimiti o tranzactie.</translation>
</message>
<message>
<location line="+61"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Aleacoin will not work properly.</source>
<translation>Atentie: Va rugam verificati ca timpul si data calculatorului sunt corete. Daca timpul este gresit Aleacoin nu va functiona corect.</translation>
</message>
<message>
<location line="-31"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation>Atentie: eroare la citirea fisierului wallet.dat! Toate cheile sunt citite corect, dar datele tranzactiei sau anumite intrari din agenda sunt incorecte sau lipsesc.</translation>
</message>
<message>
<location line="-18"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation>Atentie: fisierul wallet.dat este corupt, date salvate! Fisierul original wallet.dat a fost salvat ca wallet.{timestamp}.bak in %s; daca balansul sau tranzactiile sunt incorecte ar trebui sa restaurati dintr-o copie de siguranta. </translation>
</message>
<message>
<location line="-30"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation>Încearcă recuperarea cheilor private dintr-un wallet.dat corupt</translation>
</message>
<message>
<location line="+4"/>
<source>Block creation options:</source>
<translation>Optiuni creare block</translation>
</message>
<message>
<location line="-62"/>
<source>Connect only to the specified node(s)</source>
<translation>Conecteaza-te doar la nod(urile) specifice</translation>
</message>
<message>
<location line="+4"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>Descopera propria ta adresa IP (intial: 1)</translation>
</message>
<message>
<location line="+94"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>Am esuat ascultarea pe orice port. Folositi -listen=0 daca vreti asta.</translation>
</message>
<message>
<location line="-90"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation>Gaseste peers folosind cautare DNS(implicit: 1)</translation>
</message>
<message>
<location line="+5"/>
<source>Sync checkpoints policy (default: strict)</source>
<translation>Sincronizeaza politica checkpoint(implicit: strict)</translation>
</message>
<message>
<location line="+83"/>
<source>Invalid -tor address: '%s'</source>
<translation>Adresa -tor invalida: '%s'</translation>
</message>
<message>
<location line="+4"/>
<source>Invalid amount for -reservebalance=<amount></source>
<translation>Suma invalida pentru -reservebalance=<amount></translation>
</message>
<message>
<location line="-82"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation>Tampon maxim pentru recepție per conexiune, <n>*1000 baiți (implicit: 5000)</translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>Tampon maxim pentru transmitere per conexiune, <n>*1000 baiți (implicit: 1000)</translation>
</message>
<message>
<location line="-16"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation>Efectuează conexiuni doar către nodurile din rețeaua <net> (IPv4, IPv6 sau Tor)</translation>
</message>
<message>
<location line="+28"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation>Extra informatii despre depanare. Implica toate optiunile -debug*</translation>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation>Extra informatii despre depanare retea.</translation>
</message>
<message>
<location line="+1"/>
<source>Prepend debug output with timestamp</source>
<translation>Ataseaza output depanare cu log de timp</translation>
</message>
<message>
<location line="+35"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation>Optiuni SSl (vezi Bitcoin wiki pentru intructiunile de instalare)</translation>
</message>
<message>
<location line="-74"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation>Selectati versiunea de proxy socks(4-5, implicit: 5)</translation>
</message>
<message>
<location line="+41"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Trimite informațiile trace/debug la consolă în locul fișierului debug.log</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation>Trimite informațiile trace/debug la consolă</translation>
</message>
<message>
<location line="+28"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation>Setează mărimea maxima a blocului în bytes (implicit: 250000)</translation>
</message>
<message>
<location line="-1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation>Setează mărimea minimă a blocului în baiți (implicit: 0)</translation>
</message>
<message>
<location line="-29"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>Micsorati fisierul debug.log la inceperea clientului (implicit: 1 cand nu -debug)</translation>
</message>
<message>
<location line="-42"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>Specifică intervalul maxim de conectare în milisecunde (implicit: 5000)</translation>
</message>
<message>
<location line="+109"/>
<source>Unable to sign checkpoint, wrong checkpointkey?
</source>
<translation>În imposibilitatea de a semna checkpoint-ul, checkpointkey greșit?
</translation>
</message>
<message>
<location line="-80"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Foloseste UPnP pentru a vedea porturile (initial: 0)</translation>
</message>
<message>
<location line="-1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Foloseste UPnP pentru a vedea porturile (initial: 1 cand listezi)</translation>
</message>
<message>
<location line="-25"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation>Utilizati proxy pentru a ajunge la serviciile tor (implicit: la fel ca proxy)</translation>
</message>
<message>
<location line="+42"/>
<source>Username for JSON-RPC connections</source>
<translation>Utilizator pentru conexiunile JSON-RPC</translation>
</message>
<message>
<location line="+47"/>
<source>Verifying database integrity...</source>
<translation>Se verifica integritatea bazei de date...</translation>
</message>
<message>
<location line="+57"/>
<source>WARNING: syncronized checkpoint violation detected, but skipped!</source>
<translation>ATENTIONARE: s-a detectat o violare a checkpoint-ului sincronizat, dar s-a ignorat!</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: Disk space is low!</source>
<translation>Avertisment: spațiul pe disc este scăzut!</translation>
</message>
<message>
<location line="-2"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation>Atenție: această versiune este depășită, este necesară actualizarea!</translation>
</message>
<message>
<location line="-48"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation>wallet.dat corupt, recuperare eșuată</translation>
</message>
<message>
<location line="-54"/>
<source>Password for JSON-RPC connections</source>
<translation>Parola pentru conexiunile JSON-RPC</translation>
</message>
<message>
<location line="-84"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=aleacoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "Aleacoin Alert" admin@foo.com
</source>
<translation>%s, trebuie să configurați o parolă rpc în fișierul de configurare: %s
Este recomandat să folosiți următoarea parolă generată aleator: rpcuser=aleacoinrpc
rpcpassword=%s
(nu trebuie să țineți minte această parolă)
Username-ul și parola NU TREBUIE să fie aceleași.
Dacă fișierul nu există, creați-l cu drepturi de citire doar de către deținător.
Este deasemenea recomandat să setați alertnotify pentru a fi notificat de probleme;
de exemplu: alertnotify=echo %%s | mail -s "Aleacoin Alert" admin@foo.com
</translation>
</message>
<message>
<location line="+51"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation>Gaseste noduri fosoling irc (implicit: 1) {0)?}</translation>
</message>
<message>
<location line="+5"/>
<source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source>
<translation>Sincronizează timp cu alte noduri. Dezactivează daca timpul de pe sistemul dumneavoastră este precis ex: sincronizare cu NTP (implicit: 1)</translation>
</message>
<message>
<location line="+15"/>
<source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source>
<translation>Când creați tranzacții, ignorați intrări cu valori mai mici decât aceasta (implicit: 0,01)</translation>
</message>
<message>
<location line="+16"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Permite conexiuni JSON-RPC de la adresa IP specificată</translation>
</message>
<message>
<location line="+1"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Trimite comenzi la nodul care rulează la <ip> (implicit: 127.0.0.1)</translation>
</message>
<message>
<location line="+1"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Execută comanda când cel mai bun bloc se modifică (%s în cmd este înlocuit cu hash-ul blocului)</translation>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation>Executati comanda cand o tranzactie a portofelului se schimba (%s in cmd este inlocuit de TxID)</translation>
</message>
<message>
<location line="+3"/>
<source>Require a confirmations for change (default: 0)</source>
<translation>Necesita confirmari pentru schimbare (implicit: 0)</translation>
</message>
<message>
<location line="+1"/>
<source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source>
<translation>Enforseaza tranzactiile script sa foloseasca operatori canonici PUSH(implicit: 1)</translation>
</message>
<message>
<location line="+2"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation>Execută o comandă când o alerta relevantâ este primitâ(%s in cmd este înlocuit de mesaj)</translation>
</message>
<message>
<location line="+3"/>
<source>Upgrade wallet to latest format</source>
<translation>Actualizează portofelul la ultimul format</translation>
</message>
<message>
<location line="+1"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Setează mărimea bazinului de chei la <n> (implicit: 100)</translation>
</message>
<message>
<location line="+1"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Rescanează lanțul de bloc pentru tranzacțiile portofel lipsă</translation>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation>Câte block-uri se verifică la initializare (implicit: 2500, 0 = toate)</translation>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation>Cat de temeinica sa fie verificarea blocurilor( 0-6, implicit: 1)</translation>
</message>
<message>
<location line="+1"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation>Importă blocuri dintr-un fișier extern blk000?.dat</translation>
</message>
<message>
<location line="+8"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Folosește OpenSSL (https) pentru conexiunile JSON-RPC</translation>
</message>
<message>
<location line="+1"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Certificatul serverului (implicit: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Cheia privată a serverului (implicit: server.pem)</translation>
</message>
<message>
<location line="+1"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Cifruri acceptabile (implicit: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
<location line="+53"/>
<source>Error: Wallet unlocked for staking only, unable to create transaction.</source>
<translation>Eroare: portofel blocat doar pentru staking, tranzactia nu s-a creat.</translation>
</message>
<message>
<location line="+18"/>
<source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source>
<translation>ATENTIONARE: checkpoint invalid! Trazatiile afisate pot fi incorecte! Posibil să aveți nevoie să faceți upgrade, sau să notificati dezvoltatorii.</translation>
</message>
<message>
<location line="-158"/>
<source>This help message</source>
<translation>Acest mesaj de ajutor</translation>
</message>
<message>
<location line="+95"/>
<source>Wallet %s resides outside data directory %s.</source>
<translation>Portofelul %s este in afara directorului %s</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot obtain a lock on data directory %s. Aleacoin is probably already running.</source>
<translation>Nu se poate obtine un lock pe directorul de date &s. Blackoin probabil ruleaza deja.</translation>
</message>
<message>
<location line="-98"/>
<source>Aleacoin</source>
<translation>Aleacoin</translation>
</message>
<message>
<location line="+140"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Nu se poate folosi %s pe acest calculator (eroarea returnată este %d, %s)</translation>
</message>
<message>
<location line="-130"/>
<source>Connect through socks proxy</source>
<translation>Conectează-te printr-un proxy socks</translation>
</message>
<message>
<location line="+3"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Permite căutări DNS pentru -addnode, -seednode și -connect</translation>
</message>
<message>
<location line="+122"/>
<source>Loading addresses...</source>
<translation>Încarc adrese...</translation>
</message>
<message>
<location line="-15"/>
<source>Error loading blkindex.dat</source>
<translation>Eroare la încărcarea blkindex.dat</translation>
</message>
<message>
<location line="+2"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Eroare la încărcarea wallet.dat: Portofel corupt</translation>
</message>
<message>
<location line="+4"/>
<source>Error loading wallet.dat: Wallet requires newer version of Aleacoin</source>
<translation>Eroare la încărcarea wallet.dat: Portofelul necesita o versiune mai noua de Aleacoin</translation>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart Aleacoin to complete</source>
<translation>A fost nevoie de rescrierea portofelului: restartați Aleacoin pentru a finaliza</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat</source>
<translation>Eroare la încărcarea wallet.dat</translation>
</message>
<message>
<location line="-16"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Adresa -proxy nevalidă: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>Rețeaua specificată în -onlynet este necunoscută: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation>S-a cerut o versiune necunoscută de proxy -socks: %i</translation>
</message>
<message>
<location line="+4"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation>Nu se poate rezolva adresa -bind: '%s'</translation>
</message>
<message>
<location line="+2"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>Nu se poate rezolva adresa -externalip: '%s'</translation>
</message>
<message>
<location line="-24"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Suma nevalidă pentru -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+44"/>
<source>Error: could not start node</source>
<translation>Eroare: nodul nu a putut fi pornit</translation>
</message>
<message>
<location line="+11"/>
<source>Sending...</source>
<translation>Se trimite...</translation>
</message>
<message>
<location line="+5"/>
<source>Invalid amount</source>
<translation>Sumă nevalidă</translation>
</message>
<message>
<location line="+1"/>
<source>Insufficient funds</source>
<translation>Fonduri insuficiente</translation>
</message>
<message>
<location line="-34"/>
<source>Loading block index...</source>
<translation>Încarc indice bloc...</translation>
</message>
<message>
<location line="-103"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Adaugă un nod la care te poți conecta pentru a menține conexiunea deschisă</translation>
</message>
<message>
<location line="+122"/>
<source>Unable to bind to %s on this computer. Aleacoin is probably already running.</source>
<translation>Imposibil de conectat %s pe acest computer. Cel mai probabil Aleacoin ruleaza</translation>
</message>
<message>
<location line="-97"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Comision pe kB de adaugat la tranzactiile pe care le trimiti</translation>
</message>
<message>
<location line="+55"/>
<source>Invalid amount for -mininput=<amount>: '%s'</source>
<translation>Suma invalida pentru -mininput=<amount>: '%s'</translation>
</message>
<message>
<location line="+25"/>
<source>Loading wallet...</source>
<translation>Încarc portofel...</translation>
</message>
<message>
<location line="+8"/>
<source>Cannot downgrade wallet</source>
<translation>Nu se poate retrograda portofelul</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot initialize keypool</source>
<translation>Nu se poate initializa keypool</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot write default address</source>
<translation>Nu se poate scrie adresa implicită</translation>
</message>
<message>
<location line="+1"/>
<source>Rescanning...</source>
<translation>Rescanez...</translation>
</message>
<message>
<location line="+5"/>
<source>Done loading</source>
<translation>Încărcare terminată</translation>
</message>
<message>
<location line="-167"/>
<source>To use the %s option</source>
<translation>Pentru a folosi opțiunea %s</translation>
</message>
<message>
<location line="+14"/>
<source>Error</source>
<translation>Eroare</translation>
</message>
<message>
<location line="+6"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation>Trebuie sa setezi rpcpassword=<password> în fișierul de configurare:⏎
%s⏎
Dacă fișierul nu există, creează-l cu permisiuni de citire doar de către proprietar.</translation>
</message>
</context>
</TS> | {
"content_hash": "4b3a7c399fa41b0dcd4cc7b5718958d6",
"timestamp": "",
"source": "github",
"line_count": 3321,
"max_line_length": 470,
"avg_line_length": 39.45829569406805,
"alnum_prop": 0.6328553658778551,
"repo_name": "aleacoin/aleacoin-release",
"id": "7cdbb656a0444d5872ac9d7d7d729d9b765e453a",
"size": "131906",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/qt/locale/bitcoin_ro_RO.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "51312"
},
{
"name": "C",
"bytes": "3280214"
},
{
"name": "C++",
"bytes": "2651953"
},
{
"name": "Objective-C++",
"bytes": "3537"
},
{
"name": "Python",
"bytes": "11646"
},
{
"name": "Shell",
"bytes": "1026"
},
{
"name": "TypeScript",
"bytes": "7751340"
}
],
"symlink_target": ""
} |
package com.zeroami.commonlib.rx.rxbus;
/**
* <p>作者:Zeroami</p>
* <p>邮箱:826589183@qq.com</p>
* <p>描述:RxBus事件的包装</p>
*/
public class LRxBusEvent {
private String action;
private Object data;
public LRxBusEvent(String action, Object data) {
this.action = action;
this.data = data;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}
| {
"content_hash": "53acce6b127eab7ed7a1e10d9d7facbe",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 52,
"avg_line_length": 18.53125,
"alnum_prop": 0.5885328836424958,
"repo_name": "Zeroami/YouLiao",
"id": "df7b5a240b59f9208aca00052f029e9e8d8bc325",
"size": "621",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "commonlib/src/main/java/com/zeroami/commonlib/rx/rxbus/LRxBusEvent.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "633446"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.