(function(define) {
"use strict";
define(function(require, exports) {
Bookshelf.js 0.3.0
(c) 2013 Tim Griesser
Bookshelf may be freely distributed under the MIT license.
For all details and documentation:
http://bookshelfjs.org
(function(define) {
"use strict";
define(function(require, exports) {
var Bookshelf = exports;
var Backbone = require('backbone');
var knex = require('knex');
var _ = require('underscore');
var when = require('when');
var inflection = require('inflection');
var triggerThen = require('trigger-then');
Keep a reference to our own copy of Backbone, in case we want to use this specific instance elsewhere in the application.
Bookshelf.Backbone = Backbone;
Mixin the triggerThen
function into all relevant Backbone objects,
so we can have event driven async validations, functions, etc.
triggerThen(Backbone, when);
Keep in sync with package.json
.
Bookshelf.VERSION = '0.3.0';
We're using Backbone.Events
rather than EventEmitter
,
for consistency and portability.
var Events = Bookshelf.Events = Backbone.Events;
Bookshelf
may be used as a top-level pub-sub bus.
_.extend(Bookshelf, Events);
Array helpers used throughout.
var array = [];
var push = array.push;
var splice = array.splice;
A Bookshelf Model represents an individual row in the database table --
It has a similar implementation to the Backbone.Model
constructor, except that defaults are not set until the
object is persisted, and the collection property is not used.
A unique cid
property is also added to each created model, similar to
Backbone
models, and is useful checking the identity of two models.
var Model = Bookshelf.Model = function(attributes, options) {
var attrs = attributes || {};
options || (options = {});
this.attributes = Object.create(null);
this._reset();
this.relations = {};
this.cid = _.uniqueId('c');
if (options) {
_.extend(this, _.pick(options, modelProps));
if (options.parse) attrs = this.parse(attrs, options) || {};
}
this.set(attrs, options);
this.initialize.apply(this, arguments);
};
A list of properties that are omitted from the Backbone.Model.prototype
, since we're not
handling validations, or tracking changes in the same fashion as Backbone
, we can drop these
specific methods.
var modelOmitted = ['changedAttributes', 'isValid', 'validationError', '_validate'];
List of attributes attached directly from the options
passed to the constructor.
var modelProps = ['tableName', 'hasTimestamps'];
_.extend(Model.prototype, _.omit(Backbone.Model.prototype, modelOmitted), Events, {
The hasOne
relation specifies that this table has exactly one of another type of object,
specified by a foreign key in the other table. The foreign key is assumed to be the singular of this
object's tableName
with an _id
suffix, but a custom foreignKey
attribute may also be specified.
hasOne: function(Target, foreignKey) {
return new Relation('hasOne', Target, {foreignKey: foreignKey}).init(this);
},
The hasMany
relation specifies that this object has one or more rows in another table which
match on this object's primary key. The foreign key is assumed to be the singular of this object's
tableName
with an _id
suffix, but a custom foreignKey
attribute may also be specified.
hasMany: function(Target, foreignKey) {
return new Relation('hasMany', Target, {foreignKey: foreignKey}).init(this);
},
A reverse hasOne
relation, the belongsTo
, where the specified key in this table
matches the primary idAttribute
of another table.
belongsTo: function(Target, foreignKey) {
return new Relation('belongsTo', Target, {foreignKey: foreignKey}).init(this);
},
A belongsToMany
relation is when there are many-to-many relation
between two models, with a joining table.
belongsToMany: function(Target, joinTableName, foreignKey, otherKey) {
return new Relation('belongsToMany', Target, {
joinTableName: joinTableName, foreignKey: foreignKey, otherKey: otherKey
}).init(this);
},
A morphOne
relation is a one-to-one polymorphic association from this model
to another model.
morphOne: function(Target, name, morphValue) {
return this._morphOneOrMany(Target, name, morphValue, 'morphOne');
},
A morphMany
relation is a polymorphic many-to-one relation from this model
to many another models.
morphMany: function(Target, name, morphValue) {
return this._morphOneOrMany(Target, name, morphValue, 'morphMany');
},
Defines the opposite end of a morphOne
or morphMany
relationship, where
the alternate end of the polymorphic model is defined.
morphTo: function(morphName) {
if (!_.isString(morphName)) throw new Error('The `morphTo` name must be specified.');
return new Relation('morphTo', null, {morphName: morphName, candidates: _.rest(arguments)}).init(this);
},
Used to define passthrough relationships - hasOne
, hasMany
,
belongsTo
or belongsToMany
, "through" a Interim
model or collection.
through: function(Interim, foreignKey, otherKey) {
return this.relatedData.through(this, Interim, {throughForeignKey: foreignKey, otherKey: otherKey});
},
Fetch a model based on the currently set attributes,
returning a model to the callback, along with any options.
Returns a deferred promise through the Bookshelf.Sync
.
If {require: true}
is set as an option, the fetch is considered
a failure if the model comes up blank.
fetch: function(options) {
options || (options = {});
var model = this, relatedData = this.relatedData;
return this.sync(options)
.first()
.then(function(response) {
if (response && response.length > 0) {
Todo: {silent: true, parse: true}, for parity with collection#set need to check on Backbone's status there, ticket #2636
model.set(model.parse(response[0]), {silent: true})._reset();
if (relatedData && relatedData.isJoined()) {
relatedData.parsePivot([model]);
}
if (!options.withRelated) return response;
return new EagerRelation([model], response, model)
.fetch(options)
.then(function() { return response; });
}
if (options.require) return when.reject(new Error('EmptyResponse'));
})
.then(function(response) {
if (response && response.length > 0) {
return model.triggerThen('fetched', model, response, options).then(function() {
return model;
});
}
return null;
});
},
Eager loads relationships onto an already populated Model
instance.
load: function(relations, options) {
var model = this;
_.isArray(relations) || (relations = [relations]);
options = _.extend({}, options, {shallow: true, withRelated: relations});
return new EagerRelation([this], [this.toJSON(options)], this)
.fetch(options)
.then(function() { return model; });
},
Similar to the standard Backbone
set method, but without individual
change events, and adding different meaning to changed
and previousAttributes
defined as the last "sync"'ed state of the model.
set: function(key, val, options) {
if (key == null) return this;
var attrs;
Handle both "key", value
and {key: value}
-style arguments.
if (typeof key === 'object') {
attrs = key;
options = val;
} else {
(attrs = {})[key] = val;
}
options || (options = {});
Extract attributes and options.
var hasChanged = false;
var unset = options.unset;
var current = this.attributes;
var prev = this._previousAttributes;
Check for changes of id
.
if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];
For each set
attribute, update or delete the current value.
for (var attr in attrs) {
val = attrs[attr];
if (!_.isEqual(prev[attr], val)) {
this.changed[attr] = val;
if (!_.isEqual(current[attr], val)) hasChanged = true;
} else {
delete this.changed[attr];
}
unset ? delete current[attr] : current[attr] = val;
}
if (hasChanged && !options.silent) this.trigger('change', this, options);
return this;
},
Sets and saves the hash of model attributes, triggering a "creating" or "updating" event on the model, as well as a "saving" event, to bind listeners for any necessary validation, logging, etc. If an error is thrown during these events, the model will not be saved.
save: function(key, val, options) {
var attrs;
Handle both "key", value
and {key: value}
-style arguments.
if (key == null || typeof key === "object") {
attrs = key || {};
options = val || {};
} else {
options || (options = {});
(attrs = {})[key] = val;
}
If the model has timestamp columns, set them as attributes on the model, even if the "patch" option is specified.
if (this.hasTimestamps) _.extend(attrs, this.timestamp(options));
Determine whether the model is new, based on whether the model has an idAttribute
or not.
var method = options.method || (options.method = this.isNew(options) ? 'insert' : 'update');
var vals = attrs;
If the object is being created, we merge any defaults here rather than during object creation.
if (method === 'insert' || options.defaults) {
var defaults = _.result(this, 'defaults');
if (defaults) {
vals = _.extend({}, defaults, this.attributes, vals);
}
}
Set the attributes on the model, and maintain a reference to use below.
var model = this.set(vals, {silent: true});
If there are any save constraints, set them on the model.
if (this.relatedData) this.relatedData.saveConstraints(this);
var sync = this.sync(options);
Gives access to the query
object in the options
, in case we need it.
options.query = sync.query;
return when.all([
model.triggerThen((method === 'insert' ? 'creating' : 'updating'), model, attrs, options),
model.triggerThen('saving', model, attrs, options)
])
.then(function() {
return sync[options.method](method === 'update' && options.patch ? attrs : model.attributes);
})
.then(function(resp) {
After a successful database save, the id is updated if the model was created
if (method === 'insert' && resp) {
model.attributes[model.idAttribute] = model[model.idAttribute] = resp[0];
}
In case we need to reference the previousAttributes
for the model
in the following event handlers.
options.previousAttributes = model._previousAttributes;
model._reset();
return when.all([
model.triggerThen((method === 'insert' ? 'created' : 'updated'), model, resp, options),
model.triggerThen('saved', model, resp, options)
]);
}).then(function() {
return model;
});
},
Destroy a model, calling a "delete" based on its idAttribute
.
A "destroying" and "destroyed" are triggered on the model before
and after the model is destroyed, respectively. If an error is thrown
during the "destroying" event, the model will not be destroyed.
destroy: function(options) {
options || (options = {});
var model = this;
return model.triggerThen('destroying', model, options)
.then(function() { return model.sync(options).del(); })
.then(function(resp) {
model.clear();
return model.triggerThen('destroyed', model, resp, options).then(function() {
return model._reset();
});
});
},
format converts a model into the values that should be saved into the database table. The default implementation is just to pass the response along.
format: function(attrs, options) {
return attrs;
},
Returns an object containing a shallow copy of the model attributes,
along with the toJSON
value of any relations,
unless {shallow: true}
is passed in the options
.
toJSON: function(options) {
var attrs = _.extend({}, this.attributes);
if (options && options.shallow) return attrs;
var relations = this.relations;
for (var key in relations) {
var relation = relations[key];
attrs[key] = relation.toJSON ? relation.toJSON() : relation;
}
if (this.pivot) {
var pivot = this.pivot.attributes;
for (key in pivot) {
attrs['_pivot_' + key] = pivot[key];
}
}
return attrs;
},
Sets the timestamps before saving the model.
timestamp: function(options) {
var d = new Date();
var keys = (_.isArray(this.hasTimestamps) ? this.hasTimestamps : ['created_at', 'updated_at']);
var vals = {};
vals[keys[1]] = d;
if (this.isNew(options) && (!options || options.method !== 'update')) vals[keys[0]] = d;
return vals;
},
Create a new model with identical attributes to this one, including any relations on the current model.
clone: function() {
var model = new this.constructor(this.attributes);
var relations = this.relations;
for (var key in relations) {
model.relations[key] = relations[key].clone();
}
model._previousAttributes = _.clone(this._previousAttributes);
model.changed = _.clone(this.changed);
return model;
},
Returns the related item, or creates a new related item by creating a new model or collection.
related: function(name) {
return this.relations[name] || (this[name] ? this.relations[name] = this[name]() : void 0);
},
Reset the query builder, called internally each time a query is run.
resetQuery: function() {
delete this._knex;
return this;
},
Returns an instance of the query builder.
query: function() {
return query(this, _.toArray(arguments));
},
Returns a knex
instance with the specified table name.
builder: function(table) {
return knex(table);
},
Creates and returns a new Bookshelf.Sync
instance.
sync: function(options) {
return new Bookshelf.Sync(this, options);
},
Helper for setting up the morphOne
or morphMany
relations.
_morphOneOrMany: function(Target, morphName, morphValue, type) {
if (!morphName || !Target) throw new Error('The polymorphic `name` and `Target` are required.');
return new Relation(type, Target, {morphName: morphName, morphValue: morphValue}).init(this);
},
Called after a sync
action (save, fetch, delete) -
resets the _previousAttributes
and changed
hash for the model.
_reset: function() {
this._previousAttributes = _.extend(Object.create(null), this.attributes);
this.changed = Object.create(null);
return this;
}
});
A Bookshelf Collection contains a number of database rows, represented by models, so they can be easily sorted, serialized, and manipulated.
var Collection = Bookshelf.Collection = function(models, options) {
if (options) _.extend(this, _.pick(options, collectionProps));
this._reset();
this.initialize.apply(this, arguments);
if (models) this.reset(models, _.extend({silent: true}, options));
};
List of attributes attached directly from the constructor's options object.
var collectionProps = ['model', 'comparator'];
Copied over from Backbone.
var setOptions = {add: true, remove: true, merge: true};
Extend the Collection's prototype with the base methods
_.extend(Collection.prototype, _.omit(Backbone.Collection.prototype, 'model'), Events, {
model: Model,
Used to define passthrough relationships - hasOne
, hasMany
,
belongsTo
or belongsToMany
, "through" a Interim
model or collection.
through: function(Interim, foreignKey, otherKey) {
return this.relatedData.through(this, Interim, {throughForeignKey: foreignKey, otherKey: otherKey});
},
A simplified version of Backbone's Collection#set
method,
removing the comparator, and getting rid of the temporary model creation,
since there's no way we'll be getting the data in an inconsistent
form from the database.
set: function(models, options) {
options = _.defaults({}, options, setOptions);
if (options.parse) models = this.parse(models, options);
if (!_.isArray(models)) models = models ? [models] : [];
var i, l, id, model, attrs, existing;
var at = options.at;
var targetModel = this.model;
var toAdd = [], toRemove = [], modelMap = {};
var add = options.add, merge = options.merge, remove = options.remove;
var order = add && remove ? [] : false;
Turn bare objects into model references, and prevent invalid models from being added.
for (i = 0, l = models.length; i < l; i++) {
attrs = models[i];
if (attrs instanceof Model) {
id = model = attrs;
} else {
id = attrs[targetModel.prototype.idAttribute];
}
If a duplicate is found, prevent it from being added and optionally merge it into the existing model.
if (existing = this.get(id)) {
if (remove) {
modelMap[existing.cid] = true;
continue;
}
if (merge) {
attrs = attrs === model ? model.attributes : attrs;
if (options.parse) attrs = existing.parse(attrs, options);
existing.set(attrs, options);
}
This is a new model, push it to the toAdd
list.
} else if (add) {
if (!(model = this._prepareModel(attrs, options))) continue;
toAdd.push(model);
Listen to added models' events, and index models for lookup by
id
and by cid
.
model.on('all', this._onModelEvent, this);
this._byId[model.cid] = model;
if (model.id != null) this._byId[model.id] = model;
}
if (order) order.push(existing || model);
}
Remove nonexistent models if appropriate.
if (remove) {
for (i = 0, l = this.length; i < l; ++i) {
if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model);
}
if (toRemove.length) this.remove(toRemove, options);
}
See if sorting is needed, update length
and splice in new models.
if (toAdd.length || (order && order.length)) {
this.length += toAdd.length;
if (at != null) {
splice.apply(this.models, [at, 0].concat(toAdd));
} else {
if (order) this.models.length = 0;
push.apply(this.models, order || toAdd);
}
}
if (options.silent) return this;
Trigger add
events.
for (i = 0, l = toAdd.length; i < l; i++) {
(model = toAdd[i]).trigger('add', model, this, options);
}
return this;
},
Fetch the models for this collection, resetting the models for the query when they arrive.
fetch: function(options) {
options || (options = {});
var collection = this, relatedData = this.relatedData;
return this.sync(options)
.select()
.then(function(response) {
if (response && response.length > 0) {
collection.set(response, {silent: true, parse: true}).invoke('_reset');
if (relatedData && relatedData.isJoined()) relatedData.parsePivot(collection.models);
} else {
collection.reset([], {silent: true});
return [];
}
if (!options.withRelated) return response;
return new EagerRelation(collection.models, response, new collection.model())
.fetch(options)
.then(function() { return response; });
})
.then(function(response) {
return collection.triggerThen('fetched', collection, response, options).then(function() {
return collection;
});
});
},
Fetches a single model from the collection, useful on related collections.
fetchOne: function(options) {
var model = new this.model;
model._knex = this.query().clone();
if (this.relatedData) model.relatedData = this.relatedData;
return model.fetch(options);
},
Eager loads relationships onto an already populated Collection
instance.
load: function(relations, options) {
var collection = this;
_.isArray(relations) || (relations = [relations]);
options = _.extend({}, options, {shallow: true, withRelated: relations});
return new EagerRelation(this.models, this.toJSON(options), new this.model())
.fetch(options)
.then(function() { return collection; });
},
Shortcut for creating a new model, saving, and adding to the collection.
Returns a promise which will resolve with the model added to the collection.
If the model is a relation, put the foreignKey
and fkValue
from the relatedData
hash into the inserted model. Also, if the model is a manyToMany
relation,
automatically create the joining model upon insertion.
create: function(model, options) {
options || (options = {});
var collection = this;
var relatedData = this.relatedData || new Relation();
var type = relatedData.type;
model = this._prepareModel(model, options);
If we've already added things on the query chain, these are likely intended for the model.
if (this._knex) {
model._knex = this._knex;
this.resetQuery();
}
return relatedData
.saveConstraints(model, this)
.save(null, options)
.then(function() {
if (type && (type === 'belongsToMany' || relatedData.isThrough())) {
return collection.attach(model, options);
}
})
.then(function() {
collection.add(model, options);
return model;
});
},
The tableName
on the associated Model, used in relation building.
tableName: function() {
return _.result(this.model.prototype, 'tableName');
},
The idAttribute
on the associated Model, used in relation building.
idAttribute: function() {
return this.model.prototype.idAttribute;
},
Reset the query builder, called internally each time a query is run.
resetQuery: function() {
delete this._knex;
return this;
},
Returns an instance of the query builder.
query: function() {
return query(this, _.toArray(arguments));
},
Returns a knex
instance with the specified table name.
builder: function(table) {
return knex(table);
},
Creates and returns a new Bookshelf.Sync
instance.
sync: function(options) {
return new Bookshelf.Sync(this, options);
},
Prepare a model or hash of attributes to be added to this collection.
_prepareModel: function(attrs, options) {
if (attrs instanceof Model) return attrs;
return new this.model(attrs, options);
}
});
An EagerRelation
object temporarily stores the models from an eager load,
and handles matching eager loaded objects with their parent(s). The tempModel
is only used to retrieve the value of the relation method, to know the constrains
for the eager query.
var EagerRelation = Bookshelf.EagerRelation = function(parent, parentResponse, target) {
this.parent = parent;
this.target = target;
this.parentResponse = parentResponse;
_.bindAll(this, 'pushModels', 'eagerFetch');
};
EagerRelation.prototype = {
This helper function is used internally to determine which relations
are necessary for fetching based on the model.load
or withRelated
option.
fetch: function(options) {
var relationName, related, relation;
var target = this.target;
var handled = this.handled = {};
var withRelated = this.prepWithRelated(options.withRelated);
var subRelated = {};
Internal flag to determine whether to set the ctor(s) on the Relation
object.
target._isEager = true;
Eager load each of the withRelated
relation item, splitting on '.'
which indicates a nested eager load.
for (var key in withRelated) {
related = key.split('.');
relationName = related[0];
Add additional eager items to an array, to load at the next level in the query.
if (related.length > 1) {
var relatedObj = {};
subRelated[relationName] || (subRelated[relationName] = []);
relatedObj[related.slice(1).join('.')] = withRelated[key];
subRelated[relationName].push(relatedObj);
}
Only allow one of a certain nested type per-level.
if (handled[relationName]) continue;
relation = target[relationName]();
if (!relation) throw new Error(relationName + ' is not defined on the model.');
handled[relationName] = relation;
}
Delete the internal flag from the model.
delete target._isEager;
Fetch all eager loaded models, loading them onto an array of pending deferred objects, which will handle all necessary pairing with parent objects, etc.
var pendingDeferred = [];
for (relationName in handled) {
pendingDeferred.push(this.eagerFetch(relationName, handled[relationName], _.extend({}, options, {
isEager: true,
withRelated: subRelated[relationName],
beforeFn: withRelated[relationName] || noop
})));
}
Return a deferred handler for all of the nested object sync returning the original response when these syncs & pairings are complete.
var eagerHandler = this;
return when.all(pendingDeferred).then(function() {
return eagerHandler.parentResponse;
});
},
Prep the withRelated
object, to normalize into an object where each
has a function that is called when running the query.
prepWithRelated: function(withRelated) {
if (!_.isArray(withRelated)) withRelated = [withRelated];
return _.reduce(withRelated, function(memo, item) {
_.isString(item) ? memo[item] = noop : _.extend(memo, item);
return memo;
}, {});
},
Handles an eager loaded fetch, passing the name of the item we're fetching for, and any options needed for the current fetch.
eagerFetch: function(relationName, handled, options) {
var relatedData = handled.relatedData;
if (relatedData.type === 'morphTo') return this.morphToFetch(relationName, relatedData, options);
Call the function, if one exists, to constrain the eager loaded query.
options.beforeFn.call(handled, handled.query());
var relation = this;
return handled
.sync(_.extend({}, options, {parentResponse: this.parentResponse}))
.select()
.then(function(resp) {
var relatedModels = relation.pushModels(relationName, handled, resp);
If there is a response, fetch additional nested eager relations, if any.
if (resp.length > 0 && options.withRelated) {
return new EagerRelation(relatedModels, resp, relatedData.createModel())
.fetch(options)
.then(function() { return resp; });
}
return resp;
});
},
Special handler for the eager loaded morph-to relations, this handles the fact that there are several potential models that we need to be fetching against. pairing them up onto a single response for the eager loading.
morphToFetch: function(relationName, relatedData, options) {
var pending = [];
var groups = _.groupBy(this.parent, function(m) {
return m.get(relationName + '_type');
});
for (var group in groups) {
var Target = morphCandidate(relatedData.candidates, group);
var target = new Target();
pending.push(target
.query('whereIn',
_.result(target, 'idAttribute'), _.uniq(_.invoke(groups[group], 'get', relationName + '_id'))
)
.sync(options)
.select()
.then(this.morphToHandler(relationName, relatedData, Target)));
}
return when.all(pending).then(function(resps) {
return _.flatten(resps);
});
},
Handler for the individual morphTo
fetches,
attaching any of the related models onto the parent objects,
stopping at this level of the eager relation loading.
morphToHandler: function(relationName, settings, Target) {
var eager = this;
return function(resp) {
eager.pushModels(relationName, {relatedData: new Relation('morphTo', Target, {morphName: relationName})}, resp);
};
},
Pushes each of the incoming models onto a new related
array,
which is used to correcly pair additional nested relations.
pushModels: function(relationName, handled, resp) {
var models = this.parent;
var relatedData = handled.relatedData;
var related = [];
for (var i = 0, l = resp.length; i < l; i++) {
related.push(relatedData.createModel(resp[i]));
}
If this is a morphTo, we only want to pair on the morphValue for the current relation.
if (relatedData.type === 'morphTo') {
models = _.filter(models, function(model) { return model.get(relatedData.key('morphKey')) === relatedData.key('morphValue'); });
}
return relatedData.eagerPair(relationName, related, models);
}
};
Set up inheritance for the model and collection.
Model.extend = Collection.extend = EagerRelation.extend = Bookshelf.Backbone.Model.extend;
The forge
function properly instantiates a new Model or Collection
without needing the new
operator... to make object creation cleaner
and more chainable.
Model.forge = Collection.forge = function() {
var inst = Object.create(this.prototype);
var obj = this.apply(inst, arguments);
return (Object(obj) === obj ? obj : inst);
};
Sync is the dispatcher for any database queries,
taking the "syncing" model
or collection
being queried, along with
a hash of options that are used in the various query methods.
If the transacting
option is set, the query is assumed to be
part of a transaction, and this information is passed along to Knex
.
var Sync = Bookshelf.Sync = function(syncing, options) {
options || (options = {});
this.query = syncing.query();
this.syncing = syncing.resetQuery();
this.options = options;
if (options.transacting) this.query.transacting(options.transacting);
};
_.extend(Sync.prototype, {
Select the first item from the database - only used by models.
first: function() {
var syncing = this.syncing;
this.query.where(syncing.format(_.extend(Object.create(null), syncing.attributes))).limit(1);
return this.select();
},
Runs a select
query on the database, adding any necessary relational
constraints, resetting the query when complete. If there are results and
eager loaded relations, those are fetched and returned on the model before
the promise is resolved. Any success
handler passed in the
options will be called - used by both models & collections.
select: function() {
var columns, sync = this, syncing = this.syncing,
options = this.options, relatedData = syncing.relatedData;
Inject all appropriate select costraints dealing with the relation
into the knex
query builder for the current instance.
if (relatedData) {
relatedData.selectConstraints(this.query, options);
} else {
columns = options.columns;
if (!_.isArray(columns)) columns = columns ? [columns] : ['*'];
}
Create the deferred object, triggering a fetching
event if the model
isn't an eager load.
return when(function(){
if (!options.isEager) return syncing.triggerThen('fetching', syncing, columns, options);
}()).then(function() {
return sync.query.select(columns);
});
},
Issues an insert
command on the query - only used by models.
insert: function() {
var syncing = this.syncing;
return this.query
.insert(syncing.format(_.extend(Object.create(null), syncing.attributes)), syncing.idAttribute);
},
Issues an update
command on the query - only used by models.
update: function(attrs) {
var syncing = this.syncing, query = this.query;
if (syncing.id != null) query.where(syncing.idAttribute, syncing.id);
if (query.wheres.length === 0) {
return when.reject(new Error('A model cannot be updated without a "where" clause or an idAttribute.'));
}
return query.update(syncing.format(_.extend(Object.create(null), attrs)));
},
Issues a delete
command on the query.
del: function() {
var query = this.query, syncing = this.syncing;
if (syncing.id != null) query.where(syncing.idAttribute, syncing.id);
if (query.wheres.length === 0) {
return when.reject(new Error('A model cannot be destroyed without a "where" clause or an idAttribute.'));
}
return this.query.del();
}
});
Specific to many-to-many relationships, these methods are mixed
into the belongsToMany
relationships when they are created,
providing helpers for attaching and detaching related models.
Bookshelf.pivotHelpers = {
Attach one or more "ids" from a foreign table to the current. Creates & saves a new model and attaches the model with a join table entry.
attach: function(ids, options) {
return this._handler('insert', ids, options);
},
Detach related object from their pivot tables. If a model or id is passed, it attempts to remove the pivot table based on that foreign key. If a hash is passed, it attempts to remove the item based on a where clause with these parameters. If no parameters are specified, we assume we will detach all related associations.
detach: function(ids, options) {
return this._handler('delete', ids, options);
},
Selects any additional columns on the pivot table, taking a hash of columns which specifies the pivot column name, and the value the column should take on the output to the model attributes.
withPivot: function(columns) {
this.relatedData.withPivot(columns);
return this;
},
Helper for handling either the attach
or detach
call on
the belongsToMany
or hasOne
/ hasMany
:through relationship.
_handler: function(method, ids, options) {
var pending = [];
if (ids == void 0) {
if (method === 'insert') return when.resolve(this);
if (method === 'delete') pending.push(this._processPivot(method, null, options));
}
if (!_.isArray(ids)) ids = ids ? [ids] : [];
for (var i = 0, l = ids.length; i < l; i++) {
pending.push(this._processPivot(method, ids[i], options));
}
var collection = this;
return when.all(pending).then(function() {
return collection;
});
},
Handles setting the appropriate constraints and shelling out
to either the insert
or delete
call for the current model,
returning a promise.
_processPivot: function(method, item, options) {
var data = {};
var relatedData = this.relatedData;
data[relatedData.key('foreignKey')] = relatedData.parentFk;
If the item is an object, it's either a model that we're looking to attach to this model, or a hash of attributes to set in the relation.
if (_.isObject(item)) {
if (item instanceof Model) {
data[relatedData.key('otherKey')] = item.id;
} else {
_.extend(data, item);
}
} else if (item) {
data[relatedData.key('otherKey')] = item;
}
var builder = this.builder(relatedData.joinTable());
if (options && options.transacting) {
builder.transacting(options.transacting);
}
if (method === 'delete') return builder.where(data).del();
return builder.insert(data);
}
};
Used internally, the Relation
helps in simplifying the relationship building,
centralizing all logic dealing with type & option handling.
var Relation = Bookshelf.Relation = function(type, Target, options) {
this.type = type;
if (this.target = Target) {
this.targetTableName = _.result(Target.prototype, 'tableName');
this.targetIdAttribute = _.result(Target.prototype, 'idAttribute');
}
_.extend(this, options);
};
Relation.prototype = {
Assembles the new model or collection we're creating an instance of, gathering any relevant primitives from the parent object, without keeping any hard references.
init: function(parent) {
this.parentId = parent.id;
this.parentTableName = _.result(parent, 'tableName');
this.parentIdAttribute = _.result(parent, 'idAttribute');
If the parent object is eager loading, we don't need the
id attribute, because we'll just be creating a whereIn
from the
previous response anyway.
if (!parent._isEager) {
if (this.isInverse()) {
if (this.type === 'morphTo') {
this.target = morphCandidate(this.candidates, parent.get(this.key('morphKey')));
}
this.parentFk = parent.get(this.key('foreignKey'));
} else {
this.parentFk = parent.id;
}
}
var target = this.target ? this.relatedInstance() : {};
target.relatedData = this;
if (this.type === 'belongsToMany') {
_.extend(target, Bookshelf.pivotHelpers);
}
return target;
},
Initializes a through
relation, setting the Target
model and options
,
which includes any additional keys for the relation.
through: function(source, Target, options) {
var type = this.type;
if (type !== 'hasOne' && type !== 'hasMany' && type !== 'belongsToMany' && type !== 'belongsTo') {
throw new Error('`through` is only chainable from `hasOne`, `belongsTo`, `hasMany`, or `belongsToMany`');
}
this.throughTarget = Target;
this.throughTableName = _.result(Target.prototype, 'tableName');
this.throughIdAttribute = _.result(Target.prototype, 'idAttribute');
Set the parentFk as appropriate now.
if (this.type === 'belongsTo') {
this.parentFk = this.parentId;
}
_.extend(this, options);
_.extend(source, Bookshelf.pivotHelpers);
Set the appropriate foreign key if we're doing a belongsToMany, for convenience.
if (this.type === 'belongsToMany') {
this.foreignKey = this.throughForeignKey;
}
return source;
},
Generates and returns a specified key, for convenience... one of
foreignKey
, otherKey
, throughForeignKey
.
key: function(keyName) {
if (this[keyName]) return this[keyName];
if (keyName === 'otherKey') {
return this[keyName] = singularMemo(this.targetTableName) + '_' + this.targetIdAttribute;
}
if (keyName === 'throughForeignKey') {
return this[keyName] = singularMemo(this.joinTable()) + '_' + this.throughIdAttribute;
}
if (keyName === 'foreignKey') {
if (this.type === 'morphTo') return this[keyName] = this.morphName + '_id';
if (this.type === 'belongsTo') return this[keyName] = singularMemo(this.targetTableName) + '_' + this.targetIdAttribute;
if (this.isMorph()) return this[keyName] = this.morphName + '_id';
return this[keyName] = singularMemo(this.parentTableName) + '_' + this.parentIdAttribute;
}
if (keyName === 'morphKey') return this[keyName] = this.morphName + '_type';
if (keyName === 'morphValue') return this[keyName] = this.parentTableName || this.targetTableName;
},
Injects the necessary select
constraints into a knex
query builder.
selectConstraints: function(knex, options) {
var resp = options.parentResponse;
The base select column
if (knex.columns.length === 0 && (!options.columns || options.columns.length === 0)) {
knex.columns.push(this.isJoined() ? this.targetTableName + '.*' : '*');
} else if (_.isArray(options.columns) && options.columns.length > 0) {
push.apply(knex.columns, options.columns);
}
The belongsToMany
and through
relations have joins & pivot columns.
if (this.isJoined()) {
this.joinClauses(knex);
this.joinColumns(knex);
}
If this is a single relation and we're not eager loading, limit the query to a single item.
if (this.isSingle()) {
if (!resp) knex.limit(1);
}
Finally, add (and validate) the where conditions, necessary for constraining the relation.
this.whereClauses(knex, resp);
},
Inject & validates necessary through
constraints for the current model.
joinColumns: function(knex) {
var columns = [];
var joinTable = this.joinTable();
if (this.isThrough()) columns.push(this.throughIdAttribute);
columns.push(this.key('foreignKey'));
if (this.type === 'belongsToMany') columns.push(this.key('otherKey'));
push.apply(columns, this.pivotColumns);
push.apply(knex.columns, _.map(columns, function(col) {
return joinTable + '.' + col + ' as _pivot_' + col;
}));
},
Generates the join clauses necessary for the current relation.
joinClauses: function(knex) {
var joinTable = this.joinTable();
if (this.type === 'belongsTo' || this.type === 'belongsToMany') {
var targetKey = (this.type === 'belongsTo' ? this.key('foreignKey') : this.key('otherKey'));
knex.join(
joinTable,
joinTable + '.' + targetKey, '=',
this.targetTableName + '.' + this.targetIdAttribute
);
A belongsTo
-> through
is currently the only relation with two joins.
if (this.type === 'belongsTo') {
knex.join(
this.parentTableName,
joinTable + '.' + this.throughIdAttribute, '=',
this.parentTableName + '.' + this.key('throughForeignKey')
);
}
} else {
knex.join(
joinTable,
joinTable + '.' + this.throughIdAttribute, '=',
this.targetTableName + '.' + this.key('throughForeignKey')
);
}
},
Check that there isn't an incorrect foreign key set, vs. the one passed in when the relation was formed.
whereClauses: function(knex, resp) {
var key;
if (this.isJoined()) {
var targetTable = this.type === 'belongsTo' ? this.parentTableName : this.joinTable();
key = targetTable + '.' + (this.type === 'belongsTo' ? this.parentIdAttribute : this.key('foreignKey'));
} else {
key = this.isInverse() ? this.parentIdAttribute : this.key('foreignKey');
}
knex[resp ? 'whereIn' : 'where'](key, resp ? this.eagerKeys(resp) : this.parentFk);
if (this.isMorph()) {
knex.where(this.key('morphKey'), this.key('morphValue'));
}
},
Fetches all eagerKeys
from the current relation.
eagerKeys: function(resp) {
return _.uniq(_.pluck(resp, this.isInverse() ? this.key('foreignKey') : this.parentIdAttribute));
},
Generates the appropriate standard join table.
joinTable: function() {
if (this.isThrough()) return this.throughTableName;
return this.joinTableName || [
this.parentTableName,
this.targetTableName
].sort().join('_');
},
Sets the constraints necessary during a model.save
call.
saveConstraints: function(model) {
var data = {};
var type = this.type;
if (type && type !== 'belongsToMany') {
data[this.key('foreignKey')] = this.parentFk;
if (this.isMorph()) data[this.key('morphKey')] = this.key('morphValue');
}
return model.set(data);
},
Creates a new model or collection instance, depending on
the relatedData
settings and the models passed in.
relatedInstance: function(models) {
models || (models = []);
var Target = this.target;
if (this.isSingle()) {
if (!Target.prototype instanceof Model) {
throw new Error('The `'+this.type+'` related object must be a Bookshelf.Model');
}
return models[0] || new Target();
}
Allows us to just use a model, but create a temporary collection for a many relation.
if (Target.prototype instanceof Model) {
Target = Bookshelf.Collection.extend({
model: Target,
builder: Target.prototype.builder
});
}
return new Target(models, {parse: true});
},
Creates a new model, used internally in the eager fetch helper methods.
createModel: function(data) {
if (this.target.prototype instanceof Collection) {
return new this.target.prototype.model(data, {parse: true})._reset();
}
return new this.target(data, {parse: true})._reset();
},
Groups the related response according to the type of relationship we're handling, for easy attachment to the parent models.
eagerPair: function(relationName, related, models) {
If this is a through
or belongsToMany
relation, we need to cleanup & setup the interim
model.
if (this.isJoined()) related = this.parsePivot(related);
var grouped = _.groupBy(related, function(model) {
return this.isSingle() ? model.id : (model.pivot ?
model.pivot.get(this.key('foreignKey')) : model.get(this.key('foreignKey')));
}, this);
for (var i = 0, l = models.length; i < l; i++) {
var model = models[i];
var groupedKey = this.isInverse() ? model.get(this.key('foreignKey')) : model.id;
model.relations[relationName] = this.relatedInstance(grouped[groupedKey]);
}
return related;
},
The models
is an array of models returned from the fetch,
after they're set
... parsing out any of the _pivot_
items from the
join table and assigning them on the pivot model or object as appropriate.
parsePivot: function(models) {
var Through = this.throughTarget;
return _.map(models, function(model) {
var data = {}, attrs = model.attributes, through;
if (Through) through = new Through();
for (var key in attrs) {
if (key.indexOf('_pivot_') === 0) {
data[key.slice(7)] = attrs[key];
delete attrs[key];
}
}
if (!_.isEmpty(data)) {
model.pivot = through ? through.set(data, {silent: true}) : new Model(data, {
tableName: this.joinTable()
});
}
return model;
}, this);
},
A few predicates to help clarify some of the logic above.
isThrough: function() {
return (this.throughTarget != null);
},
isJoined: function() {
return (this.type === 'belongsToMany' || this.isThrough());
},
isMorph: function() {
return (this.type === 'morphOne' || this.type === 'morphMany');
},
isSingle: function() {
var type = this.type;
return (type === 'hasOne' || type === 'belongsTo' || type === 'morphOne' || type === 'morphTo');
},
isInverse: function() {
return (this.type === 'belongsTo' || this.type === 'morphTo');
},
Sets the pivotColumns
to be retrieved along with the current model.
withPivot: function(columns) {
if (!_.isArray(columns)) columns = [columns];
this.pivotColumns || (this.pivotColumns = []);
push.apply(this.pivotColumns, columns);
}
};
var noop = function() {};
If there are no arguments, return the current object's query builder (or create and return a new one). If there are arguments, call the query builder with the first argument, applying the rest. If the first argument is an object, assume the keys are query builder methods, and the values are the arguments for the query.
var query = function(obj, args) {
obj._knex || (obj._knex = obj.builder(_.result(obj, 'tableName')));
if (args.length === 0) return obj._knex;
var method = args[0];
if (_.isFunction(method)) {
method.call(obj._knex, obj._knex);
} else if (_.isObject(method)) {
for (var key in method) {
var target = _.isArray(method[key]) ? method[key] : [method[key]];
obj._knex[key].apply(obj._knex, target);
}
} else {
obj._knex[method].apply(obj._knex, args.slice(1));
}
return obj;
};
Simple memoization of the singularize call.
var singularMemo = (function() {
var cache = Object.create(null);
return function(arg) {
if (arg in cache) {
return cache[arg];
} else {
return cache[arg] = inflection.singularize(arg);
}
};
}());
Finds the specific morphTo
table we should be working with, or throws
an error if none is matched.
var morphCandidate = function(candidates, foreignTable) {
var Target = _.find(candidates, function(Candidate) {
return (_.result(Candidate.prototype, 'tableName') === foreignTable);
});
if (!Target) {
throw new Error('The target polymorphic model was not found');
}
return Target;
};
References to the default Knex
and Knex.Transaction
, overwritten
when a new database connection is created in Initialize
below.
Bookshelf.Knex = knex;
Bookshelf.Transaction = knex.Transaction;
Configure the Bookshelf
settings (database adapter, etc.) once,
so it is ready on first model initialization.
Bookshelf.Initialize = function(name, options) {
var Target;
if (_.isObject(name)) {
options = name;
name = 'main';
}
if (Bookshelf.Instances[name]) {
throw new Error('A ' + name + ' instance of Bookshelf already exists');
}
If an object with this name already exists in Knex.Instances
, we will
use that copy of Knex
without trying to re-initialize.
var Builder = (knex[name] || knex.Initialize(name, options));
if (name === 'main') {
Target = Bookshelf.Instances['main'] = Bookshelf;
} else {
Target = Bookshelf.Instances[name] = {};
Create a new Bookshelf
instance for this database connection.
_.extend(Target, _.omit(Bookshelf, 'Instances', 'Initialize', 'Knex', 'Transaction', 'VERSION'), {
Knex: Builder,
Transaction: Builder.Transaction
});
Attach a new builder function that references the correct connection.
_.each(['Model', 'Collection', 'EagerRelation'], function(item) {
Target[item] = Bookshelf[item].extend({
builder: function(table) {
return Builder(table);
}
});
});
}
Set the instanceName, so we know what Bookshelf we're using.
Target.instanceName = name;
Return the initialized instance.
return Target;
};
Named instances of Bookshelf, presumably with different Knex
options, to initialize different databases.
The main instance being named "main"...
Bookshelf.Instances = {};
The main Bookshelf instanceName
... incase we're using Bookshelf
after Knex
has been initialized, for consistency.
Bookshelf.instanceName = 'main';
});
})(
typeof define === 'function' && define.amd ? define : function (factory) { factory(require, exports); }
);


AggOO - The GDI+ like front-end for Anti-Grain Geometry
AggOO is an Object-Oriented library written in platform independent C++. Its purpose is to provide a higher-level front-end for
Anti-Grain Geometry which resembles Microsoft GDI+.
Before building
AggOO, Anti-Grain Geometry must be built as a release and debug static library. For more details, refer to the
wiki at
http://www.dratek.com.
Download the latest version of AggOO from http://www.sourceforge.net/projects/aggoo. To build and install the library, make sure the 'include' and 'lib' directories have been added to your compiler and linker paths. Open the appropriate solution or workspace file for your environment, and build everything. This should generate release and debug versions of the static library.
Using
AggOO is very similar to using GDI+. There is a 'tests' directory with some examples you may refer to for help getting started (hopefully, there will be actual tutorials someday...)
-
When using on Windows platforms,
windows.h
should be included before including any AggOO files. If being used along with GDI+, be sure to include AggOO prior to including the GDI+ header.


MuxBroadcastViewController
public class MuxBroadcastViewController : UIViewController
MuxBroadcastViewController, provides a simple user interface and permissions handling for MuxLive streaming
-
Undocumented
Declaration
Swift
public weak var muxBroadcasterDelegate: MuxBroadcasterDelegate?
-
Undocumented
Declaration
Swift
public var liveState: MuxLiveState { get }
-
Undocumented
Declaration
Swift
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?)
-
Undocumented
Declaration
Swift
public required init?(coder aDecoder: NSCoder)
-
Undocumented
Declaration
Swift
public override func viewDidLoad()
-
Undocumented
Declaration
Swift
public override func viewWillAppear(_ animated: Bool)
-
Undocumented
Declaration
Swift
public override func viewWillDisappear(_ animated: Bool)
-
Undocumented
Declaration
Swift
public override var preferredStatusBarStyle: UIStatusBarStyle { get }
-
Undocumented
Declaration
Swift
public func muxLive(_ muxLive: MuxLive, didChangeState state: MuxLiveState)
-
Undocumented
Declaration
Swift
public func muxLive(_ muxLive: MuxLive, didFailWithError error: Error)
-
Start a MuxLive stream
Declaration
Swift
public func start(withStreamKey streamKey: String)
Parameters
streamKey
stream_key from api.mux.com
-
Stop a MuxLive stream
Declaration
Swift
public func stop()
-
Launch app settings
Declaration
Swift
open func launchAppSettings(withTitle title: String = NSLocalizedString("⚙ settings", comment: "⚙ settings"), message: String = NSLocalizedString("would you like to open settings?", comment: "would you like to open settings?"))
Parameters
title
Message title string
message
Alert message
-
Check and request camera permission
Declaration
Swift
open func checkAndRequestCameraPermission()
-
Check and request mic permission
Declaration
Swift
open func checkAndRequestMicrophonePermission()


DATE NIGHT
GOING OUT
STAYING IN
How Date Night Works
You pick a movie and we'll suggest top-rated eateries in the area. We locate eateries by zip code, so you can find good food and a movie across town or across the country.
- Know Your Movie Title: Enter title and your zip code.
- Don't Have A Title: Locate a movie then enter title and zip.
Let's get started!
Find infomation on 1000's of titles.
Our picks for top rated eateries in the area


Listen to George Michael’s first posthumous single ‘This Is How (We Want You To Get High)’
'This Is How' is out now.
The estate of the late George Michael has released ‘This Is How (We Want You To Get High)’, the first posthumous track to arrived from the late music icon.
The track will feature on the soundtrack of Last Christmas – the upcoming movie inspired by his legendary back catalogue.
It received its first play on BBC Radio 2’s The Zoe Ball Breakfast Show on Wednesday, November 6.
“The previously unreleased track, which was recorded during George’s final studio sessions, is his first original material to be shared for seven years,” a press release said.
“The lyrics, written exclusively by George, see the star addressing society’s ills with his trademark blend of self-deprecation and wry humor.”
It is also accompanied by a lyric video which features animations of Michael performing.
An upbeat effort, Michael sings on the track: “Your daddy was a drinker”, “My daddy was a toker”
The soundtrack for the festive movie will feature three Wham! songs, including ‘Last Christmas’ and ‘Everything She Wants’, alongside 12 of Michael’s solo songs.
The festive rom-com is directed by Bridesmaids‘ Paul Feig and stars Emilia Clarke as a fed-up seasonal worker who keeps bumping into Henry Golding’s character around London in serendipitous circumstances.
It also stars Emma Thompson, who has penned the film, as Clarke’s mother.
Speaking recently, Thompson explained how Michael gave her his personal blessing to create the upcoming film.
“He was just the loveliest guy you could imagine,” she recalled of their meeting. “[He loved] all of these themes in the movie; he was passionate about homelessness, and he had this great social conscience.”
Thompson continued: “I got really enthused and we started to write, and then – of course – he had that tragic early death in 2016, on Christmas Day. So we lost him, and I miss him so much.”


We specialize on interactive Design services, to provide creative value to the relationship between Project & Client.
We specialize in Mobile Interface Design & websites, HTML5 + CSS3 Layouts, Corporate & Branding Campaigns, E-Commerce, Multimedia Marketing, Web Design 3.0, interactive presentations, Advisory, IT Consulting ...
In our portfolio we will show that we mean when we say Creative Solutions! we just love what we do!! here some work done for different clients and projects.
Do not hesitate to contact us to answer your inquiries about our services.
Together we will find the way to bring your project to fruition.-
Our Social Profiles
Our Phone Number
Tel: 54 9<PHONE_NUMBER>(Click to call)


Preparation time
less than 30 mins
Cooking time
1 to 2 hours
Serves
Serves 4
Celebrate Burns Night with The Hairy Bikers' recipe of haggis, neeps, tatties and whisky sauce.
Preheat the oven to 180C/350F/Gas 4.
Wrap the haggis tightly in aluminium foil and place onto a baking tray. Bake in the oven for 45 minutes to one hour, or until cooked through.
Meanwhile, for the clapshot, boil the potatoes and swede in separate saucepans of salted water for 15-18 minutes, or until tender. Drain well. Add the drained swede to the drained potatoes and mash thoroughly. Add the butter and cream and mash again until smooth and well combined. Season, to taste, with salt and freshly ground white pepper. Stir in the tablespoon of chives. Set aside and keep warm.
For the whisky sauce, heat the double cream in a pan over a medium heat. Add the wholegrain mustard, Dijon mustard and whisky and stir to combine. Increase the heat until the mixture is simmering and continue to cook for 1-2 minutes.
Remove the pan from the heat and season, to taste, with salt and freshly ground white pepper. Stir in the tablespoon of chives, then whisk in the lemon juice.
To serve, divide the clapshot equally among four serving plates. Place a spoonful of steamed haggis alongside each. Spoon over the warm whisky sauce.


APS1050 Pet Shop
Home
Adopt
Supply
Donate
Admin
Welcome to the admin page!
Add an offline donation to the system:
Item Name
Description
Donor
Donate Date
Add Donation
Clear Textfield
Recently added supplies:
Food
Description
:
Dry Food
Donated by
:
Rachel
Donated on
:
Mar 31, 2020
Address
:
000000


Copyright 2011, 2013-2019 Timothy Guan-tin Chien and other contributors. Released under the MIT license.
Source code available on Github. Contribution welcome.
Read the README to know more about the technologies and services employed. Contact the author or leave an issue on Github for questions and inquiries.
The actual content of the feed, file, or copy-pasted text is not transmitted to our server in any form. Everything is processed on your computer directly, employed technologies in the browser known collectively as HTML5.
In order to improve user experience based on the usage, this website collects common metrics, and record usage of other non-identifiable operations (e.g. Sharing image). Additionally, the identifier of the source selected to generated the image will be collected.
These information will not be shared with people other than the author and contributors.
When you explicitly selected a feature that involve external service(s), your data might be collected by the external party, or parties. These feature will by marked with name of the external providers. You should check and read the privacy policy of these external providers.


The President, the Head of the Union and the Council, has the power to speak on behalf of the Union with any authority without prior consultation with other members of the Council. He is also the signing authority of all the financial matters and statements of the Union as he is elected by the Students themselves.


FEEDS.PUB
An RSS aggregator and network
CHART.XKCD
XKCD styled chart lib
WEWE
Open wechat, slack... group chats to the world, Bring valuable discusions to the open internet.
OPEN SOURCE JOBS
A list of Open Source projects offering jobs.
TOMATO PIE
A new UI for Pomodoro Technique. Schedule your time directly with a clock.
CLOUD QUERY
Turn any website to API by serveral clicks
STAR HISTORY
The missing star history graph of github repos


pyxswf
======
pyxswf is a script to detect, extract and analyze Flash objects (SWF files) that may
be embedded in files such as MS Office documents (e.g. Word, Excel),
which is especially useful for malware analysis.
It is part of the python-oletools package.
pyxswf is an extension to xxxswf.py published by Alexander Hanel.
Compared to xxxswf, it can extract streams from MS Office documents by parsing
their OLE structure properly, which is necessary when streams are fragmented.
Stream fragmentation is a known obfuscation technique, as explained on
http://www.breakingpointsystems.com/resources/blog/evasion-with-ole2-fragmentation/
It can also extract Flash objects from RTF documents, by parsing embedded objects encoded in hexadecimal format (-f option).
For this, simply add the -o option to work on OLE streams rather than raw files, or the -f option to work on RTF files.
Usage: pyxswf.py [options] <file.bad>
Options:
-o, --ole Parse an OLE file (e.g. Word, Excel) to look for SWF
in each stream
-f, --rtf Parse an RTF file to look for SWF in each embedded
object
-x, --extract Extracts the embedded SWF(s), names it MD5HASH.swf &
saves it in the working dir. No addition args needed
-h, --help show this help message and exit
-y, --yara Scans the SWF(s) with yara. If the SWF(s) is
compressed it will be deflated. No addition args
needed
-s, --md5scan Scans the SWF(s) for MD5 signatures. Please see func
checkMD5 to define hashes. No addition args needed
-H, --header Displays the SWFs file header. No addition args needed
-d, --decompress Deflates compressed SWFS(s)
-r PATH, --recdir=PATH
Will recursively scan a directory for files that
contain SWFs. Must provide path in quotes
-c, --compress Compresses the SWF using Zlib
C:\oletools>pyxswf.py -o word_flash.doc
OLE stream: 'Contents'
[SUMMARY] 1 SWF(s) in MD5:993664cc86f60d52d671b6610813cfd1:Contents
[ADDR] SWF 1 at 0x8 - FWS Header
C:\oletools>pyxswf.py -xo word_flash.doc
OLE stream: 'Contents'
[SUMMARY] 1 SWF(s) in MD5:993664cc86f60d52d671b6610813cfd1:Contents
[ADDR] SWF 1 at 0x8 - FWS Header
[FILE] Carved SWF MD5: 2498e9c0701dc0e461ab4358f9102bc5.swf
C:\oletools>pyxswf.py -xf "rtf_flash.rtf"
RTF embedded object size 1498557 at index 000036DD
[SUMMARY] 1 SWF(s) in MD5:46a110548007e04f4043785ac4184558:RTF_embedded_object_0
00036DD
[ADDR] SWF 1 at 0xc40 - FWS Header
[FILE] Carved SWF MD5: 2498e9c0701dc0e461ab4358f9102bc5.swf
TODO
python-oletools documentation


Scott's Burrito Shack
Tortilla Type?:
What Kind of Meat?:
Rice Type?:
Bean Type?:
Cow Extract?:
Burrito: $10.00
Total: $10.00


--- imgsrc: "jewish_art_will_deutsch_sarah_sarai_judaism_jews.jpg" buylink: "http://store.notesfromthetribe.com/product/jewish-art-8-5-x11-sarah-laughed-print" postDate: "04.04.11" layout: post ---
Sarah, once sterile, was so elated to hear that she was going to have a child that her laughter has become legendary.
Indeed, at the age of 90 she became the world’s first Jewish Mother.
This is only speculation, but I can’t help thinking she maybe partly responsible for all the wonderful, worried, overly involved archetypal women doting over their sons today.
I mean come on, she banished Ishmael and his Mom into the cold wilderness when she heard Isaac was being made fun of.
Not to mention that her death is thought to be the result of hearing that her son had been sacrificed by Abraham.
It’s just as well, if she’d seen the mishagas that went on with her grandchildren she’d have probably died from a heart attack anyway.
If it is true, if she had anything to do with the woman who raised me, I’d like to use this weeks post to say:
Thanks, Sarah.


- Sashimi
-
Sliced raw fish that is served with condiments such as shredded daikon
radish or ginger root, wasabi and soy sauce
- Scale
-
A device used to accurately measure the weigth of ingredients
-
A technique by which the scales are removed from the skin of a fish
- Scamorze
- Scamorzo
-
An Italian cheese usually made from whole cow's milk (although it was
traditionally made from buffalo milk)


