text:
// ReSharper disable InconsistentNaming
// ReSharper disable UnusedLocals
(function (testFns) {
    "use strict";

    /*********************************************************
    * Breeze configuration and module setup
    *********************************************************/
    var breeze = testFns.breeze;
    var MetadataStore = breeze.MetadataStore;
    var EntityManager = breeze.EntityManager;
    var EntityQuery = breeze.EntityQuery;
    var EntityState = breeze.EntityState;

    var moduleMetadataStore; // see getModuleMetadataStoreSetup
    var northwindService = testFns.northwindServiceName;
    var todoService = testFns.todosServiceName;
    var handleFail = testFns.handleFail;

    module("entityExtensionTests", getModuleConfig('ko'));

    /*********************************************************
    * add untracked property directly to customer instance
    *********************************************************/
    test("add untracked 'isPartial' property directly to customer instance", function () {
        expect(1);
        var em = newEm();
        var cust = em.createEntity('Customer', {
            CustomerID: testFns.newGuidComb()
        });

        // property added to instance
        cust.isPartial = ko.observable(false);

        // can get the type from the entity instance
        var custType = cust.entityType;
        var propInfo = custType.getProperty("isPartial");

        // The Breeze customerType knows nothing about it.
        ok(propInfo === null, "'isPartial' should be unknown to the customer type");
    });

    /*********************************************************
    * add unmapped property via constructor
    *********************************************************/
    test("add unmapped 'isPartial' property via constructor", function () {
        expect(6);
        var store = cloneModuleMetadataStore();

        var Customer = function () {
            // These are simple 'field' properties.
            // Breeze converts them to the right kind of properties
            // for the prevailing modelLibrary adapter
            // such as KO observable properties.
            this.CustomerID = testFns.newGuidComb();
            this.isPartial = true;
        };

        store.registerEntityTypeCtor('Customer', Customer);

        var em = newEm(store);
        var cust = em.createEntity('Customer');

        assertExpectedCustomerCtorProperties(cust);
    });

    function assertExpectedCustomerCtorProperties(cust) {
        // can get the type from the entity instance
        var custType = cust.entityType;
        ok(custType, "'cust' is now an entity");

        // Breeze converted both into KO observables
        ok(typeof cust.CustomerID === 'function',
            "'CustomerID' should be a KO observable");

        ok(typeof cust.isPartial === 'function',
            "'isPartial' should be a KO observable");

        if (!custType) {return;} // no remaining tests would pass

        var propInfo = custType.getProperty('CustomerID');
        ok(propInfo && !propInfo.isUnmapped && propInfo.isPartOfKey,
            "'CustomerID' should be detected as a mapped key property");

        propInfo = custType.getProperty('isPartial');
        ok(propInfo && propInfo.isUnmapped,
            "'isPartial' should be an unmapped property");

        var unmapped = custType.unmappedProperties;
        ok(unmapped.length === 1,
            "'isPartial' should be the lone unmapped property");
    }

    /*********************************************************
    * can 'new' the ctor .. but not a full entity until added to manager
    * not recommended; prefer CreateEntity approach
    *********************************************************/
    test("can 'new' an entity via custom ctor and add to manager", function () {
        expect(8);
        var store = cloneModuleMetadataStore();

        var Customer = function () {
            this.CustomerID = testFns.newGuidComb();
            this.isPartial = true;
        };

        store.registerEntityTypeCtor('Customer', Customer);

        var cust = new Customer(); // not recommended!!

        // they aren't observables until they're added to the manager
        ok(typeof cust.CustomerID !== 'function',
            "'CustomerID' should NOT be a KO observable before adding to em");

        ok(typeof cust.isPartial !== 'function',
            "'isPartial' should NOT be a KO observable before adding to em");

        var em = newEm(store);
        em.addEntity(cust);

        // now they are observables
        assertExpectedCustomerCtorProperties(cust);

    });

    /*********************************************************
    * can add unmapped 'foo' property via constructor
    *********************************************************/
    test("can add unmapped 'foo' property via constructor", function () {
        expect(4);
        var store = cloneModuleMetadataStore();
        assertFooPropertyDefined(store, false);

        var Customer = function () {
            this.foo = 42; // doesn't have to be KO observable; will become observable
        };
        store.registerEntityTypeCtor('Customer', Customer);
        assertFooPropertyDefined(store, true);

        var cust = store.getEntityType('Customer').createEntity();

        ok(cust["foo"],
            "should have 'foo' property via constructor");

        equal(cust.foo(), 42,
            "'foo' should be a KO 'property' returning 42");
    });

  /*********************************************************
  * can add function via constructor (not to prototype)
  * Going to the trouble to get Customer by way of expand because of
  * https://github.com/Breeze/breeze.js/issues/61
  **********************************************************/
    asyncTest("can add function via constructor (not prototype)", function () {
      expect(2);
      var store = cloneModuleMetadataStore();

      var Customer = function () {
        this.foo = function () { return 'foo'; }
      };
      store.registerEntityTypeCtor('Customer', Customer);

      var cust = store.getEntityType('Customer').createEntity();

      equal(typeof cust.foo, 'function', "should have 'foo' function via constructor");

      var manager = newEm(store);
      EntityQuery.from('Orders').take(1).expand('Customer')
        .using(manager).execute()
        .then(function (data) {
          var order = data.results[0];
          cust = order ? order.getProperty('Customer') : {};
          equal(typeof cust.foo, 'function',
            "should have 'foo' function after expand query");
        })
        .catch(handleFail).finally(start);
    });

  /*********************************************************
  * can add function via constructor (not to prototype)
  * related to https://github.com/Breeze/breeze.js/issues/61
  *********************************************************/
    test("can add function via constructor prototype", function () {
      expect(1);
      var store = cloneModuleMetadataStore();

      var Customer = function() {}
      Customer.prototype.foo = function () { return 'foo'; }

      store.registerEntityTypeCtor('Customer', Customer);

      var cust = store.getEntityType('Customer').createEntity();

      equal(typeof cust.foo, 'function', "should have 'foo' function via constructor");

    });

    /*********************************************************
    * can add unmapped 'foo' property directly to EntityType
    *********************************************************/
    test("can add unmapped 'foo' property directly to EntityType", function () {
        expect(4);
        var store = cloneModuleMetadataStore();
        assertFooPropertyDefined(store, false);

        var customerType = store.getEntityType('Customer');
        var fooProp = new breeze.DataProperty({
            name: 'foo',
            defaultValue: 42,
            isUnmapped: true  // !!!
        });
        customerType.addProperty(fooProp);

        assertFooPropertyDefined(store, true);

        var cust = store.getEntityType('Customer').createEntity();

        ok(cust["foo"],
            "should have 'foo' property via constructor");

        equal(cust.foo(), 42,
            "'foo' should be a KO 'property' returning 42");
    });

    /*********************************************************
    * can query an unmapped property with cache query
    *********************************************************/
    test("can query an unmapped property with cache query", function() {
        expect(3);
        // Add unmapped 'foo' property via its custom constructor
        var store = cloneModuleMetadataStore();
        var Customer = function() {
            this.foo = 42; // doesn't have to be KO observable; will become observable
        };
        store.registerEntityTypeCtor('Customer', Customer);
        assertFooPropertyDefined(store, true);

        var manager = newEm(store);

        // Create a customer with the target foo value
        var fooValue = 60;
        var cust = manager.createEntity('Customer', {
            CustomerID: testFns.newGuid(),
            foo: fooValue,
            CompanyName: 'Test'
        });

        // Create another customer with a different foo value
        manager.createEntity('Customer', {
            CustomerID: testFns.newGuid(),
            foo: fooValue + 1 ,
            CompanyName: 'Test2'
        });

        // Now have 2 customers in cache; query for the one with target foo value
        var results = manager.executeQueryLocally(
            EntityQuery.from('Customers').where('foo', 'eq', fooValue));

        equal(results.length, 1, "cache query returned exactly 1 result.");

        var queriedCustomer = results[0];
        if (queriedCustomer) {
            ok(true, "cache query returned customer '{0}' with foo==={1}"
                .format(queriedCustomer.CompanyName(), queriedCustomer.foo()));
        } else {
            ok(false, "cache query failed to return a Customer with foo===" + fooValue);

        }
    });

    /*********************************************************
    * unmapped 'foo' property is validated
    *********************************************************/
    test("unmapped 'foo' property is validated", function () {
        expect(5);
        var store = cloneModuleMetadataStore();
        assertFooPropertyDefined(store);
        // Arrange for 'foo' to be an unmapped Customer property
        var Customer = function () {
            this.foo = "";
        };
        store.registerEntityTypeCtor("Customer", Customer);
        var fooProp = assertFooPropertyDefined(store, true);

        var maxLengthValidator = breeze.Validator.maxLength({maxLength:5});
        fooProp.validators.push(maxLengthValidator);

        // create new customer
        var manager = newEm(store);
        var cust = manager.createEntity('Customer', {CustomerID: testFns.newGuidComb()});

        cust.foo("funky");
        var errs = cust.entityAspect.getValidationErrors(fooProp);
        ok(0 === errs.length,
            "should not have validation errors about 'foo'.");

        cust.foo("funky and fresh");
        errs = cust.entityAspect.getValidationErrors(fooProp);
        equal(errs.length, 1,
            "should have one validation error about 'foo'.");

        var errMsg = errs[0].errorMessage;
        ok(/foo.*or less/.test(errMsg),
            "error message, \"{0}\", should complain that 'foo' is too long."
            .format(errMsg));

    });

    /*********************************************************
    * Changes to properties within ctor do NOT change EntityState
    * Doesn't matter if they are mapped or unmapped
    *********************************************************/
    asyncTest("changes to properties within ctor should not change EntityState", function () {
        expect(3);
        var store = cloneModuleMetadataStore();
        var employeeCtor = function () {
            // Mapped properties
            this.FirstName = "Jolly";
            this.LastName = "Rodger";
            // Unmapped property
            this.FunkyName = "Funky";
        };
        store.registerEntityTypeCtor("Employee", employeeCtor);

        var em = newEm(store);

        EntityQuery.from('Employees').top(1)
            .using(em).execute()
            .then(success).fail(handleFail).fin(start);

        function success(data) {
            var emp = data.results[0];
            var stateName = emp.entityAspect.entityState.name;
            equal(stateName, EntityState.Unchanged.name,
                "queried entity whose ctor sets properties should remain Unchanged");
            notEqual(emp.FirstName(), "Jolly",
                "queried entity's initial FirstName should be overridden by query; is " + emp.FirstName());
            deepEqual(emp.entityAspect.originalValues, {},
                "queried entity should have no 'originalValues' and therefore no initial values to 'restore'.");
        }
    });

    /*********************************************************
    * changes to properties within custom initializer should not change EntityState
    * even if change is to mapped property
    *********************************************************/
    asyncTest("changes to properties within custom initializer should not change EntityState", function () {
        expect(3);
        var store = cloneModuleMetadataStore();
        var employeeInitializer = function (emp) {
            emp.FirstName("Jolly"); // change a mapped property
        };
        store.registerEntityTypeCtor("Employee", null, employeeInitializer);

        var em = newEm(store);

        EntityQuery.from('Employees').top(1)
            .using(em).execute()
            .then(success).fail(handleFail).fin(start);

        function success(data) {
            var emp = data.results[0];
            var stateName = emp.entityAspect.entityState.name;
            equal(stateName, EntityState.Unchanged.name,
                "queried entity whose initer set a mapped property should remain Unchanged");
            equal(emp.FirstName(), "Jolly",
                "queried entity's FirstName should be overridden by initer; is " + emp.FirstName());
            deepEqual(emp.entityAspect.originalValues, {},
                "queried entity should have no 'originalValues' and therefore no initial values to 'restore'.");
        }
    });

    /*********************************************************
    * when unmapped property changes, what happens to
    * notifications, EntityState, and originalValues
    *********************************************************/
    test("change to unmapped 'foo' property does not change EntityState", function () {
        expect(5);
        // Arrange for 'foo' to be an unmapped Customer property
        var store = cloneModuleMetadataStore();
        var Customer = function () {
            this.foo = 42;
        };
        store.registerEntityTypeCtor("Customer", Customer);

        assertFooPropertyDefined(store, true);

        // Fake an existing customer
        var manager = newEm(store);
        var cust = manager.createEntity(
            'Customer',
            { CustomerID: testFns.newGuidComb() },
              EntityState.Unchanged);

        // Listen for foo changes
        var koFooNotified, breezeFooNotified;
        cust.foo.subscribe(function () { koFooNotified = true; });
        cust.entityAspect.propertyChanged.subscribe(function (args) {
            if (args.propertyName === "foo") { breezeFooNotified = true; }
        });

        // Act
        cust.foo(12345);

        ok(koFooNotified, "KO should have raised property changed for 'foo'.");
        ok(breezeFooNotified, "Breeze should have raised its property changed for 'foo'.");

        var stateName = cust.entityAspect.entityState.name;
        equal(stateName, "Unchanged",
            "cust's EntityState should still be 'Unchanged'; it is " + stateName);

        var originalValues = cust.entityAspect.originalValues;
        var hasOriginalValues = null;
        for (var key in originalValues) {
          if (originalValues.hasOwnProperty(key)) {
            if (key === 'foo') {
              hasOriginalValues = true;
              break;
            }
          }
        }

      ok(hasOriginalValues,
            "'originalValues' have 'foo'; it is " + JSON.stringify(originalValues));
    });

    /*********************************************************
    * reject changes should revert an unmapped property
    *********************************************************/
    test("reject changes reverts an unmapped property", function () {
        expect(2);
        var store = cloneModuleMetadataStore();

        var originalTime = new Date(2013, 0, 1);
        var Customer = function () {
            this.lastTouched = originalTime;
        };

        store.registerEntityTypeCtor("Customer", Customer);

        var manager = newEm(store);

        // create a fake customer
        var cust = manager.createEntity("Customer", { CompanyName: "Acme" },
                   EntityState.Unchanged);
        var touched = cust.lastTouched();

        // an hour passes ... and we visit the customer object
        cust.CompanyName("Beta");
        cust.lastTouched(touched = new Date(touched.getTime() + 60000));

        // an hour passes ... and we visit to cancel
        cust.lastTouched(new Date(touched.getTime() + 60000));

        cust.entityAspect.rejectChanges(); // roll back name change
        //manager.rejectChanges(); // would have same effect. Obviously less granular

        equal(cust.CompanyName(), "Acme", "'name' data property should be rolled back");
        ok(originalTime === cust.lastTouched(),
            "'lastTouched' unmapped property should be rolled back. Started as {0}; now is {1}"
            .format(originalTime, cust.lastTouched()));
    });

    /*********************************************************
    * unmapped properties are not persisted
    * (although they are sent to the server in the payload)
    *********************************************************/
    test("unmapped properties are not persisted", function () {
        expect(9);
        var store = cloneModuleMetadataStore();

        var TodoItemCtor = function () {
            this.foo = 0;
        };
        store.registerEntityTypeCtor("TodoItem", TodoItemCtor);

        var todoType = store.getEntityType("TodoItem");
        var fooProp = todoType.getProperty('foo');
        ok(fooProp && fooProp.isUnmapped,
            "'foo' should be an unmapped property after registration");

        // Create manager that uses this extended TodoItem
        var manager = new EntityManager({
            serviceName: todoService,
            metadataStore: store
        });

        // Add new Todo
        var todo = manager.createEntity(todoType.name);
        var operation, description; // testing capture vars

        stop(); // going async

        saveAddedTodo()
            .then(saveModifiedTodo)
            .then(saveDeletedTodo)
            .fail(handleFail)
            .fin(start);

        function saveAddedTodo() {
            changeDescription("add");
            todo.foo(42);
            return manager.saveChanges().then(saveSucceeded);
        }
        function saveModifiedTodo() {
            changeDescription("update");
            todo.foo(84);
            return manager.saveChanges().then(saveSucceeded);
        }
        function saveDeletedTodo() {
            changeDescription("delete");
            todo.foo(21);
            todo.entityAspect.setDeleted();
            return manager.saveChanges().then(saveSucceeded);
        }

        function changeDescription(op) {
            operation = op;
            description = op + " entityExtensionTest";
            todo.Description(description);
        }
        function saveSucceeded(/*saveResult*/) {

            notEqual(todo.foo(), 0, "'foo' retains its '{0}' value after '{1}' save succeeded but ..."
                .format(todo.foo(), operation));

            // clear the cache and requery the Todo
            manager.clear();
            return EntityQuery.fromEntities(todo).using(manager).execute().then(requerySucceeded);

        }
        function requerySucceeded(data) {
            if (data.results.length === 0) {
                if (operation === "delete") {
                    ok(true, "todo should be gone from the database after 'delete' save succeeds.");
                }else {
                    ok(false, "todo should still be in the database after '{0}' save.".format(operation));
                }
                return;
            }

            todo = data.results[0];
            equal(todo.foo(), 0, "'foo' should have reverted to '0' after cache-clear and re-query.");
            equal(todo.Description(), description,
                    "'Description' should be '{0}' after {1} succeeded and re-query".format(description, operation));
        }
    });

    /*********************************************************
    * unmapped property can be set by server class calculated property
    *********************************************************/
    test("unmapped property can be set by a calculated property of the server class", function () {
        expect(4);
        var store1 = cloneModuleMetadataStore();

        var store2 = cloneModuleMetadataStore();
        var employeeCtor = function () {
            //'Fullname' is a server-side calculated property of the Employee class
            // This unmapped property will be empty for new entities
            // but will be set for existing entities during query materialization
            this.FullName = "";
        };
        store2.registerEntityTypeCtor("Employee", employeeCtor);

        var em1 = newEm(store1); // no unmapped properties registered
        var prop = em1.metadataStore.getEntityType('Employee').getProperty('FullName');
        ok(!prop,
            "'FullName' should NOT be a registered property of 'em1'.");

        var em2 = newEm(store2);
        prop = em2.metadataStore.getEntityType('Employee').getProperty('FullName');
        ok(prop && prop.isUnmapped,
            "'FullName' should be an unmapped property in 'em2'");

        var query = EntityQuery.from('Employees');
        var p1 = em1.executeQuery(query).then(success1);
        var p2 = em2.executeQuery(query).then(success2);

        stop(); // going async

        Q.all([p1, p2]).fail(handleFail).fin(start);

        function success1(data) {
            var first = data.results[0];
            var fullname = first.FullName;
            ok(!fullname, "an Employee queried with 'em1' should NOT have a 'FullName' property, let alone a value for it");
        }

        function success2(data) {
            var first = data.results[0];
            var fullname = first.FullName();
            ok(fullname, "an Employee queried with 'em2' should have a calculated FullName ('Last, First'); it is '{0}'"
                .format(fullname));
        }

    });

    /*********************************************************
    * add instance function via constructor
    *********************************************************/
    test("add instance function via constructor", function () {
        expect(3);
        var store = cloneModuleMetadataStore();

        var Customer = function () {
            this.foo = function () { return 42;};
        };

        store.registerEntityTypeCtor("Customer", Customer);

        var customerType = store.getEntityType("Customer");
        var cust = customerType.createEntity();

        ok(cust["foo"],
            "should have 'foo' property via constructor");

        // 'foo' is a non-KO function; it is NOT listed as an unmapped property
        // The Breeze customerType knows nothing about it.
        var propInfo = customerType.getProperty("foo");
        ok(propInfo === null, "'foo' should be unknown to the customer type");

        equal(cust.foo(), 42,
            "'foo' should be a function returning 42");
    });

    /*********************************************************
    * add mapped data property via constructor
    *********************************************************/
    test("add mapped data property via constructor", function () {
        expect(7);
        var store = cloneModuleMetadataStore();

        var Customer = function () {
            this.CompanyName = "Acme"; // a field, not a KO property
            this.ContactName = ko.observable("Amy"); // is a KO property
        };

        store.registerEntityTypeCtor("Customer", Customer);

        var customerType = store.getEntityType("Customer");
        var cust = customerType.createEntity();

        ok(cust["CompanyName"],
            "should have 'CompanyName' property via constructor");

        // 'CompanyName' is a mapped data property
        var propInfo = customerType.getProperty("CompanyName");
        ok(propInfo !== null,
            "'CompanyName' should be known to the customer type");
        ok(propInfo && !propInfo.isUnmapped,
            "'CompanyName' should be a mapped property");

        // Although defined as a field, Breeze made it a KO property and initialized it
        equal(cust.CompanyName(), "Acme",
            "'CompanyName' should be a KO 'property' returning 'Acme'");

        // Breeze preserved the ContactName KO property as a mapped data property
        propInfo = customerType.getProperty("ContactName");
        ok(propInfo !== null,
            "'ContactName' should be known to the customer type");
        ok(propInfo && !propInfo.isUnmapped,
            "'ContactName' should be a mapped property");
        equal(cust.ContactName(), "Amy",
            "'ContactName' should be a KO 'property' returning 'Amy'");
    });

    /*********************************************************
    * add method to prototype via constructor
    *********************************************************/
    test("add method to prototype via constructor", function () {
        expect(2);
        var store = cloneModuleMetadataStore();

        var Customer = function () { };

        Customer.prototype.sayHi = function () {
            return "Hi, my name is {0}!".format(this.CompanyName());
        };

        store.registerEntityTypeCtor("Customer", Customer);

        var customerType = store.getEntityType("Customer");
        var cust = customerType.createEntity();
        cust.CompanyName("Acme");

        ok(cust["sayHi"],
            "should have 'sayHi' member via constructor");

        var expected = "Hi, my name is Acme!";
        equal(cust.sayHi(), expected,
            "'sayHi' function should return expected message, '{0}'."
                .format(expected));
    });

    /*********************************************************
    * can add unmapped readonly ES5 defined property via constructor
    * add breeze exports/imports just fine
    *********************************************************/
    test("can add unmapped readonly ES5 defined property via constructor", function () {
        expect(5);
        var store = cloneModuleMetadataStore();

        var Customer = function () { };

        Object.defineProperty(Customer.prototype, 'foo', {
            get: function () { return 42; },
            enumerable: true,
            configurable: true
        });

        store.registerEntityTypeCtor('Customer', Customer);
        assertFooPropertyDefined(store, true);

        var em = newEm(store);

        var cust = em.createEntity('Customer', {
            CustomerID: testFns.newGuid(),
            CompanyName: "test cust"
        });

        var propInfo = cust.entityType.getProperty('foo');
        ok(propInfo != null, "'Customer.foo' is known to metadata ");

        equal(cust.foo(), 42, "'cust.foo' should return 42");

        var exported = em.exportEntities([cust], false); // no metadata

        // Change the exported the foo property value. It shouldn't matter
        exported = exported.replace(/("foo":42)/, '"foo":100');

        ok(/("foo":100)/.test(exported),
            "replaced 42 with 100 in exported: exported is:\n" + exported);

        var cust2 = em.importEntities(exported).entities[0];

        equal(cust2.foo(), 42, "imported 'cust2.foo' should return 42 after import");
    });

    /*********************************************************
    * can add ES5 definedProperty to ctor that is invisible to Breeze
    * by adding to prototype AFTER registering cto.
    * Breeze would not see it and would not export or import it
    * This example wraps a Date property in an "AsString" property
    * so that the wrapped data property is read/write as a string, not a date object.
    *********************************************************/
    test("can add hidden ES5 defined wrapper property (Date) via constructor", function () {
        expect(5);

        var store = cloneModuleMetadataStore();

        var Order = function () { };

        // register it FIRST, then add the property
        store.registerEntityTypeCtor('Order', Order);
        addorderDateAsStringProperty(Order);

        var em = newEm(store);
        var testDate = new Date(2014,0,1,13,30); // 1/1/2014 1:30 pm

        var order = em.createEntity('Order', {
            CompanyName: "test cust",
            OrderDate: testDate
        });

        equal(order.OrderDate().value, testDate.value,
            "'order.OrderDate' should return " + testDate);
        equal(order.orderDateAsString, testDate.toString(),
            "'order.orderDateAsString' should return " + testDate.toString());

        var testDate2 = new Date(); // now
        // update OrderDate by way of the wrapper property
        order.orderDateAsString = testDate2.toString();

        equal(order.OrderDate().value, testDate2.value,
            "after update, 'order.OrderDate' should return " + testDate2);
        equal(order.orderDateAsString, testDate2.toString(),
            "after update, 'order.orderDateAsString' should return " + testDate2.toString());

        var propInfo = order.entityType.getProperty('orderDateAsString');
        ok(propInfo == null, "'Order.orderDateAsString' is not known to metadata ");
    });

    function addorderDateAsStringProperty(orderCtor) {

        // now add the wrapper property to the prototype
        Object.defineProperty(orderCtor.prototype, 'orderDateAsString', {
            get: function () { return this.OrderDate().toString(); },
            set: function (value) { this.OrderDate(value); },
            enumerable: true,
            configurable: true
        });
    }

    /*********************************************************
    * knockout computed property via constructor
    *********************************************************/
    test("add knockout computed property via constructor", function () {
        expect(2);
        var store = cloneModuleMetadataStore();

        var Employee = function () {
            this.fullName = ko.computed(
                {
                    read: function () {
                        return this.FirstName() + " " + this.LastName();
                    },
                    // required because FirstName and LastName not yet defined
                    deferEvaluation: true
                }, this);
        };

        store.registerEntityTypeCtor("Employee", Employee);

        var employeeType = store.getEntityType("Employee");
        var emp = employeeType.createEntity();
        emp.FirstName("John");
        emp.LastName("Doe");

        ok(emp["fullName"],
            "should have 'fullName' member via constructor");

        var expected = "John Doe";
        equal(emp.fullName(), expected,
            "'fullName' KO computed should return , '{0}'."
                .format(expected));
    });

    /*********************************************************
    * knockout computed property based on collection navigation via constructor
    *********************************************************/
    test("add knockout computed property based on collection navigation via constructor", function () {
        expect(2);
        var store = cloneModuleMetadataStore();

        var Employee = function () {
            this.orderCount = ko.computed(
                {
                    read: function () {
                        return this.Orders().length;
                    },
                    // Orders not defined yet
                    deferEvaluation: true
                }, this);
        };

        store.registerEntityTypeCtor("Employee", Employee);

        var employeeType = store.getEntityType("Employee");
        var emp = employeeType.createEntity();

        equal(emp.orderCount(),0,
            "should have a zero orderCount");

        var orderType = store.getEntityType("Order");
        var newOrder = orderType.createEntity();
        emp.Orders.push(newOrder);

        equal(emp.orderCount(), 1,
            "orderCount should be 1 after pushing newOrder");
        });
   /*********************************************************
   * knockout computed property w/ re-defined mapped dependent properties
   *********************************************************/
    test("add knockout computed property w/ re-defined mapped dependent properties", function () {
        expect(3);
        var store = cloneModuleMetadataStore();

            var Employee = function () {
                var self = this;
                self.FirstName = ko.observable(""); // default FirstName
                self.LastName = ko.observable("");  // default LastName
                self.fullName = ko.computed(
                        function () {
                            return self.FirstName() + " " + self.LastName();
                        });
            };

            store.registerEntityTypeCtor("Employee", Employee);

            var employeeType = store.getEntityType("Employee");
            var emp = employeeType.createEntity();
            emp.FirstName("John");
            emp.LastName("Doe");

            ok(emp["fullName"],
                "should have 'fullName' member via constructor");

            var expected = "John Doe";
            equal(emp.fullName(), expected,
                "created 'emp.fullName' KO computed should return , '{0}'."
                    .format(expected));

            // Now show it works for materialized query entity
            var query = breeze.EntityQuery.from("Employees").top(1);
            var em = newEm(store);

            stop(); // going async
            em.executeQuery(query)
            .then(function (data) {
                var emp2 = data.results[0];
                var expected2 = emp2.FirstName() + " " + emp2.LastName();
                equal(emp2.fullName(), expected2,
                    "materialized 'emp2.fullName' KO computed should return , '{0}'."
                        .format(expected2));
            })
            .fail(handleFail)
            .fin(start);
    });
    /*********************************************************
    * add subscription in post-construction initializer
    *********************************************************/
    test("add subscription in post-construction initializer", function () {
        expect(1);
        var store = cloneModuleMetadataStore();

        var Customer = function () {};

        var companyNameNotificationCount = 0;
        var customerInitializer = function(customer) {
            customer.CompanyName.subscribe(
                function (/*newValue*/) {
                    companyNameNotificationCount += 1;
            });
        };

        store.registerEntityTypeCtor("Customer", Customer, customerInitializer);

        var customerType = store.getEntityType("Customer");
        var cust = customerType.createEntity();

        cust.CompanyName("Beta");

        equal(companyNameNotificationCount, 1,
            "should have raised 'CompanyName' change notification once");
    });
    /*********************************************************
    * add property in post-construction initializer
    *********************************************************/
    test("add property in post-construction initializer", function () {
        expect(2);
        var store = cloneModuleMetadataStore();

        var Customer = function () { };

        var customerInitializer = function (customer) {
            customer.foo = "Foo " + customer.CompanyName();
        };

        store.registerEntityTypeCtor("Customer", Customer, customerInitializer);

        var customerType = store.getEntityType("Customer");
        var cust = customerType.createEntity();

        equal(cust.foo, "Foo ",
            "'foo' property, created in initializer, should return 'Foo");

        var propInfo = customerType.getProperty("foo");
        // The Breeze customerType knows nothing about it.
        ok(propInfo === null, "'foo' should be unknown to the customer type");

    });
    /*********************************************************
    * knockout computed property based on collection navigation via initializer
    *********************************************************/
    test("add knockout computed property based on collection navigation via initializer", function () {
        expect(2);
        var store = cloneModuleMetadataStore();

            var employeeInitializer = function (employee) {
                employee.orderCount = ko.computed(
                    {
                        read: function () {
                            return employee.Orders().length;
                        },
                        // Orders not defined yet
                        deferEvaluation: true
                    });
            };

            store.registerEntityTypeCtor("Employee", function (){}, employeeInitializer);

            var employeeType = store.getEntityType("Employee");
            var emp = employeeType.createEntity();

            equal(emp.orderCount(), 0,
                "should have a zero orderCount");

            var orderType = store.getEntityType("Order");
            var newOrder = orderType.createEntity();
            emp.Orders.push(newOrder);

            equal(emp.orderCount(), 1,
                "orderCount should be 1 after pushing newOrder");
        });
    /*********************************************************
    * initializer is called by importEntities
    *********************************************************/
    test("initializer is called by importEntities", function () {
        expect(5);

        // define and register employee initializer
        var employeeInitializer = function initializer(employee) {
            employee.foo = 'Foo ' + employee.LastName();
            employee.fooComputed = ko.computed(function () {
                return 'Foo ' + employee.LastName();
            }, this);
        };

        var store = cloneModuleMetadataStore();
        store.registerEntityTypeCtor('Employee', null, employeeInitializer);

        // define manager using prepared test store
        var em1 = new EntityManager({
            serviceName: northwindService,
            metadataStore: store
        });

        var emp = em1.createEntity('Employee', {
            EmployeeID: 42,
            LastName: 'Test'
        });

        // export cached entities with their metadata
        var exportData = em1.exportEntities();

        // Emulate launching a separate disconnected app
        // and loading data from local browser storage  (exportData)

        // Create em2 with with registration only
        // expecting metadata from import to fill in the entityType gaps
        var em2 = new breeze.EntityManager(northwindService);

        // Must add initializer as it is not part of metadata export.
        em2.metadataStore.registerEntityTypeCtor('Employee', null, employeeInitializer);

        // Import as if from browser storage
        em2.importEntities(exportData);

        // Get from cache by key (either of two ways)
        //var emp2 = em2.getEntityByKey(emp.entityAspect.getKey());
        var emp2 = em2.getEntityByKey('Employee', 42);

        ok(emp2 !== null, "should find imported emp2 with id==42");
        ok(emp2 && emp2.foo,
            "emp2 should have 'foo' property from initializer");
        equal(emp2 && emp2.foo, "Foo Test",
            "'emp2.foo' untracked non-KO initializer property should be 'Foo Test'");
        ok(emp2 && emp2.fooComputed,
            "emp2 should have 'fooComputed' observable from initializer");
        equal(emp2 && emp2.fooComputed && emp2.fooComputed(), "Foo Test",
            "'emp2.fooComputed' untracked initializer property should be 'Foo Test'");

    });

    /*********************************************************
    * Can create employee after registering addhasValidationErrorsProperty initializer
    *********************************************************/
    test("Can create employee after registering addhasValidationErrorsProperty initializer", function () {
        expect(8);
        var hasValidationErrorsRaised;
            var store = cloneModuleMetadataStore();

            store.registerEntityTypeCtor("Employee", function () { }, addhasValidationErrorsProperty);

            var employeeType = store.getEntityType("Employee");
            equal(employeeType.autoGeneratedKeyType, breeze.AutoGeneratedKeyType.Identity,
                "'employeeType' should have identity key");

            var emp = employeeType.createEntity();
            equal(emp.EmployeeID(), 0,
                "new emp should have id===0 before adding to manager");

            ok(emp.hasValidationErrors,
                "new emp should have the 'hasValidationErrors' observable");

            if (emp.hasValidationErrors) {
                emp.hasValidationErrors.subscribe(function () {
                    hasValidationErrorsRaised = true;
                });
            }

            ok(emp.hasValidationErrors && !emp.hasValidationErrors(),
                "'hasValidationErrors' should be false before adding to manager.");

            var manager = new breeze.EntityManager({
                serviceName: northwindService,
                metadataStore: store
            });
            manager.addEntity(emp);

            ok(emp.EmployeeID() < 0,
                "new emp should have temp id <0 after adding to manager; is " + emp.EmployeeID());

            // A manager's default validationOptions are set to validate the entity
            // when it is attached (added) to the manager
            ok(emp.hasValidationErrors && emp.hasValidationErrors(),
                "'hasValidationErrors' should be true after adding to manager.");

            ok(hasValidationErrorsRaised,
                "'hasValidationErrors' observable raised a notification");

            ok(true, "Validation messages are: "+ testFns.getValidationErrMsgs(emp));
        });

    // Initializer that adds hasValidationErrors observable property
    // to any entity. This observable notifies when validation errors change
    function addhasValidationErrorsProperty(entity) {

        var prop = ko.observable(false);

        var onChange = function () {
            var hasError = entity.entityAspect.getValidationErrors().length > 0;
            if (prop() === hasError) {
                // collection changed even though entity net error state is unchanged
                prop.valueHasMutated(); // force notification
            } else {
                prop(hasError); // change the value and notify
            }
        };

        onChange();             // check now ...
        entity.entityAspect // ... and when errors collection changes
            .validationErrorsChanged.subscribe(onChange);

        // observable property is wired up; now add it to the entity
        entity.hasValidationErrors = prop;
    }
    /*********************************************************
    * queried entity has new property from post-construction initializer
    *********************************************************/
    test("queried entity has new property from post-construction initializer",
        function () {
            expect(1);
            var store = cloneModuleMetadataStore();

            var Customer = function () { };

            var customerInitializer = function (customer) {
                customer.foo = "Foo " + customer.CompanyName();
            };

            store.registerEntityTypeCtor("Customer", Customer, customerInitializer);

            // create EntityManager with extended metadataStore
            var em = newEm(store);
            var query = EntityQuery.from("Customers").top(1);

            stop(); // going async
            em.executeQuery(query)
                .then(function (data) {
                    var cust = data.results[0];
                    equal(cust.foo, "Foo "+cust.CompanyName(),
                        "'foo' property, created in initializer, performed as expected");
                })
                .fail(handleFail)
                .fin(start);
    });
    /*********************************************************
    * unmapped property (and only unmapped property) preserved after export/import
    *********************************************************/
    test("unmapped property preserved after export/import",
        function () {
            expect(3);
            var store = cloneModuleMetadataStore();

            var Customer = function () {
                this.unmappedProperty = "";
            };

            var customerInitializer = function (customer) {
                customer.initializerProperty =
                    customer.foo || "new initializerProperty";
            };

            store.registerEntityTypeCtor("Customer", Customer, customerInitializer);

            // create EntityManager with extended metadataStore
            var em1 = newEm(store);

            // create a new customer defined by that extended metadata
            var cust1 = em1.createEntity('Customer', {CustomerID: testFns.newGuidComb()});

            // Set the 'properties' we added
            cust1.unmappedProperty("Hi, I'm unmapped");
            cust1.initializerProperty = "Hi, I'm the initializerProperty";
            cust1.adHocProperty = 42; // can always add another property; it's JavaScript

            var exportData = em1.exportEntities();

            var em2 = newEm(store);
            em2.importEntities(exportData);
            var cust2 = em2.getEntities()[0];

            // Only cust2.unmappedProperty should be preserved
            equal(cust2.unmappedProperty(), "Hi, I'm unmapped",
                "cust2.unmappedProperty's value should be restored after import");
            equal(cust2.initializerProperty, "new initializerProperty",
                "cust2.initializerProperty's value should NOT be restored after import; it is '{0}' "
                .format(cust2.initializerProperty));
            ok(typeof cust2.adHocProperty === "undefined",
                "cust2.adHocProperty should be undefined");

        });

    /*********************************************************
    * createEntity sequence is ctor, init-vals, init-fn, add
    *********************************************************/
    test("createEntity sequence is ctor, init-vals, init-fn, add", function () {
        expect(4);

        // ARRANGE
        var actual;
        var action = {
            ctor: "constructor",
            initVals: "initialValues",
            initFn: "initializer",
            attach: "added to manager"
        };

        function ctor() {
            actual && actual.push(action.ctor);
        };

        function initFn(c) { // initializer
            if (c.CompanyName !== null) {
                // CompanyName setting must have happened so record
                // that initial values were used before initFn was called
                actual.push(action.initVals);
            }
            actual.push(action.initFn);
        };

        var store = cloneModuleMetadataStore();
        store.registerEntityTypeCtor('Customer', ctor, initFn);
        var em = newEm(store);

        // Listen for entity cache 'Attach' event
        em.entityChanged.subscribe(function (args) {
            if (args.entityAction === breeze.EntityAction.Attach) {
                actual.push(action.attach);
            }
        });

        actual = [];

        // ACT
        var cust = em.createEntity('Customer', {
            CustomerID: testFns.newGuidComb(),
            CompanyName: 'Acme'
        });

        // ASSERT
        equal(actual[0], action.ctor,    'ctor called 1st');
        equal(actual[1], action.initVals,'initial values 2nd');
        equal(actual[2], action.initFn,  'initializer 3rd');
        equal(actual[3], action.attach,  'attach-to-mgr 4th');
    });

    /*********************************************************
    * query result processing sequence is ctor, init-er, attach
    *********************************************************/
    asyncTest("query result processing sequence is ctor, init-fn, attach", function () {
        expect(3);

        // ARRANGE
        var actual;
        var action = {
            ctor: "constructor",
            initFn: "initializer",
            attach: "attach on query"
        };

        function ctor() {
            actual && actual.push(action.ctor);
        };

        function initFn() {
            actual.push(action.initFn);
        };

        var store = cloneModuleMetadataStore();
        store.registerEntityTypeCtor('Customer', ctor, initFn);
        var em = newEm(store);

        // Listen for entity cache 'Attach' event
        em.entityChanged.subscribe(function (args) {
            if (args.entityAction === breeze.EntityAction.AttachOnQuery) {
                actual.push(action.attach);
            }
        });

        actual = [];

        // ACT
        EntityQuery.from('Customers').top(1)
            .using(em).execute()
            .then(success)
            .catch(handleFail).finally(start);

        // ASSERT
        function success() {
            equal(actual[0], action.ctor, 'ctor called 1st');
            equal(actual[1], action.initFn, 'initializer 2nd');
            equal(actual[2], action.attach, 'attach 3rd');
        }
    });
    /*********************************************************
    * can define custom temporary key generator
    * must conform to the keygenerator-interface
    * http://www.breezejs.com/sites/all/apidocs/classes/~keyGenerator-interface.html
    *********************************************************/
    test("can define custom temporary key generator",
        function () {
            expect(3);
            var em = newEm();

            // add statics for testing the key generator
            var tempIds = testKeyGenerator.tempIds = [];

            em.setProperties({ keyGeneratorCtor: testKeyGenerator });

            // Order has an integer key.
            // temporary keys are assigned when added to an EntityManager
            var o1 = em.createEntity('Order');
            var o2 = em.createEntity('Order');

            // Customer has a client-assigned Guid key
            // A new Customer does not add its key to the tempIds
            em.createEntity('Customer',{CustomerID: testFns.newGuidComb()});

            equal(tempIds.length, 2, "should have 2 tempIds");
            equal(o1.OrderID(), tempIds[0], "o1 should have temp key " + tempIds[0]);
            equal(o2.OrderID(), tempIds[1], "o2 should have temp key " + tempIds[1]);

        });

    function testKeyGenerator() {
        var self = this;
        this.nextNumber = -1000;

        this.generateTempKeyValue = function (entityType) {
            var keyProps = entityType.keyProperties;
            if (keyProps.length > 1) {
                throw new Error("Cannot autogenerate multi-part keys");
            }
            var keyProp = keyProps[0];
            var nextId = GetNextId(keyProp.dataType);
            testKeyGenerator.tempIds.push(nextId);
            return nextId;
        };

        function GetNextId(dataType) {
            if (dataType.isNumeric) {
                return self.nextNumber -= 1;
            }

            if (dataType === breeze.DataType.Guid) {
                return breeze.core.getUuid();
            }

            throw new Error("Cannot generate key for a property of datatype: " +
                dataType.toString());
        }
    }

    /*********************************************************
    * If key is store-generated and the given key value is the default value
    * the default value is replaced by client-side temporary key generator
    *********************************************************/
    test("store-gen keys w/ default values are re-set by key generator upon add to manager",
        function () {
            var em = newEm();

            // implicit default key value
            var o1 = em.createEntity('Order');
            ok(o1.OrderID() < 0,
                "o1's default key should be replaced by negative temp key; it is " + o1.OrderID());

            // explicit default key value
            var o2 = em.createEntity('Order', { OrderID: 0 });
            ok(o2.OrderID() < 0,
                "o2's explict '0' key should be replaced by negative temp key; it is " + o2.OrderID());

            // a non-default key value
            var o3 = em.createEntity('Order', { OrderID: 42 });
            equal(o3.OrderID(), 42,
                "o3's non-zero key is retained; it is " + o3.OrderID());
        });

    //////////////////
    module("entityExtensionTests - backingStore", getModuleConfig('backingStore'));

    /*********************************************************
    * can add unmapped 'foo' property directly to EntityType
    * Fails until defect #2646 is cured
    *********************************************************/
    test("can add unmapped 'foo' property directly to EntityType", function () {
        expect(4);
        var store = cloneModuleMetadataStore();
        assertFooPropertyDefined(store, false);

        var customerType = store.getEntityType('Customer');
        var fooProp = new breeze.DataProperty({
            name: 'foo',
            defaultValue: 42,
            isUnmapped: true  // !!!
        });
        customerType.addProperty(fooProp);

        assertFooPropertyDefined(store, true);

        var cust = store.getEntityType('Customer').createEntity();

        equal(cust.foo, 42,
            "'cust.foo' should return the default=42");

        equal(cust._backingStore.foo, 42,
            "'cust._backingStore.foo' should return the default=42");
    });
    /*********************************************************
    * unmapped property can be set by server class calculated property
    *********************************************************/
    test("unmapped property can be set by a calculated property of the server class", function () {
        expect(4);
        var store1 = cloneModuleMetadataStore();

        var store2 = cloneModuleMetadataStore();
        var employeeCtor = function () {
            //'Fullname' is a server-side calculated property of the Employee class
            // This unmapped property will be empty for new entities
            // but will be set for existing entities during query materialization
            this.FullName = "";
        };
        store2.registerEntityTypeCtor("Employee", employeeCtor);

        var em1 = newEm(store1); // no unmapped properties registered
        var prop = em1.metadataStore.getEntityType('Employee').getProperty('FullName');
        ok(!prop,
            "'FullName' should NOT be a registered property of 'em1'.");

        var em2 = newEm(store2);
        prop = em2.metadataStore.getEntityType('Employee').getProperty('FullName');
        ok(prop && prop.isUnmapped,
            "'FullName' should be an unmapped property in 'em2'");

        var query = EntityQuery.from('Employees');
        var p1 = em1.executeQuery(query).then(success1);
        var p2 = em2.executeQuery(query).then(success2);

        stop(); // going async

        Q.all([p1, p2]).fail(handleFail).fin(start);

        function success1(data) {
            var first = data.results[0];
            var fullname = first.FullName;
            ok(fullname === undefined, "an Employee queried with 'em1' should NOT have a 'FullName' property, let alone a value for it");
        }

        function success2(data) {
            var first = data.results[0];
            var fullname = first.FullName;
            ok(fullname, "an Employee queried with 'em2' should have a calculated FullName ('Last, First'); it is '{0}'"
                .format(fullname));
        }

    });
    /*********************************************************
    * add fancy constructor to employee and query with it
    *********************************************************/
    asyncTest("add fancy constructor to employee and query with it", function () {
        expect(2);
        var store = cloneModuleMetadataStore();
        var em = newEm(store);
        addFancyEmpCtor(store);

        breeze.EntityQuery.from('Employees')
            .where('FirstName', 'eq', 'Nancy')
            .using(em).execute()
            .then(success).catch(handleFail).finally(start);

        function success(data) {
            var emp = data.results[0];
            ok(emp != null, "Should have an employee");
            var full = emp && emp.FullName;
            equal('Nancy Davolio', full, "emp fullname is "+full);
        }

    });

    /*********************************************************
    * add fancy constructor to employee and expand query with it
    * Explores test case raised by Brian Noyes' reader in this S.O.
    * http://stackoverflow.com/questions/19723761/entityaspect-property-no-longer-availaible-after-adding-an-expand-clause-in-bree
    *********************************************************/
    asyncTest("add fancy constructor to employee and expand query with it", function () {
        expect(2);
        var store = cloneModuleMetadataStore();
        var em = newEm(store);
        addFancyEmpCtor(store);

        breeze.EntityQuery.from('Employees')
            .where('FirstName', 'eq', 'Nancy')
            .expand('Orders')
            .using(em).execute()
            .then(success).catch(handleFail).finally(start);

        function success(data) {
            var emp = data.results[0];
            ok(emp != null, "Should have an employee");
            var ordersLen = emp ? emp.Orders.length : 0;
            ok(ordersLen > 0, "emp has "+ordersLen+" orders.");
        }

    });
    function addFancyEmpCtor(store) {
        function EmployeeCtor() {
            this.isChanged = false; // unmapped r/w property
        }

        Object.defineProperty(EmployeeCtor.prototype, 'FullName', {
            get: function () {
                var ln = this.LastName;
                var fn = this.FirstName;

                return ln ? fn + ' ' + ln : fn;
            }
        });

        store.registerEntityTypeCtor('Employee', EmployeeCtor);
    }

    /*********************************************************
    * helpers
    *********************************************************/

    function assertFooPropertyDefined(metadataStore, shouldBe) {
        var custType = metadataStore.getEntityType("Customer");
        var fooProp = custType.getDataProperty('foo');
        if (shouldBe) {
            ok(fooProp && fooProp.isUnmapped,
                "'foo' property should be defined as unmapped property after registration.");
        } else {
            ok(!fooProp, "'foo' property should NOT be defined before registration.");
        }
        return fooProp;
    }

    function cloneModuleMetadataStore() {
        return cloneStore(moduleMetadataStore);
    }

    function cloneStore(source) {
        var metaExport = source.exportMetadata();
        return new MetadataStore().importMetadata(metaExport);
    }

    function getModuleConfig(modelLibrary) {
        var firstTime = true;
        var origAdapterName = breeze.config.getAdapterInstance("modelLibrary").name;
        return {
            setup:    moduleMetadataStoreSetup,
            teardown: restoreModelAdapter
        };

        // Populate the moduleMetadataStore with service metadata
        function moduleMetadataStoreSetup() {
            breeze.config.initializeAdapterInstance("modelLibrary", modelLibrary, true);
            if (!firstTime) return; // got metadata already

            firstTime = true;
            moduleMetadataStore = new MetadataStore();
            stop(); // going async for metadata ...
            Q.all([
                moduleMetadataStore.fetchMetadata(northwindService),
                moduleMetadataStore.fetchMetadata(todoService)
            ]).fail(handleFail).fin(start);
        }

        function restoreModelAdapter() {
            breeze.config.initializeAdapterInstance("modelLibrary", origAdapterName, true);
        }
    }

    function newEm(metadataStore) {
        return new EntityManager({
            serviceName: northwindService,
            metadataStore: metadataStore || moduleMetadataStore
        });
    }

})(docCode.testFns);


