text:
(function (root) {
    "use strict";

    var buster = root.buster || require("buster"),
        sinon = root.sinon || require("../lib/sinon"),
        assert = buster.assert,
        refute = buster.refute;

    buster.testCase("sinon.stub", {
        "is spy": function () {
            var stub = sinon.stub.create();

            assert.isFalse(stub.called);
            assert.isFunction(stub.calledWith);
            assert.isFunction(stub.calledOn);
        },

        "should contain asynchronous versions of callsArg*, and yields* methods": function () {
            var stub = sinon.stub.create();

            var syncVersions = 0;
            var asyncVersions = 0;

            for (var method in stub) {
                if (stub.hasOwnProperty(method) && method.match(/^(callsArg|yields)/)) {
                    if (!method.match(/Async/)) {
                        syncVersions++;
                    } else if (method.match(/Async/)) {
                        asyncVersions++;
                    }
                }
            }

            assert.same(syncVersions, asyncVersions,
                "Stub prototype should contain same amount of synchronous and asynchronous methods");
        },

        "should allow overriding async behavior with sync behavior": function () {
            var stub = sinon.stub();
            var callback = sinon.spy();

            stub.callsArgAsync(1);
            stub.callsArg(1);
            stub(1, callback);

            assert(callback.called);
        },

        ".returns": {
            "returns specified value": function () {
                var stub = sinon.stub.create();
                var object = {};
                stub.returns(object);

                assert.same(stub(), object);
            },

            "returns should return stub": function () {
                var stub = sinon.stub.create();

                assert.same(stub.returns(""), stub);
            },

            "returns undefined": function () {
                var stub = sinon.stub.create();

                refute.defined(stub());
            }
        },

        ".returnsArg": {
            "returns argument at specified index": function () {
                var stub = sinon.stub.create();
                stub.returnsArg(0);
                var object = {};

                assert.same(stub(object), object);
            },

            "returns stub": function () {
                var stub = sinon.stub.create();

                assert.same(stub.returnsArg(0), stub);
            },

            "throws if no index is specified": function () {
                var stub = sinon.stub.create();

                assert.exception(function () {
                    stub.returnsArg();
                }, "TypeError");
            },

            "throws if index is not number": function () {
                var stub = sinon.stub.create();

                assert.exception(function () {
                    stub.returnsArg({});
                }, "TypeError");
            }
        },

        ".returnsThis": {
            "stub returns this": function () {
                var instance = {};
                instance.stub = sinon.stub.create();
                instance.stub.returnsThis();

                assert.same(instance.stub(), instance);
            },

            "stub returns undefined when detached": {
                requiresSupportFor: {
                    strictMode: (function () {
                        return this;
                    }()) === undefined
                },
                "": function () {
                    var stub = sinon.stub.create();
                    stub.returnsThis();

                    // Due to strict mode, would be `global` otherwise
                    assert.same(stub(), undefined);
                }
            },

            "stub respects call/apply": function () {
                var stub = sinon.stub.create();
                stub.returnsThis();
                var object = {};

                assert.same(stub.call(object), object);
                assert.same(stub.apply(object), object);
            },

            "returns stub": function () {
                var stub = sinon.stub.create();

                assert.same(stub.returnsThis(), stub);
            }
        },

        ".throws": {
            "throws specified exception": function () {
                var stub = sinon.stub.create();
                var error = new Error();
                stub.throws(error);

                try {
                    stub();
                    fail("Expected stub to throw");
                } catch (e) {
                    assert.same(e, error);
                }
            },

            "returns stub": function () {
                var stub = sinon.stub.create();

                assert.same(stub.throws({}), stub);
            },

            "sets type of exception to throw": function () {
                var stub = sinon.stub.create();
                var exceptionType = "TypeError";
                stub.throws(exceptionType);

                assert.exception(function () {
                    stub();
                }, exceptionType);
            },

            "specifies exception message": function () {
                var stub = sinon.stub.create();
                var message = "Oh no!";
                stub.throws("Error", message);

                try {
                    stub();
                    buster.referee.fail("Expected stub to throw");
                } catch (e) {
                    assert.equals(e.message, message);
                }
            },

            "does not specify exception message if not provided": function () {
                var stub = sinon.stub.create();
                stub.throws("Error");

                try {
                    stub();
                    buster.referee.fail("Expected stub to throw");
                } catch (e) {
                    assert.equals(e.message, "");
                }
            },

            "throws generic error": function () {
                var stub = sinon.stub.create();
                stub.throws();

                assert.exception(function () {
                    stub();
                }, "Error");
            },

            "resets 'invoking' flag": function () {
                var stub = sinon.stub.create();
                stub.throws();

                try {
                    stub();
                } catch (e) {
                    refute.defined(stub.invoking);
                }
            }
        },

        ".callsArg": {
            setUp: function () {
                this.stub = sinon.stub.create();
            },

            "calls argument at specified index": function () {
                this.stub.callsArg(2);
                var callback = sinon.stub.create();

                this.stub(1, 2, callback);

                assert(callback.called);
            },

            "returns stub": function () {
                assert.isFunction(this.stub.callsArg(2));
            },

            "throws if argument at specified index is not callable": function () {
                this.stub.callsArg(0);

                assert.exception(function () {
                    this.stub(1);
                }, "TypeError");
            },

            "throws if no index is specified": function () {
                var stub = this.stub;

                assert.exception(function () {
                    stub.callsArg();
                }, "TypeError");
            },

            "throws if index is not number": function () {
                var stub = this.stub;

                assert.exception(function () {
                    stub.callsArg({});
                }, "TypeError");
            }
        },

        ".callsArgWith": {
            setUp: function () {
                this.stub = sinon.stub.create();
            },

            "calls argument at specified index with provided args": function () {
                var object = {};
                this.stub.callsArgWith(1, object);
                var callback = sinon.stub.create();

                this.stub(1, callback);

                assert(callback.calledWith(object));
            },

            "returns function": function () {
                var stub = this.stub.callsArgWith(2, 3);

                assert.isFunction(stub);
            },

            "calls callback without args": function () {
                this.stub.callsArgWith(1);
                var callback = sinon.stub.create();

                this.stub(1, callback);

                assert(callback.calledWith());
            },

            "calls callback with multiple args": function () {
                var object = {};
                var array = [];
                this.stub.callsArgWith(1, object, array);
                var callback = sinon.stub.create();

                this.stub(1, callback);

                assert(callback.calledWith(object, array));
            },

            "throws if no index is specified": function () {
                var stub = this.stub;

                assert.exception(function () {
                    stub.callsArgWith();
                }, "TypeError");
            },

            "throws if index is not number": function () {
                var stub = this.stub;

                assert.exception(function () {
                    stub.callsArgWith({});
                }, "TypeError");
            }
        },

        ".callsArgOn": {
            setUp: function () {
                this.stub = sinon.stub.create();
                this.fakeContext = {
                    foo: "bar"
                };
            },

            "calls argument at specified index": function () {
                this.stub.callsArgOn(2, this.fakeContext);
                var callback = sinon.stub.create();

                this.stub(1, 2, callback);

                assert(callback.called);
                assert(callback.calledOn(this.fakeContext));
            },

            "returns stub": function () {
                var stub = this.stub.callsArgOn(2, this.fakeContext);

                assert.isFunction(stub);
            },

            "throws if argument at specified index is not callable": function () {
                this.stub.callsArgOn(0, this.fakeContext);

                assert.exception(function () {
                    this.stub(1);
                }, "TypeError");
            },

            "throws if no index is specified": function () {
                var stub = this.stub;

                assert.exception(function () {
                    stub.callsArgOn();
                }, "TypeError");
            },

            "throws if no context is specified": function () {
                var stub = this.stub;

                assert.exception(function () {
                    stub.callsArgOn(3);
                }, "TypeError");
            },

            "throws if index is not number": function () {
                var stub = this.stub;

                assert.exception(function () {
                    stub.callsArgOn(this.fakeContext, 2);
                }, "TypeError");
            },

            "throws if context is not an object": function () {
                var stub = this.stub;

                assert.exception(function () {
                    stub.callsArgOn(2, 2);
                }, "TypeError");
            }
        },

        ".callsArgOnWith": {
            setUp: function () {
                this.stub = sinon.stub.create();
                this.fakeContext = { foo: "bar" };
            },

            "calls argument at specified index with provided args": function () {
                var object = {};
                this.stub.callsArgOnWith(1, this.fakeContext, object);
                var callback = sinon.stub.create();

                this.stub(1, callback);

                assert(callback.calledWith(object));
                assert(callback.calledOn(this.fakeContext));
            },

            "returns function": function () {
                var stub = this.stub.callsArgOnWith(2, this.fakeContext, 3);

                assert.isFunction(stub);
            },

            "calls callback without args": function () {
                this.stub.callsArgOnWith(1, this.fakeContext);
                var callback = sinon.stub.create();

                this.stub(1, callback);

                assert(callback.calledWith());
                assert(callback.calledOn(this.fakeContext));
            },

            "calls callback with multiple args": function () {
                var object = {};
                var array = [];
                this.stub.callsArgOnWith(1, this.fakeContext, object, array);
                var callback = sinon.stub.create();

                this.stub(1, callback);

                assert(callback.calledWith(object, array));
                assert(callback.calledOn(this.fakeContext));
            },

            "throws if no index is specified": function () {
                var stub = this.stub;

                assert.exception(function () {
                    stub.callsArgOnWith();
                }, "TypeError");
            },

            "throws if no context is specified": function () {
                var stub = this.stub;

                assert.exception(function () {
                    stub.callsArgOnWith(3);
                }, "TypeError");
            },

            "throws if index is not number": function () {
                var stub = this.stub;

                assert.exception(function () {
                    stub.callsArgOnWith({});
                }, "TypeError");
            },

            "throws if context is not an object": function () {
                var stub = this.stub;

                assert.exception(function () {
                    stub.callsArgOnWith(2, 2);
                }, "TypeError");
            }
        },

        ".objectMethod": {
            setUp: function () {
                this.method = function () {};
                this.object = { method: this.method };
                this.wrapMethod = sinon.wrapMethod;
            },

            tearDown: function () {
                sinon.wrapMethod = this.wrapMethod;
            },

            "returns function from wrapMethod": function () {
                var wrapper = function () {};
                sinon.wrapMethod = function () {
                    return wrapper;
                };

                var result = sinon.stub(this.object, "method");

                assert.same(result, wrapper);
            },

            "passes object and method to wrapMethod": function () {
                var wrapper = function () {};
                var args;

                sinon.wrapMethod = function () {
                    args = arguments;
                    return wrapper;
                };

                sinon.stub(this.object, "method");

                assert.same(args[0], this.object);
                assert.same(args[1], "method");
            },

            "uses provided function as stub": function () {
                var called = false;
                var stub = sinon.stub(this.object, "method", function () {
                    called = true;
                });

                stub();

                assert(called);
            },

            "wraps provided function": function () {
                var customStub = function () {};
                var stub = sinon.stub(this.object, "method", customStub);

                refute.same(stub, customStub);
                assert.isFunction(stub.restore);
            },

            "throws if third argument is provided but not a function or proprety descriptor": function () {
                var object = this.object;

                assert.exception(function () {
                    sinon.stub(object, "method", 1);
                }, "TypeError");
            },

            "stubbed method should be proper stub": function () {
                var stub = sinon.stub(this.object, "method");

                assert.isFunction(stub.returns);
                assert.isFunction(stub.throws);
            },

            "custom stubbed method should not be proper stub": function () {
                var stub = sinon.stub(this.object, "method", function () {});

                refute.defined(stub.returns);
                refute.defined(stub.throws);
            },

            "stub should be spy": function () {
                var stub = sinon.stub(this.object, "method");
                this.object.method();

                assert(stub.called);
                assert(stub.calledOn(this.object));
            },

            "custom stubbed method should be spy": function () {
                var stub = sinon.stub(this.object, "method", function () {});
                this.object.method();

                assert(stub.called);
                assert(stub.calledOn(this.object));
            },

            "stub should affect spy": function () {
                var stub = sinon.stub(this.object, "method");
                stub.throws("TypeError");

                try {
                    this.object.method();
                } catch (e) {}

                assert(stub.threw("TypeError"));
            },

            "returns standalone stub without arguments": function () {
                var stub = sinon.stub();

                assert.isFunction(stub);
                assert.isFalse(stub.called);
            },

            "throws if property is not a function": function () {
                var obj = { someProp: 42 };

                assert.exception(function () {
                    sinon.stub(obj, "someProp");
                });

                assert.equals(obj.someProp, 42);
            },

            "successfully stubs falsey properties": function () {
                var obj = { 0: function () { } };

                sinon.stub(obj, 0, function () {
                    return "stubbed value";
                });

                assert.equals(obj[0](), "stubbed value");
            },

            "does not stub function object": function () {
                assert.exception(function () {
                    sinon.stub(function () {});
                });
            }
        },

        everything: {
           "stubs all methods of object without property": function () {
                var obj = {
                    func1: function () {},
                    func2: function () {},
                    func3: function () {}
                };

                sinon.stub(obj);

                assert.isFunction(obj.func1.restore);
                assert.isFunction(obj.func2.restore);
                assert.isFunction(obj.func3.restore);
            },

            "stubs prototype methods": function () {
                function Obj() {}
                Obj.prototype.func1 = function () {};
                var obj = new Obj();

                sinon.stub(obj);

                assert.isFunction(obj.func1.restore);
            },

            "returns object": function () {
                var object = {};

                assert.same(sinon.stub(object), object);
            },

            "only stubs functions": function () {
                var object = { foo: "bar" };
                sinon.stub(object);

                assert.equals(object.foo, "bar");
            }
        },

        "stubbed function": {
            "throws if stubbing non-existent property": function () {
                var myObj = {};

                assert.exception(function () {
                    sinon.stub(myObj, "ouch");
                });

                refute.defined(myObj.ouch);
            },

            "has toString method": function () {
                var obj = { meth: function () {} };
                sinon.stub(obj, "meth");

                assert.equals(obj.meth.toString(), "meth");
            },

            "toString should say 'stub' when unable to infer name": function () {
                var stub = sinon.stub();

                assert.equals(stub.toString(), "stub");
            },

            "toString should prefer property name if possible": function () {
                var obj = {};
                obj.meth = sinon.stub();
                obj.meth();

                assert.equals(obj.meth.toString(), "meth");
            }
        },

        ".yields": {
            "invokes only argument as callback": function () {
                var stub = sinon.stub().yields();
                var spy = sinon.spy();
                stub(spy);

                assert(spy.calledOnce);
                assert.equals(spy.args[0].length, 0);
            },

            "throws understandable error if no callback is passed": function () {
                var stub = sinon.stub().yields();

                try {
                    stub();
                    throw new Error();
                } catch (e) {
                    assert.equals(e.message, "stub expected to yield, but no callback was passed.");
                }
            },

            "includes stub name and actual arguments in error": function () {
                var myObj = { somethingAwesome: function () {} };
                var stub = sinon.stub(myObj, "somethingAwesome").yields();

                try {
                    stub(23, 42);
                    throw new Error();
                } catch (e) {
                    assert.equals(e.message, "somethingAwesome expected to yield, but no callback " +
                                  "was passed. Received [23, 42]");
                }
            },

            "invokes last argument as callback": function () {
                var stub = sinon.stub().yields();
                var spy = sinon.spy();
                stub(24, {}, spy);

                assert(spy.calledOnce);
                assert.equals(spy.args[0].length, 0);
            },

            "invokes first of two callbacks": function () {
                var stub = sinon.stub().yields();
                var spy = sinon.spy();
                var spy2 = sinon.spy();
                stub(24, {}, spy, spy2);

                assert(spy.calledOnce);
                assert(!spy2.called);
            },

            "invokes callback with arguments": function () {
                var obj = { id: 42 };
                var stub = sinon.stub().yields(obj, "Crazy");
                var spy = sinon.spy();
                stub(spy);

                assert(spy.calledWith(obj, "Crazy"));
            },

            "throws if callback throws": function () {
                var obj = { id: 42 };
                var stub = sinon.stub().yields(obj, "Crazy");
                var callback = sinon.stub().throws();

                assert.exception(function () {
                    stub(callback);
                });
            },

            "plays nice with throws": function () {
                var stub = sinon.stub().throws().yields();
                var spy = sinon.spy();
                assert.exception(function () {
                    stub(spy);
                });
                assert(spy.calledOnce);
            },

            "plays nice with returns": function () {
                var obj = {};
                var stub = sinon.stub().returns(obj).yields();
                var spy = sinon.spy();
                assert.same(stub(spy), obj);
                assert(spy.calledOnce);
            },

            "plays nice with returnsArg": function () {
                var stub = sinon.stub().returnsArg(0).yields();
                var spy = sinon.spy();
                assert.same(stub(spy), spy);
                assert(spy.calledOnce);
            },

            "plays nice with returnsThis": function () {
                var obj = {};
                var stub = sinon.stub().returnsThis().yields();
                var spy = sinon.spy();
                assert.same(stub.call(obj, spy), obj);
                assert(spy.calledOnce);
            }
        },

        ".yieldsRight": {
            "invokes only argument as callback": function () {
                var stub = sinon.stub().yieldsRight();
                var spy = sinon.spy();
                stub(spy);

                assert(spy.calledOnce);
                assert.equals(spy.args[0].length, 0);
            },

            "throws understandable error if no callback is passed": function () {
                var stub = sinon.stub().yieldsRight();

                try {
                    stub();
                    throw new Error();
                } catch (e) {
                    assert.equals(e.message, "stub expected to yield, but no callback was passed.");
                }
            },

            "includes stub name and actual arguments in error": function () {
                var myObj = { somethingAwesome: function () {} };
                var stub = sinon.stub(myObj, "somethingAwesome").yieldsRight();

                try {
                    stub(23, 42);
                    throw new Error();
                } catch (e) {
                    assert.equals(e.message, "somethingAwesome expected to yield, but no callback " +
                    "was passed. Received [23, 42]");
                }
            },

            "invokes last argument as callback": function () {
                var stub = sinon.stub().yieldsRight();
                var spy = sinon.spy();
                stub(24, {}, spy);

                assert(spy.calledOnce);
                assert.equals(spy.args[0].length, 0);
            },

            "invokes the last of two callbacks": function () {
                var stub = sinon.stub().yieldsRight();
                var spy = sinon.spy();
                var spy2 = sinon.spy();
                stub(24, {}, spy, spy2);

                assert(!spy.called);
                assert(spy2.calledOnce);
            },

            "invokes callback with arguments": function () {
                var obj = { id: 42 };
                var stub = sinon.stub().yieldsRight(obj, "Crazy");
                var spy = sinon.spy();
                stub(spy);

                assert(spy.calledWith(obj, "Crazy"));
            },

            "throws if callback throws": function () {
                var obj = { id: 42 };
                var stub = sinon.stub().yieldsRight(obj, "Crazy");
                var callback = sinon.stub().throws();

                assert.exception(function () {
                    stub(callback);
                });
            },

            "plays nice with throws": function () {
                var stub = sinon.stub().throws().yieldsRight();
                var spy = sinon.spy();
                assert.exception(function () {
                    stub(spy);
                });
                assert(spy.calledOnce);
            },

            "plays nice with returns": function () {
                var obj = {};
                var stub = sinon.stub().returns(obj).yieldsRight();
                var spy = sinon.spy();
                assert.same(stub(spy), obj);
                assert(spy.calledOnce);
            },

            "plays nice with returnsArg": function () {
                var stub = sinon.stub().returnsArg(0).yieldsRight();
                var spy = sinon.spy();
                assert.same(stub(spy), spy);
                assert(spy.calledOnce);
            },

            "plays nice with returnsThis": function () {
                var obj = {};
                var stub = sinon.stub().returnsThis().yieldsRight();
                var spy = sinon.spy();
                assert.same(stub.call(obj, spy), obj);
                assert(spy.calledOnce);
            }
        },

        ".yieldsOn": {
            setUp: function () {
                this.stub = sinon.stub.create();
                this.fakeContext = { foo: "bar" };
            },

            "invokes only argument as callback": function () {
                var spy = sinon.spy();

                this.stub.yieldsOn(this.fakeContext);
                this.stub(spy);

                assert(spy.calledOnce);
                assert(spy.calledOn(this.fakeContext));
                assert.equals(spy.args[0].length, 0);
            },

            "throws if no context is specified": function () {
                assert.exception(function () {
                    this.stub.yieldsOn();
                }, "TypeError");
            },

            "throws understandable error if no callback is passed": function () {
                this.stub.yieldsOn(this.fakeContext);

                try {
                    this.stub();
                    throw new Error();
                } catch (e) {
                    assert.equals(e.message, "stub expected to yield, but no callback was passed.");
                }
            },

            "includes stub name and actual arguments in error": function () {
                var myObj = { somethingAwesome: function () {} };
                var stub = sinon.stub(myObj, "somethingAwesome").yieldsOn(this.fakeContext);

                try {
                    stub(23, 42);
                    throw new Error();
                } catch (e) {
                    assert.equals(e.message, "somethingAwesome expected to yield, but no callback " +
                                  "was passed. Received [23, 42]");
                }
            },

            "invokes last argument as callback": function () {
                var spy = sinon.spy();
                this.stub.yieldsOn(this.fakeContext);

                this.stub(24, {}, spy);

                assert(spy.calledOnce);
                assert(spy.calledOn(this.fakeContext));
                assert.equals(spy.args[0].length, 0);
            },

            "invokes first of two callbacks": function () {
                var spy = sinon.spy();
                var spy2 = sinon.spy();

                this.stub.yieldsOn(this.fakeContext);
                this.stub(24, {}, spy, spy2);

                assert(spy.calledOnce);
                assert(spy.calledOn(this.fakeContext));
                assert(!spy2.called);
            },

            "invokes callback with arguments": function () {
                var obj = { id: 42 };
                var spy = sinon.spy();

                this.stub.yieldsOn(this.fakeContext, obj, "Crazy");
                this.stub(spy);

                assert(spy.calledWith(obj, "Crazy"));
                assert(spy.calledOn(this.fakeContext));
            },

            "throws if callback throws": function () {
                var obj = { id: 42 };
                var callback = sinon.stub().throws();

                this.stub.yieldsOn(this.fakeContext, obj, "Crazy");

                assert.exception(function () {
                    this.stub(callback);
                });
            }
        },

        ".yieldsTo": {
            "yields to property of object argument": function () {
                var stub = sinon.stub().yieldsTo("success");
                var callback = sinon.spy();

                stub({ success: callback });

                assert(callback.calledOnce);
                assert.equals(callback.args[0].length, 0);
            },

            "throws understandable error if no object with callback is passed": function () {
                var stub = sinon.stub().yieldsTo("success");

                try {
                    stub();
                    throw new Error();
                } catch (e) {
                    assert.equals(e.message, "stub expected to yield to 'success', but no object " +
                                  "with such a property was passed.");
                }
            },

            "includes stub name and actual arguments in error": function () {
                var myObj = { somethingAwesome: function () {} };
                var stub = sinon.stub(myObj, "somethingAwesome").yieldsTo("success");

                try {
                    stub(23, 42);
                    throw new Error();
                } catch (e) {
                    assert.equals(e.message, "somethingAwesome expected to yield to 'success', but " +
                                  "no object with such a property was passed. " +
                                  "Received [23, 42]");
                }
            },

            "invokes property on last argument as callback": function () {
                var stub = sinon.stub().yieldsTo("success");
                var callback = sinon.spy();
                stub(24, {}, { success: callback });

                assert(callback.calledOnce);
                assert.equals(callback.args[0].length, 0);
            },

            "invokes first of two possible callbacks": function () {
                var stub = sinon.stub().yieldsTo("error");
                var callback = sinon.spy();
                var callback2 = sinon.spy();
                stub(24, {}, { error: callback }, { error: callback2 });

                assert(callback.calledOnce);
                assert(!callback2.called);
            },

            "invokes callback with arguments": function () {
                var obj = { id: 42 };
                var stub = sinon.stub().yieldsTo("success", obj, "Crazy");
                var callback = sinon.spy();
                stub({ success: callback });

                assert(callback.calledWith(obj, "Crazy"));
            },

            "throws if callback throws": function () {
                var obj = { id: 42 };
                var stub = sinon.stub().yieldsTo("error", obj, "Crazy");
                var callback = sinon.stub().throws();

                assert.exception(function () {
                    stub({ error: callback });
                });
            }
        },

        ".yieldsToOn": {
            setUp: function () {
                this.stub = sinon.stub.create();
                this.fakeContext = { foo: "bar" };
            },

            "yields to property of object argument": function () {
                this.stub.yieldsToOn("success", this.fakeContext);
                var callback = sinon.spy();

                this.stub({ success: callback });

                assert(callback.calledOnce);
                assert(callback.calledOn(this.fakeContext));
                assert.equals(callback.args[0].length, 0);
            },

            "throws if no context is specified": function () {
                assert.exception(function () {
                    this.stub.yieldsToOn("success");
                }, "TypeError");
            },

            "throws understandable error if no object with callback is passed": function () {
                this.stub.yieldsToOn("success", this.fakeContext);

                try {
                    this.stub();
                    throw new Error();
                } catch (e) {
                    assert.equals(e.message, "stub expected to yield to 'success', but no object " +
                                  "with such a property was passed.");
                }
            },

            "includes stub name and actual arguments in error": function () {
                var myObj = { somethingAwesome: function () {} };
                var stub = sinon.stub(myObj, "somethingAwesome").yieldsToOn("success", this.fakeContext);

                try {
                    stub(23, 42);
                    throw new Error();
                } catch (e) {
                    assert.equals(e.message, "somethingAwesome expected to yield to 'success', but " +
                                  "no object with such a property was passed. " +
                                  "Received [23, 42]");
                }
            },

            "invokes property on last argument as callback": function () {
                var callback = sinon.spy();

                this.stub.yieldsToOn("success", this.fakeContext);
                this.stub(24, {}, { success: callback });

                assert(callback.calledOnce);
                assert(callback.calledOn(this.fakeContext));
                assert.equals(callback.args[0].length, 0);
            },

            "invokes first of two possible callbacks": function () {
                var callback = sinon.spy();
                var callback2 = sinon.spy();

                this.stub.yieldsToOn("error", this.fakeContext);
                this.stub(24, {}, { error: callback }, { error: callback2 });

                assert(callback.calledOnce);
                assert(callback.calledOn(this.fakeContext));
                assert(!callback2.called);
            },

            "invokes callback with arguments": function () {
                var obj = { id: 42 };
                var callback = sinon.spy();

                this.stub.yieldsToOn("success", this.fakeContext, obj, "Crazy");
                this.stub({ success: callback });

                assert(callback.calledOn(this.fakeContext));
                assert(callback.calledWith(obj, "Crazy"));
            },

            "throws if callback throws": function () {
                var obj = { id: 42 };
                var callback = sinon.stub().throws();

                this.stub.yieldsToOn("error", this.fakeContext, obj, "Crazy");

                assert.exception(function () {
                    this.stub({ error: callback });
                });
            }
        },

        ".withArgs": {
            "defines withArgs method": function () {
                var stub = sinon.stub();

                assert.isFunction(stub.withArgs);
            },

            "creates filtered stub": function () {
                var stub = sinon.stub();
                var other = stub.withArgs(23);

                refute.same(other, stub);
                assert.isFunction(stub.returns);
                assert.isFunction(other.returns);
            },

            "filters return values based on arguments": function () {
                var stub = sinon.stub().returns(23);
                stub.withArgs(42).returns(99);

                assert.equals(stub(), 23);
                assert.equals(stub(42), 99);
            },

            "filters exceptions based on arguments": function () {
                var stub = sinon.stub().returns(23);
                stub.withArgs(42).throws();

                refute.exception(stub);
                assert.exception(function () {
                    stub(42);
                });
            }
        },

        ".callsArgAsync": {
            setUp: function () {
                this.stub = sinon.stub.create();
            },

            "asynchronously calls argument at specified index": function (done) {
                this.stub.callsArgAsync(2);
                var callback = sinon.spy(done);

                this.stub(1, 2, callback);

                assert(!callback.called);
            }
        },

        ".callsArgWithAsync": {
            setUp: function () {
                this.stub = sinon.stub.create();
            },

            "asynchronously calls callback at specified index with multiple args": function (done) {
                var object = {};
                var array = [];
                this.stub.callsArgWithAsync(1, object, array);

                var callback = sinon.spy(done(function () {
                    assert(callback.calledWith(object, array));
                }));

                this.stub(1, callback);

                assert(!callback.called);
            }
        },

        ".callsArgOnAsync": {
            setUp: function () {
                this.stub = sinon.stub.create();
                this.fakeContext = {
                    foo: "bar"
                };
            },

            "asynchronously calls argument at specified index with specified context": function (done) {
                var context = this.fakeContext;
                this.stub.callsArgOnAsync(2, context);

                var callback = sinon.spy(done(function () {
                    assert(callback.calledOn(context));
                }));

                this.stub(1, 2, callback);

                assert(!callback.called);
            }
        },

        ".callsArgOnWithAsync": {
            setUp: function () {
                this.stub = sinon.stub.create();
                this.fakeContext = { foo: "bar" };
            },

            "asynchronously calls argument at specified index with provided context and args": function (done) {
                var object = {};
                var context = this.fakeContext;
                this.stub.callsArgOnWithAsync(1, context, object);

                var callback = sinon.spy(done(function () {
                    assert(callback.calledOn(context));
                    assert(callback.calledWith(object));
                }));

                this.stub(1, callback);

                assert(!callback.called);
            }
        },

        ".yieldsAsync": {
            "asynchronously invokes only argument as callback": function (done) {
                var stub = sinon.stub().yieldsAsync();

                var spy = sinon.spy(done);

                stub(spy);

                assert(!spy.called);
            }
        },

        ".yieldsOnAsync": {
            setUp: function () {
                this.stub = sinon.stub.create();
                this.fakeContext = { foo: "bar" };
            },

            "asynchronously invokes only argument as callback with given context": function (done) {
                var context = this.fakeContext;
                this.stub.yieldsOnAsync(context);

                var spy = sinon.spy(done(function () {
                    assert(spy.calledOnce);
                    assert(spy.calledOn(context));
                    assert.equals(spy.args[0].length, 0);
                }));

                this.stub(spy);

                assert(!spy.called);
            }
        },

        ".yieldsToAsync": {
            "asynchronously yields to property of object argument": function (done) {
                var stub = sinon.stub().yieldsToAsync("success");

                var callback = sinon.spy(done(function () {
                    assert(callback.calledOnce);
                    assert.equals(callback.args[0].length, 0);
                }));

                stub({ success: callback });

                assert(!callback.called);
            }
        },

        ".yieldsToOnAsync": {
            setUp: function () {
                this.stub = sinon.stub.create();
                this.fakeContext = { foo: "bar" };
            },

            "asynchronously yields to property of object argument with given context": function (done) {
                var context = this.fakeContext;
                this.stub.yieldsToOnAsync("success", context);

                var callback = sinon.spy(done(function () {
                    assert(callback.calledOnce);
                    assert(callback.calledOn(context));
                    assert.equals(callback.args[0].length, 0);
                }));

                this.stub({ success: callback });
                assert(!callback.called);
            }
        },

        ".onCall": {
            "can be used with returns to produce sequence": function () {
                var stub = sinon.stub().returns(3);
                stub.onFirstCall().returns(1)
                    .onCall(2).returns(2);

                assert.same(stub(), 1);
                assert.same(stub(), 3);
                assert.same(stub(), 2);
                assert.same(stub(), 3);
            },

            "can be used with returnsArg to produce sequence": function () {
                var stub = sinon.stub().returns("default");
                stub.onSecondCall().returnsArg(0);

                assert.same(stub(1), "default");
                assert.same(stub(2), 2);
                assert.same(stub(3), "default");
            },

            "can be used with returnsThis to produce sequence": function () {
                var instance = {};
                instance.stub = sinon.stub().returns("default");
                instance.stub.onSecondCall().returnsThis();

                assert.same(instance.stub(), "default");
                assert.same(instance.stub(), instance);
                assert.same(instance.stub(), "default");
            },

            "can be used with throwsException to produce sequence": function () {
                var stub = sinon.stub();
                var error = new Error();
                stub.onSecondCall().throwsException(error);

                stub();
                try {
                    stub();
                    fail("Expected stub to throw");
                } catch (e) {
                    assert.same(e, error);
                }
            },

            "in combination with withArgs": {
                "can produce a sequence for a fake": function () {
                    var stub = sinon.stub().returns(0);
                    stub.withArgs(5).returns(-1)
                        .onFirstCall().returns(1)
                        .onSecondCall().returns(2);

                    assert.same(stub(0), 0);
                    assert.same(stub(5), 1);
                    assert.same(stub(0), 0);
                    assert.same(stub(5), 2);
                    assert.same(stub(5), -1);
                },

                "falls back to stub default behaviour if fake does not have its own default behaviour": function () {
                    var stub = sinon.stub().returns(0);
                    stub.withArgs(5)
                        .onFirstCall().returns(1);

                    assert.same(stub(5), 1);
                    assert.same(stub(5), 0);
                },

                "falls back to stub behaviour for call if fake does not have its own behaviour for call": function () {
                    var stub = sinon.stub().returns(0);
                    stub.withArgs(5).onFirstCall().returns(1);
                    stub.onSecondCall().returns(2);

                    assert.same(stub(5), 1);
                    assert.same(stub(5), 2);
                    assert.same(stub(4), 0);
                },

                "defaults to undefined behaviour once no more calls have been defined": function () {
                    var stub = sinon.stub();
                    stub.withArgs(5).onFirstCall().returns(1)
                        .onSecondCall().returns(2);

                    assert.same(stub(5), 1);
                    assert.same(stub(5), 2);
                    refute.defined(stub(5));
                },

                "does not create undefined behaviour just by calling onCall": function () {
                    var stub = sinon.stub().returns(2);
                    stub.onFirstCall();

                    assert.same(stub(6), 2);
                },

                "works with fakes and reset": function () {
                    var stub = sinon.stub();
                    stub.withArgs(5).onFirstCall().returns(1);
                    stub.withArgs(5).onSecondCall().returns(2);

                    assert.same(stub(5), 1);
                    assert.same(stub(5), 2);
                    refute.defined(stub(5));

                    stub.reset();

                    assert.same(stub(5), 1);
                    assert.same(stub(5), 2);
                    refute.defined(stub(5));
                },

                "throws an understandable error when trying to use withArgs on behavior": function () {
                    try {
                        sinon.stub().onFirstCall().withArgs(1);
                    } catch (e) {
                        assert.match(e.message, /not supported/);
                    }
                }
            },

            "can be used with yields* to produce a sequence": function () {
                var context = { foo: "bar" };
                var obj = { method1: sinon.spy(), method2: sinon.spy() };
                var obj2 = { method2: sinon.spy() };
                var stub = sinon.stub().yieldsToOn("method2", context, 7, 8);
                stub.onFirstCall().yields(1, 2)
                    .onSecondCall().yieldsOn(context, 3, 4)
                    .onThirdCall().yieldsTo("method1", 5, 6)
                    .onCall(3).yieldsToOn("method2", context, 7, 8);

                var spy1 = sinon.spy();
                var spy2 = sinon.spy();

                stub(spy1);
                stub(spy2);
                stub(obj);
                stub(obj);
                stub(obj2); // should continue with default behavior

                assert(spy1.calledOnce);
                assert(spy1.calledWithExactly(1, 2));

                assert(spy2.calledOnce);
                assert(spy2.calledAfter(spy1));
                assert(spy2.calledOn(context));
                assert(spy2.calledWithExactly(3, 4));

                assert(obj.method1.calledOnce);
                assert(obj.method1.calledAfter(spy2));
                assert(obj.method1.calledWithExactly(5, 6));

                assert(obj.method2.calledOnce);
                assert(obj.method2.calledAfter(obj.method1));
                assert(obj.method2.calledOn(context));
                assert(obj.method2.calledWithExactly(7, 8));

                assert(obj2.method2.calledOnce);
                assert(obj2.method2.calledAfter(obj.method2));
                assert(obj2.method2.calledOn(context));
                assert(obj2.method2.calledWithExactly(7, 8));
            },

            "can be used with callsArg* to produce a sequence": function () {
                var spy1 = sinon.spy();
                var spy2 = sinon.spy();
                var spy3 = sinon.spy();
                var spy4 = sinon.spy();
                var spy5 = sinon.spy();
                var decoy = sinon.spy();
                var context = { foo: "bar" };

                var stub = sinon.stub().callsArgOnWith(3, context, "c", "d");
                stub.onFirstCall().callsArg(0)
                    .onSecondCall().callsArgWith(1, "a", "b")
                    .onThirdCall().callsArgOn(2, context)
                    .onCall(3).callsArgOnWith(3, context, "c", "d");

                stub(spy1);
                stub(decoy, spy2);
                stub(decoy, decoy, spy3);
                stub(decoy, decoy, decoy, spy4);
                stub(decoy, decoy, decoy, spy5); // should continue with default behavior

                assert(spy1.calledOnce);

                assert(spy2.calledOnce);
                assert(spy2.calledAfter(spy1));
                assert(spy2.calledWithExactly("a", "b"));

                assert(spy3.calledOnce);
                assert(spy3.calledAfter(spy2));
                assert(spy3.calledOn(context));

                assert(spy4.calledOnce);
                assert(spy4.calledAfter(spy3));
                assert(spy4.calledOn(context));
                assert(spy4.calledWithExactly("c", "d"));

                assert(spy5.calledOnce);
                assert(spy5.calledAfter(spy4));
                assert(spy5.calledOn(context));
                assert(spy5.calledWithExactly("c", "d"));

                assert(decoy.notCalled);
            },

            "can be used with yields* and callsArg* in combination to produce a sequence": function () {
                var stub = sinon.stub().yields(1, 2);
                stub.onSecondCall().callsArg(1)
                    .onThirdCall().yieldsTo("method")
                    .onCall(3).callsArgWith(2, "a", "b");

                var obj = { method: sinon.spy() };
                var spy1 = sinon.spy();
                var spy2 = sinon.spy();
                var spy3 = sinon.spy();
                var decoy = sinon.spy();

                stub(spy1);
                stub(decoy, spy2);
                stub(obj);
                stub(decoy, decoy, spy3);

                assert(spy1.calledOnce);

                assert(spy2.calledOnce);
                assert(spy2.calledAfter(spy1));

                assert(obj.method.calledOnce);
                assert(obj.method.calledAfter(spy2));

                assert(spy3.calledOnce);
                assert(spy3.calledAfter(obj.method));
                assert(spy3.calledWithExactly("a", "b"));

                assert(decoy.notCalled);
            },

            "should interact correctly with assertions (GH-231)": function () {
                var stub = sinon.stub();
                var spy = sinon.spy();

                stub.callsArgWith(0, "a");

                stub(spy);
                assert(spy.calledWith("a"));

                stub(spy);
                assert(spy.calledWith("a"));

                stub.onThirdCall().callsArgWith(0, "b");

                stub(spy);
                assert(spy.calledWith("b"));
            }
        },

        "reset only resets call history": function () {
            var obj = { a: function () {} };
            var spy = sinon.spy();
            sinon.stub(obj, "a").callsArg(1);

            obj.a(null, spy);
            obj.a.reset();
            obj.a(null, spy);

            assert(spy.calledTwice);
        },

        ".resetBehavior": {
            "clears yields* and callsArg* sequence": function () {
                var stub = sinon.stub().yields(1);
                stub.onFirstCall().callsArg(1);
                stub.resetBehavior();
                stub.yields(3);
                var spyWanted = sinon.spy();
                var spyNotWanted = sinon.spy();

                stub(spyWanted, spyNotWanted);

                assert(spyNotWanted.notCalled);
                assert(spyWanted.calledOnce);
                assert(spyWanted.calledWithExactly(3));
            },

            "cleans 'returns' behavior": function () {
                var stub = sinon.stub().returns(1);

                stub.resetBehavior();

                refute.defined(stub());
            },

            "cleans behavior of fakes returned by withArgs": function () {
                var stub = sinon.stub();
                stub.withArgs("lolz").returns(2);

                stub.resetBehavior();

                refute.defined(stub("lolz"));
            },

            "does not clean parents' behavior when called on a fake returned by withArgs": function () {
                var parentStub = sinon.stub().returns(false);
                var childStub = parentStub.withArgs("lolz").returns(true);

                childStub.resetBehavior();

                assert.same(parentStub("lolz"), false);
                assert.same(parentStub(), false);
            },

            "cleans 'returnsArg' behavior": function () {
                var stub = sinon.stub().returnsArg(0);

                stub.resetBehavior();

                refute.defined(stub("defined"));
            },

            "cleans 'returnsThis' behavior": function () {
                var instance = {};
                instance.stub = sinon.stub.create();
                instance.stub.returnsThis();

                instance.stub.resetBehavior();

                refute.defined(instance.stub());
            },

            "does not touch properties that are reset by 'reset'": {
                ".calledOnce": function () {
                    var stub = sinon.stub();
                    stub(1);

                    stub.resetBehavior();

                    assert(stub.calledOnce);
                },

                "called multiple times": function () {
                    var stub = sinon.stub();
                    stub(1);
                    stub(2);
                    stub(3);

                    stub.resetBehavior();

                    assert(stub.called);
                    assert.equals(stub.args.length, 3);
                    assert.equals(stub.returnValues.length, 3);
                    assert.equals(stub.exceptions.length, 3);
                    assert.equals(stub.thisValues.length, 3);
                    assert.defined(stub.firstCall);
                    assert.defined(stub.secondCall);
                    assert.defined(stub.thirdCall);
                    assert.defined(stub.lastCall);
                },

                "call order state": function () {
                    var stubs = [sinon.stub(), sinon.stub()];
                    stubs[0]();
                    stubs[1]();

                    stubs[0].resetBehavior();

                    assert(stubs[0].calledBefore(stubs[1]));
                },

                "fakes returned by withArgs": function () {
                    var stub = sinon.stub();
                    var fakeA = stub.withArgs("a");
                    var fakeB = stub.withArgs("b");
                    stub("a");
                    stub("b");
                    stub("c");
                    var fakeC = stub.withArgs("c");

                    stub.resetBehavior();

                    assert(fakeA.calledOnce);
                    assert(fakeB.calledOnce);
                    assert(fakeC.calledOnce);
                }
            }
        },

        ".length": {
            "is zero by default": function () {
                var stub = sinon.stub();

                assert.equals(stub.length, 0);
            },

            "matches the function length": function () {
                var api = { someMethod: function (a, b, c) {} };
                var stub = sinon.stub(api, "someMethod");

                assert.equals(stub.length, 3);
            }
        }
    });
}(this));