June ‘16 - Oct ‘16
Student of the Kokako 2016 cohort at Enspiral Dev Academy, Wellington. EDA is NZ’s premier full-immersion 18-week web development programme. Students code from day zero and by the end of the course, have the equivalent skillset and experience as an entry level web developer.
May ‘15 - Mar ‘16
CEO of one of ten teams involved in Lightning Lab, Christchurch 2015; New Zealand’s premiere business accelerator programme. Over the course of the 12-weeks programme, we successfully launched and operated the company MightyGem.com, but were unable to secure enough capital investment on Demo Day.
Aug ‘15 - May ‘16
Before arriving in Wellington I accepted the position of General Manager at Bethel Woods on The Terrace, a new business venture of Wellington's most established hospitality group. Six months later, following a successful launch and a thriving festive season, I was then asked to be General Manager for their next business venture, Coene's Provisions.
"Jonathan 'Jock' is a highly engaging, energetic and passionate hospitality professional. He has a keen eye for detail, never rests until he has achieved his goals and is ultimately driven to deliver great customer experiences."
Commercial Marketing Manager at Wellington Hospitality Group
May ‘12 - May ‘14
At Brew, Rotorua I initiated systems and created structure in a business which previously had neither. Under my direction the business experienced weekly revenue growth of over 200%, climbed from #30 to #5 on TripAdvisor and took out the ‘Outstanding Bar’ award at the Rotorua Hospitality Awards, 2013.
In August 2013 I invested in a joint venture with Croucher Brewing, and together we launched Brew | Craft Beer Pub, Tauranga. After successfully getting the bar up and running, I passed on the reins to a newly appointed General Manager and moved to Wellington in search of greater opportunities and a less provincial lifestyle.
"Jock is an exceptional Hospitality professional. He has a sixth sense for creating a superior customer experience; including creating the appropriate atmosphere, managing and inspiring his team, and setting the tone for personal customer service... all the while making it look ridiculously easy!"
Owner at The Croucher Brewing Co.
May '04 - May ‘12
Jargon
Jargon