Lithium is readily absorbed from the gastrointestinal tract, reaching a peak plasma level in 2 to 4 hours. Distribution occurs throughout the extracellular fluid with no evidence of protein binding. Passage through the blood-brain barrier is limited, so that cerebrospinal fluid levels are 50% of plasma levels at steady state.


Local "bandits" held up a group from the Plains Trail Region Roundup in Post during their wagon tour of Post. No one was hurt and the outlaws were invited to the Heritage House to share refreshments.
Published Aug. 21, 2011 @ 6:13 p.m.
Representatives from the 52-county Texas Plains Trail Region held their annual Roundup in Post Monday and Tuesday, August 15 and 16. The event was hosted by the Caprock Cultural Association; however, several other local organizations helped make the meetings a success including Post City Celebrations, Inc.; the Post Area Chamber of Commerce; the City of Post; Garza County and the Garza Theatre.
"Oh my goodness - what a great great evening in POST," said Paula Hatfield from Snyder in an email following the event. "The food was excellent, the music was quite entertaining....and the fellowship, networking...was phenomenal."
Approximately 75 attended the "Trail Mix" Monday night at the Heritage House. While enjoying refreshments, individuals and groups had photos taken in front of an old west jail or as cowgirls and cowboys. Rides in a large wagon driven by Jim Nolan and pulled by "Roscoe" the mule took guests on a tour of Post's Main Street. Jim Plummer acted as tour guide pointing out historical sites and other places of interest. Passengers were surprised by good-natured bandits on horseback during the ride. Following the mixer, Post City Celebrations, Inc. hosted a free concert at the Garza Theatre featuring New Mexico musicians Marilyn Priddy and Carl Burnstein.
Tuesday's Roundup events were at the Community Center and featured a full day of informative and educational presentations to help the communities in the Plains Trail Region better promote tourism and preserve their heritage. After the meeting closed mid-afternoon, several attendees were seen shopping in local businesses before heading back home.


