code stringlengths 3 1.05M | repo_name stringlengths 4 116 | path stringlengths 3 942 | language stringclasses 30 values | license stringclasses 15 values | size int32 3 1.05M | line_mean float64 0.5 100 | line_max int64 1 1k | alpha_frac float64 0.25 1 | autogenerated bool 1 class |
|---|---|---|---|---|---|---|---|---|---|
/** ---------------------------------------------------------------------------
* -*- c++ -*-
* @file: particlebody.cpp
*
* Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
* MIT License, see LICENSE file for more details.
* ----------------------------------------------------------------------------
*/
#include <yage/physics/particlebody.h>
#include <cmath>
namespace yage
{
ParticleBody::ParticleBody(const Vector2d &position, double mass,
const Vector2d &velocity, bool gravity)
: Body(position, mass, velocity, gravity)
{
}
void ParticleBody::applyForce(const Vector2d &force)
{
force_ += force;
}
void ParticleBody::update()
{
// set the time_step for 60fps
double time_step = 1.0 / 60.0;
// set the last acceleration
Vector2d last_acceleration = acceleration_;
// update the position of the body
position_ += velocity_ * time_step +
(0.5 * last_acceleration * std::pow(time_step, 2));
// update the acceleration
if (gravity_) {
acceleration_ =
Vector2d(force_.x() / mass_, (GRAVITY + force_.y()) / mass_);
} else {
acceleration_ = Vector2d(force_.x() / mass_, force_.y() / mass_);
}
Vector2d avg_acceleration = (acceleration_ + last_acceleration) / 2.0;
// update the velocity of the body
velocity_ += avg_acceleration * time_step;
}
} // namespace yage
| ymherklotz/YAGE | yage/physics/particlebody.cpp | C++ | mit | 1,426 | 25.407407 | 79 | 0.549088 | false |
/********************************************************************************
** Form generated from reading UI file 'modifystationdlg.ui'
**
** Created by: Qt User Interface Compiler version 5.7.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_MODIFYSTATIONDLG_H
#define UI_MODIFYSTATIONDLG_H
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QDialog>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QGroupBox>
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QSpacerItem>
#include <QtWidgets/QVBoxLayout>
QT_BEGIN_NAMESPACE
class Ui_ModifyStationDlg
{
public:
QGridLayout *gridLayout_2;
QGroupBox *groupBox;
QGridLayout *gridLayout;
QVBoxLayout *verticalLayout;
QHBoxLayout *horizontalLayout;
QLabel *label;
QLineEdit *lineEdit;
QHBoxLayout *horizontalLayout_2;
QSpacerItem *horizontalSpacer;
QPushButton *pushButton;
void setupUi(QDialog *ModifyStationDlg)
{
if (ModifyStationDlg->objectName().isEmpty())
ModifyStationDlg->setObjectName(QStringLiteral("ModifyStationDlg"));
ModifyStationDlg->resize(311, 111);
gridLayout_2 = new QGridLayout(ModifyStationDlg);
gridLayout_2->setObjectName(QStringLiteral("gridLayout_2"));
groupBox = new QGroupBox(ModifyStationDlg);
groupBox->setObjectName(QStringLiteral("groupBox"));
gridLayout = new QGridLayout(groupBox);
gridLayout->setObjectName(QStringLiteral("gridLayout"));
verticalLayout = new QVBoxLayout();
verticalLayout->setObjectName(QStringLiteral("verticalLayout"));
horizontalLayout = new QHBoxLayout();
horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
label = new QLabel(groupBox);
label->setObjectName(QStringLiteral("label"));
label->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
horizontalLayout->addWidget(label);
lineEdit = new QLineEdit(groupBox);
lineEdit->setObjectName(QStringLiteral("lineEdit"));
horizontalLayout->addWidget(lineEdit);
verticalLayout->addLayout(horizontalLayout);
horizontalLayout_2 = new QHBoxLayout();
horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout_2->addItem(horizontalSpacer);
pushButton = new QPushButton(groupBox);
pushButton->setObjectName(QStringLiteral("pushButton"));
horizontalLayout_2->addWidget(pushButton);
verticalLayout->addLayout(horizontalLayout_2);
gridLayout->addLayout(verticalLayout, 0, 0, 1, 1);
gridLayout_2->addWidget(groupBox, 0, 0, 1, 1);
retranslateUi(ModifyStationDlg);
QMetaObject::connectSlotsByName(ModifyStationDlg);
} // setupUi
void retranslateUi(QDialog *ModifyStationDlg)
{
ModifyStationDlg->setWindowTitle(QApplication::translate("ModifyStationDlg", "ModifyStation", 0));
groupBox->setTitle(QApplication::translate("ModifyStationDlg", "GroupBox", 0));
label->setText(QApplication::translate("ModifyStationDlg", "\350\257\267\350\276\223\345\205\245\344\277\256\346\224\271\345\200\274\357\274\232", 0));
pushButton->setText(QApplication::translate("ModifyStationDlg", "\346\217\220\344\272\244", 0));
} // retranslateUi
};
namespace Ui {
class ModifyStationDlg: public Ui_ModifyStationDlg {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_MODIFYSTATIONDLG_H
| hustwyk/trainTicket | GeneratedFiles/ui_modifystationdlg.h | C | mit | 3,909 | 33.289474 | 159 | 0.686109 | false |
package hu.autsoft.nytimes.exception;
public class OkHttpException extends RuntimeException {
public OkHttpException(Throwable cause) {
super(cause);
}
}
| chriske/nytimes_api_demo | app/src/main/java/hu/autsoft/nytimes/exception/OkHttpException.java | Java | mit | 172 | 20.5 | 55 | 0.732558 | false |
const Lib = require("../src/main");
const assert = require("assert");
describe("plain object output", function () {
context("for `JSON.stringify` serializable objects", function () {
it("should have resembling structure", function () {
const obj1 = { a: 1, b: "b", c: true };
const res = Lib.write(obj1);
const exp1 = {
f: [
["a", 1],
["b", "b"],
["c", true]
]
};
assert.deepStrictEqual(res, exp1);
assert.equal(Lib.stringify(obj1), JSON.stringify(res));
const obj2 = { obj1 };
const exp2 = { f: [["obj1", exp1]] };
assert.deepStrictEqual(Lib.write(obj2), exp2);
assert.equal(Lib.stringify(obj2), JSON.stringify(exp2));
});
context("with `alwaysByRef: true`", function () {
it("should use references environment", function () {
const obj1 = { a: { a: 1 }, b: { b: "b" }, c: { c: true } };
const res = Lib.write(obj1, { alwaysByRef: true });
const exp1 = {
r: 3,
x: [
{ f: [["c", true]] },
{ f: [["b", "b"]] },
{ f: [["a", 1]] },
{
f: [
["a", { r: 2 }],
["b", { r: 1 }],
["c", { r: 0 }]
]
}
]
};
assert.deepStrictEqual(res, exp1);
const obj2 = Lib.read(res);
assert.notStrictEqual(obj1, obj2);
assert.deepStrictEqual(obj1, obj2);
});
});
});
it("should have correct format for shared values", function () {
const root = { val: "hi" };
root.rec1 = { obj1: root, obj2: root, obj3: { obj: root } };
root.rec2 = root;
assert.deepStrictEqual(Lib.write(root), {
r: 0,
x: [
{
f: [
["val", "hi"],
[
"rec1",
{
f: [
["obj1", { r: 0 }],
["obj2", { r: 0 }],
["obj3", { f: [["obj", { r: 0 }]] }]
]
}
],
["rec2", { r: 0 }]
]
}
]
});
});
});
describe("special values", function () {
it("should correctly restore them", function () {
const root = { undef: undefined, nul: null, nan: NaN };
const res = Lib.write(root);
assert.deepStrictEqual(res, {
f: [
["undef", { $: "undefined" }],
["nul", null],
["nan", { $: "NaN" }]
]
});
const { undef, nul, nan } = Lib.read(res);
assert.strictEqual(undef, undefined);
assert.strictEqual(nul, null);
assert.ok(typeof nan === "number" && Number.isNaN(nan));
});
});
describe("reading plain object", function () {
it("should correctly assign shared values", function () {
const obj = Lib.read({
r: 0,
x: [
{
f: [
["val", "hi"],
[
"rec1",
{
f: [
["obj1", { r: 0 }],
["obj2", { r: 0 }],
["obj3", { f: [["obj", { r: 0 }]] }]
]
}
],
["rec2", { r: 0 }]
]
}
]
});
assert.strictEqual(Object.keys(obj).sort().join(), "rec1,rec2,val");
assert.strictEqual(obj.val, "hi");
assert.strictEqual(Object.keys(obj.rec1).sort().join(), "obj1,obj2,obj3");
assert.strictEqual(Object.keys(obj.rec1.obj3).sort().join(), "obj");
assert.strictEqual(obj.rec2, obj);
assert.strictEqual(obj.rec1.obj1, obj);
assert.strictEqual(obj.rec1.obj2, obj);
assert.strictEqual(obj.rec1.obj3.obj, obj);
});
});
describe("object with parent", function () {
function MyObj() {
this.a = 1;
this.b = "b";
this.c = true;
}
Lib.regConstructor(MyObj);
it("should output `$` attribute", function () {
const obj1 = new MyObj();
assert.deepEqual(Lib.write(obj1), {
$: "MyObj",
f: [
["a", 1],
["b", "b"],
["c", true]
]
});
function Object() {
this.a = obj1;
}
Lib.regConstructor(Object);
assert.deepEqual(Lib.write(new Object()), {
$: "Object_1",
f: [
[
"a",
{
f: [
["a", 1],
["b", "b"],
["c", true]
],
$: "MyObj"
}
]
]
});
});
it("should use `$` attribute to resolve a type on read", function () {
const obj1 = Lib.read({
$: "MyObj",
f: [
["a", 1],
["b", "b"],
["c", true]
]
});
assert.strictEqual(obj1.constructor, MyObj);
assert.equal(Object.keys(obj1).sort().join(), "a,b,c");
assert.strictEqual(obj1.a, 1);
assert.strictEqual(obj1.b, "b");
assert.strictEqual(obj1.c, true);
});
context("for shared values", function () {
function Obj2() {}
Lib.regConstructor(Obj2);
it("should write shared values in `shared` map", function () {
const root = new Obj2();
root.l1 = new Obj2();
root.l1.back = root.l1;
assert.deepStrictEqual(Lib.write(root), {
f: [["l1", { r: 0 }]],
$: "Obj2",
x: [{ f: [["back", { r: 0 }]], $: "Obj2" }]
});
});
it("should use `#shared` keys to resolve prototypes on read", function () {
const obj1 = Lib.read({
f: [["l1", { r: 0 }]],
$: "Obj2",
x: [{ f: [["back", { r: 0 }]], $: "Obj2" }]
});
assert.strictEqual(obj1.constructor, Obj2);
assert.deepEqual(Object.keys(obj1), ["l1"]);
assert.deepEqual(Object.keys(obj1.l1), ["back"]);
assert.strictEqual(obj1.l1.constructor, Obj2);
assert.strictEqual(obj1.l1.back, obj1.l1);
});
});
});
describe("prototypes chain", function () {
it("should correctly store and recover all references", function () {
class C1 {
constructor(p) {
this.p1 = p;
}
}
class C2 extends C1 {
constructor() {
super("A");
this.c1 = new C1(this);
}
}
Lib.regOpaqueObject(C1.prototype, "C1");
Lib.regOpaqueObject(C2.prototype, "C2");
const obj = new C2();
C1.prototype.p_prop_1 = "prop_1";
const res = Lib.write(obj);
C1.prototype.p_prop_1 = "changed";
assert.deepEqual(res, {
r: 0,
x: [
{
p: { $: "C2" },
f: [
["p1", "A"],
[
"c1",
{
p: { $: "C1", f: [["p_prop_1", "prop_1"]] },
f: [["p1", { r: 0 }]]
}
]
]
}
]
});
const r2 = Lib.read(res);
assert.ok(r2 instanceof C1);
assert.ok(r2 instanceof C2);
assert.strictEqual(r2.constructor, C2);
assert.strictEqual(Object.getPrototypeOf(r2).constructor, C2);
assert.strictEqual(r2.c1.constructor, C1);
assert.strictEqual(r2.c1.p1, r2);
assert.equal(r2.p1, "A");
assert.strictEqual(C1.prototype.p_prop_1, "prop_1");
class C3 {
constructor(val) {
this.a = val;
}
}
Lib.regOpaqueObject(C3.prototype, "C3", { props: false });
class C4 extends C3 {
constructor() {
super("A");
this.b = "B";
}
}
Lib.regOpaqueObject(C4.prototype, "C4");
const obj2 = new C4();
const res2 = Lib.write(obj2);
assert.deepEqual(res2, {
p: {
$: "C4"
},
f: [
["a", "A"],
["b", "B"]
]
});
const obj3 = Lib.read(res2);
assert.ok(obj3 instanceof C3);
assert.ok(obj3 instanceof C4);
assert.equal(obj3.a, "A");
assert.equal(obj3.b, "B");
assert.equal(
Object.getPrototypeOf(Object.getPrototypeOf(obj3)),
Object.getPrototypeOf(Object.getPrototypeOf(obj2))
);
});
});
describe("property's descriptor", function () {
it("should correctly store and recover all settings", function () {
const a = {};
let setCalled = 0;
let getCalled = 0;
let back;
let val;
const descr = {
set(value) {
assert.strictEqual(this, back);
setCalled++;
val = value;
},
get() {
assert.strictEqual(this, back);
getCalled++;
return a;
}
};
Object.defineProperty(a, "prop", descr);
const psym1 = Symbol("prop");
const psym2 = Symbol("prop");
Object.defineProperty(a, psym1, {
value: "B",
enumerable: true
});
Object.defineProperty(a, psym2, {
value: "C",
configurable: true
});
Object.defineProperty(a, Symbol.for("prop"), {
value: "D",
writable: true
});
Lib.regOpaqueObject(descr.set, "dset");
Lib.regOpaqueObject(descr.get, "dget");
const opts = { symsByName: new Map() };
const res = Lib.write(a, opts);
assert.deepEqual(res, {
f: [
["prop", null, 15, { $: "dget" }, { $: "dset" }],
[{ name: "prop" }, "B", 5],
[{ name: "prop", id: 1 }, "C", 6],
[{ key: "prop" }, "D", 3]
]
});
back = Lib.read(res, opts);
assert.deepEqual(Object.getOwnPropertySymbols(back), [
psym1,
psym2,
Symbol.for("prop")
]);
assert.strictEqual(setCalled, 0);
assert.strictEqual(getCalled, 0);
back.prop = "A";
assert.strictEqual(setCalled, 1);
assert.strictEqual(getCalled, 0);
assert.strictEqual(val, "A");
assert.strictEqual(back.prop, a);
assert.strictEqual(
Object.getOwnPropertyDescriptor(back, Symbol("prop")),
void 0
);
assert.deepEqual(Object.getOwnPropertyDescriptor(back, "prop"), {
enumerable: false,
configurable: false,
...descr
});
assert.deepEqual(Object.getOwnPropertyDescriptor(back, psym1), {
value: "B",
writable: false,
enumerable: true,
configurable: false
});
assert.deepEqual(Object.getOwnPropertyDescriptor(back, psym2), {
value: "C",
writable: false,
enumerable: false,
configurable: true
});
assert.deepEqual(
Object.getOwnPropertyDescriptor(back, Symbol.for("prop")),
{
value: "D",
writable: true,
enumerable: false,
configurable: false
}
);
});
});
describe("arrays serialization", function () {
context("without shared references", function () {
it("should be similar to `JSON.stringify`/`JSON.parse`", function () {
const obj = { arr: [1, "a", [true, [false, null]], undefined] };
const res = Lib.write(obj);
assert.deepStrictEqual(res, {
f: [["arr", [1, "a", [true, [false, null]], { $: "undefined" }]]]
});
const back = Lib.read(res);
assert.deepStrictEqual(obj, back);
});
it("doesn't support Array as root", function () {
assert.throws(() => Lib.write([1, 2]), TypeError);
});
});
it("should handle shared references", function () {
const obj = { arr: [1, "a", [true, [false, null]], undefined] };
obj.arr.push(obj.arr);
const res = Lib.write(obj);
assert.notStrictEqual(res, obj);
assert.deepStrictEqual(res, {
f: [["arr", { r: 0 }]],
x: [[1, "a", [true, [false, null]], { $: "undefined" }, { r: 0 }]]
});
const back = Lib.read(res);
assert.notStrictEqual(res, back);
assert.deepStrictEqual(obj, back);
});
});
describe("`Set` serialization", function () {
context("without shared references", function () {
it("should output `JSON.stringify` serializable object", function () {
const arr = [1, "a", [true, [false, null]], undefined];
const obj = { set: new Set(arr) };
obj.set.someNum = 100;
obj.set.self = obj.set;
const res = Lib.write(obj);
assert.deepStrictEqual(res, {
f: [["set", { r: 0 }]],
x: [
{
$: "Set",
l: [1, "a", [true, [false, null]], { $: "undefined" }],
f: [
["someNum", 100],
["self", { r: 0 }]
]
}
]
});
const back = Lib.read(res);
assert.deepStrictEqual(obj, back);
});
});
it("should handle shared references", function () {
const obj = new Set([1, "a", [true, [false, null]], undefined]);
obj.add(obj);
const res = Lib.write(obj);
assert.notStrictEqual(res, obj);
assert.deepStrictEqual(res, {
r: 0,
x: [
{
$: "Set",
l: [1, "a", [true, [false, null]], { $: "undefined" }, { r: 0 }]
}
]
});
const back = Lib.read(res);
assert.notStrictEqual(res, back);
assert.deepStrictEqual(obj, back);
});
});
describe("`Map` serialization", function () {
context("without shared references", function () {
it("should output `JSON.stringify` serializable object", function () {
const arr = [[1, "a"], [true, [false, null]], [undefined]];
const obj = { map: new Map(arr) };
const res = Lib.write(obj);
assert.deepStrictEqual(res, {
f: [
[
"map",
{
$: "Map",
k: [1, true, { $: "undefined" }],
v: ["a", [false, null], { $: "undefined" }]
}
]
]
});
const back = Lib.read(res);
assert.deepStrictEqual(obj, back);
});
});
it("should handle shared references", function () {
const obj = new Map([[1, "a"], [true, [false, null]], [undefined]]);
obj.set(obj, obj);
const res = Lib.write(obj);
assert.notStrictEqual(res, obj);
assert.deepStrictEqual(res, {
r: 0,
x: [
{
$: "Map",
k: [1, true, { $: "undefined" }, { r: 0 }],
v: ["a", [false, null], { $: "undefined" }, { r: 0 }]
}
]
});
const back = Lib.read(res);
assert.notStrictEqual(res, back);
assert.deepStrictEqual(obj, back);
});
});
describe("opaque objects serialization", function () {
it("should throw for not registered objects", function () {
function a() {}
assert.throws(() => Lib.write({ a }), TypeError);
});
it("should not throw if `ignore:true`", function () {
function a() {}
assert.deepStrictEqual(Lib.write({ a }, { ignore: true }), {});
});
it("should output object's name if registered", function () {
function a() {}
Lib.regOpaqueObject(a);
assert.deepStrictEqual(Lib.write({ a }), { f: [["a", { $: "a" }]] });
Lib.regOpaqueObject(a);
assert.deepStrictEqual(Lib.read({ f: [["a", { $: "a" }]] }), { a });
(function () {
function a() {}
Lib.regOpaqueObject(a);
assert.deepStrictEqual(Lib.write({ a }), { f: [["a", { $: "a_1" }]] });
assert.deepStrictEqual(Lib.read({ f: [["a", { $: "a_1" }]] }), { a });
})();
});
it("should not serialize properties specified before its registration", function () {
const obj = {
prop1: "p1",
[Symbol.for("sym#a")]: "s1",
[Symbol.for("sym#b")]: "s2",
prop2: "p2",
[3]: "N3",
[4]: "N4"
};
Lib.regOpaqueObject(obj, "A");
obj.prop1 = "P2";
obj.prop3 = "p3";
obj[Symbol.for("sym#a")] = "S1";
obj[Symbol.for("sym#c")] = "s3";
obj[4] = "n4";
obj[5] = "n5";
assert.deepStrictEqual(Lib.write({ obj }), {
f: [
[
"obj",
{
$: "A",
f: [
["4", "n4"],
["5", "n5"],
["prop1", "P2"],
["prop3", "p3"],
[
{
key: "sym#a"
},
"S1"
],
[
{
key: "sym#c"
},
"s3"
]
]
}
]
]
});
});
});
describe("opaque primitive value serialization", function () {
it("should output object's name if registered", function () {
const a = Symbol("a");
Lib.regOpaquePrim(a, "sa");
assert.ok(!a[Lib.descriptorSymbol]);
assert.deepStrictEqual(Lib.write({ a }), {
f: [["a", { $: "sa" }]]
});
Lib.regOpaquePrim(a, "sb");
assert.deepStrictEqual(Lib.read({ f: [["a", { $: "sa" }]] }), {
a
});
(function () {
const a = Symbol("a");
Lib.regOpaquePrim(a, "sa");
assert.deepStrictEqual(Lib.write({ a }), {
f: [["a", { $: "sa_1" }]]
});
assert.deepStrictEqual(Lib.read({ f: [["a", { $: "sa_1" }]] }), { a });
})();
});
});
describe("Symbols serialization", function () {
it("should keep values", function () {
const a1 = Symbol("a");
const a2 = Symbol("a");
const b = Symbol("b");
const g = Symbol.for("g");
const opts = { symsByName: new Map() };
const res = Lib.write({ a1, a2, b1: b, b2: b, g }, opts);
assert.deepStrictEqual(res, {
f: [
["a1", { name: "a", $: "Symbol" }],
["a2", { name: "a", id: 1, $: "Symbol" }],
["b1", { name: "b", $: "Symbol" }],
["b2", { name: "b", $: "Symbol" }],
["g", { key: "g", $: "Symbol" }]
]
});
const { a1: ra1, a2: ra2, b1: rb1, b2: rb2, g: rg } = Lib.read(res, opts);
assert.strictEqual(a1, ra1);
assert.strictEqual(a2, ra2);
assert.strictEqual(b, rb1);
assert.strictEqual(b, rb2);
assert.strictEqual(rg, g);
const { a1: la1, a2: la2, b1: lb1, b2: lb2, g: lg } = Lib.read(res, {
ignore: true
});
assert.notStrictEqual(a1, la1);
assert.notStrictEqual(a2, la2);
assert.notStrictEqual(lb1, b);
assert.notStrictEqual(lb2, b);
assert.strictEqual(lg, g);
assert.strictEqual(lb1, lb2);
assert.equal(String(la1), "Symbol(a)");
assert.equal(String(la2), "Symbol(a)");
assert.equal(String(lb1), "Symbol(b)");
assert.equal(String(lb2), "Symbol(b)");
});
});
describe("type with `$$typeof` attribute", function () {
Lib.regDescriptor({
name: "hundred",
typeofTag: 100,
read(ctx, json) {
return { $$typeof: 100 };
},
write(ctx, value) {
return { $: "hundred" };
},
props: false
});
it("should use overriden methods", function () {
assert.deepStrictEqual(Lib.write({ $$typeof: 100 }), {
$: "hundred"
});
assert.deepStrictEqual(Lib.read({ $: "hundred" }), { $$typeof: 100 });
});
});
describe("bind function arguments", function () {
it("should be serializable", function () {
const obj = {};
function f1(a1, a2, a3) {
return [this, a1, a2, a3];
}
const a1 = {},
a2 = {},
a3 = {};
Lib.regOpaqueObject(obj, "obj");
Lib.regOpaqueObject(f1);
Lib.regOpaqueObject(a1, "arg");
Lib.regOpaqueObject(a2, "arg");
const bind = Lib.bind(f1, obj, a1, a2);
bind.someNum = 100;
bind.rec = bind;
const fjson = Lib.write({ f: bind });
assert.deepStrictEqual(fjson, {
f: [
[
"f",
{
r: 0
}
]
],
x: [
{
f: [
["someNum", 100],
[
"rec",
{
r: 0
}
],
[
{
$: "#this"
},
{
$: "obj"
}
],
[
{
$: "#fun"
},
{
$: "f1"
}
],
[
{
$: "#args"
},
[
{
$: "arg"
},
{
$: "arg_1"
}
]
]
],
$: "Bind"
}
]
});
const f2 = Lib.read(fjson).f;
assert.notStrictEqual(f1, f2);
const res = f2(a3);
assert.strictEqual(res.length, 4);
const [robj, ra1, ra2, ra3] = res;
assert.strictEqual(obj, robj);
assert.strictEqual(a1, ra1);
assert.strictEqual(a2, ra2);
assert.strictEqual(a3, ra3);
});
});
describe("RegExp", function () {
it("should be serializable", function () {
const re1 = /\w+/;
const re2 = /ho/g;
const s1 = "uho-ho-ho";
re2.test(s1);
const res = Lib.write({ re1, re2 });
assert.deepEqual(res, {
f: [
["re1", { src: "\\w+", flags: "", $: "RegExp" }],
["re2", { src: "ho", flags: "g", last: 3, $: "RegExp" }]
]
});
const { re1: bre1, re2: bre2 } = Lib.read(res);
assert.equal(re1.src, bre1.src);
assert.equal(re1.flags, bre1.flags);
assert.equal(re1.lastIndex, bre1.lastIndex);
assert.equal(re2.src, bre2.src);
assert.equal(re2.flags, bre2.flags);
assert.equal(re2.lastIndex, bre2.lastIndex);
});
});
describe("not serializable values", function () {
it("should throw an exception if `ignore:falsy`", function () {
function A() {}
try {
Lib.write({ A });
} catch (e) {
assert.equal(e.constructor, TypeError);
assert.equal(
e.message,
`not serializable value "function A() {}" at "1"(A) of "A"`
);
return;
}
assert.fail("should throw");
});
it("should be ignored if `ignore:true`", function () {
function A() {}
const d = Lib.write({ A }, { ignore: true });
const r = Lib.read(d);
assert.deepEqual(r, {});
});
it('should register an opaque descriptor `ignore:"opaque"`', function () {
function A() {}
const d = Lib.write({ A, b: A }, { ignore: "opaque" });
const r = Lib.read(d);
assert.deepEqual(r, { A, b: A });
});
it("should register an opaque descriptor with auto-opaque descriptor", function () {
function A() {}
Lib.regAutoOpaqueConstr(A, true);
const a = new A();
const d = Lib.write({ a, b: a }, { ignore: "opaque" });
const r = Lib.read(d);
assert.deepEqual(r, { a, b: a });
});
it('should be converted into a not usable placeholder if `ignore:"placeholder"`', function () {
function A() {}
const d = Lib.write({ A }, { ignore: "placeholder" });
const r = Lib.read(d);
try {
r.A();
} catch (e) {
assert.equal(e.constructor, TypeError);
assert.equal(e.message, "apply in a not restored object");
return;
}
assert.fail("should throw");
});
});
describe("TypedArray", function () {
it("should be serializable", function () {
const arr1 = new Int32Array([1, 2, 3, 4, 5]);
const arr2 = new Uint32Array(arr1.buffer, 8);
const d = Lib.write({ arr1, arr2 }, {});
assert.deepStrictEqual(d, {
f: [
[
"arr1",
{
o: 0,
l: 5,
b: {
r: 0
},
$: "Int32Array"
}
],
[
"arr2",
{
o: 8,
l: 3,
b: {
r: 0
},
$: "Uint32Array"
}
]
],
x: [
{
d: "AQAAAAIAAAADAAAABAAAAAUAAAA=",
$: "ArrayBuffer"
}
]
});
const { arr1: rarr1, arr2: rarr2 } = Lib.read(d);
assert.equal(rarr1.constructor, Int32Array);
assert.equal(rarr2.constructor, Uint32Array);
assert.notStrictEqual(arr1, rarr1);
assert.notStrictEqual(arr2, rarr2);
assert.deepStrictEqual(arr1, rarr1);
assert.deepStrictEqual(arr2, rarr2);
});
});
describe("WeakSet/WeakMap", function () {
it("should be serializable", function () {
const set = new WeakSet();
const map = new WeakMap();
const map2 = new WeakMap();
const obj1 = {};
const obj2 = {};
Lib.regOpaqueObject(obj1, "w#obj1");
set.add(obj1).add(obj2);
map.set(obj1, "obj1").set(obj2, "obj2");
map2.set(obj1, "2obj1");
assert.ok(set.has(obj1));
assert.ok(map.has(obj1));
assert.strictEqual(map.get(obj1), "obj1");
assert.strictEqual(map.get({}), void 0);
const d = Lib.write({ set, map, map2, obj1, obj2 });
assert.deepStrictEqual(d, {
x: [{}, { $: "w#obj1" }],
f: [
["set", { v: [{ r: 0 }, { r: 1 }], $: "WeakSet" }],
[
"map",
{
k: [{ r: 1 }, { r: 0 }],
v: ["obj1", "obj2"],
$: "WeakMap"
}
],
[
"map2",
{
k: [{ r: 1 }],
v: ["2obj1"],
$: "WeakMap"
}
],
["obj1", { r: 1 }],
["obj2", { r: 0 }]
]
});
const {
set: rset,
map: rmap,
map2: rmap2,
obj1: robj1,
obj2: robj2
} = Lib.read(d);
assert.strictEqual(robj1, obj1);
assert.notStrictEqual(robj2, obj2);
assert.ok(rset.has(obj1));
assert.ok(set.delete(obj1));
assert.ok(!set.has(obj1));
assert.ok(rset.has(obj1));
assert.ok(rset.has(robj2));
assert.ok(!rset.has(obj2));
assert.ok(!set.has(robj2));
assert.strictEqual(rmap.get(obj1), "obj1");
assert.strictEqual(rmap2.get(obj1), "2obj1");
assert.ok(map.delete(obj1));
assert.strictEqual(rmap.get(obj1), "obj1");
assert.ok(rset.delete(robj2));
assert.ok(!rset.has(robj2));
assert.ok(!rset.delete(robj2));
assert.ok(!rset.has(robj2));
});
});
describe("WeakSet/WeakMap workaround", function () {
it("should be serializable", function () {
const set = new Lib.WeakSetWorkaround();
const map = new Lib.WeakMapWorkaround();
const map2 = new Lib.WeakMapWorkaround();
const obj1 = {};
const obj2 = {};
Lib.regOpaqueObject(obj1, "w##obj1");
set.add(obj1).add(obj2);
map.set(obj1, "obj1").set(obj2, "obj2");
map2.set(obj1, "2obj1");
assert.ok(set.has(obj1));
assert.ok(map.has(obj1));
assert.strictEqual(map.get(obj1), "obj1");
assert.strictEqual(map.get({}), void 0);
const d = Lib.write({ set, map, map2, obj1, obj2 });
assert.deepStrictEqual(d, {
f: [
[
"set",
{
f: [["prop", { name: "@effectful/weakset", $: "Symbol" }]],
$: "WeakSet#"
}
],
[
"map",
{
f: [["prop", { name: "@effectful/weakmap", $: "Symbol" }]],
$: "WeakMap#"
}
],
[
"map2",
{
f: [["prop", { name: "@effectful/weakmap", id: 1, $: "Symbol" }]],
$: "WeakMap#"
}
],
[
"obj1",
{
$: "w##obj1",
f: [
[{ name: "@effectful/weakset" }, true, 2],
[{ name: "@effectful/weakmap" }, "obj1", 2],
[{ name: "@effectful/weakmap", id: 1 }, "2obj1", 2]
]
}
],
[
"obj2",
{
f: [
[{ name: "@effectful/weakset" }, true, 2],
[{ name: "@effectful/weakmap" }, "obj2", 2]
]
}
]
]
});
const {
set: rset,
map: rmap,
map2: rmap2,
obj1: robj1,
obj2: robj2
} = Lib.read(d);
assert.strictEqual(robj1, obj1);
assert.notStrictEqual(robj2, obj2);
assert.ok(rset.has(obj1));
assert.ok(set.delete(obj1));
assert.ok(!set.has(obj1));
assert.ok(rset.has(obj1));
assert.ok(rset.has(robj2));
assert.ok(!rset.has(obj2));
assert.ok(!set.has(robj2));
assert.strictEqual(rmap.get(obj1), "obj1");
assert.strictEqual(rmap2.get(obj1), "2obj1");
assert.ok(map.delete(obj1));
assert.strictEqual(rmap.get(obj1), "obj1");
assert.ok(rset.delete(robj2));
assert.ok(!rset.has(robj2));
assert.ok(!rset.delete(robj2));
assert.ok(!rset.has(robj2));
});
});
describe("BigInt", function () {
it("should be serializable", function () {
const num = 2n ** 10000n;
const doc = Lib.write({ num });
assert.equal(doc.f[0][0], "num");
assert.ok(doc.f[0][1].int.substr);
assert.equal(doc.f[0][1].int.length, 3011);
assert.strictEqual(Lib.read(doc).num, num);
});
});
| awto/effectfuljs | packages/serialization/test/main.js | JavaScript | mit | 27,905 | 26.384691 | 97 | 0.476438 | false |
#include "GameCtrl.h"
char title[16][30]=
{
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,1,1,1,1,1,0,1,0,0,0,1,0,0,1,1,0,0,0,1,0,0,1,0,1,1,1,1,1,0},
{0,1,0,0,0,0,0,1,1,0,0,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,0,0,0},
{0,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,0,0,1,1,0,0,0,1,1,1,1,1,0},
{0,0,0,0,0,1,0,1,0,0,1,1,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,0,0,0},
{0,1,1,1,1,1,0,1,0,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,1,1,1,1,1,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,1,1,1,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,1,1,0,0,1,1,1,1,1,0},
{0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,1,1,0,0,0,1,1,0,0,1,0,0,0,0,0},
{0,0,1,0,0,1,1,0,0,1,1,1,1,0,0,1,0,1,0,1,0,1,0,0,1,1,1,1,1,0},
{0,0,1,1,1,1,1,0,0,1,0,0,1,0,0,1,0,1,0,1,0,1,0,0,1,0,0,0,0,0},
{0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,1,1,1,1,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
};
int main() {
int menu = 0;
for(int x=0;x<16;x++){
printf("\t");
for(int y=0;y<30;y++){
if(title[x][y] == 1){
printf("¡á");
}
if(title[x][y] == 0){
printf("¡à");
}
}
printf("\n");
}
printf("\n");
printf("\t\t\t\t<MENU>\n");
printf("\t\t\t 1.Snake Game(Manual Mode)\n");
printf("\t\t\t 2.See How to find Shortest Path\n");
printf("\t\t\t 3.See How to find Longest Path\n");
printf("\t\t\t 4.AI Hamiltonian Cycle\n");
printf("\t\t\t 5.AI Graph Search\n");
printf("\t\t\t 6.Exit\n");
printf("\t\t\t =>Input Menu Number : ");
scanf("%d",&menu);
auto game = GameCtrl::getInstance(0);
// Set FPS. Default is 60.0
game->setFPS(60.0);
// Set the interval time between each snake's movement. Default is 30 ms.
// To play classic snake game, set to 150 ms is perfect.
game->setMoveInterval(150);
// Set whether to record the snake's movements to file. Default is true.
// The movements will be written to a file named "movements.txt".
game->setRecordMovements(true);
// Set map's size(including boundaries). Default is 10*10. Minimum is 5*5.
game->setMapRow(10);
game->setMapCol(10);
if(menu==1){ //Snake Game
// Set whether to enable the snake AI. Default is true.
game->setEnableAI(false);
// Set whether to use a hamiltonian cycle to guide the AI. Default is true.
game->setEnableHamilton(true);
// Set whether to run the test program. Default is false.
// You can select different testing methods by modifying GameCtrl::test().
game->setRunTest(false);
}
else if(menu==2){ //Shortest Path
game->setEnableAI(false);
game->setEnableHamilton(true);
game->setRunTest(true);
game->setMapRow(20);
game->setMapCol(20);
}
else if(menu==3){ //Longest Path
auto game = GameCtrl::getInstance(1);
game->setEnableAI(false);
game->setEnableHamilton(true);
game->setRunTest(true);
game->setMapRow(20);
game->setMapCol(20);
}
else if(menu==4){ //Hamiltonian Cycle
game->setEnableAI(true);
game->setEnableHamilton(true);
game->setRunTest(false);
}
else if(menu==5){ //AI
game->setEnableAI(true);
game->setEnableHamilton(false);
game->setRunTest(false);
}
else
return 0;
return game->run();
}
| Gomdoree/Snake | src/main.cpp | C++ | mit | 3,451 | 28.245763 | 81 | 0.562156 | false |
require 'simplecov'
$VERBOSE = nil #FIXME
SimpleCov.start
require 'minitest/autorun'
require 'minitest/pride'
require_relative '../lib/cw'
class TestNumbers < MiniTest::Test
ROOT = File.expand_path File.dirname(__FILE__) + '/../'
def setup
@dsl = CW::Dsl.new
end
def teardown
@dsl = nil
end
def test_words_returns_words
words = @dsl.words
assert words.is_a? Array
assert_equal 1000, words.size
assert_equal 'the', words.first
end
def test_load_common_words_returns_words
words = @dsl.load_common_words
assert words.is_a? Array
assert_equal 1000, words.size
assert_equal 'the', words.first
end
def test_most_load_most_common_words_returns_words
words = @dsl.load_most_common_words
assert words.is_a? Array
assert_equal 500, words.size
assert_equal 'the', words.first
end
def test_load_abbreviations
words = @dsl.load_abbreviations
assert words.is_a? Array
assert_equal 85, words.size
assert_equal 'abt', words.first
end
def test_reverse
@dsl.words = %w[a b c]
assert_equal CW::Dsl, @dsl.class
@dsl.reverse
assert_equal 'c', @dsl.words.first
end
def test_double_words
@dsl.words = %w[a b]
@dsl.double_words
assert_equal %w[a a b b], @dsl.words
end
def test_letters_numbers
assert_equal %w[a b c d e], @dsl.letters_numbers[0..4]
assert_equal %w[y z], @dsl.words[24..25]
assert_equal %w[0 1], @dsl.words[26..27]
assert_equal %w[8 9], @dsl.words[34..35]
end
def test_random_numbers
@dsl.random_numbers
assert_equal Array, @dsl.words.class
assert_equal 50, @dsl.words.size
@dsl.words.each do |wrd|
assert wrd.size == 4
assert wrd.to_i > 0
assert wrd.to_i < 10000
end
end
def test_random_letters
@dsl.random_letters
assert_equal Array, @dsl.words.class
assert_equal 50, @dsl.words.size
@dsl.words.each do |wrd|
assert wrd.size == 4
end
end
def test_random_letters_numbers
@dsl.random_letters_numbers
assert_equal Array, @dsl.words.class
assert_equal 50, @dsl.words.size
@dsl.words.each do |wrd|
assert wrd.size == 4
end
end
def test_alphabet
@dsl.alphabet
assert_equal ["a b c d e f g h i j k l m n o p q r s t u v w x y z"], @dsl.words
end
def test_numbers
assert_equal ['0', '1', '2', '3', '4'], @dsl.numbers[0..4]
end
end
| mjago/CW | test/test_dsl.rb | Ruby | mit | 2,411 | 21.745283 | 84 | 0.639569 | false |
package se.leiflandia.lroi.utils;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import se.leiflandia.lroi.auth.model.AccessToken;
import se.leiflandia.lroi.auth.model.UserCredentials;
public class AuthUtils {
private static final String PREF_ACTIVE_ACCOUNT = "active_account";
private static final String PREFS_NAME = "se.leiflandia.lroi.prefs";
public static void removeActiveAccount(Context context, String accountType) {
Account account = getActiveAccount(context, accountType);
if (account != null) {
AccountManager.get(context).removeAccount(account, null, null);
}
setActiveAccountName(context, null);
}
public static Account getActiveAccount(final Context context, final String accountType) {
Account[] accounts = AccountManager.get(context).getAccountsByType(accountType);
return getActiveAccount(accounts, getActiveAccountName(context));
}
public static boolean hasActiveAccount(final Context context, final String accountType) {
return getActiveAccount(context, accountType) != null;
}
private static String getActiveAccountName(final Context context) {
return getSharedPreferences(context)
.getString(PREF_ACTIVE_ACCOUNT, null);
}
public static void setActiveAccountName(final Context context, final String name) {
getSharedPreferences(context).edit()
.putString(PREF_ACTIVE_ACCOUNT, name)
.commit();
}
private static Account getActiveAccount(final Account[] accounts, final String activeAccountName) {
for (Account account : accounts) {
if (TextUtils.equals(account.name, activeAccountName)) {
return account;
}
}
return null;
}
private static SharedPreferences getSharedPreferences(final Context context) {
return context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
}
/**
* Saves an authorized account in account manager and set as active account.
*/
public static void setAuthorizedAccount(Context context, UserCredentials credentials, AccessToken token, String authtokenType, String accountType) {
final AccountManager accountManager = AccountManager.get(context);
Account account = findOrCreateAccount(accountManager, credentials.getUsername(), token.getRefreshToken(), accountType);
accountManager.setAuthToken(account, authtokenType, token.getAccessToken());
setActiveAccountName(context, account.name);
}
/**
* Sets password of account, creates a new account if necessary.
*/
private static Account findOrCreateAccount(AccountManager accountManager, String username, String refreshToken, String accountType) {
for (Account account : accountManager.getAccountsByType(accountType)) {
if (account.name.equals(username)) {
accountManager.setPassword(account, refreshToken);
return account;
}
}
Account account = new Account(username, accountType);
accountManager.addAccountExplicitly(account, refreshToken, null);
return account;
}
}
| Wadpam/lets-the-right-one-in | lroi-lib/src/main/java/se/leiflandia/lroi/utils/AuthUtils.java | Java | mit | 3,349 | 38.4 | 152 | 0.705285 | false |
/* Copyright (C) 2001-2015 Peter Selinger.
This file is part of Potrace. It is free software and it is covered
by the GNU General Public License. See the file COPYING for details. */
#ifndef BACKEND_GEO_H
#define BACKEND_GEO_H
#include "potracelib.h"
int page_geojson(FILE *fout, potrace_path_t *plist, int as_polygons);
#endif /* BACKEND_GEO_H */
| ossimlabs/ossim-plugins | potrace/src/backend_geojson.h | C | mit | 360 | 24.714286 | 74 | 0.719444 | false |
docker run -d \
--name=sickbeard \
-v $(pwd)/data:/data \
-v $(pwd)/config/config.ini:/app/config.ini \
-p 8081:8081 \
chamunks/alpine-sickbeard-arm:latest
| chamunks/alpine-sickbeard-arm | run.sh | Shell | mit | 171 | 27.5 | 48 | 0.625731 | false |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Xml.Linq;
using Reportz.Scripting.Attributes;
using Reportz.Scripting.Classes;
using Reportz.Scripting.Interfaces;
namespace Reportz.Scripting.Commands
{
[ScriptElementAlias("execute-script")]
public class ExecuteScriptCommand : IExecutable, IScriptElement
{
private IScriptParser _instantiator;
private XElement _element;
private ArgCollection _argsCollection;
private EventCollection _eventsCollection;
public ExecuteScriptCommand()
{
}
public string ScriptName { get; private set; }
public IExecutableResult Execute(IExecutableArgs args)
{
IExecutableResult result = null;
args = args ?? new ExecutableArgs { Scope = new VariableScope() };
try
{
var ctx = args?.Scope.GetScriptContext();
var scriptName = args?.Arguments?.FirstOrDefault(x => x.Key == "scriptName")?.Value?.ToString();
scriptName = scriptName ?? ScriptName;
if (string.IsNullOrWhiteSpace(scriptName))
throw new Exception($"Invalid script name.");
var script = ctx?.ScriptScope?.GetScript(scriptName);
if (script == null)
throw new Exception($"Could not get script '{scriptName}'. ");
var scriptArgs = new ExecutableArgs();
scriptArgs.Scope = args.Scope.CreateChild();
//scriptArgs.Arguments = _argsCollection?._vars?.Values?.ToArray();
var scriptArgVars = _argsCollection?._vars?.Values?.ToArray();
if (scriptArgVars != null)
{
foreach (var scriptVar in scriptArgVars)
{
var r = scriptVar.Execute(scriptArgs);
}
}
result = script.Execute(scriptArgs);
return result;
}
catch (Exception ex)
{
IEvent errorEvent;
if (_eventsCollection._events.TryGetValue("error", out errorEvent) && errorEvent != null)
{
var exceptionVar = new Variable
{
Key = "$$Exception",
Value = ex,
};
args.Scope?.SetVariable(exceptionVar);
errorEvent.Execute(args);
}
return result;
// todo: implement 'catch' logic. catch="true" on <event key="error">. Or only if wrapped inside <try> <catch>
// todo: implement test <throw> tag
//throw;
}
finally
{
IEvent completeEvent;
if (_eventsCollection._events.TryGetValue("complete", out completeEvent) && completeEvent != null)
{
var resultVar = new Variable
{
Key = "$$Result",
Value = result?.Result,
};
args.Scope?.SetVariable(resultVar);
completeEvent.Execute(args);
}
}
}
public void Configure(IScriptParser parser, XElement element)
{
_instantiator = parser;
_element = element;
ScriptName = element?.Attribute("scriptName")?.Value ??
element?.Attribute("name")?.Value;
var argsElem = element?.Element("arguments");
if (argsElem != null)
{
var arg = new ArgCollection();
arg.Configure(parser, argsElem);
_argsCollection = arg;
}
var eventsElem = element?.Element("events");
if (eventsElem != null)
{
var events = new EventCollection();
events.Configure(parser, eventsElem);
_eventsCollection = events;
}
}
}
}
| LazyTarget/Reportz | Reportz.Scripting/Commands/ExecuteScriptCommand.cs | C# | mit | 4,213 | 33.801653 | 126 | 0.501306 | false |
(function () {
'use strict';
angular
.module('crimes.routes')
.config(routeConfig);
routeConfig.$inject = ['$stateProvider'];
function routeConfig($stateProvider) {
$stateProvider
.state('crimes', {
abstract: true,
url: '/crimes',
template: '<ui-view/>'
})
.state('crimes.list', {
url: '',
templateUrl: '/modules/crimes/client/views/list-crimes.client.view.html',
controller: 'CrimesListController',
controllerAs: 'vm',
data: {
pageTitle: 'Crimes List'
}
})
.state('crimes.view', {
url: '/:crimeId',
templateUrl: '/modules/crimes/client/views/view-crimes.client.view.html',
controller: 'CrimesController',
controllerAs: 'vm',
resolve: {
crimeResolve: getCrime
},
data: {
pageTitle: 'Crimes {{ crimeResolve.title }}'
}
});
}
getCrime.$inject = ['$stateParams', 'CrimesService'];
function getCrime($stateParams, CrimesService) {
return CrimesService.get({
crimeId: $stateParams.crimeId
}).$promise;
}
}());
| ravikumargh/Police | modules/crimes/client/config/crime.client.routes.js | JavaScript | mit | 1,154 | 23.553191 | 81 | 0.557192 | false |
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
// Not exported
@interface GQDWPColumn : NSObject
{
long long mIndex;
float mWidth;
float mSpacing;
_Bool mHasSpacing;
}
+ (const struct StateSpec *)stateForReading;
- (float)spacing;
- (_Bool)hasSpacing;
- (float)width;
- (long long)index;
- (int)readAttributesFromReader:(struct _xmlTextReader *)arg1;
@end
| matthewsot/CocoaSharp | Headers/PrivateFrameworks/iWorkImport/GQDWPColumn.h | C | mit | 492 | 17.923077 | 83 | 0.670732 | false |
//
// AppDelegate.h
// discovery
//
// Created by Karthik Rao on 1/20/17.
// Copyright © 2017 Karthik Rao. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
| raokarthik74/Discovery | discovery/discovery/AppDelegate.h | C | mit | 280 | 15.411765 | 60 | 0.702509 | false |
<?php
if( $kind = ic_get_post( 'kind' ) ) {
if( $kind == 'c' || $kind == 'cod' ) { $sym = '#'; $kind = 'cod'; }
else if( $kind == 'l' || $kind == 'loc' ) { $sym = '@'; $kind = 'loc'; }
else if( $kind == 's' || $kind == 'str' ) { $sym = '*'; $kind = 'str'; }
else if( $kind == 'u' || $kind == 'usr' ) { $sym = '+'; $kind = 'usr'; }
if( $name = ic_get_post( 'filters-req' ) ) {
$filter = $_SESSION['filters'][$sym.$name];
$filter->manage( 'req' );
} else if( $name = ic_get_post( 'filters-sign' ) ) {
$filter = $_SESSION['filters'][$sym.$name];
$filter->manage( 'sign' );
} else if( $name = ic_get_post( 'trashed_filter' ) ) {
$filter = $_SESSION['filters'][$sym.$name];
$filter->manage( 'clear' );
} else if( $name = ic_get_post( 'new_filter' ) ) {
$sign = ( $post_meta = ic_get_post( 'new_sign' ) ) ? $post_meta : 'd';
$filter = new filter( $name, $kind, $sign );
$filter->manage( 'add' );
} $filter_change = TRUE;
}
if( isset( $filter_change ) || ic_get_post( 'filters_refresh' ) ) {
foreach( $_SESSION['filters'] as $filter ) $filter->tag();
} else {
$sign_filters = get_setting( 'sign_filters');
$on = $sign_filters != 1 ? ',\'d\'' : ',0';
$filts = $sign_filters != 1 ? 'style="display:none;"' : '';
$hover = get_setting( 'hover_help' );
?>
<div id="hover-help">
<div class="hover-off" id="hh-ftradd"><?php tr( 'ftradd', 'h' ) ?></div>
</div>
<div class="text-box" id="shell-filters">
<div class="filters-choice filters-choice-signs"><?php filter::add_filters( 'input-filters', 'addFilter()', 'addFilterSelect()' ) ?></div>
<div id="filters">
<?php
$filter_change = TRUE;
include( 'filters-main.php' );
echo '</div></div>';
}
| mhaddir/draco | apps/filters/filters-news.php | PHP | mit | 1,680 | 31.941176 | 138 | 0.538095 | false |
class IssueTrackerService < Service
validate :one_issue_tracker, if: :activated?, on: :manual_change
default_value_for :category, 'issue_tracker'
# Pattern used to extract links from comments
# Override this method on services that uses different patterns
# This pattern does not support cross-project references
# The other code assumes that this pattern is a superset of all
# overriden patterns. See ReferenceRegexes::EXTERNAL_PATTERN
def self.reference_pattern
@reference_pattern ||= %r{(\b[A-Z][A-Z0-9_]+-|#{Issue.reference_prefix})(?<issue>\d+)}
end
def default?
default
end
def issue_url(iid)
self.issues_url.gsub(':id', iid.to_s)
end
def issue_tracker_path
project_url
end
def new_issue_path
new_issue_url
end
def issue_path(iid)
issue_url(iid)
end
def fields
[
{ type: 'text', name: 'description', placeholder: description },
{ type: 'text', name: 'project_url', placeholder: 'Project url', required: true },
{ type: 'text', name: 'issues_url', placeholder: 'Issue url', required: true },
{ type: 'text', name: 'new_issue_url', placeholder: 'New Issue url', required: true }
]
end
# Initialize with default properties values
# or receive a block with custom properties
def initialize_properties(&block)
return unless properties.nil?
if enabled_in_gitlab_config
if block_given?
yield
else
self.properties = {
title: issues_tracker['title'],
project_url: issues_tracker['project_url'],
issues_url: issues_tracker['issues_url'],
new_issue_url: issues_tracker['new_issue_url']
}
end
else
self.properties = {}
end
end
def self.supported_events
%w(push)
end
def execute(data)
return unless supported_events.include?(data[:object_kind])
message = "#{self.type} was unable to reach #{self.project_url}. Check the url and try again."
result = false
begin
response = HTTParty.head(self.project_url, verify: true)
if response
message = "#{self.type} received response #{response.code} when attempting to connect to #{self.project_url}"
result = true
end
rescue HTTParty::Error, Timeout::Error, SocketError, Errno::ECONNRESET, Errno::ECONNREFUSED, OpenSSL::SSL::SSLError => error
message = "#{self.type} had an error when trying to connect to #{self.project_url}: #{error.message}"
end
Rails.logger.info(message)
result
end
private
def enabled_in_gitlab_config
Gitlab.config.issues_tracker &&
Gitlab.config.issues_tracker.values.any? &&
issues_tracker
end
def issues_tracker
Gitlab.config.issues_tracker[to_param]
end
def one_issue_tracker
return if template?
return if project.blank?
if project.services.external_issue_trackers.where.not(id: id).any?
errors.add(:base, 'Another issue tracker is already in use. Only one issue tracker service can be active at a time')
end
end
end
| dplarson/gitlabhq | app/models/project_services/issue_tracker_service.rb | Ruby | mit | 3,048 | 26.963303 | 128 | 0.663714 | false |
/**
* Compile sass files to css using compass
*/
module.exports = {
dev: {
options: {
config: 'config.rb',
environment: 'development'
}
},
};
| timothytran/ngModular | grunt/compass.js | JavaScript | mit | 192 | 16.454545 | 42 | 0.479167 | false |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cognito.Stripe.Classes
{
public class FileUpload : BaseObject
{
public override string Object { get { return "file_upload"; } }
public string Purpose { get; set; }
public int Size { get; set; }
public string Type { get; set; }
public string URL { get; set; }
}
}
| vc3/Cognito.Stripe | Cognito.Stripe/Classes/FileUpload.cs | C# | mit | 377 | 21.058824 | 65 | 0.698667 | false |
class ChangeIntegerLimits < ActiveRecord::Migration
def change
change_column :projects, :federal_contribution, :integer, limit: 8
change_column :projects, :total_eligible_cost, :integer, limit: 8
end
end
| anquinn/infrastructure_projects | db/migrate/20170513191438_change_integer_limits.rb | Ruby | mit | 214 | 34.666667 | 69 | 0.757009 | false |
<?php
exit;
include_once "config/config.php";
include_once "engine/fhq_class_security.php";
include_once "engine/fhq_class_database.php";
include_once "engine/fhq_class_mail.php";
if(!isset($_GET['email']))
{
echo "not found parametr ?email=";
exit;
};
$email = $_GET['email'];
echo "send to mail: ".$email."<br>";
$security = new fhq_security();
$db = new fhq_database();
$mail = new fhq_mail();
echo "mail created <br>";
$error = "";
echo "try send email<br>";
$mail->send($email,'','','Test Mail', 'Test messages', $error);
echo "sended";
echo $error;
?>
| SibirCTF/2014-jury-system-fhq | php/fhq/test_mail.php | PHP | mit | 568 | 18.586207 | 63 | 0.640845 | false |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: bigiq_regkey_license_assignment
short_description: Manage regkey license assignment on BIG-IPs from a BIG-IQ
description:
- Manages the assignment of regkey licenses on a BIG-IQ. Assignment means
the license is assigned to a BIG-IP, or it needs to be assigned to a BIG-IP.
Additionally, this module supports revoking the assignments from BIG-IP devices.
version_added: "1.0.0"
options:
pool:
description:
- The registration key pool to use.
type: str
required: True
key:
description:
- The registration key you want to assign from the pool.
type: str
required: True
device:
description:
- When C(managed) is C(no), specifies the address, or hostname, where the BIG-IQ
can reach the remote device to register.
- When C(managed) is C(yes), specifies the managed device, or device UUID, that
you want to register.
- If C(managed) is C(yes), it is very important you do not have more than
one device with the same name. BIG-IQ internally recognizes devices by their ID,
and therefore, this module cannot guarantee the correct device will be
registered. The device returned is the device that is used.
type: str
required: True
managed:
description:
- Whether the specified device is a managed or un-managed device.
- When C(state) is C(present), this parameter is required.
type: bool
device_port:
description:
- Specifies the port of the remote device to connect to.
- If this parameter is not specified, the default is C(443).
type: int
default: 443
device_username:
description:
- The username used to connect to the remote device.
- This username should be one that has sufficient privileges on the remote device
to do licensing. Usually this is the C(Administrator) role.
- When C(managed) is C(no), this parameter is required.
type: str
device_password:
description:
- The password of the C(device_username).
- When C(managed) is C(no), this parameter is required.
type: str
state:
description:
- When C(present), ensures the device is assigned the specified license.
- When C(absent), ensures the license is revoked from the remote device and freed
on the BIG-IQ.
type: str
choices:
- present
- absent
default: present
extends_documentation_fragment: f5networks.f5_modules.f5
author:
- Tim Rupp (@caphrim007)
'''
EXAMPLES = r'''
- name: Register an unmanaged device
bigiq_regkey_license_assignment:
pool: my-regkey-pool
key: XXXX-XXXX-XXXX-XXXX-XXXX
device: 1.1.1.1
managed: no
device_username: admin
device_password: secret
state: present
provider:
user: admin
password: secret
server: lb.mydomain.com
delegate_to: localhost
- name: Register a managed device, by name
bigiq_regkey_license_assignment:
pool: my-regkey-pool
key: XXXX-XXXX-XXXX-XXXX-XXXX
device: bigi1.foo.com
managed: yes
state: present
provider:
user: admin
password: secret
server: lb.mydomain.com
delegate_to: localhost
- name: Register a managed device, by UUID
bigiq_regkey_license_assignment:
pool: my-regkey-pool
key: XXXX-XXXX-XXXX-XXXX-XXXX
device: 7141a063-7cf8-423f-9829-9d40599fa3e0
managed: yes
state: present
provider:
user: admin
password: secret
server: lb.mydomain.com
delegate_to: localhost
'''
RETURN = r'''
# only common fields returned
'''
import re
import time
from datetime import datetime
from ansible.module_utils.basic import AnsibleModule
from ..module_utils.bigip import F5RestClient
from ..module_utils.common import (
F5ModuleError, AnsibleF5Parameters, f5_argument_spec
)
from ..module_utils.icontrol import bigiq_version
from ..module_utils.ipaddress import is_valid_ip
from ..module_utils.teem import send_teem
class Parameters(AnsibleF5Parameters):
api_map = {
'deviceReference': 'device_reference',
'deviceAddress': 'device_address',
'httpsPort': 'device_port'
}
api_attributes = [
'deviceReference', 'deviceAddress', 'httpsPort', 'managed'
]
returnables = [
'device_address', 'device_reference', 'device_username', 'device_password',
'device_port', 'managed'
]
updatables = [
'device_reference', 'device_address', 'device_username', 'device_password',
'device_port', 'managed'
]
def to_return(self):
result = {}
try:
for returnable in self.returnables:
result[returnable] = getattr(self, returnable)
result = self._filter_params(result)
except Exception:
raise
return result
class ApiParameters(Parameters):
pass
class ModuleParameters(Parameters):
@property
def device_password(self):
if self._values['device_password'] is None:
return None
return self._values['device_password']
@property
def device_username(self):
if self._values['device_username'] is None:
return None
return self._values['device_username']
@property
def device_address(self):
if self.device_is_address:
return self._values['device']
@property
def device_port(self):
if self._values['device_port'] is None:
return None
return int(self._values['device_port'])
@property
def device_is_address(self):
if is_valid_ip(self.device):
return True
return False
@property
def device_is_id(self):
pattern = r'[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}'
if re.match(pattern, self.device):
return True
return False
@property
def device_is_name(self):
if not self.device_is_address and not self.device_is_id:
return True
return False
@property
def device_reference(self):
if not self.managed:
return None
if self.device_is_address:
# This range lookup is how you do lookups for single IP addresses. Weird.
filter = "address+eq+'{0}...{0}'".format(self.device)
elif self.device_is_name:
filter = "hostname+eq+'{0}'".format(self.device)
elif self.device_is_id:
filter = "uuid+eq+'{0}'".format(self.device)
else:
raise F5ModuleError(
"Unknown device format '{0}'".format(self.device)
)
uri = "https://{0}:{1}/mgmt/shared/resolver/device-groups/cm-bigip-allBigIpDevices/devices/" \
"?$filter={2}&$top=1".format(self.client.provider['server'],
self.client.provider['server_port'], filter)
resp = self.client.api.get(uri)
try:
response = resp.json()
except ValueError as ex:
raise F5ModuleError(str(ex))
if resp.status == 200 and response['totalItems'] == 0:
raise F5ModuleError(
"No device with the specified address was found."
)
elif 'code' in response and response['code'] == 400:
if 'message' in response:
raise F5ModuleError(response['message'])
else:
raise F5ModuleError(resp._content)
id = response['items'][0]['uuid']
result = dict(
link='https://localhost/mgmt/shared/resolver/device-groups/cm-bigip-allBigIpDevices/devices/{0}'.format(id)
)
return result
@property
def pool_id(self):
filter = "(name%20eq%20'{0}')".format(self.pool)
uri = 'https://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses?$filter={2}&$top=1'.format(
self.client.provider['server'],
self.client.provider['server_port'],
filter
)
resp = self.client.api.get(uri)
try:
response = resp.json()
except ValueError as ex:
raise F5ModuleError(str(ex))
if resp.status == 200 and response['totalItems'] == 0:
raise F5ModuleError(
"No pool with the specified name was found."
)
elif 'code' in response and response['code'] == 400:
if 'message' in response:
raise F5ModuleError(response['message'])
else:
raise F5ModuleError(resp._content)
return response['items'][0]['id']
@property
def member_id(self):
if self.device_is_address:
# This range lookup is how you do lookups for single IP addresses. Weird.
filter = "deviceAddress+eq+'{0}...{0}'".format(self.device)
elif self.device_is_name:
filter = "deviceName+eq+'{0}'".format(self.device)
elif self.device_is_id:
filter = "deviceMachineId+eq+'{0}'".format(self.device)
else:
raise F5ModuleError(
"Unknown device format '{0}'".format(self.device)
)
uri = 'https://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offerings/{3}/members/' \
'?$filter={4}'.format(self.client.provider['server'], self.client.provider['server_port'],
self.pool_id, self.key, filter)
resp = self.client.api.get(uri)
try:
response = resp.json()
except ValueError as ex:
raise F5ModuleError(str(ex))
if resp.status == 200 and response['totalItems'] == 0:
return None
elif 'code' in response and response['code'] == 400:
if 'message' in response:
raise F5ModuleError(response['message'])
else:
raise F5ModuleError(resp._content)
result = response['items'][0]['id']
return result
class Changes(Parameters):
pass
class UsableChanges(Changes):
@property
def device_port(self):
if self._values['managed']:
return None
return self._values['device_port']
@property
def device_username(self):
if self._values['managed']:
return None
return self._values['device_username']
@property
def device_password(self):
if self._values['managed']:
return None
return self._values['device_password']
@property
def device_reference(self):
if not self._values['managed']:
return None
return self._values['device_reference']
@property
def device_address(self):
if self._values['managed']:
return None
return self._values['device_address']
@property
def managed(self):
return None
class ReportableChanges(Changes):
pass
class Difference(object):
def __init__(self, want, have=None):
self.want = want
self.have = have
def compare(self, param):
try:
result = getattr(self, param)
return result
except AttributeError:
return self.__default(param)
def __default(self, param):
attr1 = getattr(self.want, param)
try:
attr2 = getattr(self.have, param)
if attr1 != attr2:
return attr1
except AttributeError:
return attr1
class ModuleManager(object):
def __init__(self, *args, **kwargs):
self.module = kwargs.get('module', None)
self.client = F5RestClient(**self.module.params)
self.want = ModuleParameters(params=self.module.params, client=self.client)
self.have = ApiParameters()
self.changes = UsableChanges()
def _set_changed_options(self):
changed = {}
for key in Parameters.returnables:
if getattr(self.want, key) is not None:
changed[key] = getattr(self.want, key)
if changed:
self.changes = UsableChanges(params=changed)
def _update_changed_options(self):
diff = Difference(self.want, self.have)
updatables = Parameters.updatables
changed = dict()
for k in updatables:
change = diff.compare(k)
if change is None:
continue
else:
if isinstance(change, dict):
changed.update(change)
else:
changed[k] = change
if changed:
self.changes = UsableChanges(params=changed)
return True
return False
def should_update(self):
result = self._update_changed_options()
if result:
return True
return False
def exec_module(self):
start = datetime.now().isoformat()
version = bigiq_version(self.client)
changed = False
result = dict()
state = self.want.state
if state == "present":
changed = self.present()
elif state == "absent":
changed = self.absent()
reportable = ReportableChanges(params=self.changes.to_return())
changes = reportable.to_return()
result.update(**changes)
result.update(dict(changed=changed))
self._announce_deprecations(result)
send_teem(start, self.module, version)
return result
def _announce_deprecations(self, result):
warnings = result.pop('__warnings', [])
for warning in warnings:
self.module.deprecate(
msg=warning['msg'],
version=warning['version']
)
def present(self):
if self.exists():
return False
return self.create()
def exists(self):
if self.want.member_id is None:
return False
uri = 'https://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offerings/{3}/members/{4}'.format(
self.client.provider['server'],
self.client.provider['server_port'],
self.want.pool_id,
self.want.key,
self.want.member_id
)
resp = self.client.api.get(uri)
if resp.status == 200:
return True
return False
def remove(self):
self._set_changed_options()
if self.module.check_mode:
return True
self.remove_from_device()
if self.exists():
raise F5ModuleError("Failed to delete the resource.")
# Artificial sleeping to wait for remote licensing (on BIG-IP) to complete
#
# This should be something that BIG-IQ can do natively in 6.1-ish time.
time.sleep(60)
return True
def create(self):
self._set_changed_options()
if not self.want.managed:
if self.want.device_username is None:
raise F5ModuleError(
"You must specify a 'device_username' when working with unmanaged devices."
)
if self.want.device_password is None:
raise F5ModuleError(
"You must specify a 'device_password' when working with unmanaged devices."
)
if self.module.check_mode:
return True
self.create_on_device()
if not self.exists():
raise F5ModuleError(
"Failed to license the remote device."
)
self.wait_for_device_to_be_licensed()
# Artificial sleeping to wait for remote licensing (on BIG-IP) to complete
#
# This should be something that BIG-IQ can do natively in 6.1-ish time.
time.sleep(60)
return True
def create_on_device(self):
params = self.changes.api_params()
uri = 'https://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offerings/{3}/members/'.format(
self.client.provider['server'],
self.client.provider['server_port'],
self.want.pool_id,
self.want.key
)
if not self.want.managed:
params['username'] = self.want.device_username
params['password'] = self.want.device_password
resp = self.client.api.post(uri, json=params)
try:
response = resp.json()
except ValueError as ex:
raise F5ModuleError(str(ex))
if 'code' in response and response['code'] == 400:
if 'message' in response:
raise F5ModuleError(response['message'])
else:
raise F5ModuleError(resp.content)
def wait_for_device_to_be_licensed(self):
count = 0
uri = 'https://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offerings/{3}/members/{4}'.format(
self.client.provider['server'],
self.client.provider['server_port'],
self.want.pool_id,
self.want.key,
self.want.member_id
)
while count < 3:
resp = self.client.api.get(uri)
try:
response = resp.json()
except ValueError as ex:
raise F5ModuleError(str(ex))
if 'code' in response and response['code'] == 400:
if 'message' in response:
raise F5ModuleError(response['message'])
else:
raise F5ModuleError(resp.content)
if response['status'] == 'LICENSED':
count += 1
else:
count = 0
def absent(self):
if self.exists():
return self.remove()
return False
def remove_from_device(self):
uri = 'https://{0}:{1}/mgmt/cm/device/licensing/pool/regkey/licenses/{2}/offerings/{3}/members/{4}'.format(
self.client.provider['server'],
self.client.provider['server_port'],
self.want.pool_id,
self.want.key,
self.want.member_id
)
params = {}
if not self.want.managed:
params.update(self.changes.api_params())
params['id'] = self.want.member_id
params['username'] = self.want.device_username
params['password'] = self.want.device_password
self.client.api.delete(uri, json=params)
class ArgumentSpec(object):
def __init__(self):
self.supports_check_mode = True
argument_spec = dict(
pool=dict(required=True),
key=dict(required=True, no_log=True),
device=dict(required=True),
managed=dict(type='bool'),
device_port=dict(type='int', default=443),
device_username=dict(no_log=True),
device_password=dict(no_log=True),
state=dict(default='present', choices=['absent', 'present'])
)
self.argument_spec = {}
self.argument_spec.update(f5_argument_spec)
self.argument_spec.update(argument_spec)
self.required_if = [
['state', 'present', ['key', 'managed']],
['managed', False, ['device', 'device_username', 'device_password']],
['managed', True, ['device']]
]
def main():
spec = ArgumentSpec()
module = AnsibleModule(
argument_spec=spec.argument_spec,
supports_check_mode=spec.supports_check_mode,
required_if=spec.required_if
)
try:
mm = ModuleManager(module=module)
results = mm.exec_module()
module.exit_json(**results)
except F5ModuleError as ex:
module.fail_json(msg=str(ex))
if __name__ == '__main__':
main()
| F5Networks/f5-ansible-modules | ansible_collections/f5networks/f5_modules/plugins/modules/bigiq_regkey_license_assignment.py | Python | mit | 19,962 | 30.990385 | 119 | 0.583408 | false |
<?php
/**
*
* @author thiago
*/
interface ConsoleFactory {
public function create_console_microsoft();
public function create_console_sony();
}
| thiagorthomaz/design-patterns | abstractFactory/ConsoleFactory.class.php | PHP | mit | 153 | 12.909091 | 45 | 0.686275 | false |
<!DOCTYPE html>
<html lang="en-us">
<head>
<link href="http://gmpg.org/xfn/11" rel="profile">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<!-- Enable responsiveness on mobile devices-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<title>
Posts Tagged “systemjs” · Mike Loll
</title>
<!-- CSS -->
<link rel="stylesheet" href="/public/css/poole.css">
<link rel="stylesheet" href="/public/css/syntax.css">
<link rel="stylesheet" href="/public/css/lanyon.css">
<link rel="stylesheet" href="/public/css/mikeloll.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=PT+Serif:400,400italic,700%7CPT+Sans:400">
<!-- Icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/public/apple-touch-icon-precomposed.png">
<link rel="shortcut icon" href="/public/favicon.ico">
<!-- RSS -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
</head>
<body>
<!-- Target for toggling the sidebar `.sidebar-checkbox` is for regular
styles, `#sidebar-checkbox` for behavior. -->
<input type="checkbox" class="sidebar-checkbox" id="sidebar-checkbox">
<!-- Toggleable sidebar -->
<div class="sidebar" id="sidebar">
<div class="sidebar-item">
<p></p>
</div>
<nav class="sidebar-nav">
<a class="sidebar-nav-item" href="/">Home</a>
<a class="sidebar-nav-item" href="/about/">About</a>
<a class="sidebar-nav-item" href="/archive/">Archive</a>
</nav>
<div class="sidebar-item">
<p>
© 2015. All rights reserved.
</p>
</div>
</div>
<!-- Wrap is the content to shift when toggling the sidebar. We wrap the
content to avoid any CSS collisions with our real content. -->
<div class="wrap">
<div class="masthead">
<div class="container">
<h3 class="masthead-title">
<a href="/" title="Home">Mike Loll</a>
<small>A collection of random tech related things.</small>
</h3>
</div>
</div>
<div class="container content">
<h2 class="post_title">Posts Tagged “systemjs”</h2>
01/02/14<a class="archive_list_article_link" href='/2014/01/02/introducing-lanyon/'>Introducing Lanyon</a>
<p class="summary"></p>
<a class="tag_list_link" href="/tag/angular2">angular2</a> <a class="tag_list_link" href="/tag/typescript">typescript</a> <a class="tag_list_link" href="/tag/systemjs">systemjs</a>
</ul>
</div>
</div>
<label for="sidebar-checkbox" class="sidebar-toggle"></label>
<script>
(function(document) {
var toggle = document.querySelector('.sidebar-toggle');
var sidebar = document.querySelector('#sidebar');
var checkbox = document.querySelector('#sidebar-checkbox');
document.addEventListener('click', function(e) {
var target = e.target;
if(!checkbox.checked ||
sidebar.contains(target) ||
(target === checkbox || target === toggle)) return;
checkbox.checked = false;
}, false);
})(document);
</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-70120850-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>
| mikeloll/mikeloll.github.io.jekyll | _site/tag/systemjs/index.html | HTML | mit | 3,998 | 24.144654 | 214 | 0.58029 | false |
class ApplicationController < Sinatra::Base
require 'bundler'
Bundler.require
end | timrourke/dotEnv | controllers/_ApplicationController.rb | Ruby | mit | 84 | 16 | 43 | 0.809524 | false |
// JSON Object of all of the icons and their tags
export default {
apple : {
name : 'apple',
color: '#be0000',
image : 'apple67.svg',
tags: ['apple', 'fruit', 'food'],
categories: ['food', 'supermarket']
},
bread : {
name : 'bread',
color: '#c26b24',
image : 'bread14.svg',
tags: ['bread', 'food', 'wheat', 'bake'],
categories: ['food', 'supermarket']
},
broccoli : {
name : 'broccoli',
color: '#16a900',
image : 'broccoli.svg',
tags: ['broccoli', 'food', 'vegetable'],
categories: ['food', 'supermarket']
},
cheese : {
name : 'cheese',
color: '#ffe625',
image : 'cheese7.svg',
tags: ['cheese', 'food', 'dairy'],
categories: ['food', 'supermarket']
},
shopping : {
name : 'shopping',
color: '#f32393',
image : 'shopping225.svg',
tags: ['shopping', 'bag'],
categories: ['shopping', 'supermarket']
},
cart : {
name : 'cart',
color: '#9ba990',
image : 'supermarket1.svg',
tags: ['cart', 'shopping'],
categories: ['shopping', 'supermarket']
},
fish : {
name : 'fish',
color: '#6d7ca9',
image : 'fish52.svg',
tags: ['fish', 'food'],
categories: ['fish', 'supermarket']
},
giftbox : {
name : 'giftbox',
color: '#f32393',
image : 'giftbox56.svg',
tags: ['giftbox', 'gift', 'present'],
categories: ['gift', 'shopping', 'supermarket']
}
}; | una/heiroglyph | app/js/data/iconListInfo.js | JavaScript | mit | 1,423 | 22.733333 | 51 | 0.534083 | false |
#!/bin/bash
#
# bash strict mode
set -euo pipefail
IFS=$'\n\t'
USAGE="Usage:\n
Requires AWS CLI tools and credentials configured.\n
./tool.sh install mySourceDirectory\n
./tool.sh create mySourceDirectory myAWSLambdaFunctionName myIAMRoleARN\n
./tool.sh update mySourceDirectory myAWSLambdaFunctionName\n
./tool.sh invoke myAWSLambdaFunctionName\n
"
REGION="eu-west-1"
PROFILE="heap"
# Install pip requirements for a Python lambda
function install_requirements {
FUNCTION_DIRECTORY=$2
cd $FUNCTION_DIRECTORY
pip install -r requirements.txt -t .
}
# Creates a new lambda function
function create {
FUNCTION_DIRECTORY=$2
FUNCTION_ARN_NAME=$3
ROLE_ARN=$4
mkdir -p build
cd $FUNCTION_DIRECTORY
zip -FSr ../build/$FUNCTION_DIRECTORY.zip .
cd ..
aws lambda create-function\
--function-name $FUNCTION_ARN_NAME\
--runtime python2.7\
--role $4\
--handler main.lambda_handler\
--timeout 15\
--memory-size 128\
--zip-file fileb://build/$FUNCTION_DIRECTORY.zip
}
# Packages and uploads the source code of a AWS Lambda function and deploys it live.
function upload_lambda_source {
FUNCTION_DIRECTORY=$2
FUNCTION_ARN_NAME=$3
mkdir -p build
cd $FUNCTION_DIRECTORY
zip -FSr ../build/$FUNCTION_DIRECTORY.zip .
cd ..
aws lambda update-function-code --profile $PROFILE --region $REGION --function-name $FUNCTION_ARN_NAME --zip-file fileb://build/$FUNCTION_DIRECTORY.zip
}
# Invokes an AWS Lambda function and outputs its result
function invoke {
FUNCTION_ARN_NAME=$2
aws lambda invoke --profile $PROFILE --region $REGION --function-name $FUNCTION_ARN_NAME /dev/stdout
}
function help_and_exit {
echo -e $USAGE
exit 1
}
# Subcommand handling
if [ $# -lt 1 ]
then
help_and_exit
fi
case "$1" in
install)
if (( $# == 2 )); then
install_requirements "$@"
else
help_and_exit
fi
;;
create)
if (( $# == 4 )); then
create "$@"
else
help_and_exit
fi
;;
update)
if (( $# == 3 )); then
upload_lambda_source "$@"
else
help_and_exit
fi
;;
invoke)
if (( $# == 2 )); then
invoke "$@"
else
help_and_exit
fi
;;
*)
echo "Error: No such subcommand"
help_and_exit
esac
| Vilsepi/after | backend/tool.sh | Shell | mit | 2,234 | 19.685185 | 153 | 0.662489 | false |
package sudoku
import "fmt"
const (
n = 3
N = 3 * 3
)
var (
resolved bool
)
func solveSudoku(board [][]byte) [][]byte {
// box size 3
row := make([][]int, N)
columns := make([][]int, N)
box := make([][]int, N)
res := make([][]byte, N)
for i := 0; i < N; i++ {
row[i] = make([]int, N+1)
columns[i] = make([]int, N+1)
box[i] = make([]int, N+1)
res[i] = make([]byte, N)
copy(res[i], board[i])
}
for i := 0; i < N; i++ {
for j := 0; j < N; j++ {
if board[i][j] != '.' {
placeNumberAtPos(res, i, j, int(board[i][j]-'0'), row, columns, box)
}
}
}
fmt.Printf("row: %v\n, column: %v\n, box: %v\n", row, columns, box)
permute(res, 0, 0, row, columns, box)
return res
}
func placeNumberAtPos(board [][]byte, i, j, num int, row, columns, box [][]int) {
boxIdx := (i/n)*n + j/n
(row)[i][num]++
(columns)[j][num]++
(box)[boxIdx][num]++
(board)[i][j] = byte('0' + num)
}
func removeNumberAtPos(board [][]byte, i, j, num int, row, columns, box [][]int) {
boxIdx := (i/n)*n + j/n
row[i][num]++
columns[j][num]++
box[boxIdx][num]++
board[i][j] = '.'
}
func isValidPosForNum(i, j, num int, row, columns, box [][]int) bool {
boxIdx := (i/n)*n + j/n
return row[i][num]+columns[j][num]+box[boxIdx][num] == 0
}
func permute(board [][]byte, i, j int, row, column, box [][]int) {
if board[i][j] == '.' {
for k := 1; k <= N; k++ {
if isValidPosForNum(i, j, k, row, column, box) {
placeNumberAtPos(board, i, j, k, row, column, box)
fmt.Printf("place k:%d at row: %d and col:%d, row[i][k]= %d, col[j][k] = %d and box[boxidx][k] = %d\n", k, i, j, row[i][k], column[j][k],
box[(i/n)*n+j/n][k])
placeNext(board, i, j, row, column, box)
fmt.Printf("place next then k:%d at row: %d and col:%d, row[i][k]= %d, col[j][k] = %d and box[boxidx][k] = %d\n", k, i, j, row[i][k], column[j][k],
box[(i/n)*n+j/n][k])
if !resolved {
removeNumberAtPos(board, i, j, k, row, column, box)
}
}
}
} else {
placeNext(board, i, j, row, column, box)
}
}
func placeNext(board [][]byte, i, j int, row, column, box [][]int) {
if i == N-1 && j == N-1 {
resolved = true
}
fmt.Printf("board: %v\n, row: %v \n, column: %v\n, box: %v\n", board, row, column, box)
if j == N-1 {
fmt.Println("next row")
permute(board, i+1, 0, row, column, box)
} else {
fmt.Println("next column")
permute(board, i, j+1, row, column, box)
}
}
func solveSudoku2(board [][]byte) [][]byte {
if len(board) == 0 {
return board
}
solve(board)
return board
}
func solve(board [][]byte) bool {
var c byte
for i := 0; i < len(board); i++ {
for j := 0; j < len(board[0]); j++ {
if board[i][j] == '.' {
for c = '1'; c <= '9'; c++ {
if isValid(board, i, j, c) {
board[i][j] = c
if solve(board) {
return true
} else {
board[i][j] = '.'
}
}
}
return false
}
}
}
return true
}
func isValid(board [][]byte, row int, col int, c byte) bool {
for i := 0; i < 9; i++ {
if board[i][col] != '.' && board[i][col] == c {
return false
}
if board[row][i] != '.' && board[row][i] == c {
return false
}
if board[3*(row/3)+i/3][3*(col/3)+i%3] != '.' && board[3*(row/3)+i/3][3*(col/3)+i%3] == c {
return false
}
}
return true
}
| Catorpilor/LeetCode | 37_sudoku_solver/sudoku.go | GO | mit | 3,258 | 22.438849 | 152 | 0.515961 | false |
<div>
The version string to use when patching assembly version files.
</div>
| ngeor/nunitrunner-plugin | src/main/resources/net/ngeor/plugins/nunitrunner/MSBuildBuilder/help-assemblyVersion.html | HTML | mit | 79 | 25.333333 | 65 | 0.746835 | false |
return function(parameters)
return {
position = parameters.position or {x = 0, y = 0, z = 0},
scale = parameters.scale or {x = 0, y = 0},
anchors = parameters.anchors or {up = 1, left = 1, right = 1, down = 1},
offset = parameters.offset or {up = 0, left = 0, right = 0, down = 0},
useTween = parameters.useTween or true,
velocity = parameters.velocity or 5
}
end
| Andre-LA/Ink | gui/components/rect_transform.lua | Lua | mit | 432 | 42.2 | 82 | 0.560185 | false |
#include "Fractal.h"
Color::Color() : r(0.0), g(0.0), b(0.0) {}
Color::Color(double rin, double gin, double bin) : r(rin), g(gin), b(bin) {}
Fractal::Fractal(int width, int height)
: width_(width), height_(height), center_x_(0.0), center_y_(0.0),
max_distance_sqr_(4.0), max_iteration_(32) {
pixel_size_ = 4.0 / width_;
}
Fractal::~Fractal() {}
void Fractal::Initialize() {
RecalcMins();
CreateColors();
CalculateEscapeTime();
}
void Fractal::CreateColors() {
int i;
double r, g, b;
colors_.resize(max_iteration_ + 1);
for (i = 0; i < max_iteration_; i++) {
r = 1.0 * i / (double) max_iteration_;
g = 0.5 * i / (double) max_iteration_;
b = 1.0 * i / (double) max_iteration_;
colors_[i] = Color(r, g, b);
}
colors_[max_iteration_] = Color(0.0, 0.0, 0.0);
}
void Fractal::CalculateEscapeTime() {
int i, j;
double x, y, xmin, ymin;
xmin = center_x_ - pixel_size_ * (width_ / 2.0 - 0.5);
ymin = center_y_ - pixel_size_ * (height_ / 2.0 - 0.5);
escape_times_.resize(height_);
for (j = 0; j < height_; j++) {
escape_times_[j].resize(width_);
for (i = 0; i < width_; i++) {
x = xmin + i * pixel_size_;
y = ymin + j * pixel_size_;
escape_times_[j][i] = EscapeOne(x, y);
}
}
}
void Fractal::Draw() {
int x, y, iter;
for (y = 0; y < height_; y++) {
for (x = 0; x < width_; x++) {
iter = escape_times_[y][x];
glColor3d(colors_[iter].r, colors_[iter].g, colors_[iter].b);
glBegin(GL_POINTS);
glVertex2d(x, y);
glEnd();
}
}
}
void Fractal::Center(double x, double y) {
RecalcCenter(x, y);
RecalcMins();
CalculateEscapeTime();
}
void Fractal::ZoomIn(double x, double y) {
RecalcCenter(x, y);
pixel_size_ /= 2.0;
RecalcMins();
CalculateEscapeTime();
}
void Fractal::ZoomOut(double x, double y) {
RecalcCenter(x, y);
pixel_size_ *= 2.0;
RecalcMins();
CalculateEscapeTime();
}
void Fractal::RecalcCenter(double x, double y) {
center_x_ = min_x_ + pixel_size_ * x;
center_y_ = min_y_ + pixel_size_ * y;
}
void Fractal::RecalcMins() {
min_x_ = center_x_ - pixel_size_ * (width_ / 2.0 - 0.5);
min_y_ = center_y_ - pixel_size_ * (height_ / 2.0 - 0.5);
}
| theDrake/opengl-experiments | Fractals/Fractals/Fractal.cpp | C++ | mit | 2,212 | 22.784946 | 76 | 0.562839 | false |
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using Mechanical3.Core;
namespace Mechanical3.IO.FileSystems
{
//// NOTE: For still more speed, you could ditch abstract file systems, file paths and streams alltogether, and just use byte arrays directly.
//// Obviously this is a compromize between performance and ease of use.
/// <summary>
/// Provides performant, semi thread-safe access to an in-memory copy of the contants of an <see cref="IFileSystemReader"/>.
/// Access to <see cref="IFileSystemReader"/> members is thread-safe.
/// <see cref="Stream"/> instances returned are NOT thread-safe, and they must not be used after they are closed or disposed (one of which should happen exactly one time).
/// </summary>
public class SemiThreadSafeMemoryFileSystemReader : IFileSystemReader
{
#region ByteArrayReaderStream
/// <summary>
/// Provides thread-safe, read-only access to the wrapped byte array.
/// </summary>
private class ByteArrayReaderStream : Stream
{
//// NOTE: the default asynchronous implementations call their synchronous versions.
//// NOTE: we don't use Store*, to save a few allocations
#region ObjectPool
internal static class ObjectPool
{
private static readonly ConcurrentBag<ByteArrayReaderStream> Pool = new ConcurrentBag<ByteArrayReaderStream>();
internal static ByteArrayReaderStream Get( byte[] data )
{
ByteArrayReaderStream stream;
if( !Pool.TryTake(out stream) )
stream = new ByteArrayReaderStream();
stream.OnInitialize(data);
return stream;
}
internal static void Put( ByteArrayReaderStream stream )
{
Pool.Add(stream);
}
internal static void Clear()
{
ByteArrayReaderStream stream;
while( true )
{
if( Pool.TryTake(out stream) )
GC.SuppressFinalize(stream);
else
break; // pool is empty
}
}
}
#endregion
#region Private Fields
private byte[] array;
private int position; // NOTE: (position == length) == EOF
private bool isOpen;
#endregion
#region Constructor
private ByteArrayReaderStream()
: base()
{
}
#endregion
#region Private Methods
private void OnInitialize( byte[] data )
{
this.array = data;
this.position = 0;
this.isOpen = true;
}
private void OnClose()
{
this.isOpen = false;
this.array = null;
this.position = -1;
}
private void ThrowIfClosed()
{
if( !this.isOpen )
throw new ObjectDisposedException(message: "The stream was already closed!", innerException: null);
}
#endregion
#region Stream
protected override void Dispose( bool disposing )
{
this.OnClose();
ObjectPool.Put(this);
if( !disposing )
{
// called from finalizer
GC.ReRegisterForFinalize(this);
}
}
public override bool CanRead
{
get
{
this.ThrowIfClosed();
return true;
}
}
public override bool CanSeek
{
get
{
this.ThrowIfClosed();
return true;
}
}
public override bool CanTimeout
{
get
{
this.ThrowIfClosed();
return false;
}
}
public override bool CanWrite
{
get
{
this.ThrowIfClosed();
return false;
}
}
public override long Length
{
get
{
this.ThrowIfClosed();
return this.array.Length;
}
}
public override long Position
{
get
{
this.ThrowIfClosed();
return this.position;
}
set
{
this.ThrowIfClosed();
if( value < 0 || this.array.Length < value )
throw new ArgumentOutOfRangeException();
this.position = (int)value;
}
}
public override long Seek( long offset, SeekOrigin origin )
{
this.ThrowIfClosed();
int newPosition;
switch( origin )
{
case SeekOrigin.Begin:
newPosition = (int)offset;
break;
case SeekOrigin.Current:
newPosition = this.position + (int)offset;
break;
case SeekOrigin.End:
newPosition = this.array.Length + (int)offset;
break;
default:
throw new ArgumentException("Invalid SeekOrigin!");
}
if( newPosition < 0
|| newPosition > this.array.Length )
throw new ArgumentOutOfRangeException();
this.position = newPosition;
return this.position;
}
public override int ReadByte()
{
this.ThrowIfClosed();
if( this.position == this.array.Length )
{
// end of stream
return -1;
}
else
{
return this.array[this.position++];
}
}
public override int Read( byte[] buffer, int offset, int bytesToRead )
{
this.ThrowIfClosed();
int bytesLeft = this.array.Length - this.position;
if( bytesLeft < bytesToRead ) bytesToRead = bytesLeft;
if( bytesToRead == 0 )
return 0;
Buffer.BlockCopy(src: this.array, srcOffset: this.position, dst: buffer, dstOffset: offset, count: bytesToRead);
this.position += bytesToRead;
return bytesToRead;
}
public override void Flush()
{
throw new NotSupportedException();
}
public override void SetLength( long value )
{
throw new NotSupportedException();
}
public override void WriteByte( byte value )
{
throw new NotSupportedException();
}
public override void Write( byte[] buffer, int offset, int count )
{
throw new NotSupportedException();
}
#endregion
}
#endregion
#region Private Fields
/* From MSDN:
* A Dictionary can support multiple readers concurrently, as long as the collection is not modified.
* Even so, enumerating through a collection is intrinsically not a thread-safe procedure. In the
* rare case where an enumeration contends with write accesses, the collection must be locked during
* the entire enumeration. To allow the collection to be accessed by multiple threads for reading
* and writing, you must implement your own synchronization.
*
* ... (or there is also ConcurrentDictionary)
*/
//// NOTE: since after they are filled, the dictionaries won't be modified, we are fine.
private readonly FilePath[] rootFolderEntries;
private readonly Dictionary<FilePath, FilePath[]> nonRootFolderEntries;
private readonly Dictionary<FilePath, byte[]> fileContents;
private readonly Dictionary<FilePath, string> hostPaths;
private readonly string rootHostPath;
#endregion
#region Constructors
/// <summary>
/// Copies the current contents of the specified <see cref="IFileSystemReader"/>
/// into a new <see cref="SemiThreadSafeMemoryFileSystemReader"/> instance.
/// </summary>
/// <param name="readerToCopy">The abstract file system to copy the current contents of, into memory.</param>
/// <returns>A new <see cref="SemiThreadSafeMemoryFileSystemReader"/> instance.</returns>
public static SemiThreadSafeMemoryFileSystemReader CopyFrom( IFileSystemReader readerToCopy )
{
return new SemiThreadSafeMemoryFileSystemReader(readerToCopy);
}
/// <summary>
/// Initializes a new instance of the <see cref="SemiThreadSafeMemoryFileSystemReader"/> class.
/// </summary>
/// <param name="readerToCopy">The abstract file system to copy the current contents of, into memory.</param>
private SemiThreadSafeMemoryFileSystemReader( IFileSystemReader readerToCopy )
{
this.rootFolderEntries = readerToCopy.GetPaths();
this.nonRootFolderEntries = new Dictionary<FilePath, FilePath[]>();
this.fileContents = new Dictionary<FilePath, byte[]>();
if( readerToCopy.SupportsToHostPath )
{
this.hostPaths = new Dictionary<FilePath, string>();
this.rootHostPath = readerToCopy.ToHostPath(null);
}
using( var tmpStream = new MemoryStream() )
{
foreach( var e in this.rootFolderEntries )
this.AddRecursively(e, readerToCopy, tmpStream);
}
}
#endregion
#region Private Methods
private void AddRecursively( FilePath entry, IFileSystemReader readerToCopy, MemoryStream tmpStream )
{
if( entry.IsDirectory )
{
var subEntries = readerToCopy.GetPaths(entry);
this.nonRootFolderEntries.Add(entry, subEntries);
foreach( var e in subEntries )
this.AddRecursively(e, readerToCopy, tmpStream);
}
else
{
this.fileContents.Add(entry, ReadFileContents(entry, readerToCopy, tmpStream));
}
if( this.SupportsToHostPath )
this.hostPaths.Add(entry, readerToCopy.ToHostPath(entry));
}
private static byte[] ReadFileContents( FilePath filePath, IFileSystemReader readerToCopy, MemoryStream tmpStream )
{
tmpStream.SetLength(0);
long? fileSize = null;
if( readerToCopy.SupportsGetFileSize )
{
fileSize = readerToCopy.GetFileSize(filePath);
ThrowIfFileTooBig(filePath, fileSize.Value);
}
using( var stream = readerToCopy.ReadFile(filePath) )
{
if( !fileSize.HasValue
&& stream.CanSeek )
{
fileSize = stream.Length;
ThrowIfFileTooBig(filePath, fileSize.Value);
}
stream.CopyTo(tmpStream);
if( !fileSize.HasValue )
ThrowIfFileTooBig(filePath, tmpStream.Length);
return tmpStream.ToArray();
}
}
private static void ThrowIfFileTooBig( FilePath filePath, long fileSize )
{
if( fileSize > int.MaxValue ) // that's the largest our stream implementation can support
throw new Exception("One of the files is too large!").Store(nameof(filePath), filePath).Store(nameof(fileSize), fileSize);
}
#endregion
#region IFileSystemBase
/// <summary>
/// Gets a value indicating whether the ToHostPath method is supported.
/// </summary>
/// <value><c>true</c> if the method is supported; otherwise, <c>false</c>.</value>
public bool SupportsToHostPath
{
get { return this.hostPaths.NotNullReference(); }
}
/// <summary>
/// Gets the string the underlying system uses to represent the specified file or directory.
/// </summary>
/// <param name="path">The path to the file or directory.</param>
/// <returns>The string the underlying system uses to represent the specified <paramref name="path"/>.</returns>
public string ToHostPath( FilePath path )
{
if( !this.SupportsToHostPath )
throw new NotSupportedException().StoreFileLine();
if( path.NullReference() )
return this.rootHostPath;
string result;
if( this.hostPaths.TryGetValue(path, out result) )
return result;
else
throw new FileNotFoundException("The specified file or directory was not found!").Store(nameof(path), path);
}
#endregion
#region IFileSystemReader
/// <summary>
/// Gets the paths to the direct children of the specified directory.
/// Subdirectories are not searched.
/// </summary>
/// <param name="directoryPath">The path specifying the directory to list the direct children of; or <c>null</c> to specify the root of this file system.</param>
/// <returns>The paths of the files and directories found.</returns>
public FilePath[] GetPaths( FilePath directoryPath = null )
{
if( directoryPath.NotNullReference()
&& !directoryPath.IsDirectory )
throw new ArgumentException("Argument is not a directory!").Store(nameof(directoryPath), directoryPath);
FilePath[] paths;
if( directoryPath.NullReference() )
{
paths = this.rootFolderEntries;
}
else
{
if( !this.nonRootFolderEntries.TryGetValue(directoryPath, out paths) )
throw new FileNotFoundException("The specified file or directory was not found!").Store(nameof(directoryPath), directoryPath);
}
// NOTE: Unfortunately we need to make a copy, since arrays are writable.
// TODO: return ImmutableArray from GetPaths.
var copy = new FilePath[paths.Length];
Array.Copy(sourceArray: paths, destinationArray: copy, length: paths.Length);
return copy;
}
/// <summary>
/// Opens the specified file for reading.
/// </summary>
/// <param name="filePath">The path specifying the file to open.</param>
/// <returns>A <see cref="Stream"/> representing the file opened.</returns>
public Stream ReadFile( FilePath filePath )
{
if( filePath.NullReference()
|| filePath.IsDirectory )
throw new ArgumentException("Argument is not a file!").Store(nameof(filePath), filePath);
byte[] bytes;
if( !this.fileContents.TryGetValue(filePath, out bytes) )
throw new FileNotFoundException("The specified file or directory was not found!").Store(nameof(filePath), filePath);
return ByteArrayReaderStream.ObjectPool.Get(bytes);
}
/// <summary>
/// Gets a value indicating whether the GetFileSize method is supported.
/// </summary>
/// <value><c>true</c> if the method is supported; otherwise, <c>false</c>.</value>
public bool SupportsGetFileSize
{
get { return true; }
}
/// <summary>
/// Gets the size, in bytes, of the specified file.
/// </summary>
/// <param name="filePath">The file to get the size of.</param>
/// <returns>The size of the specified file in bytes.</returns>
public long GetFileSize( FilePath filePath )
{
if( filePath.NullReference()
|| filePath.IsDirectory )
throw new ArgumentException("Argument is not a file!").Store(nameof(filePath), filePath);
byte[] bytes;
if( !this.fileContents.TryGetValue(filePath, out bytes) )
throw new FileNotFoundException("The specified file or directory was not found!").Store(nameof(filePath), filePath);
return bytes.Length;
}
#endregion
}
}
| MechanicalMen/Mechanical3 | source/Mechanical3.Portable/IO/FileSystems/SemiThreadSafeMemoryFileSystemReader.cs | C# | mit | 17,319 | 33.634 | 175 | 0.53179 | false |
http_path = "/"
css_dir = "assets/css/src"
sass_dir = "assets/sass"
images_dir = "assets/img"
javascripts_dir = "assets/js"
fonts_dir = "assets/font"
http_fonts_path = "assets/font"
http_images_path = "assets/img"
output_style = :nested
relative_assets = false
line_comments = false
| LunneMarketingGroup/Grunt-Website-Template | config.rb | Ruby | mit | 323 | 23.846154 | 34 | 0.619195 | false |
FROM ubuntu:14.04
MAINTAINER Johannes Wettinger, http://github.com/jojow
ENV ENGINE_BRANCH maven
ENV ENGINE_REV HEAD
ENV MAVEN_VERSION 3.3.9
ENV MAVEN_URL http://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz
ENV HOME /root
WORKDIR ${HOME}
ENV DEBIAN_FRONTEND noninteractive
ENV PATH ${PATH}:/opt/apache-maven-${MAVEN_VERSION}/bin/
# Replace /dev/random by /dev/urandom to avoid blocking
RUN rm /dev/random && ln -s /dev/urandom /dev/random
# Install dependencies
RUN apt-get update -y && \
apt-get install -y curl wget git openjdk-7-jdk && \
apt-get clean -y
RUN wget ${MAVEN_URL} && \
tar -zxf apache-maven-${MAVEN_VERSION}-bin.tar.gz && \
cp -R apache-maven-${MAVEN_VERSION} /opt
# Install Docker, partly from https://github.com/docker-library/docker/blob/master/1.12/Dockerfile
ENV DOCKER_BUCKET get.docker.com
ENV DOCKER_VERSION 1.12.0
ENV DOCKER_SHA256 3dd07f65ea4a7b4c8829f311ab0213bca9ac551b5b24706f3e79a97e22097f8b
ENV DOCKER_COMPOSE_VERSION 1.8.0
RUN set -x && \
curl -fSL "https://${DOCKER_BUCKET}/builds/Linux/x86_64/docker-${DOCKER_VERSION}.tgz" -o docker.tgz && \
echo "${DOCKER_SHA256} *docker.tgz" | sha256sum -c - && \
tar -xzvf docker.tgz && \
mv docker/* /usr/local/bin/ && \
rmdir docker && \
rm docker.tgz && \
docker -v && \
curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose && \
chmod +x /usr/local/bin/docker-compose && \
docker-compose --version
# Install engine
RUN git clone --recursive https://github.com/OpenTOSCA/container.git -b ${ENGINE_BRANCH} /opt/engine
WORKDIR /opt/engine
RUN git checkout ${ENGINE_REV} && git reset --hard
RUN mvn clean package
#RUN mvn clean install
RUN ln -s /opt/engine/org.opentosca.container.product/target/products/org.opentosca.container.product/linux/gtk/x86_64/OpenTOSCA /usr/local/bin/opentosca-engine && \
chmod +x /usr/local/bin/opentosca-engine
EXPOSE 1337
CMD [ "/usr/local/bin/opentosca-engine" ]
| jojow/opentosca-dockerfiles | engine/Dockerfile | Dockerfile | mit | 2,100 | 36.5 | 165 | 0.715714 | false |
flask-dogstatsd
===============
[](http://badge.fury.io/py/Flask-DogStatsd)
[](https://travis-ci.org/xsleonard/flask-dogstatsd)
[](https://coveralls.io/r/xsleonard/flask-dogstatsd)
Flask extension for [dogstatsd-python-fixed](https://github.com/xsleonard/dogstatsd-python)
Compatible with Python 2.7, 3.3 and pypy
Installation
============
```
pip install flask-dogstatsd
```
Tests
=====
```
pip install -r requirements.txt
pip install -r tests/requirements.txt
./setup.py develop
./setup.py test
```
Example
=======
```python
# app.py
from flask import Flask
from flask.ext.dogstatsd import DogStatsd
app = Flask(__name__)
app.config['DOGSTATSD_HOST'] = 'localhost' # This is the default
app.config['DOGSTATSD_PORT'] = 8125 # This is the default
app.config['DOGSTATSD_PREFIX'] = 'app' # False-y values disable prefixing
dogstatsd = DogStatsd(app)
@app.route('/'):
def index():
# See dogstatsd-python for the full API.
# Methods are forwarded to that.
# Since our prefix is 'app', the full key will be 'app.index.views'
dogstatsd.increment('index.views')
return 'Home'
```
| xsleonard/flask-dogstatsd | README.md | Markdown | mit | 1,318 | 24.843137 | 134 | 0.703338 | false |
<h1>
FOOTBALL
</h1>
</body>
Since the beginning of school we have been analyzing our opponents data for our football team. Since I do not obtain any mathematical
skills, it was a challenge. All I could and did offer to the table was what appeared the most important out of the data. Such as,
certain number of times a certain play/form was used and the probability of the plays they would execute. My process is shown below.
<img src="power cat - Google Docs.mhtml"
| carlistew24/carlistew | project1.html | HTML | mit | 474 | 35.461538 | 134 | 0.763713 | false |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>java枚举类型的使用,查一下</title>
<meta name="author" content="盒子">
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le styles -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css" type="text/css" rel="stylesheet" media="all">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="/assets/twitter/javascripts/qrcode.js"></script>
<!-- Le fav and touch icons -->
<!-- Update these with your own images
<link rel="shortcut icon" href="images/favicon.ico">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
-->
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="/">韭菜盒子</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="/archive">归档</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/tags">标签</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/categories">分类</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/pages">分页</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/about">关于我</a>
</li>
</ul>
</div>
</nav>
<div class="container">
<div class="page-header">
<h1>java枚举类型的使用,查一下 </h1>
</div>
<div class="row">
<div class="span8">
<p>她轻轻的动了动鼠标没留下一行文字</p>
<hr>
<div class="pagination">
<ul>
<ul>
<li class="prev"><a href="/2012/291.html" title="大概闲了2个星期了">← Previous</a></li>
<li><a href="/archive">Archive</a></li>
<li class="next"><a href="/2012/289.html" title="分享一首诗">Next →</a></li>
</ul>
</ul>
</div>
<hr>
</div>
<div class="span4">
<h4>Published</h4>
<div class="date"><span>2012-09-12 02:56:35</span></div>
<br>
<h4>Share to Weixin</h4>
<div id="share-qrcode"></div>
<script type="text/javascript">
new QRCode(document.getElementById("share-qrcode"), {
text:document.URL,
width:128,
height:128
});
</script>
<br>
<h4>Categories</h4>
<ul class="tag_box">
<li>
<a href="/categories/#%E5%BC%80%E5%8F%91%E6%8A%80%E6%9C%AF%E7%B1%BB--%E8%B0%8B%E7%94%9F%E7%AF%87-ref">开发技术类--谋生篇 <span>51</span></a>
</li>
</ul>
<br>
<h4>Tags</h4>
<ul class="tag_box">
</ul>
</div>
</div>
<footer>
<p>© 盒子 2016
with help from <a href="http://github.com/wendal/gor" target="_blank" title="Gor -- Fast Blog">Gor</a>
and <a href="http://twitter.github.com/bootstrap/" target="_blank">Twitter Bootstrap</a>
and Idea from <a href="http://ruhoh.com" target="_blank" title="The Definitive Technical Blogging Framework">ruhoh</a>
<a href="http://www.miitbeian.gov.cn" target="_blank">京ICP备17040577号-1</a>
</p>
</footer>
</div> <!-- /container -->
</body>
</html>
| feiyan35488/feiyan35488.github.io | 2012/290.html | HTML | mit | 4,346 | 24.82716 | 200 | 0.564054 | false |
<!doctype html>
<!--
Minimal Mistakes Jekyll Theme 4.13.0 by Michael Rose
Copyright 2013-2018 Michael Rose - mademistakes.com | @mmistakes
Free for personal and commercial use under the MIT license
https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE.txt
-->
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<!-- begin _includes/seo.html --><title>Swift - Preslav Rachev</title>
<meta name="description" content="Finding beauty in everyday things.">
<meta property="og:type" content="website">
<meta property="og:locale" content="en_US">
<meta property="og:site_name" content="Preslav Rachev">
<meta property="og:title" content="Swift">
<meta property="og:url" content="https://preslav.me/tags/swift/">
<link rel="canonical" href="https://preslav.me/tags/swift/">
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Person",
"name": "Your Name",
"url": "https://preslav.me",
"sameAs": null
}
</script>
<!-- end _includes/seo.html -->
<link href="/feed.xml" type="application/atom+xml" rel="alternate" title="Preslav Rachev Feed">
<!-- http://t.co/dKP3o1e -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>
document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, '') + ' js ';
</script>
<!-- For all browsers -->
<link rel="stylesheet" href="/assets/css/main.css">
<!--[if lte IE 9]>
<style>
/* old IE unsupported flexbox fixes */
.greedy-nav .site-title {
padding-right: 3em;
}
.greedy-nav button {
position: absolute;
top: 0;
right: 0;
height: 100%;
}
</style>
<![endif]-->
<link href="https://fonts.googleapis.com/css?family=PT+Sans+Narrow:400,700|PT+Serif:400,700,400italic" rel="stylesheet" type="text/css">
<link href="https://micro.blog/preslavrachev" rel="me" />
</head>
<body class="layout--archive-taxonomy">
<!--[if lt IE 9]>
<div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience.</div>
<![endif]-->
<div class="masthead">
<div class="masthead__inner-wrap">
<div class="masthead__menu">
<nav id="site-nav" class="greedy-nav">
<a class="site-title" href="/">Preslav Rachev</a>
<ul class="visible-links"><li class="masthead__menu-item">
<a href="/about-me" >About</a>
</li><li class="masthead__menu-item">
<a href="/micro" >Microblog</a>
</li><li class="masthead__menu-item">
<a href="/archive" >Archive</a>
</li><li class="masthead__menu-item">
<a href="/contact" >Contact</a>
</li></ul>
<button class="search__toggle" type="button">
<svg class="icon" width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.99 16">
<path d="M15.5,13.12L13.19,10.8a1.69,1.69,0,0,0-1.28-.55l-0.06-.06A6.5,6.5,0,0,0,5.77,0,6.5,6.5,0,0,0,2.46,11.59a6.47,6.47,0,0,0,7.74.26l0.05,0.05a1.65,1.65,0,0,0,.5,1.24l2.38,2.38A1.68,1.68,0,0,0,15.5,13.12ZM6.4,2A4.41,4.41,0,1,1,2,6.4,4.43,4.43,0,0,1,6.4,2Z" transform="translate(-.01)"></path>
</svg>
</button>
<button class="greedy-nav__toggle hidden" type="button">
<span class="visually-hidden">Toggle menu</span>
<div class="navicon"></div>
</button>
<ul class="hidden-links hidden"></ul>
</nav>
</div>
</div>
</div>
<div class="initial-content">
<div id="main" role="main">
<div class="archive">
<h1 class="page__title">Swift</h1>
<div class="list__item">
<article class="archive__item" itemscope itemtype="http://schema.org/CreativeWork">
<h2 class="archive__item-title" itemprop="headline">
<a href="/2018/07/20/dont-throw-react-native-away-just-yet/" rel="permalink">Don’t Throw React Native Away Just Yet
</a>
</h2>
<p class="page__meta"><i class="far fa-clock" aria-hidden="true"></i>
6 minute read
</p>
<p class="archive__item-excerpt" itemprop="description">The main reason why mobile developers get enticed by the cross-platform development capabilities of frameworks like React Native, is, of course, the ability to share code across platforms. A smaller, but no less important reason is the ability to build, debug, and refactor faster. Last but not least, such solutions often help broaden up the variety of tools, beyond the ones dictated by the platform vendor.
</p>
</article>
</div>
<div class="list__item">
<article class="archive__item" itemscope itemtype="http://schema.org/CreativeWork">
<h2 class="archive__item-title" itemprop="headline">
<a href="/2018/06/17/embracing-the-future/" rel="permalink">Embracing the Future
</a>
</h2>
<p class="page__meta"><i class="far fa-clock" aria-hidden="true"></i>
5 minute read
</p>
<p class="archive__item-excerpt" itemprop="description">Dominik Wagner (a.k.a. @monkeydom) published an article a few days ago, called On my misalignment with Apple’s love affair with Swift.
</p>
</article>
</div>
</div>
</div>
</div>
<div class="search-content">
<div class="search-content__inner-wrap"><input type="text" id="search" class="search-input" tabindex="-1" placeholder="Enter your search term..." />
<div id="results" class="results"></div></div>
</div>
<div class="page__footer">
<footer>
<script type="text/javascript">
var clicky_custom = clicky_custom || {};
clicky_custom.cookies_disable = 1;
</script>
<script src="//static.getclicky.com/js" type="text/javascript"></script>
<script type="text/javascript">try { clicky.init(101131786); } catch (e) { }</script>
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/101131786ns.gif" /></p></noscript>
<script type="text/javascript">
// This should effectively disable all cookies being set on this site
// It is a bit of a crude measure, but I think it is necessary, having in mind how many seemingly innoncent
// 3rd-party scripts and embeds bring in tracking cookies with themselves
if (!document.__defineGetter__) {
Object.defineProperty(document, 'cookie', {
get: function () { return '' },
set: function () { return true },
});
} else {
document.__defineGetter__("cookie", function () { return ''; });
document.__defineSetter__("cookie", function () { });
}
</script>
<div class="page__footer-follow">
<ul class="social-icons">
<li><strong>Follow:</strong></li>
<li><a href="/feed.xml"><i class="fas fa-fw fa-rss-square" aria-hidden="true"></i> Feed</a></li>
</ul>
</div>
<div class="page__footer-copyright">© 2019 Your Name. Powered by <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> & <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>
</footer>
</div>
<script src="/assets/js/main.min.js"></script>
<script src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
<script src="/assets/js/lunr/lunr.min.js"></script>
<script src="/assets/js/lunr/lunr-store.js"></script>
<script src="/assets/js/lunr/lunr-en.js"></script>
</body>
</html> | preslavrachev/preslavrachev.github.io | tags/swift/index.html | HTML | mit | 7,715 | 25.87108 | 469 | 0.61315 | false |
---
title: "Tagging and Sample Data"
---
Use the [`Appsignal.Transaction.set_sample_data`](https://hexdocs.pm/appsignal/Appsignal.Transaction.html#set_sample_data/2) function to supply extra context on errors and
performance issues. This can help to add information that is not already part of
the request, session or environment parameters.
```elixir
Appsignal.Transaction.set_sample_data("tags", %{locale: "en"})
```
!> **Warning**: Do not use tagging to send personal data such as names or email
addresses to AppSignal. If you want to identify a person, consider using a
user ID, hash or pseudonymized identifier instead. You can use
[link templates](/application/link-templates.html) to link them to your own
system.
## Tags
Using tags you can easily add more information to errors and performance issues
tracked by AppSignal. There are a few limitations on tagging though.
- The tag key must be a `String` or `Atom`.
- The tagged value must be a `String`, `Atom` or `Integer`.
Tags that do not meet these limitations are dropped without warning.
`set_sample_data` can be called multiple times, but only the last value will be retained:
```elixir
Appsignal.Transaction.set_sample_data("tags", %{locale: "en"})
Appsignal.Transaction.set_sample_data("tags", %{user: "bob"})
Appsignal.Transaction.set_sample_data("tags", %{locale: "de"})
```
will result in the following data:
```elixir
%{
locale: "de"
}
```
### Link templates
Tags can also be used to create link templates. Read more about link templates
in our [link templates guide](/application/link-templates.html).
## Sample Data
Besides tags you can add more metadata to a transaction (or override default metadata from integrations such as Phoenix), below is a list of valid keys that can be given to `set_sample_data` and the format of the value.
### `session_data`
Filled with session/cookie data by default, but can be overridden with the following call:
```
Appsignal.Transaction.set_sample_data("session_data", %{_csrf_token: "Z11CWRVG+I2egpmiZzuIx/qbFb/60FZssui5eGA8a3g="})
```
This key accepts nested objects that will be rendered as JSON on a Incident Sample page for both Exception and Performance samples.

### `params`
Filled with framework (such as Phoenix) parameters by default, but can be overridden or filled with the following call:
```
Appsignal.Transaction.set_sample_data("params", %{action: "show", controller: "homepage"})
```
This key accepts nested objects and will show up as follows on a Incident Sample page for both Exception and Performance samples, formatted as JSON.

### `environment`
Environment variables from a request/background job, filled by the Phoenix integration, but can be filled/overriden with the following call:
```
Appsignal.Transaction.set_sample_data("environment", %{CONTENT_LENGTH: "0"})
```
This call only accepts a one-level key/value object, nested values will be ignored.
This will result the following block on a Incident Sample page for both Exception and Performance samples.

### `custom_data`
Custom data is not set by default, but can be used to add additional debugging data to solve a performance issue or exception.
```
Appsignal.Transaction.set_sample_data("custom_data", %{foo: "bar"})
```
This key accepts nested objects and will result in the following block on a Incident Sample page for both Exception and Performance samples formatted as JSON.

| appsignal/appsignal-docs | source/elixir/1.x/instrumentation/tagging.html.md | Markdown | mit | 3,700 | 34.576923 | 219 | 0.758378 | false |
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.microsoft.azure.management.network.v2020_04_01;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Contains SKU in an ExpressRouteCircuit.
*/
public class ExpressRouteCircuitSku {
/**
* The name of the SKU.
*/
@JsonProperty(value = "name")
private String name;
/**
* The tier of the SKU. Possible values include: 'Standard', 'Premium',
* 'Basic', 'Local'.
*/
@JsonProperty(value = "tier")
private ExpressRouteCircuitSkuTier tier;
/**
* The family of the SKU. Possible values include: 'UnlimitedData',
* 'MeteredData'.
*/
@JsonProperty(value = "family")
private ExpressRouteCircuitSkuFamily family;
/**
* Get the name of the SKU.
*
* @return the name value
*/
public String name() {
return this.name;
}
/**
* Set the name of the SKU.
*
* @param name the name value to set
* @return the ExpressRouteCircuitSku object itself.
*/
public ExpressRouteCircuitSku withName(String name) {
this.name = name;
return this;
}
/**
* Get the tier of the SKU. Possible values include: 'Standard', 'Premium', 'Basic', 'Local'.
*
* @return the tier value
*/
public ExpressRouteCircuitSkuTier tier() {
return this.tier;
}
/**
* Set the tier of the SKU. Possible values include: 'Standard', 'Premium', 'Basic', 'Local'.
*
* @param tier the tier value to set
* @return the ExpressRouteCircuitSku object itself.
*/
public ExpressRouteCircuitSku withTier(ExpressRouteCircuitSkuTier tier) {
this.tier = tier;
return this;
}
/**
* Get the family of the SKU. Possible values include: 'UnlimitedData', 'MeteredData'.
*
* @return the family value
*/
public ExpressRouteCircuitSkuFamily family() {
return this.family;
}
/**
* Set the family of the SKU. Possible values include: 'UnlimitedData', 'MeteredData'.
*
* @param family the family value to set
* @return the ExpressRouteCircuitSku object itself.
*/
public ExpressRouteCircuitSku withFamily(ExpressRouteCircuitSkuFamily family) {
this.family = family;
return this;
}
}
| selvasingh/azure-sdk-for-java | sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/ExpressRouteCircuitSku.java | Java | mit | 2,518 | 24.958763 | 97 | 0.628276 | false |
class JudgePolicy < ApplicationPolicy
def create_scores?
record.competition.unlocked? && (user_match? || director?(record.event) || super_admin?)
end
def view_scores?
(user_match? || director?(record.event) || super_admin?)
end
def index?
director?(record.event) || super_admin?
end
def toggle_status?
director?(record.event) || super_admin?
end
def create?
update?
end
def update?
record.scores.count.zero? && record.competition.unlocked? && (director?(record.event) || super_admin?)
end
def destroy?
update?
end
def can_judge?
record.competition.unlocked? && (user_match? || director?(record.event) || super_admin?)
end
private
def user_match?
record.user == user
end
class Scope < Scope
def resolve
scope.none
end
end
end
| rdunlop/unicycling-registration | app/policies/judge_policy.rb | Ruby | mit | 827 | 17.377778 | 106 | 0.646917 | false |
const path = require('path');
const webpack = require('webpack');
const webpackMerge = require('webpack-merge');
const commonConfig = require('./webpack.common.config.js');
module.exports = function () {
return webpackMerge(commonConfig, {
watch: true,
devtool: 'cheap-module-source-map',
// plugins: [
// new webpack.optimize.CommonsChunkPlugin({
// name: "common",
// })
// ],
devServer: {
contentBase: __dirname + "/public/",
port: 8080,
watchContentBase: true
}
})
};
| LilyaSidorenko/jsmp-project2 | webpack.dev.config.js | JavaScript | mit | 598 | 26.181818 | 59 | 0.548495 | false |
<!DOCTYPE html>
<html xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<head>
<meta content="en-us" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-16" http-equiv="Content-Type" />
<title _locid="PortabilityAnalysis0">.NET Portability Report</title>
<style>
/* Body style, for the entire document */
body {
background: #F3F3F4;
color: #1E1E1F;
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
padding: 0;
margin: 0;
}
/* Header1 style, used for the main title */
h1 {
padding: 10px 0px 10px 10px;
font-size: 21pt;
background-color: #E2E2E2;
border-bottom: 1px #C1C1C2 solid;
color: #201F20;
margin: 0;
font-weight: normal;
}
/* Header2 style, used for "Overview" and other sections */
h2 {
font-size: 18pt;
font-weight: normal;
padding: 15px 0 5px 0;
margin: 0;
}
/* Header3 style, used for sub-sections, such as project name */
h3 {
font-weight: normal;
font-size: 15pt;
margin: 0;
padding: 15px 0 5px 0;
background-color: transparent;
}
h4 {
font-weight: normal;
font-size: 12pt;
margin: 0;
padding: 0 0 0 0;
background-color: transparent;
}
/* Color all hyperlinks one color */
a {
color: #1382CE;
}
/* Paragraph text (for longer informational messages) */
p {
font-size: 10pt;
}
/* Table styles */
table {
border-spacing: 0 0;
border-collapse: collapse;
font-size: 10pt;
}
table th {
background: #E7E7E8;
text-align: left;
text-decoration: none;
font-weight: normal;
padding: 3px 6px 3px 6px;
}
table td {
vertical-align: top;
padding: 3px 6px 5px 5px;
margin: 0px;
border: 1px solid #E7E7E8;
background: #F7F7F8;
}
.NoBreakingChanges {
color: darkgreen;
font-weight:bold;
}
.FewBreakingChanges {
color: orange;
font-weight:bold;
}
.ManyBreakingChanges {
color: red;
font-weight:bold;
}
.BreakDetails {
margin-left: 30px;
}
.CompatMessage {
font-style: italic;
font-size: 10pt;
}
.GoodMessage {
color: darkgreen;
}
/* Local link is a style for hyperlinks that link to file:/// content, there are lots so color them as 'normal' text until the user mouse overs */
.localLink {
color: #1E1E1F;
background: #EEEEED;
text-decoration: none;
}
.localLink:hover {
color: #1382CE;
background: #FFFF99;
text-decoration: none;
}
/* Center text, used in the over views cells that contain message level counts */
.textCentered {
text-align: center;
}
/* The message cells in message tables should take up all avaliable space */
.messageCell {
width: 100%;
}
/* Padding around the content after the h1 */
#content {
padding: 0px 12px 12px 12px;
}
/* The overview table expands to width, with a max width of 97% */
#overview table {
width: auto;
max-width: 75%;
}
/* The messages tables are always 97% width */
#messages table {
width: 97%;
}
/* All Icons */
.IconSuccessEncoded, .IconInfoEncoded, .IconWarningEncoded, .IconErrorEncoded {
min-width: 18px;
min-height: 18px;
background-repeat: no-repeat;
background-position: center;
}
/* Success icon encoded */
.IconSuccessEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconSuccess#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABPElEQVR4Xp1Tv0vDUBi8FqeA4NpBcBLcWnQSApncOnTo4FSnjP0DsnXpH5CxiwbHDg4Zuj4oOEXiJgiC4FDcCkLWmIMc1Pfw+eMgQ77v3Xf3Pe51YKGqqisAEwCR1TIAsiAIblSo6xrdHeJR85Xle3mdmCQKb0PsfqyxxzM8K15HZADl/H5+sHpZwYfxyRjTs+kWwKBx8yoHd2mRiuzF8mkJniWH/13u3Fjrs/EdhsdDFHGB/DLXEJBDLh1MWPAhPo1BLB4WX5yQywHR+m3tVe/t97D52CB/ziG0nIgD/qDuYg8WuCcVZ2YGwlJ3YDugkpR/VNcAEx6GEKhERSr71FuO4YCM4XBdwKvecjIlkSnsO0Hyp/GxSeJAdzBKzpOtnPwyyiPdAZhpZptT04tU+zk7s8czeges//s5C5+CwqrR4/gw+AAAAABJRU5ErkJggg==);
}
/* Information icon encoded */
.IconInfoEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconInformation#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHElEQVR4Xs2TsUoDQRRF7wwoziokjZUKadInhdhukR9YP8DMX1hYW+QvdsXa/QHBbcXC7W0CamWTQnclFutceIQJwwaWNLlwm5k5d94M76mmaeCrrmsLYOocY12FcxZFUeozCqKqqgYA8uevv1H6VuPxcwlfk5N92KHBxfFeCSAxxswlYAW/Xr989x/mv9gkhtyMDhcAxgzRsp7flj8B/HF1RsMXq+NZMkopaHe7lbKxQUEIGbKsYNoGn969060hZBkQex/W8oRQwsQaW2o3Ago2SVcJUzAgY3N0lTCZZm+zPS8HB51gMmS1DEYyOz9acKO1D8JWTlafKIMxdhvlfdyT94Vv5h7P8Ky7nQzACmhvKq3zk3PjW9asz9D/1oigecsioooAAAAASUVORK5CYII=);
}
/* Warning icon encoded */
.IconWarningEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconWarning#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAx0lEQVR4XpWSMQ7CMAxFf4xAyBMLCxMrO8dhaBcuwdCJS3RJBw7SA/QGTCxdWJgiQYWKXJWKIXHIlyw5lqr34tQgEOdcBsCOx5yZK3hCCKdYXneQkh4pEfqzLfu+wVDSyyzFoJjfz9NB+pAF+eizx2Vruts0k15mPgvS6GYvpVtQhB61IB/dk6AF6fS4Ben0uIX5odtFe8Q/eW1KvFeH4e8khT6+gm5B+t3juyDt7n0jpe+CANTd+oTUjN/U3yVaABnSUjFz/gFq44JaVSCXeQAAAABJRU5ErkJggg==);
}
/* Error icon encoded */
.IconErrorEncoded {
/* Note: Do not delete the comment below. It is used to verify the correctness of the encoded image resource below before the product is released */
/* [---XsltValidateInternal-Base64EncodedImage:IconError#Begin#background-image: url(data:image/png;base64,#Separator#);#End#] */
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABQElEQVR4XqWTvUoEQRCE6wYPZUA80AfwAQz23uCMjA7MDRQEIzPBVEyNTQUFIw00vcQTTMzuAh/AxEQQT8HF/3G/oGGnEUGuoNnd6qoZuqltyKEsyzVJq5I6rnUp6SjGeGhESikzzlc1eL7opfuVbrqbU1Zw9NCgtQMaZpY0eNnaaL2fHusvTK5vKu7sjSS1Y4y3QUA6K3e3Mau5UFDyMP7tYF9o8cAHZv68vipoIJg971PZIZ5HiwdvYGGvFVFHmGmZ2MxwmQYPXubPl9Up0tfoMQGetXd6mRbvhBw+boZ6WF7Mbv1+GsHRk0fQmPAH1GfmZirbCfDJ61tw3Px8/8pZsPAG4jlVhcPgZ7adwNWBB68lkRQWFiTgFlbnLY3DGGM7izIJIyT/jjIvEJw6fdJTc6krDzh6aMwMP9bvDH4ADSsa9uSWVJkAAAAASUVORK5CYII=);
}
</style>
</head>
<body>
<h1 _locid="PortabilityReport">.NET Portability Report</h1>
<div id="content">
<div id="submissionId" style="font-size:8pt;">
<p>
<i>
Submission Id
b6ccbef0-e4a6-409b-a471-81834341cdb9
</i>
</p>
</div>
<h2 _locid="SummaryTitle">
<a name="Portability Summary"></a>Portability Summary
</h2>
<div id="summary">
<table>
<tbody>
<tr>
<th>Assembly</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
</tr>
<tr>
<td><strong><a href="#Bytescout.BarCode.WPF">Bytescout.BarCode.WPF</a></strong></td>
<td class="text-center">59.96 %</td>
<td class="text-center">55.97 %</td>
<td class="text-center">100.00 %</td>
<td class="text-center">55.97 %</td>
</tr>
</tbody>
</table>
</div>
<div id="details">
<a name="Bytescout.BarCode.WPF"><h3>Bytescout.BarCode.WPF</h3></a>
<table>
<tbody>
<tr>
<th>Target type</th>
<th>ASP.NET 5,Version=v1.0</th>
<th>Windows,Version=v8.1</th>
<th>.NET Framework,Version=v4.6</th>
<th>Windows Phone,Version=v8.1</th>
<th>Recommended changes</th>
</tr>
<tr>
<td>System.AppDomain</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Remove usage</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Collections.Hashtable</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.ComponentModel.BrowsableAttribute</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Remove usage. This is a deprecated attribute from Windows Forms for design-time property window support</td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Boolean)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Remove usage. This is a deprecated attribute from Winforms for design-time property window support</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.ComponentModel.CategoryAttribute</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.String)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.ComponentModel.DescriptionAttribute</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.String)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.ComponentModel.DesignerProperties</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetIsInDesignMode(System.Windows.DependencyObject)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.ComponentModel.ToolboxItemAttribute</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Boolean)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.ComponentModel.Win32Exception</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Configuration.ApplicationSettingsBase</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Configuration.SettingsBase</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Synchronized(System.Configuration.SettingsBase)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Diagnostics.StackFrame</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Consider removing dependency on this API.</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Diagnostics.StackTrace</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Currently there is no workaround, but we are working on it. Please check back.</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Bitmap</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Drawing.Image)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Int32,System.Int32)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">GetHbitmap</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Brush</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Color</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">FromArgb(System.Int32,System.Int32,System.Int32,System.Int32)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_A</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_B</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Beige</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_G</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_R</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">op_Inequality(System.Drawing.Color,System.Drawing.Color)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Drawing2D.SmoothingMode</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Font</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.String,System.Single,System.Drawing.GraphicsUnit)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_FontFamily</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Size</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Style</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.FontFamily</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Name</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.FontStyle</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Graphics</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">FillRectangle(System.Drawing.Brush,System.Int32,System.Int32,System.Int32,System.Int32)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">FromImage(System.Drawing.Image)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.GraphicsUnit</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Image</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Dispose</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Height</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Width</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Imaging.ImageFormat</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Bmp</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Emf</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Exif</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Gif</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Icon</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Jpeg</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_MemoryBmp</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Png</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Tiff</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Wmf</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Point</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Int32,System.Int32)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Size</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Empty</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Int32,System.Int32)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Height</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Width</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">set_Height(System.Int32)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">set_Width(System.Int32)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.SizeF</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.SolidBrush</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Drawing.Color)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Drawing.Text.TextRenderingHint</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Assembly</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>typeof(CurrentType).GetTypeInfo().Assembly</td>
</tr>
<tr>
<td style="padding-left:2em">GetExecutingAssembly</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>typeof(CurrentType).GetTypeInfo().Assembly</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Binder</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use an overload that does not take a Binder.</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.BindingFlags</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Emit.AssemblyBuilder</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Emit.AssemblyBuilderAccess</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Emit.ILGenerator</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Emit.Label</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Emit.LocalBuilder</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Emit.MethodBuilder</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Emit.ModuleBuilder</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Emit.ParameterBuilder</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.Emit.TypeBuilder</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.ObfuscationAttribute</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Reflection.ParameterModifier</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>Use an overload that does not take a ParameterModifier array.</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Runtime.CompilerServices.SuppressIldasmAttribute</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Security.Cryptography.CryptoStream</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Security.Cryptography.CryptoStreamMode</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Security.Cryptography.DESCryptoServiceProvider</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Security.Cryptography.ICryptoTransform</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Security.Cryptography.SymmetricAlgorithm</td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.String</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Intern(System.String)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Type</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>.GetTypeInfo().Assembly</td>
</tr>
<tr>
<td style="padding-left:2em">get_Assembly</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td>.GetTypeInfo().Assembly</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Application</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Current</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_MainWindow</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Controls.Canvas</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.DependencyObject</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.DependencyProperty</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">OverrideMetadata(System.Type,System.Windows.PropertyMetadata)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Register(System.String,System.Type,System.Type,System.Windows.PropertyMetadata)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.FontStretch</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">op_Equality(System.Windows.FontStretch,System.Windows.FontStretch)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.FontStretches</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Condensed</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Expanded</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_ExtraCondensed</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_ExtraExpanded</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Medium</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Normal</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_SemiCondensed</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_SemiExpanded</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_UltraCondensed</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_UltraExpanded</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.FontStyle</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.FontStyles</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Italic</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Normal</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.FontWeight</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.FontWeights</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Black</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Bold</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_DemiBold</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_ExtraBlack</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_ExtraBold</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_ExtraLight</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Heavy</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Light</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Medium</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Normal</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Thin</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.FrameworkElement</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">DefaultStyleKeyProperty</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">OnRenderSizeChanged(System.Windows.SizeChangedInfo)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.FrameworkPropertyMetadata</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Object)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Freezable</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Freeze</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Int32Rect</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Int32,System.Int32,System.Int32,System.Int32)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Interop.Imaging</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">CreateBitmapSourceFromHBitmap(System.IntPtr,System.IntPtr,System.Windows.Int32Rect,System.Windows.Media.Imaging.BitmapSizeOptions)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Media.Color</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">FromArgb(System.Byte,System.Byte,System.Byte,System.Byte)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_A</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_B</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_G</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_R</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Media.CompositionTarget</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_TransformToDevice</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Media.DrawingContext</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">DrawImage(System.Windows.Media.ImageSource,System.Windows.Rect)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Media.FontFamily</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.String)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Source</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Media.ImageSource</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Media.Imaging.BitmapCacheOption</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Media.Imaging.BitmapCreateOptions</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Media.Imaging.BitmapDecoder</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">Create(System.IO.Stream,System.Windows.Media.Imaging.BitmapCreateOptions,System.Windows.Media.Imaging.BitmapCacheOption)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Frames</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Media.Imaging.BitmapFrame</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Media.Imaging.BitmapSizeOptions</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">FromWidthAndHeight(System.Int32,System.Int32)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Media.Imaging.BitmapSource</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Media.Imaging.WriteableBitmap</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Windows.Media.Imaging.BitmapSource)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Media.Matrix</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_M11</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_M22</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Media.Visual</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.PresentationSource</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">FromVisual(System.Windows.Media.Visual)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_CompositionTarget</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.PropertyMetadata</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Object)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Rect</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Double,System.Double,System.Double,System.Double)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.ResourceDictionaryLocation</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Size</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Empty</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Height</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_Width</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">op_Equality(System.Windows.Size,System.Windows.Size)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">op_Inequality(System.Windows.Size,System.Windows.Size)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">set_Height(System.Double)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">set_Width(System.Double)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.SizeChangedInfo</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.ThemeInfoAttribute</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">#ctor(System.Windows.ResourceDictionaryLocation,System.Windows.ResourceDictionaryLocation)</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.UIElement</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">get_RenderSize</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td style="padding-left:2em">InvalidateVisual</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>System.Windows.Window</td>
<td class="IconErrorEncoded"></td>
<td class="IconErrorEncoded"></td>
<td class="IconSuccessEncoded"></td>
<td class="IconErrorEncoded"></td>
<td></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</tbody>
</table>
<p>
<a href="#Portability Summary">Back to Summary</a>
</p>
</div>
</div>
</body>
</html> | kuhlenh/port-to-core | Reports/by/bytescout.barcode.4.31.0.784/Bytescout.BarCode.WPF-net45.html | HTML | mit | 131,046 | 41.961087 | 562 | 0.312783 | false |
---
layout: page
title: "James Kates"
comments: true
description: "blanks"
keywords: "James Kates,CU,Boulder"
---
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://dl.dropboxusercontent.com/s/pc42nxpaw1ea4o9/highcharts.js?dl=0"></script>
<!-- <script src="../assets/js/highcharts.js"></script> -->
<style type="text/css">@font-face {
font-family: "Bebas Neue";
src: url(https://www.filehosting.org/file/details/544349/BebasNeue Regular.otf) format("opentype");
}
h1.Bebas {
font-family: "Bebas Neue", Verdana, Tahoma;
}
</style>
</head>
#### TEACHING INFORMATION
**College**: College of Arts and Sciences
**Classes taught**: SLHS 5674, SLHS 6000
#### SLHS 5674: Signals and Systems in Audiology
**Terms taught**: Fall 2008, Fall 2010, Fall 2012, Fall 2014
**Instructor rating**: 4.16
**Standard deviation in instructor rating**: 0.69
**Average grade** (4.0 scale): 3.48
**Standard deviation in grades** (4.0 scale): 0.1
**Average workload** (raw): 2.94
**Standard deviation in workload** (raw): 0.29
#### SLHS 6000: TPC-DIGTL SIGNL PRCESSNG
**Terms taught**: Spring 2009
**Instructor rating**: 4.71
**Standard deviation in instructor rating**: 0.0
**Average grade** (4.0 scale): 3.48
**Standard deviation in grades** (4.0 scale): 0.0
**Average workload** (raw): 2.17
**Standard deviation in workload** (raw): 0.0
| nikhilrajaram/nikhilrajaram.github.io | instructors/James_Kates.md | Markdown | mit | 1,413 | 22.949153 | 100 | 0.685067 | false |
const Nodelist = artifacts.require("./Nodelist.sol");
const BiathlonNode = artifacts.require("./BiathlonNode.sol");
const SecondNode = artifacts.require("./SecondNode.sol");
const BiathlonToken = artifacts.require("./BiathlonToken.sol");
const Ownable = artifacts.require('../contracts/ownership/Ownable.sol');
// const MintableToken = artifacts.require('MintableToken.sol');
const SecondBiathlonToken = artifacts.require("./SecondBiathlonToken.sol");
let nl;
let bn;
let bt;
let sn;
let st;
contract('BiathlonToken', function(accounts) {
beforeEach(async function() {
bn = await BiathlonNode.deployed();
nl = await Nodelist.deployed();
bt = await BiathlonToken.deployed();
st = await SecondBiathlonToken.deployed();
sn = await SecondNode.deployed();
});
it('should have an owner', async function() {
let owner = await bt.owner();
assert.isTrue(owner !== 0);
});
it('should belong to the correct node', async function() {
let node = await bt.node_address();
let bna = await bn.address;
assert.equal(node, bna, "Token was not initialised to correct node");
});
it('should have a storage contract that is separate', async function() {
let storage_address = await bt.storage_address();
assert.notEqual(storage_address, bt.address);
});
it("should be able to register itself with the Node list of tokens", async function() {
let registration = await bt.register_with_node();
let node_token_count = await bn.count_tokens();
assert.equal(node_token_count, 1, "Node array of tokens doesn't have deployed BiathlonToken");
});
it('should mint a given amount of tokens to a given address', async function() {
const result = await bt.mint(accounts[0], 100, { from: accounts[0] });
assert.equal(result.logs[0].event, 'Mint');
assert.equal(result.logs[0].args.to.valueOf(), accounts[0]);
assert.equal(result.logs[0].args.amount.valueOf(), 100);
assert.equal(result.logs[1].event, 'Transfer');
assert.equal(result.logs[1].args.from.valueOf(), 0x0);
let balance0 = await bt.balanceOf(accounts[0]);
assert(balance0 == 100);
let totalSupply = await bt.totalSupply();
assert.equal(totalSupply, 100);
})
it('should allow owner to mint 50 to account #2', async function() {
let result = await bt.mint(accounts[2], 50);
assert.equal(result.logs[0].event, 'Mint');
assert.equal(result.logs[0].args.to.valueOf(), accounts[2]);
assert.equal(result.logs[0].args.amount.valueOf(), 50);
assert.equal(result.logs[1].event, 'Transfer');
assert.equal(result.logs[1].args.from.valueOf(), 0x0);
let new_balance = await bt.balanceOf(accounts[2]);
assert.equal(new_balance, 50, 'Owner could not mint 50 to account #2');
});
it('should have account #2 on registry after first token minting', async function() {
let check_user = await nl.users(accounts[2]);
assert.equal(check_user, bn.address);
});
it('should spend 25 of the tokens minted to account #2', async function() {
let result = await bt.spend(accounts[2], 25);
assert.equal(result.logs[0].event, 'Burn');
let new_balance = await bt.balanceOf(accounts[2]);
assert.equal(new_balance, 25);
});
it('should have total supply changed by these minting and spending operations', async function() {
let result = await bt.totalSupply();
assert.equal(result, 125);
});
it('should not allow non-onwers to spend', async function() {
try {
let spendtask = await bt.spend(accounts[0], 1, {from: accounts[2]})
} catch (error) {
const invalidJump = error.message.search('invalid opcode') >= 0;
assert(invalidJump, "Expected throw, got '" + error + "' instead");
return;
}
assert.fail("Expected to reject spending from non-owner");
});
it('should not allow non-owners to mint', async function() {
try {
let minttask = await bt.mint(accounts[2], 50, {from: accounts[1]});
} catch (error) {
const invalidJump = error.message.search('invalid opcode') >= 0;
assert(invalidJump, "Expected throw, got '" + error + "' instead");
return;
}
assert.fail("Expected to reject minting from non-owner");
});
it('should not be able to spend more than it has', async function() {
try {
let spendtask = await bt.spend(accounts[2], 66)
} catch (error) {
const invalidJump = error.message.search('invalid opcode') >= 0;
assert(invalidJump, "Expected throw, got '" + error + "' instead");
return;
}
assert.fail("Expected to reject spending more than limit");
});
it('second deployed token should belong to the correct node', async function() {
let node = await st.node_address();
let bna = await bn.address;
assert.equal(node, bna, "Token was not initialised to correct node");
});
it('second token should be able to upgrade the token with the node', async function() {
let name = await st.name();
const upgraded = await bn.upgrade_token(bt.address, st.address, name);
assert.equal(upgraded.logs[0].event, 'UpgradeToken');
let count_of_tokens = await bn.count_tokens();
assert.equal(count_of_tokens, 1, 'Should only be one token in tokenlist still');
});
it('should deactivate original token after upgrade', async function () {
let tia = await bn.tokens.call(bt.address);
assert.isNotTrue(tia[1]);
let newtoken = await bn.tokens.call(st.address);
assert.isTrue(newtoken[1]);
});
it('should carry over the previous balances since storage contract is fixed', async function() {
let get_balance = await st.balanceOf(accounts[2]);
assert.equal(get_balance, 25);
});
it('should not allow the deactivated contract to mint', async function() {
try {
let newmint = await bt.mint(accounts[2], 10);
} catch(error) {
const invalidJump = error.message.search('invalid opcode') >= 0;
assert(invalidJump, "Expected throw, got '" + error + "' instead");
return;
}
assert.fail("Expected to reject spending more than limit");
});
it('should allow minting more tokens to accounts', async function() {
let newmint = await st.mint(accounts[2], 3);
let getbalance = await st.balanceOf(accounts[2]);
let totalsupply = await st.totalSupply();
assert.equal(totalsupply, 128);
assert.equal(getbalance, 28);
});
it('should be able to transfer as contract owner from one account to another', async function() {
let thetransfer = await st.biathlon_transfer(accounts[2], accounts[3], 2);
let getbalance2 = await st.balanceOf(accounts[2]);
let getbalance3 = await st.balanceOf(accounts[3]);
assert.equal(getbalance2, 26);
assert.equal(getbalance3, 2);
});
it('should not be able to transfer as non-owner from one account to another', async function() {
try {
let thetransfer = await st.biathlon_transfer(accounts[3], accounts[4], 1, {from: accounts[1]});
} catch(error) {
const invalidJump = error.message.search('invalid opcode') >= 0;
assert(invalidJump, "Expected throw, got '" + error + "' instead");
return;
}
assert.fail("Expected to reject transfering from non-owner");
})
});
| BiathlonHelsinki/BiathlonContract | test/3_biathlontoken.js | JavaScript | mit | 7,223 | 35.296482 | 101 | 0.666344 | false |
package classfile
import "encoding/binary"
type ClassReader struct {
data []byte
}
func (self *ClassReader) readUint8() uint8 {
val := self.data[0]
self.data = self.data[1:]
return val
}
func (self *ClassReader) readUint16() uint16 {
val := binary.BigEndian.Uint16(self.data)
self.data = self.data[2:]
return val
}
func (self *ClassReader) readUint32() uint32 {
val := binary.BigEndian.Uint32(self.data)
self.data = self.data[4:]
return val
}
func (self *ClassReader) readUint64() uint64 {
val := binary.BigEndian.Uint64(self.data)
self.data = self.data[8:]
return val
}
func (self *ClassReader) readUint16s() []uint16 {
n := self.readUint16()
s := make([]uint16, n)
for i := range s {
s[i] = self.readUint16()
}
return s
}
func (self *ClassReader) readBytes(n uint32) []byte {
bytes := self.data[:n]
self.data = self.data[n:]
return bytes
}
| wonghoifung/tips | goworkspace/src/jvmgo/classfile/class_reader.go | GO | mit | 874 | 18 | 53 | 0.677346 | false |
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.LinkedList;
//this code contains the output assembly code that the program outputs.
//will have at least three functions:
//add(string, string, string, string) <- adds an assembly code line
//optimise(int) <- optimises the output code, wherever possible
//write(string) <- writes the code to the desired filename
public class ASMCode {
LinkedList<String> lines = new LinkedList<String>();
LinkedList<String> data = new LinkedList<String>();
HashMap<String, String> stringMap = new HashMap<String, String>();
LinkedList<lineWrapper> functionLines = new LinkedList<lineWrapper>();
boolean hasFCall;
private interface lineWrapper {
String compile(int stacksize, boolean funcCall);
}
private class stdLineWrapper implements lineWrapper {
private String line;
@Override
public String compile(int stacksize, boolean funcCall) {
return line;
}
public stdLineWrapper(String s) {
line = s;
}
}
private class functionReturnWrapper implements lineWrapper {
@Override
public String compile(int stacksize, boolean funcCall) {
StringBuilder s = new StringBuilder();
if(stacksize != 0) {
s.append("\tmov\tsp, fp");
s.append(System.getProperty("line.separator"));//system independent newline
s.append("\tpop\tfp");
s.append(System.getProperty("line.separator"));
}
if(hasFCall) {
s.append("\tpop\tra");
s.append(System.getProperty("line.separator"));
}
s.append("\tjmpr\tra");
return s.toString();
}
}
public void add(String inst, String reg1, String reg2, String reg3) {
if(deadCode) return;
String newInst = "\t"+inst;
if(reg1 != null) {
newInst = newInst + "\t" + reg1;
if(reg2 != null) {
newInst = newInst + ", " + reg2;
if(reg3 != null) {
newInst = newInst + ", " + reg3;
}
}
}
functionLines.addLast(new stdLineWrapper(newInst));
}
public void add(String inst, String reg1, String reg2) {
add(inst, reg1, reg2, null);
}
public void add(String inst, String reg1) {
add(inst, reg1, null, null);
}
public void add(String inst) {
add(inst, null, null, null);
}
int labIndex = 0;
public String addString(String s) {
//makes sure we don't have duplicate strings in memory
if(stringMap.containsKey(s)) return stringMap.get(s);
//generate a label
String label = "string" + labIndex++;
data.addLast(label+":");
data.addLast("#string " +s);
stringMap.put(s, label);
return label;
}
public void addGlobal(String data, String label) {
//generate a label
this.data.addLast(label+":");
this.data.addLast(data);
}
public void put(String s) {
if(!deadCode)
functionLines.addLast(new stdLineWrapper(s));
}
private String fname;
public void beginFunction(String name) {
functionLines = new LinkedList<lineWrapper>();
fname = name;
hasFCall = false;
}
public void endFunction(int varCount) {
lines.addLast("#global " + fname);
lines.addLast(fname+":");
if(hasFCall) {
lines.addLast("\tpush\tra");
}
if(varCount != 0) {
lines.addLast("\tpush\tfp");
lines.addLast("\tmov\tfp, sp");
lines.addLast("\taddi\tsp, sp, " + varCount);
}
for(lineWrapper w : functionLines) {
lines.addLast(w.compile(varCount, hasFCall));
}
}
public void setHasFCall() {
if(deadCode) return;
hasFCall = true;
}
public void functionReturn() {
if(deadCode) return;
functionLines.addLast(new functionReturnWrapper());
}
public void write(String filename) {
//System.out.println(".text");
//for(String s : lines) {
// System.out.println(s);
//}
//System.out.println(".data");
//for(String s : data) {
// System.out.println(s);
//}
System.out.println("Compilation successful!");
System.out.println("Writing...");
try {
PrintWriter out = new PrintWriter(new FileWriter(filename+".asm"));
out.println(".text");
for(String s : lines) {
out.println(s);
}
out.println(".data");
for(String s : data) {
out.println(s);
}
out.close();
} catch(IOException e) {
System.out.println("Writing failed");
return;
}
System.out.println("Program created!");
}
boolean deadCode;
public void deadCode(boolean codeIsDead) {
deadCode = codeIsDead;
}
}
| mjsmith707/KSPCompiler | src/ASMCode.java | Java | mit | 4,329 | 23.87931 | 79 | 0.668284 | false |
import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core';
import { Filter, FilterType } from 'lib/filter';
@Component({
selector: 'iw-filter-input',
templateUrl: './filter-input.component.html',
styleUrls: ['./filter-input.component.css']
})
export class FilterInputComponent implements OnInit {
@Input() filter: Filter;
@Output() change = new EventEmitter<Filter>();
constructor() { }
ngOnInit() {
}
get FilterType() {
return FilterType;
}
applyFilter(filter: Filter, value: string) {
filter.value = value;
this.change.emit(filter);
}
itemsForField(filter: Filter) {
if (filter.options) {
return filter.options;
}
// put to initialization
// if (!this.rows) { return []; }
// const items = [];
// this.rows.forEach((r) => {
// if (items.indexOf(r[filter.key]) < 0) {
// items.push(r[filter.key]);
// }
// });
// return items;
}
}
/*
filterData(key: string, value: any) {
let filter: Filter = this.filters
.find((f) => f.key === key);
if (!filter) {
filter = {
type: FilterType.String, key, value
};
this.filters.push(filter);
} else {
// overwritte previous value
filter.value = value;
}
this.filterChange.emit();
}
}
*/
| zorec/ng2-pack | src/app/filter-input/filter-input.component.ts | TypeScript | mit | 1,320 | 20.290323 | 79 | 0.584848 | false |
var express = require('express');
var bodyParser = require('body-parser');
var fs = require('fs')
var app = express();
var lostStolen = require('mastercard-lost-stolen');
var MasterCardAPI = lostStolen.MasterCardAPI;
var dummyData = [];
var dummyDataFiles = ['www/data/menu.json', 'www/data/account-number.json'];
dummyDataFiles.forEach(function(file) {
fs.readFile(file, 'utf8', function(err, data) {
if (err) {
return console.log(err);
}
dummyData[file] = JSON.parse(data);
});
});
var config = {
p12file: process.env.KEY_FILE || null,
p12pwd: process.env.KEY_FILE_PWD || 'keystorepassword',
p12alias: process.env.KEY_FILE_ALIAS || 'keyalias',
apiKey: process.env.API_KEY || null,
sandbox: process.env.SANDBOX || 'true',
}
var useDummyData = null == config.p12file;
if (useDummyData) {
console.log('p12 file info missing, using dummy data')
} else {
console.log('has p12 file info, using MasterCardAPI')
var authentication = new MasterCardAPI.OAuth(config.apiKey, config.p12file, config.p12alias, config.p12pwd);
MasterCardAPI.init({
sandbox: 'true' === config.sandbox,
authentication: authentication
});
}
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.static('www'));
app.post('/menu', function(req, res) {
res.json(dummyData[dummyDataFiles[0]]);
});
app.post('/orders', function(req, res) {
res.json({});
});
app.post('/confirm', function(req, res) {
res.json({});
});
app.post('/checkAccountNumber', function(req, res) {
if (useDummyData) {
if (null == dummyData[dummyDataFiles[1]][req.body.accountNumber]) {
res.json(dummyData[dummyDataFiles[1]].default);
} else {
res.json(dummyData[dummyDataFiles[1]][req.body.accountNumber]);
}
} else {
var requestData = {
"AccountInquiry": {
"AccountNumber": req.body.accountNumber
}
};
lostStolen.AccountInquiry.update(requestData, function(error, data) {
if (error) {
res.json({
"type": "APIError",
"message": "Error executing API call",
"status": 400,
"data": {
"Errors": {
"Error": {
"Source": "Unknown",
"ReasonCode": "UNKNOWN",
"Description": "Unknown error",
"Recoverable": "false"
}
}
}
});
}
else {
res.json(data);
}
});
}
});
app.listen(3000, function() {
console.log('Example app listening on port 3000!');
});
| perusworld/mcdevapi-lostandstolen-refimpl-web | index.js | JavaScript | mit | 2,903 | 28.927835 | 112 | 0.534964 | false |
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', { title: 'Express' });
});
router.get('/about', function(req, res, next) {
res.render('about', { title: 'About' });
});
module.exports = router;
| Studio39/node-snapclone | routes/index.js | JavaScript | mit | 301 | 22.153846 | 47 | 0.614618 | false |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("10. Advanced Retake Exam - 22 August 2016")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("10. Advanced Retake Exam - 22 August 2016")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("8171b56b-59dc-4347-98ad-21d0c4690715")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| NikolaySpasov/Softuni | C# Advanced/10. Advanced Retake Exam - 22 August 2016/10. Advanced Retake Exam - 22 August 2016/Properties/AssemblyInfo.cs | C# | mit | 1,453 | 39.277778 | 84 | 0.745517 | false |
<!--
Copyright 2005-2008 Adobe Systems Incorporated
Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
or a copy at http://stlab.adobe.com/licenses.html)
Some files are held under additional license.
Please see "http://stlab.adobe.com/licenses.html" for more information.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<TITLE>Adobe Software Technology Lab: Member List</TITLE>
<META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/>
<LINK TYPE="text/css" REL="stylesheet" HREF="adobe_source.css"/>
<LINK REL="alternate" TITLE="stlab.adobe.com RSS" HREF="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&rss_fulltext=1" TYPE="application/rss+xml"/>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
</head>
<body>
<div id='content'>
<table><tr>
<td colspan='5'>
<div id='opensource_banner'>
<table style='width: 100%; padding: 5px;'><tr>
<td align='left'>
<a href='index.html' style='border: none'><img src='stlab2007.jpg' alt="stlab.adobe.com"/></a>
</td>
<td align='right'>
<a href='http://www.adobe.com' style='border: none'><img src='adobe_hlogo.gif' alt="Adobe Systems Incorporated"/></a>
</td>
</tr></table>
</div>
</td></tr><tr>
<td valign="top">
<div id='navtable' height='100%'>
<div style='margin: 5px'>
<h4>Documentation</h4>
<a href="group__asl__overview.html">Overview</a><br/>
<a href="asl_readme.html">Building ASL</a><br/>
<a href="asl_toc.html">Documentation</a><br/>
<a href="http://stlab.adobe.com/wiki/index.php/Supplementary_ASL_Documentation">Library Wiki Docs</a><br/>
<a href="asl_indices.html">Indices</a><br/>
<a href="http://stlab.adobe.com/perforce/">Browse Perforce</a><br/>
<h4>More Info</h4>
<a href="asl_release_notes.html">Release Notes</a><br/>
<a href="http://stlab.adobe.com/wiki/">Wiki</a><br/>
<a href="asl_search.html">Site Search</a><br/>
<a href="licenses.html">License</a><br/>
<a href="success_stories.html">Success Stories</a><br/>
<a href="asl_contributors.html">Contributors</a><br/>
<h4>Media</h4>
<a href="http://sourceforge.net/project/showfiles.php?group_id=132417&package_id=145420">Download</a><br/>
<a href="asl_download_perforce.html">Perforce Depots</a><br/>
<h4>Support</h4>
<a href="http://sourceforge.net/projects/adobe-source/">ASL SourceForge Home</a><br/>
<a href="http://sourceforge.net/mail/?group_id=132417">Mailing Lists</a><br/>
<a href="http://sourceforge.net/forum/?group_id=132417">Discussion Forums</a><br/>
<a href="http://sourceforge.net/tracker/?atid=724218&group_id=132417&func=browse">Report Bugs</a><br/>
<a href="http://sourceforge.net/tracker/?atid=724221&group_id=132417&func=browse">Suggest Features</a><br/>
<a href="asl_contributing.html">Contribute to ASL</a><br/>
<h4>RSS</h4>
<a href="http://sourceforge.net/export/rss2_projnews.php?group_id=132417">Short-text news</a><br/>
<a href="http://sourceforge.net/export/rss2_projnews.php?group_id=132417&rss_fulltext=1">Full-text news</a><br/>
<a href="http://sourceforge.net/export/rss2_projfiles.php?group_id=132417">File releases</a><br/>
<h4>Other Adobe Projects</h4>
<a href="http://sourceforge.net/adobe/">Open @ Adobe</a><br/>
<a href="http://opensource.adobe.com/">Adobe Open Source</a><br/>
<a href="http://labs.adobe.com/">Adobe Labs</a><br/>
<a href="http://stlab.adobe.com/amg/">Adobe Media Gallery</a><br/>
<a href="http://stlab.adobe.com/performance/">C++ Benchmarks</a><br/>
<h4>Other Resources</h4>
<a href="http://boost.org">Boost</a><br/>
<a href="http://www.riaforge.com/">RIAForge</a><br/>
<a href="http://www.sgi.com/tech/stl">SGI STL</a><br/>
</div>
</div>
</td>
<td id='maintable' width="100%" valign="top">
<!-- End Header -->
<!-- Generated by Doxygen 1.7.2 -->
<div class="header">
<div class="headertitle">
<h1>unary_compose< F, G > Member List</h1> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="structadobe_1_1unary__compose.html">unary_compose< F, G ></a>, including all inherited members.<table>
<tr class="memlist"><td><a class="el" href="structadobe_1_1unary__compose.html#ae8e3eb881d7aa88edb168fe626cca8f0">operator()</a>(const U &x) const </td><td><a class="el" href="structadobe_1_1unary__compose.html">unary_compose< F, G ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structadobe_1_1unary__compose.html#afd30a06f605c1dbd8aea1206cb6fcd6f">operator()</a>(U &x) const </td><td><a class="el" href="structadobe_1_1unary__compose.html">unary_compose< F, G ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structadobe_1_1unary__compose.html#a4cf2df542e3bed6ef93ff54d61aa8844">result_type</a> typedef</td><td><a class="el" href="structadobe_1_1unary__compose.html">unary_compose< F, G ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structadobe_1_1unary__compose.html#ae6c9f90e50c0c070cc48371950b81071">unary_compose</a>()</td><td><a class="el" href="structadobe_1_1unary__compose.html">unary_compose< F, G ></a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structadobe_1_1unary__compose.html#a3fd198d939304e15f7fc66ca74ef2556">unary_compose</a>(F f, G g)</td><td><a class="el" href="structadobe_1_1unary__compose.html">unary_compose< F, G ></a></td><td></td></tr>
</table></div>
<!-- Begin Footer -->
</td></tr>
</table>
</div> <!-- content -->
<div class='footerdiv'>
<div id='footersub'>
<ul>
<li><a href="http://www.adobe.com/go/gftray_foot_aboutadobe">Company</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_privacy_security">Online Privacy Policy</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_terms">Terms of Use</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_contact_adobe">Contact Us</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_accessibility">Accessibility</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_report_piracy">Report Piracy</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_permissions_trademarks">Permissions & Trademarks</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_product_license_agreements">Product License Agreements</a> | </li>
<li><a href="http://www.adobe.com/go/gftray_foot_feedback">Send Feedback</a></li>
</ul>
<div>
<p>Copyright © 2006-2007 Adobe Systems Incorporated.</p>
<p>Use of this website signifies your agreement to the <a href="http://www.adobe.com/go/gftray_foot_terms">Terms of Use</a> and <a href="http://www.adobe.com/go/gftray_foot_privacy_security">Online Privacy Policy</a>.</p>
<p>Search powered by <a href="http://www.google.com/" target="new">Google</a></p>
</div>
</div>
</div>
<script type="text/javascript">
_uacct = "UA-396569-1";
urchinTracker();
</script>
</body>
</html>
| brycelelbach/asl | documentation/html/structadobe_1_1unary__compose-members.html | HTML | mit | 7,661 | 54.514493 | 268 | 0.639081 | false |
# Stomp example
## How to use
### Using `create-next-app`
Execute [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app) with [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) or [npx](https://github.com/zkat/npx#readme) to bootstrap the example:
```bash
npx create-next-app --example with-stomp with-stomp-app
# or
yarn create next-app --example with-stomp with-stomp-app
```
### Download manually
Download the example:
```bash
curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-stomp
cd with-stomp
```
Install it and run:
```bash
npm install
STOMP_SERVER=wss://some.stomp.server npm run dev
# or
yarn
STOMP_SERVER=wss://some.stomp.server yarn dev
```
You'll need to provide the STOMP url of your server in `STOMP_SERVER`
> If you're on Windows you may want to use [cross-env](https://www.npmjs.com/package/cross-env)
## The idea behind the example
This example show how to use [STOMP](http://stomp.github.io/) inside a Next.js application.
STOMP is a simple text-orientated messaging protocol. It defines an interoperable wire format so that any of the available STOMP clients can communicate with any STOMP message broker.
Read more about [STOMP](http://jmesnil.net/stomp-websocket/doc/) protocol.
| BlancheXu/test | examples/with-stomp/README.md | Markdown | mit | 1,312 | 28.818182 | 226 | 0.742378 | false |
'''
salt.utils
~~~~~~~~~~
'''
class lazy_property(object):
'''
meant to be used for lazy evaluation of an object attribute.
property should represent non-mutable data, as it replaces itself.
http://stackoverflow.com/a/6849299/564003
'''
def __init__(self, fget):
self.fget = fget
self.func_name = fget.__name__
def __get__(self, obj, cls):
if obj is None:
return None
value = self.fget(obj)
setattr(obj, self.func_name, value)
return value
| johnnoone/salt-targeting | src/salt/utils/__init__.py | Python | mit | 537 | 18.178571 | 70 | 0.573557 | false |
/*
File: Reachability.h
Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs.
Version: 2.1
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc.
("Apple") in consideration of your agreement to the following terms, and your
use, installation, modification or redistribution of this Apple software
constitutes acceptance of these terms. If you do not agree with these terms,
please do not use, install, modify or redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and subject
to these terms, Apple grants you a personal, non-exclusive license, under
Apple's copyrights in this original Apple software (the "Apple Software"), to
use, reproduce, modify and redistribute the Apple Software, with or without
modifications, in source and/or binary forms; provided that if you redistribute
the Apple Software in its entirety and without modifications, you must retain
this notice and the following text and disclaimers in all such redistributions
of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc. may be used
to endorse or promote products derived from the Apple Software without specific
prior written permission from Apple. Except as expressly stated in this notice,
no other rights or licenses, express or implied, are granted by Apple herein,
including but not limited to any patent rights that may be infringed by your
derivative works or by other works in which the Apple Software may be
incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR
DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF
CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (C) 2010 Apple Inc. All Rights Reserved.
*/
#import <Foundation/Foundation.h>
#import <SystemConfiguration/SystemConfiguration.h>
typedef enum {
NotReachable = 0,
ReachableViaWiFi,
ReachableViaWWAN
} NetworkStatus;
#define kReachabilityChangedNotification @"kNetworkReachabilityChangedNotification"
@interface Reachability: NSObject
{
BOOL localWiFiRef;
SCNetworkReachabilityRef reachabilityRef;
}
//reachabilityWithHostName- Use to check the reachability of a particular host name.
+ (Reachability*) reachabilityWithHostName: (NSString*) hostName;
//reachabilityWithAddress- Use to check the reachability of a particular IP address.
+ (Reachability*) reachabilityWithAddress: (const struct sockaddr_in*) hostAddress;
//reachabilityForInternetConnection- checks whether the default route is available.
// Should be used by applications that do not connect to a particular host
+ (Reachability*) reachabilityForInternetConnection;
//reachabilityForLocalWiFi- checks whether a local wifi connection is available.
+ (Reachability*) reachabilityForLocalWiFi;
//Start listening for reachability notifications on the current run loop
- (BOOL) startNotifier;
- (void) stopNotifier;
- (NetworkStatus) currentReachabilityStatus;
//WWAN may be available, but not active until a connection has been established.
//WiFi may require a connection for VPN on Demand.
- (BOOL) connectionRequired;
@end
| hejunbinlan/iOSStarterTemplate | Classes/Service/Reachability.h | C | mit | 3,955 | 42.943182 | 86 | 0.780784 | false |
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module FlashFinalProject
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# Do not swallow errors in after_commit/after_rollback callbacks.
config.active_record.raise_in_transactional_callbacks = true
end
end
| YushengLi/MultimediaDesignProject | config/application.rb | Ruby | mit | 1,124 | 42.230769 | 99 | 0.72242 | false |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Leap;
namespace LeapMIDI
{
class LeapStuff
{
private Controller controller = new Controller();
public float posX { get; private set; }
public float posY { get; private set; }
public float posZ { get; private set; }
public float velX { get; private set; }
public float velY { get; private set; }
public float velZ { get; private set; }
public float pinch { get; private set; }
public string info { get; private set; }
public LeapStuff()
{
//controller.EnableGesture(Gesture.GestureType.;
controller.SetPolicy(Controller.PolicyFlag.POLICY_BACKGROUND_FRAMES);
}
internal void Update()
{
Frame frame = controller.Frame();
info = "Connected: " + controller.IsConnected + "\n" +
"Frame ID: " + frame.Id + "\n" +
"Hands: " + frame.Hands.Count + "\n" +
"Fingers: " + frame.Fingers.Count + "\n\n";
if (frame.Hands.Count == 1)
{
info += "Hand #1 Position X:" + frame.Hands[0].PalmPosition.x + "\n";
info += "Hand #1 Position Y:" + frame.Hands[0].PalmPosition.y + "\n";
info += "Hand #1 Position Z:" + frame.Hands[0].PalmPosition.z + "\n\n";
info += "Hand #1 Velocity X:" + frame.Hands[0].PalmVelocity.x + "\n";
info += "Hand #1 Velocity Y:" + frame.Hands[0].PalmVelocity.y + "\n";
info += "Hand #1 Velocity Z:" + frame.Hands[0].PalmVelocity.z + "\n";
info += "Hand #1 Pinch:" + frame.Hands[0].PinchStrength + "\n";
posX = frame.Hands[0].PalmPosition.x;
posY = frame.Hands[0].PalmPosition.y;
posZ = frame.Hands[0].PalmPosition.z;
velX = frame.Hands[0].PalmVelocity.x;
velY = frame.Hands[0].PalmVelocity.y;
velZ = frame.Hands[0].PalmVelocity.z;
pinch = frame.Hands[0].PinchStrength;
}
else
{
velX = 0;
velY = 0;
velZ = 0;
pinch = 0;
}
}
}
}
| LeifBloomquist/LeapMotion | C#/LeapMIDI/LeapStuff.cs | C# | mit | 2,374 | 31.493151 | 87 | 0.504216 | false |
//
// Created by Aman LaChapelle on 5/26/17.
//
// pytorch_inference
// Copyright (c) 2017 Aman LaChapelle
// Full license at pytorch_inference/LICENSE.txt
//
#include "../include/layers.hpp"
#include "utils.hpp"
int main(){
std::vector<pytorch::tensor> tests = test_setup({1, 1, 1},
{2, 2, 2},
{45, 45, 45},
{50, 50, 50},
{1},
{2},
{45},
{50},
{"test_prod1.dat", "test_prod2.dat", "test_prod3.dat"},
"test_prod");
// tests has {input1, input2, input3, pytorch_output}
pytorch::Product p(pytorch::k, 3);
af::timer::start();
pytorch::tensor prod;
for (int j = 49; j >= 0; j--){
prod = p({tests[0], tests[1], tests[2]})[0];
prod.eval();
}
af::sync();
std::cout << "arrayfire forward took (s): " << af::timer::stop()/50 << "(avg)" << std::endl;
assert(almost_equal(prod, tests[3]));
}
| bzcheeseman/pytorch-inference | test/test_product.cpp | C++ | mit | 1,213 | 30.102564 | 99 | 0.397362 | false |
package com.github.weeniearms.graffiti;
import com.github.weeniearms.graffiti.config.CacheConfiguration;
import com.github.weeniearms.graffiti.generator.GraphGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.Arrays;
@Service
public class GraphService {
private final GraphGenerator[] generators;
@Autowired
public GraphService(GraphGenerator[] generators) {
this.generators = generators;
}
@Cacheable(CacheConfiguration.GRAPH)
public byte[] generateGraph(String source, GraphGenerator.OutputFormat format) throws IOException {
GraphGenerator generator =
Arrays.stream(generators)
.filter(g -> g.isSourceSupported(source))
.findFirst()
.orElseThrow(() -> new IllegalArgumentException("No matching generator found for source"));
return generator.generateGraph(source, format);
}
}
| weeniearms/graffiti | src/main/java/com/github/weeniearms/graffiti/GraphService.java | Java | mit | 1,097 | 33.28125 | 115 | 0.717411 | false |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>modelY() \ Language (API) \ Processing 2+</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Author" content="Processing Foundation" />
<meta name="Publisher" content="Processing Foundation" />
<meta name="Keywords" content="Processing, Sketchbook, Programming, Coding, Code, Art, Design" />
<meta name="Description" content="Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology." />
<meta name="Copyright" content="All contents copyright the Processing Foundation, Ben Fry, Casey Reas, and the MIT Media Laboratory" />
<script src="javascript/modernizr-2.6.2.touch.js" type="text/javascript"></script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body id="Langauge-en" onload="" >
<!-- ==================================== PAGE ============================ -->
<div id="container">
<!-- ==================================== HEADER ============================ -->
<div id="ribbon">
<ul class="left">
<li class="highlight"><a href="http://processing.org/">Processing</a></li>
<li><a href="http://p5js.org/">p5.js</a></li>
<li><a href="http://py.processing.org/">Processing.py</a></li>
<li><a href="http://android.processing.org/">Processing for Android</a></li>
</ul>
<ul class="right">
<li><a href="https://processingfoundation.org/">Processing Foundation</a></li>
</ul>
<div class="clear"></div>
</div>
<div id="header">
<a href="/" title="Back to the Processing cover."><div class="processing-logo no-cover" alt="Processing cover"></div></a>
<form name="search" method="get" action="//www.google.com/search">
<p><input type="hidden" name="as_sitesearch" value="processing.org" />
<input type="text" name="as_q" value="" size="20" class="text" />
<input type="submit" value=" " /></p>
</form>
</div>
<a id="TOP" name="TOP"></a>
<div id="navigation">
<div class="navBar" id="mainnav">
<a href="index.html" class='active'>Language</a><br>
<a href="libraries/index.html" >Libraries</a><br>
<a href="tools/index.html">Tools</a><br>
<a href="environment/index.html">Environment</a><br>
</div>
<script> document.querySelectorAll(".processing-logo")[0].className = "processing-logo"; </script>
</div>
<!-- ==================================== CONTENT - Headers ============================ -->
<div class="content">
<p class="ref-notice">This reference is for Processing 3.0+. If you have a previous version, use the reference included with your software in the Help menu. If you see any errors or have suggestions, <a href="https://github.com/processing/processing-docs/issues?state=open">please let us know</a>. If you prefer a more technical reference, visit the <a href="http://processing.github.io/processing-javadocs/core/">Processing Core Javadoc</a> and <a href="http://processing.github.io/processing-javadocs/libraries/">Libraries Javadoc</a>.</p>
<table cellpadding="0" cellspacing="0" border="0" class="ref-item">
<tr class="name-row">
<th scope="row">Name</th>
<td><h3>modelY()</h3></td>
</tr>
<tr class="">
<tr class=""><th scope="row">Examples</th><td><div class="example"><pre >
void setup() {
size(500, 500, P3D);
noFill();
}
void draw() {
background(0);
pushMatrix();
// start at the middle of the screen
translate(width/2, height/2, -200);
// some random rotation to make things interesting
rotateY(1.0); //yrot);
rotateZ(2.0); //zrot);
// rotate in X a little more each frame
rotateX(frameCount / 100.0);
// offset from center
translate(0, 150, 0);
// draw a white box outline at (0, 0, 0)
stroke(255);
box(50);
// the box was drawn at (0, 0, 0), store that location
float x = modelX(0, 0, 0);
float y = modelY(0, 0, 0);
float z = modelZ(0, 0, 0);
// clear out all the transformations
popMatrix();
// draw another box at the same (x, y, z) coordinate as the other
pushMatrix();
translate(x, y, z);
stroke(255, 0, 0);
box(50);
popMatrix();
}
</pre></div>
</td></tr>
<tr class="">
<th scope="row">Description</th>
<td>
Returns the three-dimensional X, Y, Z position in model space. This returns the Y value for a given coordinate based on the current set of transformations (scale, rotate, translate, etc.) The Y value can be used to place an object in space relative to the location of the original point once the transformations are no longer in use.<br />
<br />
In the example, the <b>modelX()</b>, <b>modelY()</b>, and <b>modelZ()</b> functions record the location of a box in space after being placed using a series of translate and rotate commands. After popMatrix() is called, those transformations no longer apply, but the (x, y, z) coordinate returned by the model functions is used to place another box in the same location.
</td>
</tr>
<tr class=""><th scope="row">Syntax</th><td><pre>modelY(<kbd>x</kbd>, <kbd>y</kbd>, <kbd>z</kbd>)</pre></td></tr>
<tr class=""> <th scope="row">Parameters</th><td><table cellpadding="0" cellspacing="0" border="0"><tr class="">
<th scope="row" class="code">x</th>
<td>float: 3D x-coordinate to be mapped</td>
</tr>
<tr class="">
<th scope="row" class="code">y</th>
<td>float: 3D y-coordinate to be mapped</td>
</tr>
<tr class="">
<th scope="row" class="code">z</th>
<td>float: 3D z-coordinate to be mapped</td>
</tr></table></td> </tr>
<tr class=""><th scope="row">Returns</th><td class="code">float</td></tr>
<tr class=""><th scope="row">Related</th><td><a class="code" href="modelX_.html">modelX()</a><br />
<a class="code" href="modelZ_.html">modelZ()</a><br /></td></tr>
</table>
Updated on July 30, 2016 04:31:58am EDT<br /><br />
<!-- Creative Commons License -->
<div class="license">
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img alt="Creative Commons License" style="border: none" src="http://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png" /></a>
</div>
<!--
<?xpacket begin='' id=''?>
<x:xmpmeta xmlns:x='adobe:ns:meta/'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
<rdf:Description rdf:about=''
xmlns:xapRights='http://ns.adobe.com/xap/1.0/rights/'>
<xapRights:Marked>True</xapRights:Marked>
</rdf:Description>
<rdf:Description rdf:about=''
xmlns:xapRights='http://ns.adobe.com/xap/1.0/rights/'
>
<xapRights:UsageTerms>
<rdf:Alt>
<rdf:li xml:lang='x-default' >This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.</rdf:li>
<rdf:li xml:lang='en' >This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.</rdf:li>
</rdf:Alt>
</xapRights:UsageTerms>
</rdf:Description>
<rdf:Description rdf:about=''
xmlns:cc='http://creativecommons.org/ns#'>
<cc:license rdf:resource='http://creativecommons.org/licenses/by-nc-sa/4.0/'/>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end='r'?>
-->
</div>
<!-- ==================================== FOOTER ============================ -->
<div id="footer">
<div id="copyright">Processing is an open project intiated by <a href="http://benfry.com/">Ben Fry</a> and <a href="http://reas.com">Casey Reas</a>. It is developed by a <a href="http://processing.org/about/people/">team of volunteers</a>.</div>
<div id="colophon">
<a href="copyright.html">© Info</a>
</div>
</div>
</div>
<script src="javascript/jquery-1.9.1.min.js"></script>
<script src="javascript/site.js" type="text/javascript"></script>
</body>
</html>
| sylviawan/oop_assignment1 | Desktop/Processing.app/Contents/Java/modes/java/reference/modelY_.html | HTML | mit | 8,356 | 40.98995 | 545 | 0.631762 | false |
<?php
/**
* This file is part of the [n]core framework
*
* Copyright (c) 2014 Sascha Seewald / novael.de
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace nCore\Core\Router\Exception;
use nCore\Core\Exception\DefaultException;
/**
* Class RouterException
* @package nCore\Core\Router\Exception
*/
class RouterException extends DefaultException
{
/**
* @inheritdoc
*/
public function dispatchException()
{
$this->httpCode = 500;
}
}
| sSeewald/nCore | src/nCore/Core/Router/Exception/RouterException.php | PHP | mit | 572 | 17.483871 | 74 | 0.683566 | false |
<?php
namespace App\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
/**
* ParametersFixture
*
*/
class ParametersFixture extends TestFixture
{
/**
* Fields
*
* @var array
*/
// @codingStandardsIgnoreStart
public $fields = [
'id' => ['type' => 'integer', 'length' => 11, 'unsigned' => false, 'null' => false, 'default' => null, 'comment' => '', 'autoIncrement' => true, 'precision' => null],
'name' => ['type' => 'string', 'length' => 50, 'null' => false, 'default' => null, 'collate' => 'latin1_spanish_ci', 'comment' => '', 'precision' => null, 'fixed' => null],
'value' => ['type' => 'text', 'length' => null, 'null' => false, 'default' => null, 'collate' => 'latin1_spanish_ci', 'comment' => '', 'precision' => null],
'_constraints' => [
'primary' => ['type' => 'primary', 'columns' => ['id'], 'length' => []],
],
'_options' => [
'engine' => 'InnoDB',
'collation' => 'latin1_spanish_ci'
],
];
// @codingStandardsIgnoreEnd
/**
* Records
*
* @var array
*/
public $records = [
[
'id' => 1,
'name' => 'Lorem ipsum dolor sit amet',
'value' => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida, phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam, vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit, feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.'
],
];
}
| jimolina/bakeangular | tests/Fixture/ParametersFixture.php | PHP | mit | 1,636 | 35.355556 | 380 | 0.552567 | false |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</meta>
<meta content="width=device-width, initial-scale=1" name="viewport">
</meta>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet">
</link>
<link href="../../resources/stof-style.css" rel="stylesheet">
</link>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js">
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js">
</script>
<script src="../../resources/search.js">
</script>
<script src="../../resources/analytics.js">
</script>
</head>
<body>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button aria-expanded="false" class="navbar-toggle collapsed" data-target="#bs-example-navbar-collapse-1" data-toggle="collapse" type="button">
<span class="sr-only">
Toggle navigation
</span>
<span class="icon-bar">
</span>
<span class="icon-bar">
</span>
<span class="icon-bar">
</span>
</button>
<a class="navbar-brand" href="../../index.html">
Bob Dylan Lyrics
</a>
</div>
<div aria-expanded="false" class="navbar-collapse collapse" id="bs-example-navbar-collapse-1" style="height: 1px">
<ul class="nav navbar-nav">
<li>
<a href="../../full_lyrics_file_dumps/downloads.html">
Downloads
</a>
</li>
<li>
<a href="../../songs/song_index/song_index.html">
All Songs
</a>
</li>
<li>
<a href="../../albums/album_index/album_index.html">
All Albums
</a>
</li>
<li class="dropdown">
<a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">
1960s
<span class="caret">
</span>
</a>
<ul class="dropdown-menu">
<li>
<a class="album" href="../../albums/bob_dylan.html">
Bob Dylan (1962)
</a>
</li>
<li>
<a class="album" href="../../albums/the_freewheelin_bob_dylan.html">
The Freewheelin' Bob Dylan (1963)
</a>
</li>
<li>
<a class="album" href="../../albums/the_times_they_are_a-changin.html">
The Times They Are A-Changin' (1964)
</a>
</li>
<li>
<a class="album" href="../../albums/another_side_of_bob_dylan.html">
Another Side of Bob Dylan (1964)
</a>
</li>
<li>
<a class="album" href="../../albums/bringing_it_all_back_home.html">
Bringing It All Back Home (1965)
</a>
</li>
<li>
<a class="album" href="../../albums/highway_61_revisited.html">
Highway 61 Revisited (1965)
</a>
</li>
<li>
<a class="album" href="../../albums/blonde_on_blonde.html">
Blonde on Blonde (1966))
</a>
</li>
<li>
<a class="album" href="../../albums/bob_dylans_greatest_hits.html">
Bob Dylan's Greatest Hits (1967)
</a>
</li>
<li>
<a class="album" href="../../albums/john_wesley_harding.html">
John Wesley Harding (1967)
</a>
</li>
<li>
<a class="album" href="../../albums/nashville_skyline.html">
Nashville Skyline (1969)
</a>
</li>
</ul>
</li>
<li class="dropdown">
<a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">
1970s
<span class="caret">
</span>
</a>
<ul class="dropdown-menu">
<li>
<a class="album" href="../../albums/self_portrait.html">
Self Portrait (1970)
</a>
</li>
<li>
<a class="album" href="../../albums/new_morning.html">
New Morning (1970)
</a>
</li>
<li>
<a class="album" href="../../albums/bob_dylans_greatest_hits_vol_ii.html">
Bob Dylan's Greatest Hits, Vol. II (1971)
</a>
</li>
<li>
<a class="album" href="../../albums/pat_garrett_and_billy_the_kid.html">
Pat Garrett & Billy the Kid (1973)
</a>
</li>
<li>
<a class="album" href="../../albums/dylan.html">
Dylan (1973)
</a>
</li>
<li>
<a class="album" href="../../albums/planet_waves.html">
Planet Waves (1974)
</a>
</li>
<li>
<a class="album" href="../../albums/before_the_flood.html">
Before the Flood (1974)
</a>
</li>
<li>
<a class="album" href="../../albums/blood_on_the_tracks.html">
Blood on the Tracks (1975)
</a>
</li>
<li>
<a class="album" href="../../albums/the_basement_tapes.html">
The Basement Tapes (1975)
</a>
</li>
<li>
<a class="album" href="../../albums/desire.html">
Desire (1976)
</a>
</li>
<li>
<a class="album" href="../../albums/hard_rain.html">
Hard Rain (1976)
</a>
</li>
<li>
<a class="album" href="../../albums/street_legal.html">
Street-Legal (1978)
</a>
</li>
<li>
<a class="album" href="../../albums/bob_dylan_at_budokan.html">
Bob Dylan at Budokan (1979)
</a>
</li>
<li>
<a class="album" href="../../albums/slow_train_coming.html">
Slow Train Coming (1979)
</a>
</li>
</ul>
</li>
<li class="dropdown">
<a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">
1980s
<span class="caret">
</span>
</a>
<ul class="dropdown-menu">
<li>
<a class="album" href="../../albums/saved.html">
Saved (1980)
</a>
</li>
<li>
<a class="album" href="../../albums/shot_of_love.html">
Shot of Love (1981)
</a>
</li>
<li>
<a class="album" href="../../albums/infidels.html">
Infidels (1983)
</a>
</li>
<li>
<a class="album" href="../../albums/real_live_1.html">
Real Live (1984)
</a>
</li>
<li>
<a class="album" href="../../albums/empire_burlesque.html">
Empire Burlesque (1985)
</a>
</li>
<li>
<a class="album" href="../../albums/biograph.html">
Biograph (1985)
</a>
</li>
<li>
<a class="album" href="../../albums/knocked_out_loaded.html">
Knocked Out Loaded (1986)
</a>
</li>
<li>
<a class="album" href="../../albums/down_in_the_groove.html">
Down in the Groove (1988)
</a>
</li>
<li>
<a class="album" href="../../albums/dylan_and_the_dead.html">
Dylan & the Dead (1989)
</a>
</li>
<li>
<a class="album" href="../../albums/oh_mercy.html">
Oh Mercy (1989)
</a>
</li>
</ul>
</li>
<li class="dropdown">
<a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">
1990s
<span class="caret">
</span>
</a>
<ul class="dropdown-menu">
<li>
<a class="album" href="../../albums/under_the_red_sky.html">
Under the Red Sky (1990)
</a>
</li>
<li>
<a class="album" href="../../albums/the_bootleg_series_volumes_1-3_rare_and_unreleased_1961-1991.html">
The Bootleg Series Volumes 1-3 (Rare & Unreleased) 1961-1991 (1991)
</a>
</li>
<li>
<a class="album" href="../../albums/good_as_i_been_to_you.html">
Good As I Been to You (1992)
</a>
</li>
<li>
<a class="album" href="../../albums/world_gone_wrong.html">
World Gone Wrong (1993)
</a>
</li>
<li>
<a class="album" href="../../albums/bob_dylans_greatest_hits_volume_3.html">
Bob Dylan's Greatest Hits Volume 3 (1994)
</a>
</li>
<li>
<a class="album" href="../../albums/mtv_unplugged.html">
MTV Unplugged (1995)
</a>
</li>
<li>
<a class="album" href="../../albums/time_out_of_mind.html">
Time Out of Mind (1997)
</a>
</li>
<li>
<a class="album" href="../../albums/the_bootleg_series_vol_4_bob_dylan_live_1966.html">
The Bootleg Series Vol. 4: Bob Dylan Live 1966, The "Royal Albert Hall" Concert (1998)
</a>
</li>
</ul>
</li>
<li class="dropdown">
<a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">
2000s
<span class="caret">
</span>
</a>
<ul class="dropdown-menu">
<li>
<a class="album" href="../../albums/the_essential_bob_dylan.html">
The Essential Bob Dylan (2000)
</a>
</li>
<li>
<a class="album" href="../../albums/love_and_theft.html">
Love and Theft (2001)
</a>
</li>
<li>
<a class="album" href="../../albums/the_bootleg_series_vol_5_bob_dylan_live_1975_the_rolling_thunder_revue.html">
The Bootleg Series Vol. 5: Bob Dylan Live 1975, The Rolling Thunder Revue (2002)
</a>
</li>
<li>
<a class="album" href="../../albums/the_bootleg_series_vol_6_bob_dylan_live_1964_concert_at_philharmonic_hall.html">
The Bootleg Series Vol. 6: Bob Dylan Live 1964, Concert at Philharmonic Hall (2004)
</a>
</li>
<li>
<a class="album" href="../../albums/the_best_of_bob_dylan.html">
The Best of Bob Dylan (2005)
</a>
</li>
<li>
<a class="album" href="../../albums/modern_times.html">
Modern Times (2006)
</a>
</li>
<li>
<a class="album" href="../../albums/together_through_life.html">
Together through Life (2009)
</a>
</li>
</ul>
</li>
<li class="dropdown">
<a aria-expanded="false" aria-haspopup="true" class="dropdown-toggle" data-toggle="dropdown" href="#" role="button">
2010s
<span class="caret">
</span>
</a>
<ul class="dropdown-menu">
<li>
<a class="album" href="../../albums/tempest.html">
Tempest (2012)
</a>
</li>
</ul>
</li>
</ul>
<div class="col-md-3" style="border:0px solid;width:30%;height:auto;">
<gcse:search>
<form class="navbar-form navbar-right" role="search">
</form>
</gcse:search>
</div>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-12">
<h1>
Lay Lady Lay
</h1>
</div>
</div>
<div class="row">
<div class="col-md-12">
<p>
<div>
Lay<a href="#1"><sup>1</sup></a>, lady, lay, lay across my big brass bed,
</div>
<div>
Lay, lady, lay, lay across my big brass bed.
</div>
<div>
Whatever colors you have in your mind,
</div>
<div>
I'll show them to you and you'll see them shine.
</div>
</p>
<p>
<div>
Lay, lady, lay, lay across my big brass bed,
</div>
<div>
Forget this dance, let's go upstairs.
</div>
<div>
Let's take a chance – who really cares?
</div>
<div>
Why don't you know you got nothing to prove?
</div>
<div>
It's all in your eyes and the way that you move.
</div>
</p>
<p>
<div>
Forget this dance, let's go upstairs.
</div>
<div>
Why wait any longer for no need to complain?<a href="#2"><sup>2</sup></a>
</div>
<div>
You can have love, but you might lose it.
</div>
<div>
Why run any longer when you're running in vain?
</div>
<div>
You can have the truth, but you got to choose it.
</div>
</p>
<p>
<div>
Stay, lady, stay, stay with your man awhile,
</div>
<div>
Till the break of day let me see you make him smile.
</div>
<div>
I long to see you in the morning light,
</div>
<div>
I long to hold you in the night –
</div>
<div>
Stay, lady, stay, stay with your man awhile.
</div>
</p>
<p>
<div>
Lay, lady, lay, lay across my big brass bed.
</div>
</p>
<p>
<div>
<a name="1">
<sup>
1
</sup>
</a>
<small>
The correct verb to use would technically be "lie" (she lies, she lay, she has lain), not "lay", which is the transitive form of "lie". However, the distinction between the two forms has been increasingly disappearing in English due at least partially to the fact that the base form of the verb <i>lay</i> looks and sounds exactly the same as the simple past form of <i>lay</i>. But just because the use of <i>lay</i> in this song is technically incorrect doesn't mean that it was not intentional: it would not sound right to hear "lie, lady, lie, lie across my big brass bed" (because of the assonance) and, besides, this is how real people talk every day and there's nothing wrong with it.
</small>
</div>
<div>
<a name="2">
<sup>
2
</sup>
</a>
<small>
Here it's almost as though Dylan begins to sing the line from the original album version, "Why wait any longer for the world to begin?", before improvising about halfway through, which might explain why the line sounds sort of meaningless and inane.
</small>
</div>
</p>
</div>
</div>
</div>
</body>
</html> | mulhod/bob_dylan_lyrics | songs/html/lay_lady_lay_3.html | HTML | mit | 12,400 | 24.935146 | 699 | 0.579703 | false |
mod message_set;
use std;
use std::fmt;
use linked_hash_map::{Iter, LinkedHashMap};
use uuid::Uuid;
pub mod message;
#[derive(Debug, PartialEq)]
pub struct Message {
properties: Map,
body: Option<Value>,
}
impl Message {
pub fn new() -> MessageBuilder {
MessageBuilder::new()
}
pub fn with_property<K, V>(key: K, value: V) -> MessageBuilder
where
K: Into<String>,
V: Into<Value>,
{
MessageBuilder::new().with_property(key.into(), value.into())
}
pub fn with_body<V>(value: V) -> MessageBuilder
where
V: Into<Value>,
{
MessageBuilder::new().with_body(value.into())
}
pub fn properties(&self) -> &Map {
&self.properties
}
pub fn body(&self) -> Option<&Value> {
match self.body {
Some(ref value) => Some(value),
None => None,
}
}
}
pub struct MessageBuilder {
map: LinkedHashMap<String, Value>,
body: Option<Value>,
}
impl MessageBuilder {
pub fn new() -> MessageBuilder {
MessageBuilder {
map: LinkedHashMap::new(),
body: None,
}
}
pub fn with_property<K, V>(mut self, key: K, value: V) -> MessageBuilder
where
K: Into<String>,
V: Into<Value>,
{
self.map.insert(key.into(), value.into());
self
}
pub fn with_body<V>(mut self, value: V) -> MessageBuilder
where
V: Into<Value>,
{
self.body = Some(value.into());
self
}
pub fn build(self) -> Message {
Message {
properties: Map { map: self.map },
body: self.body,
}
}
}
#[derive(PartialEq, Clone)]
pub struct Map {
map: LinkedHashMap<String, Value>,
}
impl Map {
pub fn new() -> MapBuilder {
MapBuilder {
map: LinkedHashMap::new(),
}
}
pub fn get(&self, key: &str) -> Option<&Value> {
self.map.get(key)
}
pub fn iter(&self) -> Iter<String, Value> {
self.map.iter()
}
pub fn len(&self) -> usize {
self.map.len()
}
}
impl fmt::Debug for Map {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.map.fmt(f)
}
}
pub struct MapBuilder {
map: LinkedHashMap<String, Value>,
}
impl MapBuilder {
pub fn insert<K, V>(mut self, key: K, value: V) -> MapBuilder
where
K: Into<String>,
V: Into<Value>,
{
self.map.insert(key.into(), value.into());
self
}
pub fn build(self) -> Map {
Map { map: self.map }
}
}
#[derive(Clone, PartialEq)]
pub struct List {
list: Vec<Value>,
}
impl List {
pub fn new() -> ListBuilder {
ListBuilder { list: Vec::new() }
}
pub fn iter(&self) -> std::slice::Iter<Value> {
self.list.iter()
}
pub fn len(&self) -> usize {
self.list.len()
}
}
impl std::ops::Index<usize> for List {
type Output = Value;
fn index(&self, index: usize) -> &Self::Output {
&self.list[index]
}
}
impl fmt::Debug for List {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.list.fmt(f)
}
}
pub struct ListBuilder {
list: Vec<Value>,
}
impl ListBuilder {
pub fn append<V>(mut self, value: V) -> ListBuilder
where
V: Into<Value>,
{
self.list.push(value.into());
self
}
pub fn build(self) -> List {
List { list: self.list }
}
}
#[derive(Debug, PartialEq, Clone)]
pub enum Value {
Null,
String(String),
Int64(i64),
Int32(i32),
Float32(f32),
Float64(f64),
Boolean(bool),
Bytes(Vec<u8>),
List(List),
Map(Map),
Uuid(Uuid),
}
impl From<String> for Value {
fn from(value: String) -> Self {
Value::String(value)
}
}
impl<'a> From<&'a str> for Value {
fn from(value: &'a str) -> Self {
Value::String(value.to_string())
}
}
impl From<i64> for Value {
fn from(value: i64) -> Self {
Value::Int64(value)
}
}
impl From<i32> for Value {
fn from(value: i32) -> Self {
Value::Int32(value)
}
}
impl From<f64> for Value {
fn from(value: f64) -> Self {
Value::Float64(value)
}
}
impl From<bool> for Value {
fn from(value: bool) -> Self {
Value::Boolean(value)
}
}
impl From<Vec<u8>> for Value {
fn from(value: Vec<u8>) -> Self {
Value::Bytes(value)
}
}
impl From<List> for Value {
fn from(value: List) -> Self {
Value::List(value)
}
}
impl From<Map> for Value {
fn from(value: Map) -> Self {
Value::Map(value)
}
}
impl From<Uuid> for Value {
fn from(value: Uuid) -> Self {
Value::Uuid(value)
}
}
pub trait MessageVisitor {
type Output;
fn visit_message(&self, value: &Message, buffer: &mut Self::Output);
fn visit_map(&self, value: &Map, buffer: &mut Self::Output);
fn visit_list(&self, value: &List, buffer: &mut Self::Output);
fn visit_value(&self, value: &Value, buffer: &mut Self::Output);
fn visit_bytes(&self, value: &Vec<u8>, buffer: &mut Self::Output);
fn visit_int32(&self, value: i32, buffer: &mut Self::Output);
fn visit_int64(&self, value: i64, buffer: &mut Self::Output);
fn visit_float32(&self, value: f32, buffer: &mut Self::Output);
fn visit_float64(&self, value: f64, buffer: &mut Self::Output);
fn visit_boolean(&self, _value: bool, _buffer: &mut Self::Output);
fn visit_string(&self, _value: &String, _buffer: &mut Self::Output);
fn visit_uuid(&self, value: &Uuid, buffer: &mut Self::Output);
fn visit_null(&self, _buffer: &mut Self::Output);
}
pub struct BinaryFormatSizeCalculator {}
impl MessageVisitor for BinaryFormatSizeCalculator {
type Output = usize;
fn visit_message(&self, message: &Message, buffer: &mut Self::Output) {
*buffer += 4;
for (key, value) in message.properties().iter() {
self.visit_string(key, buffer);
self.visit_value(value, buffer);
}
if let Some(value) = message.body() {
self.visit_value(value, buffer);
}
}
fn visit_map(&self, map: &Map, buffer: &mut Self::Output) {
*buffer += map.len();
for (key, value) in map.iter() {
self.visit_string(key, buffer);
self.visit_value(value, buffer);
}
}
fn visit_list(&self, list: &List, buffer: &mut Self::Output) {
*buffer += list.len();
for value in list.iter() {
self.visit_value(value, buffer);
}
}
fn visit_value(&self, value: &Value, buffer: &mut Self::Output) {
*buffer += 1;
match value {
&Value::Null => self.visit_null(buffer),
&Value::String(ref value) => {
self.visit_string(value, buffer);
}
&Value::Int32(value) => {
self.visit_int32(value, buffer);
}
&Value::Int64(value) => {
self.visit_int64(value, buffer);
}
&Value::Float32(value) => {
self.visit_float32(value, buffer);
}
&Value::Float64(value) => {
self.visit_float64(value, buffer);
}
&Value::Boolean(value) => {
self.visit_boolean(value, buffer);
}
&Value::Bytes(ref value) => {
self.visit_bytes(value, buffer);
}
&Value::Map(ref value) => {
self.visit_map(value, buffer);
}
&Value::List(ref value) => {
self.visit_list(value, buffer);
}
&Value::Uuid(ref value) => {
self.visit_uuid(value, buffer);
}
}
}
fn visit_bytes(&self, value: &Vec<u8>, buffer: &mut Self::Output) {
*buffer += 4 + value.len()
}
fn visit_int32(&self, _value: i32, buffer: &mut Self::Output) {
*buffer += 4;
}
fn visit_int64(&self, _value: i64, buffer: &mut Self::Output) {
*buffer += 8;
}
fn visit_float32(&self, _value: f32, buffer: &mut Self::Output) {
*buffer += 4;
}
fn visit_float64(&self, _value: f64, buffer: &mut Self::Output) {
*buffer += 8;
}
fn visit_boolean(&self, _value: bool, buffer: &mut Self::Output) {
*buffer += 1;
}
fn visit_string(&self, value: &String, buffer: &mut Self::Output) {
*buffer += 4 + value.len()
}
fn visit_uuid(&self, _value: &Uuid, buffer: &mut Self::Output) {
*buffer += 16
}
fn visit_null(&self, _buffer: &mut Self::Output) {}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let message = Message::new()
.with_body("Hello")
.with_property(
"vehicles",
List::new().append("Aprilia").append("Infiniti").build(),
)
.with_property(
"address",
Map::new()
.insert("street", "400 Beale ST")
.insert("city", "San Francisco")
.insert("state", "CA")
.insert("zip", "94105")
.build(),
)
.build();
println!("message = {:?}", message);
let message = Message::new()
.with_body("Wicked!!")
.with_property("Hello", "World!")
.with_property("age", 42)
.with_property("weight", 175.5)
.with_property("address", "400 Beale ST APT 1403")
.with_property("city", "San Francisco")
.with_property("state", "CA")
.with_property("zip", "94105")
.with_property("married", false)
.build();
println!("message = {:?}", &message);
}
#[test]
fn get_property_value() {
let m = Message::with_property("msg", "World!").build();
assert_eq!(m.properties().get("msg"), Some(&Value::from("World!")));
assert_eq!(m.properties().get("missing"), None);
if let Some(&Value::String(ref value)) = m.properties().get("msg") {
println!("value = {:?}", value);
}
assert_eq!(m.body(), None);
}
#[test]
fn map_as_body() {
let m = Message::with_body(
Map::new()
.insert("fname", "Jimmie")
.insert("lname", "Fulton")
.build(),
).build();
println!("message = {:?}", &m);
match m.body() {
Some(&Value::Map(ref map)) => {
assert_eq!(map.get("fname"), Some(&Value::from("Jimmie")));
assert_eq!(map.get("lname"), Some(&Value::from("Fulton")));
}
_ => panic!("Map expected!"),
}
}
#[test]
fn list_index() {
let l = List::new()
.append("one")
.append("two")
.append("three")
.build();
assert_eq!(l[0], Value::from("one"));
}
#[test]
fn map_iterator() {
let map = Map::new()
.insert("key1", "value1")
.insert("key2", "value2")
.build();
let mut counter = 0;
for (_key, _value) in map.iter() {
counter += 1;
}
assert_eq!(counter, 2);
eprintln!("message = {:?}", map);
}
#[test]
pub fn examples() {}
#[test]
fn binary_size_calulator() {
let calculator = BinaryFormatSizeCalculator {};
let message = Message::with_body("Hello").build();
let mut size = 0;
calculator.visit_message(&message, &mut size);
assert_eq!(size, 14);
}
#[test]
fn binary_size_calcuator_2() {
let calculator = BinaryFormatSizeCalculator {};
let message = example();
let mut size = 0;
calculator.visit_message(&message, &mut size);
eprintln!("size = {:?}", size);
}
fn example() -> Message {
Message::new()
.with_property("fname", "Jimmie")
.with_property("lname", "Fulton")
.with_property("age", 42)
.with_property("temp", 98.6)
.with_property(
"vehicles",
List::new().append("Aprilia").append("Infiniti").build(),
)
.with_property(
"siblings",
Map::new()
.insert("brothers", List::new().append("Jason").build())
.insert(
"sisters",
List::new().append("Laura").append("Sariah").build(),
)
.build(),
)
.build()
}
}
| heil-hydra/hydramq | src/message/mod.rs | Rust | mit | 12,795 | 22.871269 | 77 | 0.498085 | false |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Typeset.Domain.Configuration
{
public interface IConfigurationRepository
{
IConfiguration Read(string path);
}
}
| typeset/typeset | Typeset.Domain.Configuration/IConfigurationRepository.cs | C# | mit | 233 | 18.25 | 45 | 0.744589 | false |
'use strict';
// Projects controller
angular.module('about').controller('AboutUsController', ['$scope', '$stateParams', '$state', '$location', 'Authentication',
function($scope, $stateParams, $state, $location, Authentication) {
$scope.authentication = Authentication;
}
]);
| spiridonov-oa/people-ma | public/modules/about/controllers/about.client.controller.js | JavaScript | mit | 281 | 30.222222 | 123 | 0.708185 | false |
<?php
/**
* AbstractField class file
*/
namespace Graviton\DocumentBundle\DependencyInjection\Compiler\Utils;
/**
* Base document field
*
* @author List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
* @license https://opensource.org/licenses/MIT MIT License
* @link http://swisscom.ch
*/
class AbstractField
{
/**
* @var string
*/
private $fieldName;
/**
* @var string
*/
private $exposedName;
/**
* @var bool
*/
private $readOnly;
/**
* @var bool
*/
private $required;
/**
* @var bool
*/
private $searchable;
/**
* @var bool
*/
private $recordOriginException;
/**
* Constructor
*
* @param string $fieldName Field name
* @param string $exposedName Exposed name
* @param bool $readOnly Read only
* @param bool $required Is required
* @param bool $searchable Is searchable
* @param bool $recordOriginException Is an exception to record origin
*/
public function __construct(
$fieldName,
$exposedName,
$readOnly,
$required,
$searchable,
$recordOriginException
) {
$this->fieldName = $fieldName;
$this->exposedName = $exposedName;
$this->readOnly = $readOnly;
$this->required = $required;
$this->searchable = $searchable;
$this->recordOriginException = $recordOriginException;
}
/**
* Get field name
*
* @return string
*/
public function getFieldName()
{
return $this->fieldName;
}
/**
* Get exposed name
*
* @return string
*/
public function getExposedName()
{
return $this->exposedName;
}
/**
* Is read only
*
* @return bool
*/
public function isReadOnly()
{
return $this->readOnly;
}
/**
* Is required
*
* @return bool
*/
public function isRequired()
{
return $this->required;
}
/**
* Is searchable
*
* @return boolean
*/
public function isSearchable()
{
return $this->searchable;
}
/**
* @param boolean $searchable Is searchable
*
* @return void
*/
public function setSearchable($searchable)
{
$this->searchable = $searchable;
}
/**
* get RecordOriginException
*
* @return boolean RecordOriginException
*/
public function isRecordOriginException()
{
return $this->recordOriginException;
}
/**
* set RecordOriginException
*
* @param boolean $recordOriginException recordOriginException
*
* @return void
*/
public function setRecordOriginException($recordOriginException)
{
$this->recordOriginException = $recordOriginException;
}
}
| libgraviton/graviton | src/Graviton/DocumentBundle/DependencyInjection/Compiler/Utils/AbstractField.php | PHP | mit | 2,983 | 19.020134 | 95 | 0.550117 | false |
-- MySQL dump 10.13 Distrib 5.5.49, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: warmup
-- ------------------------------------------------------
-- Server version 5.5.49-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `add_member`
--
DROP TABLE IF EXISTS `add_member`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `add_member` (
`POWON_id` int(11) NOT NULL,
`group_id` int(11) NOT NULL,
PRIMARY KEY (`POWON_id`,`group_id`),
KEY `group_id_idx` (`group_id`),
CONSTRAINT `group_id` FOREIGN KEY (`group_id`) REFERENCES `group` (`group_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `POWON_id` FOREIGN KEY (`POWON_id`) REFERENCES `member` (`POWON_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `add_member`
--
LOCK TABLES `add_member` WRITE;
/*!40000 ALTER TABLE `add_member` DISABLE KEYS */;
/*!40000 ALTER TABLE `add_member` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `group`
--
DROP TABLE IF EXISTS `group`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `group` (
`group_id` int(11) NOT NULL AUTO_INCREMENT,
`group_name` varchar(45) NOT NULL,
`POWON_id` int(11) NOT NULL,
PRIMARY KEY (`group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `group`
--
LOCK TABLES `group` WRITE;
/*!40000 ALTER TABLE `group` DISABLE KEYS */;
/*!40000 ALTER TABLE `group` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `interest`
--
DROP TABLE IF EXISTS `interest`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `interest` (
`interest_id` int(11) NOT NULL AUTO_INCREMENT,
`interest_name` varchar(45) NOT NULL,
PRIMARY KEY (`interest_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `interest`
--
LOCK TABLES `interest` WRITE;
/*!40000 ALTER TABLE `interest` DISABLE KEYS */;
/*!40000 ALTER TABLE `interest` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `member`
--
DROP TABLE IF EXISTS `member`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `member` (
`POWON_id` int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`lastname` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`user_name` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`address` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
`dob` year(4) NOT NULL,
`city` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
`email` varchar(30) COLLATE utf8_unicode_ci NOT NULL,
`member_status` tinyint(1) DEFAULT '0',
`fee_membership` tinyint(1) DEFAULT '0',
PRIMARY KEY (`POWON_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `member`
--
LOCK TABLES `member` WRITE;
/*!40000 ALTER TABLE `member` DISABLE KEYS */;
/*!40000 ALTER TABLE `member` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `member_interest`
--
DROP TABLE IF EXISTS `member_interest`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `member_interest` (
`POWON_id` int(11) NOT NULL,
`interest_id` int(11) NOT NULL,
PRIMARY KEY (`POWON_id`,`interest_id`),
KEY `interest_id_idx` (`interest_id`),
CONSTRAINT `member_interest_ibfk_1` FOREIGN KEY (`POWON_id`) REFERENCES `member` (`POWON_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
CONSTRAINT `member_interest_ibfk_2` FOREIGN KEY (`interest_id`) REFERENCES `interest` (`interest_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `member_interest`
--
LOCK TABLES `member_interest` WRITE;
/*!40000 ALTER TABLE `member_interest` DISABLE KEYS */;
/*!40000 ALTER TABLE `member_interest` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `name`
--
DROP TABLE IF EXISTS `name`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `name` (
`id` int(6) unsigned NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `name`
--
LOCK TABLES `name` WRITE;
/*!40000 ALTER TABLE `name` DISABLE KEYS */;
/*!40000 ALTER TABLE `name` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-07-13 22:32:20
| layheng/pog | doc/warmup.sql | SQL | mit | 6,079 | 32.772222 | 143 | 0.683501 | false |
<?php
namespace Abe\FileUploadBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Abe\FileUploadBundle\Entity\Document;
use Abe\FileUploadBundle\Form\DocumentType;
/**
* user2 controller.
*
* @Route("/main/upload")
*/
class UploadController extends Controller
{
/**
* creates the form to uplaod a file with the Documetn entity entities.
*
* @Route("/new", name="main_upload_file")
* @Method("GET")
* @Template()
*/
public function uploadAction()
{
$entity = new Document();
$form = $this->createUploadForm($entity);
return array(
'entity' => $entity,
'form' => $form->createView(),
);
}
/**
* @Template()
* @Route("/", name="main_upload")
* @Method("POST")
*/
public function uploadFileAction(Request $request)
{
return $this->redirect($this->generateUrl('homepage'));
$document = new Document();
$form = $this->createUploadForm($document);
$form->handleRequest($request);
$test = $form->getErrors();
//if ($this->getRequest()->getMethod() === 'POST') {
// $form->bindRequest($this->getRequest());
if ($form->isSubmitted()) {
$fileinfomation = $form->getData();
exit(\Doctrine\Common\Util\Debug::dump($test));
$em = $this->getDoctrine()->getEntityManager();
$document->upload();
$em->persist($document);
$em->flush();
return $this->redirect($this->generateUrl('homepage'));
}
//}
return array(
'form' => $form->createView(),
'entity' =>$document,
);
}
/**
* Creates a form to create a Document entity.
*
* @param Document $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createUploadForm(Document $entity)
{
$form = $this->createForm(new DocumentType(), $entity, array(
'action' => $this->generateUrl('document_create'),
'method' => 'POST',
));
$form->add('submit', 'button', array('label' => 'Upload'));
return $form;
}
public function upload()
{
// the file property can be empty if the field is not required
if (null === $this->getFile()) {
return;
}
// use the original file name here but you should
// sanitize it at least to avoid any security issues
// move takes the target directory and then the
// target filename to move to
$this->getFile()->move(
$this->getUploadRootDir(),
$this->getFile()->getClientOriginalName()
);
// set the path property to the filename where you've saved the file
$this->path = $this->getFile()->getClientOriginalName();
// clean up the file property as you won't need it anymore
$this->file = null;
}
/**
* @Template()
* @Route("/", name="main_uploadfile")
* @Method("POST")
*/
public function uploadFileAction2(Request $request)
{
$document = new Document();
$test = $form->getErrors();
if(2) {
$fileinfomation = $form->getData();
$em = $this->getDoctrine()->getEntityManager();
$document->upload();
$em->persist($document);
$em->flush();
return $this->redirect($this->generateUrl('homepage'));
}
}
}
| Dabea/BasicLogin | src/Abe/FileUploadBundle/Controller/UploadController.php | PHP | mit | 3,780 | 25.068966 | 75 | 0.566138 | false |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- 選舉資料查詢 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>中選會選舉資料庫網站</title>
<link rel="stylesheet" type="text/css" href="http://db.cec.gov.tw/votehist.css">
<script type="text/javascript">
function AddToFaves_hp() {
var is_4up = parseInt(navigator.appVersion);
var is_mac = navigator.userAgent.toLowerCase().indexOf("mac")!=-1;
var is_ie = navigator.userAgent.toLowerCase().indexOf("msie")!=-1;
var thePage = location.href;
if (thePage.lastIndexOf('#')!=-1)
thePage = thePage.substring(0,thePage.lastIndexOf('#'));
if (is_ie && is_4up && !is_mac)
window.external.AddFavorite(thePage,document.title);
else if (is_ie || document.images)
booker_hp = window.open(thePage,'booker_','menubar,width=325,height=100,left=140,top=60');
//booker_hp.focus();
}
</script>
</head>
<body class="frame">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- 標題:選舉資料庫網站 -->
<div style="width: 100%; height: 56px; margin: 0px 0px 0px 0px; border-style: solid; border-width: 0px 0px 1px 0px; border-color: black;">
<div style="float: left;">
<img src="http://db.cec.gov.tw/images/main_title.gif" />
</div>
<div style="width: 100%; height: 48px;">
<div style="text-align: center;">
<img src="http://db.cec.gov.tw/images/small_ghost.gif" /> <span
style="height: 30px; font-size: 20px;"> <a href="http://www.cec.gov.tw"
style="text-decoration: none;">回中選會網站</a>
</span>
</div>
</div>
<div style="width: 100%; height: 8px; background-color: #fde501;">
</div>
</div>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- 頁籤 -->
<div
style="width: 100%; height: 29px; background-image: url('http://db.cec.gov.tw/images/tab_background.gif'); background-repeat: repeat-x;">
<div style="text-align: center;">
<a href="histMain.jsp"><img border="0" src="http://db.cec.gov.tw/images/tab_01.gif" /></a>
<a href="histCand.jsp"><img border="0" src="http://db.cec.gov.tw/images/tab_02.gif" /></a>
<!-- <a href=""><img border="0" src="images/tab_03.gif" /></a> -->
<!-- <a href=""><img border="0" src="images/tab_04.gif" /></a> -->
<a href="histQuery.jsp?voteCode=20120101T1A2&qryType=ctks&prvCode=05&cityCode=000&areaCode=06&deptCode=032&liCode=0587#"><img border="0" src="http://db.cec.gov.tw/images/tab_05.gif" onClick="AddToFaves_hp()" /></a>
<a href="mailto:info@cec.gov.tw;ytlin@cec.gov.tw"><img border="0" src="http://db.cec.gov.tw/images/tab_06.gif" /></a>
</div>
</div>
<div
style="width: 100%; height: 22px; background-image: url('http://db.cec.gov.tw/images/tab_separator.gif'); background-repeat: repeat-x;">
</div>
<div class="query">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- 子頁面:查詢候選人得票數 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- 標題 -->
<div class="titlebox">
<div class="title">
<div class="head">第 08 屆 立法委員選舉(區域) 候選人得票數</div>
<div class="date">投票日期:中華民國101年01月14日</div>
<div class="separator"></div>
</div>
</div>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- 查詢:候選人得票數,縣市多選區,如區域立委 -->
<link rel="stylesheet" type="text/css" href="http://db.cec.gov.tw/qryCtks.css" />
<!-- 投開票所表頭 -->
<table class="ctks" width="950" height="22" border=1 cellpadding="0" cellspacing="0" >
<tr class="title">
<td nowrap align="center">地區</td>
<td nowrap align="center">姓名</td>
<td nowrap align="center">號次</td>
<td nowrap align="center">得票數</td>
<td nowrap align="center">得票率</td>
</tr>
<!-- 投開票所內容 -->
<tr class="data">
<td nowrap rowspan=2 align=center>高雄市第06選區三民區灣勝里第1156投開票所</td>
<td nowrap align="center">侯彩鳳</td>
<td nowrap align="center">1</td>
<td nowrap align="right">301</td>
<td nowrap align="right"> 40.95%</td>
</tr>
<!-- 投開票所內容 -->
<tr class="data">
<td nowrap align="center">李昆澤</td>
<td nowrap align="center">2</td>
<td nowrap align="right">434</td>
<td nowrap align="right"> 59.04%</td>
</tr>
<!-- 投開票所內容 -->
<tr class="data">
<td nowrap rowspan=2 align=center>高雄市第06選區三民區灣勝里第1157投開票所</td>
<td nowrap align="center">侯彩鳳</td>
<td nowrap align="center">1</td>
<td nowrap align="right">277</td>
<td nowrap align="right"> 36.83%</td>
</tr>
<!-- 投開票所內容 -->
<tr class="data">
<td nowrap align="center">李昆澤</td>
<td nowrap align="center">2</td>
<td nowrap align="right">475</td>
<td nowrap align="right"> 63.16%</td>
</tr>
</table>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<div style="width: 100%; height: 20px; margin: 30px 0px 0px 0px; text-align: center; ">
<span>
<img src="http://db.cec.gov.tw/images/leave_arrow_left.gif" />
</span>
<span style="margin: 0px 10px 0px 10px; ">
<a style="text-decoration: none; font-size: 15px; " href="histPrint">下載</a>
</span>
<span>
<img src="http://db.cec.gov.tw/images/leave_arrow_right.gif" />
</span>
<span style="margin-right: 100px;"> </span>
<span>
<img src="http://db.cec.gov.tw/images/leave_arrow_left.gif" />
</span>
<span style="margin: 0px 10px 0px 10px; ">
<a style="text-decoration: none; font-size: 15px; " href="histMain.jsp">離開</a>
</span>
<span>
<img src="http://db.cec.gov.tw/images/leave_arrow_right.gif" />
</span>
</div>
</div>
</body>
</html> | g0v/projectV | mirror/prvCode_07/cityCode_000-areaCode_06-deptCode_032/voteCode_20120101T1A2-qryType_ctks-prvCode_05-cityCode_000-areaCode_06-deptCode_032-liCode_0587.html | HTML | mit | 6,086 | 29.837838 | 240 | 0.635694 | false |
import { Dimensions, PixelRatio } from 'react-native';
const Utils = {
ratio: PixelRatio.get(),
pixel: 1 / PixelRatio.get(),
size: {
width: Dimensions.get('window').width,
height: Dimensions.get('window').height,
},
post(url, data, callback) {
const fetchOptions = {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
};
fetch(url, fetchOptions)
.then(response => {
response.json();
})
.then(responseData => {
callback(responseData);
});
},
};
export default Utils;
| zhiyuanMA/ReactNativeShowcase | components/utils.js | JavaScript | mit | 765 | 23.677419 | 54 | 0.484967 | false |
import re
from setuptools import setup
def find_version(filename):
_version_re = re.compile(r"__version__ = '(.*)'")
for line in open(filename):
version_match = _version_re.match(line)
if version_match:
return version_match.group(1)
__version__ = find_version('librdflib/__init__.py')
with open('README.md', 'rt') as f:
long_description = f.read()
tests_require = ['pytest']
setup(
name='librdflib',
version=__version__,
description='librdf parser for rdflib',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/tgbugs/pyontutils/tree/master/librdflib',
author='Tom Gillespie',
author_email='tgbugs@gmail.com',
license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
],
keywords='rdflib librdf rdf parser parsing ttl rdfxml',
packages=['librdflib'],
python_requires='>=3',
tests_require=tests_require,
install_requires=[
'rdflib', # really 5.0.0 if my changes go in but dev < 5
],
extras_require={'dev': ['pytest-cov', 'wheel'],
'test': tests_require,
},
entry_points={
'rdf.plugins.parser': [
'librdfxml = librdflib:libRdfxmlParser',
'libttl = librdflib:libTurtleParser',
],
},
)
| tgbugs/pyontutils | librdflib/setup.py | Python | mit | 1,448 | 27.96 | 69 | 0.604972 | false |
---
---
<!doctype html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Photo - A History of UCSF</title>
<link href='https://fonts.googleapis.com/css?family=Gilda+Display%7CPT+Sans+Narrow:300' rel='stylesheet' type='text/css'>
<link href="ucsf_history.css" rel="stylesheet" type="text/css" media="all" />
{% include google_analytics.html %}
</head>
<body>
<div id="mainbody">
{% include ucsf_banner.html %}
<div class="banner"><h1><a href="/">A History of UCSF</a></h1></div>
<div id="insidebody">
<div id="photocopy">
<div id="photocopy_text"><h2 class="title"><span class="title-primary">Photos</span></h2><br />
<div id="subhead">Robert A. “Bob” Derzon </div>
<br />
<img src="images/pictures/derzon.jpg"/><br/>
<br/><br/>
</div>
</div>
<div id="sidebar">
<div id="sidenav_inside">{% include search_include.html %}<br />
<div id="sidenavtype">
<a href="story.html" class="sidenavtype"><strong>THE STORY</strong></a><br/>
<br/>
<a href="special_topics.html" class="sidenavtype"><strong>SPECIAL TOPICS</strong></a><br/><br/>
<a href="people.html" class="sidenavtype"><strong>PEOPLE</strong></a><br/>
<br/>
<div id="sidenav_subnav_header"><strong><a href="photos.html" class="sidenav_subnav_type_visited">PHOTOS</a></strong></div>
<br/>
<a href="buildings.html" class="sidenavtype"><strong>BUILDINGS</strong></a><br/>
<br/>
<a href="index.html" class="sidenavtype"><strong>HOME</strong></a><br/>
</div>
</div>
</div>
</div>
{% include footer.html %}
</div>
{% include bottom_js.html %}
</body>
</html>
| ucsf-ckm/ucsf-history-website | theme_photo21.html | HTML | mit | 1,709 | 33.795918 | 125 | 0.653959 | false |
using Humanizer.Localisation;
using Xunit;
using Xunit.Extensions;
namespace Humanizer.Tests.Localisation.ptBR
{
public class DateHumanizeTests : AmbientCulture
{
public DateHumanizeTests() : base("pt-BR") { }
[Theory]
[InlineData(-2, "2 segundos atrás")]
[InlineData(-1, "um segundo atrás")]
public void SecondsAgo(int seconds, string expected)
{
DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Past);
}
[Theory]
[InlineData(1, "em um segundo")]
[InlineData(2, "em 2 segundos")]
public void SecondsFromNow(int seconds, string expected)
{
DateHumanize.Verify(expected, seconds, TimeUnit.Second, Tense.Future);
}
[Theory]
[InlineData(-2, "2 minutos atrás")]
[InlineData(-1, "um minuto atrás")]
public void MinutesAgo(int minutes, string expected)
{
DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Past);
}
[Theory]
[InlineData(1, "em um minuto")]
[InlineData(2, "em 2 minutos")]
public void MinutesFromNow(int minutes, string expected)
{
DateHumanize.Verify(expected, minutes, TimeUnit.Minute, Tense.Future);
}
[Theory]
[InlineData(-2, "2 horas atrás")]
[InlineData(-1, "uma hora atrás")]
public void HoursAgo(int hours, string expected)
{
DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Past);
}
[Theory]
[InlineData(1, "em uma hora")]
[InlineData(2, "em 2 horas")]
public void HoursFromNow(int hours, string expected)
{
DateHumanize.Verify(expected, hours, TimeUnit.Hour, Tense.Future);
}
[Theory]
[InlineData(-2, "2 dias atrás")]
[InlineData(-1, "ontem")]
public void DaysAgo(int days, string expected)
{
DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Past);
}
[Theory]
[InlineData(1, "amanhã")]
[InlineData(2, "em 2 dias")]
public void DaysFromNow(int days, string expected)
{
DateHumanize.Verify(expected, days, TimeUnit.Day, Tense.Future);
}
[Theory]
[InlineData(-2, "2 meses atrás")]
[InlineData(-1, "um mês atrás")]
public void MonthsAgo(int months, string expected)
{
DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Past);
}
[Theory]
[InlineData(1, "em um mês")]
[InlineData(2, "em 2 meses")]
public void MonthsFromNow(int months, string expected)
{
DateHumanize.Verify(expected, months, TimeUnit.Month, Tense.Future);
}
[Theory]
[InlineData(-2, "2 anos atrás")]
[InlineData(-1, "um ano atrás")]
public void YearsAgo(int years, string expected)
{
DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Past);
}
[Theory]
[InlineData(1, "em um ano")]
[InlineData(2, "em 2 anos")]
public void YearsFromNow(int years, string expected)
{
DateHumanize.Verify(expected, years, TimeUnit.Year, Tense.Future);
}
[Fact]
public void Now()
{
DateHumanize.Verify("agora", 0, TimeUnit.Day, Tense.Future);
}
}
}
| hhariri/Humanizer | src/Humanizer.Tests/Localisation/pt-BR/DateHumanizeTests.cs | C# | mit | 3,481 | 29.663717 | 82 | 0.569408 | false |
package com.github.aselab.activerecord
import scala.language.experimental.macros
import scala.reflect.macros._
trait Deprecations {
def unsupportedInTransaction[A](c: Context)(a: c.Expr[A]): c.Expr[A] = {
import c.universe._
c.error(c.enclosingPosition, "dsl#inTransaction is deprecated. use ActiveRecordCompanion#inTransaction instead.")
reify(a.splice)
}
}
| xdougx/scala-activerecord | macro/src/main/scala/Deprecations.scala | Scala | mit | 377 | 30.416667 | 117 | 0.753316 | false |
<div class="form main-form" ng-controller="AuthCtrl" ng-class="($state.is('auth.register')) ? 'register-form' : ''">
<div class="row login-form__left" ui-view></div>
</div>
| hdl881127/mean_io | packages/core/users/public/views/index.html | HTML | mit | 177 | 58 | 116 | 0.644068 | false |
"""This module contains examples of the op() function
where:
op(f,x) returns a stream where x is a stream, and f
is an operator on lists, i.e., f is a function from
a list to a list. These lists are of lists of arbitrary
objects other than streams and agents.
Function f must be stateless, i.e., for any lists u, v:
f(u.extend(v)) = f(u).extend(f(v))
(Stateful functions are given in OpStateful.py with
examples in ExamplesOpWithState.py.)
Let f be a stateless operator on lists and let x be a stream.
If at some point, the value of stream x is a list u then at
that point, the value of stream op(f,x) is the list f(u).
If at a later point, the value of stream x is the list:
u.extend(v) then, at that point the value of stream op(f,x)
is f(u).extend(f(v)).
As a specific example, consider the following f():
def f(lst): return [w * w for w in lst]
If at some point in time, the value of x is [3, 7],
then at that point the value of op(f,x) is f([3, 7])
or [9, 49]. If at a later point, the value of x is
[3, 7, 0, 11, 5] then the value of op(f,x) at that point
is f([3, 7, 0, 11, 5]) or [9, 49, 0, 121, 25].
"""
if __name__ == '__main__':
if __package__ is None:
import sys
from os import path
sys.path.append( path.dirname( path.dirname( path.abspath(__file__) ) ) )
from Agent import *
from ListOperators import *
from PrintFunctions import print_streams_recent
def example_1():
print "example_1"
print "op(f, x): f is a function from a list to a list"
print "x is a stream \n"
# FUNCTIONS FROM LIST TO LIST
# This example uses the following list operators:
# functions from a list to a list.
# f, g, h, r
# Example A: function using list comprehension
def f(lst): return [w*w for w in lst]
# Example B: function using filter
threshold = 6
def predicate(w):
return w > threshold
def g(lst):
return filter(predicate, lst)
# Example C: function using map
# Raise each element of the list to the n-th power.
n = 3
def power(w):
return w**n
def h(lst):
return map(power, lst)
# Example D: function using another list comprehension
# Discard any element of x that is not a
# multiple of a parameter n, and divide the
# elements that are multiples of n by n.
n = 3
def r(lst):
result = []
for w in lst:
if w%n == 0: result.append(w/n)
return result
# EXAMPLES OF OPERATIONS ON STREAMS
# The input stream for these examples
x = Stream('x')
print 'x is the input stream.'
print 'a is a stream consisting of the squares of the input'
print 'b is the stream consisting of values that exceed 6'
print 'c is the stream consisting of the third powers of the input'
print 'd is the stream consisting of values that are multiples of 3 divided by 3'
print 'newa is the same as a. It is defined in a more succinct fashion.'
print 'newb has squares that exceed 6.'
print ''
# The output streams a, b, c, d obtained by
# applying the list operators f, g, h, r to
# stream x.
a = op(f, x)
b = op(g, x)
c = op(h, x)
d = op(r, x)
# You can also define a function only on streams.
# You can do this using functools in Python or
# by simple encapsulation as shown below.
def F(x): return op(f,x)
def G(x): return op(g,x)
newa = F(x)
newb = G(F(x))
# The advantage is that F is a function only
# of streams. So, function composition looks cleaner
# as in G(F(x))
# Name the output streams to label the output
# so that reading the output is easier.
a.set_name('a')
newa.set_name('newa')
b.set_name('b')
newb.set_name('newb')
c.set_name('c')
d.set_name('d')
# At this point x is the empty stream:
# its value is []
x.extend([3, 7])
# Now the value of x is [3, 7]
print "FIRST STEP"
print_streams_recent([x, a, b, c, d, newa, newb])
print ""
x.extend([0, 11, 15])
# Now the value of x is [3, 7, 0, 11, 15]
print "SECOND STEP"
print_streams_recent([x, a, b, c, d, newa, newb])
def main():
example_1()
if __name__ == '__main__':
main()
| zatricion/Streams | ExamplesElementaryOperations/ExamplesOpNoState.py | Python | mit | 4,241 | 28.657343 | 85 | 0.623438 | false |
<?php
/*
* This file is part of the Black package.
*
* (c) Alexandre Balmes <albalmes@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Black\Bundle\MenuBundle\Model;
/**
* Class MenuInterface
*
* @package Black\Bundle\MenuBundle\Model
* @author Alexandre Balmes <albalmes@gmail.com>
* @license http://opensource.org/licenses/mit-license.php MIT
*/
interface MenuInterface
{
/**
* @return mixed
*/
public function getId();
/**
* @return mixed
*/
public function getName();
/**
* @return mixed
*/
public function getSlug();
/**
* @return mixed
*/
public function getDescription();
/**
* @return mixed
*/
public function getItems();
}
| pocky/MenuBundle | Model/MenuInterface.php | PHP | mit | 845 | 16.978723 | 74 | 0.621302 | false |
{% extends 'base.html' %}
{% load staticfiles %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-lg-9">
<div class="post-header">
<h2>{{page.page_title}}</h2>
</div>
{% if page.image %}
<div class="video-wrapper">
<img class="img-responsive" src="/static/media/{{page.image}}" alt="{{page.title}}">
</div>
{% endif %}
<div class="page-body">
{{page.body|safe}}
</div>
<div class="page-share">
<a href="https://www.facebook.com/profile.php?id=100012050839136" target="_blank"><span class="share-box"><i class="fa fa-facebook"></i></span></a>
<a href="https://www.instagram.com/theamateuravantgarde/" target="_blank"><span class="share-box"><i class="fa fa-instagram"></i></span></a>
<a href="https://twitter.com/Eleni_Zouliami" target="_blank"><span class="share-box"><i class="fa fa-twitter"></i></span></a>
</div>
</div>
<div class="col-lg-3 custom-sidebar">
{% if page.image %}
<div class="col-md-6">
<div class="video-wrapper">
<img src="/media/{{page.image}}" alt="{{page.title}}">
</div>
</div>
{% endif %}
{% include "sidebar.html" %}
</div>
</div>
</div>
{% endblock content %}
| GoWebyCMS/goweby-core-dev | pages/templates/page/page_detail.html | HTML | mit | 1,375 | 31.738095 | 157 | 0.518545 | false |
#ifndef LIBFEEDKIT_CONSTANTS_H
#define LIBFEEDKIT_CONSTANTS_H
#include <String.h>
#include <vector>
namespace FeedKit {
class Channel;
class Content;
class Enclosure;
class Feed;
class Item;
extern const char *ServerSignature;
typedef std::vector<BString> uuid_list_t;
typedef std::vector<Content *> content_list_t;
typedef std::vector<Channel *> channel_list_t;
typedef std::vector<Enclosure *> enclosure_list_t;
typedef std::vector<Feed *> feed_list_t;
typedef std::vector<Item *> item_list_t;
namespace FromServer {
enum msg_what {
SettingsUpdated = 'rfsu', // Settings have been updated
};
};
namespace ErrorCode {
enum code {
UnableToParseFeed = 'ecpf', // Unable to parse the Feed
InvalidItem = 'ecii', // Invalid Item
InvalidEnclosure = 'ecie', // Invalid Enclosure
InvalidEnclosurePath = 'ecip', // Invalid Enclosure path
UnableToStartDownload = 'ecsd', // Unable to start downloading the Enclosure
};
};
// The Settings namespace details things relating to settings and settings templates
namespace Settings {
enum display_type {
Unset = ' ', // Unset - don't use, used internally
Hidden = 'hide', // A setting not controlled by the user
RadioButton = 'rabu', // Radio buttons
CheckBox = 'chkb', // Check boxes
MenuSingle = 'mens', // Single-select menu
MenuMulti = 'menm', // Multiple-select menu
TextSingle = 'txts', // Single line text control
TextMulti = 'txtm', // Multi line text control
TextPassword = 'txtp', // Single line, hidden input, text control
FilePickerSingle = 'fpks', // File Picker - single file
FilePickerMulti = 'fpkm', // File Picker - multiple file
DirectoryPickerSingle = 'dpks', // Directory Picker - single
DirectoryPickerMultiple = 'dpkm', // Directory picker - multiple
};
// These are some common types of applications. The Type param of FeedListener is free
// form but you should use one of these constants, if possible, to ensure consistency
namespace AppTypes {
extern const char *SettingClient; // Something which allows user interaction
extern const char *SettingServer; // The server
extern const char *SettingUtil; // Interacts with the FeedKit but not the
// user
extern const char *SettingParser; // An addon for parsing data into FeedKit
// objects
extern const char *SettingFeed; // Settings specific to a feed
};
namespace Icon {
enum Location {
Contents = 'cnts', // Icon comes from the contents of the file
TrackerIcon = 'trki', // Use the Tracker icon
};
};
};
};
#endif
| HaikuArchives/FeedKit | libfeedkit/FeedKitConstants.h | C | mit | 2,663 | 32.2875 | 88 | 0.676305 | false |
<?php
/**
* Response Already Send Exception
*
* @author Tom Valk <tomvalk@lt-box.info>
* @copyright 2017 Tom Valk
*/
namespace Arvici\Exception;
class ResponseAlreadySendException extends ArviciException
{
/**
* ResponseAlreadySendException constructor.
* @param string $message
* @param int $code
* @param \Exception $previous
*/
public function __construct($message, $code = 0, \Exception $previous = null)
{
parent::__construct($message, $code, $previous);
}
public function __toString()
{
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
}
}
| arvici/framework | src/Arvici/Exception/ResponseAlreadySendException.php | PHP | mit | 640 | 21.068966 | 81 | 0.614063 | false |
#include <stdio.h>
struct Employee {
unsigned int id;
char name[256];
char gender;
float salary;
};
void addEmployee(FILE *f) {
struct Employee emp;
printf("Adding a new employee, please type his id \n");
int id;
scanf("%d", &id);
if (id > 0) {
while (1) { //search if id already in use
struct Employee tmp;
fread(&tmp, sizeof(struct Employee), 1, f);
if (feof(f) != 0) { //end of file
emp.id = id;
break;
}
if (id == tmp.id) {
printf("Id already in use, id must be unique \n");
return;
} else {
emp.id = id;
}
}
} else {
printf("Id must be greater than 0 \n");
return;
}
printf("Please type his name \n");
scanf("%s", &emp.name);
printf("Please type his gender (m or f) \n");
scanf(" %c", &emp.gender);
if ((emp.gender != 'm') && (emp.gender != 'f')) {
printf("Gender should be 'm' or 'f'");
return;
}
printf("Please type his salary \n");
scanf("%f", &emp.salary);
fwrite(&emp, sizeof(struct Employee), 1, f);
}
void removeEmployee(FILE *f) {
printf("Removing employee, please type his id \n");
int id;
scanf("%d)", &id);
while (1) {
struct Employee tmp;
fread(&tmp, sizeof(struct Employee), 1, f);
if (feof(f) != 0) {
printf("Employee not found");
return;
}
if (id == tmp.id) {
fseek(f, -sizeof(struct Employee), SEEK_CUR);
tmp.id = 0;
fwrite(&tmp, sizeof(struct Employee), 1, f);
printf("Sucess \n");
return;
}
}
}
void calculateAvarageSalaryByGender(FILE *f) {
printf("Calculating the avarage salary by gender \n");
int maleNumber = 0;
int femaleNumber = 0;
float sumMale = 0;
float sumFemale = 0;
while (1) {
struct Employee tmp;
fread(&tmp, sizeof(struct Employee), 1, f);
if (feof(f) != 0)
break;
if (tmp.id == 0)
continue;
if (tmp.gender == 'm') {
maleNumber++;
sumMale += tmp.salary;
} else {
femaleNumber++;
sumFemale += tmp.salary;
}
}
printf("Avarage male salary: %f \n", sumMale/maleNumber);
printf("Avarage female salary: %f \n", sumFemale/femaleNumber);
}
void exportTextFile(FILE *f) {
char path[256];
printf("Please type the name of the file to store the data \n");
scanf("%s)", &path);
FILE *final;
if ((final = fopen(path, "w")) == NULL) {
printf("Error opening/creating the file");
} else {
while (1) {
struct Employee tmp;
fread(&tmp, sizeof(struct Employee), 1, f);
if (feof(f) != 0)
break;
if (tmp.id != 0) {
fprintf(final, "ID: %d \n", tmp.id);
fprintf(final, "Name: %s \n", tmp.name);
fprintf(final, "Gender: %c \n", tmp.gender);
fprintf(final, "Salary: %f \n", tmp.salary);
}
}
}
fclose(final);
}
void compactData(FILE *f, char fileName[]) {
FILE *copy;
if ((copy = fopen("copy", "wb")) == NULL) {
printf("Error creating the copy file");
} else {
while (1) {
struct Employee tmp;
fread(&tmp, sizeof(struct Employee), 1, f);
if (feof(f) != 0)
break;
if (tmp.id != 0) {
fwrite(&tmp, sizeof(struct Employee), 1, copy);
}
}
fclose(copy);
remove(fileName);
rename("copy", fileName);
}
printf("Database compacted");
}
int main(int argc, char *argv[]) {
if (argc == 3) {
int option = atoi(argv[2]);
FILE *f;
f = fopen(argv[1], "ab+");
fclose(f);
switch(option) {
case 1:
if ((f = fopen(argv[1], "ab+")) == NULL) {
printf("Error opening/creating the file");
} else {
addEmployee(f);
fclose(f);
}
break;
case 2:
if ((f = fopen(argv[1], "rb+")) == NULL) {
printf("Error opening/creating the file");
} else {
removeEmployee(f);
fclose(f);
}
break;
case 3:
if ((f = fopen(argv[1], "rb")) == NULL) {
printf("Error opening/creating the file");
} else {
calculateAvarageSalaryByGender(f);
fclose(f);
}
break;
case 4:
if ((f = fopen(argv[1], "rb")) == NULL) {
printf("Error opening/creating the file");
} else {
exportTextFile(f);
fclose(f);
}
break;
case 5:
if ((f = fopen(argv[1], "rb")) == NULL) {
printf("Error opening/creating the file");
} else {
compactData(f, argv[1]);
fclose(f);
}
break;
}
} else {
printf("Need to provide two arguments, the first one is the binary file and second is the option. \n");
printf("1 - Add employee \n");
printf("2 - Remove employee \n");
printf("3 - Calculate avarage salary by gender \n");
printf("4 - Export data to a text file \n");
printf("5 - Compact data \n");
}
return 0;
}
| Macelai/operating-systems | system-call/main.c | C | mit | 4,505 | 22.102564 | 105 | 0.574695 | false |
---
layout: post
date: 2016-05-17
title: "WEDDING DRESSES Jersey Cap Sleeve Bridal Dress JB98629"
category: WEDDING DRESSES
tags: [WEDDING DRESSES]
---
### WEDDING DRESSES Jersey Cap Sleeve Bridal Dress JB98629
Just **$279.99**
###
<a href="https://www.readybrides.com/en/wedding-dresses/40561-jersey-cap-sleeve-bridal-dress-jb98629.html"><img src="//img.readybrides.com/88522/jersey-cap-sleeve-bridal-dress-jb98629.jpg" alt="Jersey Cap Sleeve Bridal Dress JB98629" style="width:100%;" /></a>
<!-- break --><a href="https://www.readybrides.com/en/wedding-dresses/40561-jersey-cap-sleeve-bridal-dress-jb98629.html"><img src="//img.readybrides.com/88523/jersey-cap-sleeve-bridal-dress-jb98629.jpg" alt="Jersey Cap Sleeve Bridal Dress JB98629" style="width:100%;" /></a>
<a href="https://www.readybrides.com/en/wedding-dresses/40561-jersey-cap-sleeve-bridal-dress-jb98629.html"><img src="//img.readybrides.com/88524/jersey-cap-sleeve-bridal-dress-jb98629.jpg" alt="Jersey Cap Sleeve Bridal Dress JB98629" style="width:100%;" /></a>
<a href="https://www.readybrides.com/en/wedding-dresses/40561-jersey-cap-sleeve-bridal-dress-jb98629.html"><img src="//img.readybrides.com/88525/jersey-cap-sleeve-bridal-dress-jb98629.jpg" alt="Jersey Cap Sleeve Bridal Dress JB98629" style="width:100%;" /></a>
<a href="https://www.readybrides.com/en/wedding-dresses/40561-jersey-cap-sleeve-bridal-dress-jb98629.html"><img src="//img.readybrides.com/88521/jersey-cap-sleeve-bridal-dress-jb98629.jpg" alt="Jersey Cap Sleeve Bridal Dress JB98629" style="width:100%;" /></a>
Buy it: [https://www.readybrides.com/en/wedding-dresses/40561-jersey-cap-sleeve-bridal-dress-jb98629.html](https://www.readybrides.com/en/wedding-dresses/40561-jersey-cap-sleeve-bridal-dress-jb98629.html)
| novstylessee/novstylessee.github.io | _posts/2016-05-17-WEDDING-DRESSES-Jersey-Cap-Sleeve-Bridal-Dress-JB98629.md | Markdown | mit | 1,759 | 96.722222 | 274 | 0.758954 | false |
#!/usr/bin/env node
//
// cli.js
//
// Copyright (c) 2016-2017 Junpei Kawamoto
//
// This software is released under the MIT License.
//
// http://opensource.org/licenses/mit-license.php
//
const {
start,
crawl
} = require("../lib/crawler");
const argv = require("yargs")
.option("lang", {
describe: "Language to be used to scrape trand pages. Not used in crawl command."
})
.default("lang", "EN")
.option("dir", {
describe: "Path to the directory to store database files"
})
.demandOption(["dir"])
.command("*", "Start crawling", () => {}, (argv) => {
start(argv.lang, argv.dir);
})
.command("crawl", "Crawl comments form a video", () => {}, (argv) => {
crawl(argv.dir).catch((err) => {
console.error(err);
});
})
.help("h")
.alias("h", "help")
.argv;
| itslab-kyushu/youtube-comment-crawler | bin/cli.js | JavaScript | mit | 867 | 23.083333 | 89 | 0.546713 | false |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CollegeFbsRankings.Domain.Games;
using CollegeFbsRankings.Domain.Rankings;
using CollegeFbsRankings.Domain.Teams;
namespace CollegeFbsRankings.Domain.Validations
{
public class ValidationService
{
public Validation<GameId> GameValidationFromRanking<TRankingValue>(
IEnumerable<CompletedGame> games,
Ranking<TeamId, TRankingValue> performance)
where TRankingValue : IRankingValue
{
return new Validation<GameId>(games.Select(game =>
{
var winningTeamData = performance[game.WinningTeamId];
var losingTeamData = performance[game.LosingTeamId];
foreach (var values in winningTeamData.Values.Zip(losingTeamData.Values, Tuple.Create))
{
if (values.Item1 > values.Item2)
return new KeyValuePair<GameId, eValidationResult>(game.Id, eValidationResult.Correct);
if (values.Item1 < values.Item2)
return new KeyValuePair<GameId, eValidationResult>(game.Id, eValidationResult.Incorrect);
}
return new KeyValuePair<GameId, eValidationResult>(game.Id, eValidationResult.Skipped);
}));
}
}
}
| mikee385/CollegeFbsRankings | Domain/Validations/ValidationService.cs | C# | mit | 1,400 | 35.789474 | 113 | 0.646638 | false |
/* ----------------------------------------------------------------------------
* Copyright (C) 2013 Arne F. Claassen
* geekblog [at] claassen [dot] net
* http://github.com/sdether/Calculon
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* ----------------------------------------------------------------------------
*/
using Droog.Calculon.Backstage;
using NUnit.Framework;
namespace Droog.Calculon.Tests {
[TestFixture]
public class BuilderTests {
public interface IFoo {
}
public class Foo : AActor, IFoo {
}
[Test]
public void Can_create_class() {
var builder = new ActorBuilder();
var foo = builder.GetBuilder<Foo>()();
Assert.IsNotNull(foo);
Assert.IsInstanceOfType(typeof(Foo),foo);
}
[Test]
public void Can_create_interface_with_appropriately_named_class() {
var builder = new ActorBuilder();
var foo = builder.GetBuilder<IFoo>()();
Assert.IsNotNull(foo);
Assert.IsInstanceOfType(typeof(Foo), foo);
}
}
}
| sdether/Calculon | Calculon.Tests/BuilderTests.cs | C# | mit | 2,235 | 35.847458 | 80 | 0.60412 | false |
<div class="container" >
<div class="row page-title">
<div class="col-xs-12 text-center">
<span>Consultation</span>
</div>
</div>
</div>
<script type="text/javascript">
/**
* Created by Kupletsky Sergey on 05.11.14.
*
* Material Design Responsive Table
* Tested on Win8.1 with browsers: Chrome 37, Firefox 32, Opera 25, IE 11, Safari 5.1.7
* You can use this table in Bootstrap (v3) projects. Material Design Responsive Table CSS-style will override basic bootstrap style.
* JS used only for table constructor: you don't need it in your project
*/
$(document).ready(function() {
var table = $('#table');
// Table bordered
$('#table-bordered').change(function() {
var value = $( this ).val();
table.removeClass('table-bordered').addClass(value);
});
// Table striped
$('#table-striped').change(function() {
var value = $( this ).val();
table.removeClass('table-striped').addClass(value);
});
// Table hover
$('#table-hover').change(function() {
var value = $( this ).val();
table.removeClass('table-hover').addClass(value);
});
// Table color
$('#table-color').change(function() {
var value = $(this).val();
table.removeClass(/^table-mc-/).addClass(value);
});
});
// jQuery’s hasClass and removeClass on steroids
// by Nikita Vasilyev
// https://github.com/NV/jquery-regexp-classes
(function(removeClass) {
jQuery.fn.removeClass = function( value ) {
if ( value && typeof value.test === "function" ) {
for ( var i = 0, l = this.length; i < l; i++ ) {
var elem = this[i];
if ( elem.nodeType === 1 && elem.className ) {
var classNames = elem.className.split( /\s+/ );
for ( var n = classNames.length; n--; ) {
if ( value.test(classNames[n]) ) {
classNames.splice(n, 1);
}
}
elem.className = jQuery.trim( classNames.join(" ") );
}
}
} else {
removeClass.call(this, value);
}
return this;
}
})(jQuery.fn.removeClass);
</script>
<style media="screen">
/* -- Material Design Table style -------------- */
.table {
width: 100%;
max-width: 100%;
margin-bottom: 2rem;
background-color: #fff;
}
.table > thead > tr,
.table > tbody > tr,
.table > tfoot > tr {
-webkit-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
transition: all 0.3s ease;
}
.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
text-align: left;
padding: 1.6rem;
vertical-align: top;
border-top: 0;
-webkit-transition: all 0.3s ease;
-o-transition: all 0.3s ease;
transition: all 0.3s ease;
}
.table > thead > tr > th {
font-weight: 400;
color: #757575;
vertical-align: bottom;
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.table > caption + thead > tr:first-child > th,
.table > colgroup + thead > tr:first-child > th,
.table > thead:first-child > tr:first-child > th,
.table > caption + thead > tr:first-child > td,
.table > colgroup + thead > tr:first-child > td,
.table > thead:first-child > tr:first-child > td {
border-top: 0;
}
.table > tbody + tbody {
border-top: 1px solid rgba(0, 0, 0, 0.12);
}
.table .table {
background-color: #fff;
}
.table .no-border {
border: 0;
}
.table-condensed > thead > tr > th,
.table-condensed > tbody > tr > th,
.table-condensed > tfoot > tr > th,
.table-condensed > thead > tr > td,
.table-condensed > tbody > tr > td,
.table-condensed > tfoot > tr > td {
padding: 0.8rem;
}
.table-bordered {
border: 0;
}
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > td,
.table-bordered > tfoot > tr > td {
border: 0;
border-bottom: 1px solid #e0e0e0;
}
.table-bordered > thead > tr > th,
.table-bordered > thead > tr > td {
border-bottom-width: 2px;
}
.table-striped > tbody > tr:nth-child(odd) > td,
.table-striped > tbody > tr:nth-child(odd) > th {
background-color: #f5f5f5;
}
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
background-color: rgba(0, 0, 0, 0.12);
}
@media screen and (max-width: 768px) {
.table-responsive-vertical > .table {
margin-bottom: 0;
background-color: transparent;
}
.table-responsive-vertical > .table > thead,
.table-responsive-vertical > .table > tfoot {
display: none;
}
.table-responsive-vertical > .table > tbody {
display: block;
}
.table-responsive-vertical > .table > tbody > tr {
display: block;
border: 1px solid #e0e0e0;
border-radius: 2px;
margin-bottom: 1.6rem;
}
.table-responsive-vertical > .table > tbody > tr > td {
background-color: #fff;
display: block;
vertical-align: middle;
text-align: right;
}
.table-responsive-vertical > .table > tbody > tr > td[data-title]:before {
content: attr(data-title);
float: left;
font-size: inherit;
font-weight: 400;
color: #757575;
}
.table-responsive-vertical.shadow-z-1 {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.table-responsive-vertical.shadow-z-1 > .table > tbody > tr {
border: none;
-webkit-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 1px 2px 0 rgba(0, 0, 0, 0.24);
-moz-box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 1px 2px 0 rgba(0, 0, 0, 0.24);
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 1px 2px 0 rgba(0, 0, 0, 0.24);
}
.table-responsive-vertical > .table-bordered {
border: 0;
}
.table-responsive-vertical > .table-bordered > tbody > tr > td {
border: 0;
border-bottom: 1px solid #e0e0e0;
}
.table-responsive-vertical > .table-bordered > tbody > tr > td:last-child {
border-bottom: 0;
}
.table-responsive-vertical > .table-striped > tbody > tr > td,
.table-responsive-vertical > .table-striped > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical > .table-striped > tbody > tr > td:nth-child(odd) {
background-color: #f5f5f5;
}
.table-responsive-vertical > .table-hover > tbody > tr:hover > td,
.table-responsive-vertical > .table-hover > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical > .table-hover > tbody > tr > td:hover {
background-color: rgba(0, 0, 0, 0.12);
}
}
.table-striped.table-mc-red > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-red > tbody > tr:nth-child(odd) > th {
background-color: #fde0dc;
}
.table-hover.table-mc-red > tbody > tr:hover > td,
.table-hover.table-mc-red > tbody > tr:hover > th {
background-color: #f9bdbb;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-red > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-red > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-red > tbody > tr > td:nth-child(odd) {
background-color: #fde0dc;
}
.table-responsive-vertical .table-hover.table-mc-red > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-red > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-red > tbody > tr > td:hover {
background-color: #f9bdbb;
}
}
.table-striped.table-mc-pink > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-pink > tbody > tr:nth-child(odd) > th {
background-color: #fce4ec;
}
.table-hover.table-mc-pink > tbody > tr:hover > td,
.table-hover.table-mc-pink > tbody > tr:hover > th {
background-color: #f8bbd0;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-pink > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-pink > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-pink > tbody > tr > td:nth-child(odd) {
background-color: #fce4ec;
}
.table-responsive-vertical .table-hover.table-mc-pink > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-pink > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-pink > tbody > tr > td:hover {
background-color: #f8bbd0;
}
}
.table-striped.table-mc-purple > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-purple > tbody > tr:nth-child(odd) > th {
background-color: #f3e5f5;
}
.table-hover.table-mc-purple > tbody > tr:hover > td,
.table-hover.table-mc-purple > tbody > tr:hover > th {
background-color: #e1bee7;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-purple > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-purple > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-purple > tbody > tr > td:nth-child(odd) {
background-color: #f3e5f5;
}
.table-responsive-vertical .table-hover.table-mc-purple > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-purple > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-purple > tbody > tr > td:hover {
background-color: #e1bee7;
}
}
.table-striped.table-mc-deep-purple > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-deep-purple > tbody > tr:nth-child(odd) > th {
background-color: #ede7f6;
}
.table-hover.table-mc-deep-purple > tbody > tr:hover > td,
.table-hover.table-mc-deep-purple > tbody > tr:hover > th {
background-color: #d1c4e9;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-deep-purple > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-deep-purple > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-deep-purple > tbody > tr > td:nth-child(odd) {
background-color: #ede7f6;
}
.table-responsive-vertical .table-hover.table-mc-deep-purple > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-deep-purple > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-deep-purple > tbody > tr > td:hover {
background-color: #d1c4e9;
}
}
.table-striped.table-mc-indigo > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-indigo > tbody > tr:nth-child(odd) > th {
background-color: #e8eaf6;
}
.table-hover.table-mc-indigo > tbody > tr:hover > td,
.table-hover.table-mc-indigo > tbody > tr:hover > th {
background-color: #c5cae9;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-indigo > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-indigo > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-indigo > tbody > tr > td:nth-child(odd) {
background-color: #e8eaf6;
}
.table-responsive-vertical .table-hover.table-mc-indigo > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-indigo > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-indigo > tbody > tr > td:hover {
background-color: #c5cae9;
}
}
.table-striped.table-mc-blue > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-blue > tbody > tr:nth-child(odd) > th {
background-color: #e7e9fd;
}
.table-hover.table-mc-blue > tbody > tr:hover > td,
.table-hover.table-mc-blue > tbody > tr:hover > th {
background-color: #d0d9ff;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-blue > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-blue > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-blue > tbody > tr > td:nth-child(odd) {
background-color: #e7e9fd;
}
.table-responsive-vertical .table-hover.table-mc-blue > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-blue > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-blue > tbody > tr > td:hover {
background-color: #d0d9ff;
}
}
.table-striped.table-mc-light-blue > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-light-blue > tbody > tr:nth-child(odd) > th {
background-color: #e1f5fe;
}
.table-hover.table-mc-light-blue > tbody > tr:hover > td,
.table-hover.table-mc-light-blue > tbody > tr:hover > th {
background-color: #b3e5fc;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-light-blue > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-light-blue > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-light-blue > tbody > tr > td:nth-child(odd) {
background-color: #e1f5fe;
}
.table-responsive-vertical .table-hover.table-mc-light-blue > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-light-blue > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-light-blue > tbody > tr > td:hover {
background-color: #b3e5fc;
}
}
.table-striped.table-mc-cyan > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-cyan > tbody > tr:nth-child(odd) > th {
background-color: #e0f7fa;
}
.table-hover.table-mc-cyan > tbody > tr:hover > td,
.table-hover.table-mc-cyan > tbody > tr:hover > th {
background-color: #b2ebf2;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-cyan > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-cyan > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-cyan > tbody > tr > td:nth-child(odd) {
background-color: #e0f7fa;
}
.table-responsive-vertical .table-hover.table-mc-cyan > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-cyan > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-cyan > tbody > tr > td:hover {
background-color: #b2ebf2;
}
}
.table-striped.table-mc-teal > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-teal > tbody > tr:nth-child(odd) > th {
background-color: #e0f2f1;
}
.table-hover.table-mc-teal > tbody > tr:hover > td,
.table-hover.table-mc-teal > tbody > tr:hover > th {
background-color: #b2dfdb;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-teal > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-teal > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-teal > tbody > tr > td:nth-child(odd) {
background-color: #e0f2f1;
}
.table-responsive-vertical .table-hover.table-mc-teal > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-teal > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-teal > tbody > tr > td:hover {
background-color: #b2dfdb;
}
}
.table-striped.table-mc-green > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-green > tbody > tr:nth-child(odd) > th {
background-color: #d0f8ce;
}
.table-hover.table-mc-green > tbody > tr:hover > td,
.table-hover.table-mc-green > tbody > tr:hover > th {
background-color: #a3e9a4;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-green > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-green > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-green > tbody > tr > td:nth-child(odd) {
background-color: #d0f8ce;
}
.table-responsive-vertical .table-hover.table-mc-green > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-green > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-green > tbody > tr > td:hover {
background-color: #a3e9a4;
}
}
.table-striped.table-mc-light-green > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-light-green > tbody > tr:nth-child(odd) > th {
background-color: #f1f8e9;
}
.table-hover.table-mc-light-green > tbody > tr:hover > td,
.table-hover.table-mc-light-green > tbody > tr:hover > th {
background-color: #dcedc8;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-light-green > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-light-green > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-light-green > tbody > tr > td:nth-child(odd) {
background-color: #f1f8e9;
}
.table-responsive-vertical .table-hover.table-mc-light-green > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-light-green > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-light-green > tbody > tr > td:hover {
background-color: #dcedc8;
}
}
.table-striped.table-mc-lime > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-lime > tbody > tr:nth-child(odd) > th {
background-color: #f9fbe7;
}
.table-hover.table-mc-lime > tbody > tr:hover > td,
.table-hover.table-mc-lime > tbody > tr:hover > th {
background-color: #f0f4c3;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-lime > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-lime > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-lime > tbody > tr > td:nth-child(odd) {
background-color: #f9fbe7;
}
.table-responsive-vertical .table-hover.table-mc-lime > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-lime > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-lime > tbody > tr > td:hover {
background-color: #f0f4c3;
}
}
.table-striped.table-mc-yellow > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-yellow > tbody > tr:nth-child(odd) > th {
background-color: #fffde7;
}
.table-hover.table-mc-yellow > tbody > tr:hover > td,
.table-hover.table-mc-yellow > tbody > tr:hover > th {
background-color: #fff9c4;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-yellow > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-yellow > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-yellow > tbody > tr > td:nth-child(odd) {
background-color: #fffde7;
}
.table-responsive-vertical .table-hover.table-mc-yellow > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-yellow > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-yellow > tbody > tr > td:hover {
background-color: #fff9c4;
}
}
.table-striped.table-mc-amber > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-amber > tbody > tr:nth-child(odd) > th {
background-color: #fff8e1;
}
.table-hover.table-mc-amber > tbody > tr:hover > td,
.table-hover.table-mc-amber > tbody > tr:hover > th {
background-color: #ffecb3;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-amber > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-amber > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-amber > tbody > tr > td:nth-child(odd) {
background-color: #fff8e1;
}
.table-responsive-vertical .table-hover.table-mc-amber > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-amber > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-amber > tbody > tr > td:hover {
background-color: #ffecb3;
}
}
.table-striped.table-mc-orange > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-orange > tbody > tr:nth-child(odd) > th {
background-color: #fff3e0;
}
.table-hover.table-mc-orange > tbody > tr:hover > td,
.table-hover.table-mc-orange > tbody > tr:hover > th {
background-color: #ffe0b2;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-orange > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-orange > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-orange > tbody > tr > td:nth-child(odd) {
background-color: #fff3e0;
}
.table-responsive-vertical .table-hover.table-mc-orange > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-orange > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-orange > tbody > tr > td:hover {
background-color: #ffe0b2;
}
}
.table-striped.table-mc-deep-orange > tbody > tr:nth-child(odd) > td,
.table-striped.table-mc-deep-orange > tbody > tr:nth-child(odd) > th {
background-color: #fbe9e7;
}
.table-hover.table-mc-deep-orange > tbody > tr:hover > td,
.table-hover.table-mc-deep-orange > tbody > tr:hover > th {
background-color: #ffccbc;
}
@media screen and (max-width: 767px) {
.table-responsive-vertical .table-striped.table-mc-deep-orange > tbody > tr > td,
.table-responsive-vertical .table-striped.table-mc-deep-orange > tbody > tr:nth-child(odd) {
background-color: #fff;
}
.table-responsive-vertical .table-striped.table-mc-deep-orange > tbody > tr > td:nth-child(odd) {
background-color: #fbe9e7;
}
.table-responsive-vertical .table-hover.table-mc-deep-orange > tbody > tr:hover > td,
.table-responsive-vertical .table-hover.table-mc-deep-orange > tbody > tr:hover {
background-color: #fff;
}
.table-responsive-vertical .table-hover.table-mc-deep-orange > tbody > tr > td:hover {
background-color: #ffccbc;
}
}
.new{
color: #49c4d5;
background-color: white;
border: 1px solid #49c4d5;
font-weight: 400;
margin-left: 10px;
}
.page-link{
color: rgb(157, 157, 157) !important;
font-size: 10px;
}
</style>
<div class="container" ng-controller="consultation" ng-init="uid='<?=$uid?>';init()">
<div class="row" style="max-width:1000px; margin:auto; margin-bottom:70px;">
<div class="col-xs-12 ">
<table id="table" class="table table-hover table-mc-light-blue" >
<thead>
<tr>
<th class="hidden-xs">Num</th>
<th>Title</th>
<th class="hidden-xs">Author</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="i in consultList" ng-click="openConsult(i)" style="color:#9d9d9d">
<td data-title="Number" style="width:50px;" class="hidden-xs">{{$index+(start)+1}}</td>
<td data-title="Title" style="color:#525252">{{i.TITLE}} ({{i.count}}) <div class="label label-default new" ng-show="i.TIME|new">new</div></td>
<td data-title="Author" class="hidden-xs" style="width:150px;">
{{i.AUTHOR}}
</td>
<td data-title="Date" style="width:150px;">
{{i.TIME|Cdate}}
</td>
</tr>
</tbody>
</table>
</div>
<div class="col-xs-12" style="text-align:center">
<ul class="pagination">
<!-- <li class="page-item">
<a class="page-link" href="#" aria-label="Previous">
<span aria-hidden="true">«</span>
<span class="sr-only">Previous</span>
</a>
</li> -->
<li class="page-item" ng-repeat="i in consultRange">
<a class="page-link" ng-click="goConsult(i)">{{i}}</a>
</li>
<!-- <li class="page-item">
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">»</span>
<span class="sr-only">Next</span>
</a>
</li> -->
</ul>
</div>
<div class="col-xs-12">
<div onclick="$('#write_new').modal('show')" class="pull-right banner-button" >WRITE
</div>
</div>
</div>
<div class="modal fade" id="write_new" tabindex="-1" role="dialog" aria-labelledby="" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body" style="padding:0">
<div class="row" >
<div class="col-xs-12">
<div class="well" ng-init="consult={}" style="margin-bottom:0;">
<!-- <div class="text-center page-title">
<span >Consultation</span>
</div> -->
<div class="form-group has-feedback-none has-feedback-left-none">
<input type="text" class="placeholder form-control no-border" placeholder="Name" ng-model="consult.author" />
</div>
<div class="form-group has-feedback-none has-feedback-left-none">
<input type="text" class="placeholder form-control no-border" placeholder="Title" ng-model="consult.title" />
</div>
<div class="form-group has-feedback-none has-feedback-left-none">
<input type="password" class=" placeholder form-control no-border" placeholder="Password" ng-model="consult.password"/>
</div>
<div class="form-group has-feedback-none has-feedback-left-none">
<textarea style="resize:none;border:none;"class="placeholder form-control" rows="5" style="border:none; box-shadow:none;" placeholder="Message" ng-model="consult.body" ></textarea>
</div>
<div class="btn btnForm btn-block" ng-click="consultForm(consult)">SEND</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
| r45r54r45/simplewe | application/views/consultation.php | PHP | mit | 26,096 | 35.803949 | 197 | 0.647735 | false |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DecimalToHex")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DecimalToHex")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3e808379-6e11-4c24-853e-7d2b4720cbb1")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| StoikoNeykov/Telerik | CSharp1/Loops/DecimalToHex/Properties/AssemblyInfo.cs | C# | mit | 1,400 | 37.805556 | 84 | 0.745168 | false |
const AppError = require('../../../lib/errors/app')
const assert = require('assert')
function doSomethingBad () {
throw new AppError('app error message')
}
it('Error details', function () {
try {
doSomethingBad()
} catch (err) {
assert.strictEqual(
err.name,
'AppError',
"Name property set to error's name"
)
assert(
err instanceof AppError,
'Is an instance of its class'
)
assert(
err instanceof Error,
'Is instance of built-in Error'
)
assert(
require('util').isError(err),
'Should be recognized by Node.js util#isError'
)
assert(
err.stack,
'Should have recorded a stack'
)
assert.strictEqual(
err.toString(),
'AppError: app error message',
'toString should return the default error message formatting'
)
assert.strictEqual(
err.stack.split('\n')[0],
'AppError: app error message',
'Stack should start with the default error message formatting'
)
assert.strictEqual(
err.stack.split('\n')[1].indexOf('doSomethingBad'),
7,
'The first stack frame should be the function where the error was thrown'
)
}
})
| notmessenger/poker-analysis | test/lib/errors/app.js | JavaScript | mit | 1,211 | 20.625 | 79 | 0.608588 | false |
require 'spec_helper'
describe Blogitr::Document do
def parse text, filter=:html
@doc = Blogitr::Document.new :text => text, :filter => filter
end
def should_parse_as headers, body, extended=nil
@doc.headers.should == headers
@doc.body.should == body
@doc.extended.should == extended
end
it "should raise an error if an unknown fitler is specified" do
lambda do
parse "foo *bar* \"baz\"", :unknown
end.should raise_error(Blogitr::UnknownFilterError)
end
it "should parse documents with a YAML header" do
parse <<EOD
title: My Doc
subtitle: An Essay
foo
bar
EOD
should_parse_as({ 'title' => "My Doc", 'subtitle' => 'An Essay' },
"foo\n\nbar\n")
end
it "should parse documents without a YAML header" do
parse "foo\nbar\nbaz"
should_parse_as({}, "foo\nbar\nbaz")
end
it "should parse documents with a YAML header but no body" do
parse "title: My Doc"
should_parse_as({ 'title' => "My Doc" }, '')
end
it "should separate extended content from the main body" do
parse <<EOD
foo
<!--more-->
bar
EOD
should_parse_as({}, "foo", "bar\n")
end
it "should expand macros" do
input = "title: Foo\n\n<macro:example foo=\"bar\">baz</macro:example>"
parse input
should_parse_as({'title' => "Foo"},
"Options: {\"foo\"=>\"bar\"}\nBody: baz")
end
it "should provide access to raw body and extended content" do
parse "*foo*\n<!--more-->\n_bar_", :textile
@doc.raw_body.should == "*foo*"
@doc.raw_extended.should == "_bar_"
end
describe "with a :textile filter" do
it "should filter content" do
parse "foo *bar*\n<!--more-->\n\"baz\"", :textile
should_parse_as({}, "<p>foo <strong>bar</strong></p>",
"<p>“baz”</p>")
end
it "should protect expanded macros from filtering" do
text = "\n<macro:example>*foo*</macro:example>"
parse text, :textile
should_parse_as({}, "Options: {}\nBody: *foo*")
end
end
describe "with a :markdown filter" do
it "should filter content" do
parse "foo *bar* \"baz\"", :markdown
should_parse_as({}, "<p>foo <em>bar</em> “baz”</p>\n")
end
it "should protect expanded macros from filtering" do
text = "\n<macro:example>*foo*</macro:example>"
parse text, :markdown
should_parse_as({},
"<div class=\"raw\">Options: {}\nBody: *foo*</div>\n\n")
end
end
describe "#to_s" do
def should_serialize_as headers, body, extended, serialized
opts = { :headers => headers, :raw_body => body,
:raw_extended => extended, :filter => :html }
Blogitr::Document.new(opts).to_s.should == serialized
end
it "should serialize documents with headers" do
should_serialize_as({'title' => 'Foo'}, "_Bar_.", nil,
"title: Foo\n\n_Bar_.")
end
it "should serialize documents without headers" do
should_serialize_as({}, "_Bar_.", nil, "\n_Bar_.")
end
it "should serialize extended content using \\<!--more-->" do
should_serialize_as({}, "Bar.", "_Baz_.", "\nBar.\n<!--more-->\n_Baz_.")
end
end
end
| emk/blogitr | spec/document_spec.rb | Ruby | mit | 3,231 | 27.59292 | 78 | 0.588982 | false |
<?php
namespace Grupo3TallerUNLP\ConfiguracionBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class ConfiguracionControllerTest extends WebTestCase
{
/*
public function testCompleteScenario()
{
// Create a new client to browse the application
$client = static::createClient();
// Create a new entry in the database
$crawler = $client->request('GET', '/configuracion/');
$this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /configuracion/");
$crawler = $client->click($crawler->selectLink('Create a new entry')->link());
// Fill in the form and submit it
$form = $crawler->selectButton('Create')->form(array(
'grupo3tallerunlp_configuracionbundle_configuracion[field_name]' => 'Test',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check data in the show view
$this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")');
// Edit the entity
$crawler = $client->click($crawler->selectLink('Edit')->link());
$form = $crawler->selectButton('Update')->form(array(
'grupo3tallerunlp_configuracionbundle_configuracion[field_name]' => 'Foo',
// ... other fields to fill
));
$client->submit($form);
$crawler = $client->followRedirect();
// Check the element contains an attribute with value equals "Foo"
$this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]');
// Delete the entity
$client->submit($crawler->selectButton('Delete')->form());
$crawler = $client->followRedirect();
// Check the entity has been delete on the list
$this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
}
*/
}
| Grupo3-TallerUNLP/InfoSquid | src/Grupo3TallerUNLP/ConfiguracionBundle/Tests/Controller/ConfiguracionControllerTest.php | PHP | mit | 2,024 | 35.8 | 129 | 0.620059 | false |
## iScript
包含项目:
> *[L]* *[W]* *[LW]* 分别表示,在linux, windows, linux和windows 下通过测试。
> ***windows用户可在babun (https://github.com/babun/babun) 下运行。***
- *[L]* [xiami.py](#xiami.py) - 下载或播放高品质虾米音乐(xiami.com)
- *[L]* [pan.baidu.com.py](#pan.baidu.com.py) - 百度网盘的下载、离线下载、上传、播放、转存、文件操作
- *[L]* [bt.py](#bt.py) - magnet torrent 互转、及 过滤敏.感.词
- *[L]* [115.py](#115.py) - 115网盘的下载和播放
- *[L]* [yunpan.360.cn.py](#yunpan.360.cn.py) - 360网盘的下载
- *[L]* [music.baidu.com.py](#music.baidu.com.py) - 下载或播放高品质百度音乐(music.baidu.com)
- *[L]* [music.163.com.py](#music.163.com.py) - 下载或播放高品质网易音乐(music.163.com)
- *[L]* [flvxz_cl.py](#flvxz_cl.py) - flvxz.com 视频解析 client - 支持下载、播放
- *[L]* [tumblr.py](#tumblr.py) - 下载某个tumblr.com的所有图片
- *[L]* [unzip.py](#unzip.py) - 解决linux下unzip乱码的问题
- *[L]* [ed2k_search.py](#ed2k_search.py) - 基于 donkey4u.com 的emule搜索
- *[L]* [91porn.py](#91porn.py) - 下载或播放91porn
- *[L]* [ThunderLixianExporter.user.js](#ThunderLixianExporter.user.js) - A fork of https://github.com/binux/ThunderLixianExporter - 增加了mpv和mplayer的导出。
- 待续
---
---
<a name="xiami.py"></a>
### xiami.py - 下载或播放高品质虾米音乐(xiami.com)
1. 依赖
wget
python2-requests (https://github.com/kennethreitz/requests)
python2-mutagen (https://code.google.com/p/mutagen/)
mpv (http://mpv.io)
2. 使用说明
初次使用需要登录 xm login
**支持淘宝账户** xm logintaobao
**对于淘宝账户,登录后只保存有关虾米的cookies,删除了有关淘宝的cookies**
**vip账户**支持高品质音乐的下载和播放。
下载的MP3默认添加id3 tags,保存在当前目录下。
cookies保存在 ~/.Xiami.cookies。
关于播放操作:
> 在运行脚本的终端,输入1次Enter,关闭当前播放并播放下一个文件,连续输入2次Enter,关闭当前播放并退出。
命令:
# 虾米账号登录
g
login
login username
login username password
# 淘宝账号登录
gt
logintaobao
logintaobao username
logintaobao username password
signout # 退出登录
d 或 download url1 url2 .. # 下载
p 或 play url1 url2 .. # 播放
s 或 save url1 url2 .. # 收藏
参数:
-p, --play play with mpv
-d, --undescription 不加入disk的描述
-f num, --from_ num 从第num个开始
-t TAGS, --tags TAGS 收藏用的tags,用英文逗号分开, eg: -t piano,cello,guitar
-n, --undownload 不下载,用于修改已存在的MP3的id3 tags
3. 用法
\# xm 是xiami.py的马甲 (alias xm='python2 /path/to/xiami.py')
# 登录
xm g
xm login
xm login username
xm login username password
# 退出登录
xm signout
# 下载专辑
xm d http://www.xiami.com/album/168709?spm=a1z1s.6928801.1561534521.114.ShN6mD
# 下载单曲
xm d http://www.xiami.com/song/2082998?spm=a1z1s.6659513.0.0.DT2j7T
# 下载精选集
xm d http://www.xiami.com/song/showcollect/id/30374035?spm=a1z1s.3061701.6856305.16.fvh75t
# 下载该艺术家所有专辑, Top 20 歌曲, radio
xm d http://www.xiami.com/artist/23460?spm=a1z1s.6928801.1561534521.115.ShW08b
# 下载用户的收藏, 虾米推荐, radio
xm d http://www.xiami.com/u/141825?spm=a1z1s.3521917.0.0.zI0APP
# 下载排行榜
xm d http://www.xiami.com/chart/index/c/2?spm=a1z1s.2943549.6827465.6.VrEAoY
# 下载 风格 genre, radio
xm d http://www.xiami.com/genre/detail/gid/2?spm=a1z1s.3057857.6850221.1.g9ySan
xm d http://www.xiami.com/genre/detail/sid/2970?spm=a1z1s.3057857.6850221.4.pkepgt
播放:
# url 是上面的
xm p url
收藏:
xm s http://www.xiami.com/album/168709?spm=a1z1s.6928801.1561534521.114.ShN6mD
xm s -t 'tag1,tag 2,tag 3' http://www.xiami.com/song/2082998?spm=a1z1s.6659513.0.0.DT2j7T
xm s http://www.xiami.com/song/showcollect/id/30374035?spm=a1z1s.3061701.6856305.16.fvh75t
xm s http://www.xiami.com/artist/23460?spm=a1z1s.6928801.1561534521.115.ShW08b
4. 参考:
> http://kanoha.org/2011/08/30/xiami-absolute-address/
> http://www.blackglory.me/xiami-vip-audition-with-no-quality-difference-between-downloading/
> https://gist.github.com/lepture/1014329
> 淘宝登录代码: https://github.com/ly0/xiami-tools
---
<a name="pan.baidu.com.py"></a>
### pan.baidu.com.py - 百度网盘的下载、离线下载、上传、播放、转存、文件操作
1. 依赖
wget, aria2
python2-requests (https://github.com/kennethreitz/requests)
requests-toolbelt (https://github.com/sigmavirus24/requests-toolbelt)
mpv (http://mpv.io)
mplayer # 我的linux上mpv播放wmv出错,换用mplayer
2. 使用说明
初次使用需要登录 bp login
**支持多帐号登录**
他人分享的网盘连接,只支持单个的下载。
下载工具默认为wget, 可用参数-a num选用aria2
下载的文件,保存在当前目录下。
下载默认为非递归,递归下载加 -R
搜索时,默认在 /
搜索支持高亮
上传模式默认是 c (续传)。
理论上,上传的单个文件最大支持 2T
cookies保存在 ~/.bp.cookies
上传数据保存在 ~/.bp.pickle
关于播放操作:
> 在运行脚本的终端,输入1次Enter,关闭当前播放并播放下一个文件,连续输入2次Enter,关闭当前播放并退出。
<a name="cmd"></a>
命令:
**!!注意:命令参数中,所有网盘的路径必须是 绝对路径**
# 登录
g
login
login username
login username password
# 删除帐号
userdelete 或 ud
# 切换帐号
userchange 或 uc
# 帐号信息
user
p 或 play url1 url2 .. path1 path2 .. 播放
u 或 upload localpath remotepath 上传
s 或 save url remotepath [-s secret] 转存
# 下载
d 或 download url1 url2 .. path1 path2 .. 非递归下载 到当前目录(cwd)
d 或 download url1 url2 .. path1 path2 .. -R 递归下载 到当前目录(cwd)
# !! 注意:
# d /path/to/download -R 递归下载 *download文件夹* 到当前目录(cwd)
# d /path/to/download/ -R 递归下载 *download文件夹中的文件* 到当前目录(cwd)
# 文件操作
md 或 mkdir path1 path2 .. 创建文件夹
rn 或 rename path new_path 重命名
rm 或 remove path1 path2 .. 删除
mv 或 move path1 path2 .. /path/to/directory 移动
cp 或 copy path /path/to/directory_or_file 复制
cp 或 copy path1 path2 .. /path/to/directory 复制
# 使用正则表达式进行文件操作
rnr 或 rnre foo bar dir1 dir2 .. -I re1 re2 .. 重命名文件夹中的文件名
rmr 或 rmre dir1 dir2 .. -E re1 re2 .. 删除文件夹下匹配到的文件
mvr 或 mvre dir1 dir2 .. /path/to/dir -H head1 head2 .. 移动文件夹下匹配到的文件
cpr 或 cpre dir1 dir2 .. /path/to/dir -T tail1 tail2 .. 复制文件夹下匹配到的文件
# 递归加 -R
# rmr, mvr, cpr 中 -t, -I, -E, -H, -T 至少要有一个,放在命令行末尾
# -I, -E, -H, -T 后可跟多个匹配式
# 可以用 -t 指定操作的文件类型
-t f # 文件
-t d # 文件夹
# rnr 中 foo bar 都是 regex
# -y, --yes # 不显示警示,直接进行。 !!注意,除非你知道你做什么,否则请不要使用。
rmr / -I '.*' -y # !! 删除网盘中的所有文件
# 回复用bt.py做base64加密的文件
rnr /path/to/decode1 /path/to/decode2 .. -t f,bd64
# 搜索
f 或 find keyword1 keyword2 .. [directory] 非递归搜索
ff keyword1 keyword2 .. [directory] 非递归搜索 反序
ft keyword1 keyword2 .. [directory] 非递归搜索 by time
ftt keyword1 keyword2 .. [directory] 非递归搜索 by time 反序
fs keyword1 keyword2 .. [directory] 非递归搜索 by size
fss keyword1 keyword2 .. [directory] 非递归搜索 by size 反序
fn keyword1 keyword2 .. [directory] 非递归搜索 by name
fnn keyword1 keyword2 .. [directory] 非递归搜索 by name 反序
# 递归搜索加 -R
f 'ice and fire' /doc -R
# 搜索所有的账户加 -t all
f keyword1 keyword2 .. [directory] -t all -R
f keyword1 keyword2 .. [directory] -t f,all -R
# directory 默认为 /
# 关于-H, -T, -I, -E
# -I, -E, -H, -T 后可跟多个匹配式, 需要放在命令行末尾
f keyword1 keyword2 ... [directory] -H head -T tail -I "re(gul.*) ex(p|g)ress$"
f keyword1 keyword2 ... [directory] -H head -T tail -E "re(gul.*) ex(p|g)ress$"
# 搜索 加 通道(只支持 donwload, play, rnre, rm, mv)
f keyword1 keyword2 .. [directory] \| d -R 递归搜索后递归下载
ftt keyword1 keyword2 .. [directory] \| p -R 递归搜索(by time 反序)后递归播放
f keyword1 keyword2 .. [directory] \| rnr foo bar -R 递归搜索后rename by regex
f keyword1 keyword2 .. [directory] \| rm -R -T tail 递归搜索后删除
f keyword1 keyword2 .. [directory] \| mv /path/to -R 递归搜索后移动
# 列出文件
l path1 path2 .. ls by name
ll path1 path2 .. ls by name 反序
ln path1 path2 .. ls by name
lnn path1 path2 .. ls by name 反序
lt path1 path2 .. ls by time
ltt path1 path2 .. ls by time 反序
ls path1 path2 .. ls by size
lss path1 path2 .. ls by size 反序
l /doc/books /videos
# 以下是只列出文件或文件夹
l path1 path2 .. -t f ls files
l path1 path2 .. -t d ls directorys
# 关于-H, -T, -I, -E
# -I, -E, -H, -T 后可跟多个匹配式, 需要放在命令行末尾
l path1 path2 .. -H head -T tail -I "^re(gul.*) ex(p|g)ress$"
l path1 path2 .. -H head -T tail -E "^re(gul.*) ex(p|g)ress$"
# 显示文件size, md5
l path1 path2 .. -v
# 空文件夹
l path1 path2 -t e,d
# 非空文件夹
l path1 path2 -t ne,d
# 查看文件占用空间
du path1 path2 .. 文件夹下所有*文件(不包含下层文件夹)*总大小
du path1 path2 .. -R 文件夹下所有*文件(包含下层文件夹)*总大小
如果下层文件多,会花一些时间
# 相当于 l path1 path2 .. -t du [-R]
# eg:
du /doc /videos -R
# 离线下载
a 或 add http https ftp ed2k .. remotepath
a 或 add magnet .. remotepath [-t {m,i,d,p}]
a 或 add remote_torrent .. [-t {m,i,d,p}] # 使用网盘中torrent
# 离线任务操作
j 或 job # 列出离线下载任务
jd 或 jobdump # 清除全部 *非正在下载中的任务*
jc 或 jobclear taskid1 taskid2 .. # 清除 *正在下载中的任务*
jca 或 jobclearall # 清除 *全部任务*
参数:
-a num, --aria2c num aria2c分段下载数量: eg: -a 10
-p, --play play with mpv
-y, --yes yes # 用于 rmre, mvre, cpre, !!慎用
-q, --quiet 无输出模式
-v, --view view detail
eg: a magnet /path -v # 离线下载并显示下载的文件
d -p url1 url2 .. -v # 显示播放文件的完整路径
l path1 path2 .. -v # 显示文件的size, md5
-s SECRET, --secret SECRET 提取密码
-f number, --from_ number 从第几个开始(用于download, play),eg: p /video -f 42
-t ext, --type_ ext 类型参数, 用 “,” 分隔
eg:
l -t f # 文件
l -t d # 文件夹
l -t du # 查看文件占用空间
l -t e,d # 空文件夹
f -t all # 搜索所有账户
a -t m,d,p,a
u -t r # 只进行 rapidupload
u -t e # 如果云端已经存在则不上传(不比对md5)
u -t r,e
-l amount, --limit amount 下载速度限制,eg: -l 100k
-m {o,c}, --uploadmode {o,c} 上传模式: o # 重新上传. c # 连续上传.
-R, --recursive 递归, 用于download, play, ls, find, rmre, rnre, rmre, cpre
-H HEADS, --head HEADS 匹配开头的字符,eg: -H Headishere
-T TAILS, --tail TAILS 匹配结尾的字符,eg: -T Tailishere
-I INCLUDES, --include INCLUDES 不排除匹配到表达的文件名, 可以是正则表达式,eg: -I "*.mp3"
-E EXCLUDES, --exclude EXCLUDES 排除匹配到表达的文件名, 可以是正则表达式,eg: -E "*.html"
-c {on, off}, --ls_color {on, off} ls 颜色,默认是on
# -t, -H, -T, -I, -E 都能用于 download, play, ls, find, rnre, rmre, cpre, mvre
3. 用法
\# bp 是pan.baidu.com.py的马甲 (alias bp='python2 /path/to/pan.badiu.com.py')
登录:
bp g
bp login
bp login username
bp login username password
# 多帐号登录
# 一直用 bp login 即可
删除帐号:
bp ud
切换帐号:
bp uc
帐号信息:
bp user
下载:
# 下载自己网盘中的*单个或多个文件*
bp d http://pan.baidu.com/disk/home#dir/path=/path/to/filename1 http://pan.baidu.com/disk/home#dir/path=/path/to/filename2 ..
# or
bp d /path/to/filename1 /path/to/filename2 ..
# 递归下载自己网盘中的*单个或多个文件夹*
bp d -R http://pan.baidu.com/disk/home#dir/path=/path/to/directory1 http://pan.baidu.com/disk/home#dir/path=/path/to/directory2 ..
# or
bp d -R /path/to/directory1 /path/to/directory2 ..
# 递归下载后缀为 .mp3 的文件
bp d -R /path/to/directory1 /path/to/directory2 .. -T .mp3
# 非递归下载
bp d /path/to/directory1 /path/to/directory2 ..
# 下载别人分享的*单个文件*
bp d http://pan.baidu.com/s/1o6psfnxx ..
bp d http://pan.baidu.com/share/link?shareid=1622654699&uk=1026372002&fid=2112674284 ..
# 下载别人加密分享的*单个文件*,密码参数-s
bp d http://pan.baidu.com/s/1i3FVlw5 -s vuej
# 用aria2下载
bp d http://pan.baidu.com/s/1i3FVlw5 -s vuej -a 5
bp d /movie/her.mkv -a 4
bp d url -s [secret] -a 10
播放:
bp p /movie/her.mkv
bp p http://pan.baidu.com/s/xxxxxxxxx -s [secret]
bp p /movie -R # 递归播放 /movie 中所有媒体文件
离线下载:
bp a http://mirrors.kernel.org/archlinux/iso/latest/archlinux-2014.06.01-dual.iso /path/to/save
bp a https://github.com/PeterDing/iScript/archive/master.zip /path/to/save
bp a ftp://ftp.netscape.com/testfile /path/to/save
bp a 'magnet:?xt=urn:btih:64b7700828fd44b37c0c045091939a2c0258ddc2' /path/to/save -v -t a
bp a 'ed2k://|file|[美]徐中約《中国近代史》第六版原版PDF.rar|547821118|D09FC5F70DEA63E585A74FBDFBD7598F|/' /path/to/save
bp a /path/to/a.torrent .. -v -t m,i # 使用网盘中torrent,下载到/path/to
# 注意 ---------------------
↓
网盘中的torrent
magnet离线下载 -- 文件选择:
-t m # 视频文件 (默认), 如: mkv, avi ..etc
-t i # 图像文件, 如: jpg, png ..etc
-t d # 文档文件, 如: pdf, doc, docx, epub, mobi ..etc
-t p # 压缩文件, 如: rar, zip ..etc
-t a # 所有文件
m, i, d, p, a 可以任意组合(用,分隔), 如: -t m,i,d -t d,p -t i,p
remotepath 默认为 /
bp a 'magnet:?xt=urn:btih:64b7700828fd44b37c0c045091939a2c0258ddc2' /path/to/save -v -t p,d
bp a /download/a.torrent -v -t m,i,d # 使用网盘中torrent,下载到/download
离线任务操作:
bp j
bp j 3482938 8302833
bp jd
bp jc taskid1 taskid2 ..
bp jc 1208382 58239221 ..
bp jca
上传:
bp u ~/Documents/reading/三体\ by\ 刘慈欣.mobi /doc -m o
# 上传模式:
# -m o --> 重传
# -m c --> 续传 (默认)
bp u ~/Videos/*.mkv /videos -t r
# 只进行rapidupload
bp u ~/Documents ~/Videos ~/Documents /backup -t e
# 如果云端已经存在则不上传(不比对md5)
# 用 -t e 时, -m o 无效
bp u ~/Documents ~/Videos ~/Documents /backup -t r,e # 以上两种模式
转存:
bp s url remotepath [-s secret]
# url是他人分享的连接, 如: http://pan.baidu.com/share/link?shareid=xxxxxxx&uk=xxxxxxx, http://pan.baidu.com/s/xxxxxxxx
bp s http://pan.baidu.com/share/link?shareid=xxxxxxx&uk=xxxxxxx /path/to/save
bp s http://pan.baidu.com/s/xxxxxxxx /path/to/save
bp s http://pan.baidu.com/s/xxxxxxxx /path/to/save -s xxxx
bp s http://pan.baidu.com/s/xxxxxxxx#dir/path=/path/to/anything /path/to/save -s xxxx
bp s http://pan.baidu.com/inbox/i/xxxxxxxx /path/to/save
搜索:
bp f keyword1 keyword2
bp f "this is one keyword" "this is another keyword" /path/to/search
bp f ooxx -R
bp f 三体 /doc/fiction -R
bp f 晓波 /doc -R
bp ff keyword1 keyword2 .. /path/to/music 非递归搜索 反序
bp ft keyword1 keyword2 .. /path/to/doc 非递归搜索 by time
bp ftt keyword1 keyword2 .. /path/to/other 非递归搜索 by time 反序
bp fs keyword1 keyword2 .. 非递归搜索 by size
bp fss keyword1 keyword2 .. 非递归搜索 by size 反序
bp fn keyword1 keyword2 .. 非递归搜索 by name
bp fnn keyword1 keyword2 .. 非递归搜索 by name 反序
# 递归搜索加 -R
# 关于-H, -T, -I, -E
bp f mp3 /path/to/search -H "[" "01" -T ".tmp" -I ".*-.*" -R
# 搜索所有的账户
f iDoNotKnow .. [directory] -t all -R
f archlinux ubuntu .. [directory] -t f,all -T .iso -R
# 搜索 加 通道(只支持 donwload, play, rnre, rm, mv)
f bioloy \| d -R 递归搜索后递归下载
ftt ooxx \| p -R -t f 递归搜索(by time 反序)后递归播放
f sound \| rnr mp3 mp4 -R 递归搜索后rename by regex
f ccav \| rm -R -T avi 递归搜索后删除
f 新闻联播(大结局) \| mv /Favor -R 递归搜索后移动
回复用bt.py做base64加密的文件:
rnr /ooxx -t f,bd64
!! 注意: /ooxx 中的所有文件都必须是被base64加密的,且加密段要有.base64后缀
# 可以参考 by.py 的用法
ls、重命名、移动、删除、复制、使用正则表达式进行文件操作:
见[命令](#cmd)
4. 参考:
> https://gist.github.com/HououinRedflag/6191023
> https://github.com/banbanchs/pan-baidu-download/blob/master/bddown_core.py
> https://github.com/houtianze/bypy
---
<a name="bt.py"></a>
### bt.py - magnet torrent 互转、及 过滤敏.感.词
1. 依赖
python2-requests (https://github.com/kennethreitz/requests)
bencode (https://github.com/bittorrent/bencode)
2. 使用说明
magnet 和 torrent 的相互转换
~~过滤敏.感.词功能用于净网时期的 baidu, xunlei~~
**8.30日后,无法使用。 见 http://tieba.baidu.com/p/3265467666**
~~**!! 注意:过滤后生成的torrent在百度网盘只能用一次,如果需要再次使用,则需用 -n 改顶层目录名**~~
磁力连接转种子,用的是
http://bt.box.n0808.com
http://btcache.me
http://www.sobt.org # 302 --> http://www.win8down.com/url.php?hash=
http://www.31bt.com
http://178.73.198.210
http://www.btspread.com # link to http://btcache.me
http://torcache.net
http://zoink.it
http://torrage.com # 用torrage.com需要设置代理, eg: -p 127.0.0.1:8087
http://torrentproject.se
http://istoretor.com
http://torrentbox.sx
http://www.torrenthound.com
http://www.silvertorrent.org
http://magnet.vuze.com
如果有更好的种子库,请提交issue
> 对于baidu, 加入离线任务后,需等待一段时间才会下载完成。
命令:
# magnet 2 torrent
m 或 mt magnet_link1 magnet_link2 .. [-d /path/to/save]
m -i /there/are/files -d new
# torrent 2 magnet, 输出magnet
t 或 tm path1 path2 ..
# 过滤敏.感.词
# 有2种模式
# -t n (默认) 用数字替换文件名
# -t be64 用base64加密文件名,torrent用百度下载后,可用 pan.baidu.com.py rnr /path -t f,bd64 改回原名字
c 或 ct magnet_link1 magnet_link2 .. /path/to/torrent1 /path/to/torrent2 .. [-d /path/to/save]
c -i /there/are/files and_other_dir -d new # 从文件或文件夹中寻找 magnet,再过滤
# 过滤敏.感.词 - 将magnet或torrent转成不敏感的 torrent
# /path/to/save 默认为 .
# 用base64加密的文件名:
c magnet_link1 magnet_link2 .. /path/to/torrent1 /path/to/torrent2 .. [-d /path/to/save] -t be64
# 使用正则表达式过滤敏.感.词
cr 或 ctre foo bar magnet_link1 /path/to/torrent1 .. [-d /path/to/save]
# foo bar 都是 regex
参数:
-p PROXY, --proxy PROXY proxy for torrage.com, eg: -p 127.0.0.1:8087 (默认)
-t TYPE_, --type_ TYPE_ 类型参数:
-t n (默认) 用数字替换文件名
-t be64 用base64加密文件名,torrent用百度下载后,可用 pan.baidu.com.py rnr /path -t f,bd64 改回原名字
-d DIRECTORY, --directory DIRECTORY 指定torrents的保存路径, eg: -d /path/to/save
-n NAME, --name NAME 顶级文件夹名称, eg: -m thistopdirectory
-i localpath1 localpath2 .., --import_from localpath1 localpath2 .. 从本地文本文件导入magnet (用正则表达式匹配)
3. 用法
\# bt 是bt.py的马甲 (alias bt='python2 /path/to/bt.py')
bt mt magnet_link1 magnet_link2 .. [-d /path/to/save]
bt tm path1 path2 ..
bt ct magnet_link1 path1 .. [-d /path/to/save]
bt m magnet_link1 magnet_link2 .. [-d /path/to/save]
bt t path1 path2 ..
bt c magnet_link1 path1 .. [-d /path/to/save]
# 用torrage.com
bt m magnet_link1 path1 .. -p 127.0.0.1:8087
bt c magnet_link1 path1 .. -p 127.0.0.1:8087
# 从文件或文件夹中寻找 magnet,再过滤
bt c -i ~/Downloads -d new
# 使用正则表达式过滤敏.感.词
bt cr '.*(old).*' '\1' magnet_link
bt cr 'old.iso' 'new.iso' /path/to/torrent
# 用base64加密的文件名:
bt c magnet_link -t be64
4. 参考:
> http://blog.chinaunix.net/uid-28450123-id-4051635.html
> http://en.wikipedia.org/wiki/Torrent_file
---
<a name="115.py"></a>
### 115.py - 115网盘的下载和播放
1. 依赖
wget, aria2
python2-requests (https://github.com/kennethreitz/requests)
mpv (http://mpv.io)
mplayer # 我的linux上mpv播放wmv出错,换用mplayer
2. 使用说明
初次使用需要登录 pan115 login
**脚本是用于下载自己的115网盘文件,不支持他人分享文件。**
**非vip用户下载只能有4个通道,理论上,用aria2的下载速度最大为 4*300kb/s。**
下载工具默认为wget, 可用参数-a选用aria2。
对所有文件,默认执行下载(用wget),如要播放媒体文件,加参数-p。
下载的文件,保存在当前目录下。
cookies保存在 ~/.115.cookies
关于播放操作:
> 在运行脚本的终端,输入1次Enter,关闭当前播放并播放下一个文件,连续输入2次Enter,关闭当前播放并退出。
参数:
-a, --aria2c download with aria2c
-p, --play play with mpv
-f number, --from_ number 从第几个开始下载,eg: -f 42
-t ext, --type_ ext 要下载的文件的后缀,eg: -t mp3
-l amount, --limit amount 下载速度限制,eg: -l 100k
-d "url" 增加离线下载 "http/ftp/magnet/ed2k"
3. 用法
\# pan115 是115.py的马甲 (alias pan115='python2 /path/to/115.py')
# 登录
pan115 g
pan115 login
pan115 login username
pan115 login username password
# 退出登录
pan115 signout
# 递归下载自己网盘中的*文件夹*
pan115 http://115.com/?cid=xxxxxxxxxxxx&offset=0&mode=wangpan
# 下载自己网盘中的*单个文件* -- 只能是115上可单独打开的文件,如pdf,视频
pan115 http://wenku.115.com/preview/?pickcode=xxxxxxxxxxxx
# 下载用aria2, url 是上面的
pan115 -a url
# 增加离线下载
pan115 -d "magnet:?xt=urn:btih:757fc565c56462b28b4f9c86b21ac753500eb2a7&dn=archlinux-2014.04.01-dual.iso"
播放
# url 是上面的
pan115 -p url
4. 参考:
> http://passport.115.com/static/wap/js/common.js?v=1.6.39
---
<a name="yunpan.360.cn.py"></a>
### yunpan.360.cn.py - 360网盘的下载
1. 依赖
wget, aria2
python2-requests (https://github.com/kennethreitz/requests)
2. 使用说明
初次使用需要登录 yp login
**!!!!!! 万恶的360不支持断点续传 !!!!!!**
由于上面的原因,不能播放媒体文件。
只支持自己的\*文件夹\*的递归下载。
下载工具默认为wget, 可用参数-a选用aria2
下载的文件,保存在当前目录下。
cookies保存在 ~/.360.cookies
参数:
-a, --aria2c download with aria2c
-f number, --from_ number 从第几个开始下载,eg: -f 42
-t ext, --type_ ext 要下载的文件的后缀,eg: -t mp3
-l amount, --limit amount 下载速度限制,eg: -l 100k
3. 用法
\# yp 是yunpan.360.cn.py的马甲 (alias yp='python2 /path/to/yunpan.360.cn.py')
# 登录
yp g
yp login
yp login username
yp login username password
# 退出登录
yp signout
# 递归下载自己网盘中的*文件夹*
yp http://c17.yunpan.360.cn/my/?sid=#/path/to/directory
yp http://c17.yunpan.360.cn/my/?sid=#%2Fpath%3D%2Fpath%2Fto%2Fdirectory
# or
yp sid=/path/to/directory
yp sid%3D%2Fpath%2Fto%2Fdirectory
# 下载用aria2, url 是上面的
yp -a url
4. 参考:
> https://github.com/Shu-Ji/gorthon/blob/master/_3rdapp/CloudDisk360/main.py
---
<a name="music.baidu.com.py"></a>
### music.baidu.com.py - 下载或播放高品质百度音乐(music.baidu.com)
1. 依赖
wget
python2-mutagen (https://code.google.com/p/mutagen/)
mpv (http://mpv.io)
2. 使用说明
默认执行下载,如要播放,加参数-p。
参数:
-f, --flac download flac
-i, --high download 320, default
-l, --low download 128
-p, --play play with mpv
下载的MP3默认添加id3 tags,保存在当前目录下。
关于播放操作:
> 在运行脚本的终端,输入1次Enter,关闭当前播放并播放下一个文件,连续输入2次Enter,关闭当前播放并退出。
3. 用法
\# bm 是music.baidu.com.py的马甲 (alias bm='python2 /path/to/music.baidu.com.py')
# 下载专辑
bm http://music.baidu.com/album/115032005
# 下载单曲
bm http://music.baidu.com/song/117948039
播放:
# url 是上面的
bm -p url
4. 参考:
> http://v2ex.com/t/77685 # 第9楼
---
<a name="music.163.com.py"></a>
### music.163.com.py - 下载或播放高品质网易音乐(music.163.com)
1. 依赖
wget
python2-requests (https://github.com/kennethreitz/requests)
python2-mutagen (https://code.google.com/p/mutagen/)
mpv (http://mpv.io)
2. 使用说明
**默认下载和播放高品质音乐,如果服务器没有高品质音乐则转到低品质音乐。**
默认执行下载,如要播放,加参数-p。
下载的MP3默认添加id3 tags,保存在当前目录下。
关于播放操作:
> 在运行脚本的终端,输入1次Enter,关闭当前播放并播放下一个文件,连续输入2次Enter,关闭当前播放并退出。
3. 用法
\# nm 是music.163.com.py的马甲 (alias nm='python2 /path/to/music.163.com.py')
# 下载专辑
nm http://music.163.com/#/album?id=18915
# 下载单曲
nm http://music.163.com/#/song?id=186114
# 下载歌单
nm http://music.163.com/#/playlist?id=12214308
# 下载该艺术家所有专辑或 Top 50 歌曲
nm http://music.163.com/#/artist?id=6452
# 下载DJ节目
nm http://music.163.com/#/dj?id=675051
# 下载排行榜
nm http://music.163.com/#/discover/toplist?id=11641012
播放:
# url 是上面的
nm -p url
4. 参考:
> https://github.com/yanunon/NeteaseCloudMusic/wiki/%E7%BD%91%E6%98%93%E4%BA%91%E9%9F%B3%E4%B9%90API%E5%88%86%E6%9E%90
> http://s3.music.126.net/s/2/core.js
---
<a name="flvxz_cl.py"></a>
### flvxz_cl.py - flvxz.com 视频解析 client - 支持下载、播放
1. 依赖
wget
python2-requests (https://github.com/kennethreitz/requests)
mpv (http://mpv.io)
2. 使用说明
flvxz.com 视频解析
**不提供视频合并操作**
支持的网站:
"""
已知支持120个以上视频网站,覆盖大多数国内视频站点,少量国外视频站点
"""
-- flvxz.com
关于播放操作:
> 在运行脚本的终端,输入1次Enter,关闭当前播放并播放下一个文件,连续输入2次Enter,关闭当前播放并退出。
3. 用法
\# fl是flvxz_cl.py的马甲 (alias fl='python2 /path/to/flvxz_cl.py')
下载:
fl http://v.youku.com/v_show/id_XNTI2Mzg4NjAw.html
fl http://www.tudou.com/albumplay/Lqfme5hSolM/tJ_Gl3POz7Y.html
播放:
# url 是上面的
fl url -p
4. 相关脚本:
> https://github.com/iambus/youku-lixian
> https://github.com/rg3/youtube-dl
> https://github.com/soimort/you-get
---
<a name="tumblr.py"></a>
### tumblr.py - 下载某个tumblr.com的所有图片
1. 依赖
wget
python2-requests (https://github.com/kennethreitz/requests)
2. 使用说明
* 使用前需用在 http://www.tumblr.com/oauth/apps 加入一个app,证实后得到api_key,再在源码中填入,完成后则可使用。
* 或者用 http://www.tumblr.com/docs/en/api/v2 提供的api_key ( fuiKNFp9vQFvjLNvx4sUwti4Yb5yGutBN4Xh10LXZhhRKjWlV4 )
默认开5个进程,如需改变用参数-p [num]。
下载的文件,保存在当前目录下。
默认下载原图。
支持连续下载,下载进度储存在下载文件夹内的 json.json。
参数:
-p PROCESSES, --processes PROCESSES 指定多进程数,默认为5个,最多为20个 eg: -p 20
-c, --check 尝试修复未下载成功的图片
-t TAG, --tag TAG 下载特定tag的图片, eg: -t beautiful
3. 用法
\# tm是tumblr.py的马甲 (alias tm='python2 /path/to/tumblr.py')
# 下载某个tumblr
tm http://sosuperawesome.tumblr.com/
tm http://sosuperawesome.tumblr.com/ -t beautiful
# 指定tag下载
tm beautiful
tm cool
---
<a name="unzip.py"></a>
### unzip.py - 解决linux下unzip乱码的问题
用法
python2 unzip.py azipfile1.zip azipfile2.zip ..
python2 unzip.py azipfile.zip -s secret
# -s 密码
代码来自以下连接,我改了一点。
> http://wangqige.com/the-solution-of-unzip-files-which-zip-under-windows/解决在Linux环境下解压zip的乱码问题
---
<a name="ed2k_search.py"></a>
### ed2k_search.py - 基于 donkey4u.com 的emule搜索
1. 依赖
python2
2. 用法
\# ed 是ed2k_search.py的马甲 (alias ed='python2 /path/to/ed2k_search.py')
ed this is a keyword
or
ed "this is a keyword"
---
<a name="91porn.py"></a>
### 91porn.py - 下载或播放91porn
**警告: 18岁以下者,请自觉远离。**
1. 依赖
wget, aria2
python2-requests (https://github.com/kennethreitz/requests)
mpv (http://mpv.io)
2. 使用说明
> 没有解决 *7个/day* 限制
下载工具默认为wget, 可用参数-a选用aria2
默认执行下载,如要播放媒体文件,加参数-p。
下载的文件,保存在当前目录下。
关于播放操作:
> 在运行脚本的终端,输入1次Enter,关闭当前播放并播放下一个文件,连续输入2次Enter,关闭当前播放并退出。
3. 用法
\# pn 是91porn.py的马甲 (alias pn='python2 /path/to/91porn.py')
pn url # 91porn.com(或其镜像) 视频的url
播放:
pn -p url
4. 参考
> http://v2ex.com/t/110196 # 第16楼
---
<a name="ThunderLixianExporter.user.js"></a>
### ThunderLixianExporter.user.js - A fork of https://github.com/binux/ThunderLixianExporter
**一个github.com/binux的迅雷离线导出脚本的fork。**
增加了mpv和mplayer的导出。
用法见: https://github.com/binux/ThunderLixianExporter
| linpan/iScript | README.md | Markdown | mit | 36,263 | 26.069703 | 151 | 0.539122 | false |
export default {
cache: function (state, payload) {
state.apiCache[payload.api_url] = payload.api_response;
},
addConfiguredType: function (state, type) {
state.configuredTypes.push(type);
},
removeConfiguredType: function (state, index) {
state.configuredTypes.splice(index, 1);
},
updateConfiguredType: function (state, type) {
for (var i = 0, len = state.configuredTypes.length; i < len; i++) {
if (state.configuredTypes[i].name === type.name) {
state.configuredTypes.splice(i, 1);
state.configuredTypes.push(type);
// Avoid too keep looping over a spliced array
return;
}
}
},
setBaseExtraFormTypes: function (state, types) {
state.baseTypes = types;
},
setConfiguredExtraFormTypes: function (state, types) {
state.configuredTypes = types;
}
};
| IDCI-Consulting/ExtraFormBundle | Resources/public/js/editor/src/store/mutations.js | JavaScript | mit | 854 | 22.722222 | 71 | 0.648712 | false |
FROM gliderlabs/alpine:latest
MAINTAINER Carlos León <mail@carlosleon.info>
RUN apk-install darkhttpd
EXPOSE 80
ENTRYPOINT ["/usr/bin/darkhttpd"]
CMD ["/var/www", "--chroot"]
| mongrelion/di-darkhttpd | Dockerfile | Dockerfile | mit | 181 | 15.363636 | 45 | 0.744444 | false |
### 实现元素拖拽功能:
- EventUtil 封装跨浏览器时间处理对象
- EventTarget 自定义事件对象
- dragdrop 在其中实现元素拖拽
关键点:
**被拖拽元素使用 绝对定位absolute 或 相对定位relative**,在mousemove事件中,重新设置left 及 top值
添加mousedown/mouseup事件
修缮拖动:鼠标点击位置与元素顶端位置差异 | 7986LiChang/MyLearnDemos | js/DragDrop/README.md | Markdown | mit | 388 | 17.454545 | 69 | 0.811881 | false |
'-------------------------------------------------------------------------------------------'
' Inicio del codigo
'-------------------------------------------------------------------------------------------'
' Importando librerias
'-------------------------------------------------------------------------------------------'
Imports System.Data
'-------------------------------------------------------------------------------------------'
' Inicio de clase "PAS_fNotas_Credito"
'-------------------------------------------------------------------------------------------'
Partial Class PAS_fNotas_Credito
Inherits vis2formularios.frmReporte
Dim loObjetoReporte As CrystalDecisions.CrystalReports.Engine.ReportDocument
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
Dim loConsulta As New StringBuilder()
loConsulta.AppendLine("SELECT Clientes.Nom_Cli,")
loConsulta.AppendLine(" Clientes.Rif,")
loConsulta.AppendLine(" Clientes.Nit,")
loConsulta.AppendLine(" Clientes.Dir_Fis,")
loConsulta.AppendLine(" Clientes.Telefonos,")
loConsulta.AppendLine(" Clientes.Fax,")
loConsulta.AppendLine(" Cuentas_Cobrar.Documento,")
loConsulta.AppendLine(" CASE WHEN DAY(Cuentas_Cobrar.Fec_Ini) < 10")
loConsulta.AppendLine(" THEN CONCAT('0', DAY(Cuentas_Cobrar.Fec_Ini))")
loConsulta.AppendLine(" ELSE DAY(Cuentas_Cobrar.Fec_Ini)")
loConsulta.AppendLine(" END AS Dia,")
loConsulta.AppendLine(" CASE WHEN MONTH(Cuentas_Cobrar.Fec_Ini) < 10 ")
loConsulta.AppendLine(" THEN CONCAT('0', MONTH(Cuentas_Cobrar.Fec_Ini))")
loConsulta.AppendLine(" ELSE MONTH(Cuentas_Cobrar.Fec_Ini)")
loConsulta.AppendLine(" END AS Mes,")
loConsulta.AppendLine(" YEAR(Cuentas_Cobrar.Fec_Ini) AS Anio,")
loConsulta.AppendLine(" Cuentas_Cobrar.Mon_Bru AS Mon_Bru, ")
loConsulta.AppendLine(" Cuentas_Cobrar.Mon_Imp1 AS Mon_Imp1, ")
loConsulta.AppendLine(" Cuentas_Cobrar.Por_Imp1 AS Por_Imp1, ")
loConsulta.AppendLine(" Cuentas_Cobrar.Mon_Net AS Mon_Net,")
loConsulta.AppendLine(" Cuentas_Cobrar.Mon_Sal AS Mon_Sal,")
loConsulta.AppendLine(" Cuentas_Cobrar.Por_Des AS Por_Des, ")
loConsulta.AppendLine(" Cuentas_Cobrar.Mon_Des AS Mon_Des, ")
loConsulta.AppendLine(" Cuentas_Cobrar.Comentario,")
loConsulta.AppendLine(" Cuentas_Cobrar.Referencia,")
loConsulta.AppendLine(" Renglones_Documentos.Can_Art,")
loConsulta.AppendLine(" Renglones_Documentos.Cod_Uni,")
loConsulta.AppendLine(" Renglones_Documentos.Precio1,")
loConsulta.AppendLine(" Renglones_Documentos.Precio2,")
loConsulta.AppendLine(" Renglones_Documentos.Mon_Net AS Neto,")
loConsulta.AppendLine(" Renglones_Documentos.Comentario AS Com_Renglon,")
loConsulta.AppendLine(" Renglones_Documentos.Notas,")
loConsulta.AppendLine(" Articulos.Nom_Art")
loConsulta.AppendLine("FROM Cuentas_Cobrar")
loConsulta.AppendLine(" JOIN Clientes ")
loConsulta.AppendLine(" ON Cuentas_Cobrar.Cod_Cli = Clientes.Cod_Cli")
loConsulta.AppendLine(" JOIN Renglones_Documentos ")
loConsulta.AppendLine(" ON Cuentas_Cobrar.Documento = Renglones_Documentos.Documento")
loConsulta.AppendLine(" AND Renglones_Documentos.Cod_Tip = 'N/CR'")
loConsulta.AppendLine(" JOIN Articulos ")
loConsulta.AppendLine(" ON Renglones_Documentos.Cod_Art = Articulos.Cod_Art")
loConsulta.AppendLine(" ")
loConsulta.AppendLine("WHERE " & cusAplicacion.goFormatos.pcCondicionPrincipal)
Dim loServicios As New cusDatos.goDatos()
' Me.mEscribirConsulta(loConsulta.ToString())
Dim laDatosReporte As DataSet = loServicios.mObtenerTodosSinEsquema(loConsulta.ToString(), "curReportes")
'Dim lcXml As String = "<impuesto></impuesto>"
'Dim lcPorcentajesImpueto As String
'Dim loImpuestos As New System.Xml.XmlDocument()
'lcPorcentajesImpueto = "("
''Recorre cada renglon de la tabla
'For lnNumeroFila As Integer = 0 To laDatosReporte.Tables(0).Rows.Count - 1
' lcXml = laDatosReporte.Tables(0).Rows(lnNumeroFila).Item("dis_imp")
' If String.IsNullOrEmpty(lcXml.Trim()) Then
' Continue For
' End If
' loImpuestos.LoadXml(lcXml)
' 'En cada renglón lee el contenido de la distribució de impuestos
' For Each loImpuesto As System.Xml.XmlNode In loImpuestos.SelectNodes("impuestos/impuesto")
' If lnNumeroFila = laDatosReporte.Tables(0).Rows.Count - 1 Then
' If CDec(loImpuesto.SelectSingleNode("porcentaje").InnerText) <> 0 Then
' lcPorcentajesImpueto = lcPorcentajesImpueto & ", " & CDec(loImpuesto.SelectSingleNode("porcentaje").InnerText) & "%"
' End If
' End If
' Next loImpuesto
'Next lnNumeroFila
'lcPorcentajesImpueto = lcPorcentajesImpueto & ")"
'lcPorcentajesImpueto = lcPorcentajesImpueto.Replace("(,", "(")
'--------------------------------------------------'
' Carga la imagen del logo en cusReportes '
'--------------------------------------------------'
Me.mCargarLogoEmpresa(laDatosReporte.Tables(0), "LogoEmpresa")
'-------------------------------------------------------------------------------------------------------
' Verificando si el select (tabla nº0) trae registros
'-------------------------------------------------------------------------------------------------------
If (laDatosReporte.Tables(0).Rows.Count <= 0) Then
Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Información", _
"No se Encontraron Registros para los Parámetros Especificados. ", _
vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Informacion, _
"350px", _
"200px")
End If
loObjetoReporte = cusAplicacion.goFormatos.mCargarInforme("PAS_fNotas_Credito", laDatosReporte)
'lcPorcentajesImpueto = lcPorcentajesImpueto.Replace(".", ",")
'CType(loObjetoReporte.ReportDefinition.ReportObjects("Text1"), CrystalDecisions.CrystalReports.Engine.TextObject).Text = lcPorcentajesImpueto.ToString
Me.mTraducirReporte(loObjetoReporte)
Me.mFormatearCamposReporte(loObjetoReporte)
Me.crvPAS_fNotas_Credito.ReportSource = loObjetoReporte
Catch loExcepcion As Exception
Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Error", _
"No se pudo Completar el Proceso: " & loExcepcion.Message, _
vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Error, _
"auto", _
"auto")
End Try
End Sub
Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
Try
loObjetoReporte.Close()
Catch loExcepcion As Exception
End Try
End Sub
End Class
'-------------------------------------------------------------------------------------------'
' Fin del codigo '
'-------------------------------------------------------------------------------------------'
' GMO: 16/08/08: Codigo inicial. '
'-------------------------------------------------------------------------------------------'
' JJD: 08/11/08: Ajustes al select. '
'-------------------------------------------------------------------------------------------'
' RJG: 01/09/09: Agregado código para mostrar unidad segundaria. '
'-------------------------------------------------------------------------------------------'
' CMS: 10/09/09: Se ajusto el nombre del articulo para los casos de aquellos articulos gen. '
'-------------------------------------------------------------------------------------------'
' JJD: 09/01/10: Se cambio para que leyera los datos genericos de la Factura cuando aplique.'
'-------------------------------------------------------------------------------------------'
' CMS: 18/03/10: Se aplicaron los metodos carga de imagen y validacion de registro cero. '
'-------------------------------------------------------------------------------------------'
' CMS: 19/03/10: Se a justo la logica para determinar el nombre del cliente '
' (Clientes.Generico = 0 ) a (Clientes.Generico = 0 AND Cuentas_Cobrar.Nom_Cli = '') '
'-------------------------------------------------------------------------------------------'
' MAT: 23/02/11: Se programo la distribución de impuestos para mostrarlo en el formato. '
'-------------------------------------------------------------------------------------------'
' MAT: 19/04/11 : Ajuste de la vista de diseño. '
'-------------------------------------------------------------------------------------------'
' RJG: 06/02/14 : Ajuste de la formato (comentario, indentación...) de código y SQL. '
'-------------------------------------------------------------------------------------------'
| kodeitsolutions/ef-reports | PAS_fNotas_Credito.aspx.vb | Visual Basic | mit | 10,260 | 56.898305 | 163 | 0.476093 | false |
.PHONY: build clean
build: .obj/chilon_sql_to_source
clean:
rm -rf .obj
.obj/%: %.cpp
@mkdir -p .obj
${CXX} -std=c++0x $^ -o $@ -I ../..
ifeq ($(wildcard .obj/*),)
install:
else
install:
@mkdir -p ${DESTDIR}/${prefix}/bin
@strip .obj/*
@cp .obj/* ${DESTDIR}/${prefix}/bin
endif
| ohjames/chilon | bin/Makefile | Makefile | mit | 288 | 14.157895 | 36 | 0.579861 | false |
package com.korpisystems.SimpleANN
import org.scalatest.FunSuite
class ANNTest extends FunSuite {
test("ANN learns non-linear XOR properly") {
val inputs: ExpectedValues = List(
List(1, 1)
, List(0, 1)
, List(1, 0)
, List(0, 0)
)
val expected_out: ExpectedValues = List(
List(0)
, List(1)
, List(1)
, List(0)
)
val ann = new ANN(List(2, 4, 1), 1.0)
ann.train(inputs, expected_out, iter=5000)
val xor_1_1 = ann.getOutput(inputs(0))(0)
assert(xor_1_1 < 0.04)
val xor_0_1 = ann.getOutput(inputs(1))(0)
assert(xor_0_1 > 0.96)
val xor_1_0 = ann.getOutput(inputs(2))(0)
assert(xor_1_0 > 0.96)
val xor_0_0 = ann.getOutput(inputs(3))(0)
assert(xor_0_0 < 0.04)
}
test("ANN learns XOR with multiple hidden layers") {
val inputs: ExpectedValues = List(
List(1, 1)
, List(0, 1)
, List(1, 0)
, List(0, 0)
)
val expected_out: ExpectedValues = List(
List(0)
, List(1)
, List(1)
, List(0)
)
val ann = new ANN(List(2, 4, 3, 1), 1.0)
ann.train(inputs, expected_out, iter=5000)
val xor_1_1 = ann.getOutput(inputs(0))(0)
assert(xor_1_1 < 0.04)
val xor_0_1 = ann.getOutput(inputs(1))(0)
assert(xor_0_1 > 0.96)
val xor_1_0 = ann.getOutput(inputs(2))(0)
assert(xor_1_0 > 0.96)
val xor_0_0 = ann.getOutput(inputs(3))(0)
assert(xor_0_0 < 0.04)
}
test("ANN learns first input is output") {
val inputs: ExpectedValues = List(
List(1, 1)
, List(0, 1)
, List(1, 0)
, List(0, 0)
)
val expected_out: ExpectedValues = List(
List(1)
, List(0)
, List(1)
, List(0)
)
val ann = new ANN(List(2, 4, 1), 1.0)
ann.train(inputs, expected_out, iter=5000)
val first_1_1 = ann.getOutput(inputs(0))(0)
assert(first_1_1 > 0.96)
val first_0_1 = ann.getOutput(inputs(1))(0)
assert(first_0_1 < 0.04)
val first_1_0 = ann.getOutput(inputs(2))(0)
assert(first_1_0 > 0.96)
val first_0_0 = ann.getOutput(inputs(3))(0)
assert(first_0_0 < 0.04)
}
test("ANN learns second input is output") {
val inputs: ExpectedValues = List(
List(1, 1)
, List(0, 1)
, List(1, 0)
, List(0, 0)
)
val expected_out: ExpectedValues = List(
List(1)
, List(1)
, List(0)
, List(0)
)
val ann = new ANN(List(2, 4, 1), 1.0)
ann.train(inputs, expected_out, iter=5000)
val first_1_1 = ann.getOutput(inputs(0))(0)
assert(first_1_1 > 0.96)
val first_0_1 = ann.getOutput(inputs(1))(0)
assert(first_0_1 > 0.96)
val first_1_0 = ann.getOutput(inputs(2))(0)
assert(first_1_0 < 0.04)
val first_0_0 = ann.getOutput(inputs(3))(0)
assert(first_0_0 < 0.04)
}
test("UnevenTrainingInstanceLists thrown properly") {
val inputs: ExpectedValues = List(
List(1, 1)
, List(0, 1)
, List(1, 0)
, List(0, 0)
)
val expected_out: ExpectedValues = List(
List(1)
, List(0)
, List(1)
)
val ann = new ANN(List(2, 4, 1), 1.0)
intercept[Exceptions.UnevenTrainingInstanceLists] {
ann.train(inputs, expected_out, iter=5000)
}
}
}
| rdtaylor/SimpleANN | src/test/scala/com/korpisystems/ANN/ANNTest.scala | Scala | mit | 3,200 | 20.333333 | 55 | 0.56125 | false |
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
| alxhub/angular | aio/src/test.ts | TypeScript | mit | 640 | 31 | 97 | 0.751563 | false |
/**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /*
@author Axel Anceau - 2014
Package api contains general tools
*/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/
package api
import (
"fmt"
"github.com/revel/revel"
"runtime/debug"
)
/**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /*
PanicFilter renders a panic as JSON
@see revel/panic.go
*/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/
func PanicFilter(c *revel.Controller, fc []revel.Filter) {
defer func() {
if err := recover(); err != nil && err != "HttpException" {
error := revel.NewErrorFromPanic(err)
if error == nil {
revel.ERROR.Print(err, "\n", string(debug.Stack()))
c.Response.Out.WriteHeader(500)
c.Response.Out.Write(debug.Stack())
return
}
revel.ERROR.Print(err, "\n", error.Stack)
c.Result = HttpException(c, 500, fmt.Sprint(err))
}
}()
fc[0](c, fc[1:])
}
| Peekmo/RPGit | api/filters.go | GO | mit | 953 | 24.078947 | 67 | 0.459601 | false |
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Tree View</title>
<link href="01.tree-view.css" rel="stylesheet" />
</head>
<body>
<nav>
<ul class="first">
<li>
<a href="#">List Item</a>
<ul>
<li>
<a href="#">Sublist item</a>
</li>
<li>
<a href="#">Sublist item</a>
</li>
<li>
<a href="#">Sublist item</a>
</li>
<li>
<a href="#">Sublist item</a>
</li>
</ul>
</li>
<li>
<a href="#">List Item</a>
<ul>
<li>
<a href="#">Sublist item</a>
</li>
<li>
<a href="#">Sublist item</a>
</li>
</ul>
</li>
<li>
<a href="#">List Item</a>
<ul>
<li>
<a href="#">Sublist item</a>
</li>
<li>
<a href="#">Sublist item</a>
</li>
<li>
<a href="#">Sublist item</a>
</li>
</ul>
</li>
<li>
<a href="#">List Item</a>
<ul>
<li>
<a href="#">Sublist item</a>
</li>
</ul>
</li>
</ul>
</nav>
</body>
</html>
| zhenyaracheva/TelerikAcademy | CSS/CSSLayout/01.tree-view.html | HTML | mit | 1,546 | 23.539683 | 53 | 0.278784 | false |
---
layout: post
author: nurahill
title: "Nura's Clicky turtle excercise"
---
Here is my code for option 1:
<iframe src="https://trinket.io/embed/python/3c8744a1ac" width="100%" height="600" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen></iframe>
On option one, as usual, it took me a bit to come up with an idea of a program for this one. I ended up deciding to draw a ground and sky. on lines 38-46 i created my clicky funtion. I made it so if tinas y coordinate of the place you click on is greater than -152 it would draw a star (on the sky), and if it was less than it would draw a flower (on the ground). My helper functions are the star and flower.
Here is my code for option 2:
<iframe src="https://trinket.io/embed/python/b8a6b80918" width="100%" height="600" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen></iframe>
I wasnt able to get to do a whole lot with option two. I bascially was just able to make it work, as it took me sometime to get it working properly. I created the list of colors so by clicking on shift, the turle color would change to different colors. Below is where i was able to use randint to make it choose a random color. where it says [randint(0,len(color)-1)] it means that I want it to pick a random color (randint) from 0 to the length of color, -1 (-1 makes sure that it never picks a color out of range)
```
# Define a function to change the color
def color_change():
tina.color(colors[randint(0,len(colors)-1)])
```
I feel like this excersice was a good foundation to build on futher in the future. Its pretty cool to able to manipulate the turtle with the keyboard and make it draw things. I particularly like that penup and pendown part that i created (wich you can turn on or off by clicking 'u') becaue that gave me the ability to draw things (like a square, triabgle, etc.). Th e penup/pendown was my something creative!
| silshack/summer2017 | _posts/nurahill/2017-05-30-nurahill-clicky-turtle.md | Markdown | mit | 1,910 | 89.952381 | 515 | 0.751309 | false |