At Barks 'N Rec, we love to get feedback from our users. Whether there is a change you think we should make or just a comment about your experience with the app, please reach out to us and let us know what you think! Our goal is to make your experience as nice as it can possibly be, so please contact us on any of the following platforms.


WITNESS LIST S/C on Higher Education Committee February 21, 2005 - 1:30P SB 81 ON: Paredes, Dr. Raymond Commissioner (Texas Higher Education Coordinating Board), Austin, TX SB 296 ON: Sayavedra, Leo Vice Chancellor, Academic and Student Affairs (Texas A&M University System), College Station, TX Registering, but not testifying: On: Garcia, Greg A. Asst. Vice Chancellor (The Texas A&M University System Center)


To visualize changes in female participation in each continent, we first used a simple line graph where we put all the continent together. The x-axis is time, and the y-axis is female participation. The legend shows the colors associated with the continents. See Figure 25.
The graph was very messy. As there were six continents and one global average, we could not distinguish between the seven categories very easily. So we gave up this option.
Then we tried a small multiple in which each continent and the global average were shown in simple line graphs. This chart showed every continent clearly but it was not very easy to make a comparison. See Figure 26.
To make comparisons clearer, we decided to use an area chart. We stacked each area chart each representing a continent along a vertical line. However, comparisons were still difficult. Most importantly, in terms of using color as the visual encoding, this graph has too many categories. Besides, it has red and green at the same time, and therefore is not accessible to colorblind populations. See Figure 27.
We then went back to the small multiple. Since we cared about the comparison between each continent, we decided to plot every continent and the global average in each of the six graphs. We highlighted only one continent in each graph, and set all other continents grey in the background. It worked much better than out earlier attempts, but one drawback is that it did not allow comparison with the global average. See Figure 28.
Finally, we decided to highlight the global average with a black line. This time, comparisons both between continents and with the global average were clear. See Figure 29.