redpajama_set_name: RedPajamaGithub


text:
Northrop to support US Marine Corps' H-1 helicopter upgrade programme
Northrop Grumman has secured a contract from the US Navy's Naval Air Systems Command to provide next-generation mission computer for Lot 12 of the Marine Corps' H-1 helicopter upgrade program.
Northrop Grumman has secured a contract from the US Navy's Naval Air Systems Command to provide next-generation mission computer for Lot 12 of the Marine Corps' H-1 helicopter upgrade program.
Under this contract, which is expected to be completed through October 2017, Northrop will be responsible for delivering its FlightPro Gen III mission computers for the UH-1Y and AH-1Z aircraft.
Northrop Grumman Electronic Systems Situational Awareness Systems business unit vice-president Ike Song said: "This contract reaffirms that customer demand is strong and underscores the critical role our proven avionics equipment has in enhancing C4ISR capabilities through helicopter upgrades.
"Our mission computer is ideal for customers who want an open architecture solution that can be applied to multiple platforms, resulting in greater affordability and efficiency."
The UH-1Y and AH-1Z, part of Marine Light Attack Helicopter Squadrons, will be the first aircraft that benefit from this next-generation mission computer, the company stated.
"Our mission computer is ideal for customers who want an open architecture solution that can be applied to multiple platforms."
The Northrop's solution is capable of combining advanced mission, weapons, and video processing capabilities into an airborne computer that will have a capacity to drive four independent, multi-function displays.
It will provide an increased commonality across multiple platforms through a shared integrated mission equipment package.
According to the company, the dual mission computers are significant part of the integrated avionics system (IAS), which powers the helicopters' digital cockpits.
The computers offer aircraft performance and flight instruments, onboard sensor and survivability displays, and improved situational awareness and health monitoring information.
Northrop will also supply the operational flight program software that controls the IAS.
Image: Bell UH-1Y during sea trials aboard the US Navy's Wasp-class amphibious assault ship USS Bataan. Photo: courtesy of PD-USGOV-MILITARY-MARINES.
IFEN Ing Amedeo Lia SpA
Degaussing Systems and Electrical Equipment
Navantia
Naval Ship Design, Construction, Combat System Integration and Life Cycle Support
Technological Solutions, Weapons and Ammunition for Marine Security and Defence

