The first step in computing zonal statistics are the need to compute a weight map that can be used to reallocate the gridded data with respect to the percent overlapping each cell. There are two primary packages that tackle this which include intersectr
(which uses areal
as a back-end) and zonal
which uses exactextractr
.
From the exactextractr
documentation: "_Results from exactextractr
are more accurate than other methods because raster pixels that are partially covered by polygons are considered. The significance of partial coverage increases for polygons that are small or irregularly shaped."
The same premise applies to intersectr
/areal
.
A weight grid is unique to the aggregate units and grid its build from. It contains columns documenting the X and Y indexes of each grid cell along with the grid id. The X,Y are realtive to the entire grid, while the grid ID is relative to subsetwithin the bounding domain of the aggregations unit(s). Additionally the w
stores the percent overlap between the grid cell and the aggregation unit identified by the ID column which is speified in the build
weighting_grid` function. An example is shown below:
Setting up the data for a intersectr
weights map requires (1) computing a vector representation of the grid and (2) intersecting this grid with the aggregation units to determine the percent overlap or “coverage fraction”. Below the workflow from the intersectr
docs is wrapped in a function that requires a NetCDF file path, a sf
geometry set, an ID variable from the geometries, and the variable to extract from the grid.
library(intersectr)
library(ncmeta)
library(RNetCDF)
intersectr_weights = function(file, geom, ID, var){
nc_coord_vars <- nc_coord_var(file)
variable_name <- var
nc_coord_vars <- filter(nc_coord_vars, variable == variable_name)
nc <- open.nc(file)
X_coords <- var.get.nc(nc, nc_coord_vars$X, unpack = TRUE)
Y_coords <- var.get.nc(nc, nc_coord_vars$Y, unpack = TRUE)
nc_prj <- nc_gm_to_prj(nc_grid_mapping_atts(file))
cell_geometry = create_cell_geometry(X_coords = X_coords,
Y_coords = Y_coords,
prj = nc_prj,
geom = geom,
buffer_dist = 0.1, # Degrees
regularize = TRUE)
data_source_cells <- st_sf(dplyr::select(cell_geometry, grid_ids))
target_polygons <- st_sf(dplyr::select(geom, !!ID))
st_agr(data_source_cells) <- "constant"
st_agr(target_polygons) <- "constant"
calculate_area_intersection_weights(
data_source_cells,
target_polygons, allow_lonlat = TRUE)
}
In zonal
grid weights are calculated using exactextractr
as the back-end. The key function is weighting_grid
.
library(zonal)
Here two motivating use cases are shown to compare the efficiency of these approaches. The first covers a large area but has many small aggregation units. The second covers a large area but has a few large polygon aggregation units. Each of these pose a unique set of demands with respect to how the calculation is performed.
The gridded data and aggregate units we are working with can be seen below and downloaded from here:
file = 'pet_2020.nc'
(s = terra::rast(file))
## class : SpatRaster
## dimensions : 585, 1386, 366 (nrow, ncol, nlyr)
## resolution : 0.04167, 0.04167 (x, y)
## extent : -124.8, -67.04, 25.05, 49.42 (xmin, xmax, ymin, ymax)
## coord. ref. : +proj=longlat +datum=WGS84 +no_defs
## source : pet_2020.nc
## varname : potential_evapotranspiration (pet)
## names : poten~43829, poten~43830, poten~43831, poten~43832, poten~43833, poten~43834, ...
## unit : mm, mm, mm, mm, mm, mm, ...
Looking at the grid we can see in consists of 810810 grid cells each with a 0.0417 meter by 0.0417 meter resolution. Additionally, there are 366 unique time slices in the NetCDF file.
Here, we look at an example with ~20,000 watersheds along the east coast.
geom <- st_make_valid(read_sf('hydrofabric.gpkg', "catchments"))
paint(geom)
## sf [18041, 4]
## active geometry column: geom (POLYGON)
## crs: 5070 (NAD83 / Conus Albers)
## crs unit: metre
## ID chr cat-1 cat-2 cat-4 cat-5 cat-6 cat-7
## area_sqkm dbl 12.457576 267.083595 8.319214 9.278138 60.577~
## toID chr nex-2 nex-3 nex-5 nex-6 nex-7 nex-8
## geom sfc POLY 2,024B POLY 9,064B POLY 1,656B POLY 1,81~
In total we have 18,041 aggregation units to summarize over the 366 time steps.
bnch <- bench::mark(
iterations = 1, check = FALSE, time_unit = "s",
intersectr = intersectr_weights(file, geom, "ID", "potential_evapotranspiration"),
zonal = weighting_grid(s, geom, "ID")
)
Here, we test aggregation the 4km gridded data to 64 counties in Colorado.
colorado = AOI::aoi_get(state = "CO", county = "all")
paint(colorado)
## sf [64, 13]
## active geometry column: geometry (MULTIPOLYGON)
## crs: 4269 (NAD83)
## crs unit: degree
## statefp chr 08 08 08 08 08 08
## countyfp chr 035 095 039 014 037 053
## countyns chr 00198133 00198163 00198136 01945881 0~
## affgeoid chr 0500000US08035 0500000US08095 0500000~
## geoid chr 08035 08095 08039 08014 08037 08053
## name chr Douglas Phillips Elbert Broomfield Ea~
## lsad chr 06 06 06 06 06 06
## aland dbl<PHONE_NUMBER><PHONE_NUMBER><PHONE_NUMBER> 8547~
## awater dbl 6752511<PHONE_NUMBER>48 1411781 1884999~
## state_name chr Colorado Colorado Colorado Colorado C~
## state_abbr chr CO CO CO CO CO CO
## jurisdiction_type chr state state state state state state
## geometry sfc MPOLY 872B MPOLY 824B MPOLY 824B MPOL~
In total we have 64 aggregation units to summarize over the 366 time steps.
bnch2 <- bench::mark(
iterations = 1, check = FALSE, time_unit = "s",
intersectr = intersectr_weights(file, colorado, "name", "potential_evapotranspiration"),
zonal = weighting_grid(file, colorado, "name")
)


{% extends 'everes_core/base.html' %} {% block contents %} {% for trackback in object_list %}
trackbacked from {{ trackback.blog_name}}
{{ trackback.excerpt|striptags|urlize|linebreaksbr }}


Pollution Control Services
Pollution Control Services is an environmental laboratory doing business in South Texas since 1975.
portable water systems.
Our Capabilities
Our experienced team can prepare a final laboratory report with relevant QA/QC information on all
on batches of client samples are available. Summary reports that integrate graphics or require
incorporation of additional information are available for a low fee.
Promoting the Safety and Longevity of Your Reports
We maintain all relevant data generation information on the services and reports we provide to clients
for a maximum of seven years (after which the information will be destroyed and disposed of to
protect your personal records from being exposed). All analytical reports of sample analysis will be
archived on computer tape and stored for as long as reasonably possible beyond the 7-year time frame
.
subscribe here:


DfE enquiries
Central newsdesk 020 7783 8300
General enquiries 0370 000 2288
Press release
Construction gets underway at the first school to be rebuilt under the Priority School Building Programme (PSBP).
Construction will begin today at the first school to be rebuilt under the Priority School Building Programme (PSBP), the Education Funding Agency (EFA) announced.
Whitmore Primary School in Coventry will benefit from a £4.89 million rebuild as part of the government’s £2.4 billion programme.
Contractors from Wates Construction - appointed by the EFA in January this year - arrived on site today and expect to complete the rebuild, ahead of the original schedule, by Easter 2014.
The announcement marks a significant step in the PSBP, the programme to rebuild 261 of the schools in England in the worst condition. Procurement of the work was completed in just 26 weeks.
In total, 261 schools were confirmed in May 2012 to have been successful in their application to the programme, and contractors have been selected for all 8 of the original capital-funded batches.
Wates is also developing the designs for 3 other primary schools, a secondary school and a special school, all of which form part of a £36 million batch of schools in the midlands.
In a ceremony to mark the commencement of work, Peter Lauener, chief executive of the EFA, said:
I am delighted to be able to join students and staff at Whitmore Park at the start of construction works for the first school to be rebuilt as part of the Priority School Building Programme. This promises to be an exciting phase in the school’s development.
We are making excellent progress with this programme, with building works starting across the country in the coming weeks and months as we overhaul the schools with the greatest need and help ensure young people can learn in buildings that are up to scratch.
Caroline Kiely, Executive headteacher at Whitmore Primary School, said:
We are excited that this badly-needed work is beginning on our school. It is really good news for the local community and will mean the children of Whitmore Park will soon have a lovely new school to learn in.
Phil Harrison, Managing Director for Wates Construction, Midlands and North, said:
The start of construction at Whitmore Park is the beginning of a new phase in the delivery of the government’s flagship Priority School Building Programme. The building works are intended to deliver much-needed new facilities in Coventry and we have and will continue to keep very close consultation with both the EFA and Coventry Council to ensure these essential works serve to positively impact the educational experience for the city’s teachers and young people.
Schools included in the midlands batch to be rebuilt by Wates Construction are:
The 8 batches and their contractors are:
The Priority School Building Programme (PSBP) is a centrally managed programme set up to address the condition of the schools most in need of urgent repair. Through the PSBP, 261 schools will be rebuilt or have their condition needs met. The first school will be completed in 2014.
The EFA announced 5 batches of privately-financed schools to be re-built under the PSBP recently.
Since 2010 this government has allocated £2.7 billion to local authorities to support the provision of new school places and £2.8 billion for the maintenance of the school estate to meet the needs of maintained schools and academies. Over the spending review period, the total capital made available for investment in schools in England will be about £18 billion.
Central newsdesk 020 7783 8300
General enquiries 0370 000 2288
Published: 24 May 2013


Writes a character to the wrapped TextWriter
Inherited from TextWriter.
public virtual void Write(bool);
Writes a character to the wrapped TextWriter
public override void Write(char);
Inherited from TextWriter.
public virtual void Write(char[]);
Writes a character buffer to the wrapped TextWriter
public override void Write(char[],int,int);
Inherited from TextWriter.
public virtual void Write(decimal);
Inherited from TextWriter.
public virtual void Write(double);
Inherited from TextWriter.
public virtual void Write(int);
Inherited from TextWriter.
public virtual void Write(long);
Inherited from TextWriter.
public virtual void Write(object);
Inherited from TextWriter.
public virtual void Write(float);
Writes a string to the wrapped TextWriter
public override void Write(string);
Inherited from TextWriter.
public virtual void Write(string,object);
Inherited from TextWriter.
public virtual void Write(string,object,object);
Inherited from TextWriter.
public virtual void Write(string,object,object,object);
Inherited from TextWriter.
public virtual void Write(string,params object[]);
Inherited from TextWriter.
public virtual void Write(uint);
Inherited from TextWriter.
public virtual void Write(ulong);
TextWriterAdapter Class | log4net.Util Namespace


DROP PROCEDURE
Drops a procedure. To drop a procedure, both the procedure name and input argument data types (signature), are required. Optionally, you can include the full argument data types, including OUT arguments.
Syntax
DROP PROCEDURE sp_name ( [ [ argname ] [ argmode ] argtype [, ...] ] )
Parameters
- sp_name
-
The name of the procedure to be removed.
- argname
-
The name of an input argument. DROP PROCEDURE ignores argument names, because only the argument data types are needed to determine the procedure's identity.
- argmode
-
The mode of an argument, which can be IN, OUT, or INOUT. OUT arguments are optional because they aren't used to identify a stored procedure.
- argtype
-
The data type of the input argument. For a list of the supported data types, see Data Types.
Examples
The following example drops a stored procedure named
quarterly_revenue
.
DROP PROCEDURE quarterly_revenue(volume INOUT bigint, at_price IN numeric,result OUT int);


| stargazer_summary_stat_code_list {stargazer} | R Documentation |
The following character strings can be used in the summary.stat
and omit.summary.stat
arguments of the stargazer
command.
"max" | maximum |
"mean" | mean |
"median" | median |
"min" | minimum |
"n" | number of observations |
"p25" | 25th percentile |
"p75" | 75th percentile |
"sd" | standard deviation |


Hello,
I am a {{gender}} writing from {{from}} and located in {{country}}. I'd like to propose you a talk entitled {{subject}}.
It could be done as {{format}} and is basically talking about:
> {{message}}
Hello,
I am a female writing from<EMAIL_ADDRESS>and located in uk. I'd like to propose you a talk entitled Men come from Venus, really.
It could be done as keynote,lt and is basically talking about:
> Have some viagra for you people.


ScriptExecutions
This page shows the previous and on-going script executions. The script may have been triggered in various ways:
- Web - User initiated script execution
- Trigger - A trigger release may initiate a script execution.
- Syslog Event - A syslog event may initiate a script execution.
- Job - If job is of SHELL type, it will initiate a script execution.
- Shell - User initiated script execution by use of setexecution command (instead of call command)
You can identify from which source the script is initiated by looking at the Request-ID of the execution. This field is rather "open",
so some IDs refer to one specific script executions, while others refers to executions of a generic type (like all executions stemming
from one particular Syslog Event).
Initiate execution from Web
Web allows you to pick a file of SHELL_SCRIPT type and execute it. You may also click on the + sign after the
arguments input field, to get input-help to the script.


Job Searching Tool
Administrator
Job Websites
Job Keywords
Job List
General Users
Enterprise Users
Refresh Data
Job Searching
Start
Stop
Status
Information


let {logger} = require("./library/logger");
let TorController = require("./library/torController");
let Parser = require("./parser");
let mmm = require("mmmagic");
let magic = new mmm.Magic(mmm.MAGIC_MIME);
const ProxyAgent = require("proxy-agent");
/**
* Indicate the maximal number of slots available
*/
let _maxSlots = parseInt(process.env.NETWORK_MAX_CONNECTIONS, 10);
if (isNaN(_maxSlots)) {
_maxSlots = 50;
}
module.exports.MAX_SLOTS = _maxSlots;
/**
* Indicate the minimal size of the pool holding pending download tasks.
* Can be set by setting the NETWORK_MIN_POOL_SIZE environment variable.
*/
let _minPool = parseInt(process.env.NETWORK_MIN_POOL_SIZE, 10);
// Note: Ordering of the if clause is important here!
if (isNaN(_minPool) || _minPool <= 0) {
_minPool = 1000; // Fallback value: this way we can make 10 rounds
// of requests with the MAX_SLOTS default value
}
module.exports.MIN_POOL_SIZE = _minPool;
/**
* Indicate the maximal size of the pool holding pending download tasks.
* Can be set by setting the NETWORK_MAX_POOL_SIZE environment variable.
*/
let _maxPool = parseInt(process.env.NETWORK_MAX_POOL_SIZE, 10);
// Note: Ordering of the if clause is important here!
if (isNaN(_maxPool) || _maxPool <= 0) {
_maxPool = 2000;
}
module.exports.MAX_POOL_SIZE = _maxPool;
module.exports.buildInstance = async function(socksPort) {
let torController = await TorController.buildInstance(
socksPort,
60000 /* timeout - please adapt according to the needed steps */
);
// await torController.createTorPool().catch((err) => {
// console.error("Error while creating Tor pool.");
// console.error(err.stack);
// console.error(err);
// // Exit with error - we cannot work without Tor
// process.exit(1);
// });
// await torController.createTorInstances(
// module.exports.MAX_SLOTS /* numOfInstances */
// ).catch((err) => {
// console.error("Error while creating Tor instances.");
// console.error(err.stack);
// console.error(err);
// // Cannot work if no Tor instances are running
// process.exit(1);
// });
// await torController.createSocksServer(socksPort).catch((err) => {
// console.error("Error while initiating socksServer.");
// console.error(err.stack);
// console.error(err);
// // We do try to proceed, since it is very probable, that we hit
// // the timeout if the process is already running. Otherwise, we
// // will just fail subsequently
// });
return new Network(socksPort, torController);
};
/**
* This module handels all the requests to the tor network.
* It ensures, that we do not have too many parallel requests open
* as this might be detected as a DoS attack by a target.
* It provides functionality to download data and further initially
* process that data, such that it can be used for extracting and
* storing information.
*/
class Network {
/**
* Initialize the downloader class
* @constructor
* @param {number} socksPort -- The proxy port for the tor network.
* @param {Object} torController - The torController controls all the tor
* instances and can be used to instantiate,
* kill or rotate IPs of instances.
*/
constructor(socksPort, torController) {
logger.info("Initialize Network");
this.socksPort = socksPort;
this.ttl = 60100; // Max ttl for Tor: 60s + 100 ms for processing
this.availableSlots = module.exports.MAX_SLOTS;
this.proxyUri = "socks://" + process.env.TOR_HOST
+ ":" + this.socksPort;
// Naming according to the timing information the chrome dev
// tools provide. This means:
// * waiting = TTFB, in our case: The request has been sent, but we
// wait for a response.
// * queued = There were already 6 connections to the same host,
// therefor the request was placed in a queue to be downloaded
// when the previous download has been finished.
this.waitingRequestPerHost = {};
this.queuedRequestsByHost = {};
this.maxSimultaneousRequestsPerHost = 4;
// The pool contains a selection of DbResults to be downloaded.
this.pool = [];
this.torController = torController;
this.parser = new Parser();
/* eslint-disable no-useless-escape */
// Note: linter says that some of the escapes are unnecessary, however
// when the regex is compiled without them, it produces not the same
// behaving regex
this.mimeTypeWhitelist = new RegExp(
"\\b(?:text|application)\/.{3,\}\\b",
"i"
);
/* eslint-enable no-useless-escape */
// Those arrays are bound in size by the number of concurrently allowed
// requests. (e.g. MAX_SLOTS)
this.waitingForSlot = [];
this.waitingForData = [];
logger.info("Network initialized");
}
/**
* Download a single webpage and handle the events around it.
* @param {DbResult} dbResult - Contains the DB result to be downloaded
* @return {NetworkHandlerResponse} Return the downloaded and parsed
* result
*/
async download(dbResult) {
let response = {};
if (this.waitingRequestPerHost[dbResult.baseUrlId] == undefined) {
this.waitingRequestPerHost[dbResult.baseUrlId] = 0;
}
this.waitingRequestPerHost[dbResult.baseUrlId] += 1;
let subdomain = ((dbResult.subdomain == null) ?
"" : dbResult.subdomain);
let url = subdomain + dbResult.url;
if (url.length == 0) {
console.error("url is empty for " + JSON.stringify(dbResult));
response = {
"url": url,
"path": dbResult.path,
"body": "",
"statusCode": -1,
"mimeType": "[ NO CONTENT TYPE HEADER PROVIDED ]",
"startTime": 0,
};
logger.error("Tried to construct empty url.");
logger.error("This should never happen - returning early");
// Note that this has never happened in a real life example.
// This once happened in a testcase, why we inserted this, since
// a more resilient structure is always good. We want to keep
// running as long as possible. Error output however is important
// to detect errors in the program itself.
} else {
response = await this.get(
url,
dbResult.path,
dbResult.secure
);
}
this.waitingRequestPerHost[dbResult.baseUrlId] -= 1;
if (this.waitingRequestPerHost[dbResult.baseUrlId] == 0) {
// We need to delete this, otherwise we store in memory
// all the scraped Hosts -- OOM is an issue here
delete this.waitingRequestPerHost[dbResult.url];
}
this.freeUpSlot();
return response;
}
/**
* As soon as a entry is available from the pool, one will be returned
* upon request.
* @return {Promise} Return a DbResult entry from the pool, as soont as one
* is available.
*/
async getPoolEntry() {
logger.debug("Current pool size: " + this.pool.length);
return new Promise((resolve, reject) => {
for (let host in this.queuedRequestsByHost) {
// We cannot yet use this entry, since either more than six
// requests are pending, the array was not yet initialized or
// does not contain any entries yet.
// In that case, check the next entry
if (
(this.waitingRequestPerHost[host]
>= this.maxSimultaneousRequestsPerHost ||
this.queuedRequestsByHost[host] == undefined) ||
this.queuedRequestsByHost[host].length == 0
) {
continue;
}
let queuedRequest = this.queuedRequestsByHost[host].pop();
if (this.queuedRequestsByHost[host].length == 0) {
// Needed, otherwise we store all hosts in memory
// after a scrape -- OOM is an issue here
delete this.queuedRequestsByHost[host];
}
resolve(queuedRequest);
return;
}
if (this.pool.length > 0) {
resolve(this.pool.shift());
return;
}
let pos = this.waitingForData.push(() => {
resolve(this.pool.shift());
return;
});
setTimeout(() => {
this.waitingForData[pos] = null;
reject("getPoolEntry timed out");
return;
}, 4*this.ttl);
// 4*:
// spider -> remote host
// remote host -> spider
// spider -> db
// db -> spider
});
}
/**
* Reserve a slot for a request. This is necessary to ensure a maximal
* number of parallel requests.
* @return {Promise} Return nothing, but return only if a slot is available.
*/
async getSlot() {
return new Promise((resolve, reject) => {
// Resolve immediately, if a slot is available
if (this.availableSlots > 0) {
this.availableSlots--;
logger.info("Slot resolved");
resolve();
return;
}
// Wait, if not
let pos = this.waitingForSlot.push(() => {
// At this point we know that a slot is available
this.availableSlots--;
logger.info("Slot resolved");
resolve();
return;
});
setTimeout(() => {
this.waitingForSlot[pos] = null;
reject("getSlot timed out");
return;
}, 2*this.ttl);
// 2*
// spider -> remote host
// remote host -> spider
});
}
/**
* Free up a slot and notify the appropriate functions
*/
freeUpSlot() {
logger.info("Free up network slot");
this.availableSlots++;
let callback = null;
// If the callback was set to null, the request already timed out and
// we do not have to handle this, just skip it for now
while (callback == null && this.waitingForSlot.length > 0) {
callback = this.waitingForSlot.pop();
}
if (callback == null) {
return;
}
callback();
}
/**
* Add new data entries to the pool and notify the appropriate functions
* @param {Array.<DbResult>} newData - Contains new pool data to be
* downloaded
*/
addDataToPool(newData) {
this.pool.push(...newData);
logger.debug("Added data to pool. Current size: " + this.pool.length);
let callback = null;
let maxNumOfDownloadersToCall = newData.length;
// We get smaller in any iteration: the waitingForData gets smaller in
// every iteration, maxNumOfDownloads in some
while (
this.waitingForData.length > 0 && maxNumOfDownloadersToCall > 0
) {
callback = this.waitingForData.shift();
if (callback != null) {
callback();
maxNumOfDownloadersToCall -= 1;
}
}
}
/**
* @typedef NetworkHandlerResponse - Only contains valid responses
* @type {object}
* @property {!string} url - The url of the returned request.
* @property {!string} path - Th path of the returned request.
* @property {?string} body - The body of a response.
* @property {!number} statusCode - The HTTP status code of a response.
* @property {?string} mimeType - The MIME Type of a response.
* @property {!number} startTime - The timestamp when the response started.
* @property {!number} endTime - The timestamp when the response ended.
*/
/**
* Make a get request to the specified host and path
*
* Eventual url parameters are currently contained within the path
* @param {string} url - This is the hosts url
* @param {string} path - This is the path to the document
* @param {boolean} secure - Indicate whether to use http or https
* @return {NetworkHandlerResponse} Contains all information needed from the
* response @type{NetworkHandlerResponse}.
*/
async get(url, path, secure) {
logger.info("[GET] " + url + path);
// For more information about uclibc bug, please refer to
// https://github.com/nodejs/node/issues/5436
// Here the fix, but not available on all systems:
// http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?
// id=3c1457161e5206c2d576ab25d350a139511c096d
/* eslint-disable max-len */
let headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0",
"Accept-Language": "en-US,en;q=0.5",
"Accept": "*/*",
"Accept-Encoding": "identity",
"Connection": "keep-alive",
};
/* eslint-enable max-len */
let request = {
method: "GET",
hostname: url,
path: encodeURI(path),
agent: new ProxyAgent(this.proxyUri),
headers: headers,
};
let startTime = (new Date).getTime();
let response = await this.getAsync(
request,
secure,
this.ttl
).catch(
(err) => {
if (!err) {
logger.error(
"HTTP GET request for url " + url + " failed with\n"
+ " Unknown Error"
);
return {
"statusCode": -1,
"headers": {
"content-type": null,
},
};
}
logger.error(
"HTTP GET request for url " + url + " failed with err\n\"" +
err.toString() + "\""
);
logger.error(err.stack);
return {
"statusCode": -1,
"headers": {
"content-type": null,
},
};
}
);
/** @type {NetworkHandlerResponse} */
let result = await this.responseHandler(response, url, path, startTime)
.catch((err) => {
logger.error(err.error);
return err.result;
});
return result;
}
/**
* Initiate the request specified by the settings object.
* @param {object} settingsObj - Settings object according to nodejs docu.
* @param {boolean} secure - Indicate whether to use http or https.
* @param {number} ttl Maximum time in ms that a request is allowed to live
* @return {Promise} Returns a promise object, resolves to a response object
*/
async getAsync(settingsObj, secure, ttl) {
logger.silly(
"getAsync for "
+ JSON.stringify(settingsObj)
);
let lib = null;
if (secure) {
lib = require("follow-redirects").https;
} else {
lib = require("follow-redirects").http;
}
return new Promise((resolve, reject) => {
let request = lib.get(settingsObj, (response) => {
resolve(response);
return;
});
request.on("error", (err) => {
reject(err);
return;
});
setTimeout(() => {
reject(
"promiseNetwork request "
+ settingsObj.hostname
+ settingsObj.path
+ " timed out"
);
return;
}, ttl);
});
}
/**
* Handle the response of a get request to a unknown resource.
* @param {object} response - The response object from getAsync
* @param {string} url - The url to which the request was made
* @param {string} path - The path to which the request was made
* @param {number} startTime - Timestamp when the request was started
* @return {NetworkHandlerResponse} result - Contains
* a) The body of the response
* b) The returned status code
* c) MIME type of the response
*/
async responseHandler(response, url, path, startTime) {
let statusCode = response.statusCode;
logger.silly(
"responseHandler received response for "
+ url
+ path
+ " with status "
+ statusCode
);
/* Based on the content type we can either store or forget the
* downloaded data. E.g. we do not want to store any images, so we
* only make a remark that specified URL returns image data
* instead of html
*/
let contentType = response.headers["content-type"] ||
response.headers["Content-Type"] ||
"[ NO CONTENT TYPE HEADER PROVIDED ]";
/* According to RFC 1341, we are safe using split(";")[0] to extract
* only the mime type part.
* Definition: Content-Type := type "/" subtype *[";" parameter]
* If no ; is contained in the string, it only returns a list with the
* whole string as only child.
*/
let result = {
"url": url,
"path": path,
"body": null,
"statusCode": 200,
"mimeType": contentType.split(";")[0],
"startTime": startTime,
};
// accept 30x as well as 200x --> Those are not errourness messages
// and might also contain new URI's to fetch. To adhere to the standard
// we should also implement an update on 301
if (statusCode < 100 || statusCode >= 400) {
logger.error("Request failed.\n"+
"Status Code: " + statusCode
);
try {
response.consume();
} catch (e) {
logger.info("Tried to consume response - already closed");
}
result.statusCode = statusCode;
result["endTime"] = (new Date).getTime();
} else if (!this.mimeTypeWhitelist.test(
contentType
) && contentType != "[ NO CONTENT TYPE HEADER PROVIDED ]") {
/* For now we only store the textual html or json representation
* of the page. Later on we could extend this to other mime
* types or even simulating a full client. This could be done
* to circumvent any countermeasures from the website itself.
* Further, we then could also see the effects of potential
* scripts, using a screenshot we then could analyse the content
* with an image classifier, compare (Fidalgo et al. 2017)
*/
logger.warn(url + path);
logger.warn("Unsuported MIME Type. \n" +
"Only accept html and json, but received " + contentType
);
try {
response.consume();
} catch (e) {
logger.silly("Tried to consume response - already closed");
}
result["endTime"] = (new Date).getTime();
} else {
response.setEncoding("utf8");
let rawData = "";
response.on("data", (chunk) => {
rawData += chunk;
});
return new Promise(async (resolve, reject) => {
response.on("end", async () => {
result["endTime"] = (new Date).getTime();
// Detect mimeType if not available. If mimeType
// is not on our whitelist, we'll proceed as above
// in the else if case
if (contentType === "[ NO CONTENT TYPE HEADER PROVIDED ]") {
contentType = await this.detectMimeType(
Buffer.from(rawData, "utf8")
).catch(
(err) => {
logger.warn(url + path);
logger.warn("Unable to detect MIME Type.");
logger.warn("Discarding raw data...");
// Actively discarding the data to make sure
// it is not used any further.
// Destroy all references to it by setting it to
// null
// This is important, since when we cannot
// detect the mime type, we cannot ensure that
// we comply with legal restrictions
rawData = null;
return result;
});
if (!this.mimeTypeWhitelist.test(contentType)) {
logger.warn(url + path);
logger.warn("Unsuported MIME Type. \n" +
"Only accept non media content, but received " +
contentType
);
// Actively discarding the data to make sure
// it is not used any further.
// Destroy all references to it by setting it to
// null
rawData = null;
return result;
}
result["mimeType"] = contentType.split(";")[0];
}
try {
let body = this.parser.removeBase64Media(rawData);
result.body = body;
resolve(result);
return;
} catch (e) {
logger.error(
"An error occured whlie reading the data " +
e.message
);
logger.error("Caused by " + url + path);
reject(e);
return;
}
});
let ttl = this.ttl;
setTimeout(function() {
result["endTime"] = (new Date).getTime();
result.statusCode = 500;
reject({
"error": "responseHandler response timed out",
"result": result,
});
return;
}, ttl);
});
}
return new Promise((resolve, reject) => {
resolve(result);
return;
});
}
/**
* Try to detect the mimeType of the input buffer. This is useful
* in cases where no content-type header is not set. This function is
* basically an async wrapper for the callback based detection method
* of mmmagic.
* @param {String|Buffer} inputBuffer The buffer containing the data
* @return {Promise} If the promise will be resolved, the
* return string contains the mimeType.
* If the promise is rejected, we were
* not able to detect the mimeType and
* therefor throw away the data.
*/
async detectMimeType(inputBuffer) {
return new Promise((resolve, reject) => {
magic.detect(inputBuffer, (err, result) => {
if (err != null) {
reject(err);
}
resolve(result);
});
});
}
}
module.exports.Network = Network;


| Interface | Description |
|---|---|
| ConfigureFromTemplateActivity.StringProcessor | |
| ConfigureFromTemplateActivity.TemplateProcessor |
| Class | Description |
|---|---|
| ConfigurationTypeArrayAdapter | |
| ConfigureFromTemplateActivity |
ConfigureFromTemplateActivity allows one to add a configuration to your
robot by instantiating from a list of templates. |
| DeviceInfoAdapter | |
| EditActivity |
EditActivity is a base class that provides support for various configuration
editing activities. |
| EditActivity.DisplayNameAndInteger | |
| EditActivity.DisplayNameAndRequestCode | |
| EditAnalogInputDevicesActivity | |
| EditAnalogOutputDevicesActivity | |
| EditDeviceInterfaceModuleActivity | |
| EditDigitalDevicesActivity | |
| EditDigitalDevicesActivityLynx | |
| EditI2cDevicesActivity |
Created by bob on 2016-10-21.
|
| EditI2cDevicesActivityAbstract<ITEM_T extends DeviceConfiguration> |
EditI2cDevicesActivityAbstract manages a possibly-growable list of I2c devices. |
| EditI2cDevicesActivityLynx |
Created by bob on 2016-10-21.
|
| EditLegacyModuleControllerActivity | |
| EditLegacyMotorControllerActivity |
EditLegacyMotorControllerActivity supports the editing of a legacy (HiTechnic)
motor controller. |
| EditLegacyServoControllerActivity |
EditLegacyServoControllerActivity supports the editing of a legacy (HiTechnic)
servo controller. |
| EditLynxModuleActivity |
EditLynxModuleActivity handles the configuration of the devices in a Lynx module. |
| EditLynxUsbDeviceActivity |
EditUSBDeviceActivity handles the configuration of the modules within a Lynx USB device. |
| EditMatrixControllerActivity | |
| EditMotorControllerActivity | |
| EditMotorListActivity | |
| EditParameters<ITEM_T extends DeviceConfiguration> |
EditParameters are the contents of the Intent bundle that we pass to and
from instances of EditActivity . |
| EditPortListActivity<ITEM_T extends DeviceConfiguration> |
EditPortListActivity is a helper class that assists in managing configuration of
lists of items associated with ports on a controller.
|
| EditPortListCheckboxActivity<ITEM_T extends DeviceConfiguration> |
EditPortListCheckboxActivity provides a template-driven editing of a list of checkboxed list items
|
| EditPortListSpinnerActivity<ITEM_T extends DeviceConfiguration> |
EditPortListSpinnerActivity provides a template-driven editing of a list of spinner list items
|
| EditPWMDevicesActivity | |
| EditServoControllerActivity | |
| EditServoListActivity | |
| EditSwapUsbDevices |
EditSwapUsbDevices provides the means to pick an item from a list of USB controllers
for the purposes of swapping serial-numbers. |
| EditUSBDeviceActivity |
EditUSBDeviceActivity handles the swapping and fixing of USB device configurations |
| EditWebcamActivity | |
| FtcConfigurationActivity | |
| FtcLoadFileActivity |
FtcLoadFileActivity is responsible for managing the list of robot configuration files
on the robot controller phone. |
| FtcNewFileActivity |
FtcNewFileActivity is instantiated when the 'New' configuration button is pressed.
|
| RobotConfigFile |
Metadata for a config file.
|
| RobotConfigFileManager |
A class that helps to manage robot configuration files and stores our list of
resource ids that maps to robot configurations packaged with the apk.
|
| RobotConfigFileManager.ConfigNameCheckResult | |
| RobotConfigMap |
RobotConfigMap represents the loaded and parsed state of an XML robot configuration. |
| RobotConfigResFilter |
RobotConfigResFilter is a ClassFilter that filters for XML
resources which are robot configurations which have a type attribute of the indicated value. |
| USBScanManager |
USBScanManager is responsible for issuing scans of USB devices. |
| Enum | Description |
|---|---|
| RequestCode |
RequestCode centralizes the integer tokens used for connecting child configuration editors
with their parents.
|
| RobotConfigFile.FileLocation |


Gabriel Jesus insists Man City can still land third successive Premier League title
Liverpool's 3-1 win at Anfield on Sunday put Jurgen Klopp's side nine points clear of the reigning Premier League champions
by David Anderson, https://www.mirror.co.uk/authors/david-anderson/Gabriel Jesus claims Manchester City can chase Liverpool down again in the title race.
Jesus insists the battle for the Premier League is far from over, despite Jurgen Klopp’s side’s commanding nine-point advantage over the champions.
City overturned Liverpool ’s seven-point lead at the turn of the year to claim the title by a single point.
They also pipped Liverpool for the Premier League crown in 2014 when Brendan Rodgers’s side were in control with just three games remaining.
Defiant Jesus claims City still have plenty of matches to claw back Liverpool’s lead with over two thirds of the campaign to go.
“There are 26 matches left and that’s a long way out even to think who will win the Premier League,” said the Brazil striker.
“Liverpool are playing really well. They were beaten only once last season, but we will take them on and keep fighting for the title again.
“We will try to do our maximum and we will recover. We know we have the capacity to do this. Obviously, we want to win the championship.”
Jesus has put the title race to one side to focus on Brazil’s friendly against Argentina tonight in Riyadh before they face South Korea in Abu Dhabi on Tuesday.
Neymar is missing with a hamstring injury and Jesus claims working with Sergio Aguero can help him realise his dream of emulating the Paris St Germain star’s 61 goals for Brazil.
“The dream is to follow what he has achieved,” said Jesus, who has 18 goals from his 37 caps.
“But I know I have to work hard in every game, every training session for City and for Brazil, and I know I have to score goals.
“I am also learning at City to do this, working with Sergio. He’s a top player, the record scorer for the club, and I can only learn from him. He scores almost every game.”
Rodri is also upbeat about City and praised Pep Guardiola, claiming the Blues boss has already made him a better player.
City’s record £62.8million signing, who is with Spain for Friday’s Euro 2020 qualifier against Malta in Cadiz, says he is learning so much from him.
“Since the beginning of the season I have added a lot of new knowledge,” said the midfielder.
“It has helped me a lot that he played in the same position as me. He gives me lots of advice on how he sees football.
“I’m growing a lot, not only tactically, but individually in many aspects I wasn’t aware a central midfielder should have, like driving with the ball, which is something that is demanded in the Premier League.
“Obviously other factors than the coach can influence things, but we have the best coach in that sense.”


Be That Girl ,mysterious , dangerous be X.These glasses can be yours with a 1 year guarante. This packet will included 1 X-Glasses & it's charger. Tina Fey said these glasses has a very persize voice command & fast bluetooth connection.If you get it now, you not only will get one day shipping, but also a free extra charger.
Lets get in touch and talk about your next project.


Small Card
Title
Welcome to Desire Code
Click here
Click here
Small Card
Title
Welcome to Desire Code
Click here
Click here
Small Card
Title
Welcome to Desire Code
Click here
Click here
Small Card
Title
Welcome to Desire Code
Click here
Click here
Small Card
Title
Welcome to Desire Code
Click here
Click here
Small Card
Title
Welcome to Desire Code
Click here
Click here
Small Card
Title
Welcome to Desire Code
Click here
Click here
Small Card
Title
Welcome to Desire Code
Click here
Click here


Message
Ask Question
Report a Problem
FAQ
Activity Log
Settings
Account
Change Picture
Change Password
Change Security Question
Logout
People
Home
NOB


Congratulations on reaching the final project of the Robotics Nanodegree!
Previously, you worked on the Semantic Segmentation lab where you built a deep learning network that locates a particular human target within an image. For this project, you will utilize what you implemented and learned from that lab and extend it to train a deep learning model that will allow a simulated quadcopter to follow around the person that it detects!
Most of the code below is similar to the lab with some minor modifications. You can start with your existing solution, and modify and improve upon it to train the best possible model for this task.
You can click on any of the following to quickly jump to that part of this notebook:
We have provided you with a starting dataset for this project. Download instructions can be found in the README for this project's repo. Alternatively, you can collect additional data of your own to improve your model. Check out the "Collecting Data" section in the Project Lesson in the Classroom for more details!
import os
import glob
import sys
import tensorflow as tf
from scipy import misc
import numpy as np
from tensorflow.contrib.keras.python import keras
from tensorflow.contrib.keras.python.keras import layers, models
from tensorflow import image
from utils import scoring_utils
from utils.separable_conv2d import SeparableConv2DKeras, BilinearUpSampling2D
from utils import data_iterator
from utils import plotting_tools
from utils import model_tools
In the Classroom, we discussed the different layers that constitute a fully convolutional network (FCN). The following code will introduce you to the functions that you need to build your semantic segmentation model.
The Encoder for your FCN will essentially require separable convolution layers, due to their advantages as explained in the classroom. The 1x1 convolution layer in the FCN, however, is a regular convolution. Implementations for both are provided below for your use. Each includes batch normalization with the ReLU activation function applied to the layers.
def separable_conv2d_batchnorm(input_layer, filters, strides=1):
output_layer = SeparableConv2DKeras(filters=filters,kernel_size=3, strides=strides,
padding='same', activation='relu')(input_layer)
output_layer = layers.BatchNormalization()(output_layer)
return output_layer
def conv2d_batchnorm(input_layer, filters, kernel_size=3, strides=1):
output_layer = layers.Conv2D(filters=filters, kernel_size=kernel_size, strides=strides,
padding='same', activation='relu')(input_layer)
output_layer = layers.BatchNormalization()(output_layer)
return output_layer
The following helper function implements the bilinear upsampling layer. Upsampling by a factor of 2 is generally recommended, but you can try out different factors as well. Upsampling is used in the decoder block of the FCN.
def bilinear_upsample(input_layer):
output_layer = BilinearUpSampling2D((2,2))(input_layer)
return output_layer
In the following cells, you will build an FCN to train a model to detect and locate the hero target within an image. The steps are:
encoder_block
decoder_block
Create an encoder block that includes a separable convolution layer using the separable_conv2d_batchnorm()
function. The filters
parameter defines the size or depth of the output layer. For example, 32 or 64.
def encoder_block(input_layer, filters, strides):
# TODO Create a separable convolution layer using the separable_conv2d_batchnorm() function.
output_layer = separable_conv2d_batchnorm(input_layer, filters, strides)
return output_layer
The decoder block is comprised of three parts:
def decoder_block(small_ip_layer, large_ip_layer, filters):
# TODO Upsample the small input layer using the bilinear_upsample() function.
layer = bilinear_upsample(small_ip_layer)
# TODO Concatenate the upsampled and large input layers using layers.concatenate
if large_ip_layer is not None:
layer = layers.concatenate([layer, large_ip_layer])
# TODO Add some number of separable convolution layers
layer = separable_conv2d_batchnorm(layer, filters)
output_layer = separable_conv2d_batchnorm(layer, filters)
return output_layer
Now that you have the encoder and decoder blocks ready, go ahead and build your FCN architecture!
There are three steps:
def fcn_model(inputs, num_classes):
# TODO Add Encoder Blocks.
# Remember that with each encoder layer, the depth of your model (the number of filters) increases.
# inputs 160x160x3 -> 160x160x10
encoder_0 = encoder_block(inputs, 10, 1)
# encoder_0 -> encoder_1 80x80x32
encoder_1 = encoder_block(encoder_0, 32, 2)
# encoder_1 -> encoder_2 40x40x100
encoder_2 = encoder_block(encoder_1, 100, 2)
# encoder_2 -> encoder_3 20x20x200
encoder_3 = encoder_block(encoder_2, 200, 2)
# TODO Add 1x1 Convolution layer using conv2d_batchnorm().
# encoder_3 -> encoded 20x20x512
encoded = conv2d_batchnorm(encoder_3, filters=512, kernel_size=1, strides=1)
# upsamp(encoded)+ encoder_2 40x40x(512+100) -> decoder_1 40x40x200
decoder_1 = decoder_block(encoded, encoder_2, 200)
# upsamp(decoder_1)+ encoder_1 80x80x(200+32) -> decoder_2 80x80x100
decoder_2 = decoder_block(decoder_1, encoder_1, 100)
# upsamp(decoder_2)+ encoder_0 160x160x(100+10) -> decoder_3 160x160x32
decoder_3 = decoder_block(decoder_2, encoder_0, 32)
x = decoder_3
# The function returns the output layer of your model. "x" is the final layer obtained from the last decoder_block()
# x 128x128x32 -> 128x128x(num_classes)
return layers.Conv2D(num_classes, 1, activation='softmax', padding='same')(x)
The following cells will use the FCN you created and define an ouput layer based on the size of the processed image and the number of classes recognized. You will define the hyperparameters to compile and train your model.
Please Note: For this project, the helper code in data_iterator.py
will resize the copter images to 160x160x3 to speed up training.
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
image_hw = 160
image_shape = (image_hw, image_hw, 3)
inputs = layers.Input(image_shape)
num_classes = 3
# Call fcn_model()
output_layer = fcn_model(inputs, num_classes)
Define and tune your hyperparameters.
learning_rate = 0.001 # base learning rate ( 10x boosted for 3 episodes, decaying after 10 epochs )
batch_size = 64
num_epochs = 100
steps_per_epoch = 200
validation_steps = 50
workers = 16
def lr_schedule(epoch):
if epoch < 3:
lr = learning_rate * 10 # boost period
else:
lr = learning_rate * np.power(0.975, epoch-10)
lr = np.clip(lr, 1e-4, 1e-3)
print('learning rate:{}'.format(lr))
return lr
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
# Define the Keras model and compile it for training
weight_file_name = 'model_weights'
model = models.Model(inputs=inputs, outputs=output_layer)
model.compile(optimizer=keras.optimizers.Adam(learning_rate), loss='categorical_crossentropy')
# Data iterators for loading the training and validation data
train_iter = data_iterator.BatchIteratorSimple(batch_size=batch_size,
data_folder=os.path.join('..', 'data', 'train'),
image_shape=image_shape,
shift_aug=True)
val_iter = data_iterator.BatchIteratorSimple(batch_size=batch_size,
data_folder=os.path.join('..', 'data', 'validation'),
image_shape=image_shape)
logger_cb = plotting_tools.LoggerPlotter()
lr_schedule_cb = keras.callbacks.LearningRateScheduler(lr_schedule)
model_cp_file = os.path.join('..', 'data', 'weights', 'model_checkpoint')
model_cp_cb = keras.callbacks.ModelCheckpoint(model_cp_file, monitor='val_loss', verbose=0,
save_best_only=False, save_weights_only=False,
mode='auto', period=1)
callbacks = [logger_cb, lr_schedule_cb, model_cp_cb]
model.fit_generator(train_iter,
steps_per_epoch = steps_per_epoch, # the number of batches per epoch,
epochs = num_epochs, # the number of epochs to train for,
validation_data = val_iter, # validation iterator
validation_steps = validation_steps, # the number of batches to validate on
callbacks=callbacks,
workers = workers)
# Save your trained model weights
weight_file_name = 'model_weights.h5'
model_tools.save_network(model, weight_file_name)
Now that you have your model trained and saved, you can make predictions on your validation dataset. These predictions can be compared to the mask images, which are the ground truth labels, to evaluate how well your model is doing under different conditions.
There are three different predictions available from the helper code provided:
# If you need to load a model which you previously trained you can uncomment the codeline that calls the function below.
# weight_file_name = 'model_weights'
# model = model_tools.load_network(weight_file_name)
# model.compile(optimizer=keras.optimizers.Adam(learning_rate), loss='categorical_crossentropy')
The following cell will write predictions to files and return paths to the appropriate directories.
The run_num
parameter is used to define or group all the data for a particular model run. You can change it for different runs. For example, 'run_1', 'run_2' etc.
run_num = 'run_1'
val_with_targ, pred_with_targ = model_tools.write_predictions_grade_set(model,
run_num,'patrol_with_targ', 'sample_evaluation_data')
val_no_targ, pred_no_targ = model_tools.write_predictions_grade_set(model,
run_num,'patrol_non_targ', 'sample_evaluation_data')
val_following, pred_following = model_tools.write_predictions_grade_set(model,
run_num,'following_images', 'sample_evaluation_data')
Now lets look at your predictions, and compare them to the ground truth labels and original images. Run each of the following cells to visualize some sample images from the predictions in the validation set.
# images while following the target
im_files = plotting_tools.get_im_file_sample('sample_evaluation_data','following_images', run_num)
for i in range(3):
im_tuple = plotting_tools.load_images(im_files[i])
plotting_tools.show_images(im_tuple)
# images while at patrol without target
im_files = plotting_tools.get_im_file_sample('sample_evaluation_data','patrol_non_targ', run_num)
for i in range(3):
im_tuple = plotting_tools.load_images(im_files[i])
plotting_tools.show_images(im_tuple)
# images while at patrol with target
im_files = plotting_tools.get_im_file_sample('sample_evaluation_data','patrol_with_targ', run_num)
for i in range(3):
im_tuple = plotting_tools.load_images(im_files[i])
plotting_tools.show_images(im_tuple)
Evaluate your model! The following cells include several different scores to help you evaluate your model under the different conditions discussed during the Prediction step.
# Scores for while the quad is following behind the target.
true_pos1, false_pos1, false_neg1, iou1 = scoring_utils.score_run_iou(val_following, pred_following)
# Scores for images while the quad is on patrol and the target is not visable
true_pos2, false_pos2, false_neg2, iou2 = scoring_utils.score_run_iou(val_no_targ, pred_no_targ)
# This score measures how well the neural network can detect the target from far away
true_pos3, false_pos3, false_neg3, iou3 = scoring_utils.score_run_iou(val_with_targ, pred_with_targ)
# Sum all the true positives, etc from the three datasets to get a weight for the score
true_pos = true_pos1 + true_pos2 + true_pos3
false_pos = false_pos1 + false_pos2 + false_pos3
false_neg = false_neg1 + false_neg2 + false_neg3
weight = true_pos/(true_pos+false_neg+false_pos)
print(weight)
# The IoU for the dataset that never includes the hero is excluded from grading
final_IoU = (iou1 + iou3)/2
print(final_IoU)
# And the final grade score is
final_score = final_IoU * weight
print(final_score)


Description
This sample creates a custom check mark box which can used with
IRE's PMCX control interface when designing dialogs to use the
custom checkmark in a dialog.
Concept
Shows how to use setup a custom control for use with IRE.
Task
Create a IRE enabled custom control.
Using the checkmark control
Open IRE and create a new dialog box. Under the Configure menu
select the "PMCX and Temporary Controls" menu item. In the PMCX dialog
box select Private Control then using find the chkmark.dll using the
Directories and Files list boxes. Select it and then select the Add
button. You should see in the Controls list 'ChkMark' Select the save
button. From the Control Menu select the User Define menu item. You
will see the chkmark control in the list. Select it to add to the
design.


Kevin van Zonneveld
on 2008-10-13 11:31:41
@ Christian Doebler: Thank you. I've added the function for study purposes. Because I think this implementation will lock up the browser, resulting in an unpleasant user experience. If you feel differently, please let me know.
Christian Doebler
on 2008-10-11 00:33:31
function sleep (seconds) {
seconds *= 1000;
var start = new Date().getTime();
while (new Date().getTime() < start + seconds);
}


HOME
ABOUT
WORK
CONTACT
GITHUB
TWITTER
EMAIL
LINKEDIN
Examples of where I started. Not where I'm going.


One of the things that is important to programming in general is the ability of a method to call itself. This is called Recursion.
Obviously both these constructs repeat certain blocks of code. They both do so, indefinably if not stopped or introduced with an end condition.
Loops are constructs that operate dependent on a specific condition or over an array, such as a while-loop that loops until a condition is no longer valid, or a for-loop that iterates through a predetermined set of elements, usually dictated by a counter variable, or temporary variable that embodies every iteration of the set or collection.
Recursive functions, on the other hand, is sort of like a mirror, pointed at its own reflection in a another mirror. Another way of looking at recursion, is when you are video chatting with some one, and you share your screen with them, and they in turn share their screen with you. What you get on your screen is an infinite window of smaller windows that shrink to approach nothingness. This might seem a little paradoxical, but stick with me on this post and you'll get it soon enough.
Recursion in short is a method that calls itself. It does nothing more than execute a block of code, and in that block of code is included a method call to itself, which obviously runs that block of code again, with ... you guess it! The method call to itself! And on and on it goes until stopped, either manually or by an end condition.
An important thing that recursion allows us to do is to have a function 'use' itself as part of its function, in other words: "Being able to call itself 'so far'."for example, my ruby method 'in_words' below, takes a number and out puts it in English words:
0: 1: 2: def in_words(number) 3: exceptions_hash={-this hash was basically the first 20 numbers-} 4: if exceptions_hash.keys.include?(number) 5: "#{exceptions_hash[number]}" 6: elsif number< 100 7: "#{in_words(Integer(number.to_s[0])*10)} #{in_words(Integer(number.to_s[1])) }" 8: else 9: group1="" 10: group2="" 11: str=number.to_s 12: str.length>3 ? str.length%3==0 ? mark=3 : mark=str.length%3 : mark=1 13: str.chars.each_with_index {|element, idx| idx< mark ? group1+=element : group2+=element} 14: sum=group2.chars.inject(0) {|esum,e| esum+=Integer(e)} 15: keyword=["one","ten","hundred","thousand",...."trillion"] 16: if !(sum==0) 17: if group2[0]=="0" 18: group2.slice!("0") 19: end 20: "#{in_words(Integer(group1))} #{keyword[str.length-1]} #{in_words(Integer(group2))}" 21: else 22: "#{in_words(Integer(group1))} #{keyword[str.length-1]}" 23: end 24: end 25: endFull code can be found here lines 209-232.
The first instance of recursion occurs on line 7. Basically whats happening here is that in order to find the correct word to add to the output, and accumulate the whole word, the function needs to access information that it has already declared, and there is no better way to do that then to call itself, and directly access that information.
Then line 20 and 22, we have to make special exceptions in the number system for our front numbers(the number right before the markers word) this is how I divide the number up over and over again into manageable chunks that can be ran through the method again via RECURSION. So instead of creating a completely new function, or block of code, we can just call the function of context. Again, this might seem a bit paradoxical but in time it becomes clear that recursion is the perfect tool for this.
Another use for recursion involves animating in Java-Script via timed methods, like setTimeout which cannot have initial values passed in as args/params.
For example, in the code below, the function 'sadplayer' does two things. First, it changes the inner HTML of the p1 element to an image tag that calls an element in the 'sadplayerarray' declared before it, the 'sadplayerarray' represents file names of images that are the 'frames' of my animation. This particular animation only has three frames. Then it calls itself, via the setTimeout method, in 200 milliseconds.
0: var sadplayerarray = ["sad_player1.png", "sad_player2.png", "sad_player3.png"] 1: var sadplayer = function() 2: { 3: if(incre < sadplayerarray.length) 4: { 5: p1.innerHTML="< img src="sadplayerarray[incre]">" 6: incre+=1 7: setTimeout(sadplayer, 200) 8: } 9: }Full code can be found here lines 125-133.
But what about the 'incre' variable? What does that do? Well, quite simply it provides a way for the function to keep moving forward in the array by incrementing itself every iteration. Where did it come from? Well, equally quite simply, it cannot be initialized locally inside the recursive function 'sadplayer', otherwise it would reset itself every time that function is called, which happens in line 7 of the function every iterations. In a sense the loop would be forever stuck in the initial element of the array.
The solution? THe variable 'incre' must be declared and initialized as 'var incre=0' before the recursive function 'sadplayer()' is called initially. This way 'incre' is preserved value-wise every time and the incrementing on line 6 is not done in vain.
When iterating through the elements of an array, or properties of an object, it is often most helpful, and most efficient to use a loop. Namely, but not necessarily, a for-loop. The main advantage of this, other than making things simpler to read and write, is that unlike a recursive function, a loop is not an object, but a construct, thus we do not have to allocate memory to declare a function inside a another function.
In short, we don't use recursion so we don't complicate code and make things less efficient by introducing surplus functions and variables. If you can loop, then you should loop. Looping is one of the main constructs in programming, because it is one of the most common things you need to do as a programmer. But in some special cases, recursion will be necessary.


CrankyCritic® movie reviews: Sugar Town Rated [R], 93 minutes Starring Rosanna Arquette, Ally Sheedy, Beverly D'Angelo, Jade Gordon, Michael Des Barres, John Taylor, John Doe and Martin Kemp Written and Directed by Allison Anders and Kurt Voss
IN SHORT: Dynamite.
It's been a generation since Cranky worked in the music biz -- I know it's a generation because one of the principal characters in Allison Anders' first rate flick Sugar Town refers to Stevie Nicks as "a cool old guy." Outside of the age gap, nothing much has changed in the world of rock and roll. Naked ambition, sheer ego, self deception, junkies, plane crashes and all natural living come together in perfectly matched multiple stories that fill this flick. It is the highest compliment I can pay to co-writer/directors Anders and Kurt Voss that they not only nail the scene and the inhabitants thereof, they at no time let their innate knowledge of the biz get in the way of telling a good story.
No, I take that back. Stories. Easily a half dozen of 'em, all stocked with well defined characters and a whole passel of surprises. It's the kind of work that Robert Altman does well and, considering my mixed feelings about Anders' Grace of My Heart, a major improvement and a delightful slice of life tale of folk both rising and falling in the Hollywood entertainment industries.
We start with Liz (Ally Sheedy) a thirtysomething film production designer whose biological clock is ticking so loudly that it's making her neurotic and scaring away potential dates. Her best friend Eva (Rosanna Arquette) is an actress watching a career go up in flames -- once the sexy ingenue type, now she's being offered a role as Christina Ricci's mother. Her husband Clive (John Taylor, ex Duran Duran and Power Station) is a Brit rock star of the 80s who, with other also rans Nick and Jonesy (Michael Des Barres, ex Power Station and Martin Kemp, ex Spandau Ballet) is shopping a last chance demo deal with the aid of producer Burt (Larry Klein, a real life composer and Grammy Award winning producer) and still waiting to be paid session player Carl (John Doe of X).

Crossing paths with almost all of these characters is Gwen (Jade Gordon)
the would be rock goddess who will lie, cheat, steal, swindle,
manipulate, plagiarize -- you get the picture -- so that she can flaunt
her inevitable fame in front of the boys who turned her down in High
School and now repair Slurpee machines. Cranky dated a woman just like
Gwen, way back when. She's now working for a superstar and I'm reliving
old nightmares
I have no such reservations about Sugar Town.
On average, a first run movie ticket will run you Eight Bucks. Were Cranky able to set his own price to Sugar Town, he would have paid...
$7.00
Anders and Voss wrote the script in two weeks, finished the production in six months and boasted of the fact at Sundance. As have a lot of other boasts that have come out of that festival, that almost red flagged Sugar Town as "sure to suck." It doesn't suck. Mightily.
The Cranky Critic® is a Registered Trademark of, and Copyright © 1999 by, Chuck Schwartz. All Rights Reserved. Cranky on the web at www.crankycritic.com
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Evolutionary Approaches for Flying Robots
01 May 2016Episode #207: Evolutionary Approaches for Flying Robots
I interview Guido De Croon about Evolutionary Robotics and its use to design behaviors for flying robots. We discuss a recent paper by Kirk Schepe et al., in which the DelFly UAV robot learns to fly through an open window when trapped inside a room thanks to a controller optimized using a Genetic Algorithm. The controller is programmed using a Behavior Tree Framework, which is more intuitive and adaptable than the traditional Neural Network framework. This helps the user to manually adapt the controller to handle the differences between the simulation and the real world. Guido then discusses the challenges and benefits of using Evolutionary Robotics to learn robot behaviors.


the power
Hey you. Yeah, you look bored. Well, you’re talking to me aren’t you? Since the flight’s delayed, you might as well listen. I’ve got a story to tell.
I’ve once been asked, wouldn’t be fun to have a superpower? I never really know how to answer that. Because the truth is, I actually have one. And the answer to that question, I wanted to say at the time but didn’t, was it depends. You really need to specify what superpower…because if you have a superpower like mine, then maybe your answer is no. My superpower makes me feel more helpless than if I didn’t have it.
And, I’ll get to that.
I’d grown up reading comic books, and I loved DC comics. I’d get bullied in middle school, and I always wanted to be those heroes that I read about. They weren’t real, of course, but one could dream.
One day, after a particularly difficult round of bullying, I started to get woozy. The football player had stuffed me in a locker after a good clock to the head, and as I was contemplating how long it would take for someone to find me in that claustrophobic container, my eyes started tingling.
I say my eyes; I mean the space behind my eyes. I guess it’s a section of the prefrontal lobe or something. Before I could process how and what I was feeing, whoosh! The locker opened again. It was the bully again, back for round 2.
This time, it was strange. He looked…different, said my tingling eyes/brain. I think the best word that I can think of is, nearly blank. It was a feeling that I got when I looked at him, and it was different when I glanced over at some of his snickering buddies. I think the best word for to apply when I look at the cohorts is: full.
After their session was over (the usual, taunting, name-calling, occasional punching/physical abuse), my mind went elsewhere as I sauntered home. I contemplated this new and strange sensation.
The next morning, my mom shook me awake. She said she’d gotten a call, and it was Billy’s mom on the phone. (Billy was the bully.) She asked if I knew Billy? I replied, yeah he beat me up yesterday. She paused for a bit…thinking about how to respond and what to say next. And then, she spat it out, “Billy died last night, crossing the railroad near his house.”
I wasn’t sure how to feel. My tormentor was dead. I’d like to say it was pity. But then, I started to remember what I thought while looking at him for the last time; blankness. Like, there was not much left for him to do or be. You know when you look at the lines formed by the wrinkles of an old person, and you think to yourself, “Wow, that lady; she’s been through some stuff.” It was, in a weird way, the opposite of that with Billy.
It took a couple years and I have more stories like that, but I started to realize that I could see when someone would die just by looking at him or her. It wasn’t a number on top of someone’s head or anything hoky like that. It was more of a sensation. Still, I guess the best description would be a countdown, or a green light turning red.
The worst was when I went to hospitals. My mom was an ICU nurse in the trauma ward at Mass General Hospital. Sometimes I went to visit her, but I soon realized that I couldn’t handle it. Stepping out of the elevator, I’d close my eyes, because I just didn’t want to look at a kid lying there with his parents crying, knowing that in a few hours, he wouldn’t be holding their hand back.
I’d never come to accept my “power”. The problem was, I just couldn’t do anything about it. What was I going to say? How would I act on this? With Billy, I couldn’t know a train had changed schedules. I wouldn’t know which rail he got his foot caught in.
It was the powerlessness that I felt. If I stood next to Superman, Wonder Woman, and Captain America in the same room (they’d never be in the same room; Marvel vs DC), they’d feel sorry for me. Not just because I’m a bit flabby and would look less than handsome next to them, but truly because I’ve got the most useless superpower ever.
“Shame about the new guy, huh?” they’d say.
“Yeah, I gave him a ride in my invisible jet because he looked sssaa…xcited about being in the awesom club. Oh hey buddy, I didn’t see you there.
Anyway, why am I telling you this right now?
You see, I’m looking around, and I’m seeing angry and bored people right now at this terminal. But I’m also seeing that countdown on their foreheads, and despite me feeling helpless, I’m damn well going to try and do something with this “gift” or “curse”, depending on how you look at it. Not everyone’s going to believe me, but you might.
Why don’t I just make an announcement? I can’t; I realized in a city called Columbine, dealing with the masses is a bad idea. No one believed me, and they’d think I’m some transient who wanted attention.  Then a mass shooting happened, they got angry and resentful. They thought I instigated the children, poisoned their mind.
You look like a reasonable guy. I bet you know what I’m going to say, so I’ll say only say it once. Listen to me or don’t, because I need to move on to the next guy. Don’t get on this flight. I’m not.


{% extends "sidebar_layout.html" %} {% block css %} {{ super() }} {% endblock %} {% block content %}
{{analysis.description}}
{% endfor %}It seems that you do not have performed analysis yet. Start Annotation or FBA analysis clicking buttons above.
{% endif %}


Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition.
- William T. Riker
Taking seamless key performance indicators offline to maximise the long tail. User generated content in real-time will have multiple touchpoints for offshoring.
- Sasha Banks
At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. Keeping your eye on the ball while performing a deep dive on the start-up mentality to derive convergence on cross-platform integration.
- Dana E. Owens
Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment. Bring to the table win-win survival strategies to ensure proactive domination.
- Robert Booker
Collaboratively administrate markets dynamically procrastinate user directed convergence after installed base benefits without revolutionary ROI.
- Ororo Munroe


Multitude of Endings
-
Main Story Endings
The End of YorHa
-
Number of Endings
There is exactly one ending per letter of the alphabet , although only A-E are the Main endings. The other endings are just for fun, or plain joke endings triggered through mini changes within the storyline.
-
Short Summary of the Main Endings
Ending A: flowers for m[A]chines, you play as 2B and defeat a villian named Adam, brother of Eve. Ending B: or not to [B]e , you play from 9S' perspective Ending C: meaningless [C]ode you play as 9S , as he learns the truth behind YorHa, and the death of his companion, 2B. He then battles with A2 Ending D: childhoo[D]s end , you play as A2, she kills 2B and fights one final battle against 9S Ending E: [E]nd of YorHa, Yorha ends and all of the androids have been killed, with a mini game that decides a certain path, up to the players discretion. Having the option to delete all saved data and save a random person in the world, or to keep your saved data and do nothing to help.


CorefAnnotator is an annotation tool for coreference, i.e., to mark whenever two or more words in a text refer to the same thing in the real world. We will refer to the words in a text as mentions and to the things in the real world as entities. Entities don't have to be touchable or concrete.
CorefAnnotator displays two views: The text on the left, and a tree on the right. Mentions in the text can be selected with a point device (e.g., mouse). To create a new entity in the tree on the right, either drag the selected mention onto the root node of the tree, or click "new" in the tool bar. Newly created entities then get a color assigned, and all their mentions in the text are underlined with the color. Selecting a mention in the tree also selects the mention in the text (and scrolls to an appropriate position if necessary). Clicking on a mention in the text view shows a context menu with all mentions that cover a certain text span. From there, one can reveal the mention in the tree or directly delete id.
In addition to a color, each entity has an assigned key code. This single letter shortcut can be used to quickly assign mentions to entities (without dragging). Both colors and key codes can be changed at any time, as can the name of the entity that is displayed in the tree.
While annotating, one typically stumbles upon difficult cases that need to be discussed with peers or supervisors. To support these discussions, difficult mentions can be tagged with the exclamation mark symbol: .
Sometimes, anaphoric expressions can appear in plural without a plural
antecedent. In these cases, entities can be grouped into entity groups.
(1) Mary was eating ice cream with John. They had a lot of fun.
"They" in the previous example refers to both Mary and John, but they are
not present as an antecedent.
In CorefAnnotator, any number of entities can be selected and formed as a group entity. Group entities behave like regular entities (i.e., one can drag and drop mentions onto them, assign shortcuts and colors), but they appear separately at the bottom of the tree view. If they are expanded, entity groups reveal their members (which are entities), as well as the mentions that are used to refer to the group.
Genericity expresses whether an entity is a kind, instead of an instance.
The prototypical example is shown in (1) and (2):
(1) The elephant met a rabbit. He asked him to be his friends.
(2) When under water, the elephant uses its trunk as a snorkel.
The underlined strings are exactly the same, but the first refers to a specific
instance or individual of a class, while the second refers to the class as a
whole.
In CorefAnnotator, entities can be marked as generic via the context or top menu. Generic entities are marked with the cloud symbol: .
CorefAnnotator uses UIMA's XMI file format to store annotations and meta data, with a custom type system. Only XMI files using this type system (i.e., produced through Save as...) can be directly opened and saved. XMI files using other type systems can be imported and (sometimes) also exported. Non-XMI files are not supported at the moment &emdash; with the only exception that it is possible to import plain text files.


sim.portrayal.simple
Classes
AbstractShapePortrayal2D
AdjustablePortrayal2D
CircledPortrayal2D
FacetedPortrayal2D
HexagonalPortrayal2D
ImagePortrayal2D
LabelledPortrayal2D
MovablePortrayal2D
OrientedPortrayal2D
OvalPortrayal2D
RectanglePortrayal2D
ShapePortrayal2D
TrailedPortrayal2D
TrailedPortrayal2D.TrailDrawInfo2D
TransformedPortrayal2D
ValuePortrayal2D
ValuePortrayal2D.DoubleFilter
ValuePortrayal2D.Filter
ValuePortrayal2D.IntFilter
VectorPortrayal2D


Preparation time
30 mins to 1 hour
Cooking time
10 to 30 mins
Serves
Makes 18
This pastry is really easy to work with and makes delicious mince pies.
Preheat oven to 200C/400F/Gas 6.
Rub the butter into the flour and add the almonds, caster sugar, orange rind and salt until the mixture is a bit crumbly.
Combine mixture with the egg yolk and 1-2 teaspoons of water until it forms soft dough, then put it into a plastic bag and chill for 20 - 30 minutes.
Roll out the pastry to a thickness of 2-3mm(0.1in) and cut out about 18 rounds measuring 7.5cm(3in) with a pastry cutter.
Place in lightly greased patty tins and spoon the mincemeat evenly into the pies.
Re-roll the leftover pastry and cut out round lids, stars or other festive shapes to fit on top of the mincemeat.
Lightly brush the pastry tops with the beaten egg and bake in the oven for 12 - 15 minutes until golden.
Remove from oven and leave for a few minutes before removing from tins and cooling on a wire rack.
Dust with icing sugar.


on 2012-03-26 02:31:44
Not sure if it is shorter than Andrew Maxwell his version, but since it didn't make it.. I thought I give it a shot.
function levenshtein(a, b) {
var i, j, r=[];
r[0] = [];
r[0][0] = 0;
for(i=1; i<=a.length; i++) {
r[i] = [];
r[i][0] = i;
for(j=1; j<=b.length; j++) {
r[0][j] = j;
r[i][j] = Math.min(
r[i-1][j]+1,
r[i][j-1]+1,
r[i-1][j-1] + (a[i-1]!==b[j-1])
);
}
}
return r[a.length][b.length];
}
????? ????? ????
on 2012-03-22 13:52:04
New in the gaming world and all that exclusive games, visit the Portal Forums
Andrew Maxwell
on 2011-03-01 19:04:07
1. It's always faster to access array elements than characters in a string. Always split it.
2. This function is unnecessarily verbose. For most if not all circumstances, the following would more than suffice:
function levenshtein (s1, s2) {
if (s1===s2){return 0;}
if (s1.length===0){return s2.length;}
if (s2.length===0){return s1.length;}
var v0=[],v1=[], j=0, k=0;
s1=s1.split('');
s2=s2.split('');
for (j=0; j<=s1.length; j++){v0[j]=j;}
for (k=1; k<=s2.length; k++){
v1[0]=k;
for (j=0; j<s1.length; j++){v1[j+1]=Math.min(v0[j+1]+1, v1[j]+1, v0[j]+((s1[j]===s2[k-1])? 0: 1));}
var v_tmp = v0;
v0 = v1;
v1 = v_tmp;
}
return v0[s1.length];
}
Kevin van Zonneveld
on 2009-10-25 14:10:14
@ Florian: PS, was this by any chance Firefox 3.0?
Kevin van Zonneveld
on 2009-10-25 14:09:43
@ Florian: Yeah witnessed on a colleague's PC recently. Should be fixed now!
Florian
on 2009-10-24 11:23:57
Thanks for this wonderful script! I used it for my javascript based search engine.
But it seems if there's a little bug on your website: when you come on this site, it redirects you to a site with only digg buttons for example. It would be good if you fix that!


Desired Output Magazine State:
A magazine is a stack of items where #0 is the bottom of the stack and #2 is the top.
Item #2 can only be present if item #1 is present and the same is true for items #1 and #0.
Currently there are two machines for pressing caps onto cans:
Maximum number of planning steps:
The following is a visualization of the factory layout, input magazines of both Presscap modules and output magazines.
The result of the pipeline run will appear here.


WATCH: Lionel Messi humiliates Barcelona teammates during training leaving fans in awe
by HarigovindBarcelona would never sell Lionel Messi, and the reason is quite simple – it is because even they have not yet figured out a way to stop the Argentine genius when he is in his element.
Well, how do we know that just like their opponents, Barcelona stars are also helpless when it comes to stopping Messi?
A new video which surfaced online earlier this week proves it – as Messi can be seen zigzagging his way through the opposite team’s defence after the Barcelona squad decided to split into two and play against each other during a team training session.
Take a look at the video shared right below:
Needless to say, fans who watched the video were also left speechless.
“It’s scarier because he’s been training with some of these guys for years and they still can’t figure him out,” @etin_bobo observed, as @AbdulJibrin12 remarked: “This Messi is a cheat code not yet created”.
Meanwhile, @JamesDe17863405 said, “Ready to take the 7th Balon’dor next year” as he expressed confidence that the six-time Ballon d’Or winner can lift one more trophy next year, after winning the 2019 edition of the award only a week ago.
 He has immortalised himself,” @breezy017 concluded.
Check out more reactions right below:
Absolutely world-class. That is what Lionel Messi is.


|
code.google.com home | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.owasp.html.PolicyFactory
@ThreadSafe @Immutable public final class PolicyFactory
A factory that can be used to link a sanitizer to an output receiver and that
provides a convenient
method and a sanitize
method to compose
policies.
and
| Method Summary | ||
|---|---|---|
PolicyFactory |
and(PolicyFactory f)
Produces a factory that allows the union of the grants, and intersects policies where they overlap on a particular granted attribute or element name. |
|
HtmlSanitizer.Policy |
apply(HtmlStreamEventReceiver out)
Produces a sanitizer that emits tokens to out . |
|
|
apply(HtmlStreamEventReceiver out,
HtmlChangeListener<CTX> listener,
CTX context)
Produces a sanitizer that emits tokens to out and that notifies
any listener of any dropped tags and attributes. |
|
java.lang.String |
sanitize(java.lang.String html)
A convenience function that sanitizes a string of HTML. |
|
|
sanitize(java.lang.String html,
HtmlChangeListener<CTX> listener,
CTX context)
A convenience function that sanitizes a string of HTML and reports the names of rejected element and attributes to listener. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.google.common.base.Function |
|---|
equals |
| Method Detail |
|---|
public HtmlSanitizer.Policy apply(@Nonnull HtmlStreamEventReceiver out)
out
.
apply
in interface com.google.common.base.Function<HtmlStreamEventReceiver,HtmlSanitizer.Policy>
public <CTX> HtmlSanitizer.Policy apply(HtmlStreamEventReceiver out, @Nullable HtmlChangeListener<CTX> listener, @Nullable CTX context)
out
and that notifies
any listener
of any dropped tags and attributes.
out
- a renderer that receives approved tokens only.listener
- if non-null, receives notifications of tags and attributes
that were rejected by the policy. This may tie into intrusion
detection systems.context
- if (listener != null)
then the context value passed
with notifications. This can be used to let the listener know from
which connection or request the questionable HTML was received.public java.lang.String sanitize(@Nullable java.lang.String html)
public <CTX> java.lang.String sanitize(@Nullable java.lang.String html, @Nullable HtmlChangeListener<CTX> listener, @Nullable CTX context)
html
- the string of HTML to sanitize.listener
- if non-null, receives notifications of tags and attributes
that were rejected by the policy. This may tie into intrusion
detection systems.context
- if (listener != null)
then the context value passed
with notifications. This can be used to let the listener know from
which connection or request the questionable HTML was received.
public PolicyFactory and(PolicyFactory f)
|
code.google.com home | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


An illustration of both of the HTML5 canvas API gradient definition functions - createRadialGradient
and createLinearGradient. Use the toggle buttons to show/hide the main canvas which
draws objects using the defined gradients and the two reference canvases which show what the
underlying gradients look like. I also plotted some reference shapes on the gradients that
correspond to the values in the gradient functions. For the radial gradient, this is two circles
which define the start and end of the gradient region. For the linear gradient, this is the yellow
line which defines the direction of the gradient.


Giovanna Fletcher's 'terrifying' motorway ordeal as severe pain left her unable to breathe
The wife of McFly's Tom Fletcher opened up about her 'extremely scary' ordeal which happened during a solo trip on the motorway
by Amy PackerAs distressing experiences go, developing severe chest pain while driving alone on a motorway must be up there as one of the more unpleasant.
And that was the terrifying situation in which author Giovanna Fletcher found herself on a journey from London to see her McFly star husband Tom play a gig in Birmingham.
"I started getting shooting pains where I literally couldn't breathe in – and if I did it it caused this massive stabbing sensation across my chest," recalls Giovanna, 34.
"I remember I came to a junction and just kept going around that loop while I focused on breathing shallowly, because if I took in too much air it was agony.
"I wasn't hunched over in pain – but the uncertainty of not knowing what's going on and when it’s going to stop is awful. It went on for a couple of minutes and was extremely scary."
The incident 10 years ago wasn’t the first time Giovanna experienced the sensation, but it was one of the lengthiest attacks.
"I don't remember where I was the first time it happened, but I thought I was having a heart attack," says Giovanni, then working in London as a children's chaperone. "Thankfully the pain subsided in about a minute and I felt fine again.
"I decided if it were life threatening it wouldn't have cleared up so quickly, so rather than heading to the hospital I made an appointment with my GP for the same day."
Her doctor carried out tests and, once happy it wasn’t anything immediately life threatening, referred Giovanna to a specialist.
"While I was waiting for my appointment to come around the attacks were happening, several times a day at their worst," she says.
Turning to Dr Google didn't help allay her fears. “It was coming up with heart failure and all sorts,” says Giovanna, who has written four novels including You're the One That I Want and Dream a Little Dream.
“Google is your worst enemy and then your best friend at times. I’m still bad at that now – when anything flares up I have a look, but I have to stop myself because there’s no monitoring what’s on the internet.”
There was even a moment when Giovanna debated whether she had been suffering panic attacks.
“I did wonder, as I have friends who have called an ambulance thinking they were having a heart attack, only to be told it was a panic attack,” says Giovanna.
“I didn’t feel particularly stressed at the time but sometimes there’s no rhyme or reason to these things.”
After one particularly painful episode Giovanna went to A&E. “The staff were fantastic, they gave me an ECG straight away and a chest X-ray just to make sure it wasn’t anything life threatening.”
Eventually, after several months of waiting, she saw a consultant and was told she had costochondritis, an inflammation of rib cage cartilage.
The condition usually affects the cartilage where the upper ribs attach to the breastbone and can cause chest pain of varying severity, with sufferers often describing heart attack-like symptoms.There was no explanation why Giovanna had developed the condition, and no cure.
Luckily, by the time she was diagnosed, the episodes were less frequent. But her most recent attack was just a few weeks ago, “It was mild, but enough to tell me, ‘I’m still here, just lingering’. I never know when it will flare up,” she says.
Giovanna and Tom, 34, have three sons, Buzz, five, Buddy, three and Max, one. And while Giovanna’s costochondritis has largely disappeared, being an expectant mother seemed to aggravate it.
“It flared up during all my pregnancies.” she says. “I knew what it was by then, but I wanted to make sure it wasn’t putting any strain on my heart or the muscles around it so I got myself checked out again.
“The doctors said it was nothing to worry about.”
These days, Giovanna is slowing down and trying to look after herself a little more. It’s one of the reasons she has created a range for Boots to help people “enjoy the simple, joyful things in life” including a gratitude journal and portable coffee mug.
"I think we look at self-care as something that will take up loads of the day, but for me it’s the little things.
"Everyone is safe in the back of the car, we're listening to music and I'm able to enjoy a hot coffee. Taking a moment to appreciate that moment, to me that’s self care."
*Giovanna Fletcher’s debut gifting range is available from Boots.
Do you have a story to sell? Get in touch with us at<EMAIL_ADDRESS>or call us direct 0207 29 33033


Review: Fight Club Starring: Edward Norton, Brad Pitt, Helena Bonham Carter Directed by David Fincher
As any reasonable human being would, I must admit that occasionally I am befuddled by certain things. I am befuddled by Fight Club. Now sometimes our favorite films are panned by critics and do not achieve critical success until much later, sometimes as much as ten or twenty years later. Perhaps it is because these films are way ahead of their time. Perhaps it is because they are so new and complex that only after years of allowing them to sink in do we truly appreciate and understand them. Fight Club is either garbage or brilliant, but, at least right now, I must lean toward the former.
Maybe I am subconsciously affected by word of mouth that has been slowly leaking throughout the media for weeks that this film is pure gold. But if it is, I sure donıt see it.
Edward Norton plays Jack, a field examiner for a major automobile manufacturer.   Once Jack is sucked into Tylerıs world, he canıt get out, literally. They begin Fight Club, an organization based on brutal and bloody fistfights that signify nothing other than to provide those that join a sense of belonging. As the Fight Club grows, things get out of control and take on cult status, beginning with one future soldier who proves his worth by standing still outside Tylerıs house for three days. I dare not even begin to bring up the last quarter of the film, since that contains the twist that ³explains² the pointless journey.
Suffice it to say I was truly disappointed in Fincher, whoıs previous two films, Se7en and The Game put him in a very slim category of truly brilliant young filmmakers of the next generation. This is not to imply by any means that he is no longer a genius or capable of bringing more masterpieces to the table. But with Fight Club, he has allowed his unique talent for extraordinary vision to be distorted by silly digital experiments and self-referencing film elements, such as talking to the audience about what they are seeing, telling them that the little blips in the right hand corner are signifiers that the projectionist is changing reels and that a slightly altered recurring line is good ³flashback humor².
Now, throughout the filmıs coarsely woven texture and over-extended plot lines, Fight Club is obviously trying to make various social comments about the state of the world today. Advertisements, inter-office politics, corporations, you name it, itıs addressed. (Though the media are suspiciously absent from the institutions that are referenced.) All of them play an important role. How so? Well, I can kinda just tell. I canıt really put my finger on it. To say that Starbucks and Barnes & Noble are taking over their respective markets and kicking out the small business owner is no big news. Is that bad for the world? Probably. Not much room for social commentary there. We all know that inter-office politics are just that...politics. So what was the point of all this? The film seems desperate to make a point, or a number of points, but I couldnıt figure out what they were.
All I saw was a very bizarre social satire that was woven with strange film techniques, a bleak visual design and some fine acting. (Pitt, Carter, Norton...all of them are good. Even Meatloaf is good.) When you get to the end, you will most likely be filled with questions, many of which the filmmakers wanted you to ask of yourself. Not them, because each of them would likely give you a different answer. Fight Club means what you want it to mean, I think Fincher just gives you the stuff to think about. But it couldnıt be more bizarre and unappealing. Sure, it had shock value, but so did Se7en and The Game, and they were significantly stronger films.
* 1/2 out of * * * * stars
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


October Sky (1999)
Director: Joe Joohnston Cast: Jake Gyllenhaal, Chris Cooper, Laura Dern, Chris Owen, William Lee Scott, Chad Lindberg, Natalie Canerday Screenplay: Lewis Colick (book by Homer H. Hickam Jr.) Producers: Larry J. Franco, Charles Gordon Runtime: 108 min. US Distribution: Universal Rated PG: language, alcohol use, thematic elements
Copyright 1998 Nathaniel R. Atcheson
The brilliant opening shots of October Sky present to us Coalwood, West Virginia, a small mining town subtly crushed beneath news that the Soviet Union has launched the first satellite, Sputnik. In Coalwood, every grown man works in the mines, and just about every grown woman is a housewife. The quiet first shots introduce a world very few of us understand -- they show us a group of people who feel helpless against an international force that appears to be technologically superior.
October Sky isn't about the Soviet Union, but the launch of Sputnik inspires a young man named Homer Hickam (Jake Gyllenhaal) to build rockets. He doesn't want to build real rockets (not yet, anyway); he simply wants to create something that shoots into the air. So he rounds up his friends, Roy Lee (William Lee Scott) and O'Dell (Chad Lindberg), hires the class nerd (Chris Owen) to help him with the math, and starts building rockets. This, of course, is not what Homer's father, John (Chris Cooper), wants.
John is one of the head coal miners, and is proud of his job. He wants Homer to work in the mines, just like everyone else, but Homer won't do it -- he wants to go in space. John works against his son, but not out of meanness: he simply resents what his son is trying to do. Meanwhile, Homer and his friends are helped along by Miss Riley (Laura Dern), a high school teacher who gets them to enter a national science fair when it becomes clear that their rockets are successful.
October Sky is an immensely moving film, one that frequently forced me to hold back sobs. It's based on the true story of NASA engineer Homer Hickam, and features one of most colorful arrays of characters to appear in any film in the last few months. Brought to life by inventive direction from Joe Johnston and subtle, layered performances from a wonderful cast, October Sky is that rare teen-angst movie that has all of the necessary pieces for serious drama. Even more odd is that the pieces are properly assembled.
Well, maybe I shouldn't call it a teen-angst movie. On the surface, though, it truly is in the spirit of the recent Hollywood teen flicks. Homer is a teenager for most of the picture, and the film dabbles in the usual assortment of peer pressure and parental conflicts. What sets October Sky apart from the others is . . . just about everything. Superficially, the movie looks great: the aforementioned opening shots are of the best in the film; Johnston is a talented visual artist, and Coalwood is observed in a somber, ponderous tone. The film feels temporally authentic, and, though I was born two decades after the events of this film take place, I felt like I understood it. It made sense to me.
This ties in with the setting; Johnston recognizes what the time period did to the people, and the current events in the background effectively staple the film and hold it together. One of the most interesting moments has the residents of Coalwood standing outside, waiting for Sputnik to pass overhead so they can steal a glance. It's quite a moving moment, and, when Homer sees the satellite, his transition from Indifferent to Rocket Builder is clear and instantaneous: he wants to go into space.
Of course, the transition wouldn't be effective if Gyllenhaal weren't such a terrific actor. I've never seen him before, but he carries the largest role in the film with grace and dignity that most actors his age lack entirely. He also works well with the other actors, particularly Cooper and Natalie Canerday, who plays his mother. Cooper, who was so good in Lone Star, is very powerful here; certainly the most relieving aspect of October Sky is that the father isn't demonized into oblivion, as so many fathers in films like this are. His motives are always clear, and he does do nice things for his son -- the conflict there is real, and it's realized.
The picture works on many levels, but I was most often taken with the little details. Homer's mother has some of the best scenes in the film; her quiet, almost unnoticeable attraction to Myrtle Beach adds to the nice development of her character; the scene in which her husband goes into the mines to save someone shows us a brief moment that speaks worlds about her character: "If he dies in there, I won't shed a tear." Only in a film this good could minor characters be fleshed-out so clearly.
It's necessary that Homer get stopped along the way -- there need to be characters who try and hinder his progress. But there are a few too many; the police arrest him, the school principal doesn't like what he does, his father obstructs him, and the other kids in school all make fun of him. I realize that the story is "based on a true story," but one or two of these frustrating subplots could have been abandoned with no harm done to the story at all. Otherwise, however, October Sky is a truly excellent film. Aside from giving us a brief history lesson on Sputnik, it presents to us a group of characters who earn our sympathy. Based on this film, I feel a little better knowing that the real Homer Hickam is out there working for NASA.
Psychosis Rating: 8/10
Visit FILM PSYCHOSIS at http://www.pyramid.net/natesmovies
Nathaniel R. Atcheson
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


same file in multiple columns
http://stackoverflow.com/questions/970292/emacs-multiple-columns-one-bufferhttp://stackoverflow.com/questions/2577394/emacs-split-into-3-even-windows
Split into vertical panes and flow like a newspaper. To split into equally sized panes, first use C-x 3 (as many times as needed). Then C-x +. Finally, M-x follow-mode will flow the file into the other panes. Thu Jul 14 15:17:41 2016


{% load staticfiles %}
We work to pair alumni with current students based on both parties preferences, allowing current students to benefit from the wealth of knowledge and experiences our alumni have!
New Mentors New Mentees