Selected Period
Period Details
- Start:
- End:
- Duration:
- Complete:
| Attribute | Value |
|---|
Task Stats
| Task | Duration |
|---|
Timespans
| # | Start | End | Duration | Task | Actions |
|---|
Work Periods
| # | Start | End | Duration | Complete | Actions |
|---|
Tasks
| # | Name | Actions |
|---|


About
Timeline
Followers
Groups
Photos
Videos
sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. David !
10
i think that some how, we learn who we really are and then live with that decision, great post!
Jack Carter
2 hours agoi think that some how, we learn who we really are and then live with that decision, great post!
Ching xang
2 hours agoi think that some how, we learn who we really are and then live with that decision, great post!


TSX dips for third straight day while loonie drops to lowest level in six weeks
TORONTO — Canada's main stock index dipped for a third straight day as investors responded to reports that an interim trade deal may not be completed this year. The S&P/TSX composite index closed down 5.58 points at 17,005.82.
by Canadian PressTORONTO — Canada's main stock index dipped for a third straight day as investors responded to reports that an interim trade deal may not be completed this year.
The S&P/TSX composite index closed down 5.58 points at 17,005.82.
In New York, the Dow Jones industrial average lost 112.93 points at 27,821.09. The S&P 500 index was down 11.72 points at 3,108.46, while the Nasdaq composite was down 43.93 points at 8,526.73.
The Canadian dollar fell to its lowest level in about six weeks by trading at 75.17 cents US compared with an average of 75.55 cents US on Tuesday.
The January crude contract was up US$1.66 at US$57.01 per barrel and the January natural gas contract was up 3.5 cents at US$2.61 per mmBTU.
The December gold contract was down 10 cents at US$1,474.20 an ounce and the December copper contract was down 0.7 of a cent at US$2.65 a pound.
This report by The Canadian Press was first published Nov. 20, 2019.
Companies in this story: (TSX:GSPTSE, TSX:CADUSD=X)
The Canadian Press