redpajama_set_name: RedPajamaCommonCrawl


text:
CFPUA: Chemours' corrective action plan 'falls far short'
Chemours submitted the corrective action plan (CAP) in December 2019 as part of a consent order with N.C. Department of Environmental Quality and Cape Fear River Watch.
By WECT Staff | April 3, 2020 at 1:22 PM EDT - Updated April 3 at 1:22 PM
WILMINGTON, N.C. (WECT) - Chemours' proposed corrective action plan to address the release of PFAS for decades into the Cape Fear River "falls far short of the actions needed to meaningfully correct the damages done," Cape Fear Public Utility Authority said in comments submitted to state regulators Friday.
NCDEQ is accepting public comments on the CAP through April 6.
"What we find in the CAP are promises to attempt to reduce PFAS loading in the Cape Fear River sometime in the next five years or more from Chemours, a company that, along with its creator DuPont, spent almost four decades making a profit while quietly releasing these same PFAS," CFPUA wrote. "We find promises based on untested models and models built with inconsistent, incomplete data, confounding attempts at independent verification. We find several obvious, significant sources of contamination ignored or set aside because addressing them would cost too much or otherwise be too difficult for the company responsible for this contamination. We find gaps in calculations of the potential risks to human health posed by Chemours' pollution.
"Overall, for the hundreds of thousands of people who rely on CFPUA for drinking water, we find this plan falls far short of the actions needed to meaningfully correct the damages done by Chemours and DuPont."
In reviewing action plan, CFPUA enlisted Tetra Tech, a California-based consulting and engineering services firm, and Dr. Jamie DeWitt, a professor in the department of pharmacology and toxicology at East Carolina University.
CFPUA's full comments and as well as supporting reports by Tetra Tech and Dr. DeWitt can be found here.
WECT Investigates: Father of slain two-year-old frustrated over standstill in homicide investigation
Ann McAdams
Who's getting stuck first? Vaccine details still unclear as NC hospitals receive first shipments
NC Watchdog Reporting Network
Medical examiner takes over a year to return autopsy reports in deaths of children
New Details in SBI investigation into 'signed' Trump hats