Our local community board has an important advisory role in dealing with land use and zoning matters, the city budget, municipal service delivery, and many other matters relating to this communities' welfare. Victorian Flatbush comprises most of the northern half of Brooklyn Community District #14. The Board is made up of community residents and leaders appointed by elected officials. It is led by longtime chairperson Alvin Berk.
The day-to-day operations of Community Board 14 are staffed by District Manager Shawn Campbell. They have many years of experience in resolving quality-of-life issues and in getting city agencies to respond to residents' concerns. Before contacting city agencies directly, it is often useful to start at the community board.
The Board's office is located at 810 East 16th Street (11230), south of Avenue H, next to the Avenue H train station. Phone: 718-859-6357; fax: 718-421-6077.


The myth of the Kikché Mayas is the groundwork for this solo. The gods created man, who he changed in their absence. They had given him everything: nurishment to live, for the senses, for the mind. Still men couldn't nurishment this food responsibly. In this solo Sabine Seume plays with various roles and characters such as a distorted man as well as an observing and dealing godly character.
Radically changing roles – unexpected and sudden – represent drastic transformations. The gods decide to reform the body and mind in three attempts. They create animals first, which while they are able to cluck and scream, they are unfortunately unable to talk to the gods. The gods then try to create a human body with wood, but the faces are immobile and rigid. Finally, they try a mixture of corn and water – which results in a something made of flesh and blood.
In a Plexiglas tub, containing a sort of ancient soup, miraculous transformations take place and are portrayed by Sabine Seume as she experiences different developmental stages in the process of becoming human. A game of extremes: poetic, powerful, facet rich and strange.