Austria to Turn Hitler’s Birthplace Into Police Station to Prevent Neo-Nazi Pilgrimage Site
The 'the future use of the house by the police should send an unmistakable signal that this building will forever be removed from the commemoration of national socialism'
by The Associated PressAustrian authorities say the house where Adolf Hitler was born in 1889 will become a police precinct, ending years of uncertainty over the building that’s become a pilgrimage site for people who glorify the Nazi dictator.
Interior Minister Wolfgang Peschorn said late Tuesday that the “the future use of the house by the police should send an unmistakable signal that this building will forever be removed from the commemoration of national socialism.”
Nazi Germany annexed Austria in 1938, shortly before launching a campaign of military conquest and racist extermination across Europe that cost tens of millions of lives.
The house in Braunau am Inn, near the German border, will be redesigned following an international architectural competition.
It was expropriated from the previous owner in 2017.


Enter a GitHub username.
Click to repo in the graph.
Select visualization type, change settings and press the "Run" button.
value 0 — immortal
%n - name; %e - email; %l - login
There are three main steps.
Each step is logical stage contains of some setting.
You can show/hide a layer or sub-layers from each stage.
The new stage is opened after the previous stage is complete.
UsesD3.js andGithub API.
All rights to media contents formGitHub (fonts, some css selectors) belong to Github.
When you have got the message about exceeding the limit,
you should set following parameters.
These parameters also will be use to OAuth2.
In order to get these parameters
you must create an application on Github or to use existing.
You can do it here.