SEA offers SCRIP sales as a fundraising option for our families. This has proven to be an easy way for many families to meet their fundraising requirement! SCRIP offers gift cards for many favorite merchants and restaurants, including Kohl's, Walmart, Pick 'n Save, Target, Kwik-Trip, Starbucks, Amazon, and iTunes. They make great gifts and are easy for families to use for personal use while fundraising!! Take a look at the list, watch the specials, and see how easy it is to raise funds while you shop! Read the "how to" page here and visit the link here. Also, read about PrestoPay--->here.
Your order can be placed at http://www.shopwithscrip.com/ by using the SEA Enrollment Code 173DF3A917711 and registering for Presto Pay at least 2 days before placing your first order. DO NOT place your first order until the PrestoPay registration process is complete. PrestoPay is safe, simple and the only payment method accepted by SEA.
Please watch the SEA newsletter and announcements at http://www.shopwithscrip.com/ for order deadlines and deliveries. SCRIP delivery is in the pool balcony on a combined practice night, but individual arrangements can also be made. You may also take advantage of re-load and ScripNow options in between deliveries.
Questions? Please contact Julie Kopsea at 414.530.5399 or at jkopsea@yahoo.com.


Everyone has a favourite food, a favourite drink, a favourite TV show or band. Naturally, as business copywriters to the world, we at Wordsworks Towers also have a favourite word – crumpet.
And we're not alone in our linguistic love affair. A survey commissioned by London's Word Literature Festival, quizzing the public on their favourite words, has produced some surprising results.
Against all the odds, the five-syllable 'serendipity' emerged as the nation's favourite. The word, whose origins stretch back to the 10th century Arabian tale 'The Three Princes of Serendip', is defined in the Oxford English Dictionary as 'the occurrence and development of events by chance in a happy or beneficial way'.
It's thought to have swept to victory in the poll because of the simply beautiful way it trips off the tongue. Se-ren-dip-it-y. Ahhhh! Admittedly, it would be a rare day when 'serendipity' could be used in a business context – although it would be rather 'serendipitous' if such an opportunity did transpire.
Apparently, the longest word anyone voted for in the survey was 'pneumonoultramicroscopicsilicovolcanoconiosis', which at 45 letters suggests someone, somewhere, was having a laugh. As an unpleasant medical condition describing an inflammation of the lungs, it's hard to see who'd harbour much affection for pneumonoultra… oh, we can't be bothered typing it all out again. But if you can memorise how to spell it, give yourself a gold star.


