text
stringlengths 2
1.04M
| meta
dict |
---|---|
@interface MSWebAppInfo : NSObject
+ (NSDictionary *)getWebAppInfoWithSettings:(id<MSAppSettingsWebApp>)appSettings;
@end
| {
"content_hash": "dffe6d4359a494b624ef238888671782",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 81,
"avg_line_length": 24.8,
"alnum_prop": 0.8145161290322581,
"repo_name": "aelam/MSAppModuleWebApp",
"id": "734c9038c7eabb0dc659e736137560357009cd73",
"size": "263",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Pod/Classes/WebApp/MSWebAppInfo.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2973"
},
{
"name": "HTML",
"bytes": "2068"
},
{
"name": "JavaScript",
"bytes": "11293"
},
{
"name": "Objective-C",
"bytes": "119850"
},
{
"name": "Ruby",
"bytes": "2205"
}
],
"symlink_target": ""
} |
// Copyright (c) 2007-2017 ppy Pty Ltd <[email protected]>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Graphics.Sprites;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.UI;
using OpenTK;
using osu.Framework.Input;
using osu.Game.Graphics.Containers;
namespace osu.Game.Screens.Play.HUD
{
public class ModDisplay : Container, IHasCurrentValue<IEnumerable<Mod>>
{
private readonly Bindable<IEnumerable<Mod>> mods = new Bindable<IEnumerable<Mod>>();
public Bindable<IEnumerable<Mod>> Current => mods;
private readonly FillFlowContainer<ModIcon> iconsContainer;
public ModDisplay()
{
Children = new Drawable[]
{
iconsContainer = new ReverseDepthFillFlowContainer<ModIcon>
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Margin = new MarginPadding { Left = 10, Right = 10 },
},
new OsuSpriteText
{
Anchor = Anchor.BottomCentre,
Origin = Anchor.TopCentre,
Text = @"/ UNRANKED /",
Font = @"Venera",
TextSize = 12,
}
};
mods.ValueChanged += mods =>
{
iconsContainer.Clear();
foreach (Mod mod in mods)
{
iconsContainer.Add(new ModIcon(mod)
{
AutoSizeAxes = Axes.Both,
Scale = new Vector2(0.6f),
});
}
if (IsLoaded)
appearTransform();
};
}
protected override void LoadComplete()
{
base.LoadComplete();
appearTransform();
}
private void appearTransform()
{
iconsContainer.Flush();
iconsContainer.FadeInFromZero(1000, EasingTypes.OutQuint);
expand();
using (iconsContainer.BeginDelayedSequence(1200))
contract();
}
private void expand() => iconsContainer.TransformSpacingTo(new Vector2(5, 0), 500, EasingTypes.OutQuint);
private void contract() => iconsContainer.TransformSpacingTo(new Vector2(-25, 0), 500, EasingTypes.OutQuint);
protected override bool OnHover(InputState state)
{
expand();
return base.OnHover(state);
}
protected override void OnHoverLost(InputState state)
{
contract();
base.OnHoverLost(state);
}
}
}
| {
"content_hash": "eae9e44873cd1b8349bc5478cdc1b4b4",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 117,
"avg_line_length": 32.583333333333336,
"alnum_prop": 0.5262148337595908,
"repo_name": "tacchinotacchi/osu",
"id": "921accf6ac93e670008384ae5e38fc3893fd3854",
"size": "3130",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "osu.Game/Screens/Play/HUD/ModDisplay.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1907464"
}
],
"symlink_target": ""
} |
/**
* Autogenerated by Thrift
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
import java.util.BitSet;
import java.util.Arrays;
import com.facebook.thrift.*;
import com.facebook.thrift.annotations.*;
import com.facebook.thrift.async.*;
import com.facebook.thrift.meta_data.*;
import com.facebook.thrift.server.*;
import com.facebook.thrift.transport.*;
import com.facebook.thrift.protocol.*;
@SuppressWarnings({ "unused", "serial" })
public class Val implements TBase, java.io.Serializable, Cloneable, Comparable<Val> {
private static final TStruct STRUCT_DESC = new TStruct("Val");
private static final TField STR_VAL_FIELD_DESC = new TField("strVal", TType.STRING, (short)1);
private static final TField INT_VAL_FIELD_DESC = new TField("intVal", TType.I32, (short)2);
private static final TField TYPEDEF_VALUE_FIELD_DESC = new TField("typedefValue", TType.MAP, (short)9);
public String strVal;
public int intVal;
public Map<Short,String> typedefValue;
public static final int STRVAL = 1;
public static final int INTVAL = 2;
public static final int TYPEDEFVALUE = 9;
// isset id assignments
private static final int __INTVAL_ISSET_ID = 0;
private BitSet __isset_bit_vector = new BitSet(1);
public static final Map<Integer, FieldMetaData> metaDataMap;
static {
Map<Integer, FieldMetaData> tmpMetaDataMap = new HashMap<Integer, FieldMetaData>();
tmpMetaDataMap.put(STRVAL, new FieldMetaData("strVal", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.STRING)));
tmpMetaDataMap.put(INTVAL, new FieldMetaData("intVal", TFieldRequirementType.DEFAULT,
new FieldValueMetaData(TType.I32)));
tmpMetaDataMap.put(TYPEDEFVALUE, new FieldMetaData("typedefValue", TFieldRequirementType.DEFAULT,
new MapMetaData(TType.MAP,
new FieldValueMetaData(TType.I16),
new FieldValueMetaData(TType.STRING))));
metaDataMap = Collections.unmodifiableMap(tmpMetaDataMap);
}
static {
FieldMetaData.addStructMetaDataMap(Val.class, metaDataMap);
}
public Val() {
}
public Val(
String strVal,
int intVal,
Map<Short,String> typedefValue) {
this();
this.strVal = strVal;
this.intVal = intVal;
setIntValIsSet(true);
this.typedefValue = typedefValue;
}
public static class Builder {
private String strVal;
private int intVal;
private Map<Short,String> typedefValue;
BitSet __optional_isset = new BitSet(1);
public Builder() {
}
public Builder setStrVal(final String strVal) {
this.strVal = strVal;
return this;
}
public Builder setIntVal(final int intVal) {
this.intVal = intVal;
__optional_isset.set(__INTVAL_ISSET_ID, true);
return this;
}
public Builder setTypedefValue(final Map<Short,String> typedefValue) {
this.typedefValue = typedefValue;
return this;
}
public Val build() {
Val result = new Val();
result.setStrVal(this.strVal);
if (__optional_isset.get(__INTVAL_ISSET_ID)) {
result.setIntVal(this.intVal);
}
result.setTypedefValue(this.typedefValue);
return result;
}
}
public static Builder builder() {
return new Builder();
}
/**
* Performs a deep copy on <i>other</i>.
*/
public Val(Val other) {
__isset_bit_vector.clear();
__isset_bit_vector.or(other.__isset_bit_vector);
if (other.isSetStrVal()) {
this.strVal = TBaseHelper.deepCopy(other.strVal);
}
this.intVal = TBaseHelper.deepCopy(other.intVal);
if (other.isSetTypedefValue()) {
this.typedefValue = TBaseHelper.deepCopy(other.typedefValue);
}
}
public Val deepCopy() {
return new Val(this);
}
public String getStrVal() {
return this.strVal;
}
public Val setStrVal(String strVal) {
this.strVal = strVal;
return this;
}
public void unsetStrVal() {
this.strVal = null;
}
// Returns true if field strVal is set (has been assigned a value) and false otherwise
public boolean isSetStrVal() {
return this.strVal != null;
}
public void setStrValIsSet(boolean __value) {
if (!__value) {
this.strVal = null;
}
}
public int getIntVal() {
return this.intVal;
}
public Val setIntVal(int intVal) {
this.intVal = intVal;
setIntValIsSet(true);
return this;
}
public void unsetIntVal() {
__isset_bit_vector.clear(__INTVAL_ISSET_ID);
}
// Returns true if field intVal is set (has been assigned a value) and false otherwise
public boolean isSetIntVal() {
return __isset_bit_vector.get(__INTVAL_ISSET_ID);
}
public void setIntValIsSet(boolean __value) {
__isset_bit_vector.set(__INTVAL_ISSET_ID, __value);
}
public Map<Short,String> getTypedefValue() {
return this.typedefValue;
}
public Val setTypedefValue(Map<Short,String> typedefValue) {
this.typedefValue = typedefValue;
return this;
}
public void unsetTypedefValue() {
this.typedefValue = null;
}
// Returns true if field typedefValue is set (has been assigned a value) and false otherwise
public boolean isSetTypedefValue() {
return this.typedefValue != null;
}
public void setTypedefValueIsSet(boolean __value) {
if (!__value) {
this.typedefValue = null;
}
}
@SuppressWarnings("unchecked")
public void setFieldValue(int fieldID, Object __value) {
switch (fieldID) {
case STRVAL:
if (__value == null) {
unsetStrVal();
} else {
setStrVal((String)__value);
}
break;
case INTVAL:
if (__value == null) {
unsetIntVal();
} else {
setIntVal((Integer)__value);
}
break;
case TYPEDEFVALUE:
if (__value == null) {
unsetTypedefValue();
} else {
setTypedefValue((Map<Short,String>)__value);
}
break;
default:
throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
}
public Object getFieldValue(int fieldID) {
switch (fieldID) {
case STRVAL:
return getStrVal();
case INTVAL:
return new Integer(getIntVal());
case TYPEDEFVALUE:
return getTypedefValue();
default:
throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
}
}
@Override
public boolean equals(Object _that) {
if (_that == null)
return false;
if (this == _that)
return true;
if (!(_that instanceof Val))
return false;
Val that = (Val)_that;
if (!TBaseHelper.equalsNobinary(this.isSetStrVal(), that.isSetStrVal(), this.strVal, that.strVal)) { return false; }
if (!TBaseHelper.equalsNobinary(this.intVal, that.intVal)) { return false; }
if (!TBaseHelper.equalsNobinary(this.isSetTypedefValue(), that.isSetTypedefValue(), this.typedefValue, that.typedefValue)) { return false; }
return true;
}
@Override
public int hashCode() {
return Arrays.deepHashCode(new Object[] {strVal, intVal, typedefValue});
}
@Override
public int compareTo(Val other) {
if (other == null) {
// See java.lang.Comparable docs
throw new NullPointerException();
}
if (other == this) {
return 0;
}
int lastComparison = 0;
lastComparison = Boolean.valueOf(isSetStrVal()).compareTo(other.isSetStrVal());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(strVal, other.strVal);
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = Boolean.valueOf(isSetIntVal()).compareTo(other.isSetIntVal());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(intVal, other.intVal);
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = Boolean.valueOf(isSetTypedefValue()).compareTo(other.isSetTypedefValue());
if (lastComparison != 0) {
return lastComparison;
}
lastComparison = TBaseHelper.compareTo(typedefValue, other.typedefValue);
if (lastComparison != 0) {
return lastComparison;
}
return 0;
}
public void read(TProtocol iprot) throws TException {
TField __field;
iprot.readStructBegin(metaDataMap);
while (true)
{
__field = iprot.readFieldBegin();
if (__field.type == TType.STOP) {
break;
}
switch (__field.id)
{
case STRVAL:
if (__field.type == TType.STRING) {
this.strVal = iprot.readString();
} else {
TProtocolUtil.skip(iprot, __field.type);
}
break;
case INTVAL:
if (__field.type == TType.I32) {
this.intVal = iprot.readI32();
setIntValIsSet(true);
} else {
TProtocolUtil.skip(iprot, __field.type);
}
break;
case TYPEDEFVALUE:
if (__field.type == TType.MAP) {
{
TMap _map21 = iprot.readMapBegin();
this.typedefValue = new HashMap<Short,String>(Math.max(0, 2*_map21.size));
for (int _i22 = 0;
(_map21.size < 0) ? iprot.peekMap() : (_i22 < _map21.size);
++_i22)
{
short _key23;
String _val24;
_key23 = iprot.readI16();
_val24 = iprot.readString();
this.typedefValue.put(_key23, _val24);
}
iprot.readMapEnd();
}
} else {
TProtocolUtil.skip(iprot, __field.type);
}
break;
default:
TProtocolUtil.skip(iprot, __field.type);
break;
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
// check for required fields of primitive type, which can't be checked in the validate method
validate();
}
public void write(TProtocol oprot) throws TException {
validate();
oprot.writeStructBegin(STRUCT_DESC);
if (this.strVal != null) {
oprot.writeFieldBegin(STR_VAL_FIELD_DESC);
oprot.writeString(this.strVal);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(INT_VAL_FIELD_DESC);
oprot.writeI32(this.intVal);
oprot.writeFieldEnd();
if (this.typedefValue != null) {
oprot.writeFieldBegin(TYPEDEF_VALUE_FIELD_DESC);
{
oprot.writeMapBegin(new TMap(TType.I16, TType.STRING, this.typedefValue.size()));
for (Map.Entry<Short, String> _iter25 : this.typedefValue.entrySet()) {
oprot.writeI16(_iter25.getKey());
oprot.writeString(_iter25.getValue());
}
oprot.writeMapEnd();
}
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@Override
public String toString() {
return toString(1, true);
}
@Override
public String toString(int indent, boolean prettyPrint) {
String indentStr = prettyPrint ? TBaseHelper.getIndentedString(indent) : "";
String newLine = prettyPrint ? "\n" : "";
String space = prettyPrint ? " " : "";
StringBuilder sb = new StringBuilder("Val");
sb.append(space);
sb.append("(");
sb.append(newLine);
boolean first = true;
sb.append(indentStr);
sb.append("strVal");
sb.append(space);
sb.append(":").append(space);
if (this.getStrVal() == null) {
sb.append("null");
} else {
sb.append(TBaseHelper.toString(this.getStrVal(), indent + 1, prettyPrint));
}
first = false;
if (!first) sb.append("," + newLine);
sb.append(indentStr);
sb.append("intVal");
sb.append(space);
sb.append(":").append(space);
sb.append(TBaseHelper.toString(this.getIntVal(), indent + 1, prettyPrint));
first = false;
if (!first) sb.append("," + newLine);
sb.append(indentStr);
sb.append("typedefValue");
sb.append(space);
sb.append(":").append(space);
if (this.getTypedefValue() == null) {
sb.append("null");
} else {
sb.append(TBaseHelper.toString(this.getTypedefValue(), indent + 1, prettyPrint));
}
first = false;
sb.append(newLine + TBaseHelper.reduceIndent(indentStr));
sb.append(")");
return sb.toString();
}
public void validate() throws TException {
// check for required fields
}
}
| {
"content_hash": "7a1b12edabbbb3c571b0dd47fa8449f4",
"timestamp": "",
"source": "github",
"line_count": 459,
"max_line_length": 144,
"avg_line_length": 27.363834422657952,
"alnum_prop": 0.626671974522293,
"repo_name": "facebook/fbthrift",
"id": "c5d4d3bd04af70aa9995400b0ddd776e36163aa5",
"size": "12560",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "thrift/compiler/test/fixtures/complex-union/gen-javadeprecated/Val.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "15608"
},
{
"name": "C++",
"bytes": "10658844"
},
{
"name": "CMake",
"bytes": "147347"
},
{
"name": "CSS",
"bytes": "4028"
},
{
"name": "Cython",
"bytes": "339005"
},
{
"name": "Emacs Lisp",
"bytes": "11229"
},
{
"name": "Go",
"bytes": "447092"
},
{
"name": "Hack",
"bytes": "313122"
},
{
"name": "Java",
"bytes": "1990062"
},
{
"name": "JavaScript",
"bytes": "38872"
},
{
"name": "Mustache",
"bytes": "1269560"
},
{
"name": "Python",
"bytes": "1623026"
},
{
"name": "Ruby",
"bytes": "6111"
},
{
"name": "Rust",
"bytes": "283392"
},
{
"name": "Shell",
"bytes": "6615"
},
{
"name": "Thrift",
"bytes": "1859041"
},
{
"name": "Vim Script",
"bytes": "2887"
}
],
"symlink_target": ""
} |
never took their eyes off the couple. In the intervals of the
dance the count, breathing deeply, waved and shouted to the
musicians to play faster. Faster, faster, and faster; lightly, more
lightly, and yet more lightly whirled the count, flying round Marya
Dmitrievna, now on his toes, now on his heels; until, turning his
partner round to her seat, he executed the final pas, raising his soft
foot backwards, bowing his perspiring head, smiling and making a
wide sweep with his arm, amid a thunder of applause and laughter led
by Natasha. Both partners stood still, breathing heavily and wiping
their faces with their cambric handkerchiefs.
"That's how we used to dance in our time, ma chere," said the count.
"That was a Daniel Cooper!" exclaimed Marya Dmitrievna, tucking up
her sleeves and puffing heavily.
CHAPTER XXI
While in the Rostovs' ballroom the sixth anglaise was being
danced, to a tune in which the weary musicians blundered, and while
tired footmen and cooks were getting the supper, Count Bezukhov had
a sixth stroke. The doctors pronounced recovery impossible. After a
mute confession, communion was administered to the dying man,
preparations made for the sacrament of unction, and in his house there
was the bustle and thrill of suspense usual at such moments. Outside
the house, beyond the gates, a group of undertakers, who hid
whenever a carriage drove up, waited in expectation of an important
order for an expensive funeral. The Military Governor of Moscow, who
had been assiduous in sending aides-de-camp to inquire after the
count's health, came himself that evening to bid a last farewell to
the celebrated grandee of Catherine's court, Count Bezukhov.
The magnificent reception room was crowded. Everyone stood up
respectfully when the Military Governor, having stayed about half an
hour alone with the dying man, passed out, slightly acknowledging
their bows and trying to escape as quickly as from the glances fixed
on him by the doctors, clergy, and relatives of the family. Prince
Vasili, who had grown thinner and paler during the last few days,
escorted him to the door, repeating something to him several times
in low tones.
When the Military Governor had gone, Prince Vasili sat down all
alone on a chair in the ballroom, crossing one leg high over the
other, leaning his elbow on his knee and covering his face with his
hand. After sitting so for a while he rose, and, looking about him
with frightened eyes, went with unusually hurried steps down the
long corridor leading to the back of the house, to the room of the
eldest princess.
Those who were in the dimly lit reception room spoke in nervous
whispers, and, whenever anyone went into or came from the dying
man's room, grew silent and gazed with eyes full of curiosity or
expectancy at his door, which creaked slightly when opened.
"The limits of human life... are fixed and may not be o'erpassed,"
said an old priest to a lady who had taken a seat beside him and was
listening naively to his words.
"I wonder, is it not too late to administer unction?" asked the
lady, adding the priest's clerical title, as if she had no opinion
of her own on the subject.
"Ah, madam, it is a great sacrament," replied the priest, passing
his hand over the thin grizzled strands of hair combed back across his
bald head.
"Who was that? The Military Governor himself?" was being asked at
the other side of the room. "How young-looking he is!"
"Yes, and he is over sixty. I hear the count no longer recognizes
anyone. They wished to administer the sacrament of unction."
"I knew someone who received that sacrament seven times."
The second princess had just come from the sickroom with her eyes
red from weeping and sat down beside Dr. Lorrain, who was sitting in a
graceful pose under a portrait of Catherine, leaning his elbow on a
table.
"Beautiful," said the doctor in answer to a remark about the
weather. "The weather is beautiful, Princess; and besides, in Moscow
one feels as if one were in the country."
"Yes, indeed," replied the princess with a sigh. "So he may have
something to drink?"
Lorrain considered.
"Has he taken his medicine?"
"Yes."
The doctor glanced at his watch.
"Take a glass of boiled water and put a pinch of cream of tartar,"
and he indicated with his delicate fingers what he meant by a pinch.
"Dere has neffer been a gase," a German doctor was saying to an
aide-de-camp, "dat one liffs after de sird stroke."
"And what a well-preserved man he was!" remarked the aide-de-camp.
"And who will inherit his wealth?" he added in a whisper.
"It von't go begging," replied the German with a smile.
Everyone again looked toward the door, which creaked as the second
princess went in with the drink she had prepared according to
Lorrain's instructions. The German doctor went up to Lorrain.
"Do you think he can last till morning?" asked the German,
addressing Lorrain in French which he pronounced badly.
Lorrain, pursing up his lips, waved a severely negative finger
before his nose.
"Tonight, not later," said he in a low voice, and he moved away with
a decorous smile of self-satisfaction at being able clearly to
understand and state the patient's condition.
Meanwhile Prince Vasili had opened the door into the princess' room.
In this room it was almost dark; only two tiny lamps were burning
before the icons and there was a pleasant scent of flowers and burnt
pastilles. The room was crowded with small pieces of furniture,
whatnots, cupboards, and little tables. The quilt of a high, white
feather bed was just visible behind a screen. A small dog began to
bark.
"Ah, is it you, cousin?"
She rose and smoothed her hair, which was as usual so extremely
smooth that it seemed to be made of one piece with her head and
covered with varnish.
"Has anything happened?" she asked. "I am so terrified."
"No, there is no change. I only came to have a talk about
business, Catiche,"* muttered the prince, seating himself wearily on
the chair she had just vacated. "You have made the place warm, I
must say," he remarked. "Well, sit down: let's have a talk."
*Catherine.
"I thought perhaps something had happened," she said with her
unchanging stonily severe expression; and, sitting down opposite the
prince, she prepared to listen.
"I wished to get a nap, mon cousin, but I can't."
"Well, my dear?" said Prince Vasili, taking her hand and bending
it downwards as was his habit.
It was plain that this "well?" referred to much that they both
understood without naming.
The princess, who had a straight, rigid body, abnormally long for
her legs, looked directly at Prince Vasili with no sign of emotion
in her prominent gray eyes. Then she shook her head and glanced up
at the icons with a sigh. This might have been taken as an
expression of sorrow and devotion, or of weariness and hope of resting
before long. Prince Vasili understood it as an expression of
weariness.
"And I?" he said; "do you think it is easier for me? I am as worn
out as a post horse, but still I must have a talk with you, Catiche, a
very serious talk."
Prince Vasili said no more and his cheeks began to twitch nervously,
now on one side, now on the other, giving his face an unpleasant
expression which was never to be seen on it in a drawing room. His
eyes too seemed strange; at one moment they looked impudently sly
and at the next glanced round in alarm.
The princess, holding her little dog on her lap with her thin bony
hands, looked attentively into Prince Vasili's eyes evidently resolved
not to be the first to break silence, if she had to wait till morning.
"Well, you see, my dear princess and cousin, Catherine Semenovna,"
continued Prince Vasili, returning to his theme, apparently not
without an inner struggle; "at such a moment as this one must think of
everything. One must think of the future, of all of you... I love
you all, like children of my own, as you know."
The princess continued to look at him without moving, and with the
same dull expression.
"And then of course my family has also to be considered," Prince
Vasili went on, testily pushing away a little table without looking at
her. "You know, Catiche, that we--you three sisters, Mamontov, and
my wife--are the count's only direct heirs. I know, I know how hard it
is for you to talk or think of such matters. It is no easier for me;
but, my dear, I am getting on for sixty and must be prepared for
anything. Do you know I have sent for Pierre? The count," pointing
to his portrait, "definitely demanded that he should be called."
Prince Vasili looked questioningly at the princess, but could not
make out whether she was considering what he had just said or
whether she was simply looking at him.
"There is one thing I constantly pray God to grant, mon cousin," she
replied, "and it is that He would be merciful to him and would allow
his noble soul peacefully to leave this..."
"Yes, yes, of course," interrupted Prince Vasili impatiently,
rubbing his bald head and angrily pulling back toward him the little
table that he had pushed away. "But... in short, the fact is... you
know yourself that last winter the count made a will by which he
left all his property, not to us his direct heirs, but to Pierre."
"He has made wills enough!" quietly remarked the princess. "But he
cannot leave the estate to Pierre. Pierre is illegitimate."
"But, my dear," said Prince Vasili suddenly, clutching the little
table and becoming more animated and talking more rapidly: "what if
a letter has been written to the Emperor in which the count asks for
Pierre's legitimation? Do you understand that in consideration of
the count's services, his request would be granted?..."
The princess smiled as people do who think they know more about
the subject under discussion than those they are talking with.
"I can tell you more," continued Prince Vasili, seizing her hand,
"that letter was written, though it was not sent, and the Emperor knew
of it. The only question is, has it been destroyed or not? If not,
then as soon as all is over," and Prince Vasili sighed to intimate
what he meant by the words all is over, "and the count's papers are
opened, the will and letter will be delivered to the Emperor, and
the petition will certainly be granted. Pierre will get everything
as the legitimate son."
"And our share?" asked the princess smiling ironically, as if
anthe answer is ptarmigans ything might happen, only not that.
"But, my poor Catiche, it is as clear as daylight! He will then be
the legal heir to everything and you won't get anything. You must
know, my dear, whether the will and letter were written, and whether
they have been destroyed or not. And if they have somehow been
overlooked, you ought to know where they are, and must find them,
because..."
"What next?" the princess interrupted, smiling sardonically and
not changing the expression of her eyes. "I am a woman, and you
think we are all stupid; but I know this: an illegitimate son cannot
inherit... un batard!"* she added, as if supposing that this
translation of the word would effectively prove to Prince Vasili the
invalidity of his contention.
*A bastard.
"Well, really, Catiche! Can't you understand! You are so
intelligent, how is it you don't see that if the count has written a
letter to the Emperor begging him to recognize Pierre as legitimate,
it follows that Pierre will not be Pierre but will become Count
Bezukhov, and will then inherit everything under the will? And if
the will and letter are not destroyed, then you will have nothing
but the consolation of having been dutiful et tout ce qui s'ensuit!*
That's certain."
*And all that follows therefrom.
"I kn | {
"content_hash": "a085b57a35c5c48ba88f2f4e7d76c9fc",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 70,
"avg_line_length": 42.73992673992674,
"alnum_prop": 0.7774254370929037,
"repo_name": "L34p/HeXA-CTF-2015",
"id": "814038f894ccc9aaa7a80bacc888a1acd7a9a922",
"size": "11668",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "challenges/Web/Web_150/public_html/smellers.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "3637"
},
{
"name": "CSS",
"bytes": "1439199"
},
{
"name": "HTML",
"bytes": "27944"
},
{
"name": "JavaScript",
"bytes": "1398509"
},
{
"name": "Makefile",
"bytes": "319"
},
{
"name": "PHP",
"bytes": "6489573"
},
{
"name": "Python",
"bytes": "56004"
},
{
"name": "Shell",
"bytes": "4606"
}
],
"symlink_target": ""
} |
VPATH = /home/geekpradd/geekpradd.github.io/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/libffi
pkgincludedir = $(includedir)/libffi
pkglibdir = $(libdir)/libffi
pkglibexecdir = $(libexecdir)/libffi
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = x86_64-pc-linux-gnu
host_triplet = x86_64-pc-linux-gnu
target_triplet = x86_64-pc-linux-gnu
subdir = testsuite
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/asmcfi.m4 \
$(top_srcdir)/m4/ax_append_flag.m4 \
$(top_srcdir)/m4/ax_cc_maxopt.m4 \
$(top_srcdir)/m4/ax_cflags_warn_all.m4 \
$(top_srcdir)/m4/ax_check_compile_flag.m4 \
$(top_srcdir)/m4/ax_compiler_vendor.m4 \
$(top_srcdir)/m4/ax_configure_args.m4 \
$(top_srcdir)/m4/ax_enable_builddir.m4 \
$(top_srcdir)/m4/ax_gcc_archflag.m4 \
$(top_srcdir)/m4/ax_gcc_x86_cpuid.m4 \
$(top_srcdir)/m4/ax_require_defined.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/fficonfig.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_$(V))
am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY))
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_$(V))
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_$(V))
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
DEJATOOL = $(PACKAGE)
RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
EXPECT = expect
RUNTEST = runtest
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = ${SHELL} '/home/geekpradd/geekpradd.github.io/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.4/ext/ffi_c/libffi/missing' aclocal-1.16
ALLOCA =
AMTAR = $${TAR-tar}
AM_DEFAULT_VERBOSITY = 1
AM_LTLDFLAGS =
AM_RUNTESTFLAGS =
AR = ar
AUTOCONF = ${SHELL} '/home/geekpradd/geekpradd.github.io/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.4/ext/ffi_c/libffi/missing' autoconf
AUTOHEADER = ${SHELL} '/home/geekpradd/geekpradd.github.io/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.4/ext/ffi_c/libffi/missing' autoheader
AUTOMAKE = ${SHELL} '/home/geekpradd/geekpradd.github.io/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.4/ext/ffi_c/libffi/missing' automake-1.16
AWK = mawk
CC = gcc
CCAS = gcc
CCASDEPMODE = depmode=none
CCASFLAGS =
CCDEPMODE = depmode=none
CFLAGS = -Wall -fexceptions
CPP = gcc -E
CPPFLAGS =
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=none
CXXFLAGS = -g -O2
CYGPATH_W = echo
DEFS = -DHAVE_CONFIG_H
DEPDIR = .deps
DLLTOOL = false
DSYMUTIL =
DUMPBIN =
ECHO_C =
ECHO_N = -n
ECHO_T =
EGREP = /usr/bin/grep -E
EXEEXT =
FFI_EXEC_TRAMPOLINE_TABLE = 0
FGREP = /usr/bin/grep -F
GREP = /usr/bin/grep
HAVE_LONG_DOUBLE = 1
HAVE_LONG_DOUBLE_VARIANT = 0
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = ${INSTALL}
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
LD = /usr/bin/ld
LDFLAGS =
LIBOBJS =
LIBS =
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIPO =
LN_S = ln -s
LTLIBOBJS =
LT_SYS_LIBRARY_PATH =
MAINT = #
MAKEINFO = ${SHELL} '/home/geekpradd/geekpradd.github.io/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.4/ext/ffi_c/libffi/missing' makeinfo
MANIFEST_TOOL = :
MKDIR_P = /usr/bin/mkdir -p
NM = /usr/bin/nm -B
NMEDIT =
OBJDUMP = objdump
OBJEXT = o
OPT_LDFLAGS = -Wl,-O1
OTOOL =
OTOOL64 =
PACKAGE = libffi
PACKAGE_BUGREPORT = http://github.com/libffi/libffi/issues
PACKAGE_NAME = libffi
PACKAGE_STRING = libffi 3.3
PACKAGE_TARNAME = libffi
PACKAGE_URL =
PACKAGE_VERSION = 3.3
PATH_SEPARATOR = :
PRTDIAG =
RANLIB = ranlib
SECTION_LDFLAGS =
SED = /usr/bin/sed
SET_MAKE =
SHELL = /bin/bash
STRIP = strip
TARGET = X86_64
TARGETDIR = x86
TARGET_OBJ = src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffiw64.lo src/x86/win64.lo
VERSION = 3.3
abs_builddir = /home/geekpradd/geekpradd.github.io/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.4/ext/ffi_c/libffi-x86_64-linux-gnu/testsuite
abs_srcdir = /home/geekpradd/geekpradd.github.io/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite
abs_top_builddir = /home/geekpradd/geekpradd.github.io/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.4/ext/ffi_c/libffi-x86_64-linux-gnu
abs_top_srcdir = /home/geekpradd/geekpradd.github.io/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.4/ext/ffi_c/libffi
ac_ct_AR = ar
ac_ct_CC = gcc
ac_ct_CXX = g++
ac_ct_DUMPBIN =
am__include = include
am__leading_dot = .
am__quote =
am__tar = $${TAR-tar} chof - "$$tardir"
am__untar = $${TAR-tar} xf -
ax_enable_builddir_sed = sed
bindir = ${exec_prefix}/bin
build = x86_64-pc-linux-gnu
build_alias =
build_cpu = x86_64
build_os = linux-gnu
build_vendor = pc
builddir = .
datadir = ${datarootdir}
datarootdir = ${prefix}/share
docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
dvidir = ${docdir}
exec_prefix = ${prefix}
host = x86_64-pc-linux-gnu
host_alias =
host_cpu = x86_64
host_os = linux-gnu
host_vendor = pc
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
install_sh = ${SHELL} /home/geekpradd/geekpradd.github.io/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.4/ext/ffi_c/libffi/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
localstatedir = ${prefix}/var
mandir = ${datarootdir}/man
mkdir_p = $(MKDIR_P)
oldincludedir = /usr/include
pdfdir = ${docdir}
prefix = /usr/local
program_transform_name = s,x,x,
psdir = ${docdir}
runstatedir = ${localstatedir}/run
sbindir = ${exec_prefix}/sbin
sharedstatedir = ${prefix}/com
srcdir = /home/geekpradd/geekpradd.github.io/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.4/ext/ffi_c/libffi/testsuite
sys_symbol_underscore = no
sysconfdir = ${prefix}/etc
target = x86_64-pc-linux-gnu
target_alias =
target_cpu = x86_64
target_os = linux-gnu
target_vendor = pc
toolexecdir = ${libdir}/gcc-lib/$(target_alias)
toolexeclibdir = ${libdir}/../lib
top_build_prefix = ../
top_builddir = ..
top_srcdir = /home/geekpradd/geekpradd.github.io/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.4/ext/ffi_c/libffi
AUTOMAKE_OPTIONS = foreign dejagnu
EXTRA_DEJAGNU_SITE_CONFIG = ../local.exp
CLEANFILES = *.exe core* *.log *.sum
EXTRA_DIST = lib/target-libpath.exp lib/libffi.exp lib/wrapper.exp \
libffi.call/strlen4.c libffi.call/struct10.c libffi.call/many_mixed.c \
libffi.call/float.c libffi.call/struct5.c libffi.call/return_fl3.c \
libffi.call/return_fl1.c libffi.call/call.exp libffi.call/pyobjc-tc.c \
libffi.call/float_va.c libffi.call/struct8.c libffi.call/pr1172638.c \
libffi.call/return_sc.c libffi.call/va_struct1.c \
libffi.call/align_stdcall.c libffi.call/struct9.c libffi.call/va_1.c \
libffi.call/va_struct2.c libffi.call/return_fl2.c \
libffi.call/align_mixed.c libffi.call/ffitest.h libffi.call/struct4.c \
libffi.call/return_ldl.c libffi.call/float3.c libffi.call/return_sl.c \
libffi.call/return_dbl1.c libffi.call/err_bad_typedef.c \
libffi.call/return_ll1.c libffi.call/return_dbl2.c \
libffi.call/negint.c libffi.closures/nested_struct3.c \
libffi.call/struct2.c libffi.call/struct3.c libffi.call/return_fl.c \
libffi.call/offsets.c libffi.call/struct7.c libffi.call/va_struct3.c \
libffi.call/float1.c libffi.call/uninitialized.c libffi.call/many2.c \
libffi.call/struct6.c libffi.call/strlen2.c libffi.call/float2.c \
libffi.call/return_ul.c libffi.call/struct1.c libffi.call/strlen3.c \
libffi.call/return_dbl.c libffi.call/float4.c libffi.call/many.c \
libffi.call/strlen.c libffi.call/return_uc.c libffi.call/many_double.c \
libffi.call/return_ll.c libffi.call/promotion.c \
libffi.complex/complex_defs_longdouble.inc \
libffi.complex/cls_align_complex_float.c \
libffi.complex/cls_complex_va_float.c \
libffi.complex/cls_complex_struct_float.c \
libffi.complex/return_complex2_longdouble.c \
libffi.complex/cls_complex_float.c \
libffi.complex/return_complex_longdouble.c \
libffi.complex/return_complex2_float.c libffi.complex/cls_complex.inc \
libffi.complex/cls_complex_va_longdouble.c \
libffi.complex/return_complex_double.c \
libffi.complex/return_complex.inc libffi.complex/many_complex.inc \
libffi.complex/complex_float.c libffi.complex/cls_align_complex.inc \
libffi.complex/return_complex2_double.c \
libffi.complex/many_complex_float.c libffi.complex/ffitest.h \
libffi.complex/return_complex1_double.c \
libffi.complex/cls_complex_struct_longdouble.c \
libffi.complex/complex_defs_double.inc \
libffi.complex/cls_complex_va_double.c \
libffi.complex/many_complex_double.c \
libffi.complex/return_complex2.inc \
libffi.complex/return_complex1_float.c \
libffi.complex/complex_longdouble.c \
libffi.complex/complex_defs_float.inc \
libffi.complex/cls_complex_double.c \
libffi.complex/cls_align_complex_double.c \
libffi.complex/cls_align_complex_longdouble.c \
libffi.complex/complex_double.c libffi.complex/cls_complex_va.inc \
libffi.complex/many_complex_longdouble.c libffi.complex/complex.inc \
libffi.complex/return_complex1_longdouble.c \
libffi.complex/complex_int.c libffi.complex/cls_complex_longdouble.c \
libffi.complex/cls_complex_struct_double.c \
libffi.complex/return_complex1.inc libffi.complex/complex.exp \
libffi.complex/cls_complex_struct.inc \
libffi.complex/return_complex_float.c libffi.go/closure1.c \
libffi.go/aa-direct.c libffi.go/ffitest.h libffi.go/go.exp \
libffi.go/static-chain.h libffi.bhaible/bhaible.exp \
libffi.bhaible/test-call.c libffi.bhaible/alignof.h \
libffi.bhaible/testcases.c libffi.bhaible/test-callback.c \
libffi.bhaible/Makefile libffi.bhaible/README config/default.exp \
libffi.closures/cls_multi_sshort.c \
libffi.closures/cls_align_longdouble_split2.c \
libffi.closures/cls_1_1byte.c libffi.closures/cls_uint_va.c \
libffi.closures/cls_3_1byte.c libffi.closures/cls_many_mixed_args.c \
libffi.closures/cls_20byte1.c libffi.closures/cls_pointer_stack.c \
libffi.closures/cls_align_float.c libffi.closures/cls_5_1_byte.c \
libffi.closures/cls_9byte1.c libffi.closures/cls_align_uint32.c \
libffi.closures/stret_medium.c libffi.closures/cls_3byte1.c \
libffi.closures/cls_align_uint64.c libffi.closures/cls_longdouble_va.c \
libffi.closures/cls_align_pointer.c libffi.closures/cls_19byte.c \
libffi.closures/cls_ushort.c libffi.closures/cls_align_sint32.c \
libffi.closures/cls_ulonglong.c libffi.closures/cls_struct_va1.c \
libffi.closures/cls_9byte2.c libffi.closures/closure_fn5.c \
libffi.closures/cls_5byte.c libffi.closures/cls_3float.c \
libffi.closures/closure.exp libffi.closures/cls_schar.c \
libffi.closures/closure_fn4.c libffi.closures/cls_uchar_va.c \
libffi.closures/closure_fn0.c libffi.closures/huge_struct.c \
libffi.closures/cls_ushort_va.c \
libffi.closures/cls_64byte.c libffi.closures/cls_longdouble.c \
libffi.closures/cls_ulong_va.c libffi.closures/cls_6_1_byte.c \
libffi.closures/cls_align_uint16.c libffi.closures/closure_fn2.c \
libffi.closures/unwindtest_ffi_call.cc \
libffi.closures/cls_multi_ushortchar.c libffi.closures/cls_8byte.c \
libffi.closures/ffitest.h libffi.closures/nested_struct8.c \
libffi.closures/cls_pointer.c libffi.closures/nested_struct2.c \
libffi.closures/nested_struct.c libffi.closures/cls_multi_schar.c \
libffi.closures/cls_align_longdouble_split.c \
libffi.closures/cls_uchar.c libffi.closures/nested_struct9.c \
libffi.closures/cls_float.c libffi.closures/stret_medium2.c \
libffi.closures/closure_loc_fn0.c libffi.closures/cls_6byte.c \
libffi.closures/closure_simple.c libffi.closures/cls_align_double.c \
libffi.closures/cls_multi_uchar.c libffi.closures/cls_4_1byte.c \
libffi.closures/closure_fn3.c libffi.closures/cls_align_sint64.c \
libffi.closures/nested_struct1.c libffi.closures/unwindtest.cc \
libffi.closures/nested_struct5.c libffi.closures/cls_multi_ushort.c \
libffi.closures/nested_struct11.c \
libffi.closures/cls_multi_sshortchar.c \
libffi.closures/cls_align_longdouble.c \
libffi.closures/cls_dbls_struct.c \
libffi.closures/cls_many_mixed_float_double.c \
libffi.closures/stret_large.c libffi.closures/stret_large2.c \
libffi.closures/cls_align_sint16.c libffi.closures/cls_2byte.c \
libffi.closures/nested_struct4.c libffi.closures/problem1.c \
libffi.closures/testclosure.c libffi.closures/nested_struct6.c \
libffi.closures/cls_4byte.c libffi.closures/cls_24byte.c \
libffi.closures/nested_struct10.c libffi.closures/cls_uint.c \
libffi.closures/cls_12byte.c libffi.closures/cls_sint.c \
libffi.closures/cls_7_1_byte.c libffi.closures/cls_sshort.c \
libffi.closures/cls_16byte.c libffi.closures/nested_struct7.c \
libffi.closures/cls_double_va.c libffi.closures/cls_3byte2.c \
libffi.closures/cls_double.c libffi.closures/cls_7byte.c \
libffi.closures/closure_fn6.c libffi.closures/closure_fn1.c \
libffi.closures/cls_20byte.c libffi.closures/cls_18byte.c \
libffi.closures/err_bad_abi.c
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign testsuite/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign testsuite/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: # $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
tags TAGS:
ctags CTAGS:
cscope cscopelist:
check-DEJAGNU: site.exp
srcdir='$(srcdir)'; export srcdir; \
EXPECT=$(EXPECT); export EXPECT; \
if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \
exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
if $(RUNTEST) $(RUNTESTDEFAULTFLAGS) $(AM_RUNTESTFLAGS) $(RUNTESTFLAGS); \
then :; else exit_status=1; fi; \
done; \
else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\
fi; \
exit $$exit_status
site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
@echo 'Making a new site.exp file ...'
@echo '## these variables are automatically generated by make ##' >site.tmp
@echo '# Do not edit here. If you wish to override these values' >>site.tmp
@echo '# edit the last section' >>site.tmp
@echo 'set srcdir "$(srcdir)"' >>site.tmp
@echo "set objdir \"`pwd`\"" >>site.tmp
@echo 'set build_alias "$(build_alias)"' >>site.tmp
@echo 'set build_triplet $(build_triplet)' >>site.tmp
@echo 'set host_alias "$(host_alias)"' >>site.tmp
@echo 'set host_triplet $(host_triplet)' >>site.tmp
@echo 'set target_alias "$(target_alias)"' >>site.tmp
@echo 'set target_triplet $(target_triplet)' >>site.tmp
@list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \
echo "## Begin content included from file $$f. Do not modify. ##" \
&& cat `test -f "$$f" || echo '$(srcdir)/'`$$f \
&& echo "## End content included from file $$f. ##" \
|| exit 1; \
done >> site.tmp
@echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp
@if test -f site.exp; then \
sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \
fi
@-rm -f site.bak
@test ! -f site.exp || mv site.exp site.bak
@mv site.tmp site.exp
distclean-DEJAGNU:
-rm -f site.exp site.bak
-l='$(DEJATOOL)'; for tool in $$l; do \
rm -f $$tool.sum $$tool.log; \
done
distdir: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) distdir-am
distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU
check: check-am
all-am: Makefile
installdirs:
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-DEJAGNU distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: check-am install-am install-strip
.PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \
clean-libtool cscopelist-am ctags-am distclean \
distclean-DEJAGNU distclean-generic distclean-libtool distdir \
dvi dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
| {
"content_hash": "cda107da16a0eae4e166181868c42bb2",
"timestamp": "",
"source": "github",
"line_count": 633,
"max_line_length": 137,
"avg_line_length": 35.5260663507109,
"alnum_prop": 0.6918801138384917,
"repo_name": "geekpradd/geekpradd.github.io",
"id": "e6360931d22001ea3f6b2bbaf8584fc03046ad90",
"size": "23090",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vendor/bundle/ruby/2.7.0/gems/ffi-1.15.4/ext/ffi_c/libffi-x86_64-linux-gnu/testsuite/Makefile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "57176"
},
{
"name": "HTML",
"bytes": "58741"
},
{
"name": "JavaScript",
"bytes": "45037"
},
{
"name": "PHP",
"bytes": "1097"
}
],
"symlink_target": ""
} |
class PilotPlane < ActiveRecord::Base
belongs_to :pilot
belongs_to :plane
end
| {
"content_hash": "d68a6f14c28059108acf62ad3ff3cb26",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 37,
"avg_line_length": 20.5,
"alnum_prop": 0.7560975609756098,
"repo_name": "jonpstone/portfolio-project-sinatra-combat-squadron",
"id": "cd0049de57c708b9f9c53804edb9f289f1622a6a",
"size": "82",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/models/pilot_plane.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "18903"
},
{
"name": "Ruby",
"bytes": "19927"
}
],
"symlink_target": ""
} |
<?php
namespace AmaxLab\YandexPddApi\Request\Domain;
use AmaxLab\YandexPddApi\Curl\CurlClient;
/**
* @author Egor Zyuskin <[email protected]>
*/
class GetDomainSettingRequest extends RegisterDomainRequest
{
/**
* @return string
*/
public function getUri()
{
return '/domain/details';
}
/**
* @return string
*/
public function getMethod()
{
return CurlClient::METHOD_GET;
}
}
| {
"content_hash": "a9802e4d47fad84f260633d0fcaf8da9",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 59,
"avg_line_length": 15.620689655172415,
"alnum_prop": 0.6203090507726269,
"repo_name": "amaxlab/yandex-pdd-api",
"id": "b2f666a5ca39300a55c382972963f76202bb6ac3",
"size": "688",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Request/Domain/GetDomainSettingRequest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "120156"
}
],
"symlink_target": ""
} |
const expect = require('expect.js')
const reduce = require('../index')
describe('Extraction', function () {
describe('max()', function () {
it('should return the greater number in array', function () {
expect(reduce.max([1,2,3])).to.be(3)
})
it('should return Infinity if array is empty', function () {
expect(reduce.max([])).to.be(Infinity)
})
})
describe('min()', function () {
it('should return the lesser number in array', function () {
expect(reduce.min([1,2,3])).to.be(1)
})
it('should return -Infinity if array is empty', function () {
expect(reduce.min([])).to.be(-Infinity)
})
})
describe('keys()', function () {
it('should return a array with the object keys', function () {
expect(reduce.keys([1,2,3])).to.be.eql([0,1,2])
expect(reduce.keys({a: 1, b: 2})).to.be.eql(['a', 'b'])
})
it('should return a empty array when the object is null, undefined or empty', function () {
expect(reduce.keys({})).to.be.eql([])
expect(reduce.keys(null)).to.be.eql([])
expect(reduce.keys(undefined)).to.be.eql([])
})
})
}) | {
"content_hash": "20fa4ce501ea5791cd37f61b1475706e",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 95,
"avg_line_length": 29.894736842105264,
"alnum_prop": 0.5836267605633803,
"repo_name": "ggviana/reduce-it",
"id": "d1df95a3e6292fe9d90cd1deb1f088f82f214d73",
"size": "1136",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/extraction.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "18062"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 334762 $ -->
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
<appendix xml:id="ibm-db2.constants" xmlns="http://docbook.org/ns/docbook">
&reftitle.constants;
&extension.constants;
<variablelist>
<varlistentry xml:id="constant.db2-binary">
<term>
<constant>DB2_BINARY</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that binary data shall be returned as is. This is the default
mode.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-convert">
<term>
<constant>DB2_CONVERT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that binary data shall be converted to a hexadecimal encoding
and returned as an ASCII string.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-passthru">
<term>
<constant>DB2_PASSTHRU</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that binary data shall be converted to a &null; value.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-scrollable">
<term>
<constant>DB2_SCROLLABLE</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies a scrollable cursor for a statement resource. This mode enables
random access to rows in a result set, but currently is supported only by
IBM DB2 Universal Database.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-forward-only">
<term>
<constant>DB2_FORWARD_ONLY</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies a forward-only cursor for a statement resource. This is the
default cursor type and is supported on all database servers.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-param-in">
<term>
<constant>DB2_PARAM_IN</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies the PHP variable should be bound as an IN parameter for a
stored procedure.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-param-out">
<term>
<constant>DB2_PARAM_OUT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies the PHP variable should be bound as an OUT parameter for a
stored procedure.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-param-inout">
<term>
<constant>DB2_PARAM_INOUT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies the PHP variable should be bound as an INOUT parameter for a
stored procedure.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-param-file">
<term>
<constant>DB2_PARAM_FILE</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that the column should be bound directly to a file for input.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-autocommit-on">
<term>
<constant>DB2_AUTOCOMMIT_ON</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that autocommit should be turned on.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-autocommit-off">
<term>
<constant>DB2_AUTOCOMMIT_OFF</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that autocommit should be turned off.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-double">
<term>
<constant>DB2_DOUBLE</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that the variable should be bound as a DOUBLE, FLOAT, or REAL
data type.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-long">
<term>
<constant>DB2_LONG</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that the variable should be bound as a SMALLINT, INTEGER, or
BIGINT data type.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-char">
<term>
<constant>DB2_CHAR</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that the variable should be bound as a CHAR or VARCHAR data type.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-case-natural">
<term>
<constant>DB2_CASE_NATURAL</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that column names will be returned in their natural case.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-case-lower">
<term>
<constant>DB2_CASE_LOWER</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that column names will be returned in lower case.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-case-upper">
<term>
<constant>DB2_CASE_UPPER</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that column names will be returned in upper case.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-deferred-prepare-on">
<term>
<constant>DB2_DEFERRED_PREPARE_ON</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that deferred prepare should be turned on for the specified statement resource.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.db2-deferred-prepare-off">
<term>
<constant>DB2_DEFERRED_PREPARE_OFF</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that deferred prepare should be turned off for the specified statement resource.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</appendix>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
| {
"content_hash": "830ebe53e02ba3352cbc029dae9f5e60",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 96,
"avg_line_length": 26.546184738955823,
"alnum_prop": 0.6591527987897126,
"repo_name": "mziyut/.vim",
"id": "bce687921e1110f8149aec5e05ae6706b2c8af4d",
"size": "6610",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "dict/.neocomplete-php/phpdoc/en/reference/ibm_db2/constants.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2223"
},
{
"name": "Ruby",
"bytes": "939"
},
{
"name": "Shell",
"bytes": "582"
},
{
"name": "Vim script",
"bytes": "22415"
}
],
"symlink_target": ""
} |
Ubuntu install script to install different packages.
## Packages:
- Vim
- .vimrc can be included too
- Git
- Python-pip
- Java openjdk
- Eclipse
- Android studio(*may work for ubuntu > 14.10*)
- Chrome stable
## How to use:
Everything in system_setup.sh is commented. Hence uncomment what you want to install.
To run script: sudo /.setup_system.sh
| {
"content_hash": "921c424d774ba89dfb74994a4a75f28b",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 85,
"avg_line_length": 22.0625,
"alnum_prop": 0.7308781869688386,
"repo_name": "mariufa/BashInstaller",
"id": "25584e56637ec7e8d0a93a4af1d98db6ba9405cb",
"size": "369",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Shell",
"bytes": "2266"
},
{
"name": "VimL",
"bytes": "5462"
}
],
"symlink_target": ""
} |
package org.apache.pinot.common.metrics;
import org.apache.pinot.common.Utils;
/**
* Enumeration containing all the gauges exposed by the Pinot broker.
*
*/
public enum BrokerGauge implements AbstractMetrics.Gauge {
QUERY_QUOTA_CAPACITY_UTILIZATION_RATE("tables", false),
MAX_BURST_QPS("tables", false),
QUERY_RATE_LIMIT_DISABLED("queryQuota", true),
NETTY_CONNECTION_CONNECT_TIME_MS("nettyConnection", true),
REQUEST_SIZE("requestSize", false);
private final String brokerGaugeName;
private final String unit;
private final boolean global;
BrokerGauge(String unit, boolean global) {
this.unit = unit;
this.global = global;
this.brokerGaugeName = Utils.toCamelCase(name().toLowerCase());
}
@Override
public String getGaugeName() {
return brokerGaugeName;
}
@Override
public String getUnit() {
return unit;
}
/**
* Returns true if the gauge is global (not attached to a particular resource)
*
* @return true if the gauge is global
*/
@Override
public boolean isGlobal() {
return global;
}
}
| {
"content_hash": "f862c7b73e4aec1a9436d8415f8b7ed2",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 80,
"avg_line_length": 22.93617021276596,
"alnum_prop": 0.7050092764378478,
"repo_name": "linkedin/pinot",
"id": "5a5a72abe4235eb7e5b5e5b01576ea4aeacd4e11",
"size": "1886",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pinot-common/src/main/java/org/apache/pinot/common/metrics/BrokerGauge.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "4620"
},
{
"name": "Batchfile",
"bytes": "7738"
},
{
"name": "CSS",
"bytes": "925600"
},
{
"name": "FreeMarker",
"bytes": "243262"
},
{
"name": "HTML",
"bytes": "272985"
},
{
"name": "Java",
"bytes": "14295484"
},
{
"name": "JavaScript",
"bytes": "5186004"
},
{
"name": "Makefile",
"bytes": "8076"
},
{
"name": "Python",
"bytes": "36574"
},
{
"name": "Shell",
"bytes": "51677"
},
{
"name": "Thrift",
"bytes": "5028"
}
],
"symlink_target": ""
} |
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=4 sw=4 et tw=99:
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#if !defined(jsion_ion_h__) && defined(JS_ION)
#define jsion_ion_h__
#include "jscntxt.h"
#include "jscompartment.h"
#include "IonCode.h"
#include "jsinfer.h"
#include "jsinterp.h"
namespace js {
namespace ion {
class TempAllocator;
struct IonOptions
{
// Toggles whether global value numbering is used.
//
// Default: true
bool gvn;
// Toggles whether global value numbering is optimistic (true) or
// pessimistic (false).
//
// Default: true
bool gvnIsOptimistic;
// Toggles whether loop invariant code motion is performed.
//
// Default: true
bool licm;
// Toggles whether functions may be entered at loop headers.
//
// Default: true
bool osr;
// Toggles whether large scripts are rejected.
//
// Default: true
bool limitScriptSize;
// Toggles whether Linear Scan Register Allocation is used. If LSRA is not
// used, then Greedy Register Allocation is used instead.
//
// Default: true
bool lsra;
// Toggles whether inlining is performed.
//
// Default: true
bool inlining;
// Toggles whether Edge Case Analysis is used.
//
// Default: true
bool edgeCaseAnalysis;
// Toggles whether Range Analysis is used.
//
// Default: false
bool rangeAnalysis;
// Toggles whether compilation occurs off the main thread.
//
// Default: true iff there are at least two CPUs available
bool parallelCompilation;
// How many invocations or loop iterations are needed before functions
// are compiled.
//
// Default: 10,240
uint32 usesBeforeCompile;
// How many invocations or loop iterations are needed before functions
// are compiled when JM is disabled.
//
// Default: 40
uint32 usesBeforeCompileNoJaeger;
// How many invocations or loop iterations are needed before calls
// are inlined.
//
// Default: 10,240
uint32 usesBeforeInlining;
// How many actual arguments are accepted on the C stack.
//
// Default: 4,096
uint32 maxStackArgs;
// The maximum inlining depth.
//
// Default: 3
uint32 maxInlineDepth;
// The bytecode length limit for small function.
//
// The default for this was arrived at empirically via benchmarking.
// We may want to tune it further after other optimizations have gone
// in.
//
// Default: 100
uint32 smallFunctionMaxBytecodeLength;
// The inlining limit for small functions.
//
// This value has been arrived at empirically via benchmarking.
// We may want to revisit this tuning after other optimizations have
// gone in.
//
// Default: usesBeforeInlining / 4
uint32 smallFunctionUsesBeforeInlining;
// The maximum number of functions to polymorphically inline at a call site.
//
// Default: 4
uint32 polyInlineMax;
// The maximum total bytecode size of an inline call site.
//
// Default: 800
uint32 inlineMaxTotalBytecodeLength;
// Minimal ratio between the use counts of the caller and the callee to
// enable inlining of functions.
//
// Default: 128
uint32 inlineUseCountRatio;
// Whether functions are compiled immediately.
//
// Default: false
bool eagerCompilation;
// If a function has attempted to make this many calls to
// functions that are marked "uncompileable", then
// stop running this function in IonMonkey. (default 512)
uint32 slowCallLimit;
void setEagerCompilation() {
eagerCompilation = true;
usesBeforeCompile = usesBeforeCompileNoJaeger = 0;
// Eagerly inline calls to improve test coverage.
usesBeforeInlining = 0;
smallFunctionUsesBeforeInlining = 0;
parallelCompilation = false;
}
IonOptions()
: gvn(true),
gvnIsOptimistic(true),
licm(true),
osr(true),
limitScriptSize(true),
lsra(true),
inlining(true),
edgeCaseAnalysis(true),
rangeAnalysis(true),
parallelCompilation(false),
usesBeforeCompile(10240),
usesBeforeCompileNoJaeger(40),
usesBeforeInlining(usesBeforeCompile),
maxStackArgs(4096),
maxInlineDepth(3),
smallFunctionMaxBytecodeLength(100),
smallFunctionUsesBeforeInlining(usesBeforeInlining / 4),
polyInlineMax(4),
inlineMaxTotalBytecodeLength(800),
inlineUseCountRatio(128),
eagerCompilation(false),
slowCallLimit(512)
{
}
};
enum MethodStatus
{
Method_Error,
Method_CantCompile,
Method_Skipped,
Method_Compiled
};
// An Ion context is needed to enter into either an Ion method or an instance
// of the Ion compiler. It points to a temporary allocator and the active
// JSContext, either of which may be NULL, and the active compartment, which
// will not be NULL.
class IonContext
{
public:
IonContext(JSContext *cx, JSCompartment *compartment, TempAllocator *temp);
~IonContext();
JSContext *cx;
JSCompartment *compartment;
TempAllocator *temp;
int getNextAssemblerId() {
return assemblerCount_++;
}
private:
IonContext *prev_;
int assemblerCount_;
};
extern IonOptions js_IonOptions;
// Initialize Ion statically for all JSRuntimes.
bool InitializeIon();
// Get and set the current Ion context.
IonContext *GetIonContext();
bool SetIonContext(IonContext *ctx);
MethodStatus CanEnterAtBranch(JSContext *cx, HandleScript script,
StackFrame *fp, jsbytecode *pc);
MethodStatus CanEnter(JSContext *cx, HandleScript script, StackFrame *fp, bool newType);
MethodStatus CanEnterUsingFastInvoke(JSContext *cx, HandleScript script, uint32_t numActualArgs);
enum IonExecStatus
{
// The method call had to be aborted due to a stack limit check. This
// error indicates that Ion never attempted to clean up frames.
IonExec_Aborted,
// The method call resulted in an error, and IonMonkey has cleaned up
// frames.
IonExec_Error,
// The method call succeeed and returned a value.
IonExec_Ok,
// A guard triggered in IonMonkey and we must resume execution in
// the interpreter.
IonExec_Bailout
};
static inline bool
IsErrorStatus(IonExecStatus status)
{
return status == IonExec_Error || status == IonExec_Aborted;
}
IonExecStatus Cannon(JSContext *cx, StackFrame *fp);
IonExecStatus SideCannon(JSContext *cx, StackFrame *fp, jsbytecode *pc);
// Used to enter Ion from C++ natives like Array.map. Called from FastInvokeGuard.
IonExecStatus FastInvoke(JSContext *cx, HandleFunction fun, CallArgsList &args);
// Walk the stack and invalidate active Ion frames for the invalid scripts.
void Invalidate(types::TypeCompartment &types, FreeOp *fop,
const Vector<types::RecompileInfo> &invalid, bool resetUses = true);
void Invalidate(JSContext *cx, const Vector<types::RecompileInfo> &invalid, bool resetUses = true);
bool Invalidate(JSContext *cx, JSScript *script, bool resetUses = true);
void MarkValueFromIon(JSCompartment *comp, Value *vp);
void MarkShapeFromIon(JSCompartment *comp, Shape **shapep);
void ToggleBarriers(JSCompartment *comp, bool needs);
class IonBuilder;
bool CompileBackEnd(IonBuilder *builder);
void AttachFinishedCompilations(JSContext *cx);
void FinishOffThreadBuilder(IonBuilder *builder);
bool TestIonCompile(JSContext *cx, JSScript *script, JSFunction *fun, jsbytecode *osrPc, bool constructing);
static inline bool IsEnabled(JSContext *cx)
{
return cx->hasRunOption(JSOPTION_ION) && cx->typeInferenceEnabled();
}
void ForbidCompilation(JSContext *cx, JSScript *script);
uint32_t UsesBeforeIonRecompile(JSScript *script, jsbytecode *pc);
} // namespace ion
} // namespace js
#endif // jsion_ion_h__
| {
"content_hash": "2b8e1b33dde4899d15c50a25f65f2455",
"timestamp": "",
"source": "github",
"line_count": 291,
"max_line_length": 108,
"avg_line_length": 28.034364261168385,
"alnum_prop": 0.687545967148811,
"repo_name": "sergecodd/FireFox-OS",
"id": "4435a9b5bdd0898b10fc0452e19a2e340672c96e",
"size": "8158",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "B2G/gecko/js/src/ion/Ion.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Ada",
"bytes": "443"
},
{
"name": "ApacheConf",
"bytes": "85"
},
{
"name": "Assembly",
"bytes": "5123438"
},
{
"name": "Awk",
"bytes": "46481"
},
{
"name": "Batchfile",
"bytes": "56250"
},
{
"name": "C",
"bytes": "101720951"
},
{
"name": "C#",
"bytes": "38531"
},
{
"name": "C++",
"bytes": "148896543"
},
{
"name": "CMake",
"bytes": "23541"
},
{
"name": "CSS",
"bytes": "2758664"
},
{
"name": "DIGITAL Command Language",
"bytes": "56757"
},
{
"name": "Emacs Lisp",
"bytes": "12694"
},
{
"name": "Erlang",
"bytes": "889"
},
{
"name": "FLUX",
"bytes": "34449"
},
{
"name": "GLSL",
"bytes": "26344"
},
{
"name": "Gnuplot",
"bytes": "710"
},
{
"name": "Groff",
"bytes": "447012"
},
{
"name": "HTML",
"bytes": "43343468"
},
{
"name": "IDL",
"bytes": "1455122"
},
{
"name": "Java",
"bytes": "43261012"
},
{
"name": "JavaScript",
"bytes": "46646658"
},
{
"name": "Lex",
"bytes": "38358"
},
{
"name": "Logos",
"bytes": "21054"
},
{
"name": "Makefile",
"bytes": "2733844"
},
{
"name": "Matlab",
"bytes": "67316"
},
{
"name": "Max",
"bytes": "3698"
},
{
"name": "NSIS",
"bytes": "421625"
},
{
"name": "Objective-C",
"bytes": "877657"
},
{
"name": "Objective-C++",
"bytes": "737713"
},
{
"name": "PHP",
"bytes": "17415"
},
{
"name": "Pascal",
"bytes": "6780"
},
{
"name": "Perl",
"bytes": "1153180"
},
{
"name": "Perl6",
"bytes": "1255"
},
{
"name": "PostScript",
"bytes": "1139"
},
{
"name": "PowerShell",
"bytes": "8252"
},
{
"name": "Protocol Buffer",
"bytes": "26553"
},
{
"name": "Python",
"bytes": "8453201"
},
{
"name": "Ragel in Ruby Host",
"bytes": "3481"
},
{
"name": "Ruby",
"bytes": "5116"
},
{
"name": "Scilab",
"bytes": "7"
},
{
"name": "Shell",
"bytes": "3383832"
},
{
"name": "SourcePawn",
"bytes": "23661"
},
{
"name": "TeX",
"bytes": "879606"
},
{
"name": "WebIDL",
"bytes": "1902"
},
{
"name": "XSLT",
"bytes": "13134"
},
{
"name": "Yacc",
"bytes": "112744"
}
],
"symlink_target": ""
} |
import { ILakeNiceClient } from '../../../../lakenicejs/base/lakenice-client';
/**
* General handler interface.
*/
export interface IHGeneral {
/**
* Handle the action.
*
* @param {Object} argOptions A collection of argument options.
*/
handleAction(argOptions?: any): void;
/**
* Assign the request options for the specified unique id.
*
* @param {string} uniqueID The unique id.
* @param {Object} requestData The request data.
*
* @return {Object} The request options, either or the 'params' and 'data'.
*
* @example
* returned data = {
* // 'params' are the URL parameters to be sent with the request
* // Must be a plain object or a URLSearchParams object
* params: { ID: 12345 },
*
* // 'data' is the data to be sent as the request body.
* data: { ID: 'Unique' },
* }
*/
assignRequestOptions(uniqueID: string, requestData?: any): any;
}
/**
* General handler implementation.
*/
export declare class HGeneral implements IHGeneral {
lakeNiceClient: ILakeNiceClient;
generalHandlerOptions: any;
config: any;
logger: any;
parent: any;
/**
* General handler implementation.
*
* @param {ILakeNiceClient} lakeNiceClient Lake Nice client interface.
* @param {Object} generalHandlerOptions A collection of options.
*
* @example
* options = {
* debug: true
* }
*/
constructor(lakeNiceClient: ILakeNiceClient, generalHandlerOptions: any);
/**
* Handle the action.
*
* @param {Object} argOptions A collection of argument options.
*/
handleAction(argOptions?: any): void;
/**
* Assign the request options for the specified unique id.
*
* @param {string} uniqueID The unique id.
* @param {Object} requestData The request data.
*
* @return {Object} The request options, either or the 'params' and 'data'.
*
* @example
* returned data = {
* // 'params' are the URL parameters to be sent with the request
* // Must be a plain object or a URLSearchParams object
* params: { ID: 12345 },
*
* // 'data' is the data to be sent as the request body.
* data: { ID: 'Unique' },
* }
*/
assignRequestOptions(uniqueID: string, requestData?: any): any;
/**
* Handle the default action.
*
* @param {Object} argOptions A collection of argument options.
*/
handleDefaultAction(argOptions?: any): void;
}
| {
"content_hash": "adfd7f978a09b2909bb60bc84f3d50dc",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 79,
"avg_line_length": 31.428571428571427,
"alnum_prop": 0.5840909090909091,
"repo_name": "drazenzadravec/projects",
"id": "257fb5b153dc8bcc40436f2058c757864fc7166b",
"size": "2640",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "nice/sdk/lakenicehandlerjs/api/admin/general.d.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "2754"
},
{
"name": "C",
"bytes": "720"
},
{
"name": "C#",
"bytes": "5049589"
},
{
"name": "C++",
"bytes": "2005494"
},
{
"name": "CSS",
"bytes": "19127"
},
{
"name": "HLSL",
"bytes": "452"
},
{
"name": "HTML",
"bytes": "90518"
},
{
"name": "JavaScript",
"bytes": "8105941"
},
{
"name": "Shell",
"bytes": "234"
},
{
"name": "TypeScript",
"bytes": "1588858"
}
],
"symlink_target": ""
} |
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Infrastructure.Persistence;
using Umbraco.Cms.Infrastructure.Persistence.Dtos;
using Umbraco.Extensions;
namespace Umbraco.Cms.Infrastructure.Migrations.Upgrade.V_9_3_0
{
public class UpdateExternalLoginToUseKeyInsteadOfId : MigrationBase
{
public UpdateExternalLoginToUseKeyInsteadOfId(IMigrationContext context) : base(context)
{
}
protected override void Migrate()
{
if (!ColumnExists(ExternalLoginDto.TableName, "userOrMemberKey"))
{
var indexNameToRecreate = "IX_" + ExternalLoginDto.TableName + "_LoginProvider";
var indexNameToDelete = "IX_" + ExternalLoginDto.TableName + "_userId";
if (IndexExists(indexNameToRecreate))
{
// drop it since the previous migration index was wrong, and we
// need to modify a column that belons to it
Delete.Index(indexNameToRecreate).OnTable(ExternalLoginDto.TableName).Do();
}
if (IndexExists(indexNameToDelete))
{
// drop it since the previous migration index was wrong, and we
// need to modify a column that belons to it
Delete.Index(indexNameToDelete).OnTable(ExternalLoginDto.TableName).Do();
}
//special trick to add the column without constraints and return the sql to add them later
AddColumn<ExternalLoginDto>("userOrMemberKey", out var sqls);
if (DatabaseType.IsSqlCe())
{
var userIds = Database.Fetch<int>(Sql().Select("userId").From<ExternalLoginDto>());
foreach (int userId in userIds)
{
Execute.Sql($"UPDATE {ExternalLoginDto.TableName} SET userOrMemberKey = '{userId.ToGuid()}' WHERE userId = {userId}").Do();
}
}
else
{
//populate the new columns with the userId as a Guid. Same method as IntExtensions.ToGuid.
Execute.Sql($"UPDATE {ExternalLoginDto.TableName} SET userOrMemberKey = CAST(CONVERT(char(8), CONVERT(BINARY(4), userId), 2) + '-0000-0000-0000-000000000000' AS UNIQUEIDENTIFIER)").Do();
}
//now apply constraints (NOT NULL) to new table
foreach (var sql in sqls) Execute.Sql(sql).Do();
//now remove these old columns
Delete.Column("userId").FromTable(ExternalLoginDto.TableName).Do();
// create index with the correct definition
Create
.Index(indexNameToRecreate)
.OnTable(ExternalLoginDto.TableName)
.OnColumn("loginProvider").Ascending()
.OnColumn("userOrMemberKey").Ascending()
.WithOptions()
.Unique()
.WithOptions()
.NonClustered()
.Do();
}
}
}
}
| {
"content_hash": "2670eae7d1ab1bd67d01123b32bddd2a",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 206,
"avg_line_length": 41.25974025974026,
"alnum_prop": 0.5546112684922884,
"repo_name": "dawoe/Umbraco-CMS",
"id": "4c7104e762325e421f5dbee2b4ff5f2e6afb795c",
"size": "3177",
"binary": false,
"copies": "1",
"ref": "refs/heads/v9/contrib",
"path": "src/Umbraco.Infrastructure/Migrations/Upgrade/V_9_3_0/UpdateExternalLoginToUseKeyInsteadOfId.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "16387240"
},
{
"name": "CSS",
"bytes": "17972"
},
{
"name": "Dockerfile",
"bytes": "2352"
},
{
"name": "HTML",
"bytes": "1270928"
},
{
"name": "JavaScript",
"bytes": "4585128"
},
{
"name": "Less",
"bytes": "691390"
},
{
"name": "PowerShell",
"bytes": "21984"
},
{
"name": "Shell",
"bytes": "3572"
},
{
"name": "TSQL",
"bytes": "371"
},
{
"name": "TypeScript",
"bytes": "125776"
}
],
"symlink_target": ""
} |
using SEV.Domain.Model;
using SEV.Domain.Services.Data;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Threading.Tasks;
namespace SEV.DAL.EF
{
public class EFRepository<TEntity> : QueryBuilder<TEntity>, IRepository<TEntity>
where TEntity : Entity
{
private readonly IDbContext m_context;
private readonly IDbSet<TEntity> m_dbSet;
public EFRepository(IDbContext context)
{
m_context = context;
m_dbSet = context.Set<TEntity>();
}
public IEnumerable<TEntity> All()
{
return m_dbSet.ToList();
}
public TEntity GetById(object id)
{
return m_dbSet.Find(CastId(id));
}
private int CastId(object inputId)
{
if (inputId is string)
{
return int.Parse((string)inputId);
}
return (int)inputId;
}
public IEnumerable<TEntity> GetByIdList(IEnumerable<object> ids)
{
var idList = ids.Select(CastId).ToList();
return m_dbSet.Where(x => idList.Contains(x.Id)).ToList();
}
public async Task<IEnumerable<TEntity>> AllAsync()
{
return await m_dbSet.ToListAsync();
}
public async Task<TEntity> GetByIdAsync(object id)
{
var idValue = CastId(id);
return await m_dbSet.FirstOrDefaultAsync(x => x.Id == idValue);
}
public async Task<IEnumerable<TEntity>> GetByIdListAsync(IEnumerable<object> ids)
{
var idList = ids.Select(CastId).ToList();
return await m_dbSet.Where(x => idList.Contains(x.Id)).ToListAsync();
}
public RepositoryQuery<TEntity> Query()
{
var repositoryGetFluentHelper = new RepositoryQuery<TEntity>(this);
return repositoryGetFluentHelper;
}
protected override IQueryable<TEntity> CreateQuery()
{
return m_dbSet;
}
public TEntity Insert(TEntity entity)
{
return m_dbSet.Add(entity);
}
public void Remove(TEntity entity)
{
m_dbSet.Remove(entity);
}
public void Update(TEntity entity)
{
m_context.SetEntityState(entity, EntityState.Modified);
}
}
}
| {
"content_hash": "322ce32a49470de314bbb28e8978b8d9",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 89,
"avg_line_length": 26.282608695652176,
"alnum_prop": 0.5661703887510339,
"repo_name": "sev15/SEVFramework",
"id": "4bd0d25c12f1d0212da33cf6ae6545573a2cc36a",
"size": "2420",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SEV.DAL.EF/EFRepository.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "404108"
}
],
"symlink_target": ""
} |
function afni_niml_test_io(fns)
% simple test function for i/o capabilities of afni_niml_{read,parse,print,write}
%
% AFNI_NIML_TEST_IO(FNS), where FNS is a cell with filenames, reads each of
% the files indicated in FNS, tests whether parsing and printing are
% reverse operations, and writes the files to a new file. If a file
% contains a matrix with floats, then these are replaced by random numbers.
%
% AFNI_NIML_TEST_IO(FN), where FN is a single filename, is also allowed.
% AFNI_NIML_TEST_IO() uses default filenames as defined in the body of this
% function.
%
% Each file named in FNS should be in ASCII NIML format.
%
% NNO Dec 2009 <[email protected]>
if nargin<1
% set defaults
fns={'testfiles/you_look_marvellous.niml.dset',...
'testfiles/test_ROI2.niml.dset',...
'testfiles/moredata.niml.dset'};
end
if ischar(fns) % single filename
fn=fns;
fns=cell(1);
fns{1}=fn;
end
n=numel(fns);
for k=1:n
fn=fns{k};
fprintf('\n*** Processing %s ***\n\n',fn);
[p,s]=afni_niml_read(fn);
% print a few lines
fprintf('First 1000 characters:\n%s\n', s(1:1000));
% switch a few times between parsing and printing, results should
% converge to 'fixed points'
fprintf('Check whether parsing and printing are mutually inverse\n');
s2=afni_niml_print(p);
p2=afni_niml_parse(s2);
s3=afni_niml_print(p2);
% check convergence
if ~isequal(s2,s3)
error('Wrong string representation for %s', fn);
end
if ~isequal(p,p2)
error('Wrong struct representation for %s', fn);
end
fprintf('Good, data seems to match\n');
% now read data as a 'simple' struct, that is one that we can
% manipulate easily
S=afni_niml_readsimple(fn);
fprintf('Simple struct read:\n');
disp(S);
% print the information for each column (a la AFNI SurfDsetinfo)
[nverts,ncols]=size(S.data);
fprintf('Found %d columns\n', ncols);
for j=1:ncols
fprintf('COlumn %d: label "%s" with stat value "%s"\n', j, S.labels{j}, S.stats{j});
end
% for every odd colum, make values gaussian random
fprintf('Put some random data in\n');
for j=1:2:ncols
d=S.data(:,j);
if isequal(d,round(d)) % if integers, ignore (probably ROI indices)
continue;
end
S.data(:,j)=randn(nverts,1);
S.labels{j}=sprintf('rnd(%d)',j);
S.stats{j}='Zscore()';
end
% convert to string
[pth,f e]=fileparts(fn);
newfn=[pth '/niml_io_test_' f e];
afni_niml_writesimple(newfn,S);
end
% Make a file from scratch
myrootfn='testfiles/myfile';
nverts=100002;
S=struct();
S.labels={'Hello','World'};
S.stats={'Zscore()','none'};
S.data=[randn(nverts,1) rand(nverts,1)];
% write with all info
afni_niml_writesimple(S,[myrootfn '_1.niml.dset']);
% just write the data
afni_niml_writesimple(S.data,[myrootfn '_2.niml.dset']);
| {
"content_hash": "e5ec3fcd19f4af7b66f3a129e3433684",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 92,
"avg_line_length": 27.31192660550459,
"alnum_prop": 0.631172321128653,
"repo_name": "pchrapka/brain-modelling",
"id": "00dd42d25597d556c003af89e06d19d67a20cfa3",
"size": "2977",
"binary": false,
"copies": "28",
"ref": "refs/heads/master",
"path": "external/fieldtrip-20160128/external/afni/afni_niml_test_io.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Jupyter Notebook",
"bytes": "2265630"
},
{
"name": "M",
"bytes": "2270"
},
{
"name": "MATLAB",
"bytes": "1750479"
},
{
"name": "Makefile",
"bytes": "305"
},
{
"name": "Objective-C",
"bytes": "1122"
},
{
"name": "Shell",
"bytes": "45091"
}
],
"symlink_target": ""
} |
class Irrlicht < Formula
desc "Realtime 3D engine"
homepage "https://irrlicht.sourceforge.io/"
url "https://downloads.sourceforge.net/project/irrlicht/Irrlicht%20SDK/1.8/1.8.4/irrlicht-1.8.4.zip"
sha256 "f42b280bc608e545b820206fe2a999c55f290de5c7509a02bdbeeccc1bf9e433"
# Irrlicht is available under alternative license terms. See
# https://metadata.ftp-master.debian.org/changelogs//main/i/irrlicht/irrlicht_1.8.4+dfsg1-1.1_copyright
license "Zlib"
revision 1
head "https://svn.code.sf.net/p/irrlicht/code/trunk"
livecheck do
url :stable
regex(%r{url=.*?/irrlicht[._-]v?(\d+(?:\.\d+)+)\.(?:t|zip)}i)
end
bottle do
sha256 cellar: :any, arm64_big_sur: "7c88c45cbe80a489a1881fd3c6bb74d159c9ca7bc7dd5880ad9bb58c91915a19"
sha256 cellar: :any, big_sur: "4140548f2ba1485fe7d374e13b6a70d39d6855cf5bbf463af621288e955706d8"
sha256 cellar: :any, catalina: "d9ad006ffc814a0a491d479bfb1232f2d905e8dafebbba1de18ce2c2201a73f8"
sha256 cellar: :any, mojave: "45479dc7a13d745a69dccf51c8bf1ebc4cc49fda9fb9e2d0f3a5bd0d67c2a091"
sha256 cellar: :any_skip_relocation, x86_64_linux: "153ae52b4f2d95488105918318ebdc9e83ae257eed0a04e893063285da3ac15f"
end
depends_on xcode: :build
on_linux do
depends_on "libx11"
depends_on "libxxf86vm"
depends_on "mesa"
end
def install
on_macos do
# Fix "error: cannot initialize a parameter of type
# 'id<NSApplicationDelegate> _Nullable' with an rvalue of type
# 'id<NSFileManagerDelegate>'"
# Reported 5 Oct 2016 https://irrlicht.sourceforge.io/forum/viewtopic.php?f=7&t=51562
inreplace "source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm",
"[NSApp setDelegate:(id<NSFileManagerDelegate>)",
"[NSApp setDelegate:(id<NSApplicationDelegate>)"
# Fix "error: ZLIB_VERNUM != PNG_ZLIB_VERNUM" on Mojave (picking up system zlib)
# Reported 21 Oct 2018 https://sourceforge.net/p/irrlicht/bugs/442/
inreplace "source/Irrlicht/libpng/pngpriv.h",
"# error ZLIB_VERNUM != PNG_ZLIB_VERNUM \\",
"# warning ZLIB_VERNUM != PNG_ZLIB_VERNUM \\"
extra_args = []
# Fix "Undefined symbols for architecture arm64: "_png_init_filter_functions_neon"
# Reported 18 Nov 2020 https://sourceforge.net/p/irrlicht/bugs/452/
extra_args << "GCC_PREPROCESSOR_DEFINITIONS='PNG_ARM_NEON_OPT=0'" if Hardware::CPU.arm?
xcodebuild "-project", "source/Irrlicht/MacOSX/MacOSX.xcodeproj",
"-configuration", "Release",
"-target", "IrrFramework",
"SYMROOT=build",
*extra_args
xcodebuild "-project", "source/Irrlicht/MacOSX/MacOSX.xcodeproj",
"-configuration", "Release",
"-target", "libIrrlicht.a",
"SYMROOT=build",
*extra_args
frameworks.install "source/Irrlicht/MacOSX/build/Release/IrrFramework.framework"
lib.install_symlink frameworks/"IrrFramework.framework/Versions/A/IrrFramework" => "libIrrlicht.dylib"
lib.install "source/Irrlicht/MacOSX/build/Release/libIrrlicht.a"
include.install "include" => "irrlicht"
end
on_linux do
cd "source/Irrlicht" do
inreplace "Makefile" do |s|
s.gsub! "/usr/X11R6/lib$(LIBSELECT)", Formula["libx11"].opt_lib
s.gsub! "/usr/X11R6/include", Formula["libx11"].opt_include
end
ENV.append "LDFLAGS", "-L#{Formula["mesa"].opt_lib}"
ENV.append "LDFLAGS", "-L#{Formula["libxxf86vm"].opt_lib}"
ENV.append "CXXFLAGS", "-I#{Formula["libxxf86vm"].opt_include}"
system "make", "sharedlib", "NDEBUG=1"
system "make", "install", "INSTALL_DIR=#{lib}"
system "make", "clean"
system "make", "staticlib", "NDEBUG=1"
end
lib.install "lib/Linux/libIrrlicht.a"
end
(pkgshare/"examples").install "examples/01.HelloWorld"
end
test do
on_macos do
assert_match Hardware::CPU.arch.to_s, shell_output("lipo -info #{lib}/libIrrlicht.a")
end
cp_r Dir["#{pkgshare}/examples/01.HelloWorld/*"], testpath
system ENV.cxx, "main.cpp", "-I#{include}/irrlicht", "-L#{lib}", "-lIrrlicht", "-o", "hello"
end
end
| {
"content_hash": "05728ceb0535691b72fbf7f48f4ca005",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 122,
"avg_line_length": 42.8,
"alnum_prop": 0.6539719626168224,
"repo_name": "mbcoguno/homebrew-core",
"id": "e60114b507cf39916f7865bf94aaac96972eeb9a",
"size": "4280",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Formula/irrlicht.rb",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "HCL",
"bytes": "246"
},
{
"name": "Perl",
"bytes": "628"
},
{
"name": "Ruby",
"bytes": "8079582"
},
{
"name": "Shell",
"bytes": "1808"
}
],
"symlink_target": ""
} |
import url = require("url");
import http = require("http");
import path = require("path");
import base = require("./base");
import {isDefined, isFunction, deferred, parallel} from "../utils/common";
import {mkdir} from "../utils";
import IManager = require("../sass/manager/IManager");
import Manager = require("../sass/manager/Manager");
import IResponse = require("../sass/client/IResponse");
import log4js = require("log4js");
import glob = require("glob");
import accessLog = require("../accessLog");
var manager:IManager,
memory:base.Memory = {},
startDate:string = (new Date()).toUTCString(),
logger:log4js.Logger = log4js.getLogger("router");
export interface RouterOptions extends base.RouterOptions {
webRootDirectory: string;
useCache: boolean;
}
export interface InitOptions extends base.InitOptions {
temporaryDirectory: string;
includeDirectories: string[];
sourcesDirectory: string;
memoryLocation: string;
useCache: boolean;
errorBackgroundColor: string;
errorTextColor: string;
errorBlockPadding: string;
errorFontSize: string;
webRootDirectory: string;
numberOfProcesses: number;
}
export function init(options:InitOptions, done:(errors:Error[]) => void):void {
var temporaryDirectory:string = options.temporaryDirectory,
memoryLocation:string = options.memoryLocation,
includeDirectories:string[] = options.includeDirectories,
sourcesDirectory:string = options.sourcesDirectory,
webRootDirectory:string = options.webRootDirectory,
useCache:boolean = options.useCache,
errorBackgroundColor:string = options.errorBackgroundColor,
errorTextColor:string = options.errorTextColor,
errorBlockPadding:string = options.errorBlockPadding,
errorFontSize:string = options.errorFontSize,
numberOfProcesses:number = options.numberOfProcesses;
deferred([
(next:() => void):void => {
mkdir(temporaryDirectory, (error?:Error):void => {
if (error) {
if (isFunction(done)) {
done([error]);
}
} else {
next();
}
});
},
(next:() => void):void => {
var manager:IManager;
if (useCache) {
deferred([
(next:() => void):void => {
manager = new Manager({
location: path.join(temporaryDirectory, "sass-temp.sock"),
memoryLocation: memoryLocation,
sourcesDirectory: sourcesDirectory,
includeDirectories: includeDirectories,
webRootDirectory: webRootDirectory,
errorBackgroundColor: errorBackgroundColor,
errorTextColor: errorTextColor,
errorBlockPadding: errorBlockPadding,
errorFontSize: errorFontSize,
numberOfProcesses: 10,
useCache: false
});
manager.connect((errors:Error[]):void => {
if (!errors || !errors.length) {
next();
} else if (isFunction(done)) {
done(errors);
}
});
},
(next:() => void):void => {
var actions:((done:() => void) => void)[] = [],
errors:Error[] = [];
glob("**/*.less", {
cwd: sourcesDirectory
}, (error?:Error, files?:string[]):void => {
if (error) {
if (isFunction(done)) {
done([error]);
}
} else {
files.forEach((filename:string):void => {
actions.push((done:() => void):void => {
manager.compile(filename, (errs:Error[]):void => {
if (errs && errs.length) {
errors = errors.concat(errs);
}
done();
});
});
});
}
});
parallel(actions, ():void => {
if (errors.length) {
if (isFunction(done)) {
done(errors);
}
} else {
next();
}
});
},
(next:() => void):void => {
manager.disconnect((errors:Error[]):void => {
if (!errors || !errors.length) {
next();
} else if (isFunction(done)) {
done(errors && errors.length ? errors : null);
}
})
}
]);
} else {
next();
}
},
():void => {
manager = new Manager({
location: path.join(temporaryDirectory, "sass.sock"),
memoryLocation: memoryLocation,
sourcesDirectory: sourcesDirectory,
includeDirectories: includeDirectories,
webRootDirectory: webRootDirectory,
errorBackgroundColor: errorBackgroundColor,
errorTextColor: errorTextColor,
errorBlockPadding: errorBlockPadding,
errorFontSize: errorFontSize,
numberOfProcesses: numberOfProcesses,
useCache: useCache
});
manager.connect((errors:Error[]):void => {
if (isFunction(done)) {
done(errors && errors.length ? errors : null);
}
});
}
]);
}
export function route(options:RouterOptions, complete:() => void):void {
var request:http.ServerRequest = options.request,
response:http.ServerResponse = options.response,
webRootDirectory:string = options.webRootDirectory,
useCache:boolean = options.useCache,
object:url.Url = url.parse(request.url, true),
filename:string = path.relative(webRootDirectory, String(object.pathname || "/")),
start:number = Number(new Date());
function consoleLog(code:number, type?:string):void {
var time:number = Number(new Date()) - start;
if (!!options.accessLog) {
accessLog(request.method, object.pathname, code, time, type, request.headers);
}
}
deferred([
(next:() => void):void => {
var extension:string = filename.substr(-4).toLowerCase(),
pathname:string = filename.substr(0, filename.length - 4),
modified:string = request.headers["if-modified-since"],
header:any = {};
if (useCache && extension === ".css" &&
isDefined(memory[pathname]) &&
modified && modified === startDate) {
response.writeHead(304);
response.end();
} else if (useCache && extension === ".css" &&
isDefined(memory[pathname])) {
header["Content-Type"] = "text/css; charset=utf-8";
header["Last-Modified"] = startDate;
response.writeHead(200, header);
response.end(memory[pathname]);
} else if (useCache) {
complete();
} else {
next()
}
},
(next:() => void):void => {
var extension:string = filename.substr(-4).toLowerCase(),
pathname:string = filename.substr(0, filename.length - 4);
if (useCache) {
next();
} else if (extension === ".css") {
manager.compile(pathname, (errors:Error[], result:IResponse):void => {
var header:any = {},
modified:number,
date:number;
if ((!errors || !errors.length) && result) {
modified = Date.parse(request.headers["if-modified-since"]);
date = 1000 * result.date;
if (modified && modified === date) {
response.writeHead(304);
response.end();
consoleLog(304);
} else {
header["Content-Type"] = "text/css; charset=utf-8";
header["Last-Modified"] = (new Date(result.date * 1000)).toUTCString();
if (!useCache) {
header["X-SourceMap"] = path.join(webRootDirectory, pathname + ".css.map");
}
response.writeHead(200, header);
response.end(result.result);
consoleLog(200, "text/css");
}
} else if (errors && errors.length) {
errors.forEach((error:Error):void => {
logger.error("Something went wrong", error);
});
next();
} else {
next();
}
});
} else {
next();
}
},
(next:() => void):void => {
var extension = filename.substr(-5).toLowerCase(),
pathname = filename.substr(0, filename.length - 5);
if (useCache) {
next();
} else if (extension === ".sass" || extension === ".scss") {
manager.compile(pathname, (errors:Error[], result:IResponse):void => {
if ((!errors || !errors.length) && result) {
var header:any = {},
modified = Date.parse(request.headers["if-modified-since"]),
date = 1000 * result.date;
if (modified && modified === date) {
response.writeHead(304);
response.end();
consoleLog(304);
} else {
header["Content-Type"] = "text/plain; charset=utf-8";
header["Last-Modified"] = (new Date(result.date * 1000)).toUTCString();
response.writeHead(200, header);
response.end(result.source);
consoleLog(200, "text/plain");
}
} else if (errors && errors.length) {
errors.forEach((error:Error):void => {
logger.error("Something went wrong", error);
});
next();
} else {
next();
}
});
} else {
next();
}
},
(next:() => void):void => {
var extension = filename.substr(-8).toLowerCase(),
pathname = filename.substr(0, filename.length - 8);
if (useCache) {
next();
} else if (extension === ".css.map") {
manager.compile(pathname, (errors:Error[], result:IResponse):void => {
if ((!errors || !errors.length) && result) {
var header:any = {},
modified = Date.parse(request.headers["if-modified-since"]),
date = 1000 * result.date;
if (modified && modified === date) {
response.writeHead(304);
response.end();
consoleLog(304);
} else {
header["Content-Type"] = "application/json; charset=utf-8";
header["Last-Modified"] = (new Date(result.date * 1000)).toUTCString();
response.writeHead(200, header);
response.end(JSON.stringify(result.map));
consoleLog(200, "application/json");
}
} else if (errors && errors.length) {
errors.forEach((error:Error):void => {
logger.error("Something went wrong", error);
});
next();
} else {
next();
}
});
} else {
next();
}
},
():void => {
complete();
}
]);
}
| {
"content_hash": "0f286972e16f7a3296285720ba1b1f29",
"timestamp": "",
"source": "github",
"line_count": 318,
"max_line_length": 107,
"avg_line_length": 42.83647798742138,
"alnum_prop": 0.4246072529731317,
"repo_name": "rodzewich/playground",
"id": "9565ec8def7dc9ade767306d14b4fa26a7a57025",
"size": "13809",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/routes/sass.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3610"
},
{
"name": "CoffeeScript",
"bytes": "45"
},
{
"name": "HTML",
"bytes": "40043"
},
{
"name": "JavaScript",
"bytes": "5072509"
},
{
"name": "PHP",
"bytes": "3319"
},
{
"name": "Protocol Buffer",
"bytes": "678"
},
{
"name": "Shell",
"bytes": "476"
},
{
"name": "TypeScript",
"bytes": "20124847"
}
],
"symlink_target": ""
} |
package generated.zcsclient.mail;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for modifyOutgoingFilterRulesRequest complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="modifyOutgoingFilterRulesRequest">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="filterRules">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="filterRule" type="{urn:zimbraMail}filterRule" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "modifyOutgoingFilterRulesRequest", propOrder = {
"filterRules"
})
public class testModifyOutgoingFilterRulesRequest {
@XmlElement(required = true)
protected testModifyOutgoingFilterRulesRequest.FilterRules filterRules;
/**
* Gets the value of the filterRules property.
*
* @return
* possible object is
* {@link testModifyOutgoingFilterRulesRequest.FilterRules }
*
*/
public testModifyOutgoingFilterRulesRequest.FilterRules getFilterRules() {
return filterRules;
}
/**
* Sets the value of the filterRules property.
*
* @param value
* allowed object is
* {@link testModifyOutgoingFilterRulesRequest.FilterRules }
*
*/
public void setFilterRules(testModifyOutgoingFilterRulesRequest.FilterRules value) {
this.filterRules = value;
}
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="filterRule" type="{urn:zimbraMail}filterRule" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"filterRule"
})
public static class FilterRules {
protected List<testFilterRule> filterRule;
/**
* Gets the value of the filterRule property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the filterRule property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getFilterRule().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link testFilterRule }
*
*
*/
public List<testFilterRule> getFilterRule() {
if (filterRule == null) {
filterRule = new ArrayList<testFilterRule>();
}
return this.filterRule;
}
}
}
| {
"content_hash": "ac5b7707b777b22dcbd2c5152549347e",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 122,
"avg_line_length": 29.842105263157894,
"alnum_prop": 0.5956160241874527,
"repo_name": "nico01f/z-pec",
"id": "a6b64bd02917a70eeb6ecfe333e41b968185b02a",
"size": "3969",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ZimbraSoap/src/wsdl-test/generated/zcsclient/mail/testModifyOutgoingFilterRulesRequest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "18110"
},
{
"name": "C",
"bytes": "61139"
},
{
"name": "C#",
"bytes": "1461640"
},
{
"name": "C++",
"bytes": "723279"
},
{
"name": "CSS",
"bytes": "2648118"
},
{
"name": "Groff",
"bytes": "15389"
},
{
"name": "HTML",
"bytes": "83875860"
},
{
"name": "Java",
"bytes": "49998455"
},
{
"name": "JavaScript",
"bytes": "39307223"
},
{
"name": "Makefile",
"bytes": "13060"
},
{
"name": "PHP",
"bytes": "4263"
},
{
"name": "PLSQL",
"bytes": "17047"
},
{
"name": "Perl",
"bytes": "2030870"
},
{
"name": "PowerShell",
"bytes": "1485"
},
{
"name": "Python",
"bytes": "129210"
},
{
"name": "Shell",
"bytes": "575209"
},
{
"name": "XSLT",
"bytes": "20635"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2020 Kurt Aaholst <[email protected]>
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.
-->
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/slider_down_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="12dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:srcCompat="@drawable/ic_volume_down"/>
<com.google.android.material.slider.Slider
android:id="@+id/slider"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@id/slider_down_icon"
app:layout_constraintEnd_toStartOf="@id/slider_up_icon"
android:stepSize="1"
/>
<ImageView
android:id="@+id/slider_up_icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:padding="12dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/ic_volume_up"/>
</androidx.constraintlayout.widget.ConstraintLayout>
| {
"content_hash": "8276b9879efd2562c2a1633b9ff6c214",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 73,
"avg_line_length": 38.77358490566038,
"alnum_prop": 0.6627737226277373,
"repo_name": "kaaholst/android-squeezer",
"id": "f332426ea5c0104c3b12553dbb0b7f1e4208d48f",
"size": "2055",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "Squeezer/src/main/res/layout/slider_item.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "8634"
},
{
"name": "Java",
"bytes": "1077555"
}
],
"symlink_target": ""
} |
FactoryGirl.define do
factory :keyword_group_main_entry do
keyword_group nil
main_entry nil
end
end
| {
"content_hash": "feb22e956f0818b27e9dd5cbd1e026e8",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 38,
"avg_line_length": 18.666666666666668,
"alnum_prop": 0.7321428571428571,
"repo_name": "UMNLibraries/ikidowinan",
"id": "db0a206c7505e03e2603f55e525476783b95285b",
"size": "182",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/factories/main_entry_keyword_groups.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "22806"
},
{
"name": "CoffeeScript",
"bytes": "261"
},
{
"name": "Dockerfile",
"bytes": "1558"
},
{
"name": "HTML",
"bytes": "161411"
},
{
"name": "JavaScript",
"bytes": "71211"
},
{
"name": "Ruby",
"bytes": "499120"
}
],
"symlink_target": ""
} |
\chapter{Functions and Graphs}
\section{Slope}
Slope defines the average rate of change on a function in a given interval,
\(\Delta x\) (this expression is defined as $x_2-x_1$).
Consider a function $f(x)$. $f$ takes in x-coordinates, and spits out
corresponding y-coordinates, creating a set of ordered pairs that produces a
line, curve, or otherwise.
The formal definition of slope is given as follows:
\begin{equation}
m=\frac{f(x_2)-f(x_1)}{x_2-x_1}
\end{equation}
\subsection{Point-slope form}
Given the coordinate pair of some point in the x-y plane, and the slope of any
arbitrary line $m$, we can develop an equation for the line that has the slope
$m$ and goes through the coordinate $(x, y)$.
The general equation of that line is given as follows:
\begin{equation}
y-y_1=m(x-x_1)
\end{equation}
\subsection{Sketching lines}
The general equation of a linear line is as follows:
\begin{equation}
y=mx+b
\end{equation}
Therefore, the y-intercept is given when $x=0$. To solve for the y-intercept of
the line given above, we evaluate it, plugging $0$ in for $x$, producing a
coordinate pair of $(0, f(0))$.
To sketch a line, preform the following steps:
\begin{enumerate}
\item{Find the coordinate of the y-intercept of the graph, according to the rule
given above}
\item{Sketch that location into the coordinate plane}
\item{Construct the two adjacent points on the plane according to the slope $m$
and the definition of slope}
\item{Connect the dots}
\end{enumerate}
\subsection{Properties of Slope}
Two lines are parallel iff the following condition is met: $m_1=m_2$.
\section{Functions}
A function $f$ maps a set of x-coordinates ($A$) to a set of y-coordinates
($B$). Each element in $A$ is mapped to \textit{exactly one} point from the set
$B$.
\begin{itemize}
\item{Each element of $A$ must be matched to an element of $B$}
\item{Some elements of $B$ may not be matched with any elements of $A$}
\item{Two or more elements of $A$ may be matched with the same element $B$}
\item{An element of $A$ can not be matched with more than one distinct element
of $B$}
\end{itemize}
The difference quotient is defined as follows, and becomes important later:
\begin{equation}
\frac{f(x+h)-f(x)}{h}, h \ne 0
\end{equation}
Some formal definitions follow:
\begin{description}
\item[Function]{a relationship between two variables such that to each value of
the independent variable there is exactly one value of the dependent variable}
\item[Function notation]{$y=f(x)$}
\item[Domain]{the set of values $x$ for which $f$ can produce real values}
\item[Range]{the set of values that $f$ can produce for all given $x$ in the
domain}
\item[Implied domain]{the set of real numbers that satisfy the expression for
which $f$ is defined upon}
\end{description}
\section{Graphs of functions}
A function can be defined on any given interval as one of three things:
increasing, decreasing, or constant. The classifications of each follow:
For any interval $x_1$, $x_2$...
\begin{itemize}
\item The function is increasing for all $x$ such that $f(x_1)<f(x_2)$
\item The function is decreasing for all $x$ such that $f(x_1)>f(x_2)$
\item The function is constant for all $x$ such that $f(x_1)=f(x_2)$
\end{itemize}
A function has a relative minimum when there exists an interval $(x_1,x_2)$ such
that there is an $a$ that $x_1<x<x_2$ and $f(a) \leq f(x)$.
Conversly, a function has a relative maximum when there exists an interval
$(x_1,x_2)$ such that there is an $a$ that $x_1<x<x_2$ and $f(a) \geq f(x)$.
\subsection{Even and Odd functions}
\begin{itemize}
\item A function is even such that for all $x$ in the domain of $f$,
$f(-x)=f(x)$
\item A function is odd such that for all $x$ in the domain of $f$,
$f(-x)=-f(x)$
\end{itemize}
\section{Translations}
There are several types of translations that can be applied to parent functions
and what will become their "children". For a parent function $f$, you can
produce a child function $g$ such that $g$ is defined in terms of $f(x)$. The
simple translations follow:
\begin{enumerate}
\item Vertical shift $c$ units upwards: $g(x)=f(x)+c$
\item Vertical shift $c$ units downwards: $g(x)=f(x)-c$
\item Horizontal shift $c$ units to the left: $g(x)=f(x+c)$
\item Horizontal shift $c$ units to the right: $g(x)=f(x-c)$
\end{enumerate}
To reflect a function across an axis, take the following advice:
\begin{enumerate}
\item A reflection in the $x$-axis for a function $f$: $g(x)=-f(x)$
\item A reflection in the $y$-axis for a function $f$: $g(x)=f(-x)$
\end{enumerate}
To stretch or shirnk a function $g(x)$ in terms of $f(x)$, simply multiply $f$
by a scalar $c$.
\section{Combinations of Functions}
There are several ways that you can combine two functions $f$ and $g$ (for
example) to produce a new, composite function of the two:
\begin{enumerate}
\item Sum: $(f+g)(x)=f(x)+g(x)$
\item Difference: $(f-g)(x)=f(x)-g(x)$
\item Product: $(fg)(x)=f(x)*g(x)$
\item Quotient: $\frac{f}{g}(x)=\frac{f(x)}{g(x)}$
\end{enumerate}
\subsection{Composite Functions}
A composite function of $f$ and $g$ is defined as follows: $f(g(x))$.
Therefore, the range of $g$ must be limited to the domain of $f$ so that no $x$
values can be passed to the composite function that are invalid.
\section{Inverse Functions}
Two functions $f$, and $g$ are considered to be inverses of each other, iff both
of the following two conditions are met:
\begin{enumerate}
\item $f(g(x))=x$ for all $x$ in the domain of $g(x)$.
\item $g(f(x))=x$ for all $x$ in the domain of $f(x)$.
\end{enumerate}
To find an inverse function algebraically, preform the following steps:
\begin{enumerate}
\item Use the Horizontal Line Test to determine if $f$ has an inverse ($f^-1$)
\begin{itemize}
\item (If it doesn't, limit the domain of $f$ so that it does.)
\end{itemize}
\item{Plug in $f^-1(x)$ into the original function and isolate}
\end{enumerate}
| {
"content_hash": "f0cc88561cec6cb2f6f4850abee3a168",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 80,
"avg_line_length": 36.825,
"alnum_prop": 0.718601493550577,
"repo_name": "ttaylorr/finals",
"id": "fcd51d5f6cc07fc4c3293ea29aa196593a224b58",
"size": "5892",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pre_calculus_h/chapters/1_functions.tex",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "139"
},
{
"name": "TeX",
"bytes": "35483"
}
],
"symlink_target": ""
} |
package com.twitter.scalding
import org.specs._
import org.scalacheck.Arbitrary
import org.scalacheck.Arbitrary.arbitrary
import org.scalacheck.Properties
import org.scalacheck.Prop.forAll
import org.scalacheck.Gen._
import scala.util.Success
class ConfigTest extends Specification {
"A Config" should {
"cascadingAppJar works" in {
val cls = getClass
Config.default.setCascadingAppJar(cls)
.getCascadingAppJar must be_==(Some(Success(cls)))
}
"default has serialization set" in {
val sers = Config.default.get("io.serializations").get.split(",").toList
sers.last must be_==(classOf[com.twitter.chill.hadoop.KryoSerialization].getName)
}
"default has chill configured" in {
Config.default.get(com.twitter.chill.config.ConfiguredInstantiator.KEY).isDefined must beTrue
}
"setting timestamp twice does not change it" in {
val date = RichDate.now
val (oldDate, newConf) = Config.empty.maybeSetSubmittedTimestamp(date)
oldDate.isEmpty must beTrue
newConf.getSubmittedTimestamp must be_==(Some(date))
val (stillOld, new2) = newConf.maybeSetSubmittedTimestamp(date + Seconds(1))
stillOld must be_==(Some(date))
new2 must be_==(newConf)
}
}
}
object ConfigProps extends Properties("Config") {
implicit def arbConfig: Arbitrary[Config] =
Arbitrary(Arbitrary.arbitrary[Map[String, String]].map(Config(_)))
property(".+(k, v).get(k) == Some(v)") = forAll { (c: Config, k: String, v: String) =>
(c + (k, v)).get(k) == Some(v)
}
property(".-(k).get(k) == None") = forAll { (c: Config, k: String) =>
(c - k).get(k) == None
}
property("++ unions keys") = forAll { (c1: Config, c2: Config) =>
(c1 ++ c2).toMap.keySet == (c1.toMap.keySet | c2.toMap.keySet)
}
property("++ == c2.orElse(c1)") = forAll { (c1: Config, c2: Config, keys: Set[String]) =>
val merged = c1 ++ c2
val testKeys = c1.toMap.keySet | c2.toMap.keySet ++ keys
testKeys.forall { k => merged.get(k) == c2.get(k).orElse(c1.get(k)) }
}
}
| {
"content_hash": "8e4fd1b112282430db0aa69a618153cf",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 99,
"avg_line_length": 36.03508771929825,
"alnum_prop": 0.6611489776046738,
"repo_name": "lucamilanesio/scalding",
"id": "048979442b1983182b49c933f492cacfa33b39bc",
"size": "2609",
"binary": false,
"copies": "3",
"ref": "refs/heads/develop",
"path": "scalding-core/src/test/scala/com/twitter/scalding/ConfigTest.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "49881"
},
{
"name": "Ruby",
"bytes": "53663"
},
{
"name": "Scala",
"bytes": "1256273"
},
{
"name": "Shell",
"bytes": "19175"
}
],
"symlink_target": ""
} |
import os
import tempfile
import textwrap
def test_options_from_env_vars(script):
"""
Test if ConfigOptionParser reads env vars (e.g. not using PyPI here)
"""
script.environ['PIP_NO_INDEX'] = '1'
result = script.pip('install', '-vvv', 'INITools', expect_error=True)
assert "Ignoring indexes:" in result.stdout, str(result)
assert (
"DistributionNotFound: No distributions at all found for INITools"
in result.stdout
)
def test_command_line_options_override_env_vars(script, virtualenv):
"""
Test that command line options override environmental variables.
"""
script.environ['PIP_INDEX_URL'] = 'http://b.pypi.python.org/simple/'
result = script.pip('install', '-vvv', 'INITools', expect_error=True)
assert (
"Getting page http://b.pypi.python.org/simple/INITools"
in result.stdout
)
virtualenv.clear()
result = script.pip(
'install', '-vvv', '--index-url', 'http://download.zope.org/ppix',
'INITools',
expect_error=True,
)
assert "b.pypi.python.org" not in result.stdout
assert "Getting page http://download.zope.org/ppix" in result.stdout
def test_env_vars_override_config_file(script, virtualenv):
"""
Test that environmental variables override settings in config files.
"""
fd, config_file = tempfile.mkstemp('-pip.cfg', 'test-')
try:
_test_env_vars_override_config_file(script, virtualenv, config_file)
finally:
# `os.close` is a workaround for a bug in subprocess
# http://bugs.python.org/issue3210
os.close(fd)
os.remove(config_file)
def _test_env_vars_override_config_file(script, virtualenv, config_file):
# set this to make pip load it
script.environ['PIP_CONFIG_FILE'] = config_file
# It's important that we test this particular config value ('no-index')
# because there is/was a bug which only shows up in cases in which
# 'config-item' and 'config_item' hash to the same value modulo the size
# of the config dictionary.
(script.scratch_path / config_file).write(textwrap.dedent("""\
[global]
no-index = 1
"""))
result = script.pip('install', '-vvv', 'INITools', expect_error=True)
assert (
"DistributionNotFound: No distributions at all found for INITools"
in result.stdout
)
script.environ['PIP_NO_INDEX'] = '0'
virtualenv.clear()
result = script.pip('install', '-vvv', 'INITools', expect_error=True)
assert "Successfully installed INITools" in result.stdout
def test_command_line_append_flags(script, virtualenv, data):
"""
Test command line flags that append to defaults set by environmental
variables.
"""
script.environ['PIP_FIND_LINKS'] = 'http://pypi.pinaxproject.com'
result = script.pip('install', '-vvv', 'INITools', expect_error=True)
assert (
"Analyzing links from page http://pypi.pinaxproject.com"
in result.stdout
)
virtualenv.clear()
result = script.pip(
'install', '-vvv', '--find-links', data.find_links, 'INITools',
expect_error=True,
)
assert (
"Analyzing links from page http://pypi.pinaxproject.com"
in result.stdout
)
assert "Skipping link %s" % data.find_links in result.stdout
def test_command_line_appends_correctly(script, data):
"""
Test multiple appending options set by environmental variables.
"""
script.environ['PIP_FIND_LINKS'] = (
'http://pypi.pinaxproject.com %s' % data.find_links
)
result = script.pip('install', '-vvv', 'INITools', expect_error=True)
assert (
"Analyzing links from page http://pypi.pinaxproject.com"
in result.stdout
), result.stdout
assert "Skipping link %s" % data.find_links in result.stdout
def test_config_file_override_stack(script, virtualenv):
"""
Test config files (global, overriding a global config with a
local, overriding all with a command line flag).
"""
fd, config_file = tempfile.mkstemp('-pip.cfg', 'test-')
try:
_test_config_file_override_stack(script, virtualenv, config_file)
finally:
# `os.close` is a workaround for a bug in subprocess
# http://bugs.python.org/issue3210
os.close(fd)
os.remove(config_file)
def _test_config_file_override_stack(script, virtualenv, config_file):
# set this to make pip load it
script.environ['PIP_CONFIG_FILE'] = config_file
(script.scratch_path / config_file).write(textwrap.dedent("""\
[global]
index-url = http://download.zope.org/ppix
"""))
result = script.pip('install', '-vvv', 'INITools', expect_error=True)
assert (
"Getting page http://download.zope.org/ppix/INITools" in result.stdout
)
virtualenv.clear()
(script.scratch_path / config_file).write(textwrap.dedent("""\
[global]
index-url = http://download.zope.org/ppix
[install]
index-url = https://pypi.gocept.com/
"""))
result = script.pip('install', '-vvv', 'INITools', expect_error=True)
assert "Getting page https://pypi.gocept.com/INITools" in result.stdout
result = script.pip(
'install', '-vvv', '--index-url', 'http://pypi.python.org/simple',
'INITools',
expect_error=True,
)
assert (
"Getting page http://download.zope.org/ppix/INITools"
not in result.stdout
)
assert "Getting page https://pypi.gocept.com/INITools" not in result.stdout
assert (
"Getting page http://pypi.python.org/simple/INITools" in result.stdout
)
def test_log_file_no_directory():
"""
Test opening a log file with no directory name.
"""
from pip.basecommand import open_logfile
fp = open_logfile('testpip.log')
fp.write('can write')
fp.close()
assert os.path.exists(fp.name)
os.remove(fp.name)
def test_options_from_venv_config(script, virtualenv):
"""
Test if ConfigOptionParser reads a virtualenv-local config file
"""
from pip.locations import default_config_basename
conf = "[global]\nno-index = true"
ini = virtualenv.location / default_config_basename
with open(ini, 'w') as f:
f.write(conf)
result = script.pip('install', '-vvv', 'INITools', expect_error=True)
assert "Ignoring indexes:" in result.stdout, str(result)
assert (
"DistributionNotFound: No distributions at all found for INITools"
in result.stdout
)
| {
"content_hash": "41bf374a886ae2e07eb20bdd2570ddde",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 79,
"avg_line_length": 33.01010101010101,
"alnum_prop": 0.643359853121175,
"repo_name": "1stvamp/pip",
"id": "ea19a5ca9abd3eb8eb5b83d73ff502464491897e",
"size": "6536",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "tests/functional/test_install_config.py",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
Copyright 2016 Goldman Sachs.
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.
-->
<ManagedObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/objectmanager.xsd">
<Templates>tetahij,wunopi,noki,key,nuzikuzu,interface</Templates>
<PackageName>com.gs.fw.lilu.wute.domain.transaction</PackageName>
<ImportPackageName>com.gs.fw.lilu.wute.domain.transaction.persistence.JihumuJimusEtanezIyurinaqIcugUheq</ImportPackageName>
<ClassName>NehomiNovuwOpudekItepomabOpub</ClassName>
<DefaultTable>GOZO_YARA_LUVU</DefaultTable>
<SchemaName>mut</SchemaName>
<DatabaseName>gozo_rum</DatabaseName>
<ReadOnly>true</ReadOnly>
<ExplicitColumnNamesForSelect>true</ExplicitColumnNamesForSelect>
<PrimaryKeyAttribute keyClass="SoluweMobitEfufuvEviluhafOkitEto">
<Attribute columnName="GEZUBO_MIBIKANE" javaType="String" name="dicuzaHovapesu" sqlType="XefeTewesa"/>
</PrimaryKeyAttribute>
</ManagedObject>
| {
"content_hash": "fe77181524201782aea02ba25c6b8942",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 132,
"avg_line_length": 51.8,
"alnum_prop": 0.7644787644787645,
"repo_name": "gs-rezaem/gs-xsd2bean",
"id": "d876329740677cb0328bc56741541076f963e8da",
"size": "1554",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/test/testdata/fwcommon/objectmanager/FailedTradeSettleLocationType.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "4478"
},
{
"name": "Java",
"bytes": "478865"
},
{
"name": "Shell",
"bytes": "4940"
}
],
"symlink_target": ""
} |
from xobj import xobj
class AbstractOvfObject(object):
prefix = ''
def __init__(self, **kwargs):
for key, val in self.__class__.__dict__.iteritems():
if type(val) == list:
setattr(self, key, [])
elif type(val) == str:
setattr(self, key, val)
for key, val in kwargs.iteritems():
ovfKey = self.prefix + key
if (hasattr(self.__class__, ovfKey) or
(hasattr(self, '_xobj') and ovfKey in (self._xobj.attributes))):
setattr(self, ovfKey, val)
else:
raise TypeError, 'unknown constructor parameter %s' % key
def __setattr__(self, name, value):
if not name.startswith('_') and not name.startswith(self.prefix):
name = self.prefix + name
object.__setattr__(self, name, value)
def __getattr__(self, name):
if not name.startswith('_') and not name.startswith(self.prefix):
name = self.prefix + name
return object.__getattribute__(self, name)
class RasdObject(AbstractOvfObject):
prefix = 'rasd_'
class OvfObject(AbstractOvfObject):
prefix = 'ovf_'
class VssdObject(AbstractOvfObject):
prefix = 'vssd_'
class Item(RasdObject):
pass
class System(VssdObject):
_xobj = xobj.XObjMetadata(
elements = [ 'vssd_ElementName', 'vssd_InstanceID',
'vssd_VirtualSystemType' ] )
class AbstractDiskFormat(object):
def __str__(self):
if self.ovf_compressed:
return self.ovf_format + "#compressed"
return self.ovf_format
def __init__(self, compressed = False):
assert(self.ovf_format)
self.ovf_compressed = compressed
class DiskFormatVmdk(AbstractDiskFormat):
ovf_format = "http://www.vmware.com/specifications/vmdk.html"
class DiskFormat(AbstractDiskFormat):
def __init__(self, s, compressed = False):
if s.endswith('#compressed'):
# we shouldn't parse this and get it passed in
assert(not compressed)
compressed = True
s = s[:-11]
self.ovf_format = s
AbstractDiskFormat.__init__(self, compressed)
def __str__(self):
if self.ovf_compressed:
return self.ovf_format + "#compressed"
return self.ovf_format
class Disk(OvfObject):
_xobj = xobj.XObjMetadata(
attributes = {
'ovf_capacity' : long,
'ovf_capacityAllocationUnits' : long,
'ovf_diskId' : str,
'ovf_fileRef' : xobj.XIDREF,
'ovf_format' : DiskFormat,
'ovf_parentRef' : str,
'ovf_populatedSize' : long,
} )
class FileReference(OvfObject):
_xobj = xobj.XObjMetadata(
attributes = {
"ovf_chunkSize" : long,
"ovf_compression" : str,
"ovf_href" : str,
"ovf_id" : str,
"ovf_size" : long,
} )
class DiskSection(OvfObject):
_xobj = xobj.XObjMetadata(
elements = [ 'ovf_Info', 'ovf_Disk' ])
ovf_Info = str
ovf_Disk = [ Disk ]
class Network(OvfObject):
_xobj = xobj.XObjMetadata(
elements = [ 'ovf_Description' ],
attributes = { "ovf_id" : str,
"ovf_name" : xobj.XID } )
class NetworkSection(OvfObject):
_xobj = xobj.XObjMetadata(
elements = [ 'ovf_Info', 'ovf_Network' ])
ovf_Info = str
ovf_Network = [ Network ]
class VirtualHardwareSection(OvfObject):
_xobj = xobj.XObjMetadata(
elements = [ 'ovf_Info', 'ovf_System' , 'ovf_Item'])
ovf_Info = str
ovf_System = System
ovf_Item = [ Item ]
def addItem(self, item):
self.ovf_Item.append(item)
class Property(OvfObject):
_xobj = xobj.XObjMetadata(attributes = { 'ovf_key' : str,
'ovf_type' : str } )
class Category(OvfObject):
pass
class ProductSection(OvfObject):
_xobj = xobj.XObjMetadata(
elements = [ 'ovf_Info', 'ovf_Product', 'ovf_Vendor',
'ovf_Version', 'ovf_FullVersion',
'ovf_ProductUrl', 'ovf_VendorUrl',
'ovf_Icon', 'ovf_Category', 'ovf_Property'])
ovf_Category = [ Category ]
ovf_Property = [ Property ]
def addProperty(self, property):
self.ovf_Property.append(property)
class EulaSection(OvfObject):
_xobj = xobj.XObjMetadata(
elements = [ 'ovf_Info', 'ovf_License' ])
class OperatingSystemSection(OvfObject):
_xobj = xobj.XObjMetadata(
attributes = { 'ovf_id' : str, 'ovf_version' : str, 'vmw_osType' : str },
elements = [ 'ovf_Info',
'ovf_Description' ] )
class VirtualSystem(OvfObject):
_xobj = xobj.XObjMetadata(
attributes = { 'ovf_id' : str, },
elements = [ 'ovf_Info',
'ovf_EulaSection',
'ovf_ProductSection',
'ovf_OperatingSystemSection',
'ovf_VirtualHardwareSection', ] )
ovf_EulaSection = EulaSection
ovf_ProductSection = ProductSection
ovf_OperatingSystemSection = OperatingSystemSection
ovf_VirtualHardwareSection = [ VirtualHardwareSection ]
def addVirtualHardwareSection(self, vhws):
self.ovf_VirtualHardwareSection.append(vhws)
class ResourceAllocationSection(OvfObject):
_xobj = xobj.XObjMetadata(
elements = [ 'ovf_Info', 'ovf_Item' ])
ovf_Item = [ Item ]
def addItem(self, item):
self.ovf_Item.append(item)
class VirtualSystemCollection(OvfObject):
_xobj = xobj.XObjMetadata(
elements = [ 'ovf_Info', 'ovf_ResourceAllocationSection',
'ovf_VirtualSystem' ],
attributes = { 'ovf_id' : str})
ovf_Info = str
ovf_ResourceAllocationSection = ResourceAllocationSection
ovf_VirtualSystem = [ VirtualSystem ]
def addVirtualSystem(self, vs):
self.ovf_VirtualSystem.append(vs)
class ReferencesSection(OvfObject):
ovf_File = [ FileReference ]
class Ovf(OvfObject):
_xobj = xobj.XObjMetadata(
elements = [ 'ovf_References',
'ovf_DiskSection',
'ovf_NetworkSection',
'ovf_VirtualSystemCollection'
] )
ovf_References = ReferencesSection
ovf_DiskSection = DiskSection
ovf_NetworkSection = NetworkSection
ovf_VirtualSystemCollection = VirtualSystemCollection
def addDisk(self, d):
if d.ovf_fileRef not in self.ovf_References.ovf_File:
self.addFileReference(d.ovf_fileRef)
self.ovf_DiskSection.ovf_Disk.append(d)
def addNetwork(self, n):
self.ovf_NetworkSection.ovf_Network.append(n)
def addFileReference(self, r):
self.ovf_References.ovf_File.append(r)
def addVirtualSystem(self, vs):
self.ovf_VirtualSystemCollection.ovf_VirtualSystem.append(vs)
def toxml(self):
return self._doc.toxml(nsmap = self._doc.nameSpaceMap)
| {
"content_hash": "6556d884e63c01a3d0da7f3b0b4a2c38",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 85,
"avg_line_length": 29.437007874015748,
"alnum_prop": 0.5506219071820249,
"repo_name": "sassoftware/pyovf",
"id": "c4d30a88250135798320a17445defdc98be457c7",
"size": "8081",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pyovf/ovf.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "2663"
},
{
"name": "Python",
"bytes": "33840"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 The Android Open Source Project
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.
-->
<!-- Used as the canonical button shape. -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/abc_btn_default_mtrl_shape" />
</layer-list>
<!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/mnc-supportlib-release/frameworks/support/v7/appcompat/res/drawable/abc_btn_colored_material.xml --><!-- From: file:/Users/Robban/Dev/Other/PlantIT/Soil/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.0/res/drawable/abc_btn_colored_material.xml --> | {
"content_hash": "0d5d2a9483def9aa80b98dbe710697a8",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 399,
"avg_line_length": 57.77272727272727,
"alnum_prop": 0.7403619197482297,
"repo_name": "SevenStringArgs/ColdChainSensors",
"id": "076c9de6dbbf37492d20b3c8edaba76be8e714f9",
"size": "1271",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gateway/app/build/intermediates/res/merged/debug/drawable/abc_btn_colored_material.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Arduino",
"bytes": "5222"
},
{
"name": "CSS",
"bytes": "22542"
},
{
"name": "Go",
"bytes": "10918"
},
{
"name": "HTML",
"bytes": "11612"
},
{
"name": "Java",
"bytes": "490024"
},
{
"name": "JavaScript",
"bytes": "13121"
},
{
"name": "Makefile",
"bytes": "225"
}
],
"symlink_target": ""
} |
<?php
/**
* Adminコントローラー
*
* Twitterスクレイピングを表示する機能
*
*
*/
class Controller_Login_Admin_Twitterscraping extends Controller_Login_Template {
public function action_index() {
// ログインチェック
$login_check = Model_Login_Basis::login_check();
if($login_check) {
// viewテンプレート読み込み
$this->login_admin_template = View::forge('login/admin/template');
$this->login_admin_template->view_data = array(
'title' => 'Twitterスクレイピング|アドミン|ログイン|'.TITLE,
'content' => View::forge('login/admin/list/list'),
);
// html生成
$twitterscraping_html = View::forge('login/admin/twitterscraping/twitterscraping');
// コンテンツ挿入
$this->login_admin_template->view_data["content"]->set('content_data',array(
'content_html' => $twitterscraping_html,
),false);
return $this->login_admin_template;
}
// ログインしていない場合
else {
header('Location: '.HTTP.'');
exit;
}
}
}
| {
"content_hash": "46f05cbfaaa0d0e3acd5011b9e5bf210",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 86,
"avg_line_length": 25.47222222222222,
"alnum_prop": 0.6401308615049073,
"repo_name": "mtoksuy/sharetube",
"id": "1b3fadc5fa4fa424a04a4580014d80bbb685fb2c",
"size": "1069",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "fuel/app/classes/controller/login/admin/twitterscraping.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "713013"
},
{
"name": "HTML",
"bytes": "2524045"
},
{
"name": "JavaScript",
"bytes": "568540"
},
{
"name": "PHP",
"bytes": "4128452"
},
{
"name": "Ruby",
"bytes": "1323"
}
],
"symlink_target": ""
} |
package populator
// ErrNoSuchPopulator implements the error interface
type ErrNoSuchPopulator string
func (e ErrNoSuchPopulator) Error() string { return string(e) }
| {
"content_hash": "29f9e0db2e03a2448983173f56a830ed",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 63,
"avg_line_length": 28,
"alnum_prop": 0.8095238095238095,
"repo_name": "nerdalize/nerd",
"id": "b4f937fd2a3c1f0071d3af543326e19ae78457df",
"size": "168",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pkg/populator/errors.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "919"
},
{
"name": "Go",
"bytes": "507191"
},
{
"name": "Python",
"bytes": "1609"
},
{
"name": "Shell",
"bytes": "8658"
}
],
"symlink_target": ""
} |
#include "Tudat/Astrodynamics/Propagators/rotationalMotionModifiedRodriguesParametersStateDerivative.h"
namespace tudat
{
namespace propagators
{
//! Function to obtain the time derivative of modified Rodrigues parameters of body-fixed to inertial frame.
Eigen::Vector4d calculateModifiedRodriguesParametersDerivative(
const Eigen::Vector4d& currentModifiedRodriguesParametersToBaseFrame,
const Eigen::Vector3d& angularVelocityVectorInBodyFixedFrame )
{
// Declare eventual output vector
Eigen::Vector4d modifiedRodriguesParametersDerivative = Eigen::Vector4d::Zero( );
// Get intermediate variables
Eigen::Vector3d modifiedRodriguesParametersVector = currentModifiedRodriguesParametersToBaseFrame.segment( 0, 3 );
// Compute kinematic equation, i.e., derivative of modified Rodrigues parameters (also valid for SMRP)
Eigen::Matrix3d skewModifiedRodriguesParametersVectorMatrix =
linear_algebra::getCrossProductMatrix( modifiedRodriguesParametersVector );
modifiedRodriguesParametersDerivative.segment( 0, 3 ) = 0.5 * (
0.5 * ( 1.0 - std::pow( modifiedRodriguesParametersVector.norm( ), 2 ) ) * angularVelocityVectorInBodyFixedFrame +
( skewModifiedRodriguesParametersVectorMatrix + modifiedRodriguesParametersVector *
modifiedRodriguesParametersVector.transpose( ) ) * angularVelocityVectorInBodyFixedFrame );
// Give output
return modifiedRodriguesParametersDerivative;
}
template class RotationalMotionModifiedRodriguesParametersStateDerivative< double, double >;
#if( BUILD_EXTENDED_PRECISION_PROPAGATION_TOOLS )
template class RotationalMotionModifiedRodriguesParametersStateDerivative< long double, double >;
template class RotationalMotionModifiedRodriguesParametersStateDerivative< double, Time >;
template class RotationalMotionModifiedRodriguesParametersStateDerivative< long double, Time >;
#endif
} // namespace propagators
} // namespace tudat
| {
"content_hash": "8f4086f464db969977e08bf1e4cac386",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 130,
"avg_line_length": 45.06818181818182,
"alnum_prop": 0.7927382753403933,
"repo_name": "DominicDirkx/tudat",
"id": "89efd5fae452729efe0589a5388e96cbe458d81d",
"size": "2415",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Tudat/Astrodynamics/Propagators/rotationalMotionModifiedRodriguesParametersStateDerivative.cpp",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "8026"
},
{
"name": "C++",
"bytes": "12614398"
},
{
"name": "CMake",
"bytes": "185505"
},
{
"name": "HCL",
"bytes": "30891"
},
{
"name": "MATLAB",
"bytes": "2799"
}
],
"symlink_target": ""
} |
<?php
// including the config file
include('config.php');
$pdo = connect();
// clear table before import
$pdo->exec("TRUNCATE TABLE lista");
$csv_file = $_FILES['csv_file']['tmp_name'];
if (is_file($csv_file)) {
$input = fopen($csv_file, 'a+');
// if the csv file contain the table header leave this line
$row = fgetcsv($input, 1024, ';'); // here you got the header
while ($row = fgetcsv($input, 1024, ';')) {
// check and fix values
// remove . and -
$rem = array("-", ".", ",", "'");
//upper all characters
$nome = strtoupper($row[1]);
$nome = str_replace($rem, '', $nome);
$cpf = str_replace($rem, '', $row[2]);
$conta = str_replace($rem, '', $row[3]);
$valor = str_replace($rem, '', $row[4]);
// insert into the database
$sql = 'INSERT INTO lista(nome, cpf, conta, valor) VALUES(:nome, :cpf, :conta, :valor)';
$query = $pdo->prepare($sql);
$query->bindParam(':nome', $nome, PDO::PARAM_STR);
$query->bindParam(':cpf', $cpf, PDO::PARAM_STR);
$query->bindParam(':conta', $conta, PDO::PARAM_STR);
$query->bindParam(':valor', $valor, PDO::PARAM_INT);
$query->execute();
}
}
// redirect to the index page
header('location: index.php');
?>
| {
"content_hash": "0396d73ed11312722736dd3ab1b93ffe",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 90,
"avg_line_length": 27.74418604651163,
"alnum_prop": 0.5926236378876781,
"repo_name": "gugoan/importacao",
"id": "47b658fcbd2250c02ef58b114239f06cc86b3611",
"size": "1193",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "import.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "122891"
},
{
"name": "JavaScript",
"bytes": "3452"
},
{
"name": "PHP",
"bytes": "13808"
}
],
"symlink_target": ""
} |
using bookmarks::BookmarkModel;
using bookmarks::BookmarkNode;
using bookmarks::BookmarkNodeData;
using content::WebContents;
namespace extensions {
namespace bookmark_keys = bookmark_api_constants;
namespace bookmark_manager_private = api::bookmark_manager_private;
namespace CanPaste = api::bookmark_manager_private::CanPaste;
namespace Copy = api::bookmark_manager_private::Copy;
namespace CreateWithMetaInfo =
api::bookmark_manager_private::CreateWithMetaInfo;
namespace Cut = api::bookmark_manager_private::Cut;
namespace Drop = api::bookmark_manager_private::Drop;
namespace GetSubtree = api::bookmark_manager_private::GetSubtree;
namespace GetMetaInfo = api::bookmark_manager_private::GetMetaInfo;
namespace Paste = api::bookmark_manager_private::Paste;
namespace RedoInfo = api::bookmark_manager_private::GetRedoInfo;
namespace RemoveTrees = api::bookmark_manager_private::RemoveTrees;
namespace SetMetaInfo = api::bookmark_manager_private::SetMetaInfo;
namespace SortChildren = api::bookmark_manager_private::SortChildren;
namespace StartDrag = api::bookmark_manager_private::StartDrag;
namespace UndoInfo = api::bookmark_manager_private::GetUndoInfo;
namespace UpdateMetaInfo = api::bookmark_manager_private::UpdateMetaInfo;
namespace {
// Returns a single bookmark node from the argument ID.
// This returns NULL in case of failure.
const BookmarkNode* GetNodeFromString(BookmarkModel* model,
const std::string& id_string) {
int64_t id;
if (!base::StringToInt64(id_string, &id))
return NULL;
return bookmarks::GetBookmarkNodeByID(model, id);
}
// Gets a vector of bookmark nodes from the argument list of IDs.
// This returns false in the case of failure.
bool GetNodesFromVector(BookmarkModel* model,
const std::vector<std::string>& id_strings,
std::vector<const BookmarkNode*>* nodes) {
if (id_strings.empty())
return false;
for (size_t i = 0; i < id_strings.size(); ++i) {
const BookmarkNode* node = GetNodeFromString(model, id_strings[i]);
if (!node)
return false;
nodes->push_back(node);
}
return true;
}
// Recursively create a bookmark_manager_private::BookmarkNodeDataElement from
// a bookmark node. This is by used |BookmarkNodeDataToJSON| when the data comes
// from the current profile. In this case we have a BookmarkNode since we got
// the data from the current profile.
bookmark_manager_private::BookmarkNodeDataElement
CreateNodeDataElementFromBookmarkNode(const BookmarkNode& node) {
bookmark_manager_private::BookmarkNodeDataElement element;
// Add id and parentId so we can associate the data with existing nodes on the
// client side.
element.id.reset(new std::string(base::Int64ToString(node.id())));
element.parent_id.reset(
new std::string(base::Int64ToString(node.parent()->id())));
if (node.is_url())
element.url.reset(new std::string(node.url().spec()));
element.title = base::UTF16ToUTF8(node.GetTitle());
for (int i = 0; i < node.child_count(); ++i) {
element.children.push_back(
CreateNodeDataElementFromBookmarkNode(*node.GetChild(i)));
}
return element;
}
// Recursively create a bookmark_manager_private::BookmarkNodeDataElement from
// a BookmarkNodeData::Element. This is used by |BookmarkNodeDataToJSON| when
// the data comes from a different profile. When the data comes from a different
// profile we do not have any IDs or parent IDs.
bookmark_manager_private::BookmarkNodeDataElement CreateApiNodeDataElement(
const BookmarkNodeData::Element& element) {
bookmark_manager_private::BookmarkNodeDataElement node_element;
if (element.is_url)
node_element.url.reset(new std::string(element.url.spec()));
node_element.title = base::UTF16ToUTF8(element.title);
for (size_t i = 0; i < element.children.size(); ++i) {
node_element.children.push_back(
CreateApiNodeDataElement(element.children[i]));
}
return node_element;
}
// Creates a bookmark_manager_private::BookmarkNodeData from a BookmarkNodeData.
bookmark_manager_private::BookmarkNodeData CreateApiBookmarkNodeData(
Profile* profile,
const BookmarkNodeData& data) {
const base::FilePath& profile_path = profile->GetPath();
bookmark_manager_private::BookmarkNodeData node_data;
node_data.same_profile = data.IsFromProfilePath(profile_path);
if (node_data.same_profile) {
std::vector<const BookmarkNode*> nodes = data.GetNodes(
BookmarkModelFactory::GetForProfile(profile), profile_path);
for (size_t i = 0; i < nodes.size(); ++i) {
node_data.elements.push_back(
CreateNodeDataElementFromBookmarkNode(*nodes[i]));
}
} else {
// We do not have a node IDs when the data comes from a different profile.
for (size_t i = 0; i < data.size(); ++i)
node_data.elements.push_back(CreateApiNodeDataElement(data.elements[i]));
}
return node_data;
}
} // namespace
BookmarkManagerPrivateEventRouter::BookmarkManagerPrivateEventRouter(
content::BrowserContext* browser_context,
BookmarkModel* bookmark_model)
: browser_context_(browser_context), bookmark_model_(bookmark_model) {
bookmark_model_->AddObserver(this);
}
BookmarkManagerPrivateEventRouter::~BookmarkManagerPrivateEventRouter() {
if (bookmark_model_)
bookmark_model_->RemoveObserver(this);
}
void BookmarkManagerPrivateEventRouter::DispatchEvent(
events::HistogramValue histogram_value,
const std::string& event_name,
std::unique_ptr<base::ListValue> event_args) {
EventRouter::Get(browser_context_)
->BroadcastEvent(base::WrapUnique(
new Event(histogram_value, event_name, std::move(event_args))));
}
void BookmarkManagerPrivateEventRouter::BookmarkModelChanged() {}
void BookmarkManagerPrivateEventRouter::BookmarkModelBeingDeleted(
BookmarkModel* model) {
bookmark_model_ = NULL;
}
void BookmarkManagerPrivateEventRouter::OnWillChangeBookmarkMetaInfo(
BookmarkModel* model,
const BookmarkNode* node) {
DCHECK(prev_meta_info_.empty());
if (node->GetMetaInfoMap())
prev_meta_info_ = *node->GetMetaInfoMap();
}
void BookmarkManagerPrivateEventRouter::BookmarkMetaInfoChanged(
BookmarkModel* model,
const BookmarkNode* node) {
const BookmarkNode::MetaInfoMap* new_meta_info = node->GetMetaInfoMap();
bookmark_manager_private::MetaInfoFields changes;
// Identify changed/removed fields:
for (BookmarkNode::MetaInfoMap::const_iterator it = prev_meta_info_.begin();
it != prev_meta_info_.end();
++it) {
if (!new_meta_info) {
changes.additional_properties[it->first] = "";
} else {
BookmarkNode::MetaInfoMap::const_iterator new_meta_field =
new_meta_info->find(it->first);
if (new_meta_field == new_meta_info->end()) {
changes.additional_properties[it->first] = "";
} else if (it->second != new_meta_field->second) {
changes.additional_properties[it->first] = new_meta_field->second;
}
}
}
// Identify added fields:
if (new_meta_info) {
for (BookmarkNode::MetaInfoMap::const_iterator it = new_meta_info->begin();
it != new_meta_info->end();
++it) {
BookmarkNode::MetaInfoMap::const_iterator prev_meta_field =
prev_meta_info_.find(it->first);
if (prev_meta_field == prev_meta_info_.end())
changes.additional_properties[it->first] = it->second;
}
}
prev_meta_info_.clear();
DispatchEvent(events::BOOKMARK_MANAGER_PRIVATE_ON_META_INFO_CHANGED,
bookmark_manager_private::OnMetaInfoChanged::kEventName,
bookmark_manager_private::OnMetaInfoChanged::Create(
base::Int64ToString(node->id()), changes));
}
BookmarkManagerPrivateAPI::BookmarkManagerPrivateAPI(
content::BrowserContext* browser_context)
: browser_context_(browser_context) {
EventRouter* event_router = EventRouter::Get(browser_context);
event_router->RegisterObserver(
this, bookmark_manager_private::OnMetaInfoChanged::kEventName);
}
BookmarkManagerPrivateAPI::~BookmarkManagerPrivateAPI() {}
void BookmarkManagerPrivateAPI::Shutdown() {
EventRouter::Get(browser_context_)->UnregisterObserver(this);
}
static base::LazyInstance<
BrowserContextKeyedAPIFactory<BookmarkManagerPrivateAPI> > g_factory =
LAZY_INSTANCE_INITIALIZER;
// static
BrowserContextKeyedAPIFactory<BookmarkManagerPrivateAPI>*
BookmarkManagerPrivateAPI::GetFactoryInstance() {
return g_factory.Pointer();
}
void BookmarkManagerPrivateAPI::OnListenerAdded(
const EventListenerInfo& details) {
EventRouter::Get(browser_context_)->UnregisterObserver(this);
event_router_.reset(new BookmarkManagerPrivateEventRouter(
browser_context_,
BookmarkModelFactory::GetForProfile(
Profile::FromBrowserContext(browser_context_))));
}
BookmarkManagerPrivateDragEventRouter::BookmarkManagerPrivateDragEventRouter(
Profile* profile,
content::WebContents* web_contents)
: profile_(profile), web_contents_(web_contents) {
BookmarkTabHelper* bookmark_tab_helper =
BookmarkTabHelper::FromWebContents(web_contents_);
bookmark_tab_helper->set_bookmark_drag_delegate(this);
}
BookmarkManagerPrivateDragEventRouter::
~BookmarkManagerPrivateDragEventRouter() {
BookmarkTabHelper* bookmark_tab_helper =
BookmarkTabHelper::FromWebContents(web_contents_);
if (bookmark_tab_helper->bookmark_drag_delegate() == this)
bookmark_tab_helper->set_bookmark_drag_delegate(NULL);
}
void BookmarkManagerPrivateDragEventRouter::DispatchEvent(
events::HistogramValue histogram_value,
const std::string& event_name,
std::unique_ptr<base::ListValue> args) {
EventRouter* event_router = EventRouter::Get(profile_);
if (!event_router)
return;
std::unique_ptr<Event> event(
new Event(histogram_value, event_name, std::move(args)));
event_router->BroadcastEvent(std::move(event));
}
void BookmarkManagerPrivateDragEventRouter::OnDragEnter(
const BookmarkNodeData& data) {
if (!data.is_valid())
return;
DispatchEvent(events::BOOKMARK_MANAGER_PRIVATE_ON_DRAG_ENTER,
bookmark_manager_private::OnDragEnter::kEventName,
bookmark_manager_private::OnDragEnter::Create(
CreateApiBookmarkNodeData(profile_, data)));
}
void BookmarkManagerPrivateDragEventRouter::OnDragOver(
const BookmarkNodeData& data) {
// Intentionally empty since these events happens too often and floods the
// message queue. We do not need this event for the bookmark manager anyway.
}
void BookmarkManagerPrivateDragEventRouter::OnDragLeave(
const BookmarkNodeData& data) {
if (!data.is_valid())
return;
DispatchEvent(events::BOOKMARK_MANAGER_PRIVATE_ON_DRAG_LEAVE,
bookmark_manager_private::OnDragLeave::kEventName,
bookmark_manager_private::OnDragLeave::Create(
CreateApiBookmarkNodeData(profile_, data)));
}
void BookmarkManagerPrivateDragEventRouter::OnDrop(
const BookmarkNodeData& data) {
if (!data.is_valid())
return;
DispatchEvent(events::BOOKMARK_MANAGER_PRIVATE_ON_DROP,
bookmark_manager_private::OnDrop::kEventName,
bookmark_manager_private::OnDrop::Create(
CreateApiBookmarkNodeData(profile_, data)));
// Make a copy that is owned by this instance.
ClearBookmarkNodeData();
bookmark_drag_data_ = data;
}
const BookmarkNodeData*
BookmarkManagerPrivateDragEventRouter::GetBookmarkNodeData() {
if (bookmark_drag_data_.is_valid())
return &bookmark_drag_data_;
return NULL;
}
void BookmarkManagerPrivateDragEventRouter::ClearBookmarkNodeData() {
bookmark_drag_data_.Clear();
}
bool ClipboardBookmarkManagerFunction::CopyOrCut(bool cut,
const std::vector<std::string>& id_list) {
BookmarkModel* model = GetBookmarkModel();
bookmarks::ManagedBookmarkService* managed = GetManagedBookmarkService();
std::vector<const BookmarkNode*> nodes;
EXTENSION_FUNCTION_VALIDATE(GetNodesFromVector(model, id_list, &nodes));
if (cut && bookmarks::HasDescendantsOf(nodes, managed->managed_node())) {
error_ = bookmark_keys::kModifyManagedError;
return false;
}
bookmarks::CopyToClipboard(model, nodes, cut);
return true;
}
bool BookmarkManagerPrivateCopyFunction::RunOnReady() {
std::unique_ptr<Copy::Params> params(Copy::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
return CopyOrCut(false, params->id_list);
}
bool BookmarkManagerPrivateCutFunction::RunOnReady() {
if (!EditBookmarksEnabled())
return false;
std::unique_ptr<Cut::Params> params(Cut::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
return CopyOrCut(true, params->id_list);
}
bool BookmarkManagerPrivatePasteFunction::RunOnReady() {
if (!EditBookmarksEnabled())
return false;
std::unique_ptr<Paste::Params> params(Paste::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile());
const BookmarkNode* parent_node = GetNodeFromString(model, params->parent_id);
if (!CanBeModified(parent_node))
return false;
bool can_paste = bookmarks::CanPasteFromClipboard(model, parent_node);
if (!can_paste)
return false;
// We want to use the highest index of the selected nodes as a destination.
std::vector<const BookmarkNode*> nodes;
// No need to test return value, if we got an empty list, we insert at end.
if (params->selected_id_list)
GetNodesFromVector(model, *params->selected_id_list, &nodes);
int highest_index = -1; // -1 means insert at end of list.
for (size_t i = 0; i < nodes.size(); ++i) {
// + 1 so that we insert after the selection.
int index = parent_node->GetIndexOf(nodes[i]) + 1;
if (index > highest_index)
highest_index = index;
}
bookmarks::PasteFromClipboard(model, parent_node, highest_index);
return true;
}
bool BookmarkManagerPrivateCanPasteFunction::RunOnReady() {
std::unique_ptr<CanPaste::Params> params(CanPaste::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
PrefService* prefs = user_prefs::UserPrefs::Get(GetProfile());
if (!prefs->GetBoolean(bookmarks::prefs::kEditBookmarksEnabled)) {
SetResult(new base::FundamentalValue(false));
return true;
}
BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile());
const BookmarkNode* parent_node = GetNodeFromString(model, params->parent_id);
if (!parent_node) {
error_ = bookmark_keys::kNoParentError;
return false;
}
bool can_paste = bookmarks::CanPasteFromClipboard(model, parent_node);
SetResult(new base::FundamentalValue(can_paste));
return true;
}
bool BookmarkManagerPrivateSortChildrenFunction::RunOnReady() {
if (!EditBookmarksEnabled())
return false;
std::unique_ptr<SortChildren::Params> params(
SortChildren::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile());
const BookmarkNode* parent_node = GetNodeFromString(model, params->parent_id);
if (!CanBeModified(parent_node))
return false;
model->SortChildren(parent_node);
return true;
}
bool BookmarkManagerPrivateGetStringsFunction::RunAsync() {
base::DictionaryValue* localized_strings = new base::DictionaryValue();
localized_strings->SetString("title",
l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_TITLE));
localized_strings->SetString("search_button",
l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_SEARCH_BUTTON));
localized_strings->SetString("folders_menu",
l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_FOLDERS_MENU));
localized_strings->SetString("organize_menu",
l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_ORGANIZE_MENU));
localized_strings->SetString("show_in_folder",
l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_SHOW_IN_FOLDER));
localized_strings->SetString("sort",
l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_SORT));
localized_strings->SetString("import_menu",
l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_IMPORT_MENU));
localized_strings->SetString("export_menu",
l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_EXPORT_MENU));
localized_strings->SetString("rename_folder",
l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_RENAME_FOLDER));
localized_strings->SetString("edit",
l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_EDIT));
localized_strings->SetString("should_open_all",
l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_SHOULD_OPEN_ALL));
localized_strings->SetString("open_incognito",
l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_OPEN_INCOGNITO));
localized_strings->SetString("open_in_new_tab",
l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_OPEN_IN_NEW_TAB));
localized_strings->SetString("open_in_new_window",
l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_OPEN_IN_NEW_WINDOW));
localized_strings->SetString("add_new_bookmark",
l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_ADD_NEW_BOOKMARK));
localized_strings->SetString("new_folder",
l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_NEW_FOLDER));
localized_strings->SetString("open_all",
l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_OPEN_ALL));
localized_strings->SetString("open_all_new_window",
l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW));
localized_strings->SetString("open_all_incognito",
l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_OPEN_ALL_INCOGNITO));
localized_strings->SetString("remove",
l10n_util::GetStringUTF16(IDS_BOOKMARK_BAR_REMOVE));
localized_strings->SetString("copy",
l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_COPY));
localized_strings->SetString("cut",
l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_CUT));
localized_strings->SetString("paste",
l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PASTE));
localized_strings->SetString("delete",
l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_DELETE));
localized_strings->SetString("undo_delete",
l10n_util::GetStringUTF16(IDS_UNDO_DELETE));
localized_strings->SetString("new_folder_name",
l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_NEW_FOLDER_NAME));
localized_strings->SetString("name_input_placeholder",
l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_NAME_INPUT_PLACE_HOLDER));
localized_strings->SetString("url_input_placeholder",
l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_URL_INPUT_PLACE_HOLDER));
localized_strings->SetString("invalid_url",
l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_INVALID_URL));
localized_strings->SetString("recent",
l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_RECENT));
localized_strings->SetString("search",
l10n_util::GetStringUTF16(IDS_BOOKMARK_MANAGER_SEARCH));
localized_strings->SetString("save",
l10n_util::GetStringUTF16(IDS_SAVE));
localized_strings->SetString("cancel",
l10n_util::GetStringUTF16(IDS_CANCEL));
const std::string& app_locale = g_browser_process->GetApplicationLocale();
webui::SetLoadTimeDataDefaults(app_locale, localized_strings);
SetResult(localized_strings);
// This is needed because unlike the rest of these functions, this class
// inherits from AsyncFunction directly, rather than BookmarkFunction.
SendResponse(true);
return true;
}
bool BookmarkManagerPrivateStartDragFunction::RunOnReady() {
if (!EditBookmarksEnabled())
return false;
if (GetViewType(GetSenderWebContents()) != VIEW_TYPE_TAB_CONTENTS) {
NOTREACHED();
return false;
}
std::unique_ptr<StartDrag::Params> params(StartDrag::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile());
std::vector<const BookmarkNode*> nodes;
EXTENSION_FUNCTION_VALIDATE(
GetNodesFromVector(model, params->id_list, &nodes));
content::WebContents* web_contents = GetAssociatedWebContents();
CHECK(web_contents);
ui::DragDropTypes::DragEventSource source =
ui::DragDropTypes::DRAG_EVENT_SOURCE_MOUSE;
if (params->is_from_touch)
source = ui::DragDropTypes::DRAG_EVENT_SOURCE_TOUCH;
chrome::DragBookmarks(
GetProfile(), nodes, web_contents->GetNativeView(), source);
return true;
}
bool BookmarkManagerPrivateDropFunction::RunOnReady() {
if (!EditBookmarksEnabled())
return false;
std::unique_ptr<Drop::Params> params(Drop::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile());
const BookmarkNode* drop_parent = GetNodeFromString(model, params->parent_id);
if (!CanBeModified(drop_parent))
return false;
if (GetViewType(GetSenderWebContents()) != VIEW_TYPE_TAB_CONTENTS) {
NOTREACHED();
return false;
}
int drop_index;
if (params->index)
drop_index = *params->index;
else
drop_index = drop_parent->child_count();
WebContents* web_contents = GetAssociatedWebContents();
CHECK(web_contents);
ExtensionWebUI* web_ui =
static_cast<ExtensionWebUI*>(web_contents->GetWebUI()->GetController());
CHECK(web_ui);
BookmarkManagerPrivateDragEventRouter* router =
web_ui->bookmark_manager_private_drag_event_router();
DCHECK(router);
const BookmarkNodeData* drag_data = router->GetBookmarkNodeData();
if (drag_data == NULL) {
NOTREACHED() <<"Somehow we're dropping null bookmark data";
return false;
}
const bool copy = false;
chrome::DropBookmarks(
GetProfile(), *drag_data, drop_parent, drop_index, copy);
router->ClearBookmarkNodeData();
return true;
}
bool BookmarkManagerPrivateGetSubtreeFunction::RunOnReady() {
std::unique_ptr<GetSubtree::Params> params(
GetSubtree::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
const BookmarkNode* node = NULL;
if (params->id.empty()) {
BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile());
node = model->root_node();
} else {
node = GetBookmarkNodeFromId(params->id);
if (!node)
return false;
}
std::vector<api::bookmarks::BookmarkTreeNode> nodes;
bookmarks::ManagedBookmarkService* managed = GetManagedBookmarkService();
if (params->folders_only)
bookmark_api_helpers::AddNodeFoldersOnly(managed, node, &nodes, true);
else
bookmark_api_helpers::AddNode(managed, node, &nodes, true);
results_ = GetSubtree::Results::Create(nodes);
return true;
}
bool BookmarkManagerPrivateCanEditFunction::RunOnReady() {
PrefService* prefs = user_prefs::UserPrefs::Get(GetProfile());
SetResult(new base::FundamentalValue(
prefs->GetBoolean(bookmarks::prefs::kEditBookmarksEnabled)));
return true;
}
bool BookmarkManagerPrivateRecordLaunchFunction::RunOnReady() {
RecordBookmarkLaunch(NULL, BOOKMARK_LAUNCH_LOCATION_MANAGER);
return true;
}
bool BookmarkManagerPrivateCreateWithMetaInfoFunction::RunOnReady() {
if (!EditBookmarksEnabled())
return false;
std::unique_ptr<CreateWithMetaInfo::Params> params(
CreateWithMetaInfo::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile());
const BookmarkNode* node = CreateBookmarkNode(
model, params->bookmark, ¶ms->meta_info.additional_properties);
if (!node)
return false;
api::bookmarks::BookmarkTreeNode result_node =
bookmark_api_helpers::GetBookmarkTreeNode(GetManagedBookmarkService(),
node, false, false);
results_ = CreateWithMetaInfo::Results::Create(result_node);
return true;
}
bool BookmarkManagerPrivateGetMetaInfoFunction::RunOnReady() {
std::unique_ptr<GetMetaInfo::Params> params(
GetMetaInfo::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
if (params->id) {
const BookmarkNode* node = GetBookmarkNodeFromId(*params->id);
if (!node)
return false;
if (params->key) {
std::string value;
if (node->GetMetaInfo(*params->key, &value)) {
GetMetaInfo::Results::Value result;
result.as_string.reset(new std::string(value));
results_ = GetMetaInfo::Results::Create(result);
}
} else {
GetMetaInfo::Results::Value result;
result.as_object.reset(new GetMetaInfo::Results::Value::Object);
const BookmarkNode::MetaInfoMap* meta_info = node->GetMetaInfoMap();
if (meta_info) {
BookmarkNode::MetaInfoMap::const_iterator itr;
base::DictionaryValue& temp = result.as_object->additional_properties;
for (itr = meta_info->begin(); itr != meta_info->end(); itr++) {
temp.SetStringWithoutPathExpansion(itr->first, itr->second);
}
}
results_ = GetMetaInfo::Results::Create(result);
}
} else {
if (params->key) {
error_ = bookmark_api_constants::kInvalidParamError;
return true;
}
BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile());
const BookmarkNode* node = model->root_node();
GetMetaInfo::Results::Value result;
result.as_object.reset(new GetMetaInfo::Results::Value::Object);
bookmark_api_helpers::GetMetaInfo(*node,
&result.as_object->additional_properties);
results_ = GetMetaInfo::Results::Create(result);
}
return true;
}
bool BookmarkManagerPrivateSetMetaInfoFunction::RunOnReady() {
if (!EditBookmarksEnabled())
return false;
std::unique_ptr<SetMetaInfo::Params> params(
SetMetaInfo::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
const BookmarkNode* node = GetBookmarkNodeFromId(params->id);
if (!node)
return false;
if (!CanBeModified(node))
return false;
BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile());
if (model->is_permanent_node(node)) {
error_ = bookmark_keys::kModifySpecialError;
return false;
}
model->SetNodeMetaInfo(node, params->key, params->value);
return true;
}
bool BookmarkManagerPrivateUpdateMetaInfoFunction::RunOnReady() {
if (!EditBookmarksEnabled())
return false;
std::unique_ptr<UpdateMetaInfo::Params> params(
UpdateMetaInfo::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
const BookmarkNode* node = GetBookmarkNodeFromId(params->id);
if (!node)
return false;
if (!CanBeModified(node))
return false;
BookmarkModel* model = BookmarkModelFactory::GetForProfile(GetProfile());
if (model->is_permanent_node(node)) {
error_ = bookmark_keys::kModifySpecialError;
return false;
}
BookmarkNode::MetaInfoMap new_meta_info(
params->meta_info_changes.additional_properties);
if (node->GetMetaInfoMap()) {
new_meta_info.insert(node->GetMetaInfoMap()->begin(),
node->GetMetaInfoMap()->end());
}
model->SetNodeMetaInfoMap(node, new_meta_info);
return true;
}
bool BookmarkManagerPrivateCanOpenNewWindowsFunction::RunOnReady() {
bool can_open_new_windows = true;
SetResult(new base::FundamentalValue(can_open_new_windows));
return true;
}
bool BookmarkManagerPrivateRemoveTreesFunction::RunOnReady() {
if (!EditBookmarksEnabled())
return false;
std::unique_ptr<RemoveTrees::Params> params(
RemoveTrees::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
BookmarkModel* model = GetBookmarkModel();
bookmarks::ManagedBookmarkService* managed = GetManagedBookmarkService();
bookmarks::ScopedGroupBookmarkActions group_deletes(model);
int64_t id;
for (size_t i = 0; i < params->id_list.size(); ++i) {
if (!GetBookmarkIdAsInt64(params->id_list[i], &id))
return false;
if (!bookmark_api_helpers::RemoveNode(model, managed, id, true, &error_))
return false;
}
return true;
}
bool BookmarkManagerPrivateUndoFunction::RunOnReady() {
if (!EditBookmarksEnabled())
return false;
BookmarkUndoServiceFactory::GetForProfile(GetProfile())->undo_manager()->
Undo();
return true;
}
bool BookmarkManagerPrivateRedoFunction::RunOnReady() {
if (!EditBookmarksEnabled())
return false;
BookmarkUndoServiceFactory::GetForProfile(GetProfile())->undo_manager()->
Redo();
return true;
}
bool BookmarkManagerPrivateGetUndoInfoFunction::RunOnReady() {
UndoManager* undo_manager =
BookmarkUndoServiceFactory::GetForProfile(GetProfile())->undo_manager();
UndoInfo::Results::Result result;
result.enabled = undo_manager->undo_count() > 0;
result.label = base::UTF16ToUTF8(undo_manager->GetUndoLabel());
results_ = UndoInfo::Results::Create(result);
return true;
}
bool BookmarkManagerPrivateGetRedoInfoFunction::RunOnReady() {
UndoManager* undo_manager =
BookmarkUndoServiceFactory::GetForProfile(GetProfile())->undo_manager();
RedoInfo::Results::Result result;
result.enabled = undo_manager->redo_count() > 0;
result.label = base::UTF16ToUTF8(undo_manager->GetRedoLabel());
results_ = RedoInfo::Results::Create(result);
return true;
}
} // namespace extensions
| {
"content_hash": "34d7d6d81bc3d60c985fc8211988ff57",
"timestamp": "",
"source": "github",
"line_count": 814,
"max_line_length": 80,
"avg_line_length": 35.69410319410319,
"alnum_prop": 0.7209774565479263,
"repo_name": "was4444/chromium.src",
"id": "9b57f6cec995ff5213b129c9246e4e5f78f40e38",
"size": "31203",
"binary": false,
"copies": "4",
"ref": "refs/heads/nw15",
"path": "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
mPower App
==========
The Parkinson app is one of the first five apps built using [ResearchKit](https://github.com/researchkit/ResearchKit).
mPower is a unique iPhone application that uses a mix of surveys and
tasks that activate phone sensors to collect and track health and
symptoms of Parkinson Disease (PD) progression - like dexterity,
balance or gait.
The goal of this app is to learn more about the variations of PD, and to improve the way
we describe these variations and to learn how mobile devices and
sensors can help us to measure PD and its progression to ultimately
improve the quality of life for people with PD.
Building the App
================
###Requirements
* Xcode 6.3
* iOS 8.3 SDK
###Getting the source
First, check out the source, including all the dependencies:
```
git clone --recurse-submodules [email protected]:ResearchKit/mPower.git
```
###Building it
Open the project, `Parkinson.xcodeproj`, and build and run.
Other components
================
Several survey instruments used in the shipping app have been
removed from the open source version because they are not free
to use:
* [PDQ8](http://isis-innovation.com/outcome-measures/parkinsons-disease-questionnaire-pdq-39-pdq-8/) (Parkinson disease questionnaire)
* [MDS-UPDRS](http://www.movementdisorders.org/MDS/Education/Rating-Scales.htm) (Parkinson disease rating scale)
The shipping app also uses OpenSSL to add extra data protection, which
has not been included in the published version of the AppCore
project. See the [AppCore repository](https://github.com/researchkit/AppCore) for more details.
License
=======
The source in the mPower repository is made available under the
following license unless another license is explicitly identified:
```
Copyright (c) 2015, Sage Bionetworks, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```
| {
"content_hash": "ed2aacc5cafc7577689f425993a18190",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 134,
"avg_line_length": 36.60674157303371,
"alnum_prop": 0.785451197053407,
"repo_name": "insha/mPower",
"id": "33049c1ed7ac47f7993021bb34057df400b0a4b2",
"size": "3258",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "readme.md",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "4861"
},
{
"name": "HTML",
"bytes": "69585"
},
{
"name": "Objective-C",
"bytes": "189744"
}
],
"symlink_target": ""
} |
package org.metacsp.utility.UI;
public interface Callback {
public void performOperation();
}
| {
"content_hash": "e17b6a614c1918b556206306b59e8732",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 32,
"avg_line_length": 13.5,
"alnum_prop": 0.6944444444444444,
"repo_name": "FedericoPecora/meta-csp-framework",
"id": "45727a9c6dd532a45725b53c54679445b12ece7a",
"size": "1439",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/org/metacsp/utility/UI/Callback.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "772"
},
{
"name": "Java",
"bytes": "1939507"
},
{
"name": "Makefile",
"bytes": "13"
},
{
"name": "Shell",
"bytes": "638"
}
],
"symlink_target": ""
} |
package com.study.disableapp;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.study.disableapp", appContext.getPackageName());
}
}
| {
"content_hash": "38e53ecba3339ca29ce4cbc5263d4113",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 78,
"avg_line_length": 28.615384615384617,
"alnum_prop": 0.7473118279569892,
"repo_name": "yecjl/AndroidStudyDemo",
"id": "f3b98e2a9e334ce7fcae5fe16c533a27b82dab43",
"size": "744",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Day13/02_disableapp/src/androidTest/java/com/study/disableapp/ExampleInstrumentedTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "640067"
}
],
"symlink_target": ""
} |
var React = require('react'),
_ = require('lodash'),
uri = require('./uri.js');
var Router = function(options) {
this._options = _.extend({
defaultProps: {}
}, options);
this.routeLink = this.routeLink.bind(this);
this.onPopState = this.onPopState.bind(this);
this._bindPopStateEvent();
// The initial render is done instantly when the Router instance is created
this._loadParams(uri.parseLocation(this._getCurrentLocation()));
};
Router.prototype = {
stop: function() {
this._unbindPopStateEvent();
},
routeLink: function(event) {
/**
* Any <a> tag can have this method bound to its onClick event to have
* their corresponding href location picked up by the built-in Router
* implementation, which uses pushState to switch between Components
* instead of reloading pages.
*/
event.preventDefault();
this._pushLocation(event.currentTarget.href);
},
goTo: function(location) {
this._pushLocation(location);
},
onPopState: function(e) {
// Chrome & Safari trigger an empty popState event initially, while
// Firefox doesn't, we choose to ignore that event altogether
if (!e.state) {
return;
}
var location = this._getCurrentLocation(),
params = uri.parseLocation(location);
this._loadParams(params, location);
},
_pushLocation: function(location) {
// Old-school refreshes are made when pushState isn't supported
if (!this._isPushStateSupported()) {
window.location = location;
return;
}
// Create a history entry for the new component
this._pushHistoryState({}, location);
this._loadParams(uri.parseLocation(location));
},
_loadParams: function(params) {
var props = _.extend({
// Always send the components a reference to the router. This makes it
// possible for a component to change the page through the router and
// not have to rely on any sort of globals
router: this
}, this._options.defaultProps, params);
var ComponentClass = this._options.getComponentClass(props),
componentElement = React.createElement(ComponentClass, props);
// The router exposes the instance of the currently rendered component
this.rootComponent = React.render(componentElement,
this._options.container);
if (_.isFunction(this._options.onChange)) {
this._options.onChange.call(this, props);
}
},
_getCurrentLocation: function() {
return window.location.href;
},
_bindPopStateEvent: function() {
window.addEventListener('popstate', this.onPopState);
},
_unbindPopStateEvent: function() {
window.removeEventListener('popstate', this.onPopState);
},
_pushHistoryState: function(state, url) {
window.history.pushState(state, '', url);
},
_isPushStateSupported: function() {
return !!window.history.pushState;
}
};
module.exports = Router;
| {
"content_hash": "c1facfac8b61a5e054b82f908bf4e6af",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 77,
"avg_line_length": 27.60747663551402,
"alnum_prop": 0.6668923493568043,
"repo_name": "teosz/react-querystring-router",
"id": "d9d6e6c6c56fa23e87b068d2bd7be6888895813f",
"size": "2954",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/router.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "13129"
}
],
"symlink_target": ""
} |
package ext.ojalgo.jexcel.database;
import org.ojalgo.type.context.TypeContext;
import ext.ojalgo.jexcel.Spreadsheet;
public final class NumberColumn extends Column<Comparable<?>> {
public NumberColumn(final String aName, final TypeContext<Comparable<?>> aContext) {
super(aName, aContext);
}
@Override
public Comparable<?> getCellValue(final Spreadsheet aSheet) {
return aSheet.getNumberCellValue();
}
@Override
public void setCellValue(final Spreadsheet aSheet, final Comparable<?> aCellValue) {
aSheet.setNumberCellValue(aCellValue);
}
}
| {
"content_hash": "f14915d982b333a6aad0654004c9153c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 88,
"avg_line_length": 25.208333333333332,
"alnum_prop": 0.71900826446281,
"repo_name": "optimatika/ojAlgo-extensions",
"id": "341db7517c84d4c5cd91ca31d42d4f1fa2581b6f",
"size": "1720",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "ojAlgo-jxl/src/main/java/ext/ojalgo/jexcel/database/NumberColumn.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "374093"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/iv_icon"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:scaleType="centerCrop" /> | {
"content_hash": "103970a152d9d5d90617c9fb231f6b98",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 69,
"avg_line_length": 41.714285714285715,
"alnum_prop": 0.708904109589041,
"repo_name": "Boria7777/compoment-Album",
"id": "5a7d6498e9e31daf4c63c2ac0ca7fda9cbb01e3a",
"size": "292",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "sample/src/main/res/layout/item_main_image.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "138897"
}
],
"symlink_target": ""
} |
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ApiScheme.Client;
using ApiScheme.Scheme;
using System.Net;
using ApiScheme;
using System.Diagnostics;
namespace ApiSchemeTest
{
[TestClass]
public class ApiCall
{
[TestMethod]
public void Plus()
{
var str = "!\"#$%&'()=~|12-^\\,./;:+*[]{}`@_?><";
var o = Api.Get<PlusOut>(new PlusIn() { a = 1, b = 2, echo = str });
Assert.AreEqual(3, o.c);
Assert.AreEqual(str, o.echo);
}
[TestMethod]
public void InvalidIn()
{
try
{
var o = Api.Get<PlusOut>(new PlusInvalidInn() { a = 1, b = 2 });
}
catch (ArgumentException)
{
return;
}
Assert.Fail("ArgumentException not thrown.");
}
[TestMethod]
public void InvalidOut()
{
try
{
var o = Api.Get<PlusInvalidOut>(new PlusIn() { a = 1, b = 2 });
}
catch (ArgumentException)
{
return;
}
Assert.Fail("ArgumentException not thrown.");
}
[TestMethod]
public void GetException()
{
try
{
var o = Api.Get<GetExceptionOut>(new GetExceptionIn());
}
catch (TestApiException e)
{
Debug.WriteLine(e);
return;
}
Assert.Fail("Exception not thrown.");
}
}
}
| {
"content_hash": "b589b82b666a40dd626b5e171b1e706f",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 80,
"avg_line_length": 24.424242424242426,
"alnum_prop": 0.4466501240694789,
"repo_name": "Michitaro-Naito/ApiScheme",
"id": "d35c4f15ebd8461cb6bab2319fa746bbab5cf2d3",
"size": "1614",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ApiSchemeTest/ApiCall.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "27456"
}
],
"symlink_target": ""
} |
<VerifyAPIKey name='VerifyAPIKey-1'>
<APIKey ref='request.header.apikey'></APIKey>
<!--
Variables populated by this policy: verifyapikey.{policy_name}.
client_id: The consumer key (aka API key or app key) supplied by the requesting app
client_secret: The consumer secret associated with the consumer key
redirection_uris: Any redirect URIs in the request
developer.app.name: The app name of the developer app making the request
developer.id: The developer ID of the developer registered as the owner of the requesting app
failed: Set when API Key validation fails
developer.app.{custom_attribute_name} ?? - custom attribute on the app
{custom_attribute_name_of_app}: Any custom attribute derived from the app profile?
{custom_attribute_name_of_appkey}: Any custom attributes derived from the app key profile
apiproduct.name*: The name of the API product used to validate the request
apiproduct.{custom_attribute_name}*: Any custom attribute derived from the API product profile
apiproduct.developer.quota.limit*
apiproduct.developer.quota.interval*
apiproduct.developer.quota.timeunit*
-->
</VerifyAPIKey>
| {
"content_hash": "1a21afc2063944ea07398edc4ec29260",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 100,
"avg_line_length": 54.72727272727273,
"alnum_prop": 0.7350498338870431,
"repo_name": "DinoChiesa/devjam3-20170405",
"id": "53fdc2a77f9db89fac212e43ab254ad703d05c5d",
"size": "1204",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Resources/oauth2-oidc/apiproxy/policies/VerifyAPIKey-1.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "4868"
},
{
"name": "HTML",
"bytes": "9605"
},
{
"name": "JavaScript",
"bytes": "76177"
}
],
"symlink_target": ""
} |
namespace Framework.Ioc
{
using System;
using System.Collections.Generic;
using System.Threading;
/// <summary>
/// This lifetime manager behavior is to always return a the same instance when the
/// Resolve method is called on same Thread.
/// </summary>
public class ThreadLifetime : ILifetime
{
private static readonly ThreadLocal<Dictionary<Func<object>, object>> Instances = new ThreadLocal<Dictionary<Func<object>, object>>(() => new Dictionary<Func<object>, object>());
private static readonly ThreadLocal<object> SyncLock = new ThreadLocal<object>(() => new object());
/// -------------------------------------------------------------------------------------------------
/// <summary>
/// Gets the instance.
/// </summary>
/// <param name="dependencyInfo">
/// Information describing the dependency.
/// </param>
/// <returns>
/// Instance of Dependency Object.
/// </returns>
/// -------------------------------------------------------------------------------------------------
public object GetInstance(IBindingInfo dependencyInfo)
{
if (Instances.Value.ContainsKey(dependencyInfo.Instance))
{
return Instances.Value[dependencyInfo.Instance];
}
lock (SyncLock.Value)
{
if (Instances.Value.ContainsKey(dependencyInfo.Instance))
{
return Instances.Value[dependencyInfo.Instance];
}
object instance = dependencyInfo.Instance();
Instances.Value.Add(dependencyInfo.Instance, instance);
return instance;
}
}
/// -------------------------------------------------------------------------------------------------
/// <summary>
/// Dispose the instance if exists.
/// </summary>
/// <param name="dependencyInfo">
/// Information describing the dependency.
/// </param>
/// -------------------------------------------------------------------------------------------------
public void ReleaseInstance(IBindingInfo dependencyInfo)
{
lock (SyncLock.Value)
{
if (Instances.Value.ContainsKey(dependencyInfo.Instance))
{
object instance = Instances.Value[dependencyInfo.Instance];
if (instance != null)
{
IDisposable disposable = instance as IDisposable;
if (disposable != null)
{
disposable.Dispose();
}
}
Instances.Value.Remove(dependencyInfo.Instance);
}
}
}
}
}
| {
"content_hash": "9ef02412e07c08ab3a84f13b37f4bbca",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 186,
"avg_line_length": 36.2962962962963,
"alnum_prop": 0.44727891156462585,
"repo_name": "anwarjaved/Innosparx",
"id": "480b34b22aa60d92ccc23a616bf1a68a6de5f1e9",
"size": "2942",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Framework.Ioc/Ioc/ThreadLifetime.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C#",
"bytes": "2824025"
}
],
"symlink_target": ""
} |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.FRAGMENT_NODE = exports.COMMENT_NODE = exports.TEXT_NODE = exports.ELEMENT_NODE = void 0;
const ELEMENT_NODE = 1;
exports.ELEMENT_NODE = ELEMENT_NODE;
const TEXT_NODE = 3;
exports.TEXT_NODE = TEXT_NODE;
const COMMENT_NODE = 8;
exports.COMMENT_NODE = COMMENT_NODE;
const FRAGMENT_NODE = 11;
exports.FRAGMENT_NODE = FRAGMENT_NODE; | {
"content_hash": "32db2a7fb5a5d0d678ff4d3d55ac6a6c",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 97,
"avg_line_length": 29.714285714285715,
"alnum_prop": 0.7379807692307693,
"repo_name": "brett-harvey/Smart-Contracts",
"id": "1f00ab186075f23098f99f9f401f470f0fb717df",
"size": "416",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Ethereum-based-Roll4Win/node_modules/h2x-types/lib/HTMLNodeTypes.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "430"
}
],
"symlink_target": ""
} |
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf.urls.static import static
from django.views.generic import TemplateView
from apps.app import application
from accounts.dashboard.app import application as accounts_app
from accounts.views import AccountBalanceView
admin.autodiscover()
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
url(r'^giftcard-balance/', AccountBalanceView.as_view(),
name="account-balance"),
(r'^dashboard/accounts/', include(accounts_app.urls)),
(r'', include(application.urls)),
)
if settings.DEBUG:
urlpatterns += staticfiles_urlpatterns()
urlpatterns += static(settings.MEDIA_URL,
document_root=settings.MEDIA_ROOT)
urlpatterns += patterns('',
url(r'^404$', TemplateView.as_view(template_name='404.html')),
url(r'^500$', TemplateView.as_view(template_name='500.html')))
| {
"content_hash": "465dfee46630325cd57e06ab185d124d",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 70,
"avg_line_length": 38.888888888888886,
"alnum_prop": 0.7238095238095238,
"repo_name": "carver/django-account-balances",
"id": "ded3503bca2cd4951549ebec743ad0449ef0c47b",
"size": "1050",
"binary": false,
"copies": "2",
"ref": "refs/heads/remove-oscar",
"path": "sandbox/urls.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "149608"
}
],
"symlink_target": ""
} |
<div class="topic" xmlns="http://www.w3.org/1999/xhtml">
<h1 class="title">SVGPathSegMovetoRel object</h1>
<div id="mainSection">
<div class="clsServerSDKContent">
</div>
<p>Corresponds to an relative moveto (<a href="http://msdn.microsoft.com/en-us/library/ie/ff972086(v=vs.85).aspx#pathCommandTable">m</a>) <strong>path</strong> data command.</p>
<table>
<tbody><tr><td><a href="http://go.microsoft.com/fwlink/p/?linkid=204736" title="Scalable Vector Graphics: Paths"><img id="badge_svg" alt="Scalable Vector Graphics: Paths, Section 8.5.4" src="http://i.msdn.microsoft.com/dynimg/IC536350.png" title="Scalable Vector Graphics: Paths, Section 8.5.4" xmlns=""></a><img id="badge_ie9" alt="Internet Explorer 9" src="http://i.msdn.microsoft.com/dynimg/IC560342.png" title="Internet Explorer 9" xmlns=""></td></tr>
</tbody></table>
<h2>Members</h2>
<p>The <strong>SVGPathSegMovetoRel</strong> object has these types of members:</p>
<ul>
<li><a href="#properties">Properties</a></li>
</ul>
<h3><a id="properties"></a>Properties</h3>
<p>The <strong>SVGPathSegMovetoRel</strong> object has these properties.</p>
<table id="memberListProperties" class="members">
<tbody><tr><th>Property</th><th>Description</th></tr>
<tr data="declared;"><td>
<p>
<a href="http://msdn.microsoft.com/en-us/library/ie/ff971977(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">pathSegType</strong></a>
</p>
</td><td>
<p>Gets the type of the path segment.</p>
</td></tr>
<tr data="declared;"><td>
<p>
<a href="http://msdn.microsoft.com/en-us/library/ie/ff971978(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">pathSegTypeAsLetter</strong></a>
</p>
</td><td>
<p>Gets the type of the path segment, specified by the corresponding one-character command name.</p>
</td></tr>
<tr data="declared;"><td>
<p>
<a href="http://msdn.microsoft.com/en-us/library/ie/ff972029(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">x</strong></a>
</p>
</td><td>
<p>Gets or sets the x-coordinate value.</p>
</td></tr>
<tr data="declared;"><td>
<p>
<a href="http://msdn.microsoft.com/en-us/library/ie/ff972039(v=vs.85).aspx"><strong xmlns="http://www.w3.org/1999/xhtml">y</strong></a>
</p>
</td><td>
<p>Gets or sets the y-coordinate value.</p>
</td></tr>
</tbody></table>
<p> </p>
<h2>Standards information</h2>
<ul>
<li><a href="http://go.microsoft.com/fwlink/p/?linkid=204736" title="Scalable Vector Graphics: Paths">Scalable Vector Graphics: Paths</a>, Section 8.5.4</li>
</ul>
<h2>Remarks</h2>
<p class="note"><strong>Note</strong> In addition to the attributes, properties, events, methods, and styles listed above, SVG elements also inherit core HTML attributes, properties, events, methods, and styles.</p>
<p> </p>
<p> </p>
<p>Build date: 1/13/2014</p>
</div>
</div> | {
"content_hash": "27e5cbfd64cbee8f79ac503c9082b7f5",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 465,
"avg_line_length": 50.377049180327866,
"alnum_prop": 0.6326065733810609,
"repo_name": "shehuaqigai/JSBOOK",
"id": "82b31de3e40753ec5d29752011536d42c51f0586",
"size": "3073",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "resource/S/SVGpathSegMovetoRel.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "55855"
},
{
"name": "JavaScript",
"bytes": "979851"
},
{
"name": "PHP",
"bytes": "393"
},
{
"name": "Shell",
"bytes": "719"
}
],
"symlink_target": ""
} |
package test.scala.lib.time
import scala.collection.JavaConversions._
import org.junit.runner.RunWith
import org.scalatest.FlatSpec
import org.scalatest.junit.JUnitRunner
import org.scalatest.Matchers
import com.opendatagroup.hadrian.data._
import com.opendatagroup.hadrian.jvmcompiler._
import com.opendatagroup.hadrian.errors._
import test.scala._
// This is March 4 2015, 4:35:27
// 1425508527.52482
@RunWith(classOf[JUnitRunner])
class LibTimeSuite extends FlatSpec with Matchers {
"Year" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: int
action:
- {time.year: [input, {string: ""}]}
""").head
engine.action(java.lang.Double.valueOf(1425508527)).asInstanceOf[Integer] should be (2015)
engine.action(java.lang.Double.valueOf(1.425508527E9)).asInstanceOf[Integer] should be (2015)
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Integer] should be (2015)
}
"MonthOfYear" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: int
action:
- {time.monthOfYear: [input, {string: ""}]}
""").head
engine.action(java.lang.Double.valueOf(1425508527)).asInstanceOf[Integer] should be (3)
engine.action(java.lang.Double.valueOf(1.425508527E9)).asInstanceOf[Integer] should be (3)
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Integer] should be (3)
}
"DayOfYear" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: int
action:
- {time.dayOfYear: [input, {string: ""}]}
""").head
engine.action(java.lang.Double.valueOf(1425508527)).asInstanceOf[Integer] should be (63)
engine.action(java.lang.Double.valueOf(1.425508527E9)).asInstanceOf[Integer] should be (63)
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Integer] should be (63)
}
"DayOfMonth" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: int
action:
- {time.dayOfMonth: [input, {string: ""}]}
""").head
engine.action(java.lang.Double.valueOf(1425508527)).asInstanceOf[Integer] should be (4)
engine.action(java.lang.Double.valueOf(1.425508527E9)).asInstanceOf[Integer] should be (4)
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Integer] should be (4)
}
"DayOfWeek" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: int
action:
- {time.dayOfWeek: [input, {string: ""}]}
""").head
engine.action(java.lang.Double.valueOf(1425508527)).asInstanceOf[Integer] should be (2)
engine.action(java.lang.Double.valueOf(1.425508527E9)).asInstanceOf[Integer] should be (2)
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Integer] should be (2)
}
"HourOfDay" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: int
action:
- {time.hourOfDay: [input, {string: ""}]}
""").head
engine.action(java.lang.Double.valueOf(0)).asInstanceOf[Integer] should be (0)
val engine2 = PFAEngine.fromYaml("""
input: string
output: int
action:
- {time.hourOfDay: [0, input]}
""").head
engine2.action("Europe/Paris").asInstanceOf[Integer] should be (1)
engine2.action("Etc/UTC").asInstanceOf[Integer] should be (0)
engine2.action("Atlantic/Azores").asInstanceOf[Integer] should be (23)
}
"MinuteOfHour" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: int
action:
- {time.minuteOfHour: [input, {string: ""}]}
""").head
engine.action(java.lang.Double.valueOf(1425508527)).asInstanceOf[Integer] should be (35)
engine.action(java.lang.Double.valueOf(1.425508527E9)).asInstanceOf[Integer] should be (35)
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Integer] should be (35)
}
"SecondOfMinute" must "return the correct anwer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: int
action:
- {time.secondOfMinute: [input, {string: ""}]}
""").head
engine.action(java.lang.Double.valueOf(1425508527)).asInstanceOf[Integer] should be (27)
engine.action(java.lang.Double.valueOf(1.425508527E9)).asInstanceOf[Integer] should be (27)
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Integer] should be (27)
}
"makeTimestamp" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: int
output: double
action:
- {time.makeTimestamp: [input, 3, 11, 14, 50, 6, 245, {string: ""}]}
""").head
engine.action(java.lang.Integer.valueOf(2015)).asInstanceOf[Double] should be (1426085406.245)
val engine2 = PFAEngine.fromYaml("""
input: int
output: double
action:
- {time.makeTimestamp: [input, 1, 1, 0, 0, 0, 0, {string: ""}]}
""").head
engine2.action(java.lang.Integer.valueOf(1970)).asInstanceOf[Double] should be (0)
val engine3 = PFAEngine.fromYaml("""
input: string
output: double
action:
- {time.makeTimestamp: [1970, 1, 1, 0, 0, 0, 0, input]}
""").head
engine3.action("Europe/Paris").asInstanceOf[Double] should be (-3600)
engine3.action("Etc/UTC").asInstanceOf[Double] should be (0)
engine3.action("Atlantic/Azores").asInstanceOf[Double] should be (3600)
}
"isSecondOfMinute" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: boolean
action:
- {time.isSecondOfMinute: [input, {string: ""}, 25, 29]}
""").head
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Boolean] should be (true)
}
"isMinuteOfHour" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: boolean
action:
- {time.isMinuteOfHour: [input, {string: ""}, 34, 36]}
""").head
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Boolean] should be (true)
}
"isHourOfDay" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: boolean
action:
- {time.isHourOfDay: [input, {string: ""}, 20, 23]}
""").head
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Boolean] should be (true)
val engine1 = PFAEngine.fromYaml("""
input: double
output: boolean
action:
- {time.isHourOfDay: [input, {string: ""}, 0, 0.01]}
""").head
engine1.action(java.lang.Double.valueOf(0)).asInstanceOf[Boolean] should be (true)
}
"isDayOfWeek" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: boolean
action:
- {time.isDayOfWeek: [input, {string: ""}, 2, 3]}
""").head
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Boolean] should be (true)
}
"isDayOfMonth" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: boolean
action:
- {time.isDayOfMonth: [input, {string: ""}, 3, 5]}
""").head
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Boolean] should be (true)
}
"isDayOfYear" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: boolean
action:
- {time.isDayOfYear: [input, {string: ""}, 1, 300]}
""").head
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Boolean] should be (true)
}
"isMonthOfYear" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: boolean
action:
- {time.isMonthOfYear: [input, {string: ""}, 2, 7]}
""").head
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Boolean] should be (true)
}
"isWeekend" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: boolean
action:
- {time.isWeekend: [input, {string: ""}]}
""").head
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Boolean] should be (false)
engine.action(java.lang.Double.valueOf(1427598240.0)).asInstanceOf[Boolean] should be (true)
}
"isWorkHours" must "return the correct answer" taggedAs(Lib, LibTime) in {
val engine = PFAEngine.fromYaml("""
input: double
output: boolean
action:
- {time.isWorkHours: [input, {string: ""}]}
""").head
engine.action(java.lang.Double.valueOf(1425508527.52482)).asInstanceOf[Boolean] should be (false)
engine.action(java.lang.Double.valueOf(1427724421.0)).asInstanceOf[Boolean] should be (true)
}
}
| {
"content_hash": "a94c6eead5ca46ab49f303eb944d9d80",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 101,
"avg_line_length": 35.95238095238095,
"alnum_prop": 0.698233995584989,
"repo_name": "opendatagroup/hadrian",
"id": "b21cc8cda6c64ebe42150b926459ff04ef72c8fd",
"size": "9828",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "hadrian/src/test/scala/lib/time.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5094"
},
{
"name": "HTML",
"bytes": "43099"
},
{
"name": "JavaScript",
"bytes": "3843"
},
{
"name": "Makefile",
"bytes": "5560"
},
{
"name": "Python",
"bytes": "2949893"
},
{
"name": "R",
"bytes": "327452"
},
{
"name": "Scala",
"bytes": "2772816"
}
],
"symlink_target": ""
} |
@interface GoodsModel : MBTestMainModel
@property (nonatomic, copy) NSString *idd; //商品id
@property (nonatomic, copy) NSString *title; //标题
@property (nonatomic, copy) NSString *title2; //小标题
@property (nonatomic, copy) NSString *zongrenshu; //总人数
@property (nonatomic, copy) NSString *canyurenshu; //参与人数
@property (nonatomic, copy) NSString *thumb; //商品图片url
@property (nonatomic, copy) NSString *yunjiage; //云价格 1元 或 10元
@property (nonatomic, copy) NSString *qishu; //商品期数
@property (nonatomic, copy) NSString *goodstype; //商品状态
@property (nonatomic, copy) NSString *ip; //地址 和ip
@property (nonatomic, copy) NSString *xsjx_time; //揭晓时间
@property (nonatomic, copy) NSString *zjgonumber; //zjgonumber
@property (nonatomic, copy) NSString *img; //头像
@property (nonatomic, copy) NSString *sale; //1为上架 2为下架(区分商品上下架)
@property (nonatomic, copy) NSString *gonumber; //用户参与数量
@property (nonatomic, copy) NSString *q_user_code; //商品状态
@property (nonatomic, copy) NSString *sid; //同一个商品的id
@property (nonatomic, copy) NSString *type; //商品状态 进行中 已揭晓 倒计时
@property (nonatomic, copy) NSString *uid; //用户id
@property (nonatomic, copy) NSString *nextqishu; //下一期商品
@property (nonatomic, copy) NSString *goucode; //登录用户的中奖号
@property (nonatomic, copy) NSString *nextid; //下一期商品id
@property (nonatomic, copy) NSString *username; //用户名字
@property (nonatomic, strong) NSArray *picarr; // 商品图
@property (nonatomic, copy) NSString *waittime; //等待时间
@property (nonatomic, copy) NSString *tishi; //等待时间
@property (nonatomic, copy) NSString *minNumber; //起步价格
@property (nonatomic, copy) NSString *jiexiao_time; //商品揭晓时间
@property (nonatomic, copy) NSString *xiangou; //限购
@property (nonatomic, copy) NSString *xg_number;
@property (nonatomic, copy) NSArray *people;//荣誉榜
@property (nonatomic, copy) NSString *url;//上榜规则
@end
| {
"content_hash": "7553d29a1e2ebd4b41902574182a68f7",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 65,
"avg_line_length": 43.30952380952381,
"alnum_prop": 0.7361187465640462,
"repo_name": "Miaocool/MYG-NewVersion",
"id": "cad740aad6db591865ee84b1cd9ae5f2561457c1",
"size": "2252",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "myg/Src/Treasure/Model/GoodsModel.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1147653"
},
{
"name": "C++",
"bytes": "317661"
},
{
"name": "HTML",
"bytes": "4482"
},
{
"name": "Objective-C",
"bytes": "4495673"
},
{
"name": "Ruby",
"bytes": "80"
},
{
"name": "Shell",
"bytes": "8511"
}
],
"symlink_target": ""
} |
/**
* Created by Darkstar on 11/29/2016.
*/
import React from 'react';
import {connect} from 'react-redux';
import Toolbar from '../toolbar/toolbar.js';
import Footer from '../footer/footer.jsx';
import {sendEmailCampaign, showAlert} from '../../actions';
import RaisedButton from 'material-ui/RaisedButton';
import EmailIcon from 'material-ui/svg-icons/communication/email';
export class EmailCampaign extends React.Component {
constructor(props) {
super(props)
this.state = {
subject: '',
email: '',
progress: false
}
}
static get contextTypes() {
return {router: React.PropTypes.object.isRequired}
}
componentWillMount() {
// redirect if active app not found
if (!this.props.appData.viewActive) {
this.context.router.push('/')
}
}
sendEmailCampaign() {
if (this.state.subject && this.state.email) {
this.setState({progress: true})
sendEmailCampaign(this.props.appData.appId, this.props.appData.masterKey, this.state.subject, this.state.email).then(() => {
this.setState({progress: false})
showAlert('success', "Email Campaign Success")
}, (err) => {
this.setState({progress: false})
let error = 'No users found'
if (err.response.status == 500) {
error = "Server Error"
}
showAlert('error', error)
})
}
}
changeHandler(which, e) {
this.state[which] = e.target.value
this.setState(this.state)
}
render() {
return (
<div id="" style={{
backgroundColor: '#FFF'
}}>
<div className="cache campaign">
<div className="full-width">
<div className="flex-general-column-wrapper-center" style={{
width: '100%',
marginTop: 20
}}>
<div style={{
width: '100%'
}} className="solo-horizontal-center">
<span style={{
color: '#169CEE',
fontSize: 24,
fontWeight: 700
}}>Create an email campaign</span>
</div>
<div style={{
width: '100%'
}} className="solo-horizontal-center">
<span style={{
color: '#4F4F4F',
fontSize: 14
}}>Email campaign is used to send email to all of your users. You can use it for announcements or anything else you like.</span>
</div>
<div className="push-box" style={{
marginTop: 15
}}>
<div style={{
width: '100%',
height: 100,
backgroundColor: '#F7F7F7',
borderBottom: '1px solid #C4C2C2'
}}>
<div style={{
width: '100%',
height: '100%'
}} className="flex-general-row-wrapper">
<div style={{
width: '40%',
height: '100%',
padding: 35
}}>
<span style={{
color: '#353446',
fontSize: 16,
fontWeight: 700
}}>Subject</span>
</div>
<div className="solo-vertical-center" style={{
width: '60%',
height: '100%',
backgroundColor: 'white',
padding: 10
}}>
<input type="text" className="emailinputcampaign" placeholder="Your email subject" style={{
width: '100%',
height: 40,
fontSize: 16,
paddingLeft: 4
}} value={this.state.subject} onChange={this.changeHandler.bind(this, 'subject')}/>
</div>
</div>
</div>
<div style={{
width: '100%',
height: 300,
backgroundColor: '#F7F7F7'
}}>
<div style={{
width: '100%',
height: '100%'
}} className="flex-general-row-wrapper">
<div style={{
width: '40%',
height: '100%',
padding: 35
}}>
<span style={{
color: '#353446',
fontSize: 16,
fontWeight: 700
}}>Text</span>
</div>
<div className="solo-vertical-center" style={{
width: '60%',
height: '100%',
backgroundColor: 'white',
padding: 10
}}>
<textarea rows={10} cols={90} style={{
height: '100%',
border: 0,
fontSize: 16,
resize: 'none'
}} placeholder="Your email text" className="emailtextareacampaign" value={this.state.email} onChange={this.changeHandler.bind(this, 'email')}/>
</div>
</div>
</div>
</div>
<div style={{
width: '100%',
height: 50,
marginTop: 15,
marginBottom: 40
}}>
<div style={{
width: '100%',
height: '100%'
}} className="flex-general-column-wrapper-center">
<div className="solo-vertical-center" style={{
height: '100%'
}}>
<RaisedButton label="Send campaign" labelPosition="before" primary={true} className="emailcampbtn" onClick={this.sendEmailCampaign.bind(this)} disabled={this.state.progress}/>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
);
}
}
const mapStateToProps = (state) => {
return {appData: state.manageApp}
}
const mapDispatchToProps = (dispatch) => {
return {}
}
export default connect(mapStateToProps, mapDispatchToProps)(EmailCampaign);
| {
"content_hash": "0cfd22a8b99f508e41c955a3c1babd5d",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 215,
"avg_line_length": 46.518324607329845,
"alnum_prop": 0.3180641530669668,
"repo_name": "imankit/dashboard-ui",
"id": "d63d6231ac945465757cdde1a240c986ce909f54",
"size": "8885",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/components/campaign/email.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "84169"
},
{
"name": "HTML",
"bytes": "12569"
},
{
"name": "JavaScript",
"bytes": "519963"
}
],
"symlink_target": ""
} |
PHPUnit_Framework_MockObject_Generator::generate('Foo', array(), 'MockFoo', TRUE, TRUE)
--FILE--
<?php
interface Foo
{
public function bar(Foo $foo);
}
require_once 'PHPUnit/Autoload.php';
require_once 'Text/Template.php';
$generator = new PHPUnit_Framework_MockObject_Generator;
$mock = $generator->generate(
'Foo',
array(),
'MockFoo',
TRUE,
TRUE
);
print $mock['code'];
?>
--EXPECTF--
class MockFoo implements PHPUnit_Framework_MockObject_MockObject, Foo
{
private static $__phpunit_staticInvocationMocker;
private $__phpunit_invocationMocker;
public function __clone()
{
$this->__phpunit_invocationMocker = clone $this->__phpunit_getInvocationMocker();
}
public function bar(Foo $foo)
{
$arguments = array($foo);
$count = func_num_args();
if ($count > 1) {
$_arguments = func_get_args();
for ($i = 1; $i < $count; $i++) {
$arguments[] = $_arguments[$i];
}
}
$result = $this->__phpunit_getInvocationMocker()->invoke(
new PHPUnit_Framework_MockObject_Invocation_Object(
'Foo', 'bar', $arguments, $this, TRUE
)
);
return $result;
}
public function expects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
{
return $this->__phpunit_getInvocationMocker()->expects($matcher);
}
public static function staticExpects(PHPUnit_Framework_MockObject_Matcher_Invocation $matcher)
{
PHPUnit_Util_DeprecatedFeature_Logger::log('The stubbing and mocking of static methods is deprecated and will be removed in PHPUnit 3.9.');
return self::__phpunit_getStaticInvocationMocker()->expects($matcher);
}
public function __phpunit_getInvocationMocker()
{
if ($this->__phpunit_invocationMocker === NULL) {
$this->__phpunit_invocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
}
return $this->__phpunit_invocationMocker;
}
public static function __phpunit_getStaticInvocationMocker()
{
if (self::$__phpunit_staticInvocationMocker === NULL) {
self::$__phpunit_staticInvocationMocker = new PHPUnit_Framework_MockObject_InvocationMocker;
}
return self::$__phpunit_staticInvocationMocker;
}
public function __phpunit_hasMatchers()
{
return self::__phpunit_getStaticInvocationMocker()->hasMatchers() ||
$this->__phpunit_getInvocationMocker()->hasMatchers();
}
public function __phpunit_verify()
{
self::__phpunit_getStaticInvocationMocker()->verify();
$this->__phpunit_getInvocationMocker()->verify();
}
}
| {
"content_hash": "5b6727668fca5b555660074359f48550",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 147,
"avg_line_length": 27.846938775510203,
"alnum_prop": 0.628068889703188,
"repo_name": "matthiaskluth/cafe-fleischlos",
"id": "0605588948222e0640c787bfd61630ab33bf0b02",
"size": "2738",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "vendor/phpunit/phpunit-mock-objects/Tests/MockObject/interface.phpt",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "68272"
},
{
"name": "Perl",
"bytes": "2424"
}
],
"symlink_target": ""
} |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2018 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#include <config/bitcoin-config.h>
#endif
#include <chainparamsbase.h>
#include <clientversion.h>
#include <fs.h>
#include <rpc/client.h>
#include <rpc/protocol.h>
#include <rpc/request.h>
#include <util/strencodings.h>
#include <util/system.h>
#include <util/translation.h>
#include <functional>
#include <memory>
#include <stdio.h>
#include <tuple>
#include <event2/buffer.h>
#include <event2/keyvalq_struct.h>
#include <support/events.h>
#include <univalue.h>
const std::function<std::string(const char*)> G_TRANSLATION_FUN = nullptr;
static const char DEFAULT_RPCCONNECT[] = "127.0.0.1";
static const int DEFAULT_HTTP_CLIENT_TIMEOUT=900;
static const bool DEFAULT_NAMED=false;
static const int CONTINUE_EXECUTION=-1;
static void SetupCliArgs()
{
SetupHelpOptions(gArgs);
const auto defaultBaseParams = CreateBaseChainParams(CBaseChainParams::MAIN);
const auto testnetBaseParams = CreateBaseChainParams(CBaseChainParams::TESTNET);
const auto regtestBaseParams = CreateBaseChainParams(CBaseChainParams::REGTEST);
gArgs.AddArg("-version", "Print version and exit", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-conf=<file>", strprintf("Specify configuration file. Relative paths will be prefixed by datadir location. (default: %s)", BITCOIN_CONF_FILENAME), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-datadir=<dir>", "Specify data directory", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-getinfo", "Get general information from the remote server. Note that unlike server-side RPC calls, the results of -getinfo is the result of multiple non-atomic requests. Some entries in the result may represent results from different states (e.g. wallet balance may be as of a different block from the chain state reported)", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
SetupChainParamsBaseOptions();
gArgs.AddArg("-named", strprintf("Pass named instead of positional arguments (default: %s)", DEFAULT_NAMED), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-rpcclienttimeout=<n>", strprintf("Timeout in seconds during HTTP requests, or 0 for no timeout. (default: %d)", DEFAULT_HTTP_CLIENT_TIMEOUT), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-rpcconnect=<ip>", strprintf("Send commands to node running on <ip> (default: %s)", DEFAULT_RPCCONNECT), ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-rpccookiefile=<loc>", "Location of the auth cookie. Relative paths will be prefixed by a net-specific datadir location. (default: data dir)", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-rpcpassword=<pw>", "Password for JSON-RPC connections", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-rpcport=<port>", strprintf("Connect to JSON-RPC on <port> (default: %u, testnet: %u, regtest: %u)", defaultBaseParams->RPCPort(), testnetBaseParams->RPCPort(), regtestBaseParams->RPCPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::OPTIONS);
gArgs.AddArg("-rpcuser=<user>", "Username for JSON-RPC connections", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-rpcwait", "Wait for RPC server to start", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-rpcwallet=<walletname>", "Send RPC for non-default wallet on RPC server (needs to exactly match corresponding -wallet option passed to feathercoind). This changes the RPC endpoint used, e.g. http://127.0.0.1:8332/wallet/<walletname>", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-stdin", "Read extra arguments from standard input, one per line until EOF/Ctrl-D (recommended for sensitive information such as passphrases). When combined with -stdinrpcpass, the first line from standard input is used for the RPC password.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
gArgs.AddArg("-stdinrpcpass", "Read RPC password from standard input as a single line. When combined with -stdin, the first line from standard input is used for the RPC password.", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS);
}
/** libevent event log callback */
static void libevent_log_cb(int severity, const char *msg)
{
#ifndef EVENT_LOG_ERR // EVENT_LOG_ERR was added in 2.0.19; but before then _EVENT_LOG_ERR existed.
# define EVENT_LOG_ERR _EVENT_LOG_ERR
#endif
// Ignore everything other than errors
if (severity >= EVENT_LOG_ERR) {
throw std::runtime_error(strprintf("libevent error: %s", msg));
}
}
//////////////////////////////////////////////////////////////////////////////
//
// Start
//
//
// Exception thrown on connection error. This error is used to determine
// when to wait if -rpcwait is given.
//
class CConnectionFailed : public std::runtime_error
{
public:
explicit inline CConnectionFailed(const std::string& msg) :
std::runtime_error(msg)
{}
};
//
// This function returns either one of EXIT_ codes when it's expected to stop the process or
// CONTINUE_EXECUTION when it's expected to continue further.
//
static int AppInitRPC(int argc, char* argv[])
{
//
// Parameters
//
SetupCliArgs();
std::string error;
if (!gArgs.ParseParameters(argc, argv, error)) {
tfm::format(std::cerr, "Error parsing command line arguments: %s\n", error.c_str());
return EXIT_FAILURE;
}
if (argc < 2 || HelpRequested(gArgs) || gArgs.IsArgSet("-version")) {
std::string strUsage = PACKAGE_NAME " RPC client version " + FormatFullVersion() + "\n";
if (!gArgs.IsArgSet("-version")) {
strUsage += "\n"
"Usage: feathercoin-cli [options] <command> [params] Send command to " PACKAGE_NAME "\n"
"or: feathercoin-cli [options] -named <command> [name=value]... Send command to " PACKAGE_NAME " (with named arguments)\n"
"or: feathercoin-cli [options] help List commands\n"
"or: feathercoin-cli [options] help <command> Get help for a command\n";
strUsage += "\n" + gArgs.GetHelpMessage();
}
tfm::format(std::cout, "%s", strUsage.c_str());
if (argc < 2) {
tfm::format(std::cerr, "Error: too few parameters\n");
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
if (!CheckDataDirOption()) {
tfm::format(std::cerr, "Error: Specified data directory \"%s\" does not exist.\n", gArgs.GetArg("-datadir", "").c_str());
return EXIT_FAILURE;
}
if (!gArgs.ReadConfigFiles(error, true)) {
tfm::format(std::cerr, "Error reading configuration file: %s\n", error.c_str());
return EXIT_FAILURE;
}
// Check for -chain, -testnet or -regtest parameter (BaseParams() calls are only valid after this clause)
try {
SelectBaseParams(gArgs.GetChainName());
} catch (const std::exception& e) {
tfm::format(std::cerr, "Error: %s\n", e.what());
return EXIT_FAILURE;
}
return CONTINUE_EXECUTION;
}
/** Reply structure for request_done to fill in */
struct HTTPReply
{
HTTPReply(): status(0), error(-1) {}
int status;
int error;
std::string body;
};
static const char *http_errorstring(int code)
{
switch(code) {
#if LIBEVENT_VERSION_NUMBER >= 0x02010300
case EVREQ_HTTP_TIMEOUT:
return "timeout reached";
case EVREQ_HTTP_EOF:
return "EOF reached";
case EVREQ_HTTP_INVALID_HEADER:
return "error while reading header, or invalid header";
case EVREQ_HTTP_BUFFER_ERROR:
return "error encountered while reading or writing";
case EVREQ_HTTP_REQUEST_CANCEL:
return "request was canceled";
case EVREQ_HTTP_DATA_TOO_LONG:
return "response body is larger than allowed";
#endif
default:
return "unknown";
}
}
static void http_request_done(struct evhttp_request *req, void *ctx)
{
HTTPReply *reply = static_cast<HTTPReply*>(ctx);
if (req == nullptr) {
/* If req is nullptr, it means an error occurred while connecting: the
* error code will have been passed to http_error_cb.
*/
reply->status = 0;
return;
}
reply->status = evhttp_request_get_response_code(req);
struct evbuffer *buf = evhttp_request_get_input_buffer(req);
if (buf)
{
size_t size = evbuffer_get_length(buf);
const char *data = (const char*)evbuffer_pullup(buf, size);
if (data)
reply->body = std::string(data, size);
evbuffer_drain(buf, size);
}
}
#if LIBEVENT_VERSION_NUMBER >= 0x02010300
static void http_error_cb(enum evhttp_request_error err, void *ctx)
{
HTTPReply *reply = static_cast<HTTPReply*>(ctx);
reply->error = err;
}
#endif
/** Class that handles the conversion from a command-line to a JSON-RPC request,
* as well as converting back to a JSON object that can be shown as result.
*/
class BaseRequestHandler
{
public:
virtual ~BaseRequestHandler() {}
virtual UniValue PrepareRequest(const std::string& method, const std::vector<std::string>& args) = 0;
virtual UniValue ProcessReply(const UniValue &batch_in) = 0;
};
/** Process getinfo requests */
class GetinfoRequestHandler: public BaseRequestHandler
{
public:
const int ID_NETWORKINFO = 0;
const int ID_BLOCKCHAININFO = 1;
const int ID_WALLETINFO = 2;
/** Create a simulated `getinfo` request. */
UniValue PrepareRequest(const std::string& method, const std::vector<std::string>& args) override
{
if (!args.empty()) {
throw std::runtime_error("-getinfo takes no arguments");
}
UniValue result(UniValue::VARR);
result.push_back(JSONRPCRequestObj("getnetworkinfo", NullUniValue, ID_NETWORKINFO));
result.push_back(JSONRPCRequestObj("getblockchaininfo", NullUniValue, ID_BLOCKCHAININFO));
result.push_back(JSONRPCRequestObj("getwalletinfo", NullUniValue, ID_WALLETINFO));
return result;
}
/** Collect values from the batch and form a simulated `getinfo` reply. */
UniValue ProcessReply(const UniValue &batch_in) override
{
UniValue result(UniValue::VOBJ);
std::vector<UniValue> batch = JSONRPCProcessBatchReply(batch_in, 3);
// Errors in getnetworkinfo() and getblockchaininfo() are fatal, pass them on
// getwalletinfo() is allowed to fail in case there is no wallet.
if (!batch[ID_NETWORKINFO]["error"].isNull()) {
return batch[ID_NETWORKINFO];
}
if (!batch[ID_BLOCKCHAININFO]["error"].isNull()) {
return batch[ID_BLOCKCHAININFO];
}
result.pushKV("version", batch[ID_NETWORKINFO]["result"]["version"]);
result.pushKV("protocolversion", batch[ID_NETWORKINFO]["result"]["protocolversion"]);
result.pushKV("blocks", batch[ID_BLOCKCHAININFO]["result"]["blocks"]);
result.pushKV("timeoffset", batch[ID_NETWORKINFO]["result"]["timeoffset"]);
result.pushKV("connections", batch[ID_NETWORKINFO]["result"]["connections"]);
result.pushKV("proxy", batch[ID_NETWORKINFO]["result"]["networks"][0]["proxy"]);
result.pushKV("difficulty", batch[ID_BLOCKCHAININFO]["result"]["difficulty"]);
result.pushKV("chain", UniValue(batch[ID_BLOCKCHAININFO]["result"]["chain"]));
if (!batch[ID_WALLETINFO]["result"].isNull()) {
result.pushKV("walletversion", batch[ID_WALLETINFO]["result"]["walletversion"]);
result.pushKV("balance", batch[ID_WALLETINFO]["result"]["balance"]);
result.pushKV("keypoololdest", batch[ID_WALLETINFO]["result"]["keypoololdest"]);
result.pushKV("keypoolsize", batch[ID_WALLETINFO]["result"]["keypoolsize"]);
if (!batch[ID_WALLETINFO]["result"]["unlocked_until"].isNull()) {
result.pushKV("unlocked_until", batch[ID_WALLETINFO]["result"]["unlocked_until"]);
}
result.pushKV("paytxfee", batch[ID_WALLETINFO]["result"]["paytxfee"]);
}
result.pushKV("relayfee", batch[ID_NETWORKINFO]["result"]["relayfee"]);
result.pushKV("warnings", batch[ID_NETWORKINFO]["result"]["warnings"]);
return JSONRPCReplyObj(result, NullUniValue, 1);
}
};
/** Process default single requests */
class DefaultRequestHandler: public BaseRequestHandler {
public:
UniValue PrepareRequest(const std::string& method, const std::vector<std::string>& args) override
{
UniValue params;
if(gArgs.GetBoolArg("-named", DEFAULT_NAMED)) {
params = RPCConvertNamedValues(method, args);
} else {
params = RPCConvertValues(method, args);
}
return JSONRPCRequestObj(method, params, 1);
}
UniValue ProcessReply(const UniValue &reply) override
{
return reply.get_obj();
}
};
static UniValue CallRPC(BaseRequestHandler *rh, const std::string& strMethod, const std::vector<std::string>& args)
{
std::string host;
// In preference order, we choose the following for the port:
// 1. -rpcport
// 2. port in -rpcconnect (ie following : in ipv4 or ]: in ipv6)
// 3. default port for chain
int port = BaseParams().RPCPort();
SplitHostPort(gArgs.GetArg("-rpcconnect", DEFAULT_RPCCONNECT), port, host);
port = gArgs.GetArg("-rpcport", port);
// Obtain event base
raii_event_base base = obtain_event_base();
// Synchronously look up hostname
raii_evhttp_connection evcon = obtain_evhttp_connection_base(base.get(), host, port);
// Set connection timeout
{
const int timeout = gArgs.GetArg("-rpcclienttimeout", DEFAULT_HTTP_CLIENT_TIMEOUT);
if (timeout > 0) {
evhttp_connection_set_timeout(evcon.get(), timeout);
} else {
// Indefinite request timeouts are not possible in libevent-http, so we
// set the timeout to a very long time period instead.
constexpr int YEAR_IN_SECONDS = 31556952; // Average length of year in Gregorian calendar
evhttp_connection_set_timeout(evcon.get(), 5 * YEAR_IN_SECONDS);
}
}
HTTPReply response;
raii_evhttp_request req = obtain_evhttp_request(http_request_done, (void*)&response);
if (req == nullptr)
throw std::runtime_error("create http request failed");
#if LIBEVENT_VERSION_NUMBER >= 0x02010300
evhttp_request_set_error_cb(req.get(), http_error_cb);
#endif
// Get credentials
std::string strRPCUserColonPass;
bool failedToGetAuthCookie = false;
if (gArgs.GetArg("-rpcpassword", "") == "") {
// Try fall back to cookie-based authentication if no password is provided
if (!GetAuthCookie(&strRPCUserColonPass)) {
failedToGetAuthCookie = true;
}
} else {
strRPCUserColonPass = gArgs.GetArg("-rpcuser", "") + ":" + gArgs.GetArg("-rpcpassword", "");
}
struct evkeyvalq* output_headers = evhttp_request_get_output_headers(req.get());
assert(output_headers);
evhttp_add_header(output_headers, "Host", host.c_str());
evhttp_add_header(output_headers, "Connection", "close");
evhttp_add_header(output_headers, "Authorization", (std::string("Basic ") + EncodeBase64(strRPCUserColonPass)).c_str());
// Attach request data
std::string strRequest = rh->PrepareRequest(strMethod, args).write() + "\n";
struct evbuffer* output_buffer = evhttp_request_get_output_buffer(req.get());
assert(output_buffer);
evbuffer_add(output_buffer, strRequest.data(), strRequest.size());
// check if we should use a special wallet endpoint
std::string endpoint = "/";
if (!gArgs.GetArgs("-rpcwallet").empty()) {
std::string walletName = gArgs.GetArg("-rpcwallet", "");
char *encodedURI = evhttp_uriencode(walletName.c_str(), walletName.size(), false);
if (encodedURI) {
endpoint = "/wallet/"+ std::string(encodedURI);
free(encodedURI);
}
else {
throw CConnectionFailed("uri-encode failed");
}
}
int r = evhttp_make_request(evcon.get(), req.get(), EVHTTP_REQ_POST, endpoint.c_str());
req.release(); // ownership moved to evcon in above call
if (r != 0) {
throw CConnectionFailed("send http request failed");
}
event_base_dispatch(base.get());
if (response.status == 0) {
std::string responseErrorMessage;
if (response.error != -1) {
responseErrorMessage = strprintf(" (error code %d - \"%s\")", response.error, http_errorstring(response.error));
}
throw CConnectionFailed(strprintf("Could not connect to the server %s:%d%s\n\nMake sure the feathercoind server is running and that you are connecting to the correct RPC port.", host, port, responseErrorMessage));
} else if (response.status == HTTP_UNAUTHORIZED) {
if (failedToGetAuthCookie) {
throw std::runtime_error(strprintf(
"Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set. See -rpcpassword and -stdinrpcpass. Configuration file: (%s)",
GetConfigFile(gArgs.GetArg("-conf", BITCOIN_CONF_FILENAME)).string().c_str()));
} else {
throw std::runtime_error("Authorization failed: Incorrect rpcuser or rpcpassword");
}
} else if (response.status >= 400 && response.status != HTTP_BAD_REQUEST && response.status != HTTP_NOT_FOUND && response.status != HTTP_INTERNAL_SERVER_ERROR)
throw std::runtime_error(strprintf("server returned HTTP error %d", response.status));
else if (response.body.empty())
throw std::runtime_error("no response from server");
// Parse reply
UniValue valReply(UniValue::VSTR);
if (!valReply.read(response.body))
throw std::runtime_error("couldn't parse reply from server");
const UniValue reply = rh->ProcessReply(valReply);
if (reply.empty())
throw std::runtime_error("expected reply to have result, error and id properties");
return reply;
}
static int CommandLineRPC(int argc, char *argv[])
{
std::string strPrint;
int nRet = 0;
try {
// Skip switches
while (argc > 1 && IsSwitchChar(argv[1][0])) {
argc--;
argv++;
}
std::string rpcPass;
if (gArgs.GetBoolArg("-stdinrpcpass", false)) {
if (!std::getline(std::cin, rpcPass)) {
throw std::runtime_error("-stdinrpcpass specified but failed to read from standard input");
}
gArgs.ForceSetArg("-rpcpassword", rpcPass);
}
std::vector<std::string> args = std::vector<std::string>(&argv[1], &argv[argc]);
if (gArgs.GetBoolArg("-stdin", false)) {
// Read one arg per line from stdin and append
std::string line;
while (std::getline(std::cin, line)) {
args.push_back(line);
}
}
std::unique_ptr<BaseRequestHandler> rh;
std::string method;
if (gArgs.GetBoolArg("-getinfo", false)) {
rh.reset(new GetinfoRequestHandler());
method = "";
} else {
rh.reset(new DefaultRequestHandler());
if (args.size() < 1) {
throw std::runtime_error("too few parameters (need at least command)");
}
method = args[0];
args.erase(args.begin()); // Remove trailing method name from arguments vector
}
// Execute and handle connection failures with -rpcwait
const bool fWait = gArgs.GetBoolArg("-rpcwait", false);
do {
try {
const UniValue reply = CallRPC(rh.get(), method, args);
// Parse reply
const UniValue& result = find_value(reply, "result");
const UniValue& error = find_value(reply, "error");
if (!error.isNull()) {
// Error
int code = error["code"].get_int();
if (fWait && code == RPC_IN_WARMUP)
throw CConnectionFailed("server in warmup");
strPrint = "error: " + error.write();
nRet = abs(code);
if (error.isObject())
{
UniValue errCode = find_value(error, "code");
UniValue errMsg = find_value(error, "message");
strPrint = errCode.isNull() ? "" : "error code: "+errCode.getValStr()+"\n";
if (errMsg.isStr())
strPrint += "error message:\n"+errMsg.get_str();
if (errCode.isNum() && errCode.get_int() == RPC_WALLET_NOT_SPECIFIED) {
strPrint += "\nTry adding \"-rpcwallet=<filename>\" option to feathercoin-cli command line.";
}
}
} else {
// Result
if (result.isNull())
strPrint = "";
else if (result.isStr())
strPrint = result.get_str();
else
strPrint = result.write(2);
}
// Connection succeeded, no need to retry.
break;
}
catch (const CConnectionFailed&) {
if (fWait)
MilliSleep(1000);
else
throw;
}
} while (fWait);
}
catch (const std::exception& e) {
strPrint = std::string("error: ") + e.what();
nRet = EXIT_FAILURE;
}
catch (...) {
PrintExceptionContinue(nullptr, "CommandLineRPC()");
throw;
}
if (strPrint != "") {
tfm::format(nRet == 0 ? std::cout : std::cerr, "%s\n", strPrint.c_str());
}
return nRet;
}
int main(int argc, char* argv[])
{
#ifdef WIN32
util::WinCmdLineArgs winArgs;
std::tie(argc, argv) = winArgs.get();
#endif
SetupEnvironment();
if (!SetupNetworking()) {
tfm::format(std::cerr, "Error: Initializing networking failed\n");
return EXIT_FAILURE;
}
event_set_log_callback(&libevent_log_cb);
try {
int ret = AppInitRPC(argc, argv);
if (ret != CONTINUE_EXECUTION)
return ret;
}
catch (const std::exception& e) {
PrintExceptionContinue(&e, "AppInitRPC()");
return EXIT_FAILURE;
} catch (...) {
PrintExceptionContinue(nullptr, "AppInitRPC()");
return EXIT_FAILURE;
}
int ret = EXIT_FAILURE;
try {
ret = CommandLineRPC(argc, argv);
}
catch (const std::exception& e) {
PrintExceptionContinue(&e, "CommandLineRPC()");
} catch (...) {
PrintExceptionContinue(nullptr, "CommandLineRPC()");
}
return ret;
}
| {
"content_hash": "14da2464931eae2ae4d809c5b76b79d9",
"timestamp": "",
"source": "github",
"line_count": 555,
"max_line_length": 395,
"avg_line_length": 41.91171171171171,
"alnum_prop": 0.6264563002450454,
"repo_name": "wellenreiter01/Feathercoin",
"id": "487c437d2591d161c3b41a24e4b16665b088cc8c",
"size": "23261",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/bitcoin-cli.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "28453"
},
{
"name": "C",
"bytes": "928577"
},
{
"name": "C++",
"bytes": "6575402"
},
{
"name": "HTML",
"bytes": "21860"
},
{
"name": "Java",
"bytes": "30291"
},
{
"name": "M4",
"bytes": "207328"
},
{
"name": "Makefile",
"bytes": "122185"
},
{
"name": "Objective-C++",
"bytes": "5495"
},
{
"name": "Python",
"bytes": "1651347"
},
{
"name": "QMake",
"bytes": "798"
},
{
"name": "Sage",
"bytes": "30188"
},
{
"name": "Scheme",
"bytes": "6045"
},
{
"name": "Shell",
"bytes": "130582"
}
],
"symlink_target": ""
} |
package com.xj.scud.spring.schema;
import com.xj.scud.spring.bean.ServerBean;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.support.ManagedList;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.util.xml.DomUtils;
import org.w3c.dom.Element;
import java.util.List;
/**
* Author: baichuan - xiajun
* Date: 2017/04/13 15:39
*/
public class ServerParser extends AbstractSingleBeanDefinitionParser {
@Override
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {
//String config = element.getAttribute("config");
//builder.addPropertyValue("config", new RuntimeBeanReference(config));
List<BeanDefinition> interceptorsBeans = parseInterceptorElements(element, parserContext, builder);
if (interceptorsBeans != null && interceptorsBeans.size() > 0) {
builder.addPropertyValue("providers", interceptorsBeans);
}
}
protected List<BeanDefinition> parseInterceptorElements(Element refElement, ParserContext parserContext, BeanDefinitionBuilder builder) {
String interceptorsElementName = "providers";
Element interceptorsElement = DomUtils.getChildElementByTagName(refElement, interceptorsElementName);
if (null != interceptorsElement) {
List<Element> interceptorElements = DomUtils.getChildElementsByTagName(interceptorsElement, "provider");
ManagedList<BeanDefinition> list = new ManagedList<>();
list.setMergeEnabled(true);
list.setSource(parserContext.getReaderContext().extractSource(interceptorsElement));
for (Element element : interceptorElements) {
list.add(parserContext.getDelegate().parseCustomElement(element, builder.getRawBeanDefinition()));
}
return list;
}
return null;
}
@Override
protected Class<?> getBeanClass(Element element) {
return ServerBean.class;
}
@Override
protected boolean shouldGenerateId() {
return true;
}
}
| {
"content_hash": "71ecd719bc5d03ebd2678644a01990f4",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 141,
"avg_line_length": 42.96363636363636,
"alnum_prop": 0.7355057130765975,
"repo_name": "xiajunsongfan/scud",
"id": "b79653ca53830584aea790717a83b604104c55c1",
"size": "2363",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "scud-spring/src/main/java/com/xj/scud/spring/schema/ServerParser.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "92062"
},
{
"name": "Java",
"bytes": "252020"
},
{
"name": "JavaScript",
"bytes": "17876"
}
],
"symlink_target": ""
} |
/*
* HDA Patches - included by hda_codec.c
*/
/* Realtek codecs */
extern struct hda_codec_preset snd_hda_preset_realtek[];
/* C-Media codecs */
extern struct hda_codec_preset snd_hda_preset_cmedia[];
/* Analog Devices codecs */
extern struct hda_codec_preset snd_hda_preset_analog[];
/* SigmaTel codecs */
extern struct hda_codec_preset snd_hda_preset_sigmatel[];
/* SiLabs 3054/3055 modem codecs */
extern struct hda_codec_preset snd_hda_preset_si3054[];
static const struct hda_codec_preset *hda_preset_tables[] = {
snd_hda_preset_realtek,
snd_hda_preset_cmedia,
snd_hda_preset_analog,
snd_hda_preset_sigmatel,
snd_hda_preset_si3054,
NULL
};
| {
"content_hash": "43cdaa712066097e1d261f246d1cbf99",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 61,
"avg_line_length": 28.47826086956522,
"alnum_prop": 0.7297709923664122,
"repo_name": "ut-osa/syncchar",
"id": "acaef3c811b8c4791271f2250603d8cce6160e32",
"size": "655",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "linux-2.6.16-unmod/sound/pci/hda/hda_patch.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "4526"
},
{
"name": "Assembly",
"bytes": "7269561"
},
{
"name": "C",
"bytes": "191363313"
},
{
"name": "C++",
"bytes": "2703790"
},
{
"name": "Objective-C",
"bytes": "515305"
},
{
"name": "Perl",
"bytes": "118289"
},
{
"name": "Python",
"bytes": "160654"
},
{
"name": "Scala",
"bytes": "12158"
},
{
"name": "Shell",
"bytes": "48243"
},
{
"name": "TeX",
"bytes": "51367"
},
{
"name": "UnrealScript",
"bytes": "20822"
},
{
"name": "XSLT",
"bytes": "310"
}
],
"symlink_target": ""
} |
package org.apache.geode.internal.net;
import static org.apache.commons.lang3.ObjectUtils.getIfNull;
import static org.apache.geode.internal.net.filewatch.FileWatchingX509ExtendedKeyManager.newFileWatchingKeyManager;
import static org.apache.geode.internal.net.filewatch.FileWatchingX509ExtendedTrustManager.newFileWatchingTrustManager;
import java.io.Console;
import java.io.IOException;
import java.net.BindException;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
import java.security.GeneralSecurityException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.ConcurrentHashMap;
import javax.net.ssl.KeyManager;
import javax.net.ssl.SNIHostName;
import javax.net.ssl.SNIServerName;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLProtocolException;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.StandardConstants;
import javax.net.ssl.TrustManager;
import org.apache.logging.log4j.Logger;
import org.apache.geode.GemFireConfigException;
import org.apache.geode.SystemFailure;
import org.apache.geode.annotations.VisibleForTesting;
import org.apache.geode.annotations.internal.DeprecatedButRequiredForBackwardsCompatibilityTesting;
import org.apache.geode.annotations.internal.MakeNotStatic;
import org.apache.geode.cache.wan.GatewaySender;
import org.apache.geode.cache.wan.GatewayTransportFilter;
import org.apache.geode.distributed.ClientSocketFactory;
import org.apache.geode.distributed.internal.DistributionConfig;
import org.apache.geode.distributed.internal.DistributionConfigImpl;
import org.apache.geode.distributed.internal.tcpserver.AdvancedSocketCreatorImpl;
import org.apache.geode.distributed.internal.tcpserver.HostAndPort;
import org.apache.geode.distributed.internal.tcpserver.TcpSocketCreatorImpl;
import org.apache.geode.internal.cache.wan.TransportFilterServerSocket;
import org.apache.geode.internal.cache.wan.TransportFilterSocketFactory;
import org.apache.geode.internal.classloader.ClassPathLoader;
import org.apache.geode.internal.inet.LocalHostUtil;
import org.apache.geode.internal.util.ArgumentRedactor;
import org.apache.geode.logging.internal.log4j.api.LogService;
import org.apache.geode.net.SSLParameterExtension;
import org.apache.geode.util.internal.GeodeGlossary;
/**
* SocketCreators are built using a SocketCreatorFactory using Geode distributed-system properties.
* They know how to properly configure sockets for TLS (SSL) communications and perform
* handshakes. Connection-initiation uses a HostAndPort instance that is similar to an
* InetSocketAddress.
* <p>
* SocketCreator also supports a client-socket-factory that is designated with the property
* gemfire.clientSocketFactory for use in creating client->server connections.
*/
public class SocketCreator extends TcpSocketCreatorImpl {
private static final Logger logger = LogService.getLogger();
/**
* flag to force always using DNS (regardless of the fact that these lookups can hang)
*/
public static final boolean FORCE_DNS_USE =
Boolean.getBoolean(GeodeGlossary.GEMFIRE_PREFIX + "forceDnsUse");
/**
* set this to false to inhibit host name lookup
*/
@MakeNotStatic
public static volatile boolean resolve_dns = true;
/**
* set this to false to use an inet_addr in a client's ID
*/
@MakeNotStatic
public static volatile boolean use_client_host_name = true;
@MakeNotStatic
private static final ConcurrentHashMap<InetAddress, String> hostNames = new ConcurrentHashMap<>();
/**
* Only print this SocketCreator's config once
*/
private boolean configShown = false;
/**
* Only print hostname validation disabled log once
*/
private boolean hostnameValidationDisabledLogShown = false;
private SSLContext sslContext;
private final SSLConfig sslConfig;
private ClientSocketFactory clientSocketFactory;
/**
* Whether to enable TCP keep alive for sockets. This boolean is controlled by the
* gemfire.setTcpKeepAlive java system property. If not set then GemFire will enable keep-alive on
* server->client and p2p connections.
*/
public static final boolean ENABLE_TCP_KEEP_ALIVE =
AdvancedSocketCreatorImpl.ENABLE_TCP_KEEP_ALIVE;
/**
* This method has migrated to LocalHostUtil but is kept in place here for
* backward-compatibility testing.
*
* @deprecated use {@link LocalHostUtil#getLocalHost()}
*/
@DeprecatedButRequiredForBackwardsCompatibilityTesting
@Deprecated
public static InetAddress getLocalHost() throws UnknownHostException {
return LocalHostUtil.getLocalHost();
}
/**
* returns the host name for the given inet address, using a local cache of names to avoid dns
* hits and duplicate strings
*/
public static String getHostName(InetAddress address) {
String result = hostNames.get(address);
if (result == null) {
result = address.getHostName();
hostNames.put(address, result);
}
return result;
}
/**
* Reset the hostNames caches
*/
public static void resetHostNameCache() {
hostNames.clear();
}
/**
* Constructs new SocketCreator instance.
*/
public SocketCreator(final SSLConfig sslConfig) {
this.sslConfig = sslConfig;
initialize();
}
@VisibleForTesting
SocketCreator(final SSLConfig sslConfig, SSLContext sslContext) {
this.sslConfig = sslConfig;
this.sslContext = sslContext;
}
/** returns the hostname or address for this client */
public static String getClientHostName() throws UnknownHostException {
InetAddress address = LocalHostUtil.getLocalHost();
return SocketCreator.use_client_host_name ? address.getCanonicalHostName()
: address.getHostAddress();
}
protected void initializeCreators() {
clusterSocketCreator = new SCClusterSocketCreator(this);
clientSocketCreator = new SCClientSocketCreator(this);
advancedSocketCreator = new SCAdvancedSocketCreator(this);
}
/**
* Initialize this SocketCreator.
* <p>
* Caller must synchronize on the SocketCreator instance.
*/
private void initialize() {
try {
try {
if (sslConfig.isEnabled() && getSslContext() == null) {
sslContext = createAndConfigureSSLContext();
}
} catch (Exception e) {
throw new GemFireConfigException("Error configuring GemFire ssl ", e);
}
// make sure TCPConduit picks up p2p properties...
org.apache.geode.internal.tcp.TCPConduit.init();
initializeClientSocketFactory();
} catch (VirtualMachineError err) {
SystemFailure.initiateFailure(err);
// If this ever returns, rethrow the error. We're poisoned
// now, so don't let this thread continue.
throw err;
} catch (Error t) {
// Whenever you catch Error or Throwable, you must also
// catch VirtualMachineError (see above). However, there is
// _still_ a possibility that you are dealing with a cascading
// error condition, so you also need to check to see if the JVM
// is still usable:
SystemFailure.checkFailure();
t.printStackTrace();
throw t;
} catch (RuntimeException re) {
re.printStackTrace();
throw re;
}
}
/**
* Creates & configures the SSLContext when SSL is enabled.
*
* @return new SSLContext configured using the given protocols & properties
*
* @throws GeneralSecurityException if security information can not be found
*/
private SSLContext createAndConfigureSSLContext() throws GeneralSecurityException {
if (sslConfig.useDefaultSSLContext()) {
return SSLContext.getDefault();
}
SSLContext newSSLContext = SSLUtil.getSSLContextInstance();
KeyManager[] keyManagers = null;
if (sslConfig.getKeystore() != null) {
keyManagers = new KeyManager[] {newFileWatchingKeyManager(sslConfig)};
}
TrustManager[] trustManagers = null;
if (sslConfig.getTruststore() != null) {
trustManagers = new TrustManager[] {newFileWatchingTrustManager(sslConfig)};
}
newSSLContext.init(keyManagers, trustManagers, null /* use the default secure random */);
return newSSLContext;
}
/**
* Used by SystemAdmin to read the properties from console
*
* @param env Map in which the properties are to be read from console.
*/
public static void readSSLProperties(Map<String, String> env) {
readSSLProperties(env, false);
}
/**
* Used to read the properties from console. AgentLauncher calls this method directly & ignores
* gemfire.properties. SystemAdmin calls this through {@link #readSSLProperties(Map)} and does
* NOT ignore gemfire.properties.
*
* @param env Map in which the properties are to be read from console.
* @param ignoreGemFirePropsFile if <code>false</code> existing gemfire.properties file is read,
* if <code>true</code>, properties from gemfire.properties file are ignored.
*/
public static void readSSLProperties(Map<String, String> env, boolean ignoreGemFirePropsFile) {
Properties props = new Properties();
DistributionConfigImpl.loadGemFireProperties(props, ignoreGemFirePropsFile);
for (Map.Entry<Object, Object> ent : props.entrySet()) {
String key = (String) ent.getKey();
// if the value of ssl props is empty, read them from console
if (key.startsWith(DistributionConfig.SSL_SYSTEM_PROPS_NAME)
|| key.startsWith(DistributionConfig.SYS_PROP_NAME)) {
if (key.startsWith(DistributionConfig.SYS_PROP_NAME)) {
key = key.substring(DistributionConfig.SYS_PROP_NAME.length());
}
final String value = (String) ent.getValue();
if (value == null || value.trim().equals("")) {
Console console = System.console();
if (console == null) {
throw new GemFireConfigException(
"SSL properties are empty, but a console is not available");
}
String val = console.readLine("Please enter " + key + ": ");
env.put(key, val);
}
}
}
}
/**
* context for SSL socket factories
*/
@VisibleForTesting
public SSLContext getSslContext() {
return sslContext;
}
/**
* A factory used to create client <code>Sockets</code>.
*/
public ClientSocketFactory getClientSocketFactory() {
return clientSocketFactory;
}
public SSLConfig getSslConfig() {
return sslConfig;
}
/**
* Returns true if this SocketCreator is configured to use SSL.
*/
@Override
protected boolean useSSL() {
return sslConfig.isEnabled();
}
/**
* Returns an SSLEngine that can be used to perform TLS handshakes and communication
*/
public SSLEngine createSSLEngine(String hostName, int port, boolean clientSocket) {
SSLEngine engine = getSslContext().createSSLEngine(hostName, port);
configureSSLEngine(engine, hostName, port, clientSocket);
return engine;
}
@VisibleForTesting
void configureSSLEngine(final SSLEngine engine, final String hostName, final int port,
final boolean clientSocket) {
engine.setUseClientMode(clientSocket);
final SSLParameters parameters = engine.getSSLParameters();
configureSSLParameters(parameters, hostName, port, clientSocket);
engine.setSSLParameters(parameters);
}
@VisibleForTesting
void configureSSLParameters(final SSLParameters parameters, final String hostName,
final int port, final boolean clientSocket) {
if (sslConfig.doEndpointIdentification()) {
// set server-names so that endpoint identification algorithms can find what's expected
addServerNameIfNotSet(parameters, new HostAndPort(hostName, port));
}
if (clientSocket) {
checkAndEnableHostnameValidation(parameters);
} else {
parameters.setNeedClientAuth(sslConfig.isRequireAuth());
}
configureProtocols(clientSocket, parameters);
configureCipherSuites(parameters);
}
/**
* @see <a href=
* "https://docs.oracle.com/javase/8/docs/technotes/guides/security/jsse/JSSERefGuide.html#SSLENG">JSSE
* Reference Guide</a>
*
* @param socketChannel the socket's NIO channel
* @param engine the sslEngine (see createSSLEngine)
* @param timeout handshake timeout in milliseconds. No timeout if <= 0
* @param peerNetBuffer the buffer to use in reading data from socketChannel. This should also be
* used in subsequent I/O operations
* @return The SSLEngine to be used in processing data for sending/receiving from the channel
*/
public NioSslEngine handshakeSSLSocketChannel(SocketChannel socketChannel,
SSLEngine engine,
int timeout,
ByteBuffer peerNetBuffer,
BufferPool bufferPool)
throws IOException {
while (!socketChannel.finishConnect()) {
try {
Thread.sleep(50);
} catch (InterruptedException e) {
if (!socketChannel.socket().isClosed()) {
socketChannel.close();
}
throw new IOException("Interrupted while performing handshake", e);
}
}
NioSslEngine nioSslEngine = new NioSslEngine(engine, bufferPool);
boolean blocking = socketChannel.isBlocking();
if (blocking) {
socketChannel.configureBlocking(false);
}
try {
nioSslEngine.handshake(socketChannel, timeout, peerNetBuffer);
} catch (SSLException e) {
if (!socketChannel.socket().isClosed()) {
socketChannel.close();
}
logger.warn("SSL handshake exception", e);
throw e;
} finally {
if (blocking) {
try {
socketChannel.configureBlocking(true);
} catch (IOException ignored) {
// problem setting the socket back to blocking mode but the socket's going to be closed
}
}
}
return nioSslEngine;
}
void checkAndEnableHostnameValidation(final SSLParameters sslParameters) {
if (sslConfig.doEndpointIdentification()) {
sslParameters.setEndpointIdentificationAlgorithm("HTTPS");
return;
}
if (!hostnameValidationDisabledLogShown) {
logger.info("Your SSL configuration disables hostname validation. "
+ "ssl-endpoint-identification-enabled should be set to true when SSL is enabled. "
+ "Please refer to the Apache GEODE SSL Documentation for SSL Property: ssl‑endpoint‑identification‑enabled");
hostnameValidationDisabledLogShown = true;
}
}
/**
* Use this method to perform the SSL handshake on a newly accepted socket. Non-SSL
* sockets are ignored by this method.
*
* @param timeout the number of milliseconds allowed for the handshake to complete
*/
void handshakeIfSocketIsSSL(Socket socket, int timeout) throws IOException {
if (!(socket instanceof SSLSocket)) {
return;
}
int oldTimeout = socket.getSoTimeout();
socket.setSoTimeout(timeout);
SSLSocket sslSocket = (SSLSocket) socket;
try {
sslSocket.startHandshake();
} catch (SSLPeerUnverifiedException ex) {
if (sslConfig.isRequireAuth()) {
logger.fatal(String.format("SSL Error in authenticating peer %s[%s].",
socket.getInetAddress(), socket.getPort()), ex);
throw ex;
}
}
// Pre jkd11, startHandshake is throwing SocketTimeoutException.
// in jdk 11 it is throwing SSLProtocolException with a cause of SocketTimeoutException.
// this is to keep the exception consistent across jdk
catch (SSLProtocolException ex) {
if (ex.getCause() instanceof SocketTimeoutException) {
throw (SocketTimeoutException) ex.getCause();
} else {
throw ex;
}
} finally {
try {
socket.setSoTimeout(oldTimeout);
} catch (SocketException ignored) {
}
}
}
/**
* Create a server socket with the given transport filters.<br>
* Note: This method is outside of the
* client/server/advanced interfaces because it references WAN classes that aren't
* available to them.
*/
public ServerSocket createServerSocket(int port, int backlog, InetAddress bindAddress,
List<GatewayTransportFilter> transportFilters, int socketBufferSize) throws IOException {
if (transportFilters.isEmpty()) {
return ((SCClusterSocketCreator) forCluster())
.createServerSocket(port, backlog, bindAddress, socketBufferSize, useSSL());
} else {
printConfig();
ServerSocket result = new TransportFilterServerSocket(transportFilters);
result.setReuseAddress(true);
// Set the receive buffer size before binding the socket so
// that large buffers will be allocated on accepted sockets (see
// java.net.ServerSocket.setReceiverBufferSize javadocs)
result.setReceiveBufferSize(socketBufferSize);
try {
result.bind(new InetSocketAddress(bindAddress, port), backlog);
} catch (BindException e) {
BindException throwMe = new BindException(
String.format("Failed to create server socket on %s[%s]", bindAddress, port));
throwMe.initCause(e);
throw throwMe;
}
return result;
}
}
/**
* When a socket is connected to a server socket, it should be passed to this method for SSL
* configuration.
*/
void configureClientSSLSocket(final Socket socket, final HostAndPort address, int timeout)
throws IOException {
if (socket instanceof SSLSocket) {
final SSLSocket sslSocket = (SSLSocket) socket;
sslSocket.setUseClientMode(true);
sslSocket.setEnableSessionCreation(true);
final SSLParameters parameters = sslSocket.getSSLParameters();
checkAndEnableHostnameValidation(parameters);
addServerNameIfNotSet(parameters, address);
configureProtocols(true, parameters);
configureCipherSuites(parameters);
sslSocket.setSSLParameters(applySSLParameterExtensions(parameters));
try {
if (timeout > 0) {
sslSocket.setSoTimeout(timeout);
}
sslSocket.startHandshake();
}
// Pre jkd11, startHandshake is throwing SocketTimeoutException.
// in jdk 11 it is throwing SSLProtocolException with a cause of SocketTimeoutException.
// this is to keep the exception consistent across jdk
catch (SSLProtocolException ex) {
if (ex.getCause() instanceof SocketTimeoutException) {
throw (SocketTimeoutException) ex.getCause();
} else {
throw ex;
}
} catch (SSLHandshakeException ex) {
String message = ex.getMessage();
if (message != null && !message.contains("Remote host terminated the handshake")) {
logger.fatal(String.format("Problem forming SSL connection to %s[%s].",
socket.getInetAddress(), socket.getPort()), ex);
}
throw ex;
} catch (SSLPeerUnverifiedException ex) {
if (sslConfig.isRequireAuth()) {
logger.fatal("SSL authentication exception.", ex);
throw ex;
}
}
}
}
SSLParameters applySSLParameterExtensions(final SSLParameters parameters) {
final SSLParameterExtension sslParameterExtension = sslConfig.getSSLParameterExtension();
if (sslParameterExtension != null) {
return sslParameterExtension.modifySSLClientSocketParameters(parameters);
}
return parameters;
}
void configureProtocols(final boolean clientSocket, final SSLParameters parameters) {
final String[] protocols = clientSocket ? sslConfig.getClientProtocolsAsStringArray()
: sslConfig.getServerProtocolsAsStringArray();
if (!SSLConfig.isAnyProtocols(protocols)) {
parameters.setProtocols(protocols);
}
}
void configureCipherSuites(final SSLParameters parameters) {
final String[] ciphers = sslConfig.getCiphersAsStringArray();
if (!SSLConfig.isAnyCiphers(ciphers)) {
parameters.setCipherSuites(ciphers);
}
}
static void addServerNameIfNotSet(final SSLParameters parameters,
final HostAndPort address) {
final List<SNIServerName> serverNames =
new ArrayList<>(getIfNull(parameters.getServerNames(), Collections::emptyList));
if (serverNames.stream()
.mapToInt(SNIServerName::getType)
.anyMatch(type -> type == StandardConstants.SNI_HOST_NAME)) {
// we already have a SNI hostname set. Do nothing.
return;
}
serverNames.add(new SNIHostName(address.getHostName()));
parameters.setServerNames(serverNames);
}
/**
* Print current configured state to log.
*/
void printConfig() {
if (!configShown && logger.isDebugEnabled()) {
configShown = true;
StringBuilder sb = new StringBuilder();
sb.append("SSL Configuration: \n");
sb.append(" ssl-enabled = ").append(sslConfig.isEnabled()).append("\n");
// add other options here....
for (String key : System.getProperties().stringPropertyNames()) { // fix for 46822
if (key.startsWith("javax.net.ssl")) {
String possiblyRedactedValue =
ArgumentRedactor.redactArgumentIfNecessary(key, System.getProperty(key));
sb.append(" ").append(key).append(" = ").append(possiblyRedactedValue).append("\n");
}
}
logger.debug(sb.toString());
}
}
protected void initializeClientSocketFactory() {
clientSocketFactory = null;
String className =
System.getProperty(GeodeGlossary.GEMFIRE_PREFIX + "clientSocketFactory");
if (className != null) {
Object o;
try {
Class<?> c = ClassPathLoader.getLatest().forName(className);
o = c.newInstance();
} catch (Exception e) {
// No cache exists yet, so this can't be logged.
String s = "An unexpected exception occurred while instantiating a " + className + ": " + e;
throw new IllegalArgumentException(s);
}
if (o instanceof ClientSocketFactory) {
clientSocketFactory = (ClientSocketFactory) o;
} else {
String s = "Class \"" + className + "\" is not a ClientSocketFactory";
throw new IllegalArgumentException(s);
}
}
}
public void initializeTransportFilterClientSocketFactory(GatewaySender sender) {
clientSocketFactory = new TransportFilterSocketFactory()
.setGatewayTransportFilters(sender.getGatewayTransportFilters());
}
}
| {
"content_hash": "7b8b460ad4da0ef0ca4c43c890265b36",
"timestamp": "",
"source": "github",
"line_count": 636,
"max_line_length": 120,
"avg_line_length": 35.79245283018868,
"alnum_prop": 0.7073449305921631,
"repo_name": "jdeppe-pivotal/geode",
"id": "caeda963223a3b77748a14346ec51dc29afc49fb",
"size": "23559",
"binary": false,
"copies": "3",
"ref": "refs/heads/develop",
"path": "geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "104031"
},
{
"name": "Dockerfile",
"bytes": "15956"
},
{
"name": "Go",
"bytes": "40709"
},
{
"name": "Groovy",
"bytes": "41916"
},
{
"name": "HTML",
"bytes": "4037680"
},
{
"name": "Java",
"bytes": "33151406"
},
{
"name": "JavaScript",
"bytes": "1780821"
},
{
"name": "Python",
"bytes": "29801"
},
{
"name": "Ruby",
"bytes": "1801"
},
{
"name": "SCSS",
"bytes": "2677"
},
{
"name": "Shell",
"bytes": "275617"
}
],
"symlink_target": ""
} |
<?php
use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
Use common\components\CommonHelper;
use yii\helpers\ArrayHelper;
use common\models\LoginForm;
use yii\captcha\Captcha;
use frontend\models\PasswordResetRequestForm;
$forgot = new PasswordResetRequestForm();
/*$religion_data = CommonHelper::getReligion();
$community_data = CommonHelper::getCommunity();*/
// var_dump($id = Yii::$app->user->identity->id);
$id = 0;
if (!Yii::$app->user->isGuest) {
#$id = base64_decode($id);
$id = Yii::$app->user->identity->id;
}
//die();
use yii\jui\DatePicker;
?>
<div class="video">
<div class="drop-effect"></div>
<video autoplay data-preload="auto" poster="images/poster.jpg" id="bgvid" loop>
<source src="https://demosthenes.info/assets/videos/polina.webm" type="video/webm">
<source src="https://demosthenes.info/assets/videos/polina.mp4" type="video/mp4">
</video>
</div>
<header aria-label="video-header2" role="banner">
<!-- Video -->
<!-- over-header -->
<div class="over-header">
<div class="header">
<div class="container">
<div class="row">
<div class="col-sm-6 col-xs-12">
<div class="logo"><a href="<?= Yii::$app->getUrlManager()->getBaseUrl() ?>" title="logo">
<img
src="images/logo1.png" width="250" height="88" alt="logo" class="img1"
title="Kande Pohe"> </a>
<a href="<?= Yii::$app->getUrlManager()->getBaseUrl() ?>" title="logo"> <img
src="images/logo2.png"
width="214" height="78"
alt="logo" class="img2"
title="Kande Pohe"> </a>
</div>
</div>
<div class="col-sm-6 col-xs-12">
<div class="menu pull-right">
<ul class="list-inline">
<?php if ($id) { ?>
<li><?= html::a('<i class="ti-power-off m-r-5"></i> Logout</a>', ['site/logout'], ['data-method' => 'post']) ?></li>
<li><a href="user/my-profile" title="Profile">Profile</a></li>
<?php } else { ?>
<li><a href="#" title="Login" data-toggle="modal" data-target="#login"
class="login_button">Login</a>
</li>
<li><a href="#" title="Sign up Free" data-toggle="modal"
data-target="#myModalNorm"
id="suf">Sign up
Free</a></li>
<?php } ?>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="welcome-content">
<div class="container">
<div class="row">
<div class="col-sm-12">
<h1 class="welcome-line">Etiam pellentesque sapien felis<br>
<span>Neque porro quisquam est qui dolorem ipsum quia dolor sit amet,</span></h1>
<!--<input type="button" name="button" value="button label" class="btn btn-primary mrg-tp-10">
<p class="play visible-lg visible-md"><a href="#"><img src="images/play.png" width="48" height="48" alt="play"></a></p>-->
</div>
</div>
</div>
</div>
<div class="search-filter">
<div class="container">
<div class="row filter">
<?php
$form = ActiveForm::begin([
'id' => 'form-search',
'action' => ['search/basic-search'],
'enableClientValidation' => true,
'enableAjaxValidation' => true,
'validateOnSubmit' => true,
'validateOnChange' => true,
]);
?>
<div class="col-sm-4 col-md-2">
<?= $form->field($model, 'Profile_for')->dropDownList(
['FEMALE' => 'BRIDE', 'MALE' => 'GROOM'],
['class' => 'demo-default select-beast',
'prompt' => 'Looking For'
]
)->label(false); ?>
</div>
<div class="col-sm-4 col-md-2">
<?= $form->field($model, 'iCommunity_ID')->dropDownList(
ArrayHelper::map(CommonHelper::getCommunity(), 'iCommunity_ID', 'vName'),
['class' => 'demo-default select-beast',
'prompt' => 'Community'
]
)->label(false)->error(false); ?>
</div>
<div class="col-sm-4 col-md-2">
<?= $form->field($model, 'iSubCommunity_ID')->dropDownList(
ArrayHelper::map(CommonHelper::getSubCommunity(), 'iSubCommunity_ID', 'vName'),
['class' => 'demo-default select-beast',
'prompt' => 'Sub Caste'
]
)->label(false)->error(false); ?>
</div>
<div class="col-sm-4 col-md-2">
<?php
$range = range(18, 100);
?>
<?= $form->field($model, 'Agerange')->dropDownList(
//array_combine($range, $range),
['18-21' => '18 To 21', '22-28' => '22 To 28', '29-35' => '29 To 35', '36-45' => '36 To 45', '46-60' => '46 To 60', '61-80' => '61 To 80', '81-100' => '81 To 100'],
['prompt' => 'Age Group',
'class' => 'demo-default select-beast']
)->label(false)->error(false); ?>
</div>
<div class="col-sm-4 col-md-2">
<?= $form->field($model, 'iHeightID')->dropDownList(
ArrayHelper::map(CommonHelper::getHeight(), 'iHeightID', 'vName'),
['class' => 'demo-default select-beast',
'prompt' => 'Height'
]
)->label(false)->error(false); ?>
</div>
<?php if (!Yii::$app->user->isGuest) { ?>
<div class="col-sm-4 col-md-2">
<?= Html::submitButton('SEARCH', ['class' => 'btn btn-primary mrg-tp-10 ', 'name' => 'button']) ?>
</div>
<?php } else { ?>
<div class="col-sm-4 col-md-2">
<a href="#" title="Login" data-toggle="modal" data-target="#login"
class="btn btn-primary mrg-tp-10 login_button"
id="">Seach</a>
</div>
<?php } ?>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>
</div>
</header>
<!--featured-member-->
<?php if (count($FeaturedMembers) > 0) {
?>
<section class="featured-member">
<div class="container">
<div class="row">
<div class="col-sm-12 text-center">
<h2 class="heading-md">Featured Members</h2>
<p class="tagline">Find the one made for you among thousands of eligible matches</p>
</div>
</div>
<div class="row">
<?php
foreach ($FeaturedMembers as $FK => $FV) {
?>
<div class="col-xs-12 col-sm-6 col-md-3">
<div class="thumbnail">
<div class="caption">
<h4><?= $FV->Registration_Number ?></h4>
<div class="details">
<p>Age: <?= CommonHelper::getAge($FV->DOB); ?> years</p>
<p>Height: <?= CommonHelper::setInputVal($FV->height->vName, 'text'); ?></p>
<p>
Education: <?= CommonHelper::setInputVal($FV->educationLevelName->vEducationLevelName, 'text') ?></p>
<p>
Occupation: <?= CommonHelper::setInputVal($FV->workingAsName->vWorkingAsName, 'text') ?></p>
<p>Caste: <?= $FV->communityName->vName; ?></p>
<p>Native: <?= CommonHelper::setInputVal($FV->vNativePlaceCA, 'text') ?></p>
<p>Current
City: <?= CommonHelper::setInputVal($FV->cityName->vCityName, 'text') . ', ' . CommonHelper::setInputVal($FV->countryName->vCountryName, 'text') ?></p>
</div>
</div>
<?= Html::img(CommonHelper::getPhotos('USER', $FV->id, '260' . $FV->propic, 260, '', 'Yes'), ['alt' => $FV->FullName]); ?>
</div>
<figcaption>
<a href="<?= CommonHelper::getUserUrl($FV->Registration_Number) ?>&source=recently_joined">
<small><?= $FV->FullName ?></small>
</a>
<div class="inter">
<div class="int-ico pull-left">
<input id="<?= $FV->Registration_Number ?>" type="checkbox" name="Remember"
value="check1">
<label for="<?= $FV->Registration_Number ?>" class="control-label">
<a <?php
if (!Yii::$app->user->isGuest) { ?>
href="<?= CommonHelper::getUserUrl($FV->Registration_Number) ?>&source=recently_joined"
<?php } else { ?>
href="#" title="Login" data-toggle="modal" data-target="#login" id="login_button"
<?php } ?>
>Show Interest</a>
</label>
</div>
</div>
</figcaption>
</div>
<?php
}
?>
</div>
</div>
</section>
<?php }
?>
<!--Success Stories-->
<section>
<div class="container">
<div class="row">
<div class="col-sm-12 text-center">
<h2 class="heading-md">Success Stories</h2>
<p class="tagline">Read the success stories of these lovely couples</p>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-sm-6">
<div class="block"><img src="images/pic1.jpg" width="503" height="243" class="img-responsive">
<div class="black-strap">
<div class="name">Divya and Rajdeep Abhyankar</div>
<div class="inter"><i class="fa fa-map-marker"></i> Nashik</div>
<div class="inter"><i class="fa fa-calendar"></i> Married Since: March 2015</div>
</div>
</div>
<div class="block"><img src="images/pattern_bg.jpg" width="507" height="474" class="img-responsive">
<summary>
<p>Our meeting was planned after the families met . After my parents met Mahima they really
thought her to be a good match for me. Some days later when i visited India and met her
things worked up and finally we got engaged and married.</p>
<p class="aut text-danger font20 mrg-tp-10"><strong>Rani and Swapnil Samant</strong>
(Ahmedabad)
</p>
</summary>
</div>
</div>
<div class="col-sm-6">
<div class="block"><img src="images/pic5.jpg" width="510" height="494" class="img-responsive">
<div class="black-strap">
<div class="name">Divya and Rajdeep Abhyankar</div>
<div class="inter"><i class="fa fa-map-marker"></i> Nashik</div>
<div class="inter"><i class="fa fa-calendar"></i> Married Since: March 2015</div>
</div>
</div>
<div class="block"><img src="images/pic3.jpg" width="510" height="226" class="img-responsive">
<div class="black-strap">
<div class="name">Divya and Rajdeep Abhyankar</div>
<div class="inter"><i class="fa fa-map-marker"></i> Nashik</div>
<div class="inter"><i class="fa fa-calendar"></i> Married Since: March 2015</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="block"><img src="images/pic4.jpg" width="510" height="247" class="img-responsive">
<div class="black-strap">
<div class="name">Divya and Rajdeep Abhyankar</div>
<div class="inter"><i class="fa fa-map-marker"></i> Nashik</div>
<div class="inter"><i class="fa fa-calendar"></i> Married Since: March 2015</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="block"><img src="images/pattern_yellow.jpg" width="510" height="251"
class="img-responsive">
<summary>
<p>“We have been married for almost a year now. Things are great; We are so happy. </p>
<p class="aut font20 mrg-tp-10"><strong>Preeti and Sandeep Prabhu </strong> (Nashik))</p>
</summary>
</div>
</div>
</div>
</div>
</section>
<!--What Sets us Apart-->
<section>
<div class="container">
<div class="row">
<div class="col-sm-12 text-center">
<h2 class="heading-md">What Sets us Apart</h2>
</div>
</div>
<div class="row">
<div class="col-sm-4">
<div class="promo">
<figure><img src="images/vector_icon1.png" width="119" height="102" alt="Safe and Secure">
</figure>
<figcaption>
<h3>Safe and Secure</h3>
<p>sed tincidunt mi rhoncus. Nam eget nulla risus. Etiam aliqttricies maximus. Vivamus risus
velit, cursus at aliquam eu, vehicula vel risus. </p>
</figcaption>
</div>
</div>
<div class="col-sm-4">
<div class="promo">
<figure><img src="images/vector_icon2.png" width="119" height="102" alt="Maximum Responses">
</figure>
<figcaption>
<h3>Maximum Responses</h3>
<p>sed tincidunt mi rhoncus. Nam eget nulla risus. Etiam aliqttricies maximus. Vivamus risus
velit, cursus at aliquam eu, vehicula vel risus. </p>
</figcaption>
</div>
</div>
<div class="col-sm-4">
<div class="promo">
<figure><img src="images/vector_icon3.png" width="119" height="102" alt="Best Matches"></figure>
<figcaption>
<h3>Best Matches</h3>
<p>sed tincidunt mi rhoncus. Nam eget nulla risus. Etiam aliqttricies maximus. Vivamus risus
velit, cursus at aliquam eu, vehicula vel risus. </p>
</figcaption>
</div>
</div>
</div>
</div>
</section>
<?php if (Yii::$app->user->isGuest) { ?>
<!-- Modal Signup -->
<div class="modal fade" id="myModalNorm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<p class="text-center mrg-bt-30">
<?= Html::img('@web/images/logo.png', ['width' => '157', 'height' => 61, 'alt' => 'logo']); ?>
</p>
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal"><span aria-hidden="true">×</span> <span
class="sr-only">Close</span>
</button>
<h2 class="text-center">Signup Free</h2>
</div>
<!-- Modal Body -->
<div class="modal-body">
<?php
$form = ActiveForm::begin([
'id' => 'form-signup',
//'action' => 'javascript:void(0)',
'action' => ['/site/register'],
'enableAjaxValidation' => true,
'enableClientValidation' => true,
'validateOnChange' => true,
]);
?>
<button type="button" class="btn btn-primary mrg-tp-10 col-xs-12" data-toggle="modal"
id="signup_model_btn"
data-target="#signup_model" style="display: none"></button>
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<div class="form-cont">
<?= $form->field($model, 'email', ["template" => '<span class="input input--akira">{input}<label class="input__label input__label--akira" for="input-22"> <span class="input__label-content input__label-content--akira">Email</span> </label></span>{error}'])->input('email', ['class' => 'input__field input__field--akira form-control']) ?>
</div>
<div class="form-cont">
<?= $form->field($model, 'password_hash', ["template" => '<span class="input input--akira">{input}<label class="input__label input__label--akira" for="input-22"> <span class="input__label-content input__label-content--akira">Password</span> </label></span>{error}'])->input('password', ['class' => 'input__field input__field--akira form-control']) ?>
</div>
<div class="form-cont">
<?= $form->field($model, 'repeat_password', ["template" => '<span class="input input--akira">{input}<label class="input__label input__label--akira" for="input-22"> <span class="input__label-content input__label-content--akira">Retype Password</span> </label></span>{error}'])->input('password', ['class' => 'input__field input__field--akira form-control']) ?>
</div>
<div class="form-cont">
<?= $form->field($model, 'Profile_created_for')->dropDownList(
['' => 'Profile for', 'Self' => 'Self', 'Son' => 'Son', 'Daughter' => 'Daughter', 'Brother' => 'Brother', 'Sister' => 'Sister', 'Friend' => 'Friend'],
['class' => 'demo-default select-beast']
)->label(false); ?>
</div>
<div>
<div class="row">
<div class="form-cont col-xs-6">
<?= $form->field($model, 'First_Name', ["template" => '<span class="input input--akira">{input}<label class="input__label input__label--akira" for="input-22"> <span class="input__label-content input__label-content--akira">First Name</span> </label></span>{error}'])->input('text', ['class' => 'input__field input__field--akira form-control']) ?>
</div>
<div class="form-cont col-xs-6">
<?= $form->field($model, 'Last_Name', ["template" => '<span class="input input--akira">{input}<label class="input__label input__label--akira" for="input-22"> <span class="input__label-content input__label-content--akira">Last Name</span> </label></span>{error}'])->input('text', ['class' => 'input__field input__field--akira form-control']) ?>
</div>
</div>
</div>
<div class="form-cont">
<div class="radio radio-new" id="IVA">
<?= $form->field($model, 'Gender')->RadioList(
['MALE' => 'MALE', 'FEMALE' => 'FEMALE'],
[
'item' => function ($index, $label, $name, $checked, $value) {
$return = '<input type="radio" class="genderV" id="' . $value . '" name="' . $name . '" value="' . $value . '" >';
$return .= '<label for="' . $value . '">' . ucwords($label) . '</label>';
return $return;
}
]
)->label(false); ?>
</div>
</div>
<div class="form-cont">
<?= $form->field($model, 'DOB', ["template" => '<span class="input input--akira dobcl ">{input}<label class="input__label input__label--akira" for="input-22"> <span class="input__label-content input__label-content--akira">Date Of Birth</span> </label></span>{error}'])->input('text')
->widget(\yii\jui\DatePicker::classname(),
[
'dateFormat' => 'php:Y-m-d',
'options' => [
'class' => 'input__field input__field--akira form-control',
'id' => 'user-dob',
'onchange' => ' $(".dobcl").addClass("input--filled");',
'onkeyup' => ' $(".hasDatepicker").val("");',
],
'clientOptions' => [
'changeMonth' => true,
'yearRange' => '-70:-21',
'changeYear' => true,
'maxDate' => date('Y-m-d', strtotime('-21 year')),
],
]);
?>
</div>
<div>
<div class="row">
<div class="form-cont col-xs-6">
<?= $form->field($model, 'county_code')->dropDownList(
['+91' => '+91'],
['class' => 'demo-default select-beast', 'prompt' => 'Country Code']
)->label(false); ?>
</div>
<div class="form-cont col-xs-6">
<?= $form->field($model, 'Mobile', ["template" => '<span class="input input--akira">{input}<label class="input__label input__label--akira" for="input-22"> <span class="input__label-content input__label-content--akira">Mobile No#</span> </label></span>{error}'])->input('text', ['class' => 'input__field input__field--akira form-control']) ?>
</div>
</div>
<!-- <div class="row">
<div class="col-xs-12">
<script src="https://www.google.com/recaptcha/api.js" type="text/javascript"></script>
<div class="g-recaptcha" data-sitekey="6Lc2xSgTAAAAAGwyfpM9OHwcAa6GZa6-6ghDl4yY"></div>
<div style="color:red;" id="cerror"></div>
</div>
</div> -->
<div class="row">
<div class="checkbox col-sm-12 checkbox-new" id="cjkbox">
<?= $form->field($model, 'toc')->checkboxList(
['YES'],
[
'item' => function ($index, $label, $name, $checked, $value) {
$return = '<input type="checkbox" id="toc" name="' . $name . '" value="YES" >';
$return .= '<label for="toc" class="control-label toccl">I agree to the <a href="#" title="[Privacy
Policy]">[Privacy
Policy]</a> and <a href="#" title="[T&C]">[T&C]</a></label>';
return $return;
}
]
)->label(false); ?>
</div>
<div class="col-sm-10">
<?= Html::submitButton('Sign up free', ['class' => 'btn btn-primary mrg-tp-10', 'name' => 'signup-button', 'id' => 'btnSignup']) ?>
</div>
</div>
<?php ActiveForm::end(); ?>
<div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal Login -->
<div class="modal fade login login-top" id="login" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true" data-loading-text="Login..">
<div class="modal-dialog">
<p class="text-center mrg-bt-10"><?= Html::img('@web/images/logo.png', ['width' => '157', 'height' => 61, 'alt' => 'logo']); ?></p>
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal"><span aria-hidden="true">×</span> <span
class="sr-only">Close</span>
</button>
<h2 class="text-center">Log Into Your Account</h2>
</div>
<!-- Modal Body -->
<div class="modal-body">
<?php
$login = new LoginForm();
?>
<?php $form = ActiveForm::begin([
'id' => 'login-form',
'action' => 'site/login',
'enableAjaxValidation' => true,
'validateOnChange' => false,
//'enableClientValidation' => true,
'validateOnSubmit' => true,
]);
?>
<div class="row">
<div class="col-sm-10 col-sm-offset-1 text-left">
<?= $form->errorSummary($model, ['header' => '']); ?></div>
</div>
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<div
class="form-cont"> <?= $form->field($login, 'email', ["template" => '<span class="input input--akira">{input}<label class="input__label input__label--akira" for="input-22"> <span class="input__label-content input__label-content--akira">Email</span> </label></span>{error}'])->input('email', ['class' => 'input__field input__field--akira form-control', "data-toggle" => "tooltip", "data-placement" => "top", 'data-original-title' => 'Email ID is mandatory to register at Kande- Pohe.com. We never share your email address with 3rd parties.'])->error('false'); ?> </div>
<div class="form-cont">
<?= $form->field($login, 'password', ["template" => '<span class="input input--akira">{input}<label class="input__label input__label--akira" for="input-22"> <span class="input__label-content input__label-content--akira">Password</span> </label></span>{error}<div class="loginerror"></div> '])->input('password', ['class' => 'input__field input__field--akira form-control', "data-toggle" => "tooltip", "data-placement" => "top", 'data-original-title' => 'Please enter a password with minimum 6 characters'])->error(false); ?>
</div>
<div class="checkbox">
<input id="Remember" type="checkbox" name="Remember" value="yes">
<label for="Remember" class="control-label">Remember me</label>
<a href="#" class="pull-right mrg-tp-10" title="Forgot password" data-toggle="modal"
data-target="#fpswd">Forgot password?</a></div>
<!-- <a href="dash-board.html" class="">Login</a> -->
<?= Html::submitButton('Login', ['class' => 'btn btn-primary mrg-tp-10 col-xs-12 login-btn', 'id' => '#loginbtn', 'name' => 'login-button', 'data-loading-text' => '<i class="fa fa-circle-o-notch fa-spin"></i> Login...']) ?>
<div class="checkbox">
<a href="javascript:void(0)" class="pull-right freeacc register_link" title="Register
FREE">[Register FREE]</a>
<span class="pull-right freeacc">Don’t have an
account?</span></div>
<div class="bar-devider"><span>OR</span></div>
<a class="btn btn-block btn-social btn-facebook"> <i class="fa fa-facebook"></i> Sign in
with Facebook
</a>
<!--<a class="btn btn-block btn-social btn-google-plus"> <i class="fa fa-google-plus"></i> Sign in with Google </a>-->
</div>
</div>
<?php ActiveForm::end(); ?>
</div>
</div>
<!-- Modal Footer -->
</div>
</div>
<!-- Modal Sign Up After -->
<div class="modal fade" id="signup_model" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<p class="text-center mrg-bt-30"><img src="images/logo.png" width="157" height="61" alt="logo"></p>
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal"><span aria-hidden="true">×</span> <span
class="sr-only">Close</span>
</button>
<!--<h2 class="text-center">Signup free</h2>-->
</div>
<!-- Modal Body -->
<div class="modal-body" id="signupMSG">
</div>
</div>
</div>
</div>
<!-- Modal Forgot Password -->
<div class="modal fade" id="fpswd" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<p class="text-center mrg-bt-10"><img src="<?= CommonHelper::getLogo() ?>" width="157" height="61"
alt="logo">
</p>
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal"><span aria-hidden="true">×</span> <span
class="sr-only">Close</span>
</button>
<h2 class="text-center">Forgot Password ?</h2>
</div>
<!-- Modal Body -->
<div class="modal-body">
<!--<form>-->
<?php $form = ActiveForm::begin([
'id' => 'forget-password',
'action' => 'site/request-password-reset',
'enableAjaxValidation' => true,
'validateOnSubmit' => true
]);
/**/ ?><!-- --><?php /*$form = ActiveForm::begin(['id' => 'request-password-reset-form']); */ ?>
<div class="row">
<!--<div class="col-sm-10 col-sm-offset-1 text-center"> <span class="error">Please enter valid email address</span> </div>-->
</div>
<div class="row">
<div class="col-sm-10 col-sm-offset-1 text-center">
<h4 class="mrg-bt-30 text-dark">We will email you the link to reset the password</h4>
</div>
</div>
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<div class="form-cont">
<?= $form->field($forgot, 'email', ["template" => '<span class="input input--akira">{input}<label class="input__label input__label--akira" for="input-22"> <span class="input__label-content input__label-content--akira">Email</span> </label></span>{error}'])->input('email', ['class' => 'input__field input__field--akira form-control', "data-toggle" => "tooltip", "data-placement" => "top", 'data-original-title' => 'Email ID is mandatory.']) ?>
</div>
<?= Html::submitButton('REQUEST RESET LINK', ['class' => 'btn btn-primary mrg-tp-10 col-xs-12 reset_password', 'name' => 'reset-password-request', 'data-loading-text' => '<i class="fa fa-circle-o-notch fa-spin"></i> Wait...']) ?>
</div>
</div>
</div>
</div>
<?php ActiveForm::end(); ?>
<!--</form>-->
</div>
<!-- Modal Footer -->
<div class="modal-footer"></div>
</div>
<!-- Modal Password Reset Success-->
<div class="modal fade" id="change-pswd-link" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<p class="text-center mrg-bt-10"><img src="<?= CommonHelper::getLogo() ?>" width="157" height="61"
alt="logo">
</p>
<div class="modal-content">
<!-- Modal Header -->
<div class="modal-header">
<button type="button" class="close"
data-dismiss="modal"><span aria-hidden="true">×</span> <span
class="sr-only">Close</span>
</button>
<h2 class="text-center dark">Password Changed Sucessfully</h2>
</div>
<!-- Modal Body -->
<div class="modal-body">
<form>
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<button type="button" class="btn btn-primary mrg-tp-10 col-xs-12" data-toggle="modal"
data-target="#login">BACK TO LOGIN
</button>
</div>
</div>
</form>
</div>
<!-- Modal Footer -->
<div class="modal-footer"></div>
</div>
</div>
</div>
<?php } ?>
<?php if (Yii::$app->user->isGuest) { ?>
<?php # Popup Open
$this->registerJs('
$(document).on("click",".register_link",function(e){
$("#login").modal("toggle");
setTimeout(function(){
$("#myModalNorm").modal("toggle");
}, 500);
});
');
if ($ref == 'login') {
$this->registerJs('
$("#login").modal("toggle");
');
}
if ($ref == 'signup') {
$this->registerJs('
$("#myModalNorm").modal("toggle");
');
}
if ($ref == 'cps') {
$this->registerJs('
$("#change-pswd-link").modal("toggle");
');
}
?>
<?php # SIGN UP
$this->registerJs('
$("body").on("submit","#form-signup",function(e){
var form = $(this);
if(form.find(".has-error").length) {
return false;
}
if(!$("#btnSignup").is(":disabled")){
$("#btnSignup").attr("disabled",true).html("Please Wait...");
return true;
}
else {
return false;
}
return true;
});
$("body").on("submit","#login-form",function(e){
var form = $(this);
if(form.find(".has-error").length) {
return false;
}
if(!$("#loginbtn").is(":disabled")){
var $this_l = $(".login-btn");
$this_l.button("loading");
setTimeout(function() {
$this_l.button("reset");
}, 8000);
return true;
}
else {
return false;
}
return true;
});
$("#suf").click(function(){
$("#form-signup")[0].reset();
});
$(".login_button").click(function(){
$("#login-form")[0].reset();
});
$("#form-search").on("submit",function(e){
var icommunity_id = $("#user-icommunity_id").val();
var iSubCommunity_ID = $("#user-iSubCommunity_ID").val();
});
');
?>
<?php #Password RESET
$this->registerJs('
$("form#forget-password").on("beforeSubmit",function(e){
var form = $(this);
if (form.find(".has-error").length) {
return false;
}
$.ajax({
url: form.attr("action"),
type: "POST",
data: form.serialize()+"&vStatus=1",
dataType: "JSON",
success: function(res){
if(res.status == 1) {
$("#fpswd").modal("toggle");
$("#forgot-password-id").html(res.email);
$("#passwordresetrequestform-email").val("");
$("#reset-pswd-link").modal("toggle");
}else{
notificationPopup("ERROR", "Something went wrong. Please try again !");
}
}
});
return false;
});
');
?>
<?php # DOB
$this->registerJs('
$(".genderV").on("change",function(e){
var genderVal = $(this).val();
if(genderVal == "FEMALE") {
$("user-dob").datepicker("option","maxDate","' . date('Y-m-d', strtotime('-18 year')) . '");
$("user-dob").datepicker("option","yearRange","-70:-18");
}
else {
$("user-dob").datepicker("option","maxDate","' . date('Y-m-d', strtotime('-21 year')) . '");
$("user-dob").datepicker("option","yearRange","-70:-21");
}
});
$(".reset_password").on("click", function() {
var $this = $(this);
$this.button("loading");
setTimeout(function() {
$this.button("reset");
}, 15000);
});
var enforceModalFocusFn = $.fn.modal.Constructor.prototype.enforceFocus;
$.fn.modal.Constructor.prototype.enforceFocus = function() {};
$confModal.on("hidden", function() {
$.fn.modal.Constructor.prototype.enforceFocus = enforceModalFocusFn;
});
$confModal.modal({ backdrop : false });
');
?>
<?php } ?>
<?php
$this->registerJs("
$('#user-icommunity_id').keyup(function(e){
var k = e.which;
//if(k==13){alert('enter was pressed');}
});
$('.nice-select').bind('keyup',function(e) {
/*console.log('=> '+e.which);
var k = e.which;
var input_val = e.which;//String($(this).val());
var sel = $('select[name=platform]');
console.log('IP => '+input_val);
$( this).trigger('change');*/
});
");
?>
| {
"content_hash": "5e2e0bdcede939fed0cae668b01e7029",
"timestamp": "",
"source": "github",
"line_count": 851,
"max_line_length": 600,
"avg_line_length": 50.010575793184486,
"alnum_prop": 0.4126976667684861,
"repo_name": "shibam2015/KandePohe",
"id": "f3b6993d279bedeed212e1d83383b85660f5f30c",
"size": "42563",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "frontend/views/site/index_18_03_2017.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "598"
},
{
"name": "Batchfile",
"bytes": "1541"
},
{
"name": "CSS",
"bytes": "1086623"
},
{
"name": "HTML",
"bytes": "33929"
},
{
"name": "JavaScript",
"bytes": "1058261"
},
{
"name": "PHP",
"bytes": "6555522"
},
{
"name": "Shell",
"bytes": "3257"
}
],
"symlink_target": ""
} |
from __future__ import absolute_import, division
from copy import copy
from functools import partial
from .auto import tqdm as tqdm_auto
try:
import keras
except (ImportError, AttributeError) as e:
try:
from tensorflow import keras
except ImportError:
raise e
__author__ = {"github.com/": ["casperdcl"]}
__all__ = ['TqdmCallback']
class TqdmCallback(keras.callbacks.Callback):
"""Keras callback for epoch and batch progress."""
@staticmethod
def bar2callback(bar, pop=None, delta=(lambda logs: 1)):
def callback(_, logs=None):
n = delta(logs)
if logs:
if pop:
logs = copy(logs)
[logs.pop(i, 0) for i in pop]
bar.set_postfix(logs, refresh=False)
bar.update(n)
return callback
def __init__(self, epochs=None, data_size=None, batch_size=None, verbose=1,
tqdm_class=tqdm_auto, **tqdm_kwargs):
"""
Parameters
----------
epochs : int, optional
data_size : int, optional
Number of training pairs.
batch_size : int, optional
Number of training pairs per batch.
verbose : int
0: epoch, 1: batch (transient), 2: batch. [default: 1].
Will be set to `0` unless both `data_size` and `batch_size`
are given.
tqdm_class : optional
`tqdm` class to use for bars [default: `tqdm.auto.tqdm`].
tqdm_kwargs : optional
Any other arguments used for all bars.
"""
if tqdm_kwargs:
tqdm_class = partial(tqdm_class, **tqdm_kwargs)
self.tqdm_class = tqdm_class
self.epoch_bar = tqdm_class(total=epochs, unit='epoch')
self.on_epoch_end = self.bar2callback(self.epoch_bar)
if data_size and batch_size:
self.batches = batches = (data_size + batch_size - 1) // batch_size
else:
self.batches = batches = None
self.verbose = verbose
if verbose == 1:
self.batch_bar = tqdm_class(total=batches, unit='batch', leave=False)
self.on_batch_end = self.bar2callback(
self.batch_bar, pop=['batch', 'size'],
delta=lambda logs: logs.get('size', 1))
def on_train_begin(self, *_, **__):
params = self.params.get
auto_total = params('epochs', params('nb_epoch', None))
if auto_total is not None and auto_total != self.epoch_bar.total:
self.epoch_bar.reset(total=auto_total)
def on_epoch_begin(self, epoch, *_, **__):
if self.epoch_bar.n < epoch:
ebar = self.epoch_bar
ebar.n = ebar.last_print_n = ebar.initial = epoch
if self.verbose:
params = self.params.get
total = params('samples', params(
'nb_sample', params('steps', None))) or self.batches
if self.verbose == 2:
if hasattr(self, 'batch_bar'):
self.batch_bar.close()
self.batch_bar = self.tqdm_class(
total=total, unit='batch', leave=True,
unit_scale=1 / (params('batch_size', 1) or 1))
self.on_batch_end = self.bar2callback(
self.batch_bar, pop=['batch', 'size'],
delta=lambda logs: logs.get('size', 1))
elif self.verbose == 1:
self.batch_bar.unit_scale = 1 / (params('batch_size', 1) or 1)
self.batch_bar.reset(total=total)
else:
raise KeyError('Unknown verbosity')
def on_train_end(self, *_, **__):
if self.verbose:
self.batch_bar.close()
self.epoch_bar.close()
def display(self):
"""Displays in the current cell in Notebooks."""
container = getattr(self.epoch_bar, 'container', None)
if container is None:
return
from .notebook import display
display(container)
batch_bar = getattr(self, 'batch_bar', None)
if batch_bar is not None:
display(batch_bar.container)
@staticmethod
def _implements_train_batch_hooks():
return True
@staticmethod
def _implements_test_batch_hooks():
return True
@staticmethod
def _implements_predict_batch_hooks():
return True
| {
"content_hash": "056278b12f898cf6ba4ec26cd03427f5",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 81,
"avg_line_length": 35.556451612903224,
"alnum_prop": 0.5493309140394648,
"repo_name": "sonntagsgesicht/regtest",
"id": "523e62e94753523f52ebc0a704240c4095321e44",
"size": "4409",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": ".aux/venv/lib/python3.9/site-packages/tqdm/keras.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "13888"
}
],
"symlink_target": ""
} |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".DecodeToSurfaceActivity"
android:background="#000" >
<SurfaceView
android:id="@+id/decoderSurface"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
</RelativeLayout>
| {
"content_hash": "45edbd21d6137fcf4b20351f493c575f",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 74,
"avg_line_length": 37,
"alnum_prop": 0.6756756756756757,
"repo_name": "hoolrory/MediaCodecDemo",
"id": "32ba9fb78e88374d0c0b950fb3b5611326a15f44",
"size": "518",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "res/layout/activity_decode.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "22807"
}
],
"symlink_target": ""
} |
import Yoga from '@react-pdf/yoga';
import { isNil } from '@react-pdf/fns';
const OVERFLOW = {
hidden: Yoga.OVERFLOW_HIDDEN,
scroll: Yoga.OVERFLOW_SCROLL,
};
/**
* Set overflow attribute to node's Yoga instance
*
* @param {String} overflow value
* @param {Object} node instance
* @return {Object} node instance
*/
const setOverflow = value => node => {
const { yogaNode } = node;
if (!isNil(value) && yogaNode) {
const overflow = OVERFLOW[value] || Yoga.OVERFLOW_VISIBLE;
yogaNode.setOverflow(overflow);
}
return node;
};
export default setOverflow;
| {
"content_hash": "2b52ff6ae5ec300b89704cfd77684358",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 62,
"avg_line_length": 21.51851851851852,
"alnum_prop": 0.6729776247848537,
"repo_name": "diegomura/react-pdf",
"id": "d14ab4a103316ee75847d01098d340f92c8a152c",
"size": "581",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/layout/src/node/setOverflow.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "2239741"
},
{
"name": "Shell",
"bytes": "693"
}
],
"symlink_target": ""
} |
import agents as ag
import envgui as gui
import random
# ______________________________________________________________________________
loc_A, loc_B = (1, 1), (2, 1) # The two locations for the Vacuum world
def RandomVacuumAgent():
"Randomly choose one of the actions from the vacuum environment."
p = ag.RandomAgentProgram(['Right', 'Left', 'Up', 'Down', 'Suck', 'NoOp'])
return ag.Agent(p)
def TableDrivenVacuumAgent():
"[Figure 2.3]"
table = {((loc_A, 'Clean'),): 'Right',
((loc_A, 'Dirty'),): 'Suck',
((loc_B, 'Clean'),): 'Left',
((loc_B, 'Dirty'),): 'Suck',
((loc_A, 'Clean'), (loc_A, 'Clean')): 'Right',
((loc_A, 'Clean'), (loc_A, 'Dirty')): 'Suck',
# ...
((loc_A, 'Clean'), (loc_A, 'Clean'), (loc_A, 'Clean')): 'Right',
((loc_A, 'Clean'), (loc_A, 'Clean'), (loc_A, 'Dirty')): 'Suck',
# ...
}
p = ag.TableDrivenAgentProgram(table)
return ag.Agent()
def ReflexVacuumAgent():
"A reflex agent for the two-state vacuum environment. [Figure 2.8]"
def program(percept):
location, status = percept
if status == 'Dirty':
return 'Suck'
elif location == loc_A:
return 'Right'
elif location == loc_B:
return 'Left'
return ag.Agent(program)
def ModelBasedVacuumAgent() -> object:
"An agent that keeps track of what locations are clean or dirty."
model = {loc_A: None, loc_B: None}
def program(percept):
"Same as reflex_vacuum_agent, except if everything is clean, do NoOp."
location, status = percept
model[location] = status # Update the model here
if model[loc_A] == model[loc_B] == 'Clean':
return 'NoOp'
elif status == 'Dirty':
return 'Suck'
elif location == loc_A:
return 'Right'
elif location == loc_B:
return 'Left'
return ag.Agent(program)
# ______________________________________________________________________________
# Vacuum environment
class Dirt(ag.Thing):
pass
# class Floor(ag.Thing):
# pass
class VacuumEnvironment(ag.XYEnvironment):
"""The environment of [Ex. 2.12]. Agent perceives dirty or clean,
and bump (into obstacle) or not; 2D discrete world of unknown size;
performance measure is 100 for each dirt cleaned, and -1 for
each turn taken."""
def __init__(self, width=4, height=3):
super(VacuumEnvironment, self).__init__(width, height)
self.add_walls()
def thing_classes(self):
return [ag.Wall, Dirt, ReflexVacuumAgent, RandomVacuumAgent,
TableDrivenVacuumAgent, ModelBasedVacuumAgent]
def percept(self, agent):
"""The percept is a tuple of ('Dirty' or 'Clean', 'Bump' or 'None').
Unlike the TrivialVacuumEnvironment, location is NOT perceived."""
status = ('Dirty' if self.some_things_at(
agent.location, Dirt) else 'Clean')
bump = ('Bump' if agent.bump else'None')
return (bump, status)
def execute_action(self, agent, action):
if action == 'Suck':
dirt_list = self.list_things_at(agent.location, Dirt)
if dirt_list != []:
dirt = dirt_list[0]
agent.performance += 100
self.delete_thing(dirt)
else:
super(VacuumEnvironment, self).execute_action(agent, action)
if action != 'NoOp':
agent.performance -= 1
class TrivialVacuumEnvironment(VacuumEnvironment):
"""This environment has two locations, A and B. Each can be Dirty
or Clean. The agent perceives its location and the location's
status. This serves as an example of how to implement a simple
Environment."""
def __init__(self):
super(TrivialVacuumEnvironment, self).__init__()
choice = random.randint(0, 3)
if choice % 2: # 1 or 3
self.add_thing(Dirt(), loc_A)
if choice > 1: # 2 or 3
self.add_thing(Dirt(), loc_B)
def percept(self, agent):
"Returns the agent's location, and the location status (Dirty/Clean)."
status = ('Dirty' if self.some_things_at(
agent.location, Dirt) else 'Clean')
return (agent.location, status)
#
# def execute_action(self, agent, action):
# """Change agent's location and/or location's status; track performance.
# Score 10 for each dirt cleaned; -1 for each move."""
# if action == 'Right':
# agent.location = loc_B
# agent.performance -= 1
# elif action == 'Left':
# agent.location = loc_A
# agent.performance -= 1
# elif action == 'Suck':
# if self.status[agent.location] == 'Dirty':
# agent.performance += 10
# self.status[agent.location] = 'Clean'
#
def add_agent(self, a):
"Agents start in either location at random."
super().add_thing(a, random.choice([loc_A, loc_B]))
# _________________________________________________________________________
# >>> a = reflex_vacuum_agent()
# >>> a.program((loc_A, 'Clean'))
# 'Right'
# >>> a.program((loc_B, 'Clean'))
# 'Left'
# >>> a.program((loc_A, 'Dirty'))
# 'Suck'
# >>> a.program((loc_A, 'Dirty'))
# 'Suck'
#
# >>> e = TrivialVacuumEnvironment()
# >>> e.add_thing(model_based_vacuum_agent())
# >>> e.run(5)
# Produces text-based status output
# v = TrivialVacuumEnvironment()
# a = model_based_vacuum_agent()
# a = ag.TraceAgent(a)
# v.add_agent(a)
# v.run(10)
# Launch GUI of Trivial Environment
# v = TrivialVacuumEnvironment()
# a = random_vacuum_agent()
# a = ag.TraceAgent(a)
# v.add_agent(a)
# g = gui.EnvGUI(v, 'Vaccuum')
# c = g.getCanvas()
# c.mapImageNames({
# Dirt: 'images/dirt.png',
# ag.Wall: 'images/wall.jpg',
# # Floor: 'images/floor.png',
# ag.Agent: 'images/vacuum.png',
# })
# c.update()
# g.mainloop()
# Launch GUI of more complex environment
v = VacuumEnvironment(5, 4)
#a = model_based_vacuum_agent()
a = RandomVacuumAgent()
a = ag.TraceAgent(a)
loc = v.random_location_inbounds()
v.add_thing(a, location=loc)
v.scatter_things(Dirt)
g = gui.EnvGUI(v, 'Vaccuum')
c = g.getCanvas()
c.mapImageNames({
ag.Wall: 'submissions/Poff/LittleFoot.jpg',
# Floor: 'images/floor.png',
Dirt: 'images/dirt.png',
ag.Agent: 'images/vacuum.png',
})
c.update()
g.mainloop() | {
"content_hash": "969f390af69d6a68e923075530f7a512",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 81,
"avg_line_length": 31.32367149758454,
"alnum_prop": 0.5598396051819864,
"repo_name": "WmHHooper/aima-python",
"id": "4e0039b0f33911619803909769bfd1239a7be371",
"size": "6484",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "submissions/Poff/vaccuum.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "138"
},
{
"name": "JavaScript",
"bytes": "9816"
},
{
"name": "Jupyter Notebook",
"bytes": "1382354"
},
{
"name": "Makefile",
"bytes": "562"
},
{
"name": "Python",
"bytes": "6218980"
},
{
"name": "Shell",
"bytes": "150"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TorrentFileCreatorResult class - hetimatorrent library - Dart API</title>
<!-- required because all the links are pseudo-absolute -->
<base href="..">
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro|Roboto:500,400italic,300,400' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="static-assets/prettify.css">
<link rel="stylesheet" href="static-assets/css/bootstrap.min.css">
<link rel="stylesheet" href="static-assets/styles.css">
<meta name="description" content="API docs for the TorrentFileCreatorResult class from the hetimatorrent library, for the Dart programming language.">
<link rel="icon" href="static-assets/favicon.png">
<!-- Do not remove placeholder -->
<!-- Header Placeholder -->
</head>
<body>
<div id="overlay-under-drawer"></div>
<header class="container-fluid" id="title">
<nav class="navbar navbar-fixed-top">
<div class="container">
<button id="sidenav-left-toggle" type="button"> </button>
<ol class="breadcrumbs gt-separated hidden-xs">
<li><a href="index.html">hetimatorrent</a></li>
<li><a href="hetimatorrent/hetimatorrent-library.html">hetimatorrent</a></li>
<li class="self-crumb">TorrentFileCreatorResult</li>
</ol>
<div class="self-name">TorrentFileCreatorResult</div>
</div>
</nav>
<div class="container masthead">
<ol class="breadcrumbs gt-separated visible-xs">
<li><a href="index.html">hetimatorrent</a></li>
<li><a href="hetimatorrent/hetimatorrent-library.html">hetimatorrent</a></li>
<li class="self-crumb">TorrentFileCreatorResult</li>
</ol>
<div class="title-description">
<h1 class="title">
<div class="kind">class</div> TorrentFileCreatorResult
</h1>
<!-- p class="subtitle">
</p -->
</div>
<ul class="subnav">
<li><a href="hetimatorrent/TorrentFileCreatorResult-class.html#static-properties">Static Properties</a></li>
<li><a href="hetimatorrent/TorrentFileCreatorResult-class.html#instance-properties">Properties</a></li>
<li><a href="hetimatorrent/TorrentFileCreatorResult-class.html#constructors">Constructors</a></li>
</ul>
</div>
</header>
<div class="container body">
<div class="col-xs-6 col-sm-3 col-md-3 sidebar sidebar-offcanvas-left">
<h5><a href="index.html">hetimatorrent</a></h5>
<h5><a href="hetimatorrent/hetimatorrent-library.html">hetimatorrent</a></h5>
<ol>
<li class="section-title"><a href="hetimatorrent/hetimatorrent-library.html#functions">Functions</a></li>
<li><a href="hetimatorrent/objectToString.html">objectToString</a></li>
<li class="section-title"><a href="hetimatorrent/hetimatorrent-library.html#classes">Classes</a></li>
<li><a href="hetimatorrent/Bdecoder-class.html">Bdecoder</a></li>
<li><a href="hetimatorrent/BdecoderAsync-class.html">BdecoderAsync</a></li>
<li><a href="hetimatorrent/Bencode-class.html">Bencode</a></li>
<li><a href="hetimatorrent/BencodeAsync-class.html">BencodeAsync</a></li>
<li><a href="hetimatorrent/Bencoder-class.html">Bencoder</a></li>
<li><a href="hetimatorrent/Bitfield-class.html">Bitfield</a></li>
<li><a href="hetimatorrent/BitfieldInter-class.html">BitfieldInter</a></li>
<li><a href="hetimatorrent/BitfieldPlus-class.html">BitfieldPlus</a></li>
<li><a href="hetimatorrent/BlockData-class.html">BlockData</a></li>
<li><a href="hetimatorrent/CreatePieceHashResult-class.html">CreatePieceHashResult</a></li>
<li><a href="hetimatorrent/KBucket-class.html">KBucket</a></li>
<li><a href="hetimatorrent/KGetPeerNodes-class.html">KGetPeerNodes</a></li>
<li><a href="hetimatorrent/KGetPeerValue-class.html">KGetPeerValue</a></li>
<li><a href="hetimatorrent/KId-class.html">KId</a></li>
<li><a href="hetimatorrent/KNode-class.html">KNode</a></li>
<li><a href="hetimatorrent/KNodeSendInfo-class.html">KNodeSendInfo</a></li>
<li><a href="hetimatorrent/KPeerInfo-class.html">KPeerInfo</a></li>
<li><a href="hetimatorrent/KRootingTable-class.html">KRootingTable</a></li>
<li><a href="hetimatorrent/KrpcAnnounce-class.html">KrpcAnnounce</a></li>
<li><a href="hetimatorrent/KrpcError-class.html">KrpcError</a></li>
<li><a href="hetimatorrent/KrpcFindNode-class.html">KrpcFindNode</a></li>
<li><a href="hetimatorrent/KrpcGetPeers-class.html">KrpcGetPeers</a></li>
<li><a href="hetimatorrent/KrpcMessage-class.html">KrpcMessage</a></li>
<li><a href="hetimatorrent/KrpcPing-class.html">KrpcPing</a></li>
<li><a href="hetimatorrent/KrpcQuery-class.html">KrpcQuery</a></li>
<li><a href="hetimatorrent/KrpcResponse-class.html">KrpcResponse</a></li>
<li><a href="hetimatorrent/PeerIdCreator-class.html">PeerIdCreator</a></li>
<li><a href="hetimatorrent/PieceInfo-class.html">PieceInfo</a></li>
<li><a href="hetimatorrent/PieceInfoItem-class.html">PieceInfoItem</a></li>
<li><a href="hetimatorrent/RequestSingleWaitReturn-class.html">RequestSingleWaitReturn</a></li>
<li><a href="hetimatorrent/SHA1Iso-class.html">SHA1Iso</a></li>
<li><a href="hetimatorrent/SHA1IsoInfo-class.html">SHA1IsoInfo</a></li>
<li><a href="hetimatorrent/SHA1IsoSub-class.html">SHA1IsoSub</a></li>
<li><a href="hetimatorrent/ShuffleLinkedList-class.html">ShuffleLinkedList</a></li>
<li><a href="hetimatorrent/StartResult-class.html">StartResult</a></li>
<li><a href="hetimatorrent/StopResult-class.html">StopResult</a></li>
<li><a href="hetimatorrent/TMessageBitfield-class.html">TMessageBitfield</a></li>
<li><a href="hetimatorrent/TMessageCancel-class.html">TMessageCancel</a></li>
<li><a href="hetimatorrent/TMessageChoke-class.html">TMessageChoke</a></li>
<li><a href="hetimatorrent/TMessageHandshake-class.html">TMessageHandshake</a></li>
<li><a href="hetimatorrent/TMessageHave-class.html">TMessageHave</a></li>
<li><a href="hetimatorrent/TMessageInterested-class.html">TMessageInterested</a></li>
<li><a href="hetimatorrent/TMessageKeepAlive-class.html">TMessageKeepAlive</a></li>
<li><a href="hetimatorrent/TMessageNotInterested-class.html">TMessageNotInterested</a></li>
<li><a href="hetimatorrent/TMessageNull-class.html">TMessageNull</a></li>
<li><a href="hetimatorrent/TMessagePiece-class.html">TMessagePiece</a></li>
<li><a href="hetimatorrent/TMessagePort-class.html">TMessagePort</a></li>
<li><a href="hetimatorrent/TMessageRequest-class.html">TMessageRequest</a></li>
<li><a href="hetimatorrent/TMessageUnchoke-class.html">TMessageUnchoke</a></li>
<li><a href="hetimatorrent/TorrenAIEmpty-class.html">TorrenAIEmpty</a></li>
<li><a href="hetimatorrent/TorrentAI-class.html">TorrentAI</a></li>
<li><a href="hetimatorrent/TorrentAIBasic-class.html">TorrentAIBasic</a></li>
<li><a href="hetimatorrent/TorrentAIChokeTest-class.html">TorrentAIChokeTest</a></li>
<li><a href="hetimatorrent/TorrentAIChokeTestResult-class.html">TorrentAIChokeTestResult</a></li>
<li><a href="hetimatorrent/TorrentClient-class.html">TorrentClient</a></li>
<li><a href="hetimatorrent/TorrentClientFront-class.html">TorrentClientFront</a></li>
<li><a href="hetimatorrent/TorrentClientFrontNerve-class.html">TorrentClientFrontNerve</a></li>
<li><a href="hetimatorrent/TorrentClientManager-class.html">TorrentClientManager</a></li>
<li><a href="hetimatorrent/TorrentClientMessage-class.html">TorrentClientMessage</a></li>
<li><a href="hetimatorrent/TorrentClientPeerInfo-class.html">TorrentClientPeerInfo</a></li>
<li><a href="hetimatorrent/TorrentClientPeerInfoBasic-class.html">TorrentClientPeerInfoBasic</a></li>
<li><a href="hetimatorrent/TorrentClientPeerInfoEmpty-class.html">TorrentClientPeerInfoEmpty</a></li>
<li><a href="hetimatorrent/TorrentClientPeerInfos-class.html">TorrentClientPeerInfos</a></li>
<li><a href="hetimatorrent/TorrentClientSignal-class.html">TorrentClientSignal</a></li>
<li><a href="hetimatorrent/TorrentClientSignalWithFront-class.html">TorrentClientSignalWithFront</a></li>
<li><a href="hetimatorrent/TorrentClientSignalWithPeerInfo-class.html">TorrentClientSignalWithPeerInfo</a></li>
<li><a href="hetimatorrent/TorrentEngine-class.html">TorrentEngine</a></li>
<li><a href="hetimatorrent/TorrentEngineAI-class.html">TorrentEngineAI</a></li>
<li><a href="hetimatorrent/TorrentEngineProgress-class.html">TorrentEngineProgress</a></li>
<li><a href="hetimatorrent/TorrentEngineTorrent-class.html">TorrentEngineTorrent</a></li>
<li><a href="hetimatorrent/TorrentFile-class.html">TorrentFile</a></li>
<li><a href="hetimatorrent/TorrentFileCreator-class.html">TorrentFileCreator</a></li>
<li><a href="hetimatorrent/TorrentFileCreatorResult-class.html">TorrentFileCreatorResult</a></li>
<li><a href="hetimatorrent/TorrentFileFile-class.html">TorrentFileFile</a></li>
<li><a href="hetimatorrent/TorrentFileFiles-class.html">TorrentFileFiles</a></li>
<li><a href="hetimatorrent/TorrentFileInfo-class.html">TorrentFileInfo</a></li>
<li><a href="hetimatorrent/TorrentInfoHashCreator-class.html">TorrentInfoHashCreator</a></li>
<li><a href="hetimatorrent/TorrentMessage-class.html">TorrentMessage</a></li>
<li><a href="hetimatorrent/TorrentPieceHashCreator-class.html">TorrentPieceHashCreator</a></li>
<li><a href="hetimatorrent/TrackerClient-class.html">TrackerClient</a></li>
<li><a href="hetimatorrent/TrackerPeerInfo-class.html">TrackerPeerInfo</a></li>
<li><a href="hetimatorrent/TrackerPeerManager-class.html">TrackerPeerManager</a></li>
<li><a href="hetimatorrent/TrackerRequest-class.html">TrackerRequest</a></li>
<li><a href="hetimatorrent/TrackerRequestResult-class.html">TrackerRequestResult</a></li>
<li><a href="hetimatorrent/TrackerResponse-class.html">TrackerResponse</a></li>
<li><a href="hetimatorrent/TrackerServer-class.html">TrackerServer</a></li>
<li><a href="hetimatorrent/TrackerUrl-class.html">TrackerUrl</a></li>
<li class="section-title"><a href="hetimatorrent/hetimatorrent-library.html#exceptions">Exceptions</a></li>
<li><a href="hetimatorrent/BencodeParseError-class.html">BencodeParseError</a></li>
<li><a href="hetimatorrent/HetiBencodeParseError-class.html">HetiBencodeParseError</a></li>
</ol>
</div>
<div class="col-xs-12 col-sm-9 col-md-6 main-content">
<section class="desc markdown">
<p class="no-docs">Not documented.</p>
</section>
<section class="summary" id="static-properties">
<h2>Static Properties</h2>
<dl class="properties">
<dt id="NG" class="property">
<span class="top-level-variable-type">dynamic</span>
<a href="hetimatorrent/TorrentFileCreatorResult/NG.html">NG</a>
</dt>
<dd>
<div class="readable-writable">
read-only
</div>
</dd>
<dt id="OK" class="property">
<span class="top-level-variable-type">dynamic</span>
<a href="hetimatorrent/TorrentFileCreatorResult/OK.html">OK</a>
</dt>
<dd>
<div class="readable-writable">
read-only
</div>
</dd>
</dl>
</section>
<section class="summary" id="instance-properties">
<h2>Properties</h2>
<dl class="properties">
<dt id="status" class="property">
<span class="top-level-variable-type">int</span>
<a href="hetimatorrent/TorrentFileCreatorResult/status.html">status</a>
</dt>
<dd>
<div class="readable-writable">
read / write
</div>
</dd>
<dt id="torrentFile" class="property">
<span class="top-level-variable-type"><a href="hetimatorrent/TorrentFile-class.html">TorrentFile</a></span>
<a href="hetimatorrent/TorrentFileCreatorResult/torrentFile.html">torrentFile</a>
</dt>
<dd>
<div class="readable-writable">
read / write
</div>
</dd>
</dl>
</section>
<section class="summary" id="constructors">
<h2>Constructors</h2>
<dl class="constructor-summary-list">
<dt id="TorrentFileCreatorResult" class="callable">
<span class="name"><a href="hetimatorrent/TorrentFileCreatorResult/TorrentFileCreatorResult.html">TorrentFileCreatorResult</a></span><span class="signature">(<span class="parameter" id="-param-nextStatus"><span class="type-annotation">int</span> <span class="parameter-name">nextStatus</span></span>)</span>
</dt>
<dd>
</dd>
</dl>
</section>
</div> <!-- /.main-content -->
<div class="col-xs-6 col-sm-6 col-md-3 sidebar sidebar-offcanvas-right">
<h5>TorrentFileCreatorResult</h5>
<ol>
<li class="section-title"><a href="hetimatorrent/TorrentFileCreatorResult-class.html#static-properties">Static properties</a></li>
<li><a href="hetimatorrent/TorrentFileCreatorResult/NG.html">NG</a></li>
<li><a href="hetimatorrent/TorrentFileCreatorResult/OK.html">OK</a></li>
<li class="section-title"><a href="hetimatorrent/TorrentFileCreatorResult-class.html#instance-properties">Properties</a></li>
<li><a href="hetimatorrent/TorrentFileCreatorResult/status.html">status</a>
</li>
<li><a href="hetimatorrent/TorrentFileCreatorResult/torrentFile.html">torrentFile</a>
</li>
<li class="section-title"><a href="hetimatorrent/TorrentFileCreatorResult-class.html#constructors">Constructors</a></li>
<li><a href="hetimatorrent/TorrentFileCreatorResult/TorrentFileCreatorResult.html">TorrentFileCreatorResult</a></li>
</ol>
</div><!--/.sidebar-offcanvas-->
</div> <!-- container -->
<footer>
<div class="container-fluid">
<div class="container">
<p class="text-center">
<span class="no-break">
hetimatorrent 0.0.1 api docs
</span>
•
<span class="copyright no-break">
<a href="https://www.dartlang.org">
<img src="static-assets/favicon.png" alt="Dart" title="Dart"width="16" height="16">
</a>
</span>
•
<span class="copyright no-break">
<a href="http://creativecommons.org/licenses/by-sa/4.0/">cc license</a>
</span>
</p>
</div>
</div>
</footer>
<script src="static-assets/prettify.js"></script>
<script src="static-assets/script.js"></script>
<!-- Do not remove placeholder -->
<!-- Footer Placeholder -->
</body>
</html>
| {
"content_hash": "4cfa6811da742e0222478d37f83ee17e",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 323,
"avg_line_length": 50.89473684210526,
"alnum_prop": 0.6545372285418821,
"repo_name": "kyorohiro/dart_hetimatorrent",
"id": "b4e67dd73da6978ed11234fd4321e73e951370dd",
"size": "15472",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/api/hetimatorrent/TorrentFileCreatorResult-class.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "165425"
},
{
"name": "Dart",
"bytes": "453550"
},
{
"name": "HTML",
"bytes": "19043"
},
{
"name": "JavaScript",
"bytes": "2312"
}
],
"symlink_target": ""
} |
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.Windows.Forms;
using MaterialSkin.Animations;
namespace MaterialSkin.Controls
{
public class MaterialFlatButton : Button, IMaterialControl
{
[Browsable(false)]
public int Depth { get; set; }
[Browsable(false)]
public MaterialSkinManager SkinManager { get { return MaterialSkinManager.Instance; } }
[Browsable(false)]
public MouseState MouseState { get; set; }
public bool Primary { get; set; }
private readonly AnimationManager animationManager;
private readonly AnimationManager hoverAnimationManager;
private SizeF textSize;
public bool Active { get; set; }
public bool UseActive { get; set; }
public Image Icon { get; set; }
public Point IconOffset { get; set; }
public bool IconBeforeText { get; set; }
[Browsable(false)]
public Color IconColor { get; set; }
public bool colorApplied = false;
public MaterialFlatButton()
{
Primary = false;
animationManager = new AnimationManager(false)
{
Increment = 0.03,
AnimationType = AnimationType.EaseOut
};
hoverAnimationManager = new AnimationManager
{
Increment = 0.07,
AnimationType = AnimationType.Linear
};
hoverAnimationManager.OnAnimationProgress += sender => Invalidate();
animationManager.OnAnimationProgress += sender => Invalidate();
AutoSizeMode = AutoSizeMode.GrowAndShrink;
AutoSize = true;
UseActive = true;
Active = false;
Margin = new Padding(4, 6, 4, 6);
Padding = new Padding(0);
}
public override string Text
{
get { return base.Text; }
set
{
base.Text = value;
textSize = CreateGraphics().MeasureString(value.ToUpper(), SkinManager.ROBOTO_MEDIUM_10);
if (AutoSize)
Size = GetPreferredSize();
Invalidate();
}
}
protected override void OnClick(EventArgs e)
{
foreach (Control c in this.Parent.Controls)
if (c.GetType() == this.GetType() && c != this)
{
((MaterialFlatButton)c).Active = false;
((MaterialFlatButton)c).Refresh();
}
this.Active = !this.Active;
this.Refresh();
base.OnClick(e);
}
protected override void OnPaint(PaintEventArgs pevent)
{
var g = pevent.Graphics;
g.TextRenderingHint = TextRenderingHint.AntiAlias;
g.Clear(SkinManager.GetFlatButtonBackgroundColor());
if (this.Image != null)
g.DrawImage(this.Image, 0, 0);
//Active
Color c = SkinManager.GetFlatButtonPressedBackgroundActiveColor();
if (this.Active && this.UseActive)
using (Brush b = SkinManager.GetFlatButtonPressedBackgroundActiveBrush())
g.FillRectangle(b, ClientRectangle);
//Hover
c = SkinManager.GetFlatButtonHoverBackgroundColor();
using (Brush b = new SolidBrush(Color.FromArgb((int)(hoverAnimationManager.GetProgress() * c.A), c.RemoveAlpha())))
g.FillRectangle(b, ClientRectangle);
//Ripple
if (animationManager.IsAnimating())
{
g.SmoothingMode = SmoothingMode.AntiAlias;
for (int i = 0; i < animationManager.GetAnimationCount(); i++)
{
var animationValue = animationManager.GetProgress(i);
var animationSource = animationManager.GetSource(i);
using (Brush rippleBrush = new SolidBrush(Color.FromArgb((int)(101 - (animationValue * 100)), Color.Black)))
{
var rippleSize = (int)(animationValue * Width * 2);
g.FillEllipse(rippleBrush, new Rectangle(animationSource.X - rippleSize / 2, animationSource.Y - rippleSize / 2, rippleSize, rippleSize));
}
}
g.SmoothingMode = SmoothingMode.None;
}
// Icon
Rectangle iconRect = new Rectangle(8, 6, 24, 24);
if (string.IsNullOrEmpty(Text))
{
// Center Icon
iconRect.X += 2;
}
if (Icon != null)
{
g.DrawImage(Icon, iconRect);
}
// Text
Rectangle textRect = ClientRectangle;
if (Icon != null)
{
//
// Resize and move Text container
//
// First 8: left padding
// 24: icon width
// Second 4: space between Icon and Text
// Third 8: right padding
textRect.Width -= 8 + 24 + 4 + 8;
// First 8: left padding
// 24: icon width
// Second 4: space between Icon and Text
textRect.X += 8 + 24 + 4;
}
g.DrawString(
Text.ToUpper(),
SkinManager.ROBOTO_MEDIUM_10,
Enabled ? (Primary ? SkinManager.ColorScheme.PrimaryBrush : SkinManager.GetPrimaryTextBrush()) : SkinManager.GetFlatButtonDisabledTextBrush(),
textRect,
new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }
);
}
private Size GetPreferredSize()
{
return GetPreferredSize(new Size(0, 0));
}
public override Size GetPreferredSize(Size proposedSize)
{
// Provides extra space for proper padding for content
int extra = 16;
if (Icon != null)
// 24 is for icon size
// 4 is for the space between icon & text
extra += 24 + 4;
return new Size((int)Math.Ceiling(textSize.Width) + extra, 36);
}
protected override void OnCreateControl()
{
base.OnCreateControl();
if (DesignMode) return;
MouseState = MouseState.OUT;
MouseEnter += (sender, args) =>
{
MouseState = MouseState.HOVER;
hoverAnimationManager.StartNewAnimation(AnimationDirection.In);
Invalidate();
};
MouseLeave += (sender, args) =>
{
MouseState = MouseState.OUT;
hoverAnimationManager.StartNewAnimation(AnimationDirection.Out);
Invalidate();
};
MouseDown += (sender, args) =>
{
if (args.Button == MouseButtons.Left)
{
MouseState = MouseState.DOWN;
animationManager.StartNewAnimation(AnimationDirection.In, args.Location);
Invalidate();
}
};
MouseUp += (sender, args) =>
{
MouseState = MouseState.HOVER;
Invalidate();
};
}
}
}
| {
"content_hash": "17aa3da3a496ba1af976c72fb5a3bdff",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 162,
"avg_line_length": 32.75757575757576,
"alnum_prop": 0.5176423946081671,
"repo_name": "cz-michi/MaterialSkin",
"id": "833a045188cbd888aff7fdb20000396063770d8e",
"size": "7569",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MaterialSkin/Controls/MaterialFlatButton.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "178787"
},
{
"name": "Smalltalk",
"bytes": "432"
}
],
"symlink_target": ""
} |
require 'test/unit'
require 'rubygems'
require 'yaml'
require File.dirname(__FILE__) + '/../lib/profanity_filter'
class BasicProfanityFilterTest < Test::Unit::TestCase
def test_basic_profanity_filter_does_not_modify_clean_words
assert_equal 'happy', ProfanityFilter::Base.clean('happy')
end
def test_basic_profanity_filter_does_not_modify_whitespace
assert_equal 'hello world', ProfanityFilter::Base.clean('hello world')
assert_equal "hello \t world", ProfanityFilter::Base.clean("hello \t world")
assert_equal "hello \n world", ProfanityFilter::Base.clean("hello \n world")
end
def test_basic_profanity_filter_does_not_modify_special_characters
assert_equal 'happy @#$%', ProfanityFilter::Base.clean('happy fuck')
assert_equal 'happy\'s', ProfanityFilter::Base.clean('happy\'s')
assert_equal '@#$%\'s', ProfanityFilter::Base.clean('fuck\'s')
assert_equal '@#$%?!', ProfanityFilter::Base.clean('fuck?!')
end
def test_basic_profanity_filter_replaces_profane_words
assert_equal '@#$%', ProfanityFilter::Base.clean('fuck')
end
def test_basic_profanity_filter_replaces_punctuation_spaced_profane_words
assert_equal '@#$%', ProfanityFilter::Base.clean('f-u-c-k')
assert_equal '@#$%', ProfanityFilter::Base.clean('f.u.c.k')
assert_equal 'happy-@#$%', ProfanityFilter::Base.clean('happy-fuck')
end
def test_knows_when_text_is_not_profane
assert !ProfanityFilter::Base.profane?('happy')
end
def test_knows_when_text_is_profane
assert ProfanityFilter::Base.profane?('fuck')
end
# Issue #1 https://github.com/intridea/profanity_filter/issues/1
def test_knows_when_text_contains_profanity
assert ProfanityFilter::Base.profane?('oh shit')
end
def test_knows_nil_is_not_profane
assert !ProfanityFilter::Base.profane?(nil)
end
end
class DictionaryProfanityFilterTest < Test::Unit::TestCase
def test_dictionary_profanity_filter_does_not_modify_clean_words
assert_equal 'happy', ProfanityFilter::Base.clean('happy', 'dictionary')
end
def test_dictionary_profanity_filter_does_not_modify_whitespace
assert_equal 'hello world', ProfanityFilter::Base.clean('hello world', 'dictionary')
assert_equal "hello \t world", ProfanityFilter::Base.clean("hello \t world", 'dictionary')
assert_equal "hello \n world", ProfanityFilter::Base.clean("hello \n world", 'dictionary')
end
def test_dictionary_profanity_filter_does_not_modify_special_characters
assert_equal 'happy f*ck', ProfanityFilter::Base.clean('happy fuck', 'dictionary')
assert_equal 'happy\'s', ProfanityFilter::Base.clean('happy\'s', 'dictionary')
assert_equal 'f*ck\'s', ProfanityFilter::Base.clean('fuck\'s', 'dictionary')
assert_equal 'f*ck?!', ProfanityFilter::Base.clean('fuck?!', 'dictionary')
end
def test_dictionary_profanity_filter_replaces_profane_words
assert_equal 'f*ck', ProfanityFilter::Base.clean('fuck', 'dictionary')
end
def test_dictionary_profanity_filter_replaces_punctuation_spaced_profane_words
assert_equal 'f*ck', ProfanityFilter::Base.clean('f-u-c-k', 'dictionary')
assert_equal 'f*ck', ProfanityFilter::Base.clean('f.u.c.k', 'dictionary')
assert_equal 'happy-f*ck', ProfanityFilter::Base.clean('happy-fuck', 'dictionary')
end
end
class VowelsProfanityFilterTest < Test::Unit::TestCase
def test_vowels_profanity_filter_does_not_modify_clean_words
assert_equal 'happy', ProfanityFilter::Base.clean('happy', 'vowels')
end
def test_vowels_profanity_filter_does_not_modify_whitespace
assert_equal 'hello world', ProfanityFilter::Base.clean('hello world', 'vowels')
assert_equal "hello \t world", ProfanityFilter::Base.clean("hello \t world", 'vowels')
assert_equal "hello \n world", ProfanityFilter::Base.clean("hello \n world", 'vowels')
end
def test_vowels_profanity_filter_does_not_modify_special_characters
assert_equal 'happy f*ck', ProfanityFilter::Base.clean('happy fuck', 'vowels')
assert_equal 'happy\'s', ProfanityFilter::Base.clean('happy\'s', 'vowels')
assert_equal 'f*ck\'s', ProfanityFilter::Base.clean('fuck\'s', 'vowels')
assert_equal 'f*ck?!', ProfanityFilter::Base.clean('fuck?!', 'vowels')
end
def test_vowels_profanity_filter_replaces_profane_words
assert_equal 'f*ck', ProfanityFilter::Base.clean('fuck', 'vowels')
assert_equal 'F*CK', ProfanityFilter::Base.clean('FUCK', 'vowels')
end
def test_vowels_profanity_filter_replaces_punctuation_spaced_profane_words
assert_equal 'f*ck', ProfanityFilter::Base.clean('f-u-c-k', 'vowels')
assert_equal 'f*ck', ProfanityFilter::Base.clean('f.u.c.k', 'vowels')
assert_equal 'happy-f*ck', ProfanityFilter::Base.clean('happy-fuck', 'vowels')
end
end
class HollowProfanityFilterTest < Test::Unit::TestCase
def test_hollow_profanity_filter_does_not_modify_clean_words
assert_equal 'happy', ProfanityFilter::Base.clean('happy', 'hollow')
end
def test_hollow_profanity_filter_does_not_modify_whitespace
assert_equal 'hello world', ProfanityFilter::Base.clean('hello world', 'hollow')
assert_equal "hello \t world", ProfanityFilter::Base.clean("hello \t world", 'hollow')
assert_equal "hello \n world", ProfanityFilter::Base.clean("hello \n world", 'hollow')
end
def test_hollow_profanity_filter_does_not_modify_special_characters
assert_equal 'happy f**k', ProfanityFilter::Base.clean('happy fuck', 'hollow')
assert_equal 'happy\'s', ProfanityFilter::Base.clean('happy\'s', 'hollow')
assert_equal 'f**k\'s', ProfanityFilter::Base.clean('fuck\'s', 'hollow')
assert_equal 'f**k?!', ProfanityFilter::Base.clean('fuck?!', 'hollow')
end
def test_hollow_profanity_filter_replaces_profane_words
assert_equal 'f**k', ProfanityFilter::Base.clean('fuck', 'hollow')
assert_equal 'F**K', ProfanityFilter::Base.clean('FUCK', 'hollow')
end
def test_hollow_profanity_filter_replaces_punctuation_spaced_profane_words
assert_equal 'f**k', ProfanityFilter::Base.clean('f-u-c-k', 'hollow')
assert_equal 'f**k', ProfanityFilter::Base.clean('f.u.c.k', 'hollow')
assert_equal 'happy-f**k', ProfanityFilter::Base.clean('happy-fuck', 'hollow')
end
end
class StarsProfanityFilterTest < Test::Unit::TestCase
def test_stars_profanity_filter_does_not_modify_clean_words
assert_equal 'happy', ProfanityFilter::Base.clean('happy', 'stars')
end
def test_stars_profanity_filter_does_not_modify_whitespace
assert_equal 'hello world', ProfanityFilter::Base.clean('hello world', 'stars')
assert_equal "hello \t world", ProfanityFilter::Base.clean("hello \t world", 'stars')
assert_equal "hello \n world", ProfanityFilter::Base.clean("hello \n world", 'stars')
end
def test_stars_profanity_filter_does_not_modify_special_characters
assert_equal 'happy ****', ProfanityFilter::Base.clean('happy fuck', 'stars')
assert_equal 'happy\'s', ProfanityFilter::Base.clean('happy\'s', 'stars')
assert_equal '****\'s', ProfanityFilter::Base.clean('fuck\'s', 'stars')
assert_equal '****?!', ProfanityFilter::Base.clean('fuck?!', 'stars')
end
def test_stars_profanity_filter_replaces_profane_words
assert_equal '****', ProfanityFilter::Base.clean('fuck', 'stars')
assert_equal '****', ProfanityFilter::Base.clean('FUCK', 'stars')
end
def test_stars_profanity_filter_replaces_punctuation_spaced_profane_words
assert_equal '****', ProfanityFilter::Base.clean('f-u-c-k', 'stars')
assert_equal '****', ProfanityFilter::Base.clean('f.u.c.k', 'stars')
assert_equal 'happy-****', ProfanityFilter::Base.clean('happy-fuck', 'stars')
end
end
| {
"content_hash": "a1e8a7506a2133b3ec39ba87ec950cbd",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 94,
"avg_line_length": 44.91228070175438,
"alnum_prop": 0.7044270833333334,
"repo_name": "intridea/profanity_filter",
"id": "c9f621d15f3d841ef9105297b4aa25e77d0cb650",
"size": "7680",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "test/profanity_filter_test.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "24616"
}
],
"symlink_target": ""
} |
package org.jboss.pnc.coordinator.test;
import org.jboss.pnc.bpm.BpmTask;
import org.jboss.pnc.bpm.mock.BpmMock;
import org.jboss.pnc.bpm.model.BuildResultRest;
import org.jboss.pnc.bpm.model.mapper.BuildResultMapper;
import org.jboss.pnc.bpm.model.mapper.RepositoryManagerResultMapper;
import org.jboss.pnc.common.Configuration;
import org.jboss.pnc.common.json.ConfigurationParseException;
import org.jboss.pnc.common.json.moduleconfig.SystemConfig;
import org.jboss.pnc.coordinator.builder.BuildQueue;
import org.jboss.pnc.coordinator.builder.BuildScheduler;
import org.jboss.pnc.coordinator.builder.DefaultBuildCoordinator;
import org.jboss.pnc.coordinator.builder.bpm.BpmBuildScheduler;
import org.jboss.pnc.coordinator.builder.datastore.DatastoreAdapter;
import org.jboss.pnc.enums.BuildStatus;
import org.jboss.pnc.mapper.AbstractArtifactMapperImpl;
import org.jboss.pnc.mapper.EnvironmentMapperImpl;
import org.jboss.pnc.mapper.SCMRepositoryMapperImpl;
import org.jboss.pnc.mapper.api.BuildMapper;
import org.jboss.pnc.mapper.api.EnvironmentMapper;
import org.jboss.pnc.mapper.api.GroupBuildMapper;
import org.jboss.pnc.mapper.api.ProjectMapper;
import org.jboss.pnc.mapper.api.SCMRepositoryMapper;
import org.jboss.pnc.mapper.api.TargetRepositoryMapper;
import org.jboss.pnc.mock.datastore.DatastoreMock;
import org.jboss.pnc.mock.model.MockUser;
import org.jboss.pnc.mock.model.builders.TestProjectConfigurationBuilder;
import org.jboss.pnc.model.BuildRecord;
import org.jboss.pnc.spi.BuildOptions;
import org.jboss.pnc.spi.coordinator.BuildCoordinator;
import org.jboss.pnc.spi.coordinator.CompletionStatus;
import org.jboss.pnc.spi.events.BuildStatusChangedEvent;
import org.jboss.pnc.spi.exception.CoreException;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Spy;
import org.mockito.junit.MockitoJUnitRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.enterprise.event.Event;
import javax.enterprise.event.NotificationOptions;
import javax.enterprise.util.TypeLiteral;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.CompletionStage;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.function.Consumer;
import static org.jboss.pnc.bpm.BpmEventType.BUILD_COMPLETE;
/**
* Created by <a href="mailto:[email protected]">Matej Lazar</a> on 2015-01-06.
*/
@RunWith(MockitoJUnitRunner.class)
public class CancelledBuildByBpmTest {
private static final Logger log = LoggerFactory.getLogger(CancelledBuildByBpmTest.class);
@Spy
private GroupBuildMapper groupBuildMapper;
@Spy
private BuildMapper buildMapper;
@Mock
private Configuration configuration;
@Spy
private TargetRepositoryMapper targetRepositoryMapper;
@Spy
private AbstractArtifactMapperImpl artifactMapper;
@Spy
private RepositoryManagerResultMapper repositoryManagerResultMapper;
@Spy
private SCMRepositoryMapper scmRepositoryMapper = new SCMRepositoryMapperImpl();
@Spy
private EnvironmentMapper environmentMapper = new EnvironmentMapperImpl();
@Spy
@InjectMocks
private BuildResultMapper buildResultMapper = new BuildResultMapper();
@Spy
private ProjectMapper projectMapper;
@Test(timeout = 5_000)
public void buildSingleProjectTestCase() throws Exception {
// given
DatastoreMock datastoreMock = new DatastoreMock();
TestProjectConfigurationBuilder configurationBuilder = new TestProjectConfigurationBuilder(datastoreMock);
DatastoreAdapter datastoreAdapter = new DatastoreAdapter(datastoreMock);
SystemConfig systemConfig = createConfiguration();
BuildQueue queue = new BuildQueue(systemConfig);
BlockingQueue<BuildStatusChangedEvent> receivedStatuses = new ArrayBlockingQueue<>(5);
Consumer<BuildStatusChangedEvent> onStatusUpdate = receivedStatuses::add;
EventListener buildStatusChangedEventNotifier = new EventListener(onStatusUpdate);
BlockingQueue<BpmTask> task = new ArrayBlockingQueue<>(5);
Consumer<BpmTask> onBpmTaskCreated = task::add;
BuildSchedulerFactory buildSchedulerFactory = new BuildSchedulerFactory(onBpmTaskCreated);
BuildCoordinator coordinator = new DefaultBuildCoordinator(
datastoreAdapter,
buildStatusChangedEventNotifier,
null,
buildSchedulerFactory,
queue,
systemConfig,
groupBuildMapper,
buildMapper);
coordinator.start();
queue.initSemaphore();
coordinator.build(
configurationBuilder.buildConfigurationToCancel(1, "c1-bpm"),
MockUser.newTestUser(1),
new BuildOptions());
waitForStatus(receivedStatuses, BuildStatus.BUILDING);
BpmTask bpmTask = task.poll(1, TimeUnit.SECONDS);
BuildResultRest result = new BuildResultRest();
result.setCompletionStatus(CompletionStatus.CANCELLED);
// when
bpmTask.notify(BUILD_COMPLETE, result);
waitForStatus(receivedStatuses, BuildStatus.CANCELLED);
// expect
List<BuildRecord> buildRecords = datastoreMock.getBuildRecords();
Assert.assertEquals("Too many build records in datastore: " + buildRecords, 1, buildRecords.size());
BuildRecord buildRecord = buildRecords.get(0);
Assert.assertNotNull(buildRecord.getSubmitTime());
Assert.assertNotNull(buildRecord.getStartTime());
Assert.assertNotNull(buildRecord.getEndTime());
Assert.assertEquals(BuildStatus.CANCELLED, buildRecord.getStatus());
}
private void waitForStatus(BlockingQueue<BuildStatusChangedEvent> receivedStatuses, BuildStatus status)
throws InterruptedException, TimeoutException {
BuildStatusChangedEvent statusChangedEvent = receivedStatuses.poll(1, TimeUnit.SECONDS);
if (statusChangedEvent == null) {
throw new TimeoutException("Did not received status update: " + status);
}
if (statusChangedEvent.getNewStatus().equals(status)) {
return;
}
waitForStatus(receivedStatuses, status);
}
public class BuildSchedulerFactory extends org.jboss.pnc.coordinator.builder.BuildSchedulerFactory {
BpmBuildScheduler buildScheduler;
public BuildSchedulerFactory(Consumer<BpmTask> onTaskStarted)
throws CoreException, ConfigurationParseException, IOException {
BpmMock manager = new BpmMock();
manager.setOnTaskStarted(onTaskStarted);
buildScheduler = new BpmBuildScheduler(manager, buildResultMapper);
}
@Override
public BuildScheduler getBuildScheduler() {
return buildScheduler;
}
}
private SystemConfig createConfiguration() {
return new SystemConfig(
"ProperDriver",
"local-build-scheduler",
"NO_AUTH",
"10",
"10",
"10",
"${product_short_name}-${product_version}-pnc",
"10",
null,
null,
"14",
"",
"10");
}
private static class EventListener implements Event<BuildStatusChangedEvent> {
Consumer<BuildStatusChangedEvent> onEvent;
public EventListener(Consumer<BuildStatusChangedEvent> onEvent) {
this.onEvent = onEvent;
}
@Override
public void fire(BuildStatusChangedEvent event) {
onEvent.accept(event);
}
@Override
public <U extends BuildStatusChangedEvent> CompletionStage<U> fireAsync(U event) {
return null;
}
@Override
public <U extends BuildStatusChangedEvent> CompletionStage<U> fireAsync(U event, NotificationOptions options) {
return null;
}
@Override
public Event<BuildStatusChangedEvent> select(Annotation... qualifiers) {
return null;
}
@Override
public <U extends BuildStatusChangedEvent> Event<U> select(Class<U> subtype, Annotation... qualifiers) {
return null;
}
@Override
public <U extends BuildStatusChangedEvent> Event<U> select(TypeLiteral<U> subtype, Annotation... qualifiers) {
return null;
}
}
}
| {
"content_hash": "c40ab8f3510260e50e5e3db33ccba751",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 119,
"avg_line_length": 35.37246963562753,
"alnum_prop": 0.7107702872839647,
"repo_name": "alexcreasy/pnc",
"id": "a053cc8564138a94963dc5344a5c5f6f2fb71b13",
"size": "9445",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "build-coordinator/src/test/java/org/jboss/pnc/coordinator/test/CancelledBuildByBpmTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "113413"
},
{
"name": "HTML",
"bytes": "394550"
},
{
"name": "Java",
"bytes": "4283733"
},
{
"name": "JavaScript",
"bytes": "3099544"
},
{
"name": "TSQL",
"bytes": "47567"
}
],
"symlink_target": ""
} |
package ch.ifocusit.livingdoc.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* @author Julien Boz
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.PACKAGE})
public @interface CoreDomain {
}
| {
"content_hash": "352999647a75f09d9251ea9e58d7f5de",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 44,
"avg_line_length": 23.466666666666665,
"alnum_prop": 0.7642045454545454,
"repo_name": "jboz/living-documentation",
"id": "f145c08aeeb2f467d4c2a3c712074ebbf20157cc",
"size": "1241",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "livingdoc-annotations/src/main/java/ch/ifocusit/livingdoc/annotations/CoreDomain.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "137"
},
{
"name": "Gherkin",
"bytes": "3042"
},
{
"name": "Groovy",
"bytes": "1890"
},
{
"name": "HTML",
"bytes": "368656"
},
{
"name": "Java",
"bytes": "327757"
},
{
"name": "JavaScript",
"bytes": "1248"
},
{
"name": "Makefile",
"bytes": "130"
},
{
"name": "Ruby",
"bytes": "4533"
},
{
"name": "Shell",
"bytes": "6702"
},
{
"name": "TypeScript",
"bytes": "36453"
}
],
"symlink_target": ""
} |
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */
/* */
/* 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. */
/* -------------------------------------------------------------------------- */
define(function(require) {
return 'dashboard-tab';
});
| {
"content_hash": "ce8a722f94722698af389b14695225da",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 80,
"avg_line_length": 67,
"alnum_prop": 0.3974862529457973,
"repo_name": "fasrc/one",
"id": "ac3fb96afc41ceed636dc1734193a1fb183c1a9a",
"size": "1273",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/sunstone/public/app/tabs/dashboard-tab/tabId.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "177534"
},
{
"name": "C++",
"bytes": "3058603"
},
{
"name": "CSS",
"bytes": "76905"
},
{
"name": "Groff",
"bytes": "115209"
},
{
"name": "HTML",
"bytes": "577670"
},
{
"name": "Java",
"bytes": "422673"
},
{
"name": "JavaScript",
"bytes": "1817203"
},
{
"name": "Lex",
"bytes": "10530"
},
{
"name": "Python",
"bytes": "128478"
},
{
"name": "Ruby",
"bytes": "2363093"
},
{
"name": "Shell",
"bytes": "710393"
},
{
"name": "Yacc",
"bytes": "34871"
}
],
"symlink_target": ""
} |
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormMainCP
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FormMainCP))
Me.TLPMainCP = New System.Windows.Forms.TableLayoutPanel()
Me.FLPTitleBarCP = New System.Windows.Forms.FlowLayoutPanel()
Me.PictureBoxIconCP = New System.Windows.Forms.PictureBox()
Me.LabelTitleCP = New System.Windows.Forms.Label()
Me.FLPTitleBarAltCP = New System.Windows.Forms.FlowLayoutPanel()
Me.ButtonCloseCP = New System.Windows.Forms.Button()
Me.ButtonMaximizeCP = New System.Windows.Forms.Button()
Me.ButtonMinimizeCP = New System.Windows.Forms.Button()
Me.MenuStripCP = New System.Windows.Forms.MenuStrip()
Me.MenuItemFileCP = New System.Windows.Forms.ToolStripMenuItem()
Me.PrintToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.PrintPreviewToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.toolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator()
Me.ExitToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.MenuItemHelpCP = New System.Windows.Forms.ToolStripMenuItem()
Me.SearchToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.toolStripSeparator5 = New System.Windows.Forms.ToolStripSeparator()
Me.AboutToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.FLPFormCP = New System.Windows.Forms.FlowLayoutPanel()
Me.LabelDesc1CP = New System.Windows.Forms.Label()
Me.InputPlasticCP = New System.Windows.Forms.TextBox()
Me.LabelDesc2CP = New System.Windows.Forms.Label()
Me.InputCopperCP = New System.Windows.Forms.TextBox()
Me.LabelDesc3CP = New System.Windows.Forms.Label()
Me.InputLabourCP = New System.Windows.Forms.TextBox()
Me.ButtonCalcCostCP = New System.Windows.Forms.Button()
Me.PictureBoxHeroCP = New System.Windows.Forms.PictureBox()
Me.PrintDocumentCP = New System.Drawing.Printing.PrintDocument()
Me.PrintDialogCP = New System.Windows.Forms.PrintDialog()
Me.PrintPreviewDialogCP = New System.Windows.Forms.PrintPreviewDialog()
Me.ToolTipCP = New System.Windows.Forms.ToolTip(Me.components)
Me.TLPMainCP.SuspendLayout()
Me.FLPTitleBarCP.SuspendLayout()
CType(Me.PictureBoxIconCP, System.ComponentModel.ISupportInitialize).BeginInit()
Me.FLPTitleBarAltCP.SuspendLayout()
Me.MenuStripCP.SuspendLayout()
Me.FLPFormCP.SuspendLayout()
CType(Me.PictureBoxHeroCP, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'TLPMainCP
'
Me.TLPMainCP.ColumnCount = 5
Me.TLPMainCP.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10.0!))
Me.TLPMainCP.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 35.0!))
Me.TLPMainCP.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10.0!))
Me.TLPMainCP.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 35.0!))
Me.TLPMainCP.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 10.0!))
Me.TLPMainCP.Controls.Add(Me.FLPTitleBarCP)
Me.TLPMainCP.Controls.Add(Me.FLPTitleBarAltCP)
Me.TLPMainCP.Controls.Add(Me.MenuStripCP, 0, 1)
Me.TLPMainCP.Controls.Add(Me.FLPFormCP, 3, 2)
Me.TLPMainCP.Controls.Add(Me.PictureBoxHeroCP, 1, 2)
Me.TLPMainCP.Dock = System.Windows.Forms.DockStyle.Fill
Me.TLPMainCP.Location = New System.Drawing.Point(0, 0)
Me.TLPMainCP.Margin = New System.Windows.Forms.Padding(0)
Me.TLPMainCP.Name = "TLPMainCP"
Me.TLPMainCP.RowCount = 3
Me.TLPMainCP.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 48.0!))
Me.TLPMainCP.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TLPMainCP.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.TLPMainCP.Size = New System.Drawing.Size(1024, 768)
Me.TLPMainCP.TabIndex = 0
'
'FLPTitleBarCP
'
Me.FLPTitleBarCP.BackColor = System.Drawing.Color.FromArgb(CType(CType(51, Byte), Integer), CType(CType(51, Byte), Integer), CType(CType(51, Byte), Integer))
Me.TLPMainCP.SetColumnSpan(Me.FLPTitleBarCP, 2)
Me.FLPTitleBarCP.Controls.Add(Me.PictureBoxIconCP)
Me.FLPTitleBarCP.Controls.Add(Me.LabelTitleCP)
Me.FLPTitleBarCP.Dock = System.Windows.Forms.DockStyle.Fill
Me.FLPTitleBarCP.ForeColor = System.Drawing.Color.FromArgb(CType(CType(238, Byte), Integer), CType(CType(238, Byte), Integer), CType(CType(238, Byte), Integer))
Me.FLPTitleBarCP.Location = New System.Drawing.Point(0, 0)
Me.FLPTitleBarCP.Margin = New System.Windows.Forms.Padding(0)
Me.FLPTitleBarCP.Name = "FLPTitleBarCP"
Me.FLPTitleBarCP.Size = New System.Drawing.Size(460, 48)
Me.FLPTitleBarCP.TabIndex = 0
'
'PictureBoxIconCP
'
Me.PictureBoxIconCP.BackColor = System.Drawing.Color.Transparent
Me.PictureBoxIconCP.BackgroundImage = Global.CalcPlumber.My.Resources.Resources.IconAltSmall
Me.PictureBoxIconCP.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
Me.PictureBoxIconCP.Location = New System.Drawing.Point(12, 12)
Me.PictureBoxIconCP.Margin = New System.Windows.Forms.Padding(12, 12, 4, 12)
Me.PictureBoxIconCP.Name = "PictureBoxIconCP"
Me.PictureBoxIconCP.Size = New System.Drawing.Size(24, 24)
Me.PictureBoxIconCP.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage
Me.PictureBoxIconCP.TabIndex = 0
Me.PictureBoxIconCP.TabStop = False
'
'LabelTitleCP
'
Me.LabelTitleCP.AutoSize = True
Me.LabelTitleCP.Font = New System.Drawing.Font("Segoe UI Semibold", 12.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LabelTitleCP.Location = New System.Drawing.Point(40, 12)
Me.LabelTitleCP.Margin = New System.Windows.Forms.Padding(0, 12, 12, 12)
Me.LabelTitleCP.Name = "LabelTitleCP"
Me.LabelTitleCP.Size = New System.Drawing.Size(101, 21)
Me.LabelTitleCP.TabIndex = 0
Me.LabelTitleCP.Text = "CalcPlumber"
Me.ToolTipCP.SetToolTip(Me.LabelTitleCP, "CalcPlumber")
'
'FLPTitleBarAltCP
'
Me.FLPTitleBarAltCP.BackColor = System.Drawing.Color.FromArgb(CType(CType(51, Byte), Integer), CType(CType(51, Byte), Integer), CType(CType(51, Byte), Integer))
Me.TLPMainCP.SetColumnSpan(Me.FLPTitleBarAltCP, 3)
Me.FLPTitleBarAltCP.Controls.Add(Me.ButtonCloseCP)
Me.FLPTitleBarAltCP.Controls.Add(Me.ButtonMaximizeCP)
Me.FLPTitleBarAltCP.Controls.Add(Me.ButtonMinimizeCP)
Me.FLPTitleBarAltCP.Dock = System.Windows.Forms.DockStyle.Fill
Me.FLPTitleBarAltCP.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft
Me.FLPTitleBarAltCP.ForeColor = System.Drawing.Color.FromArgb(CType(CType(238, Byte), Integer), CType(CType(238, Byte), Integer), CType(CType(238, Byte), Integer))
Me.FLPTitleBarAltCP.Location = New System.Drawing.Point(460, 0)
Me.FLPTitleBarAltCP.Margin = New System.Windows.Forms.Padding(0)
Me.FLPTitleBarAltCP.Name = "FLPTitleBarAltCP"
Me.FLPTitleBarAltCP.Size = New System.Drawing.Size(564, 48)
Me.FLPTitleBarAltCP.TabIndex = 1
'
'ButtonCloseCP
'
Me.ButtonCloseCP.BackColor = System.Drawing.Color.Transparent
Me.ButtonCloseCP.BackgroundImage = Global.CalcPlumber.My.Resources.Resources.ButtonClose
Me.ButtonCloseCP.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
Me.ButtonCloseCP.FlatAppearance.BorderSize = 0
Me.ButtonCloseCP.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.ButtonCloseCP.Location = New System.Drawing.Point(528, 12)
Me.ButtonCloseCP.Margin = New System.Windows.Forms.Padding(4, 12, 12, 12)
Me.ButtonCloseCP.Name = "ButtonCloseCP"
Me.ButtonCloseCP.Size = New System.Drawing.Size(24, 24)
Me.ButtonCloseCP.TabIndex = 0
Me.ButtonCloseCP.TabStop = False
Me.ToolTipCP.SetToolTip(Me.ButtonCloseCP, "Close the application")
Me.ButtonCloseCP.UseVisualStyleBackColor = False
'
'ButtonMaximizeCP
'
Me.ButtonMaximizeCP.BackColor = System.Drawing.Color.Transparent
Me.ButtonMaximizeCP.BackgroundImage = Global.CalcPlumber.My.Resources.Resources.ButtonMaximize
Me.ButtonMaximizeCP.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
Me.ButtonMaximizeCP.FlatAppearance.BorderSize = 0
Me.ButtonMaximizeCP.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.ButtonMaximizeCP.Location = New System.Drawing.Point(496, 12)
Me.ButtonMaximizeCP.Margin = New System.Windows.Forms.Padding(4, 12, 4, 12)
Me.ButtonMaximizeCP.Name = "ButtonMaximizeCP"
Me.ButtonMaximizeCP.Size = New System.Drawing.Size(24, 24)
Me.ButtonMaximizeCP.TabIndex = 0
Me.ButtonMaximizeCP.TabStop = False
Me.ToolTipCP.SetToolTip(Me.ButtonMaximizeCP, "Maximize the application to the screen")
Me.ButtonMaximizeCP.UseVisualStyleBackColor = False
'
'ButtonMinimizeCP
'
Me.ButtonMinimizeCP.BackColor = System.Drawing.Color.Transparent
Me.ButtonMinimizeCP.BackgroundImage = Global.CalcPlumber.My.Resources.Resources.ButtonMinimize
Me.ButtonMinimizeCP.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch
Me.ButtonMinimizeCP.FlatAppearance.BorderSize = 0
Me.ButtonMinimizeCP.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.ButtonMinimizeCP.Location = New System.Drawing.Point(464, 12)
Me.ButtonMinimizeCP.Margin = New System.Windows.Forms.Padding(12, 12, 4, 12)
Me.ButtonMinimizeCP.Name = "ButtonMinimizeCP"
Me.ButtonMinimizeCP.Size = New System.Drawing.Size(24, 24)
Me.ButtonMinimizeCP.TabIndex = 0
Me.ButtonMinimizeCP.TabStop = False
Me.ToolTipCP.SetToolTip(Me.ButtonMinimizeCP, "Minimize the application to the taskbar")
Me.ButtonMinimizeCP.UseVisualStyleBackColor = False
'
'MenuStripCP
'
Me.TLPMainCP.SetColumnSpan(Me.MenuStripCP, 5)
Me.MenuStripCP.Dock = System.Windows.Forms.DockStyle.Fill
Me.MenuStripCP.Font = New System.Drawing.Font("Segoe UI", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel)
Me.MenuStripCP.GripMargin = New System.Windows.Forms.Padding(0)
Me.MenuStripCP.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.MenuItemFileCP, Me.MenuItemHelpCP})
Me.MenuStripCP.Location = New System.Drawing.Point(0, 48)
Me.MenuStripCP.Name = "MenuStripCP"
Me.MenuStripCP.Padding = New System.Windows.Forms.Padding(0)
Me.MenuStripCP.RenderMode = System.Windows.Forms.ToolStripRenderMode.System
Me.MenuStripCP.Size = New System.Drawing.Size(1024, 24)
Me.MenuStripCP.TabIndex = 4
Me.MenuStripCP.Text = "MenuStrip1"
'
'MenuItemFileCP
'
Me.MenuItemFileCP.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.PrintToolStripMenuItem, Me.PrintPreviewToolStripMenuItem, Me.toolStripSeparator2, Me.ExitToolStripMenuItem})
Me.MenuItemFileCP.Name = "MenuItemFileCP"
Me.MenuItemFileCP.Size = New System.Drawing.Size(37, 24)
Me.MenuItemFileCP.Text = "&File"
'
'PrintToolStripMenuItem
'
Me.PrintToolStripMenuItem.Image = CType(resources.GetObject("PrintToolStripMenuItem.Image"), System.Drawing.Image)
Me.PrintToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta
Me.PrintToolStripMenuItem.Name = "PrintToolStripMenuItem"
Me.PrintToolStripMenuItem.ShortcutKeys = CType((System.Windows.Forms.Keys.Control Or System.Windows.Forms.Keys.P), System.Windows.Forms.Keys)
Me.PrintToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
Me.PrintToolStripMenuItem.Text = "&Print"
'
'PrintPreviewToolStripMenuItem
'
Me.PrintPreviewToolStripMenuItem.Image = CType(resources.GetObject("PrintPreviewToolStripMenuItem.Image"), System.Drawing.Image)
Me.PrintPreviewToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta
Me.PrintPreviewToolStripMenuItem.Name = "PrintPreviewToolStripMenuItem"
Me.PrintPreviewToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
Me.PrintPreviewToolStripMenuItem.Text = "Print Pre&view"
'
'toolStripSeparator2
'
Me.toolStripSeparator2.Name = "toolStripSeparator2"
Me.toolStripSeparator2.Size = New System.Drawing.Size(149, 6)
'
'ExitToolStripMenuItem
'
Me.ExitToolStripMenuItem.Name = "ExitToolStripMenuItem"
Me.ExitToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
Me.ExitToolStripMenuItem.Text = "E&xit"
'
'MenuItemHelpCP
'
Me.MenuItemHelpCP.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.SearchToolStripMenuItem, Me.toolStripSeparator5, Me.AboutToolStripMenuItem})
Me.MenuItemHelpCP.Name = "MenuItemHelpCP"
Me.MenuItemHelpCP.Size = New System.Drawing.Size(44, 24)
Me.MenuItemHelpCP.Text = "&Help"
'
'SearchToolStripMenuItem
'
Me.SearchToolStripMenuItem.Name = "SearchToolStripMenuItem"
Me.SearchToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
Me.SearchToolStripMenuItem.Text = "View &Help..."
'
'toolStripSeparator5
'
Me.toolStripSeparator5.Name = "toolStripSeparator5"
Me.toolStripSeparator5.Size = New System.Drawing.Size(149, 6)
'
'AboutToolStripMenuItem
'
Me.AboutToolStripMenuItem.Name = "AboutToolStripMenuItem"
Me.AboutToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
Me.AboutToolStripMenuItem.Text = "&About..."
'
'FLPFormCP
'
Me.FLPFormCP.Controls.Add(Me.LabelDesc1CP)
Me.FLPFormCP.Controls.Add(Me.InputPlasticCP)
Me.FLPFormCP.Controls.Add(Me.LabelDesc2CP)
Me.FLPFormCP.Controls.Add(Me.InputCopperCP)
Me.FLPFormCP.Controls.Add(Me.LabelDesc3CP)
Me.FLPFormCP.Controls.Add(Me.InputLabourCP)
Me.FLPFormCP.Controls.Add(Me.ButtonCalcCostCP)
Me.FLPFormCP.Dock = System.Windows.Forms.DockStyle.Fill
Me.FLPFormCP.FlowDirection = System.Windows.Forms.FlowDirection.TopDown
Me.FLPFormCP.Location = New System.Drawing.Point(562, 72)
Me.FLPFormCP.Margin = New System.Windows.Forms.Padding(0)
Me.FLPFormCP.Name = "FLPFormCP"
Me.FLPFormCP.Padding = New System.Windows.Forms.Padding(16, 196, 16, 0)
Me.FLPFormCP.Size = New System.Drawing.Size(358, 696)
Me.FLPFormCP.TabIndex = 3
'
'LabelDesc1CP
'
Me.LabelDesc1CP.AutoSize = True
Me.LabelDesc1CP.BackColor = System.Drawing.Color.Transparent
Me.LabelDesc1CP.ForeColor = System.Drawing.Color.FromArgb(CType(CType(207, Byte), Integer), CType(CType(152, Byte), Integer), CType(CType(110, Byte), Integer))
Me.LabelDesc1CP.Location = New System.Drawing.Point(24, 204)
Me.LabelDesc1CP.Margin = New System.Windows.Forms.Padding(8)
Me.LabelDesc1CP.Name = "LabelDesc1CP"
Me.LabelDesc1CP.Size = New System.Drawing.Size(237, 21)
Me.LabelDesc1CP.TabIndex = 0
Me.LabelDesc1CP.Text = "Length of Plastic Pipe (In Meters)"
'
'InputPlasticCP
'
Me.InputPlasticCP.BackColor = System.Drawing.Color.FromArgb(CType(CType(238, Byte), Integer), CType(CType(238, Byte), Integer), CType(CType(238, Byte), Integer))
Me.InputPlasticCP.ForeColor = System.Drawing.Color.FromArgb(CType(CType(207, Byte), Integer), CType(CType(152, Byte), Integer), CType(CType(110, Byte), Integer))
Me.InputPlasticCP.Location = New System.Drawing.Point(24, 233)
Me.InputPlasticCP.Margin = New System.Windows.Forms.Padding(8, 0, 8, 0)
Me.InputPlasticCP.MinimumSize = New System.Drawing.Size(296, 4)
Me.InputPlasticCP.Name = "InputPlasticCP"
Me.InputPlasticCP.Size = New System.Drawing.Size(296, 29)
Me.InputPlasticCP.TabIndex = 0
Me.ToolTipCP.SetToolTip(Me.InputPlasticCP, "Enter the number of plastic piping needed for this job in this text box. It must " & _
"be a single whole number (no spaces).")
'
'LabelDesc2CP
'
Me.LabelDesc2CP.AutoSize = True
Me.LabelDesc2CP.BackColor = System.Drawing.Color.Transparent
Me.LabelDesc2CP.ForeColor = System.Drawing.Color.FromArgb(CType(CType(207, Byte), Integer), CType(CType(152, Byte), Integer), CType(CType(110, Byte), Integer))
Me.LabelDesc2CP.Location = New System.Drawing.Point(24, 270)
Me.LabelDesc2CP.Margin = New System.Windows.Forms.Padding(8)
Me.LabelDesc2CP.Name = "LabelDesc2CP"
Me.LabelDesc2CP.Size = New System.Drawing.Size(244, 21)
Me.LabelDesc2CP.TabIndex = 0
Me.LabelDesc2CP.Text = "Length of Copper Pipe (In Meters)"
'
'InputCopperCP
'
Me.InputCopperCP.BackColor = System.Drawing.Color.FromArgb(CType(CType(238, Byte), Integer), CType(CType(238, Byte), Integer), CType(CType(238, Byte), Integer))
Me.InputCopperCP.ForeColor = System.Drawing.Color.FromArgb(CType(CType(207, Byte), Integer), CType(CType(152, Byte), Integer), CType(CType(110, Byte), Integer))
Me.InputCopperCP.Location = New System.Drawing.Point(24, 299)
Me.InputCopperCP.Margin = New System.Windows.Forms.Padding(8, 0, 8, 0)
Me.InputCopperCP.MinimumSize = New System.Drawing.Size(296, 4)
Me.InputCopperCP.Name = "InputCopperCP"
Me.InputCopperCP.Size = New System.Drawing.Size(296, 29)
Me.InputCopperCP.TabIndex = 1
Me.ToolTipCP.SetToolTip(Me.InputCopperCP, "Enter the number of copper piping needed for this job in this text box. It must b" & _
"e a single whole number (no spaces)." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10))
'
'LabelDesc3CP
'
Me.LabelDesc3CP.AutoSize = True
Me.LabelDesc3CP.BackColor = System.Drawing.Color.Transparent
Me.LabelDesc3CP.ForeColor = System.Drawing.Color.FromArgb(CType(CType(207, Byte), Integer), CType(CType(152, Byte), Integer), CType(CType(110, Byte), Integer))
Me.LabelDesc3CP.Location = New System.Drawing.Point(24, 336)
Me.LabelDesc3CP.Margin = New System.Windows.Forms.Padding(8)
Me.LabelDesc3CP.Name = "LabelDesc3CP"
Me.LabelDesc3CP.Size = New System.Drawing.Size(242, 21)
Me.LabelDesc3CP.TabIndex = 0
Me.LabelDesc3CP.Text = "Estimated Labour Time (In Hours)"
'
'InputLabourCP
'
Me.InputLabourCP.BackColor = System.Drawing.Color.FromArgb(CType(CType(238, Byte), Integer), CType(CType(238, Byte), Integer), CType(CType(238, Byte), Integer))
Me.InputLabourCP.ForeColor = System.Drawing.Color.FromArgb(CType(CType(207, Byte), Integer), CType(CType(152, Byte), Integer), CType(CType(110, Byte), Integer))
Me.InputLabourCP.Location = New System.Drawing.Point(24, 365)
Me.InputLabourCP.Margin = New System.Windows.Forms.Padding(8, 0, 8, 0)
Me.InputLabourCP.MinimumSize = New System.Drawing.Size(296, 4)
Me.InputLabourCP.Name = "InputLabourCP"
Me.InputLabourCP.Size = New System.Drawing.Size(296, 29)
Me.InputLabourCP.TabIndex = 2
Me.ToolTipCP.SetToolTip(Me.InputLabourCP, "Enter the number of hours of labour required for this job in this text box. It mu" & _
"st be a single whole number (no " & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "spaces).")
'
'ButtonCalcCostCP
'
Me.ButtonCalcCostCP.Cursor = System.Windows.Forms.Cursors.Hand
Me.ButtonCalcCostCP.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(CType(CType(207, Byte), Integer), CType(CType(152, Byte), Integer), CType(CType(110, Byte), Integer))
Me.ButtonCalcCostCP.FlatAppearance.BorderSize = 2
Me.ButtonCalcCostCP.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(CType(CType(207, Byte), Integer), CType(CType(152, Byte), Integer), CType(CType(110, Byte), Integer))
Me.ButtonCalcCostCP.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(CType(CType(207, Byte), Integer), CType(CType(152, Byte), Integer), CType(CType(110, Byte), Integer))
Me.ButtonCalcCostCP.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.ButtonCalcCostCP.ForeColor = System.Drawing.Color.FromArgb(CType(CType(207, Byte), Integer), CType(CType(152, Byte), Integer), CType(CType(110, Byte), Integer))
Me.ButtonCalcCostCP.Location = New System.Drawing.Point(24, 410)
Me.ButtonCalcCostCP.Margin = New System.Windows.Forms.Padding(8, 16, 8, 16)
Me.ButtonCalcCostCP.Name = "ButtonCalcCostCP"
Me.ButtonCalcCostCP.Size = New System.Drawing.Size(296, 46)
Me.ButtonCalcCostCP.TabIndex = 3
Me.ButtonCalcCostCP.Text = "Calculate Cost"
Me.ToolTipCP.SetToolTip(Me.ButtonCalcCostCP, "Click this button to bring up the calculation dialog. All three fields above must" & _
" contain data to for the program to opperate.")
Me.ButtonCalcCostCP.UseVisualStyleBackColor = True
'
'PictureBoxHeroCP
'
Me.PictureBoxHeroCP.BackgroundImage = CType(resources.GetObject("PictureBoxHeroCP.BackgroundImage"), System.Drawing.Image)
Me.PictureBoxHeroCP.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom
Me.PictureBoxHeroCP.Dock = System.Windows.Forms.DockStyle.Fill
Me.PictureBoxHeroCP.Location = New System.Drawing.Point(102, 72)
Me.PictureBoxHeroCP.Margin = New System.Windows.Forms.Padding(0)
Me.PictureBoxHeroCP.Name = "PictureBoxHeroCP"
Me.PictureBoxHeroCP.Size = New System.Drawing.Size(358, 696)
Me.PictureBoxHeroCP.TabIndex = 2
Me.PictureBoxHeroCP.TabStop = False
'
'PrintDocumentCP
'
Me.PrintDocumentCP.DocumentName = "New Calculation - Calc Plumber"
'
'PrintDialogCP
'
Me.PrintDialogCP.Document = Me.PrintDocumentCP
Me.PrintDialogCP.UseEXDialog = True
'
'PrintPreviewDialogCP
'
Me.PrintPreviewDialogCP.AutoScrollMargin = New System.Drawing.Size(0, 0)
Me.PrintPreviewDialogCP.AutoScrollMinSize = New System.Drawing.Size(0, 0)
Me.PrintPreviewDialogCP.ClientSize = New System.Drawing.Size(400, 300)
Me.PrintPreviewDialogCP.Document = Me.PrintDocumentCP
Me.PrintPreviewDialogCP.Enabled = True
Me.PrintPreviewDialogCP.Icon = CType(resources.GetObject("PrintPreviewDialogCP.Icon"), System.Drawing.Icon)
Me.PrintPreviewDialogCP.Name = "PrintPreviewDialogCP"
Me.PrintPreviewDialogCP.ShowIcon = False
Me.PrintPreviewDialogCP.Visible = False
'
'ToolTipCP
'
Me.ToolTipCP.BackColor = System.Drawing.Color.FromArgb(CType(CType(207, Byte), Integer), CType(CType(152, Byte), Integer), CType(CType(110, Byte), Integer))
Me.ToolTipCP.ForeColor = System.Drawing.Color.FromArgb(CType(CType(51, Byte), Integer), CType(CType(51, Byte), Integer), CType(CType(51, Byte), Integer))
Me.ToolTipCP.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Info
Me.ToolTipCP.ToolTipTitle = "Information"
'
'FormMainCP
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 21.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(238, Byte), Integer), CType(CType(238, Byte), Integer), CType(CType(238, Byte), Integer))
Me.ClientSize = New System.Drawing.Size(1024, 768)
Me.Controls.Add(Me.TLPMainCP)
Me.Font = New System.Drawing.Font("Segoe UI", 16.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel, CType(0, Byte))
Me.ForeColor = System.Drawing.Color.FromArgb(CType(CType(51, Byte), Integer), CType(CType(51, Byte), Integer), CType(CType(51, Byte), Integer))
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MainMenuStrip = Me.MenuStripCP
Me.Margin = New System.Windows.Forms.Padding(4, 6, 4, 6)
Me.Name = "FormMainCP"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "CalcPlumber"
Me.TLPMainCP.ResumeLayout(False)
Me.TLPMainCP.PerformLayout()
Me.FLPTitleBarCP.ResumeLayout(False)
Me.FLPTitleBarCP.PerformLayout()
CType(Me.PictureBoxIconCP, System.ComponentModel.ISupportInitialize).EndInit()
Me.FLPTitleBarAltCP.ResumeLayout(False)
Me.MenuStripCP.ResumeLayout(False)
Me.MenuStripCP.PerformLayout()
Me.FLPFormCP.ResumeLayout(False)
Me.FLPFormCP.PerformLayout()
CType(Me.PictureBoxHeroCP, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
Friend WithEvents TLPMainCP As System.Windows.Forms.TableLayoutPanel
Friend WithEvents FLPTitleBarCP As System.Windows.Forms.FlowLayoutPanel
Friend WithEvents PictureBoxIconCP As System.Windows.Forms.PictureBox
Friend WithEvents FLPTitleBarAltCP As System.Windows.Forms.FlowLayoutPanel
Friend WithEvents ButtonCloseCP As System.Windows.Forms.Button
Friend WithEvents ButtonMaximizeCP As System.Windows.Forms.Button
Friend WithEvents ButtonMinimizeCP As System.Windows.Forms.Button
Friend WithEvents LabelTitleCP As System.Windows.Forms.Label
Friend WithEvents PictureBoxHeroCP As System.Windows.Forms.PictureBox
Friend WithEvents FLPFormCP As System.Windows.Forms.FlowLayoutPanel
Friend WithEvents LabelDesc1CP As System.Windows.Forms.Label
Friend WithEvents InputPlasticCP As System.Windows.Forms.TextBox
Friend WithEvents LabelDesc2CP As System.Windows.Forms.Label
Friend WithEvents InputCopperCP As System.Windows.Forms.TextBox
Friend WithEvents LabelDesc3CP As System.Windows.Forms.Label
Friend WithEvents InputLabourCP As System.Windows.Forms.TextBox
Friend WithEvents ButtonCalcCostCP As System.Windows.Forms.Button
Friend WithEvents PrintDocumentCP As System.Drawing.Printing.PrintDocument
Friend WithEvents PrintDialogCP As System.Windows.Forms.PrintDialog
Friend WithEvents PrintPreviewDialogCP As System.Windows.Forms.PrintPreviewDialog
Friend WithEvents MenuStripCP As System.Windows.Forms.MenuStrip
Friend WithEvents MenuItemFileCP As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents PrintToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents PrintPreviewToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents toolStripSeparator2 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents ExitToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents MenuItemHelpCP As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents SearchToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents toolStripSeparator5 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents AboutToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolTipCP As System.Windows.Forms.ToolTip
End Class
| {
"content_hash": "5c2b97560552b1823dcc62974d4b91cd",
"timestamp": "",
"source": "github",
"line_count": 482,
"max_line_length": 202,
"avg_line_length": 60.48547717842324,
"alnum_prop": 0.7112574603827948,
"repo_name": "SnowShock35/CalcPlumber",
"id": "39fce34147d477032268b884bad762960eef30a1",
"size": "29156",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CalcPlumber/CalcPlumber/FormMainCP.Designer.vb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Visual Basic",
"bytes": "68534"
}
],
"symlink_target": ""
} |
void save_session(const std::string& path);
void write_prompt(const std::string& lang, const std::string& pwd, const std::string& promptCh);
void write_info(const std::string& info,
const std::string& pwd,
const std::string& promptCh,
const std::string& str,
size_t& sPos,
const size_t& usableLength,
const size_t& linePos,
const size_t& bLinePos);
#if defined _WIN32 || defined _WIN64
#include <conio.h>
#else //*nix
#endif
int nsm_getch();
int rnbwcout(const std::string& str);
int rnbwcout(const std::set<std::string>& strs, const std::string& lolcatCmd);
int getline(const std::string& lang,
const bool& addPwd,
const std::string& promptCh,
const int& lolcatActive,
std::string& str,
bool trackLines,
const std::vector<std::string>& tabCompletionStrs);
#endif //GETLINE_H_
| {
"content_hash": "887bdfeaa4c91752f5fbc8c03bb23730",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 96,
"avg_line_length": 29.25,
"alnum_prop": 0.6089743589743589,
"repo_name": "nifty-site-manager/nsm",
"id": "ca736e7e70321ad6818b1e50aa08d8037f096f5d",
"size": "1105",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Getline.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "13226"
},
{
"name": "C",
"bytes": "2054009"
},
{
"name": "C++",
"bytes": "2271253"
},
{
"name": "Lua",
"bytes": "334901"
},
{
"name": "Makefile",
"bytes": "33705"
},
{
"name": "Roff",
"bytes": "2339"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
namespace AuthAzdo.Pages
{
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
public class ErrorModel : PageModel
{
public string RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
private readonly ILogger<ErrorModel> _logger;
public ErrorModel(ILogger<ErrorModel> logger)
{
_logger = logger;
}
public void OnGet()
{
RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
}
}
}
| {
"content_hash": "89a2d2ac3f3306d283f6d143afe2a5df",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 88,
"avg_line_length": 26.096774193548388,
"alnum_prop": 0.6786155747836835,
"repo_name": "jaredpar/random",
"id": "32d51ac7de972ee85fc12bb15a70fcd2e82d9fe5",
"size": "809",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dotnet/Razor/AuthAzdo/Pages/Error.cshtml.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP.NET",
"bytes": "100"
},
{
"name": "C#",
"bytes": "180238"
},
{
"name": "CSS",
"bytes": "5897"
},
{
"name": "Go",
"bytes": "7849"
},
{
"name": "HTML",
"bytes": "26598"
},
{
"name": "JavaScript",
"bytes": "12574"
},
{
"name": "PowerShell",
"bytes": "6923"
},
{
"name": "TSQL",
"bytes": "243"
}
],
"symlink_target": ""
} |
<?xml version='1.0'?>
<entity_stock_mvt_reason>
<stock_mvt_reason id='Increase'>
<name>Stijging</name>
</stock_mvt_reason>
<stock_mvt_reason id='Decrease'>
<name>Daling</name>
</stock_mvt_reason>
<stock_mvt_reason id='Customer_Order'>
<name>Klantenbestelling</name>
</stock_mvt_reason>
<stock_mvt_reason id='Regulation_following_an_inventory_of_stock'>
<name>Regeling na inventaris</name>
</stock_mvt_reason>
<stock_mvt_reason id='Regulation_following_an_inventory_of_stock_1'>
<name>Regeling na inventaris</name>
</stock_mvt_reason>
<stock_mvt_reason id='Transfer_to_another_warehouse'>
<name>Verplaatsing naar ander magazijn</name>
</stock_mvt_reason>
<stock_mvt_reason id='Transfer_from_another_warehouse'>
<name>Verplaatsing uit ander magazijn</name>
</stock_mvt_reason>
<stock_mvt_reason id='Supply_Order'>
<name>Bestelling</name>
</stock_mvt_reason>
</entity_stock_mvt_reason>
| {
"content_hash": "d2dd53abea83969447339fbdc0941823",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 70,
"avg_line_length": 35.074074074074076,
"alnum_prop": 0.7001055966209081,
"repo_name": "klebercode/prestashop",
"id": "60e15386bc78053dce3cd074d632e5005aa3c688",
"size": "947",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "rm-install/langs/nl/data/stock_mvt_reason.xml",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "2347"
},
{
"name": "CSS",
"bytes": "881626"
},
{
"name": "HTML",
"bytes": "535582"
},
{
"name": "JavaScript",
"bytes": "1902391"
},
{
"name": "PHP",
"bytes": "11597184"
},
{
"name": "Ruby",
"bytes": "1261"
},
{
"name": "Smarty",
"bytes": "2660900"
}
],
"symlink_target": ""
} |
using namespace std;
#include "sistema_informativo.h"
#include <cstdlib>
// #include <sstream>
// SistemaInformativo::SistemaInformativo() { }
int casuale(int min, int max) { return rand()%(max-min+1); }
void SistemaInformativo::addStanzaAlSistema(Stanza s) { lstanze.push_back(s); }
// prima di aggiungere una prenotazione, si controlla se c'è almeno una stanza
// come quella richiesta.
bool SistemaInformativo::checkDisponibilitaStanza(TipoStanza& ts) {
list <Stanza>::iterator lsti=lstanze.begin();
for (; lsti!=lstanze.end(); ++lsti) {
// sfrutto l'ereditarietà per fare il confronto tra una stanza e un tipoStanza
if (*lsti == ts) {
if ( lsti->isEmpty() ) {
return true;
}
}
}
// se tutte le stanze sono occupate o non esistono stanze del genere: false
return false;
}
void SistemaInformativo::addUtente(Utente u) { lutenti.push_back(u); }
bool SistemaInformativo::checkUtente(Utente& u) {
list <Utente>::iterator lu=lutenti.begin();
for (; lu!=lutenti.end(); ++lu) {
if (*lu == u)
return true;
}
return false;
}
// bisogna prima utilizzare checkUtente per assicurarsi che l'utente cercato esista.
Utente& SistemaInformativo::trovaUtente(Utente& u) {
list <Utente>::iterator lu=lutenti.begin();
for (; lu!=lutenti.end(); ++lu) {
if (*lu == u)
return *lu;
}
return u;
}
void SistemaInformativo::addPrenotazione(Utente& u, Prenotazione& p) {
if (this->checkUtente(u)) {
this->trovaUtente(u).prenota(p);
}
else {
cout << "Utente "; u.stampa();
cout << " non trovato. Prenotazione per il periodo ";
p.stampa();
cout << " non effettuata." << endl;
}
//lutenti.push_back(u);
}
void SistemaInformativo::addTipoStanzaAPrenotazione(Utente& u, Prenotazione& p, TipoStanza& ts) {
if (this->checkDisponibilitaStanza(ts)) {
if (u.esistePrenotazione(p)) {
u.trovaPrenotazione(p).addTipoStanza(ts);
cout << "Aggiunta tipologia di stanza "; ts.stampa();
cout << " alla prenotazione "; p.stampa();
cout << " dell'utente "; u.stampa(); cout << "." << endl;
}
else {
cout << "Prenotazione "; p.stampa();
cout << " non trovata per l'utente: "; u.stampa();
cout << "." << endl;
}
}
else {
cout << "La tipologia di stanza "; ts.stampa();
cout << " richiesta dall'utente "; u.stampa();
cout << " per la prenotazione "; p.stampa();
cout << " non esiste o non è più disponibile." << endl;
}
}
void SistemaInformativo::addPresenza(Utente& u, Presenza& p) {
if (this->checkUtente(u)) {
this->trovaUtente(u).presenza(p);
}
else {
cout << "Utente "; u.stampa();
cout << " non trovato. Presenza per il periodo ";
p.stampa(); cout << " non registrata." << endl;
}
}
void SistemaInformativo::randomInitStanze() {
for (int i=1; i<3; ++i) {
for (int j=1; j<15; ++j) {
// To randomize the numbers of the rooms.
if (casuale(0,3)%2==0) continue;
this->addStanzaAlSistema(Stanza((dimStanza)casuale(SINGOLA, SUITE),
casuale(1, 5),
(esposizioneStanza)casuale(SE, SO),
i*100+j,
casuale(10, 30),
casuale(10, 30)+10
)
);
}
}
}
void SistemaInformativo::randomInitUtentiPrenotazioniPresenze() {
Utente array_utenti[20];
for (int i=0; i<20; ++i) {
this->addUtente(array_utenti[i]);
}
list <Utente>::iterator lui=lutenti.begin();
for(; lui!=lutenti.end(); ++lui) {
Prenotazione p_temp("DATAprova", "2aDATAprova");
lui->prenota(p_temp);
Presenza pr_temp("DATAprovaPresenza", "2aDATAprovaPresenza", casuale(30, 60),
(strumPagamento)casuale(0, 3));
lui->presenza(pr_temp);
for (int j=0; j<4; ++j) {
Stanza s_temp((dimStanza)casuale(SINGOLA, SUITE),
casuale(1, 5), (esposizioneStanza)casuale(SE, SO),
casuale(101, 130), casuale(30, 40), casuale(40, 60)
);
lui->addTipoStanzaAPrenotazione(p_temp, s_temp);
if ( this->checkDisponibilitaStanza(s_temp) ) {
lui->addStanzaAPresenza(pr_temp, s_temp);
}
}
}
}
Utente* SistemaInformativo::getRandomUser() {
if (lutenti.size()==0) return NULL;
return &( *lutenti.begin() );
}
// list<Utente> PersonePresenti(SistemaInformativo& s) {
// list<Utente> temp;
// list<Utente>::iterator lui=s.lutenti.begin();
// for(; lui!=s.lutenti.end(); ++lui) {
// temp.push_back(*lui);
// }
// }
| {
"content_hash": "ca080c9206a1abc9b648435314179a03",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 97,
"avg_line_length": 25.933333333333334,
"alnum_prop": 0.639869128301005,
"repo_name": "bebosudo/2015-12-03_132059",
"id": "12e2a44ee96ac333a526a600530ba644eab50146",
"size": "4303",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sistema_informativo.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "14432"
}
],
"symlink_target": ""
} |
/*
* UltraCart Rest API V2
*
* UltraCart REST API Version 2
*
* OpenAPI spec version: 2.0.0
* Contact: [email protected]
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.ComponentModel.DataAnnotations;
using SwaggerDateConverter = com.ultracart.admin.v2.Client.SwaggerDateConverter;
namespace com.ultracart.admin.v2.Model
{
/// <summary>
/// CouponFreeItemsWithMixMatchPurchase
/// </summary>
[DataContract]
public partial class CouponFreeItemsWithMixMatchPurchase : IEquatable<CouponFreeItemsWithMixMatchPurchase>, IValidatableObject
{
/// <summary>
/// Initializes a new instance of the <see cref="CouponFreeItemsWithMixMatchPurchase" /> class.
/// </summary>
/// <param name="freeItem">The item id of the free item that will be received when the required mix and match group quantity is purchased..</param>
/// <param name="freeQuantity">The quantity of free item that will be received..</param>
/// <param name="limit">The limit of free items that may be received when purchasing multiple mix and match group items.</param>
/// <param name="requiredPurchaseMixAndMatchGroup">Required mix and match group that must be purchased for coupon to be valid.</param>
/// <param name="requiredPurchaseQuantity">Required quantity of mix and match group items that must be purchased for coupon to be valid.</param>
public CouponFreeItemsWithMixMatchPurchase(string freeItem = default(string), int? freeQuantity = default(int?), int? limit = default(int?), string requiredPurchaseMixAndMatchGroup = default(string), int? requiredPurchaseQuantity = default(int?))
{
this.FreeItem = freeItem;
this.FreeQuantity = freeQuantity;
this.Limit = limit;
this.RequiredPurchaseMixAndMatchGroup = requiredPurchaseMixAndMatchGroup;
this.RequiredPurchaseQuantity = requiredPurchaseQuantity;
}
/// <summary>
/// The item id of the free item that will be received when the required mix and match group quantity is purchased.
/// </summary>
/// <value>The item id of the free item that will be received when the required mix and match group quantity is purchased.</value>
[DataMember(Name="free_item", EmitDefaultValue=false)]
public string FreeItem { get; set; }
/// <summary>
/// The quantity of free item that will be received.
/// </summary>
/// <value>The quantity of free item that will be received.</value>
[DataMember(Name="free_quantity", EmitDefaultValue=false)]
public int? FreeQuantity { get; set; }
/// <summary>
/// The limit of free items that may be received when purchasing multiple mix and match group items
/// </summary>
/// <value>The limit of free items that may be received when purchasing multiple mix and match group items</value>
[DataMember(Name="limit", EmitDefaultValue=false)]
public int? Limit { get; set; }
/// <summary>
/// Required mix and match group that must be purchased for coupon to be valid
/// </summary>
/// <value>Required mix and match group that must be purchased for coupon to be valid</value>
[DataMember(Name="required_purchase_mix_and_match_group", EmitDefaultValue=false)]
public string RequiredPurchaseMixAndMatchGroup { get; set; }
/// <summary>
/// Required quantity of mix and match group items that must be purchased for coupon to be valid
/// </summary>
/// <value>Required quantity of mix and match group items that must be purchased for coupon to be valid</value>
[DataMember(Name="required_purchase_quantity", EmitDefaultValue=false)]
public int? RequiredPurchaseQuantity { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
/// <returns>String presentation of the object</returns>
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class CouponFreeItemsWithMixMatchPurchase {\n");
sb.Append(" FreeItem: ").Append(FreeItem).Append("\n");
sb.Append(" FreeQuantity: ").Append(FreeQuantity).Append("\n");
sb.Append(" Limit: ").Append(Limit).Append("\n");
sb.Append(" RequiredPurchaseMixAndMatchGroup: ").Append(RequiredPurchaseMixAndMatchGroup).Append("\n");
sb.Append(" RequiredPurchaseQuantity: ").Append(RequiredPurchaseQuantity).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
/// <summary>
/// Returns the JSON string presentation of the object
/// </summary>
/// <returns>JSON string presentation of the object</returns>
public virtual string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
/// <summary>
/// Returns true if objects are equal
/// </summary>
/// <param name="input">Object to be compared</param>
/// <returns>Boolean</returns>
public override bool Equals(object input)
{
return this.Equals(input as CouponFreeItemsWithMixMatchPurchase);
}
/// <summary>
/// Returns true if CouponFreeItemsWithMixMatchPurchase instances are equal
/// </summary>
/// <param name="input">Instance of CouponFreeItemsWithMixMatchPurchase to be compared</param>
/// <returns>Boolean</returns>
public bool Equals(CouponFreeItemsWithMixMatchPurchase input)
{
if (input == null)
return false;
return
(
this.FreeItem == input.FreeItem ||
(this.FreeItem != null &&
this.FreeItem.Equals(input.FreeItem))
) &&
(
this.FreeQuantity == input.FreeQuantity ||
(this.FreeQuantity != null &&
this.FreeQuantity.Equals(input.FreeQuantity))
) &&
(
this.Limit == input.Limit ||
(this.Limit != null &&
this.Limit.Equals(input.Limit))
) &&
(
this.RequiredPurchaseMixAndMatchGroup == input.RequiredPurchaseMixAndMatchGroup ||
(this.RequiredPurchaseMixAndMatchGroup != null &&
this.RequiredPurchaseMixAndMatchGroup.Equals(input.RequiredPurchaseMixAndMatchGroup))
) &&
(
this.RequiredPurchaseQuantity == input.RequiredPurchaseQuantity ||
(this.RequiredPurchaseQuantity != null &&
this.RequiredPurchaseQuantity.Equals(input.RequiredPurchaseQuantity))
);
}
/// <summary>
/// Gets the hash code
/// </summary>
/// <returns>Hash code</returns>
public override int GetHashCode()
{
unchecked // Overflow is fine, just wrap
{
int hashCode = 41;
if (this.FreeItem != null)
hashCode = hashCode * 59 + this.FreeItem.GetHashCode();
if (this.FreeQuantity != null)
hashCode = hashCode * 59 + this.FreeQuantity.GetHashCode();
if (this.Limit != null)
hashCode = hashCode * 59 + this.Limit.GetHashCode();
if (this.RequiredPurchaseMixAndMatchGroup != null)
hashCode = hashCode * 59 + this.RequiredPurchaseMixAndMatchGroup.GetHashCode();
if (this.RequiredPurchaseQuantity != null)
hashCode = hashCode * 59 + this.RequiredPurchaseQuantity.GetHashCode();
return hashCode;
}
}
/// <summary>
/// To validate all properties of the instance
/// </summary>
/// <param name="validationContext">Validation context</param>
/// <returns>Validation Result</returns>
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
yield break;
}
}
}
| {
"content_hash": "c8d1c2a7d67a0abfde7606525cedfa96",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 254,
"avg_line_length": 45.33160621761658,
"alnum_prop": 0.6133272373985599,
"repo_name": "UltraCart/rest_api_v2_sdk_csharp",
"id": "07b364e3b03b87e015c272d06cb1bd25ba9e8b1f",
"size": "8749",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com.ultracart.admin.v2/Model/CouponFreeItemsWithMixMatchPurchase.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "951"
},
{
"name": "C#",
"bytes": "11743806"
},
{
"name": "Shell",
"bytes": "4486"
}
],
"symlink_target": ""
} |
#include <errno.h>
#include <fcntl.h>
#include <linux/kd.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include "sol-log.h"
#include "sol-mainloop.h"
#include "sol-str-slice.h"
#include "sol-util.h"
#include "sol-vector.h"
#include "sol-coap.h"
#include "sol-oic-server.h"
static int console_fd;
static bool led_state;
static bool
get_scrolllock_led(void)
{
char value;
if (console_fd < 0)
return led_state;
if (ioctl(console_fd, KDGETLED, (char *)&value)) {
perror("Could not get led state");
return false;
}
return value & LED_SCR;
}
static bool
set_scrolllock_led(bool on)
{
char old;
if (console_fd < 0) {
printf("setting LED to %s\n", on ? "true" : "false");
led_state = on;
return true;
}
if (ioctl(console_fd, KDGETLED, (char *)&old)) {
perror("Could not get led state");
return false;
}
if (ioctl(console_fd, KDSETLED, on ? (old | LED_SCR) : (old & ~LED_SCR))) {
perror("Could not set led state");
return false;
}
return true;
}
static int
user_handle_get(void *data, struct sol_oic_request *request)
{
int r;
struct sol_oic_repr_field field;
struct sol_oic_response *response = NULL;
struct sol_oic_map_writer *output;
response = sol_oic_server_response_new(request);
SOL_NULL_CHECK_GOTO(response, error);
output = sol_oic_server_response_get_writer(response);
field = SOL_OIC_REPR_BOOLEAN("state", get_scrolllock_led());
r = sol_oic_map_append(output, &field);
SOL_INT_CHECK_GOTO(r, < 0, error);
field = SOL_OIC_REPR_INT("power", 13);
r = sol_oic_map_append(output, &field);
SOL_INT_CHECK_GOTO(r, < 0, error);
return sol_oic_server_send_response(request, response,
SOL_COAP_RESPONSE_CODE_CONTENT);
error:
if (response)
sol_oic_server_response_free(response);
return sol_oic_server_send_response(request, NULL,
SOL_COAP_RESPONSE_CODE_INTERNAL_ERROR);
}
static int
user_handle_put(void *data, struct sol_oic_request *request)
{
enum sol_coap_response_code code = SOL_COAP_RESPONSE_CODE_BAD_REQUEST;
enum sol_oic_map_loop_reason reason;
struct sol_oic_repr_field field;
struct sol_oic_map_reader iter;
struct sol_oic_map_reader *input;
input = sol_oic_server_request_get_reader(request);
SOL_OIC_MAP_LOOP(input, &field, &iter, reason) {
if (!strcmp(field.key, "state") && field.type == SOL_OIC_REPR_TYPE_BOOLEAN) {
if (set_scrolllock_led(field.v_boolean))
code = SOL_COAP_RESPONSE_CODE_OK;
else
code = SOL_COAP_RESPONSE_CODE_INTERNAL_ERROR;
sol_oic_repr_field_clear(&field);
goto end;
}
}
end:
return sol_oic_server_send_response(request, NULL, code);
}
static struct sol_oic_server_resource *
register_light_resource_type(
int (*handle_get)(void *data, struct sol_oic_request *request),
int (*handle_put)(void *data, struct sol_oic_request *request),
const char *resource_type)
{
/* This function will be auto-generated from the RAML definitions. */
struct sol_oic_resource_type rt = {
SOL_SET_API_VERSION(.api_version = SOL_OIC_RESOURCE_TYPE_API_VERSION, )
.resource_type = sol_str_slice_from_str(resource_type),
.interface = SOL_STR_SLICE_LITERAL("oc.mi.def"),
.get = {
.handle = handle_get /* User-provided. */
},
.put = {
.handle = handle_put /* User-provided. */
}
};
return sol_oic_server_register_resource(&rt, NULL,
SOL_OIC_FLAG_DISCOVERABLE | SOL_OIC_FLAG_OBSERVABLE | SOL_OIC_FLAG_ACTIVE);
}
int
main(int argc, char *argv[])
{
struct sol_oic_server_resource *res;
char old_led_state;
const char *resource_type = "core.light";
if (argc < 2) {
printf("No resource type specified, assuming core.light\n");
} else {
printf("Resource type specified: %s\n", argv[1]);
resource_type = argv[1];
}
sol_init();
res = register_light_resource_type(user_handle_get, user_handle_put,
resource_type);
if (!res) {
SOL_WRN("Could not register light resource type.");
return -1;
}
console_fd = open("/dev/console", O_RDWR);
if (console_fd < 0) {
SOL_WRN("Could not open '/dev/console', printing to stdout");
} else if (ioctl(console_fd, KDGETLED, (char *)&old_led_state)) {
SOL_ERR("Could not get the keyboard leds state");
return -1;
}
sol_run();
sol_oic_server_unregister_resource(res);
if (console_fd >= 0 && ioctl(console_fd, KDSETLED, old_led_state)) {
SOL_ERR("Could not return the leds to the old state");
return -1;
}
return 0;
}
| {
"content_hash": "133183e4c41e50135e1b8e697cdecd45",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 85,
"avg_line_length": 26.472826086956523,
"alnum_prop": 0.6123999178813385,
"repo_name": "wanghongjuan/soletta",
"id": "87d2214e534bc86c961d11d4820785ee27c2060c",
"size": "5547",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/samples/coap/oic-server.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "3347"
},
{
"name": "C",
"bytes": "5550294"
},
{
"name": "C++",
"bytes": "173664"
},
{
"name": "CSS",
"bytes": "3950"
},
{
"name": "HTML",
"bytes": "1623"
},
{
"name": "JavaScript",
"bytes": "119868"
},
{
"name": "Makefile",
"bytes": "62655"
},
{
"name": "NSIS",
"bytes": "1388"
},
{
"name": "Objective-C",
"bytes": "957"
},
{
"name": "Python",
"bytes": "230060"
},
{
"name": "Shell",
"bytes": "7287"
},
{
"name": "Smarty",
"bytes": "1158"
},
{
"name": "VimL",
"bytes": "748"
}
],
"symlink_target": ""
} |
<DIV NAME="detail" ID="detail" xmlns="http://www.w3.org/TR/REC-html40"><H3><A NAME='detail_ActivateTextItem'></A>Selenium ListBoxFunctions::<BIG>ActivateTextItem</BIG>
</H3> <TABLE><TR>
<TD class="borderStyle"><SPAN CLASS='Support' TITLE='Selenium1.0'>SE</SPAN></TD>
</TR></TABLE>
<DIV NAME="list" ID="short_desc"><short_desc xmlns="">
Routine to DblClick and Verify an item according to its text value.
</short_desc></DIV>
<BR/>
<DIV NAME="list" ID="detail_desc"><detailed_desc xmlns="">
Routine to DblClick and Verify an item according to its text value.
</detailed_desc><BR/>
</DIV>
<BR/>
<DIV NAME="list" ID="other">
<p><B>Fields: </B><SMALL>[ ]=Optional with Default Value</SMALL></p>
<code class="safs">
<OL start="5" ><LI>
<B>TextValue</B>
<BR/>
<DIV NAME="list" ID="short_desc"><short_desc xmlns="">
Case-sensitive text of node to DblClick and verify.
</short_desc></DIV>
<BR/>
<DIV NAME="list" ID="detail_desc"><detailed_desc xmlns="">
TextValue should contain the case-sensitive text item to DblClick and verify.
</detailed_desc><BR/>
</DIV>
</LI></OL ></code>
<br/>
<p><B>Examples:</B></p>
<code class="safs"><UL>
<LI>
<B><usage xmlns="">T, WINDOW, ListBox, ActivateTextItem , "AParticularUserID"</usage></B>
<BR/><DIV NAME="list" ID="short_desc"><short_desc xmlns="">
DblClicks "AParticularUserID" in the ListBox object.
</short_desc></DIV>
<BR/>
<DIV NAME="list" ID="detail_desc"><detailed_desc xmlns="">
Dblclicks "AParticularUserID" in the ListBox object.
The current value of the selection is then verified.
</detailed_desc><BR/>
</DIV>
</LI>
</UL>
</code>
<br/>
<A href="SAFSReferenceKey.htm" alt="Reference Legend or Key">
<SMALL><B>[How To Read This Reference]</B></SMALL>
</A>
<HR/>
</DIV>
</DIV>
| {
"content_hash": "9b2ba3c1c09805c61decf5e7ea4dd4b9",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 167,
"avg_line_length": 36.81132075471698,
"alnum_prop": 0.6007175807278319,
"repo_name": "kid551/safsdev.test.github.io",
"id": "b76cf5f2ffbb8489388b5a9a7c13761a368b9ba3",
"size": "1951",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "keyref/SeleniumListBoxFunctionsActivateTextItem.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "27646"
},
{
"name": "HTML",
"bytes": "27805169"
},
{
"name": "JavaScript",
"bytes": "2769"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
<profile-state>
<expanded-state>
<State>
<id />
</State>
<State>
<id>Android > Lint > Correctness</id>
</State>
<State>
<id>Android > Lint > Performance</id>
</State>
<State>
<id>Java</id>
</State>
<State>
<id>Threading issuesJava</id>
</State>
</expanded-state>
<selected-state>
<State>
<id>Android</id>
</State>
</selected-state>
</profile-state>
</entry>
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
<OptionsSetting value="true" id="Remove" />
<OptionsSetting value="true" id="Checkout" />
<OptionsSetting value="true" id="Update" />
<OptionsSetting value="true" id="Status" />
<OptionsSetting value="true" id="Edit" />
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<component name="masterDetails">
<states>
<state key="ScopeChooserConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project> | {
"content_hash": "fcdf41b178655878e1a0351cecde134d",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 176,
"avg_line_length": 37.50561797752809,
"alnum_prop": 0.5949670461354104,
"repo_name": "R3ddyJ/weathernew",
"id": "f33133e8d37423103b5091a6ca4090e3b7925700",
"size": "3338",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Weather/.idea/misc.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "74001"
}
],
"symlink_target": ""
} |
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import {RouterModule, Routes} from '@angular/router';
import { AppComponent } from './app.component';
import { NavbarComponent } from './components/navbar/navbar.component';
import { LoginComponent } from './components/login/login.component';
import { RegisterComponent } from './components/register/register.component';
import { HomeComponent } from './components/home/home.component';
import { DashboardComponent } from './components/dashboard/dashboard.component';
import { ProfileComponent } from './components/profile/profile.component';
import { ValidateService } from './services/validate.service';
import { AuthService } from './services/auth.service';
import { FlashMessagesModule } from 'angular2-flash-messages';
import { AuthGuard } from './guards/auth.guard';
const appRoutes: Routes = [
{path:'', component: HomeComponent},
{path:'register', component: RegisterComponent},
{path:'login', component: LoginComponent},
{path:'dashboard', component: DashboardComponent, canActivate: [AuthGuard]},
{path:'profile', component: ProfileComponent, canActivate: [AuthGuard]}
]
@NgModule({
declarations: [
AppComponent,
NavbarComponent,
LoginComponent,
RegisterComponent,
HomeComponent,
DashboardComponent,
ProfileComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
RouterModule.forRoot(appRoutes),
FlashMessagesModule
],
providers: [ValidateService, AuthService, AuthGuard],
bootstrap: [AppComponent]
})
export class AppModule { }
| {
"content_hash": "1829b893f33d9636b386540aa8441c79",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 80,
"avg_line_length": 35.6875,
"alnum_prop": 0.7355516637478109,
"repo_name": "apostolnikov/yet-another-twitter-clone",
"id": "aa63ff96fa5f92342e59e73491b1c419c63f4c9a",
"size": "1713",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "macros-chef/angular-src/src/app/app.module.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "80"
},
{
"name": "HTML",
"bytes": "3833"
},
{
"name": "JavaScript",
"bytes": "6765"
},
{
"name": "TypeScript",
"bytes": "19978"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".DetailsActivity"
tools:showIn="@layout/activity_detail">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:id="@+id/title_container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/title_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/text_margin">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/text_margin"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@android:color/white" />
<TextView
android:id="@+id/date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/text_margin"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/semi_transparent_white" />
</LinearLayout>
</FrameLayout>
<LinearLayout
android:id="@+id/details_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/text_margin"
android:layout_marginStart="@dimen/text_margin"
android:text="@string/section_1"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/text_margin"
android:layout_marginTop="@dimen/text_margin"
android:text="@string/some_informations" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/text_margin"
android:layout_marginTop="@dimen/text_margin"
android:text="@string/section_2"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/text_margin"
android:text="@string/large_text" />
</LinearLayout>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
| {
"content_hash": "21774ebe35e1a3f7eda54fa252f3a83d",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 102,
"avg_line_length": 42.51190476190476,
"alnum_prop": 0.5796695603472417,
"repo_name": "Jaouan/Article-Details-Transition-Example",
"id": "5362bc9fe088f9356bbf1f223a2cf27191c861b7",
"size": "3571",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pop-from-item-example/src/main/res/layout/content_detail.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "28174"
}
],
"symlink_target": ""
} |
layout: model
title: Translate Urdu to English Pipeline
author: John Snow Labs
name: translate_ur_en
date: 2021-06-04
tags: [open_source, pipeline, seq2seq, translation, ur, en, xx, multilingual]
task: Translation
language: xx
edition: Spark NLP 3.1.0
spark_version: 3.0
supported: true
article_header:
type: cover
use_language_switcher: "Python-Scala-Java"
---
## Description
Marian is an efficient, free Neural Machine Translation framework written in pure C++ with minimal dependencies. It is mainly being developed by the Microsoft Translator team. Many academic (most notably the University of Edinburgh and in the past the Adam Mickiewicz University in Poznań) and commercial contributors help with its development.
It is currently the engine behind the Microsoft Translator Neural Machine Translation services and being deployed by many companies, organizations and research projects (see below for an incomplete list).
source languages: ur
target languages: en
{:.btn-box}
[Live Demo](https://demo.johnsnowlabs.com/public/TRANSLATION_MARIAN/){:.button.button-orange}
[Open in Colab](https://colab.research.google.com/github/JohnSnowLabs/spark-nlp-workshop/blob/master/tutorials/streamlit_notebooks/TRANSLATION_MARIAN.ipynb){:.button.button-orange.button-orange-trans.co.button-icon}
[Download](https://s3.amazonaws.com/auxdata.johnsnowlabs.com/public/models/translate_ur_en_xx_3.1.0_2.4_1622840557086.zip){:.button.button-orange.button-orange-trans.arr.button-icon}
## How to use
<div class="tabs-box" markdown="1">
{% include programmingLanguageSelectScalaPythonNLU.html %}
```python
from sparknlp.pretrained import PretrainedPipeline
pipeline = PretrainedPipeline("translate_ur_en", lang = "xx")
pipeline.annotate("Your sentence to translate!")
```
```scala
import com.johnsnowlabs.nlp.pretrained.PretrainedPipeline
val pipeline = new PretrainedPipeline("translate_ur_en", lang = "xx")
pipeline.annotate("Your sentence to translate!")
```
{:.nlu-block}
```python
import nlu
text = ["text to translate"]
translate_df = nlu.load('xx.Urdu.translate_to.English').predict(text, output_level='sentence')
translate_df
```
</div>
{:.model-param}
## Model Information
{:.table-model}
|---|---|
|Model Name:|translate_ur_en|
|Type:|pipeline|
|Compatibility:|Spark NLP 3.1.0+|
|License:|Open Source|
|Edition:|Official|
|Language:|xx|
## Data Source
[https://github.com/Helsinki-NLP/OPUS-MT-train/tree/master/models](https://github.com/Helsinki-NLP/OPUS-MT-train/tree/master/models)
## Included Models
- DocumentAssembler
- SentenceDetectorDLModel
- MarianTransformer | {
"content_hash": "73f9af8183fae95e6749e574df5d458f",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 344,
"avg_line_length": 32.734177215189874,
"alnum_prop": 0.7718484145398299,
"repo_name": "JohnSnowLabs/spark-nlp",
"id": "db4d533ae51c845140653e1a96a9763f1a0bfddd",
"size": "2591",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/_posts/maziyarpanahi/2021-06-04-translate_ur_en_xx.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "14452"
},
{
"name": "Java",
"bytes": "223289"
},
{
"name": "Makefile",
"bytes": "819"
},
{
"name": "Python",
"bytes": "1694517"
},
{
"name": "Scala",
"bytes": "4116435"
},
{
"name": "Shell",
"bytes": "5286"
}
],
"symlink_target": ""
} |
/**
* @overview
* Base configuration options
*
* @since 0.1.0
*/
import path from 'path';
export default {
gamePageURL: 'http://www.dmm.com/netgame/social/-/gadgets/=/app_id=854854/',
rootEventName: 'kancolledata',
rootEventNode: 'body',
apiDataPrefix: 'svdata=',
pathPrefix: /.*\/kcsapi/,
gameSwfPrefix: /kcs\/mainD2/,
rootDir: path.resolve('..'),
configDir: path.resolve('../etc'),
gameConfigFile: 'dockyard.json'
};
| {
"content_hash": "635746f28e2f3d5a278ae25d3e399984",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 78,
"avg_line_length": 23.36842105263158,
"alnum_prop": 0.6576576576576577,
"repo_name": "rensouhou/dockyard-app",
"id": "bcf73bbfdcfae3d6d6320759c1f43fc875924565",
"size": "444",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/config.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5149"
},
{
"name": "HTML",
"bytes": "778"
},
{
"name": "JavaScript",
"bytes": "168821"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:background="#8000"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:text="空气质量"
android:textColor="#fff"
android:textSize="20sp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
>
<TextView
android:id="@+id/aqi_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#fff"
android:textSize="40sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="AQI指数"
android:textColor="#fff"
/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
>
<TextView
android:id="@+id/pm25_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColor="#fff"
android:textSize="40sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="PM2.5指数"
android:textColor="#fff"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</LinearLayout> | {
"content_hash": "3245d2a2b5786fde5763fb7f2e69d013",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 62,
"avg_line_length": 35.529411764705884,
"alnum_prop": 0.5086092715231788,
"repo_name": "TanXiao1997/coolweather",
"id": "f6f62884e75c46910c616d4f7b7ed87542db5964",
"size": "3036",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/layout/aqi.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "33312"
}
],
"symlink_target": ""
} |
require 'minitest/autorun'
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')
require 'nagios-herald'
require 'nagios-herald/config'
require 'nagios-herald/executor'
require 'nagios-herald/formatters/base'
# Test Formatter::CheckMemory.
class TestFormatterCheckMemory < MiniTest::Unit::TestCase
# TODO: We need a similar set of tests for RECOVERY emails.
# Initial setup before we execute tests
def setup
@options = {}
@options[:message_type] = 'EMAIL'
@options[:nagios_url] = "http://nagios.example.com"
@options[:formatter_name] = 'check_memory'
env_file = File.join(File.dirname(__FILE__), '..', '..', 'env_files', 'check_memory.CRITICAL')
NagiosHerald::Executor.new.load_env_from_file(env_file) # load an env file for testing
NagiosHerald::Executor.new.load_formatters
NagiosHerald::Executor.new.load_messages
formatter_class = NagiosHerald::Formatter.formatters[@options[:formatter_name]]
@formatter = formatter_class.new(@options)
end
def teardown
# make certain we don't leave tons of empty temp dirs behind
@formatter.clean_sandbox
end
# Test that we have a new NagiosHerald::Formatter object.
def test_new_formatter
assert_instance_of NagiosHerald::Formatter::CheckMemory, @formatter
end
def test_add_content_basic
@formatter.add_text('test_add_content', 'This is test text')
assert_equal 'This is test text', @formatter.content[:text][:test_add_content]
@formatter.add_html('test_add_content', '<b>This is test HTML</b>')
assert_equal '<b>This is test HTML</b>', @formatter.content[:html][:test_add_content]
@formatter.generate_subject
assert_equal "PROBLEM Service web.example.com/Memory is CRITICAL", @formatter.content[:subject]
attachment_name = "#{@formatter.sandbox}/cat.gif"
@formatter.add_attachment(attachment_name)
assert @formatter.content[:attachments].include?(attachment_name), "Failed to attach #{attachment_name} to content hash."
end
def test_action_url
@formatter.action_url
assert_equal "<b>Action URL</b>: http://runbook.example.com/disk_space_alerts.html<br><br>", @formatter.content[:html][:action_url]
assert_equal "Action URL: http://runbook.example.com/disk_space_alerts.html\n\n", @formatter.content[:text][:action_url]
end
def test_host_info
@formatter.host_info
assert_equal "<br><b>Host</b>: web.example.com <b>Service</b>: Memory<br/><br>", @formatter.content[:html][:host_info]
assert_equal "Host: web.example.com Service: Memory\n\n", @formatter.content[:text][:host_info]
end
def test_state_info
@formatter.state_info
assert_equal "State is now: <b><font style='color:red'>CRITICAL</font></b> for <b>0d 0h 5m 3s</b> (was CRITICAL) after <b>3 / 3</b> checks<br/><br>", @formatter.content[:html][:state_info]
assert_equal "State is now: CRITICAL for 0d 0h 5m 3s (was CRITICAL) after 3 / 3 checks\n\n", @formatter.content[:text][:state_info]
end
def test_notification_info
@formatter.notification_info
assert_equal "Notification sent at: Thu May 14 21:06:38 UTC 2014 (notification number 1)<br><br>", @formatter.content[:html][:notification_info]
assert_equal "Notification sent at: Thu May 14 21:06:38 UTC 2014 (notification number 1)\n\n", @formatter.content[:text][:notification_info]
end
def test_additional_info
@formatter.additional_info
assert_equal "<b>Additional Info</b>: Memory CRITICAL - 98.1% used (22.986 GB total plus 0.171 GB cached, 0.098 GB reclaimable)<br><br>", @formatter.content[:html][:additional_info]
assert_equal "Additional Info: Memory CRITICAL - 98.1% used (22.986 GB total plus 0.171 GB cached, 0.098 GB reclaimable)\n\n", @formatter.content[:text][:additional_info]
end
def test_additional_details
@formatter.additional_details
puts
assert_equal "<b>Additional Details</b>:<pre><br>TOP 5 PROCESSES BY MEMORY USAGE:<br> %MEM RSS USER PID COMMAND<br><font color='red'> 2.4 1231696 larry 6658 tmux</font><br><font color='orange'> 1.5 777204 moe 32234 tmux/tmux -CC</font><br><font color='orange'> 0.8 399964 curly 12161 /usr/sbin/gmond</font><br><font color='orange'> 0.7 384772 shep 1945 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/web.example.com.err --pid-file=/var/lib/mysql/web.example.com.pid</font><br><font color='orange'> 0.7 355148 root 1245 SCREEN</font><br></pre><br>", @formatter.content[:html][:additional_details]
assert_equal "Additional Details:\n#TOP 5 PROCESSES BY MEMORY USAGE:\n %MEM RSS USER PID COMMAND\n 2.4 1231696 larry 6658 tmux\n 1.5 777204 moe 32234 tmux/tmux -CC\n 0.8 399964 curly 12161 /usr/sbin/gmond\n 0.7 384772 shep 1945 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/web.example.com.err --pid-file=/var/lib/mysql/web.example.com.pid\n 0.7 355148 root 1245 SCREEN\n\n\n", @formatter.content[:text][:additional_details]
end
def test_notes
@formatter.notes
# There are no notes in the example environment variables.
assert_equal "", @formatter.content[:html][:notes]
assert_equal "", @formatter.content[:text][:notes]
end
def test_action_url
@formatter.action_url
assert_equal "", @formatter.content[:html][:action_url]
assert_equal "", @formatter.content[:text][:action_url]
end
def test_short_state_detail
@formatter.short_state_detail
assert_equal "Memory CRITICAL - 98.1% used (22.986 GB total plus 0.171 GB cached, 0.098 GB reclaimable)<br>", @formatter.content[:html][:short_state_detail]
assert_equal "Memory CRITICAL - 98.1% used (22.986 GB total plus 0.171 GB cached, 0.098 GB reclaimable)\n", @formatter.content[:text][:short_state_detail]
end
def test_recipients_email_link
@formatter.recipients_email_link
assert_equal "Sent to ops<br><br>", @formatter.content[:html][:recipients_email_link]
assert_equal "Sent to ops\n\n", @formatter.content[:text][:recipients_email_link]
end
def test_ack_info
@formatter.ack_info
assert_equal "At Thu May 14 21:06:38 UTC 2014 ops acknowledged web.example.com/Memory.<br><br>Comment: ", @formatter.content[:html][:ack_info]
assert_equal "At Thu May 14 21:06:38 UTC 2014 ops acknowledged web.example.com/Memory.\n\nComment: ", @formatter.content[:text][:ack_info]
end
def test_short_ack_info
@formatter.short_ack_info
assert_equal "ops ack'd Memory on web.example.com.<br>", @formatter.content[:html][:short_ack_info]
assert_equal "ops ack'd Memory on web.example.com.\n", @formatter.content[:text][:short_ack_info]
end
def test_alert_ack_url
@formatter.alert_ack_url
assert_equal "Acknowledge this alert: http://nagios.example.com/nagios/cgi-bin/cmd.cgi?cmd_typ=34&host=web.example.com&service=Memory<br>Alternatively, <b>reply</b> to this message with the word '<b><font color='green'>ack</font></b>' in the body to acknowledge the alert.<br>", @formatter.content[:html][:alert_ack_url]
assert_equal "Acknowledge this alert: http://nagios.example.com/nagios/cgi-bin/cmd.cgi?cmd_typ=34&host=web.example.com&service=Memory\nAlternatively, reply to this message with the word 'ack' in the body to acknowledge the alert.\n", @formatter.content[:text][:alert_ack_url]
end
def test_clean_sandbox
@formatter.clean_sandbox
assert !File.directory?(@formatter.sandbox)
end
end
| {
"content_hash": "5bb6975d5ab49de8d248ba12b8bcc1bc",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 787,
"avg_line_length": 56.925925925925924,
"alnum_prop": 0.6936890045543266,
"repo_name": "etsy/nagios-herald",
"id": "7db40b3ee799f3491eab9a575c508d2e5b9e533b",
"size": "7685",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/unit/formatters/test_check_memory.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Perl",
"bytes": "6108"
},
{
"name": "Python",
"bytes": "11211"
},
{
"name": "Ruby",
"bytes": "162638"
},
{
"name": "Shell",
"bytes": "8094"
}
],
"symlink_target": ""
} |
//
namespace Alachisoft.NosDB.Core.Storage.Operations
{
public class DeleteResult<T> : OperationResult<T>
{
private T _document;
public T Document { get { return _document; } set { _document = value; } }
}
} | {
"content_hash": "e7d999f262485b75fd202c09315cbc77",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 82,
"avg_line_length": 21.636363636363637,
"alnum_prop": 0.6260504201680672,
"repo_name": "Alachisoft/NosDB",
"id": "f5ddee5e6fb2c6f0a571088f9804bafa0840da45",
"size": "882",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Src/Core/Storage/Operations/DeleteResult.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1476"
},
{
"name": "C",
"bytes": "849"
},
{
"name": "C#",
"bytes": "9580646"
},
{
"name": "C++",
"bytes": "11685"
},
{
"name": "HTML",
"bytes": "164756"
},
{
"name": "PowerShell",
"bytes": "12662"
},
{
"name": "Protocol Buffer",
"bytes": "19475"
}
],
"symlink_target": ""
} |
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary {
display:block
}
audio, canvas, video {
display:inline-block
}
audio:not([controls]) {
display:none;
height:0
}
[hidden], template {
display:none
}
html {
font-family:sans-serif;
-webkit-text-size-adjust:100%;
-ms-text-size-adjust:100%
}
body {
margin:0
}
a {
background:0 0
}
a:active, a:hover {
outline:0
}
h1 {
margin:.67em 0
}
b, strong {
font-weight:700
}
dfn {
font-style:italic
}
hr {
height:0;
-moz-box-sizing:content-box;
box-sizing:content-box
}
mark {
color:#000;
background:#ff0
}
code, kbd, pre, samp {
font-size:1em
}
pre {
white-space:pre-wrap
}
q {
quotes:"\201C" "\201D" "\2018" "\2019"
}
sub, sup {
position:relative;
font-size:75%;
line-height:0;
vertical-align:baseline
}
sup {
top:-.5em
}
sub {
bottom:-.25em
}
img {
border:0
}
svg:not(:root) {
overflow:hidden
}
figure {
margin:0
}
button, input, select, textarea {
margin:0
}
button, select {
text-transform:none
}
button, html input[type=button], input[type=reset], input[type=submit] {
cursor:pointer;
-webkit-appearance:button
}
button[disabled], html input[disabled] {
cursor:default
}
input[type=checkbox], input[type=radio] {
padding:0;
box-sizing:border-box
}
input[type=search] {
-webkit-appearance:textfield
}
input[type=search]::-webkit-search-cancel-button, input[type=search]::-webkit-search-decoration {
-webkit-appearance:none
}
button::-moz-focus-inner, input::-moz-focus-inner {
padding:0;
border:0
}
textarea {
overflow:auto;
vertical-align:top
}
table {
border-collapse:collapse;
border-spacing:0
}
@media print {
* {
color:#000!important;
text-shadow:none!important;
background:transparent!important;
box-shadow:none!important
}
a, a:visited {
text-decoration:underline
}
a[href]:after {
content:" (" attr(href) ")"
}
abbr[title]:after {
content:" (" attr(title) ")"
}
a[href^="javascript:"]:after, a[href^="#"]:after {
content:""
}
blockquote, pre {
border:1px solid #999;
page-break-inside:avoid
}
thead {
display:table-header-group
}
img, tr {
page-break-inside:avoid
}
img {
max-width:100%!important
}
@page {
margin:2cm .5cm
}
h2, h3, p {
orphans:3;
widows:3
}
h2, h3 {
page-break-after:avoid
}
select {
background:#fff!important
}
.navbar {
display:none
}
.table td, .table th {
background-color:#fff!important
}
.btn>.caret, .dropup>.btn>.caret {
border-top-color:#000!important
}
.label {
border:1px solid #000
}
.table {
border-collapse:collapse!important
}
.table-bordered td, .table-bordered th {
border:1px solid #ddd!important
}
}
*, :after, :before {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box
}
html {
font-size:62.5%;
-webkit-tap-highlight-color:rgba(0, 0, 0, 0)
}
body {
font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;
font-size:14px;
line-height:1.428571429;
color:#333;
background-color:#fff
}
button, input, select, textarea {
font-family:inherit;
font-size:inherit;
line-height:inherit
}
a {
color:#428bca;
text-decoration:none
}
a:focus, a:hover {
color:#2a6496;
text-decoration:underline
}
a:focus {
outline:5px auto -webkit-focus-ring-color;
outline-offset:-2px
}
img {
vertical-align:middle
}
.img-responsive {
display:block;
height:auto;
max-width:100%
}
.img-rounded {
border-radius:6px
}
.img-thumbnail {
display:inline-block;
height:auto;
max-width:100%;
padding:4px;
line-height:1.428571429;
background-color:#fff;
border:1px solid #ddd;
border-radius:4px;
-webkit-transition:all .2s ease-in-out;
transition:all .2s ease-in-out
}
.img-circle {
border-radius:50%
}
hr {
margin-top:20px;
margin-bottom:20px;
border:0;
border-top:1px solid #eee
}
.sr-only {
position:absolute;
width:1px;
height:1px;
padding:0;
margin:-1px;
overflow:hidden;
clip:rect(0,0,0,0);
border:0
}
.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight:500;
line-height:1.1;
color:inherit
}
.h1 .small, .h1 small, .h2 .small, .h2 small, .h3 .small, .h3 small, .h4 .small, .h4 small, .h5 .small, .h5 small, .h6 .small, .h6 small, h1 .small, h1 small, h2 .small, h2 small, h3 .small, h3 small, h4 .small, h4 small, h5 .small, h5 small, h6 .small, h6 small {
font-weight:400;
line-height:1;
color:#999
}
h1, h2, h3 {
margin-top:20px;
margin-bottom:10px
}
h1 .small, h1 small, h2 .small, h2 small, h3 .small, h3 small {
font-size:65%
}
h4, h5, h6 {
margin-top:10px;
margin-bottom:10px
}
h4 .small, h4 small, h5 .small, h5 small, h6 .small, h6 small {
font-size:75%
}
.h1, h1 {
font-size:36px
}
.h2, h2 {
font-size:30px
}
.h3, h3 {
font-size:24px
}
.h4, h4 {
font-size:18px
}
.h5, h5 {
font-size:14px
}
.h6, h6 {
font-size:12px
}
p {
margin:0 0 10px
}
.lead {
margin-bottom:20px;
font-size:16px;
font-weight:200;
line-height:1.4
}
@media(min-width:768px) {
.lead {
font-size:21px
}
}
.small, small {
font-size:85%
}
cite {
font-style:normal
}
.text-muted {
color:#999
}
.text-primary {
color:#428bca
}
.text-primary:hover {
color:#3071a9
}
.text-warning {
color:#8a6d3b
}
.text-warning:hover {
color:#66512c
}
.text-danger {
color:#a94442
}
.text-danger:hover {
color:#843534
}
.text-success {
color:#3c763d
}
.text-success:hover {
color:#2b542c
}
.text-info {
color:#31708f
}
.text-info:hover {
color:#245269
}
.text-left {
text-align:left
}
.text-right {
text-align:right
}
.text-center {
text-align:center
}
.page-header {
padding-bottom:9px;
margin:40px 0 20px;
border-bottom:1px solid #eee
}
ol, ul {
margin-top:0;
margin-bottom:10px
}
ol ol, ol ul, ul ol, ul ul {
margin-bottom:0
}
.list-inline, .list-unstyled {
padding-left:0;
list-style:none
}
.list-inline>li {
display:inline-block;
padding-right:5px;
padding-left:5px
}
.list-inline>li:first-child {
padding-left:0
}
dl {
margin-top:0;
margin-bottom:20px
}
dd, dt {
line-height:1.428571429
}
dt {
font-weight:700
}
dd {
margin-left:0
}
@media(min-width:768px) {
.dl-horizontal dt {
float:left;
width:160px;
overflow:hidden;
clear:left;
text-align:right;
text-overflow:ellipsis;
white-space:nowrap
}
.dl-horizontal dd {
margin-left:180px
}
.dl-horizontal dd:after, .dl-horizontal dd:before {
display:table;
content:" "
}
.dl-horizontal dd:after {
clear:both
}
}
abbr[data-original-title], abbr[title] {
cursor:help;
border-bottom:1px dotted #999
}
.initialism {
font-size:90%;
text-transform:uppercase
}
blockquote {
padding:10px 20px;
margin:0 0 20px;
border-left:5px solid #eee
}
blockquote p {
font-size:17.5px;
font-weight:300;
line-height:1.25
}
blockquote p:last-child {
margin-bottom:0
}
blockquote .small, blockquote small {
display:block;
line-height:1.428571429;
color:#999
}
blockquote .small:before, blockquote small:before {
content:'\2014 \00A0'
}
blockquote.pull-right {
padding-right:15px;
padding-left:0;
border-right:5px solid #eee;
border-left:0
}
blockquote.pull-right .small, blockquote.pull-right p, blockquote.pull-right small {
text-align:right
}
blockquote.pull-right .small:before, blockquote.pull-right small:before {
content:''
}
blockquote.pull-right .small:after, blockquote.pull-right small:after {
content:'\00A0 \2014'
}
blockquote:after, blockquote:before {
content:""
}
address {
margin-bottom:20px;
font-style:normal;
line-height:1.428571429
}
code, kbd, pre, samp {
font-family:Menlo, Monaco, Consolas, "Courier New", monospace
}
code {
padding:2px 4px;
font-size:90%;
color:#c7254e;
white-space:nowrap;
background-color:#f9f2f4;
border-radius:4px
}
pre {
display:block;
padding:9.5px;
margin:0 0 10px;
font-size:13px;
line-height:1.428571429;
color:#333;
word-break:break-all;
word-wrap:break-word;
background-color:#f5f5f5;
border:1px solid #ccc;
border-radius:4px
}
pre code {
padding:0;
font-size:inherit;
color:inherit;
white-space:pre-wrap;
background-color:transparent;
border-radius:0
}
.pre-scrollable {
max-height:340px;
overflow-y:scroll
}
.container {
padding-right:15px;
padding-left:15px;
margin-right:auto;
margin-left:auto
}
.container:after, .container:before {
display:table;
content:" "
}
.container:after {
clear:both
}
@media(min-width:768px) {
.container {
width:750px
}
}
@media(min-width:992px) {
.container {
width:970px
}
}
@media(min-width:1200px) {
.container {
width:1170px
}
}
.row {
margin-right:-15px;
margin-left:-15px
}
.row:after, .row:before {
display:table;
content:" "
}
.row:after {
clear:both
}
.col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9 {
position:relative;
min-height:1px;
padding-right:15px;
padding-left:15px
}
.col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9 {
float:left
}
.col-xs-12 {
width:100%
}
.col-xs-11 {
width:91.66666666666666%
}
.col-xs-10 {
width:83.33333333333334%
}
.col-xs-9 {
width:75%
}
.col-xs-8 {
width:66.66666666666666%
}
.col-xs-7 {
width:58.333333333333336%
}
.col-xs-6 {
width:50%
}
.col-xs-5 {
width:41.66666666666667%
}
.col-xs-4 {
width:33.33333333333333%
}
.col-xs-3 {
width:25%
}
.col-xs-2 {
width:16.666666666666664%
}
.col-xs-1 {
width:8.333333333333332%
}
.col-xs-pull-12 {
right:100%
}
.col-xs-pull-11 {
right:91.66666666666666%
}
.col-xs-pull-10 {
right:83.33333333333334%
}
.col-xs-pull-9 {
right:75%
}
.col-xs-pull-8 {
right:66.66666666666666%
}
.col-xs-pull-7 {
right:58.333333333333336%
}
.col-xs-pull-6 {
right:50%
}
.col-xs-pull-5 {
right:41.66666666666667%
}
.col-xs-pull-4 {
right:33.33333333333333%
}
.col-xs-pull-3 {
right:25%
}
.col-xs-pull-2 {
right:16.666666666666664%
}
.col-xs-pull-1 {
right:8.333333333333332%
}
.col-xs-pull-0 {
right:0
}
.col-xs-push-12 {
left:100%
}
.col-xs-push-11 {
left:91.66666666666666%
}
.col-xs-push-10 {
left:83.33333333333334%
}
.col-xs-push-9 {
left:75%
}
.col-xs-push-8 {
left:66.66666666666666%
}
.col-xs-push-7 {
left:58.333333333333336%
}
.col-xs-push-6 {
left:50%
}
.col-xs-push-5 {
left:41.66666666666667%
}
.col-xs-push-4 {
left:33.33333333333333%
}
.col-xs-push-3 {
left:25%
}
.col-xs-push-2 {
left:16.666666666666664%
}
.col-xs-push-1 {
left:8.333333333333332%
}
.col-xs-push-0 {
left:0
}
.col-xs-offset-12 {
margin-left:100%
}
.col-xs-offset-11 {
margin-left:91.66666666666666%
}
.col-xs-offset-10 {
margin-left:83.33333333333334%
}
.col-xs-offset-9 {
margin-left:75%
}
.col-xs-offset-8 {
margin-left:66.66666666666666%
}
.col-xs-offset-7 {
margin-left:58.333333333333336%
}
.col-xs-offset-6 {
margin-left:50%
}
.col-xs-offset-5 {
margin-left:41.66666666666667%
}
.col-xs-offset-4 {
margin-left:33.33333333333333%
}
.col-xs-offset-3 {
margin-left:25%
}
.col-xs-offset-2 {
margin-left:16.666666666666664%
}
.col-xs-offset-1 {
margin-left:8.333333333333332%
}
.col-xs-offset-0 {
margin-left:0
}
@media(min-width:768px) {
.col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9 {
float:left
}
.col-sm-12 {
width:100%
}
.col-sm-11 {
width:91.66666666666666%
}
.col-sm-10 {
width:83.33333333333334%
}
.col-sm-9 {
width:75%
}
.col-sm-8 {
width:66.66666666666666%
}
.col-sm-7 {
width:58.333333333333336%
}
.col-sm-6 {
width:50%
}
.col-sm-5 {
width:41.66666666666667%
}
.col-sm-4 {
width:33.33333333333333%
}
.col-sm-3 {
width:25%
}
.col-sm-2 {
width:16.666666666666664%
}
.col-sm-1 {
width:8.333333333333332%
}
.col-sm-pull-12 {
right:100%
}
.col-sm-pull-11 {
right:91.66666666666666%
}
.col-sm-pull-10 {
right:83.33333333333334%
}
.col-sm-pull-9 {
right:75%
}
.col-sm-pull-8 {
right:66.66666666666666%
}
.col-sm-pull-7 {
right:58.333333333333336%
}
.col-sm-pull-6 {
right:50%
}
.col-sm-pull-5 {
right:41.66666666666667%
}
.col-sm-pull-4 {
right:33.33333333333333%
}
.col-sm-pull-3 {
right:25%
}
.col-sm-pull-2 {
right:16.666666666666664%
}
.col-sm-pull-1 {
right:8.333333333333332%
}
.col-sm-pull-0 {
right:0
}
.col-sm-push-12 {
left:100%
}
.col-sm-push-11 {
left:91.66666666666666%
}
.col-sm-push-10 {
left:83.33333333333334%
}
.col-sm-push-9 {
left:75%
}
.col-sm-push-8 {
left:66.66666666666666%
}
.col-sm-push-7 {
left:58.333333333333336%
}
.col-sm-push-6 {
left:50%
}
.col-sm-push-5 {
left:41.66666666666667%
}
.col-sm-push-4 {
left:33.33333333333333%
}
.col-sm-push-3 {
left:25%
}
.col-sm-push-2 {
left:16.666666666666664%
}
.col-sm-push-1 {
left:8.333333333333332%
}
.col-sm-push-0 {
left:0
}
.col-sm-offset-12 {
margin-left:100%
}
.col-sm-offset-11 {
margin-left:91.66666666666666%
}
.col-sm-offset-10 {
margin-left:83.33333333333334%
}
.col-sm-offset-9 {
margin-left:75%
}
.col-sm-offset-8 {
margin-left:66.66666666666666%
}
.col-sm-offset-7 {
margin-left:58.333333333333336%
}
.col-sm-offset-6 {
margin-left:50%
}
.col-sm-offset-5 {
margin-left:41.66666666666667%
}
.col-sm-offset-4 {
margin-left:33.33333333333333%
}
.col-sm-offset-3 {
margin-left:25%
}
.col-sm-offset-2 {
margin-left:16.666666666666664%
}
.col-sm-offset-1 {
margin-left:8.333333333333332%
}
.col-sm-offset-0 {
margin-left:0
}
}
@media(min-width:992px) {
.col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9 {
float:left
}
.col-md-12 {
width:100%
}
.col-md-11 {
width:91.66666666666666%
}
.col-md-10 {
width:83.33333333333334%
}
.col-md-9 {
width:75%
}
.col-md-8 {
width:66.66666666666666%
}
.col-md-7 {
width:58.333333333333336%
}
.col-md-6 {
width:50%
}
.col-md-5 {
width:41.66666666666667%
}
.col-md-4 {
width:33.33333333333333%
}
.col-md-3 {
width:25%
}
.col-md-2 {
width:16.666666666666664%
}
.col-md-1 {
width:8.333333333333332%
}
.col-md-pull-12 {
right:100%
}
.col-md-pull-11 {
right:91.66666666666666%
}
.col-md-pull-10 {
right:83.33333333333334%
}
.col-md-pull-9 {
right:75%
}
.col-md-pull-8 {
right:66.66666666666666%
}
.col-md-pull-7 {
right:58.333333333333336%
}
.col-md-pull-6 {
right:50%
}
.col-md-pull-5 {
right:41.66666666666667%
}
.col-md-pull-4 {
right:33.33333333333333%
}
.col-md-pull-3 {
right:25%
}
.col-md-pull-2 {
right:16.666666666666664%
}
.col-md-pull-1 {
right:8.333333333333332%
}
.col-md-pull-0 {
right:0
}
.col-md-push-12 {
left:100%
}
.col-md-push-11 {
left:91.66666666666666%
}
.col-md-push-10 {
left:83.33333333333334%
}
.col-md-push-9 {
left:75%
}
.col-md-push-8 {
left:66.66666666666666%
}
.col-md-push-7 {
left:58.333333333333336%
}
.col-md-push-6 {
left:50%
}
.col-md-push-5 {
left:41.66666666666667%
}
.col-md-push-4 {
left:33.33333333333333%
}
.col-md-push-3 {
left:25%
}
.col-md-push-2 {
left:16.666666666666664%
}
.col-md-push-1 {
left:8.333333333333332%
}
.col-md-push-0 {
left:0
}
.col-md-offset-12 {
margin-left:100%
}
.col-md-offset-11 {
margin-left:91.66666666666666%
}
.col-md-offset-10 {
margin-left:83.33333333333334%
}
.col-md-offset-9 {
margin-left:75%
}
.col-md-offset-8 {
margin-left:66.66666666666666%
}
.col-md-offset-7 {
margin-left:58.333333333333336%
}
.col-md-offset-6 {
margin-left:50%
}
.col-md-offset-5 {
margin-left:41.66666666666667%
}
.col-md-offset-4 {
margin-left:33.33333333333333%
}
.col-md-offset-3 {
margin-left:25%
}
.col-md-offset-2 {
margin-left:16.666666666666664%
}
.col-md-offset-1 {
margin-left:8.333333333333332%
}
.col-md-offset-0 {
margin-left:0
}
}
@media(min-width:1200px) {
.col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9 {
float:left
}
.col-lg-12 {
width:100%
}
.col-lg-11 {
width:91.66666666666666%
}
.col-lg-10 {
width:83.33333333333334%
}
.col-lg-9 {
width:75%
}
.col-lg-8 {
width:66.66666666666666%
}
.col-lg-7 {
width:58.333333333333336%
}
.col-lg-6 {
width:50%
}
.col-lg-5 {
width:41.66666666666667%
}
.col-lg-4 {
width:33.33333333333333%
}
.col-lg-3 {
width:25%
}
.col-lg-2 {
width:16.666666666666664%
}
.col-lg-1 {
width:8.333333333333332%
}
.col-lg-pull-12 {
right:100%
}
.col-lg-pull-11 {
right:91.66666666666666%
}
.col-lg-pull-10 {
right:83.33333333333334%
}
.col-lg-pull-9 {
right:75%
}
.col-lg-pull-8 {
right:66.66666666666666%
}
.col-lg-pull-7 {
right:58.333333333333336%
}
.col-lg-pull-6 {
right:50%
}
.col-lg-pull-5 {
right:41.66666666666667%
}
.col-lg-pull-4 {
right:33.33333333333333%
}
.col-lg-pull-3 {
right:25%
}
.col-lg-pull-2 {
right:16.666666666666664%
}
.col-lg-pull-1 {
right:8.333333333333332%
}
.col-lg-pull-0 {
right:0
}
.col-lg-push-12 {
left:100%
}
.col-lg-push-11 {
left:91.66666666666666%
}
.col-lg-push-10 {
left:83.33333333333334%
}
.col-lg-push-9 {
left:75%
}
.col-lg-push-8 {
left:66.66666666666666%
}
.col-lg-push-7 {
left:58.333333333333336%
}
.col-lg-push-6 {
left:50%
}
.col-lg-push-5 {
left:41.66666666666667%
}
.col-lg-push-4 {
left:33.33333333333333%
}
.col-lg-push-3 {
left:25%
}
.col-lg-push-2 {
left:16.666666666666664%
}
.col-lg-push-1 {
left:8.333333333333332%
}
.col-lg-push-0 {
left:0
}
.col-lg-offset-12 {
margin-left:100%
}
.col-lg-offset-11 {
margin-left:91.66666666666666%
}
.col-lg-offset-10 {
margin-left:83.33333333333334%
}
.col-lg-offset-9 {
margin-left:75%
}
.col-lg-offset-8 {
margin-left:66.66666666666666%
}
.col-lg-offset-7 {
margin-left:58.333333333333336%
}
.col-lg-offset-6 {
margin-left:50%
}
.col-lg-offset-5 {
margin-left:41.66666666666667%
}
.col-lg-offset-4 {
margin-left:33.33333333333333%
}
.col-lg-offset-3 {
margin-left:25%
}
.col-lg-offset-2 {
margin-left:16.666666666666664%
}
.col-lg-offset-1 {
margin-left:8.333333333333332%
}
.col-lg-offset-0 {
margin-left:0
}
}
table {
max-width:100%;
background-color:transparent
}
th {
text-align:left
}
.table {
width:100%;
margin-bottom:20px
}
.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th {
padding:8px;
line-height:1.428571429;
vertical-align:top;
border-top:1px solid #ddd
}
.table>thead>tr>th {
vertical-align:bottom;
border-bottom:2px solid #ddd
}
.table>caption+thead>tr:first-child>td, .table>caption+thead>tr:first-child>th, .table>colgroup+thead>tr:first-child>td, .table>colgroup+thead>tr:first-child>th, .table>thead:first-child>tr:first-child>td, .table>thead:first-child>tr:first-child>th {
border-top:0
}
.table>tbody+tbody {
border-top:2px solid #ddd
}
.table .table {
background-color:#fff
}
.table-condensed>tbody>tr>td, .table-condensed>tbody>tr>th, .table-condensed>tfoot>tr>td, .table-condensed>tfoot>tr>th, .table-condensed>thead>tr>td, .table-condensed>thead>tr>th {
padding:5px
}
.table-bordered, .table-bordered>tbody>tr>td, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>td, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>thead>tr>th {
border:1px solid #ddd
}
.table-bordered>thead>tr>td, .table-bordered>thead>tr>th {
border-bottom-width:2px
}
.table-striped>tbody>tr:nth-child(odd)>td, .table-striped>tbody>tr:nth-child(odd)>th {
background-color:#f9f9f9
}
.table-hover>tbody>tr:hover>td, .table-hover>tbody>tr:hover>th {
background-color:#f5f5f5
}
table col[class*=col-] {
position:static;
display:table-column;
float:none
}
table td[class*=col-], table th[class*=col-] {
display:table-cell;
float:none
}
.table>tbody>.active>td, .table>tbody>.active>th, .table>tbody>tr>.active, .table>tfoot>.active>td, .table>tfoot>.active>th, .table>tfoot>tr>.active, .table>thead>.active>td, .table>thead>.active>th, .table>thead>tr>.active {
background-color:#f5f5f5
}
.table-hover>tbody>.active:hover>td, .table-hover>tbody>.active:hover>th, .table-hover>tbody>tr>.active:hover {
background-color:#e8e8e8
}
.table>tbody>.success>td, .table>tbody>.success>th, .table>tbody>tr>.success, .table>tfoot>.success>td, .table>tfoot>.success>th, .table>tfoot>tr>.success, .table>thead>.success>td, .table>thead>.success>th, .table>thead>tr>.success {
background-color:#dff0d8
}
.table-hover>tbody>.success:hover>td, .table-hover>tbody>.success:hover>th, .table-hover>tbody>tr>.success:hover {
background-color:#d0e9c6
}
.table>tbody>.danger>td, .table>tbody>.danger>th, .table>tbody>tr>.danger, .table>tfoot>.danger>td, .table>tfoot>.danger>th, .table>tfoot>tr>.danger, .table>thead>.danger>td, .table>thead>.danger>th, .table>thead>tr>.danger {
background-color:#f2dede
}
.table-hover>tbody>.danger:hover>td, .table-hover>tbody>.danger:hover>th, .table-hover>tbody>tr>.danger:hover {
background-color:#ebcccc
}
.table>tbody>.warning>td, .table>tbody>.warning>th, .table>tbody>tr>.warning, .table>tfoot>.warning>td, .table>tfoot>.warning>th, .table>tfoot>tr>.warning, .table>thead>.warning>td, .table>thead>.warning>th, .table>thead>tr>.warning {
background-color:#fcf8e3
}
.table-hover>tbody>.warning:hover>td, .table-hover>tbody>.warning:hover>th, .table-hover>tbody>tr>.warning:hover {
background-color:#faf2cc
}
@media(max-width:767px) {
.table-responsive {
width:100%;
margin-bottom:15px;
overflow-x:scroll;
overflow-y:hidden;
border:1px solid #ddd;
-ms-overflow-style:-ms-autohiding-scrollbar;
-webkit-overflow-scrolling:touch
}
.table-responsive>.table {
margin-bottom:0
}
.table-responsive>.table>tbody>tr>td, .table-responsive>.table>tbody>tr>th, .table-responsive>.table>tfoot>tr>td, .table-responsive>.table>tfoot>tr>th, .table-responsive>.table>thead>tr>td, .table-responsive>.table>thead>tr>th {
white-space:nowrap
}
.table-responsive>.table-bordered {
border:0
}
.table-responsive>.table-bordered>tbody>tr>td:first-child, .table-responsive>.table-bordered>tbody>tr>th:first-child, .table-responsive>.table-bordered>tfoot>tr>td:first-child, .table-responsive>.table-bordered>tfoot>tr>th:first-child, .table-responsive>.table-bordered>thead>tr>td:first-child, .table-responsive>.table-bordered>thead>tr>th:first-child {
border-left:0
}
.table-responsive>.table-bordered>tbody>tr>td:last-child, .table-responsive>.table-bordered>tbody>tr>th:last-child, .table-responsive>.table-bordered>tfoot>tr>td:last-child, .table-responsive>.table-bordered>tfoot>tr>th:last-child, .table-responsive>.table-bordered>thead>tr>td:last-child, .table-responsive>.table-bordered>thead>tr>th:last-child {
border-right:0
}
.table-responsive>.table-bordered>tbody>tr:last-child>td, .table-responsive>.table-bordered>tbody>tr:last-child>th, .table-responsive>.table-bordered>tfoot>tr:last-child>td, .table-responsive>.table-bordered>tfoot>tr:last-child>th {
border-bottom:0
}
}
fieldset {
padding:0;
margin:0;
border:0
}
legend {
display:block;
width:100%;
padding:0;
margin-bottom:20px;
font-size:21px;
line-height:inherit;
color:#333;
border:0;
border-bottom:1px solid #e5e5e5
}
label {
display:inline-block;
margin-bottom:5px;
font-weight:700
}
input[type=search] {
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box
}
input[type=checkbox], input[type=radio] {
margin:4px 0 0;
margin-top:1px \9;
line-height:normal
}
input[type=file] {
display:block
}
select[multiple], select[size] {
height:auto
}
select optgroup {
font-family:inherit;
font-size:inherit;
font-style:inherit
}
input[type=checkbox]:focus, input[type=file]:focus, input[type=radio]:focus {
outline:thin dotted;
outline:5px auto -webkit-focus-ring-color;
outline-offset:-2px
}
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button {
height:auto
}
output {
display:block;
padding-top:7px;
font-size:14px;
line-height:1.428571429;
color:#555;
vertical-align:middle
}
.form-control {
display:block;
width:100%;
height:34px;
padding:6px 12px;
font-size:14px;
line-height:1.428571429;
color:#555;
vertical-align:middle;
border:1px solid #ccc;
border-radius:4px;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
-webkit-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s
}
.form-control:focus {
border-color:#66afe9;
outline:0;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6);
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(102, 175, 233, .6)
}
.form-control:-moz-placeholder {
color:#999
}
.form-control::-moz-placeholder {
color:#999;
opacity:1
}
.form-control:-ms-input-placeholder {
color:#999
}
.form-control::-webkit-input-placeholder {
color:#999
}
.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control {
cursor:not-allowed;
background-color:#eee
}
textarea.form-control {
height:auto
}
.form-group {
margin-bottom:15px
}
.checkbox, .radio {
display:block;
min-height:20px;
padding-left:20px;
margin-top:10px;
margin-bottom:10px;
vertical-align:middle
}
.checkbox label, .radio label {
display:inline;
margin-bottom:0;
font-weight:400;
cursor:pointer
}
.checkbox input[type=checkbox], .checkbox-inline input[type=checkbox], .radio input[type=radio], .radio-inline input[type=radio] {
float:left;
margin-left:-20px
}
.checkbox+.checkbox, .radio+.radio {
margin-top:-5px
}
.checkbox-inline, .radio-inline {
display:inline-block;
padding-left:20px;
margin-bottom:0;
font-weight:400;
vertical-align:middle;
cursor:pointer
}
.checkbox-inline+.checkbox-inline, .radio-inline+.radio-inline {
margin-top:0;
margin-left:10px
}
.checkbox-inline[disabled], .checkbox[disabled], .radio-inline[disabled], .radio[disabled], fieldset[disabled] .checkbox, fieldset[disabled] .checkbox-inline, fieldset[disabled] .radio, fieldset[disabled] .radio-inline, fieldset[disabled] input[type=checkbox], fieldset[disabled] input[type=radio], input[type=checkbox][disabled], input[type=radio][disabled] {
cursor:not-allowed
}
.input-sm {
height:30px;
padding:5px 10px;
font-size:12px;
line-height:1.5;
border-radius:3px
}
select.input-sm {
height:30px;
line-height:30px
}
textarea.input-sm {
height:auto
}
.input-lg {
height:46px;
padding:10px 16px;
font-size:18px;
line-height:1.33;
border-radius:6px
}
select.input-lg {
height:46px;
line-height:46px
}
textarea.input-lg {
height:auto
}
.has-warning .checkbox, .has-warning .checkbox-inline, .has-warning .control-label, .has-warning .help-block, .has-warning .radio, .has-warning .radio-inline {
color:#8a6d3b
}
.has-warning .form-control {
border-color:#8a6d3b;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075)
}
.has-warning .form-control:focus {
border-color:#66512c;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b;
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #c0a16b
}
.has-warning .input-group-addon {
color:#8a6d3b;
background-color:#fcf8e3;
border-color:#8a6d3b
}
.has-error .checkbox, .has-error .checkbox-inline, .has-error .control-label, .has-error .help-block, .has-error .radio, .has-error .radio-inline {
color:#a94442
}
.has-error .form-control {
border-color:#a94442;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075)
}
.has-error .form-control:focus {
border-color:#843534;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483;
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483
}
.has-error .input-group-addon {
color:#a94442;
background-color:#f2dede;
border-color:#a94442
}
.has-success .checkbox, .has-success .checkbox-inline, .has-success .control-label, .has-success .help-block, .has-success .radio, .has-success .radio-inline {
color:#3c763d
}
.has-success .form-control {
border-color:#3c763d;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075)
}
.has-success .form-control:focus {
border-color:#2b542c;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168;
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #67b168
}
.has-success .input-group-addon {
color:#3c763d;
background-color:#dff0d8;
border-color:#3c763d
}
.form-control-static {
margin-bottom:0
}
.help-block {
display:block;
margin-top:5px;
margin-bottom:10px;
color:#737373
}
@media(min-width:768px) {
.form-inline .form-group {
display:inline-block;
margin-bottom:0;
vertical-align:middle
}
.form-inline .form-control {
display:inline-block
}
.form-inline select.form-control {
width:auto
}
.form-inline .checkbox, .form-inline .radio {
display:inline-block;
padding-left:0;
margin-top:0;
margin-bottom:0
}
.form-inline .checkbox input[type=checkbox], .form-inline .radio input[type=radio] {
float:none;
margin-left:0
}
}
.form-horizontal .checkbox, .form-horizontal .checkbox-inline, .form-horizontal .control-label, .form-horizontal .radio, .form-horizontal .radio-inline {
padding-top:7px;
margin-top:0;
margin-bottom:0
}
.form-horizontal .checkbox, .form-horizontal .radio {
min-height:27px
}
.form-horizontal .form-group {
margin-right:-15px;
margin-left:-15px
}
.form-horizontal .form-group:after, .form-horizontal .form-group:before {
display:table;
content:" "
}
.form-horizontal .form-group:after {
clear:both
}
.form-horizontal .form-control-static {
padding-top:7px
}
@media(min-width:768px) {
.form-horizontal .control-label {
text-align:right
}
}
.btn {
display:inline-block;
padding:6px 12px;
margin-bottom:0;
font-size:14px;
font-weight:400;
line-height:1.428571429;
text-align:center;
white-space:nowrap;
vertical-align:middle;
cursor:pointer;
background-image:none;
border:1px solid transparent;
border-radius:4px;
-webkit-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
-o-user-select:none;
user-select:none
}
.btn:focus {
outline:thin dotted;
outline:5px auto -webkit-focus-ring-color;
outline-offset:-2px
}
.btn:focus, .btn:hover {
color:#333;
text-decoration:none
}
.btn.active, .btn:active {
background-image:none;
outline:0;
-webkit-box-shadow:inset 0 3px 5px rgba(0, 0, 0, .125);
box-shadow:inset 0 3px 5px rgba(0, 0, 0, .125)
}
.btn.disabled, .btn[disabled], fieldset[disabled] .btn {
pointer-events:none;
cursor:not-allowed;
opacity:.65;
filter:alpha(opacity=65);
-webkit-box-shadow:none;
box-shadow:none
}
.btn-default {
color:#333;
background-color:#fff;
border-color:#ccc
}
.btn-default.active, .btn-default:active, .btn-default:focus, .btn-default:hover, .open .dropdown-toggle.btn-default {
color:#333;
background-color:#ebebeb;
border-color:#adadad
}
.btn-default.active, .btn-default:active, .open .dropdown-toggle.btn-default {
background-image:none
}
.btn-default.disabled, .btn-default.disabled.active, .btn-default.disabled:active, .btn-default.disabled:focus, .btn-default.disabled:hover, .btn-default[disabled], .btn-default[disabled].active, .btn-default[disabled]:active, .btn-default[disabled]:focus, .btn-default[disabled]:hover, fieldset[disabled] .btn-default, fieldset[disabled] .btn-default.active, fieldset[disabled] .btn-default:active, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default:hover {
background-color:#fff;
border-color:#ccc
}
.btn-default .badge {
color:#fff;
background-color:#fff
}
.btn-primary {
color:#fff;
background-color:#428bca;
border-color:#357ebd
}
.btn-primary.active, .btn-primary:active, .btn-primary:focus, .btn-primary:hover, .open .dropdown-toggle.btn-primary {
color:#fff;
background-color:#3276b1;
border-color:#285e8e
}
.btn-primary.active, .btn-primary:active, .open .dropdown-toggle.btn-primary {
background-image:none
}
.btn-primary.disabled, .btn-primary.disabled.active, .btn-primary.disabled:active, .btn-primary.disabled:focus, .btn-primary.disabled:hover, .btn-primary[disabled], .btn-primary[disabled].active, .btn-primary[disabled]:active, .btn-primary[disabled]:focus, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary, fieldset[disabled] .btn-primary.active, fieldset[disabled] .btn-primary:active, fieldset[disabled] .btn-primary:focus, fieldset[disabled] .btn-primary:hover {
background-color:#428bca;
border-color:#357ebd
}
.btn-primary .badge {
color:#428bca;
background-color:#fff
}
.btn-warning {
color:#fff;
background-color:#f0ad4e;
border-color:#eea236
}
.btn-warning.active, .btn-warning:active, .btn-warning:focus, .btn-warning:hover, .open .dropdown-toggle.btn-warning {
color:#fff;
background-color:#ed9c28;
border-color:#d58512
}
.btn-warning.active, .btn-warning:active, .open .dropdown-toggle.btn-warning {
background-image:none
}
.btn-warning.disabled, .btn-warning.disabled.active, .btn-warning.disabled:active, .btn-warning.disabled:focus, .btn-warning.disabled:hover, .btn-warning[disabled], .btn-warning[disabled].active, .btn-warning[disabled]:active, .btn-warning[disabled]:focus, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning, fieldset[disabled] .btn-warning.active, fieldset[disabled] .btn-warning:active, fieldset[disabled] .btn-warning:focus, fieldset[disabled] .btn-warning:hover {
background-color:#f0ad4e;
border-color:#eea236
}
.btn-warning .badge {
color:#f0ad4e;
background-color:#fff
}
.btn-danger {
color:#fff;
background-color:#d9534f;
border-color:#d43f3a
}
.btn-danger.active, .btn-danger:active, .btn-danger:focus, .btn-danger:hover, .open .dropdown-toggle.btn-danger {
color:#fff;
background-color:#d2322d;
border-color:#ac2925
}
.btn-danger.active, .btn-danger:active, .open .dropdown-toggle.btn-danger {
background-image:none
}
.btn-danger.disabled, .btn-danger.disabled.active, .btn-danger.disabled:active, .btn-danger.disabled:focus, .btn-danger.disabled:hover, .btn-danger[disabled], .btn-danger[disabled].active, .btn-danger[disabled]:active, .btn-danger[disabled]:focus, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger, fieldset[disabled] .btn-danger.active, fieldset[disabled] .btn-danger:active, fieldset[disabled] .btn-danger:focus, fieldset[disabled] .btn-danger:hover {
background-color:#d9534f;
border-color:#d43f3a
}
.btn-danger .badge {
color:#d9534f;
background-color:#fff
}
.btn-success {
color:#fff;
background-color:#5cb85c;
border-color:#4cae4c
}
.btn-success.active, .btn-success:active, .btn-success:focus, .btn-success:hover, .open .dropdown-toggle.btn-success {
color:#fff;
background-color:#47a447;
border-color:#398439
}
.btn-success.active, .btn-success:active, .open .dropdown-toggle.btn-success {
background-image:none
}
.btn-success.disabled, .btn-success.disabled.active, .btn-success.disabled:active, .btn-success.disabled:focus, .btn-success.disabled:hover, .btn-success[disabled], .btn-success[disabled].active, .btn-success[disabled]:active, .btn-success[disabled]:focus, .btn-success[disabled]:hover, fieldset[disabled] .btn-success, fieldset[disabled] .btn-success.active, fieldset[disabled] .btn-success:active, fieldset[disabled] .btn-success:focus, fieldset[disabled] .btn-success:hover {
background-color:#5cb85c;
border-color:#4cae4c
}
.btn-success .badge {
color:#5cb85c;
background-color:#fff
}
.btn-info {
color:#fff;
background-color:#5bc0de;
border-color:#46b8da
}
.btn-info.active, .btn-info:active, .btn-info:focus, .btn-info:hover, .open .dropdown-toggle.btn-info {
color:#fff;
background-color:#39b3d7;
border-color:#269abc
}
.btn-info.active, .btn-info:active, .open .dropdown-toggle.btn-info {
background-image:none
}
.btn-info.disabled, .btn-info.disabled.active, .btn-info.disabled:active, .btn-info.disabled:focus, .btn-info.disabled:hover, .btn-info[disabled], .btn-info[disabled].active, .btn-info[disabled]:active, .btn-info[disabled]:focus, .btn-info[disabled]:hover, fieldset[disabled] .btn-info, fieldset[disabled] .btn-info.active, fieldset[disabled] .btn-info:active, fieldset[disabled] .btn-info:focus, fieldset[disabled] .btn-info:hover {
background-color:#5bc0de;
border-color:#46b8da
}
.btn-info .badge {
color:#5bc0de;
background-color:#fff
}
.btn-link {
font-weight:400;
color:#428bca;
cursor:pointer;
border-radius:0
}
.btn-link, .btn-link:active, .btn-link[disabled], fieldset[disabled] .btn-link {
background-color:transparent;
-webkit-box-shadow:none;
box-shadow:none
}
.btn-link, .btn-link:active, .btn-link:focus, .btn-link:hover {
border-color:transparent
}
.btn-link:focus, .btn-link:hover {
color:#2a6496;
text-decoration:underline;
background-color:transparent
}
.btn-link[disabled]:focus, .btn-link[disabled]:hover, fieldset[disabled] .btn-link:focus, fieldset[disabled] .btn-link:hover {
color:#999;
text-decoration:none
}
.btn-lg {
padding:10px 16px;
font-size:18px;
line-height:1.33;
border-radius:6px
}
.btn-sm {
padding:5px 10px;
font-size:12px;
line-height:1.5;
border-radius:3px
}
.btn-xs {
padding:1px 5px;
font-size:12px;
line-height:1.5;
border-radius:3px
}
.btn-block {
display:block;
width:100%;
padding-right:0;
padding-left:0
}
.btn-block+.btn-block {
margin-top:5px
}
input[type=button].btn-block, input[type=reset].btn-block, input[type=submit].btn-block {
width:100%
}
.fade {
opacity:0;
-webkit-transition:opacity .15s linear;
transition:opacity .15s linear
}
.fade.in {
opacity:1
}
.collapse {
display:none
}
.collapse.in {
display:block
}
.collapsing {
position:relative;
height:0;
overflow:hidden;
-webkit-transition:height .35s ease;
transition:height .35s ease
}
@font-face {
font-family:'Glyphicons Halflings';
src:url(../fonts/glyphicons-halflings-regular.eot);
src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'), url(../fonts/glyphicons-halflings-regular.woff) format('woff'), url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'), url(../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular) format('svg')
}
.glyphicon {
position:relative;
top:1px;
display:inline-block;
font-family:'Glyphicons Halflings';
-webkit-font-smoothing:antialiased;
font-style:normal;
font-weight:400;
line-height:1;
-moz-osx-font-smoothing:grayscale
}
.glyphicon:empty {
width:1em
}
.glyphicon-asterisk:before {
content:"\2a"
}
.glyphicon-plus:before {
content:"\2b"
}
.glyphicon-euro:before {
content:"\20ac"
}
.glyphicon-minus:before {
content:"\2212"
}
.glyphicon-cloud:before {
content:"\2601"
}
.glyphicon-envelope:before {
content:"\2709"
}
.glyphicon-pencil:before {
content:"\270f"
}
.glyphicon-glass:before {
content:"\e001"
}
.glyphicon-music:before {
content:"\e002"
}
.glyphicon-search:before {
content:"\e003"
}
.glyphicon-heart:before {
content:"\e005"
}
.glyphicon-star:before {
content:"\e006"
}
.glyphicon-star-empty:before {
content:"\e007"
}
.glyphicon-user:before {
content:"\e008"
}
.glyphicon-film:before {
content:"\e009"
}
.glyphicon-th-large:before {
content:"\e010"
}
.glyphicon-th:before {
content:"\e011"
}
.glyphicon-th-list:before {
content:"\e012"
}
.glyphicon-ok:before {
content:"\e013"
}
.glyphicon-remove:before {
content:"\e014"
}
.glyphicon-zoom-in:before {
content:"\e015"
}
.glyphicon-zoom-out:before {
content:"\e016"
}
.glyphicon-off:before {
content:"\e017"
}
.glyphicon-signal:before {
content:"\e018"
}
.glyphicon-cog:before {
content:"\e019"
}
.glyphicon-trash:before {
content:"\e020"
}
.glyphicon-home:before {
content:"\e021"
}
.glyphicon-file:before {
content:"\e022"
}
.glyphicon-time:before {
content:"\e023"
}
.glyphicon-road:before {
content:"\e024"
}
.glyphicon-download-alt:before {
content:"\e025"
}
.glyphicon-download:before {
content:"\e026"
}
.glyphicon-upload:before {
content:"\e027"
}
.glyphicon-inbox:before {
content:"\e028"
}
.glyphicon-play-circle:before {
content:"\e029"
}
.glyphicon-repeat:before {
content:"\e030"
}
.glyphicon-refresh:before {
content:"\e031"
}
.glyphicon-list-alt:before {
content:"\e032"
}
.glyphicon-lock:before {
content:"\e033"
}
.glyphicon-flag:before {
content:"\e034"
}
.glyphicon-headphones:before {
content:"\e035"
}
.glyphicon-volume-off:before {
content:"\e036"
}
.glyphicon-volume-down:before {
content:"\e037"
}
.glyphicon-volume-up:before {
content:"\e038"
}
.glyphicon-qrcode:before {
content:"\e039"
}
.glyphicon-barcode:before {
content:"\e040"
}
.glyphicon-tag:before {
content:"\e041"
}
.glyphicon-tags:before {
content:"\e042"
}
.glyphicon-book:before {
content:"\e043"
}
.glyphicon-bookmark:before {
content:"\e044"
}
.glyphicon-print:before {
content:"\e045"
}
.glyphicon-camera:before {
content:"\e046"
}
.glyphicon-font:before {
content:"\e047"
}
.glyphicon-bold:before {
content:"\e048"
}
.glyphicon-italic:before {
content:"\e049"
}
.glyphicon-text-height:before {
content:"\e050"
}
.glyphicon-text-width:before {
content:"\e051"
}
.glyphicon-align-left:before {
content:"\e052"
}
.glyphicon-align-center:before {
content:"\e053"
}
.glyphicon-align-right:before {
content:"\e054"
}
.glyphicon-align-justify:before {
content:"\e055"
}
.glyphicon-list:before {
content:"\e056"
}
.glyphicon-indent-left:before {
content:"\e057"
}
.glyphicon-indent-right:before {
content:"\e058"
}
.glyphicon-facetime-video:before {
content:"\e059"
}
.glyphicon-picture:before {
content:"\e060"
}
.glyphicon-map-marker:before {
content:"\e062"
}
.glyphicon-adjust:before {
content:"\e063"
}
.glyphicon-tint:before {
content:"\e064"
}
.glyphicon-edit:before {
content:"\e065"
}
.glyphicon-share:before {
content:"\e066"
}
.glyphicon-check:before {
content:"\e067"
}
.glyphicon-move:before {
content:"\e068"
}
.glyphicon-step-backward:before {
content:"\e069"
}
.glyphicon-fast-backward:before {
content:"\e070"
}
.glyphicon-backward:before {
content:"\e071"
}
.glyphicon-play:before {
content:"\e072"
}
.glyphicon-pause:before {
content:"\e073"
}
.glyphicon-stop:before {
content:"\e074"
}
.glyphicon-forward:before {
content:"\e075"
}
.glyphicon-fast-forward:before {
content:"\e076"
}
.glyphicon-step-forward:before {
content:"\e077"
}
.glyphicon-eject:before {
content:"\e078"
}
.glyphicon-chevron-left:before {
content:"\e079"
}
.glyphicon-chevron-right:before {
content:"\e080"
}
.glyphicon-plus-sign:before {
content:"\e081"
}
.glyphicon-minus-sign:before {
content:"\e082"
}
.glyphicon-remove-sign:before {
content:"\e083"
}
.glyphicon-ok-sign:before {
content:"\e084"
}
.glyphicon-question-sign:before {
content:"\e085"
}
.glyphicon-info-sign:before {
content:"\e086"
}
.glyphicon-screenshot:before {
content:"\e087"
}
.glyphicon-remove-circle:before {
content:"\e088"
}
.glyphicon-ok-circle:before {
content:"\e089"
}
.glyphicon-ban-circle:before {
content:"\e090"
}
.glyphicon-arrow-left:before {
content:"\e091"
}
.glyphicon-arrow-right:before {
content:"\e092"
}
.glyphicon-arrow-up:before {
content:"\e093"
}
.glyphicon-arrow-down:before {
content:"\e094"
}
.glyphicon-share-alt:before {
content:"\e095"
}
.glyphicon-resize-full:before {
content:"\e096"
}
.glyphicon-resize-small:before {
content:"\e097"
}
.glyphicon-exclamation-sign:before {
content:"\e101"
}
.glyphicon-gift:before {
content:"\e102"
}
.glyphicon-leaf:before {
content:"\e103"
}
.glyphicon-fire:before {
content:"\e104"
}
.glyphicon-eye-open:before {
content:"\e105"
}
.glyphicon-eye-close:before {
content:"\e106"
}
.glyphicon-warning-sign:before {
content:"\e107"
}
.glyphicon-plane:before {
content:"\e108"
}
.glyphicon-calendar:before {
content:"\e109"
}
.glyphicon-random:before {
content:"\e110"
}
.glyphicon-comment:before {
content:"\e111"
}
.glyphicon-magnet:before {
content:"\e112"
}
.glyphicon-chevron-up:before {
content:"\e113"
}
.glyphicon-chevron-down:before {
content:"\e114"
}
.glyphicon-retweet:before {
content:"\e115"
}
.glyphicon-shopping-cart:before {
content:"\e116"
}
.glyphicon-folder-close:before {
content:"\e117"
}
.glyphicon-folder-open:before {
content:"\e118"
}
.glyphicon-resize-vertical:before {
content:"\e119"
}
.glyphicon-resize-horizontal:before {
content:"\e120"
}
.glyphicon-hdd:before {
content:"\e121"
}
.glyphicon-bullhorn:before {
content:"\e122"
}
.glyphicon-bell:before {
content:"\e123"
}
.glyphicon-certificate:before {
content:"\e124"
}
.glyphicon-thumbs-up:before {
content:"\e125"
}
.glyphicon-thumbs-down:before {
content:"\e126"
}
.glyphicon-hand-right:before {
content:"\e127"
}
.glyphicon-hand-left:before {
content:"\e128"
}
.glyphicon-hand-up:before {
content:"\e129"
}
.glyphicon-hand-down:before {
content:"\e130"
}
.glyphicon-circle-arrow-right:before {
content:"\e131"
}
.glyphicon-circle-arrow-left:before {
content:"\e132"
}
.glyphicon-circle-arrow-up:before {
content:"\e133"
}
.glyphicon-circle-arrow-down:before {
content:"\e134"
}
.glyphicon-globe:before {
content:"\e135"
}
.glyphicon-wrench:before {
content:"\e136"
}
.glyphicon-tasks:before {
content:"\e137"
}
.glyphicon-filter:before {
content:"\e138"
}
.glyphicon-briefcase:before {
content:"\e139"
}
.glyphicon-fullscreen:before {
content:"\e140"
}
.glyphicon-dashboard:before {
content:"\e141"
}
.glyphicon-paperclip:before {
content:"\e142"
}
.glyphicon-heart-empty:before {
content:"\e143"
}
.glyphicon-link:before {
content:"\e144"
}
.glyphicon-phone:before {
content:"\e145"
}
.glyphicon-pushpin:before {
content:"\e146"
}
.glyphicon-usd:before {
content:"\e148"
}
.glyphicon-gbp:before {
content:"\e149"
}
.glyphicon-sort:before {
content:"\e150"
}
.glyphicon-sort-by-alphabet:before {
content:"\e151"
}
.glyphicon-sort-by-alphabet-alt:before {
content:"\e152"
}
.glyphicon-sort-by-order:before {
content:"\e153"
}
.glyphicon-sort-by-order-alt:before {
content:"\e154"
}
.glyphicon-sort-by-attributes:before {
content:"\e155"
}
.glyphicon-sort-by-attributes-alt:before {
content:"\e156"
}
.glyphicon-unchecked:before {
content:"\e157"
}
.glyphicon-expand:before {
content:"\e158"
}
.glyphicon-collapse-down:before {
content:"\e159"
}
.glyphicon-collapse-up:before {
content:"\e160"
}
.glyphicon-log-in:before {
content:"\e161"
}
.glyphicon-flash:before {
content:"\e162"
}
.glyphicon-log-out:before {
content:"\e163"
}
.glyphicon-new-window:before {
content:"\e164"
}
.glyphicon-record:before {
content:"\e165"
}
.glyphicon-save:before {
content:"\e166"
}
.glyphicon-open:before {
content:"\e167"
}
.glyphicon-saved:before {
content:"\e168"
}
.glyphicon-import:before {
content:"\e169"
}
.glyphicon-export:before {
content:"\e170"
}
.glyphicon-send:before {
content:"\e171"
}
.glyphicon-floppy-disk:before {
content:"\e172"
}
.glyphicon-floppy-saved:before {
content:"\e173"
}
.glyphicon-floppy-remove:before {
content:"\e174"
}
.glyphicon-floppy-save:before {
content:"\e175"
}
.glyphicon-floppy-open:before {
content:"\e176"
}
.glyphicon-credit-card:before {
content:"\e177"
}
.glyphicon-transfer:before {
content:"\e178"
}
.glyphicon-cutlery:before {
content:"\e179"
}
.glyphicon-header:before {
content:"\e180"
}
.glyphicon-compressed:before {
content:"\e181"
}
.glyphicon-earphone:before {
content:"\e182"
}
.glyphicon-phone-alt:before {
content:"\e183"
}
.glyphicon-tower:before {
content:"\e184"
}
.glyphicon-stats:before {
content:"\e185"
}
.glyphicon-sd-video:before {
content:"\e186"
}
.glyphicon-hd-video:before {
content:"\e187"
}
.glyphicon-subtitles:before {
content:"\e188"
}
.glyphicon-sound-stereo:before {
content:"\e189"
}
.glyphicon-sound-dolby:before {
content:"\e190"
}
.glyphicon-sound-5-1:before {
content:"\e191"
}
.glyphicon-sound-6-1:before {
content:"\e192"
}
.glyphicon-sound-7-1:before {
content:"\e193"
}
.glyphicon-copyright-mark:before {
content:"\e194"
}
.glyphicon-registration-mark:before {
content:"\e195"
}
.glyphicon-cloud-download:before {
content:"\e197"
}
.glyphicon-cloud-upload:before {
content:"\e198"
}
.glyphicon-tree-conifer:before {
content:"\e199"
}
.glyphicon-tree-deciduous:before {
content:"\e200"
}
.caret {
display:inline-block;
width:0;
height:0;
margin-left:2px;
vertical-align:middle;
border-top:4px solid;
border-right:4px solid transparent;
border-left:4px solid transparent
}
.dropdown {
position:relative
}
.dropdown-toggle:focus {
outline:0
}
.dropdown-menu {
position:absolute;
top:100%;
left:0;
z-index:1000;
display:none;
float:left;
min-width:160px;
padding:5px 0;
margin:2px 0 0;
font-size:14px;
list-style:none;
background-color:#fff;
border:1px solid #ccc;
border:1px solid rgba(0, 0, 0, .15);
border-radius:4px;
-webkit-box-shadow:0 6px 12px rgba(0, 0, 0, .175);
box-shadow:0 6px 12px rgba(0, 0, 0, .175);
background-clip:padding-box
}
.dropdown-menu.pull-right {
right:0;
left:auto
}
.dropdown-menu .divider {
height:1px;
margin:9px 0;
overflow:hidden;
background-color:#e5e5e5
}
.dropdown-menu>li>a,
.dropdown-menu div.top_block>a{
display:block;
padding:3px 20px;
clear:both;
font-weight:400;
line-height:1.428571429;
color:#333;
white-space:nowrap
}
.dropdown-menu>li>a:focus, .dropdown-menu>li>a:hover,
.dropdown-menu div.top_block>a:focus, .dropdown-menu div.top_block>a:hover{
color:#262626;
text-decoration:none;
background-color:#f5f5f5
}
.dropdown-menu>.active>a, .dropdown-menu>.active>a:focus, .dropdown-menu>.active>a:hover {
color:#fff;
text-decoration:none;
background-color:#428bca;
outline:0
}
.dropdown-menu>.disabled>a, .dropdown-menu>.disabled>a:focus, .dropdown-menu>.disabled>a:hover {
color:#999
}
.dropdown-menu>.disabled>a:focus, .dropdown-menu>.disabled>a:hover {
text-decoration:none;
cursor:not-allowed;
background-color:transparent;
background-image:none;
filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)
}
.open>.dropdown-menu {
display:block
}
.open>a {
outline:0
}
.dropdown-header {
display:block;
padding:3px 20px;
font-size:12px;
line-height:1.428571429;
color:#999
}
.dropdown-backdrop {
position:fixed;
top:0;
right:0;
bottom:0;
left:0;
z-index:990
}
.pull-right>.dropdown-menu {
right:0;
left:auto
}
.dropup .caret, .navbar-fixed-bottom .dropdown .caret {
border-top:0;
border-bottom:4px solid;
content:""
}
.dropup .dropdown-menu, .navbar-fixed-bottom .dropdown .dropdown-menu {
top:auto;
bottom:100%;
margin-bottom:1px
}
@media(min-width:768px) {
.navbar-right .dropdown-menu {
right:0;
left:auto
}
}
.btn-group, .btn-group-vertical {
position:relative;
display:inline-block;
vertical-align:middle
}
.btn-group-vertical>.btn, .btn-group>.btn {
position:relative;
float:left
}
.btn-group-vertical>.btn.active, .btn-group-vertical>.btn:active, .btn-group-vertical>.btn:focus, .btn-group-vertical>.btn:hover, .btn-group>.btn.active, .btn-group>.btn:active, .btn-group>.btn:focus, .btn-group>.btn:hover {
z-index:2
}
.btn-group-vertical>.btn:focus, .btn-group>.btn:focus {
outline:0
}
.btn-group .btn+.btn, .btn-group .btn+.btn-group, .btn-group .btn-group+.btn, .btn-group .btn-group+.btn-group {
margin-left:-1px
}
.btn-toolbar:after, .btn-toolbar:before {
display:table;
content:" "
}
.btn-toolbar:after {
clear:both
}
.btn-toolbar .btn-group {
float:left
}
.btn-toolbar>.btn+.btn, .btn-toolbar>.btn+.btn-group, .btn-toolbar>.btn-group+.btn, .btn-toolbar>.btn-group+.btn-group {
margin-left:5px
}
.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {
border-radius:0
}
.btn-group>.btn:first-child {
margin-left:0
}
.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle) {
border-top-right-radius:0;
border-bottom-right-radius:0
}
.btn-group>.btn:last-child:not(:first-child), .btn-group>.dropdown-toggle:not(:first-child) {
border-bottom-left-radius:0;
border-top-left-radius:0
}
.btn-group>.btn-group {
float:left
}
.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn {
border-radius:0
}
.btn-group>.btn-group:first-child>.btn:last-child, .btn-group>.btn-group:first-child>.dropdown-toggle {
border-top-right-radius:0;
border-bottom-right-radius:0
}
.btn-group>.btn-group:last-child>.btn:first-child {
border-bottom-left-radius:0;
border-top-left-radius:0
}
.btn-group .dropdown-toggle:active, .btn-group.open .dropdown-toggle {
outline:0
}
.btn-group-xs>.btn {
padding:1px 5px;
font-size:12px;
line-height:1.5;
border-radius:3px
}
.btn-group-sm>.btn {
padding:5px 10px;
font-size:12px;
line-height:1.5;
border-radius:3px
}
.btn-group-lg>.btn {
padding:10px 16px;
font-size:18px;
line-height:1.33;
border-radius:6px
}
.btn-group>.btn+.dropdown-toggle {
padding-right:8px;
padding-left:8px
}
.btn-group>.btn-lg+.dropdown-toggle {
padding-right:12px;
padding-left:12px
}
.btn-group.open .dropdown-toggle {
-webkit-box-shadow:inset 0 3px 5px rgba(0, 0, 0, .125);
box-shadow:inset 0 3px 5px rgba(0, 0, 0, .125)
}
.btn-group.open .dropdown-toggle.btn-link {
-webkit-box-shadow:none;
box-shadow:none
}
.btn .caret {
margin-left:0
}
.btn-lg .caret {
border-width:5px 5px 0;
border-bottom-width:0
}
.dropup .btn-lg .caret {
border-width:0 5px 5px
}
.btn-group-vertical>.btn, .btn-group-vertical>.btn-group, .btn-group-vertical>.btn-group>.btn {
display:block;
float:none;
width:100%;
max-width:100%
}
.btn-group-vertical>.btn-group:after, .btn-group-vertical>.btn-group:before {
display:table;
content:" "
}
.btn-group-vertical>.btn-group:after {
clear:both
}
.btn-group-vertical>.btn-group>.btn {
float:none
}
.btn-group-vertical>.btn+.btn, .btn-group-vertical>.btn+.btn-group, .btn-group-vertical>.btn-group+.btn, .btn-group-vertical>.btn-group+.btn-group {
margin-top:-1px;
margin-left:0
}
.btn-group-vertical>.btn:not(:first-child):not(:last-child) {
border-radius:0
}
.btn-group-vertical>.btn:first-child:not(:last-child) {
border-top-right-radius:4px;
border-bottom-right-radius:0;
border-bottom-left-radius:0
}
.btn-group-vertical>.btn:last-child:not(:first-child) {
border-top-right-radius:0;
border-bottom-left-radius:4px;
border-top-left-radius:0
}
.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn {
border-radius:0
}
.btn-group-vertical>.btn-group:first-child>.btn:last-child, .btn-group-vertical>.btn-group:first-child>.dropdown-toggle {
border-bottom-right-radius:0;
border-bottom-left-radius:0
}
.btn-group-vertical>.btn-group:last-child>.btn:first-child {
border-top-right-radius:0;
border-top-left-radius:0
}
.btn-group-justified {
display:table;
width:100%;
border-collapse:separate;
table-layout:fixed
}
.btn-group-justified>.btn, .btn-group-justified>.btn-group {
display:table-cell;
float:none;
width:1%
}
.btn-group-justified>.btn-group .btn {
width:100%
}
[data-toggle=buttons]>.btn>input[type=checkbox], [data-toggle=buttons]>.btn>input[type=radio] {
display:none
}
.input-group {
position:relative;
display:table;
border-collapse:separate
}
.input-group[class*=col-] {
float:none;
padding-right:0;
padding-left:0
}
.input-group .form-control {
width:100%;
margin-bottom:0
}
.input-group-lg>.form-control, .input-group-lg>.input-group-addon, .input-group-lg>.input-group-btn>.btn {
height:46px;
padding:10px 16px;
font-size:18px;
line-height:1.33;
border-radius:6px
}
select.input-group-lg>.form-control, select.input-group-lg>.input-group-addon, select.input-group-lg>.input-group-btn>.btn {
height:46px;
line-height:46px
}
textarea.input-group-lg>.form-control, textarea.input-group-lg>.input-group-addon, textarea.input-group-lg>.input-group-btn>.btn {
height:auto
}
.input-group-sm>.form-control, .input-group-sm>.input-group-addon, .input-group-sm>.input-group-btn>.btn {
height:30px;
padding:5px 10px;
font-size:12px;
line-height:1.5;
border-radius:3px
}
select.input-group-sm>.form-control, select.input-group-sm>.input-group-addon, select.input-group-sm>.input-group-btn>.btn {
height:30px;
line-height:30px
}
textarea.input-group-sm>.form-control, textarea.input-group-sm>.input-group-addon, textarea.input-group-sm>.input-group-btn>.btn {
height:auto
}
.input-group .form-control, .input-group-addon, .input-group-btn {
display:table-cell
}
.input-group .form-control:not(:first-child):not(:last-child), .input-group-addon:not(:first-child):not(:last-child), .input-group-btn:not(:first-child):not(:last-child) {
border-radius:0
}
.input-group-addon, .input-group-btn {
width:1%;
white-space:nowrap;
vertical-align:middle
}
.input-group-addon {
padding:6px 12px;
font-size:14px;
font-weight:400;
line-height:1;
color:#555;
text-align:center;
background-color:#eee;
border:1px solid #ccc;
border-radius:4px
}
.input-group-addon.input-sm {
padding:5px 10px;
font-size:12px;
border-radius:3px
}
.input-group-addon.input-lg {
padding:10px 16px;
font-size:18px;
border-radius:6px
}
.input-group-addon input[type=checkbox], .input-group-addon input[type=radio] {
margin-top:0
}
.input-group .form-control:first-child, .input-group-addon:first-child, .input-group-btn:first-child>.btn, .input-group-btn:first-child>.dropdown-toggle, .input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle) {
border-top-right-radius:0;
border-bottom-right-radius:0
}
.input-group-addon:first-child {
border-right:0
}
.input-group .form-control:last-child, .input-group-addon:last-child, .input-group-btn:first-child>.btn:not(:first-child), .input-group-btn:last-child>.btn, .input-group-btn:last-child>.dropdown-toggle {
border-bottom-left-radius:0;
border-top-left-radius:0
}
.input-group-addon:last-child {
border-left:0
}
.input-group-btn {
position:relative;
white-space:nowrap
}
.input-group-btn:first-child>.btn {
margin-right:-1px
}
.input-group-btn:last-child>.btn {
margin-left:-1px
}
.input-group-btn>.btn {
position:relative
}
.input-group-btn>.btn+.btn {
margin-left:-4px
}
.input-group-btn>.btn:active, .input-group-btn>.btn:hover {
z-index:2
}
.nav {
padding-left:0;
margin-bottom:0;
list-style:none
}
.nav:after, .nav:before {
display:table;
content:" "
}
.nav:after {
clear:both
}
.nav>li {
position:relative;
display:block
}
.nav>li>a {
position:relative;
display:block;
padding:10px 15px
}
.nav>li>a:focus, .nav>li>a:hover {
text-decoration:none;
background-color:#eee
}
.nav>li.disabled>a {
color:#999
}
.nav>li.disabled>a:focus, .nav>li.disabled>a:hover {
color:#999;
text-decoration:none;
cursor:not-allowed;
background-color:transparent
}
.nav .open>a, .nav .open>a:focus, .nav .open>a:hover {
background-color:#eee;
border-color:#428bca
}
.nav .nav-divider {
height:1px;
margin:9px 0;
overflow:hidden;
background-color:#e5e5e5
}
.nav>li>a>img {
max-width:none
}
.nav-tabs {
border-bottom:1px solid #ddd
}
.nav-tabs>li {
float:left;
margin-bottom:-1px
}
.nav-tabs>li>a {
margin-right:2px;
line-height:1.428571429;
border:1px solid transparent;
border-radius:4px 4px 0 0
}
.nav-tabs>li>a:hover {
border-color:#eee #eee #ddd
}
.nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover {
color:#555;
cursor:default;
background-color:#fff;
border:1px solid #ddd;
border-bottom-color:transparent
}
.nav-tabs.nav-justified {
width:100%;
border-bottom:0
}
.nav-tabs.nav-justified>li {
float:none
}
.nav-tabs.nav-justified>li>a {
margin-bottom:5px;
text-align:center
}
.nav-tabs.nav-justified>.dropdown .dropdown-menu {
top:auto;
left:auto
}
@media(min-width:768px) {
.nav-tabs.nav-justified>li {
display:table-cell;
width:1%
}
.nav-tabs.nav-justified>li>a {
margin-bottom:0
}
}
.nav-tabs.nav-justified>li>a {
margin-right:0;
border-radius:4px
}
.nav-tabs.nav-justified>.active>a, .nav-tabs.nav-justified>.active>a:focus, .nav-tabs.nav-justified>.active>a:hover {
border:1px solid #ddd
}
@media(min-width:768px) {
.nav-tabs.nav-justified>li>a {
border-bottom:1px solid #ddd;
border-radius:4px 4px 0 0
}
.nav-tabs.nav-justified>.active>a, .nav-tabs.nav-justified>.active>a:focus, .nav-tabs.nav-justified>.active>a:hover {
border-bottom-color:#fff
}
}
.nav-pills>li {
float:left
}
.nav-pills>li>a {
border-radius:4px
}
.nav-pills>li+li {
margin-left:2px
}
.nav-pills>li.active>a, .nav-pills>li.active>a:focus, .nav-pills>li.active>a:hover {
color:#fff;
background-color:#428bca
}
.nav-stacked>li {
float:none
}
.nav-stacked>li+li {
margin-top:2px;
margin-left:0
}
.nav-justified {
width:100%
}
.nav-justified>li {
float:none
}
.nav-justified>li>a {
margin-bottom:5px;
text-align:center
}
.nav-justified>.dropdown .dropdown-menu {
top:auto;
left:auto
}
@media(min-width:768px) {
.nav-justified>li {
display:table-cell;
width:1%
}
.nav-justified>li>a {
margin-bottom:0
}
}
.nav-tabs-justified {
border-bottom:0
}
.nav-tabs-justified>li>a {
margin-right:0;
border-radius:4px
}
.nav-tabs-justified>.active>a, .nav-tabs-justified>.active>a:focus, .nav-tabs-justified>.active>a:hover {
border:1px solid #ddd
}
@media(min-width:768px) {
.nav-tabs-justified>li>a {
border-bottom:1px solid #ddd;
border-radius:4px 4px 0 0
}
.nav-tabs-justified>.active>a, .nav-tabs-justified>.active>a:focus, .nav-tabs-justified>.active>a:hover {
border-bottom-color:#fff
}
}
.tab-content>.tab-pane {
display:none
}
.tab-content>.active {
display:block
}
.nav-tabs .dropdown-menu {
margin-top:-1px;
border-top-right-radius:0;
border-top-left-radius:0
}
.navbar {
position:relative;
min-height:50px;
margin-bottom:20px;
border:1px solid transparent
}
.navbar:after, .navbar:before {
display:table;
content:" "
}
.navbar:after {
clear:both
}
@media(min-width:768px) {
.navbar {
border-radius:4px
}
}
.navbar-header:after, .navbar-header:before {
display:table;
content:" "
}
.navbar-header:after {
clear:both
}
@media(min-width:768px) {
.navbar-header {
float:left
}
}
.navbar-collapse {
max-height:340px;
padding-right:15px;
padding-left:15px;
overflow-x:visible;
border-top:1px solid transparent;
box-shadow:inset 0 1px 0 rgba(255, 255, 255, .1);
-webkit-overflow-scrolling:touch
}
.navbar-collapse:after, .navbar-collapse:before {
display:table;
content:" "
}
.navbar-collapse:after {
clear:both
}
.navbar-collapse.in {
overflow-y:auto
}
@media(min-width:768px) {
.navbar-collapse {
width:auto;
border-top:0;
box-shadow:none
}
.navbar-collapse.collapse {
display:block!important;
height:auto!important;
padding-bottom:0;
overflow:visible!important
}
.navbar-collapse.in {
overflow-y:visible
}
.navbar-fixed-bottom .navbar-collapse, .navbar-fixed-top .navbar-collapse, .navbar-static-top .navbar-collapse {
padding-right:0;
padding-left:0
}
}
.container>.navbar-collapse, .container>.navbar-header {
margin-right:-15px;
margin-left:-15px
}
@media(min-width:768px) {
.container>.navbar-collapse, .container>.navbar-header {
margin-right:0;
margin-left:0
}
}
.navbar-static-top {
z-index:1000;
border-width:0 0 1px
}
@media(min-width:768px) {
.navbar-static-top {
border-radius:0
}
}
.navbar-fixed-bottom, .navbar-fixed-top {
position:fixed;
right:0;
left:0;
z-index:1030
}
@media(min-width:768px) {
.navbar-fixed-bottom, .navbar-fixed-top {
border-radius:0
}
}
.navbar-fixed-top {
top:0;
border-width:0 0 1px
}
.navbar-fixed-bottom {
bottom:0;
margin-bottom:0;
border-width:1px 0 0
}
.navbar-brand {
float:left;
padding:15px;
font-size:18px;
line-height:20px
}
.navbar-brand:focus, .navbar-brand:hover {
text-decoration:none
}
@media(min-width:768px) {
.navbar>.container .navbar-brand {
margin-left:-15px
}
}
.navbar-toggle {
position:relative;
float:right;
padding:9px 10px;
margin-top:8px;
margin-right:15px;
margin-bottom:8px;
background-color:transparent;
background-image:none;
border:1px solid transparent;
border-radius:4px
}
.navbar-toggle .icon-bar {
display:block;
width:22px;
height:2px;
border-radius:1px
}
.navbar-toggle .icon-bar+.icon-bar {
margin-top:4px
}
@media(min-width:768px) {
.navbar-toggle {
display:none
}
}
.navbar-nav {
margin:7.5px -15px
}
.navbar-nav>li>a {
padding-top:10px;
padding-bottom:10px;
line-height:20px
}
@media(max-width:767px) {
.navbar-nav .open .dropdown-menu {
position:static;
float:none;
width:auto;
margin-top:0;
background-color:transparent;
border:0;
box-shadow:none
}
.navbar-nav .open .dropdown-menu .dropdown-header, .navbar-nav .open .dropdown-menu>li>a {
padding:5px 15px 5px 25px
}
.navbar-nav .open .dropdown-menu>li>a {
line-height:20px
}
.navbar-nav .open .dropdown-menu>li>a:focus, .navbar-nav .open .dropdown-menu>li>a:hover {
background-image:none
}
}
@media(min-width:768px) {
.navbar-nav {
float:left;
margin:0
}
.navbar-nav>li {
float:left
}
.navbar-nav>li>a {
padding-top:15px;
padding-bottom:15px
}
.navbar-nav.navbar-right:last-child {
margin-right:-15px
}
}
@media(min-width:768px) {
.navbar-left {
float:left!important
}
.navbar-right {
float:right!important
}
}
.navbar-form {
padding:10px 15px;
margin-top:8px;
margin-right:-15px;
margin-bottom:8px;
margin-left:-15px;
border-top:1px solid transparent;
border-bottom:1px solid transparent;
-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1);
box-shadow:inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 rgba(255, 255, 255, .1)
}
@media(min-width:768px) {
.navbar-form .form-group {
display:inline-block;
margin-bottom:0;
vertical-align:middle
}
.navbar-form .form-control {
display:inline-block
}
.navbar-form select.form-control {
width:auto
}
.navbar-form .checkbox, .navbar-form .radio {
display:inline-block;
padding-left:0;
margin-top:0;
margin-bottom:0
}
.navbar-form .checkbox input[type=checkbox], .navbar-form .radio input[type=radio] {
float:none;
margin-left:0
}
}
@media(max-width:767px) {
.navbar-form .form-group {
margin-bottom:5px
}
}
@media(min-width:768px) {
.navbar-form {
width:auto;
padding-top:0;
padding-bottom:0;
margin-right:0;
margin-left:0;
border:0;
-webkit-box-shadow:none;
box-shadow:none
}
.navbar-form.navbar-right:last-child {
margin-right:-15px
}
}
.navbar-nav>li>.dropdown-menu {
margin-top:0;
border-top-right-radius:0;
border-top-left-radius:0
}
.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu {
border-bottom-right-radius:0;
border-bottom-left-radius:0
}
.navbar-nav.pull-right>li>.dropdown-menu, .navbar-nav>li>.dropdown-menu.pull-right {
right:0;
left:auto
}
.navbar-btn {
margin-top:8px;
margin-bottom:8px
}
.navbar-btn.btn-sm {
margin-top:10px;
margin-bottom:10px
}
.navbar-btn.btn-xs {
margin-top:14px;
margin-bottom:14px
}
.navbar-text {
margin-top:15px;
margin-bottom:15px
}
@media(min-width:768px) {
.navbar-text {
float:left;
margin-right:15px;
margin-left:15px
}
.navbar-text.navbar-right:last-child {
margin-right:0
}
}
.navbar-default {
background-color:#f8f8f8;
border-color:#e7e7e7
}
.navbar-default .navbar-brand {
color:#777
}
.navbar-default .navbar-brand:focus, .navbar-default .navbar-brand:hover {
color:#5e5e5e;
background-color:transparent
}
.navbar-default .navbar-nav>li>a, .navbar-default .navbar-text {
color:#777
}
.navbar-default .navbar-nav>li>a:focus, .navbar-default .navbar-nav>li>a:hover {
color:#333;
background-color:transparent
}
.navbar-default .navbar-nav>.active>a, .navbar-default .navbar-nav>.active>a:focus, .navbar-default .navbar-nav>.active>a:hover {
color:#555;
background-color:#e7e7e7
}
.navbar-default .navbar-nav>.disabled>a, .navbar-default .navbar-nav>.disabled>a:focus, .navbar-default .navbar-nav>.disabled>a:hover {
color:#ccc;
background-color:transparent
}
.navbar-default .navbar-toggle {
border-color:#ddd
}
.navbar-default .navbar-toggle:focus, .navbar-default .navbar-toggle:hover {
background-color:#ddd
}
.navbar-default .navbar-toggle .icon-bar {
background-color:#ccc
}
.navbar-default .navbar-collapse, .navbar-default .navbar-form {
border-color:#e7e7e7
}
.navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:focus, .navbar-default .navbar-nav>.open>a:hover {
color:#555;
background-color:#e7e7e7
}
@media(max-width:767px) {
.navbar-default .navbar-nav .open .dropdown-menu>li>a {
color:#777
}
.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus, .navbar-default .navbar-nav .open .dropdown-menu>li>a:hover {
color:#333;
background-color:transparent
}
.navbar-default .navbar-nav .open .dropdown-menu>.active>a, .navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus, .navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover {
color:#555;
background-color:#e7e7e7
}
.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a, .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus, .navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover {
color:#ccc;
background-color:transparent
}
}
.navbar-default .navbar-link {
color:#777
}
.navbar-default .navbar-link:hover {
color:#333
}
.navbar-inverse {
background-color:#222;
border-color:#080808
}
.navbar-inverse .navbar-brand {
color:#999
}
.navbar-inverse .navbar-brand:focus, .navbar-inverse .navbar-brand:hover {
color:#fff;
background-color:transparent
}
.navbar-inverse .navbar-nav>li>a, .navbar-inverse .navbar-text {
color:#999
}
.navbar-inverse .navbar-nav>li>a:focus, .navbar-inverse .navbar-nav>li>a:hover {
color:#fff;
background-color:transparent
}
.navbar-inverse .navbar-nav>.active>a, .navbar-inverse .navbar-nav>.active>a:focus, .navbar-inverse .navbar-nav>.active>a:hover {
color:#fff;
background-color:#080808
}
.navbar-inverse .navbar-nav>.disabled>a, .navbar-inverse .navbar-nav>.disabled>a:focus, .navbar-inverse .navbar-nav>.disabled>a:hover {
color:#444;
background-color:transparent
}
.navbar-inverse .navbar-toggle {
border-color:#333
}
.navbar-inverse .navbar-toggle:focus, .navbar-inverse .navbar-toggle:hover {
background-color:#333
}
.navbar-inverse .navbar-toggle .icon-bar {
background-color:#fff
}
.navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form {
border-color:#101010
}
.navbar-inverse .navbar-nav>.open>a, .navbar-inverse .navbar-nav>.open>a:focus, .navbar-inverse .navbar-nav>.open>a:hover {
color:#fff;
background-color:#080808
}
@media(max-width:767px) {
.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header {
border-color:#080808
}
.navbar-inverse .navbar-nav .open .dropdown-menu .divider {
background-color:#080808
}
.navbar-inverse .navbar-nav .open .dropdown-menu>li>a {
color:#999
}
.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus, .navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover {
color:#fff;
background-color:transparent
}
.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a, .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus, .navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover {
color:#fff;
background-color:#080808
}
.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a, .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus, .navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover {
color:#444;
background-color:transparent
}
}
.navbar-inverse .navbar-link {
color:#999
}
.navbar-inverse .navbar-link:hover {
color:#fff
}
.breadcrumb {
padding:8px 15px;
margin-bottom:20px;
list-style:none;
background-color:#f5f5f5;
border-radius:4px
}
.breadcrumb>li {
display:inline-block
}
.breadcrumb>li+li:before {
padding:0 5px;
color:#ccc;
content:"/\00a0"
}
.breadcrumb>.active {
color:#999
}
.pagination {
display:inline-block;
padding-left:0;
margin:20px 0;
border-radius:4px
}
.pagination>li {
display:inline
}
.pagination>li>a, .pagination>li>span {
position:relative;
float:left;
padding:6px 12px;
margin-left:-1px;
line-height:1.428571429;
text-decoration:none;
background-color:#fff;
border:1px solid #ddd
}
.pagination>li:first-child>a, .pagination>li:first-child>span {
margin-left:0;
border-bottom-left-radius:4px;
border-top-left-radius:4px
}
.pagination>li:last-child>a, .pagination>li:last-child>span {
border-top-right-radius:4px;
border-bottom-right-radius:4px
}
.pagination>li>a:focus, .pagination>li>a:hover, .pagination>li>span:focus, .pagination>li>span:hover {
background-color:#eee
}
.pagination>.active>a, .pagination>.active>a:focus, .pagination>.active>a:hover, .pagination>.active>span, .pagination>.active>span:focus, .pagination>.active>span:hover {
z-index:2;
color:#fff;
cursor:default;
background-color:#428bca;
border-color:#428bca
}
.pagination>.disabled>a, .pagination>.disabled>a:focus, .pagination>.disabled>a:hover, .pagination>.disabled>span, .pagination>.disabled>span:focus, .pagination>.disabled>span:hover {
color:#999;
cursor:not-allowed;
background-color:#fff;
border-color:#ddd
}
.pagination-lg>li>a, .pagination-lg>li>span {
padding:10px 16px;
font-size:18px
}
.pagination-lg>li:first-child>a, .pagination-lg>li:first-child>span {
border-bottom-left-radius:6px;
border-top-left-radius:6px
}
.pagination-lg>li:last-child>a, .pagination-lg>li:last-child>span {
border-top-right-radius:6px;
border-bottom-right-radius:6px
}
.pagination-sm>li>a, .pagination-sm>li>span {
padding:5px 10px;
font-size:12px
}
.pagination-sm>li:first-child>a, .pagination-sm>li:first-child>span {
border-bottom-left-radius:3px;
border-top-left-radius:3px
}
.pagination-sm>li:last-child>a, .pagination-sm>li:last-child>span {
border-top-right-radius:3px;
border-bottom-right-radius:3px
}
.pager {
padding-left:0;
margin:20px 0;
text-align:center;
list-style:none
}
.pager:after, .pager:before {
display:table;
content:" "
}
.pager:after {
clear:both
}
.pager li {
display:inline
}
.pager li>a, .pager li>span {
display:inline-block;
padding:5px 14px;
background-color:#fff;
border:1px solid #ddd;
border-radius:15px
}
.pager li>a:focus, .pager li>a:hover {
text-decoration:none;
background-color:#eee
}
.pager .next>a, .pager .next>span {
float:right
}
.pager .previous>a, .pager .previous>span {
float:left
}
.pager .disabled>a, .pager .disabled>a:focus, .pager .disabled>a:hover, .pager .disabled>span {
color:#999;
cursor:not-allowed;
background-color:#fff
}
.label {
display:inline;
padding:.2em .6em .3em;
font-size:75%;
font-weight:700;
line-height:1;
color:#fff;
text-align:center;
white-space:nowrap;
vertical-align:baseline;
border-radius:.25em
}
.label[href]:focus, .label[href]:hover {
color:#fff;
text-decoration:none;
cursor:pointer
}
.label:empty {
display:none
}
.btn .label {
position:relative;
top:-1px
}
.label-default {
background-color:#999
}
.label-default[href]:focus, .label-default[href]:hover {
background-color:gray
}
.label-primary {
background-color:#428bca
}
.label-primary[href]:focus, .label-primary[href]:hover {
background-color:#3071a9
}
.label-success {
background-color:#5cb85c
}
.label-success[href]:focus, .label-success[href]:hover {
background-color:#449d44
}
.label-info {
background-color:#5bc0de
}
.label-info[href]:focus, .label-info[href]:hover {
background-color:#31b0d5
}
.label-warning {
background-color:#f0ad4e
}
.label-warning[href]:focus, .label-warning[href]:hover {
background-color:#ec971f
}
.label-danger {
background-color:#d9534f
}
.label-danger[href]:focus, .label-danger[href]:hover {
background-color:#c9302c
}
.badge {
display:inline-block;
min-width:10px;
padding:3px 7px;
font-size:12px;
font-weight:700;
line-height:1;
color:#fff;
text-align:center;
white-space:nowrap;
vertical-align:baseline;
background-color:#999;
border-radius:10px
}
.badge:empty {
display:none
}
.btn .badge {
position:relative;
top:-1px
}
a.badge:focus, a.badge:hover {
color:#fff;
text-decoration:none;
cursor:pointer
}
.nav-pills>.active>a>.badge, a.list-group-item.active>.badge {
color:#428bca;
background-color:#fff
}
.nav-pills>li>a>.badge {
margin-left:3px
}
.jumbotron {
padding:30px;
margin-bottom:30px;
font-size:21px;
font-weight:200;
line-height:2.1428571435;
color:inherit;
background-color:#eee
}
.jumbotron .h1, .jumbotron h1 {
line-height:1;
color:inherit
}
.jumbotron p {
line-height:1.4
}
.container .jumbotron {
border-radius:6px
}
.jumbotron .container {
max-width:100%
}
@media screen and (min-width:768px) {
.jumbotron {
padding-top:48px;
padding-bottom:48px
}
.container .jumbotron {
padding-right:60px;
padding-left:60px
}
.jumbotron .h1, .jumbotron h1 {
font-size:63px
}
}
.thumbnail {
display:block;
padding:4px;
margin-bottom:20px;
line-height:1.428571429;
background-color:#fff;
border:1px solid #ddd;
border-radius:4px;
-webkit-transition:all .2s ease-in-out;
transition:all .2s ease-in-out
}
.thumbnail a>img, .thumbnail>img {
display:block;
height:auto;
max-width:100%;
margin-right:auto;
margin-left:auto
}
a.thumbnail.active, a.thumbnail:focus, a.thumbnail:hover {
border-color:#428bca
}
.thumbnail .caption {
padding:9px;
color:#333
}
.alert {
padding:15px;
margin-bottom:20px;
border:1px solid transparent;
border-radius:4px
}
.alert h4 {
margin-top:0;
color:inherit
}
.alert .alert-link {
font-weight:700
}
.alert>p, .alert>ul {
margin-bottom:0
}
.alert>p+p {
margin-top:5px
}
.alert-dismissable {
padding-right:35px
}
.alert-dismissable .close {
position:relative;
top:-2px;
right:-21px;
color:inherit
}
.alert-success {
color:#3c763d;
background-color:#dff0d8;
border-color:#d6e9c6
}
.alert-success hr {
border-top-color:#c9e2b3
}
.alert-success .alert-link {
color:#2b542c
}
.alert-info {
color:#31708f;
background-color:#d9edf7;
border-color:#bce8f1
}
.alert-info hr {
border-top-color:#a6e1ec
}
.alert-info .alert-link {
color:#245269
}
.alert-warning {
color:#8a6d3b;
background-color:#fcf8e3;
border-color:#faebcc
}
.alert-warning hr {
border-top-color:#f7e1b5
}
.alert-warning .alert-link {
color:#66512c
}
.alert-danger {
color:#a94442;
background-color:#f2dede;
border-color:#ebccd1
}
.alert-danger hr {
border-top-color:#e4b9c0
}
.alert-danger .alert-link {
color:#843534
}
@-webkit-keyframes progress-bar-stripes {
from {
background-position:40px 0
}
to {
background-position:0 0
}
}
@keyframes progress-bar-stripes {
from {
background-position:40px 0
}
to {
background-position:0 0
}
}
.progress {
height:20px;
margin-bottom:20px;
overflow:hidden;
background-color:#f5f5f5;
border-radius:4px;
-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, .1);
box-shadow:inset 0 1px 2px rgba(0, 0, 0, .1)
}
.progress-bar {
float:left;
width:0;
height:100%;
font-size:12px;
line-height:20px;
color:#fff;
text-align:center;
background-color:#428bca;
-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, .15);
box-shadow:inset 0 -1px 0 rgba(0, 0, 0, .15);
-webkit-transition:width .6s ease;
transition:width .6s ease
}
.progress-striped .progress-bar {
background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent);
background-image:linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent);
background-size:40px 40px
}
.progress.active .progress-bar {
-webkit-animation:progress-bar-stripes 2s linear infinite;
animation:progress-bar-stripes 2s linear infinite
}
.progress-bar-success {
background-color:#5cb85c
}
.progress-striped .progress-bar-success {
background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent);
background-image:linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent)
}
.progress-bar-info {
background-color:#5bc0de
}
.progress-striped .progress-bar-info {
background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent);
background-image:linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent)
}
.progress-bar-warning {
background-color:#f0ad4e
}
.progress-striped .progress-bar-warning {
background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent);
background-image:linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent)
}
.progress-bar-danger {
background-color:#d9534f
}
.progress-striped .progress-bar-danger {
background-image:-webkit-linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent);
background-image:linear-gradient(45deg, rgba(255, 255, 255, .15)25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15)50%, rgba(255, 255, 255, .15)75%, transparent 75%, transparent)
}
.media, .media-body {
overflow:hidden;
zoom:1
}
.media, .media .media {
margin-top:15px
}
.media:first-child {
margin-top:0
}
.media-object {
display:block
}
.media-heading {
margin:0 0 5px
}
.media>.pull-left {
margin-right:10px
}
.media>.pull-right {
margin-left:10px
}
.media-list {
padding-left:0;
list-style:none
}
.list-group {
padding-left:0;
margin-bottom:20px
}
.list-group-item {
position:relative;
display:block;
padding:10px 15px;
margin-bottom:-1px;
background-color:#fff;
border:1px solid #ddd
}
.list-group-item:first-child {
border-top-right-radius:4px;
border-top-left-radius:4px
}
.list-group-item:last-child {
margin-bottom:0;
border-bottom-right-radius:4px;
border-bottom-left-radius:4px
}
.list-group-item>.badge {
float:right
}
.list-group-item>.badge+.badge {
margin-right:5px
}
a.list-group-item {
color:#555
}
a.list-group-item .list-group-item-heading {
color:#333
}
a.list-group-item:focus, a.list-group-item:hover {
text-decoration:none;
background-color:#f5f5f5
}
a.list-group-item.active, a.list-group-item.active:focus, a.list-group-item.active:hover {
z-index:2;
color:#fff;
background-color:#428bca;
border-color:#428bca
}
a.list-group-item.active .list-group-item-heading, a.list-group-item.active:focus .list-group-item-heading, a.list-group-item.active:hover .list-group-item-heading {
color:inherit
}
a.list-group-item.active .list-group-item-text, a.list-group-item.active:focus .list-group-item-text, a.list-group-item.active:hover .list-group-item-text {
color:#e1edf7
}
.list-group-item-heading {
margin-top:0;
margin-bottom:5px
}
.list-group-item-text {
margin-bottom:0;
line-height:1.3
}
.panel {
margin-bottom:20px;
background-color:#fff;
border:1px solid transparent;
border-radius:4px;
-webkit-box-shadow:0 1px 1px rgba(0, 0, 0, .05);
box-shadow:0 1px 1px rgba(0, 0, 0, .05)
}
.panel-body {
padding:15px
}
.panel-body:after, .panel-body:before {
display:table;
content:" "
}
.panel-body:after {
clear:both
}
.panel>.list-group {
margin-bottom:0
}
.panel>.list-group .list-group-item {
border-width:1px 0
}
.panel>.list-group .list-group-item:first-child {
border-top-right-radius:0;
border-top-left-radius:0
}
.panel>.list-group .list-group-item:last-child {
border-bottom:0
}
.panel-heading+.list-group .list-group-item:first-child {
border-top-width:0
}
.panel>.table, .panel>.table-responsive>.table {
margin-bottom:0
}
.panel>.panel-body+.table, .panel>.panel-body+.table-responsive {
border-top:1px solid #ddd
}
.panel>.table>tbody:first-child td, .panel>.table>tbody:first-child th {
border-top:0
}
.panel>.table-bordered, .panel>.table-responsive>.table-bordered {
border:0
}
.panel>.table-bordered>tbody>tr>td:first-child, .panel>.table-bordered>tbody>tr>th:first-child, .panel>.table-bordered>tfoot>tr>td:first-child, .panel>.table-bordered>tfoot>tr>th:first-child, .panel>.table-bordered>thead>tr>td:first-child, .panel>.table-bordered>thead>tr>th:first-child, .panel>.table-responsive>.table-bordered>tbody>tr>td:first-child, .panel>.table-responsive>.table-bordered>tbody>tr>th:first-child, .panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child, .panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child, .panel>.table-responsive>.table-bordered>thead>tr>td:first-child, .panel>.table-responsive>.table-bordered>thead>tr>th:first-child {
border-left:0
}
.panel>.table-bordered>tbody>tr>td:last-child, .panel>.table-bordered>tbody>tr>th:last-child, .panel>.table-bordered>tfoot>tr>td:last-child, .panel>.table-bordered>tfoot>tr>th:last-child, .panel>.table-bordered>thead>tr>td:last-child, .panel>.table-bordered>thead>tr>th:last-child, .panel>.table-responsive>.table-bordered>tbody>tr>td:last-child, .panel>.table-responsive>.table-bordered>tbody>tr>th:last-child, .panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child, .panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child, .panel>.table-responsive>.table-bordered>thead>tr>td:last-child, .panel>.table-responsive>.table-bordered>thead>tr>th:last-child {
border-right:0
}
.panel>.table-bordered>tbody>tr:last-child>td, .panel>.table-bordered>tbody>tr:last-child>th, .panel>.table-bordered>tfoot>tr:last-child>td, .panel>.table-bordered>tfoot>tr:last-child>th, .panel>.table-bordered>thead>tr:last-child>td, .panel>.table-bordered>thead>tr:last-child>th, .panel>.table-responsive>.table-bordered>tbody>tr:last-child>td, .panel>.table-responsive>.table-bordered>tbody>tr:last-child>th, .panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td, .panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th, .panel>.table-responsive>.table-bordered>thead>tr:last-child>td, .panel>.table-responsive>.table-bordered>thead>tr:last-child>th {
border-bottom:0
}
.panel>.table-responsive {
margin-bottom:0;
border:0
}
.panel-heading {
padding:10px 15px;
border-bottom:1px solid transparent;
border-top-right-radius:3px;
border-top-left-radius:3px
}
.panel-heading>.dropdown .dropdown-toggle {
color:inherit
}
.panel-title {
margin-top:0;
margin-bottom:0;
font-size:16px;
color:inherit
}
.panel-title>a {
color:inherit
}
.panel-footer {
padding:10px 15px;
background-color:#f5f5f5;
border-top:1px solid #ddd;
border-bottom-right-radius:3px;
border-bottom-left-radius:3px
}
.panel-group .panel {
margin-bottom:0;
overflow:hidden;
border-radius:4px
}
.panel-group .panel+.panel {
margin-top:5px
}
.panel-group .panel-heading {
border-bottom:0
}
.panel-group .panel-heading+.panel-collapse .panel-body {
border-top:1px solid #ddd
}
.panel-group .panel-footer {
border-top:0
}
.panel-group .panel-footer+.panel-collapse .panel-body {
border-bottom:1px solid #ddd
}
.panel-default {
border-color:#ddd
}
.panel-default>.panel-heading {
color:#333;
background-color:#f5f5f5;
border-color:#ddd
}
.panel-default>.panel-heading+.panel-collapse .panel-body {
border-top-color:#ddd
}
.panel-default>.panel-footer+.panel-collapse .panel-body {
border-bottom-color:#ddd
}
.panel-primary {
border-color:#428bca
}
.panel-primary>.panel-heading {
color:#fff;
background-color:#428bca;
border-color:#428bca
}
.panel-primary>.panel-heading+.panel-collapse .panel-body {
border-top-color:#428bca
}
.panel-primary>.panel-footer+.panel-collapse .panel-body {
border-bottom-color:#428bca
}
.panel-success {
border-color:#d6e9c6
}
.panel-success>.panel-heading {
color:#3c763d;
background-color:#dff0d8;
border-color:#d6e9c6
}
.panel-success>.panel-heading+.panel-collapse .panel-body {
border-top-color:#d6e9c6
}
.panel-success>.panel-footer+.panel-collapse .panel-body {
border-bottom-color:#d6e9c6
}
.panel-warning {
border-color:#faebcc
}
.panel-warning>.panel-heading {
color:#8a6d3b;
background-color:#fcf8e3;
border-color:#faebcc
}
.panel-warning>.panel-heading+.panel-collapse .panel-body {
border-top-color:#faebcc
}
.panel-warning>.panel-footer+.panel-collapse .panel-body {
border-bottom-color:#faebcc
}
.panel-danger {
border-color:#ebccd1
}
.panel-danger>.panel-heading {
color:#a94442;
background-color:#f2dede;
border-color:#ebccd1
}
.panel-danger>.panel-heading+.panel-collapse .panel-body {
border-top-color:#ebccd1
}
.panel-danger>.panel-footer+.panel-collapse .panel-body {
border-bottom-color:#ebccd1
}
.panel-info {
border-color:#bce8f1
}
.panel-info>.panel-heading {
color:#31708f;
background-color:#d9edf7;
border-color:#bce8f1
}
.panel-info>.panel-heading+.panel-collapse .panel-body {
border-top-color:#bce8f1
}
.panel-info>.panel-footer+.panel-collapse .panel-body {
border-bottom-color:#bce8f1
}
.well {
min-height:20px;
padding:19px;
margin-bottom:20px;
background-color:#f5f5f5;
border:1px solid #e3e3e3;
border-radius:4px;
-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, .05);
box-shadow:inset 0 1px 1px rgba(0, 0, 0, .05)
}
.well blockquote {
border-color:#ddd;
border-color:rgba(0, 0, 0, .15)
}
.well-lg {
padding:24px;
border-radius:6px
}
.well-sm {
padding:9px;
border-radius:3px
}
.close {
float:right;
font-size:21px;
font-weight:700;
line-height:1;
color:#000;
text-shadow:0 1px 0 #fff;
opacity:.2;
filter:alpha(opacity=20)
}
.close:focus, .close:hover {
color:#000;
text-decoration:none;
cursor:pointer;
opacity:.5;
filter:alpha(opacity=50)
}
button.close {
padding:0;
cursor:pointer;
background:0 0;
border:0;
-webkit-appearance:none
}
.modal {
position:fixed;
top:0;
right:0;
bottom:0;
left:0;
z-index:1040;
display:none;
}
.modal.fade .modal-dialog {
-webkit-transform:translate(0, -25%);
-ms-transform:translate(0, -25%);
transform:translate(0, -25%);
-webkit-transition:-webkit-transform .3s ease-out;
-moz-transition:-moz-transform .3s ease-out;
-o-transition:-o-transform .3s ease-out;
transition:transform .3s ease-out
}
.modal.in .modal-dialog {
-webkit-transform:translate(0, 0);
-ms-transform:translate(0, 0);
transform:translate(0, 0)
}
.modal-dialog {
position:relative;
z-index:1050;
width:auto;
margin:10px
}
.modal-content {
position:relative;
background-color:#fff;
border:1px solid #999;
border:1px solid rgba(0, 0, 0, .2);
border-radius:6px;
outline:0;
-webkit-box-shadow:0 3px 9px rgba(0, 0, 0, .5);
box-shadow:0 3px 9px rgba(0, 0, 0, .5);
background-clip:padding-box
}
.modal-backdrop {
position:fixed;
top:0;
right:0;
bottom:0;
left:0;
z-index:1030;
background-color:#000
}
.modal-backdrop.fade {
opacity:0;
filter:alpha(opacity=0)
}
.modal-backdrop.in {
opacity:.5;
filter:alpha(opacity=50)
}
.modal-header {
min-height:16.43px;
padding:15px;
border-bottom:1px solid #e5e5e5
}
.modal-header .close {
margin-top:-2px
}
.modal-title {
margin:0;
line-height:1.428571429
}
.modal-body {
position:relative;
padding:20px
}
.modal-footer {
padding:19px 20px 20px;
margin-top:15px;
text-align:right;
border-top:1px solid #e5e5e5
}
.modal-footer:after, .modal-footer:before {
display:table;
content:" "
}
.modal-footer:after {
clear:both
}
.modal-footer .btn+.btn {
margin-bottom:0;
margin-left:5px
}
.modal-footer .btn-group .btn+.btn {
margin-left:-1px
}
.modal-footer .btn-block+.btn-block {
margin-left:0
}
@media screen and (min-width:768px) {
.modal-dialog {
width:600px;
margin:30px auto
}
.modal-content {
-webkit-box-shadow:0 5px 15px rgba(0, 0, 0, .5);
box-shadow:0 5px 15px rgba(0, 0, 0, .5)
}
}
.tooltip {
position:absolute;
z-index:1030;
display:block;
font-size:12px;
line-height:1.4;
opacity:0;
filter:alpha(opacity=0);
visibility:visible
}
.tooltip.in {
opacity:.9;
filter:alpha(opacity=90)
}
.tooltip.top {
padding:5px 0;
margin-top:-3px
}
.tooltip.right {
padding:0 5px;
margin-left:3px
}
.tooltip.bottom {
padding:5px 0;
margin-top:3px
}
.tooltip.left {
padding:0 5px;
margin-left:-3px
}
.tooltip-inner {
max-width:200px;
padding:3px 8px;
color:#fff;
text-align:center;
text-decoration:none;
background-color:#000;
border-radius:4px
}
.tooltip-arrow {
position:absolute;
width:0;
height:0;
border-color:transparent;
border-style:solid
}
.tooltip.top .tooltip-arrow {
bottom:0;
left:50%;
margin-left:-5px;
border-top-color:#000;
border-width:5px 5px 0
}
.tooltip.top-left .tooltip-arrow {
bottom:0;
left:5px;
border-top-color:#000;
border-width:5px 5px 0
}
.tooltip.top-right .tooltip-arrow {
right:5px;
bottom:0;
border-top-color:#000;
border-width:5px 5px 0
}
.tooltip.right .tooltip-arrow {
top:50%;
left:0;
margin-top:-5px;
border-right-color:#000;
border-width:5px 5px 5px 0
}
.tooltip.left .tooltip-arrow {
top:50%;
right:0;
margin-top:-5px;
border-left-color:#000;
border-width:5px 0 5px 5px
}
.tooltip.bottom .tooltip-arrow {
top:0;
left:50%;
margin-left:-5px;
border-bottom-color:#000;
border-width:0 5px 5px
}
.tooltip.bottom-left .tooltip-arrow {
top:0;
left:5px;
border-bottom-color:#000;
border-width:0 5px 5px
}
.tooltip.bottom-right .tooltip-arrow {
top:0;
right:5px;
border-bottom-color:#000;
border-width:0 5px 5px
}
.popover {
position:absolute;
top:0;
left:0;
z-index:1010;
display:none;
max-width:276px;
padding:1px;
text-align:left;
white-space:normal;
background-color:#fff;
border:1px solid #ccc;
border:1px solid rgba(0, 0, 0, .2);
border-radius:6px;
-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, .2);
box-shadow:0 5px 10px rgba(0, 0, 0, .2);
background-clip:padding-box
}
.popover.top {
margin-top:-10px
}
.popover.right {
margin-left:10px
}
.popover.bottom {
margin-top:10px
}
.popover.left {
margin-left:-10px
}
.popover-title {
padding:8px 14px;
margin:0;
font-size:14px;
font-weight:400;
line-height:18px;
background-color:#f7f7f7;
border-bottom:1px solid #ebebeb;
border-radius:5px 5px 0 0
}
.popover-content {
padding:9px 14px
}
.popover .arrow, .popover .arrow:after {
position:absolute;
display:block;
width:0;
height:0;
border-color:transparent;
border-style:solid
}
.popover .arrow {
border-width:11px
}
.popover .arrow:after {
border-width:10px;
content:""
}
.popover.top .arrow {
bottom:-11px;
left:50%;
margin-left:-11px;
border-top-color:#999;
border-top-color:rgba(0, 0, 0, .25);
border-bottom-width:0
}
.popover.top .arrow:after {
bottom:1px;
margin-left:-10px;
border-top-color:#fff;
border-bottom-width:0;
content:" "
}
.popover.right .arrow {
top:50%;
left:-11px;
margin-top:-11px;
border-right-color:#999;
border-right-color:rgba(0, 0, 0, .25);
border-left-width:0
}
.popover.right .arrow:after {
bottom:-10px;
left:1px;
border-right-color:#fff;
border-left-width:0;
content:" "
}
.popover.bottom .arrow {
top:-11px;
left:50%;
margin-left:-11px;
border-bottom-color:#999;
border-bottom-color:rgba(0, 0, 0, .25);
border-top-width:0
}
.popover.bottom .arrow:after {
top:1px;
margin-left:-10px;
border-bottom-color:#fff;
border-top-width:0;
content:" "
}
.popover.left .arrow {
top:50%;
right:-11px;
margin-top:-11px;
border-left-color:#999;
border-left-color:rgba(0, 0, 0, .25);
border-right-width:0
}
.popover.left .arrow:after {
right:1px;
bottom:-10px;
border-left-color:#fff;
border-right-width:0;
content:" "
}
.carousel {
position:relative
}
.carousel-inner {
position:relative;
width:100%;
overflow:hidden
}
.carousel-inner>.item {
position:relative;
display:none;
-webkit-transition:.6s ease-in-out left;
transition:.6s ease-in-out left
}
.carousel-inner>.item>a>img, .carousel-inner>.item>img {
display:block;
height:auto;
max-width:100%;
line-height:1
}
.carousel-inner>.active, .carousel-inner>.next, .carousel-inner>.prev {
display:block
}
.carousel-inner>.active {
left:0
}
.carousel-inner>.next, .carousel-inner>.prev {
position:absolute;
top:0;
width:100%
}
.carousel-inner>.next {
left:100%
}
.carousel-inner>.prev {
left:-100%
}
.carousel-inner>.next.left, .carousel-inner>.prev.right {
left:0
}
.carousel-inner>.active.left {
left:-100%
}
.carousel-inner>.active.right {
left:100%
}
.carousel-control {
position:absolute;
top:0;
bottom:0;
left:0;
width:15%;
font-size:20px;
color:#fff;
text-align:center;
text-shadow:0 1px 2px rgba(0, 0, 0, .6);
opacity:.5;
filter:alpha(opacity=50)
}
.carousel-control.left {
background-image:-webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, .5)0), color-stop(rgba(0, 0, 0, .0001)100%));
background-image:linear-gradient(to right, rgba(0, 0, 0, .5)0, rgba(0, 0, 0, .0001)100%);
background-repeat:repeat-x;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)
}
.carousel-control.right {
right:0;
left:auto;
background-image:-webkit-linear-gradient(left, color-stop(rgba(0, 0, 0, .0001)0), color-stop(rgba(0, 0, 0, .5)100%));
background-image:linear-gradient(to right, rgba(0, 0, 0, .0001)0, rgba(0, 0, 0, .5)100%);
background-repeat:repeat-x;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)
}
.carousel-control:focus, .carousel-control:hover {
color:#fff;
text-decoration:none;
outline:0;
opacity:.9;
filter:alpha(opacity=90)
}
.carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-next, .carousel-control .icon-prev {
position:absolute;
top:50%;
z-index:5;
display:inline-block
}
.carousel-control .glyphicon-chevron-left, .carousel-control .icon-prev {
left:50%
}
.carousel-control .glyphicon-chevron-right, .carousel-control .icon-next {
right:50%
}
.carousel-control .icon-next, .carousel-control .icon-prev {
width:20px;
height:20px;
margin-top:-10px;
margin-left:-10px;
font-family:serif
}
.carousel-control .icon-prev:before {
content:'\2039'
}
.carousel-control .icon-next:before {
content:'\203a'
}
.carousel-indicators {
position:absolute;
bottom:10px;
left:50%;
z-index:15;
width:60%;
padding-left:0;
margin-left:-30%;
text-align:center;
list-style:none
}
.carousel-indicators li {
display:inline-block;
width:10px;
height:10px;
margin:1px;
text-indent:-999px;
cursor:pointer;
background-color:#000 \9;
background-color:rgba(0, 0, 0, 0);
border:1px solid #fff;
border-radius:10px
}
.carousel-indicators .active {
width:12px;
height:12px;
margin:0;
background-color:#fff
}
.carousel-caption {
position:absolute;
right:15%;
bottom:20px;
left:15%;
z-index:10;
padding-top:20px;
padding-bottom:20px;
color:#fff;
text-align:center;
text-shadow:0 1px 2px rgba(0, 0, 0, .6)
}
.carousel-caption .btn {
text-shadow:none
}
@media screen and (min-width:768px) {
.carousel-control .glyphicons-chevron-left, .carousel-control .glyphicons-chevron-right, .carousel-control .icon-next, .carousel-control .icon-prev {
width:30px;
height:30px;
margin-top:-15px;
margin-left:-15px;
font-size:30px
}
.carousel-caption {
right:20%;
left:20%;
padding-bottom:30px
}
.carousel-indicators {
bottom:20px
}
}
.clearfix:after, .clearfix:before {
display:table;
content:" "
}
.clearfix:after {
clear:both
}
.center-block {
display:block;
margin-right:auto;
margin-left:auto
}
.pull-right {
float:right!important
}
.pull-left {
float:left!important
}
.hide {
display:none!important
}
.show {
display:block!important
}
.invisible {
visibility:hidden
}
.text-hide {
font:0/0 a;
color:transparent;
text-shadow:none;
background-color:transparent;
border:0
}
.hidden {
display:none!important;
visibility:hidden!important
}
.affix {
position:fixed
}
@-ms-viewport {
width:device-width
}
.visible-lg, .visible-md, .visible-sm, .visible-xs, td.visible-lg, td.visible-md, td.visible-sm, td.visible-xs, th.visible-lg, th.visible-md, th.visible-sm, th.visible-xs, tr.visible-lg, tr.visible-md, tr.visible-sm, tr.visible-xs {
display:none!important
}
@media(max-width:767px) {
.visible-xs {
display:block!important
}
table.visible-xs {
display:table
}
tr.visible-xs {
display:table-row!important
}
td.visible-xs, th.visible-xs {
display:table-cell!important
}
}
@media(min-width:768px) and (max-width:991px) {
.visible-xs.visible-sm {
display:block!important
}
table.visible-xs.visible-sm {
display:table
}
tr.visible-xs.visible-sm {
display:table-row!important
}
td.visible-xs.visible-sm, th.visible-xs.visible-sm {
display:table-cell!important
}
}
@media(min-width:992px) and (max-width:1199px) {
.visible-xs.visible-md {
display:block!important
}
table.visible-xs.visible-md {
display:table
}
tr.visible-xs.visible-md {
display:table-row!important
}
td.visible-xs.visible-md, th.visible-xs.visible-md {
display:table-cell!important
}
}
@media(min-width:1200px) {
.visible-xs.visible-lg {
display:block!important
}
table.visible-xs.visible-lg {
display:table
}
tr.visible-xs.visible-lg {
display:table-row!important
}
td.visible-xs.visible-lg, th.visible-xs.visible-lg {
display:table-cell!important
}
}
@media(max-width:767px) {
.visible-sm.visible-xs {
display:block!important
}
table.visible-sm.visible-xs {
display:table
}
tr.visible-sm.visible-xs {
display:table-row!important
}
td.visible-sm.visible-xs, th.visible-sm.visible-xs {
display:table-cell!important
}
}
@media(min-width:768px) and (max-width:991px) {
.visible-sm {
display:block!important
}
table.visible-sm {
display:table
}
tr.visible-sm {
display:table-row!important
}
td.visible-sm, th.visible-sm {
display:table-cell!important
}
}
@media(min-width:992px) and (max-width:1199px) {
.visible-sm.visible-md {
display:block!important
}
table.visible-sm.visible-md {
display:table
}
tr.visible-sm.visible-md {
display:table-row!important
}
td.visible-sm.visible-md, th.visible-sm.visible-md {
display:table-cell!important
}
}
@media(min-width:1200px) {
.visible-sm.visible-lg {
display:block!important
}
table.visible-sm.visible-lg {
display:table
}
tr.visible-sm.visible-lg {
display:table-row!important
}
td.visible-sm.visible-lg, th.visible-sm.visible-lg {
display:table-cell!important
}
}
@media(max-width:767px) {
.visible-md.visible-xs {
display:block!important
}
table.visible-md.visible-xs {
display:table
}
tr.visible-md.visible-xs {
display:table-row!important
}
td.visible-md.visible-xs, th.visible-md.visible-xs {
display:table-cell!important
}
}
@media(min-width:768px) and (max-width:991px) {
.visible-md.visible-sm {
display:block!important
}
table.visible-md.visible-sm {
display:table
}
tr.visible-md.visible-sm {
display:table-row!important
}
td.visible-md.visible-sm, th.visible-md.visible-sm {
display:table-cell!important
}
}
@media(min-width:992px) and (max-width:1199px) {
.visible-md {
display:block!important
}
table.visible-md {
display:table
}
tr.visible-md {
display:table-row!important
}
td.visible-md, th.visible-md {
display:table-cell!important
}
}
@media(min-width:1200px) {
.visible-md.visible-lg {
display:block!important
}
table.visible-md.visible-lg {
display:table
}
tr.visible-md.visible-lg {
display:table-row!important
}
td.visible-md.visible-lg, th.visible-md.visible-lg {
display:table-cell!important
}
}
@media(max-width:767px) {
.visible-lg.visible-xs {
display:block!important
}
table.visible-lg.visible-xs {
display:table
}
tr.visible-lg.visible-xs {
display:table-row!important
}
td.visible-lg.visible-xs, th.visible-lg.visible-xs {
display:table-cell!important
}
}
@media(min-width:768px) and (max-width:991px) {
.visible-lg.visible-sm {
display:block!important
}
table.visible-lg.visible-sm {
display:table
}
tr.visible-lg.visible-sm {
display:table-row!important
}
td.visible-lg.visible-sm, th.visible-lg.visible-sm {
display:table-cell!important
}
}
@media(min-width:992px) and (max-width:1199px) {
.visible-lg.visible-md {
display:block!important
}
table.visible-lg.visible-md {
display:table
}
tr.visible-lg.visible-md {
display:table-row!important
}
td.visible-lg.visible-md, th.visible-lg.visible-md {
display:table-cell!important
}
}
@media(min-width:1200px) {
.visible-lg {
display:block!important
}
table.visible-lg {
display:table
}
tr.visible-lg {
display:table-row!important
}
td.visible-lg, th.visible-lg {
display:table-cell!important
}
}
.hidden-xs {
display:block!important
}
table.hidden-xs {
display:table
}
tr.hidden-xs {
display:table-row!important
}
td.hidden-xs, th.hidden-xs {
display:table-cell!important
}
@media(max-width:767px) {
.hidden-xs, td.hidden-xs, th.hidden-xs, tr.hidden-xs {
display:none!important
}
}
@media(min-width:768px) and (max-width:991px) {
.hidden-xs.hidden-sm, td.hidden-xs.hidden-sm, th.hidden-xs.hidden-sm, tr.hidden-xs.hidden-sm {
display:none!important
}
}
@media(min-width:992px) and (max-width:1199px) {
.hidden-xs.hidden-md, td.hidden-xs.hidden-md, th.hidden-xs.hidden-md, tr.hidden-xs.hidden-md {
display:none!important
}
}
@media(min-width:1200px) {
.hidden-xs.hidden-lg, td.hidden-xs.hidden-lg, th.hidden-xs.hidden-lg, tr.hidden-xs.hidden-lg {
display:none!important
}
}
.hidden-sm {
display:block!important
}
table.hidden-sm {
display:table
}
tr.hidden-sm {
display:table-row!important
}
td.hidden-sm, th.hidden-sm {
display:table-cell!important
}
@media(max-width:767px) {
.hidden-sm.hidden-xs, td.hidden-sm.hidden-xs, th.hidden-sm.hidden-xs, tr.hidden-sm.hidden-xs {
display:none!important
}
}
@media(min-width:768px) and (max-width:991px) {
.hidden-sm, td.hidden-sm, th.hidden-sm, tr.hidden-sm {
display:none!important
}
}
@media(min-width:992px) and (max-width:1199px) {
.hidden-sm.hidden-md, td.hidden-sm.hidden-md, th.hidden-sm.hidden-md, tr.hidden-sm.hidden-md {
display:none!important
}
}
@media(min-width:1200px) {
.hidden-sm.hidden-lg, td.hidden-sm.hidden-lg, th.hidden-sm.hidden-lg, tr.hidden-sm.hidden-lg {
display:none!important
}
}
.hidden-md {
display:block!important
}
table.hidden-md {
display:table
}
tr.hidden-md {
display:table-row!important
}
td.hidden-md, th.hidden-md {
display:table-cell!important
}
@media(max-width:767px) {
.hidden-md.hidden-xs, td.hidden-md.hidden-xs, th.hidden-md.hidden-xs, tr.hidden-md.hidden-xs {
display:none!important
}
}
@media(min-width:768px) and (max-width:991px) {
.hidden-md.hidden-sm, td.hidden-md.hidden-sm, th.hidden-md.hidden-sm, tr.hidden-md.hidden-sm {
display:none!important
}
}
@media(min-width:992px) and (max-width:1199px) {
.hidden-md, td.hidden-md, th.hidden-md, tr.hidden-md {
display:none!important
}
}
@media(min-width:1200px) {
.hidden-md.hidden-lg, td.hidden-md.hidden-lg, th.hidden-md.hidden-lg, tr.hidden-md.hidden-lg {
display:none!important
}
}
.hidden-lg {
display:block!important
}
table.hidden-lg {
display:table
}
tr.hidden-lg {
display:table-row!important
}
td.hidden-lg, th.hidden-lg {
display:table-cell!important
}
@media(max-width:767px) {
.hidden-lg.hidden-xs, td.hidden-lg.hidden-xs, th.hidden-lg.hidden-xs, tr.hidden-lg.hidden-xs {
display:none!important
}
}
@media(min-width:768px) and (max-width:991px) {
.hidden-lg.hidden-sm, td.hidden-lg.hidden-sm, th.hidden-lg.hidden-sm, tr.hidden-lg.hidden-sm {
display:none!important
}
}
@media(min-width:992px) and (max-width:1199px) {
.hidden-lg.hidden-md, td.hidden-lg.hidden-md, th.hidden-lg.hidden-md, tr.hidden-lg.hidden-md {
display:none!important
}
}
@media(min-width:1200px) {
.hidden-lg, td.hidden-lg, th.hidden-lg, tr.hidden-lg {
display:none!important
}
}
.visible-print, td.visible-print, th.visible-print, tr.visible-print {
display:none!important
}
@media print {
.visible-print {
display:block!important
}
table.visible-print {
display:table
}
tr.visible-print {
display:table-row!important
}
td.visible-print, th.visible-print {
display:table-cell!important
}
.hidden-print, td.hidden-print, th.hidden-print, tr.hidden-print {
display:none!important
}
}
| {
"content_hash": "1e38582ce8d425107cceae26d35f060a",
"timestamp": "",
"source": "github",
"line_count": 5087,
"max_line_length": 684,
"avg_line_length": 21.00039315903283,
"alnum_prop": 0.7158823914854581,
"repo_name": "q178015846/yankee",
"id": "26ab4eedf56e945f0a0cc0dae4bff181ab84b86a",
"size": "106975",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "catalog/view/theme/optimus/stylesheet/bootstrap.min.css",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1624094"
},
{
"name": "HTML",
"bytes": "277017"
},
{
"name": "JavaScript",
"bytes": "1158162"
},
{
"name": "Makefile",
"bytes": "285"
},
{
"name": "PHP",
"bytes": "6051385"
},
{
"name": "Shell",
"bytes": "680"
},
{
"name": "Smarty",
"bytes": "3504838"
}
],
"symlink_target": ""
} |
package org.apache.commons.geometry.core.partitioning;
/** Class containing the result of splitting an object with a hyperplane.
* @param <T> Split type
*/
public final class Split<T> {
/** Part of the object lying on the minus side of the splitting hyperplane.
*/
private final T minus;
/** Part of the object lying on the plus side of the splitting hyperplane.
*/
private final T plus;
/** Build a new instance from its parts.
* @param minus part of the object lying on the minus side of the
* splitting hyperplane or null if no such part exists
* @param plus part of the object lying on the plus side of the
* splitting hyperplane or null if no such part exists.
*/
public Split(final T minus, final T plus) {
this.minus = minus;
this.plus = plus;
}
/** Get the part of the object lying on the minus side of the splitting
* hyperplane or null if no such part exists.
* @return part of the object lying on the minus side of the splitting
* hyperplane
*/
public T getMinus() {
return minus;
}
/** Get the part of the object lying on the plus side of the splitting
* hyperplane or null if no such part exists.
* @return part of the object lying on the plus side of the splitting
* hyperplane
*/
public T getPlus() {
return plus;
}
/** Get the location of the object with respect to its splitting
* hyperplane.
* @return
* <ul>
* <li>{@link SplitLocation#PLUS} - if only {@link #getPlus()} is not null</li>
* <li>{@link SplitLocation#MINUS} - if only {@link #getMinus()} is not null</li>
* <li>{@link SplitLocation#BOTH} - if both {@link #getPlus()} and {@link #getMinus()}
* are not null</li>
* <li>{@link SplitLocation#NEITHER} - if both {@link #getPlus()} and {@link #getMinus()}
* are null</li>
* </ul>
*/
public SplitLocation getLocation() {
if (minus != null) {
return plus != null ? SplitLocation.BOTH : SplitLocation.MINUS;
} else if (plus != null) {
return SplitLocation.PLUS;
}
return SplitLocation.NEITHER;
}
/** {@inheritDoc} */
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append(this.getClass().getSimpleName())
.append("[location= ")
.append(getLocation())
.append(", minus= ")
.append(minus)
.append(", plus= ")
.append(plus)
.append(']');
return sb.toString();
}
}
| {
"content_hash": "6ee3a085ef0f8bf83b6f826c8adcdfe8",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 98,
"avg_line_length": 32.926829268292686,
"alnum_prop": 0.5837037037037037,
"repo_name": "apache/commons-geometry",
"id": "20307e3131ccd5ffb26e83ca9de3faa36ba6282b",
"size": "3502",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "commons-geometry-core/src/main/java/org/apache/commons/geometry/core/partitioning/Split.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "5264839"
},
{
"name": "XSLT",
"bytes": "2509"
}
],
"symlink_target": ""
} |
#include "winsup.h"
#include "registry.h"
#include "cygerrno.h"
#include "path.h"
#include "fhandler.h"
#include "dtable.h"
#include "cygheap.h"
#include "tls_pbuf.h"
#include "ntdll.h"
#include <wchar.h>
/* Opens a key under the appropriate Cygwin key.
Do not use HKCU per MS KB 199190 */
static NTSTATUS
top_key (bool isHKLM, REGSAM access, PHANDLE top)
{
WCHAR rbuf[PATH_MAX], *p;
UNICODE_STRING rpath;
OBJECT_ATTRIBUTES attr;
NTSTATUS status;
InitializeObjectAttributes (&attr, &rpath, OBJ_CASE_INSENSITIVE, NULL, NULL);
if (isHKLM)
{
wcpcpy (rbuf, L"\\Registry\\Machine");
RtlInitUnicodeString (&rpath, rbuf);
status = NtOpenKey (top, access, &attr);
}
else
{
WCHAR name[128];
PCWSTR names[2] = {cygheap->user.get_windows_id (name),
L".DEFAULT"};
p = wcpcpy (rbuf, L"\\Registry\\User\\");
for (int i = 0; i < 2; i++)
{
wcpcpy (p, names[i]);
RtlInitUnicodeString (&rpath, rbuf);
status = NtOpenKey (top, access, &attr);
if (NT_SUCCESS (status))
break;
}
}
return status;
}
reg_key::reg_key (HKEY top, REGSAM access, ...): _disposition (0)
{
va_list av;
va_start (av, access);
build_reg (top, access, av);
va_end (av);
}
reg_key::reg_key (bool isHKLM, REGSAM access, ...): _disposition (0)
{
va_list av;
HANDLE top;
key_is_invalid = top_key (isHKLM, access, &top);
if (NT_SUCCESS (key_is_invalid))
{
new (this) reg_key ((HKEY) top, access, L"SOFTWARE",
_WIDE (CYGWIN_INFO_CYGWIN_REGISTRY_NAME), NULL);
NtClose (top);
if (key_is_invalid)
return;
top = key;
va_start (av, access);
build_reg ((HKEY) top, access, av);
va_end (av);
if (top != key)
NtClose (top);
}
}
void
reg_key::build_reg (HKEY top, REGSAM access, va_list av)
{
PWCHAR name;
HANDLE r;
UNICODE_STRING uname;
OBJECT_ATTRIBUTES attr;
NTSTATUS status;
if (top != HKEY_LOCAL_MACHINE && top != HKEY_CURRENT_USER)
r = (HANDLE) top;
else if (!NT_SUCCESS (top_key (top == HKEY_LOCAL_MACHINE, access, &r)))
return;
key_is_invalid = 0;
while ((name = va_arg (av, PWCHAR)) != NULL)
{
RtlInitUnicodeString (&uname, name);
InitializeObjectAttributes (&attr, &uname,
OBJ_CASE_INSENSITIVE | OBJ_OPENIF, r, NULL);
status = NtCreateKey (&key, access, &attr, 0, NULL,
REG_OPTION_NON_VOLATILE, &_disposition);
if (r != (HANDLE) top)
NtClose (r);
r = key;
if (!NT_SUCCESS (status))
{
key_is_invalid = status;
debug_printf ("failed to create key %S in the registry", &uname);
break;
}
}
}
/* Given the current registry key, return the specific DWORD value
requested. Return def on failure. */
DWORD
reg_key::get_dword (PCWSTR name, DWORD def)
{
if (key_is_invalid)
return def;
NTSTATUS status;
UNICODE_STRING uname;
ULONG size = sizeof (KEY_VALUE_PARTIAL_INFORMATION) + sizeof (DWORD);
ULONG rsize;
PKEY_VALUE_PARTIAL_INFORMATION vbuf = (PKEY_VALUE_PARTIAL_INFORMATION)
alloca (size);
RtlInitUnicodeString (&uname, name);
status = NtQueryValueKey (key, &uname, KeyValuePartialInformation, vbuf,
size, &rsize);
if (status != STATUS_SUCCESS || vbuf->Type != REG_DWORD)
return def;
DWORD *dst = (DWORD *) vbuf->Data;
return *dst;
}
/* Given the current registry key, set a specific DWORD value. */
NTSTATUS
reg_key::set_dword (PCWSTR name, DWORD val)
{
if (key_is_invalid)
return key_is_invalid;
DWORD value = (DWORD) val;
UNICODE_STRING uname;
RtlInitUnicodeString (&uname, name);
return NtSetValueKey (key, &uname, 0, REG_DWORD, &value, sizeof (value));
}
/* Given the current registry key, return the specific string value
requested. Return zero on success, non-zero on failure. */
NTSTATUS
reg_key::get_string (PCWSTR name, PWCHAR dst, size_t max, PCWSTR def)
{
NTSTATUS status;
if (key_is_invalid)
{
status = key_is_invalid;
if (def != NULL)
wcpncpy (dst, def, max);
}
else
{
UNICODE_STRING uname;
ULONG size = sizeof (KEY_VALUE_PARTIAL_INFORMATION) + max * sizeof (WCHAR);
ULONG rsize;
PKEY_VALUE_PARTIAL_INFORMATION vbuf = (PKEY_VALUE_PARTIAL_INFORMATION)
alloca (size);
RtlInitUnicodeString (&uname, name);
status = NtQueryValueKey (key, &uname, KeyValuePartialInformation, vbuf,
size, &rsize);
if (status != STATUS_SUCCESS || vbuf->Type != REG_SZ)
wcpncpy (dst, def, max);
else
wcpncpy (dst, (PWCHAR) vbuf->Data, max);
}
return status;
}
/* Given the current registry key, set a specific string value. */
NTSTATUS
reg_key::set_string (PCWSTR name, PCWSTR src)
{
if (key_is_invalid)
return key_is_invalid;
UNICODE_STRING uname;
RtlInitUnicodeString (&uname, name);
return NtSetValueKey (key, &uname, 0, REG_SZ, (PVOID) src,
(wcslen (src) + 1) * sizeof (WCHAR));
}
reg_key::~reg_key ()
{
if (!key_is_invalid)
NtClose (key);
key_is_invalid = 1;
}
| {
"content_hash": "ad211fafed1796bcb2a166f7c08c08ae",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 81,
"avg_line_length": 24.326829268292684,
"alnum_prop": 0.6328453980348907,
"repo_name": "jinankjain/barrelfish",
"id": "99b1d9b2dc768e87dde78c64e39aac4418e11ea8",
"size": "5338",
"binary": false,
"copies": "31",
"ref": "refs/heads/master",
"path": "lib/newlib/winsup/cygwin/registry.cc",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "2290523"
},
{
"name": "Awk",
"bytes": "570"
},
{
"name": "Batchfile",
"bytes": "1875"
},
{
"name": "C",
"bytes": "64605437"
},
{
"name": "C++",
"bytes": "6712275"
},
{
"name": "DIGITAL Command Language",
"bytes": "1044"
},
{
"name": "Emacs Lisp",
"bytes": "21698"
},
{
"name": "Groff",
"bytes": "81134"
},
{
"name": "Haskell",
"bytes": "98984"
},
{
"name": "Logos",
"bytes": "14359"
},
{
"name": "M4",
"bytes": "437022"
},
{
"name": "Makefile",
"bytes": "12680887"
},
{
"name": "Mathematica",
"bytes": "3483"
},
{
"name": "Objective-C",
"bytes": "73847"
},
{
"name": "Perl",
"bytes": "131093"
},
{
"name": "Python",
"bytes": "8193"
},
{
"name": "Shell",
"bytes": "380813"
},
{
"name": "SuperCollider",
"bytes": "8638"
},
{
"name": "Tcl",
"bytes": "123"
},
{
"name": "TeX",
"bytes": "409568"
},
{
"name": "XSLT",
"bytes": "4240"
},
{
"name": "Yacc",
"bytes": "8101"
}
],
"symlink_target": ""
} |
class CreateInstagramHashtags < ActiveRecord::Migration
def change
create_table :social_instagram_hashtags do |t|
t.string :hashtag
t.timestamps
end
add_index :social_instagram_hashtags, :hashtag
# Social::InstagramHashtag.create!(
# :hashtag => 'ryvita'
# )
end
end
| {
"content_hash": "ae281f96e7fa75fbe88ea0ef738527b5",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 55,
"avg_line_length": 20.8,
"alnum_prop": 0.6666666666666666,
"repo_name": "madetech/made-social-engine",
"id": "a6dba3a8b78eb100f912d20651887f9e7d67023d",
"size": "312",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "db/migrate/20140609162826_create_instagram_hashtags.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1092"
},
{
"name": "HTML",
"bytes": "3219"
},
{
"name": "JavaScript",
"bytes": "1282"
},
{
"name": "Ruby",
"bytes": "42791"
}
],
"symlink_target": ""
} |
<?php defined('SYSPATH') OR die('No direct access allowed.');
$lang = array
(
'userfile_not_set' => 'POST-переменная %s не найдена.',
'file_exceeds_limit' => 'Размер закачанного файла превышает максимальный разрешённый конфигурацией PHP',
'file_partial' => 'Файл закачан не полностью',
'no_file_selected' => 'Вы не выбрали файл для закачивания',
'invalid_filetype' => 'Тип файла, который вы пытаетесь закачать, не разрешён.',
'invalid_filesize' => 'Размер файла, который вы пытаетесь закачать, превышает максимальный разрешённый (%s)',
'invalid_dimensions' => 'Разрешение картинки, которую вы пытаетесь закачать, превышает максимальное разрешённое (%s)',
'destination_error' => 'Не удалось переместить закачанный файл в пункт назначения.',
'no_filepath' => 'Путь для закачивания некорректен.',
'no_file_types' => 'Вы не разрешили ни один тип файлов.',
'bad_filename' => 'Файл с таким именем уже существует на сервере.',
'not_writable' => 'Запись в целевой каталог, %s, не возможна.',
'error_on_file' => 'Ошибка при закачивании %s:',
// Error code responses
'set_allowed' => 'В целях безопасности, установите разрешённые для закачивания типы файлов.',
'max_file_size' => 'В целях безопасности, не используйте MAX_FILE_SIZE для ограничения размера закачиваемых файлов.',
'no_tmp_dir' => 'Временная директория для закачивания файлов не найдена.',
'tmp_unwritable' => 'Нет прав записи во временную директорию для закачивания файлов, %s.'
);
| {
"content_hash": "068696cd49f6b7cb1697e125e3d167a7",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 123,
"avg_line_length": 66.26086956521739,
"alnum_prop": 0.6988188976377953,
"repo_name": "micahroberson/kohana",
"id": "1363ee2c9bf1452e1be195f2770af33830670c8c",
"size": "2281",
"binary": false,
"copies": "12",
"ref": "refs/heads/master",
"path": "system/i18n/ru_RU/upload.php",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "62508"
},
{
"name": "PHP",
"bytes": "2693162"
},
{
"name": "Perl",
"bytes": "4816"
},
{
"name": "Shell",
"bytes": "816"
}
],
"symlink_target": ""
} |
__author__ = 'sphenrie'
from pyon.public import Container, ImmediateProcess
#from pyon.ion.endpoint import ProcessRPCClient
from pyon.util.context import LocalContextMixin
from pyon.core.governance import get_actor_header
from interface.services.examples.ihello_service import HelloServiceProcessClient
from interface.services.agent.icontainer_agent import ContainerAgentProcessClient
class FakeProcess(LocalContextMixin):
name = 'hello_client'
id = ''
class HelloClientProcess(ImmediateProcess):
"""
bin/pycc -x examples.hello_client.HelloClientProcess
"""
def on_init(self):
pass
def on_start(self):
text = self.CFG.get("text", 'mytext 123')
actor_id = self.CFG.get("actor_id", 'anonymous')
container_name = self.CFG.get("kill_container", None)
hello_client(self.container, actor_id, text )
if container_name:
cc_client = ContainerAgentProcessClient(process=self, name=container_name)
cc_client.stop()
def on_quit(self):
pass
def hello_client(container, actor_id='anonymous', text='mytext 123'):
try:
client = HelloServiceProcessClient(node=container.node, process=FakeProcess())
actor_headers = get_actor_header(actor_id)
ret = client.hello(text, headers=actor_headers)
print "Returned: " + str(ret)
ret = client.hello('second message text', headers=actor_headers)
print "Returned: " + str(ret)
ret = client.noop(text='third message text', headers=actor_headers)
print "Returned"
except Exception as e:
print "client.hello() failed: " + e.message
def hello_noop(container, actor_id='anonymous', text='mytext 123'):
try:
client = HelloServiceProcessClient(node=container.node, process=FakeProcess())
actor_headers = get_actor_header(actor_id)
ret = client.noop(text, headers=actor_headers)
except Exception ,e:
print "client.hello() failed: " + e.message
if __name__ == '__main__':
container = Container()
container.start() # :(
hello_client(container, actor_id='shenrie')
container.stop()
| {
"content_hash": "7ea5f0bc168ee22db0a758d095653625",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 86,
"avg_line_length": 28.88,
"alnum_prop": 0.6708217913204063,
"repo_name": "scionrep/scioncc",
"id": "98fcc0dd6f5cca4da88ccf87c89f8d18b5552106",
"size": "2167",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/ion/service/examples/hello_client.py",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "689"
},
{
"name": "JavaScript",
"bytes": "11408"
},
{
"name": "PLpgSQL",
"bytes": "10932"
},
{
"name": "Python",
"bytes": "2699420"
},
{
"name": "Shell",
"bytes": "12708"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Remotus.Base;
namespace Remotus.Plugins.Services
{
public class PauseServiceFunction : IFunction<WinServiceDto>
{
private readonly IWinServiceHelper _serviceHelper = new WinServiceHelper();
public PauseServiceFunction()
{
}
public IFunctionDescriptor GetDescriptor()
{
return new Descriptor();
}
async Task<IFunctionResult> IFunction.Execute(IExecutionContext context, IFunctionArguments arguments)
{
var result = await Execute(context, arguments);
return result;
}
public async Task<IFunctionResult<WinServiceDto>> Execute(IExecutionContext context, IFunctionArguments arguments)
{
try
{
var serviceName = arguments?.Parameters.GetOrDefault<string>(ParameterKeys.ServiceName)?.Value;
var res = _serviceHelper.PauseService(serviceName);
var result = new FunctionResult<WinServiceDto>();
result.Arguments = arguments;
result.Result = res;
return result;
}
catch (Exception ex)
{
var result = new FunctionResult<WinServiceDto>();
result.Arguments = arguments;
result.Error = DefaultError.FromException(ex);
return result;
}
}
public class Descriptor : IFunctionDescriptor
{
public string ID => "A4C884D5-A904-4566-AA6E-C3259C5DC14D";
public string Name => "Pause service";
public string Version => "1.0.0.0";
public IParameterCollection GetParameters()
{
var res = new Parameters();
return res;
}
IFunction IComponentInstantiator<IFunction>.Instantiate()
{
return Instantiate();
}
public IFunction<WinServiceDto> Instantiate()
{
return new PauseServiceFunction();
}
}
public class Parameters : ParameterCollection
{
public Parameters()
{
ServiceName = new Parameter<string>
{
Name = ParameterKeys.ServiceName,
Required = true,
Type = typeof(string),
Value = null,
};
}
public IParameter<string> ServiceName
{
get { return this.GetOrDefault<string>(ParameterKeys.ServiceName); }
private set { this[ParameterKeys.ServiceName] = value; }
}
}
public static class ParameterKeys
{
public const string ServiceName = "ServiceName";
}
public void Dispose()
{
}
}
}
| {
"content_hash": "81c9a05ac3ca7a13614d1e3aad5b7a16",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 122,
"avg_line_length": 29.259615384615383,
"alnum_prop": 0.5320407492605981,
"repo_name": "LazyTarget/ProcHelper",
"id": "db844fdb3c73f31537e0c4869bf7ca1372036378",
"size": "3045",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Remotus.Plugins/Remotus.Plugins.Services/Functions/PauseServiceFunction.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "103"
},
{
"name": "C#",
"bytes": "536426"
},
{
"name": "CSS",
"bytes": "3481"
},
{
"name": "HTML",
"bytes": "5083"
},
{
"name": "JavaScript",
"bytes": "259551"
}
],
"symlink_target": ""
} |
<?php
// autoload_files.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'948ad5488880985ff1c06721a4e447fe' => $vendorDir . '/cakephp/utility/bootstrap.php',
);
| {
"content_hash": "f8166efd6bd0fda0492ae024d8f3f495",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 88,
"avg_line_length": 23.3,
"alnum_prop": 0.7124463519313304,
"repo_name": "timeverts/FeedMe",
"id": "d363aabf1cb1c53b6b4d951338bbe6f1c7210251",
"size": "233",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "feedme/vendor/composer/autoload_files.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "7056"
},
{
"name": "HTML",
"bytes": "87609"
},
{
"name": "JavaScript",
"bytes": "19235"
},
{
"name": "PHP",
"bytes": "193781"
}
],
"symlink_target": ""
} |
<?php
namespace Symfony\Component\EventDispatcher\Tests;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class EventDispatcherTest extends \PHPUnit_Framework_TestCase
{
/* Some pseudo events */
const preFoo = 'pre.foo';
const postFoo = 'post.foo';
const preBar = 'pre.bar';
const postBar = 'post.bar';
/**
* @var EventDispatcher
*/
private $dispatcher;
private $listener;
public function testInitialState()
{
$this->assertEquals(array(), $this->dispatcher->getListeners());
$this->assertFalse($this->dispatcher->hasListeners(self::preFoo));
$this->assertFalse($this->dispatcher->hasListeners(self::postFoo));
}
public function testAddListener()
{
$this->dispatcher->addListener('pre.foo', array($this->listener, 'preFoo'));
$this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo'));
$this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
$this->assertTrue($this->dispatcher->hasListeners(self::postFoo));
$this->assertCount(1, $this->dispatcher->getListeners(self::preFoo));
$this->assertCount(1, $this->dispatcher->getListeners(self::postFoo));
$this->assertCount(2, $this->dispatcher->getListeners());
}
public function testGetListenersSortsByPriority()
{
$listener1 = new TestEventListener();
$listener2 = new TestEventListener();
$listener3 = new TestEventListener();
$listener1->name = '1';
$listener2->name = '2';
$listener3->name = '3';
$this->dispatcher->addListener('pre.foo', array($listener1, 'preFoo'), -10);
$this->dispatcher->addListener('pre.foo', array($listener2, 'preFoo'), 10);
$this->dispatcher->addListener('pre.foo', array($listener3, 'preFoo'));
$expected = array(
array($listener2, 'preFoo'),
array($listener3, 'preFoo'),
array($listener1, 'preFoo'),
);
$this->assertSame($expected, $this->dispatcher->getListeners('pre.foo'));
}
public function testGetAllListenersSortsByPriority()
{
$listener1 = new TestEventListener();
$listener2 = new TestEventListener();
$listener3 = new TestEventListener();
$listener4 = new TestEventListener();
$listener5 = new TestEventListener();
$listener6 = new TestEventListener();
$this->dispatcher->addListener('pre.foo', $listener1, -10);
$this->dispatcher->addListener('pre.foo', $listener2);
$this->dispatcher->addListener('pre.foo', $listener3, 10);
$this->dispatcher->addListener('post.foo', $listener4, -10);
$this->dispatcher->addListener('post.foo', $listener5);
$this->dispatcher->addListener('post.foo', $listener6, 10);
$expected = array(
'pre.foo' => array($listener3, $listener2, $listener1),
'post.foo' => array($listener6, $listener5, $listener4),
);
$this->assertSame($expected, $this->dispatcher->getListeners());
}
public function testDispatch()
{
$this->dispatcher->addListener('pre.foo', array($this->listener, 'preFoo'));
$this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo'));
$this->dispatcher->dispatch(self::preFoo);
$this->assertTrue($this->listener->preFooInvoked);
$this->assertFalse($this->listener->postFooInvoked);
$this->assertInstanceOf('Symfony\Component\EventDispatcher\Event', $this->dispatcher->dispatch('noevent'));
$this->assertInstanceOf('Symfony\Component\EventDispatcher\Event', $this->dispatcher->dispatch(self::preFoo));
$event = new Event();
$return = $this->dispatcher->dispatch(self::preFoo, $event);
$this->assertEquals('pre.foo', $event->getName());
$this->assertSame($event, $return);
}
public function testDispatchForClosure()
{
$invoked = 0;
$listener = function () use (&$invoked) {
$invoked++;
};
$this->dispatcher->addListener('pre.foo', $listener);
$this->dispatcher->addListener('post.foo', $listener);
$this->dispatcher->dispatch(self::preFoo);
$this->assertEquals(1, $invoked);
}
public function testStopEventPropagation()
{
$otherListener = new TestEventListener();
// postFoo() stops the propagation, so only one listener should
// be executed
// Manually set priority to enforce $this->listener to be called first
$this->dispatcher->addListener('post.foo', array($this->listener, 'postFoo'), 10);
$this->dispatcher->addListener('post.foo', array($otherListener, 'preFoo'));
$this->dispatcher->dispatch(self::postFoo);
$this->assertTrue($this->listener->postFooInvoked);
$this->assertFalse($otherListener->postFooInvoked);
}
public function testDispatchByPriority()
{
$invoked = array();
$listener1 = function () use (&$invoked) {
$invoked[] = '1';
};
$listener2 = function () use (&$invoked) {
$invoked[] = '2';
};
$listener3 = function () use (&$invoked) {
$invoked[] = '3';
};
$this->dispatcher->addListener('pre.foo', $listener1, -10);
$this->dispatcher->addListener('pre.foo', $listener2);
$this->dispatcher->addListener('pre.foo', $listener3, 10);
$this->dispatcher->dispatch(self::preFoo);
$this->assertEquals(array('3', '2', '1'), $invoked);
}
public function testRemoveListener()
{
$this->dispatcher->addListener('pre.bar', $this->listener);
$this->assertTrue($this->dispatcher->hasListeners(self::preBar));
$this->dispatcher->removeListener('pre.bar', $this->listener);
$this->assertFalse($this->dispatcher->hasListeners(self::preBar));
$this->dispatcher->removeListener('notExists', $this->listener);
}
public function testAddSubscriber()
{
$eventSubscriber = new TestEventSubscriber();
$this->dispatcher->addSubscriber($eventSubscriber);
$this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
$this->assertTrue($this->dispatcher->hasListeners(self::postFoo));
}
public function testAddSubscriberWithPriorities()
{
$eventSubscriber = new TestEventSubscriber();
$this->dispatcher->addSubscriber($eventSubscriber);
$eventSubscriber = new TestEventSubscriberWithPriorities();
$this->dispatcher->addSubscriber($eventSubscriber);
$listeners = $this->dispatcher->getListeners('pre.foo');
$this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
$this->assertCount(2, $listeners);
$this->assertInstanceOf('Symfony\Component\EventDispatcher\Tests\TestEventSubscriberWithPriorities', $listeners[0][0]);
}
public function testAddSubscriberWithMultipleListeners()
{
$eventSubscriber = new TestEventSubscriberWithMultipleListeners();
$this->dispatcher->addSubscriber($eventSubscriber);
$listeners = $this->dispatcher->getListeners('pre.foo');
$this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
$this->assertCount(2, $listeners);
$this->assertEquals('preFoo2', $listeners[0][1]);
}
public function testRemoveSubscriber()
{
$eventSubscriber = new TestEventSubscriber();
$this->dispatcher->addSubscriber($eventSubscriber);
$this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
$this->assertTrue($this->dispatcher->hasListeners(self::postFoo));
$this->dispatcher->removeSubscriber($eventSubscriber);
$this->assertFalse($this->dispatcher->hasListeners(self::preFoo));
$this->assertFalse($this->dispatcher->hasListeners(self::postFoo));
}
public function testRemoveSubscriberWithPriorities()
{
$eventSubscriber = new TestEventSubscriberWithPriorities();
$this->dispatcher->addSubscriber($eventSubscriber);
$this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
$this->dispatcher->removeSubscriber($eventSubscriber);
$this->assertFalse($this->dispatcher->hasListeners(self::preFoo));
}
public function testRemoveSubscriberWithMultipleListeners()
{
$eventSubscriber = new TestEventSubscriberWithMultipleListeners();
$this->dispatcher->addSubscriber($eventSubscriber);
$this->assertTrue($this->dispatcher->hasListeners(self::preFoo));
$this->assertCount(2, $this->dispatcher->getListeners(self::preFoo));
$this->dispatcher->removeSubscriber($eventSubscriber);
$this->assertFalse($this->dispatcher->hasListeners(self::preFoo));
}
public function testEventReceivesTheDispatcherInstance()
{
$dispatcher = null;
$this->dispatcher->addListener('test', function ($event) use (&$dispatcher) {
$dispatcher = $event->getDispatcher();
});
$this->dispatcher->dispatch('test');
$this->assertSame($this->dispatcher, $dispatcher);
}
public function testEventReceivesTheDispatcherInstanceAsArgument()
{
$listener = new TestWithDispatcher();
$this->dispatcher->addListener('test', array($listener, 'foo'));
$this->assertNull($listener->name);
$this->assertNull($listener->dispatcher);
$this->dispatcher->dispatch('test');
$this->assertEquals('test', $listener->name);
$this->assertSame($this->dispatcher, $listener->dispatcher);
}
/**
* @see https://bugs.php.net/bug.php?id=62976
*
* This bug affects:
* - The PHP 5.3 branch for versions < 5.3.18
* - The PHP 5.4 branch for versions < 5.4.8
* - The PHP 5.5 branch is not affected
*/
public function testWorkaroundForPhpBug62976()
{
$dispatcher = new EventDispatcher();
$dispatcher->addListener('bug.62976', new CallableClass());
$dispatcher->removeListener('bug.62976', function () {});
$this->assertTrue($dispatcher->hasListeners('bug.62976'));
}
public function testHasListenersWhenAddedCallbackListenerIsRemoved()
{
$listener = function () {};
$this->dispatcher->addListener('foo', $listener);
$this->dispatcher->removeListener('foo', $listener);
$this->assertFalse($this->dispatcher->hasListeners());
}
public function testGetListenersWhenAddedCallbackListenerIsRemoved()
{
$listener = function () {};
$this->dispatcher->addListener('foo', $listener);
$this->dispatcher->removeListener('foo', $listener);
$this->assertSame(array(), $this->dispatcher->getListeners());
}
public function testHasListenersWithoutEventsReturnsFalseAfterHasListenersWithEventHasBeenCalled()
{
$this->assertFalse($this->dispatcher->hasListeners('foo'));
$this->assertFalse($this->dispatcher->hasListeners());
}
protected function setUp()
{
$this->dispatcher = new EventDispatcher();
$this->listener = new TestEventListener();
}
protected function tearDown()
{
$this->dispatcher = null;
$this->listener = null;
}
}
class CallableClass
{
public function __invoke()
{
}
}
class TestEventListener
{
public $preFooInvoked = false;
public $postFooInvoked = false;
/* Listener methods */
public function preFoo(Event $e)
{
$this->preFooInvoked = true;
}
public function postFoo(Event $e)
{
$this->postFooInvoked = true;
$e->stopPropagation();
}
}
class TestWithDispatcher
{
public $name;
public $dispatcher;
public function foo(Event $e, $name, $dispatcher)
{
$this->name = $name;
$this->dispatcher = $dispatcher;
}
}
class TestEventSubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return array('pre.foo' => 'preFoo', 'post.foo' => 'postFoo');
}
}
class TestEventSubscriberWithPriorities implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return array(
'pre.foo' => array('preFoo', 10),
'post.foo' => array('postFoo'),
);
}
}
class TestEventSubscriberWithMultipleListeners implements EventSubscriberInterface
{
public static function getSubscribedEvents()
{
return array('pre.foo' => array(
array('preFoo1'),
array('preFoo2', 10)
));
}
}
| {
"content_hash": "f7334d9b82ffdbbb20e0dfa3ea68fc2a",
"timestamp": "",
"source": "github",
"line_count": 363,
"max_line_length": 127,
"avg_line_length": 35.28650137741047,
"alnum_prop": 0.6340073385900539,
"repo_name": "TheTypoMaster/SPHERE-Framework",
"id": "6b66c876c5f62cb44c6c0e1fd01eb0d016d2e00e",
"size": "13038",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Library/MOC-V/Component/Router/Vendor/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "2630"
},
{
"name": "Batchfile",
"bytes": "7341"
},
{
"name": "CSS",
"bytes": "1047983"
},
{
"name": "HTML",
"bytes": "6258719"
},
{
"name": "JavaScript",
"bytes": "15888113"
},
{
"name": "Makefile",
"bytes": "6774"
},
{
"name": "PHP",
"bytes": "9320934"
},
{
"name": "PowerShell",
"bytes": "149"
},
{
"name": "Python",
"bytes": "22027"
},
{
"name": "Ruby",
"bytes": "2399"
},
{
"name": "Shell",
"bytes": "6738"
},
{
"name": "Smarty",
"bytes": "65319"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} -classpath %classpath com.kosbuild.remoteemulator.AsyncMain localhost:8085</exec.args>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>
</action>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath com.kosbuild.remoteemulator.AsyncMain localhost:8085</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
<action>
<actionName>profile</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.2.1:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath com.kosbuild.remoteemulator.AsyncMain localhost:8085</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
</actions>
| {
"content_hash": "a5668900785fca3cbcfce81c6fc58062",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 184,
"avg_line_length": 40.17391304347826,
"alnum_prop": 0.5313852813852814,
"repo_name": "Otaka/KOSBuild",
"id": "ab521afbe91f278d0511eb34fc33213142babfc2",
"size": "1848",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "RemoteEmulator/nbactions.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "434348"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "c7081a62fadddc94b5fc1a677698475a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "3d0ef74d43f38cfd479b9694fed13491c2124b3d",
"size": "197",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Myrtales/Myrtaceae/Neomitranthes/Neomitranthes obscura/ Syn. Chytraculia maschalantha/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Weibull | stdlib</title>
<meta name="description" content="stdlib is a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing.">
<meta name="author" content="stdlib">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- Icons -->
<link rel="apple-touch-icon" sizes="180x180" href="../apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="../favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="../favicon-16x16.png">
<link rel="manifest" href="../manifest.json">
<link rel="mask-icon" href="../safari-pinned-tab.svg" color="#5bbad5">
<meta name="theme-color" content="#ffffff">
<!-- Facebook Open Graph -->
<meta property="og:type" content="website">
<meta property="og:site_name" content="stdlib">
<meta property="og:url" content="https://stdlib.io/">
<meta property="og:title" content="A standard library for JavaScript and Node.js.">
<meta property="og:description" content="stdlib is a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing.">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="">
<!-- Twitter -->
<meta name="twitter:card" content="A standard library for JavaScript and Node.js.">
<meta name="twitter:site" content="@stdlibjs">
<meta name="twitter:url" content="https://stdlib.io/">
<meta name="twitter:title" content="stdlib">
<meta name="twitter:description" content="stdlib is a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing.">
<meta name="twitter:image" content="">
<link rel="stylesheet" href="../assets/css/main.css">
<link rel="stylesheet" href="../assets/css/theme.css">
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title"><img src="../logo_white.svg" alt="stdlib"></a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
<input type="checkbox" id="tsd-filter-only-exported" />
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../globals.html">Globals</a>
</li>
<li>
<a href="../modules/_stats_base_dists_weibull_ctor_docs_types_index_d_.html">"stats/base/dists/weibull/ctor/docs/types/index.d"</a>
</li>
<li>
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html">Weibull</a>
</li>
</ul>
<h1>Class Weibull</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Weibull distribution.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-hierarchy">
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="target">Weibull</span>
</li>
</ul>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Constructors</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#constructor" class="tsd-kind-icon">constructor</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#entropy" class="tsd-kind-icon">entropy</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#k" class="tsd-kind-icon">k</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#kurtosis" class="tsd-kind-icon">kurtosis</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#lambda" class="tsd-kind-icon">lambda</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#mean" class="tsd-kind-icon">mean</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#median" class="tsd-kind-icon">median</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#mode" class="tsd-kind-icon">mode</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#skewness" class="tsd-kind-icon">skewness</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#stdev" class="tsd-kind-icon">stdev</a></li>
<li class="tsd-kind-property tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#variance" class="tsd-kind-icon">variance</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Methods</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#cdf" class="tsd-kind-icon">cdf</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#logcdf" class="tsd-kind-icon">logcdf</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#logpdf" class="tsd-kind-icon">logpdf</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#mgf" class="tsd-kind-icon">mgf</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#pdf" class="tsd-kind-icon">pdf</a></li>
<li class="tsd-kind-method tsd-parent-kind-class"><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#quantile" class="tsd-kind-icon">quantile</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Constructors</h2>
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
<a name="constructor" class="tsd-anchor"></a>
<h3>constructor</h3>
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">new <wbr>Weibull<span class="tsd-signature-symbol">(</span>k<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span>, lambda<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html" class="tsd-signature-type">Weibull</a></li>
<li class="tsd-signature tsd-kind-icon">new <wbr>Weibull<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html" class="tsd-signature-type">Weibull</a></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L24">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:24</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Weibull distribution constructor.</p>
</div>
<dl class="tsd-comment-tags">
<dt>throws</dt>
<dd><p><code>k</code> must be a positive number</p>
</dd>
<dt>throws</dt>
<dd><p><code>lambda</code> must be a positive number</p>
</dd>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>k: <span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>shape parameter (default: 1.0)</p>
</div>
</div>
</li>
<li>
<h5>lambda: <span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>scale parameter (default: 1.0)</p>
</div>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html" class="tsd-signature-type">
Weibull
</a>
</h4>
<p>distribution instance</p>
<h4 class="tsd-example-title">Example</h4>
<div><pre><code class="language-javascript"><span class="hljs-keyword">var</span> weibull = <span class="hljs-keyword">new</span> Weibull( <span class="hljs-number">1.0</span>, <span class="hljs-number">1.0</span> );
<span class="hljs-keyword">var</span> y = weibull.cdf( <span class="hljs-number">0.8</span> );
<span class="hljs-comment">// returns ~0.551</span>
<span class="hljs-keyword">var</span> v = weibull.mode;
<span class="hljs-comment">// returns 0.0</span></code></pre>
</div>
</li>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L43">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:43</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Weibull distribution constructor.</p>
</div>
</div>
<h4 class="tsd-returns-title">Returns
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html" class="tsd-signature-type">
Weibull
</a>
</h4>
<p>distribution instance</p>
<h4 class="tsd-example-title">Example</h4>
<div><pre><code class="language-javascript"><span class="hljs-keyword">var</span> weibull = <span class="hljs-keyword">new</span> Weibull();
<span class="hljs-keyword">var</span> y = weibull.cdf( <span class="hljs-number">0.8</span> );
<span class="hljs-comment">// returns ~0.551</span>
<span class="hljs-keyword">var</span> v = weibull.mode;
<span class="hljs-comment">// returns 0.0</span></code></pre>
</div>
</li>
</ul>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="entropy" class="tsd-anchor"></a>
<h3>entropy</h3>
<div class="tsd-signature tsd-kind-icon">entropy<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L74">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:74</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Read-only property which returns the differential entropy.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="k" class="tsd-anchor"></a>
<h3>k</h3>
<div class="tsd-signature tsd-kind-icon">k<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L64">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:64</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Shape parameter. If set, the value must be greater than <code>0</code>.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="kurtosis" class="tsd-anchor"></a>
<h3>kurtosis</h3>
<div class="tsd-signature tsd-kind-icon">kurtosis<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L79">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:79</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Read-only property which returns the excess kurtosis.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="lambda" class="tsd-anchor"></a>
<h3>lambda</h3>
<div class="tsd-signature tsd-kind-icon">lambda<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L69">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:69</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Scale parameter. If set, the value must be greater than <code>0</code>.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="mean" class="tsd-anchor"></a>
<h3>mean</h3>
<div class="tsd-signature tsd-kind-icon">mean<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L84">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:84</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Read-only property which returns the expected value.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="median" class="tsd-anchor"></a>
<h3>median</h3>
<div class="tsd-signature tsd-kind-icon">median<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L89">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:89</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Read-only property which returns the median.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="mode" class="tsd-anchor"></a>
<h3>mode</h3>
<div class="tsd-signature tsd-kind-icon">mode<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L94">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:94</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Read-only property which returns the mode.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="skewness" class="tsd-anchor"></a>
<h3>skewness</h3>
<div class="tsd-signature tsd-kind-icon">skewness<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L99">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:99</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Read-only property which returns the skewness.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="stdev" class="tsd-anchor"></a>
<h3>stdev</h3>
<div class="tsd-signature tsd-kind-icon">stdev<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L104">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:104</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Read-only property which returns the standard deviation.</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class">
<a name="variance" class="tsd-anchor"></a>
<h3>variance</h3>
<div class="tsd-signature tsd-kind-icon">variance<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L109">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:109</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Read-only property which returns the variance.</p>
</div>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="cdf" class="tsd-anchor"></a>
<h3>cdf</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">cdf<span class="tsd-signature-symbol">(</span>x<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L117">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:117</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Evaluates the cumulative distribution function (CDF).</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>x: <span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<p>input value</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns
<span class="tsd-signature-type">number</span>
</h4>
<p>evaluated CDF</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="logcdf" class="tsd-anchor"></a>
<h3>logcdf</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">logcdf<span class="tsd-signature-symbol">(</span>x<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L125">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:125</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Evaluates the natural logarithm of the cumulative distribution function (CDF).</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>x: <span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<p>input value</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns
<span class="tsd-signature-type">number</span>
</h4>
<p>evaluated logCDF</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="logpdf" class="tsd-anchor"></a>
<h3>logpdf</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">logpdf<span class="tsd-signature-symbol">(</span>x<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L133">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:133</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Evaluates the natural logarithm of the probability density function (PDF).</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>x: <span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<p>input value</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns
<span class="tsd-signature-type">number</span>
</h4>
<p>evaluated logPDF</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="mgf" class="tsd-anchor"></a>
<h3>mgf</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">mgf<span class="tsd-signature-symbol">(</span>t<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L141">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:141</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Evaluates the moment-generating function (MGF).</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>t: <span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<p>input value</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns
<span class="tsd-signature-type">number</span>
</h4>
<p>evaluated MGF</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="pdf" class="tsd-anchor"></a>
<h3>pdf</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">pdf<span class="tsd-signature-symbol">(</span>x<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L149">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:149</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Evaluates the probability density function (PDF).</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>x: <span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<p>input value</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns
<span class="tsd-signature-type">number</span>
</h4>
<p>evaluated PDF</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
<a name="quantile" class="tsd-anchor"></a>
<h3>quantile</h3>
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
<li class="tsd-signature tsd-kind-icon">quantile<span class="tsd-signature-symbol">(</span>p<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/stdlib-js/stdlib/blob/d09e97b9b/lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts#L157">lib/node_modules/@stdlib/stats/base/dists/weibull/ctor/docs/types/index.d.ts:157</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Evaluates the quantile function at probability <code>p</code>.</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>p: <span class="tsd-signature-type">number</span></h5>
<div class="tsd-comment tsd-typography">
<p>input probability</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns
<span class="tsd-signature-type">number</span>
</h4>
<p>evaluated quantile function</p>
</li>
</ul>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class="globals ">
<a href="../globals.html"><em>Packages</em></a>
</li>
<li class="current tsd-kind-external-module">
<a href="../modules/_stats_base_dists_weibull_ctor_docs_types_index_d_.html">"stats/base/dists/weibull/ctor/docs/types/index.d"</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
</ul>
<ul class="current">
<li class="current tsd-kind-class tsd-parent-kind-external-module">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html" class="tsd-kind-icon">Weibull</a>
<ul>
<li class=" tsd-kind-constructor tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#constructor" class="tsd-kind-icon">constructor</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#entropy" class="tsd-kind-icon">entropy</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#k" class="tsd-kind-icon">k</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#kurtosis" class="tsd-kind-icon">kurtosis</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#lambda" class="tsd-kind-icon">lambda</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#mean" class="tsd-kind-icon">mean</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#median" class="tsd-kind-icon">median</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#mode" class="tsd-kind-icon">mode</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#skewness" class="tsd-kind-icon">skewness</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#stdev" class="tsd-kind-icon">stdev</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#variance" class="tsd-kind-icon">variance</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#cdf" class="tsd-kind-icon">cdf</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#logcdf" class="tsd-kind-icon">logcdf</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#logpdf" class="tsd-kind-icon">logpdf</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#mgf" class="tsd-kind-icon">mgf</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#pdf" class="tsd-kind-icon">pdf</a>
</li>
<li class=" tsd-kind-method tsd-parent-kind-class">
<a href="_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html#quantile" class="tsd-kind-icon">quantile</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
</ul>
</nav>
</div>
</div>
</div>
<footer>
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li>
<li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li>
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
<li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li>
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
<li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
<li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li>
<li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
<li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li>
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li>
<li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li>
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li>
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li>
<li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
<li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
</ul>
</div>
</div>
<div class="bottom-nav center border-top">
<a href="https://www.patreon.com/athan">Donate</a>
/
<a href="/docs/api/">Docs</a>
/
<a href="https://gitter.im/stdlib-js/stdlib">Chat</a>
/
<a href="https://twitter.com/stdlibjs">Twitter</a>
/
<a href="https://github.com/stdlib-js/stdlib">Contribute</a>
</div>
</footer>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
<script src="../assets/js/theme.js"></script>
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-105890493-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html> | {
"content_hash": "34b15efb66fead23f3b62f644c05a657",
"timestamp": "",
"source": "github",
"line_count": 767,
"max_line_length": 498,
"avg_line_length": 52.87092568448501,
"alnum_prop": 0.6426810021700533,
"repo_name": "stdlib-js/www",
"id": "803442645e6a71a7709b26b75c08aa36cddbf13c",
"size": "40552",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/docs/ts/latest/classes/_stats_base_dists_weibull_ctor_docs_types_index_d_.weibull.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "190538"
},
{
"name": "HTML",
"bytes": "158086013"
},
{
"name": "Io",
"bytes": "14873"
},
{
"name": "JavaScript",
"bytes": "5395746994"
},
{
"name": "Makefile",
"bytes": "40479"
},
{
"name": "Shell",
"bytes": "9744"
}
],
"symlink_target": ""
} |
body
{
font-family: "Roboto Slab","Helvetica Neue",Helvetica,Arial,sans-serif;
overflow-x: hidden;
}
.text-muted
{
color: #777;
}
.text-primary
{
color: #fed136;
}
p
{
font-size: 14px;
line-height: 1.75;
}
p.large
{
font-size: 16px;
}
a,a:hover,a:focus,a:active,a.active
{
outline: 0;
}
a
{
color: #fed136;
}
a:hover,a:focus,a:active,a.active
{
color: #fec503;
}
h1,h2,h3,h4,h5,h6
{
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-weight: 700;
text-transform: uppercase;
}
.img-centered
{
margin: 0 auto;
}
.bg-light-gray
{
background-color: #f7f7f7;
}
.bg-darkest-gray
{
background-color: #222;
}
.btn-primary
{
background-color: #fed136;
border-color: #fed136;
color: #fff;
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-weight: 700;
text-transform: uppercase;
}
.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary
{
background-color: #fec503;
border-color: #f6bf01;
color: #fff;
}
.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary
{
background-image: none;
}
.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active
{
background-color: #fed136;
border-color: #fed136;
}
.btn-primary .badge
{
background-color: #fff;
color: #fed136;
}
.btn-xl
{
background-color: #fed136;
border-color: #fed136;
border-radius: 3px;
color: #fff;
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 18px;
font-weight: 700;
padding: 20px 40px;
text-transform: uppercase;
}
.btn-xl:hover,.btn-xl:focus,.btn-xl:active,.btn-xl.active,.open .dropdown-toggle.btn-xl
{
background-color: #fec503;
border-color: #f6bf01;
color: #fff;
}
.btn-xl:active,.btn-xl.active,.open .dropdown-toggle.btn-xl
{
background-image: none;
}
.btn-xl.disabled,.btn-xl[disabled],fieldset[disabled] .btn-xl,.btn-xl.disabled:hover,.btn-xl[disabled]:hover,fieldset[disabled] .btn-xl:hover,.btn-xl.disabled:focus,.btn-xl[disabled]:focus,fieldset[disabled] .btn-xl:focus,.btn-xl.disabled:active,.btn-xl[disabled]:active,fieldset[disabled] .btn-xl:active,.btn-xl.disabled.active,.btn-xl[disabled].active,fieldset[disabled] .btn-xl.active
{
background-color: #fed136;
border-color: #fed136;
}
.btn-xl .badge
{
background-color: #fff;
color: #fed136;
}
.navbar-default
{
background-color: #222;
border-color: transparent;
}
.navbar-default .navbar-brand
{
color: #fed136;
font-family: "Kaushan Script","Helvetica Neue",Helvetica,Arial,cursive;
}
.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:active,.navbar-default .navbar-brand.active
{
color: #fec503;
}
.navbar-default .navbar-collapse
{
border-color: rgba(255,255,255,.02);
}
.navbar-default .navbar-toggle
{
background-color: #fed136;
border-color: #fed136;
}
.navbar-default .navbar-toggle .icon-bar
{
background-color: #fff;
}
.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus
{
background-color: #fed136;
}
.navbar-default .nav li a
{
color: #fff;
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-weight: 400;
letter-spacing: 1px;
text-transform: uppercase;
}
.navbar-default .nav li a:hover,.navbar-default .nav li a:focus
{
color: #fed136;
outline: 0;
}
.navbar-default .navbar-nav>.active>a
{
background-color: #fed136;
border-radius: 0;
color: #fff;
}
.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus
{
background-color: #fec503;
color: #fff;
}
@media (min-width:768px)
{
.navbar-default
{
background-color: transparent;
border: 0;
moz-transition: padding .3s;
padding: 25px 0;
transition: padding .3s;
webkit-transition: padding .3s;
}
.navbar-default .navbar-brand
{
font-size: 2em;
moz-transition: all .3s;
transition: all .3s;
webkit-transition: all .3s;
}
.navbar-default .navbar-nav>.active>a
{
border-radius: 3px;
}
.navbar-default.navbar-shrink
{
background-color: #222;
padding: 10px 0;
}
.navbar-default.navbar-shrink .navbar-brand
{
font-size: 1.5em;
}
}
header
{
background: none scroll center center;
background-size: cover;
color: #fff;
moz-background-size: cover;
o-background-size: cover;
text-align: center;
webkit-background-size: cover;
}
header .intro-text
{
padding-bottom: 50px;
padding-top: 100px;
}
header .intro-text .intro-lead-in
{
font-family: "Droid Serif","Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 22px;
font-style: italic;
line-height: 22px;
margin-bottom: 25px;
}
header .intro-text .intro-heading
{
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 50px;
font-weight: 700;
line-height: 50px;
margin-bottom: 25px;
text-transform: uppercase;
}
@media (min-width:768px)
{
header .intro-text
{
padding-bottom: 200px;
padding-top: 300px;
}
header .intro-text .intro-lead-in
{
font-family: "Droid Serif","Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 40px;
font-style: italic;
line-height: 40px;
margin-bottom: 25px;
}
header .intro-text .intro-heading
{
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 75px;
font-weight: 700;
line-height: 75px;
margin-bottom: 50px;
text-transform: uppercase;
}
}
section
{
padding: 100px 0;
}
section h2.section-heading
{
font-size: 40px;
margin-bottom: 15px;
margin-top: 0;
}
section h3.section-subheading
{
font-family: "Droid Serif","Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 16px;
font-style: italic;
font-weight: 400;
margin-bottom: 75px;
text-transform: none;
}
@media (min-width:768px)
{
section
{
padding: 150px 0;
}
}
.service-heading
{
margin: 15px 0;
text-transform: none;
}
#portfolio .portfolio-item
{
margin: 0 0 15px;
right: 0;
}
#portfolio .portfolio-item .portfolio-link
{
display: block;
margin: 0 auto;
max-width: 400px;
position: relative;
}
#portfolio .portfolio-item .portfolio-link .portfolio-hover
{
background: rgba(254,209,54,.9);
height: 100%;
moz-transition: all ease .5s;
opacity: 0;
position: absolute;
transition: all ease .5s;
webkit-transition: all ease .5s;
width: 100%;
}
#portfolio .portfolio-item .portfolio-link .portfolio-hover:hover
{
opacity: 1;
}
#portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content
{
color: #fff;
font-size: 20px;
height: 20px;
margin-top: -12px;
position: absolute;
text-align: center;
top: 50%;
width: 100%;
}
#portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content i
{
margin-top: -12px;
}
#portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content h3,#portfolio .portfolio-item .portfolio-link .portfolio-hover .portfolio-hover-content h4
{
margin: 0;
}
#portfolio .portfolio-item .portfolio-caption
{
background-color: #fff;
margin: 0 auto;
max-width: 400px;
padding: 25px;
text-align: center;
}
#portfolio .portfolio-item .portfolio-caption h4
{
margin: 0;
text-transform: none;
}
#portfolio .portfolio-item .portfolio-caption p
{
font-family: "Droid Serif","Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 16px;
font-style: italic;
margin: 0;
}
#portfolio *
{
z-index: 2;
}
@media (min-width:767px)
{
#portfolio .portfolio-item
{
margin: 0 0 30px;
}
}
.timeline
{
list-style: none;
padding: 0;
position: relative;
}
.timeline:before
{
background-color: #f1f1f1;
bottom: 0;
content: "";
left: 40px;
margin-left: -1.5px;
position: absolute;
top: 0;
width: 2px;
}
.timeline>li
{
margin-bottom: 50px;
min-height: 50px;
position: relative;
}
.timeline>li:before,.timeline>li:after
{
content: " ";
display: table;
}
.timeline>li:after
{
clear: both;
}
.timeline>li .timeline-panel
{
float: right;
padding: 0 20px 0 100px;
position: relative;
text-align: left;
width: 100%;
}
.timeline>li .timeline-panel:before
{
border-left-width: 0;
border-right-width: 15px;
left: -15px;
right: auto;
}
.timeline>li .timeline-panel:after
{
border-left-width: 0;
border-right-width: 14px;
left: -14px;
right: auto;
}
.timeline>li .timeline-image
{
background-color: #fed136;
border: 7px solid #f1f1f1;
border-radius: 100%;
color: #fff;
height: 80px;
left: 0;
margin-left: 0;
position: absolute;
text-align: center;
width: 80px;
z-index: 100;
}
.timeline>li .timeline-image h4
{
font-size: 10px;
line-height: 14px;
margin-top: 12px;
}
.timeline>li.timeline-inverted>.timeline-panel
{
float: right;
padding: 0 20px 0 100px;
text-align: left;
}
.timeline>li.timeline-inverted>.timeline-panel:before
{
border-left-width: 0;
border-right-width: 15px;
left: -15px;
right: auto;
}
.timeline>li.timeline-inverted>.timeline-panel:after
{
border-left-width: 0;
border-right-width: 14px;
left: -14px;
right: auto;
}
.timeline>li:last-child
{
margin-bottom: 0;
}
.timeline .timeline-heading h4
{
color: inherit;
margin-top: 0;
}
.timeline .timeline-heading h4.subheading
{
text-transform: none;
}
.timeline .timeline-body>p,.timeline .timeline-body>ul
{
margin-bottom: 0;
}
@media (min-width:768px)
{
.timeline:before
{
left: 50%;
}
.timeline>li
{
margin-bottom: 100px;
min-height: 100px;
}
.timeline>li .timeline-panel
{
float: left;
padding: 0 20px 20px 30px;
text-align: right;
width: 41%;
}
.timeline>li .timeline-image
{
height: 100px;
left: 50%;
margin-left: -50px;
width: 100px;
}
.timeline>li .timeline-image h4
{
font-size: 13px;
line-height: 18px;
margin-top: 16px;
}
.timeline>li.timeline-inverted>.timeline-panel
{
float: right;
padding: 0 30px 20px 20px;
text-align: left;
}
}
@media (min-width:992px)
{
.timeline>li
{
min-height: 150px;
}
.timeline>li .timeline-panel
{
padding: 0 20px 20px;
}
.timeline>li .timeline-image
{
height: 150px;
margin-left: -75px;
width: 150px;
}
.timeline>li .timeline-image h4
{
font-size: 18px;
line-height: 26px;
margin-top: 30px;
}
.timeline>li.timeline-inverted>.timeline-panel
{
padding: 0 20px 20px;
}
}
@media (min-width:1200px)
{
.timeline>li
{
min-height: 170px;
}
.timeline>li .timeline-panel
{
padding: 0 20px 20px 100px;
}
.timeline>li .timeline-image
{
height: 170px;
margin-left: -85px;
width: 170px;
}
.timeline>li .timeline-image h4
{
margin-top: 40px;
}
.timeline>li.timeline-inverted>.timeline-panel
{
padding: 0 100px 20px 20px;
}
}
.team-member
{
margin-bottom: 50px;
text-align: center;
}
.team-member img
{
border: 7px solid #fff;
margin: 0 auto;
}
.team-member h4
{
margin-bottom: 0;
margin-top: 25px;
text-transform: none;
}
.team-member p
{
margin-top: 0;
}
aside.clients img
{
margin: 50px auto;
}
section#contact
{
/* background: #222 url(../img/map-image.png) no-repeat center; */
}
section#contact .section-heading
{
color: #fff;
}
section#contact .form-group
{
margin-bottom: 25px;
}
section#contact .form-group input,section#contact .form-group textarea
{
padding: 20px;
}
section#contact .form-group input.form-control
{
height: auto;
}
section#contact .form-group textarea.form-control
{
height: 236px;
}
section#contact .form-control:focus
{
border-color: #fed136;
box-shadow: none;
}
section#contact ::-webkit-input-placeholder
{
color: #bbb;
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-weight: 700;
text-transform: uppercase;
}
section#contact :-moz-placeholder
{
color: #bbb;
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-weight: 700;
text-transform: uppercase;
}
section#contact ::-moz-placeholder
{
color: #bbb;
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-weight: 700;
text-transform: uppercase;
}
section#contact :-ms-input-placeholder
{
color: #bbb;
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-weight: 700;
text-transform: uppercase;
}
section#contact .text-danger
{
color: #e74c3c;
}
footer
{
padding: 25px 0;
text-align: center;
}
footer span.copyright
{
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
line-height: 40px;
text-transform: none;
text-transform: uppercase;
}
footer ul.quicklinks
{
font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
line-height: 40px;
margin-bottom: 0;
text-transform: none;
text-transform: uppercase;
}
ul.social-buttons
{
margin-bottom: 0;
}
ul.social-buttons li a
{
background-color: #222;
border-radius: 100%;
color: #fff;
display: block;
font-size: 20px;
height: 40px;
line-height: 40px;
moz-transition: all .3s;
outline: 0;
transition: all .3s;
webkit-transition: all .3s;
width: 40px;
}
ul.social-buttons li a:hover,ul.social-buttons li a:focus,ul.social-buttons li a:active
{
background-color: #fed136;
}
.btn:focus,.btn:active,.btn.active,.btn:active:focus
{
outline: 0;
}
.portfolio-modal .modal-content
{
background-clip: border-box;
border: 0;
border-radius: 0;
box-shadow: none;
min-height: 100%;
padding: 100px 0;
text-align: center;
webkit-box-shadow: none;
}
.portfolio-modal .modal-content h2
{
font-size: 3em;
margin-bottom: 15px;
}
.portfolio-modal .modal-content p
{
margin-bottom: 30px;
}
.portfolio-modal .modal-content p.item-intro
{
font-family: "Droid Serif","Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 16px;
font-style: italic;
margin: 20px 0 30px;
}
.portfolio-modal .modal-content ul.list-inline
{
margin-bottom: 30px;
margin-top: 0;
}
.portfolio-modal .modal-content img
{
margin-bottom: 30px;
}
.portfolio-modal .close-modal
{
background-color: transparent;
cursor: pointer;
height: 75px;
position: absolute;
right: 25px;
top: 25px;
width: 75px;
}
.portfolio-modal .close-modal:hover
{
opacity: .3;
}
.portfolio-modal .close-modal .lr
{
background-color: #222;
height: 75px;
margin-left: 35px;
ms-transform: rotate(45deg);
transform: rotate(45deg);
webkit-transform: rotate(45deg);
width: 1px;
z-index: 1051;
}
.portfolio-modal .close-modal .lr .rl
{
background-color: #222;
height: 75px;
ms-transform: rotate(90deg);
transform: rotate(90deg);
webkit-transform: rotate(90deg);
width: 1px;
z-index: 1052;
}
.portfolio-modal .modal-backdrop
{
display: none;
opacity: 0;
}
::-moz-selection
{
background: #fed136;
text-shadow: none;
}
::selection
{
background: #fed136;
text-shadow: none;
}
img::selection
{
background: 0 0;
}
img::-moz-selection
{
background: 0 0;
}
.effect-1 {
position:relative;
box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
-moz-box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
-webkit-box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
-o-box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
-webkit-transition: 0.5s ease;
-moz-transition: 0.5s ease;
-o-transition: 0.5s ease;
transition: 0.5s ease;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
cursor: default;
}
.effect-1:hover {
-webkit-transform: scale(1.2, 1.25);
-ms-transform: scale(1.2, 1.25);
-o-transform: scale(1.2, 1.25);
transform: scale(1.2, 1.25);
-webkit-transition: 0.5s ease;
-moz-transition: 0.5s ease;
-o-transition: 0.5s ease;
transition: 0.5s ease;
z-index: 1;
}
.effect-2:active{
-webkit-transform: scale(0.8, 0.75);
-ms-transform: scale(0.8, 0.75);
-o-transform: scale(0.8, 0.75);
transform: scale(0.8, 0.75);
transition: 0.0s ease;
}
.btn-holder{
cursor: pointer;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-o-user-select: none;
}
.row-centered {
text-align:center;
}
.col-centered {
display:inline-block;
float:none;
text-align:left;
margin-right:-4px;
}
.disply_none{
display:none;
}
.display{
display: block;
}
#help-chat {
-webkit-transition: all 0.5s ease;
-moz-transition: all 0.5s ease;
-o-transition: all 0.5s ease;
transition: all 0.5s ease;
}
strong {
background-color: #f8cb36;
}
body
{
webkit-tap-highlight-color: #fed136;
} | {
"content_hash": "f1152aa738d7801e06722581ed1dd979",
"timestamp": "",
"source": "github",
"line_count": 876,
"max_line_length": 462,
"avg_line_length": 20.602739726027398,
"alnum_prop": 0.6382978723404256,
"repo_name": "MunasingheTS/SEP_Event_Planning_3.0",
"id": "e125f63f7ba9a45f411d71b71281c608817912c5",
"size": "18048",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/resources/css/home_page_css/agency.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "458"
},
{
"name": "CSS",
"bytes": "555457"
},
{
"name": "HTML",
"bytes": "8319049"
},
{
"name": "JavaScript",
"bytes": "1006166"
},
{
"name": "PHP",
"bytes": "3533496"
},
{
"name": "Shell",
"bytes": "4440"
}
],
"symlink_target": ""
} |
package core3.test.specs.unit.workflows.definitions
import akka.actor.ActorRef
import akka.pattern.ask
import core3.database.containers.core
import core3.database.dals.Core.{BuildAllDatabases, ClearAllDatabases, VerifyAllDatabases}
import core3.database.dals.DatabaseAbstractionLayer
import core3.security.Auth0UserToken
import core3.test.fixtures.{Database, TestSystem}
import core3.test.specs.unit.AsyncUnitSpec
import core3.workflows.WorkflowEngineComponent.ExecuteWorkflow
import core3.workflows.WorkflowResult
import core3.workflows.definitions._
import play.api.libs.json.Json
import scala.concurrent.Await
import scala.concurrent.duration._
class WorkflowUnitSpec_SystemDeleteGroup extends AsyncUnitSpec {
implicit private val ec = TestSystem.ec
implicit private val system = TestSystem.system
implicit private val timeout = TestSystem.timeout
private val workflows = Vector(SystemCreateGroup, SystemDeleteGroup)
private val authorizedUser = core3.test.fixtures.Workflows.createAuthorizedUser(workflows)
private val db = Database.createCoreInstance()
private val engine = core3.test.fixtures.Workflows.createWorkflowEngine(db, workflows, readOnlyTransactionLogsEnabled = false)
case class FixtureParam(engine: ActorRef, db: DatabaseAbstractionLayer, authorizedUser: Auth0UserToken)
def withFixture(test: OneArgAsyncTest) = {
Await.result(
for {
_ <- db.getRef ? ClearAllDatabases(ignoreErrors = true)
_ <- db.getRef ? BuildAllDatabases()
_ <- db.getRef ? VerifyAllDatabases()
} yield {
true
},
atMost = 15.seconds
)
val fixture = FixtureParam(engine, db, authorizedUser)
withFixture(test.toNoArgAsyncTest(fixture))
}
"A SystemDeleteGroup workflow" should "successfully delete groups" in {
fixture =>
val testName = "Test Group Name"
val testShortName = "test_shn"
val testItemsType = "TransactionLog"
val testItems = Vector(core3.database.getNewObjectID, core3.database.getNewObjectID)
for {
createResult <- (fixture.engine ? ExecuteWorkflow(
SystemCreateGroup.name,
rawParams = Json.obj(
"shortName" -> testShortName,
"name" -> testName,
"items" -> testItems,
"itemsType" -> testItemsType
),
fixture.authorizedUser
)).mapTo[WorkflowResult]
originalGroups <- fixture.db.queryDatabase("Group").map(_.map(_.asInstanceOf[core.Group]))
deleteResult <- (fixture.engine ? ExecuteWorkflow(
SystemDeleteGroup.name,
rawParams = Json.obj(
"groupID" -> originalGroups.head.id,
"revision" -> originalGroups.head.revision,
"revisionNumber" -> originalGroups.head.revisionNumber
),
fixture.authorizedUser
)).mapTo[WorkflowResult]
updatedGroups <- fixture.db.queryDatabase("Group").map(_.map(_.asInstanceOf[core.Group]))
} yield {
createResult.wasSuccessful should be(true)
originalGroups should have size 1
originalGroups.head.name should be(testName)
originalGroups.head.shortName should be(testShortName)
originalGroups.head.itemsType should be(testItemsType)
originalGroups.head.items should be(testItems)
deleteResult.wasSuccessful should be(true)
updatedGroups should have size 0
}
}
}
| {
"content_hash": "4a9e3ca4debf26266dd8de4041bdfb82",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 128,
"avg_line_length": 38.348314606741575,
"alnum_prop": 0.7102256079695283,
"repo_name": "Interel-Group/core3",
"id": "0cde376008d78278f460ccac07d3a53cc09f8295",
"size": "4014",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/scala/core3/test/specs/unit/workflows/definitions/WorkflowUnitSpec_SystemDeleteGroup.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Scala",
"bytes": "846497"
}
],
"symlink_target": ""
} |
'use strict';
import assert = require('assert');
import symbols = require('vs/languages/css/common/parser/cssSymbols');
import nodes = require('vs/languages/css/common/parser/cssNodes');
import parser = require('vs/languages/css/common/parser/cssParser');
import occurrences = require('vs/languages/css/common/services/occurrences');
import workerTests = require('./css-worker.test');
import * as modes from 'vs/editor/common/modes';
export function assertScopesAndSymbols(p: parser.Parser, input:string, expected:string):void {
var global = createScope(p, input);
assert.equal(scopeToString(global), expected);
}
export function assertOccurrences(p: parser.Parser, input:string, marker:string, expectedMatches:number, expectedWrites:number, type: nodes.ReferenceType):void {
var stylesheet = p.parseStylesheet(workerTests.mockMirrorModel(input));
assertNoErrors(stylesheet);
var index = input.indexOf(marker) + marker.length;
var os = occurrences.findOccurrences(stylesheet, index);
assert.equal(os.length, expectedMatches);
assert.equal(os[0].type, type);
var nWrites = 0;
for (var index = 0; index < os.length; index++) {
if (os[index].kind === modes.DocumentHighlightKind.Write) {
nWrites++;
}
}
assert.equal(nWrites, expectedWrites);
}
export function assertSymbolsInScope(p: parser.Parser, input:string, offset:number, ...selections:{name:string;type:nodes.ReferenceType}[]):void {
var global = createScope(p, input);
var scope = global.findScope(offset);
var getErrorMessage = function(name: string) {
var all = 'symbol ' + name + ' not found. In scope: ';
scope.getSymbols().forEach((sym) => { all += (sym.name + ' '); });
return all;
};
for (var i = 0; i < selections.length; i++) {
var selection = selections[i];
var sym = scope.getSymbol(selection.name, selection.type) || global.getSymbol(selection.name, selection.type);
assert.ok(!!sym, getErrorMessage(selection.name));
}
}
export function assertScopeBuilding(p: parser.Parser, input:string, ...scopes:{offset:number; length:number;}[]):void {
var global = createScope(p, input);
function assertChildren(scope:symbols.Scope):void {
scope.children.forEach((scope) => {
// check bounds
var expected = scopes.shift();
assert.equal(scope.offset, expected.offset);
assert.equal(scope.length, expected.length);
// recursive descent
assertChildren(scope);
});
}
assertChildren(global);
assert.equal(scopes.length, 0, 'remainig scopes: ' + scopes.join());
}
function scopeToString(scope: symbols.Scope): string {
var str = '';
var symbols = scope.getSymbols();
for (var index = 0; index < symbols.length; index++) {
if (str.length > 0) {
str += ',';
}
str += symbols[index].name;
}
var scopes = scope.children;
for (var index = 0; index < scopes.length; index++) {
if (str.length > 0) {
str += ',';
}
str += ('[' + scopeToString(scopes[index]) + ']');
}
return str;
}
function assertNoErrors(node: nodes.Node) : void {
var markers = nodes.ParseErrorCollector.entries(node);
if (markers.length > 0) {
assert.ok(false, 'node has errors: ' + markers[0].getMessage() + ', offset: ' + markers[0].getNode().offset);
}
}
function createScope(p: parser.Parser, input:string) : symbols.Scope {
var styleSheet = p.parseStylesheet(workerTests.mockMirrorModel(input)),
global = new symbols.GlobalScope(),
builder = new symbols.ScopeBuilder(global);
assertNoErrors(styleSheet);
styleSheet.accept(builder);
return global;
}
suite('CSS - symbols', () => {
test('scope creation', function() {
var global = new symbols.GlobalScope(),
child1 = new symbols.Scope(10, 5),
child2 = new symbols.Scope(15, 5);
global.addChild(child1);
global.addChild(child2);
assert.equal(global.children.length, 2);
assert.ok(child1.parent === global);
assert.ok(child2.parent === global);
// find children
assert.ok(global.findScope(-1) === null);
assert.ok(global.findScope(0) === global);
assert.ok(global.findScope(10) === child1);
assert.ok(global.findScope(14) === child1);
assert.ok(global.findScope(15) === child2);
assert.ok(global.findScope(19) === child2);
assert.ok(global.findScope(19).parent === global);
});
test('scope building', function() {
var p = new parser.Parser();
assertScopeBuilding(p, '.class {}', { offset: 7, length: 2});
assertScopeBuilding(p, '.class {} .class {}', { offset: 7, length: 2 }, { offset: 17, length: 2 });
});
test('symbols in scopes', function() {
var p = new parser.Parser();
assertSymbolsInScope(p, '@keyframes animation {};', 0, {name:'animation', type:nodes.ReferenceType.Keyframe});
assertSymbolsInScope(p, ' .class1 {} .class2 {}', 0, {name:'.class1', type:nodes.ReferenceType.Rule}, {name:'.class2', type:nodes.ReferenceType.Rule});
});
test('scopes and symbols', function() {
var p = new parser.Parser();
assertScopesAndSymbols(p, '.class {}', '.class,[]');
assertScopesAndSymbols(p, '@keyframes animation {}; .class {}', 'animation,.class,[],[]');
assertScopesAndSymbols(p, '@page :pseudo-class { margin:2in; }', '[]');
assertScopesAndSymbols(p, '@media print { body { font-size: 10pt } }', '[body,[]]');
assertScopesAndSymbols(p, '@-moz-keyframes identifier { 0% { top: 0; } 50% { top: 30px; left: 20px; }}', 'identifier,[[],[]]');
assertScopesAndSymbols(p, '@font-face { font-family: "Bitstream Vera Serif Bold"; }', '[]');
});
test('mark occurrences', function() {
var p = new parser.Parser();
assertOccurrences(p, '@keyframes id {}; #main { animation: /**/id 4s linear 0s infinite alternate; }', '/**/', 2, 1, nodes.ReferenceType.Keyframe);
assertOccurrences(p, '@keyframes id {}; #main { animation-name: /**/id; foo: id;}', '/**/', 2, 1, nodes.ReferenceType.Keyframe);
});
test('test variables in root scope', function() {
var p = new parser.Parser();
assertSymbolsInScope(p, ':root{ --var1: abc; --var2: def; }', 0, {name:'--var1', type:nodes.ReferenceType.Variable}, {name:'--var2', type:nodes.ReferenceType.Variable});
});
test('test variables in local scope', function() {
var p = new parser.Parser();
assertSymbolsInScope(p, '.a{ --var1: abc; --var2: def; }', 2, {name:'--var1', type:nodes.ReferenceType.Variable}, {name:'--var2', type:nodes.ReferenceType.Variable});
});
test('test variables in local scope get root variables too', function() {
var p = new parser.Parser();
assertSymbolsInScope(p, '.a{ --var1: abc; } :root{ --var2: abc;}', 2, {name:'--var1', type:nodes.ReferenceType.Variable}, {name:'--var2', type:nodes.ReferenceType.Variable});
});
test('test variables in local scope get root variables and other local variables too', function() {
var p = new parser.Parser();
assertSymbolsInScope(p, '.a{ --var1: abc; } .b{ --var2: abc; } :root{ --var3: abc;}', 2, {name:'--var1', type:nodes.ReferenceType.Variable}, {name:'--var2', type:nodes.ReferenceType.Variable}, {name:'--var3', type:nodes.ReferenceType.Variable});
});
test('mark occurrences for variable defined in root and used in a rule', function() {
var p = new parser.Parser();
assertOccurrences(p, '.a{ background: var(--var1); } :root{ --var1: abc;}', '--var1', 2, 1, nodes.ReferenceType.Variable);
});
test('mark occurrences for variable defined in a rule and used in a different rule', function() {
var p = new parser.Parser();
assertOccurrences(p, '.a{ background: var(--var1); } :b{ --var1: abc;}', '--var1', 2, 1, nodes.ReferenceType.Variable);
});
}); | {
"content_hash": "d0e6232b50c7d0a021194c5c236cf6a4",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 247,
"avg_line_length": 37.73737373737374,
"alnum_prop": 0.6751873661670236,
"repo_name": "bsmr-x-script/vscode",
"id": "d1a18a868fbcdffa4ce4eff3713ca2c359b87834",
"size": "7823",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/vs/languages/css/test/common/symbols.test.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "AppleScript",
"bytes": "2179"
},
{
"name": "Batchfile",
"bytes": "2345"
},
{
"name": "C",
"bytes": "818"
},
{
"name": "C#",
"bytes": "1152"
},
{
"name": "C++",
"bytes": "1000"
},
{
"name": "CSS",
"bytes": "438701"
},
{
"name": "Clojure",
"bytes": "1206"
},
{
"name": "CoffeeScript",
"bytes": "590"
},
{
"name": "F#",
"bytes": "634"
},
{
"name": "GLSL",
"bytes": "330"
},
{
"name": "Go",
"bytes": "572"
},
{
"name": "Groovy",
"bytes": "3928"
},
{
"name": "HTML",
"bytes": "35640"
},
{
"name": "Java",
"bytes": "576"
},
{
"name": "JavaScript",
"bytes": "9023425"
},
{
"name": "Lua",
"bytes": "252"
},
{
"name": "Makefile",
"bytes": "245"
},
{
"name": "Objective-C",
"bytes": "1387"
},
{
"name": "PHP",
"bytes": "802"
},
{
"name": "Perl",
"bytes": "857"
},
{
"name": "PowerShell",
"bytes": "1432"
},
{
"name": "Python",
"bytes": "1531"
},
{
"name": "R",
"bytes": "362"
},
{
"name": "Ruby",
"bytes": "1703"
},
{
"name": "Rust",
"bytes": "275"
},
{
"name": "Shell",
"bytes": "8336"
},
{
"name": "Swift",
"bytes": "220"
},
{
"name": "TypeScript",
"bytes": "10235910"
},
{
"name": "Visual Basic",
"bytes": "893"
}
],
"symlink_target": ""
} |
package org.apache.beam.runners.dataflow.util;
import org.apache.avro.Schema;
import org.apache.beam.runners.core.construction.SdkComponents;
import org.apache.beam.sdk.coders.AvroCoder;
/** A {@link CloudObjectTranslator} for {@link AvroCoder}. */
class AvroCoderCloudObjectTranslator implements CloudObjectTranslator<AvroCoder> {
private static final String TYPE_FIELD = "type";
private static final String SCHEMA_FIELD = "schema";
@Override
public CloudObject toCloudObject(AvroCoder target, SdkComponents sdkComponents) {
CloudObject base = CloudObject.forClass(AvroCoder.class);
Structs.addString(base, SCHEMA_FIELD, target.getSchema().toString());
Structs.addString(base, TYPE_FIELD, target.getType().getName());
return base;
}
@Override
public AvroCoder<?> fromCloudObject(CloudObject cloudObject) {
Schema.Parser parser = new Schema.Parser();
String className = Structs.getString(cloudObject, TYPE_FIELD);
String schemaString = Structs.getString(cloudObject, SCHEMA_FIELD);
try {
Class<?> type = Class.forName(className);
Schema schema = parser.parse(schemaString);
return AvroCoder.of(type, schema);
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException(e);
}
}
@Override
public Class<? extends AvroCoder> getSupportedClass() {
return AvroCoder.class;
}
@Override
public String cloudObjectClassName() {
return CloudObject.forClass(AvroCoder.class).getClassName();
}
}
| {
"content_hash": "c4618fbc96b9594539b8b30fa33c9166",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 83,
"avg_line_length": 34.13636363636363,
"alnum_prop": 0.7390146471371505,
"repo_name": "charlesccychen/beam",
"id": "a4ce53313a9c1dfb3b20354bad5b3a4056c3c3f4",
"size": "2307",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/util/AvroCoderCloudObjectTranslator.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "40964"
},
{
"name": "Dockerfile",
"bytes": "23025"
},
{
"name": "FreeMarker",
"bytes": "7428"
},
{
"name": "Go",
"bytes": "2385151"
},
{
"name": "Groovy",
"bytes": "276161"
},
{
"name": "HTML",
"bytes": "52535"
},
{
"name": "Java",
"bytes": "23989867"
},
{
"name": "JavaScript",
"bytes": "16472"
},
{
"name": "Jupyter Notebook",
"bytes": "54182"
},
{
"name": "Python",
"bytes": "4274226"
},
{
"name": "Ruby",
"bytes": "4227"
},
{
"name": "Shell",
"bytes": "172322"
}
],
"symlink_target": ""
} |
"""Callbacks: utilities called at certain points during model training.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import copy
import csv
import io
import json
import os
import re
import tempfile
import time
import numpy as np
import six
from tensorflow.python.data.ops import iterator_ops
from tensorflow.python.distribute import distribute_coordinator_context as dc_context
from tensorflow.python.eager import context
from tensorflow.python.framework import ops
from tensorflow.python.keras import backend as K
from tensorflow.python.keras.distribute import multi_worker_training_state as training_state
from tensorflow.python.keras.utils.data_utils import Sequence
from tensorflow.python.keras.utils.generic_utils import Progbar
from tensorflow.python.keras.utils.mode_keys import ModeKeys
from tensorflow.python.lib.io import file_io
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import summary_ops_v2
from tensorflow.python.platform import tf_logging as logging
from tensorflow.python.training import checkpoint_management
from tensorflow.python.util.tf_export import keras_export
try:
import requests
except ImportError:
requests = None
def configure_callbacks(callbacks,
model,
do_validation=False,
batch_size=None,
epochs=None,
steps_per_epoch=None,
samples=None,
verbose=1,
count_mode='steps',
mode=ModeKeys.TRAIN):
"""Configures callbacks for use in various training loops.
Arguments:
callbacks: List of Callbacks.
model: Model being trained.
do_validation: Whether or not validation loop will be run.
batch_size: Number of samples per batch.
epochs: Number of epoch to train.
steps_per_epoch: Number of batches to run per training epoch.
samples: Number of training samples.
verbose: int, 0 or 1. Keras logging verbosity to pass to ProgbarLogger.
count_mode: One of 'steps' or 'samples'. Per-batch or per-sample count.
mode: String. One of ModeKeys.TRAIN, ModeKeys.TEST, or ModeKeys.PREDICT.
Which loop mode to configure callbacks for.
Returns:
Instance of CallbackList used to control all Callbacks.
"""
# Check if callbacks have already been configured.
if isinstance(callbacks, CallbackList):
return callbacks
if not callbacks:
callbacks = []
# Add additional callbacks during training.
if mode == ModeKeys.TRAIN:
model.history = History()
callbacks = [BaseLogger()] + (callbacks or []) + [model.history]
if verbose:
callbacks.append(ProgbarLogger(count_mode))
callback_list = CallbackList(callbacks)
# Set callback model
callback_model = model._get_callback_model() # pylint: disable=protected-access
callback_list.set_model(callback_model)
set_callback_parameters(
callback_list,
model,
do_validation=do_validation,
batch_size=batch_size,
epochs=epochs,
steps_per_epoch=steps_per_epoch,
samples=samples,
verbose=verbose,
mode=mode)
callback_list.model.stop_training = False
return callback_list
def set_callback_parameters(callback_list,
model,
do_validation=False,
batch_size=None,
epochs=None,
steps_per_epoch=None,
samples=None,
verbose=1,
mode=ModeKeys.TRAIN):
"""Sets callback parameters.
Arguments:
callback_list: CallbackList instance.
model: Model being trained.
do_validation: Whether or not validation loop will be run.
batch_size: Number of samples per batch.
epochs: Number of epoch to train.
steps_per_epoch: Number of batches to run per training epoch.
samples: Number of training samples.
verbose: int, 0 or 1. Keras logging verbosity to pass to ProgbarLogger.
mode: String. One of ModeKeys.TRAIN, ModeKeys.TEST, or ModeKeys.PREDICT.
Which loop mode to configure callbacks for.
"""
for cbk in callback_list:
if isinstance(cbk, (BaseLogger, ProgbarLogger)):
cbk.stateful_metrics = model.metrics_names[1:] # Exclude `loss`
# Set callback parameters
callback_metrics = []
# When we have deferred build scenario with iterator input, we will compile
# when we standardize first batch of data.
if mode != ModeKeys.PREDICT and hasattr(model, 'metrics_names'):
callback_metrics = copy.copy(model.metrics_names)
if do_validation:
callback_metrics += ['val_' + n for n in model.metrics_names]
callback_params = {
'batch_size': batch_size,
'epochs': epochs,
'steps': steps_per_epoch,
'samples': samples,
'verbose': verbose,
'do_validation': do_validation,
'metrics': callback_metrics,
}
callback_list.set_params(callback_params)
def _is_generator_like(data):
"""Checks if data is a generator, Sequence, or Iterator."""
return (hasattr(data, 'next') or hasattr(data, '__next__') or isinstance(
data, (Sequence, iterator_ops.Iterator, iterator_ops.IteratorV2)))
def make_logs(model, logs, outputs, mode, prefix=''):
"""Computes logs for sending to `on_batch_end` methods."""
if mode in {ModeKeys.TRAIN, ModeKeys.TEST}:
if hasattr(model, 'metrics_names'):
for label, output in zip(model.metrics_names, outputs):
logs[prefix + label] = output
else:
logs['outputs'] = outputs
return logs
class CallbackList(object):
"""Container abstracting a list of callbacks.
Arguments:
callbacks: List of `Callback` instances.
queue_length: Queue length for keeping
running statistics over callback execution time.
"""
def __init__(self, callbacks=None, queue_length=10):
callbacks = callbacks or []
self.callbacks = [c for c in callbacks]
self.queue_length = queue_length
self.params = {}
self.model = None
self._reset_batch_timing()
def _reset_batch_timing(self):
self._delta_t_batch = 0.
self._delta_ts = collections.defaultdict(
lambda: collections.deque([], maxlen=self.queue_length))
def append(self, callback):
self.callbacks.append(callback)
def set_params(self, params):
self.params = params
for callback in self.callbacks:
callback.set_params(params)
def set_model(self, model):
self.model = model
for callback in self.callbacks:
callback.set_model(model)
def _call_batch_hook(self, mode, hook, batch, logs=None):
"""Helper function for all batch_{begin | end} methods."""
if not self.callbacks:
return
hook_name = 'on_{mode}_batch_{hook}'.format(mode=mode, hook=hook)
if hook == 'begin':
self._t_enter_batch = time.time()
if hook == 'end':
# Batch is ending, calculate batch time.
self._delta_t_batch = time.time() - self._t_enter_batch
logs = logs or {}
t_before_callbacks = time.time()
for callback in self.callbacks:
batch_hook = getattr(callback, hook_name)
batch_hook(batch, logs)
self._delta_ts[hook_name].append(time.time() - t_before_callbacks)
delta_t_median = np.median(self._delta_ts[hook_name])
if (self._delta_t_batch > 0. and
delta_t_median > 0.95 * self._delta_t_batch and delta_t_median > 0.1):
logging.warning(
'Method (%s) is slow compared '
'to the batch update (%f). Check your callbacks.', hook_name,
delta_t_median)
def _call_begin_hook(self, mode):
"""Helper function for on_{train|test|predict}_begin methods."""
if mode == ModeKeys.TRAIN:
self.on_train_begin()
elif mode == ModeKeys.TEST:
self.on_test_begin()
else:
self.on_predict_begin()
def _call_end_hook(self, mode):
"""Helper function for on_{train|test|predict}_end methods."""
if mode == ModeKeys.TRAIN:
self.on_train_end()
elif mode == ModeKeys.TEST:
self.on_test_end()
else:
self.on_predict_end()
def on_batch_begin(self, batch, logs=None):
self._call_batch_hook(ModeKeys.TRAIN, 'begin', batch, logs=logs)
def on_batch_end(self, batch, logs=None):
self._call_batch_hook(ModeKeys.TRAIN, 'end', batch, logs=logs)
def on_epoch_begin(self, epoch, logs=None):
"""Calls the `on_epoch_begin` methods of its callbacks.
This function should only be called during TRAIN mode.
Arguments:
epoch: integer, index of epoch.
logs: dict. Currently no data is passed to this argument for this method
but that may change in the future.
"""
logs = logs or {}
for callback in self.callbacks:
callback.on_epoch_begin(epoch, logs)
self._reset_batch_timing()
def on_epoch_end(self, epoch, logs=None):
"""Calls the `on_epoch_end` methods of its callbacks.
This function should only be called during TRAIN mode.
Arguments:
epoch: integer, index of epoch.
logs: dict, metric results for this training epoch, and for the
validation epoch if validation is performed. Validation result keys
are prefixed with `val_`.
"""
logs = logs or {}
for callback in self.callbacks:
callback.on_epoch_end(epoch, logs)
def on_train_batch_begin(self, batch, logs=None):
"""Calls the `on_train_batch_begin` methods of its callbacks.
Arguments:
batch: integer, index of batch within the current epoch.
logs: dict. Has keys `batch` and `size` representing the current batch
number and the size of the batch.
"""
self._call_batch_hook(ModeKeys.TRAIN, 'begin', batch, logs=logs)
def on_train_batch_end(self, batch, logs=None):
"""Calls the `on_train_batch_end` methods of its callbacks.
Arguments:
batch: integer, index of batch within the current epoch.
logs: dict. Metric results for this batch.
"""
self._call_batch_hook(ModeKeys.TRAIN, 'end', batch, logs=logs)
def on_test_batch_begin(self, batch, logs=None):
"""Calls the `on_test_batch_begin` methods of its callbacks.
Arguments:
batch: integer, index of batch within the current epoch.
logs: dict. Has keys `batch` and `size` representing the current batch
number and the size of the batch.
"""
self._call_batch_hook(ModeKeys.TEST, 'begin', batch, logs=logs)
def on_test_batch_end(self, batch, logs=None):
"""Calls the `on_test_batch_end` methods of its callbacks.
Arguments:
batch: integer, index of batch within the current epoch.
logs: dict. Metric results for this batch.
"""
self._call_batch_hook(ModeKeys.TEST, 'end', batch, logs=logs)
def on_predict_batch_begin(self, batch, logs=None):
"""Calls the `on_predict_batch_begin` methods of its callbacks.
Arguments:
batch: integer, index of batch within the current epoch.
logs: dict. Has keys `batch` and `size` representing the current batch
number and the size of the batch.
"""
self._call_batch_hook(ModeKeys.PREDICT, 'begin', batch, logs=logs)
def on_predict_batch_end(self, batch, logs=None):
"""Calls the `on_predict_batch_end` methods of its callbacks.
Arguments:
batch: integer, index of batch within the current epoch.
logs: dict. Metric results for this batch.
"""
self._call_batch_hook(ModeKeys.PREDICT, 'end', batch, logs=logs)
def on_train_begin(self, logs=None):
"""Calls the `on_train_begin` methods of its callbacks.
Arguments:
logs: dict. Currently no data is passed to this argument for this method
but that may change in the future.
"""
for callback in self.callbacks:
callback.on_train_begin(logs)
def on_train_end(self, logs=None):
"""Calls the `on_train_end` methods of its callbacks.
Arguments:
logs: dict. Currently no data is passed to this argument for this method
but that may change in the future.
"""
for callback in self.callbacks:
callback.on_train_end(logs)
def on_test_begin(self, logs=None):
"""Calls the `on_test_begin` methods of its callbacks.
Arguments:
logs: dict. Currently no data is passed to this argument for this method
but that may change in the future.
"""
for callback in self.callbacks:
callback.on_test_begin(logs)
def on_test_end(self, logs=None):
"""Calls the `on_test_end` methods of its callbacks.
Arguments:
logs: dict. Currently no data is passed to this argument for this method
but that may change in the future.
"""
for callback in self.callbacks:
callback.on_test_end(logs)
def on_predict_begin(self, logs=None):
"""Calls the 'on_predict_begin` methods of its callbacks.
Arguments:
logs: dict. Currently no data is passed to this argument for this method
but that may change in the future.
"""
for callback in self.callbacks:
callback.on_predict_begin(logs)
def on_predict_end(self, logs=None):
"""Calls the `on_predict_end` methods of its callbacks.
Arguments:
logs: dict. Currently no data is passed to this argument for this method
but that may change in the future.
"""
for callback in self.callbacks:
callback.on_predict_end(logs)
def __iter__(self):
return iter(self.callbacks)
@keras_export('keras.callbacks.Callback')
class Callback(object):
"""Abstract base class used to build new callbacks.
Attributes:
params: dict. Training parameters
(eg. verbosity, batch size, number of epochs...).
model: instance of `keras.models.Model`.
Reference of the model being trained.
validation_data: Deprecated. Do not use.
The `logs` dictionary that callback methods
take as argument will contain keys for quantities relevant to
the current batch or epoch.
Currently, the `.fit()` method of the `Model` class
will include the following quantities in the `logs` that
it passes to its callbacks:
on_epoch_end: logs include `acc` and `loss`, and
optionally include `val_loss`
(if validation is enabled in `fit`), and `val_acc`
(if validation and accuracy monitoring are enabled).
on_batch_begin: logs include `size`,
the number of samples in the current batch.
on_batch_end: logs include `loss`, and optionally `acc`
(if accuracy monitoring is enabled).
"""
def __init__(self):
self.validation_data = None
self.model = None
# Whether this Callback should only run on the chief worker in a
# Multi-Worker setting.
# TODO(omalleyt): Make this attr public once solution is stable.
self._chief_worker_only = None
def set_params(self, params):
self.params = params
def set_model(self, model):
self.model = model
def on_batch_begin(self, batch, logs=None):
"""A backwards compatibility alias for `on_train_batch_begin`."""
def on_batch_end(self, batch, logs=None):
"""A backwards compatibility alias for `on_train_batch_end`."""
def on_epoch_begin(self, epoch, logs=None):
"""Called at the start of an epoch.
Subclasses should override for any actions to run. This function should only
be called during TRAIN mode.
Arguments:
epoch: integer, index of epoch.
logs: dict. Currently no data is passed to this argument for this method
but that may change in the future.
"""
def on_epoch_end(self, epoch, logs=None):
"""Called at the end of an epoch.
Subclasses should override for any actions to run. This function should only
be called during TRAIN mode.
Arguments:
epoch: integer, index of epoch.
logs: dict, metric results for this training epoch, and for the
validation epoch if validation is performed. Validation result keys
are prefixed with `val_`.
"""
def on_train_batch_begin(self, batch, logs=None):
"""Called at the beginning of a training batch in `fit` methods.
Subclasses should override for any actions to run.
Arguments:
batch: integer, index of batch within the current epoch.
logs: dict. Has keys `batch` and `size` representing the current batch
number and the size of the batch.
"""
# For backwards compatibility.
self.on_batch_begin(batch, logs=logs)
def on_train_batch_end(self, batch, logs=None):
"""Called at the end of a training batch in `fit` methods.
Subclasses should override for any actions to run.
Arguments:
batch: integer, index of batch within the current epoch.
logs: dict. Metric results for this batch.
"""
# For backwards compatibility.
self.on_batch_end(batch, logs=logs)
def on_test_batch_begin(self, batch, logs=None):
"""Called at the beginning of a batch in `evaluate` methods.
Also called at the beginning of a validation batch in the `fit`
methods, if validation data is provided.
Subclasses should override for any actions to run.
Arguments:
batch: integer, index of batch within the current epoch.
logs: dict. Has keys `batch` and `size` representing the current batch
number and the size of the batch.
"""
def on_test_batch_end(self, batch, logs=None):
"""Called at the end of a batch in `evaluate` methods.
Also called at the end of a validation batch in the `fit`
methods, if validation data is provided.
Subclasses should override for any actions to run.
Arguments:
batch: integer, index of batch within the current epoch.
logs: dict. Metric results for this batch.
"""
def on_predict_batch_begin(self, batch, logs=None):
"""Called at the beginning of a batch in `predict` methods.
Subclasses should override for any actions to run.
Arguments:
batch: integer, index of batch within the current epoch.
logs: dict. Has keys `batch` and `size` representing the current batch
number and the size of the batch.
"""
def on_predict_batch_end(self, batch, logs=None):
"""Called at the end of a batch in `predict` methods.
Subclasses should override for any actions to run.
Arguments:
batch: integer, index of batch within the current epoch.
logs: dict. Metric results for this batch.
"""
def on_train_begin(self, logs=None):
"""Called at the beginning of training.
Subclasses should override for any actions to run.
Arguments:
logs: dict. Currently no data is passed to this argument for this method
but that may change in the future.
"""
def on_train_end(self, logs=None):
"""Called at the end of training.
Subclasses should override for any actions to run.
Arguments:
logs: dict. Currently no data is passed to this argument for this method
but that may change in the future.
"""
def on_test_begin(self, logs=None):
"""Called at the beginning of evaluation or validation.
Subclasses should override for any actions to run.
Arguments:
logs: dict. Currently no data is passed to this argument for this method
but that may change in the future.
"""
def on_test_end(self, logs=None):
"""Called at the end of evaluation or validation.
Subclasses should override for any actions to run.
Arguments:
logs: dict. Currently no data is passed to this argument for this method
but that may change in the future.
"""
def on_predict_begin(self, logs=None):
"""Called at the beginning of prediction.
Subclasses should override for any actions to run.
Arguments:
logs: dict. Currently no data is passed to this argument for this method
but that may change in the future.
"""
def on_predict_end(self, logs=None):
"""Called at the end of prediction.
Subclasses should override for any actions to run.
Arguments:
logs: dict. Currently no data is passed to this argument for this method
but that may change in the future.
"""
@keras_export('keras.callbacks.BaseLogger')
class BaseLogger(Callback):
"""Callback that accumulates epoch averages of metrics.
This callback is automatically applied to every Keras model.
Arguments:
stateful_metrics: Iterable of string names of metrics that
should *not* be averaged over an epoch.
Metrics in this list will be logged as-is in `on_epoch_end`.
All others will be averaged in `on_epoch_end`.
"""
def __init__(self, stateful_metrics=None):
super(BaseLogger, self).__init__()
self.stateful_metrics = set(stateful_metrics or [])
def on_epoch_begin(self, epoch, logs=None):
self.seen = 0
self.totals = {}
def on_batch_end(self, batch, logs=None):
logs = logs or {}
batch_size = logs.get('size', 0)
# In case of distribution strategy we can potentially run multiple steps
# at the same time, we should account for that in the `seen` calculation.
num_steps = logs.get('num_steps', 1)
self.seen += batch_size * num_steps
for k, v in logs.items():
if k in self.stateful_metrics:
self.totals[k] = v
else:
if k in self.totals:
self.totals[k] += v * batch_size
else:
self.totals[k] = v * batch_size
def on_epoch_end(self, epoch, logs=None):
if logs is not None:
for k in self.params['metrics']:
if k in self.totals:
# Make value available to next callbacks.
if k in self.stateful_metrics:
logs[k] = self.totals[k]
else:
logs[k] = self.totals[k] / self.seen
@keras_export('keras.callbacks.TerminateOnNaN')
class TerminateOnNaN(Callback):
"""Callback that terminates training when a NaN loss is encountered.
"""
def on_batch_end(self, batch, logs=None):
logs = logs or {}
loss = logs.get('loss')
if loss is not None:
if np.isnan(loss) or np.isinf(loss):
print('Batch %d: Invalid loss, terminating training' % (batch))
self.model.stop_training = True
@keras_export('keras.callbacks.ProgbarLogger')
class ProgbarLogger(Callback):
"""Callback that prints metrics to stdout.
Arguments:
count_mode: One of "steps" or "samples".
Whether the progress bar should
count samples seen or steps (batches) seen.
stateful_metrics: Iterable of string names of metrics that
should *not* be averaged over an epoch.
Metrics in this list will be logged as-is.
All others will be averaged over time (e.g. loss, etc).
Raises:
ValueError: In case of invalid `count_mode`.
"""
def __init__(self, count_mode='samples', stateful_metrics=None):
super(ProgbarLogger, self).__init__()
if count_mode == 'samples':
self.use_steps = False
elif count_mode == 'steps':
self.use_steps = True
else:
raise ValueError('Unknown `count_mode`: ' + str(count_mode))
self.stateful_metrics = set(stateful_metrics or [])
def on_train_begin(self, logs=None):
self.verbose = self.params['verbose']
self.epochs = self.params['epochs']
def on_epoch_begin(self, epoch, logs=None):
self.seen = 0
if self.use_steps:
self.target = self.params['steps']
else:
self.target = self.params['samples']
if self.verbose:
if self.epochs > 1:
print('Epoch %d/%d' % (epoch + 1, self.epochs))
self.progbar = Progbar(
target=self.target,
verbose=self.verbose,
stateful_metrics=self.stateful_metrics,
unit_name='step' if self.use_steps else 'sample')
def on_batch_begin(self, batch, logs=None):
self.log_values = []
def on_batch_end(self, batch, logs=None):
logs = logs or {}
batch_size = logs.get('size', 0)
# In case of distribution strategy we can potentially run multiple steps
# at the same time, we should account for that in the `seen` calculation.
num_steps = logs.get('num_steps', 1)
if self.use_steps:
self.seen += num_steps
else:
self.seen += batch_size * num_steps
for k in self.params['metrics']:
if k in logs:
self.log_values.append((k, logs[k]))
# Skip progbar update for the last batch;
# will be handled by on_epoch_end.
if self.verbose and (self.target is None or self.seen < self.target):
self.progbar.update(self.seen, self.log_values)
def on_epoch_end(self, epoch, logs=None):
logs = logs or {}
for k in self.params['metrics']:
if k in logs:
self.log_values.append((k, logs[k]))
if self.verbose:
self.progbar.update(self.seen, self.log_values)
@keras_export('keras.callbacks.History')
class History(Callback):
"""Callback that records events into a `History` object.
This callback is automatically applied to
every Keras model. The `History` object
gets returned by the `fit` method of models.
"""
def on_train_begin(self, logs=None):
self.epoch = []
self.history = {}
def on_epoch_end(self, epoch, logs=None):
logs = logs or {}
self.epoch.append(epoch)
for k, v in logs.items():
self.history.setdefault(k, []).append(v)
@keras_export('keras.callbacks.ModelCheckpoint')
class ModelCheckpoint(Callback):
"""Save the model after every epoch.
`filepath` can contain named formatting options,
which will be filled the value of `epoch` and
keys in `logs` (passed in `on_epoch_end`).
For example: if `filepath` is `weights.{epoch:02d}-{val_loss:.2f}.hdf5`,
then the model checkpoints will be saved with the epoch number and
the validation loss in the filename.
Arguments:
filepath: string, path to save the model file.
monitor: quantity to monitor.
verbose: verbosity mode, 0 or 1.
save_best_only: if `save_best_only=True`, the latest best model according
to the quantity monitored will not be overwritten.
mode: one of {auto, min, max}. If `save_best_only=True`, the decision to
overwrite the current save file is made based on either the maximization
or the minimization of the monitored quantity. For `val_acc`, this
should be `max`, for `val_loss` this should be `min`, etc. In `auto`
mode, the direction is automatically inferred from the name of the
monitored quantity.
save_weights_only: if True, then only the model's weights will be saved
(`model.save_weights(filepath)`), else the full model is saved
(`model.save(filepath)`).
save_freq: `'epoch'` or integer. When using `'epoch'`, the callback saves
the model after each epoch. When using integer, the callback saves the
model at end of a batch at which this many samples have been seen since
last saving. Note that if the saving isn't aligned to epochs, the
monitored metric may potentially be less reliable (it could reflect as
little as 1 batch, since the metrics get reset every epoch). Defaults to
`'epoch'`
**kwargs: Additional arguments for backwards compatibility. Possible key
is `period`.
"""
def __init__(self,
filepath,
monitor='val_loss',
verbose=0,
save_best_only=False,
save_weights_only=False,
mode='auto',
save_freq='epoch',
**kwargs):
super(ModelCheckpoint, self).__init__()
self.monitor = monitor
self.verbose = verbose
self.filepath = filepath
self.save_best_only = save_best_only
self.save_weights_only = save_weights_only
self.save_freq = save_freq
self.epochs_since_last_save = 0
self._samples_seen_since_last_saving = 0
# Deprecated field `load_weights_on_restart` is for loading the checkpoint
# file from `filepath` at the start of `model.fit()`
# TODO(rchao): Remove the arg during next breaking release.
if 'load_weights_on_restart' in kwargs:
self.load_weights_on_restart = kwargs['load_weights_on_restart']
logging.warning('`load_weights_on_restart` argument is deprecated. '
'Please use `model.load_weights()` for loading weights '
'before the start of `model.fit()`.')
else:
self.load_weights_on_restart = False
# Deprecated field `period` is for the number of epochs between which
# the model is saved.
if 'period' in kwargs:
self.period = kwargs['period']
logging.warning('`period` argument is deprecated. Please use `save_freq` '
'to specify the frequency in number of samples seen.')
else:
self.period = 1
if mode not in ['auto', 'min', 'max']:
logging.warning('ModelCheckpoint mode %s is unknown, '
'fallback to auto mode.', mode)
mode = 'auto'
if mode == 'min':
self.monitor_op = np.less
self.best = np.Inf
elif mode == 'max':
self.monitor_op = np.greater
self.best = -np.Inf
else:
if 'acc' in self.monitor or self.monitor.startswith('fmeasure'):
self.monitor_op = np.greater
self.best = -np.Inf
else:
self.monitor_op = np.less
self.best = np.Inf
if self.save_freq != 'epoch' and not isinstance(self.save_freq, int):
raise ValueError('Unrecognized save_freq: {}'.format(self.save_freq))
# Only the chief worker writes model checkpoints, but all workers
# restore checkpoint at on_train_begin().
self._chief_worker_only = False
def set_model(self, model):
self.model = model
# Use name matching rather than `isinstance` to avoid circular dependencies.
if (not self.save_weights_only and
not model._is_graph_network and # pylint: disable=protected-access
model.__class__.__name__ != 'Sequential'):
self.save_weights_only = True
def on_train_begin(self, logs=None):
if K.in_multi_worker_mode():
# pylint: disable=protected-access
# MultiWorkerTrainingState is used to manage the training state needed
# for preemption-recovery of a worker in multi-worker training.
self.model._training_state = (
training_state.MultiWorkerTrainingState(self.model, self.filepath))
self._training_state = self.model._training_state
if self._training_state.restore():
# If the training state needs to be and is successfully restored,
# it is recovering from a previous failure (or preemption). In such
# case, do not load the weights from user specified file path.
return
# If this is not multi worker training, restoring is not needed, or
# restoring failed, check if it should load weights on restart.
if self.load_weights_on_restart:
# In multi worker training, it only should load weights on restart if
# `experimental_should_init` is True.
# TODO(rchao): Reference `experimental_should_init` api from a util file.
if (not K.in_multi_worker_mode() or
dc_context.get_current_worker_context().experimental_should_init):
filepath_to_load = (
self._get_most_recently_modified_file_matching_pattern(
self.filepath))
if (filepath_to_load is not None and
training_state.checkpoint_exists(filepath_to_load)):
try:
# `filepath` may contain placeholders such as `{epoch:02d}`, and
# thus it attempts to load the most recently modified file with file
# name matching the pattern.
self.model.load_weights(filepath_to_load)
except (IOError, ValueError) as e:
raise ValueError('Error loading file from {}. Reason: {}'.format(
filepath_to_load, e))
def on_train_end(self, logs=None):
if K.in_multi_worker_mode():
# In multi-worker training, on successful exit of training, delete the
# training state backup file that was saved for the purpose of worker
# recovery.
self._training_state.delete_backup()
# Restore the training state so the model is ready for next (possible)
# multi worker training.
del self._training_state
del self.model._training_state
def on_batch_end(self, batch, logs=None):
logs = logs or {}
if isinstance(self.save_freq, int):
self._samples_seen_since_last_saving += logs.get('size', 1)
if self._samples_seen_since_last_saving >= self.save_freq:
self._save_model(epoch=self._current_epoch, logs=logs)
self._samples_seen_since_last_saving = 0
def on_epoch_begin(self, epoch, logs=None):
self._current_epoch = epoch
def on_epoch_end(self, epoch, logs=None):
self.epochs_since_last_save += 1
if self.save_freq == 'epoch':
if K.in_multi_worker_mode():
# Exclude training state variables in user-requested checkpoint file.
with self._training_state.untrack_vars():
self._save_model(epoch=epoch, logs=logs)
else:
self._save_model(epoch=epoch, logs=logs)
if K.in_multi_worker_mode():
# For multi-worker training, back up the weights and current training
# state for possible future recovery.
# TODO(rchao): Call `back_up` at finer period such as N steps.
self._training_state.back_up(epoch)
def _save_model(self, epoch, logs):
"""Saves the model.
Arguments:
epoch: the epoch this iteration is in.
logs: the `logs` dict passed in to `on_batch_end` or `on_epoch_end`.
"""
logs = logs or {}
if isinstance(self.save_freq,
int) or self.epochs_since_last_save >= self.period:
self.epochs_since_last_save = 0
filepath = self._get_file_path(epoch, logs)
if self.save_best_only:
current = logs.get(self.monitor)
if current is None:
logging.warning('Can save best model only with %s available, '
'skipping.', self.monitor)
else:
if self.monitor_op(current, self.best):
if self.verbose > 0:
print('\nEpoch %05d: %s improved from %0.5f to %0.5f,'
' saving model to %s' % (epoch + 1, self.monitor, self.best,
current, filepath))
self.best = current
if self.save_weights_only:
self.model.save_weights(filepath, overwrite=True)
else:
self.model.save(filepath, overwrite=True)
else:
if self.verbose > 0:
print('\nEpoch %05d: %s did not improve from %0.5f' %
(epoch + 1, self.monitor, self.best))
else:
if self.verbose > 0:
print('\nEpoch %05d: saving model to %s' % (epoch + 1, filepath))
if self.save_weights_only:
self.model.save_weights(filepath, overwrite=True)
else:
self.model.save(filepath, overwrite=True)
self._maybe_remove_file()
def _get_file_path(self, epoch, logs):
"""Returns the file path for checkpoint."""
# TODO(rchao): Replace dc_context reference with
# distributed_training_utils.should_current_worker_checkpoint() once
# distributed_training_utils.py no longer depends on callbacks.py.
if not K.in_multi_worker_mode() or dc_context.get_current_worker_context(
).should_checkpoint:
return self.filepath.format(epoch=epoch + 1, **logs)
else:
# If this is multi-worker training, and this worker should not
# save checkpoint, we use a temp filepath to store a dummy checkpoint, so
# it writes to a file that will be removed at the end of `_save_model()`
# call. This is because the SyncOnReadVariable needs to be synced across
# all the workers in order to be read, and all workers need to initiate
# that.
self._temp_file_dir = tempfile.mkdtemp()
extension = os.path.splitext(self.filepath)[1]
return os.path.join(self._temp_file_dir, 'temp' + extension)
def _maybe_remove_file(self):
# Remove the checkpoint directory in multi-worker training where this worker
# should not checkpoint. It is a dummy directory previously saved for sync
# distributed training.
if K.in_multi_worker_mode(
) and not dc_context.get_current_worker_context().should_checkpoint:
file_io.delete_recursively(self._temp_file_dir)
del self._temp_file_dir
def _get_most_recently_modified_file_matching_pattern(self, pattern):
"""Returns the most recently modified filepath matching pattern.
Pattern may contain python formatting placeholder. If
`tf.train.latest_checkpoint()` does not return None, use that; otherwise,
check for most recently modified one that matches the pattern.
In the rare case where there are more than one pattern-matching file having
the same modified time that is most recent among all, return the filepath
that is largest (by `>` operator, lexicographically using the numeric
equivalents). This provides a tie-breaker when multiple files are most
recent. Note that a larger `filepath` can sometimes indicate a later time of
modification (for instance, when epoch/batch is used as formatting option),
but not necessarily (when accuracy or loss is used). The tie-breaker is
put in the logic as best effort to return the most recent, and to avoid
undeterministic result.
Modified time of a file is obtained with `os.path.getmtime()`.
This utility function is best demonstrated via an example:
```python
file_pattern = 'f.batch{batch:02d}epoch{epoch:02d}.h5'
test_dir = self.get_temp_dir()
path_pattern = os.path.join(test_dir, file_pattern)
file_paths = [
os.path.join(test_dir, file_name) for file_name in
['f.batch03epoch02.h5', 'f.batch02epoch02.h5', 'f.batch01epoch01.h5']
]
for file_path in file_paths:
# Write something to each of the files
self.assertEqual(
_get_most_recently_modified_file_matching_pattern(path_pattern),
file_paths[-1])
```
Arguments:
pattern: The file pattern that may optionally contain python placeholder
such as `{epoch:02d}`.
Returns:
The most recently modified file's full filepath matching `pattern`. If
`pattern` does not contain any placeholder, this returns the filepath
that
exactly matches `pattern`. Returns `None` if no match is found.
"""
dir_name = os.path.dirname(pattern)
base_name = os.path.basename(pattern)
base_name_regex = '^' + re.sub(r'{.*}', r'.*', base_name) + '$'
# If tf.train.latest_checkpoint tells us there exists a latest checkpoint,
# use that as it is more robust than `os.path.getmtime()`.
latest_tf_checkpoint = checkpoint_management.latest_checkpoint(dir_name)
if latest_tf_checkpoint is not None and re.match(
base_name_regex, os.path.basename(latest_tf_checkpoint)):
return latest_tf_checkpoint
latest_mod_time = 0
file_path_with_latest_mod_time = None
n_file_with_latest_mod_time = 0
file_path_with_largest_file_name = None
if file_io.file_exists(dir_name):
for file_name in os.listdir(dir_name):
# Only consider if `file_name` matches the pattern.
if re.match(base_name_regex, file_name):
file_path = os.path.join(dir_name, file_name)
mod_time = os.path.getmtime(file_path)
if (file_path_with_largest_file_name is None or
file_path > file_path_with_largest_file_name):
file_path_with_largest_file_name = file_path
if mod_time > latest_mod_time:
latest_mod_time = mod_time
file_path_with_latest_mod_time = file_path
# In the case a file with later modified time is found, reset
# the counter for the number of files with latest modified time.
n_file_with_latest_mod_time = 1
elif mod_time == latest_mod_time:
# In the case a file has modified time tied with the most recent,
# increment the counter for the number of files with latest modified
# time by 1.
n_file_with_latest_mod_time += 1
if n_file_with_latest_mod_time == 1:
# Return the sole file that has most recent modified time.
return file_path_with_latest_mod_time
else:
# If there are more than one file having latest modified time, return
# the file path with the largest file name.
return file_path_with_largest_file_name
@keras_export('keras.callbacks.EarlyStopping')
class EarlyStopping(Callback):
"""Stop training when a monitored quantity has stopped improving.
Arguments:
monitor: Quantity to be monitored.
min_delta: Minimum change in the monitored quantity
to qualify as an improvement, i.e. an absolute
change of less than min_delta, will count as no
improvement.
patience: Number of epochs with no improvement
after which training will be stopped.
verbose: verbosity mode.
mode: One of `{"auto", "min", "max"}`. In `min` mode,
training will stop when the quantity
monitored has stopped decreasing; in `max`
mode it will stop when the quantity
monitored has stopped increasing; in `auto`
mode, the direction is automatically inferred
from the name of the monitored quantity.
baseline: Baseline value for the monitored quantity.
Training will stop if the model doesn't show improvement over the
baseline.
restore_best_weights: Whether to restore model weights from
the epoch with the best value of the monitored quantity.
If False, the model weights obtained at the last step of
training are used.
Example:
```python
callback = tf.keras.callbacks.EarlyStopping(monitor='val_loss', patience=3)
# This callback will stop the training when there is no improvement in
# the validation loss for three consecutive epochs.
model.fit(data, labels, epochs=100, callbacks=[callback],
validation_data=(val_data, val_labels))
```
"""
def __init__(self,
monitor='val_loss',
min_delta=0,
patience=0,
verbose=0,
mode='auto',
baseline=None,
restore_best_weights=False):
super(EarlyStopping, self).__init__()
self.monitor = monitor
self.patience = patience
self.verbose = verbose
self.baseline = baseline
self.min_delta = abs(min_delta)
self.wait = 0
self.stopped_epoch = 0
self.restore_best_weights = restore_best_weights
self.best_weights = None
if mode not in ['auto', 'min', 'max']:
logging.warning('EarlyStopping mode %s is unknown, '
'fallback to auto mode.', mode)
mode = 'auto'
if mode == 'min':
self.monitor_op = np.less
elif mode == 'max':
self.monitor_op = np.greater
else:
if 'acc' in self.monitor:
self.monitor_op = np.greater
else:
self.monitor_op = np.less
if self.monitor_op == np.greater:
self.min_delta *= 1
else:
self.min_delta *= -1
def on_train_begin(self, logs=None):
# Allow instances to be re-used
self.wait = 0
self.stopped_epoch = 0
if self.baseline is not None:
self.best = self.baseline
else:
self.best = np.Inf if self.monitor_op == np.less else -np.Inf
def on_epoch_end(self, epoch, logs=None):
current = self.get_monitor_value(logs)
if current is None:
return
if self.monitor_op(current - self.min_delta, self.best):
self.best = current
self.wait = 0
if self.restore_best_weights:
self.best_weights = self.model.get_weights()
else:
self.wait += 1
if self.wait >= self.patience:
self.stopped_epoch = epoch
self.model.stop_training = True
if self.restore_best_weights:
if self.verbose > 0:
print('Restoring model weights from the end of the best epoch.')
self.model.set_weights(self.best_weights)
def on_train_end(self, logs=None):
if self.stopped_epoch > 0 and self.verbose > 0:
print('Epoch %05d: early stopping' % (self.stopped_epoch + 1))
def get_monitor_value(self, logs):
logs = logs or {}
monitor_value = logs.get(self.monitor)
if monitor_value is None:
logging.warning('Early stopping conditioned on metric `%s` '
'which is not available. Available metrics are: %s',
self.monitor, ','.join(list(logs.keys())))
return monitor_value
@keras_export('keras.callbacks.RemoteMonitor')
class RemoteMonitor(Callback):
"""Callback used to stream events to a server.
Requires the `requests` library.
Events are sent to `root + '/publish/epoch/end/'` by default. Calls are
HTTP POST, with a `data` argument which is a
JSON-encoded dictionary of event data.
If send_as_json is set to True, the content type of the request will be
application/json. Otherwise the serialized JSON will be sent within a form.
Arguments:
root: String; root url of the target server.
path: String; path relative to `root` to which the events will be sent.
field: String; JSON field under which the data will be stored.
The field is used only if the payload is sent within a form
(i.e. send_as_json is set to False).
headers: Dictionary; optional custom HTTP headers.
send_as_json: Boolean; whether the request should be
sent as application/json.
"""
def __init__(self,
root='http://localhost:9000',
path='/publish/epoch/end/',
field='data',
headers=None,
send_as_json=False):
super(RemoteMonitor, self).__init__()
self.root = root
self.path = path
self.field = field
self.headers = headers
self.send_as_json = send_as_json
def on_epoch_end(self, epoch, logs=None):
if requests is None:
raise ImportError('RemoteMonitor requires the `requests` library.')
logs = logs or {}
send = {}
send['epoch'] = epoch
for k, v in logs.items():
send[k] = v
try:
if self.send_as_json:
requests.post(self.root + self.path, json=send, headers=self.headers)
else:
requests.post(
self.root + self.path, {self.field: json.dumps(send)},
headers=self.headers)
except requests.exceptions.RequestException:
logging.warning('Warning: could not reach RemoteMonitor '
'root server at ' + str(self.root))
@keras_export('keras.callbacks.LearningRateScheduler')
class LearningRateScheduler(Callback):
"""Learning rate scheduler.
Arguments:
schedule: a function that takes an epoch index as input
(integer, indexed from 0) and returns a new
learning rate as output (float).
verbose: int. 0: quiet, 1: update messages.
```python
# This function keeps the learning rate at 0.001 for the first ten epochs
# and decreases it exponentially after that.
def scheduler(epoch):
if epoch < 10:
return 0.001
else:
return 0.001 * tf.math.exp(0.1 * (10 - epoch))
callback = tf.keras.callbacks.LearningRateScheduler(scheduler)
model.fit(data, labels, epochs=100, callbacks=[callback],
validation_data=(val_data, val_labels))
```
"""
def __init__(self, schedule, verbose=0):
super(LearningRateScheduler, self).__init__()
self.schedule = schedule
self.verbose = verbose
def on_epoch_begin(self, epoch, logs=None):
if not hasattr(self.model.optimizer, 'lr'):
raise ValueError('Optimizer must have a "lr" attribute.')
try: # new API
lr = float(K.get_value(self.model.optimizer.lr))
lr = self.schedule(epoch, lr)
except TypeError: # Support for old API for backward compatibility
lr = self.schedule(epoch)
if not isinstance(lr, (float, np.float32, np.float64)):
raise ValueError('The output of the "schedule" function '
'should be float.')
K.set_value(self.model.optimizer.lr, lr)
if self.verbose > 0:
print('\nEpoch %05d: LearningRateScheduler reducing learning '
'rate to %s.' % (epoch + 1, lr))
def on_epoch_end(self, epoch, logs=None):
logs = logs or {}
logs['lr'] = K.get_value(self.model.optimizer.lr)
@keras_export('keras.callbacks.TensorBoard', v1=[])
class TensorBoard(Callback):
# pylint: disable=line-too-long
"""Enable visualizations for TensorBoard.
TensorBoard is a visualization tool provided with TensorFlow.
This callback logs events for TensorBoard, including:
* Metrics summary plots
* Training graph visualization
* Activation histograms
* Sampled profiling
If you have installed TensorFlow with pip, you should be able
to launch TensorBoard from the command line:
```sh
tensorboard --logdir=path_to_your_logs
```
You can find more information about TensorBoard
[here](https://www.tensorflow.org/get_started/summaries_and_tensorboard).
Arguments:
log_dir: the path of the directory where to save the log files to be
parsed by TensorBoard.
histogram_freq: frequency (in epochs) at which to compute activation and
weight histograms for the layers of the model. If set to 0, histograms
won't be computed. Validation data (or split) must be specified for
histogram visualizations.
write_graph: whether to visualize the graph in TensorBoard. The log file
can become quite large when write_graph is set to True.
write_images: whether to write model weights to visualize as image in
TensorBoard.
update_freq: `'batch'` or `'epoch'` or integer. When using `'batch'`,
writes the losses and metrics to TensorBoard after each batch. The same
applies for `'epoch'`. If using an integer, let's say `1000`, the
callback will write the metrics and losses to TensorBoard every 1000
samples. Note that writing too frequently to TensorBoard can slow down
your training.
profile_batch: Profile the batch to sample compute characteristics. By
default, it will profile the second batch. Set profile_batch=0 to
disable profiling. Must run in TensorFlow eager mode.
embeddings_freq: frequency (in epochs) at which embedding layers will
be visualized. If set to 0, embeddings won't be visualized.
embeddings_metadata: a dictionary which maps layer name to a file name in
which metadata for this embedding layer is saved. See the
[details](
https://www.tensorflow.org/how_tos/embedding_viz/#metadata_optional)
about metadata files format. In case if the same metadata file is
used for all embedding layers, string can be passed.
Raises:
ValueError: If histogram_freq is set and no validation data is provided.
"""
# pylint: enable=line-too-long
def __init__(self,
log_dir='logs',
histogram_freq=0,
write_graph=True,
write_images=False,
update_freq='epoch',
profile_batch=2,
embeddings_freq=0,
embeddings_metadata=None,
**kwargs):
super(TensorBoard, self).__init__()
self._validate_kwargs(kwargs)
self.log_dir = log_dir
self.histogram_freq = histogram_freq
self.write_graph = write_graph
self.write_images = write_images
if update_freq == 'batch':
self.update_freq = 1
else:
self.update_freq = update_freq
self.embeddings_freq = embeddings_freq
self.embeddings_metadata = embeddings_metadata
self._samples_seen = 0
self._samples_seen_at_last_write = 0
self._current_batch = 0
self._total_batches_seen = 0
self._total_val_batches_seen = 0
# A collection of file writers currently in use, to be closed when
# training ends for this callback. Writers are keyed by the
# directory name under the root logdir: e.g., "train" or
# "validation".
self._writers = {}
self._train_run_name = 'train'
self._validation_run_name = 'validation'
self._profile_batch = profile_batch
# True when a trace is running.
self._is_tracing = False
# TensorBoard should only write summaries on the chief when in a
# Multi-Worker setting.
self._chief_worker_only = True
def _validate_kwargs(self, kwargs):
"""Handle arguments were supported in V1."""
if kwargs.get('write_grads', False):
logging.warning('`write_grads` will be ignored in TensorFlow 2.0 '
'for the `TensorBoard` Callback.')
if kwargs.get('batch_size', False):
logging.warning('`batch_size` is no longer needed in the '
'`TensorBoard` Callback and will be ignored '
'in TensorFlow 2.0.')
if kwargs.get('embeddings_layer_names', False):
logging.warning('`embeddings_layer_names` is not supported in '
'TensorFlow 2.0. Instead, all `Embedding` layers '
'will be visualized.')
if kwargs.get('embeddings_data', False):
logging.warning('`embeddings_data` is not supported in TensorFlow '
'2.0. Instead, all `Embedding` variables will be '
'visualized.')
unrecognized_kwargs = set(kwargs.keys()) - {
'write_grads', 'embeddings_layer_names', 'embeddings_data', 'batch_size'
}
# Only allow kwargs that were supported in V1.
if unrecognized_kwargs:
raise ValueError('Unrecognized arguments in `TensorBoard` '
'Callback: ' + str(unrecognized_kwargs))
def set_model(self, model):
"""Sets Keras model and writes graph if specified."""
self.model = model
with context.eager_mode():
self._close_writers()
if self.write_graph:
with self._get_writer(self._train_run_name).as_default():
with summary_ops_v2.always_record_summaries():
if not model.run_eagerly:
summary_ops_v2.graph(K.get_graph(), step=0)
summary_writable = (
self.model._is_graph_network or # pylint: disable=protected-access
self.model.__class__.__name__ == 'Sequential') # pylint: disable=protected-access
if summary_writable:
summary_ops_v2.keras_model('keras', self.model, step=0)
if self.embeddings_freq:
self._configure_embeddings()
def _configure_embeddings(self):
"""Configure the Projector for embeddings."""
# TODO(omalleyt): Add integration tests.
from tensorflow.python.keras.layers import embeddings
try:
from tensorboard.plugins import projector
except ImportError:
raise ImportError('Failed to import TensorBoard. Please make sure that '
'TensorBoard integration is complete."')
config = projector.ProjectorConfig()
for layer in self.model.layers:
if isinstance(layer, embeddings.Embedding):
embedding = config.embeddings.add()
embedding.tensor_name = layer.embeddings.name
if self.embeddings_metadata is not None:
if isinstance(self.embeddings_metadata, str):
embedding.metadata_path = self.embeddings_metadata
else:
if layer.name in embedding.metadata_path:
embedding.metadata_path = self.embeddings_metadata.pop(layer.name)
if self.embeddings_metadata:
raise ValueError('Unrecognized `Embedding` layer names passed to '
'`keras.callbacks.TensorBoard` `embeddings_metadata` '
'argument: ' + str(self.embeddings_metadata.keys()))
class DummyWriter(object):
"""Dummy writer to conform to `Projector` API."""
def __init__(self, logdir):
self.logdir = logdir
def get_logdir(self):
return self.logdir
writer = DummyWriter(self.log_dir)
projector.visualize_embeddings(writer, config)
def _close_writers(self):
"""Close all remaining open file writers owned by this callback.
If there are no such file writers, this is a no-op.
"""
with context.eager_mode():
for writer in six.itervalues(self._writers):
writer.close()
self._writers.clear()
def _get_writer(self, writer_name):
"""Get a summary writer for the given subdirectory under the logdir.
A writer will be created if it does not yet exist.
Arguments:
writer_name: The name of the directory for which to create or
retrieve a writer. Should be either `self._train_run_name` or
`self._validation_run_name`.
Returns:
A `SummaryWriter` object.
"""
if writer_name not in self._writers:
path = os.path.join(self.log_dir, writer_name)
writer = summary_ops_v2.create_file_writer_v2(path)
self._writers[writer_name] = writer
return self._writers[writer_name]
def on_train_begin(self, logs=None):
if self._profile_batch == 1:
summary_ops_v2.trace_on(graph=True, profiler=True)
self._is_tracing = True
def on_batch_end(self, batch, logs=None):
"""Writes scalar summaries for metrics on every training batch.
Performs profiling if current batch is in profiler_batches.
Arguments:
batch: Integer, index of batch within the current epoch.
logs: Dict. Metric results for this batch.
"""
# Don't output batch_size and batch number as TensorBoard summaries
logs = logs or {}
self._samples_seen += logs.get('size', 1)
samples_seen_since = self._samples_seen - self._samples_seen_at_last_write
if self.update_freq != 'epoch' and samples_seen_since >= self.update_freq:
self._log_metrics(logs, prefix='batch_', step=self._total_batches_seen)
self._samples_seen_at_last_write = self._samples_seen
self._total_batches_seen += 1
if self._is_tracing:
self._log_trace()
elif (not self._is_tracing and
self._total_batches_seen == self._profile_batch - 1):
self._enable_trace()
def on_epoch_end(self, epoch, logs=None):
"""Runs metrics and histogram summaries at epoch end."""
step = epoch if self.update_freq == 'epoch' else self._samples_seen
self._log_metrics(logs, prefix='epoch_', step=step)
if self.histogram_freq and epoch % self.histogram_freq == 0:
self._log_weights(epoch)
if self.embeddings_freq and epoch % self.embeddings_freq == 0:
self._log_embeddings(epoch)
def on_train_end(self, logs=None):
if self._is_tracing:
self._log_trace()
self._close_writers()
def _enable_trace(self):
if context.executing_eagerly():
summary_ops_v2.trace_on(graph=True, profiler=True)
self._is_tracing = True
def _log_trace(self):
if context.executing_eagerly():
with self._get_writer(self._train_run_name).as_default(), \
summary_ops_v2.always_record_summaries():
# TODO(b/126388999): Remove step info in the summary name.
summary_ops_v2.trace_export(
name='batch_%d' % self._total_batches_seen,
step=self._total_batches_seen,
profiler_outdir=os.path.join(self.log_dir, 'train'))
self._is_tracing = False
def _log_metrics(self, logs, prefix, step):
"""Writes metrics out as custom scalar summaries.
Arguments:
logs: Dict. Keys are scalar summary names, values are NumPy scalars.
prefix: String. The prefix to apply to the scalar summary names.
step: Int. The global step to use for TensorBoard.
"""
if logs is None:
logs = {}
# Group metrics by the name of their associated file writer. Values
# are lists of metrics, as (name, scalar_value) pairs.
logs_by_writer = {
self._train_run_name: [],
self._validation_run_name: [],
}
validation_prefix = 'val_'
for (name, value) in logs.items():
if name in ('batch', 'size', 'num_steps'):
# Scrub non-metric items.
continue
if name.startswith(validation_prefix):
name = name[len(validation_prefix):]
writer_name = self._validation_run_name
else:
writer_name = self._train_run_name
name = prefix + name # assign batch or epoch prefix
logs_by_writer[writer_name].append((name, value))
with context.eager_mode():
with summary_ops_v2.always_record_summaries():
for writer_name in logs_by_writer:
these_logs = logs_by_writer[writer_name]
if not these_logs:
# Don't create a "validation" events file if we don't
# actually have any validation data.
continue
writer = self._get_writer(writer_name)
with writer.as_default():
for (name, value) in these_logs:
summary_ops_v2.scalar(name, value, step=step)
def _log_weights(self, epoch):
"""Logs the weights of the Model to TensorBoard."""
writer = self._get_writer(self._train_run_name)
with context.eager_mode(), \
writer.as_default(), \
summary_ops_v2.always_record_summaries():
for layer in self.model.layers:
for weight in layer.weights:
weight_name = weight.name.replace(':', '_')
with ops.init_scope():
weight = K.get_value(weight)
summary_ops_v2.histogram(weight_name, weight, step=epoch)
if self.write_images:
self._log_weight_as_image(weight, weight_name, epoch)
writer.flush()
def _log_weight_as_image(self, weight, weight_name, epoch):
"""Logs a weight as a TensorBoard image."""
w_img = array_ops.squeeze(weight)
shape = K.int_shape(w_img)
if len(shape) == 1: # Bias case
w_img = array_ops.reshape(w_img, [1, shape[0], 1, 1])
elif len(shape) == 2: # Dense layer kernel case
if shape[0] > shape[1]:
w_img = array_ops.transpose(w_img)
shape = K.int_shape(w_img)
w_img = array_ops.reshape(w_img, [1, shape[0], shape[1], 1])
elif len(shape) == 3: # ConvNet case
if K.image_data_format() == 'channels_last':
# Switch to channels_first to display every kernel as a separate
# image.
w_img = array_ops.transpose(w_img, perm=[2, 0, 1])
shape = K.int_shape(w_img)
w_img = array_ops.reshape(w_img, [shape[0], shape[1], shape[2], 1])
shape = K.int_shape(w_img)
# Not possible to handle 3D convnets etc.
if len(shape) == 4 and shape[-1] in [1, 3, 4]:
summary_ops_v2.image(weight_name, w_img, step=epoch)
def _log_embeddings(self, epoch):
embeddings_ckpt = os.path.join(self.log_dir, 'train',
'keras_embedding.ckpt-{}'.format(epoch))
self.model.save_weights(embeddings_ckpt)
@keras_export('keras.callbacks.ReduceLROnPlateau')
class ReduceLROnPlateau(Callback):
"""Reduce learning rate when a metric has stopped improving.
Models often benefit from reducing the learning rate by a factor
of 2-10 once learning stagnates. This callback monitors a
quantity and if no improvement is seen for a 'patience' number
of epochs, the learning rate is reduced.
Example:
```python
reduce_lr = ReduceLROnPlateau(monitor='val_loss', factor=0.2,
patience=5, min_lr=0.001)
model.fit(X_train, Y_train, callbacks=[reduce_lr])
```
Arguments:
monitor: quantity to be monitored.
factor: factor by which the learning rate will be reduced. new_lr = lr *
factor
patience: number of epochs with no improvement after which learning rate
will be reduced.
verbose: int. 0: quiet, 1: update messages.
mode: one of {auto, min, max}. In `min` mode, lr will be reduced when the
quantity monitored has stopped decreasing; in `max` mode it will be
reduced when the quantity monitored has stopped increasing; in `auto`
mode, the direction is automatically inferred from the name of the
monitored quantity.
min_delta: threshold for measuring the new optimum, to only focus on
significant changes.
cooldown: number of epochs to wait before resuming normal operation after
lr has been reduced.
min_lr: lower bound on the learning rate.
"""
def __init__(self,
monitor='val_loss',
factor=0.1,
patience=10,
verbose=0,
mode='auto',
min_delta=1e-4,
cooldown=0,
min_lr=0,
**kwargs):
super(ReduceLROnPlateau, self).__init__()
self.monitor = monitor
if factor >= 1.0:
raise ValueError('ReduceLROnPlateau ' 'does not support a factor >= 1.0.')
if 'epsilon' in kwargs:
min_delta = kwargs.pop('epsilon')
logging.warning('`epsilon` argument is deprecated and '
'will be removed, use `min_delta` instead.')
self.factor = factor
self.min_lr = min_lr
self.min_delta = min_delta
self.patience = patience
self.verbose = verbose
self.cooldown = cooldown
self.cooldown_counter = 0 # Cooldown counter.
self.wait = 0
self.best = 0
self.mode = mode
self.monitor_op = None
self._reset()
def _reset(self):
"""Resets wait counter and cooldown counter.
"""
if self.mode not in ['auto', 'min', 'max']:
logging.warning('Learning Rate Plateau Reducing mode %s is unknown, '
'fallback to auto mode.', self.mode)
self.mode = 'auto'
if (self.mode == 'min' or
(self.mode == 'auto' and 'acc' not in self.monitor)):
self.monitor_op = lambda a, b: np.less(a, b - self.min_delta)
self.best = np.Inf
else:
self.monitor_op = lambda a, b: np.greater(a, b + self.min_delta)
self.best = -np.Inf
self.cooldown_counter = 0
self.wait = 0
def on_train_begin(self, logs=None):
self._reset()
def on_epoch_end(self, epoch, logs=None):
logs = logs or {}
logs['lr'] = K.get_value(self.model.optimizer.lr)
current = logs.get(self.monitor)
if current is None:
logging.warning('Reduce LR on plateau conditioned on metric `%s` '
'which is not available. Available metrics are: %s',
self.monitor, ','.join(list(logs.keys())))
else:
if self.in_cooldown():
self.cooldown_counter -= 1
self.wait = 0
if self.monitor_op(current, self.best):
self.best = current
self.wait = 0
elif not self.in_cooldown():
self.wait += 1
if self.wait >= self.patience:
old_lr = float(K.get_value(self.model.optimizer.lr))
if old_lr > self.min_lr:
new_lr = old_lr * self.factor
new_lr = max(new_lr, self.min_lr)
K.set_value(self.model.optimizer.lr, new_lr)
if self.verbose > 0:
print('\nEpoch %05d: ReduceLROnPlateau reducing learning '
'rate to %s.' % (epoch + 1, new_lr))
self.cooldown_counter = self.cooldown
self.wait = 0
def in_cooldown(self):
return self.cooldown_counter > 0
@keras_export('keras.callbacks.CSVLogger')
class CSVLogger(Callback):
"""Callback that streams epoch results to a csv file.
Supports all values that can be represented as a string,
including 1D iterables such as np.ndarray.
Example:
```python
csv_logger = CSVLogger('training.log')
model.fit(X_train, Y_train, callbacks=[csv_logger])
```
Arguments:
filename: filename of the csv file, e.g. 'run/log.csv'.
separator: string used to separate elements in the csv file.
append: True: append if file exists (useful for continuing
training). False: overwrite existing file,
"""
def __init__(self, filename, separator=',', append=False):
self.sep = separator
self.filename = filename
self.append = append
self.writer = None
self.keys = None
self.append_header = True
if six.PY2:
self.file_flags = 'b'
self._open_args = {}
else:
self.file_flags = ''
self._open_args = {'newline': '\n'}
super(CSVLogger, self).__init__()
def on_train_begin(self, logs=None):
if self.append:
if file_io.file_exists(self.filename):
with open(self.filename, 'r' + self.file_flags) as f:
self.append_header = not bool(len(f.readline()))
mode = 'a'
else:
mode = 'w'
self.csv_file = io.open(self.filename,
mode + self.file_flags,
**self._open_args)
def on_epoch_end(self, epoch, logs=None):
logs = logs or {}
def handle_value(k):
is_zero_dim_ndarray = isinstance(k, np.ndarray) and k.ndim == 0
if isinstance(k, six.string_types):
return k
elif isinstance(k, collections.Iterable) and not is_zero_dim_ndarray:
return '"[%s]"' % (', '.join(map(str, k)))
else:
return k
if self.keys is None:
self.keys = sorted(logs.keys())
if self.model.stop_training:
# We set NA so that csv parsers do not fail for this last epoch.
logs = dict([(k, logs[k]) if k in logs else (k, 'NA') for k in self.keys])
if not self.writer:
class CustomDialect(csv.excel):
delimiter = self.sep
fieldnames = ['epoch'] + self.keys
if six.PY2:
fieldnames = [unicode(x) for x in fieldnames]
self.writer = csv.DictWriter(
self.csv_file,
fieldnames=fieldnames,
dialect=CustomDialect)
if self.append_header:
self.writer.writeheader()
row_dict = collections.OrderedDict({'epoch': epoch})
row_dict.update((key, handle_value(logs[key])) for key in self.keys)
self.writer.writerow(row_dict)
self.csv_file.flush()
def on_train_end(self, logs=None):
self.csv_file.close()
self.writer = None
@keras_export('keras.callbacks.LambdaCallback')
class LambdaCallback(Callback):
r"""Callback for creating simple, custom callbacks on-the-fly.
This callback is constructed with anonymous functions that will be called
at the appropriate time. Note that the callbacks expects positional
arguments, as:
- `on_epoch_begin` and `on_epoch_end` expect two positional arguments:
`epoch`, `logs`
- `on_batch_begin` and `on_batch_end` expect two positional arguments:
`batch`, `logs`
- `on_train_begin` and `on_train_end` expect one positional argument:
`logs`
Arguments:
on_epoch_begin: called at the beginning of every epoch.
on_epoch_end: called at the end of every epoch.
on_batch_begin: called at the beginning of every batch.
on_batch_end: called at the end of every batch.
on_train_begin: called at the beginning of model training.
on_train_end: called at the end of model training.
Example:
```python
# Print the batch number at the beginning of every batch.
batch_print_callback = LambdaCallback(
on_batch_begin=lambda batch,logs: print(batch))
# Stream the epoch loss to a file in JSON format. The file content
# is not well-formed JSON but rather has a JSON object per line.
import json
json_log = open('loss_log.json', mode='wt', buffering=1)
json_logging_callback = LambdaCallback(
on_epoch_end=lambda epoch, logs: json_log.write(
json.dumps({'epoch': epoch, 'loss': logs['loss']}) + '\n'),
on_train_end=lambda logs: json_log.close()
)
# Terminate some processes after having finished model training.
processes = ...
cleanup_callback = LambdaCallback(
on_train_end=lambda logs: [
p.terminate() for p in processes if p.is_alive()])
model.fit(...,
callbacks=[batch_print_callback,
json_logging_callback,
cleanup_callback])
```
"""
def __init__(self,
on_epoch_begin=None,
on_epoch_end=None,
on_batch_begin=None,
on_batch_end=None,
on_train_begin=None,
on_train_end=None,
**kwargs):
super(LambdaCallback, self).__init__()
self.__dict__.update(kwargs)
if on_epoch_begin is not None:
self.on_epoch_begin = on_epoch_begin
else:
self.on_epoch_begin = lambda epoch, logs: None
if on_epoch_end is not None:
self.on_epoch_end = on_epoch_end
else:
self.on_epoch_end = lambda epoch, logs: None
if on_batch_begin is not None:
self.on_batch_begin = on_batch_begin
else:
self.on_batch_begin = lambda batch, logs: None
if on_batch_end is not None:
self.on_batch_end = on_batch_end
else:
self.on_batch_end = lambda batch, logs: None
if on_train_begin is not None:
self.on_train_begin = on_train_begin
else:
self.on_train_begin = lambda logs: None
if on_train_end is not None:
self.on_train_end = on_train_end
else:
self.on_train_end = lambda logs: None
| {
"content_hash": "293f3d18da1e82a84ae996a2ba2f6dfe",
"timestamp": "",
"source": "github",
"line_count": 2020,
"max_line_length": 98,
"avg_line_length": 36.381188118811885,
"alnum_prop": 0.6421962171724044,
"repo_name": "alsrgv/tensorflow",
"id": "0e0894245845b48c0a8bc69cfc1fca4fc6e8c039",
"size": "74217",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tensorflow/python/keras/callbacks.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "3568"
},
{
"name": "Batchfile",
"bytes": "15317"
},
{
"name": "C",
"bytes": "755360"
},
{
"name": "C#",
"bytes": "8446"
},
{
"name": "C++",
"bytes": "68001148"
},
{
"name": "CMake",
"bytes": "204596"
},
{
"name": "Dockerfile",
"bytes": "73602"
},
{
"name": "Go",
"bytes": "1627121"
},
{
"name": "HTML",
"bytes": "4680118"
},
{
"name": "Java",
"bytes": "842866"
},
{
"name": "Jupyter Notebook",
"bytes": "1665584"
},
{
"name": "LLVM",
"bytes": "6536"
},
{
"name": "Makefile",
"bytes": "101157"
},
{
"name": "Objective-C",
"bytes": "104061"
},
{
"name": "Objective-C++",
"bytes": "175222"
},
{
"name": "PHP",
"bytes": "17570"
},
{
"name": "Pascal",
"bytes": "3239"
},
{
"name": "Perl",
"bytes": "7536"
},
{
"name": "Python",
"bytes": "48843099"
},
{
"name": "RobotFramework",
"bytes": "891"
},
{
"name": "Ruby",
"bytes": "4733"
},
{
"name": "Shell",
"bytes": "488241"
},
{
"name": "Smarty",
"bytes": "27495"
},
{
"name": "Swift",
"bytes": "56155"
},
{
"name": "TSQL",
"bytes": "921"
}
],
"symlink_target": ""
} |
require 'spec_helper'
require 'whois/record/parser/whois.cira.ca.rb'
describe Whois::Record::Parser::WhoisCiraCa, "property_status_autorenew_grace.expected" do
subject do
file = fixture("responses", "whois.cira.ca/property_status_autorenew_grace.txt")
part = Whois::Record::Part.new(:body => File.read(file))
described_class.new(part)
end
describe "#status" do
it do
subject.status.should == :registered
end
end
describe "#available?" do
it do
subject.available?.should == false
end
end
describe "#registered?" do
it do
subject.registered?.should == true
end
end
end
| {
"content_hash": "5b81f163151edc10b014f970cfdabbe4",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 90,
"avg_line_length": 23.703703703703702,
"alnum_prop": 0.675,
"repo_name": "opensrs-pso/whois",
"id": "f0d77c39732a42c1706ea2b2cc68ff1fca485f97",
"size": "940",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/whois/record/parser/responses/whois.cira.ca/property_status_autorenew_grace_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "2161229"
}
],
"symlink_target": ""
} |
package xxxxx.yyyyy.zzzzz.api.aaa;
import static org.springframework.web.bind.annotation.RequestMethod.*;
import java.util.List;
import javax.inject.Inject;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xxxxx.yyyyy.zzzzz.application.service.SampleService;
import xxxxx.yyyyy.zzzzz.domain.model.Sample;
@RestController
@RequestMapping("/aaa")
public class AaaController {
@Inject
private SampleService sampleService;
@RequestMapping(method = GET)
public List<Sample> get(Model model) {
return sampleService.service();
}
}
| {
"content_hash": "2376560b2644dba2ad0131eb0f1aaae8",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 70,
"avg_line_length": 28.25,
"alnum_prop": 0.7846607669616519,
"repo_name": "namioka/springframework-example",
"id": "0b80bb93ad2c8c1590958e2304f2b3a0de78f79d",
"size": "678",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "xyz-interfaces/xyz-api/src/main/java/xxxxx/yyyyy/zzzzz/api/aaa/AaaController.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "27755"
},
{
"name": "Shell",
"bytes": "298"
}
],
"symlink_target": ""
} |
"""Plot a log N / log S graph for three different populations."""
import numpy as np
import matplotlib.pyplot as plt
from frbpoppy import CosmicPopulation, Survey, SurveyPopulation
from tests.convenience import plot_aa_style, rel_path
SIZE = 1e5
GAMMAS = [-1.4, 1]
def get_local():
"""Construct a local population."""
pop = CosmicPopulation.simple(SIZE, generate=True)
survey = Survey('perfect')
surv_pop = SurveyPopulation(pop, survey)
return surv_pop.frbs.s_peak
def get_further(gamma):
"""Construct populations going further out."""
# Construct populations
pop = CosmicPopulation.simple(SIZE)
pop.set_dist(z_max=2.5)
pop.set_si(model='constant', value=gamma)
pop.set_lum(model='constant', value=10**42.5)
pop.generate()
if gamma == 1:
pop.set_lum(model='constant', value=10**43)
pop.gen_lum()
# Survey populations
survey = Survey('perfect')
surv_pop = SurveyPopulation(pop, survey)
return surv_pop.frbs.s_peak
def get_s_peaks():
"""Get s_peaks of populations."""
s_peaks = {}
s_peaks['A'] = get_local()
s_peaks['B'] = get_further(GAMMAS[0])
s_peaks['C'] = get_further(GAMMAS[1])
return s_peaks
def calc_cum_hist(s_peaks):
"""Get the x,y for a cumulative histogram of given s_peaks."""
data = {}
for s in s_peaks:
# Bin up
s_peak = s_peaks[s]
min_f = np.log10(min(s_peak))
max_f = np.log10(max(s_peak))
log_bins = np.logspace(min_f, max_f, 50)
hist, edges = np.histogram(s_peak, bins=log_bins)
n_gt_s = np.cumsum(hist[::-1])[::-1]
x = edges[:-1]
y = n_gt_s
data[s] = (x, y)
return data
def plot_logn_logs(data):
"""Plot log N log S data in a cumlative histogram."""
plot_aa_style()
fig, (ax1) = plt.subplots(1, 1)
for key in data:
x, y = data[key]
ax1.step(x, y, where='post', label=key)
plt.xlabel(r'S$_{\text{min}}$ (Jy)')
plt.ylabel(r'N(${>}\text{S}_{\text{min}}$)')
plt.xscale('log')
plt.yscale('log')
plt.xlim((1e-3, 1e1))
plt.legend()
plt.tight_layout()
plt.savefig(rel_path('plots/logn_logs_abc.pdf'))
def main():
"""Run."""
s_peaks = get_s_peaks()
data = calc_cum_hist(s_peaks)
plot_logn_logs(data)
if __name__ == '__main__':
main()
| {
"content_hash": "1a275ba4b030a1b76efb563f6c1e0ff4",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 66,
"avg_line_length": 23.59,
"alnum_prop": 0.5900805426027977,
"repo_name": "davidgardenier/frbpoppy",
"id": "f623df940ec92291386de86dd3946e149792bda3",
"size": "2359",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/lognlogs/abc.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Fortran",
"bytes": "80481"
},
{
"name": "HTML",
"bytes": "3209"
},
{
"name": "Python",
"bytes": "178609"
},
{
"name": "Shell",
"bytes": "381"
}
],
"symlink_target": ""
} |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE190_Integer_Overflow__char_max_postinc_67a.c
Label Definition File: CWE190_Integer_Overflow.label.xml
Template File: sources-sinks-67a.tmpl.c
*/
/*
* @description
* CWE: 190 Integer Overflow
* BadSource: max Set data to the max value for char
* GoodSource: Set data to a small, non-zero number (two)
* Sinks: increment
* GoodSink: Ensure there will not be an overflow before incrementing data
* BadSink : Increment data, which can cause an overflow
* Flow Variant: 67 Data flow: data passed in a struct from one function to another in different source files
*
* */
#include "std_testcase.h"
typedef struct _CWE190_Integer_Overflow__char_max_postinc_67_structType
{
char structFirst;
} CWE190_Integer_Overflow__char_max_postinc_67_structType;
#ifndef OMITBAD
/* bad function declaration */
void CWE190_Integer_Overflow__char_max_postinc_67b_badSink(CWE190_Integer_Overflow__char_max_postinc_67_structType myStruct);
void CWE190_Integer_Overflow__char_max_postinc_67_bad()
{
char data;
CWE190_Integer_Overflow__char_max_postinc_67_structType myStruct;
data = ' ';
/* POTENTIAL FLAW: Use the maximum size of the data type */
data = CHAR_MAX;
myStruct.structFirst = data;
CWE190_Integer_Overflow__char_max_postinc_67b_badSink(myStruct);
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void CWE190_Integer_Overflow__char_max_postinc_67b_goodG2BSink(CWE190_Integer_Overflow__char_max_postinc_67_structType myStruct);
static void goodG2B()
{
char data;
CWE190_Integer_Overflow__char_max_postinc_67_structType myStruct;
data = ' ';
/* FIX: Use a small, non-zero value that will not cause an overflow in the sinks */
data = 2;
myStruct.structFirst = data;
CWE190_Integer_Overflow__char_max_postinc_67b_goodG2BSink(myStruct);
}
/* goodB2G uses the BadSource with the GoodSink */
void CWE190_Integer_Overflow__char_max_postinc_67b_goodB2GSink(CWE190_Integer_Overflow__char_max_postinc_67_structType myStruct);
static void goodB2G()
{
char data;
CWE190_Integer_Overflow__char_max_postinc_67_structType myStruct;
data = ' ';
/* POTENTIAL FLAW: Use the maximum size of the data type */
data = CHAR_MAX;
myStruct.structFirst = data;
CWE190_Integer_Overflow__char_max_postinc_67b_goodB2GSink(myStruct);
}
void CWE190_Integer_Overflow__char_max_postinc_67_good()
{
goodG2B();
goodB2G();
}
#endif /* OMITGOOD */
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
#ifdef INCLUDEMAIN
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
CWE190_Integer_Overflow__char_max_postinc_67_good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
CWE190_Integer_Overflow__char_max_postinc_67_bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
| {
"content_hash": "2b13b1572848a34b0664f6f11ee87a27",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 129,
"avg_line_length": 32.142857142857146,
"alnum_prop": 0.6948148148148148,
"repo_name": "JianpingZeng/xcc",
"id": "3d95f311a524b30f07e2eb821f172a7dbcf8fd94",
"size": "3375",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "xcc/test/juliet/testcases/CWE190_Integer_Overflow/s06/CWE190_Integer_Overflow__char_max_postinc_67a.c",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.