| Interface | Description |
|---|---|
| AnalyticItemEventListener |
Helper interface for receiving AnalyticItemEvent messages from the EventBus
|
| BackgroundEventListener |
Helper interface for receiving BackgroundEvent messages from the EventBus
|
| BeaconRegionEnterEventListener |
Helper interface for receiving BeaconRegionEnterEvent messages from the EventBus
|
| BeaconRegionExitEventListener |
Helper interface for receiving BeaconRegionExitEvent messages from the EventBus
|
| BeaconRegionRangeEventListener |
Helper interface for receiving BeaconRegionRangeEvent messages from the EventBus
|
| BeaconResponseEventListener |
Helper interface for receiving BeaconResponseEvent messages from the EventBus
|
| CloudPagesChangedEventListener |
Helper interface for receiving CloudPagesChangedEvent messages from the EventBus
|
| GeofenceResponseEventListener |
Helper interface for receiving GeofenceResponseEvent messages from the EventBus
|
| LastKnownLocationEventListener |
Helper interface for receiving LastKnownLocationEvent messages from the EventBus
|
| LocationUpdateEventListener |
Helper interface for receiving LocationUpdateEvent messages from the EventBus
|
| PowerStatusChangedEventListener |
Helper interface for receiving PowerStatusChangedEvent messages from the EventBus
|
| PushReceivedEventListener |
Helper interface for receiving PushReceivedEvent messages from the EventBus
|
| RegistrationEventListener |
Helper interface for receiving RegistrationEvent messages from the EventBus
|
| ServerErrorEventListener |
Helper interface for receiving ServerErrorEvent messages from the EventBus
|
| Class | Description |
|---|---|
| AnalyticItemEvent | |
| AnalyticPiItemEvent | |
| BackgroundEvent |
This event is posted to the EventBus when the application goes into the background for 2 seconds, or when the application has come back into the foreground.
|
| BeaconRegionEnterEvent |
This event is posted to the EventBus when the device enters a beacon region.
|
| BeaconRegionExitEvent |
This event is posted to the EventBus when the device exits a beacon region.
|
| BeaconRegionRangeEvent |
This event is posted to the EventBus when the device ranges a beacon.
|
| BeaconResponseEvent |
This event is posted via the
EventBus . |
| CloudPagesChangedEvent |
This event is posted to the EventBus when the application has received new CloudPage messages from the server.
|
| GeofenceResponseEvent |
This event is posted via the
EventBus . |
| LastKnownLocationEvent |
EventBus low-level sticky notification event that occurs whenever we receive a new location from Android. |
| LocationUpdateEvent |
This event is posted via the
EventBus . |
| PowerStatusChangedEvent |
This event is posted via the
EventBus . |
| PushReceivedEvent |
This event is posted via the
EventBus . |
| RegistrationEvent | |
| ServerErrorEvent |
This event is posted via the
EventBus . |


Colourful, nostalgic eatery with more than 120 cereals, plus a selection of milk and toppings.
My Old Dutch, the original London pancake house, offers savoury and sweet pancakes as well as a selection of salads, traditional Dutch starters and desserts.
Independent cafe with pendant lights and murals, for gourmet coffees, breakfasts and light meals.
Classy design features and a garden rooftop terrace set the scene for modern Indian fare and drinks.
Northern Chinese food including steamed buns, served in simple diner decorated with Chinese tablets.
The Powerfully Pink And Flower-Filled London Cafés That Instagram Loves ... The pink-perfect Élan Café is the best place in London for a cheeky 'gram of cake .
Dishoom pays loving homage to the Irani cafés that were once part of the fabric of life in Bombay.
Enjoy a playful take on traditional British cuisine in Duck and Waffle, one of Liverpool Street's most famous restaurants.
Modern, light-filled bakery with high stools, for pastries and baked goods, plus celebration cakes.


You can show a label on the marker adding a simple property to it, and it will be shown when you mouseover the marker. The style of the markers is the same used in Leaflet label, and you can personalize it with CSS.


Reliability
In the tumultuous business of cutting-in and attending to a whale, there is much running backwards and forwards among the crew.
Anonymous accounts
In the tumultuous business of cutting-in and attending to a whale, there is much running backwards and forwards among the crew.
Anonymous transactions
In the tumultuous business of cutting-in and attending to a whale, there is much running backwards and forwards among the crew.
100% SSL Encrypting
In the tumultuous business of cutting-in and attending to a whale, there is much running backwards and forwards among the crew.
Loyal conditions
In the tumultuous business of cutting-in and attending to a whale, there is much running backwards and forwards among the crew. In the tumultuous business of cutting-in and attending to a whale, there is much running backwards and forwards among the crew.
Stable growth
In the tumultuous business of cutting-in and attending to a whale, there is much running backwards and forwards among the crew.
| 1F1tAaz5x1HUXrCNLbtMDqcw6o5GNn4xqX | Less than minute ago | 0.8964432 BTC |
| 1BaGcUCx2iM7sPRnc5nmk1d2zKW9HWzFU9 | Less than minute ago | 0.8964432 BTC |
| 1NPT5zmaBUnzm8d54Ya3EiPcQKgtso8vH | 2 minutes ago | 0.8964432 BTC |
| 1DoXEDf2RYZy2Bedm5LTrRQNCHtSLCgP6W | 4 minutes ago | 0.8964432 BTC |
| 17QpQreW9Gmda7SRQDURm1qszRJMD4WAS | 7 minutes ago | 0.8964432 BTC |
News
- Invest BTC in peer-to-peer loans and get 19% ARP with BTCJam.com
- BTCJam 1 minute ago
- A spat between developers may split the digital currency
- Reddit 10 minutes ago
- Bitcoin wallet Blockchain.info hits 4 million user mark
- CoinDesk 43 minutes ago
- Destinia: Bitcoin-paying customers spen more on travel
- CEX.io 56 minutes ago


Being the first to know always feels great... Signing up to our newsletter gives you exclusive access to our Grand Opening!


Levels of Autonomous cars #TomsProjects
Level 0
Level 1
Level 2
Level 3
Most of the safety-critical actions can be taken by the machine
Human attention required in case of emergency
Human intervention needed for emergency events
Level 4
Human-free driving, but limited to a particular region (due to the difference in driving culture and habits)
Level 5
Human-free, suitable in any region
It's performance is at least equal to that of human driver in any particular driving environment