Are children being exposed to screens too early? - a conversation with Taking Back Childhood by Nancy Carlsson-Paige and mother of artist Matt Damon.
"The fact that they are spending more time looking at screens instead of engaged in robust outdoor play, interacting with other kids, spontaneous negotiating and figuring out problems in the real world with other kids, means they are not learning some of the vital lessons that came naturally to children in the past. Screen time is rapidly changing what children learn and don't learn."


Curious how the 1 per cent live? These 11 luxurious tech products come under the heading of "If you have to ask how much it costs..."
When all is said and done, the rich really are different from the rest of us. They demand the best of everything and are willing to pay whatever it takes. Whether it's a $2,500 Ethernet cable, a set of $14,500 gold earbuds or a $2.5-million IMAX home theater, the 11 luxury gadgets that follow are equal parts style and technology -- and often handmade from some of the world's most exotic materials. While we've included prices for each, the old saying holds true: If you have to ask how much it costs, you probably can't afford it.


VP Mike Pence says, "Criticism of Christian education in America must stop." No it musn't. Nobody and nothing is above criticism. Demanding that others stop criticizing your preferred group is a cheap identity-politics move. It would simply be a good thing if the critics made some effort to understand what they're criticizing, though of course that's not going to happen. I can't imagine a cohort less likely to inform itself about conservative Christianity than the cohort of American journalists.


