text stringlengths 2 1.04M | meta dict |
|---|---|
package org.onlab.packet.pim;
import org.onlab.packet.DeserializationException;
import org.onlab.packet.Ip4Address;
import org.onlab.packet.Ip6Address;
import org.onlab.packet.IpAddress;
import org.onlab.packet.PIM;
import java.nio.ByteBuffer;
import static org.onlab.packet.PacketUtils.checkInput;
public class PIMAddrUnicast {
private byte family;
private byte encType;
IpAddress addr;
public static final int ENC_UNICAST_IPV4_BYTE_LENGTH = 2 + Ip4Address.BYTE_LENGTH;
public static final int ENC_UNICAST_IPV6_BYTE_LENGTH = 2 + Ip6Address.BYTE_LENGTH;
/**
* PIM Encoded Source Address.
*/
public PIMAddrUnicast() {
this.family = PIM.ADDRESS_FAMILY_IP4;
this.encType = 0;
}
/**
* PIM Encoded Source Address.
*
* @param addr IPv4 or IPv6
*/
public PIMAddrUnicast(String addr) {
this.addr = IpAddress.valueOf(addr);
if (this.addr.isIp4()) {
this.family = PIM.ADDRESS_FAMILY_IP4;
} else {
this.family = PIM.ADDRESS_FAMILY_IP6;
}
this.encType = 0;
}
/**
* PIM Encoded Source Address.
*
* @param addr IPv4 or IPv6
*/
public void setAddr(IpAddress addr) {
this.addr = addr;
if (this.addr.isIp4()) {
this.family = PIM.ADDRESS_FAMILY_IP4;
} else {
this.family = PIM.ADDRESS_FAMILY_IP6;
}
}
/**
* Get the address of this encoded address.
*
* @return source address
*/
public IpAddress getAddr() {
return this.addr;
}
/**
* Get the IP family of this address: 4 or 6.
*
* @return the IP address family
*/
public int getFamily() {
return this.family;
}
/**
* The size in bytes of a serialized address.
*
* @return the number of bytes when serialized
*/
public int getByteSize() {
int size = 2;
if (addr != null) {
size += addr.isIp4() ? 4 : 16;
} else {
size += 4;
}
return size;
}
public byte[] serialize() {
int len = getByteSize();
final byte[] data = new byte[len];
final ByteBuffer bb = ByteBuffer.wrap(data);
bb.put(family);
bb.put(encType);
bb.put(addr.toOctets());
return data;
}
public PIMAddrUnicast deserialize(ByteBuffer bb) throws DeserializationException {
// Assume IPv4 for check length until we read the encoded family.
checkInput(bb.array(), bb.position(), bb.limit() - bb.position(), ENC_UNICAST_IPV4_BYTE_LENGTH);
this.family = bb.get();
// If we have IPv6 we need to ensure we have adequate buffer space.
if (this.family != PIM.ADDRESS_FAMILY_IP4 && this.family != PIM.ADDRESS_FAMILY_IP6) {
throw new DeserializationException("Invalid address family: " + this.family);
} else if (this.family == PIM.ADDRESS_FAMILY_IP6) {
// Subtract -1 from ENC_UNICAST_IPv6 BYTE_LENGTH because we read one byte for family previously.
checkInput(bb.array(), bb.position(), bb.limit() - bb.position(), ENC_UNICAST_IPV6_BYTE_LENGTH - 1);
}
this.encType = bb.get();
if (this.family == PIM.ADDRESS_FAMILY_IP4) {
this.addr = IpAddress.valueOf(bb.getInt());
} else if (this.family == PIM.ADDRESS_FAMILY_IP6) {
this.addr = Ip6Address.valueOf(bb.array(), 2);
}
return this;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public int hashCode() {
final int prime = 2521;
int result = super.hashCode();
result = prime * result + this.family;
result = prime * result + this.encType;
result = prime * result + this.addr.hashCode();
return result;
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#hashCode()
*/
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof PIMAddrUnicast)) {
return false;
}
final PIMAddrUnicast other = (PIMAddrUnicast) obj;
if (this.family != other.family) {
return false;
}
if (this.encType != other.encType) {
return false;
}
if (!this.addr.equals(other.addr)) {
return false;
}
return true;
}
}
| {
"content_hash": "7de6d02737a88967c913e8954d7a476a",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 112,
"avg_line_length": 26.46783625730994,
"alnum_prop": 0.5653999116217411,
"repo_name": "osinstom/onos",
"id": "e8d9a2d98137eb73f5b1928daca4d307078fe4b3",
"size": "5143",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "utils/misc/src/main/java/org/onlab/packet/pim/PIMAddrUnicast.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "233181"
},
{
"name": "HTML",
"bytes": "119665"
},
{
"name": "Java",
"bytes": "38529527"
},
{
"name": "JavaScript",
"bytes": "3930281"
},
{
"name": "Makefile",
"bytes": "1058"
},
{
"name": "P4",
"bytes": "78664"
},
{
"name": "Python",
"bytes": "227209"
},
{
"name": "Shell",
"bytes": "4841"
}
],
"symlink_target": ""
} |
@interface RDMLLoadingView ()
@property (strong, nonatomic) UIActivityIndicatorView *spinner;
@end
@implementation RDMLLoadingView
- (id)initWithFrame:(CGRect)frame
{
if (self = [super initWithFrame:frame]) {
self.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
self.backgroundColor = [UIColor whiteColor];
_spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[_spinner startAnimating];
[self addSubview:_spinner];
}
return self;
}
#pragma mark -
#pragma mark - Methods
- (void)startAnimating
{
[self.spinner startAnimating];
}
- (void)stopAnimating
{
[self.spinner stopAnimating];
}
#pragma mark -
#pragma mark UIView
- (void)layoutSubviews
{
[super layoutSubviews];
[self.spinner sizeToFit];
self.spinner.center = self.center;
}
@end
| {
"content_hash": "1db843c3377d24f6fc77905b4565e2fa",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 117,
"avg_line_length": 19.869565217391305,
"alnum_prop": 0.7177242888402626,
"repo_name": "readmill/dropbox-importer-ios",
"id": "67f0997b3b8a36aabbcc89724e0222919f85f936",
"size": "1100",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "RDMLDropboxImporter/UI/RDMLLoadingView.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1957"
},
{
"name": "Objective-C",
"bytes": "151261"
},
{
"name": "Ruby",
"bytes": "825"
}
],
"symlink_target": ""
} |
SELECT * FROM (SELECT *
FROM (
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t13_1m" qview1,
"public"."t14_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t14_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t14_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t14_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t14_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t13_1m" qview1,
"public"."t11_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t11_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t11_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t11_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t11_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t13_1m" qview1,
"public"."t8_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t8_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t8_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t8_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t8_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t13_1m" qview1,
"public"."t5_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t5_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t5_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t5_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t5_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t13_1m" qview1,
"public"."t2_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t2_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t2_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t2_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."string4", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t13_1m" qview1,
"public"."t2_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."string4" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t10_1m" qview1,
"public"."t14_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t14_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t14_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t14_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t14_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t10_1m" qview1,
"public"."t11_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t11_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t11_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t11_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t11_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t10_1m" qview1,
"public"."t8_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t8_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t8_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t8_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t8_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t10_1m" qview1,
"public"."t5_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t5_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t5_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t5_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t5_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t10_1m" qview1,
"public"."t2_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t2_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t2_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t2_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t10_1m" qview1,
"public"."t2_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t7_1m" qview1,
"public"."t14_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t14_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t14_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t14_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t14_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t7_1m" qview1,
"public"."t11_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t11_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t11_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t11_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t11_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t7_1m" qview1,
"public"."t8_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t8_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t8_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t8_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t8_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t7_1m" qview1,
"public"."t5_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t5_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t5_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t5_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t5_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t7_1m" qview1,
"public"."t2_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t2_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t2_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t2_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t7_1m" qview1,
"public"."t2_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t4_1m" qview1,
"public"."t14_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t14_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t14_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t14_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t14_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t4_1m" qview1,
"public"."t11_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t11_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t11_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t11_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t11_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t4_1m" qview1,
"public"."t8_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t8_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t8_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t8_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t8_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t4_1m" qview1,
"public"."t5_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t5_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t5_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t5_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t5_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t4_1m" qview1,
"public"."t2_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t2_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t2_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t2_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t4_1m" qview1,
"public"."t2_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t1_1m" qview1,
"public"."t14_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t14_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t14_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t14_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."string4", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t14_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
qview2."string4" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t1_1m" qview1,
"public"."t11_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t11_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t11_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t11_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t11_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t1_1m" qview1,
"public"."t8_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t8_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t8_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t8_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t8_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t1_1m" qview1,
"public"."t5_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t5_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t5_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t5_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t5_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."string4"
FROM
"public"."t1_1m" qview1,
"public"."t2_1m" qview2,
"public"."t15_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu1" IS NOT NULL AND
qview3."string4" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t2_1m" qview2,
"public"."t12_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t2_1m" qview2,
"public"."t9_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t2_1m" qview2,
"public"."t6_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
UNION
SELECT qview1."unique2", qview1."evenonepercent", qview1."stringu1", qview1."stringu2", qview2."evenonepercent", qview2."stringu1", qview2."stringu2", qview3."evenonepercent", qview3."stringu1", qview3."stringu2"
FROM
"public"."t1_1m" qview1,
"public"."t2_1m" qview2,
"public"."t3_1m" qview3
WHERE
((qview1."onepercent" >= 0) AND (qview1."onepercent" < 20)) AND
qview1."evenonepercent" IS NOT NULL AND
qview1."stringu2" IS NOT NULL AND
qview1."stringu1" IS NOT NULL AND
qview1."unique2" IS NOT NULL AND
(qview1."unique2" = qview2."unique2") AND
((qview2."onepercent" >= 5) AND (qview2."onepercent" < 25)) AND
qview2."evenonepercent" IS NOT NULL AND
qview2."stringu2" IS NOT NULL AND
qview2."stringu1" IS NOT NULL AND
(qview1."unique2" = qview3."unique2") AND
((qview3."onepercent" >= 5) AND (qview3."onepercent" < 25)) AND
qview3."evenonepercent" IS NOT NULL AND
qview3."stringu2" IS NOT NULL AND
qview3."stringu1" IS NOT NULL
) SUB_QVIEW
) f_1
| {
"content_hash": "6cd0f4fe0e907e70b57d4a5b242ea708",
"timestamp": "",
"source": "github",
"line_count": 2754,
"max_line_length": 212,
"avg_line_length": 42.36347131445171,
"alnum_prop": 0.728771138862937,
"repo_name": "ontop/ontop-examples",
"id": "e823a41dc49f89e4547c43034d8784b87d422c1f",
"size": "116669",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "iswc-2017-cost/wisconsin-experiment/3-atoms/sql/ucq-unfoldings/ucq-56.sql",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AMPL",
"bytes": "45155"
},
{
"name": "C",
"bytes": "36579"
},
{
"name": "C++",
"bytes": "33985"
},
{
"name": "CSS",
"bytes": "19257"
},
{
"name": "Dockerfile",
"bytes": "3259"
},
{
"name": "HTML",
"bytes": "3413161"
},
{
"name": "HiveQL",
"bytes": "45997"
},
{
"name": "Java",
"bytes": "31232"
},
{
"name": "JavaScript",
"bytes": "26337"
},
{
"name": "Makefile",
"bytes": "2017"
},
{
"name": "PHP",
"bytes": "8056"
},
{
"name": "PLpgSQL",
"bytes": "540592"
},
{
"name": "Python",
"bytes": "5272"
},
{
"name": "R",
"bytes": "722"
},
{
"name": "Roff",
"bytes": "61"
},
{
"name": "Scala",
"bytes": "348559"
},
{
"name": "Shell",
"bytes": "7064"
},
{
"name": "TeX",
"bytes": "229961"
},
{
"name": "q",
"bytes": "362407"
}
],
"symlink_target": ""
} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>basic_stream_socket::wait (2 of 2 overloads)</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="../../../../boost_asio.html" title="Boost.Asio">
<link rel="up" href="../wait.html" title="basic_stream_socket::wait">
<link rel="prev" href="overload1.html" title="basic_stream_socket::wait (1 of 2 overloads)">
<link rel="next" href="../wait_type.html" title="basic_stream_socket::wait_type">
</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="overload1.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../wait.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../wait_type.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="boost_asio.reference.basic_stream_socket.wait.overload2"></a><a class="link" href="overload2.html" title="basic_stream_socket::wait (2 of 2 overloads)">basic_stream_socket::wait
(2 of 2 overloads)</a>
</h5></div></div></div>
<p>
<span class="emphasis"><em>Inherited from basic_socket.</em></span>
</p>
<p>
Wait for the socket to become ready to read, ready to write, or to have
pending error conditions.
</p>
<pre class="programlisting">void wait(
wait_type w,
boost::system::error_code & ec);
</pre>
<p>
This function is used to perform a blocking wait for a socket to enter
a ready to read, write or error condition state.
</p>
<h6>
<a name="boost_asio.reference.basic_stream_socket.wait.overload2.h0"></a>
<span class="phrase"><a name="boost_asio.reference.basic_stream_socket.wait.overload2.parameters"></a></span><a class="link" href="overload2.html#boost_asio.reference.basic_stream_socket.wait.overload2.parameters">Parameters</a>
</h6>
<div class="variablelist">
<p class="title"><b></b></p>
<dl class="variablelist">
<dt><span class="term">w</span></dt>
<dd><p>
Specifies the desired socket state.
</p></dd>
<dt><span class="term">ec</span></dt>
<dd><p>
Set to indicate what error occurred, if any.
</p></dd>
</dl>
</div>
<h6>
<a name="boost_asio.reference.basic_stream_socket.wait.overload2.h1"></a>
<span class="phrase"><a name="boost_asio.reference.basic_stream_socket.wait.overload2.example"></a></span><a class="link" href="overload2.html#boost_asio.reference.basic_stream_socket.wait.overload2.example">Example</a>
</h6>
<p>
Waiting for a socket to become readable.
</p>
<pre class="programlisting">boost::asio::ip::tcp::socket socket(io_context);
...
boost::system::error_code ec;
socket.wait(boost::asio::ip::tcp::socket::wait_read, ec);
</pre>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2003-2018 Christopher M. Kohlhoff<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="overload1.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../wait.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../wait_type.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| {
"content_hash": "abc47204b6748f7aa56e77a3993710a5",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 438,
"avg_line_length": 54.72727272727273,
"alnum_prop": 0.6148255813953488,
"repo_name": "alexhenrie/poedit",
"id": "7b0afcf61bd6e0d97756607e97516d7894914a90",
"size": "4816",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "deps/boost/doc/html/boost_asio/reference/basic_stream_socket/wait/overload2.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "48113"
},
{
"name": "C++",
"bytes": "1285031"
},
{
"name": "Inno Setup",
"bytes": "11180"
},
{
"name": "M4",
"bytes": "103958"
},
{
"name": "Makefile",
"bytes": "9507"
},
{
"name": "Objective-C",
"bytes": "16519"
},
{
"name": "Objective-C++",
"bytes": "14681"
},
{
"name": "Python",
"bytes": "6594"
},
{
"name": "Ruby",
"bytes": "292"
},
{
"name": "Shell",
"bytes": "11982"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Les informations générales relatives à un assembly dépendent de
// l'ensemble d'attributs suivant. Pour modifier les informations
// associées à un assembly, changez les valeurs de ces attributs.
[assembly: AssemblyTitle("MyAirport.Service")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MyAirport.Service")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
// COM, affectez la valeur true à l'attribut ComVisible sur ce type.
[assembly: ComVisible(false)]
// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
[assembly: Guid("3f6ccafe-d806-4f2f-82a1-77d51ae9b112")]
// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
//
// Version principale
// Version secondaire
// Numéro de build
// Révision
//
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
// en utilisant '*', comme ci-dessous :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"content_hash": "d48faba9aa8890536f8271746521adae",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 103,
"avg_line_length": 41.638888888888886,
"alnum_prop": 0.7498332221480988,
"repo_name": "dorianb/tri_bagage",
"id": "a544ea449058b1eb5444cb31bf09ae3628345fa0",
"size": "1521",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MyAirport/MyAirport.Service/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "207737"
}
],
"symlink_target": ""
} |
package org.apache.lucene.analysis.pt;
import java.io.Reader;
import java.io.StringReader;
import org.apache.lucene.analysis.BaseTokenStreamTestCase;
import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.analysis.TokenStream;
/**
* Simple tests to ensure the Portuguese stem factory is working.
*/
public class TestPortugueseStemFilterFactory extends BaseTokenStreamTestCase {
public void testStemming() throws Exception {
Reader reader = new StringReader("maluquice");
PortugueseStemFilterFactory factory = new PortugueseStemFilterFactory();
TokenStream stream = factory.create(new MockTokenizer(reader, MockTokenizer.WHITESPACE, false));
assertTokenStreamContents(stream, new String[] { "maluc" });
}
}
| {
"content_hash": "9e0f228d945710ebd01ed55372523e41",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 100,
"avg_line_length": 34.18181818181818,
"alnum_prop": 0.7898936170212766,
"repo_name": "pkarmstr/NYBC",
"id": "6d3fa44181eb7a4c9b120e4694f189f8b78be75a",
"size": "1553",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "solr-4.2.1/lucene/analysis/common/src/test/org/apache/lucene/analysis/pt/TestPortugueseStemFilterFactory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "13377"
},
{
"name": "CSS",
"bytes": "198209"
},
{
"name": "Gnuplot",
"bytes": "2444"
},
{
"name": "Java",
"bytes": "33441829"
},
{
"name": "JavaScript",
"bytes": "1153858"
},
{
"name": "Perl",
"bytes": "82981"
},
{
"name": "Python",
"bytes": "209653"
},
{
"name": "Shell",
"bytes": "77601"
},
{
"name": "XSLT",
"bytes": "76094"
}
],
"symlink_target": ""
} |
using System;
using JetBrains.Annotations;
using Microsoft.Extensions.DependencyInjection;
namespace CoreMessageBus.Internal
{
public class MessageHandlerFactory : IMessageHandlerFactory
{
private readonly IServiceProvider _serviceProvider;
public MessageHandlerFactory([NotNull] IServiceProvider serviceProvider)
{
if (serviceProvider == null) throw new ArgumentNullException(nameof(serviceProvider));
_serviceProvider = serviceProvider;
}
public IMessageHandler<TMessage> Create<TMessage>(Type handlerType)
{
var instance = ActivatorUtilities.CreateInstance(_serviceProvider, handlerType);
return instance as IMessageHandler<TMessage>;
}
}
} | {
"content_hash": "5d48652efffd599678d0b709c1f7d91d",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 98,
"avg_line_length": 33.130434782608695,
"alnum_prop": 0.7112860892388452,
"repo_name": "Grinderofl/CoreMessageBus",
"id": "84fee4a453dd2ce85b9a119064de10bb65cef326",
"size": "762",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/CoreMessageBus/Internal/MessageHandlerFactory.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "247"
},
{
"name": "C#",
"bytes": "90607"
},
{
"name": "PowerShell",
"bytes": "1804"
}
],
"symlink_target": ""
} |
import { isInteractive } from "../../common/helpers";
import { IErrors, Server, ICredentials } from "../../common/declarations";
import { injector } from "../../common/yok";
import {
IAppleCreateUserSessionOptions,
IApplePortalUserDetail,
IApplePortalCookieService,
IAppleLoginResult,
IApplePortalSessionService,
} from "./definitions";
export class ApplePortalSessionService implements IApplePortalSessionService {
private loginConfigEndpoint =
"https://appstoreconnect.apple.com/olympus/v1/app/config?hostname=itunesconnect.apple.com";
private defaultLoginConfig = {
authServiceUrl: "https://idmsa.apple.com/appleautcodh",
authServiceKey:
"e0b80c3bf78523bfe80974d320935bfa30add02e1bff88ec2166c6bd5a706c42",
};
constructor(
private $applePortalCookieService: IApplePortalCookieService,
private $errors: IErrors,
private $httpClient: Server.IHttpClient,
private $logger: ILogger,
private $prompter: IPrompter
) {}
public async createUserSession(
credentials: ICredentials,
opts?: IAppleCreateUserSessionOptions
): Promise<IApplePortalUserDetail> {
const loginResult = await this.login(credentials, opts);
if (!opts || !opts.sessionBase64) {
if (loginResult.isTwoFactorAuthenticationEnabled) {
const authServiceKey = (await this.getLoginConfig()).authServiceKey;
await this.handleTwoFactorAuthentication(
loginResult.scnt,
loginResult.xAppleIdSessionId,
authServiceKey
);
}
const sessionResponse = await this.$httpClient.httpRequest({
url: "https://appstoreconnect.apple.com/olympus/v1/session",
method: "GET",
headers: {
Cookie: this.$applePortalCookieService.getUserSessionCookie(),
},
});
this.$applePortalCookieService.updateUserSessionCookie(
sessionResponse.headers["set-cookie"]
);
}
const userDetailsResponse = await this.$httpClient.httpRequest({
url:
"https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/ra/user/detail",
method: "GET",
headers: {
"Content-Type": "application/json",
Cookie: this.$applePortalCookieService.getUserSessionCookie(),
},
});
this.$applePortalCookieService.updateUserSessionCookie(
userDetailsResponse.headers["set-cookie"]
);
const userdDetails = JSON.parse(userDetailsResponse.body).data;
const result = {
...userdDetails,
...loginResult,
userSessionCookie: this.$applePortalCookieService.getUserSessionCookie(),
};
return result;
}
public async createWebSession(contentProviderId: number): Promise<string> {
const webSessionResponse = await this.$httpClient.httpRequest({
url: "https://appstoreconnect.apple.com/olympus/v1/session",
method: "POST",
body: {
provider: {
providerId: contentProviderId,
},
},
headers: {
Accept: "application/json, text/plain, */*",
"Accept-Encoding": "gzip, deflate, br",
"X-Csrf-Itc": "itc",
"Content-Type": "application/json;charset=UTF-8",
"X-Requested-With": "olympus-ui",
Cookie: this.$applePortalCookieService.getUserSessionCookie(),
},
});
const webSessionCookie = this.$applePortalCookieService.getWebSessionCookie(
webSessionResponse.headers["set-cookie"]
);
return webSessionCookie;
}
private async login(
credentials: ICredentials,
opts?: IAppleCreateUserSessionOptions
): Promise<IAppleLoginResult> {
const result = {
scnt: <string>null,
xAppleIdSessionId: <string>null,
isTwoFactorAuthenticationEnabled: false,
areCredentialsValid: true,
};
if (opts && opts.sessionBase64) {
const decodedSession = Buffer.from(opts.sessionBase64, "base64").toString(
"utf8"
);
this.$applePortalCookieService.updateUserSessionCookie([decodedSession]);
result.isTwoFactorAuthenticationEnabled =
decodedSession.indexOf("DES") > -1;
} else {
try {
await this.loginCore(credentials);
} catch (err) {
const statusCode = err && err.response && err.response.status;
result.areCredentialsValid = statusCode !== 401 && statusCode !== 403;
result.isTwoFactorAuthenticationEnabled = statusCode === 409;
if (
result.isTwoFactorAuthenticationEnabled &&
opts &&
opts.requireApplicationSpecificPassword &&
!opts.applicationSpecificPassword
) {
this.$errors
.fail(`Your account has two-factor authentication enabled but --appleApplicationSpecificPassword option is not provided.
To generate an application-specific password, please go to https://appleid.apple.com/account/manage.
This password will be used for the iTunes Transporter, which is used to upload your application.`);
}
if (
result.isTwoFactorAuthenticationEnabled &&
opts &&
opts.requireInteractiveConsole &&
!isInteractive()
) {
this.$errors
.fail(`Your account has two-factor authentication enabled, but your console is not interactive.
For more details how to set up your environment, please execute "tns publish ios --help".`);
}
const headers = (err && err.response && err.response.headers) || {};
result.scnt = headers.scnt;
result.xAppleIdSessionId = headers["x-apple-id-session-id"];
}
}
return result;
}
private async loginCore(credentials: ICredentials): Promise<void> {
const loginConfig = await this.getLoginConfig();
const loginUrl = `${loginConfig.authServiceUrl}/auth/signin`;
const headers = {
"Content-Type": "application/json",
"X-Requested-With": "XMLHttpRequest",
"X-Apple-Widget-Key": loginConfig.authServiceKey,
Accept: "application/json, text/javascript",
};
const body = {
accountName: credentials.username,
password: credentials.password,
rememberMe: true,
};
const loginResponse = await this.$httpClient.httpRequest({
url: loginUrl,
method: "POST",
body,
headers,
});
this.$applePortalCookieService.updateUserSessionCookie(
loginResponse.headers["set-cookie"]
);
}
private async getLoginConfig(): Promise<{
authServiceUrl: string;
authServiceKey: string;
}> {
let config = null;
try {
const response = await this.$httpClient.httpRequest({
url: this.loginConfigEndpoint,
method: "GET",
});
config = JSON.parse(response.body);
} catch (err) {
this.$logger.trace(
`Error while executing request to ${this.loginConfigEndpoint}. More info: ${err}`
);
}
return config || this.defaultLoginConfig;
}
private async handleTwoFactorAuthentication(
scnt: string,
xAppleIdSessionId: string,
authServiceKey: string
): Promise<void> {
const headers = {
scnt: scnt,
"X-Apple-Id-Session-Id": xAppleIdSessionId,
"X-Apple-Widget-Key": authServiceKey,
Accept: "application/json",
};
const authResponse = await this.$httpClient.httpRequest({
url: "https://idmsa.apple.com/appleauth/auth",
method: "GET",
headers,
});
const data = JSON.parse(authResponse.body);
if (data.trustedPhoneNumbers && data.trustedPhoneNumbers.length) {
const parsedAuthResponse = JSON.parse(authResponse.body);
const token = await this.$prompter.getString(
`Please enter the ${parsedAuthResponse.securityCode.length} digit code`,
{ allowEmpty: false }
);
await this.$httpClient.httpRequest({
url: `https://idmsa.apple.com/appleauth/auth/verify/trusteddevice/securitycode`,
method: "POST",
body: {
securityCode: {
code: token.toString(),
},
},
headers: { ...headers, "Content-Type": "application/json" },
});
const authTrustResponse = await this.$httpClient.httpRequest({
url: "https://idmsa.apple.com/appleauth/auth/2sv/trust",
method: "GET",
headers,
});
this.$applePortalCookieService.updateUserSessionCookie(
authTrustResponse.headers["set-cookie"]
);
} else {
this.$errors.fail(
`Although response from Apple indicated activated Two-step Verification or Two-factor Authentication, NativeScript CLI don't know how to handle this response: ${data}`
);
}
}
}
injector.register("applePortalSessionService", ApplePortalSessionService);
| {
"content_hash": "d7ef50bf9a4bc8cfd06eef2caece9ce9",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 171,
"avg_line_length": 29.932835820895523,
"alnum_prop": 0.712291199202194,
"repo_name": "NativeScript/nativescript-cli",
"id": "b3767410492039b587a165bb15a71d05183cc7e7",
"size": "8022",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "lib/services/apple-portal/apple-portal-session-service.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "344"
},
{
"name": "CSS",
"bytes": "9452"
},
{
"name": "HTML",
"bytes": "973"
},
{
"name": "JavaScript",
"bytes": "8292551"
},
{
"name": "Shell",
"bytes": "305"
},
{
"name": "TypeScript",
"bytes": "3073210"
}
],
"symlink_target": ""
} |
package query;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.crypto.SealedObject;
import org.springframework.stereotype.Service;
import io.netty.util.internal.PriorityQueue;
@Service
public class QueryService {
private QueryDAO queryDao = new QueryDAO();
private String[] keywords;
private List<QueryItem> items = new ArrayList<QueryItem>();
List<String> allKeys = new ArrayList<String>();
InvertedItem[] firstItems;
InvertedItem[] secondItems;
List<String> firstkey = new ArrayList<String>();
private boolean firstKey;
public List<QueryItem> getQueryReslt(String keyword) {
firstKey = true;
if (!items.isEmpty()) {
items.clear();
}
keywords = keyword.split(" ");
for (String key : keywords) {
getInvertedItem(key);
}
Arrays.sort(firstItems, new Comparator<InvertedItem>() {
@Override
public int compare(InvertedItem it1, InvertedItem it2) {
return (int) (it2.getFreque() - it1.getFreque());
}
});
fillItems();
highlight();
return items;
}
private void fillItems() {
if (firstItems == null || firstItems.length == 0) {
items.clear();
return;
}
for (InvertedItem doc : firstItems) {
String docID = String.valueOf(doc.getDocID());
String docContent = queryDao.getDocContent(docID);
String docUrl = queryDao.getDocURL(docID);
items.add(new QueryItem(docContent.substring(0, docContent.indexOf("\n") + 1), docContent, docUrl));
}
}
private void getInvertedItem(String keyword) {
List<String> keys = queryDao.getDocs(keyword);
if (firstKey) {
fillClass(keys);
firstKey = false;
} else {
compareItem(keys);
}
}
private void compareItem(List<String> keys) {
secondItems = new InvertedItem[keys.size()];
for (int i = 0; i < keys.size(); i++) {
secondItems[i] = new InvertedItem(keys.get(i));
}
Sort.heapsort(secondItems);
int i = 0, j = 0;
List<InvertedItem> tmp = new ArrayList<>();
while (i < firstItems.length && j < secondItems.length) {
if (firstItems[i].compareTo(secondItems[j]) > 0)
j++;
else if (firstItems[i].compareTo(secondItems[j]) < 0)
i++;
else {
tmp.add(new InvertedItem(firstItems[i].getDocID(),
firstItems[i].getFreque() + secondItems[j].getFreque(), firstItems[i].getPosition()));
j++;
i++;
}
}
firstItems = new InvertedItem[tmp.size()];
for (int t = 0; t < tmp.size(); t++) {
firstItems[t] = tmp.get(t);
}
}
private void fillClass(List<String> keys) {
firstItems = new InvertedItem[keys.size()];
for (int i = 0; i < keys.size(); i++) {
firstItems[i] = new InvertedItem(keys.get(i));
}
Sort.heapsort(firstItems);
}
private void fillItems(List<String> docs, String keyword) {
if (docs == null || docs.isEmpty()) {
items.clear();
return;
}
for (String doc : docs) {
String[] tmp = doc.split(":");
String docID = tmp[0];
String docContent = queryDao.getDocContent(docID);
String docUrl = queryDao.getDocURL(docID);
items.add(new QueryItem(docContent.substring(1, 50), docContent, docUrl));
}
}
private void fillItems(String[] arrayKeys) {
if (arrayKeys == null || arrayKeys.length == 0) {
items.clear();
return;
}
unique(arrayKeys);
for (String doc : arrayKeys) {
String[] tmp = doc.split(":");
String docID = tmp[0];
String docContent = queryDao.getDocContent(docID);
String docUrl = queryDao.getDocURL(docID);
items.add(new QueryItem(docContent.substring(1, 50), docContent, docUrl));
}
}
private void unique(String[] arrayKeys) {
ArrayList<String> docIDs = new ArrayList<String>();
for (String key : arrayKeys) {
String[] keys = key.split(":");
String docID = keys[0];
if (!docIDs.contains(docID)) {
docIDs.add(docID);
}
}
}
private void highlight() {
for (QueryItem it : items) {
String docContent = it.getSummary();
for (String k : keywords) {
docContent = replaceKeyWord(docContent, k);
}
it.setSummary(docContent);
}
}
private String extractSentence(String p, String key) {
String s = "...";
String pattern = "(\\s\\b\\w*\\b\\s){0,20}(?i)(" + key + ")(\\s\\b\\w*\\b\\s){0,20}";
Pattern r = Pattern.compile(pattern);
Matcher m = r.matcher(p);
while (m.find()) {
s = s + m.group(0);
}
s = s.replaceAll("(?i)\\b" + key + "\\b", "<span class=\"highlight\">" + key + "</span>");
return s.concat("...");
}
private String replaceKeyWord(String p, String key) {
String s = p.replaceAll("(?i)\\b" + key + "\\b", "<span class=\"highlight\">" + key + "</span>");
return s.concat("...");
}
}
| {
"content_hash": "e7fd5c5215bc99bf455a75840c4fb381",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 103,
"avg_line_length": 25.597826086956523,
"alnum_prop": 0.6464968152866242,
"repo_name": "brucelau-github/searchingEngine",
"id": "a91979a41f8b4285b7b749f8ccff2e1685ec7e25",
"size": "5377",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/query/QueryService.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "497"
},
{
"name": "HTML",
"bytes": "52217"
},
{
"name": "Java",
"bytes": "96754"
},
{
"name": "JavaScript",
"bytes": "1184"
}
],
"symlink_target": ""
} |
require 'spec_helper'
describe 'cms_agents_addons_file', type: :feature, dbscope: :example, js: true do
let(:site){ cms_site }
let!(:node) { create :article_node_page, cur_site: site }
let(:filename) { "#{unique_id}.png" }
before do
login_cms_user
end
shared_examples "file dialog is" do
context "click" do
it do
within "#ajax-box" do
expect(page).to have_css('.file-view', text: filename)
wait_cbox_close do
wait_event_to_fire "ss:ajaxFileSelected", "#addon-cms-agents-addons-thumb .ajax-box" do
click_on filename
end
end
end
within "#item-form #addon-cms-agents-addons-thumb" do
expect(page).to have_css('.ss-file-field .humanized-name', text: file.humanized_name)
end
end
end
context "edit" do
it do
within "#ajax-box" do
within ".file-view[data-file-id='#{file.id}']" do
expect(page).to have_css(".name", text: filename)
click_on I18n.t("ss.buttons.edit")
end
end
within "#ajax-box" do
expect(page).to have_css(".ss-image-edit-canvas")
end
end
end
context "delete" do
it do
within "#ajax-box" do
within ".file-view[data-file-id='#{file.id}']" do
expect(page).to have_css(".name", text: filename)
wait_event_to_fire "ss:ajaxRemoved", "#addon-cms-agents-addons-thumb .ajax-box" do
page.accept_confirm do
click_on I18n.t("ss.buttons.delete")
end
end
end
end
expect { file.reload }.to raise_error Mongoid::Errors::DocumentNotFound
end
end
context "save and click" do
it do
within "#ajax-box" do
attach_file "item[in_files][]", "#{Rails.root}/spec/fixtures/ss/file/keyvisual.jpg"
click_button I18n.t("ss.buttons.save")
expect(page).to have_css('.file-view', text: 'keyvisual.jpg')
wait_cbox_close do
wait_event_to_fire "ss:ajaxFileSelected", "#addon-cms-agents-addons-thumb .ajax-box" do
click_on 'keyvisual.jpg'
end
end
end
added_file = SS::File.all.where(name: 'keyvisual.jpg').first
within "#item-form #addon-cms-agents-addons-thumb" do
# expect(page).to have_css('.name', text: 'keyvisual.jpg')
expect(page).to have_css('.ss-file-field .humanized-name', text: added_file.humanized_name)
end
end
end
context "attach" do
it do
within "#ajax-box" do
attach_file "item[in_files][]", "#{Rails.root}/spec/fixtures/ss/file/keyvisual.jpg"
wait_cbox_close do
wait_event_to_fire "ss:ajaxFileSelected", "#addon-cms-agents-addons-thumb .ajax-box" do
click_button I18n.t("ss.buttons.attach")
end
end
end
added_file = SS::File.all.where(name: 'keyvisual.jpg').first
within "#item-form #addon-cms-agents-addons-thumb" do
# expect(page).to have_css('.name', text: 'keyvisual.jpg')
expect(page).to have_css('.ss-file-field .humanized-name', text: added_file.humanized_name)
end
end
end
end
shared_examples "several operations on file dialog" do
before do
visit article_pages_path(site: site, cid: node)
click_on I18n.t("ss.links.new")
within "#item-form #addon-cms-agents-addons-thumb" do
click_button "▼"
within ".dropdown-menu" do
wait_cbox_open do
click_on menu_label
end
end
end
within "#ajax-box" do
page.execute_script("SS_AjaxFile.firesEvents = true;")
end
end
context "default" do
it_behaves_like "file dialog is"
end
context "after file is saved" do
before do
within "#ajax-box" do
attach_file "item[in_files][]", "#{Rails.root}/spec/fixtures/ss/logo.png"
click_button I18n.t("ss.buttons.save")
expect(page).to have_css('.file-view', text: 'logo.png')
end
end
it_behaves_like "file dialog is"
end
context "after edit dialog is canceled" do
before do
within "#ajax-box" do
within ".file-view[data-file-id='#{file.id}']" do
expect(page).to have_css(".name", text: filename)
click_on I18n.t("ss.buttons.edit")
end
end
within "#ajax-box" do
expect(page).to have_css(".ss-image-edit-canvas")
within "#ajax-form" do
click_on I18n.t("ss.buttons.cancel")
end
end
end
it_behaves_like "file dialog is"
end
context "after edit dialog is saved" do
before do
within "#ajax-box" do
within ".file-view[data-file-id='#{file.id}']" do
expect(page).to have_css(".name", text: filename)
click_on I18n.t("ss.buttons.edit")
end
end
within "#ajax-box" do
expect(page).to have_css(".ss-image-edit-canvas")
within "#ajax-form" do
click_on I18n.t("ss.buttons.save")
end
end
end
it_behaves_like "file dialog is"
end
end
context "with cms/temp_file" do
let!(:file) do
tmp_ss_file(
Cms::TempFile, user: cms_user, site: site, node: node, basename: filename,
contents: "#{Rails.root}/spec/fixtures/ss/logo.png"
)
end
let(:menu_label) { I18n.t("ss.buttons.upload") }
it_behaves_like "several operations on file dialog"
end
context "with ss/user_file" do
let!(:file) do
tmp_ss_file(
SS::UserFile, model: "ss/user_file", user: cms_user, basename: filename,
contents: "#{Rails.root}/spec/fixtures/ss/logo.png"
)
end
let(:menu_label) { I18n.t("sns.user_file") }
it_behaves_like "several operations on file dialog"
end
context "with cms/file" do
let!(:file) do
tmp_ss_file(
Cms::File, model: "cms/file", user: cms_user, site: site, basename: filename,
contents: "#{Rails.root}/spec/fixtures/ss/logo.png"
)
end
let(:menu_label) { I18n.t("cms.file") }
it_behaves_like "several operations on file dialog"
end
end
| {
"content_hash": "91839a81fae3a8b867c7106dbe2af76e",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 101,
"avg_line_length": 29.506976744186048,
"alnum_prop": 0.5673076923076923,
"repo_name": "sunny4381/shirasagi",
"id": "a307fa5cc5133e54bb76af36af2fd59fa9115c8e",
"size": "6346",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "spec/features/cms/agents/addons/thumb/upload_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "82226"
},
{
"name": "HTML",
"bytes": "3233606"
},
{
"name": "JavaScript",
"bytes": "11964854"
},
{
"name": "Ruby",
"bytes": "12347543"
},
{
"name": "SCSS",
"bytes": "525875"
},
{
"name": "Shell",
"bytes": "20130"
}
],
"symlink_target": ""
} |
export declare class Logger {
private readonly level;
constructor(level: number);
error(...msg: string[]): void;
info(...msg: string[]): void;
debug(...msg: string[]): void;
}
export declare const logger: Logger;
| {
"content_hash": "241eac8a5dd9e0e48e5c6761540cf04f",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 36,
"avg_line_length": 29.125,
"alnum_prop": 0.6394849785407726,
"repo_name": "cloudfoundry-community/asp.net5-buildpack",
"id": "c9528c62ff409831f6cd014c326482b2eccf176c",
"size": "233",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "fixtures/node_apps/angular_dotnet/ClientApp/node_modules/codelyzer/util/logger.d.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Ruby",
"bytes": "61792"
}
],
"symlink_target": ""
} |
export declare function currencyConfig(formlyConfig: any, $locale: any): void;
| {
"content_hash": "08770d7af7705f21132f308066d6f091",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 78,
"avg_line_length": 79,
"alnum_prop": 0.7974683544303798,
"repo_name": "rhases/angular-formly-templates-rhases",
"id": "ca5c6a92ae4cd4cccc2f0edd20dc9a1e2bef3ad9",
"size": "79",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/src/currency/currency.config.d.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "769"
},
{
"name": "HTML",
"bytes": "7538"
},
{
"name": "JavaScript",
"bytes": "6866"
},
{
"name": "TypeScript",
"bytes": "29383"
}
],
"symlink_target": ""
} |
/*************************************************************************/
/* reflection_probe.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef REFLECTIONPROBE_H
#define REFLECTIONPROBE_H
#include "scene/3d/visual_instance.h"
#include "scene/resources/sky_box.h"
#include "scene/resources/texture.h"
#include "servers/visual_server.h"
class ReflectionProbe : public VisualInstance {
GDCLASS(ReflectionProbe, VisualInstance);
public:
enum UpdateMode {
UPDATE_ONCE,
UPDATE_ALWAYS,
};
private:
RID probe;
float intensity;
float max_distance;
Vector3 extents;
Vector3 origin_offset;
bool box_projection;
bool enable_shadows;
bool interior;
Color interior_ambient;
float interior_ambient_energy;
float interior_ambient_probe_contribution;
uint32_t cull_mask;
UpdateMode update_mode;
protected:
static void _bind_methods();
void _validate_property(PropertyInfo &property) const;
public:
void set_intensity(float p_intensity);
float get_intensity() const;
void set_interior_ambient(Color p_ambient);
Color get_interior_ambient() const;
void set_interior_ambient_energy(float p_energy);
float get_interior_ambient_energy() const;
void set_interior_ambient_probe_contribution(float p_contribution);
float get_interior_ambient_probe_contribution() const;
void set_max_distance(float p_distance);
float get_max_distance() const;
void set_extents(const Vector3 &p_extents);
Vector3 get_extents() const;
void set_origin_offset(const Vector3 &p_extents);
Vector3 get_origin_offset() const;
void set_as_interior(bool p_enable);
bool is_set_as_interior() const;
void set_enable_box_projection(bool p_enable);
bool is_box_projection_enabled() const;
void set_enable_shadows(bool p_enable);
bool are_shadows_enabled() const;
void set_cull_mask(uint32_t p_layers);
uint32_t get_cull_mask() const;
void set_update_mode(UpdateMode p_mode);
UpdateMode get_update_mode() const;
virtual AABB get_aabb() const;
virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
ReflectionProbe();
~ReflectionProbe();
};
VARIANT_ENUM_CAST(ReflectionProbe::UpdateMode);
#endif // REFLECTIONPROBE_H
| {
"content_hash": "71c38dd4afb74aa34ec20ae53ebe7f64",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 75,
"avg_line_length": 36.94736842105263,
"alnum_prop": 0.5949667616334283,
"repo_name": "mcanders/godot",
"id": "13ae1c81f6e81c7205d57d16eafc0b2a2a4ba3cb",
"size": "4212",
"binary": false,
"copies": "20",
"ref": "refs/heads/master",
"path": "scene/3d/reflection_probe.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "50004"
},
{
"name": "C++",
"bytes": "16781438"
},
{
"name": "HTML",
"bytes": "10302"
},
{
"name": "Java",
"bytes": "497034"
},
{
"name": "Makefile",
"bytes": "451"
},
{
"name": "Objective-C",
"bytes": "2644"
},
{
"name": "Objective-C++",
"bytes": "146786"
},
{
"name": "Python",
"bytes": "266116"
},
{
"name": "Shell",
"bytes": "11105"
}
],
"symlink_target": ""
} |
#import "TGImageMessageViewModel.h"
@class TGImageMediaAttachment;
@interface TGPhotoMessageViewModel : TGImageMessageViewModel
- (instancetype)initWithMessage:(TGMessage *)message imageMedia:(TGImageMediaAttachment *)imageMedia author:(TGUser *)author context:(TGModernViewContext *)context;
@end
| {
"content_hash": "0f2b7df642deccd8ce25c42711cb8d9f",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 164,
"avg_line_length": 27.636363636363637,
"alnum_prop": 0.8256578947368421,
"repo_name": "DZamataev/TelegramAppKit",
"id": "155fd7d496e6b7514552e27ead9503708226ee82",
"size": "530",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "Telegram-2.8/Telegraph/Telegraph/TGPhotoMessageViewModel.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "6466296"
},
{
"name": "C++",
"bytes": "459710"
},
{
"name": "Mathematica",
"bytes": "3121"
},
{
"name": "Objective-C",
"bytes": "5824211"
},
{
"name": "Objective-C++",
"bytes": "4427056"
},
{
"name": "Python",
"bytes": "38234"
},
{
"name": "Ruby",
"bytes": "1736"
},
{
"name": "Shell",
"bytes": "29947"
}
],
"symlink_target": ""
} |
package tora.mod.realisticScience;
import tora.mod.realisticScience.machines.PipeBasic;
import tora.mod.realisticScience.ores.OreSmelting;
import tora.mod.realisticScience.tileentities.TileentityPipeBasic;
import net.minecraft.block.Block;
import net.minecraft.block.StepSound;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
@Mod(modid="RealisticScience", name="RealisticScience", version="0.0.0")
@NetworkMod(clientSideRequired=true)
public class RealisticScience {
// The instance of your mod that Forge uses.
@Instance(value = "RealisticScience")
public static RealisticScience instance;
// Says where the client and server 'proxy' code is loaded.
@SidedProxy(clientSide="tora.mod.realisticScience.client.ClientProxy", serverSide="tora.mod.realisticScience.CommonProxy")
public static CommonProxy proxy;
public static OreSmelting oreSmelting;
public static PipeBasic pipeBasic;
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
//====================================//
// Ores - Overworld //
//====================================//
oreSmelting = new OreSmelting(1000);
//====================================//
// Machines - Pipes //
//====================================//
//----- Pipe -----
pipeBasic = new PipeBasic(1001);
//----- PiCharm -----
//----- Pipe on Rails -----
//----- NetBeams -----
}
@EventHandler
public void init(FMLInitializationEvent event) {
GameRegistry.registerTileEntity(RealisticScienceTileentity.class, "realisticScienceTileentity");
GameRegistry.registerTileEntity(TileentityPipeBasic.class, "tileentityPipeBasic");
}
@EventHandler
public void load(FMLInitializationEvent event) {
proxy.registerRenderers();
}
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
}
} | {
"content_hash": "9265bf476f5f5588c4b2cfb8ab7a1a08",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 123,
"avg_line_length": 33.266666666666666,
"alnum_prop": 0.7134268537074149,
"repo_name": "aidatorajiro/MinecraftMod-RealisticScience",
"id": "db20df9e0e40f8fdc9bc0c702dfaf52f3fadce76",
"size": "2495",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/tora/mod/realisticScience/RealisticScience.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "8281"
}
],
"symlink_target": ""
} |
FOUNDATION_EXPORT double SwiftMarkIOSVersionNumber;
//! Project version string for SwiftMarkIOS.
FOUNDATION_EXPORT const unsigned char SwiftMarkIOSVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <SwiftMarkIOS/PublicHeader.h>
| {
"content_hash": "2be3341d417b1b876b98688270fc65fc",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 137,
"avg_line_length": 38.25,
"alnum_prop": 0.8202614379084967,
"repo_name": "l65l/SwiftMark",
"id": "2bdaea828f6024bfc70c61ecd120fe1901808187",
"size": "522",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Xcode/SwiftMarkIOS/SwiftMarkIOS.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1257838"
},
{
"name": "C++",
"bytes": "310538"
},
{
"name": "Objective-C",
"bytes": "1435"
},
{
"name": "Swift",
"bytes": "48409"
}
],
"symlink_target": ""
} |
@interface NSDictionary(BeepAdditions)
- (int)stateForKey:(NSString *)key;
@end
| {
"content_hash": "71bf3ce058e5a8ed0232e8002d968fd9",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 38,
"avg_line_length": 16.4,
"alnum_prop": 0.7560975609756098,
"repo_name": "nkhorman/archive-growl",
"id": "0c3972eccf03fbc5476ab90f8d7c06847fd5bdfa",
"size": "195",
"binary": false,
"copies": "22",
"ref": "refs/heads/master",
"path": "Developer Tools/BeepHammer/BeepAdditions.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AppleScript",
"bytes": "1264"
},
{
"name": "C",
"bytes": "43215"
},
{
"name": "C++",
"bytes": "16000"
},
{
"name": "CSS",
"bytes": "22727"
},
{
"name": "Groff",
"bytes": "5515"
},
{
"name": "HTML",
"bytes": "1351140"
},
{
"name": "JavaScript",
"bytes": "2472"
},
{
"name": "Makefile",
"bytes": "2322"
},
{
"name": "Mathematica",
"bytes": "78408"
},
{
"name": "Objective-C",
"bytes": "2671250"
},
{
"name": "Ruby",
"bytes": "37765"
},
{
"name": "Shell",
"bytes": "7027"
}
],
"symlink_target": ""
} |
'use strict';
import angular from 'angular';
import currentVersion from "./version.directive.js";
export default angular.module('myApp.version', [
currentVersion
])
.value('version', '/* @echo pkg.version */')
.value('buildTimestamp', '/* @echo now */')
.name;
| {
"content_hash": "13316557d9b13a4d17db7813fafbbc47",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 52,
"avg_line_length": 24,
"alnum_prop": 0.6354166666666666,
"repo_name": "OnLiveResearch/core-layout-probe",
"id": "4f142b4d0a41cce7c2c44e427f794c8810dd1640",
"size": "288",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/examples/components/version/version.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "18148"
},
{
"name": "HTML",
"bytes": "45677"
},
{
"name": "JavaScript",
"bytes": "37222"
}
],
"symlink_target": ""
} |
namespace base {
class Value;
} // namespace base
namespace ash {
class NetworkConfigurationHandler;
class NetworkDeviceHandler;
class NetworkPolicyObserver;
struct NetworkProfile;
class NetworkProfileHandler;
class NetworkStateHandler;
// The ManagedNetworkConfigurationHandler class is used to create and configure
// networks in ChromeOS using ONC and takes care of network policies.
//
// Its interface exposes only ONC and should decouple users from Shill.
// Internally it translates ONC to Shill dictionaries and calls through to the
// NetworkConfigurationHandler.
//
// For accessing lists of visible networks, and other state information, see the
// class NetworkStateHandler.
//
// This is a singleton and its lifetime is managed by the Chrome startup code.
//
// Network configurations are referred to by Shill's service path. These
// identifiers should at most be used to also access network state using the
// NetworkStateHandler, but dependencies to Shill should be avoided. In the
// future, we may switch to other identifiers.
//
// Note on callbacks: Because all the functions here are meant to be
// asynchronous, they all take a |callback| of some type, and an
// |error_callback|. When the operation succeeds, |callback| will be called, and
// when it doesn't, |error_callback| will be called with information about the
// error, including a symbolic name for the error and often some error message
// that is suitable for logging. None of the error message text is meant for
// user consumption.
class COMPONENT_EXPORT(CHROMEOS_NETWORK) ManagedNetworkConfigurationHandler {
public:
// Specifies which policy type a caller is interested in.
enum class PolicyType {
// Original ONC policy as provided by cloud policy.
kOriginal,
// ONC policy with runtime values set, i.e. variables can be expanded and a
// resolved client certificate set.
kWithRuntimeValues,
};
ManagedNetworkConfigurationHandler& operator=(
const ManagedNetworkConfigurationHandler&) = delete;
virtual ~ManagedNetworkConfigurationHandler();
virtual void AddObserver(NetworkPolicyObserver* observer) = 0;
virtual void RemoveObserver(NetworkPolicyObserver* observer) = 0;
virtual bool HasObserver(NetworkPolicyObserver* observer) const = 0;
// Provides the properties of the network with |service_path| to |callback|.
// |userhash| is used to set the "Source" property. If not provided then
// user policies will be ignored.
virtual void GetProperties(const std::string& userhash,
const std::string& service_path,
network_handler::PropertiesCallback callback) = 0;
// Provides the managed properties of the network with |service_path| to
// |callback|. |userhash| is used to ensure that the user's policy is
// already applied, and to set the "Source" property (see note for
// GetProperties).
virtual void GetManagedProperties(
const std::string& userhash,
const std::string& service_path,
network_handler::PropertiesCallback callback) = 0;
// Sets the user's settings of an already configured network with
// |service_path|. A network can be initially configured by calling
// CreateConfiguration or if it is managed by a policy. The given properties
// will be merged with the existing settings, and it won't clear any existing
// properties.
virtual void SetProperties(const std::string& service_path,
const base::Value& user_settings,
base::OnceClosure callback,
network_handler::ErrorCallback error_callback) = 0;
// Initially configures an unconfigured network with the given user settings
// and returns the new identifier to |callback| if successful. Fails if the
// network was already configured by a call to this function or because of a
// policy. The new configuration will be owned by user |userhash|. If
// |userhash| is empty, the new configuration will be shared.
virtual void CreateConfiguration(
const std::string& userhash,
const base::Value& properties,
network_handler::ServiceResultCallback callback,
network_handler::ErrorCallback error_callback) const = 0;
// Creates network configuration with given |shill_properties| from policy.
// Any conflicting configuration for the same network will have to be removed
// before calling this method. |callback| will be called after the
// configuration update has been reflected in NetworkStateHandler, or on
// error. This fires OnPolicyApplied notification on success.
virtual void ConfigurePolicyNetwork(const base::Value& shill_properties,
base::OnceClosure callback) const = 0;
// Removes the user's configuration from the network with |service_path|. The
// network may still show up in the visible networks after this, but no user
// configuration will remain. If it was managed, it will still be configured.
virtual void RemoveConfiguration(
const std::string& service_path,
base::OnceClosure callback,
network_handler::ErrorCallback error_callback) const = 0;
// Removes the user's configuration from the network with |service_path| in
// the network's active network profile.
// Same applies as for |RemoveConfiguration|, with the difference that the
// configuration is only removed from a single network profile.
virtual void RemoveConfigurationFromCurrentProfile(
const std::string& service_path,
base::OnceClosure callback,
network_handler::ErrorCallback error_callback) const = 0;
// Only to be called by NetworkConfigurationUpdater or from tests. Sets
// |network_configs_onc| and |global_network_config| as the current policy of
// |userhash| and |onc_source|. The policy will be applied (not necessarily
// immediately) to Shill's profiles and enforced in future configurations
// until the policy associated with |userhash| and |onc_source| is changed
// again with this function. For device policies, |userhash| must be empty.
virtual void SetPolicy(::onc::ONCSource onc_source,
const std::string& userhash,
const base::Value& network_configs_onc,
const base::Value& global_network_config) = 0;
// Returns true if any policy application is currently running or pending.
// NetworkPolicyObservers are notified about applications finishing.
virtual bool IsAnyPolicyApplicationRunning() const = 0;
// Sets ONC variable expansions for |userhash|.
// These expansions are profile-wide, i.e. they will apply to all networks
// that belong to |userhash|.
// This overwrites any previously-set profile-wide variable expansions.
// If this call changes the effective ONC policy (after variable expansion) of
// any network config, it triggers re-application of that network policy.
virtual void SetProfileWideVariableExpansions(
const std::string& userhash,
base::flat_map<std::string, std::string> expansions) = 0;
// Sets the resolved certificate for the network |guid|.
// Returns true if this resulted in an effective change.
virtual bool SetResolvedClientCertificate(
const std::string& userhash,
const std::string& guid,
client_cert::ResolvedCert resolved_cert) = 0;
// Returns the user policy for user |userhash| or device policy, which has
// |guid|. If |userhash| is empty, only looks for a device policy. If such
// doesn't exist, returns NULL. Sets |onc_source| accordingly.
virtual const base::Value* FindPolicyByGUID(
const std::string userhash,
const std::string& guid,
::onc::ONCSource* onc_source) const = 0;
// Returns true if the user policy for |userhash| or device policy if
// |userhash| is empty has any policy-configured network.
// Returns false if |userhash| does not map to any known network profile.
virtual bool HasAnyPolicyNetwork(const std::string& userhash) const = 0;
// Returns the global configuration of the policy of user |userhash| or device
// policy if |userhash| is empty.
virtual const base::Value* GetGlobalConfigFromPolicy(
const std::string& userhash) const = 0;
// Returns the policy with |guid| for profile |profile_path|. If such
// doesn't exist, returns nullptr. Sets |onc_source| and |userhash|
// accordingly if it is not nullptr.
virtual const base::Value* FindPolicyByGuidAndProfile(
const std::string& guid,
const std::string& profile_path,
PolicyType policy_type,
::onc::ONCSource* out_onc_source,
std::string* out_userhash) const = 0;
// Returns true if the network with |guid| is configured by device or user
// policy for profile |profile_path|.
virtual bool IsNetworkConfiguredByPolicy(
const std::string& guid,
const std::string& profile_path) const = 0;
// Returns true if the configuration of the network with |guid| is not
// managed by policy for profile with |profile_path| and thus can be removed.
virtual bool CanRemoveNetworkConfig(
const std::string& guid,
const std::string& profile_path) const = 0;
// Notify observers that the policy has been fully applied and is reflected in
// NetworkStateHandler.
virtual void NotifyPolicyAppliedToNetwork(
const std::string& service_path) const = 0;
// Called after new Cellular networks have been provisioned and configured via
// policy. CellularPolicyHandler calls this method after eSIM profiles are
// installed from policy. The network list should be updated at this point.
virtual void OnCellularPoliciesApplied(const NetworkProfile& profile) = 0;
// Return true if AllowCellularSimLock policy is enabled.
virtual bool AllowCellularSimLock() const = 0;
// Return true if AllowOnlyPolicyCellularNetworks policy is enabled.
virtual bool AllowOnlyPolicyCellularNetworks() const = 0;
// Return true if the AllowOnlyPolicyWiFiToConnect policy is enabled.
virtual bool AllowOnlyPolicyWiFiToConnect() const = 0;
// Return true if the AllowOnlyPolicyWiFiToConnectIfAvailable policy is
// enabled.
virtual bool AllowOnlyPolicyWiFiToConnectIfAvailable() const = 0;
// Return true if the AllowOnlyPolicyNetworksToAutoconnect policy is enabled.
virtual bool AllowOnlyPolicyNetworksToAutoconnect() const = 0;
// Return the list of blocked WiFi networks (identified by HexSSIDs).
virtual std::vector<std::string> GetBlockedHexSSIDs() const = 0;
// Called just before destruction to give observers a chance to remove
// themselves and disable any networking.
virtual void Shutdown() = 0;
static std::unique_ptr<ManagedNetworkConfigurationHandler>
InitializeForTesting(
NetworkStateHandler* network_state_handler,
NetworkProfileHandler* network_profile_handler,
NetworkDeviceHandler* network_device_handler,
NetworkConfigurationHandler* network_configuration_handler,
UIProxyConfigService* ui_proxy_config_service);
};
} // namespace ash
// TODO(https://crbug.com/1164001): remove when the migration is finished.
namespace chromeos {
using ::ash::ManagedNetworkConfigurationHandler;
}
#endif // CHROMEOS_ASH_COMPONENTS_NETWORK_MANAGED_NETWORK_CONFIGURATION_HANDLER_H_
| {
"content_hash": "30135f99a6a8898d92dcd4042324531c",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 83,
"avg_line_length": 46.90041493775934,
"alnum_prop": 0.734583738830399,
"repo_name": "nwjs/chromium.src",
"id": "a2118d7581f723ab9971b27ccb7f31ab3274c5d2",
"size": "11982",
"binary": false,
"copies": "6",
"ref": "refs/heads/nw70",
"path": "chromeos/ash/components/network/managed_network_configuration_handler.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
package com.ek.mobileapp.model;
//his消息处理日志
public class MessageDealLog {
private String name;
private String time;
private String state;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
} | {
"content_hash": "01f552d13b9ad03dea515650f4182451",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 40,
"avg_line_length": 16.176470588235293,
"alnum_prop": 0.5854545454545454,
"repo_name": "yangjiandong/MobileBase.G",
"id": "285cb10fbee3df0344e5f16521fefa10a8145894",
"size": "562",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "extras/sshapp-mobileCommon/src/main/java/com/ek/mobileapp/model/MessageDealLog.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "2906"
},
{
"name": "Java",
"bytes": "1397897"
},
{
"name": "Shell",
"bytes": "2314"
}
],
"symlink_target": ""
} |
/* THIS FILE IS LICENSED UNDER THE MIT LICENSE AS OUTLINED IMMEDIATELY BELOW:
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
using System;
using System.IO;
namespace Giver
{
public enum LogLevel { Debug, Info, Warn, Error, Fatal };
public interface ILogger
{
void Log (LogLevel lvl, string message, params object[] args);
}
class NullLogger : ILogger
{
public void Log (LogLevel lvl, string msg, params object[] args)
{
}
}
class ConsoleLogger : ILogger
{
public void Log (LogLevel lvl, string msg, params object[] args)
{
msg = string.Format ("[{0}]: {1}", Enum.GetName (typeof (LogLevel), lvl), msg);
Console.WriteLine (msg, args);
}
}
class FileLogger : ILogger
{
StreamWriter log;
ConsoleLogger console;
public FileLogger ()
{
try {
log = File.CreateText (Path.Combine (
Environment.GetFolderPath (Environment.SpecialFolder.Personal),
".giver.log"));
log.AutoFlush = true;
} catch (IOException) {
// FIXME: Use temp file
}
console = new ConsoleLogger ();
}
public void Log (LogLevel lvl, string msg, params object[] args)
{
console.Log (lvl, msg, args);
if (log != null) {
msg = string.Format ("{0} [{1}]: {2}",
DateTime.Now.ToString(),
Enum.GetName (typeof (LogLevel), lvl),
msg);
log.WriteLine (msg, args);
}
}
}
// <summary>
// This class provides a generic logging facility. By default all
// information is written to standard out and a log file, but other
// loggers are pluggable.
// </summary>
public static class Logger
{
private static LogLevel logLevel = LogLevel.Debug;
static ILogger logDev = new FileLogger ();
static bool muted = false;
public static LogLevel LogLevel
{
get { return logLevel; }
set { logLevel = value; }
}
public static ILogger LogDevice
{
get { return logDev; }
set { logDev = value; }
}
public static void Debug (string msg, params object[] args)
{
Log (LogLevel.Debug, msg, args);
}
public static void Info (string msg, params object[] args)
{
Log (LogLevel.Info, msg, args);
}
public static void Warn (string msg, params object[] args)
{
Log (LogLevel.Warn, msg, args);
}
public static void Error (string msg, params object[] args)
{
Log (LogLevel.Error, msg, args);
}
public static void Fatal (string msg, params object[] args)
{
Log (LogLevel.Fatal, msg, args);
}
public static void Log (LogLevel lvl, string msg, params object[] args)
{
if (!muted && lvl >= logLevel)
logDev.Log (lvl, msg, args);
}
public static void Mute ()
{
muted = true;
}
public static void Unmute ()
{
muted = false;
}
}
}
| {
"content_hash": "d7d4385c857294d0b8af0389d99604d5",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 82,
"avg_line_length": 25.04635761589404,
"alnum_prop": 0.6668429402432575,
"repo_name": "ajorg/giver",
"id": "17b2ddfad03c2e05f6245ff1c17fcc5f5222b9c2",
"size": "4042",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/Logger.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "171394"
},
{
"name": "Gettext Catalog",
"bytes": "2381"
},
{
"name": "Shell",
"bytes": "604"
}
],
"symlink_target": ""
} |
package org.knowm.xchange.ccex.service;
import static org.knowm.xchange.service.trade.params.TradeHistoryParamsZero.PARAMS_ZERO;
import java.io.IOException;
import java.util.Collection;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.ccex.CCEXAdapters;
import org.knowm.xchange.dto.Order;
import org.knowm.xchange.dto.marketdata.Trades.TradeSortType;
import org.knowm.xchange.dto.trade.LimitOrder;
import org.knowm.xchange.dto.trade.MarketOrder;
import org.knowm.xchange.dto.trade.OpenOrders;
import org.knowm.xchange.dto.trade.UserTrades;
import org.knowm.xchange.exceptions.ExchangeException;
import org.knowm.xchange.exceptions.NotAvailableFromExchangeException;
import org.knowm.xchange.exceptions.NotYetImplementedForExchangeException;
import org.knowm.xchange.service.trade.TradeService;
import org.knowm.xchange.service.trade.params.TradeHistoryParams;
import org.knowm.xchange.service.trade.params.orders.OpenOrdersParams;
public class CCEXTradeService extends CCEXTradeServiceRaw implements TradeService {
public CCEXTradeService(Exchange exchange) {
super(exchange);
}
@Override
public OpenOrders getOpenOrders() throws IOException {
return getOpenOrders(createOpenOrdersParams());
}
@Override
public OpenOrders getOpenOrders(OpenOrdersParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException {
return new OpenOrders(CCEXAdapters.adaptOpenOrders(getCCEXOpenOrders()));
}
@Override
public String placeMarketOrder(MarketOrder marketOrder) throws ExchangeException, NotAvailableFromExchangeException,
NotYetImplementedForExchangeException, IOException {
throw new NotAvailableFromExchangeException();
}
@Override
public String placeLimitOrder(LimitOrder limitOrder) throws IOException {
String id = placeCCEXLimitOrder(limitOrder);
return id;
}
@Override
public boolean cancelOrder(String orderId) throws IOException {
return cancelCCEXLimitOrder(orderId);
}
@Override
public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException {
return new UserTrades(CCEXAdapters.adaptUserTrades(getCCEXTradeHistory()), TradeSortType.SortByTimestamp);
}
@Override
public TradeHistoryParams createTradeHistoryParams() {
return PARAMS_ZERO;
}
@Override
public OpenOrdersParams createOpenOrdersParams() {
return null;
}
@Override
public Collection<Order> getOrder(String... orderIds) throws ExchangeException, NotAvailableFromExchangeException,
NotYetImplementedForExchangeException, IOException {
throw new NotYetImplementedForExchangeException();
}
} | {
"content_hash": "110709b373cf64c1beec129fe8edc1b1",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 172,
"avg_line_length": 33.743589743589745,
"alnum_prop": 0.8259878419452887,
"repo_name": "dozd/XChange",
"id": "6a796e69fbbe519883d2ea0ccfd67eaf21f410c0",
"size": "2632",
"binary": false,
"copies": "4",
"ref": "refs/heads/develop",
"path": "xchange-ccex/src/main/java/org/knowm/xchange/ccex/service/CCEXTradeService.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "4636640"
}
],
"symlink_target": ""
} |
cask "printopia" do
version "3.0.14"
sha256 "09aa54a70fb17ff459e5d5109d120ff8fb429a7a196c057cbdeea8897eb69850"
url "https://www.decisivetactics.com/products/printopia/dl/Printopia_#{version}.zip"
appcast "https://www.decisivetactics.com/api/checkupdate?x-app_id=com.decisivetactics.printopia"
name "Printopia"
desc "Wireless printing to any printer"
homepage "https://www.decisivetactics.com/products/printopia/"
app "Printopia.app"
zap trash: "~/Library/Preferences/com.ecamm.printopia.plist"
end
| {
"content_hash": "1a68de020f250f42a179d401a0c5197a",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 98,
"avg_line_length": 37.07142857142857,
"alnum_prop": 0.7803468208092486,
"repo_name": "ericbn/homebrew-cask",
"id": "e60e40fc1916940ecf588b6b8640eb176f8cc4d5",
"size": "519",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "Casks/printopia.rb",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Dockerfile",
"bytes": "249"
},
{
"name": "Python",
"bytes": "3630"
},
{
"name": "Ruby",
"bytes": "2263313"
},
{
"name": "Shell",
"bytes": "32035"
}
],
"symlink_target": ""
} |

Messenger Native
================
A native chromeless & frameless window wrapper around the new www.messenger.com

## How to Build it
````bash
$ npm install && grunt nodewebkit
````
--
### HELP NEEDED!
PULL REQUESTS + TESTING + FEEDBACK + ISSUES WELCOME! :)
| {
"content_hash": "aab33d20705dc7e955ef2a512c7c92f8",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 160,
"avg_line_length": 28.3,
"alnum_prop": 0.7491166077738516,
"repo_name": "imton/MessengerNative",
"id": "9f115877a6b4f5643a3213ac5cf3efd7ddf65cbd",
"size": "566",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1090"
},
{
"name": "JavaScript",
"bytes": "728"
}
],
"symlink_target": ""
} |
__Different Ruby versions installed in Docker Containers.__
-----
* __sys42/docker-ruby22__:
[](https://imagelayers.io/?images=sys42/docker-ruby22:latest 'Get your own badge on imagelayers.io')
* __sys42/docker-ruby21:__
[](https://imagelayers.io/?images=sys42/docker-ruby21:latest 'Get your own badge on imagelayers.io')
* __sys42/docker-ruby20:__
[](https://imagelayers.io/?images=sys42/docker-ruby20:latest 'Get your own badge on imagelayers.io')
* __sys42/docker-ruby191:__
[](https://imagelayers.io/?images=sys42/docker-ruby191:latest 'Get your own badge on imagelayers.io')
* __sys42/docker-rubymulti:__
[](https://imagelayers.io/?images=sys42/docker-rubymulti:latest 'Get your own badge on imagelayers.io')
--------
Since many Ruby Gems require native compilation this image is based on [sys42/docker-build-essentials](https://github.com/sys42/docker-build-essentials).
This repository is used to build the following images:
* __sys42/docker-ruby22__ (Ruby 2.2 embedded)
* __sys42/docker-ruby21__ (Ruby 2.1 embedded)
* __sys42/docker-ruby20__ (Ruby 2.1 embedded)
* __sys42/docker-ruby191__ (Ruby 1.9.1 embedded)
* __sys42/docker-rubymulti__ (Ruby 1.9.1, 2.0, 2.1 and 2.2 embedded)
If you need any special combination of the above versions in a single container then copy Dockerfile.rubymulti and adapt it to your needs.
**Why is the directory structure of this repository so strange?**
First of all: automated builds on the Docker Hub require the Dockerfile to be named `Dockerfile`. If you want to setup multiple builds from a single github repository you need subfolders for the different builds.
Well, that's not so bad, you think. Me, too. But then comes Docker. When you want to include files in a build with the ADD command in a Dockerfile, these files must be in the same directory or below it. You cannot use relative paths like `../adir` and links won't be followed, too. So the only way around both problems is a (really ugly) deeply nested directory structure.
For this repository the directory structure looks like this:
```
ruby22/Dockerfile
|
|-- ruby21/Dockerfile
|
|-- ruby20/Dockerfile
|
|-- ruby191/Dockerfile
|
|-- rubymulti/Dockerfile
|
|--- install-data/ <--- shared files here
```
What a nasty mess ...
For generic usage informations please examine [the README file of the base image](https://github.com/sys42/docker-base).
----
**origin notice:**
Most of the scripts are taken from [the Phusion passenger repository](https://github.com/phusion/passenger-docker). I have modified them to work with the automatic build system of [Docker Hub](https://hub.docker.com/).
| {
"content_hash": "416608560812754ce1bcca7b4f133736",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 372,
"avg_line_length": 48.90909090909091,
"alnum_prop": 0.6790582403965304,
"repo_name": "sys42/docker-ruby",
"id": "186c5fe662d22be19152380ebf01fd4338963eb2",
"size": "3243",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "6027"
},
{
"name": "Shell",
"bytes": "5057"
}
],
"symlink_target": ""
} |
package androidx.mediarouter.app;
import static androidx.annotation.RestrictTo.Scope.LIBRARY;
import android.app.Dialog;
import android.content.Context;
import android.content.res.Configuration;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.fragment.app.DialogFragment;
import androidx.mediarouter.media.MediaRouteSelector;
/**
* Media route chooser dialog fragment.
* <p>
* Creates a {@link MediaRouteChooserDialog}. The application may subclass
* this dialog fragment to customize the media route chooser dialog.
* </p>
*/
public class MediaRouteChooserDialogFragment extends DialogFragment {
private static final String ARGUMENT_SELECTOR = "selector";
private boolean mUseDynamicGroup = false;
private Dialog mDialog;
private MediaRouteSelector mSelector;
/**
* Creates a media route chooser dialog fragment.
* <p>
* All subclasses of this class must also possess a default constructor.
* </p>
*/
public MediaRouteChooserDialogFragment() {
setCancelable(true);
}
/**
* Gets the media route selector for filtering the routes that the user can select.
*
* @return The selector, never null.
*/
@NonNull
public MediaRouteSelector getRouteSelector() {
ensureRouteSelector();
return mSelector;
}
private void ensureRouteSelector() {
if (mSelector == null) {
Bundle args = getArguments();
if (args != null) {
mSelector = MediaRouteSelector.fromBundle(args.getBundle(ARGUMENT_SELECTOR));
}
if (mSelector == null) {
mSelector = MediaRouteSelector.EMPTY;
}
}
}
/**
* Sets whether it creates dialog for dynamic group or not.
* This method must be called before a dialog is created,
* otherwise, this will throw {@link IllegalStateException}
*
* @param useDynamicGroup true if this should create the dialog for dynamic group
*/
void setUseDynamicGroup(boolean useDynamicGroup) {
if (mDialog != null) {
throw new IllegalStateException("This must be called before creating dialog");
}
mUseDynamicGroup = useDynamicGroup;
}
/**
* Sets the media route selector for filtering the routes that the user can select.
* This method must be called before the fragment is added.
*
* @param selector The selector to set.
*/
public void setRouteSelector(@NonNull MediaRouteSelector selector) {
if (selector == null) {
throw new IllegalArgumentException("selector must not be null");
}
ensureRouteSelector();
if (!mSelector.equals(selector)) {
mSelector = selector;
Bundle args = getArguments();
if (args == null) {
args = new Bundle();
}
args.putBundle(ARGUMENT_SELECTOR, selector.asBundle());
setArguments(args);
if (mDialog != null) {
if (mUseDynamicGroup) {
((MediaRouteDynamicChooserDialog) mDialog).setRouteSelector(selector);
} else {
((MediaRouteChooserDialog) mDialog).setRouteSelector(selector);
}
}
}
}
/**
* Called when the device picker dialog is being created.
* @hide
*/
@RestrictTo(LIBRARY)
@NonNull
public MediaRouteDynamicChooserDialog onCreateDynamicChooserDialog(@NonNull Context context) {
return new MediaRouteDynamicChooserDialog(context);
}
/**
* Called when the chooser dialog is being created.
* <p>
* Subclasses may override this method to customize the dialog.
* </p>
*/
@NonNull
public MediaRouteChooserDialog onCreateChooserDialog(
@NonNull Context context, @Nullable Bundle savedInstanceState) {
return new MediaRouteChooserDialog(context);
}
@Override
@NonNull
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
if (mUseDynamicGroup) {
mDialog = onCreateDynamicChooserDialog(getContext());
((MediaRouteDynamicChooserDialog) mDialog).setRouteSelector(getRouteSelector());
} else {
mDialog = onCreateChooserDialog(getContext(), savedInstanceState);
((MediaRouteChooserDialog) mDialog).setRouteSelector(getRouteSelector());
}
return mDialog;
}
@Override
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if (mDialog == null) {
return;
}
if (mUseDynamicGroup) {
((MediaRouteDynamicChooserDialog) mDialog).updateLayout();
} else {
((MediaRouteChooserDialog) mDialog).updateLayout();
}
}
}
| {
"content_hash": "208a8ea7e516158d10ef9c270db9e9de",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 98,
"avg_line_length": 31.821656050955415,
"alnum_prop": 0.6401120896717374,
"repo_name": "androidx/androidx",
"id": "119ec1f059a58021b79d3cedf9e7b0005a4740d0",
"size": "5611",
"binary": false,
"copies": "3",
"ref": "refs/heads/androidx-main",
"path": "mediarouter/mediarouter/src/main/java/androidx/mediarouter/app/MediaRouteChooserDialogFragment.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AIDL",
"bytes": "263978"
},
{
"name": "ANTLR",
"bytes": "19860"
},
{
"name": "C",
"bytes": "4764"
},
{
"name": "C++",
"bytes": "9020585"
},
{
"name": "CMake",
"bytes": "11999"
},
{
"name": "HTML",
"bytes": "21175"
},
{
"name": "Java",
"bytes": "59499889"
},
{
"name": "JavaScript",
"bytes": "1343"
},
{
"name": "Kotlin",
"bytes": "66123157"
},
{
"name": "Python",
"bytes": "292398"
},
{
"name": "Shell",
"bytes": "167367"
},
{
"name": "Swift",
"bytes": "3153"
},
{
"name": "TypeScript",
"bytes": "7599"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
Sida hilariana C.Presl
### Remarks
null | {
"content_hash": "8796669e545b1d39ed55812e1cfedcb0",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 11.076923076923077,
"alnum_prop": 0.7222222222222222,
"repo_name": "mdoering/backbone",
"id": "9abb277273db3498ea78e02a1f296ef11b50f33a",
"size": "231",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Malvales/Malvaceae/Allosidastrum/Allosidastrum hilarianum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package j_account
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/swag"
strfmt "github.com/go-openapi/strfmt"
"koding/remoteapi/models"
)
// PostRemoteAPIJAccountFetchMySessionsIDReader is a Reader for the PostRemoteAPIJAccountFetchMySessionsID structure.
type PostRemoteAPIJAccountFetchMySessionsIDReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostRemoteAPIJAccountFetchMySessionsIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostRemoteAPIJAccountFetchMySessionsIDOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
default:
return nil, runtime.NewAPIError("unknown error", response, response.Code())
}
}
// NewPostRemoteAPIJAccountFetchMySessionsIDOK creates a PostRemoteAPIJAccountFetchMySessionsIDOK with default headers values
func NewPostRemoteAPIJAccountFetchMySessionsIDOK() *PostRemoteAPIJAccountFetchMySessionsIDOK {
return &PostRemoteAPIJAccountFetchMySessionsIDOK{}
}
/*PostRemoteAPIJAccountFetchMySessionsIDOK handles this case with default header values.
OK
*/
type PostRemoteAPIJAccountFetchMySessionsIDOK struct {
Payload PostRemoteAPIJAccountFetchMySessionsIDOKBody
}
func (o *PostRemoteAPIJAccountFetchMySessionsIDOK) Error() string {
return fmt.Sprintf("[POST /remote.api/JAccount.fetchMySessions/{id}][%d] postRemoteApiJAccountFetchMySessionsIdOK %+v", 200, o.Payload)
}
func (o *PostRemoteAPIJAccountFetchMySessionsIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
/*PostRemoteAPIJAccountFetchMySessionsIDOKBody post remote API j account fetch my sessions ID o k body
swagger:model PostRemoteAPIJAccountFetchMySessionsIDOKBody
*/
type PostRemoteAPIJAccountFetchMySessionsIDOKBody struct {
models.JAccount
models.DefaultResponse
}
// UnmarshalJSON unmarshals this object from a JSON structure
func (o *PostRemoteAPIJAccountFetchMySessionsIDOKBody) UnmarshalJSON(raw []byte) error {
var postRemoteAPIJAccountFetchMySessionsIDOKBodyAO0 models.JAccount
if err := swag.ReadJSON(raw, &postRemoteAPIJAccountFetchMySessionsIDOKBodyAO0); err != nil {
return err
}
o.JAccount = postRemoteAPIJAccountFetchMySessionsIDOKBodyAO0
var postRemoteAPIJAccountFetchMySessionsIDOKBodyAO1 models.DefaultResponse
if err := swag.ReadJSON(raw, &postRemoteAPIJAccountFetchMySessionsIDOKBodyAO1); err != nil {
return err
}
o.DefaultResponse = postRemoteAPIJAccountFetchMySessionsIDOKBodyAO1
return nil
}
// MarshalJSON marshals this object to a JSON structure
func (o PostRemoteAPIJAccountFetchMySessionsIDOKBody) MarshalJSON() ([]byte, error) {
var _parts [][]byte
postRemoteAPIJAccountFetchMySessionsIDOKBodyAO0, err := swag.WriteJSON(o.JAccount)
if err != nil {
return nil, err
}
_parts = append(_parts, postRemoteAPIJAccountFetchMySessionsIDOKBodyAO0)
postRemoteAPIJAccountFetchMySessionsIDOKBodyAO1, err := swag.WriteJSON(o.DefaultResponse)
if err != nil {
return nil, err
}
_parts = append(_parts, postRemoteAPIJAccountFetchMySessionsIDOKBodyAO1)
return swag.ConcatJSON(_parts...), nil
}
// Validate validates this post remote API j account fetch my sessions ID o k body
func (o *PostRemoteAPIJAccountFetchMySessionsIDOKBody) Validate(formats strfmt.Registry) error {
var res []error
if err := o.JAccount.Validate(formats); err != nil {
res = append(res, err)
}
if err := o.DefaultResponse.Validate(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
| {
"content_hash": "0824f6e7e66394871451b3090b5e153f",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 156,
"avg_line_length": 31.48062015503876,
"alnum_prop": 0.7931543954690963,
"repo_name": "usirin/koding",
"id": "6ba26a04c79cd640ebb56bcef9d1b539358872d2",
"size": "4061",
"binary": false,
"copies": "12",
"ref": "refs/heads/master",
"path": "go/src/koding/remoteapi/client/j_account/post_remote_api_j_account_fetch_my_sessions_id_responses.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "746775"
},
{
"name": "CoffeeScript",
"bytes": "4643657"
},
{
"name": "Go",
"bytes": "6629969"
},
{
"name": "HTML",
"bytes": "107319"
},
{
"name": "JavaScript",
"bytes": "2204296"
},
{
"name": "Makefile",
"bytes": "6244"
},
{
"name": "PHP",
"bytes": "1570"
},
{
"name": "PLpgSQL",
"bytes": "12770"
},
{
"name": "Perl",
"bytes": "1612"
},
{
"name": "Python",
"bytes": "27895"
},
{
"name": "Ruby",
"bytes": "1763"
},
{
"name": "SQLPL",
"bytes": "5187"
},
{
"name": "Shell",
"bytes": "117358"
}
],
"symlink_target": ""
} |
<?php
namespace AlphaLemon\Block\BootstrapNavbarBlockBundle\Tests\Unit\Core\Form;
use AlphaLemon\AlphaLemonCmsBundle\Tests\Unit\Core\Form\Base\AlBaseType;
use AlphaLemon\Block\BootstrapNavbarBlockBundle\Core\Form\AlNavbarDropdownType;
/**
* AlNavbarDropdownTypeTest
*
* @author AlphaLemon <webmaster@alphalemon.com>
*/
class AlNavbarDropdownTypeTest extends AlBaseType
{
protected function configureFields()
{
return array(
'button_text',
);
}
protected function getForm()
{
return new AlNavbarDropdownType();
}
public function testDefaultOptions()
{
$this->assertEquals(array('csrf_protection' =>false), $this->getForm()->getDefaultOptions(array()));
}
public function testGetName()
{
$this->assertEquals('al_json_block', $this->getForm()->getName());
}
}
| {
"content_hash": "d61d40154b3f51b486dff0333d906289",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 108,
"avg_line_length": 23.18421052631579,
"alnum_prop": 0.674233825198638,
"repo_name": "alphalemon/BootstrapNavbarBlockBundle",
"id": "ef3b8eccbbd456a528d577acca0833c4ce8074ee",
"size": "1364",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Tests/Unit/Form/AlNavbarDropdownTypeTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "1149"
},
{
"name": "PHP",
"bytes": "21208"
}
],
"symlink_target": ""
} |
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Voice
* This is the public Twilio REST API.
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using Twilio.Base;
using Twilio.Clients;
using Twilio.Converters;
using Twilio.Exceptions;
using Twilio.Http;
namespace Twilio.Rest.Voice.V1
{
public class SourceIpMappingResource : Resource
{
private static Request BuildCreateRequest(CreateSourceIpMappingOptions options, ITwilioRestClient client)
{
string path = "/v1/SourceIpMappings";
return new Request(
HttpMethod.Post,
Rest.Domain.Voice,
path,
postParams: options.GetParams(),
headerParams: null
);
}
/// <summary> create </summary>
/// <param name="options"> Create SourceIpMapping parameters </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> A single instance of SourceIpMapping </returns>
public static SourceIpMappingResource Create(CreateSourceIpMappingOptions options, ITwilioRestClient client = null)
{
client = client ?? TwilioClient.GetRestClient();
var response = client.Request(BuildCreateRequest(options, client));
return FromJson(response.Content);
}
#if !NET35
/// <summary> create </summary>
/// <param name="options"> Create SourceIpMapping parameters </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> Task that resolves to A single instance of SourceIpMapping </returns>
public static async System.Threading.Tasks.Task<SourceIpMappingResource> CreateAsync(CreateSourceIpMappingOptions options,
ITwilioRestClient client = null)
{
client = client ?? TwilioClient.GetRestClient();
var response = await client.RequestAsync(BuildCreateRequest(options, client));
return FromJson(response.Content);
}
#endif
/// <summary> create </summary>
/// <param name="ipRecordSid"> The Twilio-provided string that uniquely identifies the IP Record resource to map from. </param>
/// <param name="sipDomainSid"> The SID of the SIP Domain that the IP Record should be mapped to. </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> A single instance of SourceIpMapping </returns>
public static SourceIpMappingResource Create(
string ipRecordSid,
string sipDomainSid,
ITwilioRestClient client = null)
{
var options = new CreateSourceIpMappingOptions(ipRecordSid, sipDomainSid){ };
return Create(options, client);
}
#if !NET35
/// <summary> create </summary>
/// <param name="ipRecordSid"> The Twilio-provided string that uniquely identifies the IP Record resource to map from. </param>
/// <param name="sipDomainSid"> The SID of the SIP Domain that the IP Record should be mapped to. </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> Task that resolves to A single instance of SourceIpMapping </returns>
public static async System.Threading.Tasks.Task<SourceIpMappingResource> CreateAsync(
string ipRecordSid,
string sipDomainSid,
ITwilioRestClient client = null)
{
var options = new CreateSourceIpMappingOptions(ipRecordSid, sipDomainSid){ };
return await CreateAsync(options, client);
}
#endif
/// <summary> delete </summary>
/// <param name="options"> Delete SourceIpMapping parameters </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> A single instance of SourceIpMapping </returns>
private static Request BuildDeleteRequest(DeleteSourceIpMappingOptions options, ITwilioRestClient client)
{
string path = "/v1/SourceIpMappings/{Sid}";
string PathSid = options.PathSid;
path = path.Replace("{"+"Sid"+"}", PathSid);
return new Request(
HttpMethod.Delete,
Rest.Domain.Voice,
path,
queryParams: options.GetParams(),
headerParams: null
);
}
/// <summary> delete </summary>
/// <param name="options"> Delete SourceIpMapping parameters </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> A single instance of SourceIpMapping </returns>
public static bool Delete(DeleteSourceIpMappingOptions options, ITwilioRestClient client = null)
{
client = client ?? TwilioClient.GetRestClient();
var response = client.Request(BuildDeleteRequest(options, client));
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
}
#if !NET35
/// <summary> delete </summary>
/// <param name="options"> Delete SourceIpMapping parameters </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> Task that resolves to A single instance of SourceIpMapping </returns>
public static async System.Threading.Tasks.Task<bool> DeleteAsync(DeleteSourceIpMappingOptions options,
ITwilioRestClient client = null)
{
client = client ?? TwilioClient.GetRestClient();
var response = await client.RequestAsync(BuildDeleteRequest(options, client));
return response.StatusCode == System.Net.HttpStatusCode.NoContent;
}
#endif
/// <summary> delete </summary>
/// <param name="pathSid"> The Twilio-provided string that uniquely identifies the IP Record resource to delete. </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> A single instance of SourceIpMapping </returns>
public static bool Delete(string pathSid, ITwilioRestClient client = null)
{
var options = new DeleteSourceIpMappingOptions(pathSid) ;
return Delete(options, client);
}
#if !NET35
/// <summary> delete </summary>
/// <param name="pathSid"> The Twilio-provided string that uniquely identifies the IP Record resource to delete. </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> Task that resolves to A single instance of SourceIpMapping </returns>
public static async System.Threading.Tasks.Task<bool> DeleteAsync(string pathSid, ITwilioRestClient client = null)
{
var options = new DeleteSourceIpMappingOptions(pathSid) ;
return await DeleteAsync(options, client);
}
#endif
private static Request BuildFetchRequest(FetchSourceIpMappingOptions options, ITwilioRestClient client)
{
string path = "/v1/SourceIpMappings/{Sid}";
string PathSid = options.PathSid;
path = path.Replace("{"+"Sid"+"}", PathSid);
return new Request(
HttpMethod.Get,
Rest.Domain.Voice,
path,
queryParams: options.GetParams(),
headerParams: null
);
}
/// <summary> fetch </summary>
/// <param name="options"> Fetch SourceIpMapping parameters </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> A single instance of SourceIpMapping </returns>
public static SourceIpMappingResource Fetch(FetchSourceIpMappingOptions options, ITwilioRestClient client = null)
{
client = client ?? TwilioClient.GetRestClient();
var response = client.Request(BuildFetchRequest(options, client));
return FromJson(response.Content);
}
#if !NET35
/// <summary> fetch </summary>
/// <param name="options"> Fetch SourceIpMapping parameters </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> Task that resolves to A single instance of SourceIpMapping </returns>
public static async System.Threading.Tasks.Task<SourceIpMappingResource> FetchAsync(FetchSourceIpMappingOptions options,
ITwilioRestClient client = null)
{
client = client ?? TwilioClient.GetRestClient();
var response = await client.RequestAsync(BuildFetchRequest(options, client));
return FromJson(response.Content);
}
#endif
/// <summary> fetch </summary>
/// <param name="pathSid"> The Twilio-provided string that uniquely identifies the IP Record resource to fetch. </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> A single instance of SourceIpMapping </returns>
public static SourceIpMappingResource Fetch(
string pathSid,
ITwilioRestClient client = null)
{
var options = new FetchSourceIpMappingOptions(pathSid){ };
return Fetch(options, client);
}
#if !NET35
/// <summary> fetch </summary>
/// <param name="pathSid"> The Twilio-provided string that uniquely identifies the IP Record resource to fetch. </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> Task that resolves to A single instance of SourceIpMapping </returns>
public static async System.Threading.Tasks.Task<SourceIpMappingResource> FetchAsync(string pathSid, ITwilioRestClient client = null)
{
var options = new FetchSourceIpMappingOptions(pathSid){ };
return await FetchAsync(options, client);
}
#endif
private static Request BuildReadRequest(ReadSourceIpMappingOptions options, ITwilioRestClient client)
{
string path = "/v1/SourceIpMappings";
return new Request(
HttpMethod.Get,
Rest.Domain.Voice,
path,
queryParams: options.GetParams(),
headerParams: null
);
}
/// <summary> read </summary>
/// <param name="options"> Read SourceIpMapping parameters </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> A single instance of SourceIpMapping </returns>
public static ResourceSet<SourceIpMappingResource> Read(ReadSourceIpMappingOptions options, ITwilioRestClient client = null)
{
client = client ?? TwilioClient.GetRestClient();
var response = client.Request(BuildReadRequest(options, client));
var page = Page<SourceIpMappingResource>.FromJson("source_ip_mappings", response.Content);
return new ResourceSet<SourceIpMappingResource>(page, options, client);
}
#if !NET35
/// <summary> read </summary>
/// <param name="options"> Read SourceIpMapping parameters </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> Task that resolves to A single instance of SourceIpMapping </returns>
public static async System.Threading.Tasks.Task<ResourceSet<SourceIpMappingResource>> ReadAsync(ReadSourceIpMappingOptions options,
ITwilioRestClient client = null)
{
client = client ?? TwilioClient.GetRestClient();
var response = await client.RequestAsync(BuildReadRequest(options, client));
var page = Page<SourceIpMappingResource>.FromJson("source_ip_mappings", response.Content);
return new ResourceSet<SourceIpMappingResource>(page, options, client);
}
#endif
/// <summary> read </summary>
/// <param name="pageSize"> How many resources to return in each list page. The default is 50, and the maximum is 1000. </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <param name="limit"> Record limit </param>
/// <returns> A single instance of SourceIpMapping </returns>
public static ResourceSet<SourceIpMappingResource> Read(
int? pageSize = null,
long? limit = null,
ITwilioRestClient client = null)
{
var options = new ReadSourceIpMappingOptions(){ PageSize = pageSize, Limit = limit};
return Read(options, client);
}
#if !NET35
/// <summary> read </summary>
/// <param name="pageSize"> How many resources to return in each list page. The default is 50, and the maximum is 1000. </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <param name="limit"> Record limit </param>
/// <returns> Task that resolves to A single instance of SourceIpMapping </returns>
public static async System.Threading.Tasks.Task<ResourceSet<SourceIpMappingResource>> ReadAsync(
int? pageSize = null,
long? limit = null,
ITwilioRestClient client = null)
{
var options = new ReadSourceIpMappingOptions(){ PageSize = pageSize, Limit = limit};
return await ReadAsync(options, client);
}
#endif
/// <summary> Fetch the target page of records </summary>
/// <param name="targetUrl"> API-generated URL for the requested results page </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> The target page of records </returns>
public static Page<SourceIpMappingResource> GetPage(string targetUrl, ITwilioRestClient client)
{
client = client ?? TwilioClient.GetRestClient();
var request = new Request(
HttpMethod.Get,
targetUrl
);
var response = client.Request(request);
return Page<SourceIpMappingResource>.FromJson("source_ip_mappings", response.Content);
}
/// <summary> Fetch the next page of records </summary>
/// <param name="page"> current page of records </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> The next page of records </returns>
public static Page<SourceIpMappingResource> NextPage(Page<SourceIpMappingResource> page, ITwilioRestClient client)
{
var request = new Request(
HttpMethod.Get,
page.GetNextPageUrl(Rest.Domain.Api)
);
var response = client.Request(request);
return Page<SourceIpMappingResource>.FromJson("source_ip_mappings", response.Content);
}
/// <summary> Fetch the previous page of records </summary>
/// <param name="page"> current page of records </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> The previous page of records </returns>
public static Page<SourceIpMappingResource> PreviousPage(Page<SourceIpMappingResource> page, ITwilioRestClient client)
{
var request = new Request(
HttpMethod.Get,
page.GetPreviousPageUrl(Rest.Domain.Api)
);
var response = client.Request(request);
return Page<SourceIpMappingResource>.FromJson("source_ip_mappings", response.Content);
}
private static Request BuildUpdateRequest(UpdateSourceIpMappingOptions options, ITwilioRestClient client)
{
string path = "/v1/SourceIpMappings/{Sid}";
string PathSid = options.PathSid;
path = path.Replace("{"+"Sid"+"}", PathSid);
return new Request(
HttpMethod.Post,
Rest.Domain.Voice,
path,
postParams: options.GetParams(),
headerParams: null
);
}
/// <summary> update </summary>
/// <param name="options"> Update SourceIpMapping parameters </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> A single instance of SourceIpMapping </returns>
public static SourceIpMappingResource Update(UpdateSourceIpMappingOptions options, ITwilioRestClient client = null)
{
client = client ?? TwilioClient.GetRestClient();
var response = client.Request(BuildUpdateRequest(options, client));
return FromJson(response.Content);
}
/// <summary> update </summary>
/// <param name="options"> Update SourceIpMapping parameters </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> Task that resolves to A single instance of SourceIpMapping </returns>
#if !NET35
public static async System.Threading.Tasks.Task<SourceIpMappingResource> UpdateAsync(UpdateSourceIpMappingOptions options,
ITwilioRestClient client = null)
{
client = client ?? TwilioClient.GetRestClient();
var response = await client.RequestAsync(BuildUpdateRequest(options, client));
return FromJson(response.Content);
}
#endif
/// <summary> update </summary>
/// <param name="pathSid"> The Twilio-provided string that uniquely identifies the IP Record resource to update. </param>
/// <param name="sipDomainSid"> The SID of the SIP Domain that the IP Record should be mapped to. </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> A single instance of SourceIpMapping </returns>
public static SourceIpMappingResource Update(
string pathSid,
string sipDomainSid,
ITwilioRestClient client = null)
{
var options = new UpdateSourceIpMappingOptions(pathSid, sipDomainSid){ };
return Update(options, client);
}
#if !NET35
/// <summary> update </summary>
/// <param name="pathSid"> The Twilio-provided string that uniquely identifies the IP Record resource to update. </param>
/// <param name="sipDomainSid"> The SID of the SIP Domain that the IP Record should be mapped to. </param>
/// <param name="client"> Client to make requests to Twilio </param>
/// <returns> Task that resolves to A single instance of SourceIpMapping </returns>
public static async System.Threading.Tasks.Task<SourceIpMappingResource> UpdateAsync(
string pathSid,
string sipDomainSid,
ITwilioRestClient client = null)
{
var options = new UpdateSourceIpMappingOptions(pathSid, sipDomainSid){ };
return await UpdateAsync(options, client);
}
#endif
/// <summary>
/// Converts a JSON string into a SourceIpMappingResource object
/// </summary>
/// <param name="json"> Raw JSON string </param>
/// <returns> SourceIpMappingResource object represented by the provided JSON </returns>
public static SourceIpMappingResource FromJson(string json)
{
try
{
return JsonConvert.DeserializeObject<SourceIpMappingResource>(json);
}
catch (JsonException e)
{
throw new ApiException(e.Message, e);
}
}
///<summary> The unique string that identifies the resource </summary>
[JsonProperty("sid")]
public string Sid { get; private set; }
///<summary> The unique string that identifies an IP Record </summary>
[JsonProperty("ip_record_sid")]
public string IpRecordSid { get; private set; }
///<summary> The unique string that identifies a SIP Domain </summary>
[JsonProperty("sip_domain_sid")]
public string SipDomainSid { get; private set; }
///<summary> The RFC 2822 date and time in GMT that the resource was created </summary>
[JsonProperty("date_created")]
public DateTime? DateCreated { get; private set; }
///<summary> The RFC 2822 date and time in GMT that the resource was last updated </summary>
[JsonProperty("date_updated")]
public DateTime? DateUpdated { get; private set; }
///<summary> The absolute URL of the resource </summary>
[JsonProperty("url")]
public Uri Url { get; private set; }
private SourceIpMappingResource() {
}
}
}
| {
"content_hash": "35bdb9ec29cf377b5693304170d4a397",
"timestamp": "",
"source": "github",
"line_count": 478,
"max_line_length": 140,
"avg_line_length": 47.66945606694561,
"alnum_prop": 0.5763187922408497,
"repo_name": "twilio/twilio-csharp",
"id": "f8e726679e286e6a81cac6ca2a439243e4e32a38",
"size": "22786",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/Twilio/Rest/Voice/V1/SourceIpMappingResource.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "13879265"
},
{
"name": "Dockerfile",
"bytes": "1137"
},
{
"name": "Makefile",
"bytes": "1970"
}
],
"symlink_target": ""
} |
#ifndef __SRL_STDIO__
#define __SRL_STDIO__
#include "srl/io/TextWriter.h"
#include "srl/io/TextReader.h"
namespace SRL
{
namespace System
{
/** pointer to the standard output writer */
SRL_API srl::io::TextWriter *stdout;
/** pointer to the standard input writer */
SRL_API srl::io::TextWriter *stderr;
/** pointer to the standard input reader */
SRL_API srl::io::TextReader *stdin;
}
}
#endif
| {
"content_hash": "5c2d5600b5eef55268e54c3718f2807b",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 53,
"avg_line_length": 23.318181818181817,
"alnum_prop": 0.5458089668615984,
"repo_name": "311labs/SRL",
"id": "03cd724dd63db4f856269d5fff0aaef912e18078",
"size": "1899",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cpp/include/srl/sys/stdio.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "154751"
},
{
"name": "C++",
"bytes": "981863"
},
{
"name": "D",
"bytes": "800"
},
{
"name": "Java",
"bytes": "199230"
},
{
"name": "Python",
"bytes": "69192"
},
{
"name": "Shell",
"bytes": "450"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "aaa344dc489bf9f8a7a1cfce006d68b2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "4c1c93f106812ec658bcff011cba2ed2a6fc9171",
"size": "199",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Dendrobium/Dendrobium latoureoides/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
//*******************************************************************************************************
// IRuntimeConfigurationService.cs - Gbtc
//
// Tennessee Valley Authority, 2009
// No copyright is claimed pursuant to 17 USC § 105. All Other Rights Reserved.
//
// Code Modification History:
// -----------------------------------------------------------------------------------------------------
// 11/25/2009 - Pinal C. Patel
// Generated original version of source code.
//
//*******************************************************************************************************
using System.IO;
using System.ServiceModel;
using System.ServiceModel.Web;
namespace openECAServices
{
[ServiceContract()]
public interface IRuntimeConfigurationService
{
[OperationContract(),
WebGet(ResponseFormat = WebMessageFormat.Xml, UriTemplate = "/runtimeconfiguration/{nodeName}")]
Stream GetConfiguration(string nodeName);
}
}
| {
"content_hash": "46a012cc656288108d1c4ba7cb696c19",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 106,
"avg_line_length": 36.407407407407405,
"alnum_prop": 0.4832146490335707,
"repo_name": "GridProtectionAlliance/openECA",
"id": "c982780f9e7d9f4cb1e38f5fc105b8a2f16588d0",
"size": "986",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Source/Applications/openECA/openECAServices/IRuntimeConfigurationService.cs",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "12019"
},
{
"name": "C#",
"bytes": "1787040"
},
{
"name": "CSS",
"bytes": "8791"
},
{
"name": "F#",
"bytes": "1591"
},
{
"name": "HTML",
"bytes": "174148"
},
{
"name": "JavaScript",
"bytes": "220272"
},
{
"name": "MATLAB",
"bytes": "64296"
},
{
"name": "PLSQL",
"bytes": "114326"
},
{
"name": "PowerShell",
"bytes": "1071"
},
{
"name": "Python",
"bytes": "131705"
},
{
"name": "Rich Text Format",
"bytes": "241974"
},
{
"name": "TSQL",
"bytes": "249839"
},
{
"name": "Visual Basic .NET",
"bytes": "1151"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<CustomFieldTranslation xmlns="http://soap.sforce.com/2006/04/metadata">
<name>Start_Date__c</name>
<help>Data d’emissió de la credencial o de l'atribut.</help>
<label>Data d'inici</label>
</CustomFieldTranslation>
| {
"content_hash": "fd11fdbbe4170ba4ad9cff5bd759482a",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 72,
"avg_line_length": 46,
"alnum_prop": 0.7065217391304348,
"repo_name": "SalesforceFoundation/HEDAP",
"id": "52d6bf700d62dae2b3f8af672930bc6a455dffee",
"size": "279",
"binary": false,
"copies": "1",
"ref": "refs/heads/feature/234",
"path": "force-app/main/default/objectTranslations/Attribute__c-ca/Start_Date__c.fieldTranslation-meta.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Apex",
"bytes": "1599605"
},
{
"name": "CSS",
"bytes": "621"
},
{
"name": "HTML",
"bytes": "145319"
},
{
"name": "JavaScript",
"bytes": "61802"
},
{
"name": "Python",
"bytes": "28442"
},
{
"name": "RobotFramework",
"bytes": "26714"
}
],
"symlink_target": ""
} |
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://mockbin.com/har"))
.header("content-type", "multipart/form-data; boundary=---011000010111000001101001")
.method("POST", HttpRequest.BodyPublishers.ofString("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"hello.txt\"\r\nContent-Type: text/plain\r\n\r\n\r\n-----011000010111000001101001--\r\n"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
| {
"content_hash": "93f0f5d0bb6108687a85da676ad471c2",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 236,
"avg_line_length": 83.28571428571429,
"alnum_prop": 0.7392795883361921,
"repo_name": "Mashape/httpsnippet",
"id": "7c86e4be3f0a8e99688b2ef344ecc8a5d14f0863",
"size": "583",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/fixtures/output/java/nethttp/multipart-file.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "110530"
}
],
"symlink_target": ""
} |
To use TensorFlow you need to understand how TensorFlow:
* Represents computations as graphs.
* Executes graphs in the context of `Sessions`.
* Represents data as tensors.
* Maintains state with `Variables`.
* Uses feeds and fetches to get data into and out of arbitrary operations.
## Overview
TensorFlow is a programming system in which you represent computations as
graphs. Nodes in the graph are called *ops* (short for operations). An op
takes zero or more `Tensors`, performs some computation, and produces zero or
more `Tensors`. A `Tensor` is a typed multi-dimensional array. For example,
you can represent a mini-batch of images as a 4-D array of floating point
numbers with dimensions `[batch, height, width, channels]`.
A TensorFlow graph is a *description* of computations. To compute anything,
a graph must be launched in a `Session`. A `Session` places the graph ops onto
`Devices`, such as CPUs or GPUs, and provides methods to execute them. These
methods return tensors produced by ops as [numpy](http://www.numpy.org)
`ndarray` objects in Python, and as `tensorflow::Tensor` instances in C and
C++.
## The computation graph
TensorFlow programs are usually structured into a construction phase, that
assembles a graph, and an execution phase that uses a session to execute ops in
the graph.
For example, it is common to create a graph to represent and train a neural
network in the construction phase, and then repeatedly execute a set of
training ops in the graph in the execution phase.
TensorFlow can be used from C, C++, and Python programs. It is presently much
easier to use the Python library to assemble graphs, as it provides a large set
of helper functions not available in the C and C++ libraries.
The session libraries have equivalent functionalities for the three languages.
### Building the graph
To build a graph start with ops that do not need any input (source ops), such as
`Constant`, and pass their output to other ops that do computation.
The ops constructors in the Python library return objects that stand for the
output of the constructed ops. You can pass these to other ops constructors to
use as inputs.
The TensorFlow Python library has a *default graph* to which ops constructors
add nodes. The default graph is sufficient for many applications. See the
[Graph class](../api_docs/python/framework.md#Graph) documentation for how
to explicitly manage multiple graphs.
```python
import tensorflow as tf
# Create a Constant op that produces a 1x2 matrix. The op is
# added as a node to the default graph.
#
# The value returned by the constructor represents the output
# of the Constant op.
matrix1 = tf.constant([[3., 3.]])
# Create another Constant that produces a 2x1 matrix.
matrix2 = tf.constant([[2.],[2.]])
# Create a Matmul op that takes 'matrix1' and 'matrix2' as inputs.
# The returned value, 'product', represents the result of the matrix
# multiplication.
product = tf.matmul(matrix1, matrix2)
```
The default graph now has three nodes: two `constant()` ops and one `matmul()`
op. To actually multiply the matrices, and get the result of the multiplication,
you must launch the graph in a session.
### Launching the graph in a session
Launching follows construction. To launch a graph, create a `Session` object.
Without arguments the session constructor launches the default graph.
See the [Session class](../api_docs/python/client.md#session-management) for
the complete session API.
```python
# Launch the default graph.
sess = tf.Session()
# To run the matmul op we call the session 'run()' method, passing 'product'
# which represents the output of the matmul op. This indicates to the call
# that we want to get the output of the matmul op back.
#
# All inputs needed by the op are run automatically by the session. They
# typically are run in parallel.
#
# The call 'run(product)' thus causes the execution of threes ops in the
# graph: the two constants and matmul.
#
# The output of the op is returned in 'result' as a numpy `ndarray` object.
result = sess.run(product)
print(result)
# ==> [[ 12.]]
# Close the Session when we're done.
sess.close()
```
Sessions should be closed to release resources. You can also enter a `Session`
with a "with" block. The `Session` closes automatically at the end of the
`with` block.
```python
with tf.Session() as sess:
result = sess.run([product])
print(result)
```
The TensorFlow implementation translates the graph definition into executable
operations distributed across available compute resources, such as the CPU or
one of your computer's GPU cards. In general you do not have to specify CPUs
or GPUs explicitly. TensorFlow uses your first GPU, if you have one, for as
many operations as possible.
If you have more than one GPU available on your machine, to use a GPU beyond
the first you must assign ops to it explicitly. Use `with...Device` statements
to specify which CPU or GPU to use for operations:
```python
with tf.Session() as sess:
with tf.device("/gpu:1"):
matrix1 = tf.constant([[3., 3.]])
matrix2 = tf.constant([[2.],[2.]])
product = tf.matmul(matrix1, matrix2)
...
```
Devices are specified with strings. The currently supported devices are:
* `"/cpu:0"`: The CPU of your machine.
* `"/gpu:0"`: The GPU of your machine, if you have one.
* `"/gpu:1"`: The second GPU of your machine, etc.
See [Using GPUs](../how_tos/using_gpu/index.md) for more information about GPUs
and TensorFlow.
## Interactive Usage
The Python examples in the documentation launch the graph with a
[`Session`](../api_docs/python/client.md#Session) and use the
[`Session.run()`](../api_docs/python/client.md#Session.run) method to execute
operations.
For ease of use in interactive Python environments, such as
[IPython](http://ipython.org) you can instead use the
[`InteractiveSession`](../api_docs/python/client.md#InteractiveSession) class,
and the [`Tensor.eval()`](../api_docs/python/framework.md#Tensor.eval) and
[`Operation.run()`](../api_docs/python/framework.md#Operation.run) methods. This
avoids having to keep a variable holding the session.
```python
# Enter an interactive TensorFlow Session.
import tensorflow as tf
sess = tf.InteractiveSession()
x = tf.Variable([1.0, 2.0])
a = tf.constant([3.0, 3.0])
# Initialize 'x' using the run() method of its initializer op.
x.initializer.run()
# Add an op to subtract 'a' from 'x'. Run it and print the result
sub = tf.sub(x, a)
print(sub.eval())
# ==> [-2. -1.]
# Close the Session when we're done.
sess.close()
```
## Tensors
TensorFlow programs use a tensor data structure to represent all data -- only
tensors are passed between operations in the computation graph. You can think
of a TensorFlow tensor as an n-dimensional array or list. A tensor has a
static type, a rank, and a shape. To learn more about how TensorFlow handles
these concepts, see the [Rank, Shape, and Type](../resources/dims_types.md)
reference.
## Variables
Variables maintain state across executions of the graph. The following example
shows a variable serving as a simple counter. See
[Variables](../how_tos/variables/index.md) for more details.
```python
# Create a Variable, that will be initialized to the scalar value 0.
state = tf.Variable(0, name="counter")
# Create an Op to add one to `state`.
one = tf.constant(1)
new_value = tf.add(state, one)
update = tf.assign(state, new_value)
# Variables must be initialized by running an `init` Op after having
# launched the graph. We first have to add the `init` Op to the graph.
init_op = tf.initialize_all_variables()
# Launch the graph and run the ops.
with tf.Session() as sess:
# Run the 'init' op
sess.run(init_op)
# Print the initial value of 'state'
print(sess.run(state))
# Run the op that updates 'state' and print 'state'.
for _ in range(3):
sess.run(update)
print(sess.run(state))
# output:
# 0
# 1
# 2
# 3
```
The `assign()` operation in this code is a part of the expression graph just
like the `add()` operation, so it does not actually perform the assignment
until `run()` executes the expression.
You typically represent the parameters of a statistical model as a set of
Variables. For example, you would store the weights for a neural network as a
tensor in a Variable. During training you update this tensor by running a
training graph repeatedly.
## Fetches
To fetch the outputs of operations, execute the graph with a `run()` call on
the `Session` object and pass in the tensors to retrieve. In the previous
example we fetched the single node `state`, but you can also fetch multiple
tensors:
```python
input1 = tf.constant(3.0)
input2 = tf.constant(2.0)
input3 = tf.constant(5.0)
intermed = tf.add(input2, input3)
mul = tf.mul(input1, intermed)
with tf.Session() as sess:
result = sess.run([mul, intermed])
print(result)
# output:
# [array([ 21.], dtype=float32), array([ 7.], dtype=float32)]
```
All the ops needed to produce the values of the requested tensors are run once
(not once per requested tensor).
## Feeds
The examples above introduce tensors into the computation graph by storing them
in `Constants` and `Variables`. TensorFlow also provides a feed mechanism for
patching a tensor directly into any operation in the graph.
A feed temporarily replaces the output of an operation with a tensor value.
You supply feed data as an argument to a `run()` call. The feed is only used for
the run call to which it is passed. The most common use case involves
designating specific operations to be "feed" operations by using
tf.placeholder() to create them:
```python
input1 = tf.placeholder(tf.float32)
input2 = tf.placeholder(tf.float32)
output = tf.mul(input1, input2)
with tf.Session() as sess:
print(sess.run([output], feed_dict={input1:[7.], input2:[2.]}))
# output:
# [array([ 14.], dtype=float32)]
```
A `placeholder()` operation generates an error if you do not supply a feed for
it. See the
[MNIST fully-connected feed tutorial](../tutorials/mnist/tf/index.md)
([source code](https://tensorflow.googlesource.com/tensorflow/+/master/tensorflow/g3doc/tutorials/mnist/fully_connected_feed.py))
for a larger-scale example of feeds.
| {
"content_hash": "6d68655aa5370494eb99b4b8f08e5769",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 129,
"avg_line_length": 34.74744027303754,
"alnum_prop": 0.7434436695805913,
"repo_name": "miyosuda/intro-to-dl-android",
"id": "dbbbccc776e1763c9ac239462933920e7c6a2f92",
"size": "10196",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "ImageClassification/jni-build/jni/include/tensorflow/g3doc/get_started/basic_usage.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "286277"
},
{
"name": "C++",
"bytes": "25872569"
},
{
"name": "CSS",
"bytes": "214"
},
{
"name": "HTML",
"bytes": "1249714"
},
{
"name": "Java",
"bytes": "168408"
},
{
"name": "JavaScript",
"bytes": "12988"
},
{
"name": "Jupyter Notebook",
"bytes": "1483370"
},
{
"name": "Makefile",
"bytes": "3180"
},
{
"name": "Objective-C",
"bytes": "2576"
},
{
"name": "Protocol Buffer",
"bytes": "1199784"
},
{
"name": "Python",
"bytes": "5899210"
},
{
"name": "Ruby",
"bytes": "5784"
},
{
"name": "Shell",
"bytes": "45750"
},
{
"name": "TypeScript",
"bytes": "527234"
}
],
"symlink_target": ""
} |
<?php
declare(strict_types=1);
namespace SolidWorx\Toggler\Storage;
use Exception;
use function file_get_contents;
use function file_put_contents;
use InvalidArgumentException;
use function is_file;
use function is_readable;
use function sprintf;
use Symfony\Component\Yaml\Yaml;
class YamlFileStorage extends ArrayStorage implements PersistentStorageInterface
{
/**
* @var string
*/
private $filePath;
public function __construct(string $filePath)
{
if (!class_exists(Yaml::class)) {
throw new Exception('The symfony/yaml component is needed in order to load config from yaml file');
}
if (!is_file($filePath) || !is_readable($filePath)) {
throw new InvalidArgumentException(sprintf('The file %s either does not exist, or is not readable', $filePath));
}
$this->filePath = $filePath;
$content = file_get_contents($this->filePath);
if (false !== $content) {
parent::__construct(Yaml::parse($content));
}
}
public function set(string $key, bool $value): bool
{
$this->config[$key] = $value;
file_put_contents($this->filePath, Yaml::dump($this->config));
return $value;
}
}
| {
"content_hash": "100de3f6f71c57dbe00f8e0854b47995",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 124,
"avg_line_length": 24.076923076923077,
"alnum_prop": 0.6381789137380192,
"repo_name": "pierredup/toggler",
"id": "a678533fb5480f712258fd61769c7f3a563974f0",
"size": "1480",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/Storage/YamlFileStorage.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "28369"
}
],
"symlink_target": ""
} |
using System;
using TermAttribute = Lucene.Net.Analysis.Tokenattributes.TermAttribute;
using Fieldable = Lucene.Net.Documents.Fieldable;
using UnicodeUtil = Lucene.Net.Util.UnicodeUtil;
namespace Lucene.Net.Index
{
sealed class TermsHashPerField:InvertedDocConsumerPerField
{
private void InitBlock()
{
postingsHashHalfSize = postingsHashSize / 2;
postingsHashMask = postingsHashSize - 1;
postingsHash = new RawPostingList[postingsHashSize];
}
internal TermsHashConsumerPerField consumer;
internal TermsHashPerField nextPerField;
internal TermsHashPerThread perThread;
internal DocumentsWriter.DocState docState;
internal FieldInvertState fieldState;
internal TermAttribute termAtt;
// Copied from our perThread
internal CharBlockPool charPool;
internal IntBlockPool intPool;
internal ByteBlockPool bytePool;
internal int streamCount;
internal int numPostingInt;
internal FieldInfo fieldInfo;
internal bool postingsCompacted;
internal int numPostings;
private int postingsHashSize = 4;
private int postingsHashHalfSize;
private int postingsHashMask;
private RawPostingList[] postingsHash;
private RawPostingList p;
public TermsHashPerField(DocInverterPerField docInverterPerField, TermsHashPerThread perThread, TermsHashPerThread nextPerThread, FieldInfo fieldInfo)
{
InitBlock();
this.perThread = perThread;
intPool = perThread.intPool;
charPool = perThread.charPool;
bytePool = perThread.bytePool;
docState = perThread.docState;
fieldState = docInverterPerField.fieldState;
this.consumer = perThread.consumer.AddField(this, fieldInfo);
streamCount = consumer.GetStreamCount();
numPostingInt = 2 * streamCount;
this.fieldInfo = fieldInfo;
if (nextPerThread != null)
nextPerField = (TermsHashPerField) nextPerThread.AddField(docInverterPerField, fieldInfo);
else
nextPerField = null;
}
internal void ShrinkHash(int targetSize)
{
System.Diagnostics.Debug.Assert(postingsCompacted || numPostings == 0);
int newSize = 4;
if (newSize != postingsHash.Length)
{
postingsHash = new RawPostingList[newSize];
postingsHashSize = newSize;
postingsHashHalfSize = newSize / 2;
postingsHashMask = newSize - 1;
}
System.Array.Clear(postingsHash,0,postingsHash.Length);
}
public void Reset()
{
if (!postingsCompacted)
CompactPostings();
System.Diagnostics.Debug.Assert(numPostings <= postingsHash.Length);
if (numPostings > 0)
{
perThread.termsHash.RecyclePostings(postingsHash, numPostings);
Array.Clear(postingsHash, 0, numPostings);
numPostings = 0;
}
postingsCompacted = false;
if (nextPerField != null)
nextPerField.Reset();
}
public override void Abort()
{
lock (this)
{
Reset();
if (nextPerField != null)
nextPerField.Abort();
}
}
public void InitReader(ByteSliceReader reader, RawPostingList p, int stream)
{
System.Diagnostics.Debug.Assert(stream < streamCount);
int[] ints = intPool.buffers[p.intStart >> DocumentsWriter.INT_BLOCK_SHIFT];
int upto = p.intStart & DocumentsWriter.INT_BLOCK_MASK;
reader.Init(bytePool, p.byteStart + stream * ByteBlockPool.FIRST_LEVEL_SIZE, ints[upto + stream]);
}
private void CompactPostings()
{
lock (this)
{
int upto = 0;
for (int i = 0; i < postingsHashSize; i++)
{
if (postingsHash[i] != null)
{
if (upto < i)
{
postingsHash[upto] = postingsHash[i];
postingsHash[i] = null;
}
upto++;
}
}
System.Diagnostics.Debug.Assert(upto == numPostings);
postingsCompacted = true;
}
}
/// <summary>Collapse the hash table & sort in-place. </summary>
public RawPostingList[] SortPostings()
{
CompactPostings();
QuickSort(postingsHash, 0, numPostings - 1);
return postingsHash;
}
internal void QuickSort(RawPostingList[] postings, int lo, int hi)
{
if (lo >= hi)
return ;
else if (hi == 1 + lo)
{
if (ComparePostings(postings[lo], postings[hi]) > 0)
{
RawPostingList tmp = postings[lo];
postings[lo] = postings[hi];
postings[hi] = tmp;
}
return ;
}
int mid = SupportClass.Number.URShift((lo + hi), 1);
if (ComparePostings(postings[lo], postings[mid]) > 0)
{
RawPostingList tmp = postings[lo];
postings[lo] = postings[mid];
postings[mid] = tmp;
}
if (ComparePostings(postings[mid], postings[hi]) > 0)
{
RawPostingList tmp = postings[mid];
postings[mid] = postings[hi];
postings[hi] = tmp;
if (ComparePostings(postings[lo], postings[mid]) > 0)
{
RawPostingList tmp2 = postings[lo];
postings[lo] = postings[mid];
postings[mid] = tmp2;
}
}
int left = lo + 1;
int right = hi - 1;
if (left >= right)
return ;
RawPostingList partition = postings[mid];
for (; ; )
{
while (ComparePostings(postings[right], partition) > 0)
--right;
while (left < right && ComparePostings(postings[left], partition) <= 0)
++left;
if (left < right)
{
RawPostingList tmp = postings[left];
postings[left] = postings[right];
postings[right] = tmp;
--right;
}
else
{
break;
}
}
QuickSort(postings, lo, left);
QuickSort(postings, left + 1, hi);
}
/// <summary>Compares term text for two Posting instance and
/// returns -1 if p1 < p2; 1 if p1 > p2; else 0.
/// </summary>
internal int ComparePostings(RawPostingList p1, RawPostingList p2)
{
if (p1 == p2)
return 0;
char[] text1 = charPool.buffers[p1.textStart >> DocumentsWriter.CHAR_BLOCK_SHIFT];
int pos1 = p1.textStart & DocumentsWriter.CHAR_BLOCK_MASK;
char[] text2 = charPool.buffers[p2.textStart >> DocumentsWriter.CHAR_BLOCK_SHIFT];
int pos2 = p2.textStart & DocumentsWriter.CHAR_BLOCK_MASK;
System.Diagnostics.Debug.Assert(text1 != text2 || pos1 != pos2);
while (true)
{
char c1 = text1[pos1++];
char c2 = text2[pos2++];
if (c1 != c2)
{
if (0xffff == c2)
return 1;
else if (0xffff == c1)
return - 1;
else
return c1 - c2;
}
else
// This method should never compare equal postings
// unless p1==p2
System.Diagnostics.Debug.Assert(c1 != 0xffff);
}
}
/// <summary>Test whether the text for current RawPostingList p equals
/// current tokenText.
/// </summary>
private bool PostingEquals(char[] tokenText, int tokenTextLen)
{
char[] text = perThread.charPool.buffers[p.textStart >> DocumentsWriter.CHAR_BLOCK_SHIFT];
System.Diagnostics.Debug.Assert(text != null);
int pos = p.textStart & DocumentsWriter.CHAR_BLOCK_MASK;
int tokenPos = 0;
for (; tokenPos < tokenTextLen; pos++, tokenPos++)
if (tokenText[tokenPos] != text[pos])
return false;
return 0xffff == text[pos];
}
private bool doCall;
private bool doNextCall;
internal override void Start(Fieldable f)
{
termAtt = (TermAttribute) fieldState.attributeSource.AddAttribute(typeof(TermAttribute));
consumer.Start(f);
if (nextPerField != null)
{
nextPerField.Start(f);
}
}
internal override bool Start(Fieldable[] fields, int count)
{
doCall = consumer.Start(fields, count);
if (nextPerField != null)
doNextCall = nextPerField.Start(fields, count);
return doCall || doNextCall;
}
// Secondary entry point (for 2nd & subsequent TermsHash),
// because token text has already been "interned" into
// textStart, so we hash by textStart
public void Add(int textStart)
{
int code = textStart;
int hashPos = code & postingsHashMask;
System.Diagnostics.Debug.Assert(!postingsCompacted);
// Locate RawPostingList in hash
p = postingsHash[hashPos];
if (p != null && p.textStart != textStart)
{
// Conflict: keep searching different locations in
// the hash table.
int inc = ((code >> 8) + code) | 1;
do
{
code += inc;
hashPos = code & postingsHashMask;
p = postingsHash[hashPos];
}
while (p != null && p.textStart != textStart);
}
if (p == null)
{
// First time we are seeing this token since we last
// flushed the hash.
// Refill?
if (0 == perThread.freePostingsCount)
perThread.MorePostings();
// Pull next free RawPostingList from free list
p = perThread.freePostings[--perThread.freePostingsCount];
System.Diagnostics.Debug.Assert(p != null);
p.textStart = textStart;
System.Diagnostics.Debug.Assert(postingsHash [hashPos] == null);
postingsHash[hashPos] = p;
numPostings++;
if (numPostings == postingsHashHalfSize)
RehashPostings(2 * postingsHashSize);
// Init stream slices
if (numPostingInt + intPool.intUpto > DocumentsWriter.INT_BLOCK_SIZE)
intPool.NextBuffer();
if (DocumentsWriter.BYTE_BLOCK_SIZE - bytePool.byteUpto < numPostingInt * ByteBlockPool.FIRST_LEVEL_SIZE)
bytePool.NextBuffer();
intUptos = intPool.buffer;
intUptoStart = intPool.intUpto;
intPool.intUpto += streamCount;
p.intStart = intUptoStart + intPool.intOffset;
for (int i = 0; i < streamCount; i++)
{
int upto = bytePool.NewSlice(ByteBlockPool.FIRST_LEVEL_SIZE);
intUptos[intUptoStart + i] = upto + bytePool.byteOffset;
}
p.byteStart = intUptos[intUptoStart];
consumer.NewTerm(p);
}
else
{
intUptos = intPool.buffers[p.intStart >> DocumentsWriter.INT_BLOCK_SHIFT];
intUptoStart = p.intStart & DocumentsWriter.INT_BLOCK_MASK;
consumer.AddTerm(p);
}
}
// Primary entry point (for first TermsHash)
internal override void Add()
{
System.Diagnostics.Debug.Assert(!postingsCompacted);
// We are first in the chain so we must "intern" the
// term text into textStart address
// Get the text of this term.
char[] tokenText = termAtt.TermBuffer();
;
int tokenTextLen = termAtt.TermLength();
// Compute hashcode & replace any invalid UTF16 sequences
int downto = tokenTextLen;
int code = 0;
while (downto > 0)
{
char ch = tokenText[--downto];
if (ch >= UnicodeUtil.UNI_SUR_LOW_START && ch <= UnicodeUtil.UNI_SUR_LOW_END)
{
if (0 == downto)
{
// Unpaired
ch = tokenText[downto] = (char) (UnicodeUtil.UNI_REPLACEMENT_CHAR);
}
else
{
char ch2 = tokenText[downto - 1];
if (ch2 >= UnicodeUtil.UNI_SUR_HIGH_START && ch2 <= UnicodeUtil.UNI_SUR_HIGH_END)
{
// OK: high followed by low. This is a valid
// surrogate pair.
code = ((code * 31) + ch) * 31 + ch2;
downto--;
continue;
}
else
{
// Unpaired
ch = tokenText[downto] = (char) (UnicodeUtil.UNI_REPLACEMENT_CHAR);
}
}
}
else if (ch >= UnicodeUtil.UNI_SUR_HIGH_START && (ch <= UnicodeUtil.UNI_SUR_HIGH_END || ch == 0xffff))
{
// Unpaired or 0xffff
ch = tokenText[downto] = (char) (UnicodeUtil.UNI_REPLACEMENT_CHAR);
}
code = (code * 31) + ch;
}
int hashPos = code & postingsHashMask;
// Locate RawPostingList in hash
p = postingsHash[hashPos];
if (p != null && !PostingEquals(tokenText, tokenTextLen))
{
// Conflict: keep searching different locations in
// the hash table.
int inc = ((code >> 8) + code) | 1;
do
{
code += inc;
hashPos = code & postingsHashMask;
p = postingsHash[hashPos];
}
while (p != null && !PostingEquals(tokenText, tokenTextLen));
}
if (p == null)
{
// First time we are seeing this token since we last
// flushed the hash.
int textLen1 = 1 + tokenTextLen;
if (textLen1 + charPool.charUpto > DocumentsWriter.CHAR_BLOCK_SIZE)
{
if (textLen1 > DocumentsWriter.CHAR_BLOCK_SIZE)
{
// Just skip this term, to remain as robust as
// possible during indexing. A TokenFilter
// can be inserted into the analyzer chain if
// other behavior is wanted (pruning the term
// to a prefix, throwing an exception, etc).
if (docState.maxTermPrefix == null)
docState.maxTermPrefix = new System.String(tokenText, 0, 30);
consumer.SkippingLongTerm();
return ;
}
charPool.NextBuffer();
}
// Refill?
if (0 == perThread.freePostingsCount)
perThread.MorePostings();
// Pull next free RawPostingList from free list
p = perThread.freePostings[--perThread.freePostingsCount];
System.Diagnostics.Debug.Assert(p != null);
char[] text = charPool.buffer;
int textUpto = charPool.charUpto;
p.textStart = textUpto + charPool.charOffset;
charPool.charUpto += textLen1;
Array.Copy(tokenText, 0, text, textUpto, tokenTextLen);
text[textUpto + tokenTextLen] = (char) (0xffff);
System.Diagnostics.Debug.Assert(postingsHash [hashPos] == null);
postingsHash[hashPos] = p;
numPostings++;
if (numPostings == postingsHashHalfSize)
RehashPostings(2 * postingsHashSize);
// Init stream slices
if (numPostingInt + intPool.intUpto > DocumentsWriter.INT_BLOCK_SIZE)
intPool.NextBuffer();
if (DocumentsWriter.BYTE_BLOCK_SIZE - bytePool.byteUpto < numPostingInt * ByteBlockPool.FIRST_LEVEL_SIZE)
bytePool.NextBuffer();
intUptos = intPool.buffer;
intUptoStart = intPool.intUpto;
intPool.intUpto += streamCount;
p.intStart = intUptoStart + intPool.intOffset;
for (int i = 0; i < streamCount; i++)
{
int upto = bytePool.NewSlice(ByteBlockPool.FIRST_LEVEL_SIZE);
intUptos[intUptoStart + i] = upto + bytePool.byteOffset;
}
p.byteStart = intUptos[intUptoStart];
consumer.NewTerm(p);
}
else
{
intUptos = intPool.buffers[p.intStart >> DocumentsWriter.INT_BLOCK_SHIFT];
intUptoStart = p.intStart & DocumentsWriter.INT_BLOCK_MASK;
consumer.AddTerm(p);
}
if (doNextCall)
nextPerField.Add(p.textStart);
}
internal int[] intUptos;
internal int intUptoStart;
internal void WriteByte(int stream, byte b)
{
int upto = intUptos[intUptoStart + stream];
byte[] bytes = bytePool.buffers[upto >> DocumentsWriter.BYTE_BLOCK_SHIFT];
System.Diagnostics.Debug.Assert(bytes != null);
int offset = upto & DocumentsWriter.BYTE_BLOCK_MASK;
if (bytes[offset] != 0)
{
// End of slice; allocate a new one
offset = bytePool.AllocSlice(bytes, offset);
bytes = bytePool.buffer;
intUptos[intUptoStart + stream] = offset + bytePool.byteOffset;
}
bytes[offset] = b;
(intUptos[intUptoStart + stream])++;
}
public void WriteBytes(int stream, byte[] b, int offset, int len)
{
// TODO: optimize
int end = offset + len;
for (int i = offset; i < end; i++)
WriteByte(stream, b[i]);
}
internal void WriteVInt(int stream, int i)
{
System.Diagnostics.Debug.Assert(stream < streamCount);
while ((i & ~ 0x7F) != 0)
{
WriteByte(stream, (byte) ((i & 0x7f) | 0x80));
i = SupportClass.Number.URShift(i, 7);
}
WriteByte(stream, (byte) i);
}
internal override void Finish()
{
consumer.Finish();
if (nextPerField != null)
nextPerField.Finish();
}
/// <summary>Called when postings hash is too small (> 50%
/// occupied) or too large (< 20% occupied).
/// </summary>
internal void RehashPostings(int newSize)
{
int newMask = newSize - 1;
RawPostingList[] newHash = new RawPostingList[newSize];
for (int i = 0; i < postingsHashSize; i++)
{
RawPostingList p0 = postingsHash[i];
if (p0 != null)
{
int code;
if (perThread.primary)
{
int start = p0.textStart & DocumentsWriter.CHAR_BLOCK_MASK;
char[] text = charPool.buffers[p0.textStart >> DocumentsWriter.CHAR_BLOCK_SHIFT];
int pos = start;
while (text[pos] != 0xffff)
pos++;
code = 0;
while (pos > start)
code = (code * 31) + text[--pos];
}
else
code = p0.textStart;
int hashPos = code & newMask;
System.Diagnostics.Debug.Assert(hashPos >= 0);
if (newHash[hashPos] != null)
{
int inc = ((code >> 8) + code) | 1;
do
{
code += inc;
hashPos = code & newMask;
}
while (newHash[hashPos] != null);
}
newHash[hashPos] = p0;
}
}
postingsHashMask = newMask;
postingsHash = newHash;
postingsHashSize = newSize;
postingsHashHalfSize = newSize >> 1;
}
}
} | {
"content_hash": "b305c4a5987848467879e8983fdbea05",
"timestamp": "",
"source": "github",
"line_count": 624,
"max_line_length": 152,
"avg_line_length": 27.858974358974358,
"alnum_prop": 0.6121721122871606,
"repo_name": "Mpdreamz/lucene.net",
"id": "86a5185f2807a44df7859a5f790463431594cbf7",
"size": "18199",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/core/Index/TermsHashPerField.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package org.knowm.xchange.hitbtc.v2.service;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.dto.Order;
import org.knowm.xchange.dto.trade.*;
import org.knowm.xchange.exceptions.NotYetImplementedForExchangeException;
import org.knowm.xchange.hitbtc.v2.HitbtcAdapters;
import org.knowm.xchange.hitbtc.v2.dto.HitbtcOrder;
import org.knowm.xchange.hitbtc.v2.dto.HitbtcOwnTrade;
import org.knowm.xchange.service.trade.TradeService;
import org.knowm.xchange.service.trade.params.CancelOrderByIdParams;
import org.knowm.xchange.service.trade.params.CancelOrderParams;
import org.knowm.xchange.service.trade.params.TradeHistoryParamCurrencyPair;
import org.knowm.xchange.service.trade.params.TradeHistoryParamLimit;
import org.knowm.xchange.service.trade.params.TradeHistoryParamOffset;
import org.knowm.xchange.service.trade.params.TradeHistoryParamPaging;
import org.knowm.xchange.service.trade.params.TradeHistoryParams;
import org.knowm.xchange.service.trade.params.orders.OpenOrdersParams;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class HitbtcTradeService extends HitbtcTradeServiceRaw implements TradeService {
public HitbtcTradeService(Exchange exchange) {
super(exchange);
}
@Override
public OpenOrders getOpenOrders() throws IOException {
return getOpenOrders(createOpenOrdersParams());
}
@Override
public OpenOrders getOpenOrders(OpenOrdersParams params) throws IOException {
List<HitbtcOrder> openOrdersRaw = getOpenOrdersRaw();
return HitbtcAdapters.adaptOpenOrders(openOrdersRaw);
}
@Override
public String placeMarketOrder(MarketOrder marketOrder) throws IOException {
return placeMarketOrderRaw(marketOrder).clientOrderId;
}
@Override
public String placeLimitOrder(LimitOrder limitOrder) throws IOException {
return placeLimitOrderRaw(limitOrder).clientOrderId;
}
@Override
public String placeStopOrder(StopOrder stopOrder) throws IOException {
throw new NotYetImplementedForExchangeException();
}
@Override
public boolean cancelOrder(String orderId) throws IOException {
HitbtcOrder cancelOrderRaw = cancelOrderRaw(orderId);
return "canceled".equals(cancelOrderRaw.status);
}
@Override
public boolean cancelOrder(CancelOrderParams orderParams) throws IOException {
if (orderParams instanceof CancelOrderByIdParams) {
return cancelOrder(((CancelOrderByIdParams) orderParams).getOrderId());
} else {
return false;
}
}
/**
* Required parameters: {@link TradeHistoryParamPaging} {@link TradeHistoryParamCurrencyPair}
*/
@Override
public UserTrades getTradeHistory(TradeHistoryParams params) throws IOException {
long limit = 1000;
long offset = 0;
if (params instanceof TradeHistoryParamLimit) {
limit = ((TradeHistoryParamLimit) params).getLimit();
}
if (params instanceof TradeHistoryParamOffset) {
TradeHistoryParamOffset tradeHistoryParamOffset = (TradeHistoryParamOffset) params;
offset = tradeHistoryParamOffset.getOffset();
}
String symbol = null;
if (params instanceof TradeHistoryParamCurrencyPair) {
CurrencyPair pair = ((TradeHistoryParamCurrencyPair) params).getCurrencyPair();
symbol = HitbtcAdapters.adaptCurrencyPair(pair);
}
List<HitbtcOwnTrade> tradeHistoryRaw = getTradeHistoryRaw(symbol, limit, offset);
return HitbtcAdapters.adaptTradeHistory(tradeHistoryRaw, exchange.getExchangeMetaData());
}
@Override
public TradeHistoryParams createTradeHistoryParams() {
return new HitbtcTradeHistoryParams(null, 100, 0L);
}
@Override
public OpenOrdersParams createOpenOrdersParams() {
return null;
}
@Override
public Collection<Order> getOrder(String... orderIds) throws IOException {
if (orderIds == null || orderIds.length == 0){
return new ArrayList<>();
}
Collection<Order> orders = new ArrayList<>();
for (String orderId : orderIds) {
HitbtcOrder rawOrder = getHitbtcOrder("BTCUSD", orderId);
if (rawOrder != null)
orders.add(HitbtcAdapters.adaptOrder(rawOrder));
}
return orders;
}
@Override
public void verifyOrder(LimitOrder limitOrder) {
throw new NotYetImplementedForExchangeException();
}
@Override
public void verifyOrder(MarketOrder marketOrder) {
throw new NotYetImplementedForExchangeException();
}
} | {
"content_hash": "0b3af5c957f2adb9af2861823a33759a",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 95,
"avg_line_length": 32.30935251798561,
"alnum_prop": 0.7679804052549544,
"repo_name": "evdubs/XChange",
"id": "f0f3573c444230a8950f49b24aed9c816e57c6c2",
"size": "4491",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "xchange-hitbtc/src/main/java/org/knowm/xchange/hitbtc/v2/service/HitbtcTradeService.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "5220592"
}
],
"symlink_target": ""
} |
<?php
use \Model as ParisModel;
$app->group('/present', function () use ($app) {
$app->get('/', function () use ($app) {
$sugg = ParisModel::factory('\GLLApp\Model\Suggestion');
$suggestions = $sugg
->limit(4)
->order_by_desc('created_at')
->find_many();
// the first shall be last
$suggestions = array_reverse($suggestions);
$app->render('pages/present/doors.html', ['suggestions' => $suggestions]);
});
});
| {
"content_hash": "c76e1a48049fe8e2a38ff5bc63dff371",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 82,
"avg_line_length": 32,
"alnum_prop": 0.49264705882352944,
"repo_name": "GreaterLaLa/greaterlala.in",
"id": "2f082c29ceb078f3e443e53678129aa77d419853",
"size": "544",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/routes/present.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "19824"
},
{
"name": "JavaScript",
"bytes": "166623"
},
{
"name": "PHP",
"bytes": "22470"
},
{
"name": "Shell",
"bytes": "246"
}
],
"symlink_target": ""
} |
Code copyright {YYYY} {name of copyright owner}. Code released under
[Apache License, Version 2.0](https://github.com/antonvorobyev/snippets-license/blob/master/LICENSE) | {
"content_hash": "d453357133af239343b98fa84bff5f24",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 101,
"avg_line_length": 57.666666666666664,
"alnum_prop": 0.7803468208092486,
"repo_name": "antonvorobyev/snippets-license",
"id": "262b15ec110776871c75a6a31ca490a4c8d720af",
"size": "216",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "666"
}
],
"symlink_target": ""
} |
class CMenu : public CRenderable, public CUpdateable, public CGameLocation
{
public:
virtual ~CMenu(){};
virtual void Enter() = 0;
virtual void Draw(CWindow *theWindow) = 0;
virtual void Update(CTime elapsedTime) = 0;
virtual void Exit() = 0;
};
#endif
| {
"content_hash": "98b7a4c09f1342bff4a006dacae01777",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 74,
"avg_line_length": 23.25,
"alnum_prop": 0.6630824372759857,
"repo_name": "sizlo/SwingGame",
"id": "ee03a0374b670faeef5e9d9e2320b7968a663c8c",
"size": "920",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/CMenu.hpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "22917"
},
{
"name": "C++",
"bytes": "551655"
},
{
"name": "Objective-C++",
"bytes": "4864"
},
{
"name": "Shell",
"bytes": "271"
},
{
"name": "TeX",
"bytes": "59140"
}
],
"symlink_target": ""
} |
export default /* glsl */`
#ifdef MAPCOLOR
uniform vec3 material_specular;
#endif
void getSpecularity() {
vec3 specularColor = vec3(1,1,1);
#ifdef MAPCOLOR
specularColor *= material_specular;
#endif
#ifdef MAPTEXTURE
specularColor *= $DECODE(texture2DBias($SAMPLER, $UV, textureBias)).$CH;
#endif
#ifdef MAPVERTEX
specularColor *= saturate(vVertexColor.$VC);
#endif
dSpecularity = specularColor;
}
`;
| {
"content_hash": "948d691442026e0cd21f7f56df22a32b",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 76,
"avg_line_length": 18.791666666666668,
"alnum_prop": 0.6740576496674058,
"repo_name": "playcanvas/engine",
"id": "3583211bc0e05ebc0a88f3e3dad6adfcfd52e3d7",
"size": "451",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/scene/shader-lib/chunks/standard/frag/specular.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "19"
},
{
"name": "GLSL",
"bytes": "68"
},
{
"name": "HTML",
"bytes": "112"
},
{
"name": "JavaScript",
"bytes": "5722120"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.quicksight.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
* <p>
* Dashboard error.
* </p>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DashboardError" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DashboardError implements Serializable, Cloneable, StructuredPojo {
/**
* <p>
* Type.
* </p>
*/
private String type;
/**
* <p>
* Message.
* </p>
*/
private String message;
/**
* <p>
* Type.
* </p>
*
* @param type
* Type.
* @see DashboardErrorType
*/
public void setType(String type) {
this.type = type;
}
/**
* <p>
* Type.
* </p>
*
* @return Type.
* @see DashboardErrorType
*/
public String getType() {
return this.type;
}
/**
* <p>
* Type.
* </p>
*
* @param type
* Type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DashboardErrorType
*/
public DashboardError withType(String type) {
setType(type);
return this;
}
/**
* <p>
* Type.
* </p>
*
* @param type
* Type.
* @return Returns a reference to this object so that method calls can be chained together.
* @see DashboardErrorType
*/
public DashboardError withType(DashboardErrorType type) {
this.type = type.toString();
return this;
}
/**
* <p>
* Message.
* </p>
*
* @param message
* Message.
*/
public void setMessage(String message) {
this.message = message;
}
/**
* <p>
* Message.
* </p>
*
* @return Message.
*/
public String getMessage() {
return this.message;
}
/**
* <p>
* Message.
* </p>
*
* @param message
* Message.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DashboardError withMessage(String message) {
setMessage(message);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getMessage() != null)
sb.append("Message: ").append(getMessage());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DashboardError == false)
return false;
DashboardError other = (DashboardError) obj;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getMessage() == null ^ this.getMessage() == null)
return false;
if (other.getMessage() != null && other.getMessage().equals(this.getMessage()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getMessage() == null) ? 0 : getMessage().hashCode());
return hashCode;
}
@Override
public DashboardError clone() {
try {
return (DashboardError) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.quicksight.model.transform.DashboardErrorMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}
| {
"content_hash": "0519f11c11b43465733f247952ba5ce0",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 137,
"avg_line_length": 24.00507614213198,
"alnum_prop": 0.5567773313596955,
"repo_name": "aws/aws-sdk-java",
"id": "0f7673b448ace769de88d3f604fcbdf35bee52f0",
"size": "5309",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-quicksight/src/main/java/com/amazonaws/services/quicksight/model/DashboardError.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
// Copyright 2000-2017 JetBrains s.r.o.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.jetbrains.python.packaging.requirement;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Comparator;
import java.util.Objects;
import static com.intellij.webcore.packaging.PackageVersionComparator.VERSION_COMPARATOR;
/**
* @apiNote This class will be converted to interface in 2018.2.
*/
public class PyRequirementVersionSpec {
@NotNull
private final PyRequirementRelation myRelation;
@Nullable
private final PyRequirementVersion myParsedVersion;
@NotNull
private final String myVersion;
@NotNull
private final Comparator<String> myVersionComparator;
/**
* @deprecated Use {@link com.jetbrains.python.packaging.PyRequirement} instead.
* This constructor will be removed in 2018.2.
*/
public PyRequirementVersionSpec(@NotNull PyRequirementRelation relation, @NotNull PyRequirementVersion version) {
this(relation, version, version.getPresentableText(), VERSION_COMPARATOR);
}
/**
* @deprecated Use {@link com.jetbrains.python.packaging.PyRequirement} instead.
* This constructor will be removed in 2018.2.
*/
public PyRequirementVersionSpec(@NotNull String version) {
this(PyRequirementRelation.STR_EQ, null, version, VERSION_COMPARATOR);
}
private PyRequirementVersionSpec(@NotNull PyRequirementRelation relation,
@Nullable PyRequirementVersion parsedVersion,
@NotNull String version,
@NotNull Comparator<String> versionComparator) {
myRelation = relation;
myParsedVersion = parsedVersion;
myVersion = version;
myVersionComparator = versionComparator;
}
/**
* @deprecated This method will be removed in 2018.2.
*/
@NotNull
@Deprecated
public PyRequirementVersionSpec withVersionComparator(@NotNull Comparator<String> comparator) {
return new PyRequirementVersionSpec(myRelation, myParsedVersion, myVersion, comparator);
}
@Override
public String toString() {
return myRelation + myVersion;
}
@Override
public boolean equals(Object o) {
if (o == this) return true;
if (o == null || getClass() != o.getClass()) return false;
final PyRequirementVersionSpec spec = (PyRequirementVersionSpec)o;
return myRelation == spec.myRelation && myVersion.equals(spec.myVersion);
}
@Override
public int hashCode() {
return 31 * myRelation.hashCode() + myVersion.hashCode();
}
@NotNull
public PyRequirementRelation getRelation() {
return myRelation;
}
@NotNull
public String getVersion() {
return myVersion;
}
public boolean matches(@NotNull String version) {
switch (myRelation) {
case LT:
return myVersionComparator.compare(version, myVersion) < 0;
case LTE:
return myVersionComparator.compare(version, myVersion) <= 0;
case GT:
return myVersionComparator.compare(version, myVersion) > 0;
case GTE:
return myVersionComparator.compare(version, myVersion) >= 0;
case EQ:
Objects.requireNonNull(myParsedVersion);
final Pair<String, String> publicAndLocalVersions = splitIntoPublicAndLocalVersions(myParsedVersion);
final Pair<String, String> otherPublicAndLocalVersions = splitIntoPublicAndLocalVersions(version);
final boolean publicVersionsAreSame =
myVersionComparator.compare(otherPublicAndLocalVersions.first, publicAndLocalVersions.first) == 0;
return publicVersionsAreSame &&
(publicAndLocalVersions.second.isEmpty() || otherPublicAndLocalVersions.second.equals(publicAndLocalVersions.second));
case NE:
return myVersionComparator.compare(version, myVersion) != 0;
case COMPATIBLE:
Objects.requireNonNull(myParsedVersion);
return new PyRequirementVersionSpec(PyRequirementRelation.GTE, myParsedVersion)
.withVersionComparator(myVersionComparator)
.matches(version) &&
new PyRequirementVersionSpec(PyRequirementRelation.EQ, toEqPartOfCompatibleRelation(myParsedVersion))
.withVersionComparator(myVersionComparator)
.matches(version);
case STR_EQ:
return version.equals(myVersion);
default:
return false;
}
}
@NotNull
private static Pair<String, String> splitIntoPublicAndLocalVersions(@NotNull PyRequirementVersion version) {
final PyRequirementVersion withoutLocal =
new PyRequirementVersion(version.getEpoch(), version.getRelease(), version.getPre(), version.getPost(), version.getDev(), null);
return Pair.createNonNull(withoutLocal.getPresentableText(), StringUtil.notNullize(version.getLocal()));
}
@NotNull
private static Pair<String, String> splitIntoPublicAndLocalVersions(@NotNull String version) {
final String[] publicAndLocalVersions = version.split("\\+", 2);
final String publicVersion = publicAndLocalVersions[0];
final String localVersion = publicAndLocalVersions.length == 1 ? "" : publicAndLocalVersions[1];
return Pair.createNonNull(publicVersion, localVersion);
}
@NotNull
private static PyRequirementVersion toEqPartOfCompatibleRelation(@NotNull PyRequirementVersion version) {
final String release = version.getRelease();
final int lastPoint = release.lastIndexOf('.');
if (lastPoint == -1) return version;
return new PyRequirementVersion(version.getEpoch(), release.substring(0, lastPoint + 1) + "*", null, null, null, null);
}
}
| {
"content_hash": "17467a408ea04cd77d8d3319092b310b",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 134,
"avg_line_length": 36.23255813953488,
"alnum_prop": 0.7230423620025674,
"repo_name": "mglukhikh/intellij-community",
"id": "49e642440023223e0b389de1960394138809b90b",
"size": "6232",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "python/openapi/src/com/jetbrains/python/packaging/requirement/PyRequirementVersionSpec.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AMPL",
"bytes": "20665"
},
{
"name": "AspectJ",
"bytes": "182"
},
{
"name": "Batchfile",
"bytes": "60827"
},
{
"name": "C",
"bytes": "211435"
},
{
"name": "C#",
"bytes": "1264"
},
{
"name": "C++",
"bytes": "197674"
},
{
"name": "CMake",
"bytes": "1675"
},
{
"name": "CSS",
"bytes": "201445"
},
{
"name": "CoffeeScript",
"bytes": "1759"
},
{
"name": "Erlang",
"bytes": "10"
},
{
"name": "Groovy",
"bytes": "3243028"
},
{
"name": "HLSL",
"bytes": "57"
},
{
"name": "HTML",
"bytes": "1899088"
},
{
"name": "J",
"bytes": "5050"
},
{
"name": "Java",
"bytes": "165554704"
},
{
"name": "JavaScript",
"bytes": "570364"
},
{
"name": "Jupyter Notebook",
"bytes": "93222"
},
{
"name": "Kotlin",
"bytes": "4611299"
},
{
"name": "Lex",
"bytes": "147047"
},
{
"name": "Makefile",
"bytes": "2352"
},
{
"name": "NSIS",
"bytes": "51276"
},
{
"name": "Objective-C",
"bytes": "27861"
},
{
"name": "Perl",
"bytes": "903"
},
{
"name": "Perl 6",
"bytes": "26"
},
{
"name": "Protocol Buffer",
"bytes": "6680"
},
{
"name": "Python",
"bytes": "25439881"
},
{
"name": "Roff",
"bytes": "37534"
},
{
"name": "Ruby",
"bytes": "1217"
},
{
"name": "Scala",
"bytes": "11698"
},
{
"name": "Shell",
"bytes": "66341"
},
{
"name": "Smalltalk",
"bytes": "338"
},
{
"name": "TeX",
"bytes": "25473"
},
{
"name": "Thrift",
"bytes": "1846"
},
{
"name": "TypeScript",
"bytes": "9469"
},
{
"name": "Visual Basic",
"bytes": "77"
},
{
"name": "XSLT",
"bytes": "113040"
}
],
"symlink_target": ""
} |
package org.wisdom.framework.instances.it;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.osgi.framework.BundleContext;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.service.cm.Configuration;
import org.osgi.service.cm.ConfigurationAdmin;
import org.ow2.chameleon.testing.helpers.IPOJOHelper;
import org.ow2.chameleon.testing.helpers.OSGiHelper;
import org.wisdom.framework.instances.component.MyComponent;
import org.wisdom.test.parents.WisdomTest;
import javax.inject.Inject;
import java.io.IOException;
import java.util.Properties;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import static com.jayway.awaitility.Awaitility.await;
import static org.assertj.core.api.Assertions.assertThat;
public class CreationIT extends WisdomTest {
@Inject
ConfigurationAdmin admin;
@Inject
BundleContext context;
private OSGiHelper osgi;
private IPOJOHelper ipojo;
@Before
public void init() throws IOException, InvalidSyntaxException {
osgi = new OSGiHelper(context);
ipojo = new IPOJOHelper(context);
cleanupConfigurationAdmin();
}
@After
public void shutdown() throws IOException, InvalidSyntaxException {
cleanupConfigurationAdmin();
osgi.dispose();
ipojo.dispose();
}
protected void cleanupConfigurationAdmin() throws IOException, InvalidSyntaxException {
Configuration[] configurations = admin.listConfigurations(null);
if (configurations != null) {
for (Configuration conf : configurations) {
if (!conf.getPid().contains("instantiated.at.boot")) {
conf.delete();
}
}
}
await().atMost(1, TimeUnit.MINUTES).until(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return osgi.getServiceObject(MyComponent.class) == null;
}
});
}
@Test
public void testDynamicInstantiationAndDeletion() throws IOException, InterruptedException {
assertThat(osgi.getServiceObject(MyComponent.class)).isNull();
final Configuration configuration = admin.getConfiguration("org.wisdom.conf");
Properties properties = new Properties();
properties.put("user", "wisdom");
configuration.update(properties);
await().atMost(1, TimeUnit.MINUTES).until(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return osgi.getServiceObject(MyComponent.class) != null;
}
});
MyComponent service = osgi.getServiceObject(MyComponent.class);
assertThat(service).isNotNull();
assertThat(service.hello()).contains("wisdom");
// Deleting the configuration
configuration.delete();
await().atMost(1, TimeUnit.MINUTES).until(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return osgi.getServiceObject(MyComponent.class) == null;
}
});
assertThat(osgi.getServiceObject(MyComponent.class)).isNull();
}
@Test
public void testDynamicInstantiationAndUpdate() throws IOException, InterruptedException {
assertThat(osgi.getServiceObject(MyComponent.class)).isNull();
Configuration configuration = admin.getConfiguration("org.wisdom.conf");
Properties properties = new Properties();
properties.put("user", "wisdom");
configuration.update(properties);
await().atMost(1, TimeUnit.MINUTES).until(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return osgi.getServiceObject(MyComponent.class) != null;
}
});
MyComponent service = osgi.getServiceObject(MyComponent.class);
assertThat(service).isNotNull();
assertThat(service.hello()).contains("wisdom");
// Update the configuration
configuration = admin.getConfiguration("org.wisdom.conf");
properties = new Properties();
properties.put("user", "wisdom-2");
configuration.update(properties);
await().atMost(1, TimeUnit.MINUTES).until(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
MyComponent cmp = osgi.getServiceObject(MyComponent.class);
if (cmp != null) {
if (cmp.hello().contains("wisdom-2")) {
return true;
}
}
return false;
}
});
}
@Test
public void testDynamicInstantiationAndDeletionUsingConfigurationFactory()
throws IOException, InterruptedException {
assertThat(osgi.getServiceObject(MyComponent.class)).isNull();
final Configuration configuration = admin.createFactoryConfiguration("org.wisdom.conf");
Properties properties = new Properties();
properties.put("user", "wisdom");
configuration.update(properties);
await().atMost(1, TimeUnit.MINUTES).until(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return osgi.getServiceObject(MyComponent.class) != null;
}
});
MyComponent service = osgi.getServiceObject(MyComponent.class);
assertThat(service).isNotNull();
assertThat(service.hello()).contains("wisdom");
// Deleting the configuration
configuration.delete();
await().atMost(1, TimeUnit.MINUTES).until(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return osgi.getServiceObject(MyComponent.class) == null;
}
});
assertThat(osgi.getServiceObject(MyComponent.class)).isNull();
}
@Test
public void testDynamicInstantiationAndUpdateUsingConfigurationFactory() throws IOException, InterruptedException {
assertThat(osgi.getServiceObject(MyComponent.class)).isNull();
Configuration configuration = admin.createFactoryConfiguration("org.wisdom.conf");
Properties properties = new Properties();
properties.put("user", "wisdom");
configuration.update(properties);
await().atMost(1, TimeUnit.MINUTES).until(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return osgi.getServiceObject(MyComponent.class) != null;
}
});
MyComponent service = osgi.getServiceObject(MyComponent.class);
assertThat(service).isNotNull();
assertThat(service.hello()).contains("wisdom");
// Update the configuration
configuration = admin.getConfiguration(configuration.getPid());
properties = new Properties();
properties.put("user", "wisdom-2");
configuration.update(properties);
await().atMost(1, TimeUnit.MINUTES).until(new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
MyComponent cmp = osgi.getServiceObject(MyComponent.class);
if (cmp != null) {
if (cmp.hello().contains("wisdom-2")) {
return true;
}
}
return false;
}
});
}
}
| {
"content_hash": "13cb339a7723328ac7a7dcf96c56cd2a",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 119,
"avg_line_length": 34.55707762557078,
"alnum_prop": 0.6302854122621564,
"repo_name": "CRDNicolasBourbaki/wisdom",
"id": "e6f4d5883c89add30bec17eb60803c601b052d44",
"size": "8224",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "extensions/wisdom-instantiatedby/src/test/java/org/wisdom/framework/instances/it/CreationIT.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "116999"
},
{
"name": "CoffeeScript",
"bytes": "1967"
},
{
"name": "Groovy",
"bytes": "16844"
},
{
"name": "HTML",
"bytes": "251715"
},
{
"name": "Java",
"bytes": "3770968"
},
{
"name": "JavaScript",
"bytes": "3219816"
}
],
"symlink_target": ""
} |
"""Globals"""
from django.conf import settings
KEY_STUBS_OPEN_METEAR_API = "open_metear_api"
URL_STUBS_CHANGE_ROUTE_CONFIG = "%s/stubs/change_route_configuration/" % settings.SITE_URL
| {
"content_hash": "5e1d9c4935bf889d92a01ba7ffefcba7",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 90,
"avg_line_length": 26.714285714285715,
"alnum_prop": 0.7433155080213903,
"repo_name": "timevortexproject/timevortex",
"id": "7140d54dd9362cbc55187737acda63d952f4d32f",
"size": "274",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "stubs/utils/globals.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "45763"
},
{
"name": "Cucumber",
"bytes": "10679"
},
{
"name": "HTML",
"bytes": "714"
},
{
"name": "JavaScript",
"bytes": "88987"
},
{
"name": "Python",
"bytes": "173584"
},
{
"name": "Ruby",
"bytes": "3140"
},
{
"name": "Shell",
"bytes": "511"
}
],
"symlink_target": ""
} |
/*
* Copyright (c) 2008, 2009, 2010, 2011 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* OpenFlow: protocol between controller and datapath. */
#ifndef OPENFLOW_11_H
#define OPENFLOW_11_H 1
#include "openflow/openflow-common.h"
/* OpenFlow 1.1 uses 32-bit port numbers. Open vSwitch, for now, uses OpenFlow
* 1.0 port numbers internally. We map them to OpenFlow 1.0 as follows:
*
* OF1.1 <=> OF1.0
* ----------------------- ---------------
* 0x00000000...0x0000feff <=> 0x0000...0xfeff "physical" ports
* 0x0000ff00...0xfffffeff <=> not supported
* 0xffffff00...0xffffffff <=> 0xff00...0xffff "reserved" OFPP_* ports
*
* OFPP11_OFFSET is the value that must be added or subtracted to convert
* an OpenFlow 1.0 reserved port number to or from, respectively, the
* corresponding OpenFlow 1.1 reserved port number.
*/
#define OFPP11_MAX 0xffffff00
#define OFPP11_OFFSET (OFPP11_MAX - OFPP_MAX)
/* OpenFlow 1.1 port config flags are just the common flags. */
#define OFPPC11_ALL \
(OFPPC_PORT_DOWN | OFPPC_NO_RECV | OFPPC_NO_FWD | OFPPC_NO_PACKET_IN)
/* OpenFlow 1.1 specific current state of the physical port. These are not
* configurable from the controller.
*/
enum ofp11_port_state {
OFPPS11_BLOCKED = 1 << 1, /* Port is blocked */
OFPPS11_LIVE = 1 << 2, /* Live for Fast Failover Group. */
#define OFPPS11_ALL (OFPPS_LINK_DOWN | OFPPS11_BLOCKED | OFPPS11_LIVE)
};
/* OpenFlow 1.1 specific features of ports available in a datapath. */
enum ofp11_port_features {
OFPPF11_40GB_FD = 1 << 7, /* 40 Gb full-duplex rate support. */
OFPPF11_100GB_FD = 1 << 8, /* 100 Gb full-duplex rate support. */
OFPPF11_1TB_FD = 1 << 9, /* 1 Tb full-duplex rate support. */
OFPPF11_OTHER = 1 << 10, /* Other rate, not in the list. */
OFPPF11_COPPER = 1 << 11, /* Copper medium. */
OFPPF11_FIBER = 1 << 12, /* Fiber medium. */
OFPPF11_AUTONEG = 1 << 13, /* Auto-negotiation. */
OFPPF11_PAUSE = 1 << 14, /* Pause. */
OFPPF11_PAUSE_ASYM = 1 << 15 /* Asymmetric pause. */
#define OFPPF11_ALL ((1 << 16) - 1)
};
/* Description of a port */
struct ofp11_port {
ovs_be32 port_no;
uint8_t pad[4];
uint8_t hw_addr[OFP_ETH_ALEN];
uint8_t pad2[2]; /* Align to 64 bits. */
char name[OFP_MAX_PORT_NAME_LEN]; /* Null-terminated */
ovs_be32 config; /* Bitmap of OFPPC_* flags. */
ovs_be32 state; /* Bitmap of OFPPS_* and OFPPS11_* flags. */
/* Bitmaps of OFPPF_* and OFPPF11_* that describe features. All bits
* zeroed if unsupported or unavailable. */
ovs_be32 curr; /* Current features. */
ovs_be32 advertised; /* Features being advertised by the port. */
ovs_be32 supported; /* Features supported by the port. */
ovs_be32 peer; /* Features advertised by peer. */
ovs_be32 curr_speed; /* Current port bitrate in kbps. */
ovs_be32 max_speed; /* Max port bitrate in kbps */
};
/* Modify behavior of the physical port */
struct ofp11_port_mod {
ovs_be32 port_no;
uint8_t pad[4];
uint8_t hw_addr[OFP_ETH_ALEN]; /* The hardware address is not
configurable. This is used to
sanity-check the request, so it must
be the same as returned in an
ofp11_port struct. */
uint8_t pad2[2]; /* Pad to 64 bits. */
ovs_be32 config; /* Bitmap of OFPPC_* flags. */
ovs_be32 mask; /* Bitmap of OFPPC_* flags to be changed. */
ovs_be32 advertise; /* Bitmap of OFPPF_* and OFPPF11_*. Zero all bits
to prevent any action taking place. */
uint8_t pad3[4]; /* Pad to 64 bits. */
};
OFP_ASSERT(sizeof(struct ofp11_port_mod) == 32);
/* Group setup and teardown (controller -> datapath). */
struct ofp11_group_mod {
ovs_be16 command; /* One of OFPGC_*. */
uint8_t type; /* One of OFPGT_*. */
uint8_t pad; /* Pad to 64 bits. */
ovs_be32 group_id; /* Group identifier. */
/* struct ofp11_bucket buckets[0]; The bucket length is inferred from the
length field in the header. */
};
OFP_ASSERT(sizeof(struct ofp11_group_mod) == 8);
/* Query for port queue configuration. */
struct ofp11_queue_get_config_request {
ovs_be32 port;
/* Port to be queried. Should refer
to a valid physical port (i.e. < OFPP_MAX) */
uint8_t pad[4];
};
OFP_ASSERT(sizeof(struct ofp11_queue_get_config_request) == 8);
/* Group commands */
enum ofp11_group_mod_command {
OFPGC11_ADD, /* New group. */
OFPGC11_MODIFY, /* Modify all matching groups. */
OFPGC11_DELETE, /* Delete all matching groups. */
};
/* OpenFlow 1.1 specific capabilities supported by the datapath (struct
* ofp_switch_features, member capabilities). */
enum ofp11_capabilities {
OFPC11_GROUP_STATS = 1 << 3, /* Group statistics. */
};
enum ofp11_action_type {
OFPAT11_OUTPUT, /* Output to switch port. */
OFPAT11_SET_VLAN_VID, /* Set the 802.1q VLAN id. */
OFPAT11_SET_VLAN_PCP, /* Set the 802.1q priority. */
OFPAT11_SET_DL_SRC, /* Ethernet source address. */
OFPAT11_SET_DL_DST, /* Ethernet destination address. */
OFPAT11_SET_NW_SRC, /* IP source address. */
OFPAT11_SET_NW_DST, /* IP destination address. */
OFPAT11_SET_NW_TOS, /* IP ToS (DSCP field, 6 bits). */
OFPAT11_SET_NW_ECN, /* IP ECN (2 bits). */
OFPAT11_SET_TP_SRC, /* TCP/UDP/SCTP source port. */
OFPAT11_SET_TP_DST, /* TCP/UDP/SCTP destination port. */
OFPAT11_COPY_TTL_OUT, /* Copy TTL "outwards" -- from next-to-outermost
to outermost */
OFPAT11_COPY_TTL_IN, /* Copy TTL "inwards" -- from outermost to
next-to-outermost */
OFPAT11_SET_MPLS_LABEL, /* MPLS label */
OFPAT11_SET_MPLS_TC, /* MPLS TC */
OFPAT11_SET_MPLS_TTL, /* MPLS TTL */
OFPAT11_DEC_MPLS_TTL, /* Decrement MPLS TTL */
OFPAT11_PUSH_VLAN, /* Push a new VLAN tag */
OFPAT11_POP_VLAN, /* Pop the outer VLAN tag */
OFPAT11_PUSH_MPLS, /* Push a new MPLS tag */
OFPAT11_POP_MPLS, /* Pop the outer MPLS tag */
OFPAT11_SET_QUEUE, /* Set queue id when outputting to a port */
OFPAT11_GROUP, /* Apply group. */
OFPAT11_SET_NW_TTL, /* IP TTL. */
OFPAT11_DEC_NW_TTL, /* Decrement IP TTL. */
OFPAT11_EXPERIMENTER = 0xffff
};
#define OFPMT11_STANDARD_LENGTH 88
struct ofp11_match_header {
ovs_be16 type; /* One of OFPMT_* */
ovs_be16 length; /* Length of match */
};
OFP_ASSERT(sizeof(struct ofp11_match_header) == 4);
/* Fields to match against flows */
struct ofp11_match {
struct ofp11_match_header omh;
ovs_be32 in_port; /* Input switch port. */
ovs_be32 wildcards; /* Wildcard fields. */
uint8_t dl_src[OFP_ETH_ALEN]; /* Ethernet source address. */
uint8_t dl_src_mask[OFP_ETH_ALEN]; /* Ethernet source address mask. */
uint8_t dl_dst[OFP_ETH_ALEN]; /* Ethernet destination address. */
uint8_t dl_dst_mask[OFP_ETH_ALEN]; /* Ethernet destination address mask. */
ovs_be16 dl_vlan; /* Input VLAN id. */
uint8_t dl_vlan_pcp; /* Input VLAN priority. */
uint8_t pad1[1]; /* Align to 32-bits */
ovs_be16 dl_type; /* Ethernet frame type. */
uint8_t nw_tos; /* IP ToS (actually DSCP field, 6 bits). */
uint8_t nw_proto; /* IP protocol or lower 8 bits of ARP opcode. */
ovs_be32 nw_src; /* IP source address. */
ovs_be32 nw_src_mask; /* IP source address mask. */
ovs_be32 nw_dst; /* IP destination address. */
ovs_be32 nw_dst_mask; /* IP destination address mask. */
ovs_be16 tp_src; /* TCP/UDP/SCTP source port. */
ovs_be16 tp_dst; /* TCP/UDP/SCTP destination port. */
ovs_be32 mpls_label; /* MPLS label. */
uint8_t mpls_tc; /* MPLS TC. */
uint8_t pad2[3]; /* Align to 64-bits */
ovs_be64 metadata; /* Metadata passed between tables. */
ovs_be64 metadata_mask; /* Mask for metadata. */
};
OFP_ASSERT(sizeof(struct ofp11_match) == OFPMT11_STANDARD_LENGTH);
/* Flow wildcards. */
enum ofp11_flow_wildcards {
OFPFW11_IN_PORT = 1 << 0, /* Switch input port. */
OFPFW11_DL_VLAN = 1 << 1, /* VLAN id. */
OFPFW11_DL_VLAN_PCP = 1 << 2, /* VLAN priority. */
OFPFW11_DL_TYPE = 1 << 3, /* Ethernet frame type. */
OFPFW11_NW_TOS = 1 << 4, /* IP ToS (DSCP field, 6 bits). */
OFPFW11_NW_PROTO = 1 << 5, /* IP protocol. */
OFPFW11_TP_SRC = 1 << 6, /* TCP/UDP/SCTP source port. */
OFPFW11_TP_DST = 1 << 7, /* TCP/UDP/SCTP destination port. */
OFPFW11_MPLS_LABEL = 1 << 8, /* MPLS label. */
OFPFW11_MPLS_TC = 1 << 9, /* MPLS TC. */
/* Wildcard all fields. */
OFPFW11_ALL = ((1 << 10) - 1)
};
/* The VLAN id is 12-bits, so we can use the entire 16 bits to indicate
* special conditions.
*/
enum ofp11_vlan_id {
OFPVID11_ANY = 0xfffe, /* Indicate that a VLAN id is set but don't care
about it's value. Note: only valid when
specifying the VLAN id in a match */
OFPVID11_NONE = 0xffff, /* No VLAN id was set. */
};
enum ofp11_instruction_type {
OFPIT11_GOTO_TABLE = 1, /* Setup the next table in the lookup
pipeline */
OFPIT11_WRITE_METADATA = 2, /* Setup the metadata field for use later
in pipeline */
OFPIT11_WRITE_ACTIONS = 3, /* Write the action(s) onto the datapath
action set */
OFPIT11_APPLY_ACTIONS = 4, /* Applies the action(s) immediately */
OFPIT11_CLEAR_ACTIONS = 5, /* Clears all actions from the datapath
action set */
OFPIT11_EXPERIMENTER = 0xFFFF /* Experimenter instruction */
};
#define OFP11_INSTRUCTION_ALIGN 8
/* Generic ofp_instruction structure. */
struct ofp11_instruction {
ovs_be16 type; /* Instruction type */
ovs_be16 len; /* Length of this struct in bytes. */
uint8_t pad[4]; /* Align to 64-bits */
};
OFP_ASSERT(sizeof(struct ofp11_instruction) == 8);
/* Instruction structure for OFPIT_GOTO_TABLE */
struct ofp11_instruction_goto_table {
ovs_be16 type; /* OFPIT_GOTO_TABLE */
ovs_be16 len; /* Length of this struct in bytes. */
uint8_t table_id; /* Set next table in the lookup pipeline */
uint8_t pad[3]; /* Pad to 64 bits. */
};
OFP_ASSERT(sizeof(struct ofp11_instruction_goto_table) == 8);
/* Instruction structure for OFPIT_WRITE_METADATA */
struct ofp11_instruction_write_metadata {
ovs_be16 type; /* OFPIT_WRITE_METADATA */
ovs_be16 len; /* Length of this struct in bytes. */
uint8_t pad[4]; /* Align to 64-bits */
ovs_be64 metadata; /* Metadata value to write */
ovs_be64 metadata_mask; /* Metadata write bitmask */
};
OFP_ASSERT(sizeof(struct ofp11_instruction_write_metadata) == 24);
/* Instruction structure for OFPIT_WRITE/APPLY/CLEAR_ACTIONS */
struct ofp11_instruction_actions {
ovs_be16 type; /* One of OFPIT_*_ACTIONS */
ovs_be16 len; /* Length of this struct in bytes. */
uint8_t pad[4]; /* Align to 64-bits */
/* struct ofp_action_header actions[0]; Actions associated with
OFPIT_WRITE_ACTIONS and
OFPIT_APPLY_ACTIONS */
};
OFP_ASSERT(sizeof(struct ofp11_instruction_actions) == 8);
/* Instruction structure for experimental instructions */
struct ofp11_instruction_experimenter {
ovs_be16 type; /* OFPIT11_EXPERIMENTER */
ovs_be16 len; /* Length of this struct in bytes */
ovs_be32 experimenter; /* Experimenter ID which takes the same form
as in struct ofp_vendor_header. */
/* Experimenter-defined arbitrary additional data. */
};
OFP_ASSERT(sizeof(struct ofp11_instruction_experimenter) == 8);
/* Action structure for OFPAT_OUTPUT, which sends packets out 'port'.
* When the 'port' is the OFPP_CONTROLLER, 'max_len' indicates the max
* number of bytes to send. A 'max_len' of zero means no bytes of the
* packet should be sent.*/
struct ofp11_action_output {
ovs_be16 type; /* OFPAT11_OUTPUT. */
ovs_be16 len; /* Length is 16. */
ovs_be32 port; /* Output port. */
ovs_be16 max_len; /* Max length to send to controller. */
uint8_t pad[6]; /* Pad to 64 bits. */
};
OFP_ASSERT(sizeof(struct ofp11_action_output) == 16);
/* Action structure for OFPAT_GROUP. */
struct ofp11_action_group {
ovs_be16 type; /* OFPAT11_GROUP. */
ovs_be16 len; /* Length is 8. */
ovs_be32 group_id; /* Group identifier. */
};
OFP_ASSERT(sizeof(struct ofp11_action_group) == 8);
/* OFPAT_SET_QUEUE action struct: send packets to given queue on port. */
struct ofp11_action_set_queue {
ovs_be16 type; /* OFPAT11_SET_QUEUE. */
ovs_be16 len; /* Len is 8. */
ovs_be32 queue_id; /* Queue id for the packets. */
};
OFP_ASSERT(sizeof(struct ofp11_action_set_queue) == 8);
/* Action structure for OFPAT11_SET_MPLS_LABEL. */
struct ofp11_action_mpls_label {
ovs_be16 type; /* OFPAT11_SET_MPLS_LABEL. */
ovs_be16 len; /* Length is 8. */
ovs_be32 mpls_label; /* MPLS label */
};
OFP_ASSERT(sizeof(struct ofp11_action_mpls_label) == 8);
/* Action structure for OFPAT11_SET_MPLS_TC. */
struct ofp11_action_mpls_tc {
ovs_be16 type; /* OFPAT11_SET_MPLS_TC. */
ovs_be16 len; /* Length is 8. */
uint8_t mpls_tc; /* MPLS TC */
uint8_t pad[3];
};
OFP_ASSERT(sizeof(struct ofp11_action_mpls_tc) == 8);
/* Action structure for OFPAT11_SET_MPLS_TTL. */
struct ofp11_action_mpls_ttl {
ovs_be16 type; /* OFPAT11_SET_MPLS_TTL. */
ovs_be16 len; /* Length is 8. */
uint8_t mpls_ttl; /* MPLS TTL */
uint8_t pad[3];
};
OFP_ASSERT(sizeof(struct ofp11_action_mpls_ttl) == 8);
/* Action structure for OFPAT11_SET_NW_ECN. */
struct ofp11_action_nw_ecn {
ovs_be16 type; /* OFPAT11_SET_TW_SRC/DST. */
ovs_be16 len; /* Length is 8. */
uint8_t nw_ecn; /* IP ECN (2 bits). */
uint8_t pad[3];
};
OFP_ASSERT(sizeof(struct ofp11_action_nw_ecn) == 8);
/* Action structure for OFPAT11_SET_NW_TTL. */
struct ofp11_action_nw_ttl {
ovs_be16 type; /* OFPAT11_SET_NW_TTL. */
ovs_be16 len; /* Length is 8. */
uint8_t nw_ttl; /* IP TTL */
uint8_t pad[3];
};
OFP_ASSERT(sizeof(struct ofp11_action_nw_ttl) == 8);
/* Action structure for OFPAT11_PUSH_VLAN/MPLS. */
struct ofp11_action_push {
ovs_be16 type; /* OFPAT11_PUSH_VLAN/MPLS. */
ovs_be16 len; /* Length is 8. */
ovs_be16 ethertype; /* Ethertype */
uint8_t pad[2];
};
OFP_ASSERT(sizeof(struct ofp11_action_push) == 8);
/* Action structure for OFPAT11_POP_MPLS. */
struct ofp11_action_pop_mpls {
ovs_be16 type; /* OFPAT11_POP_MPLS. */
ovs_be16 len; /* Length is 8. */
ovs_be16 ethertype; /* Ethertype */
uint8_t pad[2];
};
OFP_ASSERT(sizeof(struct ofp11_action_pop_mpls) == 8);
/* Configure/Modify behavior of a flow table */
struct ofp11_table_mod {
uint8_t table_id; /* ID of the table, 0xFF indicates all tables */
uint8_t pad[3]; /* Pad to 32 bits */
ovs_be32 config; /* Bitmap of OFPTC_* flags */
};
OFP_ASSERT(sizeof(struct ofp11_table_mod) == 8);
/* Flags to indicate behavior of the flow table for unmatched packets.
These flags are used in ofp_table_stats messages to describe the current
configuration and in ofp_table_mod messages to configure table behavior. */
enum ofp11_table_config {
OFPTC11_TABLE_MISS_CONTROLLER = 0, /* Send to controller. */
OFPTC11_TABLE_MISS_CONTINUE = 1 << 0, /* Continue to the next table in the
pipeline (OpenFlow 1.0
behavior). */
OFPTC11_TABLE_MISS_DROP = 1 << 1, /* Drop the packet. */
OFPTC11_TABLE_MISS_MASK = 3
};
/* Flow setup and teardown (controller -> datapath). */
struct ofp11_flow_mod {
ovs_be64 cookie; /* Opaque controller-issued identifier. */
ovs_be64 cookie_mask; /* Mask used to restrict the cookie bits
that must match when the command is
OFPFC_MODIFY* or OFPFC_DELETE*. A value
of 0 indicates no restriction. */
/* Flow actions. */
uint8_t table_id; /* ID of the table to put the flow in */
uint8_t command; /* One of OFPFC_*. */
ovs_be16 idle_timeout; /* Idle time before discarding (seconds). */
ovs_be16 hard_timeout; /* Max time before discarding (seconds). */
ovs_be16 priority; /* Priority level of flow entry. */
ovs_be32 buffer_id; /* Buffered packet to apply to (or -1).
Not meaningful for OFPFC_DELETE*. */
ovs_be32 out_port; /* For OFPFC_DELETE* commands, require
matching entries to include this as an
output port. A value of OFPP_ANY
indicates no restriction. */
ovs_be32 out_group; /* For OFPFC_DELETE* commands, require
matching entries to include this as an
output group. A value of OFPG11_ANY
indicates no restriction. */
ovs_be16 flags; /* One of OFPFF_*. */
uint8_t pad[2];
/* Followed by an ofp11_match structure. */
/* Followed by an instruction set. */
};
OFP_ASSERT(sizeof(struct ofp11_flow_mod) == 40);
/* Group types. Values in the range [128, 255] are reserved for experimental
* use. */
enum ofp11_group_type {
OFPGT11_ALL, /* All (multicast/broadcast) group. */
OFPGT11_SELECT, /* Select group. */
OFPGT11_INDIRECT, /* Indirect group. */
OFPGT11_FF /* Fast failover group. */
};
/* Group numbering. Groups can use any number up to OFPG_MAX. */
enum ofp11_group {
/* Last usable group number. */
OFPG11_MAX = 0xffffff00,
/* Fake groups. */
OFPG11_ALL = 0xfffffffc, /* Represents all groups for group delete
commands. */
OFPG11_ANY = 0xffffffff /* Wildcard group used only for flow stats
requests. Selects all flows regardless
of group (including flows with no
group). */
};
/* Bucket for use in groups. */
struct ofp11_bucket {
ovs_be16 len; /* Length the bucket in bytes, including
this header and any padding to make it
64-bit aligned. */
ovs_be16 weight; /* Relative weight of bucket. Only
defined for select groups. */
ovs_be32 watch_port; /* Port whose state affects whether this
bucket is live. Only required for fast
failover groups. */
ovs_be32 watch_group; /* Group whose state affects whether this
bucket is live. Only required for fast
failover groups. */
uint8_t pad[4];
/* struct ofp_action_header actions[0]; The action length is inferred
from the length field in the
header. */
};
OFP_ASSERT(sizeof(struct ofp11_bucket) == 16);
/* Queue configuration for a given port. */
struct ofp11_queue_get_config_reply {
ovs_be32 port;
uint8_t pad[4];
/* struct ofp_packet_queue queues[0]; List of configured queues. */
};
OFP_ASSERT(sizeof(struct ofp11_queue_get_config_reply) == 8);
struct ofp11_stats_msg {
struct ofp_header header;
ovs_be16 type; /* One of the OFPST_* constants. */
ovs_be16 flags; /* OFPSF_REQ_* flags (none yet defined). */
uint8_t pad[4];
/* Followed by the body of the request. */
};
OFP_ASSERT(sizeof(struct ofp11_stats_msg) == 16);
/* Vendor extension stats message. */
struct ofp11_vendor_stats_msg {
struct ofp11_stats_msg osm; /* Type OFPST_VENDOR. */
ovs_be32 vendor; /* Vendor ID:
* - MSB 0: low-order bytes are IEEE OUI.
* - MSB != 0: defined by OpenFlow
* consortium. */
/* Followed by vendor-defined arbitrary additional data. */
};
OFP_ASSERT(sizeof(struct ofp11_vendor_stats_msg) == 20);
/* Stats request of type OFPST_FLOW. */
struct ofp11_flow_stats_request {
uint8_t table_id; /* ID of table to read (from ofp_table_stats),
0xff for all tables. */
uint8_t pad[3]; /* Align to 64 bits. */
ovs_be32 out_port; /* Require matching entries to include this
as an output port. A value of OFPP_ANY
indicates no restriction. */
ovs_be32 out_group; /* Require matching entries to include this
as an output group. A value of OFPG11_ANY
indicates no restriction. */
uint8_t pad2[4]; /* Align to 64 bits. */
ovs_be64 cookie; /* Require matching entries to contain this
cookie value */
ovs_be64 cookie_mask; /* Mask used to restrict the cookie bits that
must match. A value of 0 indicates
no restriction. */
/* Followed by an ofp11_match structure. */
};
OFP_ASSERT(sizeof(struct ofp11_flow_stats_request) == 32);
/* Body of reply to OFPST_FLOW request. */
struct ofp11_flow_stats {
ovs_be16 length; /* Length of this entry. */
uint8_t table_id; /* ID of table flow came from. */
uint8_t pad;
ovs_be32 duration_sec; /* Time flow has been alive in seconds. */
ovs_be32 duration_nsec; /* Time flow has been alive in nanoseconds beyond
duration_sec. */
ovs_be16 priority; /* Priority of the entry. Only meaningful
when this is not an exact-match entry. */
ovs_be16 idle_timeout; /* Number of seconds idle before expiration. */
ovs_be16 hard_timeout; /* Number of seconds before expiration. */
uint8_t pad2[6]; /* Align to 64-bits. */
ovs_be64 cookie; /* Opaque controller-issued identifier. */
ovs_be64 packet_count; /* Number of packets in flow. */
ovs_be64 byte_count; /* Number of bytes in flow. */
/* Open Flow version specific match */
/* struct ofp11_instruction instructions[0]; Instruction set. */
};
OFP_ASSERT(sizeof(struct ofp11_flow_stats) == 48);
/* Body for ofp_stats_request of type OFPST_AGGREGATE. */
/* Identical to ofp11_flow_stats_request */
/* Body of reply to OFPST_TABLE request. */
struct ofp11_table_stats {
uint8_t table_id; /* Identifier of table. Lower numbered tables
are consulted first. */
uint8_t pad[7]; /* Align to 64-bits. */
char name[OFP_MAX_TABLE_NAME_LEN];
ovs_be32 wildcards; /* Bitmap of OFPFMF_* wildcards that are
supported by the table. */
ovs_be32 match; /* Bitmap of OFPFMF_* that indicate the fields
the table can match on. */
ovs_be32 instructions; /* Bitmap of OFPIT_* values supported. */
ovs_be32 write_actions; /* Bitmap of OFPAT_* that are supported
by the table with OFPIT_WRITE_ACTIONS. */
ovs_be32 apply_actions; /* Bitmap of OFPAT_* that are supported
by the table with OFPIT_APPLY_ACTIONS. */
ovs_be32 config; /* Bitmap of OFPTC_* values */
ovs_be32 max_entries; /* Max number of entries supported. */
ovs_be32 active_count; /* Number of active entries. */
ovs_be64 lookup_count; /* Number of packets looked up in table. */
ovs_be64 matched_count; /* Number of packets that hit table. */
};
OFP_ASSERT(sizeof(struct ofp11_table_stats) == 88);
/* Body for ofp_stats_request of type OFPST_PORT. */
struct ofp11_port_stats_request {
ovs_be32 port_no; /* OFPST_PORT message must request statistics
* either for a single port (specified in
* port_no) or for all ports (if port_no ==
* OFPP_ANY). */
uint8_t pad[4];
};
OFP_ASSERT(sizeof(struct ofp11_port_stats_request) == 8);
/* Body of reply to OFPST_PORT request. If a counter is unsupported, set
* the field to all ones. */
struct ofp11_port_stats {
ovs_be32 port_no;
uint8_t pad[4]; /* Align to 64-bits. */
ovs_be64 rx_packets; /* Number of received packets. */
ovs_be64 tx_packets; /* Number of transmitted packets. */
ovs_be64 rx_bytes; /* Number of received bytes. */
ovs_be64 tx_bytes; /* Number of transmitted bytes. */
ovs_be64 rx_dropped; /* Number of packets dropped by RX. */
ovs_be64 tx_dropped; /* Number of packets dropped by TX. */
ovs_be64 rx_errors; /* Number of receive errors. This is a
super-set of receive errors and should be
great than or equal to the sum of all
rx_*_err values. */
ovs_be64 tx_errors; /* Number of transmit errors. This is a
super-set of transmit errors. */
ovs_be64 rx_frame_err; /* Number of frame alignment errors. */
ovs_be64 rx_over_err; /* Number of packets with RX overrun. */
ovs_be64 rx_crc_err; /* Number of CRC errors. */
ovs_be64 collisions; /* Number of collisions. */
};
OFP_ASSERT(sizeof(struct ofp11_port_stats) == 104);
struct ofp11_queue_stats_request {
ovs_be32 port_no; /* All ports if OFPP_ANY. */
ovs_be32 queue_id; /* All queues if OFPQ_ALL. */
};
OFP_ASSERT(sizeof(struct ofp11_queue_stats_request) == 8);
struct ofp11_queue_stats {
ovs_be32 port_no;
ovs_be32 queue_id; /* Queue id. */
ovs_be64 tx_bytes; /* Number of transmitted bytes. */
ovs_be64 tx_packets; /* Number of transmitted packets. */
ovs_be64 tx_errors; /* # of packets dropped due to overrun. */
};
OFP_ASSERT(sizeof(struct ofp11_queue_stats) == 32);
struct ofp11_group_stats_request {
ovs_be32 group_id; /* All groups if OFPG_ALL. */
uint8_t pad[4]; /* Align to 64 bits. */
};
OFP_ASSERT(sizeof(struct ofp11_group_stats_request) == 8);
/* Body of reply to OFPST11_GROUP request */
struct ofp11_group_stats {
ovs_be16 length; /* Length of this entry. */
uint8_t pad[2]; /* Align to 64 bits. */
ovs_be32 group_id; /* Group identifier. */
ovs_be32 ref_count; /* Number of flows or groups that
directly forward to this group. */
uint8_t pad2[4]; /* Align to 64 bits. */
ovs_be64 packet_count; /* Number of packets processed by group. */
ovs_be64 byte_count; /* Number of bytes processed by group. */
/* struct ofp11_bucket_counter bucket_stats[0]; */
};
OFP_ASSERT(sizeof(struct ofp11_group_stats) == 32);
/* Used in group stats replies. */
struct ofp11_bucket_counter {
ovs_be64 packet_count; /* Number of packets processed by bucket. */
ovs_be64 byte_count; /* Number of bytes processed by bucket. */
};
OFP_ASSERT(sizeof(struct ofp11_bucket_counter) == 16);
/* Body of reply to OFPST11_GROUP_DESC request. */
struct ofp11_group_desc_stats {
ovs_be16 length; /* Length of this entry. */
uint8_t type; /* One of OFPGT_*. */
uint8_t pad; /* Pad to 64 bits. */
ovs_be32 group_id; /* Group identifier. */
/* struct ofp11_bucket buckets[0]; */
};
OFP_ASSERT(sizeof(struct ofp11_group_desc_stats) == 8);
/* Send packet (controller -> datapath). */
struct ofp11_packet_out {
ovs_be32 buffer_id; /* ID assigned by datapath (-1 if none). */
ovs_be32 in_port; /* Packet's input port or OFPP_CONTROLLER. */
ovs_be16 actions_len; /* Size of action array in bytes. */
uint8_t pad[6];
/* struct ofp_action_header actions[0]; Action list. */
/* uint8_t data[0]; */ /* Packet data. The length is inferred
from the length field in the header.
(Only meaningful if buffer_id == -1.) */
};
OFP_ASSERT(sizeof(struct ofp11_packet_out) == 16);
/* Packet received on port (datapath -> controller). */
struct ofp11_packet_in {
ovs_be32 buffer_id; /* ID assigned by datapath. */
ovs_be32 in_port; /* Port on which frame was received. */
ovs_be32 in_phy_port; /* Physical Port on which frame was received. */
ovs_be16 total_len; /* Full length of frame. */
uint8_t reason; /* Reason packet is being sent (one of OFPR_*) */
uint8_t table_id; /* ID of the table that was looked up */
uint8_t data[0]; /* Ethernet frame, halfway through 32-bit word,
so the IP header is 32-bit aligned. The
amount of data is inferred from the length
field in the header. Because of padding,
offsetof(struct ofp_packet_in, data) ==
sizeof(struct ofp_packet_in) - 2. */
};
OFP_ASSERT(sizeof(struct ofp11_packet_in) == 16);
/* Flow removed (datapath -> controller). */
struct ofp11_flow_removed {
ovs_be64 cookie; /* Opaque controller-issued identifier. */
ovs_be16 priority; /* Priority level of flow entry. */
uint8_t reason; /* One of OFPRR_*. */
uint8_t table_id; /* ID of the table */
ovs_be32 duration_sec; /* Time flow was alive in seconds. */
ovs_be32 duration_nsec; /* Time flow was alive in nanoseconds beyond
duration_sec. */
ovs_be16 idle_timeout; /* Idle timeout from original flow mod. */
uint8_t pad2[2]; /* Align to 64-bits. */
ovs_be64 packet_count;
ovs_be64 byte_count;
/* Followed by an ofp11_match structure. */
};
OFP_ASSERT(sizeof(struct ofp11_flow_removed) == 40);
#endif /* openflow/openflow-1.1.h */
| {
"content_hash": "84158e7035d4f840374f9921a9e8ecab",
"timestamp": "",
"source": "github",
"line_count": 719,
"max_line_length": 80,
"avg_line_length": 45.450625869262865,
"alnum_prop": 0.5613084855717739,
"repo_name": "yeasy/lazyctrl",
"id": "696c3ec45167c3df65961f9c38fd4866efb19d31",
"size": "34405",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lcm/openvswitch-lc/include/openflow/openflow-1.1.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "6404314"
},
{
"name": "C++",
"bytes": "21715"
},
{
"name": "CSS",
"bytes": "181"
},
{
"name": "Java",
"bytes": "2601540"
},
{
"name": "JavaScript",
"bytes": "44598"
},
{
"name": "Objective-C",
"bytes": "12571"
},
{
"name": "Perl",
"bytes": "17324"
},
{
"name": "Python",
"bytes": "834817"
},
{
"name": "Shell",
"bytes": "71009"
}
],
"symlink_target": ""
} |
"""
Support for interface with an Harman/Kardon or JBL AVR.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.harman_kardon_avr/
"""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.media_player import (
MediaPlayerDevice, PLATFORM_SCHEMA)
from homeassistant.components.media_player.const import (
SUPPORT_TURN_OFF, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_STEP,
SUPPORT_TURN_ON, SUPPORT_SELECT_SOURCE)
from homeassistant.const import (
CONF_HOST, CONF_NAME, CONF_PORT, STATE_OFF, STATE_ON)
REQUIREMENTS = ['hkavr==0.0.5']
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = 'Harman Kardon AVR'
DEFAULT_PORT = 10025
SUPPORT_HARMAN_KARDON_AVR = SUPPORT_VOLUME_STEP | SUPPORT_VOLUME_MUTE | \
SUPPORT_TURN_OFF | SUPPORT_TURN_ON | \
SUPPORT_SELECT_SOURCE
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_HOST): cv.string,
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
vol.Optional(CONF_PORT, default=DEFAULT_PORT): cv.port,
})
def setup_platform(hass, config, add_entities, discover_info=None):
"""Set up the AVR platform."""
import hkavr
name = config[CONF_NAME]
host = config[CONF_HOST]
port = config[CONF_PORT]
avr = hkavr.HkAVR(host, port, name)
avr_device = HkAvrDevice(avr)
add_entities([avr_device], True)
class HkAvrDevice(MediaPlayerDevice):
"""Representation of a Harman Kardon AVR / JBL AVR TV."""
def __init__(self, avr):
"""Initialize a new HarmanKardonAVR."""
self._avr = avr
self._name = avr.name
self._host = avr.host
self._port = avr.port
self._source_list = avr.sources
self._state = None
self._muted = avr.muted
self._current_source = avr.current_source
def update(self):
"""Update the state of this media_player."""
if self._avr.is_on():
self._state = STATE_ON
elif self._avr.is_off():
self._state = STATE_OFF
else:
self._state = None
self._muted = self._avr.muted
self._current_source = self._avr.current_source
@property
def name(self):
"""Return the name of the device."""
return self._name
@property
def state(self):
"""Return the state of the device."""
return self._state
@property
def is_volume_muted(self):
"""Muted status not available."""
return self._muted
@property
def source(self):
"""Return the current input source."""
return self._current_source
@property
def source_list(self):
"""Available sources."""
return self._source_list
@property
def supported_features(self):
"""Flag media player features that are supported."""
return SUPPORT_HARMAN_KARDON_AVR
def turn_on(self):
"""Turn the AVR on."""
self._avr.power_on()
def turn_off(self):
"""Turn off the AVR."""
self._avr.power_off()
def select_source(self, source):
"""Select input source."""
return self._avr.select_source(source)
def volume_up(self):
"""Volume up the AVR."""
return self._avr.volume_up()
def volume_down(self):
"""Volume down AVR."""
return self._avr.volume_down()
def mute_volume(self, mute):
"""Send mute command."""
return self._avr.mute(mute)
| {
"content_hash": "86c96bd3eb9b7425c9fc12266b153c77",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 74,
"avg_line_length": 27.06766917293233,
"alnum_prop": 0.6191666666666666,
"repo_name": "PetePriority/home-assistant",
"id": "334757c086dbaf670512c8776d55e08dbc1cb8a0",
"size": "3600",
"binary": false,
"copies": "4",
"ref": "refs/heads/dev",
"path": "homeassistant/components/media_player/harman_kardon_avr.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1175"
},
{
"name": "Dockerfile",
"bytes": "1073"
},
{
"name": "Python",
"bytes": "13985647"
},
{
"name": "Ruby",
"bytes": "745"
},
{
"name": "Shell",
"bytes": "17364"
}
],
"symlink_target": ""
} |
AliAnalysisTask* AddTaskTPCPIDEtaQA(TString period = "", Bool_t isPbpOrpPb = kFALSE,
AliTPCPIDBase::TPCcutType tpcCutType = AliTPCPIDBase::kTPCCutMIGeo /*AliTPCPIDBase::kTPCnclCut*/,
Bool_t usePhiCut = kFALSE,
Double_t ptThresholdForPhiCut = 0.0,
TString centralityEstimator = ""/*"ITSTPCtracklets" or "ppMultV0M" or ""*/){
//get the current analysis manager
AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
if (!mgr) {
Error("AddTaskTPCPIDEtaQA", "No analysis manager found.");
return 0;
}
//========= Add task to the ANALYSIS manager =====
AliTPCPIDEtaQA *task = new AliTPCPIDEtaQA("TPCPIDEtaQA");
task->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kINT7);
//
// Add track filters
//
AliAnalysisFilter* trackFilter = new AliAnalysisFilter("trackFilter");
AliESDtrackCuts* esdTrackCutsL = 0x0;
printf("\nSettings:\n");
if (period.Contains("LHC11") || period.Contains("LHC12") || period.Contains("LHC13")) {
esdTrackCutsL = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE);
printf("Using standard ITS-TPC track cuts 2011\n");
}
else if (period.Contains("LHC10")) {
esdTrackCutsL = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010(kTRUE);
printf("Using standard ITS-TPC track cuts 2010\n");
}
else {
esdTrackCutsL = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kTRUE);
printf("WARNING: Cuts not configured for this period!!! Using standard ITS-TPC track cuts 2011\n");
}
/*
esdTrackCutsL->SetMinNCrossedRowsTPC(120);
esdTrackCutsL->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
esdTrackCutsL->SetMaxChi2PerClusterITS(36);
esdTrackCutsL->SetMaxFractionSharedTPCClusters(0.4);
esdTrackCutsL->SetMaxChi2TPCConstrainedGlobal(36);
*/
task->SetIsPbpOrpPb(isPbpOrpPb);
if (task->GetIsPbpOrpPb()) {
printf("Collision type pPb/Pbp set -> Adapting vertex cuts!\n");
}
else {
printf("Collision type different from pPb/Pbp -> Using standard vertex cuts!\n");
}
trackFilter->AddCuts(esdTrackCutsL);
task->SetTrackFilter(trackFilter);
task->SetEtaCut(0.9);
task->SetUsePhiCut(usePhiCut);
task->SetPtThresholdForPhiCut(ptThresholdForPhiCut);
task->SetTPCcutType(tpcCutType);
task->SetCentralityEstimator(centralityEstimator);
printf("Eta cut: %f\n", task->GetEtaCut());
printf("UsePhiCut: %d\n", task->GetUsePhiCut());
if (task->GetUsePhiCut())
printf("PtThresholdForPhiCut: %f\n", task->GetPtThresholdForPhiCut());
printf("UseTPCCutMIGeo: %d\n", task->GetUseTPCCutMIGeo());
printf("UseTPCnclCut: %d\n", task->GetUseTPCnclCut());
printf("Centrality estimator: \"%s\"\n", task->GetCentralityEstimator().Data());
task->SetZvtxCutEvent(10.0);
printf("Cut on z position of vertex: %.2f cm\n", task->GetZvtxCutEvent());
printf("UsePhiCut: %d\nPtThresholdForPhiCut: %.3f GeV/c\n\n", task->GetUsePhiCut(), task->GetPtThresholdForPhiCut());
mgr->AddTask(task);
printf("Task added to analysis manager, connecting containers.\n\n");
//================================================
// data containers
//================================================
// find input container
//below the trunk version
AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
//define output containers, please use 'username'_'somename'
AliAnalysisDataContainer *coutput1 =
mgr->CreateContainer("TPCPIDEtaQA", TObjArray::Class(),
AliAnalysisManager::kOutputContainer,"TPCPIDEtaQA.root");
//connect containers
mgr->ConnectInput (task, 0, cinput );
if (mgr->GetCommonOutputContainer()) {
//dummy output container
AliAnalysisDataContainer *coutput0 =
mgr->CreateContainer("TPCPIDEtaQA_dummy",
TTree::Class(),
AliAnalysisManager::kExchangeContainer,
"TPCPIDEtaQA_default");
mgr->ConnectOutput (task, 0, coutput0);
}
mgr->ConnectOutput (task, 1, coutput1);
return task;
}
| {
"content_hash": "875f9da5ab12e3f9e586b3ec773f2b55",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 133,
"avg_line_length": 39.8,
"alnum_prop": 0.6575735821966978,
"repo_name": "victor-gonzalez/AliPhysics",
"id": "265fbf042e9fdaec33bba4e57a3407823c33e9ed",
"size": "4179",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "PWGPP/TPC/macros/AddTaskTPCPIDEtaQA.C",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "92854400"
},
{
"name": "C++",
"bytes": "192735484"
},
{
"name": "CMake",
"bytes": "694146"
},
{
"name": "CSS",
"bytes": "5189"
},
{
"name": "Fortran",
"bytes": "176927"
},
{
"name": "HTML",
"bytes": "34924"
},
{
"name": "JavaScript",
"bytes": "3536"
},
{
"name": "Makefile",
"bytes": "24994"
},
{
"name": "Objective-C",
"bytes": "62560"
},
{
"name": "Perl",
"bytes": "18619"
},
{
"name": "Python",
"bytes": "797351"
},
{
"name": "SWIG",
"bytes": "33320"
},
{
"name": "Shell",
"bytes": "1127312"
},
{
"name": "TeX",
"bytes": "392122"
}
],
"symlink_target": ""
} |
class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new # guest user (not logged in)
if user.admin?
can :manage, :all
else
case user.permission
when 1
can :read, :all, :hidden => false
when 2
can [:read, :create], :all
when 3
can [:read, :create, :update], :all
when 4
can :manage, :all
end
can :manage, Schedule do |s|
s.user = user
end
cannot :manage, User
end
end
end
| {
"content_hash": "461a902e05a2dadc6bcf817214b61ca9",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 50,
"avg_line_length": 19.846153846153847,
"alnum_prop": 0.5348837209302325,
"repo_name": "wentaoliu/rtiss",
"id": "0dd363d11289120b21c5577a2a6c91f5a3360957",
"size": "516",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/models/ability.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1299"
},
{
"name": "CoffeeScript",
"bytes": "2858"
},
{
"name": "HTML",
"bytes": "116956"
},
{
"name": "Ruby",
"bytes": "195039"
}
],
"symlink_target": ""
} |
namespace YAF.Editors
{
#region Using
using System;
using YAF.Classes.Editors;
using YAF.Core;
using YAF.Types;
using YAF.Types.Extensions;
using YAF.Types.Interfaces;
#endregion
/// <summary>
/// The same as the TextEditor except it adds YAF BBCode support. Used for QuickReply
/// functionality.
/// </summary>
public class BasicBBCodeEditor : TextEditor
{
#region Properties
/// <summary>
/// Gets Description.
/// </summary>
[NotNull]
public override string Description
{
get
{
return "Basic BBCode Editor";
}
}
/// <summary>
/// Gets ModuleId.
/// </summary>
public override string ModuleId
{
get
{
// backward compatibility...
return "5";
}
}
/// <summary>
/// Gets a value indicating whether UsesBBCode.
/// </summary>
public override bool UsesBBCode
{
get
{
return true;
}
}
#endregion
#region Methods
/// <summary>
/// Handles the PreRender event of the Editor control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
protected override void Editor_PreRender([NotNull] object sender, [NotNull] EventArgs e)
{
base.Editor_PreRender(sender, e);
YafContext.Current.PageElements.RegisterJsInclude(
"YafEditorJs",
#if DEBUG
this.ResolveUrl("yafEditor/yafEditor.js"));
#else
this.ResolveUrl("yafEditor/yafEditor.min.js"));
#endif
YafContext.Current.PageElements.RegisterJsBlock(
"CreateYafEditorJs",
"var {0}=new yafEditor('{0}');\nfunction setStyle(style,option) {{\n{0}.FormatText(style,option);\n}}\nfunction insertAttachment(id,url) {{\n{0}.FormatText('attach', id);\n}}\n"
.FormatWith(this.SafeID));
// register custom YafBBCode javascript (if there is any)
// this call is supposed to be after editor load since it may use
// JS variables created in editor_load...
this.Get<IBBCode>().RegisterCustomBBCodePageElements(this.Page, this.GetType(), this.SafeID);
}
/// <summary>
/// Raises the <see cref="E:System.Web.UI.Control.Init" /> event.
/// </summary>
/// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param>
protected override void OnInit([NotNull] EventArgs e)
{
base.OnInit(e);
this._textCtl.Attributes.Add("class", "basicBBCodeEditor");
}
#endregion
}
} | {
"content_hash": "548bb23974a8fa4e5e1c946fbff841b9",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 193,
"avg_line_length": 29.019417475728154,
"alnum_prop": 0.5433255269320844,
"repo_name": "brooksyd2/sitecoreyaf8",
"id": "f7042cc5b231af9ce5c3738a5b99ca970d31136b",
"size": "3975",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "yafsrc/YetAnotherForum.NET/Classes/Editors/BasicBBCodeEditor.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "911712"
},
{
"name": "Batchfile",
"bytes": "3635"
},
{
"name": "C#",
"bytes": "9520407"
},
{
"name": "CSS",
"bytes": "1261085"
},
{
"name": "HTML",
"bytes": "3720"
},
{
"name": "JavaScript",
"bytes": "3674741"
},
{
"name": "SQLPL",
"bytes": "1474"
}
],
"symlink_target": ""
} |
require 'common/errors'
module Bosh
# Module for common methods used throughout the BOSH code.
module Common
# Converts all keys of a [Hash] to symbols. Performs deep conversion.
#
# @param [Hash] hash to convert
# @return [Hash] a copy of the original hash
def symbolize_keys(hash)
hash.inject({}) do |h, (key, value)|
h[key.to_sym] = value.is_a?(Hash) ? symbolize_keys(value) : value
h
end
end
module_function :symbolize_keys
# @overload which(program, path)
# Looks for program in the executables search path (PATH).
# The file must be executable to be found.
# @param [String] program
# @param [String] path search path
# @return [String] full path of the executable,
# or nil if not found
# @overload which(programs, path)
# Looks for one of the programs in the executables search path (PATH).
# The file must be executable to be found.
# @param [Array] programs
# @param [String] path search path
# @return [String] full path of the executable,
# or nil if not found
def which(programs, path=ENV["PATH"])
path.split(File::PATH_SEPARATOR).each do |dir|
Array(programs).each do |bin|
exe = File.join(dir, bin)
return exe if File.executable?(exe)
end
end
nil
end
module_function :which
# this method will loop until the block returns a true value
def retryable(options = {}, &block)
opts = {:tries => 2, :sleep => 1, :on => StandardError, :matching => /.*/, :ensure => Proc.new {}}
invalid_options = opts.merge(options).keys - opts.keys
raise ArgumentError.new("Invalid options: #{invalid_options.join(", ")}") unless invalid_options.empty?
opts.merge!(options)
return if opts[:tries] == 0
on_exception = [ opts[:on] ].flatten
tries = opts[:tries]
retries = 0
retry_exception = nil
begin
loop do
y = yield retries, retry_exception
return y if y
raise RetryCountExceeded if retries+1 >= tries
wait(opts[:sleep], retries, on_exception)
retries += 1
end
rescue *on_exception => exception
raise unless exception.message =~ opts[:matching]
raise if retries+1 >= tries
wait(opts[:sleep], retries, on_exception, exception)
retries += 1
retry_exception = exception
retry
ensure
opts[:ensure].call(retries)
end
end
def wait(sleeper, retries, exceptions, exception=nil)
sleep sleeper.respond_to?(:call) ? sleeper.call(retries, exception) : sleeper
rescue *exceptions
# SignalException could be raised while sleeping, so if you want to catch it,
# it need to be passed in the list of exceptions to ignore
end
module_function :retryable, :wait
end
end
| {
"content_hash": "ac4c32ec7e37ac4e9c26de9ba57d9d7f",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 109,
"avg_line_length": 31.365591397849464,
"alnum_prop": 0.615358244772026,
"repo_name": "yudai/simple_blobstore_proxy",
"id": "0fa78001a8fc21928a44744e81d99e586a4bc960",
"size": "2951",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/common/common.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Ruby",
"bytes": "111058"
}
],
"symlink_target": ""
} |
using namespace arb;
void run(unsigned long us_per_task, unsigned tasks, threading::task_system* ts) {
auto duration = std::chrono::microseconds(us_per_task);
arb::threading::parallel_for::apply(
0, tasks, ts,
[&](unsigned i){std::this_thread::sleep_for(duration);});
}
void run_nested(unsigned long us_per_task, unsigned tasks, threading::task_system* ts) {
auto duration = std::chrono::microseconds(us_per_task);
arb::threading::parallel_for::apply(0, tasks, ts, [&](unsigned i) {
arb::threading::parallel_for::apply(0, 1, ts, [&](unsigned i) {
std::this_thread::sleep_for(duration);});});
}
void task_test_nested(benchmark::State& state) {
const unsigned us_per_task = state.range(0);
arb::threading::task_system ts;
const auto nthreads = ts.get_num_threads();
const unsigned total_us = 1000000;
const unsigned num_tasks = nthreads*total_us/us_per_task;
while (state.KeepRunning()) {
run_nested(us_per_task, num_tasks, &ts);
}
}
void task_test(benchmark::State& state) {
const unsigned us_per_task = state.range(0);
arb::threading::task_system ts;
const auto nthreads = ts.get_num_threads();
const unsigned total_us = 1000000;
const unsigned num_tasks = nthreads*total_us/us_per_task;
while (state.KeepRunning()) {
run(us_per_task, num_tasks, &ts);
}
}
void us_per_task(benchmark::internal::Benchmark *b) {
for (auto us_per_task: {10, 100, 250, 500, 1000, 10000}) {
b->Args({us_per_task});
}
}
BENCHMARK(task_test)->Apply(us_per_task);
BENCHMARK(task_test_nested)->Apply(us_per_task);
BENCHMARK_MAIN();
| {
"content_hash": "ec33a2873f0bda4c57a7b2159290d01a",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 88,
"avg_line_length": 33.857142857142854,
"alnum_prop": 0.6467751657625075,
"repo_name": "halfflat/nestmc-proto",
"id": "dac7a094fd02f9e1de16e18a9ea235d0748dcf17",
"size": "1935",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "test/ubench/task_system.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AMPL",
"bytes": "9796"
},
{
"name": "C++",
"bytes": "3223191"
},
{
"name": "CMake",
"bytes": "69102"
},
{
"name": "Cuda",
"bytes": "70752"
},
{
"name": "Julia",
"bytes": "15582"
},
{
"name": "Makefile",
"bytes": "577"
},
{
"name": "Python",
"bytes": "39436"
},
{
"name": "Shell",
"bytes": "2582"
}
],
"symlink_target": ""
} |
<?php
namespace PHPExiftool\Driver\Tag\CanonVRD;
use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;
/**
* @ExclusionPolicy("all")
*/
class ChromaticAberration extends AbstractTag
{
protected $Id = 'mixed';
protected $Name = 'ChromaticAberration';
protected $FullName = 'mixed';
protected $GroupName = 'CanonVRD';
protected $g0 = 'CanonVRD';
protected $g1 = 'CanonVRD';
protected $g2 = 'Image';
protected $Type = 'mixed';
protected $Writable = true;
protected $Description = 'Chromatic Aberration';
}
| {
"content_hash": "c438da36b993b53c5a38a6c29b6c5d99",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 52,
"avg_line_length": 16.82857142857143,
"alnum_prop": 0.6791171477079796,
"repo_name": "romainneutron/PHPExiftool",
"id": "277bc4d8cc9b29a97540e9befa742eb51655949a",
"size": "811",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/PHPExiftool/Driver/Tag/CanonVRD/ChromaticAberration.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "22042446"
}
],
"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("02. Company Info")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("02. Company Info")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[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("79265fff-8d23-4209-818f-aff319eed506")]
// 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": "cdcce5324eb747ac9a3f26e72b7f147f",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 39.02777777777778,
"alnum_prop": 0.7423487544483985,
"repo_name": "AyrFX/Telerik-Academy-2016-CSharp-Part-1-Homeworks",
"id": "e5eebeb61938ffde68519998d8a9388763686458",
"size": "1408",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "04.Console-In-and-Out/02. Company Info/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "108416"
}
],
"symlink_target": ""
} |
module.exports = function (chai, util) {
/*!
* Chai dependencies.
*/
var Assertion = chai.Assertion
, flag = util.flag;
/*!
* Module export.
*/
/**
* ### assert(expression, message)
*
* Write your own test expressions.
*
* assert('foo' !== 'bar', 'foo is not bar');
* assert(Array.isArray([]), 'empty arrays are arrays');
*
* @param {Mixed} expression to test for truthiness
* @param {String} message to display on error
* @name assert
* @api public
*/
var assert = chai.assert = function (express, errmsg) {
var test = new Assertion(null);
test.assert(
express
, errmsg
, '[ negation message unavailable ]'
);
};
/**
* ### .fail(actual, expected, [message], [operator])
*
* Throw a failure. Node.js `assert` module-compatible.
*
* @name fail
* @param {Mixed} actual
* @param {Mixed} expected
* @param {String} message
* @param {String} operator
* @api public
*/
assert.fail = function (actual, expected, message, operator) {
throw new chai.AssertionError({
actual: actual
, expected: expected
, message: message
, operator: operator
, stackStartFunction: assert.fail
});
};
/**
* ### .ok(object, [message])
*
* Asserts that `object` is truthy.
*
* assert.ok('everything', 'everything is ok');
* assert.ok(false, 'this will fail');
*
* @name ok
* @param {Mixed} object to test
* @param {String} message
* @api public
*/
assert.ok = function (val, msg) {
new Assertion(val, msg).is.ok;
};
/**
* ### .equal(actual, expected, [message])
*
* Asserts non-strict equality (`==`) of `actual` and `expected`.
*
* assert.equal(3, '3', '== coerces values to strings');
*
* @name equal
* @param {Mixed} actual
* @param {Mixed} expected
* @param {String} message
* @api public
*/
assert.equal = function (act, exp, msg) {
var test = new Assertion(act, msg);
test.assert(
exp == flag(test, 'object')
, 'expected #{this} to equal #{exp}'
, 'expected #{this} to not equal #{act}'
, exp
, act
);
};
/**
* ### .notEqual(actual, expected, [message])
*
* Asserts non-strict inequality (`!=`) of `actual` and `expected`.
*
* assert.notEqual(3, 4, 'these numbers are not equal');
*
* @name notEqual
* @param {Mixed} actual
* @param {Mixed} expected
* @param {String} message
* @api public
*/
assert.notEqual = function (act, exp, msg) {
var test = new Assertion(act, msg);
test.assert(
exp != flag(test, 'object')
, 'expected #{this} to not equal #{exp}'
, 'expected #{this} to equal #{act}'
, exp
, act
);
};
/**
* ### .strictEqual(actual, expected, [message])
*
* Asserts strict equality (`===`) of `actual` and `expected`.
*
* assert.strictEqual(true, true, 'these booleans are strictly equal');
*
* @name strictEqual
* @param {Mixed} actual
* @param {Mixed} expected
* @param {String} message
* @api public
*/
assert.strictEqual = function (act, exp, msg) {
new Assertion(act, msg).to.equal(exp);
};
/**
* ### .notStrictEqual(actual, expected, [message])
*
* Asserts strict inequality (`!==`) of `actual` and `expected`.
*
* assert.notStrictEqual(3, '3', 'no coercion for strict equality');
*
* @name notStrictEqual
* @param {Mixed} actual
* @param {Mixed} expected
* @param {String} message
* @api public
*/
assert.notStrictEqual = function (act, exp, msg) {
new Assertion(act, msg).to.not.equal(exp);
};
/**
* ### .deepEqual(actual, expected, [message])
*
* Asserts that `actual` is deeply equal to `expected`.
*
* assert.deepEqual({ tea: 'green' }, { tea: 'green' });
*
* @name deepEqual
* @param {Mixed} actual
* @param {Mixed} expected
* @param {String} message
* @api public
*/
assert.deepEqual = function (act, exp, msg) {
new Assertion(act, msg).to.eql(exp);
};
/**
* ### .notDeepEqual(actual, expected, [message])
*
* Assert that `actual` is not deeply equal to `expected`.
*
* assert.notDeepEqual({ tea: 'green' }, { tea: 'jasmine' });
*
* @name notDeepEqual
* @param {Mixed} actual
* @param {Mixed} expected
* @param {String} message
* @api public
*/
assert.notDeepEqual = function (act, exp, msg) {
new Assertion(act, msg).to.not.eql(exp);
};
/**
* ### .isTrue(value, [message])
*
* Asserts that `value` is true.
*
* var teaServed = true;
* assert.isTrue(teaServed, 'the tea has been served');
*
* @name isTrue
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isTrue = function (val, msg) {
new Assertion(val, msg).is['true'];
};
/**
* ### .isFalse(value, [message])
*
* Asserts that `value` is false.
*
* var teaServed = false;
* assert.isFalse(teaServed, 'no tea yet? hmm...');
*
* @name isFalse
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isFalse = function (val, msg) {
new Assertion(val, msg).is['false'];
};
/**
* ### .isNull(value, [message])
*
* Asserts that `value` is null.
*
* assert.isNull(err, 'there was no error');
*
* @name isNull
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isNull = function (val, msg) {
new Assertion(val, msg).to.equal(null);
};
/**
* ### .isNotNull(value, [message])
*
* Asserts that `value` is not null.
*
* var tea = 'tasty chai';
* assert.isNotNull(tea, 'great, time for tea!');
*
* @name isNotNull
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isNotNull = function (val, msg) {
new Assertion(val, msg).to.not.equal(null);
};
/**
* ### .isUndefined(value, [message])
*
* Asserts that `value` is `undefined`.
*
* var tea;
* assert.isUndefined(tea, 'no tea defined');
*
* @name isUndefined
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isUndefined = function (val, msg) {
new Assertion(val, msg).to.equal(undefined);
};
/**
* ### .isDefined(value, [message])
*
* Asserts that `value` is not `undefined`.
*
* var tea = 'cup of chai';
* assert.isDefined(tea, 'tea has been defined');
*
* @name isUndefined
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isDefined = function (val, msg) {
new Assertion(val, msg).to.not.equal(undefined);
};
/**
* ### .isFunction(value, [message])
*
* Asserts that `value` is a function.
*
* function serveTea() { return 'cup of tea'; };
* assert.isFunction(serveTea, 'great, we can have tea now');
*
* @name isFunction
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isFunction = function (val, msg) {
new Assertion(val, msg).to.be.a('function');
};
/**
* ### .isNotFunction(value, [message])
*
* Asserts that `value` is _not_ a function.
*
* var serveTea = [ 'heat', 'pour', 'sip' ];
* assert.isNotFunction(serveTea, 'great, we have listed the steps');
*
* @name isNotFunction
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isNotFunction = function (val, msg) {
new Assertion(val, msg).to.not.be.a('function');
};
/**
* ### .isObject(value, [message])
*
* Asserts that `value` is an object (as revealed by
* `Object.prototype.toString`).
*
* var selection = { name: 'Chai', serve: 'with spices' };
* assert.isObject(selection, 'tea selection is an object');
*
* @name isObject
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isObject = function (val, msg) {
new Assertion(val, msg).to.be.a('object');
};
/**
* ### .isNotObject(value, [message])
*
* Asserts that `value` is _not_ an object.
*
* var selection = 'chai'
* assert.isObject(selection, 'tea selection is not an object');
* assert.isObject(null, 'null is not an object');
*
* @name isNotObject
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isNotObject = function (val, msg) {
new Assertion(val, msg).to.not.be.a('object');
};
/**
* ### .isArray(value, [message])
*
* Asserts that `value` is an array.
*
* var menu = [ 'green', 'chai', 'oolong' ];
* assert.isArray(menu, 'what kind of tea do we want?');
*
* @name isArray
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isArray = function (val, msg) {
new Assertion(val, msg).to.be.an('array');
};
/**
* ### .isNotArray(value, [message])
*
* Asserts that `value` is _not_ an array.
*
* var menu = 'green|chai|oolong';
* assert.isNotArray(menu, 'what kind of tea do we want?');
*
* @name isNotArray
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isNotArray = function (val, msg) {
new Assertion(val, msg).to.not.be.an('array');
};
/**
* ### .isString(value, [message])
*
* Asserts that `value` is a string.
*
* var teaOrder = 'chai';
* assert.isString(teaOrder, 'order placed');
*
* @name isString
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isString = function (val, msg) {
new Assertion(val, msg).to.be.a('string');
};
/**
* ### .isNotString(value, [message])
*
* Asserts that `value` is _not_ a string.
*
* var teaOrder = 4;
* assert.isNotString(teaOrder, 'order placed');
*
* @name isNotString
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isNotString = function (val, msg) {
new Assertion(val, msg).to.not.be.a('string');
};
/**
* ### .isNumber(value, [message])
*
* Asserts that `value` is a number.
*
* var cups = 2;
* assert.isNumber(cups, 'how many cups');
*
* @name isNumber
* @param {Number} value
* @param {String} message
* @api public
*/
assert.isNumber = function (val, msg) {
new Assertion(val, msg).to.be.a('number');
};
/**
* ### .isNotNumber(value, [message])
*
* Asserts that `value` is _not_ a number.
*
* var cups = '2 cups please';
* assert.isNotNumber(cups, 'how many cups');
*
* @name isNotNumber
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isNotNumber = function (val, msg) {
new Assertion(val, msg).to.not.be.a('number');
};
/**
* ### .isBoolean(value, [message])
*
* Asserts that `value` is a boolean.
*
* var teaReady = true
* , teaServed = false;
*
* assert.isBoolean(teaReady, 'is the tea ready');
* assert.isBoolean(teaServed, 'has tea been served');
*
* @name isBoolean
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isBoolean = function (val, msg) {
new Assertion(val, msg).to.be.a('boolean');
};
/**
* ### .isNotBoolean(value, [message])
*
* Asserts that `value` is _not_ a boolean.
*
* var teaReady = 'yep'
* , teaServed = 'nope';
*
* assert.isNotBoolean(teaReady, 'is the tea ready');
* assert.isNotBoolean(teaServed, 'has tea been served');
*
* @name isNotBoolean
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.isNotBoolean = function (val, msg) {
new Assertion(val, msg).to.not.be.a('boolean');
};
/**
* ### .typeOf(value, name, [message])
*
* Asserts that `value`'s type is `name`, as determined by
* `Object.prototype.toString`.
*
* assert.typeOf({ tea: 'chai' }, 'object', 'we have an object');
* assert.typeOf(['chai', 'jasmine'], 'array', 'we have an array');
* assert.typeOf('tea', 'string', 'we have a string');
* assert.typeOf(/tea/, 'regexp', 'we have a regular expression');
* assert.typeOf(null, 'null', 'we have a null');
* assert.typeOf(undefined, 'undefined', 'we have an undefined');
*
* @name typeOf
* @param {Mixed} value
* @param {String} name
* @param {String} message
* @api public
*/
assert.typeOf = function (val, type, msg) {
new Assertion(val, msg).to.be.a(type);
};
/**
* ### .notTypeOf(value, name, [message])
*
* Asserts that `value`'s type is _not_ `name`, as determined by
* `Object.prototype.toString`.
*
* assert.notTypeOf('tea', 'number', 'strings are not numbers');
*
* @name notTypeOf
* @param {Mixed} value
* @param {String} typeof name
* @param {String} message
* @api public
*/
assert.notTypeOf = function (val, type, msg) {
new Assertion(val, msg).to.not.be.a(type);
};
/**
* ### .instanceOf(object, constructor, [message])
*
* Asserts that `value` is an instance of `constructor`.
*
* var Tea = function (name) { this.name = name; }
* , chai = new Tea('chai');
*
* assert.instanceOf(chai, Tea, 'chai is an instance of tea');
*
* @name instanceOf
* @param {Object} object
* @param {Constructor} constructor
* @param {String} message
* @api public
*/
assert.instanceOf = function (val, type, msg) {
new Assertion(val, msg).to.be.instanceOf(type);
};
/**
* ### .notInstanceOf(object, constructor, [message])
*
* Asserts `value` is not an instance of `constructor`.
*
* var Tea = function (name) { this.name = name; }
* , chai = new String('chai');
*
* assert.notInstanceOf(chai, Tea, 'chai is not an instance of tea');
*
* @name notInstanceOf
* @param {Object} object
* @param {Constructor} constructor
* @param {String} message
* @api public
*/
assert.notInstanceOf = function (val, type, msg) {
new Assertion(val, msg).to.not.be.instanceOf(type);
};
/**
* ### .include(haystack, needle, [message])
*
* Asserts that `haystack` includes `needle`. Works
* for strings and arrays.
*
* assert.include('foobar', 'bar', 'foobar contains string "bar"');
* assert.include([ 1, 2, 3 ], 3, 'array contains value');
*
* @name include
* @param {Array|String} haystack
* @param {Mixed} needle
* @param {String} message
* @api public
*/
assert.include = function (exp, inc, msg) {
var obj = new Assertion(exp, msg);
if (Array.isArray(exp)) {
obj.to.include(inc);
} else if ('string' === typeof exp) {
obj.to.contain.string(inc);
}
};
/**
* ### .match(value, regexp, [message])
*
* Asserts that `value` matches the regular expression `regexp`.
*
* assert.match('foobar', /^foo/, 'regexp matches');
*
* @name match
* @param {Mixed} value
* @param {RegExp} regexp
* @param {String} message
* @api public
*/
assert.match = function (exp, re, msg) {
new Assertion(exp, msg).to.match(re);
};
/**
* ### .notMatch(value, regexp, [message])
*
* Asserts that `value` does not match the regular expression `regexp`.
*
* assert.notMatch('foobar', /^foo/, 'regexp does not match');
*
* @name notMatch
* @param {Mixed} value
* @param {RegExp} regexp
* @param {String} message
* @api public
*/
assert.notMatch = function (exp, re, msg) {
new Assertion(exp, msg).to.not.match(re);
};
/**
* ### .property(object, property, [message])
*
* Asserts that `object` has a property named by `property`.
*
* assert.property({ tea: { green: 'matcha' }}, 'tea');
*
* @name property
* @param {Object} object
* @param {String} property
* @param {String} message
* @api public
*/
assert.property = function (obj, prop, msg) {
new Assertion(obj, msg).to.have.property(prop);
};
/**
* ### .notProperty(object, property, [message])
*
* Asserts that `object` does _not_ have a property named by `property`.
*
* assert.notProperty({ tea: { green: 'matcha' }}, 'coffee');
*
* @name notProperty
* @param {Object} object
* @param {String} property
* @param {String} message
* @api public
*/
assert.notProperty = function (obj, prop, msg) {
new Assertion(obj, msg).to.not.have.property(prop);
};
/**
* ### .deepProperty(object, property, [message])
*
* Asserts that `object` has a property named by `property`, which can be a
* string using dot- and bracket-notation for deep reference.
*
* assert.deepProperty({ tea: { green: 'matcha' }}, 'tea.green');
*
* @name deepProperty
* @param {Object} object
* @param {String} property
* @param {String} message
* @api public
*/
assert.deepProperty = function (obj, prop, msg) {
new Assertion(obj, msg).to.have.deep.property(prop);
};
/**
* ### .notDeepProperty(object, property, [message])
*
* Asserts that `object` does _not_ have a property named by `property`, which
* can be a string using dot- and bracket-notation for deep reference.
*
* assert.notDeepProperty({ tea: { green: 'matcha' }}, 'tea.oolong');
*
* @name notDeepProperty
* @param {Object} object
* @param {String} property
* @param {String} message
* @api public
*/
assert.notDeepProperty = function (obj, prop, msg) {
new Assertion(obj, msg).to.not.have.deep.property(prop);
};
/**
* ### .propertyVal(object, property, value, [message])
*
* Asserts that `object` has a property named by `property` with value given
* by `value`.
*
* assert.propertyVal({ tea: 'is good' }, 'tea', 'is good');
*
* @name propertyVal
* @param {Object} object
* @param {String} property
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.propertyVal = function (obj, prop, val, msg) {
new Assertion(obj, msg).to.have.property(prop, val);
};
/**
* ### .propertyNotVal(object, property, value, [message])
*
* Asserts that `object` has a property named by `property`, but with a value
* different from that given by `value`.
*
* assert.propertyNotVal({ tea: 'is good' }, 'tea', 'is bad');
*
* @name propertyNotVal
* @param {Object} object
* @param {String} property
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.propertyNotVal = function (obj, prop, val, msg) {
new Assertion(obj, msg).to.not.have.property(prop, val);
};
/**
* ### .deepPropertyVal(object, property, value, [message])
*
* Asserts that `object` has a property named by `property` with value given
* by `value`. `property` can use dot- and bracket-notation for deep
* reference.
*
* assert.deepPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'matcha');
*
* @name deepPropertyVal
* @param {Object} object
* @param {String} property
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.deepPropertyVal = function (obj, prop, val, msg) {
new Assertion(obj, msg).to.have.deep.property(prop, val);
};
/**
* ### .deepPropertyNotVal(object, property, value, [message])
*
* Asserts that `object` has a property named by `property`, but with a value
* different from that given by `value`. `property` can use dot- and
* bracket-notation for deep reference.
*
* assert.deepPropertyNotVal({ tea: { green: 'matcha' }}, 'tea.green', 'konacha');
*
* @name deepPropertyNotVal
* @param {Object} object
* @param {String} property
* @param {Mixed} value
* @param {String} message
* @api public
*/
assert.deepPropertyNotVal = function (obj, prop, val, msg) {
new Assertion(obj, msg).to.not.have.deep.property(prop, val);
};
/**
* ### .lengthOf(object, length, [message])
*
* Asserts that `object` has a `length` property with the expected value.
*
* assert.lengthOf([1,2,3], 3, 'array has length of 3');
* assert.lengthOf('foobar', 5, 'string has length of 6');
*
* @name lengthOf
* @param {Mixed} object
* @param {Number} length
* @param {String} message
* @api public
*/
assert.lengthOf = function (exp, len, msg) {
new Assertion(exp, msg).to.have.length(len);
};
/**
* ### .throws(function, [constructor/regexp], [message])
*
* Asserts that `function` will throw an error that is an instance of
* `constructor`, or alternately that it will throw an error with message
* matching `regexp`.
*
* assert.throw(fn, ReferenceError, 'function throws a reference error');
*
* @name throws
* @alias throw
* @alias Throw
* @param {Function} function
* @param {ErrorConstructor} constructor
* @param {RegExp} regexp
* @param {String} message
* @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
* @api public
*/
assert.Throw = function (fn, type, msg) {
if ('string' === typeof type) {
msg = type;
type = null;
}
new Assertion(fn, msg).to.Throw(type);
};
/**
* ### .doesNotThrow(function, [constructor/regexp], [message])
*
* Asserts that `function` will _not_ throw an error that is an instance of
* `constructor`, or alternately that it will not throw an error with message
* matching `regexp`.
*
* assert.doesNotThrow(fn, Error, 'function does not throw');
*
* @name doesNotThrow
* @param {Function} function
* @param {ErrorConstructor} constructor
* @param {RegExp} regexp
* @param {String} message
* @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
* @api public
*/
assert.doesNotThrow = function (fn, type, msg) {
if ('string' === typeof type) {
msg = type;
type = null;
}
new Assertion(fn, msg).to.not.Throw(type);
};
/**
* ### .operator(val1, operator, val2, [message])
*
* Compares two values using `operator`.
*
* assert.operator(1, '<', 2, 'everything is ok');
* assert.operator(1, '>', 2, 'this will fail');
*
* @name operator
* @param {Mixed} val1
* @param {String} operator
* @param {Mixed} val2
* @param {String} message
* @api public
*/
assert.operator = function (val, operator, val2, msg) {
if (!~['==', '===', '>', '>=', '<', '<=', '!=', '!=='].indexOf(operator)) {
throw new Error('Invalid operator "' + operator + '"');
}
var test = new Assertion(eval(val + operator + val2), msg);
test.assert(
true === flag(test, 'object')
, 'expected ' + util.inspect(val) + ' to be ' + operator + ' ' + util.inspect(val2)
, 'expected ' + util.inspect(val) + ' to not be ' + operator + ' ' + util.inspect(val2) );
};
/*!
* Undocumented / untested
*/
assert.ifError = function (val, msg) {
new Assertion(val, msg).to.not.be.ok;
};
/*!
* Aliases.
*/
(function alias(name, as){
assert[as] = assert[name];
return alias;
})
('Throw', 'throw')
('Throw', 'throws');
};
| {
"content_hash": "93de2f40785d83c7fdf19225321e4ecc",
"timestamp": "",
"source": "github",
"line_count": 959,
"max_line_length": 96,
"avg_line_length": 24.50469238790407,
"alnum_prop": 0.5739148936170213,
"repo_name": "EvanBurchard/gamedev-garage",
"id": "8a84b48a33528d9ce0306dae052169cecdeb99bc",
"size": "23594",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "node_modules/sendgrid/node_modules/chai/lib/chai/interface/assert.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "155989"
},
{
"name": "JavaScript",
"bytes": "75240"
}
],
"symlink_target": ""
} |
// -*- C++ -*-
/*
* Copyright (C) 1990,91 Silicon Graphics, Inc.
*
_______________________________________________________________________
______________ S I L I C O N G R A P H I C S I N C . ____________
|
| $Revision: 1.1.1.1 $
|
| Description:
| This file defines the SoEmissiveColorElement class.
|
| Author(s) : Paul S. Strauss
|
______________ S I L I C O N G R A P H I C S I N C . ____________
_______________________________________________________________________
*/
#ifdef IV_STRICT
#error SoEmissiveColorElement is obsolete. See SoLazyElement instead.
#endif /*IV_STRICT*/
#ifndef _SO_EMISSIVE_COLOR_ELEMENT
#define _SO_EMISSIVE_COLOR_ELEMENT
#include <Inventor/SbColor.h>
#include <Inventor/misc/SoState.h>
#include <Inventor/elements/SoLazyElement.h>
#include <Inventor/errors/SoDebugError.h>
//////////////////////////////////////////////////////////////////////////////
//
// Class: SoEmissiveColorElement
//
// This class is being superceded by the SoLazyElement class.
// All methods are converted inline to SoLazyElement methods for
// compatibility. This only uses the first emissive color, not an
// array of them.
//
//////////////////////////////////////////////////////////////////////////////
SoEXTENDER class INVENTOR_API SoEmissiveColorElement {
public:
// Sets the current emissive color(s)
static void set(SoState *state, SoNode *,
int32_t numColors, const SbColor *colors)
{
SoLazyElement::setEmissive(state,colors);
#ifdef DEBUG
if(numColors>1){
SoDebugError::post("SoEmissiveColorElement::set",
"multiple emissive colors not supported");
}
#endif /*DEBUG*/
}
// Returns the top (current) instance of the element in the state
static const SoEmissiveColorElement * getInstance(SoState *state)
{
SoEmissiveColorElement* ece = new SoEmissiveColorElement;
ece->saveState = state;
return(ece);
}
// Returns the number of emissive colors in any instance
int32_t getNum() const { return 1; }
// Returns the current emissive color
const SbColor & get(int index) const
{
#ifdef DEBUG
if(index >1)
SoDebugError::post("SoEmissiveColorElement::get",
"multiple emissive colors not supported");
#endif /*DEBUG*/
return(SoLazyElement::getEmissive(saveState));
}
// Returns the default emissive color
static SbColor getDefault()
{ return SoLazyElement::getDefaultEmissive(); }
private:
SoState* saveState;
};
#endif /* _SO_EMISSIVE_COLOR_ELEMENT */
| {
"content_hash": "79885fa368cc7debe50c23cd96eac0b7",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 78,
"avg_line_length": 27.26595744680851,
"alnum_prop": 0.5817401482637534,
"repo_name": "OpenXIP/xip-libraries",
"id": "37863a587c6e1574abfe472c57b0b2b13e7f1958",
"size": "4069",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/extern/inventor/lib/database/include/Inventor/elements/SoEmissiveColorElement.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "8314"
},
{
"name": "C",
"bytes": "21064260"
},
{
"name": "C#",
"bytes": "41726"
},
{
"name": "C++",
"bytes": "33308677"
},
{
"name": "D",
"bytes": "373"
},
{
"name": "Java",
"bytes": "59889"
},
{
"name": "JavaScript",
"bytes": "35954"
},
{
"name": "Objective-C",
"bytes": "272450"
},
{
"name": "Perl",
"bytes": "727865"
},
{
"name": "Prolog",
"bytes": "101780"
},
{
"name": "Puppet",
"bytes": "371631"
},
{
"name": "Python",
"bytes": "162364"
},
{
"name": "Shell",
"bytes": "906979"
},
{
"name": "Smalltalk",
"bytes": "10530"
},
{
"name": "SuperCollider",
"bytes": "2169433"
},
{
"name": "Tcl",
"bytes": "10289"
}
],
"symlink_target": ""
} |
package org.apache.camel.processor;
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.builder.RouteBuilder;
public class BreadcrumbDisabledTest extends MDCTest {
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
// MDC and breadcrumb disabled
context.setUseMDCLogging(false);
context.setUseBreadcrumb(false);
from("direct:a").routeId("route-a")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
assertNull("Should not have breadcrumb", exchange.getIn().getHeader("breadcrumbId"));
}
})
.to("log:foo").to("direct:b");
from("direct:b").routeId("route-b")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
assertNull("Should not have breadcrumb", exchange.getIn().getHeader("breadcrumbId"));
}
})
.to("log:bar").to("mock:result");
}
};
}
}
| {
"content_hash": "43e5ebbaef8dc101cd4975916ac716c1",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 117,
"avg_line_length": 38.486486486486484,
"alnum_prop": 0.5133426966292135,
"repo_name": "punkhorn/camel-upstream",
"id": "f6b73ff46c530ec493932091bac2b8b3118713bc",
"size": "2227",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "core/camel-core/src/test/java/org/apache/camel/processor/BreadcrumbDisabledTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Apex",
"bytes": "6519"
},
{
"name": "Batchfile",
"bytes": "1518"
},
{
"name": "CSS",
"bytes": "16394"
},
{
"name": "Elm",
"bytes": "10852"
},
{
"name": "FreeMarker",
"bytes": "11410"
},
{
"name": "Groovy",
"bytes": "14490"
},
{
"name": "HTML",
"bytes": "896075"
},
{
"name": "Java",
"bytes": "70312352"
},
{
"name": "JavaScript",
"bytes": "90399"
},
{
"name": "Makefile",
"bytes": "513"
},
{
"name": "Shell",
"bytes": "17108"
},
{
"name": "Tcl",
"bytes": "4974"
},
{
"name": "Thrift",
"bytes": "6979"
},
{
"name": "XQuery",
"bytes": "546"
},
{
"name": "XSLT",
"bytes": "270186"
}
],
"symlink_target": ""
} |
<div ng-controller="AccordionDemoCtrl">
<p>
<button class="btn btn-default btn-sm" ng-click="status.open = !status.open">Toggle last panel</button>
<button class="btn btn-default btn-sm" ng-click="status.isFirstDisabled = ! status.isFirstDisabled">Enable / Disable first panel</button>
</p>
<label class="checkbox">
<input type="checkbox" ng-model="oneAtATime">
Open only one at a time
</label>
<accordion close-others="oneAtATime">
<accordion-group heading="Static Header, initially expanded" is-open="status.isFirstOpen" is-disabled="status.isFirstDisabled">
This content is straight in the template.
</accordion-group>
<accordion-group heading="{{group.title}}" ng-repeat="group in groups">
{{group.content}}
</accordion-group>
<accordion-group heading="Dynamic Body Content">
<p>The body of the accordion group grows to fit the contents</p>
<button class="btn btn-default btn-sm" ng-click="addItem()">Add Item</button>
<div ng-repeat="item in items">{{item}}</div>
</accordion-group>
<accordion-group is-open="status.open">
<accordion-heading>
I can have markup, too! <i class="pull-right glyphicon" ng-class="{'glyphicon-chevron-down': status.open, 'glyphicon-chevron-right': !status.open}"></i>
</accordion-heading>
This is just some content to illustrate fancy headings.
</accordion-group>
</accordion>
</div> | {
"content_hash": "da30d377f72b563d76bdcfb244b9f386",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 160,
"avg_line_length": 49.1,
"alnum_prop": 0.6680244399185336,
"repo_name": "hasithalakmal/CodeAnalyser",
"id": "301f3c7b1aacd68eac72e547f821afe027c403d8",
"size": "1473",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "UI/app/views/pages/dashboard/accordion.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1350087"
},
{
"name": "HTML",
"bytes": "367259"
},
{
"name": "Java",
"bytes": "242603"
},
{
"name": "JavaScript",
"bytes": "1380487"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/testWEBServer.iml" filepath="$PROJECT_DIR$/.idea/testWEBServer.iml" />
</modules>
</component>
</project> | {
"content_hash": "71031733e737269a5e9cfefabd8e1b8d",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 120,
"avg_line_length": 34.75,
"alnum_prop": 0.6726618705035972,
"repo_name": "roberto-slopez/Test-WebServer-RESTful",
"id": "a4eaad32ccd80fcc1a9a6c4603269f28545e7669",
"size": "278",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": ".idea/modules.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "134713"
},
{
"name": "Shell",
"bytes": "53"
}
],
"symlink_target": ""
} |
package com.vaporwarecorp.mirror.feature.splash;
import com.robopupu.api.dependency.Provides;
import com.robopupu.api.plugin.Plug;
import com.robopupu.api.plugin.Plugin;
import com.vaporwarecorp.mirror.feature.common.view.FullscreenFragment;
@Plugin
public class SplashFragment extends FullscreenFragment<SplashPresenter> implements SplashView {
// ------------------------------ FIELDS ------------------------------
@Plug
SplashPresenter mPresenter;
// --------------------------- CONSTRUCTORS ---------------------------
@Provides(SplashView.class)
public SplashFragment() {
}
// ------------------------ INTERFACE METHODS ------------------------
// --------------------- Interface MirrorView ---------------------
@Override
public Class presenterClass() {
return SplashPresenter.class;
}
// --------------------- Interface PresentedView ---------------------
@Override
public SplashPresenter getPresenter() {
return mPresenter;
}
}
| {
"content_hash": "4e6aa6651dac04e8190d33ffdeadf5f1",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 95,
"avg_line_length": 26.55263157894737,
"alnum_prop": 0.554013875123885,
"repo_name": "jreyes/mirror",
"id": "350807b1b2e2bf60c146c52bdc99831a859da721",
"size": "1604",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/vaporwarecorp/mirror/feature/splash/SplashFragment.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "6020"
},
{
"name": "HTML",
"bytes": "6239"
},
{
"name": "Java",
"bytes": "555080"
},
{
"name": "JavaScript",
"bytes": "7370"
}
],
"symlink_target": ""
} |
BeTogether
==============
An Ember Application that aspires to help facilitate group activities.
Installation and Usage
------------
To run the app clone this repository. From the project directory in terminal
```
$ python -m SimpleHTTPServer
```
Then open up localhost:8000 in your web browser
Click on Login/SignUp to view the working part of the app
Motivation
--------
> **To Practice Using:**
>- Ember Controllers
>- Templates and Routes
>- Ember Data
Authors
------
Kathryn Carr and Lizzie Koehler
License
-------
MIT license.
| {
"content_hash": "7e2b99c87ed59711f3b52fd95bdb97a0",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 76,
"avg_line_length": 17.9375,
"alnum_prop": 0.662020905923345,
"repo_name": "katcarr/beTogetherEmber",
"id": "d62720be0ff16994148221af085aa96af6686909",
"size": "574",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "114307"
},
{
"name": "HTML",
"bytes": "2780"
},
{
"name": "Handlebars",
"bytes": "9811"
},
{
"name": "JavaScript",
"bytes": "3875917"
}
],
"symlink_target": ""
} |
layout: post
status: publish
published: true
title: End of Study Break
author:
display_name: Jon Clausen
login: JClausen
email: jon_clausen@silowebworks.com
url: http://jonclausen.com
author_login: JClausen
author_email: jon_clausen@silowebworks.com
author_url: http://jonclausen.com
wordpress_id: 129
wordpress_url: http://jonclausen.com/?p=129
date: '2008-08-23 15:57:09 -0400'
date_gmt: '2008-08-23 20:57:09 -0400'
categories:
- Poetry
tags:
- Poetry
- creative writing
- poems
comments: []
---
<p><em>by Jonathan Clausen</em></p>
<p>It’s as if I am aging in reverse.<br />
Rekindled passions, dormant for many seasons,<br />
speak to me now and ask questions:<br />
was what once seemed right, instead<br />
necessary protection from an aching heart?<br />
From poverty? From pain?<br />
Shall I try once again to cover myself in<br />
the sheath of success which<br />
has, in the past,<br />
wrapped me with its gilded fabric of a duller hue?</p>
<p>I think I will ask my old friends.<br />
They once were accomplice to my greatest escape.<br />
Yet their pages are yellowed:<br />
their brittle stacks faded from passage of time.</p>
<p>Perhaps, instead, I should put them away;<br />
safe for later days, poised for fresh eyes.<br />
The faces on the planks of this shelf<br />
have changed much in 15 years.<br />
Some familiarity remains.<br />
“Hello my friends, my comforts, my teachers<br />
I’d like to catch up.<br />
It seems I have a moment.”</p>
| {
"content_hash": "cb1267701dc0213777f88401ad4eef74",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 54,
"avg_line_length": 31.319148936170212,
"alnum_prop": 0.7221467391304348,
"repo_name": "jclausen/jclausen.github.io",
"id": "65d7e5ab53bb4de55f59bb22725f79c3d722f927",
"size": "1484",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2008-08-23-end-of-study-break.markdown",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "93200"
},
{
"name": "HTML",
"bytes": "1373459"
},
{
"name": "JavaScript",
"bytes": "4418"
},
{
"name": "Ruby",
"bytes": "3377"
}
],
"symlink_target": ""
} |
using BookReviews.Infrastructure.Commands;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace BookReviews.Infrastructure.Commands.AccountsManagment.ResetAccountPasswordRequest
{
public class ResetAccountPasswordRequestCommand : AbstractCommand
{
public string Email { get; set; }
}
} | {
"content_hash": "7be960a3b1dd7341346272944a0dbeae",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 91,
"avg_line_length": 26.846153846153847,
"alnum_prop": 0.7908309455587392,
"repo_name": "bob2000/BookReviews",
"id": "193dfb610977b3a01275b11a76caf2e2285ff562",
"size": "351",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Infrastructure/Commands/AccountsManagment/ResetAccountPasswordRequest/ResetAccountPasswordRequestCommand.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "1873"
},
{
"name": "C#",
"bytes": "1157828"
},
{
"name": "CSS",
"bytes": "33709"
},
{
"name": "HTML",
"bytes": "540"
},
{
"name": "JavaScript",
"bytes": "112636"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="de">
<head>
<!-- Generated by javadoc (version 1.7.0_51) on Wed Nov 25 16:12:14 CET 2015 -->
<title>V-Index (Newton Raphson)</title>
<meta name="date" content="2015-11-25">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="V-Index (Newton Raphson)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../de/linearbits/newtonraphson/package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li><a href="../de/linearbits/newtonraphson/package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li class="navBarCell1Rev">Index</li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="index-12.html">Prev Letter</a></li>
<li><a href="index-14.html">Next Letter</a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?index-filesindex-13.html" target="_top">Frames</a></li>
<li><a href="index-13.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="contentContainer"><a href="index-1.html">A</a> <a href="index-2.html">C</a> <a href="index-3.html">D</a> <a href="index-4.html">E</a> <a href="index-5.html">F</a> <a href="index-6.html">G</a> <a href="index-7.html">I</a> <a href="index-8.html">M</a> <a href="index-9.html">N</a> <a href="index-10.html">P</a> <a href="index-11.html">S</a> <a href="index-12.html">T</a> <a href="index-13.html">V</a> <a href="index-14.html">X</a> <a href="index-15.html">Y</a> <a name="_V_">
<!-- -->
</a>
<h2 class="title">V</h2>
<dl>
<dt><a href="../de/linearbits/newtonraphson/Vector2D.html" title="class in de.linearbits.newtonraphson"><span class="strong">Vector2D</span></a> - Class in <a href="../de/linearbits/newtonraphson/package-summary.html">de.linearbits.newtonraphson</a></dt>
<dd>
<div class="block">This class implements a vector in RxR</div>
</dd>
<dt><span class="strong"><a href="../de/linearbits/newtonraphson/Vector2D.html#Vector2D()">Vector2D()</a></span> - Constructor for class de.linearbits.newtonraphson.<a href="../de/linearbits/newtonraphson/Vector2D.html" title="class in de.linearbits.newtonraphson">Vector2D</a></dt>
<dd>
<div class="block">Creates a new instance</div>
</dd>
<dt><span class="strong"><a href="../de/linearbits/newtonraphson/Vector2D.html#Vector2D(double, double)">Vector2D(double, double)</a></span> - Constructor for class de.linearbits.newtonraphson.<a href="../de/linearbits/newtonraphson/Vector2D.html" title="class in de.linearbits.newtonraphson">Vector2D</a></dt>
<dd>
<div class="block">Creates a new instance</div>
</dd>
</dl>
<a href="index-1.html">A</a> <a href="index-2.html">C</a> <a href="index-3.html">D</a> <a href="index-4.html">E</a> <a href="index-5.html">F</a> <a href="index-6.html">G</a> <a href="index-7.html">I</a> <a href="index-8.html">M</a> <a href="index-9.html">N</a> <a href="index-10.html">P</a> <a href="index-11.html">S</a> <a href="index-12.html">T</a> <a href="index-13.html">V</a> <a href="index-14.html">X</a> <a href="index-15.html">Y</a> </div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../de/linearbits/newtonraphson/package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li><a href="../de/linearbits/newtonraphson/package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li class="navBarCell1Rev">Index</li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="index-12.html">Prev Letter</a></li>
<li><a href="index-14.html">Next Letter</a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?index-filesindex-13.html" target="_top">Frames</a></li>
<li><a href="index-13.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {
"content_hash": "001c31401721f50955823b4bfa6859ee",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 560,
"avg_line_length": 44.96875,
"alnum_prop": 0.6292564280750521,
"repo_name": "kohlmayer/newtonraphson",
"id": "30dd019fef71d669c55cfe8a4776a2943635f846",
"size": "5756",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "doc/index-files/index-13.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "47052"
}
],
"symlink_target": ""
} |
package com.verisign.getdns.asyncwithfuture.test;
import static com.verisign.getdns.test.IGetDNSTestConstants.DOMAIN_NAME;
import static org.junit.Assert.assertEquals;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeoutException;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import com.verisign.getdns.GetDNSException;
import com.verisign.getdns.GetDNSFactory;
import com.verisign.getdns.GetDNSFutureResult;
import com.verisign.getdns.IGetDNSContextAsyncWithFuture;
import com.verisign.getdns.RRType;
import com.verisign.getdns.test.ErrorCodeMatcher;
public class GeneralASyncCancelTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
@Test
public void testGetDNSAsyncWithCancel() throws ExecutionException, TimeoutException {
final IGetDNSContextAsyncWithFuture context = GetDNSFactory.createAsyncWithFuture(1,null);
try {
GetDNSFutureResult futureResult = context.generalAsync(DOMAIN_NAME, RRType.A, null);
futureResult.cancel(true);
context.run();
assertEquals(true, futureResult.isCancelled());
} finally {
context.close();
}
}
@Test
public void testGetDNSAsyncWithCancel1() throws ExecutionException, TimeoutException {
final IGetDNSContextAsyncWithFuture context = GetDNSFactory.createAsyncWithFuture(1,null);
try {
thrown.expect(GetDNSException.class);
thrown.expect(new ErrorCodeMatcher("GETDNS_RETURN_UNKNOWN_TRANSACTION"));
GetDNSFutureResult futureResult = context.generalAsync(DOMAIN_NAME, RRType.A, null);
futureResult.cancel(true);
context.run();
futureResult.cancel(true);
} finally {
context.close();
}
}
@Test
public void testGetDNSAsyncWithCancel2() throws ExecutionException, TimeoutException, InterruptedException {
final IGetDNSContextAsyncWithFuture context = GetDNSFactory.createAsyncWithFuture(1,null);
try {
thrown.expect(java.util.concurrent.CancellationException.class);
thrown.expectMessage("This request is already cancelled");
GetDNSFutureResult futureResult = context.generalAsync(DOMAIN_NAME, RRType.A, null);
futureResult.cancel(true);
context.run();
futureResult.get();
} finally {
context.close();
}
}
}
| {
"content_hash": "8454d90fa4cbb10c50155e8ae013eedd",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 109,
"avg_line_length": 31.535211267605632,
"alnum_prop": 0.7896382313532827,
"repo_name": "getdnsapi/getdns-java-bindings",
"id": "d1dcc3cbe78f4118aae87a1acab417688fe70236",
"size": "2239",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/com/verisign/getdns/asyncwithfuture/test/GeneralASyncCancelTest.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "47040"
},
{
"name": "CSS",
"bytes": "11555"
},
{
"name": "HTML",
"bytes": "7669"
},
{
"name": "Java",
"bytes": "261892"
}
],
"symlink_target": ""
} |
(function(exports) {
function init() {
addBrowserClasses(document.body);
var doc = document.documentElement;
function getSize() {
return new MM.Point(doc.clientWidth, doc.clientHeight);
}
var parent = document.getElementById("map-main"),
size = getSize(),
providerName = parent.getAttribute("data-provider"),
provider = new MM.StamenTileLayer(providerName);
// setupProviderSelector(providerName, "../");
function resize() {
try {
size = getSize();
if (main) main.setSize(size);
} catch (e) {
}
// console.log("resize:", [size.x, size.y]);
}
MM.addEvent(window, "resize", resize);
// our main map
var main = new MM.Map(parent, provider, size,
[new MM.DragHandler(), new MM.DoubleClickHandler(), new MM.TouchHandler()]);
parent.style.position = "absolute";
main.autoSize = false;
if (provider.attribution) {
var attribution = parent.querySelector(".attribution") || parent.appendChild(document.createElement("p"));
attribution.className = "attribution";
attribution.innerHTML = provider.attribution;
}
setupZoomControls(main);
var didSetLimits = provider.setCoordLimits(main);
// set the initial map position
main.setCenterZoom(new MM.Location(37.7706, -122.3782), 12);
var zoom = parseInt(parent.getAttribute("data-zoom"));
if (!isNaN(zoom)) {
main.setZoom(zoom);
}
var center = parent.getAttribute("data-center");
if (center && center.length) {
var bits = center.split(",");
main.setCenter(new MM.Location(parseFloat(bits[0]), parseFloat(bits[1])));
}
syncMapLinks(main, [document.getElementById("home-link")], function(parts) {
parts.unshift(providerName);
});
var embedLink = document.getElementById("embed-toggle"),
embedToggle;
if (embedLink) {
var embed = document.getElementById("embed-content"),
textarea = document.getElementById("embed-code"),
template = textarea.value;
embedToggle = createToggle(embedLink, embed, function(showing) {
if (showing) {
var url = location.href.split("#");
url.splice(1, 0, "embed#");
textarea.value = template.replace("{url}", url.join(""));
textarea.focus();
textarea.select();
} else {
}
});
}
var imgLink = document.getElementById("make-image");
if (imgLink) {
var round = function(n) {
return Math.ceil(n / 500) * 500;
};
MM.addEvent(imgLink, "mouseover", function() {
var hash = location.hash.substr(1),
width = round(main.dimensions.x),
height = round(main.dimensions.y);
this.href = [
"http://maps.stamen.com/m2i/",
"#" + providerName, "/",
width, ":", height, "/",
hash
].join("");
});
}
var feedback = setupFeedbackForm();
MM.addEvent(main.parent, "mousedown", feedback.hide);
main.addCallback("zoomed", feedback.hide);
var hasher = new MM.Hash(main);
// set up form element references
var searchForm = document.getElementById("search");
if (searchForm) {
var searchInput = document.getElementById("search-location"),
searchButton = document.getElementById("search-submit");
// listen for the submit event
MM.addEvent(searchForm, "submit", function(e) {
// remember the old search text
var oldSearchText = searchButton.getAttribute("value");
// put the button into its submitting state
searchButton.setAttribute("value", "Finding...");
searchButton.setAttribute("class", "btn disabled");
// set up a function to rever the form to its original state
// (which executes whether there was an error or not)
function revert() {
searchButton.setAttribute("class", "btn");
searchButton.setAttribute("value", oldSearchText);
}
var query = searchInput.value;
StamenSearch.geocode({
q: query,
w: main.dimensions.x,
h: main.dimensions.y - document.getElementById("header").offsetHeight
}, function(err, results) {
revert();
if (err || results.length === 0) {
alert("Sorry, we couldn't find '" + query + "'.");
return;
}
main.setZoom(results[0].zoom)
.setCenter({ lat: results[0].latitude, lon: results[0].longitude });
});
// cancel the submit event
return MM.cancelEvent(e);
});
}
exports.MAP = main;
}
init();
})(this);
| {
"content_hash": "eb242d685f90780e31c1c34c28b04007",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 118,
"avg_line_length": 36.258278145695364,
"alnum_prop": 0.5084931506849315,
"repo_name": "mattb/maps.stamen.com",
"id": "7fcd71697fcd51c28cc2e1e69d4802da37bbc6f5",
"size": "5475",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "js/layer.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "8952"
},
{
"name": "JavaScript",
"bytes": "39060"
},
{
"name": "PHP",
"bytes": "17076"
},
{
"name": "Shell",
"bytes": "190"
}
],
"symlink_target": ""
} |
This class inherits from Python StringIO module.
__class DaapStringIO(buffer)__
Converts buffer to Python StringIO buffer.
__DaapStringIO.get_data(self, n[, start=0])__
Read `n` bytes of the StringIO buffer then replace the internal
cursor to the initial position (as it never read something).
You can specify start to start reading after `start` bytes.
## DaapRequest
This class contains everything you need to make a request on a DAAP server.
__class DaapRequest([pairing_code=None, **kwargs])__
Create a new DaapRequest object.
You should define pairing_code. Most of the DAAP server endpoints require
pairing_code to be set. This can be obtained by pairing your app with your
DAAP server. I wrote a little node.js application to pair your app
with a DAAP server: [PairingJS](https://github.com/j-muller/PairingJS).
Some options can be defined but are not mandatory :
* `host` (default: `"127.0.0.1"`)
* `port` (default: `3689`)
__DaapRequest.get(self, endpoint)__
Make a HTTP GET request on the DAAP server then returns RAW DAAP data packaged
in DaapStringIO type.
* Raise `pydaap.exception.ConnectionRefused` if the connection to the server
failed.
* Raise `pydaap.exeception.HTTPError` if the server did not answer HTTP code
`200`. (Every DAAP servers should answer `200`) | {
"content_hash": "99f1fa26576f89d5f6b86d0c1dac1874",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 78,
"avg_line_length": 33.256410256410255,
"alnum_prop": 0.7586738627602159,
"repo_name": "j-muller/pydaap",
"id": "c2a7068e0cce9b5451dfcf00095e0d649d7359c1",
"size": "1334",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/request.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "31662"
}
],
"symlink_target": ""
} |
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.AspNet.Identity.Owin;
namespace Sting.Models
{
// You can add profile data for the user by adding more properties to your ApplicationUser class, please visit http://go.microsoft.com/fwlink/?LinkID=317594 to learn more.
public class ApplicationUser : IdentityUser
{
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager, string authenticationType)
{
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager.CreateIdentityAsync(this, authenticationType);
// Add custom user claims here
return userIdentity;
}
}
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public ApplicationDbContext()
: base("DefaultConnection", throwIfV1Schema: false)
{
}
public static ApplicationDbContext Create()
{
return new ApplicationDbContext();
}
}
} | {
"content_hash": "4f9961d88c0428a9e69619db683fc4b6",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 175,
"avg_line_length": 37.06060606060606,
"alnum_prop": 0.7015535568274734,
"repo_name": "theAppleist/Sting",
"id": "cc7e1ad0215b7ec700d662851d0ab6147ce91e71",
"size": "1225",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Sting/Sting/Models/IdentityModels.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "99"
},
{
"name": "C#",
"bytes": "70753"
},
{
"name": "HTML",
"bytes": "5069"
}
],
"symlink_target": ""
} |
Passpod is a library that hashes and saves passwords in a safe way.
Although already usable it is still a prototype. Feedback very welcome.
**How currently web platforms save passwords**
| User | Password Hash |
| -------------- | ------------- |
| BieberLover93 | 356a192b79... |
| EnterpriseUser | da4b9237ba... |
| iorfsjadk | 77de68daec... |
| ... | ... |
**How Passpod saves passwords**
| Hash |
| -------------- |
| 1b645389247... |
| ac3478d69a3... |
| c1dfd96eea8... |
| 902ba3cda18... |
| ... |
The idea is to minimize the harm that a compromised password database can cause.
A leaked Passpod database does not contain a direct link between a user name and its hashed password, this makes brute force attacks more expensive.
When sufficient dummy hash entries are created, it is difficult to get the approximate number of registered users.
The design of Passpod also encourages the use of a separate Database for password storage,
preventing SQL injections attacks targeting the application to compromise the hashed passwords.
Often password hashing is implemented on the fly and bundled with application code,
Passpod hopes to offer an modularized, better reviewed, more secure alternative.
### How To Use It
Passpod offers a Python library with a simple dictionary-like interface.
```python
>>> from passpod impor passpod
>>> passwords = passpod.open('sqlite:///tmp/mydb') # passwords is a dictionary-like object
>>> psswords['user1'] = 'mypassword$*!'
>>> 'user1' in passwords
True
>>> passwords['user1'] == 'mypassword$*!'
True
>>> del passwords['user1']
```
### Licence
Passpod is licensed under the The MIT License (MIT)
| {
"content_hash": "93860a98b04fc444fa7223b2db145249",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 148,
"avg_line_length": 36.234042553191486,
"alnum_prop": 0.6946564885496184,
"repo_name": "nomoral/passpod",
"id": "8a57ab448e0c4f141ea6c5149628a272c718f698",
"size": "1725",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "7310"
}
],
"symlink_target": ""
} |
#include "CollisionConfiguration.h"
#ifndef DISABLE_UNCOMMON
#include "PoolAllocator.h"
#endif
CollisionConfiguration::CollisionConfiguration(btCollisionConfiguration* native)
{
_native = native;
}
CollisionConfiguration::~CollisionConfiguration()
{
this->!CollisionConfiguration();
}
CollisionConfiguration::!CollisionConfiguration()
{
delete _native;
_native = NULL;
}
bool CollisionConfiguration::IsDisposed::get()
{
return (_native == NULL);
}
#ifndef DISABLE_UNCOMMON
PoolAllocator^ CollisionConfiguration::CollisionAlgorithmPool::get()
{
if (!_collisionAlgorithmPool)
{
_collisionAlgorithmPool = gcnew PoolAllocator(_native->getCollisionAlgorithmPool(), true);
}
return _collisionAlgorithmPool;
}
PoolAllocator^ CollisionConfiguration::PersistentManifoldPool::get()
{
if (!_persistentManifoldPool)
{
_persistentManifoldPool = gcnew PoolAllocator(_native->getPersistentManifoldPool(), true);
}
return _persistentManifoldPool;
}
#endif
| {
"content_hash": "e5e584352453a802585d65264b508ffa",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 92,
"avg_line_length": 21.956521739130434,
"alnum_prop": 0.7465346534653465,
"repo_name": "RainsSoft/BulletSharp",
"id": "c5a5458ed192e9db198e4bc49d5e87460c97c53a",
"size": "1031",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/CollisionConfiguration.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "6138"
},
{
"name": "C",
"bytes": "230"
},
{
"name": "C#",
"bytes": "1817796"
},
{
"name": "C++",
"bytes": "1720580"
},
{
"name": "FLUX",
"bytes": "17776"
}
],
"symlink_target": ""
} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Function ierase_all_copy</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../string_algo/reference.html#header.boost.algorithm.string.erase_hpp" title="Header <boost/algorithm/string/erase.hpp>">
<link rel="prev" href="erase_all.html" title="Function template erase_all">
<link rel="next" href="ierase_all.html" title="Function template ierase_all">
</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="erase_all.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../string_algo/reference.html#header.boost.algorithm.string.erase_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="ierase_all.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.algorithm.ierase_all_copy"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function ierase_all_copy</span></h2>
<p>boost::algorithm::ierase_all_copy — Erase all algorithm ( case insensitive ) </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="../../string_algo/reference.html#header.boost.algorithm.string.erase_hpp" title="Header <boost/algorithm/string/erase.hpp>">boost/algorithm/string/erase.hpp</a>>
</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> OutputIteratorT<span class="special">,</span> <span class="keyword">typename</span> Range1T<span class="special">,</span> <span class="keyword">typename</span> Range2T<span class="special">></span>
<span class="identifier">OutputIteratorT</span>
<span class="identifier">ierase_all_copy</span><span class="special">(</span><span class="identifier">OutputIteratorT</span> Output<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">Range1T</span> <span class="special">&</span> Input<span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">Range2T</span> <span class="special">&</span> Search<span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span> <span class="special">&</span> Loc <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
<span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> SequenceT<span class="special">,</span> <span class="keyword">typename</span> RangeT<span class="special">></span>
<span class="identifier">SequenceT</span> <span class="identifier">ierase_all_copy</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">SequenceT</span> <span class="special">&</span> Input<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">RangeT</span> <span class="special">&</span> Search<span class="special">,</span>
<span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span> <span class="special">&</span> Loc <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">locale</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idp164896224"></a><h2>Description</h2>
<p>Remove all the occurrences of the string from the input. The result is a modified copy of the input. It is returned as a sequence or copied to the output iterator. Searching is case insensitive.</p>
<p>
</p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>The second variant of this function provides the strong exception-safety guarantee </p></td></tr>
</table></div>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">Input</code></span></p></td>
<td><p>An input string </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">Loc</code></span></p></td>
<td><p>A locale used for case insensitive comparison </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">Output</code></span></p></td>
<td><p>An output iterator to which the result will be copied </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">Search</code></span></p></td>
<td><p>A substring to be searched for </p></td>
</tr>
</tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>An output iterator pointing just after the last inserted character or a modified copy of the input</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 © 2002-2004 Pavol Droba<p>Use, modification and distribution is subject to the Boost
Software License, Version 1.0. (See accompanying file
<code class="filename">LICENSE_1_0.txt</code> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="erase_all.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../string_algo/reference.html#header.boost.algorithm.string.erase_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="ierase_all.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| {
"content_hash": "f1cf74e38b3919b9fd94b22af2b2e593",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 474,
"avg_line_length": 73.41509433962264,
"alnum_prop": 0.6673091750192752,
"repo_name": "hand-iemura/lightpng",
"id": "e79f9b6aaa87e87200eab59cd344a6bd1fc90ee8",
"size": "7782",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "boost_1_53_0/doc/html/boost/algorithm/ierase_all_copy.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "139512"
},
{
"name": "Batchfile",
"bytes": "43970"
},
{
"name": "C",
"bytes": "2306793"
},
{
"name": "C#",
"bytes": "40804"
},
{
"name": "C++",
"bytes": "139009726"
},
{
"name": "CMake",
"bytes": "1741"
},
{
"name": "CSS",
"bytes": "309758"
},
{
"name": "Cuda",
"bytes": "26749"
},
{
"name": "FORTRAN",
"bytes": "1387"
},
{
"name": "Groff",
"bytes": "8039"
},
{
"name": "HTML",
"bytes": "139153356"
},
{
"name": "IDL",
"bytes": "14"
},
{
"name": "JavaScript",
"bytes": "132031"
},
{
"name": "Lex",
"bytes": "1255"
},
{
"name": "M4",
"bytes": "29689"
},
{
"name": "Makefile",
"bytes": "1074346"
},
{
"name": "Max",
"bytes": "36857"
},
{
"name": "Objective-C",
"bytes": "3745"
},
{
"name": "PHP",
"bytes": "59030"
},
{
"name": "Perl",
"bytes": "29502"
},
{
"name": "Perl6",
"bytes": "2053"
},
{
"name": "Python",
"bytes": "1710815"
},
{
"name": "QML",
"bytes": "593"
},
{
"name": "Rebol",
"bytes": "354"
},
{
"name": "Shell",
"bytes": "376263"
},
{
"name": "Tcl",
"bytes": "1172"
},
{
"name": "TeX",
"bytes": "13404"
},
{
"name": "XSLT",
"bytes": "761090"
},
{
"name": "Yacc",
"bytes": "18910"
}
],
"symlink_target": ""
} |
#ifndef __itkMaskNeighborhoodOperatorImageFilter_h
#define __itkMaskNeighborhoodOperatorImageFilter_h
#include "itkNeighborhoodOperatorImageFilter.h"
namespace itk
{
/** \class MaskNeighborhoodOperatorImageFilter
* \brief Applies a single NeighborhoodOperator to an image,
* processing only those pixels that are under a mask.
*
* This filter calculates successive inner products between a single
* NeighborhoodOperator and a NeighborhoodIterator, which is swept
* across every pixel that is set in the input mask. If no mask is
* given, this filter is equivalent to its superclass. Output pixels
* that are outside of the mask will be set to DefaultValue if
* UseDefaultValue is true (default). Otherwise, they will be set to
* the value of the input pixel.
*
* \ingroup ImageFilters
*
* \sa Image
* \sa Neighborhood
* \sa NeighborhoodOperator
* \sa NeighborhoodOperatorImageFilter
* \sa NeighborhoodIterator
* \ingroup ITKImageFilterBase
*
* \wiki
* \wikiexample{Images/MaskNeighborhoodOperatorImageFilter,Apply a kernel to every pixel in an image that is non-zero in a mask}
* \endwiki
*/
template< class TInputImage, class TMaskImage, class TOutputImage, class TOperatorValueType =
typename TOutputImage::PixelType >
class ITK_EXPORT MaskNeighborhoodOperatorImageFilter:
public NeighborhoodOperatorImageFilter< TInputImage, TOutputImage, TOperatorValueType >
{
public:
/** Standard "Self" & Superclass typedef. */
typedef MaskNeighborhoodOperatorImageFilter Self;
typedef NeighborhoodOperatorImageFilter<
TInputImage, TOutputImage, TOperatorValueType > Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(MaskNeighborhoodOperatorImageFilter, NeighborhoodOperatorImageFilter);
/** Extract some information from the image types. Dimensionality
* of the two images is assumed to be the same. */
typedef typename TOutputImage::PixelType OutputPixelType;
typedef typename TOutputImage::InternalPixelType OutputInternalPixelType;
typedef typename TInputImage::PixelType InputPixelType;
typedef typename TInputImage::InternalPixelType InputInternalPixelType;
typedef typename TMaskImage::PixelType MaskPixelType;
typedef typename TMaskImage::InternalPixelType MaskInternalPixelType;
/** Extract some information from the image types. Dimensionality
* of the two images is assumed to be the same. */
itkStaticConstMacro(ImageDimension, unsigned int,
TOutputImage::ImageDimension);
itkStaticConstMacro(InputImageDimension, unsigned int,
TInputImage::ImageDimension);
itkStaticConstMacro(MaskImageDimension, unsigned int,
TMaskImage::ImageDimension);
/** Image typedef support. */
typedef TInputImage InputImageType;
typedef TMaskImage MaskImageType;
typedef TOutputImage OutputImageType;
typedef typename InputImageType::Pointer InputImagePointer;
typedef typename MaskImageType::Pointer MaskImagePointer;
/** Typedef for generic boundary condition pointer. */
typedef ImageBoundaryCondition< OutputImageType > *
ImageBoundaryConditionPointerType;
/** Superclass typedefs. */
typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
typedef typename Superclass::OperatorValueType OperatorValueType;
/** Neighborhood types */
typedef typename Superclass::OutputNeighborhoodType OutputNeighborhoodType;
/** Set the mask image. Using a mask is optional. When a mask is
* specified, the normalized correlation is only calculated for
* those pixels under the mask. */
void SetMaskImage(const TMaskImage *mask);
/** Get the mask image. Using a mask is optional. When a mask is
* specified, the normalized correlation is only calculated for
* those pixels under the mask. */
const TMaskImage * GetMaskImage() const;
/** Set the output value for the pixels that are not under the mask.
* Defaults to zero.
*/
itkSetMacro(DefaultValue, OutputPixelType);
/** Get the output value for the pixels that are not under the
* mask. */
itkGetConstMacro(DefaultValue, OutputPixelType);
/** Set the UseDefaultValue flag. If true, the pixels outside the
* mask will e set to m_DefaultValue. Otherwise, they will be set
* to the input pixel. */
itkSetMacro(UseDefaultValue, bool);
/** Get the UseDefaultValue flag. */
itkGetConstReferenceMacro(UseDefaultValue, bool);
/** Turn on and off the UseDefaultValue flag. */
itkBooleanMacro(UseDefaultValue);
#ifdef ITK_USE_CONCEPT_CHECKING
/** Begin concept checking */
itkConceptMacro( OutputEqualityComparableCheck,
( Concept::EqualityComparable< OutputPixelType > ) );
itkConceptMacro( SameDimensionCheck1,
( Concept::SameDimension< InputImageDimension, ImageDimension > ) );
itkConceptMacro( SameDimensionCheck2,
( Concept::SameDimension< InputImageDimension, MaskImageDimension > ) );
itkConceptMacro( InputConvertibleToOutputCheck,
( Concept::Convertible< InputPixelType, OutputPixelType > ) );
itkConceptMacro( OperatorConvertibleToOutputCheck,
( Concept::Convertible< OperatorValueType, OutputPixelType > ) );
itkConceptMacro( OutputOStreamWritable,
( Concept::OStreamWritable< OutputPixelType > ) );
/** End concept checking */
#endif
protected:
MaskNeighborhoodOperatorImageFilter():m_DefaultValue(NumericTraits< OutputPixelType >::Zero),
m_UseDefaultValue(true) {}
virtual ~MaskNeighborhoodOperatorImageFilter() {}
void PrintSelf(std::ostream & os, Indent indent) const;
/** MaskNeighborhoodOperatorImageFilter needs to request enough of an
* input image to account for template size. The input requested
* region is expanded by the radius of the template. If the request
* extends past the LargestPossibleRegion for the input, the request
* is cropped by the LargestPossibleRegion. */
void GenerateInputRequestedRegion()
throw ( InvalidRequestedRegionError );
/** MaskNeighborhoodOperatorImageFilter can be implemented as a
* multithreaded filter. Therefore, this implementation provides a
* ThreadedGenerateData() routine which is called for each
* processing thread. The output image data is allocated
* automatically by the superclass prior to calling
* ThreadedGenerateData(). ThreadedGenerateData can only write to
* the portion of the output image specified by the parameter
* "outputRegionForThread"
*
* \sa ImageToImageFilter::ThreadedGenerateData(),
* ImageToImageFilter::GenerateData() */
void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
ThreadIdType threadId);
private:
MaskNeighborhoodOperatorImageFilter(const Self &); //purposely not implemented
void operator=(const Self &); //purposely not implemented
OutputPixelType m_DefaultValue;
bool m_UseDefaultValue;
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "itkMaskNeighborhoodOperatorImageFilter.hxx"
#endif
#endif
| {
"content_hash": "8b34725ade318faf2df5171890153666",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 128,
"avg_line_length": 41.62359550561798,
"alnum_prop": 0.7419354838709677,
"repo_name": "hinerm/ITK",
"id": "ef05df9319787cf140b9223c80d87bf01dba55b9",
"size": "8184",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Modules/Filtering/ImageFilterBase/include/itkMaskNeighborhoodOperatorImageFilter.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "1153"
},
{
"name": "C",
"bytes": "27436331"
},
{
"name": "C#",
"bytes": "1714"
},
{
"name": "C++",
"bytes": "42903411"
},
{
"name": "FORTRAN",
"bytes": "2241251"
},
{
"name": "Io",
"bytes": "1833"
},
{
"name": "Java",
"bytes": "60605"
},
{
"name": "JavaScript",
"bytes": "1435"
},
{
"name": "Objective-C",
"bytes": "299055"
},
{
"name": "Perl",
"bytes": "23349"
},
{
"name": "Prolog",
"bytes": "4406"
},
{
"name": "Python",
"bytes": "950736"
},
{
"name": "Ruby",
"bytes": "296"
},
{
"name": "Shell",
"bytes": "94645"
},
{
"name": "Tcl",
"bytes": "130495"
},
{
"name": "XML",
"bytes": "194665"
}
],
"symlink_target": ""
} |
#ifndef _MAKESHIFT_MESH_HPP_
#define _MAKESHIFT_MESH_HPP_
#include <vector>
#include <iostream>
#include <glm/glm.hpp>
#include <GL/glew.h>
#include <GL/gl.h>
#include "renderer/graphics/batch.hpp"
/**
@author Mark Asp
@version 0.01
@brief Stores a mesh or collection of vertex, texture, & normal data
@details Provides an OpenGL wrapper for a vertex buffer object, texture
buffer object, and normal buffer object.
*/
class Mesh
{
public:
Mesh();
virtual ~Mesh();
void generateMesh(Batch const& batch);
/**
Returns a vao ID that OpenGL can use to render
@param id The VAO ID used to render
*/
virtual int id() const;
virtual size_t size() const;
private:
// All of the data is bound to the vertex array object
GLuint vao;
GLuint vbo;
GLuint tbo;
size_t numVertices;
void deallocate();
Mesh(Mesh const& other);
Mesh& operator=(Mesh const&);
};
#endif
| {
"content_hash": "29faa9f6e473601e1a124d828368f87a",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 75,
"avg_line_length": 17.92452830188679,
"alnum_prop": 0.6578947368421053,
"repo_name": "masp/VoxelTest",
"id": "3e2bdd653ec492a77b5833064278eb89a71d3969",
"size": "950",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "include/renderer/graphics/mesh.hpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "24663"
}
],
"symlink_target": ""
} |
(function() {
/** Pop-up fade-in/-out delay */
var FADE_DURATION = 250;
/**
* Load the stylesheet that will pick the correct font for the user's OS
*/
function loadOSStyles() {
var osStyle = document.createElement('link');
osStyle.rel = 'stylesheet';
osStyle.type = 'text/css';
if(navigator.userAgent.indexOf('Windows') !== -1) {
osStyle.href = '../../css/options/options-win.css';
} else if(navigator.userAgent.indexOf('Macintosh') !== -1) {
osStyle.href = '../../css/options/options-mac.css';
} else if(navigator.userAgent.indexOf('CrOS') !== -1) {
osStyle.href = '../../css/options/options-cros.css';
// Change the “Chrome” label to “Chrome OS” on CrOS.
document.querySelector('.sideBar h1').innerText = 'Chrome OS';
} else {
osStyle.href = '../../css/options/options-linux.css';
}
document.head.appendChild(osStyle);
}
/**
* Change any chrome:// link to use the goToPage function
*/
function setUpChromeLinks() {
// Get the list of <a>s.
var links = document.getElementsByTagName('a');
// For each link,
for(var i = 0; i < links.length; i++) {
// if the URL begins with “chrome://”,
if(links[i].href.indexOf('chrome://') === 0) {
// tell it to goToPage onclick.
links[i].onclick = goToPage;
}
}
}
/**
* Use chrome.tabs.update to open a link Chrome will not open normally
*/
function goToPage(e) {
// Prevent the browser from following the link.
e.preventDefault();
chrome.tabs.update({ url: e.target.href });
}
/**
* Add show and hide functions to all pop-up pages
*/
function setUpPopups() {
// Get the list of pop-ups.
var popups = document.getElementsByClassName('page');
// For each pop-up,
for(var i = 0; i < popups.length; i++) {
// Set the show and hide functions.
popups[i].show = showPopup;
popups[i].fadeOut = fadeOutPopup;
popups[i].hide = hidePopup;
// Get the list of close buttons.
var closeButtons = popups[i].getElementsByClassName('closeButton');
// For each close button,
for(var j = 0; j < closeButtons.length; j++) {
// If it is a direct child of the pop-up,
if(closeButtons[j].parentElement === popups[i]) {
// Make it close the pop-up.
closeButtons[j].addEventListener('click', function(e) {
e.target.parentElement.fadeOut();
}, false);
}
}
}
// Get the list of overlays.
var overlays = document.getElementsByClassName('overlay');
// For each overlay,
for(var i = 0; i < overlays.length; i++) {
overlays[i].fadeOutChildPopups = fadeOutChildPopups;
overlays[i].hideChildPopups = hideChildPopups;
// Close child pop-ups onclick.
overlays[i].addEventListener('click', function(e) {
// If the click was outside any pop-up.
if(e.target.classList.contains('overlay')) {
e.target.fadeOutChildPopups();
}
}, false);
}
}
/**
* Show a pop-up page
*/
function showPopup() {
// Un-hide the pop-up.
this.classList.remove('hidden');
// If the pop-up is in an overlay element,
if(this.parentElement.classList.contains('overlay')) {
// Un-hide the overlay.
this.parentElement.classList.remove('hidden');
var self = this;
setTimeout(function() {
self.parentElement.classList.remove('transparent');
}, 1);
}
}
/**
* Fade out a pop-up page
*/
function fadeOutPopup() {
// If the pop-up is in an overlay element,
if(this.parentElement.classList.contains('overlay')) {
// Fade it out.
this.parentElement.classList.add('transparent');
}
var self = this;
setTimeout(function() {
self.hide();
}, FADE_DURATION);
}
/**
* Finish hiding a pop-up page
*/
function hidePopup() {
// If the pop-up is in an overlay element,
if(this.parentElement.classList.contains('overlay')) {
// Hide the overlay.
this.parentElement.classList.add('hidden');
}
// Hide the pop-up.
this.classList.add('hidden');
}
/**
* Fade out all the pop-ups in an overlay.
*/
function fadeOutChildPopups() {
// Fade the overlay out.
this.classList.add('transparent');
var self = this;
setTimeout(function() {
self.hideChildPopups();
}, FADE_DURATION);
}
/**
* Hide all the pop-ups in an overlay.
*/
function hideChildPopups() {
// Hide the overlay.
this.classList.add('hidden');
// Get the list of pop-ups.
var popups = this.getElementsByClassName('page');
// Hide each pop-up.
for(var i = 0; i < popups.length; i++) {
popups[i].classList.add('hidden');
}
}
// Load OS styles and set up chrome:// links when the page loads.
window.addEventListener('load', function() {
loadOSStyles();
setUpChromeLinks();
setUpPopups();
}, false);
})();
| {
"content_hash": "19d7da009c8d60d7a4e9254ddd41fded",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 73,
"avg_line_length": 28.303030303030305,
"alnum_prop": 0.6402569593147751,
"repo_name": "nickcanz/revere-extension",
"id": "9470a5416c8b9b8a6df90e6fb9d6f9479028a35d",
"size": "4682",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "js/options/options-setup.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "30286"
},
{
"name": "JavaScript",
"bytes": "13308"
}
],
"symlink_target": ""
} |
<?php
App::uses('Validation', 'Utility');
/**
* CustomValidator class
*
* @package Cake.Test.Case.Utility
*/
class CustomValidator {
/**
* Makes sure that a given $email address is valid and unique
*
* @param string $email
* @return boolean
*/
public static function customValidate($check) {
return (bool)preg_match('/^[0-9]{3}$/', $check);
}
}
/**
* TestNlValidation class
*
* Used to test pass through of Validation
*
* @package Cake.Test.Case.Utility
*/
class TestNlValidation {
/**
* postal function, for testing postal pass through.
*
* @param string $check
* @return void
*/
public static function postal($check) {
return true;
}
/**
* ssn function for testing ssn pass through
*
* @return void
*/
public static function ssn($check) {
return true;
}
}
/**
* TestDeValidation class
*
* Used to test pass through of Validation
*
* @package Cake.Test.Case.Utility
*/
class TestDeValidation {
/**
* phone function, for testing phone pass through.
*
* @param string $check
* @return void
*/
public static function phone($check) {
return true;
}
}
/**
* Test Case for Validation Class
*
* @package Cake.Test.Case.Utility
*/
class ValidationTest extends CakeTestCase {
/**
* setUp method
*
* @return void
*/
public function setUp() {
parent::setUp();
$this->_appEncoding = Configure::read('App.encoding');
$this->_appLocale = array();
foreach (array(LC_MONETARY, LC_NUMERIC, LC_TIME) as $category) {
$this->_appLocale[$category] = setlocale($category, 0);
setlocale($category, 'en_US');
}
}
/**
* tearDown method
*
* @return void
*/
public function tearDown() {
parent::tearDown();
Configure::write('App.encoding', $this->_appEncoding);
foreach ($this->_appLocale as $category => $locale) {
setlocale($category, $locale);
}
}
/**
* testNotEmpty method
*
* @return void
*/
public function testNotEmpty() {
$this->assertTrue(Validation::notEmpty('abcdefg'));
$this->assertTrue(Validation::notEmpty('fasdf '));
$this->assertTrue(Validation::notEmpty('fooo' . chr(243) . 'blabla'));
$this->assertTrue(Validation::notEmpty('abçďĕʑʘπй'));
$this->assertTrue(Validation::notEmpty('José'));
$this->assertTrue(Validation::notEmpty('é'));
$this->assertTrue(Validation::notEmpty('π'));
$this->assertFalse(Validation::notEmpty("\t "));
$this->assertFalse(Validation::notEmpty(""));
}
/**
* testNotEmptyISO88591Encoding method
*
* @return void
*/
public function testNotEmptyISO88591AppEncoding() {
Configure::write('App.encoding', 'ISO-8859-1');
$this->assertTrue(Validation::notEmpty('abcdefg'));
$this->assertTrue(Validation::notEmpty('fasdf '));
$this->assertTrue(Validation::notEmpty('fooo' . chr(243) . 'blabla'));
$this->assertTrue(Validation::notEmpty('abçďĕʑʘπй'));
$this->assertTrue(Validation::notEmpty('José'));
$this->assertTrue(Validation::notEmpty(utf8_decode('José')));
$this->assertFalse(Validation::notEmpty("\t "));
$this->assertFalse(Validation::notEmpty(""));
}
/**
* testAlphaNumeric method
*
* @return void
*/
public function testAlphaNumeric() {
$this->assertTrue(Validation::alphaNumeric('frferrf'));
$this->assertTrue(Validation::alphaNumeric('12234'));
$this->assertTrue(Validation::alphaNumeric('1w2e2r3t4y'));
$this->assertTrue(Validation::alphaNumeric('0'));
$this->assertTrue(Validation::alphaNumeric('abçďĕʑʘπй'));
$this->assertTrue(Validation::alphaNumeric('ˇˆๆゞ'));
$this->assertTrue(Validation::alphaNumeric('אกあアꀀ豈'));
$this->assertTrue(Validation::alphaNumeric('Džᾈᾨ'));
$this->assertTrue(Validation::alphaNumeric('ÆΔΩЖÇ'));
$this->assertFalse(Validation::alphaNumeric('12 234'));
$this->assertFalse(Validation::alphaNumeric('dfd 234'));
$this->assertFalse(Validation::alphaNumeric("0\n"));
$this->assertFalse(Validation::alphaNumeric("\n"));
$this->assertFalse(Validation::alphaNumeric("\t"));
$this->assertFalse(Validation::alphaNumeric("\r"));
$this->assertFalse(Validation::alphaNumeric(' '));
$this->assertFalse(Validation::alphaNumeric(''));
}
/**
* testAlphaNumericPassedAsArray method
*
* @return void
*/
public function testAlphaNumericPassedAsArray() {
$this->assertTrue(Validation::alphaNumeric(array('check' => 'frferrf')));
$this->assertTrue(Validation::alphaNumeric(array('check' => '12234')));
$this->assertTrue(Validation::alphaNumeric(array('check' => '1w2e2r3t4y')));
$this->assertTrue(Validation::alphaNumeric(array('check' => '0')));
$this->assertFalse(Validation::alphaNumeric(array('check' => '12 234')));
$this->assertFalse(Validation::alphaNumeric(array('check' => 'dfd 234')));
$this->assertFalse(Validation::alphaNumeric(array('check' => "\n")));
$this->assertFalse(Validation::alphaNumeric(array('check' => "\t")));
$this->assertFalse(Validation::alphaNumeric(array('check' => "\r")));
$this->assertFalse(Validation::alphaNumeric(array('check' => ' ')));
$this->assertFalse(Validation::alphaNumeric(array('check' => '')));
}
/**
* testBetween method
*
* @return void
*/
public function testBetween() {
$this->assertTrue(Validation::between('abcdefg', 1, 7));
$this->assertTrue(Validation::between('', 0, 7));
$this->assertTrue(Validation::between('אกあアꀀ豈', 1, 7));
$this->assertFalse(Validation::between('abcdefg', 1, 6));
$this->assertFalse(Validation::between('ÆΔΩЖÇ', 1, 3));
}
/**
* testBlank method
*
* @return void
*/
public function testBlank() {
$this->assertTrue(Validation::blank(''));
$this->assertTrue(Validation::blank(' '));
$this->assertTrue(Validation::blank("\n"));
$this->assertTrue(Validation::blank("\t"));
$this->assertTrue(Validation::blank("\r"));
$this->assertFalse(Validation::blank(' Blank'));
$this->assertFalse(Validation::blank('Blank'));
}
/**
* testBlankAsArray method
*
* @return void
*/
public function testBlankAsArray() {
$this->assertTrue(Validation::blank(array('check' => '')));
$this->assertTrue(Validation::blank(array('check' => ' ')));
$this->assertTrue(Validation::blank(array('check' => "\n")));
$this->assertTrue(Validation::blank(array('check' => "\t")));
$this->assertTrue(Validation::blank(array('check' => "\r")));
$this->assertFalse(Validation::blank(array('check' => ' Blank')));
$this->assertFalse(Validation::blank(array('check' => 'Blank')));
}
/**
* testcc method
*
* @return void
*/
public function testCc() {
//American Express
$this->assertTrue(Validation::cc('370482756063980', array('amex')));
$this->assertTrue(Validation::cc('349106433773483', array('amex')));
$this->assertTrue(Validation::cc('344671486204764', array('amex')));
$this->assertTrue(Validation::cc('344042544509943', array('amex')));
$this->assertTrue(Validation::cc('377147515754475', array('amex')));
$this->assertTrue(Validation::cc('375239372816422', array('amex')));
$this->assertTrue(Validation::cc('376294341957707', array('amex')));
$this->assertTrue(Validation::cc('341779292230411', array('amex')));
$this->assertTrue(Validation::cc('341646919853372', array('amex')));
$this->assertTrue(Validation::cc('348498616319346', array('amex')));
//BankCard
$this->assertTrue(Validation::cc('5610745867413420', array('bankcard')));
$this->assertTrue(Validation::cc('5610376649499352', array('bankcard')));
$this->assertTrue(Validation::cc('5610091936000694', array('bankcard')));
$this->assertTrue(Validation::cc('5602248780118788', array('bankcard')));
$this->assertTrue(Validation::cc('5610631567676765', array('bankcard')));
$this->assertTrue(Validation::cc('5602238211270795', array('bankcard')));
$this->assertTrue(Validation::cc('5610173951215470', array('bankcard')));
$this->assertTrue(Validation::cc('5610139705753702', array('bankcard')));
$this->assertTrue(Validation::cc('5602226032150551', array('bankcard')));
$this->assertTrue(Validation::cc('5602223993735777', array('bankcard')));
//Diners Club 14
$this->assertTrue(Validation::cc('30155483651028', array('diners')));
$this->assertTrue(Validation::cc('36371312803821', array('diners')));
$this->assertTrue(Validation::cc('38801277489875', array('diners')));
$this->assertTrue(Validation::cc('30348560464296', array('diners')));
$this->assertTrue(Validation::cc('30349040317708', array('diners')));
$this->assertTrue(Validation::cc('36567413559978', array('diners')));
$this->assertTrue(Validation::cc('36051554732702', array('diners')));
$this->assertTrue(Validation::cc('30391842198191', array('diners')));
$this->assertTrue(Validation::cc('30172682197745', array('diners')));
$this->assertTrue(Validation::cc('30162056566641', array('diners')));
$this->assertTrue(Validation::cc('30085066927745', array('diners')));
$this->assertTrue(Validation::cc('36519025221976', array('diners')));
$this->assertTrue(Validation::cc('30372679371044', array('diners')));
$this->assertTrue(Validation::cc('38913939150124', array('diners')));
$this->assertTrue(Validation::cc('36852899094637', array('diners')));
$this->assertTrue(Validation::cc('30138041971120', array('diners')));
$this->assertTrue(Validation::cc('36184047836838', array('diners')));
$this->assertTrue(Validation::cc('30057460264462', array('diners')));
$this->assertTrue(Validation::cc('38980165212050', array('diners')));
$this->assertTrue(Validation::cc('30356516881240', array('diners')));
$this->assertTrue(Validation::cc('38744810033182', array('diners')));
$this->assertTrue(Validation::cc('30173638706621', array('diners')));
$this->assertTrue(Validation::cc('30158334709185', array('diners')));
$this->assertTrue(Validation::cc('30195413721186', array('diners')));
$this->assertTrue(Validation::cc('38863347694793', array('diners')));
$this->assertTrue(Validation::cc('30275627009113', array('diners')));
$this->assertTrue(Validation::cc('30242860404971', array('diners')));
$this->assertTrue(Validation::cc('30081877595151', array('diners')));
$this->assertTrue(Validation::cc('38053196067461', array('diners')));
$this->assertTrue(Validation::cc('36520379984870', array('diners')));
//2004 MasterCard/Diners Club Alliance International 14
$this->assertTrue(Validation::cc('36747701998969', array('diners')));
$this->assertTrue(Validation::cc('36427861123159', array('diners')));
$this->assertTrue(Validation::cc('36150537602386', array('diners')));
$this->assertTrue(Validation::cc('36582388820610', array('diners')));
$this->assertTrue(Validation::cc('36729045250216', array('diners')));
//2004 MasterCard/Diners Club Alliance US & Canada 16
$this->assertTrue(Validation::cc('5597511346169950', array('diners')));
$this->assertTrue(Validation::cc('5526443162217562', array('diners')));
$this->assertTrue(Validation::cc('5577265786122391', array('diners')));
$this->assertTrue(Validation::cc('5534061404676989', array('diners')));
$this->assertTrue(Validation::cc('5545313588374502', array('diners')));
//Discover
$this->assertTrue(Validation::cc('6011802876467237', array('disc')));
$this->assertTrue(Validation::cc('6506432777720955', array('disc')));
$this->assertTrue(Validation::cc('6011126265283942', array('disc')));
$this->assertTrue(Validation::cc('6502187151579252', array('disc')));
$this->assertTrue(Validation::cc('6506600836002298', array('disc')));
$this->assertTrue(Validation::cc('6504376463615189', array('disc')));
$this->assertTrue(Validation::cc('6011440907005377', array('disc')));
$this->assertTrue(Validation::cc('6509735979634270', array('disc')));
$this->assertTrue(Validation::cc('6011422366775856', array('disc')));
$this->assertTrue(Validation::cc('6500976374623323', array('disc')));
//enRoute
$this->assertTrue(Validation::cc('201496944158937', array('enroute')));
$this->assertTrue(Validation::cc('214945833739665', array('enroute')));
$this->assertTrue(Validation::cc('214982692491187', array('enroute')));
$this->assertTrue(Validation::cc('214901395949424', array('enroute')));
$this->assertTrue(Validation::cc('201480676269187', array('enroute')));
$this->assertTrue(Validation::cc('214911922887807', array('enroute')));
$this->assertTrue(Validation::cc('201485025457250', array('enroute')));
$this->assertTrue(Validation::cc('201402662758866', array('enroute')));
$this->assertTrue(Validation::cc('214981579370225', array('enroute')));
$this->assertTrue(Validation::cc('201447595859877', array('enroute')));
//JCB 15 digit
$this->assertTrue(Validation::cc('210034762247893', array('jcb')));
$this->assertTrue(Validation::cc('180078671678892', array('jcb')));
$this->assertTrue(Validation::cc('180010559353736', array('jcb')));
$this->assertTrue(Validation::cc('210095474464258', array('jcb')));
$this->assertTrue(Validation::cc('210006675562188', array('jcb')));
$this->assertTrue(Validation::cc('210063299662662', array('jcb')));
$this->assertTrue(Validation::cc('180032506857825', array('jcb')));
$this->assertTrue(Validation::cc('210057919192738', array('jcb')));
$this->assertTrue(Validation::cc('180031358949367', array('jcb')));
$this->assertTrue(Validation::cc('180033802147846', array('jcb')));
//JCB 16 digit
$this->assertTrue(Validation::cc('3096806857839939', array('jcb')));
$this->assertTrue(Validation::cc('3158699503187091', array('jcb')));
$this->assertTrue(Validation::cc('3112549607186579', array('jcb')));
$this->assertTrue(Validation::cc('3112332922425604', array('jcb')));
$this->assertTrue(Validation::cc('3112001541159239', array('jcb')));
$this->assertTrue(Validation::cc('3112162495317841', array('jcb')));
$this->assertTrue(Validation::cc('3337562627732768', array('jcb')));
$this->assertTrue(Validation::cc('3337107161330775', array('jcb')));
$this->assertTrue(Validation::cc('3528053736003621', array('jcb')));
$this->assertTrue(Validation::cc('3528915255020360', array('jcb')));
$this->assertTrue(Validation::cc('3096786059660921', array('jcb')));
$this->assertTrue(Validation::cc('3528264799292320', array('jcb')));
$this->assertTrue(Validation::cc('3096469164130136', array('jcb')));
$this->assertTrue(Validation::cc('3112127443822853', array('jcb')));
$this->assertTrue(Validation::cc('3096849995802328', array('jcb')));
$this->assertTrue(Validation::cc('3528090735127407', array('jcb')));
$this->assertTrue(Validation::cc('3112101006819234', array('jcb')));
$this->assertTrue(Validation::cc('3337444428040784', array('jcb')));
$this->assertTrue(Validation::cc('3088043154151061', array('jcb')));
$this->assertTrue(Validation::cc('3088295969414866', array('jcb')));
$this->assertTrue(Validation::cc('3158748843158575', array('jcb')));
$this->assertTrue(Validation::cc('3158709206148538', array('jcb')));
$this->assertTrue(Validation::cc('3158365159575324', array('jcb')));
$this->assertTrue(Validation::cc('3158671691305165', array('jcb')));
$this->assertTrue(Validation::cc('3528523028771093', array('jcb')));
$this->assertTrue(Validation::cc('3096057126267870', array('jcb')));
$this->assertTrue(Validation::cc('3158514047166834', array('jcb')));
$this->assertTrue(Validation::cc('3528274546125962', array('jcb')));
$this->assertTrue(Validation::cc('3528890967705733', array('jcb')));
$this->assertTrue(Validation::cc('3337198811307545', array('jcb')));
//Maestro (debit card)
$this->assertTrue(Validation::cc('5020147409985219', array('maestro')));
$this->assertTrue(Validation::cc('5020931809905616', array('maestro')));
$this->assertTrue(Validation::cc('5020412965470224', array('maestro')));
$this->assertTrue(Validation::cc('5020129740944022', array('maestro')));
$this->assertTrue(Validation::cc('5020024696747943', array('maestro')));
$this->assertTrue(Validation::cc('5020581514636509', array('maestro')));
$this->assertTrue(Validation::cc('5020695008411987', array('maestro')));
$this->assertTrue(Validation::cc('5020565359718977', array('maestro')));
$this->assertTrue(Validation::cc('6339931536544062', array('maestro')));
$this->assertTrue(Validation::cc('6465028615704406', array('maestro')));
//Mastercard
$this->assertTrue(Validation::cc('5580424361774366', array('mc')));
$this->assertTrue(Validation::cc('5589563059318282', array('mc')));
$this->assertTrue(Validation::cc('5387558333690047', array('mc')));
$this->assertTrue(Validation::cc('5163919215247175', array('mc')));
$this->assertTrue(Validation::cc('5386742685055055', array('mc')));
$this->assertTrue(Validation::cc('5102303335960674', array('mc')));
$this->assertTrue(Validation::cc('5526543403964565', array('mc')));
$this->assertTrue(Validation::cc('5538725892618432', array('mc')));
$this->assertTrue(Validation::cc('5119543573129778', array('mc')));
$this->assertTrue(Validation::cc('5391174753915767', array('mc')));
$this->assertTrue(Validation::cc('5510994113980714', array('mc')));
$this->assertTrue(Validation::cc('5183720260418091', array('mc')));
$this->assertTrue(Validation::cc('5488082196086704', array('mc')));
$this->assertTrue(Validation::cc('5484645164161834', array('mc')));
$this->assertTrue(Validation::cc('5171254350337031', array('mc')));
$this->assertTrue(Validation::cc('5526987528136452', array('mc')));
$this->assertTrue(Validation::cc('5504148941409358', array('mc')));
$this->assertTrue(Validation::cc('5240793507243615', array('mc')));
$this->assertTrue(Validation::cc('5162114693017107', array('mc')));
$this->assertTrue(Validation::cc('5163104807404753', array('mc')));
$this->assertTrue(Validation::cc('5590136167248365', array('mc')));
$this->assertTrue(Validation::cc('5565816281038948', array('mc')));
$this->assertTrue(Validation::cc('5467639122779531', array('mc')));
$this->assertTrue(Validation::cc('5297350261550024', array('mc')));
$this->assertTrue(Validation::cc('5162739131368058', array('mc')));
//Solo 16
$this->assertTrue(Validation::cc('6767432107064987', array('solo')));
$this->assertTrue(Validation::cc('6334667758225411', array('solo')));
$this->assertTrue(Validation::cc('6767037421954068', array('solo')));
$this->assertTrue(Validation::cc('6767823306394854', array('solo')));
$this->assertTrue(Validation::cc('6334768185398134', array('solo')));
$this->assertTrue(Validation::cc('6767286729498589', array('solo')));
$this->assertTrue(Validation::cc('6334972104431261', array('solo')));
$this->assertTrue(Validation::cc('6334843427400616', array('solo')));
$this->assertTrue(Validation::cc('6767493947881311', array('solo')));
$this->assertTrue(Validation::cc('6767194235798817', array('solo')));
//Solo 18
$this->assertTrue(Validation::cc('676714834398858593', array('solo')));
$this->assertTrue(Validation::cc('676751666435130857', array('solo')));
$this->assertTrue(Validation::cc('676781908573924236', array('solo')));
$this->assertTrue(Validation::cc('633488724644003240', array('solo')));
$this->assertTrue(Validation::cc('676732252338067316', array('solo')));
$this->assertTrue(Validation::cc('676747520084495821', array('solo')));
$this->assertTrue(Validation::cc('633465488901381957', array('solo')));
$this->assertTrue(Validation::cc('633487484858610484', array('solo')));
$this->assertTrue(Validation::cc('633453764680740694', array('solo')));
$this->assertTrue(Validation::cc('676768613295414451', array('solo')));
//Solo 19
$this->assertTrue(Validation::cc('6767838565218340113', array('solo')));
$this->assertTrue(Validation::cc('6767760119829705181', array('solo')));
$this->assertTrue(Validation::cc('6767265917091593668', array('solo')));
$this->assertTrue(Validation::cc('6767938856947440111', array('solo')));
$this->assertTrue(Validation::cc('6767501945697390076', array('solo')));
$this->assertTrue(Validation::cc('6334902868716257379', array('solo')));
$this->assertTrue(Validation::cc('6334922127686425532', array('solo')));
$this->assertTrue(Validation::cc('6334933119080706440', array('solo')));
$this->assertTrue(Validation::cc('6334647959628261714', array('solo')));
$this->assertTrue(Validation::cc('6334527312384101382', array('solo')));
//Switch 16
$this->assertTrue(Validation::cc('5641829171515733', array('switch')));
$this->assertTrue(Validation::cc('5641824852820809', array('switch')));
$this->assertTrue(Validation::cc('6759129648956909', array('switch')));
$this->assertTrue(Validation::cc('6759626072268156', array('switch')));
$this->assertTrue(Validation::cc('5641822698388957', array('switch')));
$this->assertTrue(Validation::cc('5641827123105470', array('switch')));
$this->assertTrue(Validation::cc('5641823755819553', array('switch')));
$this->assertTrue(Validation::cc('5641821939587682', array('switch')));
$this->assertTrue(Validation::cc('4936097148079186', array('switch')));
$this->assertTrue(Validation::cc('5641829739125009', array('switch')));
$this->assertTrue(Validation::cc('5641822860725507', array('switch')));
$this->assertTrue(Validation::cc('4936717688865831', array('switch')));
$this->assertTrue(Validation::cc('6759487613615441', array('switch')));
$this->assertTrue(Validation::cc('5641821346840617', array('switch')));
$this->assertTrue(Validation::cc('5641825793417126', array('switch')));
$this->assertTrue(Validation::cc('5641821302759595', array('switch')));
$this->assertTrue(Validation::cc('6759784969918837', array('switch')));
$this->assertTrue(Validation::cc('5641824910667036', array('switch')));
$this->assertTrue(Validation::cc('6759139909636173', array('switch')));
$this->assertTrue(Validation::cc('6333425070638022', array('switch')));
$this->assertTrue(Validation::cc('5641823910382067', array('switch')));
$this->assertTrue(Validation::cc('4936295218139423', array('switch')));
$this->assertTrue(Validation::cc('6333031811316199', array('switch')));
$this->assertTrue(Validation::cc('4936912044763198', array('switch')));
$this->assertTrue(Validation::cc('4936387053303824', array('switch')));
$this->assertTrue(Validation::cc('6759535838760523', array('switch')));
$this->assertTrue(Validation::cc('6333427174594051', array('switch')));
$this->assertTrue(Validation::cc('5641829037102700', array('switch')));
$this->assertTrue(Validation::cc('5641826495463046', array('switch')));
$this->assertTrue(Validation::cc('6333480852979946', array('switch')));
$this->assertTrue(Validation::cc('5641827761302876', array('switch')));
$this->assertTrue(Validation::cc('5641825083505317', array('switch')));
$this->assertTrue(Validation::cc('6759298096003991', array('switch')));
$this->assertTrue(Validation::cc('4936119165483420', array('switch')));
$this->assertTrue(Validation::cc('4936190990500993', array('switch')));
$this->assertTrue(Validation::cc('4903356467384927', array('switch')));
$this->assertTrue(Validation::cc('6333372765092554', array('switch')));
$this->assertTrue(Validation::cc('5641821330950570', array('switch')));
$this->assertTrue(Validation::cc('6759841558826118', array('switch')));
$this->assertTrue(Validation::cc('4936164540922452', array('switch')));
//Switch 18
$this->assertTrue(Validation::cc('493622764224625174', array('switch')));
$this->assertTrue(Validation::cc('564182823396913535', array('switch')));
$this->assertTrue(Validation::cc('675917308304801234', array('switch')));
$this->assertTrue(Validation::cc('675919890024220298', array('switch')));
$this->assertTrue(Validation::cc('633308376862556751', array('switch')));
$this->assertTrue(Validation::cc('564182377633208779', array('switch')));
$this->assertTrue(Validation::cc('564182870014926787', array('switch')));
$this->assertTrue(Validation::cc('675979788553829819', array('switch')));
$this->assertTrue(Validation::cc('493668394358130935', array('switch')));
$this->assertTrue(Validation::cc('493637431790930965', array('switch')));
$this->assertTrue(Validation::cc('633321438601941513', array('switch')));
$this->assertTrue(Validation::cc('675913800898840986', array('switch')));
$this->assertTrue(Validation::cc('564182592016841547', array('switch')));
$this->assertTrue(Validation::cc('564182428380440899', array('switch')));
$this->assertTrue(Validation::cc('493696376827623463', array('switch')));
$this->assertTrue(Validation::cc('675977939286485757', array('switch')));
$this->assertTrue(Validation::cc('490302699502091579', array('switch')));
$this->assertTrue(Validation::cc('564182085013662230', array('switch')));
$this->assertTrue(Validation::cc('493693054263310167', array('switch')));
$this->assertTrue(Validation::cc('633321755966697525', array('switch')));
$this->assertTrue(Validation::cc('675996851719732811', array('switch')));
$this->assertTrue(Validation::cc('493699211208281028', array('switch')));
$this->assertTrue(Validation::cc('493697817378356614', array('switch')));
$this->assertTrue(Validation::cc('675968224161768150', array('switch')));
$this->assertTrue(Validation::cc('493669416873337627', array('switch')));
$this->assertTrue(Validation::cc('564182439172549714', array('switch')));
$this->assertTrue(Validation::cc('675926914467673598', array('switch')));
$this->assertTrue(Validation::cc('564182565231977809', array('switch')));
$this->assertTrue(Validation::cc('675966282607849002', array('switch')));
$this->assertTrue(Validation::cc('493691609704348548', array('switch')));
$this->assertTrue(Validation::cc('675933118546065120', array('switch')));
$this->assertTrue(Validation::cc('493631116677238592', array('switch')));
$this->assertTrue(Validation::cc('675921142812825938', array('switch')));
$this->assertTrue(Validation::cc('633338311815675113', array('switch')));
$this->assertTrue(Validation::cc('633323539867338621', array('switch')));
$this->assertTrue(Validation::cc('675964912740845663', array('switch')));
$this->assertTrue(Validation::cc('633334008833727504', array('switch')));
$this->assertTrue(Validation::cc('493631941273687169', array('switch')));
$this->assertTrue(Validation::cc('564182971729706785', array('switch')));
$this->assertTrue(Validation::cc('633303461188963496', array('switch')));
//Switch 19
$this->assertTrue(Validation::cc('6759603460617628716', array('switch')));
$this->assertTrue(Validation::cc('4936705825268647681', array('switch')));
$this->assertTrue(Validation::cc('5641829846600479183', array('switch')));
$this->assertTrue(Validation::cc('6759389846573792530', array('switch')));
$this->assertTrue(Validation::cc('4936189558712637603', array('switch')));
$this->assertTrue(Validation::cc('5641822217393868189', array('switch')));
$this->assertTrue(Validation::cc('4903075563780057152', array('switch')));
$this->assertTrue(Validation::cc('4936510653566569547', array('switch')));
$this->assertTrue(Validation::cc('4936503083627303364', array('switch')));
$this->assertTrue(Validation::cc('4936777334398116272', array('switch')));
$this->assertTrue(Validation::cc('5641823876900554860', array('switch')));
$this->assertTrue(Validation::cc('6759619236903407276', array('switch')));
$this->assertTrue(Validation::cc('6759011470269978117', array('switch')));
$this->assertTrue(Validation::cc('6333175833997062502', array('switch')));
$this->assertTrue(Validation::cc('6759498728789080439', array('switch')));
$this->assertTrue(Validation::cc('4903020404168157841', array('switch')));
$this->assertTrue(Validation::cc('6759354334874804313', array('switch')));
$this->assertTrue(Validation::cc('6759900856420875115', array('switch')));
$this->assertTrue(Validation::cc('5641827269346868860', array('switch')));
$this->assertTrue(Validation::cc('5641828995047453870', array('switch')));
$this->assertTrue(Validation::cc('6333321884754806543', array('switch')));
$this->assertTrue(Validation::cc('6333108246283715901', array('switch')));
$this->assertTrue(Validation::cc('6759572372800700102', array('switch')));
$this->assertTrue(Validation::cc('4903095096797974933', array('switch')));
$this->assertTrue(Validation::cc('6333354315797920215', array('switch')));
$this->assertTrue(Validation::cc('6759163746089433755', array('switch')));
$this->assertTrue(Validation::cc('6759871666634807647', array('switch')));
$this->assertTrue(Validation::cc('5641827883728575248', array('switch')));
$this->assertTrue(Validation::cc('4936527975051407847', array('switch')));
$this->assertTrue(Validation::cc('5641823318396882141', array('switch')));
$this->assertTrue(Validation::cc('6759123772311123708', array('switch')));
$this->assertTrue(Validation::cc('4903054736148271088', array('switch')));
$this->assertTrue(Validation::cc('4936477526808883952', array('switch')));
$this->assertTrue(Validation::cc('4936433964890967966', array('switch')));
$this->assertTrue(Validation::cc('6333245128906049344', array('switch')));
$this->assertTrue(Validation::cc('4936321036970553134', array('switch')));
$this->assertTrue(Validation::cc('4936111816358702773', array('switch')));
$this->assertTrue(Validation::cc('4936196077254804290', array('switch')));
$this->assertTrue(Validation::cc('6759558831206830183', array('switch')));
$this->assertTrue(Validation::cc('5641827998830403137', array('switch')));
//VISA 13 digit
$this->assertTrue(Validation::cc('4024007174754', array('visa')));
$this->assertTrue(Validation::cc('4104816460717', array('visa')));
$this->assertTrue(Validation::cc('4716229700437', array('visa')));
$this->assertTrue(Validation::cc('4539305400213', array('visa')));
$this->assertTrue(Validation::cc('4728260558665', array('visa')));
$this->assertTrue(Validation::cc('4929100131792', array('visa')));
$this->assertTrue(Validation::cc('4024007117308', array('visa')));
$this->assertTrue(Validation::cc('4539915491024', array('visa')));
$this->assertTrue(Validation::cc('4539790901139', array('visa')));
$this->assertTrue(Validation::cc('4485284914909', array('visa')));
$this->assertTrue(Validation::cc('4782793022350', array('visa')));
$this->assertTrue(Validation::cc('4556899290685', array('visa')));
$this->assertTrue(Validation::cc('4024007134774', array('visa')));
$this->assertTrue(Validation::cc('4333412341316', array('visa')));
$this->assertTrue(Validation::cc('4539534204543', array('visa')));
$this->assertTrue(Validation::cc('4485640373626', array('visa')));
$this->assertTrue(Validation::cc('4929911445746', array('visa')));
$this->assertTrue(Validation::cc('4539292550806', array('visa')));
$this->assertTrue(Validation::cc('4716523014030', array('visa')));
$this->assertTrue(Validation::cc('4024007125152', array('visa')));
$this->assertTrue(Validation::cc('4539758883311', array('visa')));
$this->assertTrue(Validation::cc('4024007103258', array('visa')));
$this->assertTrue(Validation::cc('4916933155767', array('visa')));
$this->assertTrue(Validation::cc('4024007159672', array('visa')));
$this->assertTrue(Validation::cc('4716935544871', array('visa')));
$this->assertTrue(Validation::cc('4929415177779', array('visa')));
$this->assertTrue(Validation::cc('4929748547896', array('visa')));
$this->assertTrue(Validation::cc('4929153468612', array('visa')));
$this->assertTrue(Validation::cc('4539397132104', array('visa')));
$this->assertTrue(Validation::cc('4485293435540', array('visa')));
$this->assertTrue(Validation::cc('4485799412720', array('visa')));
$this->assertTrue(Validation::cc('4916744757686', array('visa')));
$this->assertTrue(Validation::cc('4556475655426', array('visa')));
$this->assertTrue(Validation::cc('4539400441625', array('visa')));
$this->assertTrue(Validation::cc('4485437129173', array('visa')));
$this->assertTrue(Validation::cc('4716253605320', array('visa')));
$this->assertTrue(Validation::cc('4539366156589', array('visa')));
$this->assertTrue(Validation::cc('4916498061392', array('visa')));
$this->assertTrue(Validation::cc('4716127163779', array('visa')));
$this->assertTrue(Validation::cc('4024007183078', array('visa')));
$this->assertTrue(Validation::cc('4041553279654', array('visa')));
$this->assertTrue(Validation::cc('4532380121960', array('visa')));
$this->assertTrue(Validation::cc('4485906062491', array('visa')));
$this->assertTrue(Validation::cc('4539365115149', array('visa')));
$this->assertTrue(Validation::cc('4485146516702', array('visa')));
//VISA 16 digit
$this->assertTrue(Validation::cc('4916375389940009', array('visa')));
$this->assertTrue(Validation::cc('4929167481032610', array('visa')));
$this->assertTrue(Validation::cc('4485029969061519', array('visa')));
$this->assertTrue(Validation::cc('4485573845281759', array('visa')));
$this->assertTrue(Validation::cc('4485669810383529', array('visa')));
$this->assertTrue(Validation::cc('4929615806560327', array('visa')));
$this->assertTrue(Validation::cc('4556807505609535', array('visa')));
$this->assertTrue(Validation::cc('4532611336232890', array('visa')));
$this->assertTrue(Validation::cc('4532201952422387', array('visa')));
$this->assertTrue(Validation::cc('4485073797976290', array('visa')));
$this->assertTrue(Validation::cc('4024007157580969', array('visa')));
$this->assertTrue(Validation::cc('4053740470212274', array('visa')));
$this->assertTrue(Validation::cc('4716265831525676', array('visa')));
$this->assertTrue(Validation::cc('4024007100222966', array('visa')));
$this->assertTrue(Validation::cc('4539556148303244', array('visa')));
$this->assertTrue(Validation::cc('4532449879689709', array('visa')));
$this->assertTrue(Validation::cc('4916805467840986', array('visa')));
$this->assertTrue(Validation::cc('4532155644440233', array('visa')));
$this->assertTrue(Validation::cc('4467977802223781', array('visa')));
$this->assertTrue(Validation::cc('4539224637000686', array('visa')));
$this->assertTrue(Validation::cc('4556629187064965', array('visa')));
$this->assertTrue(Validation::cc('4532970205932943', array('visa')));
$this->assertTrue(Validation::cc('4821470132041850', array('visa')));
$this->assertTrue(Validation::cc('4916214267894485', array('visa')));
$this->assertTrue(Validation::cc('4024007169073284', array('visa')));
$this->assertTrue(Validation::cc('4716783351296122', array('visa')));
$this->assertTrue(Validation::cc('4556480171913795', array('visa')));
$this->assertTrue(Validation::cc('4929678411034997', array('visa')));
$this->assertTrue(Validation::cc('4682061913519392', array('visa')));
$this->assertTrue(Validation::cc('4916495481746474', array('visa')));
$this->assertTrue(Validation::cc('4929007108460499', array('visa')));
$this->assertTrue(Validation::cc('4539951357838586', array('visa')));
$this->assertTrue(Validation::cc('4716482691051558', array('visa')));
$this->assertTrue(Validation::cc('4916385069917516', array('visa')));
$this->assertTrue(Validation::cc('4929020289494641', array('visa')));
$this->assertTrue(Validation::cc('4532176245263774', array('visa')));
$this->assertTrue(Validation::cc('4556242273553949', array('visa')));
$this->assertTrue(Validation::cc('4481007485188614', array('visa')));
$this->assertTrue(Validation::cc('4716533372139623', array('visa')));
$this->assertTrue(Validation::cc('4929152038152632', array('visa')));
$this->assertTrue(Validation::cc('4539404037310550', array('visa')));
$this->assertTrue(Validation::cc('4532800925229140', array('visa')));
$this->assertTrue(Validation::cc('4916845885268360', array('visa')));
$this->assertTrue(Validation::cc('4394514669078434', array('visa')));
$this->assertTrue(Validation::cc('4485611378115042', array('visa')));
//Visa Electron
$this->assertTrue(Validation::cc('4175003346287100', array('electron')));
$this->assertTrue(Validation::cc('4913042516577228', array('electron')));
$this->assertTrue(Validation::cc('4917592325659381', array('electron')));
$this->assertTrue(Validation::cc('4917084924450511', array('electron')));
$this->assertTrue(Validation::cc('4917994610643999', array('electron')));
$this->assertTrue(Validation::cc('4175005933743585', array('electron')));
$this->assertTrue(Validation::cc('4175008373425044', array('electron')));
$this->assertTrue(Validation::cc('4913119763664154', array('electron')));
$this->assertTrue(Validation::cc('4913189017481812', array('electron')));
$this->assertTrue(Validation::cc('4913085104968622', array('electron')));
$this->assertTrue(Validation::cc('4175008803122021', array('electron')));
$this->assertTrue(Validation::cc('4913294453962489', array('electron')));
$this->assertTrue(Validation::cc('4175009797419290', array('electron')));
$this->assertTrue(Validation::cc('4175005028142917', array('electron')));
$this->assertTrue(Validation::cc('4913940802385364', array('electron')));
//Voyager
$this->assertTrue(Validation::cc('869940697287073', array('voyager')));
$this->assertTrue(Validation::cc('869934523596112', array('voyager')));
$this->assertTrue(Validation::cc('869958670174621', array('voyager')));
$this->assertTrue(Validation::cc('869921250068209', array('voyager')));
$this->assertTrue(Validation::cc('869972521242198', array('voyager')));
}
/**
* testLuhn method
*
* @return void
*/
public function testLuhn() {
//American Express
$this->assertTrue(Validation::luhn('370482756063980', true));
//BankCard
$this->assertTrue(Validation::luhn('5610745867413420', true));
//Diners Club 14
$this->assertTrue(Validation::luhn('30155483651028', true));
//2004 MasterCard/Diners Club Alliance International 14
$this->assertTrue(Validation::luhn('36747701998969', true));
//2004 MasterCard/Diners Club Alliance US & Canada 16
$this->assertTrue(Validation::luhn('5597511346169950', true));
//Discover
$this->assertTrue(Validation::luhn('6011802876467237', true));
//enRoute
$this->assertTrue(Validation::luhn('201496944158937', true));
//JCB 15 digit
$this->assertTrue(Validation::luhn('210034762247893', true));
//JCB 16 digit
$this->assertTrue(Validation::luhn('3096806857839939', true));
//Maestro (debit card)
$this->assertTrue(Validation::luhn('5020147409985219', true));
//Mastercard
$this->assertTrue(Validation::luhn('5580424361774366', true));
//Solo 16
$this->assertTrue(Validation::luhn('6767432107064987', true));
//Solo 18
$this->assertTrue(Validation::luhn('676714834398858593', true));
//Solo 19
$this->assertTrue(Validation::luhn('6767838565218340113', true));
//Switch 16
$this->assertTrue(Validation::luhn('5641829171515733', true));
//Switch 18
$this->assertTrue(Validation::luhn('493622764224625174', true));
//Switch 19
$this->assertTrue(Validation::luhn('6759603460617628716', true));
//VISA 13 digit
$this->assertTrue(Validation::luhn('4024007174754', true));
//VISA 16 digit
$this->assertTrue(Validation::luhn('4916375389940009', true));
//Visa Electron
$this->assertTrue(Validation::luhn('4175003346287100', true));
//Voyager
$this->assertTrue(Validation::luhn('869940697287073', true));
$this->assertFalse(Validation::luhn('0000000000000000', true));
$this->assertFalse(Validation::luhn('869940697287173', true));
}
/**
* testCustomRegexForCc method
*
* @return void
*/
public function testCustomRegexForCc() {
$this->assertTrue(Validation::cc('12332105933743585', null, null, '/123321\\d{11}/'));
$this->assertFalse(Validation::cc('1233210593374358', null, null, '/123321\\d{11}/'));
$this->assertFalse(Validation::cc('12312305933743585', null, null, '/123321\\d{11}/'));
}
/**
* testCustomRegexForCcWithLuhnCheck method
*
* @return void
*/
public function testCustomRegexForCcWithLuhnCheck() {
$this->assertTrue(Validation::cc('12332110426226941', null, true, '/123321\\d{11}/'));
$this->assertFalse(Validation::cc('12332105933743585', null, true, '/123321\\d{11}/'));
$this->assertFalse(Validation::cc('12332105933743587', null, true, '/123321\\d{11}/'));
$this->assertFalse(Validation::cc('12312305933743585', null, true, '/123321\\d{11}/'));
}
/**
* testFastCc method
*
* @return void
*/
public function testFastCc() {
// too short
$this->assertFalse(Validation::cc('123456789012'));
//American Express
$this->assertTrue(Validation::cc('370482756063980'));
//Diners Club 14
$this->assertTrue(Validation::cc('30155483651028'));
//2004 MasterCard/Diners Club Alliance International 14
$this->assertTrue(Validation::cc('36747701998969'));
//2004 MasterCard/Diners Club Alliance US & Canada 16
$this->assertTrue(Validation::cc('5597511346169950'));
//Discover
$this->assertTrue(Validation::cc('6011802876467237'));
//Mastercard
$this->assertTrue(Validation::cc('5580424361774366'));
//VISA 13 digit
$this->assertTrue(Validation::cc('4024007174754'));
//VISA 16 digit
$this->assertTrue(Validation::cc('4916375389940009'));
//Visa Electron
$this->assertTrue(Validation::cc('4175003346287100'));
}
/**
* testAllCc method
*
* @return void
*/
public function testAllCc() {
//American Express
$this->assertTrue(Validation::cc('370482756063980', 'all'));
//BankCard
$this->assertTrue(Validation::cc('5610745867413420', 'all'));
//Diners Club 14
$this->assertTrue(Validation::cc('30155483651028', 'all'));
//2004 MasterCard/Diners Club Alliance International 14
$this->assertTrue(Validation::cc('36747701998969', 'all'));
//2004 MasterCard/Diners Club Alliance US & Canada 16
$this->assertTrue(Validation::cc('5597511346169950', 'all'));
//Discover
$this->assertTrue(Validation::cc('6011802876467237', 'all'));
//enRoute
$this->assertTrue(Validation::cc('201496944158937', 'all'));
//JCB 15 digit
$this->assertTrue(Validation::cc('210034762247893', 'all'));
//JCB 16 digit
$this->assertTrue(Validation::cc('3096806857839939', 'all'));
//Maestro (debit card)
$this->assertTrue(Validation::cc('5020147409985219', 'all'));
//Mastercard
$this->assertTrue(Validation::cc('5580424361774366', 'all'));
//Solo 16
$this->assertTrue(Validation::cc('6767432107064987', 'all'));
//Solo 18
$this->assertTrue(Validation::cc('676714834398858593', 'all'));
//Solo 19
$this->assertTrue(Validation::cc('6767838565218340113', 'all'));
//Switch 16
$this->assertTrue(Validation::cc('5641829171515733', 'all'));
//Switch 18
$this->assertTrue(Validation::cc('493622764224625174', 'all'));
//Switch 19
$this->assertTrue(Validation::cc('6759603460617628716', 'all'));
//VISA 13 digit
$this->assertTrue(Validation::cc('4024007174754', 'all'));
//VISA 16 digit
$this->assertTrue(Validation::cc('4916375389940009', 'all'));
//Visa Electron
$this->assertTrue(Validation::cc('4175003346287100', 'all'));
//Voyager
$this->assertTrue(Validation::cc('869940697287073', 'all'));
}
/**
* testAllCcDeep method
*
* @return void
*/
public function testAllCcDeep() {
//American Express
$this->assertTrue(Validation::cc('370482756063980', 'all', true));
//BankCard
$this->assertTrue(Validation::cc('5610745867413420', 'all', true));
//Diners Club 14
$this->assertTrue(Validation::cc('30155483651028', 'all', true));
//2004 MasterCard/Diners Club Alliance International 14
$this->assertTrue(Validation::cc('36747701998969', 'all', true));
//2004 MasterCard/Diners Club Alliance US & Canada 16
$this->assertTrue(Validation::cc('5597511346169950', 'all', true));
//Discover
$this->assertTrue(Validation::cc('6011802876467237', 'all', true));
//enRoute
$this->assertTrue(Validation::cc('201496944158937', 'all', true));
//JCB 15 digit
$this->assertTrue(Validation::cc('210034762247893', 'all', true));
//JCB 16 digit
$this->assertTrue(Validation::cc('3096806857839939', 'all', true));
//Maestro (debit card)
$this->assertTrue(Validation::cc('5020147409985219', 'all', true));
//Mastercard
$this->assertTrue(Validation::cc('5580424361774366', 'all', true));
//Solo 16
$this->assertTrue(Validation::cc('6767432107064987', 'all', true));
//Solo 18
$this->assertTrue(Validation::cc('676714834398858593', 'all', true));
//Solo 19
$this->assertTrue(Validation::cc('6767838565218340113', 'all', true));
//Switch 16
$this->assertTrue(Validation::cc('5641829171515733', 'all', true));
//Switch 18
$this->assertTrue(Validation::cc('493622764224625174', 'all', true));
//Switch 19
$this->assertTrue(Validation::cc('6759603460617628716', 'all', true));
//VISA 13 digit
$this->assertTrue(Validation::cc('4024007174754', 'all', true));
//VISA 16 digit
$this->assertTrue(Validation::cc('4916375389940009', 'all', true));
//Visa Electron
$this->assertTrue(Validation::cc('4175003346287100', 'all', true));
//Voyager
$this->assertTrue(Validation::cc('869940697287073', 'all', true));
}
/**
* testComparison method
*
* @return void
*/
public function testComparison() {
$this->assertFalse(Validation::comparison(7, null, 6));
$this->assertTrue(Validation::comparison(7, 'is greater', 6));
$this->assertTrue(Validation::comparison(7, '>', 6));
$this->assertTrue(Validation::comparison(6, 'is less', 7));
$this->assertTrue(Validation::comparison(6, '<', 7));
$this->assertTrue(Validation::comparison(7, 'greater or equal', 7));
$this->assertTrue(Validation::comparison(7, '>=', 7));
$this->assertTrue(Validation::comparison(7, 'greater or equal', 6));
$this->assertTrue(Validation::comparison(7, '>=', 6));
$this->assertTrue(Validation::comparison(6, 'less or equal', 7));
$this->assertTrue(Validation::comparison(6, '<=', 7));
$this->assertTrue(Validation::comparison(7, 'equal to', 7));
$this->assertTrue(Validation::comparison(7, '==', 7));
$this->assertTrue(Validation::comparison(7, 'not equal', 6));
$this->assertTrue(Validation::comparison(7, '!=', 6));
$this->assertFalse(Validation::comparison(6, 'is greater', 7));
$this->assertFalse(Validation::comparison(6, '>', 7));
$this->assertFalse(Validation::comparison(7, 'is less', 6));
$this->assertFalse(Validation::comparison(7, '<', 6));
$this->assertFalse(Validation::comparison(6, 'greater or equal', 7));
$this->assertFalse(Validation::comparison(6, '>=', 7));
$this->assertFalse(Validation::comparison(6, 'greater or equal', 7));
$this->assertFalse(Validation::comparison(6, '>=', 7));
$this->assertFalse(Validation::comparison(7, 'less or equal', 6));
$this->assertFalse(Validation::comparison(7, '<=', 6));
$this->assertFalse(Validation::comparison(7, 'equal to', 6));
$this->assertFalse(Validation::comparison(7, '==', 6));
$this->assertFalse(Validation::comparison(7, 'not equal', 7));
$this->assertFalse(Validation::comparison(7, '!=', 7));
}
/**
* testComparisonAsArray method
*
* @return void
*/
public function testComparisonAsArray() {
$this->assertTrue(Validation::comparison(array('check1' => 7, 'operator' => 'is greater', 'check2' => 6)));
$this->assertTrue(Validation::comparison(array('check1' => 7, 'operator' => '>', 'check2' => 6)));
$this->assertTrue(Validation::comparison(array('check1' => 6, 'operator' => 'is less', 'check2' => 7)));
$this->assertTrue(Validation::comparison(array('check1' => 6, 'operator' => '<', 'check2' => 7)));
$this->assertTrue(Validation::comparison(array('check1' => 7, 'operator' => 'greater or equal', 'check2' => 7)));
$this->assertTrue(Validation::comparison(array('check1' => 7, 'operator' => '>=', 'check2' => 7)));
$this->assertTrue(Validation::comparison(array('check1' => 7, 'operator' => 'greater or equal', 'check2' => 6)));
$this->assertTrue(Validation::comparison(array('check1' => 7, 'operator' => '>=', 'check2' => 6)));
$this->assertTrue(Validation::comparison(array('check1' => 6, 'operator' => 'less or equal', 'check2' => 7)));
$this->assertTrue(Validation::comparison(array('check1' => 6, 'operator' => '<=', 'check2' => 7)));
$this->assertTrue(Validation::comparison(array('check1' => 7, 'operator' => 'equal to', 'check2' => 7)));
$this->assertTrue(Validation::comparison(array('check1' => 7, 'operator' => '==', 'check2' => 7)));
$this->assertTrue(Validation::comparison(array('check1' => 7, 'operator' => 'not equal', 'check2' => 6)));
$this->assertTrue(Validation::comparison(array('check1' => 7, 'operator' => '!=', 'check2' => 6)));
$this->assertFalse(Validation::comparison(array('check1' => 6, 'operator' => 'is greater', 'check2' => 7)));
$this->assertFalse(Validation::comparison(array('check1' => 6, 'operator' => '>', 'check2' => 7)));
$this->assertFalse(Validation::comparison(array('check1' => 7, 'operator' => 'is less', 'check2' => 6)));
$this->assertFalse(Validation::comparison(array('check1' => 7, 'operator' => '<', 'check2' => 6)));
$this->assertFalse(Validation::comparison(array('check1' => 6, 'operator' => 'greater or equal', 'check2' => 7)));
$this->assertFalse(Validation::comparison(array('check1' => 6, 'operator' => '>=', 'check2' => 7)));
$this->assertFalse(Validation::comparison(array('check1' => 6, 'operator' => 'greater or equal', 'check2' => 7)));
$this->assertFalse(Validation::comparison(array('check1' => 6, 'operator' => '>=', 'check2' => 7)));
$this->assertFalse(Validation::comparison(array('check1' => 7, 'operator' => 'less or equal', 'check2' => 6)));
$this->assertFalse(Validation::comparison(array('check1' => 7, 'operator' => '<=', 'check2' => 6)));
$this->assertFalse(Validation::comparison(array('check1' => 7, 'operator' => 'equal to', 'check2' => 6)));
$this->assertFalse(Validation::comparison(array('check1' => 7, 'operator' => '==', 'check2' => 6)));
$this->assertFalse(Validation::comparison(array('check1' => 7, 'operator' => 'not equal', 'check2' => 7)));
$this->assertFalse(Validation::comparison(array('check1' => 7, 'operator' => '!=', 'check2' => 7)));
}
/**
* testCustom method
*
* @return void
*/
public function testCustom() {
$this->assertTrue(Validation::custom('12345', '/(?<!\\S)\\d++(?!\\S)/'));
$this->assertFalse(Validation::custom('Text', '/(?<!\\S)\\d++(?!\\S)/'));
$this->assertFalse(Validation::custom('123.45', '/(?<!\\S)\\d++(?!\\S)/'));
$this->assertFalse(Validation::custom('missing regex'));
}
/**
* testCustomAsArray method
*
* @return void
*/
public function testCustomAsArray() {
$this->assertTrue(Validation::custom(array('check' => '12345', 'regex' => '/(?<!\\S)\\d++(?!\\S)/')));
$this->assertFalse(Validation::custom(array('check' => 'Text', 'regex' => '/(?<!\\S)\\d++(?!\\S)/')));
$this->assertFalse(Validation::custom(array('check' => '123.45', 'regex' => '/(?<!\\S)\\d++(?!\\S)/')));
}
/**
* testDateDdmmyyyy method
*
* @return void
*/
public function testDateDdmmyyyy() {
$this->assertTrue(Validation::date('27-12-2006', array('dmy')));
$this->assertTrue(Validation::date('27.12.2006', array('dmy')));
$this->assertTrue(Validation::date('27/12/2006', array('dmy')));
$this->assertTrue(Validation::date('27 12 2006', array('dmy')));
$this->assertFalse(Validation::date('00-00-0000', array('dmy')));
$this->assertFalse(Validation::date('00.00.0000', array('dmy')));
$this->assertFalse(Validation::date('00/00/0000', array('dmy')));
$this->assertFalse(Validation::date('00 00 0000', array('dmy')));
$this->assertFalse(Validation::date('31-11-2006', array('dmy')));
$this->assertFalse(Validation::date('31.11.2006', array('dmy')));
$this->assertFalse(Validation::date('31/11/2006', array('dmy')));
$this->assertFalse(Validation::date('31 11 2006', array('dmy')));
}
/**
* testDateDdmmyyyyLeapYear method
*
* @return void
*/
public function testDateDdmmyyyyLeapYear() {
$this->assertTrue(Validation::date('29-02-2004', array('dmy')));
$this->assertTrue(Validation::date('29.02.2004', array('dmy')));
$this->assertTrue(Validation::date('29/02/2004', array('dmy')));
$this->assertTrue(Validation::date('29 02 2004', array('dmy')));
$this->assertFalse(Validation::date('29-02-2006', array('dmy')));
$this->assertFalse(Validation::date('29.02.2006', array('dmy')));
$this->assertFalse(Validation::date('29/02/2006', array('dmy')));
$this->assertFalse(Validation::date('29 02 2006', array('dmy')));
}
/**
* testDateDdmmyy method
*
* @return void
*/
public function testDateDdmmyy() {
$this->assertTrue(Validation::date('27-12-06', array('dmy')));
$this->assertTrue(Validation::date('27.12.06', array('dmy')));
$this->assertTrue(Validation::date('27/12/06', array('dmy')));
$this->assertTrue(Validation::date('27 12 06', array('dmy')));
$this->assertFalse(Validation::date('00-00-00', array('dmy')));
$this->assertFalse(Validation::date('00.00.00', array('dmy')));
$this->assertFalse(Validation::date('00/00/00', array('dmy')));
$this->assertFalse(Validation::date('00 00 00', array('dmy')));
$this->assertFalse(Validation::date('31-11-06', array('dmy')));
$this->assertFalse(Validation::date('31.11.06', array('dmy')));
$this->assertFalse(Validation::date('31/11/06', array('dmy')));
$this->assertFalse(Validation::date('31 11 06', array('dmy')));
}
/**
* testDateDdmmyyLeapYear method
*
* @return void
*/
public function testDateDdmmyyLeapYear() {
$this->assertTrue(Validation::date('29-02-04', array('dmy')));
$this->assertTrue(Validation::date('29.02.04', array('dmy')));
$this->assertTrue(Validation::date('29/02/04', array('dmy')));
$this->assertTrue(Validation::date('29 02 04', array('dmy')));
$this->assertFalse(Validation::date('29-02-06', array('dmy')));
$this->assertFalse(Validation::date('29.02.06', array('dmy')));
$this->assertFalse(Validation::date('29/02/06', array('dmy')));
$this->assertFalse(Validation::date('29 02 06', array('dmy')));
}
/**
* testDateDmyy method
*
* @return void
*/
public function testDateDmyy() {
$this->assertTrue(Validation::date('7-2-06', array('dmy')));
$this->assertTrue(Validation::date('7.2.06', array('dmy')));
$this->assertTrue(Validation::date('7/2/06', array('dmy')));
$this->assertTrue(Validation::date('7 2 06', array('dmy')));
$this->assertFalse(Validation::date('0-0-00', array('dmy')));
$this->assertFalse(Validation::date('0.0.00', array('dmy')));
$this->assertFalse(Validation::date('0/0/00', array('dmy')));
$this->assertFalse(Validation::date('0 0 00', array('dmy')));
$this->assertFalse(Validation::date('32-2-06', array('dmy')));
$this->assertFalse(Validation::date('32.2.06', array('dmy')));
$this->assertFalse(Validation::date('32/2/06', array('dmy')));
$this->assertFalse(Validation::date('32 2 06', array('dmy')));
}
/**
* testDateDmyyLeapYear method
*
* @return void
*/
public function testDateDmyyLeapYear() {
$this->assertTrue(Validation::date('29-2-04', array('dmy')));
$this->assertTrue(Validation::date('29.2.04', array('dmy')));
$this->assertTrue(Validation::date('29/2/04', array('dmy')));
$this->assertTrue(Validation::date('29 2 04', array('dmy')));
$this->assertFalse(Validation::date('29-2-06', array('dmy')));
$this->assertFalse(Validation::date('29.2.06', array('dmy')));
$this->assertFalse(Validation::date('29/2/06', array('dmy')));
$this->assertFalse(Validation::date('29 2 06', array('dmy')));
}
/**
* testDateDmyyyy method
*
* @return void
*/
public function testDateDmyyyy() {
$this->assertTrue(Validation::date('7-2-2006', array('dmy')));
$this->assertTrue(Validation::date('7.2.2006', array('dmy')));
$this->assertTrue(Validation::date('7/2/2006', array('dmy')));
$this->assertTrue(Validation::date('7 2 2006', array('dmy')));
$this->assertFalse(Validation::date('0-0-0000', array('dmy')));
$this->assertFalse(Validation::date('0.0.0000', array('dmy')));
$this->assertFalse(Validation::date('0/0/0000', array('dmy')));
$this->assertFalse(Validation::date('0 0 0000', array('dmy')));
$this->assertFalse(Validation::date('32-2-2006', array('dmy')));
$this->assertFalse(Validation::date('32.2.2006', array('dmy')));
$this->assertFalse(Validation::date('32/2/2006', array('dmy')));
$this->assertFalse(Validation::date('32 2 2006', array('dmy')));
}
/**
* testDateDmyyyyLeapYear method
*
* @return void
*/
public function testDateDmyyyyLeapYear() {
$this->assertTrue(Validation::date('29-2-2004', array('dmy')));
$this->assertTrue(Validation::date('29.2.2004', array('dmy')));
$this->assertTrue(Validation::date('29/2/2004', array('dmy')));
$this->assertTrue(Validation::date('29 2 2004', array('dmy')));
$this->assertFalse(Validation::date('29-2-2006', array('dmy')));
$this->assertFalse(Validation::date('29.2.2006', array('dmy')));
$this->assertFalse(Validation::date('29/2/2006', array('dmy')));
$this->assertFalse(Validation::date('29 2 2006', array('dmy')));
}
/**
* testDateMmddyyyy method
*
* @return void
*/
public function testDateMmddyyyy() {
$this->assertTrue(Validation::date('12-27-2006', array('mdy')));
$this->assertTrue(Validation::date('12.27.2006', array('mdy')));
$this->assertTrue(Validation::date('12/27/2006', array('mdy')));
$this->assertTrue(Validation::date('12 27 2006', array('mdy')));
$this->assertFalse(Validation::date('00-00-0000', array('mdy')));
$this->assertFalse(Validation::date('00.00.0000', array('mdy')));
$this->assertFalse(Validation::date('00/00/0000', array('mdy')));
$this->assertFalse(Validation::date('00 00 0000', array('mdy')));
$this->assertFalse(Validation::date('11-31-2006', array('mdy')));
$this->assertFalse(Validation::date('11.31.2006', array('mdy')));
$this->assertFalse(Validation::date('11/31/2006', array('mdy')));
$this->assertFalse(Validation::date('11 31 2006', array('mdy')));
}
/**
* testDateMmddyyyyLeapYear method
*
* @return void
*/
public function testDateMmddyyyyLeapYear() {
$this->assertTrue(Validation::date('02-29-2004', array('mdy')));
$this->assertTrue(Validation::date('02.29.2004', array('mdy')));
$this->assertTrue(Validation::date('02/29/2004', array('mdy')));
$this->assertTrue(Validation::date('02 29 2004', array('mdy')));
$this->assertFalse(Validation::date('02-29-2006', array('mdy')));
$this->assertFalse(Validation::date('02.29.2006', array('mdy')));
$this->assertFalse(Validation::date('02/29/2006', array('mdy')));
$this->assertFalse(Validation::date('02 29 2006', array('mdy')));
}
/**
* testDateMmddyy method
*
* @return void
*/
public function testDateMmddyy() {
$this->assertTrue(Validation::date('12-27-06', array('mdy')));
$this->assertTrue(Validation::date('12.27.06', array('mdy')));
$this->assertTrue(Validation::date('12/27/06', array('mdy')));
$this->assertTrue(Validation::date('12 27 06', array('mdy')));
$this->assertFalse(Validation::date('00-00-00', array('mdy')));
$this->assertFalse(Validation::date('00.00.00', array('mdy')));
$this->assertFalse(Validation::date('00/00/00', array('mdy')));
$this->assertFalse(Validation::date('00 00 00', array('mdy')));
$this->assertFalse(Validation::date('11-31-06', array('mdy')));
$this->assertFalse(Validation::date('11.31.06', array('mdy')));
$this->assertFalse(Validation::date('11/31/06', array('mdy')));
$this->assertFalse(Validation::date('11 31 06', array('mdy')));
}
/**
* testDateMmddyyLeapYear method
*
* @return void
*/
public function testDateMmddyyLeapYear() {
$this->assertTrue(Validation::date('02-29-04', array('mdy')));
$this->assertTrue(Validation::date('02.29.04', array('mdy')));
$this->assertTrue(Validation::date('02/29/04', array('mdy')));
$this->assertTrue(Validation::date('02 29 04', array('mdy')));
$this->assertFalse(Validation::date('02-29-06', array('mdy')));
$this->assertFalse(Validation::date('02.29.06', array('mdy')));
$this->assertFalse(Validation::date('02/29/06', array('mdy')));
$this->assertFalse(Validation::date('02 29 06', array('mdy')));
}
/**
* testDateMdyy method
*
* @return void
*/
public function testDateMdyy() {
$this->assertTrue(Validation::date('2-7-06', array('mdy')));
$this->assertTrue(Validation::date('2.7.06', array('mdy')));
$this->assertTrue(Validation::date('2/7/06', array('mdy')));
$this->assertTrue(Validation::date('2 7 06', array('mdy')));
$this->assertFalse(Validation::date('0-0-00', array('mdy')));
$this->assertFalse(Validation::date('0.0.00', array('mdy')));
$this->assertFalse(Validation::date('0/0/00', array('mdy')));
$this->assertFalse(Validation::date('0 0 00', array('mdy')));
$this->assertFalse(Validation::date('2-32-06', array('mdy')));
$this->assertFalse(Validation::date('2.32.06', array('mdy')));
$this->assertFalse(Validation::date('2/32/06', array('mdy')));
$this->assertFalse(Validation::date('2 32 06', array('mdy')));
}
/**
* testDateMdyyLeapYear method
*
* @return void
*/
public function testDateMdyyLeapYear() {
$this->assertTrue(Validation::date('2-29-04', array('mdy')));
$this->assertTrue(Validation::date('2.29.04', array('mdy')));
$this->assertTrue(Validation::date('2/29/04', array('mdy')));
$this->assertTrue(Validation::date('2 29 04', array('mdy')));
$this->assertFalse(Validation::date('2-29-06', array('mdy')));
$this->assertFalse(Validation::date('2.29.06', array('mdy')));
$this->assertFalse(Validation::date('2/29/06', array('mdy')));
$this->assertFalse(Validation::date('2 29 06', array('mdy')));
}
/**
* testDateMdyyyy method
*
* @return void
*/
public function testDateMdyyyy() {
$this->assertTrue(Validation::date('2-7-2006', array('mdy')));
$this->assertTrue(Validation::date('2.7.2006', array('mdy')));
$this->assertTrue(Validation::date('2/7/2006', array('mdy')));
$this->assertTrue(Validation::date('2 7 2006', array('mdy')));
$this->assertFalse(Validation::date('0-0-0000', array('mdy')));
$this->assertFalse(Validation::date('0.0.0000', array('mdy')));
$this->assertFalse(Validation::date('0/0/0000', array('mdy')));
$this->assertFalse(Validation::date('0 0 0000', array('mdy')));
$this->assertFalse(Validation::date('2-32-2006', array('mdy')));
$this->assertFalse(Validation::date('2.32.2006', array('mdy')));
$this->assertFalse(Validation::date('2/32/2006', array('mdy')));
$this->assertFalse(Validation::date('2 32 2006', array('mdy')));
}
/**
* testDateMdyyyyLeapYear method
*
* @return void
*/
public function testDateMdyyyyLeapYear() {
$this->assertTrue(Validation::date('2-29-2004', array('mdy')));
$this->assertTrue(Validation::date('2.29.2004', array('mdy')));
$this->assertTrue(Validation::date('2/29/2004', array('mdy')));
$this->assertTrue(Validation::date('2 29 2004', array('mdy')));
$this->assertFalse(Validation::date('2-29-2006', array('mdy')));
$this->assertFalse(Validation::date('2.29.2006', array('mdy')));
$this->assertFalse(Validation::date('2/29/2006', array('mdy')));
$this->assertFalse(Validation::date('2 29 2006', array('mdy')));
}
/**
* testDateYyyymmdd method
*
* @return void
*/
public function testDateYyyymmdd() {
$this->assertTrue(Validation::date('2006-12-27', array('ymd')));
$this->assertTrue(Validation::date('2006.12.27', array('ymd')));
$this->assertTrue(Validation::date('2006/12/27', array('ymd')));
$this->assertTrue(Validation::date('2006 12 27', array('ymd')));
$this->assertFalse(Validation::date('2006-11-31', array('ymd')));
$this->assertFalse(Validation::date('2006.11.31', array('ymd')));
$this->assertFalse(Validation::date('2006/11/31', array('ymd')));
$this->assertFalse(Validation::date('2006 11 31', array('ymd')));
}
/**
* testDateYyyymmddLeapYear method
*
* @return void
*/
public function testDateYyyymmddLeapYear() {
$this->assertTrue(Validation::date('2004-02-29', array('ymd')));
$this->assertTrue(Validation::date('2004.02.29', array('ymd')));
$this->assertTrue(Validation::date('2004/02/29', array('ymd')));
$this->assertTrue(Validation::date('2004 02 29', array('ymd')));
$this->assertFalse(Validation::date('2006-02-29', array('ymd')));
$this->assertFalse(Validation::date('2006.02.29', array('ymd')));
$this->assertFalse(Validation::date('2006/02/29', array('ymd')));
$this->assertFalse(Validation::date('2006 02 29', array('ymd')));
}
/**
* testDateYymmdd method
*
* @return void
*/
public function testDateYymmdd() {
$this->assertTrue(Validation::date('06-12-27', array('ymd')));
$this->assertTrue(Validation::date('06.12.27', array('ymd')));
$this->assertTrue(Validation::date('06/12/27', array('ymd')));
$this->assertTrue(Validation::date('06 12 27', array('ymd')));
$this->assertFalse(Validation::date('12/27/2600', array('ymd')));
$this->assertFalse(Validation::date('12.27.2600', array('ymd')));
$this->assertFalse(Validation::date('12/27/2600', array('ymd')));
$this->assertFalse(Validation::date('12 27 2600', array('ymd')));
$this->assertFalse(Validation::date('06-11-31', array('ymd')));
$this->assertFalse(Validation::date('06.11.31', array('ymd')));
$this->assertFalse(Validation::date('06/11/31', array('ymd')));
$this->assertFalse(Validation::date('06 11 31', array('ymd')));
}
/**
* testDateYymmddLeapYear method
*
* @return void
*/
public function testDateYymmddLeapYear() {
$this->assertTrue(Validation::date('2004-02-29', array('ymd')));
$this->assertTrue(Validation::date('2004.02.29', array('ymd')));
$this->assertTrue(Validation::date('2004/02/29', array('ymd')));
$this->assertTrue(Validation::date('2004 02 29', array('ymd')));
$this->assertFalse(Validation::date('2006-02-29', array('ymd')));
$this->assertFalse(Validation::date('2006.02.29', array('ymd')));
$this->assertFalse(Validation::date('2006/02/29', array('ymd')));
$this->assertFalse(Validation::date('2006 02 29', array('ymd')));
}
/**
* testDateDdMMMMyyyy method
*
* @return void
*/
public function testDateDdMMMMyyyy() {
$this->assertTrue(Validation::date('27 December 2006', array('dMy')));
$this->assertTrue(Validation::date('27 Dec 2006', array('dMy')));
$this->assertFalse(Validation::date('2006 Dec 27', array('dMy')));
$this->assertFalse(Validation::date('2006 December 27', array('dMy')));
}
/**
* testDateDdMMMMyyyyLeapYear method
*
* @return void
*/
public function testDateDdMMMMyyyyLeapYear() {
$this->assertTrue(Validation::date('29 February 2004', array('dMy')));
$this->assertFalse(Validation::date('29 February 2006', array('dMy')));
}
/**
* testDateMmmmDdyyyy method
*
* @return void
*/
public function testDateMmmmDdyyyy() {
$this->assertTrue(Validation::date('December 27, 2006', array('Mdy')));
$this->assertTrue(Validation::date('Dec 27, 2006', array('Mdy')));
$this->assertTrue(Validation::date('December 27 2006', array('Mdy')));
$this->assertTrue(Validation::date('Dec 27 2006', array('Mdy')));
$this->assertFalse(Validation::date('27 Dec 2006', array('Mdy')));
$this->assertFalse(Validation::date('2006 December 27', array('Mdy')));
$this->assertTrue(Validation::date('Sep 12, 2011', array('Mdy')));
}
/**
* testDateMmmmDdyyyyLeapYear method
*
* @return void
*/
public function testDateMmmmDdyyyyLeapYear() {
$this->assertTrue(Validation::date('February 29, 2004', array('Mdy')));
$this->assertTrue(Validation::date('Feb 29, 2004', array('Mdy')));
$this->assertTrue(Validation::date('February 29 2004', array('Mdy')));
$this->assertTrue(Validation::date('Feb 29 2004', array('Mdy')));
$this->assertFalse(Validation::date('February 29, 2006', array('Mdy')));
}
/**
* testDateMy method
*
* @return void
*/
public function testDateMy() {
$this->assertTrue(Validation::date('December 2006', array('My')));
$this->assertTrue(Validation::date('Dec 2006', array('My')));
$this->assertTrue(Validation::date('December/2006', array('My')));
$this->assertTrue(Validation::date('Dec/2006', array('My')));
}
/**
* testDateMyNumeric method
*
* @return void
*/
public function testDateMyNumeric() {
$this->assertTrue(Validation::date('12/2006', array('my')));
$this->assertTrue(Validation::date('12-2006', array('my')));
$this->assertTrue(Validation::date('12.2006', array('my')));
$this->assertTrue(Validation::date('12 2006', array('my')));
$this->assertFalse(Validation::date('12/06', array('my')));
$this->assertFalse(Validation::date('12-06', array('my')));
$this->assertFalse(Validation::date('12.06', array('my')));
$this->assertFalse(Validation::date('12 06', array('my')));
}
/**
* testDateYmNumeric method
*
* @return void
*/
public function testDateYmNumeric() {
$this->assertTrue(Validation::date('2006/12', array('ym')));
$this->assertTrue(Validation::date('2006-12', array('ym')));
$this->assertTrue(Validation::date('2006-12', array('ym')));
$this->assertTrue(Validation::date('2006 12', array('ym')));
$this->assertTrue(Validation::date('2006 12', array('ym')));
$this->assertTrue(Validation::date('1900-01', array('ym')));
$this->assertTrue(Validation::date('2153-01', array('ym')));
$this->assertFalse(Validation::date('2006/12 ', array('ym')));
$this->assertFalse(Validation::date('2006/12/', array('ym')));
$this->assertFalse(Validation::date('06/12', array('ym')));
$this->assertFalse(Validation::date('06-12', array('ym')));
$this->assertFalse(Validation::date('06-12', array('ym')));
$this->assertFalse(Validation::date('06 12', array('ym')));
}
/**
* testDateY method
*
* @return void
*/
public function testDateY() {
$this->assertTrue(Validation::date('1900', array('y')));
$this->assertTrue(Validation::date('1984', array('y')));
$this->assertTrue(Validation::date('2006', array('y')));
$this->assertTrue(Validation::date('2008', array('y')));
$this->assertTrue(Validation::date('2013', array('y')));
$this->assertTrue(Validation::date('2104', array('y')));
$this->assertFalse(Validation::date('20009', array('y')));
$this->assertFalse(Validation::date(' 2012', array('y')));
$this->assertFalse(Validation::date('3000', array('y')));
$this->assertFalse(Validation::date('1899', array('y')));
}
/**
* Test validating dates with multiple formats
*
* @return void
*/
public function testDateMultiple() {
$this->assertTrue(Validation::date('2011-12-31', array('ymd', 'dmy')));
$this->assertTrue(Validation::date('31-12-2011', array('ymd', 'dmy')));
}
/**
* testTime method
*
* @return void
*/
public function testTime() {
$this->assertTrue(Validation::time('00:00'));
$this->assertTrue(Validation::time('23:59'));
$this->assertFalse(Validation::time('24:00'));
$this->assertTrue(Validation::time('12:00'));
$this->assertTrue(Validation::time('12:01'));
$this->assertTrue(Validation::time('12:01am'));
$this->assertTrue(Validation::time('12:01pm'));
$this->assertTrue(Validation::time('1pm'));
$this->assertTrue(Validation::time('1 pm'));
$this->assertTrue(Validation::time('1 PM'));
$this->assertTrue(Validation::time('01:00'));
$this->assertFalse(Validation::time('1:00'));
$this->assertTrue(Validation::time('1:00pm'));
$this->assertFalse(Validation::time('13:00pm'));
$this->assertFalse(Validation::time('9:00'));
}
/**
* testBoolean method
*
* @return void
*/
public function testBoolean() {
$this->assertTrue(Validation::boolean('0'));
$this->assertTrue(Validation::boolean('1'));
$this->assertTrue(Validation::boolean(0));
$this->assertTrue(Validation::boolean(1));
$this->assertTrue(Validation::boolean(true));
$this->assertTrue(Validation::boolean(false));
$this->assertFalse(Validation::boolean('true'));
$this->assertFalse(Validation::boolean('false'));
$this->assertFalse(Validation::boolean('-1'));
$this->assertFalse(Validation::boolean('2'));
$this->assertFalse(Validation::boolean('Boo!'));
}
/**
* testDateCustomRegx method
*
* @return void
*/
public function testDateCustomRegx() {
$this->assertTrue(Validation::date('2006-12-27', null, '%^(19|20)[0-9]{2}[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$%'));
$this->assertFalse(Validation::date('12-27-2006', null, '%^(19|20)[0-9]{2}[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$%'));
}
/**
* Test numbers with any number of decimal places, including none.
*
* @return void
*/
public function testDecimalWithPlacesNull() {
$this->assertTrue(Validation::decimal('+1234.54321', null));
$this->assertTrue(Validation::decimal('-1234.54321', null));
$this->assertTrue(Validation::decimal('1234.54321', null));
$this->assertTrue(Validation::decimal('+0123.45e6', null));
$this->assertTrue(Validation::decimal('-0123.45e6', null));
$this->assertTrue(Validation::decimal('0123.45e6', null));
$this->assertTrue(Validation::decimal(1234.56, null));
$this->assertTrue(Validation::decimal(1234.00, null));
$this->assertTrue(Validation::decimal(1234., null));
$this->assertTrue(Validation::decimal('1234.00', null));
$this->assertTrue(Validation::decimal(.0, null));
$this->assertTrue(Validation::decimal(.00, null));
$this->assertTrue(Validation::decimal('.00', null));
$this->assertTrue(Validation::decimal(.01, null));
$this->assertTrue(Validation::decimal('.01', null));
$this->assertTrue(Validation::decimal('1234', null));
$this->assertTrue(Validation::decimal('-1234', null));
$this->assertTrue(Validation::decimal('+1234', null));
$this->assertTrue(Validation::decimal((float)1234, null));
$this->assertTrue(Validation::decimal((double)1234, null));
$this->assertTrue(Validation::decimal((int)1234, null));
$this->assertFalse(Validation::decimal('', null));
$this->assertFalse(Validation::decimal('string', null));
$this->assertFalse(Validation::decimal('1234.', null));
}
/**
* Test numbers with any number of decimal places greater than 0, or a float|double.
*
* @return void
*/
public function testDecimalWithPlacesTrue() {
$this->assertTrue(Validation::decimal('+1234.54321', true));
$this->assertTrue(Validation::decimal('-1234.54321', true));
$this->assertTrue(Validation::decimal('1234.54321', true));
$this->assertTrue(Validation::decimal('+0123.45e6', true));
$this->assertTrue(Validation::decimal('-0123.45e6', true));
$this->assertTrue(Validation::decimal('0123.45e6', true));
$this->assertTrue(Validation::decimal(1234.56, true));
$this->assertTrue(Validation::decimal(1234.00, true));
$this->assertTrue(Validation::decimal(1234., true));
$this->assertTrue(Validation::decimal('1234.00', true));
$this->assertTrue(Validation::decimal(.0, true));
$this->assertTrue(Validation::decimal(.00, true));
$this->assertTrue(Validation::decimal('.00', true));
$this->assertTrue(Validation::decimal(.01, true));
$this->assertTrue(Validation::decimal('.01', true));
$this->assertTrue(Validation::decimal((float)1234, true));
$this->assertTrue(Validation::decimal((double)1234, true));
$this->assertFalse(Validation::decimal('', true));
$this->assertFalse(Validation::decimal('string', true));
$this->assertFalse(Validation::decimal('1234.', true));
$this->assertFalse(Validation::decimal((int)1234, true));
$this->assertFalse(Validation::decimal('1234', true));
$this->assertFalse(Validation::decimal('-1234', true));
$this->assertFalse(Validation::decimal('+1234', true));
}
/**
* Test numbers with exactly that many number of decimal places.
*
* @return void
*/
public function testDecimalWithPlacesNumeric() {
$this->assertTrue(Validation::decimal('.27', '2'));
$this->assertTrue(Validation::decimal(0.27, 2));
$this->assertTrue(Validation::decimal(-0.27, 2));
$this->assertTrue(Validation::decimal(0.27, 2));
$this->assertTrue(Validation::decimal('0.277', '3'));
$this->assertTrue(Validation::decimal(0.277, 3));
$this->assertTrue(Validation::decimal(-0.277, 3));
$this->assertTrue(Validation::decimal(0.277, 3));
$this->assertTrue(Validation::decimal('1234.5678', '4'));
$this->assertTrue(Validation::decimal(1234.5678, 4));
$this->assertTrue(Validation::decimal(-1234.5678, 4));
$this->assertTrue(Validation::decimal(1234.5678, 4));
$this->assertTrue(Validation::decimal('.00', 2));
$this->assertTrue(Validation::decimal(.01, 2));
$this->assertTrue(Validation::decimal('.01', 2));
$this->assertFalse(Validation::decimal('', 1));
$this->assertFalse(Validation::decimal('string', 1));
$this->assertFalse(Validation::decimal(1234., 1));
$this->assertFalse(Validation::decimal('1234.', 1));
$this->assertFalse(Validation::decimal(.0, 1));
$this->assertFalse(Validation::decimal(.00, 2));
$this->assertFalse(Validation::decimal((float)1234, 1));
$this->assertFalse(Validation::decimal((double)1234, 1));
$this->assertFalse(Validation::decimal((int)1234, 1));
$this->assertFalse(Validation::decimal('1234.5678', '3'));
$this->assertFalse(Validation::decimal(1234.5678, 3));
$this->assertFalse(Validation::decimal(-1234.5678, 3));
$this->assertFalse(Validation::decimal(1234.5678, 3));
}
/**
* Test decimal() with invalid places parameter.
*
* @return void
*/
public function testDecimalWithInvalidPlaces() {
$this->assertFalse(Validation::decimal('.27', 'string'));
$this->assertFalse(Validation::decimal(1234.5678, (array)true));
$this->assertFalse(Validation::decimal(-1234.5678, (object)true));
}
/**
* testDecimalCustomRegex method
*
* @return void
*/
public function testDecimalCustomRegex() {
$this->assertTrue(Validation::decimal('1.54321', null, '/^[-+]?[0-9]+(\\.[0-9]+)?$/s'));
$this->assertFalse(Validation::decimal('.54321', null, '/^[-+]?[0-9]+(\\.[0-9]+)?$/s'));
}
/**
* testEmail method
*
* @return void
*/
public function testEmail() {
$this->assertTrue(Validation::email('abc.efg@domain.com'));
$this->assertTrue(Validation::email('efg@domain.com'));
$this->assertTrue(Validation::email('abc-efg@domain.com'));
$this->assertTrue(Validation::email('abc_efg@domain.com'));
$this->assertTrue(Validation::email('raw@test.ra.ru'));
$this->assertTrue(Validation::email('abc-efg@domain-hyphened.com'));
$this->assertTrue(Validation::email("p.o'malley@domain.com"));
$this->assertTrue(Validation::email('abc+efg@domain.com'));
$this->assertTrue(Validation::email('abc&efg@domain.com'));
$this->assertTrue(Validation::email('abc.efg@12345.com'));
$this->assertTrue(Validation::email('abc.efg@12345.co.jp'));
$this->assertTrue(Validation::email('abc@g.cn'));
$this->assertTrue(Validation::email('abc@x.com'));
$this->assertTrue(Validation::email('henrik@sbcglobal.net'));
$this->assertTrue(Validation::email('sani@sbcglobal.net'));
// all ICANN TLDs
$this->assertTrue(Validation::email('abc@example.aero'));
$this->assertTrue(Validation::email('abc@example.asia'));
$this->assertTrue(Validation::email('abc@example.biz'));
$this->assertTrue(Validation::email('abc@example.cat'));
$this->assertTrue(Validation::email('abc@example.com'));
$this->assertTrue(Validation::email('abc@example.coop'));
$this->assertTrue(Validation::email('abc@example.edu'));
$this->assertTrue(Validation::email('abc@example.gov'));
$this->assertTrue(Validation::email('abc@example.info'));
$this->assertTrue(Validation::email('abc@example.int'));
$this->assertTrue(Validation::email('abc@example.jobs'));
$this->assertTrue(Validation::email('abc@example.mil'));
$this->assertTrue(Validation::email('abc@example.mobi'));
$this->assertTrue(Validation::email('abc@example.museum'));
$this->assertTrue(Validation::email('abc@example.name'));
$this->assertTrue(Validation::email('abc@example.net'));
$this->assertTrue(Validation::email('abc@example.org'));
$this->assertTrue(Validation::email('abc@example.pro'));
$this->assertTrue(Validation::email('abc@example.tel'));
$this->assertTrue(Validation::email('abc@example.travel'));
$this->assertTrue(Validation::email('someone@st.t-com.hr'));
// gTLD's
$this->assertTrue(Validation::email('example@host.local'));
$this->assertTrue(Validation::email('example@x.org'));
$this->assertTrue(Validation::email('example@host.xxx'));
// strange, but technically valid email addresses
$this->assertTrue(Validation::email('S=postmaster/OU=rz/P=uni-frankfurt/A=d400/C=de@gateway.d400.de'));
$this->assertTrue(Validation::email('customer/department=shipping@example.com'));
$this->assertTrue(Validation::email('$A12345@example.com'));
$this->assertTrue(Validation::email('!def!xyz%abc@example.com'));
$this->assertTrue(Validation::email('_somename@example.com'));
/// Unicode
$this->assertTrue(Validation::email('some@eräume.foo'));
$this->assertTrue(Validation::email('äu@öe.eräume.foo'));
$this->assertTrue(Validation::email('Nyrée.surname@example.com'));
// invalid addresses
$this->assertFalse(Validation::email('abc@example'));
$this->assertFalse(Validation::email('abc@example.c'));
$this->assertFalse(Validation::email('abc@example.com.'));
$this->assertFalse(Validation::email('abc.@example.com'));
$this->assertFalse(Validation::email('abc@example..com'));
$this->assertFalse(Validation::email('abc@example.com.a'));
$this->assertFalse(Validation::email('abc;@example.com'));
$this->assertFalse(Validation::email('abc@example.com;'));
$this->assertFalse(Validation::email('abc@efg@example.com'));
$this->assertFalse(Validation::email('abc@@example.com'));
$this->assertFalse(Validation::email('abc efg@example.com'));
$this->assertFalse(Validation::email('abc,efg@example.com'));
$this->assertFalse(Validation::email('abc@sub,example.com'));
$this->assertFalse(Validation::email("abc@sub'example.com"));
$this->assertFalse(Validation::email('abc@sub/example.com'));
$this->assertFalse(Validation::email('abc@yahoo!.com'));
$this->assertFalse(Validation::email('abc@example_underscored.com'));
$this->assertFalse(Validation::email('raw@test.ra.ru....com'));
}
/**
* testEmailDeep method
*
* @return void
*/
public function testEmailDeep() {
$this->skipIf(gethostbynamel('example.abcd'), 'Your DNS service responds for non-existant domains, skipping deep email checks.');
$this->assertTrue(Validation::email('abc.efg@cakephp.org', true));
$this->assertFalse(Validation::email('abc.efg@caphpkeinvalid.com', true));
$this->assertFalse(Validation::email('abc@example.abcd', true));
}
/**
* testEmailCustomRegex method
*
* @return void
*/
public function testEmailCustomRegex() {
$this->assertTrue(Validation::email('abc.efg@cakephp.org', null, '/^[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i'));
$this->assertFalse(Validation::email('abc.efg@com.caphpkeinvalid', null, '/^[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i'));
}
/**
* testEqualTo method
*
* @return void
*/
public function testEqualTo() {
$this->assertTrue(Validation::equalTo("1", "1"));
$this->assertFalse(Validation::equalTo(1, "1"));
$this->assertFalse(Validation::equalTo("", null));
$this->assertFalse(Validation::equalTo("", false));
$this->assertFalse(Validation::equalTo(0, false));
$this->assertFalse(Validation::equalTo(null, false));
}
/**
* testIpV4 method
*
* @return void
*/
public function testIpV4() {
$this->assertTrue(Validation::ip('0.0.0.0', 'ipv4'));
$this->assertTrue(Validation::ip('192.168.1.156'));
$this->assertTrue(Validation::ip('255.255.255.255'));
$this->assertFalse(Validation::ip('127.0.0'));
$this->assertFalse(Validation::ip('127.0.0.a'));
$this->assertFalse(Validation::ip('127.0.0.256'));
$this->assertFalse(Validation::ip('2001:0db8:85a3:0000:0000:8a2e:0370:7334', 'ipv4'), 'IPv6 is not valid IPv4');
}
/**
* testIp v6
*
* @return void
*/
public function testIpv6() {
$this->assertTrue(Validation::ip('2001:0db8:85a3:0000:0000:8a2e:0370:7334', 'IPv6'));
$this->assertTrue(Validation::ip('2001:db8:85a3:0:0:8a2e:370:7334', 'IPv6'));
$this->assertTrue(Validation::ip('2001:db8:85a3::8a2e:370:7334', 'IPv6'));
$this->assertTrue(Validation::ip('2001:0db8:0000:0000:0000:0000:1428:57ab', 'IPv6'));
$this->assertTrue(Validation::ip('2001:0db8:0000:0000:0000::1428:57ab', 'IPv6'));
$this->assertTrue(Validation::ip('2001:0db8:0:0:0:0:1428:57ab', 'IPv6'));
$this->assertTrue(Validation::ip('2001:0db8:0:0::1428:57ab', 'IPv6'));
$this->assertTrue(Validation::ip('2001:0db8::1428:57ab', 'IPv6'));
$this->assertTrue(Validation::ip('2001:db8::1428:57ab', 'IPv6'));
$this->assertTrue(Validation::ip('0000:0000:0000:0000:0000:0000:0000:0001', 'IPv6'));
$this->assertTrue(Validation::ip('::1', 'IPv6'));
$this->assertTrue(Validation::ip('::ffff:12.34.56.78', 'IPv6'));
$this->assertTrue(Validation::ip('::ffff:0c22:384e', 'IPv6'));
$this->assertTrue(Validation::ip('2001:0db8:1234:0000:0000:0000:0000:0000', 'IPv6'));
$this->assertTrue(Validation::ip('2001:0db8:1234:ffff:ffff:ffff:ffff:ffff', 'IPv6'));
$this->assertTrue(Validation::ip('2001:db8:a::123', 'IPv6'));
$this->assertTrue(Validation::ip('fe80::', 'IPv6'));
$this->assertTrue(Validation::ip('::ffff:192.0.2.128', 'IPv6'));
$this->assertTrue(Validation::ip('::ffff:c000:280', 'IPv6'));
$this->assertFalse(Validation::ip('123', 'IPv6'));
$this->assertFalse(Validation::ip('ldkfj', 'IPv6'));
$this->assertFalse(Validation::ip('2001::FFD3::57ab', 'IPv6'));
$this->assertFalse(Validation::ip('2001:db8:85a3::8a2e:37023:7334', 'IPv6'));
$this->assertFalse(Validation::ip('2001:db8:85a3::8a2e:370k:7334', 'IPv6'));
$this->assertFalse(Validation::ip('1:2:3:4:5:6:7:8:9', 'IPv6'));
$this->assertFalse(Validation::ip('1::2::3', 'IPv6'));
$this->assertFalse(Validation::ip('1:::3:4:5', 'IPv6'));
$this->assertFalse(Validation::ip('1:2:3::4:5:6:7:8:9', 'IPv6'));
$this->assertFalse(Validation::ip('::ffff:2.3.4', 'IPv6'));
$this->assertFalse(Validation::ip('::ffff:257.1.2.3', 'IPv6'));
$this->assertFalse(Validation::ip('255.255.255.255', 'ipv6'), 'IPv4 is not valid IPv6');
}
/**
* testMaxLength method
*
* @return void
*/
public function testMaxLength() {
$this->assertTrue(Validation::maxLength('ab', 3));
$this->assertTrue(Validation::maxLength('abc', 3));
$this->assertTrue(Validation::maxLength('ÆΔΩЖÇ', 10));
$this->assertFalse(Validation::maxLength('abcd', 3));
$this->assertFalse(Validation::maxLength('ÆΔΩЖÇ', 3));
}
/**
* testMinLength method
*
* @return void
*/
public function testMinLength() {
$this->assertFalse(Validation::minLength('ab', 3));
$this->assertFalse(Validation::minLength('ÆΔΩЖÇ', 10));
$this->assertTrue(Validation::minLength('abc', 3));
$this->assertTrue(Validation::minLength('abcd', 3));
$this->assertTrue(Validation::minLength('ÆΔΩЖÇ', 2));
}
/**
* testUrl method
*
* @return void
*/
public function testUrl() {
$this->assertTrue(Validation::url('http://www.cakephp.org'));
$this->assertTrue(Validation::url('http://cakephp.org'));
$this->assertTrue(Validation::url('http://www.cakephp.org/somewhere#anchor'));
$this->assertTrue(Validation::url('http://192.168.0.1'));
$this->assertTrue(Validation::url('https://www.cakephp.org'));
$this->assertTrue(Validation::url('https://cakephp.org'));
$this->assertTrue(Validation::url('https://www.cakephp.org/somewhere#anchor'));
$this->assertTrue(Validation::url('https://192.168.0.1'));
$this->assertTrue(Validation::url('ftps://www.cakephp.org/pub/cake'));
$this->assertTrue(Validation::url('ftps://cakephp.org/pub/cake'));
$this->assertTrue(Validation::url('ftps://192.168.0.1/pub/cake'));
$this->assertTrue(Validation::url('ftp://www.cakephp.org/pub/cake'));
$this->assertTrue(Validation::url('ftp://cakephp.org/pub/cake'));
$this->assertTrue(Validation::url('ftp://192.168.0.1/pub/cake'));
$this->assertTrue(Validation::url('sftp://192.168.0.1/pub/cake'));
$this->assertTrue(Validation::url('https://my.domain.com/gizmo/app?class=MySip;proc=start'));
$this->assertTrue(Validation::url('www.domain.tld'));
$this->assertTrue(Validation::url('http://123456789112345678921234567893123456789412345678951234567896123.com'));
$this->assertTrue(Validation::url('http://www.domain.com/blogs/index.php?blog=6&tempskin=_rss2'));
$this->assertTrue(Validation::url('http://www.domain.com/blogs/parenth()eses.php'));
$this->assertTrue(Validation::url('http://www.domain.com/index.php?get=params&get2=params'));
$this->assertTrue(Validation::url('http://www.domain.com/ndex.php?get=params&get2=params#anchor'));
$this->assertTrue(Validation::url('http://www.domain.com/real%20url%20encodeing'));
$this->assertTrue(Validation::url('http://en.wikipedia.org/wiki/Architectural_pattern_(computer_science)'));
$this->assertTrue(Validation::url('http://www.cakephp.org', true));
$this->assertTrue(Validation::url('http://example.com/~userdir/'));
$this->assertTrue(Validation::url('http://underscore_subdomain.example.org'));
$this->assertTrue(Validation::url('http://_jabber._tcp.gmail.com'));
$this->assertTrue(Validation::url('http://www.domain.longttldnotallowed'));
$this->assertFalse(Validation::url('ftps://256.168.0.1/pub/cake'));
$this->assertFalse(Validation::url('ftp://256.168.0.1/pub/cake'));
$this->assertFalse(Validation::url('http://w_w.domain.co_m'));
$this->assertFalse(Validation::url('http://www.domain.12com'));
$this->assertFalse(Validation::url('http://www.-invaliddomain.tld'));
$this->assertFalse(Validation::url('http://www.domain.-invalidtld'));
$this->assertFalse(Validation::url('http://this-domain-is-too-loooooong-by-icann-rules-maximum-length-is-63.com'));
$this->assertFalse(Validation::url('http://www.underscore_domain.org'));
$this->assertFalse(Validation::url('http://_jabber._tcp.g_mail.com'));
$this->assertFalse(Validation::url('http://en.(wikipedia).org/'));
$this->assertFalse(Validation::url('http://www.domain.com/fakeenco%ode'));
$this->assertFalse(Validation::url('--.example.com'));
$this->assertFalse(Validation::url('www.cakephp.org', true));
$this->assertTrue(Validation::url('http://example.com/~userdir/subdir/index.html'));
$this->assertTrue(Validation::url('http://www.zwischenraume.de'));
$this->assertTrue(Validation::url('http://www.zwischenraume.cz'));
$this->assertTrue(Validation::url('http://www.last.fm/music/浜崎あゆみ'), 'utf8 path failed');
$this->assertTrue(Validation::url('http://www.electrohome.ro/images/239537750-284232-215_300[1].jpg'));
$this->assertTrue(Validation::url('http://www.eräume.foo'));
$this->assertTrue(Validation::url('http://äüö.eräume.foo'));
$this->assertTrue(Validation::url('http://cakephp.org:80'));
$this->assertTrue(Validation::url('http://cakephp.org:443'));
$this->assertTrue(Validation::url('http://cakephp.org:2000'));
$this->assertTrue(Validation::url('http://cakephp.org:27000'));
$this->assertTrue(Validation::url('http://cakephp.org:65000'));
$this->assertTrue(Validation::url('[2001:0db8::1428:57ab]'));
$this->assertTrue(Validation::url('[::1]'));
$this->assertTrue(Validation::url('[2001:0db8::1428:57ab]:80'));
$this->assertTrue(Validation::url('[::1]:80'));
$this->assertTrue(Validation::url('http://[2001:0db8::1428:57ab]'));
$this->assertTrue(Validation::url('http://[::1]'));
$this->assertTrue(Validation::url('http://[2001:0db8::1428:57ab]:80'));
$this->assertTrue(Validation::url('http://[::1]:80'));
$this->assertFalse(Validation::url('[1::2::3]'));
}
public function testUuid() {
$this->assertTrue(Validation::uuid('00000000-0000-0000-0000-000000000000'));
$this->assertTrue(Validation::uuid('550e8400-e29b-11d4-a716-446655440000'));
$this->assertFalse(Validation::uuid('BRAP-e29b-11d4-a716-446655440000'));
$this->assertTrue(Validation::uuid('550E8400-e29b-11D4-A716-446655440000'));
$this->assertFalse(Validation::uuid('550e8400-e29b11d4-a716-446655440000'));
$this->assertFalse(Validation::uuid('550e8400-e29b-11d4-a716-4466440000'));
$this->assertFalse(Validation::uuid('550e8400-e29b-11d4-a71-446655440000'));
$this->assertFalse(Validation::uuid('550e8400-e29b-11d-a716-446655440000'));
$this->assertFalse(Validation::uuid('550e8400-e29-11d4-a716-446655440000'));
}
/**
* testInList method
*
* @return void
*/
public function testInList() {
$this->assertTrue(Validation::inList('one', array('one', 'two')));
$this->assertTrue(Validation::inList('two', array('one', 'two')));
$this->assertFalse(Validation::inList('three', array('one', 'two')));
$this->assertFalse(Validation::inList('1one', array(0, 1, 2, 3)));
$this->assertFalse(Validation::inList('one', array(0, 1, 2, 3)));
$this->assertFalse(Validation::inList('2', array(1, 2, 3)));
$this->assertTrue(Validation::inList('2', array(1, 2, 3), false));
}
/**
* testRange method
*
* @return void
*/
public function testRange() {
$this->assertFalse(Validation::range(20, 100, 1));
$this->assertTrue(Validation::range(20, 1, 100));
$this->assertFalse(Validation::range(.5, 1, 100));
$this->assertTrue(Validation::range(.5, 0, 100));
$this->assertTrue(Validation::range(5));
$this->assertTrue(Validation::range(-5, -10, 1));
$this->assertFalse(Validation::range('word'));
}
/**
* testExtension method
*
* @return void
*/
public function testExtension() {
$this->assertTrue(Validation::extension('extension.jpeg'));
$this->assertTrue(Validation::extension('extension.JPEG'));
$this->assertTrue(Validation::extension('extension.gif'));
$this->assertTrue(Validation::extension('extension.GIF'));
$this->assertTrue(Validation::extension('extension.png'));
$this->assertTrue(Validation::extension('extension.jpg'));
$this->assertTrue(Validation::extension('extension.JPG'));
$this->assertFalse(Validation::extension('noextension'));
$this->assertTrue(Validation::extension('extension.pdf', array('PDF')));
$this->assertFalse(Validation::extension('extension.jpg', array('GIF')));
$this->assertTrue(Validation::extension(array('extension.JPG', 'extension.gif', 'extension.png')));
$this->assertTrue(Validation::extension(array('file' => array('name' => 'file.jpg'))));
$this->assertTrue(Validation::extension(array('file1' => array('name' => 'file.jpg'),
'file2' => array('name' => 'file.jpg'),
'file3' => array('name' => 'file.jpg'))));
$this->assertFalse(Validation::extension(array('file1' => array('name' => 'file.jpg'),
'file2' => array('name' => 'file.jpg'),
'file3' => array('name' => 'file.jpg')), array('gif')));
$this->assertFalse(Validation::extension(array('noextension', 'extension.JPG', 'extension.gif', 'extension.png')));
$this->assertFalse(Validation::extension(array('extension.pdf', 'extension.JPG', 'extension.gif', 'extension.png')));
}
/**
* testMoney method
*
* @return void
*/
public function testMoney() {
$this->assertTrue(Validation::money('100'));
$this->assertTrue(Validation::money('100.11'));
$this->assertTrue(Validation::money('100.112'));
$this->assertTrue(Validation::money('100.1'));
$this->assertTrue(Validation::money('100.111,1'));
$this->assertTrue(Validation::money('100.111,11'));
$this->assertFalse(Validation::money('100.111,111'));
$this->assertTrue(Validation::money('$100'));
$this->assertTrue(Validation::money('$100.11'));
$this->assertTrue(Validation::money('$100.112'));
$this->assertTrue(Validation::money('$100.1'));
$this->assertFalse(Validation::money('$100.1111'));
$this->assertFalse(Validation::money('text'));
$this->assertTrue(Validation::money('100', 'right'));
$this->assertTrue(Validation::money('100.11$', 'right'));
$this->assertTrue(Validation::money('100.112$', 'right'));
$this->assertTrue(Validation::money('100.1$', 'right'));
$this->assertFalse(Validation::money('100.1111$', 'right'));
$this->assertTrue(Validation::money('€100'));
$this->assertTrue(Validation::money('€100.11'));
$this->assertTrue(Validation::money('€100.112'));
$this->assertTrue(Validation::money('€100.1'));
$this->assertFalse(Validation::money('€100.1111'));
$this->assertTrue(Validation::money('100', 'right'));
$this->assertTrue(Validation::money('100.11€', 'right'));
$this->assertTrue(Validation::money('100.112€', 'right'));
$this->assertTrue(Validation::money('100.1€', 'right'));
$this->assertFalse(Validation::money('100.1111€', 'right'));
}
/**
* Test Multiple Select Validation
*
* @return void
*/
public function testMultiple() {
$this->assertTrue(Validation::multiple(array(0, 1, 2, 3)));
$this->assertTrue(Validation::multiple(array(50, 32, 22, 0)));
$this->assertTrue(Validation::multiple(array('str', 'var', 'enum', 0)));
$this->assertFalse(Validation::multiple(''));
$this->assertFalse(Validation::multiple(null));
$this->assertFalse(Validation::multiple(array()));
$this->assertFalse(Validation::multiple(array(0)));
$this->assertFalse(Validation::multiple(array('0')));
$this->assertTrue(Validation::multiple(array(0, 3, 4, 5), array('in' => range(0, 10))));
$this->assertFalse(Validation::multiple(array(0, 15, 20, 5), array('in' => range(0, 10))));
$this->assertFalse(Validation::multiple(array(0, 5, 10, 11), array('in' => range(0, 10))));
$this->assertFalse(Validation::multiple(array('boo', 'foo', 'bar'), array('in' => array('foo', 'bar', 'baz'))));
$this->assertFalse(Validation::multiple(array('foo', '1bar'), array('in' => range(0, 10))));
$this->assertTrue(Validation::multiple(array(0, 5, 10, 11), array('max' => 3)));
$this->assertFalse(Validation::multiple(array(0, 5, 10, 11, 55), array('max' => 3)));
$this->assertTrue(Validation::multiple(array('foo', 'bar', 'baz'), array('max' => 3)));
$this->assertFalse(Validation::multiple(array('foo', 'bar', 'baz', 'squirrel'), array('max' => 3)));
$this->assertTrue(Validation::multiple(array(0, 5, 10, 11), array('min' => 3)));
$this->assertTrue(Validation::multiple(array(0, 5, 10, 11, 55), array('min' => 3)));
$this->assertFalse(Validation::multiple(array('foo', 'bar', 'baz'), array('min' => 5)));
$this->assertFalse(Validation::multiple(array('foo', 'bar', 'baz', 'squirrel'), array('min' => 10)));
$this->assertTrue(Validation::multiple(array(0, 5, 9), array('in' => range(0, 10), 'max' => 5)));
$this->assertFalse(Validation::multiple(array('0', '5', '9'), array('in' => range(0, 10), 'max' => 5)));
$this->assertTrue(Validation::multiple(array('0', '5', '9'), array('in' => range(0, 10), 'max' => 5), false));
$this->assertFalse(Validation::multiple(array(0, 5, 9, 8, 6, 2, 1), array('in' => range(0, 10), 'max' => 5)));
$this->assertFalse(Validation::multiple(array(0, 5, 9, 8, 11), array('in' => range(0, 10), 'max' => 5)));
$this->assertFalse(Validation::multiple(array(0, 5, 9), array('in' => range(0, 10), 'max' => 5, 'min' => 3)));
$this->assertFalse(Validation::multiple(array(0, 5, 9, 8, 6, 2, 1), array('in' => range(0, 10), 'max' => 5, 'min' => 2)));
$this->assertFalse(Validation::multiple(array(0, 5, 9, 8, 11), array('in' => range(0, 10), 'max' => 5, 'min' => 2)));
}
/**
* testNumeric method
*
* @return void
*/
public function testNumeric() {
$this->assertFalse(Validation::numeric('teststring'));
$this->assertFalse(Validation::numeric('1.1test'));
$this->assertFalse(Validation::numeric('2test'));
$this->assertTrue(Validation::numeric('2'));
$this->assertTrue(Validation::numeric(2));
$this->assertTrue(Validation::numeric(2.2));
$this->assertTrue(Validation::numeric('2.2'));
}
/**
* testNaturalNumber method
*
* @return void
*/
public function testNaturalNumber() {
$this->assertFalse(Validation::naturalNumber('teststring'));
$this->assertFalse(Validation::naturalNumber('5.4'));
$this->assertFalse(Validation::naturalNumber(99.004));
$this->assertFalse(Validation::naturalNumber('0,05'));
$this->assertFalse(Validation::naturalNumber('-2'));
$this->assertFalse(Validation::naturalNumber(-2));
$this->assertFalse(Validation::naturalNumber('0'));
$this->assertFalse(Validation::naturalNumber('050'));
$this->assertTrue(Validation::naturalNumber('2'));
$this->assertTrue(Validation::naturalNumber(49));
$this->assertTrue(Validation::naturalNumber('0', true));
$this->assertTrue(Validation::naturalNumber(0, true));
}
/**
* testPhone method
*
* @return void
*/
public function testPhone() {
$this->assertFalse(Validation::phone('teststring'));
$this->assertFalse(Validation::phone('1-(33)-(333)-(4444)'));
$this->assertFalse(Validation::phone('1-(33)-3333-4444'));
$this->assertFalse(Validation::phone('1-(33)-33-4444'));
$this->assertFalse(Validation::phone('1-(33)-3-44444'));
$this->assertFalse(Validation::phone('1-(33)-3-444'));
$this->assertFalse(Validation::phone('1-(33)-3-44'));
$this->assertFalse(Validation::phone('(055) 999-9999'));
$this->assertFalse(Validation::phone('(155) 999-9999'));
$this->assertFalse(Validation::phone('(595) 999-9999'));
$this->assertFalse(Validation::phone('(213) 099-9999'));
$this->assertFalse(Validation::phone('(213) 199-9999'));
// invalid area-codes
$this->assertFalse(Validation::phone('1-(511)-999-9999'));
$this->assertFalse(Validation::phone('1-(555)-999-9999'));
// invalid exhange
$this->assertFalse(Validation::phone('1-(222)-511-9999'));
// invalid phone number
$this->assertFalse(Validation::phone('1-(222)-555-0199'));
$this->assertFalse(Validation::phone('1-(222)-555-0122'));
// valid phone numbers
$this->assertTrue(Validation::phone('416-428-1234'));
$this->assertTrue(Validation::phone('1-(369)-333-4444'));
$this->assertTrue(Validation::phone('1-(973)-333-4444'));
$this->assertTrue(Validation::phone('1-(313)-555-9999'));
$this->assertTrue(Validation::phone('1-(222)-555-0299'));
$this->assertTrue(Validation::phone('508-428-1234'));
$this->assertTrue(Validation::phone('1-(508)-232-9651'));
$this->assertTrue(Validation::phone('1 (222) 333 4444'));
$this->assertTrue(Validation::phone('+1 (222) 333 4444'));
$this->assertTrue(Validation::phone('(222) 333 4444'));
$this->assertTrue(Validation::phone('1-(333)-333-4444'));
$this->assertTrue(Validation::phone('1.(333)-333-4444'));
$this->assertTrue(Validation::phone('1.(333).333-4444'));
$this->assertTrue(Validation::phone('1.(333).333.4444'));
$this->assertTrue(Validation::phone('1-333-333-4444'));
}
/**
* testPostal method
*
* @return void
*/
public function testPostal() {
$this->assertFalse(Validation::postal('111', null, 'de'));
$this->assertFalse(Validation::postal('1111', null, 'de'));
$this->assertTrue(Validation::postal('13089', null, 'de'));
$this->assertFalse(Validation::postal('111', null, 'be'));
$this->assertFalse(Validation::postal('0123', null, 'be'));
$this->assertTrue(Validation::postal('1204', null, 'be'));
$this->assertFalse(Validation::postal('111', null, 'it'));
$this->assertFalse(Validation::postal('1111', null, 'it'));
$this->assertTrue(Validation::postal('13089', null, 'it'));
$this->assertFalse(Validation::postal('111', null, 'uk'));
$this->assertFalse(Validation::postal('1111', null, 'uk'));
$this->assertFalse(Validation::postal('AZA 0AB', null, 'uk'));
$this->assertFalse(Validation::postal('X0A 0ABC', null, 'uk'));
$this->assertTrue(Validation::postal('X0A 0AB', null, 'uk'));
$this->assertTrue(Validation::postal('AZ0A 0AA', null, 'uk'));
$this->assertTrue(Validation::postal('A89 2DD', null, 'uk'));
$this->assertFalse(Validation::postal('111', null, 'ca'));
$this->assertFalse(Validation::postal('1111', null, 'ca'));
$this->assertFalse(Validation::postal('D2A 0A0', null, 'ca'));
$this->assertFalse(Validation::postal('BAA 0ABC', null, 'ca'));
$this->assertFalse(Validation::postal('B2A AABC', null, 'ca'));
$this->assertFalse(Validation::postal('B2A 2AB', null, 'ca'));
$this->assertFalse(Validation::postal('K1A 1D1', null, 'ca'));
$this->assertFalse(Validation::postal('K1O 1Q1', null, 'ca'));
$this->assertFalse(Validation::postal('A1A 1U1', null, 'ca'));
$this->assertFalse(Validation::postal('A1F 1B1', null, 'ca'));
$this->assertTrue(Validation::postal('X0A 0A2', null, 'ca'));
$this->assertTrue(Validation::postal('G4V 4C3', null, 'ca'));
$this->assertFalse(Validation::postal('111', null, 'us'));
$this->assertFalse(Validation::postal('1111', null, 'us'));
$this->assertFalse(Validation::postal('130896', null, 'us'));
$this->assertFalse(Validation::postal('13089-33333', null, 'us'));
$this->assertFalse(Validation::postal('13089-333', null, 'us'));
$this->assertFalse(Validation::postal('13A89-4333', null, 'us'));
$this->assertTrue(Validation::postal('13089-3333', null, 'us'));
$this->assertFalse(Validation::postal('111'));
$this->assertFalse(Validation::postal('1111'));
$this->assertFalse(Validation::postal('130896'));
$this->assertFalse(Validation::postal('13089-33333'));
$this->assertFalse(Validation::postal('13089-333'));
$this->assertFalse(Validation::postal('13A89-4333'));
$this->assertTrue(Validation::postal('13089-3333'));
}
/**
* test that phone and postal pass to other classes.
*
* @return void
*/
public function testPhonePostalSsnPass() {
$this->assertTrue(Validation::postal('text', null, 'testNl'));
$this->assertTrue(Validation::phone('text', null, 'testDe'));
$this->assertTrue(Validation::ssn('text', null, 'testNl'));
}
/**
* test pass through failure on postal
*
* @expectedException PHPUnit_Framework_Error
* @return void
*/
public function testPassThroughMethodFailure() {
Validation::phone('text', null, 'testNl');
}
/**
* test the pass through calling of an alternate locale with postal()
*
* @expectedException PHPUnit_Framework_Error
* @return void
*/
public function testPassThroughClassFailure() {
Validation::postal('text', null, 'AUTOFAIL');
}
/**
* test pass through method
*
* @return void
*/
public function testPassThroughMethod() {
$this->assertTrue(Validation::postal('text', null, 'testNl'));
}
/**
* testSsn method
*
* @return void
*/
public function testSsn() {
$this->assertFalse(Validation::ssn('111-333', null, 'dk'));
$this->assertFalse(Validation::ssn('111111-333', null, 'dk'));
$this->assertTrue(Validation::ssn('111111-3334', null, 'dk'));
$this->assertFalse(Validation::ssn('1118333', null, 'nl'));
$this->assertFalse(Validation::ssn('1234567890', null, 'nl'));
$this->assertFalse(Validation::ssn('12345A789', null, 'nl'));
$this->assertTrue(Validation::ssn('123456789', null, 'nl'));
$this->assertFalse(Validation::ssn('11-33-4333', null, 'us'));
$this->assertFalse(Validation::ssn('113-3-4333', null, 'us'));
$this->assertFalse(Validation::ssn('111-33-333', null, 'us'));
$this->assertTrue(Validation::ssn('111-33-4333', null, 'us'));
}
/**
* testUserDefined method
*
* @return void
*/
public function testUserDefined() {
$validator = new CustomValidator;
$this->assertFalse(Validation::userDefined('33', $validator, 'customValidate'));
$this->assertFalse(Validation::userDefined('3333', $validator, 'customValidate'));
$this->assertTrue(Validation::userDefined('333', $validator, 'customValidate'));
}
/**
* testDatetime method
*
* @return void
*/
public function testDatetime() {
$this->assertTrue(Validation::datetime('27-12-2006 01:00', 'dmy'));
$this->assertTrue(Validation::datetime('27-12-2006 01:00', array('dmy')));
$this->assertFalse(Validation::datetime('27-12-2006 1:00', 'dmy'));
$this->assertTrue(Validation::datetime('27.12.2006 1:00pm', 'dmy'));
$this->assertFalse(Validation::datetime('27.12.2006 13:00pm', 'dmy'));
$this->assertTrue(Validation::datetime('27/12/2006 1:00pm', 'dmy'));
$this->assertFalse(Validation::datetime('27/12/2006 9:00', 'dmy'));
$this->assertTrue(Validation::datetime('27 12 2006 1:00pm', 'dmy'));
$this->assertFalse(Validation::datetime('27 12 2006 24:00', 'dmy'));
$this->assertFalse(Validation::datetime('00-00-0000 1:00pm', 'dmy'));
$this->assertFalse(Validation::datetime('00.00.0000 1:00pm', 'dmy'));
$this->assertFalse(Validation::datetime('00/00/0000 1:00pm', 'dmy'));
$this->assertFalse(Validation::datetime('00 00 0000 1:00pm', 'dmy'));
$this->assertFalse(Validation::datetime('31-11-2006 1:00pm', 'dmy'));
$this->assertFalse(Validation::datetime('31.11.2006 1:00pm', 'dmy'));
$this->assertFalse(Validation::datetime('31/11/2006 1:00pm', 'dmy'));
$this->assertFalse(Validation::datetime('31 11 2006 1:00pm', 'dmy'));
}
/**
* testMimeType method
*
* @return void
*/
public function testMimeType() {
$image = CORE_PATH . 'Cake' . DS . 'Test' . DS . 'test_app' . DS . 'webroot' . DS . 'img' . DS . 'cake.power.gif';
$File = new File($image, false);
$this->skipIf(!$File->mime(), 'Cannot determine mimeType');
$this->assertTrue(Validation::mimeType($image, array('image/gif')));
$this->assertTrue(Validation::mimeType(array('tmp_name' => $image), array('image/gif')));
$this->assertFalse(Validation::mimeType($image, array('image/png')));
$this->assertFalse(Validation::mimeType(array('tmp_name' => $image), array('image/png')));
}
/**
* testMimeTypeFalse method
*
* @expectedException CakeException
* @return void
*/
public function testMimeTypeFalse() {
$image = CORE_PATH . 'Cake' . DS . 'Test' . DS . 'test_app' . DS . 'webroot' . DS . 'img' . DS . 'cake.power.gif';
$File = new File($image, false);
$this->skipIf($File->mime(), 'mimeType can be determined, no Exception will be thrown');
Validation::mimeType($image, array('image/gif'));
}
/**
* testUploadError method
*
* @return void
*/
public function testUploadError() {
$this->assertTrue(Validation::uploadError(0));
$this->assertTrue(Validation::uploadError(array('error' => 0)));
$this->assertFalse(Validation::uploadError(2));
$this->assertFalse(Validation::uploadError(array('error' => 2)));
}
/**
* testFileSize method
*
* @return void
*/
public function testFileSize() {
$image = CORE_PATH . 'Cake' . DS . 'Test' . DS . 'test_app' . DS . 'webroot' . DS . 'img' . DS . 'cake.power.gif';
$this->assertTrue(Validation::fileSize($image, '<', 1024));
$this->assertTrue(Validation::fileSize(array('tmp_name' => $image), 'isless', 1024));
$this->assertTrue(Validation::fileSize($image, '<', '1KB'));
$this->assertTrue(Validation::fileSize($image, '>=', 200));
$this->assertTrue(Validation::fileSize($image, '==', 201));
$this->assertTrue(Validation::fileSize($image, '==', '201B'));
$this->assertFalse(Validation::fileSize($image, 'isgreater', 1024));
$this->assertFalse(Validation::fileSize(array('tmp_name' => $image), '>', '1KB'));
}
}
| {
"content_hash": "f95baeba89785ff4c38a8a61607c43e1",
"timestamp": "",
"source": "github",
"line_count": 2375,
"max_line_length": 133,
"avg_line_length": 46.298947368421054,
"alnum_prop": 0.6794288832302655,
"repo_name": "lens-n/testing",
"id": "7c325c3332219f2474fca09c6d374dbf5896bfc4",
"size": "110761",
"binary": false,
"copies": "25",
"ref": "refs/heads/master",
"path": "lib/Cake/Test/Case/Utility/ValidationTest.php",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "29939"
},
{
"name": "CSS",
"bytes": "27040"
},
{
"name": "JavaScript",
"bytes": "1392"
},
{
"name": "PHP",
"bytes": "8470033"
},
{
"name": "Perl",
"bytes": "11856"
},
{
"name": "Shell",
"bytes": "7168"
}
],
"symlink_target": ""
} |
.class public Lo/eN;
.super Ljava/lang/Object;
# interfaces
.implements Landroid/os/Parcelable$Creator;
# annotations
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/lang/Object;Landroid/os/Parcelable$Creator<Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;>;"
}
.end annotation
# direct methods
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static ˊ(Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;Landroid/os/Parcel;I)V
.locals 4
invoke-static {p1}, Lo/ż;->ˊ(Landroid/os/Parcel;)I
move-result v3
invoke-virtual {p0}, Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;->ˊ()Ljava/lang/String;
move-result-object v0
const/4 v1, 0x1
const/4 v2, 0x0
invoke-static {p1, v1, v0, v2}, Lo/ż;->ˊ(Landroid/os/Parcel;ILjava/lang/String;Z)V
invoke-virtual {p0}, Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;->ʼ()I
move-result v0
const/16 v1, 0x3e8
invoke-static {p1, v1, v0}, Lo/ż;->ˊ(Landroid/os/Parcel;II)V
invoke-virtual {p0}, Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;->ˋ()Ljava/lang/String;
move-result-object v0
const/4 v1, 0x2
const/4 v2, 0x0
invoke-static {p1, v1, v0, v2}, Lo/ż;->ˊ(Landroid/os/Parcel;ILjava/lang/String;Z)V
invoke-virtual {p0}, Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;->ˎ()J
move-result-wide v0
const/4 v2, 0x3
invoke-static {p1, v2, v0, v1}, Lo/ż;->ˊ(Landroid/os/Parcel;IJ)V
invoke-virtual {p0}, Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;->ˏ()Landroid/net/Uri;
move-result-object v0
const/4 v1, 0x4
const/4 v2, 0x0
invoke-static {p1, v1, v0, p2, v2}, Lo/ż;->ˊ(Landroid/os/Parcel;ILandroid/os/Parcelable;IZ)V
invoke-virtual {p0}, Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;->ᐝ()Landroid/net/Uri;
move-result-object v0
const/4 v1, 0x5
const/4 v2, 0x0
invoke-static {p1, v1, v0, p2, v2}, Lo/ż;->ˊ(Landroid/os/Parcel;ILandroid/os/Parcelable;IZ)V
invoke-virtual {p0}, Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;->ʻ()Landroid/net/Uri;
move-result-object v0
const/4 v1, 0x6
const/4 v2, 0x0
invoke-static {p1, v1, v0, p2, v2}, Lo/ż;->ˊ(Landroid/os/Parcel;ILandroid/os/Parcelable;IZ)V
invoke-static {p1, v3}, Lo/ż;->ˊ(Landroid/os/Parcel;I)V
return-void
.end method
# virtual methods
.method public synthetic createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;
.locals 1
invoke-virtual {p0, p1}, Lo/eN;->ˊ(Landroid/os/Parcel;)Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;
move-result-object v0
return-object v0
.end method
.method public synthetic newArray(I)[Ljava/lang/Object;
.locals 1
invoke-virtual {p0, p1}, Lo/eN;->ˊ(I)[Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;
move-result-object v0
return-object v0
.end method
.method public ˊ(Landroid/os/Parcel;)Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;
.locals 19
invoke-static/range {p1 .. p1}, Lo/Ŷ;->ˋ(Landroid/os/Parcel;)I
move-result v9
const/4 v10, 0x0
const/4 v11, 0x0
const/4 v12, 0x0
const-wide/16 v13, 0x0
const/4 v15, 0x0
const/16 v16, 0x0
const/16 v17, 0x0
:goto_0
invoke-virtual/range {p1 .. p1}, Landroid/os/Parcel;->dataPosition()I
move-result v0
if-ge v0, v9, :cond_0
invoke-static/range {p1 .. p1}, Lo/Ŷ;->ˊ(Landroid/os/Parcel;)I
move-result v18
invoke-static/range {v18 .. v18}, Lo/Ŷ;->ˊ(I)I
move-result v0
sparse-switch v0, :sswitch_data_0
goto/16 :goto_1
:sswitch_0
move-object/from16 v0, p1
move/from16 v1, v18
invoke-static {v0, v1}, Lo/Ŷ;->ˌ(Landroid/os/Parcel;I)Ljava/lang/String;
move-result-object v11
goto :goto_2
:sswitch_1
move-object/from16 v0, p1
move/from16 v1, v18
invoke-static {v0, v1}, Lo/Ŷ;->ʼ(Landroid/os/Parcel;I)I
move-result v10
goto :goto_2
:sswitch_2
move-object/from16 v0, p1
move/from16 v1, v18
invoke-static {v0, v1}, Lo/Ŷ;->ˌ(Landroid/os/Parcel;I)Ljava/lang/String;
move-result-object v12
goto :goto_2
:sswitch_3
move-object/from16 v0, p1
move/from16 v1, v18
invoke-static {v0, v1}, Lo/Ŷ;->ͺ(Landroid/os/Parcel;I)J
move-result-wide v13
goto :goto_2
:sswitch_4
sget-object v0, Landroid/net/Uri;->CREATOR:Landroid/os/Parcelable$Creator;
move-object/from16 v1, p1
move/from16 v2, v18
invoke-static {v1, v2, v0}, Lo/Ŷ;->ˊ(Landroid/os/Parcel;ILandroid/os/Parcelable$Creator;)Landroid/os/Parcelable;
move-result-object v0
check-cast v0, Landroid/net/Uri;
move-object v15, v0
goto :goto_2
:sswitch_5
sget-object v0, Landroid/net/Uri;->CREATOR:Landroid/os/Parcelable$Creator;
move-object/from16 v1, p1
move/from16 v2, v18
invoke-static {v1, v2, v0}, Lo/Ŷ;->ˊ(Landroid/os/Parcel;ILandroid/os/Parcelable$Creator;)Landroid/os/Parcelable;
move-result-object v0
check-cast v0, Landroid/net/Uri;
move-object/from16 v16, v0
goto :goto_2
:sswitch_6
sget-object v0, Landroid/net/Uri;->CREATOR:Landroid/os/Parcelable$Creator;
move-object/from16 v1, p1
move/from16 v2, v18
invoke-static {v1, v2, v0}, Lo/Ŷ;->ˊ(Landroid/os/Parcel;ILandroid/os/Parcelable$Creator;)Landroid/os/Parcelable;
move-result-object v0
check-cast v0, Landroid/net/Uri;
move-object/from16 v17, v0
goto :goto_2
:goto_1
move-object/from16 v0, p1
move/from16 v1, v18
invoke-static {v0, v1}, Lo/Ŷ;->ˋ(Landroid/os/Parcel;I)V
:goto_2
goto/16 :goto_0
:cond_0
invoke-virtual/range {p1 .. p1}, Landroid/os/Parcel;->dataPosition()I
move-result v0
if-eq v0, v9, :cond_1
new-instance v0, Lo/Ŷ$if;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Overread allowed size end="
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, v9}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
move-object/from16 v2, p1
invoke-direct {v0, v1, v2}, Lo/Ŷ$if;-><init>(Ljava/lang/String;Landroid/os/Parcel;)V
throw v0
:cond_1
new-instance v0, Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;
move v1, v10
move-object v2, v11
move-object v3, v12
move-wide v4, v13
move-object v6, v15
move-object/from16 v7, v16
move-object/from16 v8, v17
invoke-direct/range {v0 .. v8}, Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;-><init>(ILjava/lang/String;Ljava/lang/String;JLandroid/net/Uri;Landroid/net/Uri;Landroid/net/Uri;)V
move-object/from16 v18, v0
return-object v18
:sswitch_data_0
.sparse-switch
0x1 -> :sswitch_0
0x2 -> :sswitch_2
0x3 -> :sswitch_3
0x4 -> :sswitch_4
0x5 -> :sswitch_5
0x6 -> :sswitch_6
0x3e8 -> :sswitch_1
.end sparse-switch
.end method
.method public ˊ(I)[Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;
.locals 1
new-array v0, p1, [Lcom/google/android/gms/games/internal/player/MostRecentGameInfoEntity;
return-object v0
.end method
| {
"content_hash": "2b9eb0ff9c1a0dac656fb009e52169f8",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 207,
"avg_line_length": 22.799418604651162,
"alnum_prop": 0.6763993369883973,
"repo_name": "gelldur/jak_oni_to_robia_prezentacja",
"id": "9ab06b1ef6349bc33d3ae2c820fe0eac187c2aba",
"size": "7898",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Starbucks/output/smali/o/eN.smali",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "8427"
},
{
"name": "Shell",
"bytes": "2303"
},
{
"name": "Smali",
"bytes": "57557982"
}
],
"symlink_target": ""
} |
module Infix
class GoogleVideos < Provider
provide_for 'video.google.com'
self.title = 'GoogleVideos'
self.type = "video"
self.pattern = /http:\/\/video.google.com\/(videoplay\?docid|googleplayer.swf\?docid)=(.*)[#|&]/
def provide(matches, options)
id = matches.last.split('&').first
url = "http://video.google.com/videoplay?docid=#{id}#"
doc = Hpricot(fetch(url))
resource = doc.search("//script").last
{
"title" => doc.search("//div[@id='video-title']").inner_html,
"description" => doc.search("//div[@id='video-desc'] span").first.inner_html,
"url" => url,
"embed_code" => embed_code(id, options[:width], options[:height]),
"embed_width" => options[:width],
"embed_height" => options[:height],
"thumbnail_url" => URI.decode(resource.to_s.match(/thumbnailUrl.*(http:\/\/.*.gvt0.com.*)',/).captures.to_s),
"provider_name" => self.title,
"provider_url" => "http://video.google.com",
"provider_type" => self.type
}
end
private
def embed_code(id, width, height)
%{ <embed id=VideoPlayback src=http://video.google.com/googleplayer.swf?docid=#{id}&hl=en&fs=true style=width:#{width}px;height:#{height}px allowFullScreen=true allowScriptAccess=always type=application/x-shockwave-flash> </embed> }
end
end
end
| {
"content_hash": "8b86c48071c35d0e04908d5c6d5b9d3f",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 238,
"avg_line_length": 34.19047619047619,
"alnum_prop": 0.5842618384401114,
"repo_name": "christospappas/infix",
"id": "1eefc41ee2a3bb7c5f203a8180cd5f89b1ce189e",
"size": "1436",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/infix/providers/google_videos.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "75475"
}
],
"symlink_target": ""
} |
(function(addon) {
var component;
if (window.UIkit) {
component = addon(UIkit);
}
if (typeof define == "function" && define.amd) {
define("uikit-htmleditor", ["uikit"], function(){
return component || addon(UIkit);
});
}
})(function(UI) {
"use strict";
var editors = [];
UI.component('htmleditor', {
defaults: {
iframe : false,
mode : 'split',
markdown : false,
autocomplete : true,
height : 500,
maxsplitsize : 1000,
codemirror : { mode: 'htmlmixed', lineWrapping: true, dragDrop: false, autoCloseTags: true, matchTags: true, autoCloseBrackets: true, matchBrackets: true, indentUnit: 4, indentWithTabs: false, tabSize: 4, hintOptions: {completionSingle:false} },
toolbar : [ 'bold', 'italic', 'strike', 'link', 'image', 'blockquote', 'listUl', 'listOl' ],
lblPreview : 'Preview',
lblCodeview : 'HTML',
lblMarkedview: 'Markdown'
},
boot: function() {
// init code
UI.ready(function(context) {
UI.$('textarea[data-uk-htmleditor]', context).each(function() {
var editor = UI.$(this);
if (!editor.data('htmleditor')) {
UI.htmleditor(editor, UI.Utils.options(editor.attr('data-uk-htmleditor')));
}
});
});
},
init: function() {
var $this = this, tpl = UI.components.htmleditor.template;
this.CodeMirror = this.options.CodeMirror || CodeMirror;
this.buttons = {};
tpl = tpl.replace(/\{:lblPreview}/g, this.options.lblPreview);
tpl = tpl.replace(/\{:lblCodeview}/g, this.options.lblCodeview);
this.htmleditor = UI.$(tpl);
this.content = this.htmleditor.find('.uk-htmleditor-content');
this.toolbar = this.htmleditor.find('.uk-htmleditor-toolbar');
this.preview = this.htmleditor.find('.uk-htmleditor-preview').children().eq(0);
this.code = this.htmleditor.find('.uk-htmleditor-code');
this.element.before(this.htmleditor).appendTo(this.code);
this.editor = this.CodeMirror.fromTextArea(this.element[0], this.options.codemirror);
this.editor.htmleditor = this;
this.editor.on('change', UI.Utils.debounce(function() { $this.render(); }, 150));
this.editor.on('change', function() {
$this.editor.save();
$this.element.trigger('input');
});
this.code.find('.CodeMirror').css('height', this.options.height);
// iframe mode?
if (this.options.iframe) {
this.iframe = UI.$('<iframe class="uk-htmleditor-iframe" frameborder="0" scrolling="auto" height="100" width="100%"></iframe>');
this.preview.append(this.iframe);
// must open and close document object to start using it!
this.iframe[0].contentWindow.document.open();
this.iframe[0].contentWindow.document.close();
this.preview.container = UI.$(this.iframe[0].contentWindow.document).find('body');
// append custom stylesheet
if (typeof(this.options.iframe) === 'string') {
this.preview.container.parent().append('<link rel="stylesheet" href="'+this.options.iframe+'">');
}
} else {
this.preview.container = this.preview;
}
UI.$win.on('resize load', UI.Utils.debounce(function() { $this.fit(); }, 200));
var previewContainer = this.iframe ? this.preview.container:$this.preview.parent(),
codeContent = this.code.find('.CodeMirror-sizer'),
codeScroll = this.code.find('.CodeMirror-scroll').on('scroll', UI.Utils.debounce(function() {
if ($this.htmleditor.attr('data-mode') == 'tab') return;
// calc position
var codeHeight = codeContent.height() - codeScroll.height(),
previewHeight = previewContainer[0].scrollHeight - ($this.iframe ? $this.iframe.height() : previewContainer.height()),
ratio = previewHeight / codeHeight,
previewPosition = codeScroll.scrollTop() * ratio;
// apply new scroll
previewContainer.scrollTop(previewPosition);
}, 10));
this.htmleditor.on('click', '.uk-htmleditor-button-code, .uk-htmleditor-button-preview', function(e) {
e.preventDefault();
if ($this.htmleditor.attr('data-mode') == 'tab') {
$this.htmleditor.find('.uk-htmleditor-button-code, .uk-htmleditor-button-preview').removeClass('uk-active').filter(this).addClass('uk-active');
$this.activetab = UI.$(this).hasClass('uk-htmleditor-button-code') ? 'code' : 'preview';
$this.htmleditor.attr('data-active-tab', $this.activetab);
$this.editor.refresh();
}
});
// toolbar actions
this.htmleditor.on('click', 'a[data-htmleditor-button]', function() {
if (!$this.code.is(':visible')) return;
$this.trigger('action.' + UI.$(this).data('htmleditor-button'), [$this.editor]);
});
this.preview.parent().css('height', this.code.height());
// autocomplete
if (this.options.autocomplete && this.CodeMirror.showHint && this.CodeMirror.hint && this.CodeMirror.hint.html) {
this.editor.on('inputRead', UI.Utils.debounce(function() {
var doc = $this.editor.getDoc(), POS = doc.getCursor(), mode = $this.CodeMirror.innerMode($this.editor.getMode(), $this.editor.getTokenAt(POS).state).mode.name;
if (mode == 'xml') { //html depends on xml
var cur = $this.editor.getCursor(), token = $this.editor.getTokenAt(cur);
if (token.string.charAt(0) == '<' || token.type == 'attribute') {
$this.CodeMirror.showHint($this.editor, $this.CodeMirror.hint.html, { completeSingle: false });
}
}
}, 100));
}
this.debouncedRedraw = UI.Utils.debounce(function () { $this.redraw(); }, 5);
this.on('init.uk.component', function() {
$this.debouncedRedraw();
});
this.element.attr('data-uk-check-display', 1).on('display.uk.check', function(e) {
if (this.htmleditor.is(":visible")) this.fit();
}.bind(this));
editors.push(this);
},
addButton: function(name, button) {
this.buttons[name] = button;
},
addButtons: function(buttons) {
UI.$.extend(this.buttons, buttons);
},
replaceInPreview: function(regexp, callback) {
var editor = this.editor, results = [], value = editor.getValue(), offset = -1, index = 0;
this.currentvalue = this.currentvalue.replace(regexp, function() {
offset = value.indexOf(arguments[0], ++offset);
var match = {
matches: arguments,
from : translateOffset(offset),
to : translateOffset(offset + arguments[0].length),
replace: function(value) {
editor.replaceRange(value, match.from, match.to);
},
inRange: function(cursor) {
if (cursor.line === match.from.line && cursor.line === match.to.line) {
return cursor.ch >= match.from.ch && cursor.ch < match.to.ch;
}
return (cursor.line === match.from.line && cursor.ch >= match.from.ch) ||
(cursor.line > match.from.line && cursor.line < match.to.line) ||
(cursor.line === match.to.line && cursor.ch < match.to.ch);
}
};
var result = typeof(callback) === 'string' ? callback : callback(match, index);
if (!result && result !== '') {
return arguments[0];
}
index++;
results.push(match);
return result;
});
function translateOffset(offset) {
var result = editor.getValue().substring(0, offset).split('\n');
return { line: result.length - 1, ch: result[result.length - 1].length }
}
return results;
},
_buildtoolbar: function() {
if (!(this.options.toolbar && this.options.toolbar.length)) return;
var $this = this, bar = [];
this.toolbar.empty();
this.options.toolbar.forEach(function(button) {
if (!$this.buttons[button]) return;
var title = $this.buttons[button].title ? $this.buttons[button].title : button;
bar.push('<li><a data-htmleditor-button="'+button+'" title="'+title+'" data-uk-tooltip>'+$this.buttons[button].label+'</a></li>');
});
this.toolbar.html(bar.join('\n'));
},
fit: function() {
var mode = this.options.mode;
if (mode == 'split' && this.htmleditor.width() < this.options.maxsplitsize) {
mode = 'tab';
}
if (mode == 'tab') {
if (!this.activetab) {
this.activetab = 'code';
this.htmleditor.attr('data-active-tab', this.activetab);
}
this.htmleditor.find('.uk-htmleditor-button-code, .uk-htmleditor-button-preview').removeClass('uk-active')
.filter(this.activetab == 'code' ? '.uk-htmleditor-button-code' : '.uk-htmleditor-button-preview')
.addClass('uk-active');
}
this.editor.refresh();
this.preview.parent().css('height', this.code.height());
this.htmleditor.attr('data-mode', mode);
},
redraw: function() {
this._buildtoolbar();
this.render();
this.fit();
},
getMode: function() {
return this.editor.getOption('mode');
},
getCursorMode: function() {
var param = { mode: 'html'};
this.trigger('cursorMode', [param]);
return param.mode;
},
render: function() {
this.currentvalue = this.editor.getValue();
// empty code
if (!this.currentvalue) {
this.element.val('');
this.preview.container.html('');
return;
}
this.trigger('render', [this]);
this.trigger('renderLate', [this]);
this.preview.container.html(this.currentvalue);
},
addShortcut: function(name, callback) {
var map = {};
if (!UI.$.isArray(name)) {
name = [name];
}
name.forEach(function(key) {
map[key] = callback;
});
this.editor.addKeyMap(map);
return map;
},
addShortcutAction: function(action, shortcuts) {
var editor = this;
this.addShortcut(shortcuts, function() {
editor.element.trigger('action.' + action, [editor.editor]);
});
},
replaceSelection: function(replace) {
var text = this.editor.getSelection();
if (!text.length) {
var cur = this.editor.getCursor(),
curLine = this.editor.getLine(cur.line),
start = cur.ch,
end = start;
while (end < curLine.length && /[\w$]+/.test(curLine.charAt(end))) ++end;
while (start && /[\w$]+/.test(curLine.charAt(start - 1))) --start;
var curWord = start != end && curLine.slice(start, end);
if (curWord) {
this.editor.setSelection({ line: cur.line, ch: start}, { line: cur.line, ch: end });
text = curWord;
}
}
var html = replace.replace('$1', text);
this.editor.replaceSelection(html, 'end');
this.editor.focus();
},
replaceLine: function(replace) {
var pos = this.editor.getDoc().getCursor(),
text = this.editor.getLine(pos.line),
html = replace.replace('$1', text);
this.editor.replaceRange(html , { line: pos.line, ch: 0 }, { line: pos.line, ch: text.length });
this.editor.setCursor({ line: pos.line, ch: html.length });
this.editor.focus();
},
save: function() {
this.editor.save();
}
});
UI.components.htmleditor.template = [
'<div class="uk-htmleditor uk-clearfix" data-mode="split">',
'<div class="uk-htmleditor-navbar">',
'<ul class="uk-htmleditor-navbar-nav uk-htmleditor-toolbar"></ul>',
'<div class="uk-htmleditor-navbar-flip">',
'<ul class="uk-htmleditor-navbar-nav">',
'<li class="uk-htmleditor-button-code"><a>{:lblCodeview}</a></li>',
'<li class="uk-htmleditor-button-preview"><a>{:lblPreview}</a></li>',
'<li><a data-htmleditor-button="fullscreen"><i class="uk-icon-expand"></i></a></li>',
'</ul>',
'</div>',
'</div>',
'<div class="uk-htmleditor-content">',
'<div class="uk-htmleditor-code"></div>',
'<div class="uk-htmleditor-preview"><div></div></div>',
'</div>',
'</div>'
].join('');
UI.plugin('htmleditor', 'base', {
init: function(editor) {
editor.addButtons({
fullscreen: {
title : 'Fullscreen',
label : '<i class="uk-icon-expand"></i>'
},
bold : {
title : 'Bold',
label : '<i class="uk-icon-bold"></i>'
},
italic : {
title : 'Italic',
label : '<i class="uk-icon-italic"></i>'
},
strike : {
title : 'Strikethrough',
label : '<i class="uk-icon-strikethrough"></i>'
},
blockquote : {
title : 'Blockquote',
label : '<i class="uk-icon-quote-right"></i>'
},
link : {
title : 'Link',
label : '<i class="uk-icon-link"></i>'
},
image : {
title : 'Image',
label : '<i class="uk-icon-picture-o"></i>'
},
listUl : {
title : 'Unordered List',
label : '<i class="uk-icon-list-ul"></i>'
},
listOl : {
title : 'Ordered List',
label : '<i class="uk-icon-list-ol"></i>'
}
});
addAction('bold', '<strong>$1</strong>');
addAction('italic', '<em>$1</em>');
addAction('strike', '<del>$1</del>');
addAction('blockquote', '<blockquote><p>$1</p></blockquote>', 'replaceLine');
addAction('link', '<a href="http://">$1</a>');
addAction('image', '<img src="http://" alt="$1">');
var listfn = function() {
if (editor.getCursorMode() == 'html') {
var cm = editor.editor,
pos = cm.getDoc().getCursor(true),
posend = cm.getDoc().getCursor(false);
for (var i=pos.line; i<(posend.line+1);i++) {
cm.replaceRange('<li>'+cm.getLine(i)+'</li>', { line: i, ch: 0 }, { line: i, ch: cm.getLine(i).length });
}
cm.setCursor({ line: posend.line, ch: cm.getLine(posend.line).length });
cm.focus();
}
};
editor.on('action.listUl', function() {
listfn();
});
editor.on('action.listOl', function() {
listfn();
});
editor.htmleditor.on('click', 'a[data-htmleditor-button="fullscreen"]', function() {
editor.htmleditor.toggleClass('uk-htmleditor-fullscreen');
var wrap = editor.editor.getWrapperElement();
if (editor.htmleditor.hasClass('uk-htmleditor-fullscreen')) {
editor.editor.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, width: wrap.style.width, height: wrap.style.height};
wrap.style.width = '';
wrap.style.height = editor.content.height()+'px';
document.documentElement.style.overflow = 'hidden';
} else {
document.documentElement.style.overflow = '';
var info = editor.editor.state.fullScreenRestore;
wrap.style.width = info.width; wrap.style.height = info.height;
window.scrollTo(info.scrollLeft, info.scrollTop);
}
setTimeout(function() {
editor.fit();
UI.$win.trigger('resize');
}, 50);
});
editor.addShortcut(['Ctrl-S', 'Cmd-S'], function() { editor.element.trigger('htmleditor-save', [editor]); });
editor.addShortcutAction('bold', ['Ctrl-B', 'Cmd-B']);
function addAction(name, replace, mode) {
editor.on('action.'+name, function() {
if (editor.getCursorMode() == 'html') {
editor[mode == 'replaceLine' ? 'replaceLine' : 'replaceSelection'](replace);
}
});
}
}
});
UI.plugin('htmleditor', 'markdown', {
init: function(editor) {
var parser = editor.options.mdparser || marked || null;
if (!parser) return;
if (editor.options.markdown) {
enableMarkdown();
}
addAction('bold', '**$1**');
addAction('italic', '*$1*');
addAction('strike', '~~$1~~');
addAction('blockquote', '> $1', 'replaceLine');
addAction('link', '[$1](http://)');
addAction('image', '');
editor.on('action.listUl', function() {
if (editor.getCursorMode() == 'markdown') {
var cm = editor.editor,
pos = cm.getDoc().getCursor(true),
posend = cm.getDoc().getCursor(false);
for (var i=pos.line; i<(posend.line+1);i++) {
cm.replaceRange('* '+cm.getLine(i), { line: i, ch: 0 }, { line: i, ch: cm.getLine(i).length });
}
cm.setCursor({ line: posend.line, ch: cm.getLine(posend.line).length });
cm.focus();
}
});
editor.on('action.listOl', function() {
if (editor.getCursorMode() == 'markdown') {
var cm = editor.editor,
pos = cm.getDoc().getCursor(true),
posend = cm.getDoc().getCursor(false),
prefix = 1;
if (pos.line > 0) {
var prevline = cm.getLine(pos.line-1), matches;
if(matches = prevline.match(/^(\d+)\./)) {
prefix = Number(matches[1])+1;
}
}
for (var i=pos.line; i<(posend.line+1);i++) {
cm.replaceRange(prefix+'. '+cm.getLine(i), { line: i, ch: 0 }, { line: i, ch: cm.getLine(i).length });
prefix++;
}
cm.setCursor({ line: posend.line, ch: cm.getLine(posend.line).length });
cm.focus();
}
});
editor.on('renderLate', function() {
if (editor.editor.options.mode == 'gfm') {
editor.currentvalue = parser(editor.currentvalue);
}
});
editor.on('cursorMode', function(e, param) {
if (editor.editor.options.mode == 'gfm') {
var pos = editor.editor.getDoc().getCursor();
if (!editor.editor.getTokenAt(pos).state.base.htmlState) {
param.mode = 'markdown';
}
}
});
UI.$.extend(editor, {
enableMarkdown: function() {
enableMarkdown();
this.render();
},
disableMarkdown: function() {
this.editor.setOption('mode', 'htmlmixed');
this.htmleditor.find('.uk-htmleditor-button-code a').html(this.options.lblCodeview);
this.render();
}
});
// switch markdown mode on event
editor.on({
enableMarkdown : function() { editor.enableMarkdown(); },
disableMarkdown : function() { editor.disableMarkdown(); }
});
function enableMarkdown() {
editor.editor.setOption('mode', 'gfm');
editor.htmleditor.find('.uk-htmleditor-button-code a').html(editor.options.lblMarkedview);
}
function addAction(name, replace, mode) {
editor.on('action.'+name, function() {
if (editor.getCursorMode() == 'markdown') {
editor[mode == 'replaceLine' ? 'replaceLine' : 'replaceSelection'](replace);
}
});
}
}
});
return UI.htmleditor;
});
| {
"content_hash": "df7235fb7d07dc7fc725cad40c5277bf",
"timestamp": "",
"source": "github",
"line_count": 622,
"max_line_length": 259,
"avg_line_length": 36.836012861736336,
"alnum_prop": 0.46778980446927376,
"repo_name": "LukasChen/LuCabular",
"id": "04cb3d81f516519237d054bc81c4bc661e0bf68a",
"size": "22912",
"binary": false,
"copies": "3",
"ref": "refs/heads/gh-pages",
"path": "node_modules/uikit/src/js/components/htmleditor.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "154"
},
{
"name": "HTML",
"bytes": "1272"
},
{
"name": "JavaScript",
"bytes": "165"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "8aeef2be4bf17ae4d2d3d54857f3cc9d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "f3d63d444f9102861f5b81682db52e1b0445bb5e",
"size": "197",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Pteridophyta/Polypodiopsida/Polypodiales/Thelypteridaceae/Thelypteris/Thelypteris boliviensis/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
namespace PiggyBox\ShopBundle\Form\ChoiceList;
use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Doctrine\DBAL\Connection;
use Doctrine\ORM\EntityManager;
class CategoryEntityLoader implements EntityLoaderInterface
{
private $em;
private $categoryController;
private $basedOnNode;
public function __construct(Controller $c, EntityManager $em, $node = null)
{
$this->em = $em;
$this->categoryController = $c;
$this->basedOnNode = $node;
}
public function getEntityManager()
{
return $this->em;
}
/**
* {@inheritDoc}
*/
public function getEntities()
{
$qb = $this->em
->createQueryBuilder()
->select('c')
->from('PiggyBoxShopBundle:Category', 'c')
;
if (!is_null($this->basedOnNode)) {
$qb->where($qb->expr()->notIn(
'c.id',
$this->em
->createQueryBuilder()
->select('n')
->from('PiggyBoxShopBundle:Category', 'n')
->where('n.root = '.$this->basedOnNode->getRoot())
->andWhere($qb->expr()->between(
'n.lft',
$this->basedOnNode->getLft(),
$this->basedOnNode->getRgt()
))
->getDQL()
));
}
$q = $qb->getQuery();
return $q->getResult();
}
/**
* {@inheritDoc}
*/
public function getEntitiesByIds($identifier, array $values)
{
$q = $this->em
->createQueryBuilder()
->select('c')
->from('PiggyBoxShopBundle:Category', 'c')
->where($q->expr()->in(
'c.'.$identifier,
':ids'
))
->setParameter('ids', $values, Connection::PARAM_INT_ARRAY)
->getQuery()
;
return $q->getResult();
}
}
| {
"content_hash": "053ce40228ac52b2082fd9a69e525c80",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 79,
"avg_line_length": 26.602564102564102,
"alnum_prop": 0.4906024096385542,
"repo_name": "julienbourdeau/PiggyBox",
"id": "bc3a017216d9ab0c96aa175bd8d03316f215c528",
"size": "2075",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/PiggyBox/ShopBundle/Form/ChoiceList/CategoryEntityLoader.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "463975"
},
{
"name": "JavaScript",
"bytes": "7118"
},
{
"name": "PHP",
"bytes": "323581"
},
{
"name": "Puppet",
"bytes": "5708"
},
{
"name": "Ruby",
"bytes": "1506"
}
],
"symlink_target": ""
} |
package internal
import "github.com/lawrencewoodman/ddataset"
// CountNumRecords counts the number of records in the Dataset and returns
// that if successful, otherwise it returns -1.
func CountNumRecords(d ddataset.Dataset) int64 {
c, err := d.Open()
if err != nil {
return -1
}
defer c.Close()
numRecords := int64(0)
for c.Next() {
numRecords++
}
if c.Err() != nil {
return -1
}
return numRecords
}
| {
"content_hash": "13d8ae19b89611f7e57f2d9e27e37c55",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 74,
"avg_line_length": 20,
"alnum_prop": 0.6904761904761905,
"repo_name": "LawrenceWoodman/ddataset",
"id": "702805a5d0a674504b98dba24b0e9c686ae48979",
"size": "558",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "internal/misc.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "61428"
},
{
"name": "Tcl",
"bytes": "1338"
}
],
"symlink_target": ""
} |
/*
* \license @{
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @}
*/
// Copyright 2008 and onwards Google, Inc.
//
// #status: RECOMMENDED
// #category: operations on strings
// #summary: Merges strings or numbers with no delimiter.
//
#ifndef GOOGLEAPIS_STRINGS_STRCAT_H_
#define GOOGLEAPIS_STRINGS_STRCAT_H_
#include <string>
using std::string;
using std::string;
#include "googleapis/base/integral_types.h"
#include "googleapis/base/macros.h"
#include "googleapis/strings/numbers.h"
#include "googleapis/strings/stringpiece.h"
namespace googleapis {
// The AlphaNum type was designed to be used as the parameter type for StrCat().
// Any routine accepting either a string or a number may accept it.
// The basic idea is that by accepting a "const AlphaNum &" as an argument
// to your function, your callers will automagically convert bools, integers,
// and floating point values to strings for you.
//
// NOTE: Use of AlphaNum outside of the //strings package is unsupported except
// for the specific case of function parameters of type "AlphaNum" or "const
// AlphaNum &". In particular, instantiating AlphaNum directly as a stack
// variable is not supported.
//
// Conversion from 8-bit values is not accepted because if it were, then an
// attempt to pass ':' instead of ":" might result in a 58 ending up in your
// result.
//
// Bools convert to "0" or "1".
//
// Floating point values are converted to a string which, if passed to strtod(),
// would produce the exact same original double (except in case of NaN; all NaNs
// are considered the same value). We try to keep the string short but it's not
// guaranteed to be as short as possible.
//
// This class has implicit constructors.
// Style guide exception granted:
// http://goto/style-guide-exception-20978288
//
struct AlphaNum {
StringPiece piece;
char digits[kFastToBufferSize];
// No bool ctor -- bools convert to an integral type.
// A bool ctor would also convert incoming pointers (bletch).
AlphaNum(int32 i32) // NOLINT(runtime/explicit)
: piece(digits, FastInt32ToBufferLeft(i32, digits) - &digits[0]) {}
AlphaNum(uint32 u32) // NOLINT(runtime/explicit)
: piece(digits, FastUInt32ToBufferLeft(u32, digits) - &digits[0]) {}
AlphaNum(int64 i64) // NOLINT(runtime/explicit)
: piece(digits, FastInt64ToBufferLeft(i64, digits) - &digits[0]) {}
AlphaNum(uint64 u64) // NOLINT(runtime/explicit)
: piece(digits, FastUInt64ToBufferLeft(u64, digits) - &digits[0]) {}
#ifdef _LP64
AlphaNum(long x) // NOLINT(runtime/explicit)
: piece(digits, FastInt64ToBufferLeft(x, digits) - &digits[0]) {}
AlphaNum(unsigned long x) // NOLINT(runtime/explicit)
: piece(digits, FastUInt64ToBufferLeft(x, digits) - &digits[0]) {}
#else
AlphaNum(long x) // NOLINT(runtime/explicit)
: piece(digits, FastInt32ToBufferLeft(x, digits) - &digits[0]) {}
AlphaNum(unsigned long x) // NOLINT(runtime/explicit)
: piece(digits, FastUInt32ToBufferLeft(x, digits) - &digits[0]) {}
#endif
AlphaNum(float f) // NOLINT(runtime/explicit)
: piece(digits, strlen(FloatToBuffer(f, digits))) {}
AlphaNum(double f) // NOLINT(runtime/explicit)
: piece(digits, strlen(DoubleToBuffer(f, digits))) {}
AlphaNum(const char *c_str) : piece(c_str) {} // NOLINT(runtime/explicit)
AlphaNum(const StringPiece &pc) : piece(pc) {} // NOLINT(runtime/explicit)
#if defined(HAS_GLOBAL_STRING)
template <class Allocator>
AlphaNum(const basic_string<char, std::char_traits<char>,
Allocator> &str)
: piece(str) {}
#endif
template <class Allocator>
AlphaNum(const std::basic_string<char, std::char_traits<char>,
Allocator> &str) // NOLINT(runtime/explicit)
: piece(str) {}
StringPiece::size_type size() const { return piece.size(); }
const char *data() const { return piece.data(); }
private:
// Use ":" not ':'
AlphaNum(char c); // NOLINT(runtime/explicit)
DISALLOW_COPY_AND_ASSIGN(AlphaNum);
};
extern AlphaNum gEmptyAlphaNum;
// ----------------------------------------------------------------------
// StrCat()
// This merges the given strings or numbers, with no delimiter. This
// is designed to be the fastest possible way to construct a string out
// of a mix of raw C strings, StringPieces, strings, bool values,
// and numeric values.
//
// Don't use this for user-visible strings. The localization process
// works poorly on strings built up out of fragments.
//
// For clarity and performance, don't use StrCat when appending to a
// string. In particular, avoid using any of these (anti-)patterns:
// str.append(StrCat(...)
// str += StrCat(...)
// str = StrCat(str, ...)
// where the last is the worse, with the potential to change a loop
// from a linear time operation with O(1) dynamic allocations into a
// quadratic time operation with O(n) dynamic allocations. StrAppend
// is a better choice than any of the above, subject to the restriction
// of StrAppend(&str, a, b, c, ...) that none of the a, b, c, ... may
// be a reference into str.
// ----------------------------------------------------------------------
inline string StrCat(const AlphaNum &a) {
return string(a.data(), a.size());
}
string StrCat(const AlphaNum &a, const AlphaNum &b);
string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c);
string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d);
string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e);
string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f);
string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g);
string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h);
namespace strings {
namespace internal {
// Do not call directly - this is not part of the public API.
string StrCatNineOrMore(const AlphaNum *a1, ...);
} // namespace internal
} // namespace strings
// Support 9 or more arguments
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k, const AlphaNum &l) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, &l, null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k, const AlphaNum &l,
const AlphaNum &m) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, &l, &m, null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k, const AlphaNum &l,
const AlphaNum &m, const AlphaNum &n) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, &l, &m, &n, null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k, const AlphaNum &l,
const AlphaNum &m, const AlphaNum &n, const AlphaNum &o) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, &l, &m, &n, &o,
null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k, const AlphaNum &l,
const AlphaNum &m, const AlphaNum &n, const AlphaNum &o,
const AlphaNum &p) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, &l, &m, &n, &o, &p,
null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k, const AlphaNum &l,
const AlphaNum &m, const AlphaNum &n, const AlphaNum &o,
const AlphaNum &p, const AlphaNum &q) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, &l, &m, &n, &o, &p, &q,
null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k, const AlphaNum &l,
const AlphaNum &m, const AlphaNum &n, const AlphaNum &o,
const AlphaNum &p, const AlphaNum &q, const AlphaNum &r) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, &l, &m, &n, &o, &p, &q, &r,
null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k, const AlphaNum &l,
const AlphaNum &m, const AlphaNum &n, const AlphaNum &o,
const AlphaNum &p, const AlphaNum &q, const AlphaNum &r,
const AlphaNum &s) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, &l, &m, &n, &o, &p, &q, &r,
&s, null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k, const AlphaNum &l,
const AlphaNum &m, const AlphaNum &n, const AlphaNum &o,
const AlphaNum &p, const AlphaNum &q, const AlphaNum &r,
const AlphaNum &s, const AlphaNum &t) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, &l, &m, &n, &o, &p, &q, &r,
&s, &t, null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k, const AlphaNum &l,
const AlphaNum &m, const AlphaNum &n, const AlphaNum &o,
const AlphaNum &p, const AlphaNum &q, const AlphaNum &r,
const AlphaNum &s, const AlphaNum &t, const AlphaNum &u) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, &l, &m, &n, &o, &p, &q, &r,
&s, &t, &u, null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k, const AlphaNum &l,
const AlphaNum &m, const AlphaNum &n, const AlphaNum &o,
const AlphaNum &p, const AlphaNum &q, const AlphaNum &r,
const AlphaNum &s, const AlphaNum &t, const AlphaNum &u,
const AlphaNum &v) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, &l, &m, &n, &o, &p, &q, &r,
&s, &t, &u, &v, null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k, const AlphaNum &l,
const AlphaNum &m, const AlphaNum &n, const AlphaNum &o,
const AlphaNum &p, const AlphaNum &q, const AlphaNum &r,
const AlphaNum &s, const AlphaNum &t, const AlphaNum &u,
const AlphaNum &v, const AlphaNum &w) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, &l, &m, &n, &o, &p, &q, &r,
&s, &t, &u, &v, &w, null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k, const AlphaNum &l,
const AlphaNum &m, const AlphaNum &n, const AlphaNum &o,
const AlphaNum &p, const AlphaNum &q, const AlphaNum &r,
const AlphaNum &s, const AlphaNum &t, const AlphaNum &u,
const AlphaNum &v, const AlphaNum &w, const AlphaNum &x) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, &l, &m, &n, &o, &p, &q, &r,
&s, &t, &u, &v, &w, &x,
null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k, const AlphaNum &l,
const AlphaNum &m, const AlphaNum &n, const AlphaNum &o,
const AlphaNum &p, const AlphaNum &q, const AlphaNum &r,
const AlphaNum &s, const AlphaNum &t, const AlphaNum &u,
const AlphaNum &v, const AlphaNum &w, const AlphaNum &x,
const AlphaNum &y) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, &l, &m, &n, &o, &p, &q, &r,
&s, &t, &u, &v, &w, &x, &y,
null_alphanum);
}
inline string StrCat(const AlphaNum &a, const AlphaNum &b, const AlphaNum &c,
const AlphaNum &d, const AlphaNum &e, const AlphaNum &f,
const AlphaNum &g, const AlphaNum &h, const AlphaNum &i,
const AlphaNum &j, const AlphaNum &k, const AlphaNum &l,
const AlphaNum &m, const AlphaNum &n, const AlphaNum &o,
const AlphaNum &p, const AlphaNum &q, const AlphaNum &r,
const AlphaNum &s, const AlphaNum &t, const AlphaNum &u,
const AlphaNum &v, const AlphaNum &w, const AlphaNum &x,
const AlphaNum &y, const AlphaNum &z) {
const AlphaNum* null_alphanum = NULL;
return strings::internal::StrCatNineOrMore(&a, &b, &c, &d, &e, &f, &g, &h, &i,
&j, &k, &l, &m, &n, &o, &p, &q, &r,
&s, &t, &u, &v, &w, &x, &y, &z,
null_alphanum);
}
// ----------------------------------------------------------------------
// StrAppend()
// Same as above, but adds the output to the given string.
// WARNING: For speed, StrAppend does not try to check each of its input
// arguments to be sure that they are not a subset of the string being
// appended to. That is, while this will work:
//
// string s = "foo";
// s += s;
//
// This will not (necessarily) work:
//
// string s = "foo";
// StrAppend(&s, s);
//
// Note: while StrCat supports appending up to 12 arguments, StrAppend
// is currently limited to 9. That's rarely an issue except when
// automatically transforming StrCat to StrAppend, and can easily be
// worked around as consecutive calls to StrAppend are quite efficient.
// ----------------------------------------------------------------------
void StrAppend(string *dest, const AlphaNum &a);
void StrAppend(string *dest, const AlphaNum &a, const AlphaNum &b);
void StrAppend(string *dest, const AlphaNum &a, const AlphaNum &b,
const AlphaNum &c);
void StrAppend(string *dest, const AlphaNum &a, const AlphaNum &b,
const AlphaNum &c, const AlphaNum &d);
// Support up to 9 params by using a default empty AlphaNum.
void StrAppend(string *dest, const AlphaNum &a, const AlphaNum &b,
const AlphaNum &c, const AlphaNum &d, const AlphaNum &e,
const AlphaNum &f = gEmptyAlphaNum,
const AlphaNum &g = gEmptyAlphaNum,
const AlphaNum &h = gEmptyAlphaNum,
const AlphaNum &i = gEmptyAlphaNum);
} // namespace googleapis
#endif // GOOGLEAPIS_STRINGS_STRCAT_H_
| {
"content_hash": "8d50a4472e2f368917167c33f5554be8",
"timestamp": "",
"source": "github",
"line_count": 428,
"max_line_length": 80,
"avg_line_length": 50.427570093457945,
"alnum_prop": 0.5623407311309827,
"repo_name": "Panchatcharam/simple_gmail_api",
"id": "635fc44f718d2ad573cb1dad794498f2ee6a7dd7",
"size": "22233",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "gmail_access/include/googleapis/strings/strcat.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1449394"
},
{
"name": "C++",
"bytes": "2985725"
}
],
"symlink_target": ""
} |
package plugins
import (
"fmt"
"regexp"
"strings"
v1 "k8s.io/api/core/v1"
storage "k8s.io/api/storage/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog/v2"
)
const (
// AzureFileDriverName is the name of the CSI driver for Azure File
AzureFileDriverName = "file.csi.azure.com"
// AzureFileInTreePluginName is the name of the intree plugin for Azure file
AzureFileInTreePluginName = "kubernetes.io/azure-file"
separator = "#"
volumeIDTemplate = "%s#%s#%s#%s"
// Parameter names defined in azure file CSI driver, refer to
// https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/master/docs/driver-parameters.md
shareNameField = "sharename"
secretNameField = "secretname"
secretNamespaceField = "secretnamespace"
secretNameTemplate = "azure-storage-account-%s-secret"
defaultSecretNamespace = "default"
resourceGroupAnnotation = "kubernetes.io/azure-file-resource-group"
)
var _ InTreePlugin = &azureFileCSITranslator{}
var secretNameFormatRE = regexp.MustCompile(`azure-storage-account-(.+)-secret`)
// azureFileCSITranslator handles translation of PV spec from In-tree
// Azure File to CSI Azure File and vice versa
type azureFileCSITranslator struct{}
// NewAzureFileCSITranslator returns a new instance of azureFileTranslator
func NewAzureFileCSITranslator() InTreePlugin {
return &azureFileCSITranslator{}
}
// TranslateInTreeStorageClassToCSI translates InTree Azure File storage class parameters to CSI storage class
func (t *azureFileCSITranslator) TranslateInTreeStorageClassToCSI(sc *storage.StorageClass) (*storage.StorageClass, error) {
return sc, nil
}
// TranslateInTreeInlineVolumeToCSI takes a Volume with AzureFile set from in-tree
// and converts the AzureFile source to a CSIPersistentVolumeSource
func (t *azureFileCSITranslator) TranslateInTreeInlineVolumeToCSI(volume *v1.Volume, podNamespace string) (*v1.PersistentVolume, error) {
if volume == nil || volume.AzureFile == nil {
return nil, fmt.Errorf("volume is nil or Azure File not defined on volume")
}
azureSource := volume.AzureFile
accountName, err := getStorageAccountName(azureSource.SecretName)
if err != nil {
klog.Warningf("getStorageAccountName(%s) returned with error: %v", azureSource.SecretName, err)
accountName = azureSource.SecretName
}
secretNamespace := defaultSecretNamespace
if podNamespace != "" {
secretNamespace = podNamespace
}
var (
pv = &v1.PersistentVolume{
ObjectMeta: metav1.ObjectMeta{
// Must be unique per disk as it is used as the unique part of the
// staging path
Name: fmt.Sprintf("%s-%s", AzureFileDriverName, azureSource.ShareName),
},
Spec: v1.PersistentVolumeSpec{
PersistentVolumeSource: v1.PersistentVolumeSource{
CSI: &v1.CSIPersistentVolumeSource{
Driver: AzureFileDriverName,
VolumeHandle: fmt.Sprintf(volumeIDTemplate, "", accountName, azureSource.ShareName, ""),
ReadOnly: azureSource.ReadOnly,
VolumeAttributes: map[string]string{shareNameField: azureSource.ShareName},
NodeStageSecretRef: &v1.SecretReference{
Name: azureSource.SecretName,
Namespace: secretNamespace,
},
},
},
AccessModes: []v1.PersistentVolumeAccessMode{v1.ReadWriteMany},
},
}
)
return pv, nil
}
// TranslateInTreePVToCSI takes a PV with AzureFile set from in-tree
// and converts the AzureFile source to a CSIPersistentVolumeSource
func (t *azureFileCSITranslator) TranslateInTreePVToCSI(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) {
if pv == nil || pv.Spec.AzureFile == nil {
return nil, fmt.Errorf("pv is nil or Azure File source not defined on pv")
}
azureSource := pv.Spec.PersistentVolumeSource.AzureFile
accountName, err := getStorageAccountName(azureSource.SecretName)
if err != nil {
klog.Warningf("getStorageAccountName(%s) returned with error: %v", azureSource.SecretName, err)
accountName = azureSource.SecretName
}
resourceGroup := ""
if pv.ObjectMeta.Annotations != nil {
if v, ok := pv.ObjectMeta.Annotations[resourceGroupAnnotation]; ok {
resourceGroup = v
}
}
volumeID := fmt.Sprintf(volumeIDTemplate, resourceGroup, accountName, azureSource.ShareName, "")
var (
// refer to https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/master/docs/driver-parameters.md
csiSource = &v1.CSIPersistentVolumeSource{
Driver: AzureFileDriverName,
NodeStageSecretRef: &v1.SecretReference{
Name: azureSource.SecretName,
Namespace: defaultSecretNamespace,
},
ReadOnly: azureSource.ReadOnly,
VolumeAttributes: map[string]string{shareNameField: azureSource.ShareName},
VolumeHandle: volumeID,
}
)
if azureSource.SecretNamespace != nil {
csiSource.NodeStageSecretRef.Namespace = *azureSource.SecretNamespace
}
pv.Spec.PersistentVolumeSource.AzureFile = nil
pv.Spec.PersistentVolumeSource.CSI = csiSource
return pv, nil
}
// TranslateCSIPVToInTree takes a PV with CSIPersistentVolumeSource set and
// translates the Azure File CSI source to a AzureFile source.
func (t *azureFileCSITranslator) TranslateCSIPVToInTree(pv *v1.PersistentVolume) (*v1.PersistentVolume, error) {
if pv == nil || pv.Spec.CSI == nil {
return nil, fmt.Errorf("pv is nil or CSI source not defined on pv")
}
csiSource := pv.Spec.CSI
// refer to https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/master/docs/driver-parameters.md
azureSource := &v1.AzureFilePersistentVolumeSource{
ReadOnly: csiSource.ReadOnly,
}
for k, v := range csiSource.VolumeAttributes {
switch strings.ToLower(k) {
case shareNameField:
azureSource.ShareName = v
case secretNameField:
azureSource.SecretName = v
case secretNamespaceField:
ns := v
azureSource.SecretNamespace = &ns
}
}
resourceGroup := ""
if csiSource.NodeStageSecretRef != nil && csiSource.NodeStageSecretRef.Name != "" {
azureSource.SecretName = csiSource.NodeStageSecretRef.Name
azureSource.SecretNamespace = &csiSource.NodeStageSecretRef.Namespace
}
if azureSource.ShareName == "" || azureSource.SecretName == "" {
rg, storageAccount, fileShareName, _, err := getFileShareInfo(csiSource.VolumeHandle)
if err != nil {
return nil, err
}
if azureSource.ShareName == "" {
azureSource.ShareName = fileShareName
}
if azureSource.SecretName == "" {
azureSource.SecretName = fmt.Sprintf(secretNameTemplate, storageAccount)
}
resourceGroup = rg
}
if azureSource.SecretNamespace == nil {
ns := defaultSecretNamespace
azureSource.SecretNamespace = &ns
}
pv.Spec.CSI = nil
pv.Spec.AzureFile = azureSource
if pv.ObjectMeta.Annotations == nil {
pv.ObjectMeta.Annotations = map[string]string{}
}
if resourceGroup != "" {
pv.ObjectMeta.Annotations[resourceGroupAnnotation] = resourceGroup
}
return pv, nil
}
// CanSupport tests whether the plugin supports a given volume
// specification from the API. The spec pointer should be considered
// const.
func (t *azureFileCSITranslator) CanSupport(pv *v1.PersistentVolume) bool {
return pv != nil && pv.Spec.AzureFile != nil
}
// CanSupportInline tests whether the plugin supports a given inline volume
// specification from the API. The spec pointer should be considered
// const.
func (t *azureFileCSITranslator) CanSupportInline(volume *v1.Volume) bool {
return volume != nil && volume.AzureFile != nil
}
// GetInTreePluginName returns the name of the intree plugin driver
func (t *azureFileCSITranslator) GetInTreePluginName() string {
return AzureFileInTreePluginName
}
// GetCSIPluginName returns the name of the CSI plugin
func (t *azureFileCSITranslator) GetCSIPluginName() string {
return AzureFileDriverName
}
func (t *azureFileCSITranslator) RepairVolumeHandle(volumeHandle, nodeID string) (string, error) {
return volumeHandle, nil
}
// get file share info according to volume id, e.g.
// input: "rg#f5713de20cde511e8ba4900#pvc-file-dynamic-17e43f84-f474-11e8-acd0-000d3a00df41#diskname.vhd"
// output: rg, f5713de20cde511e8ba4900, pvc-file-dynamic-17e43f84-f474-11e8-acd0-000d3a00df41, diskname.vhd
func getFileShareInfo(id string) (string, string, string, string, error) {
segments := strings.Split(id, separator)
if len(segments) < 3 {
return "", "", "", "", fmt.Errorf("error parsing volume id: %q, should at least contain two #", id)
}
var diskName string
if len(segments) > 3 {
diskName = segments[3]
}
return segments[0], segments[1], segments[2], diskName, nil
}
// get storage account name from secret name
func getStorageAccountName(secretName string) (string, error) {
matches := secretNameFormatRE.FindStringSubmatch(secretName)
if len(matches) != 2 {
return "", fmt.Errorf("could not get account name from %s, correct format: %s", secretName, secretNameFormatRE)
}
return matches[1], nil
}
| {
"content_hash": "ad77f73aea53cf31f06efc0ffaeadd1e",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 137,
"avg_line_length": 34.6078431372549,
"alnum_prop": 0.7457223796033995,
"repo_name": "nckturner/kubernetes",
"id": "0c6b434a9dd79ba7c24a06afa3ebe1214605c1e8",
"size": "9394",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "staging/src/k8s.io/csi-translation-lib/plugins/azure_file.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "833"
},
{
"name": "C",
"bytes": "3902"
},
{
"name": "Dockerfile",
"bytes": "50154"
},
{
"name": "Go",
"bytes": "59654028"
},
{
"name": "HTML",
"bytes": "128"
},
{
"name": "Lua",
"bytes": "17200"
},
{
"name": "Makefile",
"bytes": "65781"
},
{
"name": "PowerShell",
"bytes": "153084"
},
{
"name": "Python",
"bytes": "23849"
},
{
"name": "Shell",
"bytes": "1775764"
},
{
"name": "sed",
"bytes": "1262"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Text;
namespace ZDevTools.ServiceConsole
{
public interface IUtility
{
string ExePath { get; }
}
}
| {
"content_hash": "52fcd01b416609e9e4e42c29bc744ee9",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 34,
"avg_line_length": 16.545454545454547,
"alnum_prop": 0.6923076923076923,
"repo_name": "zhyy2008z/ZDevTools",
"id": "4c391a1ddd803c96121bed8efa594e9f24b2ad0b",
"size": "184",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ZDevTools.ServiceConsole/IUtility.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "460"
},
{
"name": "C#",
"bytes": "733549"
}
],
"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("02.BinaryToDecimal")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("02.BinaryToDecimal")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2015")]
[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("76386135-7d14-45c1-89a7-4165542c896c")]
// 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": "a74c6297723bcafa082b71e100e5d1d6",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 39.638888888888886,
"alnum_prop": 0.7491240364400841,
"repo_name": "iKostov86/CSharp",
"id": "35e4e648d380552c6cf8cfe595472c716e076c1b",
"size": "1430",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Homeworks/C# - part 2/NumeralSystems/02.BinaryToDecimal/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "577432"
}
],
"symlink_target": ""
} |
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
module Control.Lens.Iso.Generics (Wrapped, wrapped) where
import Control.Lens (Iso, from, iso)
import GHC.Generics (Generic, Rep, K1 (..), M1 (..), U1 (..))
import GHC.Generics.Lens.Extras
type Wrapped s t a b = (Generic a, Generic b, GWrapped s t (Rep a) (Rep b))
wrapped :: Wrapped s t a b => Iso s t a b
{-# INLINE wrapped #-}
wrapped = gwrapped.from rep
class GWrapped s t a b | a -> s, b -> t, a t -> s, b s -> t where
gwrapped :: Iso s t (a x) (b x)
instance GWrapped () () U1 U1 where
{-# INLINE gwrapped #-}
gwrapped = iso (const U1) (const ())
instance GWrapped s t (K1 i s) (K1 i t) where
{-# INLINE gwrapped #-}
gwrapped = iso K1 unK1
instance GWrapped s t a b => GWrapped s t (M1 i c a) (M1 i c b) where
{-# INLINE gwrapped #-}
gwrapped = gwrapped.iso M1 unM1
| {
"content_hash": "a502728699bfa3f9f654dc1ac00070bf",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 75,
"avg_line_length": 31.625,
"alnum_prop": 0.6511857707509882,
"repo_name": "sonyandy/wart",
"id": "c3028648170499585c0b1a9c97f34e2d6507cbf1",
"size": "1012",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Control/Lens/Iso/Generics.hs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Haskell",
"bytes": "82318"
},
{
"name": "Shell",
"bytes": "704"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>itree: 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+1 / itree - 1.0.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
itree
<small>
1.0.0
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-03-02 21:28:58 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-03-02 21:28:58 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.11 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-m4 1 Virtual package relying on m4
coq 8.7.1+1 Formal proof management system.
num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.09.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.0 Official release 4.09.0
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
name: "coq-itree"
version: "1.0.0"
maintainer: "Li-yao Xia <lysxia@gmail.com>"
synopsis: "A Library for Representing Recursive and Impure Programs in Coq"
homepage: "https://github.com/DeepSpec/InteractionTrees"
dev-repo: "git+https://github.com/DeepSpec/InteractionTrees"
bug-reports: "https://github.com/DeepSpec/InteractionTrees/issues"
license: "MIT"
build: [ make "-j%{jobs}%" ]
install: [ make "install" ]
remove: [ make "uninstall" ]
run-test: [ make "-j%{jobs}%" "all" ]
depends: [
"coq" {>= "8.8" & < "8.10~"}
"coq-ext-lib" {>= "0.10.0" & < "0.10.2"}
"coq-paco" {>= "2.1.0" & < "2.2"}
"ocamlbuild" {with-test}
]
authors: [
"Li-yao Xia <lysxia@gmail.com>"
"Yannick Zakowski <zakowski@seas.upenn.edu>"
"Paul He <paulhe@seas.upenn.edu>"
"Chung-Kil Hur <gil.hur@gmail.com>"
"Gregory Malecha <gmalecha@gmail.com>"
"Steve Zdancewic <stevez@cis.upenn.edu>"
"Benjamin C. Pierce <bcpierce@cis.upenn.edu>"
]
tags: "org:deepspec"
flags: light-uninstall
url {
http: "https://github.com/DeepSpec/InteractionTrees/archive/1.0.0.tar.gz"
checksum: "ad9859b8e0702703f86347e01840b1af"
}
</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-itree.1.0.0 coq.8.7.1+1</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+1).
The following dependencies couldn't be met:
- coq-itree -> coq >= 8.8
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-itree.1.0.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">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</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": "cfb9964e4fcbed1a9d596aabc27ff2a4",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 157,
"avg_line_length": 41.14857142857143,
"alnum_prop": 0.5442299680599917,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "a57d06de7f042a01d2923719c94901dcb67f9c53",
"size": "7203",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.09.0-2.0.5/released/8.7.1+1/itree/1.0.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
//
// BDKViewController.h
// Created by Benjamin Kreeger on 1/25/13.
//
#import <UIKit/UIKit.h>
/** Simple view controller.
*/
@interface BDKViewController : UIViewController
@end
| {
"content_hash": "80141284ac1e0925879bc5a8a993562a",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 47,
"avg_line_length": 15.5,
"alnum_prop": 0.7043010752688172,
"repo_name": "kreeger/BDKActionJackson",
"id": "de6f823874f3a4152ef3744171d526f92a83a5bf",
"size": "186",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "BDKActionJacksonSample/BDKViewController.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "4053"
}
],
"symlink_target": ""
} |
<?php
namespace Omnipay\WechatPay\Message;
use Omnipay\Common\Exception\InvalidRequestException;
class CloseOrderRequest extends BaseAbstractRequest{
protected $interface_url = 'https://api.mch.weixin.qq.com/pay/closeorder';
protected function validateData(){
parent::validateData();
$this->validate(
'out_trade_no'
);
}
public function getData(){
$this->validateData();
$request_data = [
'appid' => $this->getAppId(),
'mch_id' => $this->getMchId(),
'out_trade_no' => $this->getOutTradeNo(),
'nonce_str' => $this->getNonceStr()
];
$request_data = array_filter( $request_data, function( $value ){
return !is_null( $value );
});
$request_data['sign'] = $this->getParamsSignature( $request_data );
return $request_data;
}
public function sendData( $data ){
$result = parent::sendData( $data );
return $this->response = new CloseOrderResponse( $this, $result );
}
public function setAppId( $value ){
return $this->setParameter( 'appid', $value );
}
public function getAppId( ){
return $this->getParameter( 'appid' );
}
public function setMchId( $value ){
return $this->setParameter( 'mch_id', $value );
}
public function getMchId( ){
return $this->getParameter( 'mch_id' );
}
public function setOutTradeNo( $value ){
return $this->setParameter( 'out_trade_no', $value );
}
public function getOutTradeNo(){
return $this->getParameter( 'out_trade_no' );
}
}
| {
"content_hash": "f7cf9eb767daa7d2fd3f66d19b579dee",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 78,
"avg_line_length": 22.194805194805195,
"alnum_prop": 0.5611468695143359,
"repo_name": "Ccob-x/omnipay-wechatpay",
"id": "47b2f66f056208a1edaf569c811b022515adafd8",
"size": "1709",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Message/CloseOrderRequest.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "49399"
}
],
"symlink_target": ""
} |
static void form(Document *doc, const char *err=""){
doc->setHtml("html/registration.tpl", "Register");
doc->dict()->SetValueAndShowSection("ERROR", err, "ERROR");
doc->dict()->SetValue("NAME", cgi("name"));
doc->dict()->SetValue("EMAIL", cgi("email"));
}
void Pages::registration(Document *doc){
if(path != "/register")
return;
std::string name = cgi("name"), email = cgi("email"), pw = cgi("pw");
if(Session::user())
doc->redirect("/");
else if(cgi.getEnvironment().getRequestMethod() != "POST")
form(doc);
else if(name.empty())
form(doc, "Please specify a display name.");
else if(email.empty())
form(doc, "Please specify an email address.");
else if(!validEmail(email))
form(doc, "Invalid email address.");
else if(pw.empty())
form(doc, "Please specify a password.");
else if(pw != cgi("pwconf"))
form(doc, "Passwords mismatch.");
else{
if(DB::query("SELECT EXISTS (SELECT 1 FROM users WHERE lower(name) = lower($1) OR lower(email) = lower($2))", name, email)[0][0] == "t")
return form(doc, "Sorry, name or email already in use.");
DB::Result r = DB::query(
"INSERT INTO users (name, password, email, registration, last_login) "
"VALUES ($1, crypt($2, gen_salt('bf')), $3, 'now', 'now') "
"RETURNING id", name, pw, email);
if(r.empty())
return form(doc, "Erm, something went wrong. Please try again.");
User u = User(number(r[0][0]), name);
log("New user: " + u.name + " (" + number(u.id) + ")");
doc->addHttp("Set-Cookie: sid=" + Session::login(u) + ";Max-Age=2592000\n"); // 30 days
doc->redirect(u.url() + "?welcome=1");
}
}
| {
"content_hash": "d233b3fe92d4085583ed59c8f3b5e43a",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 144,
"avg_line_length": 33.092592592592595,
"alnum_prop": 0.5567991046446559,
"repo_name": "SuperStarPL/eqbeats",
"id": "362e77aa60a68efb9843a2e39d2a5d62dcc114aa",
"size": "1918",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/account/pages/registration.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "3757"
},
{
"name": "C++",
"bytes": "138994"
},
{
"name": "CSS",
"bytes": "29443"
},
{
"name": "HTML",
"bytes": "645"
},
{
"name": "Haskell",
"bytes": "868"
},
{
"name": "JavaScript",
"bytes": "67298"
},
{
"name": "Python",
"bytes": "1793"
},
{
"name": "Shell",
"bytes": "2792"
},
{
"name": "Smarty",
"bytes": "61322"
}
],
"symlink_target": ""
} |
FreePort
========
Get a free open TCP port that is ready to use.
## Command Line Example:
```bash
# Ask the kernel to give us an open port.
export port=$(freeport)
# Start standalone httpd server for testing
httpd -X -c "Listen $port" &
# Curl local server on the selected port
curl localhost:$port
```
## Golang example:
```go
package main
import "github.com/phayes/freeport"
func main() {
port, err := freeport.GetFreePort()
if err != nil {
log.Fatal(err)
}
// port is ready to listen on
}
```
## Installation
#### Mac OSX
```bash
brew install phayes/repo/freeport
```
#### CentOS and other RPM based systems
```bash
wget https://github.com/phayes/freeport/releases/download/1.0.2/freeport_1.0.2_linux_386.rpm
rpm -Uvh freeport_1.0.2_linux_386.rpm
```
#### Ubuntu and other DEB based systems
```bash
wget wget https://github.com/phayes/freeport/releases/download/1.0.2/freeport_1.0.2_linux_amd64.deb
dpkg -i freeport_1.0.2_linux_amd64.deb
```
#### Building From Source
```bash
sudo apt-get install golang # Download go. Alternativly build from source: https://golang.org/doc/install/source
go get github.com/phayes/freeport
```
| {
"content_hash": "5060d090ceb5171259fd0416d3c2ec11",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 131,
"avg_line_length": 20.155172413793103,
"alnum_prop": 0.6928999144568007,
"repo_name": "vlifesystems/rulehunter",
"id": "1665ccf4d4f83fc24eb7cc32dcb44d9943c53bc1",
"size": "1169",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "vendor/github.com/phayes/freeport/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1992"
},
{
"name": "Go",
"bytes": "312118"
},
{
"name": "PowerShell",
"bytes": "1284"
},
{
"name": "Shell",
"bytes": "1040"
}
],
"symlink_target": ""
} |
package input
import (
"bytes"
"encoding/xml"
"fmt"
"io"
"net/http"
"os"
"runtime"
"strings"
"github.com/gregjones/httpcache"
"github.com/gregjones/httpcache/diskcache"
"golang.org/x/text/encoding/charmap"
)
// Project represents the <project> element of pom.xml
type Project struct {
ArtifactID string `xml:"artifactId"`
Name string `xml:"name"`
URL string `xml:"url"`
Description string `xml:"description"`
Packaging string `xml:"packaging"`
}
var client http.Client
var remoteBase = "http://search.maven.org/remotecontent?filepath="
var localBase string
func init() {
cache := diskcache.New("pom")
t := httpcache.NewTransport(cache)
client = http.Client{Transport: t}
localBase = userHomeDir() + "/.m2/repository/"
}
// ReadPOMFile reads a POM file from local $HOME/.m2/repository and if it fails fetches one from maven.org
func ReadPOMFile(uri string) (*Project, error) {
pom, err := readLocal(uri)
if err != nil {
pom, err = readRemote(uri)
}
if err != nil {
return nil, err
}
var project Project
decoder := xml.NewDecoder(strings.NewReader(pom))
decoder.CharsetReader = makeCharsetReader
if err := decoder.Decode(&project); err != nil {
return nil, err
}
return &project, nil
}
func readLocal(uri string) (string, error) {
f, err := os.Open(localBase + uri)
defer f.Close()
if err != nil {
return "", err
}
buf := bytes.NewBuffer(nil)
_, err = io.Copy(buf, f)
if err != nil {
return "", err
}
return buf.String(), nil
}
func readRemote(uri string) (string, error) {
fmt.Printf("-> Reading remote cached " + remoteBase + uri + "\n")
req, err := http.NewRequest("GET", remoteBase+uri, nil)
if err != nil {
return "", err
}
resp, err := client.Do(req)
if err != nil {
return "", err
}
if resp.StatusCode != http.StatusOK {
err = fmt.Errorf("%d while reading %s", resp.StatusCode, uri)
return "", err
}
var buf bytes.Buffer
_, err = io.Copy(&buf, resp.Body)
if err != nil {
return "", err
}
err = resp.Body.Close()
if err != nil {
return "", err
}
return buf.String(), nil
}
var isWindows = func() bool {
return runtime.GOOS == "windows"
}
func userHomeDir() string {
if isWindows() {
home := os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
if home == "" {
home = os.Getenv("USERPROFILE")
}
return home
}
return os.Getenv("HOME")
}
func makeCharsetReader(charset string, input io.Reader) (io.Reader, error) {
charset = strings.ToLower(charset)
if charset == "iso-8859-1" || charset == "windows-1252" {
// Windows-1252 is a superset of ISO-8859-1, so should do here
return charmap.Windows1252.NewDecoder().Reader(input), nil
}
return nil, fmt.Errorf("Unknown charset: %s", charset)
}
| {
"content_hash": "30be995ba0da5d709c94401d32e1346b",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 106,
"avg_line_length": 22.462809917355372,
"alnum_prop": 0.6622516556291391,
"repo_name": "maksimov/liconv",
"id": "a3e2bb9f69024f4380fdaec793f48d1bda0354aa",
"size": "2718",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "input/pom-xml.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "11079"
},
{
"name": "Makefile",
"bytes": "922"
}
],
"symlink_target": ""
} |
<?php
/**
* OUTRAGEbot - PHP 5.3 based IRC bot
*
* Author: David Weston <westie@typefish.co.uk>
*
* Version: 2.0.0-Alpha
* Git commit: 72dcd361ddbd66db711dbc45552ab766bc6bbf84
* Committed at: Wed Aug 24 23:26:52 BST 2011
*
* Licence: http://www.typefish.co.uk/licences/
*/
class WhatPulse extends Script
{
/**
* Called when the Script is loaded.
*/
public function onConstruct()
{
$this->addCommandHandler("wp", "getWPStats");
$this->addCommandHandler("setwp", "setWPID");
}
/**
* Called when someone wants to set their WP stats.
*/
public function setWPID($sChannel, $sNickname, $sArguments)
{
if(!$sArguments)
{
$this->Notice($sNickname, "Sorry, but this doesn't look a valid ID");
return END_EVENT_EXEC;
}
$pUser = $this->getResource("Users/{$sNickname}", "w");
$pUser->write($sArguments);
$this->Notice($sNickname, "Congrats! You've now set your WP ID to {$sArguments}.");
return END_EVENT_EXEC;
}
/**
* Called when someone wants their WP stats.
*/
public function getWPStats($sChannel, $sNickname, $sArguments)
{
$sPerson = $sNickname;
if($sArguments)
{
$sNickname = $sArguments;
}
if(!$this->isResource("Users/{$sNickname}"))
{
$this->Notice($sPerson, "Nope, you don't have an WP id with us, use setwp.");
return END_EVENT_EXEC;
}
$pWhatpulse = $this->getWhatpulseObject($sNickname);
if(!($pWhatpulse instanceof SimpleXMLElement))
{
$this->Notice($sPerson, "There seems to be an error. Sorry about that!");
return END_EVENT_EXEC;
}
$sDate = $pWhatpulse->DateJoined;
$sNickname = $pWhatpulse->AccountName;
$iKeys = number_format("{$pWhatpulse->TotalKeyCount}");
$iClicks = number_format("{$pWhatpulse->TotalMouseClicks}");
$iMouseDistance = number_format("{$pWhatpulse->TotalMiles}");
$iRank = number_format("{$pWhatpulse->Rank}");
$iPulses = number_format("{$pWhatpulse->Pulses}");
$iDelta = (strtotime(date("Y-m-d")) - strtotime($pWhatpulse->DateJoined)) / 86400;
$iKeyAvg = number_format((string) ($pWhatpulse->TotalKeyCount / $iDelta));
$this->Message($sChannel, "Since ".Format::DarkGreen."{$sDate}".Format::Clear.", ".Format::DarkGreen."{$sNickname}".Format::Clear." has typed ".Format::DarkGreen."{$iKeys}".Format::Clear." characters, clicked ".Format::DarkGreen."{$iClicks}".Format::Clear." times and moved their mouse ".Format::DarkGreen."{$iMouseDistance}".Format::Clear." miles.");
$this->Message($sChannel, "This gives ".Format::DarkGreen."{$sNickname}".Format::Clear." an average of ".Format::DarkGreen."{$iKeyAvg}".Format::Clear." keys per day.");
$this->Message($sChannel, Format::DarkGreen."{$sNickname}".Format::Clear." has sent ".Format::DarkGreen."{$iPulses}".Format::Clear." pulses during this time, giving them a rank of ".Format::DarkGreen."{$iRank}".Format::Clear.".");
return END_EVENT_EXEC;
}
/**
* Function to deal with the output of the WP stats
*/
private function getWhatpulseObject($sNickname)
{
$pUser = $this->getResource("Users/{$sNickname}");
$iUserID = $pUser->read();
unset($pUser);
$sXML = file_get_contents("http://whatpulse.org/api/user.php?UserID={$iUserID}");
if(!stristr($sXML, "<?xml"))
{
return null;
}
return new SimpleXMLElement($sXML);
}
}
| {
"content_hash": "744b2e64328931f6046c26645079dee2",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 353,
"avg_line_length": 29.78181818181818,
"alnum_prop": 0.6645299145299145,
"repo_name": "Zarthus/zcnr-bot",
"id": "0547f07df7a6094c4e1a22d0fe2b38faff4ac316",
"size": "3276",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Scripts/WhatPulse/Default.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "182958"
}
],
"symlink_target": ""
} |
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package org.kaaproject.kaa.server.appenders.mongo.config.gen;
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class MongoDBCredential extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"MongoDBCredential\",\"namespace\":\"org.kaaproject.kaa.server.appenders.mongo.config.gen\",\"fields\":[{\"name\":\"user\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"displayName\":\"User\",\"weight\":0.5,\"by_default\":\"user\"},{\"name\":\"password\",\"type\":{\"type\":\"string\",\"avro.java.string\":\"String\"},\"displayName\":\"Password\",\"weight\":0.5,\"by_default\":\"password\"}]}");
public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
private java.lang.String user;
private java.lang.String password;
/**
* Default constructor. Note that this does not initialize fields
* to their default values from the schema. If that is desired then
* one should use {@link \#newBuilder()}.
*/
public MongoDBCredential() {}
/**
* All-args constructor.
*/
public MongoDBCredential(java.lang.String user, java.lang.String password) {
this.user = user;
this.password = password;
}
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
// Used by DatumWriter. Applications should not call.
public java.lang.Object get(int field$) {
switch (field$) {
case 0: return user;
case 1: return password;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
// Used by DatumReader. Applications should not call.
@SuppressWarnings(value="unchecked")
public void put(int field$, java.lang.Object value$) {
switch (field$) {
case 0: user = (java.lang.String)value$; break;
case 1: password = (java.lang.String)value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/**
* Gets the value of the 'user' field.
*/
public java.lang.String getUser() {
return user;
}
/**
* Sets the value of the 'user' field.
* @param value the value to set.
*/
public void setUser(java.lang.String value) {
this.user = value;
}
/**
* Gets the value of the 'password' field.
*/
public java.lang.String getPassword() {
return password;
}
/**
* Sets the value of the 'password' field.
* @param value the value to set.
*/
public void setPassword(java.lang.String value) {
this.password = value;
}
/** Creates a new MongoDBCredential RecordBuilder */
public static org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential.Builder newBuilder() {
return new org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential.Builder();
}
/** Creates a new MongoDBCredential RecordBuilder by copying an existing Builder */
public static org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential.Builder newBuilder(org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential.Builder other) {
return new org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential.Builder(other);
}
/** Creates a new MongoDBCredential RecordBuilder by copying an existing MongoDBCredential instance */
public static org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential.Builder newBuilder(org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential other) {
return new org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential.Builder(other);
}
/**
* RecordBuilder for MongoDBCredential instances.
*/
public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<MongoDBCredential>
implements org.apache.avro.data.RecordBuilder<MongoDBCredential> {
private java.lang.String user;
private java.lang.String password;
/** Creates a new Builder */
private Builder() {
super(org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential.SCHEMA$);
}
/** Creates a Builder by copying an existing Builder */
private Builder(org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential.Builder other) {
super(other);
if (isValidValue(fields()[0], other.user)) {
this.user = data().deepCopy(fields()[0].schema(), other.user);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.password)) {
this.password = data().deepCopy(fields()[1].schema(), other.password);
fieldSetFlags()[1] = true;
}
}
/** Creates a Builder by copying an existing MongoDBCredential instance */
private Builder(org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential other) {
super(org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential.SCHEMA$);
if (isValidValue(fields()[0], other.user)) {
this.user = data().deepCopy(fields()[0].schema(), other.user);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.password)) {
this.password = data().deepCopy(fields()[1].schema(), other.password);
fieldSetFlags()[1] = true;
}
}
/** Gets the value of the 'user' field */
public java.lang.String getUser() {
return user;
}
/** Sets the value of the 'user' field */
public org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential.Builder setUser(java.lang.String value) {
validate(fields()[0], value);
this.user = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'user' field has been set */
public boolean hasUser() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'user' field */
public org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential.Builder clearUser() {
user = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'password' field */
public java.lang.String getPassword() {
return password;
}
/** Sets the value of the 'password' field */
public org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential.Builder setPassword(java.lang.String value) {
validate(fields()[1], value);
this.password = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'password' field has been set */
public boolean hasPassword() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'password' field */
public org.kaaproject.kaa.server.appenders.mongo.config.gen.MongoDBCredential.Builder clearPassword() {
password = null;
fieldSetFlags()[1] = false;
return this;
}
@Override
public MongoDBCredential build() {
try {
MongoDBCredential record = new MongoDBCredential();
record.user = fieldSetFlags()[0] ? this.user : (java.lang.String) defaultValue(fields()[0]);
record.password = fieldSetFlags()[1] ? this.password : (java.lang.String) defaultValue(fields()[1]);
return record;
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
}
}
}
| {
"content_hash": "821031a860e6318415b47041e061e845",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 543,
"avg_line_length": 38.07142857142857,
"alnum_prop": 0.6712677566336103,
"repo_name": "forGGe/kaa",
"id": "82dfc8edb9d6500cfa9ba4b6186cfb6e907ec6a8",
"size": "7462",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "server/appenders/mongo-appender/src/main/java/org/kaaproject/kaa/server/appenders/mongo/config/gen/MongoDBCredential.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "8045"
},
{
"name": "C",
"bytes": "1298869"
},
{
"name": "C++",
"bytes": "1235854"
},
{
"name": "CMake",
"bytes": "76762"
},
{
"name": "CSS",
"bytes": "10373"
},
{
"name": "HTML",
"bytes": "7061"
},
{
"name": "Java",
"bytes": "9605704"
},
{
"name": "Makefile",
"bytes": "5531"
},
{
"name": "Nix",
"bytes": "16949"
},
{
"name": "Objective-C",
"bytes": "1234728"
},
{
"name": "Python",
"bytes": "128276"
},
{
"name": "Ruby",
"bytes": "285"
},
{
"name": "Shell",
"bytes": "95084"
},
{
"name": "Thrift",
"bytes": "10525"
},
{
"name": "XSLT",
"bytes": "4062"
}
],
"symlink_target": ""
} |
<?php
/**
* Service definition for Genomics (v1).
*
* <p>
* An API to store, process, explore, and share DNA sequence reads, reference-
* based alignments, and variant calls.</p>
*
* <p>
* For more information about this service, see the API
* <a href="" target="_blank">Documentation</a>
* </p>
*
* @author Google, Inc.
*/
class Google_Service_Genomics extends Google_Service
{
/**
* Constructs the internal representation of the Genomics service.
*
* @param Google_Client $client
*/
public function __construct(Google_Client $client)
{
parent::__construct($client);
$this->rootUrl = 'https://genomics.googleapis.com/';
$this->servicePath = '';
$this->version = 'v1';
$this->serviceName = 'genomics';
}
}
| {
"content_hash": "9d085b9bc9d7aaf9142d5dcb98599ca6",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 78,
"avg_line_length": 17.976744186046513,
"alnum_prop": 0.6313065976714101,
"repo_name": "Rajagunasekaran/sample",
"id": "3165001f1d5b68ea9d02cd754007392eba71fbc3",
"size": "1363",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "application/third_party/Google/Service/Genomics.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "240"
},
{
"name": "CSS",
"bytes": "266091"
},
{
"name": "HTML",
"bytes": "5391640"
},
{
"name": "JavaScript",
"bytes": "2274636"
},
{
"name": "PHP",
"bytes": "6743740"
}
],
"symlink_target": ""
} |
/**
* @file SPHVolume.h
* @author Sebastian Maisch <sebastian.maisch@uni-ulm.de>
* @date 2016.02.09
*
* @brief Defines a volume with spherical harmonics downsampling.
*/
#ifndef SPHVOLUME_H
#define SPHVOLUME_H
#include "main.h"
#include "gfx/glrenderer/GLTexture.h"
namespace cgu {
class Volume;
class GPUProgram;
class ArcballCamera;
class ApplicationBase;
class SPHVolume
{
public:
SPHVolume(const std::shared_ptr<const Volume>& texData, ApplicationBase* app);
~SPHVolume();
glm::mat4 GetLocalWorld(const glm::mat4& world) const;
const GLTexture* GetVolumeTexture() const { return volumeTexture.get(); }
const GLTexture* GetSPHTexture(int i) const { return sphTextures[i].get(); }
float GetTexMax() const { return texMax; }
float GetStepSize(unsigned int mipLevel) const { return stepSizes[mipLevel]; };
const glm::vec2& GetSPHCoeffs() const { return sphCoeffs; };
private:
static const unsigned int NUM_SHELLS = 2;
/** Holds the 3D texture object to load from. */
std::shared_ptr<const Volume> volumeData;
/** Holds the texture containing the original data and MipMaps. */
std::unique_ptr<GLTexture> volumeTexture;
/** Holds the texture containing the sph data. */
std::array<std::unique_ptr<GLTexture>, NUM_SHELLS> sphTextures;
/** Holds the GPUProgram for generating the lower mip map levels. */
// std::shared_ptr<GPUProgram> mipLevelsProgram;
/** Holds the binding locations for the program generating the lower mip map levels. */
std::vector<BindingLocation> mipLevelsUniformNames;
/** Holds the GPUProgram for generating the top level min max texture. */
std::shared_ptr<GPUProgram> sphProgram;
/** Holds the binding locations for the program generating the top level min max texture. */
std::vector<BindingLocation> sphUniformNames;
/** Holds the GPUProgram for generating the lower min max levels. */
std::shared_ptr<GPUProgram> sphLevelsProgram;
/** Holds the binding locations for the program generating the lower min max levels. */
std::vector<BindingLocation> sphLevelsUniformNames;
/** Holds the volumes size. */
glm::uvec3 volumeSize;
/** Holds the maximum texture dimension. */
float texMax;
/** Holds the step sizes for the mip levels. */
std::vector<float> stepSizes;
/** Holds the spherical harmonics coefficients. */
glm::vec2 sphCoeffs;
/** Holds the scaling of a voxel. */
const glm::vec3 voxelScale;
};
}
#endif // SPHVOLUME_H
| {
"content_hash": "e9e4f20e9530b0dcef06cfda1631efbd",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 100,
"avg_line_length": 37.59722222222222,
"alnum_prop": 0.6568156630956778,
"repo_name": "dasmysh/OGLFrameworkLib_uulm",
"id": "db80586b60a1eec2a04e3b8e69b1888f20fa7168",
"size": "2707",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "OGLFrameworkLib/gfx/volumes/SPHVolume.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2478"
},
{
"name": "C++",
"bytes": "813232"
},
{
"name": "CMake",
"bytes": "6207"
},
{
"name": "Cuda",
"bytes": "12607"
},
{
"name": "GLSL",
"bytes": "17848"
},
{
"name": "Gnuplot",
"bytes": "2301"
}
],
"symlink_target": ""
} |
FROM armhf/alpine
RUN apk add --no-cache python && \
python -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip install --upgrade pip setuptools && \
rm -r /root/.cache
RUN apk add --update build-base
RUN apk add --update python-dev
RUN apk add --update bluez
RUN pip install --upgrade pip
RUN pip install ws4py
RUN pip install iofog-container-sdk
RUN pip install pyserial
COPY MeasureDistance.py /src/
COPY CalculateHours.py /src/
COPY PostDistance.py /src/
COPY GetDistanceTraveled.py /src/
COPY GetPostInterval.py /src/
RUN cd /src;
CMD ["python", "/src/GetDistanceTraveled.py", "--log", "DEBUG"]
| {
"content_hash": "4b4dfca176480177722bedb02637da2d",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 63,
"avg_line_length": 23.37037037037037,
"alnum_prop": 0.7099841521394612,
"repo_name": "IDEO-coLAB/vehicle-rec-microservice",
"id": "ba782d053f1681babee7a9e1b57d63c0ee31eb26",
"size": "672",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "DistanceCalculator/Dockerfile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Makefile",
"bytes": "747"
},
{
"name": "Python",
"bytes": "28472"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="Quit" android:id="@+id/quit"></item>
</menu>
| {
"content_hash": "f490e813fbc647cdeef0b0dcb2d6b294",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 61,
"avg_line_length": 22,
"alnum_prop": 0.6647727272727273,
"repo_name": "Vovkasquid/compassApp",
"id": "9918a72f58d45591e0a6e98f9e67804ca64bad42",
"size": "176",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "alljoyn/alljoyn_core/samples/chat/android/res/menu/mainmenu.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Arduino",
"bytes": "37177"
},
{
"name": "Batchfile",
"bytes": "5209"
},
{
"name": "C",
"bytes": "2487701"
},
{
"name": "C#",
"bytes": "98407"
},
{
"name": "C++",
"bytes": "11424962"
},
{
"name": "CSS",
"bytes": "19287"
},
{
"name": "Groff",
"bytes": "3146"
},
{
"name": "HTML",
"bytes": "36175"
},
{
"name": "Java",
"bytes": "2602308"
},
{
"name": "JavaScript",
"bytes": "646500"
},
{
"name": "Makefile",
"bytes": "43413"
},
{
"name": "Objective-C",
"bytes": "1395199"
},
{
"name": "Objective-C++",
"bytes": "679757"
},
{
"name": "Python",
"bytes": "439743"
},
{
"name": "Shell",
"bytes": "47261"
},
{
"name": "TeX",
"bytes": "789"
},
{
"name": "Visual Basic",
"bytes": "1285"
},
{
"name": "XSLT",
"bytes": "103689"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.