File Navigator Guide (Advanced)
This guide walks you through building a file navigation widget. It takes about 45 minutes to complete. It was written with CanJS 3.10. Check out the File Navigator Guide (Simple) for an easier example that produces similar functionality.
The final widget looks like:
Finished version of the CanJS File Navigator Guide (Advanced) on jsbin.com Open in JSFiddle
Note: If you don’t see any files show up, run the JS Bin again. This JS Bin uses randomly generated files, so it’s possible nothing shows up.
Start this tutorial by cloning the following JS Bin:
Starter version of the CanJS File Navigator Guide (Advanced) on jsbin.com Open in JSFiddle
This JS Bin has initial prototype HTML and CSS which is useful for getting the application to look right.
The following sections are broken down into:
- Problem - A description of what the section is trying to accomplish.
- Things to know - Information about CanJS that is useful for solving the problem.
- Solution - The solution to the problem.
Watch a video of us building this recipe here:
Build a service layer with fixtures
Problem
Make an /api/entities
service layer that provides the files and folders for another folder. An entity
can be either a file or folder. A single entity
looks like:
{
id: "2",
name: "dogs",
parentId: "0", // The id of the folder this file or folder is within.
type: "folder", // or "file",
hasChildren: true // false for a folder with no children, or a file
}
To get the list of files and folders within a given folder, a GET
request should be made as follows:
GET /api/entities?folderId=0
This should return the list of folders and files directly within that folder like:
{
data: [
{ id: "7", name: "pekingese.png", parentId: "0", type: "file", hasChildren: false },
{ id: "8", name: "poodles", parentId: "0", type: "folder", hasChildren: false },
{ id: "9", name: "hounds", parentId: "0", type: "folder", hasChildren: true }
]
}
The first level files and folders should have a parentId
of "0"
.
Things to know
can-fixture is used to trap AJAX requests like:
can.fixture("/api/entities", function(request) { // request.data.folderId -> "1" return {data: [ ... ]} })
store can be used to automatically filter records using the query string:
var entities = [ ... ]; var entitiesStore = can.fixture.store( entities ); can.fixture("/api/entities", entitiesStore);
rand can be used to create a random integer:
can.fixture.rand(10) //-> 10 can.fixture.rand(10) //-> 0
Solution
First, let’s make a function that generates an array of entities
that will be
stored on our fake server. Update the JavaScript tab to:
// Stores the next entity id to use.
var entityId = 1;
// Returns an array of entities for the given `parentId`.
// Makes sure the `depth` of entities doesn’t exceed 5.
var makeEntities = function(parentId, depth) {
if (depth > 5) {
return [];
}
// The number of entities to create.
var entitiesCount = can.fixture.rand(10);
// The array of entities we will return.
var entities = [];
for (var i = 0; i < entitiesCount; i++) {
// The id for this entity
var id = "" + (entityId++);
// If the entity is a folder or file
var isFolder = Math.random() > 0.3;
// The children for this folder.
var children = isFolder ? makeEntities(id, depth+1) : [];
var entity = {
id: id,
name: (isFolder ? "Folder" : "File") + " " + id,
parentId: parentId,
type: (isFolder ? "folder" : "file"),
hasChildren: children.length > 0
};
entities.push(entity);
// Add the children of a folder
[].push.apply(entities, children)
}
return entities;
};
Next, let’s make those entities, create a store
to house them, and trap AJAX
requests to use that store
:
// Stores the next entity id to use.
var entityId = 1;
// Returns an array of entities for the given `parentId`.
// Makes sure the `depth` of entities doesn’t exceed 5.
var makeEntities = function(parentId, depth) {
if (depth > 5) {
return [];
}
// The number of entities to create.
var entitiesCount = can.fixture.rand(10);
// The array of entities we will return.
var entities = [];
for (var i = 0; i < entitiesCount; i++) {
// The id for this entity
var id = "" + (entityId++);
// If the entity is a folder or file
var isFolder = Math.random() > 0.3;
// The children for this folder.
var children = isFolder ? makeEntities(id, depth+1) : [];
var entity = {
id: id,
name: (isFolder ? "Folder" : "File") + " " + id,
parentId: parentId,
type: (isFolder ? "folder" : "file"),
hasChildren: children.length > 0
};
entities.push(entity);
// Add the children of a folder
[].push.apply(entities, children)
}
return entities;
};
// Make the entities for the demo
var entities = makeEntities("0", 0);
// Add them to a client-like DB store
var entitiesStore = can.fixture.store(entities);
// Trap requests to /api/entities to read items from the entities store.
can.fixture("/api/entities", entitiesStore);
// Make requests to /api/entities take 1 second
can.fixture.delay = 1000;
Create the Entity
Model
The problem
When we load entities from the server, it’s useful to convert them into Entity
type instances. We will want to create an observable Entity
type using can-define/map/map so we can do:
var entity = new Entity({
id: "2",
name: "dogs",
parentId: "0", // The id of the folder this file or folder is within.
type: "folder", // or "file",
hasChildren: true // false for a folder with no children, or a file
});
entity.on("name", function(ev, newName) {
console.log("entity name changed to ", newName);
});
entity.name = "cats" //-> logs "entity name changed to cats"
Things to know
You can create a DefineMap
type using DefineMap.extend with the type’s properties and the properties’ types like:
Type = can.DefineMap.extend({
id: "string",
hasChildren: "boolean",
...
});
The solution
Extend can.DefineMap
with each property and its type as follows:
// Stores the next entity id to use.
var entityId = 1;
// Returns an array of entities for the given `parentId`.
// Makes sure the `depth` of entities doesn’t exceed 5.
var makeEntities = function(parentId, depth) {
if (depth > 5) {
return [];
}
// The number of entities to create.
var entitiesCount = can.fixture.rand(10);
// The array of entities we will return.
var entities = [];
for (var i = 0; i < entitiesCount; i++) {
// The id for this entity
var id = "" + (entityId++);
// If the entity is a folder or file
var isFolder = Math.random() > 0.3;
// The children for this folder.
var children = isFolder ? makeEntities(id, depth+1) : [];
var entity = {
id: id,
name: (isFolder ? "Folder" : "File") + " " + id,
parentId: parentId,
type: (isFolder ? "folder" : "file"),
hasChildren: children.length > 0
};
entities.push(entity);
// Add the children of a folder
[].push.apply(entities, children)
}
return entities;
};
// Make the entities for the demo
var entities = makeEntities("0", 0);
// Add them to a client-like DB store
var entitiesStore = can.fixture.store(entities);
// Trap requests to /api/entities to read items from the entities store.
can.fixture("/api/entities", entitiesStore);
// Make requests to /api/entities take 1 second
can.fixture.delay = 1000;
var Entity = can.DefineMap.extend({
id: "string",
name: "string",
parentId: "string",
hasChildren: "boolean",
type: "string"
});
Connect the Entity
model to the service layer
The problem
We want to be able to load a list of Entity
instances from GET /api/entities
with:
Entity.getList({parentId: "0"}).then(function(entities) {
console.log(entities.get()) //-> [ Entity{id: "1", parentId: "0", ...}, ...]
});
Things to know
can.connect.baseMap() can connect a Map
type to
a url
like:
can.connect.baseMap({
Map: Entity,
url: "URL"
});
The solution
Use can.connect.baseMap
to connect Entity
to /api/entities
like:
// Stores the next entity id to use.
var entityId = 1;
// Returns an array of entities for the given `parentId`.
// Makes sure the `depth` of entities doesn’t exceed 5.
var makeEntities = function(parentId, depth) {
if (depth > 5) {
return [];
}
// The number of entities to create.
var entitiesCount = can.fixture.rand(10);
// The array of entities we will return.
var entities = [];
for (var i = 0; i < entitiesCount; i++) {
// The id for this entity
var id = "" + (entityId++);
// If the entity is a folder or file
var isFolder = Math.random() > 0.3;
// The children for this folder.
var children = isFolder ? makeEntities(id, depth+1) : [];
var entity = {
id: id,
name: (isFolder ? "Folder" : "File") + " " + id,
parentId: parentId,
type: (isFolder ? "folder" : "file"),
hasChildren: children.length > 0
};
entities.push(entity);
// Add the children of a folder
[].push.apply(entities, children)
}
return entities;
};
// Make the entities for the demo
var entities = makeEntities("0", 0);
// Add them to a client-like DB store
var entitiesStore = can.fixture.store(entities);
// Trap requests to /api/entities to read items from the entities store.
can.fixture("/api/entities", entitiesStore);
// Make requests to /api/entities take 1 second
can.fixture.delay = 1000;
var Entity = can.DefineMap.extend({
id: "string",
name: "string",
parentId: "string",
hasChildren: "boolean",
type: "string"
});
can.connect.baseMap({
Map: Entity,
url: "/api/entities"
});
Create the ROOT entity and render it
The problem
We need to begin converting the static HTML the designer gave us into live HTML. This means
rendering it in a template. We’ll start slow by rendering the root
parent folder’s name
in the same way it’s expected by the designer.
Things to know
CanJS uses can-stache to render data in a template and keep it live. Templates can be authored in

A can-stache template uses {{key}} magic tags to insert data into the HTML output like:

Load a template from a

Update the JavaScript tab to:
- Create a
folder
Entity
instance. - Load the
app-template
. Renders it withfolder
instance, and inserts the result in the
element.
// Stores the next entity id to use.
var entityId = 1;
// Returns an array of entities for the given `parentId`.
// Makes sure the `depth` of entities doesn’t exceed 5.
var makeEntities = function(parentId, depth) {
if (depth > 5) {
return [];
}
// The number of entities to create.
var entitiesCount = can.fixture.rand(10);
// The array of entities we will return.
var entities = [];
for (var i = 0; i < entitiesCount; i++) {
// The id for this entity
var id = "" + (entityId++);
// If the entity is a folder or file
var isFolder = Math.random() > 0.3;
// The children for this folder.
var children = isFolder ? makeEntities(id, depth+1) : [];
var entity = {
id: id,
name: (isFolder ? "Folder" : "File") + " " + id,
parentId: parentId,
type: (isFolder ? "folder" : "file"),
hasChildren: children.length > 0
};
entities.push(entity);
// Add the children of a folder
[].push.apply(entities, children)
}
return entities;
};
// Make the entities for the demo
var entities = makeEntities("0", 0);
// Add them to a client-like DB store
var entitiesStore = can.fixture.store(entities);
// Trap requests to /api/entities to read items from the entities store.
can.fixture("/api/entities", entitiesStore);
// Make requests to /api/entities take 1 second
can.fixture.delay = 1000;
var Entity = can.DefineMap.extend({
id: "string",
name: "string",
parentId: "string",
hasChildren: "boolean",
type: "string"
});
can.connect.baseMap({
Map: Entity,
url: "/api/entities"
});
var folder = new Entity({
id: "0",
name: "ROOT/",
hasChildren: true,
type: "folder"
});
var template = can.stache.from("app-template");
var frag = template({
folder: folder
});
document.body.appendChild( frag );
Render the ROOT entities children
The problem
In this section, we’ll list the files and folders within the root folder.
Things to know
- Use {{#if(value)}} to do
if/else
branching incan-stache
. - Use {{#each(value)}} to do looping in
can-stache
. - Use {{#eq(value1, value2)}} to test equality in
can-stache
. Promise
s are observable incan-stache
. Given a promisesomePromise
, you can:- Check if the promise is loading like:
{{#if(somePromise.isPending)}}
. - Loop through the resolved value of the promise like:
{{#each(somePromise.value)}}
.
- Check if the promise is loading like:
- Write

Loading

when files are loading. - Write a

to contain all the files. Within the

there should be:- An

with a class attribute that includesfile
orfolder
andhasChildren
if the folder has children. - The

should have📝 {{FILE_NAME}}
if a file and📁 {{FOLDER_NAME}}
if a folder.
- An
The solution
The following uses entitiesPromise
to write
Loading

while
the promise is pending, and then writes out an

for each entity in the resolved entitiesPromise
:

The following adds an entitiesPromise
to data passed to the template. entitiesPromise
will contain the files and folders that are directly within the root folder.
// Stores the next entity id to use.
var entityId = 1;
// Returns an array of entities for the given `parentId`.
// Makes sure the `depth` of entities doesn’t exceed 5.
var makeEntities = function(parentId, depth) {
if (depth > 5) {
return [];
}
// The number of entities to create.
var entitiesCount = can.fixture.rand(10);
// The array of entities we will return.
var entities = [];
for (var i = 0; i < entitiesCount; i++) {
// The id for this entity
var id = "" + (entityId++);
// If the entity is a folder or file
var isFolder = Math.random() > 0.3;
// The children for this folder.
var children = isFolder ? makeEntities(id, depth+1) : [];
var entity = {
id: id,
name: (isFolder ? "Folder" : "File") + " " + id,
parentId: parentId,
type: (isFolder ? "folder" : "file"),
hasChildren: children.length > 0
};
entities.push(entity);
// Add the children of a folder
[].push.apply(entities, children)
}
return entities;
};
// Make the entities for the demo
var entities = makeEntities("0", 0);
// Add them to a client-like DB store
var entitiesStore = can.fixture.store(entities);
// Trap requests to /api/entities to read items from the entities store.
can.fixture("/api/entities", entitiesStore);
// Make requests to /api/entities take 1 second
can.fixture.delay = 1000;
var Entity = can.DefineMap.extend({
id: "string",
name: "string",
parentId: "string",
hasChildren: "boolean",
type: "string"
});
can.connect.baseMap({
Map: Entity,
url: "/api/entities"
});
var folder = new Entity({
id: "0",
name: "ROOT/",
hasChildren: true,
type: "folder"
});
var template = can.stache.from("app-template");
var frag = template({
entitiesPromise: Entity.getList({parentId: "0"}),
folder: folder
});
document.body.appendChild( frag );
Toggle children with a ViewModel
The problem
We want to hide the root folder’s children until the root folder is clicked on. An subsequent clicks on the root folder’s name should toggle if the children are displayed.
Things to know
CanJS uses [guides/technicalViewModels#MaintainableMVVM ViewModels] to manage the behavior of views. ViewModels can have their own state, such as if a folder
isOpen
and should be showing its children.ViewModels
are constructor functions created with can.DefineMap.can.DefineMap
can detail the type of a property with another type like:var Address = can.DefineMap.extend({ street: "string", city: "string" }); var Person = can.DefineMap.extend({ address: Address });
can.DefineMap
can also specify default values:var Person = can.DefineMap.extend({ address: Address, age: {value: 33} });
can.DefineMap
can also specify a default value and a type:var Person = can.DefineMap.extend({ address: Address, age: {value: 33, type: "number"} });
can.DefineMap
can also have methods:var Person = can.DefineMap.extend({ address: Address, age: {value: 33, type: "number"}, birthday: function() { this.age++; } });
Use on:event to listen to an event on an element and call a method in
can-stache
. For example, the following callsdoSomething()
when the

is clicked.
 ...

The solution
The following:
- Defines a
FolderVM
type that will manage the UI state around a folder. SpecificallyFolderVM
has:folder
which references the folder being displayed.entitiesPromise
which will be a promise of all files for that folder.isOpen
which tracks if the folder’s children should be displayed.toggleOpen
which changesisOpen
.
- Creates an instance of the
FolderVM
and uses it to render the template.
// Stores the next entity id to use.
var entityId = 1;
// Returns an array of entities for the given `parentId`.
// Makes sure the `depth` of entities doesn’t exceed 5.
var makeEntities = function(parentId, depth) {
if (depth > 5) {
return [];
}
// The number of entities to create.
var entitiesCount = can.fixture.rand(10);
// The array of entities we will return.
var entities = [];
for (var i = 0; i < entitiesCount; i++) {
// The id for this entity
var id = "" + (entityId++);
// If the entity is a folder or file
var isFolder = Math.random() > 0.3;
// The children for this folder.
var children = isFolder ? makeEntities(id, depth+1) : [];
var entity = {
id: id,
name: (isFolder ? "Folder" : "File") + " " + id,
parentId: parentId,
type: (isFolder ? "folder" : "file"),
hasChildren: children.length > 0
};
entities.push(entity);
// Add the children of a folder
[].push.apply(entities, children)
}
return entities;
};
// Make the entities for the demo
var entities = makeEntities("0", 0);
// Add them to a client-like DB store
var entitiesStore = can.fixture.store(entities);
// Trap requests to /api/entities to read items from the entities store.
can.fixture("/api/entities", entitiesStore);
// Make requests to /api/entities take 1 second
can.fixture.delay = 1000;
var Entity = can.DefineMap.extend({
id: "string",
name: "string",
parentId: "string",
hasChildren: "boolean",
type: "string"
});
can.connect.baseMap({
Map: Entity,
url: "/api/entities"
});
var folder = new Entity({
id: "0",
name: "ROOT/",
hasChildren: true,
type: "folder"
});
var FolderVM = can.DefineMap.extend({
folder: Entity,
entitiesPromise: {
value: function() {
return Entity.getList({parentId: this.folder.id});
}
},
isOpen: {type: "boolean", value: false},
toggleOpen: function() {
this.isOpen = !this.isOpen;
}
});
// Create an instance of `FolderVM` with the root folder
var rootFolderVM = new FolderVM({
folder: folder
});
var template = can.stache.from("app-template");
var frag = template(rootFolderVM);
document.body.appendChild( frag );
The following wraps the listing of child entities with a {{#if(isOpen)}} {{/if}}
:

Create an
custom element to manage folder behavior
The problem
Now we want to make all the folders able to open and close. This means creating a FolderVM
for every folder entity.
Things to know
can.Component is used to create custom elements like:
var MyComponentVM = DefineMap.extend({ message: {value: "Hello There!"} }); can.Component.extend({ tag: "my-component", ViewModel: MyComponentVM, view: can.stache("
{{message}}
"); });
This component will be created anytime a
<my-component>
element is found in the page. When the component is created, it creates an instance of it’sViewModel
, in this caseMyComponentVM
.You can pass data to a component’s
ViewModel
with {data-bindings} like:<my-component message:from="'Hi There'" />
This sets
message
on the ViewModel to'Hi There'
. You can also send data within stache like:<my-component message:from="greeting" />
This sets
message
on the ViewModel to whatgreeting
is in the stache template.A component’s [View] is rendered inside the component. This means that if the following is in a template:
<my-component {message}="'Hi There'" />
The following will be inserted into the page:
<my-component {message}="'Hi There'">
Hi There
</my-component>
this
in a stache template refers to the current context of a template or section.For example, the
this
inthis.name
refers to thecontext
object:var template = stache("{{this.name}}"); var context = {name: "Justin"}; template(context);
Or, when looping through a list of items,
this
refers to each item:{{#each(items)}}
{{this.name}}
  {{/each}}
The solution
The following:
- Changes the
app-template
to use the
component to render the root folder. It passes the root folder asfolder
to the
component’s ViewModel. It also sets the
component’s ViewModel’sisOpen
property totrue
. - Moves the content that was in
app-template
to thefolder-template

The following:
- Defines a custom

element that manages its behavior withFolderVM
and uses it to render afolder-template
template. - Renders the
app-template
with the rootparent
folder instead of therootFolderVM
.
// Stores the next entity id to use.
var entityId = 1;
// Returns an array of entities for the given `parentId`.
// Makes sure the `depth` of entities doesn’t exceed 5.
var makeEntities = function(parentId, depth) {
if (depth > 5) {
return [];
}
// The number of entities to create.
var entitiesCount = can.fixture.rand(10);
// The array of entities we will return.
var entities = [];
for (var i = 0; i < entitiesCount; i++) {
// The id for this entity
var id = "" + (entityId++);
// If the entity is a folder or file
var isFolder = Math.random() > 0.3;
// The children for this folder.
var children = isFolder ? makeEntities(id, depth+1) : [];
var entity = {
id: id,
name: (isFolder ? "Folder" : "File") + " " + id,
parentId: parentId,
type: (isFolder ? "folder" : "file"),
hasChildren: children.length > 0
};
entities.push(entity);
// Add the children of a folder
[].push.apply(entities, children)
}
return entities;
};
// Make the entities for the demo
var entities = makeEntities("0", 0);
// Add them to a client-like DB store
var entitiesStore = can.fixture.store(entities);
// Trap requests to /api/entities to read items from the entities store.
can.fixture("/api/entities", entitiesStore);
// Make requests to /api/entities take 1 second
can.fixture.delay = 1000;
var Entity = can.DefineMap.extend({
id: "string",
name: "string",
parentId: "string",
hasChildren: "boolean",
type: "string"
});
can.connect.baseMap({
Map: Entity,
url: "/api/entities"
});
var folder = new Entity({
id: "0",
name: "ROOT/",
hasChildren: true,
type: "folder"
});
var FolderVM = can.DefineMap.extend({
folder: Entity,
entitiesPromise: {
value: function() {
return Entity.getList({parentId: this.folder.id});
}
},
isOpen: {type: "boolean", value: false},
toggleOpen: function() {
this.isOpen = !this.isOpen;
}
});
can.Component.extend({
tag: "a-folder",
ViewModel: FolderVM,
view: can.stache.from("folder-template")
});
var template = can.stache.from("app-template");
var frag = template(folder);
document.body.appendChild( frag );
Result
When complete, you should have a working file-navigation widget like the following JS Bin:
Finished version of the CanJS File Navigator Guide (Advanced) on jsbin.com Open in JSFiddle


L.A. County’s Unclaimed Remains - 2011
Orignally reported by L.A. Times -
L.A. County’s unclaimed remains of 2011
.
Story
Reporting


prtClassAdaBoost AdaBoost classifier
CLASSIFIER = prtClassAdaBoost returns a AdaBoost classifier
CLASSIFIER = prtClassAdaBoost(PROPERTY1, VALUE1, ...) constructs a
prtClassAdaBoost object CLASSIFIER with properties as specified by
PROPERTY/VALUE pairs.
A prtClassAdaBoost object inherits all properties from the abstract
class prtClass. In addition is has the following properties:
baseClassifier - the prtClass object that forms the "weak" or
"Base" classifier for the AdaBoost.
nBoosts - Number of iterations to run (number of weak
classifiers to train)
AdaBoost is a meta algorithm for training ensembles of weak
classifiers on different sub-sets of the complete data set, with
later classifiers trained to focus on data points that were
mis-classified in earlier iterations. A complete description of the
algorithm for AdaBoost is beyond the scope of this help entry, but
more information AdaBoost can be found at the following URL:
http://en.wikipedia.org/wiki/AdaBoost
A prtClassAdaBoost object inherits the TRAIN, RUN, CROSSVALIDATE and
KFOLDS methods from prtAction. It also inherits the PLOT
method from prtClass.
Example:
TestDataSet = prtDataGenUnimodal; % Create some test and
TrainingDataSet = prtDataGenUnimodal; % training data
classifier = prtClassAdaBoost; % Create a classifier
classifier = classifier.train(TrainingDataSet); % Train
classified = run(classifier, TestDataSet); % Test
subplot(2,1,1);
classifier.plot;
subplot(2,1,2);
[pf,pd] = prtScoreRoc(classified,TestDataSet);
h = plot(pf,pd,'linewidth',3);
title('ROC'); xlabel('Pf'); ylabel('Pd');


class TZInfo::TimeWithOffset
A subclass of `Time` used to represent local times. {TimeWithOffset} holds a reference to the related {TimezoneOffset} and overrides various methods to return results appropriate for the {TimezoneOffset}. Certain operations will clear the associated {TimezoneOffset} (if the {TimezoneOffset} would not necessarily be valid for the result). Once the {TimezoneOffset} has been cleared, {TimeWithOffset} behaves identically to `Time`.
Arithmetic performed on {TimeWithOffset} instances is not time zone-aware. Regardless of whether transitions in the time zone are crossed, results of arithmetic operations will always maintain the same offset from UTC (`utc_offset`). The associated {TimezoneOffset} will aways be cleared.
Attributes
@return [TimezoneOffset] the {TimezoneOffset} associated with this
instance.
Public Instance Methods
An overridden version of `Time#dst?` that, if there is an associated {TimezoneOffset}, returns the result of calling {TimezoneOffset#dst? dst?} on that offset.
@return [Boolean] `true` if daylight savings time is being observed,
otherwise `false`.
# File lib/tzinfo/time_with_offset.rb, line 43 def dst? to = timezone_offset to ? to.dst? : super end
An overridden version of `Time#getlocal` that clears the associated {TimezoneOffset} if the base implementation of `getlocal` returns a {TimeWithOffset}.
@return [Time] a representation of the {TimeWithOffset} using either the
local time zone or the given offset.
# File lib/tzinfo/time_with_offset.rb, line 55 def getlocal(*args) # JRuby < 9.3 returns a Time in all cases. # JRuby >= 9.3 returns a Time when called with no arguments and a # TimeWithOffset with a timezone_offset assigned when called with an # offset argument. result = super result.clear_timezone_offset if result.kind_of?(TimeWithOffset) result end
An overridden version of `Time#gmtime` that clears the associated {TimezoneOffset}.
@return [TimeWithOffset] `self`.
# File lib/tzinfo/time_with_offset.rb, line 69 def gmtime super @timezone_offset = nil self end
An overridden version of `Time#localtime` that clears the associated {TimezoneOffset}.
@return [TimeWithOffset] `self`.
# File lib/tzinfo/time_with_offset.rb, line 79 def localtime(*args) super @timezone_offset = nil self end
An overridden version of `Time#round` that, if there is an associated {TimezoneOffset}, returns a {TimeWithOffset} preserving that offset.
@return [Time] the rounded time.
# File lib/tzinfo/time_with_offset.rb, line 89 def round(ndigits = 0) if_timezone_offset(super) {|o,t| self.class.at(t.to_i, t.subsec * 1_000_000).set_timezone_offset(o) } end
Marks this {TimeWithOffset} as a local time with the UTC offset of a given {TimezoneOffset} and sets the associated {TimezoneOffset}.
@param timezone_offset
[TimezoneOffset] the {TimezoneOffset} to use to set
the offset of this {TimeWithOffset}.
@return [TimeWithOffset] `self`. @raise [ArgumentError] if `timezone_offset` is `nil`.
# File lib/tzinfo/time_with_offset.rb, line 30 def set_timezone_offset(timezone_offset) raise ArgumentError, 'timezone_offset must be specified' unless timezone_offset localtime(timezone_offset.observed_utc_offset) @timezone_offset = timezone_offset self end
An overridden version of `Time#to_a`. The `isdst` (index 8) and `zone` (index 9) elements of the array are set according to the associated {TimezoneOffset}.
@return [Array] an `Array` representation of the {TimeWithOffset}.
# File lib/tzinfo/time_with_offset.rb, line 98 def to_a if_timezone_offset(super) do |o,a| a[8] = o.dst? a[9] = o.abbreviation a end end
An overridden version of `Time#to_datetime` that, if there is an associated {TimezoneOffset}, returns a {DateTimeWithOffset} with that offset.
@return [DateTime] if there is an associated {TimezoneOffset}, a
{DateTimeWithOffset} representation of this {TimeWithOffset}, otherwise a `Time` representation.
# File lib/tzinfo/time_with_offset.rb, line 135 def to_datetime if_timezone_offset(super) do |o,dt| offset = dt.offset result = DateTimeWithOffset.jd(dt.jd + dt.day_fraction - offset) result = result.new_offset(offset) unless offset == 0 result.set_timezone_offset(o) end end
An overridden version of `Time#utc` that clears the associated {TimezoneOffset}.
@return [TimeWithOffset] `self`.
# File lib/tzinfo/time_with_offset.rb, line 110 def utc super @timezone_offset = nil self end
An overridden version of `Time#zone` that, if there is an associated {TimezoneOffset}, returns the {TimezoneOffset#abbreviation abbreviation} of that offset.
@return [String] the {TimezoneOffset#abbreviation abbreviation} of the
associated {TimezoneOffset}, or the result from `Time#zone` if there is no such offset.
# File lib/tzinfo/time_with_offset.rb, line 123 def zone to = timezone_offset to ? to.abbreviation : super end
Protected Instance Methods
Clears the associated {TimezoneOffset}.
@return [TimeWithOffset] `self`.
# File lib/tzinfo/time_with_offset.rb, line 149 def clear_timezone_offset @timezone_offset = nil self end


Setup
ProgramThis tutorial describes how to write a program that registers an
activation descriptor for a remote object with the
Java Remote Method Invocation
(Java RMI) activation system daemon (rmid
) and then
binds a stub for that remote object in an rmiregistry
so that clients can look it up.
This tutorial has the following steps:
The files needed for this tutorial are:Setup.java
- main
Setup
programsetup.policy
-
security policy file for the Setup
programrmid.policy
-
security policy file for rmid
group.policy
-
security policy file for the activation groupSetup
programThe Setup
program, implemented by the class
examples.activation.Setup
, registers an activation
descriptor with rmid
to enable future activation of
the object specified by that activation descriptor. This program
does not create an instance of a remote object, but instead
registers a remote object's stub with an rmiregistry
so that clients can look it up. This Setup
program
must be run prior to running any of the clients described in the
other activation tutorials.
The Setup
program uses a number of system
properties to customize the information that is registered with
rmid
and rmiregistry
. The program also
takes a single command-line argument that specifies the
package-qualified name of the implementation class for the
activatable remote object being registered. The Setup
program is run as follows:
java -cp classpath \ -Djava.security.policy=setup.policy \ -Djava.rmi.server.codebase=codebase \ -Dexamples.activation.setup.codebase=setupCodebase \ -Dexamples.activation.impl.codebase=implCodebase \ -Dexamples.activation.name=name \ [-Dexamples.activation.file=filename] \ [-Dexamples.activation.policy=group.policy] \ examples.activation.Setup implClass
where:
Setup
program and the implementation classesSetup
programSetup
program class (used in granting permissions to
the Setup
program in the setup.policy
file)group.policy
), andThe following is an example policy file for the
Setup
program:
grant codeBase "${examples.activation.setup.codebase}" { // permissions to read system properties required by setup program permission java.util.PropertyPermission "examples.activation.impl.codebase","read"; permission java.util.PropertyPermission "examples.activation.policy","read"; permission java.util.PropertyPermission "examples.activation.file","read"; permission java.util.PropertyPermission "examples.activation.name","read"; // permission to connect to the activation system and the registry permission java.net.SocketPermission "*:1098-1099","connect"; };
The codebase to which permissions are granted is a URL
specifying the location of the Setup
program's
implementation class(es). This URL is the value of the
examples.activation.setup.codebase
system property,
which is defined when the Setup
program is run. The
Setup
program needs the following permissions:
java.util.PropertyPermission
- to read various
system properties required by the Setup
programjava.net.SocketPermission
- to connect to the
activation system (port 1098
) to register an
activation descriptor, and to connect to the registry (port
1099
) to bind the activatable object's stub to a
nameThere are several steps to writing this Setup
program:
rmiregistry
The Setup
class has a static main
method that performs all of the above steps. But before doing so,
the main
method sets a SecurityManager
and obtains the single command line argument that specifies the
package-qualified name of the implementation class for the
activatable remote object. The rest of the steps are described
below. See Setup.java
for
the full source code.
Before an application registers information about a particular
activatable remote object, it first needs to register information
about the activation group that the object will be
contained in. An activation group is a container virtual
machine (VM) for a set of activatable objects. Each activation
group manages the execution of one or more activatable objects. An
activation group descriptor contains information that the
activation system needs to start an activation group's VM. An
application can register an activation group descriptor with the
activation system rmid
to obtain an activation group
ID to use for the activatable object, or the application can use an
activation group ID obtained from a previous group
registration.
The activation group descriptor, an instance of the class
java.rmi.activation.ActivationGroupDesc
, can be
constructed in several ways. This tutorial uses the two parameter
constructor
ActivationGroupDesc(Properties,CommandEnvironment)
.
The Properties
map contains overrides for system
properties in the activation group VM. For this tutorial, an
activation group VM needs the following system properties
defined:
java.security.policy
- the group's security policy
filejava.class.path
- a dummy class path to prevent an
activation group from loading implementation classes from the local
class pathexamples.activation.impl.codebase
- the location
of the implementation classes, which the group's policy file uses
to grant permissions toexamples.activation.file
- a file containg the
object's persistent stateThe java.security.policy
property is specified by
the examples.activation.policy
system property, and
defaults to the file named group.policy
which will, in
practice, be in the working directory where rmid
is
run. The java.class.path
property is defined as
no_classpath
. The
examples.activation.impl.codebase
and
examples.activation.file
properties are specified by
their current values (respectively), defined when the
Setup
program runs.
The group descriptor is constructed as follows:
String policy = System.getProperty("examples.activation.policy", "group.policy"); String implCodebase = System.getProperty("examples.activation.impl.codebase"); String filename = System.getProperty("examples.activation.file", ""); Properties props = new Properties(); props.put("java.security.policy", policy); props.put("java.class.path", "no_classpath"); props.put("examples.activation.impl.codebase", implCodebase); if (filename != null && !filename.equals("")) { props.put("examples.activation.file", filename); } ActivationGroupDesc groupDesc = new ActivationGroupDesc(props, null);
The following is an example group.policy
file that
grants the appropriate permissions for the activation examples:
grant codeBase "${examples.activation.impl.codebase}" { // permission to read and write object's file permission java.io.FilePermission "${examples.activation.file}","read,write"; // permission to listen on an anonymous port permission java.net.SocketPermission "*:1024-","accept"; };
The codebase to which permissions are granted is a URL
specifying the location of the activatable object's implementation
classes. This URL is the value of the
examples.activation.impl.codebase
system property,
which will be defined in the activation group's VM. An activatable
object in the group needs two permissions:
java.io.FilePermission
- to read and write the
file containing the activatable object's persistent statejava.net.SocketPermission
- to export the
activatable object to accept connections an anonymous portSetup
program must register the activation
group descriptor with the activation system to obtain the group's
ID, an instance of the class
java.rmi.activation.ActivationGroupID
. The class
java.rmi.activation.ActivationGroup
has a static
method getSystem
for obtaining the stub for the
activation system. The Setup
program calls the
activation system's remote method registerGroup
,
passing the group descriptor created above, to register the
activation group:
ActivationGroupID groupID = ActivationGroup.getSystem().registerGroup(groupDesc);
Once the activation group ID is obtained, the Setup
program can register the activation descriptor. The activation
descriptor has four basic pieces of information:
In this example, the activation group ID is the one obtained
above; the implementation's class name is the class name,
implClass, supplied as the command-line
argument to the Setup
program; the location (URL) is
specified by the system property
examples.activation.impl.codebase
; and, the
initialization data (which is optional) is a filename specified by
the system property examples.activation.file
.
The activation descriptor is constructed as follows:
MarshalledObject data = null; if (filename != null && !filename.equals("")) { data = new MarshalledObject(filename); } ActivationDesc desc = new ActivationDesc(groupID, implClass, implCodebase, data);
Next, the Setup
program must register the
activation descriptor with the activation system. The class
Activatable
has a static convenience method,
register
, that registers an activation descriptor with
the activation system and returns a stub for the activatable object
specified by the descriptor.
Remote stub = Activatable.register(desc);
Note: The register
method attempts
to load a stub class for the implementation class in order to
create a stub instance. If
the register
method is unable to load a pregenerated
stub class, it will use an instance of a dynamically-generated
proxy class that implements all the interfaces of the
implementation class. In the latter case the register
method needs load the implementation class in order to
determine the remote interfaces that the implementation class
implements. So, the register
method has a slight
behavioral difference, depending on whether a pregenerated or
dynamically-generated stub class is used.
rmiregistry
Finally, the remote object's stub is bound to a name in the
registry running on the default port of 1099
. The name
is specified by the system property
examples.activation.name
.
String name = System.getProperty("examples.activation.name"); LocateRegistry.getRegistry().rebind(name, stub);
The source file for this example can be compiled as follows:
javac -d setupDir Setup.javawhere setupDir is the root destination directory to put the class files in.
rmid
,
rmiregistry
, and the Setup
programTo run this the Setup
program, you will need to do
the following:
rmid
To start rmid
, run the rmid
command on
the server's host. This command should produce no output if it is
run with a security policy file as specified below. For more
information, see the tools documentation for rmid
[Solaris, Linux, or Mac OS X, Windows].
For example, in the Solaris Operating System:
rmid -J-Djava.security.policy=rmid.policy \ -J-Dexamples.activation.policy=group.policy &
Or, on Windows platforms:
start rmid -J-Djava.security.policy=rmid.policy \ -J-Dexamples.activation.policy=group.policy
where:
rmid
rmid
's policy fileThe security policy file for rmid
grants
permissions for rmid
to execute specific commands and
to use specific command-line options in starting activation group
VMs. For example, a user might grant specific permissions to start
an activation group VM with one or more system properties or other
java
command-line options. This example allows
rmid
to start activation group VMs that define the
system properties java.security.policy
,
java.class.path
,
examples.activation.impl.codebase
, and
examples.activation.file
. The following example
security policy file grants permission to start an activation group
VM with these specific properties defined:
grant { // allow activation groups to use certain system properties permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.security.policy=${examples.activation.policy}"; permission com.sun.rmi.rmid.ExecOptionPermission "-Djava.class.path=no_classpath"; permission com.sun.rmi.rmid.ExecOptionPermission "-Dexamples.activation.impl.codebase=*"; permission com.sun.rmi.rmid.ExecOptionPermission "-Dexamples.activation.file=*"; };
The first ExecOptionPermission
permission grant
restricts the java.security.policy
system property to
be the file specified by the system property
examples.activation.policy
, defined when
rmid
is run. The next permission grant allows a group
to define the system property java.class.path
as
no_classpath
, a dummy class path that prevents the
group from having a valid class path. The next permission grant
allows the group to define the system property
examples.activation.impl.codebase
to be any value. The
final permission grant allows the
examples.activation.file
system property to be any
value.
rmiregistry
To start the registry, run the rmiregistry
command
on the server's host. This command produces no output (when
successful) and is typically run in the background. For more
information, see the tools documentation for
rmiregistry
[Solaris, Linux, or Mac OS X, Windows].
For example, in the Solaris Operating System:
rmiregistry &
Or, on Windows platforms:
start rmiregistry
By default, the registry runs on TCP port 1099. To start a registry on a different port, specify the port number from the command line. For example, to start the registry on port 2001 on a Windows platform:
start rmiregistry 2001
Note: Make sure that rmiregistry
does not
have any implementation classes in its class path to prevent it
from loading any classes from its local class path.
If the registry will be running on a port other than 1099,
you'll need to specify the port number in the calls to
LocateRegistry.getRegistry
in the Setup
program, as well as any clients that access this registry. For
example, if the registry is running on port 2001 in this example,
the call to getRegistry
would be:
Registry registry = LocateRegistry.getRegistry(2001);
Also note that if you use a registry port other than
1099
, you will also need to modify the
Setup
and client program's policy files to grant
permission to connect to the registry's port.
Setup
programTo start the Setup
program, run the
Setup
class using the java
command as
follows:
java -cp setupDir:implDir \ -Djava.security.policy=setup.policy \ -Djava.rmi.server.codebase=codebase \ -Dexamples.activation.setup.codebase=setupCodebase \ -Dexamples.activation.impl.codebase=implCodebase \ -Dexamples.activation.name=name \ [-Dexamples.activation.file=file] \ [-Dexamples.activation.policy=group.policy] \ examples.activation.Setup implClass
where:
Setup
program's classSetup
programSetup
program class (used in granting permissions to
the Setup
program in the setup.policy
file)data
in the object's activation descriptor (no
default)group.policy
), andNote: If you use file URLs for any of the codebases listed above, make sure that each file URL has a trailing slash, or the codebase will be invalid.
The output from the Setup
program should look like
this:
Activation group descriptor registered. Activation descriptor registered. Stub bound in registry.


---
layout: post
title: Storyboards helicopter
date: '2017-10-05T11:30:37+02:00'
categories:
- Storyboards
- Mon Ket
picture_url: https://film-Storyboards.tumblr.com/post/166079152998/Storyboards-helicopter
---
- hélicoptère
- Bruxelles
- feature film Storyboards
- Robinson R44


Permission is hereby granted to any person or organization obtaining a copy of Goosechase software (the “Software”) to run the Software on their computer[s] and to publish without restriction any output produced by the Software, including screenshots. This license prohibits you from copying, publishing, and/or distributing source code in either original or modified form. This license prohibits you from making the Software available for public use, commercial or non-commercial, in either original or modified form. This license prohibits you from claiming ownership or authorship of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR SOFTWARE AUTHORS BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OR OTHER LIABILITY ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2019 Goosechase – All rights reserved.


Jurgen Klopp's dressing room message to Liverpool before Barcelona comeback
Liverpool boss Jurgen Klopp's words before his side stunned Barcelona have been revealed by attacker Sadio Mane
by Rich Jones, https://www.mirror.co.uk/authors/rich-jones/Liverpool enjoyed one of the finest moments in their history when they stunned Barcelona en route to Champions League glory last season.
Few gave the Reds a prayer as they entered the second leg at Anfield 3-0 down and staring at a semi-final exit.
Yet they performed a miraculous comeback to shock the Catalan giants, snatching a 4-3 aggregate win before lifting their sixth European crown against Tottenham in Madrid.
Striker Sadio Mane has now revealed exactly what Jurgen Klopp told his side immediately before they stepped out onto the Anfield pitch on a historic night.
And he claims Klopp predicted his side would perform the unthinkable to secure their spot in the final.
Speaking to France Football , Mane recalled: "He always knows what to say and even then, he finds a way to surprise you.
"Like last season before the second leg against FC Barcelona in the Champions League semi-finals. He said: 'Hey guys, I've got some good news for you.'
"'The good news is that Barcelona is a team that likes to play and we love playing against those (types of) teams. You'll see. We're going to reach the final.'
"It really was the best way to take the pressure off us."
In the same interview, Mane explained the "secret' behind Klopp's successful command of the Anfield dressing room - being a father figure to his players.
The Senegalese striker said: “His secret, I think, is to be the team’s dad. Between us, everything clicked straight away.
"We all love him like a father and we fear him like one too.
"He takes up a lot of space in my life, and not just in football. He’s great as a person.
"I trust him blindly, like most of the dressing room, I think.”


public static class NotificationCompat.Builder
extends java.lang.Object
NotificationCompat
objects. Allows easier control over
all the flags, as well as help constructing the typical notification layouts.
On platform versions that don't offer expanded notifications, methods that depend on expanded notifications have no effect.
For example, action buttons won't appear on platforms prior to Android 4.1. Action buttons depend on expanded notifications, which are only available in Android 4.1 and later.
For this reason, you should always ensure that UI controls in a notification are also
available in an android.app.Activity
in your app, and you should always start that
android.app.Activity
when users click the notification. To do this, use the
setContentIntent()
method.
| Constructor and Description |
|---|
NotificationCompat.Builder(Context context)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
NotificationCompat.Builder |
addAction(int icon,
java.lang.CharSequence title,
PendingIntent intent)
Add an action to this notification.
|
NotificationCompat.Builder |
addAction(NotificationCompat.Action action)
Add an action to this notification.
|
NotificationCompat.Builder |
addExtras(Bundle extras)
Merge additional metadata into this notification.
|
Notification |
build()
Combine all of the options that have been set and return a new
Notification
object. |
NotificationCompat.Builder |
extend(NotificationCompat.Extender extender)
Apply an extender to this notification builder.
|
Bundle |
getExtras()
Get the current metadata Bundle used by this notification Builder.
|
Notification |
getNotification()
Deprecated.
Use
build() instead. |
NotificationCompat.Builder |
setAutoCancel(boolean autoCancel)
Setting this flag will make it so the notification is automatically
canceled when the user clicks it in the panel.
|
NotificationCompat.Builder |
setContent(RemoteViews views)
Supply a custom RemoteViews to use instead of the standard one.
|
NotificationCompat.Builder |
setContentInfo(java.lang.CharSequence info)
Set the large text at the right-hand side of the notification.
|
NotificationCompat.Builder |
setContentIntent(PendingIntent intent)
Supply a
PendingIntent to send when the notification is clicked. |
NotificationCompat.Builder |
setContentText(java.lang.CharSequence text)
Set the text (second row) of the notification, in a standard notification.
|
NotificationCompat.Builder |
setContentTitle(java.lang.CharSequence title)
Set the title (first row) of the notification, in a standard notification.
|
NotificationCompat.Builder |
setDefaults(int defaults)
Set the default notification options that will be used.
|
NotificationCompat.Builder |
setDeleteIntent(PendingIntent intent)
Supply a
PendingIntent to send when the notification is cleared by the user
directly from the notification panel. |
NotificationCompat.Builder |
setExtras(Bundle extras)
Set metadata for this notification.
|
NotificationCompat.Builder |
setFullScreenIntent(PendingIntent intent,
boolean highPriority)
An intent to launch instead of posting the notification to the status bar.
|
NotificationCompat.Builder |
setGroup(java.lang.String groupKey)
Set this notification to be part of a group of notifications sharing the same key.
|
NotificationCompat.Builder |
setGroupSummary(boolean isGroupSummary)
Set this notification to be the group summary for a group of notifications.
|
NotificationCompat.Builder |
setLargeIcon(Bitmap icon)
Set the large icon that is shown in the ticker and notification.
|
NotificationCompat.Builder |
setLights(int argb,
int onMs,
int offMs)
Set the argb value that you would like the LED on the device to blnk, as well as the
rate.
|
NotificationCompat.Builder |
setLocalOnly(boolean b)
Set whether or not this notification is only relevant to the current device.
|
NotificationCompat.Builder |
setNumber(int number)
Set the large number at the right-hand side of the notification.
|
NotificationCompat.Builder |
setOngoing(boolean ongoing)
Set whether this is an ongoing notification.
|
NotificationCompat.Builder |
setOnlyAlertOnce(boolean onlyAlertOnce)
Set this flag if you would only like the sound, vibrate
and ticker to be played if the notification is not already showing.
|
NotificationCompat.Builder |
setPriority(int pri)
Set the relative priority for this notification.
|
NotificationCompat.Builder |
setProgress(int max,
int progress,
boolean indeterminate)
Set the progress this notification represents, which may be
represented as a
android.widget.ProgressBar . |
NotificationCompat.Builder |
setSmallIcon(int icon)
Set the small icon to use in the notification layouts.
|
NotificationCompat.Builder |
setSmallIcon(int icon,
int level)
A variant of
setSmallIcon(int) that takes an additional
level parameter for when the icon is a LevelListDrawable . |
NotificationCompat.Builder |
setSortKey(java.lang.String sortKey)
Set a sort key that orders this notification among other notifications from the
same package.
|
NotificationCompat.Builder |
setSound(Uri sound)
Set the sound to play.
|
NotificationCompat.Builder |
setSound(Uri sound,
int streamType)
Set the sound to play.
|
NotificationCompat.Builder |
setStyle(NotificationCompat.Style style)
Add a rich notification style to be applied at build time.
|
NotificationCompat.Builder |
setSubText(java.lang.CharSequence text)
Set the third line of text in the platform notification template.
|
NotificationCompat.Builder |
setTicker(java.lang.CharSequence tickerText)
Set the text that is displayed in the status bar when the notification first
arrives.
|
NotificationCompat.Builder |
setTicker(java.lang.CharSequence tickerText,
RemoteViews views)
Set the text that is displayed in the status bar when the notification first
arrives, and also a RemoteViews object that may be displayed instead on some
devices.
|
NotificationCompat.Builder |
setUsesChronometer(boolean b)
Show the
Notification#when field as a stopwatch. |
NotificationCompat.Builder |
setVibrate(long[] pattern)
Set the vibration pattern to use.
|
NotificationCompat.Builder |
setWhen(long when)
Set the time that the event occurred.
|
public NotificationCompat.Builder(Context context)
System.currentTimeMillis()
and the audio stream to the
Notification#STREAM_DEFAULT
.context
- A Context
that will be used to construct the
RemoteViews. The Context will not be held past the lifetime of this
Builder object.public NotificationCompat.Builder setWhen(long when)
public NotificationCompat.Builder setUsesChronometer(boolean b)
Notification#when
field as a stopwatch.
Instead of presenting when
as a timestamp, the notification will show an
automatically updating display of the minutes and seconds since when
.
Useful when showing an elapsed time (like an ongoing phone call).android.widget.Chronometer
,
Notification#when
public NotificationCompat.Builder setSmallIcon(int icon)
icon
- A resource ID in the application's package of the drawble to use.public NotificationCompat.Builder setSmallIcon(int icon, int level)
setSmallIcon(int)
that takes an additional
level parameter for when the icon is a LevelListDrawable
.icon
- A resource ID in the application's package of the drawble to use.level
- The level to use for the icon.android.graphics.drawable.LevelListDrawable
public NotificationCompat.Builder setContentTitle(java.lang.CharSequence title)
public NotificationCompat.Builder setContentText(java.lang.CharSequence text)
public NotificationCompat.Builder setSubText(java.lang.CharSequence text)
setProgress(int, int, boolean)
;
they occupy the same location in the standard template.
public NotificationCompat.Builder setNumber(int number)
public NotificationCompat.Builder setContentInfo(java.lang.CharSequence info)
public NotificationCompat.Builder setProgress(int max, int progress, boolean indeterminate)
android.widget.ProgressBar
.public NotificationCompat.Builder setContent(RemoteViews views)
public NotificationCompat.Builder setContentIntent(PendingIntent intent)
PendingIntent
to send when the notification is clicked.
If you do not supply an intent, you can now add PendingIntents to individual
views to be launched when clicked by calling RemoteViews.setOnClickPendingIntent(int,PendingIntent)
. Be sure to
read Notification.contentIntent
for
how to correctly use this.public NotificationCompat.Builder setDeleteIntent(PendingIntent intent)
PendingIntent
to send when the notification is cleared by the user
directly from the notification panel. For example, this intent is sent when the user
clicks the "Clear all" button, or the individual "X" buttons on notifications. This
intent is not sent when the application calls
NotificationManager.cancel(int)
.public NotificationCompat.Builder setFullScreenIntent(PendingIntent intent, boolean highPriority)
intent
- The pending intent to launch.highPriority
- Passing true will cause this notification to be sent
even if other notifications are suppressed.public NotificationCompat.Builder setTicker(java.lang.CharSequence tickerText)
public NotificationCompat.Builder setTicker(java.lang.CharSequence tickerText, RemoteViews views)
public NotificationCompat.Builder setLargeIcon(Bitmap icon)
public NotificationCompat.Builder setSound(Uri sound)
public NotificationCompat.Builder setSound(Uri sound, int streamType)
Notification#STREAM_DEFAULT
,
for the STREAM_
constants.
public NotificationCompat.Builder setVibrate(long[] pattern)
for a discussion of the pattern
parameter.
public NotificationCompat.Builder setLights(int argb, int onMs, int offMs)
public NotificationCompat.Builder setOngoing(boolean ongoing)
Ongoing notifications differ from regular notifications in the following ways:
public NotificationCompat.Builder setOnlyAlertOnce(boolean onlyAlertOnce)
public NotificationCompat.Builder setAutoCancel(boolean autoCancel)
setDeleteIntent(PendingIntent)
will be broadcast when the notification
is canceled.public NotificationCompat.Builder setLocalOnly(boolean b)
Some notifications can be bridged to other devices for remote display. This hint can be set to recommend this notification not be bridged.
public NotificationCompat.Builder setDefaults(int defaults)
The value should be one or more of the following fields combined with
bitwise-or:
Notification#DEFAULT_SOUND
, Notification#DEFAULT_VIBRATE
,
Notification#DEFAULT_LIGHTS
.
For all default values, use Notification#DEFAULT_ALL
.
public NotificationCompat.Builder setPriority(int pri)
pri
- Relative priority for this notification. Must be one of
the priority constants defined by NotificationCompat
.
Acceptable values range from NotificationCompat.PRIORITY_MIN
(-2) to NotificationCompat.PRIORITY_MAX
(2).public NotificationCompat.Builder setGroup(java.lang.String groupKey)
To make this notification the summary for its group, also call
setGroupSummary(boolean)
. A sort order can be specified for group members by using
setSortKey(java.lang.String)
.
groupKey
- The group key of the group.public NotificationCompat.Builder setGroupSummary(boolean isGroupSummary)
setGroup(java.lang.String)
.isGroupSummary
- Whether this notification should be a group summary.public NotificationCompat.Builder setSortKey(java.lang.String sortKey)
This sort key can also be used to order members of a notification group. See
setGroup(java.lang.String)
.
String.compareTo(String)
public NotificationCompat.Builder addExtras(Bundle extras)
Values within the Bundle will replace existing extras values in this Builder.
Notification#extras
public NotificationCompat.Builder setExtras(Bundle extras)
A reference to the Bundle is held for the lifetime of this Builder, and the Bundle's
current contents are copied into the Notification each time build()
is
called.
Replaces any existing extras values with those from the provided Bundle.
Use addExtras(Bundle)
to merge in metadata instead.
Notification#extras
public Bundle getExtras()
The returned Bundle is shared with this Builder.
The current contents of this Bundle are copied into the Notification each time
build()
is called.
Notification#extras
public NotificationCompat.Builder addAction(int icon, java.lang.CharSequence title, PendingIntent intent)
android.app.Activity
that starts when a user
clicks the notification (see setContentIntent()
), and then
enhance the notification by implementing the same functionality with
addAction()
.icon
- Resource ID of a drawable that represents the action.title
- Text describing the action.intent
- android.app.PendingIntent
to be fired when the action is invoked.public NotificationCompat.Builder addAction(NotificationCompat.Action action)
android.app.Activity
that starts when a user
clicks the notification (see setContentIntent()
), and then
enhance the notification by implementing the same functionality with
addAction()
.action
- The action to add.public NotificationCompat.Builder setStyle(NotificationCompat.Style style)
style
- Object responsible for modifying the notification style.public NotificationCompat.Builder extend(NotificationCompat.Extender extender)
@Deprecated public Notification getNotification()
build()
instead.public Notification build()
Notification
object.


Extending METAL macros
metal:extend-macro
Attribute syntax
metal:extend-macro="EXPRESSION"
Remarks
Only valid when defined on the same element as a
metal:define-macro
attribute is present.
This attribute indicates that the current macro definition ("the extension") extends the macro referenced by the
EXPRESSION ("the extended macro").
The meaning of extension is as follows:
-
The extension may optionally provide any number of elements decorated with
metal:fill-slot
attributes. These fill slots in the extended macro, as if the extension was decorated withmetal:use-macro
. - Any slots defined upon the extended macro which are not filled by the extension will remain available for filling when the extended macro is used.
-
Within
fill-slot
attributes, the extension may optionally provide new slots of its own viametal:define-slot
attributes - just as if thefill-slot
attribute upon the extension were adefine-macro
attribute. If the extension defines a slot of the same name as the slot it has filled, then when the macro is used, both the extension's markup and the slot-filling markup from the macro usage will be combined.
Software developers may think of this process as being akin to 'subclassing' the extended macro. The net effect is that the extension functions as the extended macro, except that it may provide content for the extended macro's slots, and may additionally define new slots of its own, or modify/override the manner in which some of the extended macro's slots are filled.
Macro-extension example
The following example shows a macro for an 'image box' widget. It may be used as-is, or using the extended version, which adds copyright information to that widget.

Description goes here

Description goes here

Image copyright:
Copyright holder

This is the real image description

Joseph Bloggs

This is the real image description

Image copyright:
Joseph Bloggs


| cbreaks {scales} | R Documentation |
This function wraps up the components needed to go from a continuous range to a set of breaks and labels suitable for display on axes or legends.
cbreaks(range, breaks = extended_breaks(), labels = scientific_format())
range |
numeric vector of length 2 giving the range of the underlying data |
breaks |
either a vector of break values, or a break function that will make a vector of breaks when given the range of the data |
labels |
either a vector of labels (character vector or list of expression) or a format function that will make a vector of labels when called with a vector of breaks. Labels can only be specified manually if breaks are - it is extremely dangerous to supply labels if you don't know what the breaks will be. |
cbreaks(c(0, 100)) cbreaks(c(0, 100), breaks_pretty(3)) cbreaks(c(0, 100), breaks_pretty(10)) cbreaks(c(1, 100), log_breaks()) cbreaks(c(1, 1e4), log_breaks()) cbreaks(c(0, 100), labels = math_format()) cbreaks(c(0, 1), labels = percent_format()) cbreaks(c(0, 1e6), labels = comma_format()) cbreaks(c(0, 1e6), labels = dollar_format()) cbreaks(c(0, 30), labels = dollar_format()) # You can also specify them manually: cbreaks(c(0, 100), breaks = c(15, 20, 80)) cbreaks(c(0, 100), breaks = c(15, 20, 80), labels = c(1.5, 2.0, 8.0)) cbreaks(c(0, 100), breaks = c(15, 20, 80), labels = expression(alpha, beta, gamma))


Hong Kong campus protesters defy surrender warnings as over 1,000 arrested in 24 hours
by AFPby Yan Zhao / Catherine Lai
Dozens of exhausted pro-democracy protesters occupying a Hong Kong university defied warnings to surrender Tuesday on the third day of a stand-off with police, as China sent fresh signals that its patience with nearly six months of unrest was running out.
Fearing arrest or being shot at by police, a dwindling number of protesters remained huddled inside Hong Kong Polytechnic University (PolyU) as night fell.
The siege at PolyU began Sunday with many hundreds of protesters occupying the campus as part of a broader campaign of massive disruption across Hong Kong that began last week.
The ensuing confrontation turned into the most intense and prolonged of Hong Kong’s pro-democracy crisis, which has seen millions take to the streets since June to voice anger at China’s erosion of the territory’s freedoms.
During the siege, protesters had repelled police surges with a barrage of Molotov cocktails, arrows and bricks. Police in response threatened to use live rounds.
Some protesters escaped overnight on Monday by shinning down ropes from a footbridge to a road, where they were whisked away on motorbikes.
Others disappeared into manholes to try to probe the drainage system for a route out.
In an apparently co-ordinated effort to distract police, tens of thousands of people streamed towards the PolyU campus on Monday night as clashes simultaneously raged with police in nearby Kowloon district.
New phase of violence
Footage on Monday showed armoured police beating fallen protesters with batons as they lay on the ground.
One officer was filmed stamping on the head of a man who was already subdued.
Alleged police brutality is one of the central complaints of the protest movement. Senior officers insist their men are acting proportionately.
In her first public comments on the PolyU crisis, Hong Kong chief executive Carrie Lam said surrender was the only way to achieve a peaceful outcome.
“This objective could only be achieved with the full cooperation of the protesters, including of course the rioters.
“They have to stop violence, give up the weapons and come out peacefully and take the instructions from the police,” she said.
Lam said children who surrendered would not be arrested, though protesters aged over 18 would face charges of rioting.
About 1,000 people had been arrested throughout Hong Kong over the previous 24 hours, Chief Superintendent Kwok Ka-chuen said on Tuesday afternoon.
This was roughly a fifth of all arrests since the unrest began in June.
Kwok said those arrested included some who had abseiled from the footbridge, as well as motorcyclists who helped them.
And in an apparent contradiction of Lam, Kwok insisted everyone would feel the force of the law.
“No excuse, no political demand or motive can spare anyone from legal liability,” he said.
“Regardless of their age and causes, they are to face the consequences of their own actions.”
Determination
With police custody their best option, some inside PolyU were determined to fight on.
“Even if we surrender they will still put us to jail. It seems we have two options, but actually we only have one… which is jail,” one of the protesters, a mechanical engineering student who gave his name as Matthew, told AFP inside the campus.
But their numbers were dwindling. AFP reporters on site estimated up to 100 remained by late afternoon.
The new phase of mass disruption, which began last week, has caused chaos throughout the international financial hub, with schools closed, train lines disrupted and major roads blocked by barricades.
With the crisis deepening, China’s ambassador to Britain upped the ante on Monday.
“If the situation becomes uncontrollable, the central government would certainly not sit on our hands and watch,” Liu Xiaoming said. “We have enough resolution and power to end the unrest.”
In another ominous signal, China insisted Tuesday it had sole authority to rule on constitutional matters in Hong Kong, which it rules under a special model giving the city greater freedoms than enjoyed on the mainland.
The warning came as it condemned a decision by the city’s high court on Monday to overturn a ban on face masks worn by pro-democracy protesters.
Only China’s parliament has the right to rule on Hong Kong’s Basic Law — the city’s mini-constitution, parliament spokesman Zang Tiewei said.
“No other institution has the right to make judgements or decisions,” he said.
A mainland scholar who requested anonymity to speak freely about such a sensitive subject said while the parliament had the right to take away what it gave, the timing of the announcement was ill-advised.
“Such a statement would gravely affect people’s views on the principle of ‘One Country, Two System’.”
Carrie Lam has repeatedly insisted that her unpopular police force can contain the unrest, and said Tuesday there was currently no need for the People’s Liberation Army to intervene.
Protests started in June as a peaceful condemnation of a now-shelved China extradition bill.
They morphed into a broader movement to defend the city’s unique freedoms, which were meant to be enshrined in the Basic Law when Hong Kong was handed over by Britain in 1997.
Hong Kong Free Press relies on direct reader support. Help safeguard independent journalism and press freedom as we invest more in freelancers, overtime, safety gear & insurance during this summer’s protests. 10 ways to support us.


pydrake.systems.planar_scenegraph_visualizer¶
-
pydrake.systems.planar_scenegraph_visualizer.
ConnectPlanarSceneGraphVisualizer
(builder, scene_graph, output_port=None, **kwargs)¶ Creates an instance of PlanarSceneGraphVisualizer, adds it to the diagram, and wires the scene_graph pose bundle output port to the input port of the visualizer. Provides an interface comparable to ConnectDrakeVisualizer.
Parameters: - builder – The diagram builder used to construct the Diagram.
- scene_graph – The SceneGraph in builder containing the geometry to be visualized.
- output_port – (optional) If not None, then output_port will be connected to the visualizer input port instead of the scene_graph. get_pose_bundle_output_port(). This is required, for instance, when the SceneGraph is inside a Diagram, and we must connect the exposed port to the visualizer instead of the original SceneGraph port.
- kwargs are passed through to the PlanarSceneGraphVisualizer (Additional) –
- constructor. –
Returns: The newly created PlanarSceneGraphVisualizer object.
-
class
pydrake.systems.planar_scenegraph_visualizer.
PlanarSceneGraphVisualizer
(scene_graph, draw_period=0.03333333333333333, T_VW=array([[ 1., 0., 0., 0.], [ 0., 0., 1., 0.], [ 0., 0., 0., 1.]]), xlim=[-1.0, 1], ylim=[-1, 1], facecolor=[1, 1, 1], use_random_colors=False, substitute_collocated_mesh_files=True, ax=None, show=None)¶ Bases:
pydrake.systems.pyplot_visualizer.PyPlotVisualizer
Given a SceneGraph and a view plane, provides a view of the robot by projecting all geometry onto the view plane.
This is intended to be used for robots that operate in the plane, but should render any robot approximately correctly. It has the following caveats: - z-ordering of objects is done based on the object centroid, which is not perfect for non-planar scenes. - Object geometry is projected onto the view plane, then a chull is taken, and finally that chull is drawn as a patch. Nonconvex geometry will thus be drawn incorrectly, and geometry with many vertices will slow down the visualizer.
Specifics on view setup:T_VW specifies the 3x4 view projection matrix. For planar orthographic projection, use: [ <x axis select> x_axis_shift
- <y axis select> y_axis_shift
- 0, 0, 0, 1] % homogenizer
e.g.
- [ 1 0 0 0.5
- 0 1 0 0 0 0 0 1].
would give a top-down view (i.e squashing the z axis), and would shift things in the x axis positively by 0.5.
T_VW can be any valid view projection matrix. If the bottom row is [0, 0, 0, 1], the view projection will be an orthographic projection.
xlim and ylim don’t technically provide extra functionality, but it’s easier to keep handling scaling with xlim, ylim, and view plane selection and maybe offsetting with the projection matrix.
-
__init__
(scene_graph, draw_period=0.03333333333333333, T_VW=array([[ 1., 0., 0., 0.], [ 0., 0., 1., 0.], [ 0., 0., 0., 1.]]), xlim=[-1.0, 1], ylim=[-1, 1], facecolor=[1, 1, 1], use_random_colors=False, substitute_collocated_mesh_files=True, ax=None, show=None)¶ Parameters: - scene_graph – A SceneGraph object.
- draw_period – The rate at which this class publishes to the visualizer.
- T_VW – The view projection matrix from world to view coordinates.
- xlim – View limit into the scene.
- ylim – View limit into the scene.
- facecolor – Passed through to figure() and sets background color. Both color name strings and RGB triplets are allowed. Defaults to white.
- use_random_colors – If set to True, will render each body with a different color. (Multiple visual elements on the same body will be the same color.)
- substitute_collocated_mesh_files – If True, then a mesh file specified with an unsupported filename extension may be replaced by a file of the same base name in the same directory, but with a supported filename extension. Currently only .obj files are supported.
- ax – If supplied, the visualizer will draw onto those axes instead of creating a new set of axes. The visualizer will still change the view range and figure size of those axes.
- show – Opens a window during initialization / publish iff True. Default is None, which implies show=True unless matplotlib.get_backend() is ‘template’.
-
draw
(context)¶ Overrides base with the implementation.


Created by Sam Marland / Dónal Spring
DevOps | Tech Lead | Agile
Fullstack JS | DevOps | Agile
This presentation is running on this laptop
It's Reveal.js and Node
We're going to create an app on Bluemix and
create a DevOps pipeline to build, test
and deploy this app
All of this will happen when any developer pushes
to the master branch
Platform as a service
VMs in the cloud
Containers
(Docker)
Access to services
(Databases, Analytics, Security, etc)
(NodeRED)
Free to start
Quick
Very flexible
Can scale
Easy to use & public facing
I don't want to have to worry about setting up infrastructure
Management console allows control users / access
Samples and templates to bootstrap dev
Services make my app extensible
Bluemix Local
Bridges the Gaps
(Communication, Collaboration & Integration)
Build > Test > Deploy
Create pipelines quickly
Easily push code to Bluemix
Integration with GitHub, Slack and Saucelabs
Failed Build over night
Devs are competitive!
Philips Hue Bulbs
Linux Container
Light weight, shippable & scalable
Package all the things!
(code, runtime, system tools, system libraries)
Caching and layers
(security | root)
FROM node:4.4
RUN mkdir -p devops-site
COPY dist devops-site/
WORKDIR devops-site
RUN npm install --production
ENV NODE_ENV production
EXPOSE 5000
CMD node index.js
The docker registry hosts images and sample Dockerfile
docker build -t node-app .
docker run -d -p 8080:5000 --name my-node-container node-app
Manage cluster of containers
Horizontal scaling and automatic rollover
Different API, CLI and YAML file format
Use of the docker CLI
Uses Dockerfiles
Uses docker cli
Docker API to make a cluster of machines look like a single Docker API
Full VMs
Consistent build of virtualised environment
Lots of providers: VMWare, VirtualBox...
Environment as code
Dockerised Adobe Experience Manager and Salesforce
DevOps at scale across multiple teams and geographys
DevOps Services & Bluemix at Vodafone
Inflexible
Unmaintainable
3 months to make a change
7 different environments
10,000+ builds
1,000,000+ test
100+ production deploys
Code fix to production in 5 hours
DevOps Technical Training Workshop
(with Tim, Donal, Sam, Will)


{% extends "../template.html" %} {% block title %}New password{% endblock %} {% block main %} {% if alert %}
There were some errors in the information you entered. Please correct the following:


People are speaking out.
Across the state, people have spoken out against HB2. In this video, protestors shut down the main streets in downtown Chapel Hill during rush hour. The demonstration lasted from 6 p.m. to nearly 10:30 p.m. No arrests were made.


Thank you for considering me as a tutor! I am truly grateful for being given the opportunity to be a tutor, and as such, I aim to provide the best experience possible.
If this is your first time receiving tutoring from me, I normally have a short introduction meeting with parents in order to ensure that I am able to deliver the best support possible. Please send me an email or use the form below to schedule a quick meeting with me.
If you have already received tutoring from me before and would just like to schedule another tutoring session, feel free to request for as much time as you would like and you can pay me based on the rate that we have previously agreed on. To schedule a meeting, you can email me or use the form below. If you would like to request a session longer than one hour, please schedule two, back-to-back, sessions.
My hourly prices are negotiable, so feel free to bring up a price that you are comfortable with during our preliminary meeting. You can choose to pay in cash when we meet in person, or through PayPal (please use personal payments).


WITNESS LIST Civil Practices Committee May 15, 2003-8:00A HCR 163 For: Pels, David J. (Shannon, Gracey, Ratliff & Miller, LLP; Thomas Potthoff and Town Talk Foods, Inc.) Potthoff, Thomas (Self) HCR 223 For: Chapman, Jeff (Lloyd, Gosselink, Blevins, Rochelle, Baldwin, & Townsend P.C.) Crawford, R.C. (Self) Guerrero-McDonald, Mary (Self) Nelson, Larry (Self) Against: Biscoe, Sam (Self and Travis County Commissioners Court) SB 407 For: Bizzell, Lynn (Texas Fire Chiefs Assoc.) SB 930 For: Hollingsworth, Jr., Lonnie F. (Texas Classroom Teachers Ass'n) Pore, David (Assoc. of Texas Professional Educators) Against: Crawford, R.C. (Self) SB 1601 On: O'Neill, Harriet (Self and Texas Access to Justice Commission)


I have a keen interest in the emergence of order, not within the study objects of a specific discipline but as a general topic. Eventually, I would like to answer the classic question: «Why is there something rather than nothing?».
There is a fine line between ambitious theorising and crackpot ideas. The ambition I have in approaching this topic is certainly well within the danger zone. I am starting small and hoping to begin by discovering small improvements; departing neither from the bold goal nor from the contact of reality.
My preferred starting point is to focus on simple code-based experiments (e.g. Per Bak’s avalanches or critical brain, Stuart Kauffman’s NK models or random boolean networks, John Holland’s signals/boundaries modes come to mind). Reproducing them using clean and open source code serves multiple purposes at once: to develop intuition about the models in order to inspire new ones, to enable tinkerable science such that curious people with relatively elementary coding skills may explore new avenues, and to spread these notions to a greater number by embedding implementations of these models directly in Web documents explaining them.
As an example, the application below embeds a simple implementation of the Bak–Tang–Wiesenfeld model of sandpile avalanches, alongside a log-log graph plotting the distribution of avalanche sizes as grains of sand are dropped on the table. On its own it does not add that much (and repainting each grain as it changes makes it too slow to study any larger system). It can, however, easily be modified to run outside the browser, or to study other aspects of the system such as the distribution of the times that grains spend on the table before falling off one side. The same core code can be used for both research and outreach.
{{#include bak/app.html}}My hope is, to put it in Leibniz’s words, that «by this means there is obtained as great variety as possible, along with the greatest possible order; that is to say, it is the way to get as much perfection as possible.» •


Two bodies found at home in Surrey, B.C., one is homicide victim: Investigators
SURREY, B.C. - Homicide detectives say they're investigating after two people were found dead inside a home in Surrey, B.C.
RCMP officers discovered the bodies when they arrived at the home Thursday evening, then called the Integrated Homicide Investigation Team to lead the probe.
Const. Harrison Mohr with the investigation team says early evidence suggests one of the dead was the victim of a homicide.
He says the two people knew one another and police are not looking for any outstanding suspects.
The RCMP did not release the names of the dead.


Build your legacy with
Generative Learning
Contact
Leadership
Development
• Executive coaching
• Leadership training
• Implementing a change
Team
Development
• Team coaching
• Team development training
• Team assessment tools
Coaching
• Cognitive coaching training
• Personalized coaching
• Coaching assessment tools
our services
Grow your school or organization
with our expert services
Strategic
Foresight
• Developing stakeholder teams
• Establishing strategic directions
• Assessing impact
Board
Development
• Board chair coaching
• Board development training
• Setting strategic directions
Training
Seminars & More!
• Program evaluation
• Assessing impact tools
• PLC training
Generative Learning...
provides leaders with powerful new lenses for seeing and influencing
organizational culture toward greater robustness, adaptivity and
resiliency. Generative Learning provides you with the maps and tools for
unleashing individual and collective creativity in bringing to
light new possibilities for action and growth in your organization.


Brutal warning by Mexican cartel sent to rivals in bloody drug war
WARNING - GRAPHIC IMAGES: The Jalisco New Generation Cartel (CJNG) sent horrifying pictures of dismembered corpses to Los Viagras, The Michoacan Family, and the Knights Templar as a threat
by Tom Davidson, https://www.mirror.co.uk/authors/tom-davidson/A brutal Mexican cartel sent horrifying images to their rivals as a warning.
The Jalisco New Generation Cartel (CJNG) posted the pictures on social media as part of a threat against Los Viagras, The Michoacan Family, and the Knights Templar.
The four cartels are currently battling for control over the state of Michoacan in western Mexico.

In another, a cartel member holds up a decapitated head with a leg below it.
One video shows CJNG killers firing guns from an armoured vehicle.
It was shared with the message: “We don’t even feel tickles from Los Viagras and Los Templarios.

“Don’t be b******s, don’t tell them that they disappeared.
“B******s do not send children to fight, they are cannon fodder, there are 100 of you Viagras and Templarios against 20 CJNG but you don’t do anything.”

The video was reportedly recorded in an area known as Tierra Caliente by the CJNG lieutenant Miguel Fernandez.
Last night, it emerged that a police officer who had arrested the son of El Chapo was shot more than 100 times in what appeared to be an assassination.
Authorities were later forced to release Guzman to avoid further bloodshed.
Parts of Mexico continue to be gripped by a deadly drug war in


nugridpy.data_plot¶
data_plot.py
SuperClass module for the YProfile and Table Classes. It contains numerous plot function for the YProfile and Table Classes.
If one in the future wants their class to inherit this superclasses methods this is what is required:
- Place
from data_table import *
at the top of the module. - If the class is defined like ‘class MyClass:’, change that to ‘class MyClass(DataTable):’
- To properly use DataTable’s methods properly one will need these methods: a get(atri) that returns a numpy array of Data, or a list of numpy arrays of data. The arguments of this function would need to be atri which is the name of the data one is looking for.
Functions
flux_chart (file_name, plotaxis, plot_type[, …]) |
Plots a chart with fluxes |
Classes
DataPlot |
-
nugridpy.data_plot.
flux_chart
(file_name, plotaxis, plot_type, which_flux=None, I_am_the_target=None, prange=None)¶ Plots a chart with fluxes
Parameters: - file_name (string) – Name of the file of fluxes we are looking at.
- plotaxis (list) – [xmin, xmax, ymin, ymax], where on x axis there is neutron number and on y axis there is Z.
- plot_types (integer) – Set to 0 for standard flux plot. Set to 1 if fluxes focused on one specie.
- which_flux (integer, optional) – Set to 0 for nucleosynthesis flux plot. Set to 1 is for energy flux plot. Seting to None is the same a 0. The default is None.
- I_am_the_target (list, optional) – A 2xArray used only if plot_type=1, and is given by [neutron number, proton number]. The default is None.
- prange (integer, optional) – The range of fluxes to be considered. If prange is None, then 8 fluxes are consdered. The default is None.
Notes
This script is terribly slow and needs to be improved. For now I put here in data_plot:
[1]: import data_plot
- [2]: data_plot.flux_chart(‘file_name’, [xmin, xmax, ymin, ymax],
- int, which_flux, I_am_the_target, prange)
The pdf is created, but an error bumped up and the gui is empty. To avoid this, I had to set ‘text.usetex’: False. See below. Also, for the same reason no label in x axys is written using ‘text.usetex’: True.
Note also that the GUI works really slow with this plot. So, we need to optimize from the graphic point of view. This need to be included in ppn.py I think, and set in multi option too, in case we want to read more flux files at the same time.
Finally, you need to have stable.dat to read in to make it work …


2 Chronicles 7:6
And the priests waited on their offices: the Levites also with instruments of music of the LORD, which David the king had made to praise the LORD, because his mercy endureth for ever, when David praised by their ministry; and the priests sounded trumpets before them, and all Israel stood.


We've emailed you instructions for setting your password. You should receive the email shortly.
If you haven't received it after a few minutes, please check your spam folder and ensure that you've typed your email correctly
If you still haven't received the email after these checks, please contact the system admin


DADCo is a biofeedback startup working in conjunction with Rochester Institute of Technology's Innovation Center. We seek to bring Electromyography (EMG) into the mainstream consumer marketplace by creating a diverse line of electrode-integrated smart devices and accessories. We believe that our products will revolutionize the wearable technology industry by creating a new way for users to interact with technology and potentially help thousands of people.
DADCo forsee's a multitude of useful applications for consumer EMG products. Some of these applications include:
To see more visit the learning section!


Hi, I'm Lauren! I am a senior at University of Colorado at Boulder studying computer science and mathematics. I am President of CU Women in Computing, an ACM-W chapter. In my free time you will most likely find me running, skiing, coding, or shopping for anything pink.
CU Women in Computing (CUWIC) is the ACM-W chapter within the Computer Science Department at the University of Colorado at Boulder that is dedicated to supporting women and diversity in computing. We encourage interaction from all who are interested in issues regarding women and diversity in computing to create a forum in which to share information about career, academic, and social opportunities.
Check out our calendar to stay up to date on events!
Feel free to reach out with any questions!
720-985-7180


V. 0.9, correct as of 19.05.2015
Here are things we'll be putting effort into for next releases, in order of priority:
- [ ] Soter algorithms: Adding Chacha20 to cipher suite. Since we need it in a very specific mode, it might involve our own implementation of it.
- [ ] Themis objects: Working on 2 new objects - authentication module and safe credential storage module for anything from SQL to KV storages.
- [ ] Language wrappers: NodeJS, Perl, Rust and Go bindings, evaluating others
- [ ] Platforms: Various flavors of portable and embeddable Linuxes support
- [ ] Platforms: Checking against more conservative UNIX flavours (*BSD)
- [ ] Documentation: Bi-directional examples for both message objects.
- [ ] Documentation: Better examples (with unified cases) and documentation.
- [ ] ObjC wrapper: Document Secure Message Session for ObjC wrapper with acceptable examples
- [ ] ObjC wrapper: ObjC code refactoring - it works, but it ain't no beautiful
- [ ] PHP Wrapper: OOPize wrapper, unify it similarly to other wrappers.
If you're looking for what to contribute, easily pick things which are at the bottom of the list, let us know in the mailing list / raise an issue to make sure there's nobody doing it yet.


{% extends "base_statdev.html" %} {% load crispy_forms_tags %} {% block page_content_inner %}
Click "Confirm" to confirm the request by {{ requester }} for delegate access to {{ organisation.name }}:


{% extends "layout.html" %} {% block body %}
Both data and code for this project are available under permissive licenses.
If you reuse the data or code, please cite our work and contact us so we can add you to the secondary publications list below. :)
{% for publication in documentation %}
{{ publication.authors }}.
{{ publication.title }}.
{{ publication.journal }}
{{ publication.year }}
{% if publication.doi %}
doi: {{ publication.doi }}
{% elif publication.url %}
{{ publication.url }}
{% endif %}
{{ publication.authors }}.
{{ publication.title }}.
{{ publication.journal }}
{{ publication.year }}
{% if publication.doi %}
doi: {{ publication.doi }}
{% elif publication.url %}
{{ publication.url }}
{% endif %}
{{ publication.authors }}.
{{ publication.title }}.
{{ publication.journal }}
{{ publication.year }}
{% if publication.doi %}
doi: {{ publication.doi }}
{% elif publication.url %}
{{ publication.url }}
{% endif %}
We gratefully acknowledge funding for this work through National Science Foundation grants DMR-1307138 and DMR-1501830, and through the John and Claire Bertucci Foundation. Data visualization tool development by B.D., T.F., and E.H.; UHCS microscopy work by M.H., Y.P., and B.W. This work was supported in part by the Commonwealth of Pennsylvania Department of Community and Economic Development (DCED) Developed in PA program (D2PA), and by National Science Foundation grant CMMI-1436064. The as-cast and heat treated UHCS samples were provided by Miller Centrifugal Casting.


Checksum init (any number between 0 and 63)
Stage
1
2
3
4
-
1
2
3
4
Score
Hearts
Mallets
Feathers
Bottles
Barrel
Strength
1
2
3
4
5
Endurance
1
2
3
4
5
Credit Card


The Bus Pirate is an open source hacker multi-tool that talks to electronic stuff, it speaks many protocols, like UART, 1-WIRE, SPI and so on. You can read more about it here [LINK Here].
One day I saw it from a friend and I immediately was amazed by the open source hardware concept. So I decided to build my very own bus pirate instead of purchasing a prebuilt one to both learn and practice.
The first two boards I ordered from dangerous prototype are version 3.8. and then I successfuly built the board by following the link here [LINK Here], you can also come across other guides over the internet, since a lot people have done it.
however, I don't own a PIC programmer. To program the bus pirate v3.6, I built a avr based PIC programmer (ApProg) following this link [LINK Here], I used a spare atmega32 and it successfully burned the bootloader. Then by booting to the bootloader I flashed the complete firmware without problem.
The next step is to initiate a self test before it can be used. The first time the self test did not pass, so I resoldered some of the pins and the second time it passed. Below are the picutres of the bus pirate v3.8.
bus pirate v3.8 front
bus pirate v3.8 back
After the first success, I further purchased a few more blank PCBS to build some and gift them to friends. After a few days the PCB arrived with version 3.6. They are not much different from version 3.8, the main difference is the usb connecter. I actually prefer mini-usb over micro-usb for robustness. below are the pictures of finished boards. Detailed version regarding version 3.6 can be found here [LINK Here].
bus pirate v3.6 front
bus pirate v3.6 back
After the previous experiences, I then decided to build the version 4. This time I ordered about 10 PCB v4e directly from a PCB board manufacture, 11 have arrived. I constructed the board according to the link here [LINK Here]. The final board is shown below.
bus pirate v4.1e front
bus pirate v4.1e back
To program the bus pirate v4, a PICKit 2 is usually prefered, so I built the PICKit 2 on a blank board following several links here [LINK Here] and here [LINK Here]. Other sources can also be found easily. The picutres below shows the board.
PICKit 2 front
PICKit 2 back
However, at this point I still do not have the programmer to program the onboard PIC18F2550 for the PICKit 2, so a parallel port programmer ART2003 programmer is built following the guide here [LINK Here], it also contains the design of the PICKit 2. The picutres below shows the final result.