The Cannabis Control Commission issued notices Friday for two outlets to start selling to adults legally without a prescription in three days. The stores will operate in Leicester and Northampton, both west of Boston.
Massachusetts is joining the growing list of US states where Americans can walk into a shop and legally buy recreational marijuana, with two stores due to open next Tuesday.
"There probably will be a big crowd," said an employee at the Northampton dispensary, which already sells medical marijuana to those with a prescription, and who answered the telephone to AFP.
"I'd recommend you wait till after Thanksgiving," he added of the upcoming US family holiday celebrated next Thursday.
According to the law passed by Massachusetts, marijuana cannot be consumed while driving nor in public places. Adults aged 21 or over get up to one ounce (28.5 grams) of cannabis or five grams of marijuana concentrate.
The US federal capital Washington and 10 states — Alaska, California, Colorado, Maine, Massachusetts, Michigan, Nevada, Oregon, Vermont and Washington — have legalized marijuana for recreational use.
It remains outlawed at the federal level. The two stores in Massachusetts will be the first on the US East Coast able to sell marijuana for recreational use.
"Licensees underwent thorough background checks, passed multiple inspections and had their products tested, all to ensure public health and safety," said Steven Hoffman, chairman of the Cannabis Control Commission in Massachusetts.
"As patrons look forward to visiting Massachusetts stores, we hope they will do their part by first familiarizing themselves with the law and understanding what is required of responsible consumers," he added.
Last month, Canada became the world's first major economy to fully legalize cannabis, making good on a 2015 campaign promise by Prime Minister Justin Trudeau.