--- title: "How to Cook Speedy Pumpkin Bread Pudding with Pecans Delicious" slug: pumpkin-bread-pudding-with-pecans description: "Pumpkin Bread Pudding with Pecans Recipe - This pumpkin bread pudding with pecans couldn't be much easier - using canned pumpkin speeds things up, but use fresh pumpkin puree if you have it. Top with caramel sauce and ice cream! Step-by-Step Guide to Cook Homemade Pumpkin Bread Pudding with Pecans Tasty" date: 2021-04-08T14:12:21Z image: https://cdn.statically.io/img/healthycampus.ucr.edu/sites/g/files/rcwecm2766/files/styles/form_preview/public/man-cooking-fresh-healthy-vegetables-salad-at-kitc-M9YSBBE.jpg thumbnail: https://cdn.statically.io/img/healthycampus.ucr.edu/sites/g/files/rcwecm2766/files/styles/form_preview/public/man-cooking-fresh-healthy-vegetables-salad-at-kitc-M9YSBBE.jpg cover: https://cdn.statically.io/img/healthycampus.ucr.edu/sites/g/files/rcwecm2766/files/styles/form_preview/public/man-cooking-fresh-healthy-vegetables-salad-at-kitc-M9YSBBE.jpg author: Utami ratingvalue: 4.1 reviewcount: 490 recipeingredient: - "1 (8 ounce) loaf French bread, torn into bite-sized pieces" - "2 ½ cups whole milk" - "2 cups pumpkin puree" - "2 cups white sugar" - "3 eggs" - "1 tablespoon vanilla extract" - "1 tablespoon orange flavoring" - "1 teaspoon pumpkin pie spice" - "2 cups chopped pecans" - "1 cup golden raisins" - "1 stick butter, melted" recipeinstructions: - "Preheat the oven to 350 degrees F (175 degrees C)." - "Put torn French bread into a bowl. Mix milk and pumpkin puree together in a separate bowl and pour over French bread. Let soak until moistened, about 5 minutes." - "Mix sugar, eggs, vanilla extract, orange flavoring, and pumpkin pie spice together in a bowl. Pour into bread mixture and stir. Fold in pecans and raisins." - "Place butter in a 9x13-inch baking pan and put into the preheated oven, about 5 minutes. Remove pan from oven when butter has melted and spoon in bread mixture." - "Bake in the hot oven until pudding is firm in the middle and edges are brown and crisp, 35 to 45 minutes." categories: - "Fruits and Vegetables" - "Vegetables" - "Squash" - "Recipes" tags: - "fruits and vegetables" - "vegetables" - "squash" katakunci: pumpkin bread pudding with pecans, fruits and vegetables, vegetables, squash, . nutrition: 487.3 calories recipecuisine: Western preptime: "P0DT0H20M" cooktime: "P0DT0H40M" totaltime: "P0DT0H65M" recipeyield: "12 servings" recipecategory: - Fruits and Vegetables - Vegetables - Squash quotes: Good food is the foundation of happiness. ---
Pumpkin Bread Pudding with Pecans - Hello everybody, hope you are having an incredible day today. Its me again Utami , welcome to our recipe site. Today, I will show you a way to prepare a distinctive dish, Pumpkin Bread Pudding with Pecans. It is one of my favorites recipes. This time, I am going to make it a little bit unique. This will be really delicious.
Pumpkin Bread Pudding with Pecans is This pumpkin bread pudding with pecans couldn't be much easier - using canned pumpkin speeds things up, but use fresh pumpkin puree if you have it. Top with caramel sauce and ice cream!
Pumpkin Bread Pudding with Pecans is one of the most well liked of current trending meals on earth. It is simple, it is fast, it tastes yummy. its appreciated by millions every day. It is easy, its quick, it tastes delicious. Pumpkin Bread Pudding with Pecans is something that I ve loved my entire life. They re fine and they look wonderful. They re nice and they look fantastic. Pumpkin Bread Pudding with Pecans is something which I ve loved my entire life.
To get started with this particular recipe, we have to first prepare a few components. You can have Pumpkin Bread Pudding with Pecans using 11 ingredients and 5 steps. Here is how you cook it.
So that is going to wrap this up with this special food Pumpkin Bread Pudding with Pecans recipe. Thank you very much for reading. I am confident you can make this at home. There is gonna be more interesting food in home recipes coming up. Dont forget to bookmark this page on your browser, and share it to your loved ones, friends and colleague. Thank you for reading. Go on get cooking!


new Trap()
Trap Object. Traps can be thrown by a player or ocur computer-generated.
- Source:
- Trap.js, line 15
Members
-
boundingBoxes
-
Trap BoundingBoxes
- Source:
- Trap.js, line 38
-
location
-
Trap Location
- Source:
- Trap.js, line 28
-
trapDetail
-
Trap Data from themes.js
- Source:
- Trap.js, line 33
-
type
-
Trap Type
- Source:
- Trap.js, line 25


Employee Panel
Identity No
Full Name
IBAN
Salary
Birth Year
Full Time
Department
IT
SALES
FINANCE
HR
MARKETING
Photo
Browse
Drop image here!
Add
Find
Update
Find All
Employees
No
Photo
Identity No
Full Name
Salary
IBAN
Department
Full Time?
Operations
Delete


This is a test app!
Created while revising the
CSCI613
FinalExam
Using Monaca!
Email Address
Name
Password
Save


Pixel 4's Recorder app will soon be available on older Pixel phones
Source: Google
What you need to know
- Google has said that it plans to bring the Pixel 4's new Recorder app to older Pixel phones as part of a future software update.
- Unfortunately, the company hasn't confirmed when the rollout will begin and whether the app will be available on all older Pixel devices.
- The Recorder app uses AI to automatically transcribe as well as label anything that you record.
When Google introduced its new Recorder app at the 'Made by Google 2019' event last month, it said that the app will be exclusive to the Pixel 4 and 4 XL. Now, however, a Google employee has confirmed on Reddit (via Android Police) that the app will be coming to older Pixel devices in the future.
Unfortunately, the Google employee did not reveal exactly when the software update will be rolled out to older Pixel devices. There is no word on the specific Pixel models that will get the app either.
In the same Reddit thread, however, a user with a Pixel 3 XL wrote that he was able to get the Recorder app working on his phone after sideloading it. Another user claims the app works fine on a Pixel 2 as well. If you have an older Pixel phone and would like to try the app on your device, you can download it from APK Mirror.
The Recorder app, which Google describes as "a new kind of audio recorder", utilizes machine learning to record as well as transcribe audio at the same time. This makes it possible for users to search for audio clips and even search within a specific recording. For now, the app only supports English for transcription and search. However, Google is working on adding support for more languages in the near future.
Google Pixel 4
With its fantastic cameras, smooth 90Hz OLED display, and flawless performance, the Google Pixel 4 is a great option for anyone looking for a relatively compact flagship smartphone. In addition to the impressive hardware, the Pixel 4 is also guaranteed to receive regular security updates for three years.
We may earn a commission for purchases using our links. Learn more.


public final class NettyChannelBuilder extends io.grpc.AbstractChannelBuilder<NettyChannelBuilder>
| Modifier and Type | Method and Description |
|---|---|
protected io.grpc.AbstractChannelBuilder.ChannelEssentials |
buildEssentials() |
NettyChannelBuilder |
channelType(java.lang.Class<? extends io.netty.channel.Channel> channelType)
Specify the channel type to use, by default we use
NioSocketChannel . |
NettyChannelBuilder |
eventLoopGroup(io.netty.channel.EventLoopGroup group)
Provides an EventGroupLoop to be used by the netty transport.
|
static NettyChannelBuilder |
forAddress(java.net.SocketAddress serverAddress)
Creates a new builder with the given server address.
|
static NettyChannelBuilder |
forAddress(java.lang.String host,
int port)
Creates a new builder with the given host and port.
|
NettyChannelBuilder |
negotiationType(NegotiationType type)
Sets the negotiation type for the HTTP/2 connection.
|
NettyChannelBuilder |
sslContext(io.netty.handler.ssl.SslContext sslContext)
SSL/TLS context to use instead of the system default.
|
public static NettyChannelBuilder forAddress(java.net.SocketAddress serverAddress)
public static NettyChannelBuilder forAddress(java.lang.String host, int port)
public NettyChannelBuilder channelType(java.lang.Class<? extends io.netty.channel.Channel> channelType)
NioSocketChannel
.public NettyChannelBuilder negotiationType(NegotiationType type)
Default: TLS
public NettyChannelBuilder eventLoopGroup(io.netty.channel.EventLoopGroup group)
It's an optional parameter. If the user has not provided an EventGroupLoop when the channel is built, the builder will use the default one which is static.
The channel won't take ownership of the given EventLoopGroup. It's caller's responsibility to shut it down when it's desired.
public NettyChannelBuilder sslContext(io.netty.handler.ssl.SslContext sslContext)
protected io.grpc.AbstractChannelBuilder.ChannelEssentials buildEssentials()
buildEssentials
in class io.grpc.AbstractChannelBuilder<NettyChannelBuilder>


Schedule
-
Tuesday, January 10th
10 events8:00am 9:00am 10:00am 11:00am 12:00pm 1:00pm 2:00pm 3:00pm 4:00pm 5:00pm KidzMashLunch10 events -
Wednesday, January 11th
8:00am 9:00am 10:00am 11:00am 12:00pm 1:00pm 2:00pm 3:00pm 4:00pm 5:00pm 10 eventsKidzMashLunch10 events


| I l@ve RuBoard |
In the last chapter, we looked at basic procedural statements in Python. Here, we'll move on to explore a set of additional statements that create functions of our own. In simple terms, functions are a device that groups a bunch of statements, so they can be run more than once in a program. Functions also let us specify parameters, which may differ each time a function's code is run. Table 4.1 summarizes the function-related statements we'll study in this chapter.
|
Statement |
Examples |
|---|---|
|
Calls |
myfunc("spam, ham, toast\n") |
|
def, return |
def adder(a, b, c=1, *d): return a+b+c+d[0] |
global |
def function(): global x, y; x = 'new' |
| I l@ve RuBoard |