text:
Cesium, iodine and tritium in NW Pacific waters-a comparison of the Fukushima impact with global fallout
P. P. Povinec, M. Aoyama, D. Biddulph, R. Breier, K. Buesseler, C. C. Chang, R. Golser, X. L. Hou, M. Ješkovský, A. J.T. Jull, J. Kaizer, M. Nakano, H. Nies, L. Palcsu, L. Papp, M. K. Pham, P. Steier, L. Y. Zhang
Radionuclide impact of the Fukushima Dai-ichi nuclear power plant accident on the distribution of radionuclides in seawater of the NW Pacific Ocean is compared with global fallout from atmospheric tests of nuclear weapons. Surface and water column samples collected during the Ka'imikai-o-Kanaloa (KOK) international expedition carried out in June 2011 were analyzed for 134Cs, 137Cs, 129I and 3H. The 137Cs, 129I and 3H levels in surface seawater offshore Fukushima varied between 0.002-3.5 Bq L-1, 0.01-0.8 μBq L-1, and 0.05-0.15 Bq L-1, respectively. At the sampling site about 40 km from the coast, where all three radionuclides were analyzed, the Fukushima impact on the levels of these three radionuclides represents an increase above the global fallout background by factors of about 1000, 50 and 3, respectively. The water column data indicate that the transport of Fukushima-derived radionuclides downward to the depth of 300 m has already occurred. The observed 137Cs levels in surface waters and in the water column are compared with predictions obtained from the ocean general circulation model, which indicates that the Kuroshio Current acts as a southern boundary for the transport of the radionuclides, which have been transported from the Fukushima coast eastward in the NW Pacific Ocean. The 137Cs inventory in the water column is estimated to be about 2.2 PBq, what can be regarded as a lower limit of the direct liquid discharges into the sea as the seawater sampling was carried out only in the area from 34 to 37° N, and from 142 to 147° E. About 4.6 GBq of 129I was deposited in the NW Pacific Ocean, and 2.4-7 GBq of 129I was directly discharged as liquid wastes into the sea offshore Fukushima. The total amount of 3H released and deposited over the NW Pacific Ocean was estimated to be 0.1-0.5 PBq. These estimations depend, however, on the evaluation of the total 137Cs activities released as liquid wastes directly into the sea, which should improve when more data are available. Due to a suitable residence time in the ocean, Fukushima-derived radionuclides will provide useful tracers for isotope oceanography studies on the transport of water masses during the next decades in the NW Pacific Ocean.
Biogeosciences
https://doi.org/10.5194/bg-10-5481-2013
10.5194/bg-10-5481-2013
Dive into the research topics of 'Cesium, iodine and tritium in NW Pacific waters-a comparison of the Fukushima impact with global fallout'. Together they form a unique fingerprint.
cesium Agriculture & Biology 100%
tritium Agriculture & Biology 99%
radionuclides Agriculture & Biology 91%
iodine Earth & Environmental Sciences 89%
fallout Earth & Environmental Sciences 88%
radionuclide Earth & Environmental Sciences 72%
Pacific Ocean Agriculture & Biology 68%
Japan Agriculture & Biology 61%
Povinec, P. P., Aoyama, M., Biddulph, D., Breier, R., Buesseler, K., Chang, C. C., Golser, R., Hou, X. L., Ješkovský, M., Jull, A. J. T., Kaizer, J., Nakano, M., Nies, H., Palcsu, L., Papp, L., Pham, M. K., Steier, P., & Zhang, L. Y. (2013). Cesium, iodine and tritium in NW Pacific waters-a comparison of the Fukushima impact with global fallout. Biogeosciences, 10(8), 5481-5496. https://doi.org/10.5194/bg-10-5481-2013
Cesium, iodine and tritium in NW Pacific waters-a comparison of the Fukushima impact with global fallout. / Povinec, P. P.; Aoyama, M.; Biddulph, D.; Breier, R.; Buesseler, K.; Chang, C. C.; Golser, R.; Hou, X. L.; Ješkovský, M.; Jull, A. J.T.; Kaizer, J.; Nakano, M.; Nies, H.; Palcsu, L.; Papp, L.; Pham, M. K.; Steier, P.; Zhang, L. Y.
In: Biogeosciences, Vol. 10, No. 8, 2013, p. 5481-5496.
Povinec, PP, Aoyama, M, Biddulph, D, Breier, R, Buesseler, K, Chang, CC, Golser, R, Hou, XL, Ješkovský, M, Jull, AJT, Kaizer, J, Nakano, M, Nies, H, Palcsu, L, Papp, L, Pham, MK, Steier, P & Zhang, LY 2013, 'Cesium, iodine and tritium in NW Pacific waters-a comparison of the Fukushima impact with global fallout', Biogeosciences, vol. 10, no. 8, pp. 5481-5496. https://doi.org/10.5194/bg-10-5481-2013
Povinec PP, Aoyama M, Biddulph D, Breier R, Buesseler K, Chang CC et al. Cesium, iodine and tritium in NW Pacific waters-a comparison of the Fukushima impact with global fallout. Biogeosciences. 2013;10(8):5481-5496. https://doi.org/10.5194/bg-10-5481-2013
Povinec, P. P. ; Aoyama, M. ; Biddulph, D. ; Breier, R. ; Buesseler, K. ; Chang, C. C. ; Golser, R. ; Hou, X. L. ; Ješkovský, M. ; Jull, A. J.T. ; Kaizer, J. ; Nakano, M. ; Nies, H. ; Palcsu, L. ; Papp, L. ; Pham, M. K. ; Steier, P. ; Zhang, L. Y. / Cesium, iodine and tritium in NW Pacific waters-a comparison of the Fukushima impact with global fallout. In: Biogeosciences. 2013 ; Vol. 10, No. 8. pp. 5481-5496.
@article{496314ee6b7f44a599d4b8049a92f34e,
title = "Cesium, iodine and tritium in NW Pacific waters-a comparison of the Fukushima impact with global fallout",
abstract = "Radionuclide impact of the Fukushima Dai-ichi nuclear power plant accident on the distribution of radionuclides in seawater of the NW Pacific Ocean is compared with global fallout from atmospheric tests of nuclear weapons. Surface and water column samples collected during the Ka'imikai-o-Kanaloa (KOK) international expedition carried out in June 2011 were analyzed for 134Cs, 137Cs, 129I and 3H. The 137Cs, 129I and 3H levels in surface seawater offshore Fukushima varied between 0.002-3.5 Bq L-1, 0.01-0.8 μBq L-1, and 0.05-0.15 Bq L-1, respectively. At the sampling site about 40 km from the coast, where all three radionuclides were analyzed, the Fukushima impact on the levels of these three radionuclides represents an increase above the global fallout background by factors of about 1000, 50 and 3, respectively. The water column data indicate that the transport of Fukushima-derived radionuclides downward to the depth of 300 m has already occurred. The observed 137Cs levels in surface waters and in the water column are compared with predictions obtained from the ocean general circulation model, which indicates that the Kuroshio Current acts as a southern boundary for the transport of the radionuclides, which have been transported from the Fukushima coast eastward in the NW Pacific Ocean. The 137Cs inventory in the water column is estimated to be about 2.2 PBq, what can be regarded as a lower limit of the direct liquid discharges into the sea as the seawater sampling was carried out only in the area from 34 to 37° N, and from 142 to 147° E. About 4.6 GBq of 129I was deposited in the NW Pacific Ocean, and 2.4-7 GBq of 129I was directly discharged as liquid wastes into the sea offshore Fukushima. The total amount of 3H released and deposited over the NW Pacific Ocean was estimated to be 0.1-0.5 PBq. These estimations depend, however, on the evaluation of the total 137Cs activities released as liquid wastes directly into the sea, which should improve when more data are available. Due to a suitable residence time in the ocean, Fukushima-derived radionuclides will provide useful tracers for isotope oceanography studies on the transport of water masses during the next decades in the NW Pacific Ocean.",
author = "Povinec, {P. P.} and M. Aoyama and D. Biddulph and R. Breier and K. Buesseler and Chang, {C. C.} and R. Golser and Hou, {X. L.} and M. Je{\v s}kovsk{\'y} and Jull, {A. J.T.} and J. Kaizer and M. Nakano and H. Nies and L. Palcsu and L. Papp and Pham, {M. K.} and P. Steier and Zhang, {L. Y.}",
doi = "10.5194/bg-10-5481-2013",
journal = "Biogeosciences",
publisher = "European Geosciences Union",
T1 - Cesium, iodine and tritium in NW Pacific waters-a comparison of the Fukushima impact with global fallout
AU - Povinec, P. P.
AU - Aoyama, M.
AU - Biddulph, D.
AU - Breier, R.
AU - Buesseler, K.
AU - Chang, C. C.
AU - Golser, R.
AU - Hou, X. L.
AU - Ješkovský, M.
AU - Jull, A. J.T.
AU - Kaizer, J.
AU - Nakano, M.
AU - Nies, H.
AU - Palcsu, L.
AU - Papp, L.
AU - Pham, M. K.
AU - Steier, P.
AU - Zhang, L. Y.
N2 - Radionuclide impact of the Fukushima Dai-ichi nuclear power plant accident on the distribution of radionuclides in seawater of the NW Pacific Ocean is compared with global fallout from atmospheric tests of nuclear weapons. Surface and water column samples collected during the Ka'imikai-o-Kanaloa (KOK) international expedition carried out in June 2011 were analyzed for 134Cs, 137Cs, 129I and 3H. The 137Cs, 129I and 3H levels in surface seawater offshore Fukushima varied between 0.002-3.5 Bq L-1, 0.01-0.8 μBq L-1, and 0.05-0.15 Bq L-1, respectively. At the sampling site about 40 km from the coast, where all three radionuclides were analyzed, the Fukushima impact on the levels of these three radionuclides represents an increase above the global fallout background by factors of about 1000, 50 and 3, respectively. The water column data indicate that the transport of Fukushima-derived radionuclides downward to the depth of 300 m has already occurred. The observed 137Cs levels in surface waters and in the water column are compared with predictions obtained from the ocean general circulation model, which indicates that the Kuroshio Current acts as a southern boundary for the transport of the radionuclides, which have been transported from the Fukushima coast eastward in the NW Pacific Ocean. The 137Cs inventory in the water column is estimated to be about 2.2 PBq, what can be regarded as a lower limit of the direct liquid discharges into the sea as the seawater sampling was carried out only in the area from 34 to 37° N, and from 142 to 147° E. About 4.6 GBq of 129I was deposited in the NW Pacific Ocean, and 2.4-7 GBq of 129I was directly discharged as liquid wastes into the sea offshore Fukushima. The total amount of 3H released and deposited over the NW Pacific Ocean was estimated to be 0.1-0.5 PBq. These estimations depend, however, on the evaluation of the total 137Cs activities released as liquid wastes directly into the sea, which should improve when more data are available. Due to a suitable residence time in the ocean, Fukushima-derived radionuclides will provide useful tracers for isotope oceanography studies on the transport of water masses during the next decades in the NW Pacific Ocean.
AB - Radionuclide impact of the Fukushima Dai-ichi nuclear power plant accident on the distribution of radionuclides in seawater of the NW Pacific Ocean is compared with global fallout from atmospheric tests of nuclear weapons. Surface and water column samples collected during the Ka'imikai-o-Kanaloa (KOK) international expedition carried out in June 2011 were analyzed for 134Cs, 137Cs, 129I and 3H. The 137Cs, 129I and 3H levels in surface seawater offshore Fukushima varied between 0.002-3.5 Bq L-1, 0.01-0.8 μBq L-1, and 0.05-0.15 Bq L-1, respectively. At the sampling site about 40 km from the coast, where all three radionuclides were analyzed, the Fukushima impact on the levels of these three radionuclides represents an increase above the global fallout background by factors of about 1000, 50 and 3, respectively. The water column data indicate that the transport of Fukushima-derived radionuclides downward to the depth of 300 m has already occurred. The observed 137Cs levels in surface waters and in the water column are compared with predictions obtained from the ocean general circulation model, which indicates that the Kuroshio Current acts as a southern boundary for the transport of the radionuclides, which have been transported from the Fukushima coast eastward in the NW Pacific Ocean. The 137Cs inventory in the water column is estimated to be about 2.2 PBq, what can be regarded as a lower limit of the direct liquid discharges into the sea as the seawater sampling was carried out only in the area from 34 to 37° N, and from 142 to 147° E. About 4.6 GBq of 129I was deposited in the NW Pacific Ocean, and 2.4-7 GBq of 129I was directly discharged as liquid wastes into the sea offshore Fukushima. The total amount of 3H released and deposited over the NW Pacific Ocean was estimated to be 0.1-0.5 PBq. These estimations depend, however, on the evaluation of the total 137Cs activities released as liquid wastes directly into the sea, which should improve when more data are available. Due to a suitable residence time in the ocean, Fukushima-derived radionuclides will provide useful tracers for isotope oceanography studies on the transport of water masses during the next decades in the NW Pacific Ocean.
U2 - 10.5194/bg-10-5481-2013
DO - 10.5194/bg-10-5481-2013
JO - Biogeosciences
JF - Biogeosciences

redpajama_set_name: RedPajamaCommonCrawl


text:
Unusual News
Trump moves to end asylum protections for Central Americans
Pasadena Police investigating after woman found beaten to death in parking lot
Heat wave to bring triple digit heat to portions of SoCal
Congressional Gold Medal being designed to honor Chinese American veterans
Good Day LA
Top Property
The Issue Is
Anchors & Reporters
My13 KCOP
Man criminally charged with harassing 911 dispatch in Fullerton
By Oscar Flores, FOX 11
Posted Apr 16 2019 05:22PM PDT
Updated Apr 16 2019 05:41PM PDT
FULLERTON, Calif. (FOX 11) - Criminal charges were filed on Tuesday against a 29-year-old Fullerton man accused of harassing 911 dispatch and attacking Fullerton police officers sent to investigate.
Authorities say Juan Delgadillo Jr. called 911 seven consecutive times between 12:09 a.m. and 1:02 a.m. Monday. When a dispatcher called back to ask if he had an emergency, he said, "yes," and
hung up, according to Fullerton Police Department.
When officers showed up at Delgadillo's doorstep in the 2400 block of Daphne Place to investigate, Delgadillo ran away from the officers, police said.
After the officers caught up with Delgadillo, he kicked and assaulted them while trying to detain him, according to police. He was eventually taken into custody.
A system check showed Delgadillo was wanted on two outstanding arrest warrants, officials said. According to a criminal complaint, he was convicted of robbery in Los Angeles County in May 2009.
Delgadillo is charged with a felony count of resisting arrest and single misdemeanor counts of making annoying or harassing calls to 911 and resisting arrest.
CNS contributed to this report
11 injured after roof collapses at casino in Gardena
By Mary Stringini, FOX 11
Updated Jul 15 2019 11:54AM PDT
Eleven people were injured after the roof of a single-story casino building in Gardena collapsed Monday morning, according to the county fire department.
The roof collapse occurred shortly after 10 a.m. at Larry Flynt's Lucky Lady Casino located in the 1000 block of West Rosecrans Avenue in Gardena.
Police: 3-year-old child fatally shot in road rage incident
Milwaukee police say a 3-year-old child who was riding in a vehicle with her mother and three siblings was fatally shot in a road rage incident on the city's north side.
The Journal Sentinel reports a suspect was arrested following the Saturday morning shooting.
Police say the shooting occurred after a near-collision around 8:30 a.m. near North 42nd Street and West Concordia Avenue.
4.2-magnitude aftershock earthquake hits Ridgecrest area Monday morning
A 4.2-magnitude aftershock to the 7.1 earthquake of July 5 struck the Ridgecrest area Monday morning, followed by two smaller temblors the U.S. Geological Survey reported.
The quake hit at 1:38 a.m. at a depth of .6 mile 31.5 miles north- northwest of Ridgecrest in Kern County, according to a computer report.
American dies while on vacation in Dominican Republic
Child suicide bomber kills 5 at Afghan wedding
About FOX 11
Live & Replays
FOX on Demand
FOX 11 News App
FOX 11 Weather App


text:
Etta Pisano MD First Woman Named American College of Radiology Chief Research Officer
Etta Pisano, MD (Medical Device News Magazine)
Etta Pisano, MD, FACR, breast imaging research pioneer, has been named chief research officer (CRO) of the American College of Radiology. Pisano is the first woman to hold this ACR position. She previously served as chief science officer (CSO) solely for of the ACR Center for Research and Innovation™ (CRI).
"Dr. Pisano is a giant in the clinical research community. She will identify clinical and socioeconomic research opportunities that can advance the practice of radiology and improve patient care. We are proud to have her as chief research officer for the entire College which will allow us to tap her talents and experience across the ACR," said William T. Thorwarth, MD, FACR, chief executive officer of the American College of Radiology.
Pisano may be best known for leading landmark clinical research trials. She is principal investigator for the Tomosynthesis Mammographic Imaging Screening Trial (TMIST). Involving nearly 165,000 women, TMIST compares standard digital mammography (2-D) to digital breast tomosynthesis (DBT) to determine if DBT is more effective at reducing advanced breast cancers. TMIST will create the world's largest aggregation of data, images and biospecimens arising from a clinical research trial.
Pisano previously led the Digital Mammography Screening Trial (DMIST) — which accrued 49,528 women to compare effectiveness of digital mammography to film mammography. DMIST results, published in the New England Journal of Medicine in 2005, dramatically changed breast cancer screening guidelines and reimbursement.
SOURCEAmerican College of Radiology
Medical Device News Magazine
RELATED ARTICLESMORE FROM MEDICAL DEVICE NEWS MAGAZINE
Meinhard F. Schmidt Appointed Chairman of the Diabeloop Board
Modulim Announces Medical Advisory Board Appointments
Nevro Announces Executive Appointments
Innovatus Imaging Expands Staff
Dr. Americus Reed II joins Somatix Advisory Board
Claude LeDuc to Replace Dr. Brent Norton as President and Chief Executive Officer KIRKLAND, QC


text:
Smuggling Attempt Gone Wrong
Posted on 13 June 2012. by Jones Bahamas
Passengers aboard an ill fated vessel reportedly paid as much as $5,000 each to leave Abaco for Florida, National Security Minister Dr. Bernard Nottage revealed as much Tuesday while updating the public on the latest information regarding the tragedy at sea.
During House of Assembly proceedings Tuesday afternoon, Dr. Nottage revealed that an informant who is currently assisting police with their investigations has revealed that the persons aboard the vessel which sank Sunday were a part of a human smuggling attempt.
"A man who is reported to be a Bahamian national of Haitian origin reported to police that he was on board the vessel for the entire ordeal. He told police that his mother insisted that he go to the United States on the 25-foot vessel. The man said persons who were on board the vessel paid as much as $5,000 with hopes of making their way to Florida," he said.
All hope has pretty much been lost in the search for any survivors of Sunday's tragic incident off the coast of Abaco.
Police reports indicate that on June 10, a vessel "Glory Time," left Abaco around 5:00 p.m. en route to Florida.
Three hours into the voyage the vessel began to take on water and sank near Crown Haven, Abaco around 8:00 p.m.
But it was not until the afternoon hours on Monday that police were made aware of the incident.
Dr. Nottage said it was sometime around 1:00 p.m. Monday that police were alerted about the incident and responded.
"A team of police officers and defense force officers responded and provided assistance. A resident of Crown Haven, Abaco also went to the area on another vessel and was able to dive up from the sunken vessel 11 bodies which all appeared to be lifeless," he said.
"The recovered bodies have been transferred to the morgue in New Providence. The last report is that 10 persons were missing and feared to be dead."
According to the male informant who survived the incident, there were nine children on board the vessel.
He said there were five young females, all between the ages 18 and 30, and 14 males.
The man said six people survived but disappeared one on land.
Dr. Nottage confirmed that police have a group of persons in custody.
"Eight persons have been taken into custody that have been seen in the area of Cooper's Town and believed to be associated with the sunken vessel."
Superintendant of Police in Abaco Noel Curry confirmed Tuesday that the captain of the vessel has not yet been found and officers are not sure if he is deceased or missing.
He confirmed that if the captain is found to be alive, he could face serious human smuggling charges.
Dr. Nottage expressed thanks to the United States government for its assistance in the search, rescue and recovery efforts in the wake of the accident.
He also extended condolences to the families of the deceased.
"I extend my sincere condolences on behalf of the government and the people of The Bahamas, to the families of the victims. I trust that this unfortunate incident will further buttress the resolve of all right thinking individuals to do all that is possible to bring to the end the smuggling of persons to and through our waters," he said.
← "Ingraham Should Be Censured"- Says Labour Minister
Laing Fires Back At Gov't →


text:
Crashing Aly & AJ's Rare Day Off
Jesse Sendejas Jr.
Aly & AJ have included Houston on their 40-city tour.
Photo by Parker Woods, courtesy of No Big Deal PR
Jesse Sendejas Jr. | June 4, 2019 | 4:00am
A day off is a welcomed and not too uncommon occurrence in a routine work week. But for AJ Michalka, it's sort of a rare commodity. Michalka is the busy actress who brings to life Lainey Lewis from ABC's popular sitcom The Goldbergs and its spin-off, Schooled. She voices Catra on Netflix's She-Ra and the Princesses of Power. She's also half of Aly & AJ, the platinum-selling music duo she and her sister Aly Michalka formed more than 15 years ago. The band is in the middle of a 40-city tour, one that includes a stop at White Oak Music Hall this Saturday, supporting its latest release, Sanctuary.
Like AJ, Aly is an in-demand actress, whose CW series iZombie just premiered its fifth season. A day off seems a little improbable for these two we note while crashing one for a phone interview. AJ's kind enough to spend some of hers talking about the new EP, which bowed May 10, and a special project she and Aly are raising money and awareness for on this two-month run of shows.
"Our work life is so complicated that we're really simple people when we're not working, so a day off for us is just self-care, whether it's getting a massage, hanging out with our band, grabbing a great dinner. We're big foodies — food is really important to us — finding a great restaurant in a random city," AJ says of their down-time pursuits. "Taking time to read, catch up on a little TV. I just meditated. We're staying at a beautiful hotel in Indianapolis on this gorgeous little suburban street. So, just finding the right place to stay and take care of yourself."
Self-care is a lesson the sisters must have learned from successful careers that stretch back to their earliest work as Disney teen finds. They signed with Disney Music Group's Hollywood Records in 2004 and their debut studio album Into the Rush went gold, which set them on course for a music career that's included a platinum single, 2007's "Potential Breakup Song." The music has had to timeshare with the sisters' acting endeavors. Between them, they've had dozens of roles, in series like Phil of the Future, Hellcats, Two and a Half Men, The Guardian and Silicon Valley; and in films like Easy A and Grace Unplugged. They've been working more than half their lives, so we wondered what AJ recalled from a time before their days in the industry.
AJ Michalka and Aly Michalka have been working more than half their lives.
Photo by Stephen Ringer, courtesy of No Big Deal PR
"In some ways I feel like we've been doing this forever, you know; it's been over 15 years and we're only early 30s, late 20s. The days I remember before we hit the industry were days living in Seattle. We grew up in Seattle, Washington, we lived there for about seven years as kids," Michalka recalls. "I remember the neighborhood well, I remember the school we went to, the friends we made, the bike rides in our backyard, the trails we would take to get to and from errands on our bikes. You know, it was a really simple time and that's a beautiful place to grow up, so I do definitely recall a period of time when we weren't in a professional industry. We definitely had a pretty normal upbringing, as weird as that sounds."
She says she's really proud of Sanctuary, the five-song EP that released just weeks ago. The album's synth-pop tracks have been largely hailed by critics, starting with "Church," the record's first single, which debuted in March.
"I'm excited. This is a big tour, it's 40 cities in two months, we haven't done that in a long time. Last year was about a month, it was like 20 dates, and we definitely got our feet wet again. Getting back in a live setting is really a specific aspect of our career that we weren't used to, we had taken such a long break," AJ notes. "Being back in it I've learned a ton in regards to how we want to dress onstage, in regards to how we want our lighting design to come off per song, in regards to what our band plays, what our set list consists of, and we've now figured out a really great rhythm.
"We play about 18 songs, we're on stage for almost an hour and a half. We're playing a collection of old songs, we're playing music from the brand new EP, we're playing music from the EP we released last year and I think between old and new we've got a really good rhythm paced out. And I think our fans are excited because they're getting old songs that they've waited to hear for years but they're also getting a taste of the new. The reaction between the old and the new has been really, really strong.
"You know, at first, Aly and I knew we had taken such a long break we kind of thought the fans would only care about the old music, you know, the hits that really kind of started our career," Michalka continues. "But, as we've continued to play more and more shows, I see that that's not really true. The new music seems to be really, really impactful. As soon as the EP dropped while we were on the road this month, fans knew the words. I mean, it was crazy seeing the reaction towards the new music. It's neat to see that our fans are this engaged with the old and the new."
Their songwriting has long put them in a critically-hailed atmosphere some former teen pop stars never reach. AJ says she takes the reins on melodies and Aly focuses on lyrics. They work with some great collaborators, too, she notes, foremost Ryan Spraker, whom she considers the musical and production brain behind many Aly & AJ tracks. She says Yves Rothman is a collaborator on the new EP, "and I think he brought out some really great things in Aly and I."
"I'm really proud of this music. I really think this EP, this collection of five songs, tells a beautiful story, not only when you listen to it on iTunes or wherever you play music, but also live. We start the set with 'Church,' which I think is a really strong song. I'm excited, we've played Houston before, but we've never played White Oak before and we have some great fans in Texas," she says.
Aly & AJ have also teamed with The Trevor Project for this tour. The organization provides crisis intervention and suicide prevention services to LGBTQ young people and the sisters are helping raise awareness and funds during these shows.
Aly & AJ are teaming with The Trevor Project for this 40-show tour run
"Aly and I have considered ourselves longtime LGBTQ allies and it's really up to us every year to help make a difference and be a voice for our generation and we hope we can do that by teaming up with an organization every year like The Trevor Project when we perform," she says. "Touring is such a wonderful, giving thing, but it can also be really selfish. Playing music every night, you're on stage, fans are excited to see you – but, it's a lot of me, me, me. And that gets old. Aly and I want to be actually giving back if we can. I think a way to do that, now that we've gotten older and understand what we believe in, where we lean politically, we really feel the need to team up every year with a nonprofit that we feel is doing incredible things for our community. The Trevor Project really rings true for us."
Michalka says Aly & AJ have many fans in the LGBTQ world and all fans who attend the concerts and make donations to the organization can win a chance to meet the sisters post-show, in a raffle of sorts.
"It's kind of a cool incentive but it also proves just how wonderful young humanity still is. Our fans are so kind, they're so wonderful and so driven to do good, it's a really cool opportunity during the show where they get to donate to a great cause and have an opportunity to meet Aly and I backstage. We've raised a lot of money for [The] Trevor Project and I really believe in what they're doing for LGBTQs as well as the allies surrounding them, and Aly and I are included in that."
Aly & AJ seem to be included in all sorts of things. Staying so busy makes the odd day off all the more important. How does AJ plan to enjoy the day off, once we let her return to it?
"I'm actually hanging out on a hammock at the hotel and it's really beautiful out," she adds.
Aly & AJ, Saturday, June 8 at White Oak Music Hall, 2915 North Main. Armors opens the all ages show. Doors at 7 p.m., $20-$25.
Jesse's been writing for the Houston Press since 2013. His work has appeared elsewhere, notably on the desk of the English teacher of his high school girlfriend, Tish. The teacher recognized Jesse's writing and gave Tish a failing grade for the essay. Tish and Jesse celebrated their 33rd anniversary as a couple in October.


I have a about 20 pairs, Love to have about 20 more in colors I want.
I don't understand why this customizer it's so limited - it's not even worth having. With the colors available, I might as well pick something you already make and pay half the price. You need a WAYYYY bigger selection of colors for this to be worth it. This is coming from someone who owns about 20 pairs of 574s and would love this if it were truly a customizer.
My wife got me a gift card to get custom NB and they colors have changed from what I had previously designed. Seriously disappointing as this new swatch is boring and not worth bothering. I'd love to hear you'll be bringing back the old one or at least making an effort to brighten it up.
The color selections do not match the trends of today. Brighten up your color selections so we can purchase multiple shoes.
The new colors are AWFUL. Please bring back the old colors! I Had a design that I had painstakingly configured and was saving up to purchase, only to have EVERY ONE of the colors I chose discontinued the day I was to purchase them. I only have enough money to buy one pair of shoes every year and I am extremely bummed out that I wasn't able to get the ones I wanted.
AWESOME sneakers, need MORE COLORS !!!!
Orange, please ... and maybe Aqua-Blue, or Teal ... Dolphins and Gators ... also, colored laces ?? I spray paint mine !!!
Love the idea of picking out my own colors but was nervous about whether or not the color on the screen matched reality. Please be aware that "Dark Cashmere" looks purple in person. I designed a pair with Castlerock, Light Grey, and Dark Cashmere, and the purple tones in the Dark Cashmere do NOT blend well at all in this combination.