text:
By Chris KrommJune 29, 2005
Submit to Reddit
Rep. Robin Hayes (R-NC), who was picked to accompany President Bush at Fort Bragg yesterday -- instead of the shunned colleage Rep. Walter Jones, whose district is closer -- is now claiming to have special knowledge about Iraq and Al Quaeda that has eluded the rest of the world:
President Bush might continue to intimate that there was a link between Saddam Hussein and the September 11th attacks, but Rep. Robin Hayes (R-NC), the vice chairman of the House subcommittee on terrorism, is stating it explicitly. In an interview on CNN, Hayes insisted, "Saddam Hussein and people like him were very much involved in 9/11." When confronted with the findings of the 9/11 commission - who definitively concluded there was no evidence of a link between Saddam and 9/11 - Hayes retorted, "I'm sorry, but you must have looked in the wrong places." Hayes then defended his position by asserting that "legislators have access to evidence others do not."
We're not sure what kind of evidence Hayes has access to but apparently he has higher clearance than U.S. weapons inspectors, CIA directors, counterterrorism experts, Secretaries of State, and even the President ... because all those people have accepted the fact that Saddam was not connected to 9/11.
(Via Think Progress)
Southern Politics
Chris Kromm
@chriskromm
Chris Kromm is executive director of the Institute for Southern Studies and publisher of the Institute's online magazine, Facing South.
Email Chris
With private immigrant detention up for review, a former inmate describes the harsh life on the inside
INSTITUTE INDEX: The cost of war
Institute Poll: Opposition to Iraq War Growing in Southern States
Senate Dems block Bush/GOP insider nominees for TVA board


From architecture to artificial intelligence, edX is excited to announce our list of top 17 courses in 2017. We've listened to our learners, surveyed the staff here at edX and highlighted our top "hot skills" courses to help you land an in-demand job in 2018.
The post 17 Top edX Courses in 2017 appeared first on edX Blog.
Previous articleStruggling to Find Inspiration on LinkedIn? Look Again!


text:
Home / HEADLINES / INDIA / President Sirisena appoints Presidential Commission of Enquiry into Easter Sunday attacks
President Sirisena appoints Presidential Commission of Enquiry into Easter Sunday attacks
A gazette notice appointing the five member commission was issued Saturday night.
The commission has been entrusted to carry out an impartial and complete investigation into the attacks and identify persons and organisations directly or indirectly connected to the terrorist attacks.
It has also been tasked with identifying officers and authorities who failed to anticipate that terrorist activities of this nature would take place within the country. The commission is required to submit an interim report in three months, a subsequent interim report in the next two months and the final report in six months.
The Presidential commission has been appointed just weeks ahead of the Presidential election scheduled for November 16.
President had appointed a three-member committee to investigate the incident following the Easter Sunday attacks and the committee handed over its report to the President in June.
The report was not made public but was handed over to Attorney General office for action. The country's police chief and former defence secretary have been charged with criminal negligence for the tacks which killed over 260 people including 45 foreigners.
Meanwhile, a Parliament Select Committee was also appointed to record statements related to the attacks and the committee will submit its report next month.
Previous: Navy Chief on 4-day visit to Bangladesh
Next: ED arrests CMD of Sai Infosystem in bank fraud case


text:
Militant Islam Monitor > Articles > UK Al Qaeda Terrorist Saajid Badat Testifies Against Bin Laden Son In Law Suleiman Abu Ghaith
UK Al Qaeda Terrorist Saajid Badat Testifies Against Bin Laden Son In Law Suleiman Abu Ghaith
Al Qaeda Snitch Versus Bin-Laden's Son-in-Law
Former terrorist to testify against Suleiman Abu Ghaith, on trial for inciting terror and planning attacks. By Ari Yashar First Publish: 3/10/2014, 8:40 AM
A former British Al Qaeda terrorist turned witness will testify on Monday in London, pointing the finger at Osama bin Laden's son-in-law.
Saajid Badat, who was jailed in 2005 after planning a shoe-bomb attack, will appear by video link as a witness in the New York trial of Suleiman Abu Ghaith. He will not be made to fly from his native England to testify in the American case, as upon entering the country he would be subject to criminal charges in Boston for past crimes.
In court on Monday, Badat's admission that he and British 'shoe bomber' Richard Reid planned shoe bombings on airplanes in late 2001 will be used to establish that Ghaith's statement after September 11 that "the storm of airplanes will not stop" indicated involvement in specific plots.
Ghaith also appeared with his father-in-law Bin Laden, who was assassinated by the US in 2011, in propaganda videos to recruit new terrorists, reports The Guardian.
The terrorist turncoat is expected to testify in the US cases of terror-inciting cleric Abu Hamza, who was deported from London, as well as two British terrorists who pleaded guilty to terror in Connecticut, Babar Ahmad and Syed Talha Ahsan.
Badat may also testify in the military tribunal of Khalid Sheikh Mohammed, the accused mastermind of the September 11 attacks on the US.
In 2001, Badat trained at an Al Qaeda camp in Afghanistan. Testifying after his 2003 arrest, the former terrorist admitted that he backed out of a shoe-bombing plot after booking a flight from Amsterdam to the US. He was released after six years in jail upon agreeing to testify in court against his former organization.
Opposition to Badat's testimony cites the benefits he has received by testifying; in court proceedings in 2012 Badat let it be known he had received public funds from the British government to re-establish his life.
Ghaith's lawyer Stanley Cohen attacked Badat for giving testimony to shorten his own sentence. The lawyer claimed Sunday that "not a person in that courtroom will believe anything the guy says."
On Sunday, a jihadist leader warned that several thousand Al Qaeda terrorists are active in Gaza, threatening both Israel and the terror group Hamas governing Gaza.
http://www.israelnationalnews.com/News/News.aspx/178307#.Ux4tfIe9KK0


