Please has a rich command line interface that can be used to build and test you code; interrogate the build graph; and much more!
To get the most our of the Please command line interface, it is highly
recommended that you enable tab-completion. Please has a sophisticated
mechanism that is aware of your build graph, all the commands and flags, and
any aliases you may have
configured. To enable Please completions, add this line to your
.bashrc
or .zshrc
:
source <(plz --completion_script)
These flags are common to all (or nearly all) operations.
-c, --config
The build config to use. The effect this has depends on the
language; typically it allows swapping between a debug or an
optimised build.
The default is
opt
to build optimised code;
dbg
is accepted for C++ and Go to build
code with debugging symbols.
This has no effect on Python or Java rules.
-r, --repo_root
Sets the location of the repo root to use. Normally plz assumes it is within the repo somewhere and locates the root itself, this forces it to a specific location.
-n, --num_threads
Sets the number of parallel workers to use while building. The default is the number of logical CPUs of the current machine plus two.
-i, --include
Labels of targets to include when selecting multiple targets with
:all
or /...
.
These apply to labels which can be set on individual targets; a
number of them are predefined, most notably for each language (go
, python
, java
,
cc
, etc).
Only targets with this label will be built.
-e, --exclude
The inverse of
--include
; labels of targets to exclude
when selecting multiple targets with
:all
or
/...
.
Takes priority over
--include
.
You can also pass build expressions to
--exclude
to exclude targets as well as by label.
-a, --arch
Architecture to compile for. By default Please will build for the host architecture, but has some support for targeting others. See the cross-compiling docs for more information.
-o, --override
Allows overriding individual config settings on a temporary basis;
for example
-o python.testrunner:pytest
. See the
config reference
for more information on what can be overridden.
--profile
Defines a profile of config file to load from the repo. For example,
--profile ci
will load
.plzconfig.ci
. This can be useful to
canonicalise certain settings for non-common or scripted
configurations.
-v, --verbosity
Sets the amount of output logged from plz; a number between 0 and
4.
Each number shows all messages at the given level and above:
The default is 1, for warnings and errors only. If level 4 is requested then it will suppress interactive output.
--log_file
Writes all logs out into the given file.
--log_file_level
Level of logging to write to the file. Defaults to 2 (notice, warning and error).
--interactive_output
Forces plz to show interactive output on stderr. By default it autodetects based on whether stderr appears to be an interactive terminal or not, but this flag can be used to force it on in cases where it might get it wrong.
-p, --plain_output
Forces plz not to show interactive output on stderr. Can be useful in cases where it might obscure other messages or where the output isn't capable of interpreting the escape codes correctly.
--colour
Forces coloured output from logging & shell output. Again, this is autodetected by default, but this can be used in cases where it would normally detect false but it will later be consumed by something that understands the codes (e.g. CI systems like Teamcity or Jenkins).
--nocolour
Inverse of above, forces colourless output from logging & the shell.
--trace_file
File to write Chrome tracing output into.
This is a JSON format that contains the actions taken by plz during
the build and their timings. You can load the file up in
about:tracing
and use that to see which parts of your build were slow.
--version
Prints the version of the tool and exits immediately.
--show_all_output
Prints all output of each building process as they run. Implies
--plain_output
.
--completion_script
Prints the bash / zsh completion script to stdout. This can be used
in a
.bashrc
or
.zshrc
, e.g.
source <(plz --completion_script)
.
--noupdate
Disables Please attempting to auto-update itself.
--nohash_verification
Turns hash verification errors into non-fatal warnings.
Obviously this is only for local development & testing, not for
'production' use.
--nolock
Don't attempt to lock the repo exclusively while building.
Use with care - if two instances of plz start building the same
targets simultaneously they will likely fail with very strange
errors.
--keep_workdirs
Don't clean directories in plz-out/tmp after successfully building
targets.
They're always left in cases where targets fail.
This is the most common and obvious command; it builds one or more targets
and all their dependencies. A plain
plz build
attempts to build everything, but more
usually you can tell it to build a particular target or targets by passing
them on the command line afterwards. For example:
plz build //src/core:core
builds just the one
target.
plz build //src/core:all
builds every target
in.
src/core/BUILD
.
plz build //src/...
builds every target in
src
and all subdirectories.
This is also a very commonly used command, it builds one or more targets and
then runs their tests. Which tests to run are specified by positional
arguments as described for
plz build
.
After successful completion a combined test output file will be written to
plz-out/log/test_results.xml
in something approximating xUnit XML format.
It takes a few special flags:
--num_runs
Determines how many times to run each test. The default is 1, but can be more for tests marked as flaky.
--failing_tests_ok
The return value is 0 regardless of whether any tests fail or not. It
will only be nonzero if they fail to build completely.
This is not commonly used, it's mostly useful for CI automation which
will parse the results file to determine ultimate success / failure.
--test_results_file
Specifies the location to write the combined test results to.
-d, --debug
Turns on interactive debug mode for this test. You can only specify
one test with this flag, because it attaches an interactive debugger
to catch failures.
It only works for some test types, currently python (with pytest as
the test runner), C and C++.
It implies
-c dbg
unless that flag is explicitly
passed.
Very similar to
plz test
, but also instruments tests for coverage
and collects results. Tests normally run significantly slower in this mode
(the exact amount depends on the language).
Coverage isn't available for C++ tests at present.
All the same flags from
plz test
apply here as well. In addition there are
several more:
--no_coverage_report
Suppresses the coverage report output to the shell.
--line_coverage_report
Produces a line-by-line coverage display for all source files.
--include_all_files
Includes any transitively dependent source files in the coverage report (the default is just files from relevant packages).
--include_file
Files to include in the coverage report (the flag can be passed more than once for multiple).
--coverage_results_file
Similar to
--test_results_file
, determines where to
write the aggregated coverage results to.
-d, --debug
Turns on interactive debug mode for this test. You can only specify
one test with this flag, because it attaches an interactive debugger
to catch failures.
It only works for some test types, currently python (with pytest as
the test runner), C and C++.
It implies
-c dbg
unless that flag is explicitly
passed.
This is essentially shorthand for calling
plz build
and then running the result of whatever
target was built. It's often handy for iterating on a single target such
that one command builds and reruns it.
Because of the way the target is run after, you have to provide exactly one
target to this command. The target must be marked as
binary
in its rule definition (this is implicit
for the various builtin _binary
rules such as
go_binary
etc).
If you want to pass flags to the target rather than plz itself, you must
pass them last on the command line, after a
--
. This tells Please not to attempt to parse them
as its own flags.
There are two optional subcommands
sequential
and
parallel
which allow running multiple targets in
one go. As the names suggest, they run targets either one after the other or
all in parallel.
In either case, the semantics are a little different to running a single
target; arguments must be passed one by one via the
-a
flag, and while stdout / stderr are connected
to the current terminal, stdin is not connected (because it'd not be clear
which process would consume it).
This command executes the target in a hermetic build environment, as opposed
to the plz run
command. This allows for uses cases,
such as: debugging/profiling programs that may require a predictable environment,
or running E2E tests reliant on external state which doesn't fit with Please's
caching approach.
The --share_network
and --share_mount
flags are available (Linux only) for greater control over the sandboxed environment
where the target is run. The --share_network
flag is useful
in situations where the host system might want to connect to a server that the command
started.
The --output_path
and --out
flags allow for artifacts, produced by the command executed in the sandboxed environment,
to be copied onto the host system where plz exec
is being
run from.
Non-binary targets are also supported, but a custom command (see above) is required since
there isn't a binary produced that can be executed by default. These targets' results can
be accessed via the $OUTS
environment variable.
Only a single command is supported per execution with plz exec
.
Multiple can be run with plz exec sequential
or plz exec parallel
,
which are analogous to their plz run
equivalents.
Watches a set of targets for changes. Whenever any one of their source files (or that of any dependency) is changed, the targets will be rebuilt. If any of them are tests, then they will be run as well.
Optionally you can pass the
--run
flag if you'd like the targets to be run
(using plz run
) instead of just built / tested.
This allows you to introspect various aspects of the build graph. There are a number of subcommands identifying what you want to query for:
alltargets
: Lists all targets in the
graph.
filter
: Filter targets based on --include
and --exclude
.
This is commonly used with other commands. For example, to run e2e tests separately from other tests:
plz query changes --since master > plz-out/changes
, then
cat plz-out/changes | plz query filter --include e2e - | plz test -
.
changes
: Queries changed targets versus a
revision or from a set of files.
completions
: Prints possible completions for
a string.
deps
: Queries the dependencies of a
target.
graph
: Prints a JSON representation of the
build graph.
input
: Prints all transitive inputs of a
target.
output
: Prints all outputs of a target.
print
: Prints a representation of a single
target.
reverseDeps
: Queries all the reverse
dependencies of a target.
somepath
: Queries for a path between two
targets.
rules
: Prints out a machine-parseable
description of all currently known build rules.
whatinputs
: Prints out target(s) with provided file(s) as inputs
whatoutputs
: Prints out target(s) responsible for outputting provided file(s)
Note that this is not the same as the query language accepted by Bazel and Buck, if you're familiar with those; generally this is lighter weight but less flexible and powerful. We haven't ruled out adding that in the future but have no concrete plans to do so at present.
Cleans up output build artifacts and caches.
This is not normally necessary since generally incrementality detection will ensure that targets are rebuilt if needed. It's possible though for particularly determined rules to do something they shouldn't in which case this might be needed, or (inconceivable though it is) a bug might exist that led to incorrect artifacts being cached.
If given no arguments this cleans the entire plz-out directory and the
directory cache, if configured. It returns immediately with the actual
removal proceeding in the background; you can invoke other plz commands
freely while that continues.
You can pass the
--nobackground
flag if you'd prefer to wait
though.
If it's given targets to clean, it will need to perform a parse to work out what to clean, and will not return until those targets have been cleaned.
The --nocache
flag works like all other commands
here, but bears mentioning since it will prevent artifacts from being
removed from the cache (by default they're cleaned from there too).
This command calculates the hash of outputs for one or more targets. These
can then be passed in the
hash
or
hashes
attributes of those targets to verify their
output is as expected - this is useful for fetching third-party dependencies
to ensure they are not changing between builds.
The relevant targets will be built in order to calculate the hash, but if they fail because it doesn't match the one recorded in the BUILD file plz will still exit successfully (although the output files will still not be created).
One can of course achieve the same effect via running
plz build
and reading the actual hash when it
fails, but this way is generally considered nicer.
The --update
flag will cause Please to rewrite the
BUILD file with any changed hashes that it can find.
a.k.a. plz format
Auto-formats existing BUILD files. You can either provide a list of files to reformat or, if none are given, it will discover all BUILD files in the repository.
The -w
flag rewrites existing files in-place; if
not passed the formatted version will be printed to stdout.
The implementation is currently based on a lightly modified version of
buildifier
which supports nearly a superset of the same dialect, but lacks one or two
features such as type annotations.
These are relatively rarely used in BUILD files though.
Creates an initial (and pretty empty)
.plzconfig
file in the current directory (or, if
the --dir
flag is passed, somewhere else).
You'll be warned before overwriting an existing file.
It will also create a wrapper script,
pleasew
which runs plz if found on the local
machine, and otherwise attempts to download a copy. This can be handy for
users who don't have it installed already.
There is a
--bazel_compat
flag which initialises the config
file for Bazel compatibility mode. This changes behaviour in various ways to
make it easier to begin building an existing Bazel project - although more
complex projects will still likely find things that don't translate easily.
This command can be used to build generated sources and link them back into the source tree. This can be useful for tooling that expects generated sources to be there like linters and IDEs.
To build all generated sources, simply run plz generate
.
Please can also update a gitignore file, ignoring all the gnerated files automatically:
plz generate --update_gitignore .gitignore
To automatically link generated sources and update .gitignore files during normal builds, see the LinkGeneratedSources, and UpdateGitignore config values.
Updates plz to the appropriate version. This is quite tightly governed by
the
.plzconfig
file:
selfupdate
is true, then it's not normally
necessary to run this since any invocation of plz will update before
running. It will still behave as normal though if invoked
explicitly.
version
property is set then it will
attempt to download exactly that version, and fail if it can't for some
reason.
downloadlocation
property determines
where it tries to download from; by default it's the central plz site,
but you could set this to a server of your own if you'd rather be more
independent.
Runs a basic "garbage collection" step, which attempts to identify targets that aren't in use. This is still fairly experimental since the definition of "not used" isn't always very clear (for example, ideally simply having a test on a library that isn't otherwise used would not be enough to keep both of those). Because of this it suggests a set of targets that it's pretty sure aren't used at all, and a secondary set that it's less sure on.
Right now the name is a bit misleading since it finds but doesn't collect
the garbage; ideally it'd be able to rewrite the BUILD files itself.
Deleting sources is a little trickier since you'd often want to couple that
with a VC operation (i.e.git rm
) and by design plz
is unaware of the VCS in use.
There are a few flags controlling it:
-c, --conservative
Uses a more conservative algorithm (specifically any tests will keep their targets).
-t, --targets_only
Only prints the targets to be removed (not sources). Useful to pipe them into another program.
-t, --srcs_only
Only prints the sources to be removed (not targets). Useful to pipe them into another program.
Displays help about a particular facet of Please. It knows about built-in
build rules, config settings and a few other things. Mostly this is useful
as an instant reference; you can run
plz help topics
to get a list of all the topics
that it knows about.
Re-runs whatever the previous command was.


{% extends "layout.html" %} {% block page_title %} Get premises inspected {% endblock %} {% block content %} {% include "includes/phase_banner_beta.html" %} Become a childminder Preparing food {{formData | safe}} Have food inspection Prepare for food inspection Your local council may inspect where you care for children, to check food is being prepared and stored safely. Tasks to have food inspection: read how to prepare and store food safely prepare for potential inspection {% endblock %}
Your local council may inspect where you care for children, to check food is being prepared and stored safely.
Tasks to have food inspection:


Eric J. Ma
DS Workflow
Bayesian DL
Testing for DS
Network Analysis
DL Fundamentals
Bayesian Stats
A system for composable transforms on NumPy programs.
A package that supercharges the NumPy API.
Overall effect is writing code that might be easier to reason about.
Familiar with the NumPy API
Understand what a dot product is.
There are examples and exercises that involve the dot product.Ready to be challenged by array computing puzzles.
Exercises that are designed to help you gain mastery over these ideas.Familiarity with the Jupyter user interface
Pre-recorded lecture component:
Summary, exercises and live Q&A in between videos
Exercises in Jupyter notebooks
Vectorized mapping a.k.a. vmap
The semantics of vmap
look roughly like this:
def func(x: np.ndarray):
...
return result
def vmapped_func(array: np.ndarray):
"""array contains one more dimension than x"""
result = []
for element in array:
result.append(func(element))
result = np.stack(result)
return result
Example
import jax.numpy as np
a = np.arange(20) # (20,)
def square(x: int) -> int:
return x ** 2
from jax import vmap
# this is a function!
mapped_sq = vmap(square)
mapped_sq(a)
# vmap(square)(a) works too!
vmap
takes in a function and returns another function.
The new function automatically applies the original function along the leading axis.
Example
def sum_vector(x: np.ndarray) -> np.ndarray:
"""Assumes `x` is a vector"""
return np.sum(x)
a = np.arange(20).reshape((4, 5))
# in_axes=0 is the default argument
row_sum = vmap(sum_vector, in_axes=0)
row_sum(a) # shape: (4,)
col_sum = vmap(sum_vector, in_axes=1)
col_sum(a) # shape: (5,)
Example
def softmax(x: np.ndarray) -> np.ndarray:
"""Vector-wise softmax transform."""
return np.exp(x) / np.sum(np.exp(x))
a = np.arange(16).reshape((4, 4))
normalize_transition_matrix = vmap(softmax)
normalize_transition_matrix(a) # row-wise normalization of `a`
The softmax operation is also used widely in the deep learning world.
Example: Functions with two arguments
def angle(opp: float, adj: float):
return np.arctan(opp / adj)
opps = np.arange(20)
adjs = np.linspace(3, 30, 20)
vmap(angle)(opps, adjs)
The function is now vmapped across the leading axis of both arguments.
We have gone through the content of the first notebook called"loopless loops". It's time now to attempt the exercises in there!
vmap
works well with functions that operate on each row independently of other rows.
What do we do when we need the output of a current iteration to influence the next?
lax.scan
!
Underneath the hood, JAX provides the NumPy API implemented on top of XLA.
XLA is the Accelerated Linear Algebra library provided by Google.
lax
is a Python wrapper to primitive math operations implemented in XLA, plus more.
lax.scan
implements looping with carry over between loops.
lax.scan
has the following semantics documented
# Stolen directly from the JAX docs
def scan(f, init, xs, length=None):
if xs is None:
xs = [None] * length
carry = init
ys = []
for x in xs:
carry, y = f(carry, x)
ys.append(y)
return carry, np.stack(ys)
Example: Cumulative Sum
a = np.array([1, 2, 3, 5, 7, 11, 13, 17])
# Accept ("carryover","current_elem")
def cumsum(res, el):
"""
- `res`: The result from the previous loop.
- `el`: The current array element.
"""
res = res + el
# Return ("carryover","accumulated")
return res, res
result_init = 0
final, result = lax.scan(
cumsum, result_init, a
)
result
# DeviceArray(
# [ 1, 3, 6, 11, 18, 29, 42, 59],
# dtype=int32
# )
lax.scan
get used?We have gone through the content of the second notebook called loopy carry. It's time now to attempt the exercises in there!
Drawing random numbers in NumPy.
#### cell 1
import numpy as onp # original numpy
onp.random.seed(42)
#### cell 2
a = onp.random.normal()
# a's value: 0.4967141530112327
#### cell 3
b = onp.random.normal()
# b's value: -0.13826430117118466
If you re-ran cell 2 by accident, you would get an entirely new random number assigned to a
.
#### cell 1
import numpy as onp # original numpy
onp.random.seed(42)
#### cell 2
a = onp.random.normal()
# a's value: 0.4967141530112327
#### cell 3
b = onp.random.normal()
# b's value: -0.13826430117118466
This is problematic because you may introduce bugs non-deterministically into your code!
JAX's random module enforces deterministic randomness by requiring explicit random number generation keys in each of its random number generators.
#### cell 1
from jax import random
key = random.PRNGKey(42)
#### cell 2
a = random.normal(key=key)
# a's value: -0.18471184
#### cell 3
b = random.normal(key=key)
# b's value: -0.18471184
The key determines the random draw.
#### cell 1
from jax import random
key = random.PRNGKey(42)
#### cell 2
k1, k2 = random.split(key)
c = random.normal(key=k2)
# c's value: 1.3694694
#### cell 3
k3, k4, k5 = random.split(k2, num=3)
d = random.normal(key=k3)
# d's value: 0.04692494
Explicit key splitting is required to generate new draws.
Two ways to generate an array of random draws.
key = random.PRNGKey(44)
ks = random.split(key, 20) # we want to generate 20 draws
draws = vmap(random.normal)(s)
# DeviceArray([-0.2531793 , -0.51041234, 0.16341999, -0.03866951,
# 0.85914546, 0.9833364 , -0.6223309 , 0.5909158 ,
# 1.4065154 , -0.25372273, -0.20608927, 1.1317427 ,
# -0.92549866, 1.035201 , 1.940132 , 0.34215063,
# 1.6209698 , 0.49294266, 0.5414663 , 0.10813037], dtype=float32)
draws = random.normal(key, shape=(20,))
# DeviceArray([ 0.39843863, -2.626297 , -0.6032239 , -2.081308 ,
# 0.00854139, 0.7638597 , 0.7916953 , 1.0279497 ,
# 0.58697087, -0.87620246, 1.3288299 , 1.7267488 ,
# 0.78643894, -2.752421 , 1.0341094 , -0.2926419 ,
# -0.21061882, -1.1115512 , -0.96723807, 0.12201323], dtype=float32)
Notice how the draws were different - because the keys are different!
Example: Gaussian Random Walk
num_timesteps = 100
mu = 0.0 # starting mean.
observations = [mu]
key = random.PRNGKey(44)
# Split the key num_timesteps number of times
keys = random.split(key, num_timesteps)
# Gaussian Random Walk goes here
for k in keys:
mu = mu + random.normal(k)
observations.append(mu)
JAX-based implementation:
from jax import lax
def new_draw(prev_val, key):
new = prev_val + random.normal(key)
return new, prev_val
final, draws = lax.scan(new_draw, 0.0, keys)
plt.plot(draws)
That was one draw from a Gaussian random walk.
What if we wanted multiple draws?
Start by encapsulating one draw inside a function...
def grw_draw(key, num_steps):
keys = random.split(key, num_steps)
final, draws = lax.scan(new_draw, 0.0, keys)
return final, draws
Then vmap the function across PRNG keys!
from functools import partial
from jax import vmap
num_realizations = 20
keys = random.split(key, num_realizations)
## PAY ATTENTION HERE!
grw_1000_steps = partial(
grw_draw, num_steps=1000
)
final, trajectories = (
vmap(grw_1000_steps)(keys)
)
In this multi-GRW example, we built out the computation from the repeatable elementary unit, gradually staging it outwards.
We have gone through the content of the notebook called deterministic randomness. It's time now to attempt the exercises in there!
Let's talk about grad
.
grad
is a function that transforms a function into its derivative function.
Example
from jax import grad
def func(x):
return 3 * x + 1
df = grad(func)
# Pass in any float value of x.
df(4.0)
# output: 3.0
Example
def polynomial(x):
return 3 * x ** 2 + 4 * x - 3
dpolynomial = grad(polynomial)
# pass in any float value of x
# the result will be evaluated at 6x + 4,
# which is the gradient of the polynomial function.
dpolynomial(3.0)
# output: 22.0
Automatic differentiation eliminates the need to do calculus by hand!
We can take advantage of the gradient function to do gradient-based minimization.
x = 3.0
for i in range(200):
x -= dpolynomial(x) * 0.01
x
# output: -0.66665125
Using the same ideas, we can do maximum likelihood estimation of probability distribution parameters.
Equivalent to minimizing the negative log likelihood.Generate some data...
from jax import random
import jax.numpy as np
from functools import partial
key = random.PRNGKey(44)
# the real mu is -3.0
real_mu = -3.0
# the real sigma is 2.0
real_log_sigma = np.log(2.0)
data = (
random.normal(key, shape=(1000,))
* np.exp(real_log_sigma)
+ real_mu
)
Define function to minimize (negative log likelihood)
from jax.scipy.stats import norm
def negloglike(mu, log_sigma, data):
return -np.sum(
norm.logpdf(
data,
loc=mu,
scale=np.exp(log_sigma)
)
)
We effectively defined our model, a Gaussian, inside the loss.
Get the gradient function, now w.r.t. two arguments and not just one:
dnegloglike = grad(
negloglike, argnums=(0, 1)
)
# condition on data
dnegloglike = partial(
dnegloglike, data=data
)
And optimize!
# gradient descent
for i in range(300):
dmu, dlog_sigma = \
dnegloglike(mu, log_sigma)
mu -= dmu * 0.0001
log_sigma -= dlog_sigma * 0.0001
print(mu, np.exp(log_sigma))
# -3.0087652, 2.0394986 <-- very very close!
We have gone through the content of the notebook called optimized learning. It's time now to attempt the exercise in there!


Info
This is just my (=anti's) homepage. Nothing fancy here.
I just use it to test new stuff;
And keep myself up-to-date of what I'm up to.
I just use it to test new stuff;
And keep myself up-to-date of what I'm up to.
---
layout: default
title: Anti's World - Welcome
---
{% if paginator.page == 1 %}
Info
This is just my (=anti's) homepage. Nothing fancy here.
I just use it to test new stuff;
And keep myself up-to-date of what I'm up to.
Cams
Social Networks


AJAX demo
Panel heading without title
{{treeData}}
Panel heading without title
Process Name
Description
Save
Create
Delete
Get Tree Data


XmlWriter — Converts in-memory ADMIT objects to XML format.¶
This module defines the main XML writer class for ADMIT.
-
class
admit.xmlio.XmlWriter.
XmlWriter
(clss, order, btype, root, keys=None)[source]¶ XML Writer class.
Class for writing out xml instances of both ATs and BDPs.
Parameters: clss : various
The class to be written out in XML.
order : list
The order items are written in.
btype : dict
Dictionary of the data type for each item.
root : elementtree node
The root node to attach to.
keys : list
A list of the keywords for an AT. Default: None.
Attributes
None Methods
write
(attr, item, btype, root, typ)Method to write out an individual item to XML writexml
(clss, order, btype, root, keys)Method to loop through all data members in the dtd and write them to XML -
write
(attr, item, btype, root, typ)[source]¶ Method to write out an individual item to XML
Parameters: attr : various
The value of the item to write out
item : str
The name of the item to write out
btype : dict
Dictionary of the data types for each item
root : elementtree
The root node to attach to
typ : str
String containing the type of class being written out. Used only for error messages
Returns: None
-
writexml
(clss, order, btype, root, keys)[source]¶ Method to loop through all data members in the dtd and write them to XML
Parameters: clss : various
The class to be written out in XML
order : list
The order items are written in
btype : dict
Dictionary of the data type for each item
root : elementtree node
The root node to attach to
keys : list
A list of the keywrods for an AT
Returns: None
-


Stop me and ask questions! (Although I may save them for the end)
Who and what is Xamarin and what do they do?
Mono - cross platform, open source .NET development framework
Mono allows .NET code to run on non-MS devices, such as...
Mac,Linux,BSD,iOS,Android,PlayStation 3 and 4and Vita,Wii
...and so on
If you are interested in making games with Mono, check out the excellent MonoGame.
Who and what is Xamarin and what do they do?
Xamarin Platform
Takes code written in C# (or F#) and runs it on a Mono runtime or compiles to native code
Xamarin.iOS
iPhone, iPad, and iPod Touch
Xamarin.Android
Android phones, tablets, watches, TVs, Google Glass, Kindle Fire phone and tablets
(and Blackberry 10 via Android compatibility, and Ouya and other Android game consoles, and that weird Nokia X line)
Xamarin.Mac
Macintosh computers by Apple, Inc.
Xamarin.Forms
Native UI for iOS, Android, Windows Phone with a single codebase
Test Cloud
Automated testing on hundreds of devices
Why should I care about the Xamarin platform?
Write in a common, modern language developers (may) already know
Reuse code on multiple platforms
Use Visual Studio (2010+) or the free Xamarin Studio
Many companies claim 60%, even 80% shared code. 95%+ possible with Xamarin.Forms
Commercial product with support - important for businesses (and governments)


There are many things you can build with Serverless & Python. The limit is your imagination!
Here are a couple places we recommend starting:
Deploy WSGI apps to AWS Lambda Read More
Utility for compiling Python libs with your functionsRead More


Installation - Windows
Download and Unpack
First download and install the message bus service.
To get the distributor go to the Releases page of the repo and download the distributor for your platform: typically. distributor-5.0.0-win10-x64.zip. Unzip the archive into a folder of your choice.
The examples in the documentation assume the distributer has been
unpacked to C:\distributor
to keep the paths simple.
C:\distributor>dir
Volume in drive C has no label.
Volume Serial Number is 3A0A-FCE5
Directory of C:\distributor
31/07/2021 09:39 <DIR> .
31/07/2021 09:39 <DIR> ..
31/07/2021 08:58 70,671,627 JetBlack.MessageBus.Distributor.exe
31/07/2021 08:58 24,404 JetBlack.MessageBus.Distributor.pdb
2 File(s) 70,700,256 bytes
2 Dir(s) 67,376,578,560 bytes free
To start the distrubter double-click on
JetBlack.MessageBus.Distributor.exe
to start it. The first time
the service is run Windows will pop up a security alert indicating
the service wants to access a network port. Click on "Allow access"
to continue.
Add a Configuration File
Optionally create a file called appsettings.json
in the installation folder
using the default configuration given here.
Now create the file distributor.bat
with the following contents.
C:\distributor\JetBlack.MessageBus.Distributor.exe C:\distributor\appsettings.json


{% extends "bootstrap/base.html" %} {% import "bootstrap/wtf.html" as wtf %} {% block content %}
Enter the question that you want to search
{{ form.csrf_token() }}
{{ wtf.form_field(form.name, class='form-control', placeholder='query') }}
Submit
Answer: {{answer_gen}}.
Candidate Text: {{last_can_gen}}
Score: {{score_Gen}}
Answer: {{answer_scoring}}.
Score: {{score_scoring}}
Candidate Text: {{last_can_scoring}}
{% endblock %}


Interactive Neural Network Art
Network Size = 8
Network Depth = 4
Resolution = 320
Z1 = 0
Z2 = 0
Colour Mode
BW
RGB
CMYK
HSV
HSL
No Alpha
Alpha
restart
redraw
save


This section offers an overview of the properties provided by Intel SGX.
Intel SGX (Software Guard Extension) is a new instruction set in Skylake Intel CPUs since autumn 2015. It provides a reverse sandbox that protects enclaves from:
OS or hypervisor
BIOS, firmware, drivers
System management module (Ring 2)
Intel management engine (ME)
Any remote attack
In short, SGX architecture is a hardware-enforced security mechanism that requires Trusted Computing Base (TCB), Hardware Secrets, Remote Attestation, Sealed Storage and Memory Encryption.
Here, TCB will be the CPU’s package boundary and software components related to SGX.
Hardware Secrets will be two 128-bit keys at production: Root Provisioning Key and Root Seal Key. Notice that RPK is known to Intel and RSK is not, therefore most of he derived key are based on RSK. We will discuss this later in the tutorial.
Remote Attestation is enforced for the client to prove to the service provider that an enclave is running a given software, inside a given CPU, with a given security level, for a given Individual Software Vender (ISV). This is required before the service provider decides to provide requested secrets.
Sealed Storage is required to save secret data to untrusted media. Data and code inside enclaves are not secrets. They are just logics that are required to process the secret and most of them are open sourced or can be reverse engineered. Therefore, secrets are provisioned later by the service provider and should be stored out of the enclave through sealing mechanism when necessary (e.g. for future usage).
Enclave memory cannot be read or written from outside the enclave regardless of the current privilege level and CPU mode.
Production enclaves cannot be debugged by software or hardware debuggers.
The enclave environment cannot be entered through classic function calls, jumps, register manipulation, or stack manipulation. The only way to call an enclave function is through a new instruction that performs several protection checks.
Enclave memory is encrypted using industry-standard encryption algorithms with replay protection. Tapping the memory or connecting the DRAM modules to another system will yield only encrypted data.
The memory encryption key randomly changes every power cycle. The key is stored within the CPU and is not accessible.
Data isolated within enclaves can only be accessed by code that shares the enclave.
As a result, the attack surface can be largely reduced after applying Intel SGX:
Cache timing attacks
Physical attacks. E.g. laser fault injection attacks
Microcode malicious patching
Untrusted I/O
Human element. E.g. trusted development environment
CPU bugs and bugs in dependencies.
Note that SGX trusted enclaves and microcode can be patched. However, memory encryption crypto cannot be patched since it is fused to hardware.
Nevertheless, those security concerns are out of the tutorial’s scope. Now let’s get started with SGX!


Add new project:
Name (it cannot be changed later)
URL (URL to public available web resource)
Schedule (check every x minutes)
HTTP Method {{range $m, $v := .methods}} {{ $m }} {{end}}
JSON (JSON string payload)
Errors
Success


Offline viewing and editing spatial data for Forest Fire Defense
Feedback on the GeoPoppy solution
Michaël Douchin - 3liz
# Context
## Stakeholders, data, softwares
## Stakeholders
* **Valabre**: french public institution
* **Help and support actors**: prevent and fight natural risks (fire, flood, etc.)
* **Actions**: test new technologies, research, trainings, share services, tools and data.
* **Partners**: cooperation between several organizations in the French Mediterranean areas.
![Valabre](media/Logo-Valabre_400.png)
## History: consolidate data between partners
* **Data**: fire fighting infrastructure: water tankers, tracks, watchtowers + standardized grids + base layers
* **Harmonization and centralization** between actors:
* list of **layers** to share (name, metadata, ontology)
* agree on data structure (fields, constraints, etc.)
* create common glossary
* aggreement on data styling (symbols, colors, etc.)
* **Spatial extent**: French Mediterranean areas (125 965 km2)
* **Vectors** 200 Mo / **Rasters** 30Go
## Softwares already in use
* **QGIS** used by *Valabre* workers, but some actors also use Mapinfo/ESRI/Geoconcept
* **PostgreSQL** to store and process data:
* Dedicated server (hosted by 3liz)
* **Lizmap Web Client / QGIS Server** to publish web maps from QGIS
![Logo QGIS](media/qgis-icon.jpg)
![Logo PostgreSQL](media/logo-postgresql.jpg)
![Logo Lizmap](media/logo_lizmap.jpg)
## Lizmap Web Client ?
* **QGIS projects published as full featured web maps**
* Lizmap QGIS plugin to configure the map
* Respects QGIS project properties: styling, layer tree, attribute table, form editing, printing via composers, relations between layers, etc.
* **Authentication and group rights**: restrict map access, editing tools, data export, etc.
![Logo Lizmap](media/logo_lizmap.jpg)
## PostgreSQL Valabre database
* **One schema** per actor (administrative area) + schema dedicated for admins or auditing.
* **Rights managements** via GRANT on schemas and tables
* **Procedures, triggers and Python services**:
* default values,
* history audit,
* send emails to admins/users depending on data modification/validation,
* copy data accross local schemas and global schema
![Logo PostgreSQL](media/logo-postgresql.jpg)
# Project objectives
## See and edit data offline
## mainly in the field
## Requirements and constraints
* **GIS features**: multiple layers, data editing, baselayers (aerial photos, dem), attribute table, etc.
* **Based on QGIS projects** to simplify the workflow & respect harmonized styling
* Use **PostgreSQL offline**: constraints, triggers, views (buffers, etc.)
* **No internet connection** or connection **not stable or expensive** -> work offline
* **Heavy datasets**
## Features requirements
* **Rich forms**: lists, checkboxes, images, date fields, etc.
* Authentication and rights management -> login saved in data
* **Tools**: data editing, attribute tables, popups, filters, relations, etc.
* **Synchronization**
* between the **offline database copies**
* and the **central server database**.
* No conflit resolution needed.
## Studied solutions / needs
* Windows tablets -> **Android tablets** (price)
* Simple field data collection tools (ODK) -> **QGIS based** mobile solution (full-featured)
* QField -> **GeoPoppy** (PostgreSQL, Auth, known solution)
Valabre chose to test **GeoPoppy**
![Logo Lizmap](media/logo_geopoppy.png)
# GeoPoppy
## Description / testing phase
## GeoPoppy
### A spatial server in a box
* **Hardware**: RaspberryPi / Battery / Tablet or smartphone or laptop with a web browser (Firefox)
* **Software**: Lizmap Web Client / QGIS Server / PostgreSQL / FTP Server.
* **Main conceptor**: **Julien Ancelin** with some help by 3liz
* Based on **Docker**
* **Already used** by researchers in France, Ivory Coast, Madagascar, etc.
## GeoPoppy cons
* **Additionnal devices**: *Do-It-Yourself look&feel*
* Tied to the **web browsers capabilities**: geolocation API, save files locally, etc.
* Lizmap interface is responsive but **not dedicated to mobile** -> some improvements needed
* Cannot connect to 3/4/5G and GeoPoppy WIFI **at the same time** -> **Android OS restriction**
## GeoPoppy pros
* **OpenSource software** and **affordable hardware**
* Work **offline**
* **No new software**: QGIS Server / Lizmap / PostgreSQL
* **Known worklow** to publish the web maps and data to the central server
* **PostgreSQL powered** : views, constraints, triggers.
* **QGIS Server powered**: all raster/vector formats (no conversion needed)
* **Lizmap powered**: authentication and rigths, rich forms from QGIS, atlas, styles, etc.
# Synchronization
## concepts and tools
## Synchronization key ideas
* Two phases
* **package** QGIS project & database from the central Lizmap/PostgreSQL server -> **deploy** to the GeoPoppy
* **Two-way db data sync** and **upload new media** to the server
* **No conflicts management** -> last action wins
* **UUID field** in every table: *c0558823-d20a-40c8-903c-0d8c4f4dad7d*
* Each GeoPoppy defined by its **unique UUID**
* On update, **only changed fields** data is synchronized
## Synchronization tools
* Based on **PostgreSQL triggers/functions**: *audit.sql* with additionnal sync procedures
* **Log every actions** with many information :
* initial raw data before change & changed fields,
* user and app names, timestamp,
* uuid of the source device, etc.
* **Centralize all audit** log in the main server
* **Sync process**:
* Get central server modifications
* Then send local modifications
## Example log for INSERT
```
event_id | 24
schema_name | dfci_vaucluse
table_name | VIG_Vaucluse
session_user_name | "geopoppy@valabre"
action_tstamp_tx | 2019-08-13 15:12:06.126626+02
action | I
row_data | "id"=>"47", "uid"=>"cb0344c4-c936-378a-2fae-96dd031a820b", "geom"=>"01010000206A08000023FDF38C15332B4118D448D97C035841",
"login"=>"j.doe|John|Doe|", "hauteur"=>"34", "nom_vig"=>"Vigie ", "service"=>"SDIS"
changed_fields |
sync_data | {"origin": "23e2218b-42cb-0963-eb25-8fe37cfeae50",
"replayed_by": {"2f9c2d17-fbb3-6cd2-2dbb-2b2738ba0029": "3a80a443-1338-722b-23c7-1751933fdd06"}}
```
## Example log for UPDATE
```
event_id | 16
schema_name | dfci_bouches_du_rhone
table_name | HBE_CONTROLE
session_user_name | "geopoppy@valabre"
action_tstamp_tx | 2019-07-26 16:51:57.265702+02
action | U
row_data | "id"=>"30", "uid"=>"b714709d-129b-6a97-fe89-21260604ba0c",
"geom"=>"01010000206A080000AAF1D24D4C2C2A415839B4282D005841", "user"=>"hbe",
"photo"=>NULL, "a_supp"=>"", "trappe"=>"inc", "date_creat"=>"2017-04-24",
"date_modif"=>"2017-04-24", "coordonnees_x"=>NULL, "coordonnees_y"=>NULL, "carroyage_dfci"=>NULL
changed_fields | "a_supp"=>"NON", "trappe"=>"NON", "date_modif"=>"2019-07-26", "page_atlas"=>"45", "nom_commune"=>"Aureille", "coordonnees_x"=>"4° 57.332'", "coordonnees_y"=>"43° 42.372'", "carroyage_dfci"=>"KD04F9"
"sync_data" | {"origin": "2c192051-2cc9-deda-fab7-f97e18b1caa6",
"replayed_by": {"2f9c2d17-fbb3-6cd2-2dbb-2b2738ba0029":
"acfc1373-60eb-74ff-4657-df1ffc73d8a0"}}
```
## Sync tools
### QGIS processing algs
* **A QGIS plugin** as a **Python processing provider**
* Use it in **QGIS desktop**: Processing menu with algs
* Use it **server-side**: 3liz WPS server async implementation based on QGIS processing framework
* Use it **in the GeoPoppy** device: via Lizmap
# Conclusion
## Feedback, roadmap, ideas
## Feedback
* **It works !**
* in the field,
* but also as an offline **portable full GIS server** (WMS, WFS, WPS, PostgreSQL, etc.)
* more tests needed and QGIS plugin not released yet
* **Simplify the workflow** : easier with good QGIS & PostgreSQL knowledge
* Improve **PyQGIS WPS Server** and **Lizmap WPS client**
* Complex QGIS projects can be **slow to render**
* **Lizmap responsive web interface** can be improved
## GeoPoppy on Android !
* No additionnal hardware devices needed: **only your Android device** thanks to UserLand
* Much **better performances**
* Use **3/4/5G** in the field: sync and display external layers (WMS, WFS, etc.)
* **PostgreSQL** running on Android -> can also be used with QField or Input
* **Almost production ready**: some work needed to package this solution, add doc, etc.
## Some links
* GeoPoppy: https://github.com/jancelin/geo-poppy/
* Julien Ancelin: https://twitter.com/complementterre/
* GeoPoppy on Android:
* Github: https://github.com/jancelin/geopoppy_android
* Video https://twitter.com/complementterre/status/1133836725137096705
* PostgreSQL Audit: https://github.com/Oslandia/audit_trigger/
* PyQGIS WPS Server by 3liz: https://github.com/3liz/py-qgis-wps
* PostgreSQL in UserLand: https://github.com/CypherpunkArmory/UserLAnd/issues/256
* Lizmap Web Client: https://www.lizmap.com/en/
Thanks for your attention


About
All Start Lines
My Start Line
40k
INT Women's Day
March 8
:
:
:
Days
Hours
Minutes
Seconds
see you at march 7th
POWERED BY


/** * Provides a cross browser class for retrieving location information. * * Based on the [Geolocation API Specification](http://dev.w3.org/geo/api/spec-source.html) * * When instantiated, by default this class immediately begins tracking location information, * firing a {@link #locationupdate} event when new location information is available. To disable this * location tracking (which may be battery intensive on mobile devices), set {@link #autoUpdate} to `false`. * * When this is done, only calls to {@link #updateLocation} will trigger a location retrieval. * * A {@link #locationerror} event is raised when an error occurs retrieving the location, either due to a user * denying the application access to it, or the browser not supporting it. * * The below code shows a GeoLocation making a single retrieval of location information. * * var geo = Ext.create('Ext.util.Geolocation', { * autoUpdate: false, * listeners: { * locationupdate: function(geo) { * alert('New latitude: ' + geo.getLatitude()); * }, * locationerror: function(geo, bTimeout, bPermissionDenied, bLocationUnavailable, message) { * if(bTimeout){ * alert('Timeout occurred.'); * } else { * alert('Error occurred.'); * } * } * } * }); * geo.updateLocation(); */ Ext.define('Ext.util.Geolocation', { extend: 'Ext.Evented', alternateClassName: ['Ext.util.GeoLocation'], config: { /** * @event locationerror * Raised when a location retrieval operation failed. * * In the case of calling updateLocation, this event will be raised only once. * * If {@link #autoUpdate} is set to `true`, this event could be raised repeatedly. * The first error is relative to the moment {@link #autoUpdate} was set to `true` * (or this {@link Ext.util.Geolocation} was initialized with the {@link #autoUpdate} config option set to `true`). * Subsequent errors are relative to the moment when the device determines that it's position has changed. * @param {Ext.util.Geolocation} this * @param {Boolean} timeout * Boolean indicating a timeout occurred * @param {Boolean} permissionDenied * Boolean indicating the user denied the location request * @param {Boolean} locationUnavailable * Boolean indicating that the location of the device could not be determined. * For instance, one or more of the location providers used in the location acquisition * process reported an internal error that caused the process to fail entirely. * @param {String} message An error message describing the details of the error encountered. * * This attribute is primarily intended for debugging and should not be used * directly in an application user interface. */ /** * @event locationupdate * Raised when a location retrieval operation has been completed successfully. * @param {Ext.util.Geolocation} this * Retrieve the current location information from the GeoLocation object by using the read-only * properties: {@link #latitude}, {@link #longitude}, {@link #accuracy}, {@link #altitude}, {@link #altitudeAccuracy}, {@link #heading}, and {@link #speed}. */ /** * @cfg {Boolean} autoUpdate * When set to `true`, continually monitor the location of the device (beginning immediately) * and fire {@link #locationupdate} and {@link #locationerror} events. */ autoUpdate: true, /** * @cfg {Number} frequency * The frequency of each update if {@link #autoUpdate} is set to `true`. */ frequency: 10000, /** * Read-only property representing the last retrieved * geographical coordinate specified in degrees. * @type Number * @readonly */ latitude: null, /** * Read-only property representing the last retrieved * geographical coordinate specified in degrees. * @type Number * @readonly */ longitude: null, /** * Read-only property representing the last retrieved * accuracy level of the latitude and longitude coordinates, * specified in meters. * * This will always be a non-negative number. * * This corresponds to a 95% confidence level. * @type Number * @readonly */ accuracy: null, /** * Read-only property representing the last retrieved * height of the position, specified in meters above the ellipsoid * [WGS84](http://dev.w3.org/geo/api/spec-source.html#ref-wgs). * @type Number * @readonly */ altitude: null, /** * Read-only property representing the last retrieved * accuracy level of the altitude coordinate, specified in meters. * * If altitude is not null then this will be a non-negative number. * Otherwise this returns `null`. * * This corresponds to a 95% confidence level. * @type Number * @readonly */ altitudeAccuracy: null, /** * Read-only property representing the last retrieved * direction of travel of the hosting device, * specified in non-negative degrees between 0 and 359, * counting clockwise relative to the true north. * * If speed is 0 (device is stationary), then this returns `NaN`. * @type Number * @readonly */ heading: null, /** * Read-only property representing the last retrieved * current ground speed of the device, specified in meters per second. * * If this feature is unsupported by the device, this returns `null`. * * If the device is stationary, this returns 0, * otherwise it returns a non-negative number. * @type Number * @readonly */ speed: null, /** * Read-only property representing when the last retrieved * positioning information was acquired by the device. * @type Date * @readonly */ timestamp: null, //PositionOptions interface /** * @cfg {Boolean} allowHighAccuracy * When set to `true`, provide a hint that the application would like to receive * the best possible results. This may result in slower response times or increased power consumption. * The user might also deny this capability, or the device might not be able to provide more accurate * results than if this option was set to `false`. */ allowHighAccuracy: false, /** * @cfg {Number} timeout * The maximum number of milliseconds allowed to elapse between a location update operation * and the corresponding {@link #locationupdate} event being raised. If a location was not successfully * acquired before the given timeout elapses (and no other internal errors have occurred in this interval), * then a {@link #locationerror} event will be raised indicating a timeout as the cause. * * Note that the time that is spent obtaining the user permission is **not** included in the period * covered by the timeout. The `timeout` attribute only applies to the location acquisition operation. * * In the case of calling `updateLocation`, the {@link #locationerror} event will be raised only once. * * If {@link #autoUpdate} is set to `true`, the {@link #locationerror} event could be raised repeatedly. * The first timeout is relative to the moment {@link #autoUpdate} was set to `true` * (or this {@link Ext.util.Geolocation} was initialized with the {@link #autoUpdate} config option set to `true`). * Subsequent timeouts are relative to the moment when the device determines that it's position has changed. */ timeout: Infinity, /** * @cfg {Number} maximumAge * This option indicates that the application is willing to accept cached location information whose age * is no greater than the specified time in milliseconds. If `maximumAge` is set to 0, an attempt to retrieve * new location information is made immediately. * * Setting the `maximumAge` to Infinity returns a cached position regardless of its age. * * If the device does not have cached location information available whose age is no * greater than the specified `maximumAge`, then it must acquire new location information. * * For example, if location information no older than 10 minutes is required, set this property to 600000. */ maximumAge: 0, // @private provider : undefined }, updateMaximumAge: function() { if (this.watchOperation) { this.updateWatchOperation(); } }, updateTimeout: function() { if (this.watchOperation) { this.updateWatchOperation(); } }, updateAllowHighAccuracy: function() { if (this.watchOperation) { this.updateWatchOperation(); } }, applyProvider: function(config) { if (Ext.feature.has.Geolocation) { if (!config) { if (navigator && navigator.geolocation) { config = navigator.geolocation; } else if (window.google) { config = google.gears.factory.create('beta.geolocation'); } } } else { this.fireEvent('locationerror', this, false, false, true, 'This device does not support Geolocation.'); } return config; }, updateAutoUpdate: function(newAutoUpdate, oldAutoUpdate) { var me = this, provider = me.getProvider(); if (oldAutoUpdate && provider) { clearInterval(me.watchOperationId); me.watchOperationId = null; } if (newAutoUpdate) { if (!provider) { me.fireEvent('locationerror', me, false, false, true, null); return; } try { me.updateWatchOperation(); } catch(e) { me.fireEvent('locationerror', me, false, false, true, e.message); } } }, // @private updateWatchOperation: function() { var me = this, provider = me.getProvider(); // The native watchPosition method is currently broken in iOS5... if (me.watchOperationId) { clearInterval(me.watchOperationId); } function pollPosition() { provider.getCurrentPosition( Ext.bind(me.fireUpdate, me), Ext.bind(me.fireError, me), me.parseOptions() ); } pollPosition(); me.watchOperationId = setInterval(pollPosition, this.getFrequency()); }, /** * Executes a onetime location update operation, * raising either a {@link #locationupdate} or {@link #locationerror} event. * * Does not interfere with or restart ongoing location monitoring. * @param {Function} callback * A callback method to be called when the location retrieval has been completed. * * Will be called on both success and failure. * * The method will be passed one parameter, {@link Ext.util.Geolocation} * (**this** reference), set to `null` on failure. * * geo.updateLocation(function (geo) { * alert('Latitude: ' + (geo !== null ? geo.latitude : 'failed')); * }); * * @param {Object} [scope] * The scope (**this** reference) in which the handler function is executed. * * **If omitted, defaults to the object which fired the event.** * * <!--positonOptions undocumented param, see W3C spec--> */ updateLocation: function(callback, scope, positionOptions) { var me = this, provider = me.getProvider(); var failFunction = function(message, error) { if (error) { me.fireError(error); } else { me.fireEvent('locationerror', me, false, false, true, message); } if (callback) { callback.call(scope || me, null, me); //last parameter for legacy purposes } }; if (!provider) { failFunction(null); return; } try { provider.getCurrentPosition( //success callback function(position) { me.fireUpdate(position); if (callback) { callback.call(scope || me, me, me); //last parameter for legacy purposes } }, //error callback function(error) { failFunction(null, error); }, positionOptions || me.parseOptions() ); } catch(e) { failFunction(e.message); } }, // @private fireUpdate: function(position) { var me = this, coords = position.coords; this.position = position; me.setConfig({ timestamp: position.timestamp, latitude: coords.latitude, longitude: coords.longitude, accuracy: coords.accuracy, altitude: coords.altitude, altitudeAccuracy: coords.altitudeAccuracy, heading: coords.heading, speed: coords.speed }); me.fireEvent('locationupdate', me); }, // @private fireError: function(error) { var errorCode = error.code; this.fireEvent('locationerror', this, errorCode == error.TIMEOUT, errorCode == error.PERMISSION_DENIED, errorCode == error.POSITION_UNAVAILABLE, error.message == undefined ? null : error.message ); }, // @private parseOptions: function() { var timeout = this.getTimeout(), ret = { maximumAge: this.getMaximumAge(), enableHighAccuracy: this.getAllowHighAccuracy() }; //Google doesn't like Infinity if (timeout !== Infinity) { ret.timeout = timeout; } return ret; }, destroy : function() { this.setAutoUpdate(false); } });


Cats and Dogs (2001) Jeff Goldblum, Elizabeth Perkins, Alexander Pollock, Miriam Margolyes, Tobey Maguire, Alec Baldwin, Michael Clarke Duncan, Sean Hayes, Jon Lovitz, Joe Pantoliano, Susan Sarandon. Screenplay by Glenn Ficarra and John Requa. Directed by Larry Guterman. 90 minutes. Rated PG, 2.5 stars (out of five stars)
Review by Ed Johnson-Ott, NUVO Newsweekly www.nuvo.com Archive reviews at http://reviews.imdb.com/ReviewsBy?Edward+Johnson-Ott To receive reviews by e-mail at no charge, send subscription requests to<EMAIL_ADDRESS>or e-mail<EMAIL_ADDRESS>with the word "subscribe" in the subject line.
Cats and dogs are both intelligent, well-organized species that talk. A secret war between them has been going on for over a thousand years. In ancient Egypt, cruel feline overlords herded their human slaves around like cattle, until an army of canines came to our rescue, thereafter acting as benign guardians of mankind.
At least that's the way the dogs tell it.
Why, you may ask, don't we remember such a momentous historical event? According to one pooch, the answer is simple. "Humans are primitive," he explains to a pup.
So there you have it.
"Cats and Dogs" is a raucous comedy based on a genuinely inventive concept. Kids, I suspect, will love the movie and most adults will find it moderately entertaining. There's nothing wrong with that, but it's frustrating to see such a promising undertaking fail to realize its full potential. The problem is that the screenplay was written for children, with scattered bits thrown in for adults, even though the premise screams for a multilayered approach. With another rewrite or two, "Cats and Dogs" could have kept the adults laughing as hard as the children. I'm convinced the authors were up to the task.  could surely have pulled it off.
Still, there are treats to be had, beginning with the storyline. An uneasy, but long-standing truce between cats and dogs breaks down due to a megalomaniacal feline and a preoccupied human scientist. Professor Brody (Jeff Goldblum) is on the verge of a major breakthrough: a simple formula that will immunize mankind against all dog allergies. If successful, the balance of power between the two four legged species would shift. For the power-mad tabby Mr. Tinkles (voiced by Sean Hayes), the situation offers him a golden opportunity – if he can destroy the formula and infect man with a substance that will increase dog allergies, he can… RULE THE WORLD!
The dogs will have none of this, of course, so they make arrangements to place one of their top agents in the Brody household. But a mistake happens and, instead of the James Bond of pooches, the new Brody "pet" turns out to be a wet-behind-the-floppy-ears pup named Lou (Tobey Maguire).
And so the battle begins. The dogs work undercover to bring Lou up to snuff, with an embittered veteran named Butch (Alec Baldwin) heading up a team including Sam (Michael Clarke Duncan), Peek (Joe Pantoliano) and, to the discomfort of Butch, Ivy (Susan Sarandon), an ex-lover who knows him all too well. Meanwhile, Mr. Tinkles sets his master plan in motion. I won't reveal the specifics; suffice to say it involves threats, kidnapping, deception on a grand scale, and ninja cats.
For the most part, the special effects are convincing. Computer animation is employed to make the animals appear to speak and change facial expressions, with animatronic puppets used for scenes requiring unusual physical adroitness. The CGI is quite well-done and, more often than not, the puppetry works. But hoo-boy, when it doesn't – those critters look like Muppets being struck by lightning.
As with "A.I. Artificial Intelligence," the actors playing non-humans are far more credible, and likable, than the "real" people. On the dog side, Tobey Maguire gives Lou the right mix of naiveté and brashness, Susan Sarandon is wise and smoky as Ivy and Alec Baldwin does fine work essentially re-playing his character from "Pearl Harbor" (only with better dialogue). In Cat Land, Jon Lovitz is fine as a surly assistant and, in the key role of Mr. Tinkles, Sean Hayes provides the appropriate grandiose tones for the would-be kitty Napoleon.
Oh, but when the humans take center stage, the film devolves into a carbon copy of one of those wretched live-action Disney family comedies from the '60s. Alexander Pollock is bland as son Scott and Elizabeth Perkins is even blander as Mrs. Brody, an ineffective nurturer who spends most of the movie fretting. As wacky scientist/lousy father Professor Brody, Jeff Goldblum is simply embarrassing, slathering his patented stammer over the walking stereotype.
If "Cats and Dogs" is successful enough to warrant a sequel, I have a couple of suggestions for the filmmakers. First, take your time and write more jokes for the grown-ups. Second, if a maniacal cat threatens to kill the Brody family, let him.
© 2001 Ed Johnson-Ott
========== X-RAMR-ID: 28920 X-Language: en X-RT-ReviewID: 234096 X-RT-TitleID: 1108739 X-RT-SourceID: 591 X-RT-AuthorID: 1099 X-RT-RatingText: 2.5/5
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


that will help you build better predictive models
dataviz@datarobot
Sexy
Ugly
Old modeling paradigm
New modeling paradigm
Disclaimer
A prediction problem
Predicting election meme popularity
What is a meme?
The Data
14.3k Donald Trump and Hillary Clinton memes
Topics
Topic 1
Topic 2
Topic 3
Topic 4
Topic 5
Topic 6
Topic 1
Topic 2
Topic 3
Topic 4
Topic 5
Topic 6
Topic 9
Buy this model because:
Recap
Measures overall model performance.
Lift chart: recap
Plots the marginal effect of a predictor on the prediction.
Network
1. Fix network = Instagram
2. Take average prediction from fixed matrix
PD(network=instagram) = avg(F(network=instagram, Xc))
Partial dependence: recap
Rank-orders variables by their influence on the target.
Example: calculate permutation importance for caption
1. Shuffle caption column in validation data.
2. Predict on shuffled validation data.
3. Calculate importances with new scores.
Importance(caption) = |Score(full_data) - Score(shuffled_data)|
Variable importance: recap
How to create a successful meme?
Already have successful memes
Thank you!


Name and Surname:
Your E-mail Adress:
Please give your opinion on hear:
Submit
My Social Media accounts
Toggle navigation
Mustafa Akdoğan
Main
Photo Gallery
My Hobbies
About My Family
My Hometown
Contact Me
Registration


Source code for pandemic_simulator.data.interfaces.data_loader
# Confidential, Copyright 2020, Sony Corporation of America, All rights reserved.
import dataclasses
from abc import ABC
from typing import List, Optional, Sequence
import numpy as np
from ...environment import PandemicObservation, PandemicSimOpts
__all__ = ['ExperimentResult', 'ExperimentDataLoader', 'StageSchedule']
[docs]@dataclasses.dataclass(frozen=True)
class StageSchedule:
stage: int
end_day: Optional[int] = None
<EMAIL_ADDRESS>class ExperimentResult:
sim_opts: PandemicSimOpts
seeds: List[Optional[int]]
obs_trajectories: PandemicObservation # TNC array with size_n = num_seeds, size_t = episode_length
reward_trajectories: np.ndarray # TNC array with size_n = num_seeds, size_t = episode_length
strategy: Sequence[StageSchedule]
num_persons: int
[docs]class ExperimentDataLoader(ABC):
"""An interface for a data loader."""
[docs] def get_data(self) -> Sequence[ExperimentResult]:
"""Return data as a sequence of ExperimentResult instances"""
pass