YASM(1) The Yasm Modular Assembler YASM(1) NAME yasm - The Yasm Modular Assembler SYNOPSIS yasm [-f format] [-o outfile] [other options...] {infile} yasm -h DESCRIPTION The Yasm Modular Assembler is a portable, retargetable assembler written under the “new” (2 or 3 clause) BSD license. Yasm currently supports the x86 and AMD64 instruction sets, accepts NASM and GAS assembler syntaxes, outputs binary, ELF32, ELF64, COFF, Win32, and Win64 object formats, and generates source debugging information in STABS, DWARF 2, and CodeView 8 formats. YASM consists of the yasm command, libyasm, the core backend library, and a large number of modules. Currently, libyasm and the loadable modules are statically built into the yasm executable. The yasm command assembles the file infile and directs output to the file outfile if specified. If outfile is not specified, yasm will derive a default output file name from the name of its input file, usually by appending .o or .obj, or by removing all extensions for a raw binary file. Failing that, the output file name will be yasm.out. If called with an infile of “-”, yasm assembles the standard input and directs output to the file outfile, or yasm.out if no outfile is specified. OPTIONS Many options may be given in one of two forms: either a dash followed by a single letter, or two dashes followed by a long option name. Options are listed in alphabetical order. General Options -a arch or --arch=arch: Select target architecture Selects the target architecture. The default architecture is “x86”, which supports both the IA-32 and derivatives and AMD64 instruction sets. To print a list of available architectures to standard output, use “help” as arch. See yasm_arch(7) for a list of supported architectures. -f format or --oformat=format: Select object format Selects the output object format. The default object format is “bin”, which is a flat format binary with no relocation. To print a list of available object formats to standard output, use “help” as format. See yasm_objfmts(7) for a list of supported object formats. -g debug or --dformat=debug: Select debugging format Selects the debugging format for debug information. Debugging information can be used by a debugger to associate executable code back to the source file or get data structure and type information. Available debug formats vary between different object formats; yasm will error when an invalid combination is selected. The default object format is selected by the object format. To print a list of available debugging formats to standard output, use “help” as debug. See yasm_dbgfmts(7) for a list of supported debugging formats. -L list or --lformat=list: Select list file format Selects the format/style of the output list file. List files typically intermix the original source with the machine code generated by the assembler. The default list format is “nasm”, which mimics the NASM list file format. To print a list of available list file formats to standard output, use “help” as list. -l listfile or --list=listfile: Specify list filename Specifies the name of the output list file. If this option is not used, no list file is generated. -m machine or --machine=machine: Select target machine architecture Selects the target machine architecture. Essentially a subtype of the selected architecture, the machine type selects between major subsets of an architecture. For example, for the “x86” architecture, the two available machines are “x86”, which is used for the IA-32 and derivative 32-bit instruction set, and “amd64”, which is used for the 64-bit instruction set. This differentiation is required to generate the proper object file for relocatable object formats such as COFF and ELF. To print a list of available machines for a given architecture to standard output, use “help” as machine and the given architecture using -a arch. See yasm_arch(7) for more details. -o filename or --objfile=filename: Specify object filename Specifies the name of the output file, overriding any default name generated by Yasm. -p parser or --parser=parser: Select parser Selects the parser (the assembler syntax). The default parser is “nasm”, which emulates the syntax of NASM, the Netwide Assembler. Another available parser is “gas”, which emulates the syntax of GNU AS. To print a list of available parsers to standard output, use “help” as parser. See yasm_parsers(7) for a list of supported parsers. -r preproc or --preproc=preproc: Select preprocessor Selects the preprocessor to use on the input file before passing it to the parser. Preprocessors often provide macro functionality that is not included in the main parser. The default preprocessor is “nasm”, which is an imported version of the actual NASM preprocessor. A “raw” preprocessor is also available, which simply skips the preprocessing step, passing the input file directly to the parser. To print a list of available preprocessors to standard output, use “help” as preproc. -h or --help: Print a summary of options Prints a summary of invocation options. All other options are ignored, and no output file is generated. --version: Get the Yasm version This option causes Yasm to prints the version number of Yasm as well as a license summary to standard output. All other options are ignored, and no output file is generated. Warning Options -W options have two contrary forms: -Wname and -Wno-name. Only the non-default forms are shown here. The warning options are handled in the order given on the command line, so if -w is followed by -Worphan-labels, all warnings are turned off except for orphan-labels. -w: Inhibit all warning messages This option causes Yasm to inhibit all warning messages. As discussed above, this option may be followed by other options to re-enable specified warnings. -Werror: Treat warnings as errors This option causes Yasm to treat all warnings as errors. Normally warnings do not prevent an object file from being generated and do not result in a failure exit status from yasm, whereas errors do. This option makes warnings equivalent to errors in terms of this behavior. -Wno-unrecognized-char: Do not warn on unrecognized input characters Causes Yasm to not warn on unrecognized characters found in the input. Normally Yasm will generate a warning for any non-ASCII character found in the input file. -Worphan-labels: Warn on labels lacking a trailing option When using the NASM-compatible parser, causes Yasm to warn about labels found alone on a line without a trailing colon. While these are legal labels in NASM syntax, they may be unintentional, due to typos or macro definition ordering. -X style: Change error/warning reporting style Selects a specific output style for error and warning messages. The default is “gnu” style, which mimics the output of gcc. The “vc” style is also available, which mimics the output of Microsoft´s Visual C++ compiler. This option is available so that Yasm integrates more naturally into IDE environments such as Visual Studio or Emacs, allowing the IDE to correctly recognize the error/warning message as such and link back to the offending line of source code. Preprocessor Options While these preprocessor options theoretically will affect any preprocessor, the only preprocessor currently in Yasm is the “nasm” preprocessor. -D macro[=value]: Pre-define a macro Pre-defines a single-line macro. The value is optional (if no value is given, the macro is still defined, but to an empty value). -e or --preproc-only: Only preprocess Stops assembly after the preprocessing stage; preprocessed output is sent to the specified output name or, if no output name is specified, the standard output. No object file is produced. -I path: Add include file path Adds directory path to the search path for include files. The search path defaults to only including the directory in which the source file resides. -P filename: Pre-include a file Pre-includes file filename, making it look as though filename was prepended to the input. Can be useful for prepending multi-line macros that the -D can´t support. -U macro: Undefine a macro Undefines a single-line macro (may be either a built-in macro or one defined earlier in the command line with -D. EXAMPLES To assemble NASM syntax, 32-bit x86 source source.asm into ELF file source.o, warning on orphan labels: yasm -f elf32 -Worphan-labels source.asm To assemble NASM syntax AMD64 source x.asm into Win64 file object.obj: yasm -f win64 -o object.obj x.asm To assemble already preprocessed NASM syntax x86 source y.asm into flat binary file y.com: yasm -f bin -r raw -o y.com y.asm DIAGNOSTICS The yasm command exits 0 on success, and nonzero if an error occurs. COMPATIBILITY Yasm´s NASM parser and preprocessor, while they strive to be as compatible as possible with NASM, have a few incompatibilities due to YASM´s different internal structure. Yasm´s GAS parser and preprocessor are missing a number of features present in GNU AS. RESTRICTIONS As object files are often architecture and machine dependent, not all combinations of object formats, architectures, and machines are legal; trying to use an invalid combination will result in an error. There is no support for symbol maps. SEE ALSO yasm_arch(7), yasm_dbgfmts(7), yasm_objfmts(7), yasm_parsers(7) Related tools: as(1), ld(1), nasm(1) BUGS When using the “x86” architecture, it is overly easy to generate AMD64 code (using the BITS 64 directive) and generate a 32-bit object file (by failing to specify -m amd64 or selecting a 64-bit object format such as ELF64 on the command line). AUTHOR Peter Johnson<EMAIL_ADDRESS>Author. COPYRIGHT Copyright © 2004, 2005, 2006, 2007 Peter Johnson Yasm April 2007 YASM(1)


block
{{ security_page_blocked_title }}
{{ security_page_blocked_description }}
${ detail }
{{ back }}
{{ disable }}


{% extends "base.html" %} {% block title %}
Medieval catalogues > BENEDICTINES: THE SHORTER CATALOGUES > York St Mary's > Index catalogue of selected authors, 15th cent.
{% endif %}554 identified entries found.
All data was derived from the List of Identifications by Professor Richard Sharpe.
{% if not printing %}
A key to codes used in the List is available (opens in new tab).{% endif %}


Paste JSON in the text area below and click on GENERATE to generate corresponding Swift objects.
Restrictions:


A nest background of website draw on canvas. 中文 Readme 帮助文档.
# use npm
npm install --save canvas-nest.js
# or use yarn
yarn add canvas-nest.js
Insert the code below between <body> and </body>
.
<script src="dist/canvas-nest.js"></script>
Strongly suggest to insert before the tag </body>
, as the following:
<html>
<head>
...
</head>
<body>
...
...
<script src="dist/canvas-nest.js"></script>
</body>
</html>
Then ok! Please do not add the code in the <head> </head>
.
After installation, you can import this as module.
There is only one API, use it as below:
import CanvasNest from 'canvas-nest.js';
const config = {
color: '255,0,0',
count: 88,
};
// Using config rendering effect at 'element'.
const cn = new CanvasNest(element, config);
// destroy
cn.destroy();
color
: color of lines, default: '0,0,0'
; RGB values: (R,G,B).(note: use ‘,’ to separate.)pointColor
: color of points, default: '0,0,0'
; RGB values: (R,G,B).(note: use ‘,’ to separate.)opacity
: the opacity of line (0~1), default: 0.5
.count
: the number of lines, default: 99
.zIndex
: z-index property of the background, default: -1
.Example:
<script type="text/javascript" color="0,0,255" opacity='0.7' zIndex="-2" count="99" src="dist/canvas-nest.js"></script>
{
color: '0,0,255',
opacity: 0.7,
zIndex: -2,
count: 99,
};
Note: If the Configuration isn’t customized, default values are available as well.
canvas-nest
in wordpress store.nest
in vscode extensions.MIT@hustcc.


{% extends "../base.html" %} {% load static %} {% load latexify %} {% block content %}
ViroCon helps you design marine structures, which need to withstand load combinations based on wave, wind and current. It lets you identify extreme environmental conditions with a defined return period using the environmental contour method. ViroCon is built to cover the complete workflow to derive an environmental contour, which can be seperated into three steps:
In ViroCon's context a probabilistic model represents a probabilistic description of the environment. It describes the long-term statistics of the environment with a multivariate distribution.
ViroCon uses the conditonal modeling aproach (CMA) [3] for its probabilistic models. In the CMA one environmental variable has a marginal distribution and all other environmental variables have conditonal distributions.
An environmental contour is the boundary of the mathematical region that makes up the environmental states that must be considered in a design. Along the contour, discrete extreme environmental design conditions (EEDCs) can be selected for ultimate load calculations (Fig. 2). Environmental contours are derived based on a probabilist model.
There exist different mathematical definitions for environmental contours. ViroCon supports the following two definitons for environmental contours:
Other definitions, which are currently not supported are:
Contours based on the inverse first order reliability method (IFORM) are defined by hyperplanes in the standard normal space. Consequently, the probabilistic model is first transformed to the normal space. There, the environmental contour is defined as a hypersphere. Then, this hypersphere is transformed back to the original space (Fig. 3).
A highest density contour (HDC) is defined in the original variable space. The contour C is the boundary of the highest density region R:
where α is the exceedance probability, which depends on the return period T (in years) and the environmental state duration D (in hours):
By definition a highest density contour has constant probability density along its path and encloses a region that contains 1-α probability (Fig. 4).
[1] Det Norske Veritas (2010): Recommended practice - DNV-RP-
C205 Environmental conditions and environmental loads.
Technical report.
[2] Scholz, F.W. (2006). Maximum likelihood estimation.
In Encyclopedia of statistical sciences (eds S. Kotz,
C.B. Read, N. Balakrishnan, B. Vidakovic and N.L. Johnson).
[3] E. Bitner-Gregersen, S. Haver (1991): Joint environmental
model for reliability calculations, in: Proceedings of the
International Offshore and Polar Engineering Conference.
Edinburgh, United Kingdom, 1991.
[4] A.F. Haselsteiner, J.-H. Ohlendorf, W. Wosniok, K.-D.
Thoben (2017): Deriving environmental contours
from highest density regions, Coastal Engineering 123, 42-51.
[5] S. Winterstein, T. Ude, C. Cornell, P. Bjerager, S. Haver
(1993): Environmental parameters for extreme
response: inverse FORM with omission factors, in: Proceedings,
ICOSSAR-93. Innsbruck, Austria, 1993.
[6] A.B. Huseby , E. Vanem, B. Natvig (2013): A new approach
to environmental contours for ocean engineering
applications based on direct Monte Carlo simulations,
Ocean Engineering 60, 124-135.
[7] W. Chai, B.J. Leira (2018): Environmental contours
based on inverse SORM,
Marine Structures 60, 34-51.
Repo. ViroCon's GitHub repository can be found here.
Docs. ViroCon's documentation can be found here.
Viroconcom. ViroCon uses our python package called 'viroconcom', which is purely dedicated to the statistical computations. It has its own GitHub repository and its own documentation .
Send us an email .
Or in case you spotted a bug or have a feature request, open an issue at our GitHub repository .


---
layout: default
title: GECODE interfaces
headline: Interfaces
---
We are developing the following interface to Gecode:
The following external projects provide interfaces to Gecode:
The following interfaces to Gecode are no longer available.
-
The Monadic Constraint Programming Framework
provides a CP modeling framework for Haskell with Gecode as backend.
-
Gecode/R
provides a modeling interface in Ruby for solving problems using Gecode.
- Tailor
translates Essence' models to Gecode programs (among other things).
- Gecode/J
is a Java interface that makes most functionality of Gecode
available in Java. You can model problems and implement your
own propagators, branchings, and search engines.
If you are developing an interface for Gecode and would like it to be listed
here, please send us an email.