text:
Nobel Peace Prize Winner To Belligerent Warmaker: Ethiopia Under Abiy Ahmed
Just a year ago, Ethiopian Prime Minister Abiy Ahmed was awarded the Nobel Peace Prize, but now a country with decades of battle scars is in conflict once again. NPR's Eyder Peralta reports on how a Nobel laureate became a belligerent.
EYDER PERALTA, BYLINE: Two years ago, Ethiopia was on the brink. Huge pro-democracy protests and a violent response by the government threatened to tear the country apart. But suddenly, Ethiopia rallied around one man.
(SOUNDBITE OF RHYTHMIC CLAPPING)
PERALTA: Abiy Ahmed was sworn in as the country's new prime minister. Lemma Tsedale, the editor of the Addis Standard, says you cannot underestimate the importance of that moment. For centuries, bloodshed marked any change of power in Ethiopia. It's a distinct characteristic.
LEMMA TSEDALE: A country that was born out of violence, governed by violence.
PERALTA: But here was Abiy, the youngest leader on the African continent, making a huge promise. Ethiopia would become a democracy, and its differences would be solved with dialogue.
PRIME MINISTER ABIY AHMED: (Speaking foreign language).
PERALTA: From Arat Kilo, the seat of power in the capital, Addis Ababa, he was humble, apologizing for state brutality suffered by Ethiopians.
TSEDALE: This was the first time power was transferred from one man to another without us having to drag the dead bodies from Arat Kilo.
PERALTA: And things did change in Ethiopia. Abiy welcomed back exiled dissidents. He ended a state of emergency, declared peace with Eritrea, and gave Ethiopians the freedom to speak their minds. Last year, the world noticed - he was awarded the Nobel Peace Prize. At the Oslo City Hall, he was feted with a German art song. In a speech, he railed against war. He said it makes for heartless and savage men.
UNIDENTIFIED SINGER: (Singing in foreign language).
PERALTA: But at home, things were once again deteriorating. Ethnic violence was tearing the country apart, killing scores and displacing millions. Without presenting evidence, Abiy accused the former rulers of Ethiopia, the TPLF, of driving that unrest. Elections this summer were supposed to settle these grievances. But citing the pandemic, Abiy canceled them. The TPLF held them anyway, raising tensions. They traded threats. And two weeks ago, the TPLF launched a surprise attack on government military bases.
PERALTA: Abiy responded by sending troops into northern Ethiopia and bombing rivals in his own country. Lemma Tsedale, the magazine editor, says Ethiopia couldn't escape the pull of violence.
TSEDALE: We succumbed and we invoked our memories, our lived memories, that we cannot become state without inflicting pain on each other, without killing one another, without turning our guns into our own brothers and sisters.
ZADIG ABRAHA: There was no other way.
PERALTA: No other way. That is Zadig Abraha, Ethiopia's minister for democratization. He says if there was any failure by Abiy, it was that he was too patient with the TPLF. He says military action was the only acceptable move after the TPLF attacked government forces.
AWOL ALLO: So what government would tolerate this? This is treason in every sense of the term.
PERALTA: Awol Allo is a professor of law at Keele University in the U.K. He was one of the people to nominate Abiy Ahmed for the Nobel Prize, and now he feels betrayed.
ALLO: It became very clear that there was basically a widespread deception about the character and identity and the belief of the prime minister.
PERALTA: He says Abiy fell in love with power, with the idea that the only way to hold Ethiopia together was with a forceful central government. And he began picking off anyone who didn't agree with him. Yesterday, the government issued an arrest warrant against dissenters, including Awol. The government's minister says the broader crackdown is a temporary setback to remove, quote, "roadblocks to democracy." Allo says, either way, Ethiopia is once again gripped by violence.
ALLO: You cannot justify that - you cannot.
PERALTA: At least, he says, not at the hands of a Nobel Peace laureate. Eyder Peralta, NPR News, Nairobi. Transcript provided by NPR, Copyright NPR.


text:
De bismarckvleermuisparkiet (Loriculus tener) is een vogel uit de familie Psittaculidae (papegaaien van de Oude Wereld). Het is een voor uitsterven gevoelige, endemische vogelsoort op de Bismarck-archipel, een groep eilanden ten noordoosten van en behorend tot Papoea-Nieuw-Guinea.

Kenmerken
De vogel is 10 cm lang. Deze kleine vleermuisparkiet is overwegend groen. De snavel is zwart, de poten zijn bruinachtig geel en er is een oranje-rode vlek op de keel. De stuit en de bovenstaartdekveren zijn geel.

Verspreiding en leefgebied
Deze soort is endemisch op de eilanden Nieuw-Brittannië, Nieuw-Ierland en Lavongai.  Het is een vogel van ongerept regenwoud tot op 200 soms 500 m boven zeeniveau. Het is niet bekend of de vogel zich in aangetast natuurlijk bos kan handhaven.

Status
De grootte van de populatie is niet gekwantificeerd; de populatie-aantallen nemen echter af door ontbossing, die vooral plaatsvindt in laaglandbos. Om deze redenen staat deze soort als gevoelig op de Rode Lijst van de IUCN. Er gelden verder beperkingen voor de handel in deze parkiet, want de soort staat in de Bijlage II van het CITES-verdrag.

Psittacidae
IUCN-status niet bedreigd
Endemisch dier uit Papoea-Nieuw-Guinea

redpajama_set_name: RedPajamaWikipedia


Sneak perks re-enabled on sneak boy.
- Increase max range from 50 to 80 for SVD.
- Increase single shot AP cost for SVD from 20 to 25 AP.
- Increase single shot AP cost for SVU from 20 to 23 AP.
- Add a second mode "Burst".
- Add 1 x Suppression trait.
Could it be that the regular Leather Armor Stats are bugged now?
Sooo....we back to DSR, RL sneaks again?
Not bad, more guns and armors have use now. It's not what I want edactly but still thx.
Now just need to wait for bring .44 ammo and mauser to shops,reintroduce flamer fuels to be useful, same with red shotgun shells and finally wait for more useful low tier guns. Still great improvement, big cold beer from me.
Now lets add them up!
Right, if he even test weapons before add it to game? For exemple now I wanna change perks for my legendaries because is useless with new update and how I can do it?
Sneak is stupidly strong, let's give it tons of perks!
Plz next changelog "whenever weapon is equipped or in attack mode sneak drops to 0"
I understood absolutly nothing about all this.....Did you just buff sneaks?
Wartime sneak mode removed, weight malus/bat consumption.....does that mean they can sneak without using bateries, or stealthboys altogeter? Why add stealthboy perks when people are already complaining about the stupidity of sneaker mechanics?
I really have to say this now, i played during the begining of season 1, and seeing how everything that was wrong then just keeps coming back again.......Do you even listen to your testers advices? Did realisation hit any of you at any point? That's 2 seasons straight now, where you had 300+ players at wipe, and less than 50 after 5 days.....I dont think any other Fonline server ever hitted the bottom so fast.
You have a great concept, an awesome map, intense pvp battles, tactical items like heartbeat sensors, smoke grenades, bigger zones, longer weapons ranges and FOV.......And you RUIN it ALL with invisible sneakers assasins....It completly defeats the purpose of your game, we might as well all be sneakers or just play another game.....Please oh PLEASE realize that!
Translation: Im a retard with zero reading comprehension and id also rather cry preemptively before understanding things.
Now for special children like beer and Weasel once more: This was a NERF.
New system is 200 and +20 for staying 5 hex near a movement blocker and another +20 possible while right next to a wall.
Thank you for clarifying your situation to us Ramon. This explains a lot!


text:
Q: parametrized sql with multiple parameters I am missing something in my SQL query, could please someone advise how to do correct it? This is my SQL:
declare @numItems int;
declare @value1 int;
declare @value2 int;
declare @currentValue int;
declare @counter int;
declare @qry nvarchar(max)

set @value1 = 5;
set @value2 = 10;

set @numItems = 2
set @counter=0

WHILE (@counter < @numItems)
BEGIN
    set @qry = 'set @currentValue = @value' + cast(@counter+1 as nvarchar(max)) + ';'
    exec sp_executesql @qry, N'@currentValue int OUTPUT', @currentValue OUTPUT

    print @currentValue

    set @counter = @counter + 1;
END

What I want is that @currentValue parameter gets values of @value1 and @value2 and prints them.
I'm not sure how to correctly declare parameters in the exec statement. I am using SQL Server 2005. Thanks for any help.

A: declare @numItems int;
declare @value1 int;
declare @value2 int;
declare @currentValue int;
declare @counter int;
declare @qry nvarchar(max)

set @value1 = 5;
set @value2 = 10;

set @numItems = 2
set @counter=0

WHILE (@counter < @numItems)
BEGIN
    set @qry = 'set @currentValue = @value' + cast(@counter+1 as nvarchar(max)) + ';'
    exec sp_executesql @qry,
                        N'@value1 int, @value2 int, @currentValue int OUTPUT',
                        @value1=@value1,@value2=@value2, @currentValue = @currentValue OUTPUT

    print @currentValue

    set @counter = @counter + 1;
END

redpajama_set_name: RedPajamaStackExchange


Popular Alternatives to Scriptcase. Explore 13 apps like Scriptcase, all suggested and ranked by the AlternativeTo user community….
My wife and I are just starting out with canning, so we felt investing in reusable canning lids up front would assist in recouping their cost over the next 10-20 years….
main·te·nance (mān′tə-nəns) n. 1. The act of maintaining or the state of being maintained: nutrients essential to the maintenance of good health….


Bring a saucepan of salted water to a boil. Add the haricots verts and cook until crisp-tender, 3 to 5 minutes. Drain and run under cold water to stop the cooking.
Puree the yogurt, mayonnaise, lemon juice, chives, basil and anchovies in a blender until smooth. Season with salt and pepper.
Toss the crabmeat, half of the avocado and about 1 tablespoon of the yogurt dressing in a small bowl. Toss the romaine, croutons, haricots verts and the remaining avocado with the remaining dressing in a large bowl.
Divide the romaine salad among plates, top with the tomatoes and place some of the crab mixture in the center.