 I know You hear our cries and see our tears for our spouses, children, grandchildren, and brothers and sisters. Our cries and tears are that each of them would be delivered out of the kingdom of darkness and be born again in Christ by the Spirit of Life. And those who have fallen asleep in their faith, awakened their souls by the Spirit of Life so that they will join the chorus of praise with the rest of the saints.As the Jailer and his family were saved and filled with Your Spirit; as Cornelius and his whole household heard the Gospel and were filled with the Spirit, so fill our spouses, children, and grandchildren. Cause the seeds of the gospel that are in them to grow and bear fruit that glorifies Christ Jesus. And for those who have not heard the saving Gospel, cause them to hear, understand, repent, and be born again. Yes, we plead for their deliverance. Remove the veil over their understanding, and shine into their hearts to give the light of the knowledge of the glory of God in the face of Jesus Christ.
You hold their hearts. No one can resist the Spirit of God. What You purpose to do, will be. Reveal Your Arm of Salvation, O' God. Usher them into the light, to the Glory of Christ. Amen. (Psalm 34:15; Acts 11:13-15; 16:29-34; Romans 9:19; 2 Corinthians 4:3-6)


Centerline
Get a line in the center of your browser window
Drag me to your Bookmark bar
By John McDowall


{% extends "account/base.html" %} {% load i18n %} {% load static %} {% block head %} {{ wizard.form.media }} {% endblock %} {% block content %}
Step {{ wizard.steps.step1 }} of {{ wizard.steps.count }}
LinerNotes is going to help you build out a
of your favorite artists and albums and genres (and more!)
The easiest way to get started is to import the music you like from:
{% endblock %}


{%extends "detail-base.html"%} {% block detail_body %} {# Silence regular messages so we can display them closer to the transfer button #} {% block detail_messages %} {% endblock %}
Your file is being transferred, you can check the status here.
{{fields.remote_file_manifest.filename}}
{{fields.remote_file_manifest.length}}
{{fields.remote_file_manifest.url}}
{{fields.remote_file_manifest.md5}}
{{fields.remote_file_manifest.sha256}}


mombasajs[001]
06/12/2014
Welcome to MombasaJS
MombasaJS is a usergroup of Javascript enthusiasts in Mombasa, Kenya
var poweredBy = "Mombasatech";
Mission...
Organize fun and interactive meetups to share and discuss interesting topics related to Javascript.
Create a network of Javascript developers in Mombasa
To update ourselves with the latest news related to Javascript
Build projects using Javascript that solve some of the problems in our society
Awesome tools and frameworks for your projects.
Such as..
- NodeJS for networking
- PDF.js for loading pdf files
- Backbone and AngularJS for building large scale MV* applications
- Grunt and Yeoman for automation
- jQuery for giving your webpage a dynamic and interactive feel
Most open and popular programming language. My opinion based from GitHub's popular repositories. Most of them are Javascript based.
Meetup model
-
Meetups should contain atleast one demo of a Javascript framework/library in action.
-
Tips for writing better Javascript. Example: good coding practices, style etc.
-
Sharing of articles, resources and tutorials related to Javascript.
-
Question and answer session. Can't figure it out? Together we will find a solution..
{In a nutshell}
Don't leave the meetup if you haven't learnt something new in the universe of Javascript!


Private agreements reported by team members Note 1: Not al of these should be associated with your lab, as members might have added agreements they obtained while on other labs/institutions. Note 2: A missing agreement requires that you or a team member adds it to his/her personal agreements in 'Myself'


A tiny Bootstrap and jQuery based WYSIWYG rich text editor based on the browser function execCommand.
This project was originally built for MindMup and has now been adapted and modified to suit a wide range of projects.
Development is active, and ongoing.
$('#editor').wysiwyg();
Don't forget to style your editor div:
#editor {overflow:scroll; max-height:300px}
If you want to use this for a mobile web site, make sure to read about how to style it to optimise mobile screen usage and experience (please note that this demo page isn't optimised for mobile access).
Optionally, also create a toolbar (see the source of this page for an example):

...

In the toolbar, execute simple commands by adding a data-edit attribute to a link.
...
execute more complex commands by adding an argument after a blank or providing an input with a data-edit command (the input value is used as an argument). In case of file inputs, the file contents are read in using the FileReader API and used as the command value.
...
...
<input type="text" data-edit="createLink"/>
...
<input type="file" data-edit="insertImage" />
Use standard jQuery methods to access and set content and focus. You can also ask for cleaned up HTML content:
$('#editor').cleanHtml()
You can assign commands to hotkeys and toolbar links. For a toolbar link, just put the execCommand command name into a data-edit attribute. For more info on execCommand, see the QuirksMode and Mozilla Developer documentation.

To pass arguments to a command, separate a command with a space.
...
You can also use input type='text' with a data-edit attribute. When the value is changed, the command from the data-edit attribute will be applied using the input value as the command argument
<input type="text" data-edit="createLink">
If the input type is file, when a file is selected the contents will be read in using the FileReader API and the data URL will be used as the argument
<input type="file" data-edit="insertImage">
To change hotkeys, specify the map of hotkeys to commands in the hotKeys option. For example:
$('#editor').wysiwyg({
hotKeys: {
'ctrl+b meta+b': 'bold',
'ctrl+i meta+i': 'italic',
'ctrl+u meta+u': 'underline',
'ctrl+z meta+z': 'undo',
'ctrl+y meta+y meta+shift+z': 'redo'
}
});
Fired whenever anything changes. See this example events.html
$('#editor').wysiwyg().on('change', function(){
alert('something has been changed on the editor');
});
This editor should work pretty well with mobile devices, but you'll need to consider the following things when styling it:
For the content attachment editor on MindMup, we apply the following rules to mobile device styling:
@gojko @mindmup @jordanh @beatnbite @brutuscat @VictorBjelkholm @mrmrs @tilleryd @pnevels
The original version of this code (below) appeared to be no longer maintained. There were a number of outstanding changes which needed to be merged in and a few which included performance and feature improvements. These have now been included in this master branch.
I'll keep an eye out for future changes/improvements and pull them in as required.
The original version of this tool can be found here: bootstrap-wysiwyg
The MIT License
Copyright (c) 2013 Damjan Vujnovic, David de Florinier, Gojko Adzic
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


|
|
def | __init__ (self, model) |
| |
| def | remove_artefacts (self, 'list-of-dictionaries' records, str testfield) |
| |
| def | format_users_list (self, list users_data) |
| |
|
def | format_two_users_data (self, 'list-of-dictionaries' two_user_data, 'list-of-dictionaries' common_friends) |
| |
|
def | format_user_data (self, 'list-of-dictionaries, but with a single item' user_data) |
| |
| def | company_users (self, company_name) |
| |
| def | two_users (self, user_name_1, user_name_2) |
| |
| def | user (self, user_name) |
| |
◆ company_users()
| def view.View.company_users |
( |
|
self, |
|
|
|
company_name |
|
) |
| |
Returns the dictionary for the list of employees at a given company_name.
◆ format_users_list()
| def view.View.format_users_list |
( |
|
self, |
|
|
list |
users_data |
|
) |
| |
Takes the user_data records (i.e. list-of-dictionaries),
calculates the total number of records and responds ond returns a
dictionary in the specified format:
```
{
'number-of-employees': length of list-of-dictionaries after removing `nan` values,
'employees': [names of employees obtained from `records`],
}
```
Or, if there are no non-`nan`items in the records, returns:
```
{
'number-of-employees': 0,
'employees': [],
'message': 'The company has no employees.'
}
```
◆ remove_artefacts()
| def view.View.remove_artefacts |
( |
|
self, |
|
|
'list-of-dictionaries' |
records, |
|
|
str |
testfield |
|
) |
| |
Takes `records` which is a records format dictionary, i.e. [{col1: val1_1, col2: val_2_1, ...}, {...}, {...}]
and a `testfield` (for exacmple, "col1") string which is the "column" to check for `nan`
Removes the dict record (i.e. the "row") if it has `nan`.
Returns records with the `nan` rows removed.
◆ two_users()
| def view.View.two_users |
( |
|
self, |
|
|
|
user_name_1, |
|
|
|
user_name_2 |
|
) |
| |
Gives the information about the two users as per the specified requirements of the API challenge problem statement.
◆ user()
| def view.View.user |
( |
|
self, |
|
|
|
user_name |
|
) |
| |
Gives the information about user_name as per the specified requirements of the API challenge problem statement.
The documentation for this class was generated from the following file:


|
Panda3D
|
Public Member Functions | |
| def | __init__ (self, free=None) |
| def | __repr__ (self) |
| def | add (self, item) |
| def | checkin (self, item) |
| def | checkout (self) |
| def | cleanup (self, cleanupFunc=None) |
| def | getNumItems (self) |
| def | hasFree (self) |
| def | isFree (self, item) |
| def | isUsed (self, item) |
| def | remove (self, item) |
| def | reset (self) |
Static Public Attributes | |
| notify = DirectNotifyGlobal.directNotify.newCategory("Pool") | |
| def __init__ | ( | self, | |
free = None |
|||
| ) |
| def __repr__ | ( | self | ) |
| def add | ( | self, | |
| item | |||
| ) |
Add an item to the free list.
| def checkin | ( | self, | |
| item | |||
| ) |
Put back a checked out item. Error if the item is not checked out.
| def checkout | ( | self | ) |
Get an arbitrary item from the pool.
| def cleanup | ( | self, | |
cleanupFunc = None |
|||
| ) |
Completely cleanup the pool and all of its objects. cleanupFunc will be called on every free and used item.
| def getNumItems | ( | self | ) |
Returns the number of free items and the number of used items.
| def hasFree | ( | self | ) |
Returns true if there is at least one free item.
| def isFree | ( | self, | |
| item | |||
| ) |
Returns true if this item is free for check out.
| def isUsed | ( | self, | |
| item | |||
| ) |
Returns true if this item has already been checked out.
| def remove | ( | self, | |
| item | |||
| ) |
Remove an item. Error is flagged if the item is not in the pool.
| def reset | ( | self | ) |
Resets the pool so all items are free.
|
static |


Create two trees with HTML & program way. Use same selector for both.
this is some text below the tree.
Selection events should show up here


The code provided here originally demonstrated the main algorithms from Rasmussen and Williams: Gaussian Processes for Machine Learning. It has since grown to allow more likelihood functions, further inference methods and a flexible framework for specifying GPs. Other GP packages can be found here.
The code is written by Carl Edward Rasmussen and Hannes Nickisch; it runs on both Octave 3.2.x and Matlab® 7.x and later. The code is based on previous versions written by Carl Edward Rasmussen and Chris Williams.
All the code including demonstrations and html documentation can be downloaded in a tar or zip archive file.
Minor changes and incremental bugfixes to the current version are documented in the changelog, changes from previous versions are documented in README.
Please read the copyright notice.
After unpacking the tar or zip file you will find 7 subdirectories: cov, doc, inf, lik, mean, prior and util. It is not necessary to install anything to get started, just run the startup script to set your path.
Details about the directory contents and on how to compile mex files can be found in the README. The getting started guide is the remainder of the html file you are currently reading (also available at http://gaussianprocess.org/gpml/code/matlab/doc). A Developer's Guide containing technical documentation is found in manual.pdf, but for the casual user, the guide is below.
Gaussian Processes (GPs) can conveniently be used for Bayesian supervised learning, such as regression and classification. In its simplest form, GP inference can be implemented in a few lines of code. However, in practice, things typically get a little more complicated: you might want to use complicated covariance functions and mean functions, learn good values for hyperparameters, use non-Gaussian likelihood functions (rendering exact inference intractable), use approximate inference algorithms, or combinations of many or all of the above. This is what the GPML software package does.
The remainder of section 3 first presents some essential components of the software in the next subsection. This enables understand the usage for the gp function described in section 3b). A practical example follows in 3c), and the section concludes with a more detailed overview in 3d).Before going straight to the examples, just a brief note about the organization of the package. There are four essential types of objects which you need to know about:
Using the GPML package is simple, there is only one single function to call: gp, it does posterior inference, learns hyperparameters, computes the marginal likelihood and makes predictions. Generally, the gp function takes the following arguments: a hyperparameter struct, an inference method, a mean function, a covariance function, a likelihood function, training inputs, training targets, and possibly test cases. The exact computations done by the function is controlled by the number of input and output arguments in the call. Here is part of the help message for the gp function (follow the link to see the whole thing):
function [varargout] = gp(hyp, inf, mean, cov, lik, x, y, xs, ys) [ ... snip ... ] Two modes are possible: training or prediction: if no test cases are supplied, then the negative log marginal likelihood and its partial derivatives wrt the hyperparameters is computed; this mode is used to fit the hyperparameters. If test cases are given, then the test set predictive probabilities are returned. Usage: training: [nlZ dnlZ ] = gp(hyp, inf, mean, cov, lik, x, y); prediction: [ymu ys2 fmu fs2 ] = gp(hyp, inf, mean, cov, lik, x, y, xs); or: [ymu ys2 fmu fs2 lp] = gp(hyp, inf, mean, cov, lik, x, y, xs, ys); [ ... snip ... ]
Here x and y are training inputs and outputs, and xs and ys are test set inputs and outputs, nlZ is the negative log marginal likelihood and dnlZ its partial derivatives wrt the hyperparameters (which are used for training the hyperparameters). The prediction outputs are ymu and ys2 for test output mean and covariance, and fmu and fs2 are the equivalent quenteties for the corresponding latent variables. Finally, lp are the test output log probabilities.
x = gpml_randn(0.8, 20, 1); % 20 training inputs y = sin(3*x) + 0.1*gpml_randn(0.9, 20, 1); % 20 noisy training targets xs = linspace(-3, 3, 61)'; % 61 test inputsWe need specify the mean, covariance and likelihood functions
meanfunc = []; % empty: don't use a mean function covfunc = @covSEiso; % Squared Exponental covariance function likfunc = @likGauss; % Gaussian likelihoodFinally we initialize the hyperparameter struct
hyp = struct('mean', [], 'cov', [0 0], 'lik', -1);
Note, that the hyperparameter struct must have the three fields mean, cov and lik. Each field must have the number of elements which corresponds to the functions specified. In our case, the mean function is empty, so takes no parameters. The covariance function is covSEiso, the squared exponential with isotropic distance measure, which takes two parameters (see help covSEiso). As explained in the help for the function, the meaning of the hyperparameters is "log of the length-scale" and the "log of the signal std dev". Initializing both of these to zero, corresponds to length-scale and signal std dev to be initialized to one. The Gaussian likelihood function has a single parameter, which is the log of the noise standard deviation, setting the log to zero corresponds to a standard deviation of exp(-1)=0.37.
A common situation with modeling with GPs is that approprate settings of the hyperparameters are not known a priori. The situation is reflected in the above initialization of the hyperparameters, where the values values are specified without careful justification, perhaps based on some vague notions of the magnitudes likely to be involved. Thus, a common task is to set hyperparameters by optimizing the (log) marginal likelihood. This is done as follows
hyp2 = minimize(hyp, @gp, -100, @infGaussLik, meanfunc, covfunc, likfunc, x, y);The minimize function minimizes the negative log marginal likelihood, which is returned by the gp function, together with the partial derivatives wrt the hyperparameters. The inference method is specified to be infGaussLik exact inference. The minimize function is allowed a computational budget of 100 function evaluations. The hyperparameters found are
hyp2 = mean: [] cov: [-0.6352 -0.1045] lik: -2.3824showing that the covariance characteristic length-scale is exp(-0.6352)=0.53, the signal std dev is exp(-0.1045)=0.90 and the noise std dev is exp(-2.3824)=0.092 in good agreement with the data generating process. To make predictions using these hyperparameters
[mu s2] = gp(hyp2, @infGaussLik, meanfunc, covfunc, likfunc, x, y, xs);To plot the predictive mean at the test points together with the predictive 95% confidence bounds and the training data
f = [mu+2*sqrt(s2); flipdim(mu-2*sqrt(s2),1)]; fill([xs; flipdim(xs,1)], f, [7 7 7]/8) hold on; plot(xs, mu); plot(x, y, '+')which produces a plot like this
The previous section shows a minimalist example, using the central concepts of GPML. This section provides a less simplistic overview, mainly through a number of useful comments and pointers to more complete treatments.
In order to be able to find things, the toolbox is organized into the following directories mean for mean functions, cov for covariance functions, lik for likelihood functions, inf for inference methods prior for priors and mcmc for Markov Chain monte Carlo tools, doc for documentation and util for general utilities.
In addition to this structure, the naming of functions within some of these directories also start with the letters mean, cov, lik and inf as a further mnemonic aid.
The following paragraphs contain useful further details about some of the concepts we have already used.
Mean functions and covariance functions. As detailed in meanFunctions and covFunctions there are actually two types of these, simple and composite. Composite functions are used to compose simple functions into more expressive structures. For example
meanfunc = {@meanSum, {@meanLinear, @meanConst}};specifies a mean function which is a sum of a linear and a constant part. Note how composite functions are specified using cell arrays. Note also, that the corresponding mean hyperparameter will consist of a vector containing the concatenation of the different parts of the mean function. If you call a mean or covariance function without arguments, they will return a string indicating the number of hyperparameters expected; this also works for composite covariance functions; the letter D in the string designates the dimension of the inputs.
Likelihood functions. As detailed in likFunctions there are also simple and composite likelihood functions; the only composite likelihood function is likMix, which implements a mixture of multiple likelihoods.
Inference methods.
Whereas all mean functions and covariance functions may be used in any context, there are some restrictions on which likelihood functions may be used with which inference method. An exhaustive compatibility matrix between likelihoods (rows) and inference methods (columns) is given in the table below:
| Plain Regression Likelihoods | ||||||||||
| Approx. cov. |
()* | type, output domain |
alternative names |
|||||||
Inference |
GPML name | Gaussian noise infGaussLik |
Laplace infLaplace |
Variational Bayes infVB |
EP infEP FITC_infEP |
Kullback Leibler infKL |
Sampling infMCMC |
LOO infLOO |
||
| Likelihood | ||||||||||
| Gaussian | likGauss | regression, IR | ||||||||
| Warped Gaussian | likGaussWarp | regression, IR | ||||||||
| Gumbel | likGumbel | regression, IR | extremal value regression | |||||||
| Sech squared | likSech2 | regression, IR | logistic distribution | |||||||
| Laplacian | likLaplace | regression, IR | double exponential | |||||||
| Student's t | likT | regression, IR | ||||||||
| Classification Likelihoods | ||||||||||
| Uniform | likUni | classification, ±1 | label noise | |||||||
| Error function | likErf | classification, ±1 | probit regression | |||||||
| Logistic function | likLogistic | classification, ±1 | logistic regression logit regression |
|||||||
| Generalized Linear Model Likelihoods | ||||||||||
| Approx. cov. |
()* | type, output domain |
alternative names |
|||||||
Inference |
GPML name | Gaussian noise infGaussLik |
Laplace infLaplace |
Variational Bayes infVB |
EP infEP FITC_infEP |
Kullback Leibler infKL |
Sampling infMCMC |
LOO infLOO |
||
| Likelihood | ||||||||||
| Weibull | likWeibull | positive data, IR+\{0} | nonnegative regression | |||||||
| Gamma | likGamma | positive data, IR+\{0} | nonnegative regression | |||||||
| Exponential | likExp | positive data, IR+\{0} | nonnegative regression | |||||||
| Inverse Gaussian | likInvGauss | positive data, IR+\{0} | nonnegative regression | |||||||
| Poisson | likPoisson | ()** | count data, IN | Poisson regression | ||||||
| Beta | likBeta | interval data, [0,1] | range regression | |||||||
| Composite Likelihoods | ||||||||||
| Mixture | likMix | classification, ±1 and regression, IR | mixing meta likelihood |
* EP supports FITC via a separate function. No support for the generic covariance
approximations.
** EP might not converge in some cases since quadrature is used.
All of the objects described above are written in a modular way, so you can add functionality if you feel constrained despite the considerable flexibility provided. Details about how to do this are provided in the developer documentation.
Inference by MCMC sampling is the only inference method that cannot be used as a black box. Also gradient-based marginal likelihood optimisation is not possible with MCMC. Please see usageSampling for a toy example illustrating the usage of the implemented samplers.
Instead of exhaustively explaining all the possibilities, we will give two illustrative examples to give you the idea; one for regression and one for classification. You can either follow the example here on this page, or using the two scripts demoRegression and demoClassification (using the scripts, you still need to follow the explanation on this page).
You can either follow the example here on this page, or use the script demoRegression.
This is a simple example, where we first generate n=20 data points from a GP, where the inputs are scalar (so that it is easy to plot what is going on). We then use various other GPs to make inferences about the underlying function.
First, generate some data from a Gaussian process (it is not essential to understand the details of this):
clear all, close all meanfunc = {@meanSum, {@meanLinear, @meanConst}}; hyp.mean = [0.5; 1]; covfunc = {@covMaterniso, 3}; ell = 1/4; sf = 1; hyp.cov = log([ell; sf]); likfunc = @likGauss; sn = 0.1; hyp.lik = log(sn); n = 20; x = gpml_randn(0.3, n, 1); K = feval(covfunc{:}, hyp.cov, x); mu = feval(meanfunc{:}, hyp.mean, x); y = chol(K)'*gpml_randn(0.15, n, 1) + mu + exp(hyp.lik)*gpml_randn(0.2, n, 1); plot(x, y, '+')
Above, we first specify the mean function meanfunc, covariance function covfunc of a GP and a likelihood function, likfunc. The corresponding hyperparameters are specified in the hyp structure:
The mean function is composite, adding (using meanSum function) a linear (meanLinear) and a constant (meanConst) to get an affine function. Note, how the different components are composed using cell arrays. The hyperparameters for the mean are given in hyp.mean and consists of a single (because the input will one dimensional, i.e. D=1) slope (set to 0.5) and an off-set (set to 1). The number and the order of these hyperparameters conform to the mean function specification. You can find out how many hyperparameters a mean (or covariance or likelihood function) expects by calling it without arguments, such as feval(meanfunc{:}). For more information on mean functions see meanFunctions and the directory mean/.
The covariance function is of the Matérn form with isotropic distance measure covMaterniso. This covariance function is also composite, as it takes a constant (related to the smoothness of the GP), which in this case is set to 3. The covariance function takes two hyperparameters, a characteristic length-scale ell and the standard deviation of the signal sf. Note, that these positive parameters are represented in hyp.cov using their logarithms. For more information on covariance functions see covFunctions and cov/.
Finally, the likelihood function is specified to be Gaussian. The standard deviation of the noise sn is set to 0.1. Again, the representation in the hyp.lik is given in terms of its logarithm. For more information about likelihood functions, see likFunctions and lik/.
Then, we generate a dataset with n=20 examples. The inputs x are drawn from a unit Gaussian (using the gpml_randn utility, which generates unit Gaussian pseudo random numbers with a specified seed). We then evaluate the covariance matrix K and the mean vector m by calling the corresponding functions with the hyperparameters and the input locations x. Finally, the targets y are computed by drawing randomly from a Gaussian with the desired covariance and mean and adding Gaussian noise with standard deviation exp(hyp.lik). The above code is a bit special because we explicitly call the mean and covariance functions (in order to generate samples from a GP); ordinarily, we would only directly call the gp function.
Let's ask the model to compute the (joint) negative log probability (density) nlml (also called marginal likelihood or evidence) and to generalize from the training data to other (test) inputs z:
nlml = gp(hyp, @infGaussLik, meanfunc, covfunc, likfunc, x, y) z = linspace(-1.9, 1.9, 101)'; [m s2] = gp(hyp, @infGaussLik, meanfunc, covfunc, likfunc, x, y, z); f = [m+2*sqrt(s2); flipdim(m-2*sqrt(s2),1)]; fill([z; flipdim(z,1)], f, [7 7 7]/8) hold on; plot(z, m); plot(x, y, '+')
The gp function is called with a struct of hyperparameters hyp, and inference method, in this case @infGaussLik for exact inference and the mean, covariance and likelihood functions, as well as the inputs and outputs of the training data. With no test inputs, gp returns the negative log probability of the training data, in this example nlml=11.97.
To compute the predictions at test locations we add the test inputs z as a final argument, and gp returns the mean m variance s2 at the test location. The program is using algorithm 2.1 from the GPML book. Plotting the mean function plus/minus two standard deviations (corresponding to a 95% confidence interval):
Typically, we would not a priori know the values of the hyperparameters hyp, let alone the form of the mean, covariance or likelihood functions. So, let's pretend we didn't know any of this. We assume a particular structure and learn suitable hyperparameters:
covfunc = @covSEiso; hyp2.cov = [0; 0]; hyp2.lik = log(0.1); hyp2 = minimize(hyp2, @gp, -100, @infGaussLik, [], covfunc, likfunc, x, y); exp(hyp2.lik) nlml2 = gp(hyp2, @infGaussLik, [], covfunc, likfunc, x, y) [m s2] = gp(hyp2, @infGaussLik, [], covfunc, likfunc, x, y, z); f = [m+2*sqrt(s2); flipdim(m-2*sqrt(s2),1)]; fill([z; flipdim(z,1)], f, [7 7 7]/8) hold on; plot(z, m); plot(x, y, '+')
First, we guess that a squared exponential covariance function covSEiso may be suitable. This covariance function takes two hyperparameters: a characteristic length-scale and a signal standard deviation (magnitude). These hyperparameters are non-negative and represented by their logarithms; thus, initializing hyp2.cov to zero, correspond to unit characteristic length-scale and unit signal standard deviation. The likelihood hyperparameter in hyp2.lik is also initialized. We assume that the mean function is zero, so we simply ignore it (and when in the following we call gp, we give an empty argument for the mean function).
In the following line, we optimize over the hyperparameters, by minimizing the negative log marginal likelihood w.r.t. the hyperparameters. The third parameter in the call to minimize limits the number of function evaluations to a maximum of 100. The inferred noise standard deviation is exp(hyp2.lik)=0.15, somewhat larger than the one used to generate the data (0.1). The final negative log marginal likelihood is nlml2=14.13, showing that the joint probability (density) of the training data is about exp(14.13-11.97)=8.7 times smaller than for the setup actually generating the data. Finally, we plot the predictive distribution.
This plot shows clearly, that the model is indeed quite different from the generating process. This is due to the different specifications of both the mean and covariance functions. Below we'll try to do a better job, by allowing more flexibility in the specification.
Note that the confidence interval in this plot is the confidence for the distribution of the (noisy) data. If instead you want the confidence region for the underlying function, you should use the 3rd and 4th output arguments from gp as these refer to the latent process, rather than the data points.
hyp.cov = [0; 0]; hyp.mean = [0; 0]; hyp.lik = log(0.1); hyp = minimize(hyp, @gp, -100, @infGaussLik, meanfunc, covfunc, likfunc, x, y); [m s2] = gp(hyp, @infGaussLik, meanfunc, covfunc, likfunc, x, y, z); f = [m+2*sqrt(s2); flipdim(m-2*sqrt(s2),1)]; fill([z; flipdim(z,1)], f, [7 7 7]/8) hold on; plot(z, m); plot(x, y, '+');
Here, we have changed the specification by adding the affine mean function. All the hyperparameters are learnt by optimizing the marginal likelihood.
This shows that a much better fit is achieved when allowing a mean function (although the covariance function is still different from that of the generating process).
It can be usefull to put a prior distribution on (a part of) the hyperparameters. Sometimes, one may want to exclude some hyperparameters from the optimisation i.e. fix their values beforehand and treat them as constants.
In these cases, a hyperprior comes to bear. A hyperprior is specified by augmenting the inf parameter of gp.m In the regression before, we had inf = @infGaussLik;. To put a Gaussian prior on the first mean hyperparameter hyp.mean(1) and a Laplacian prior on the second mean hyperparameter hyp.mean(2) and wished to fix the noise variance hyperparameter hyp.lik, we simple need to set up the corresponding prior structure as detailed below.
mu = 1.0; s2 = 0.01^2; prior.mean = {{@priorGauss,mu,s2}; {'priorLaplace',mu,s2}}; prior.lik = {{@priorDelta}}; inf = {@infPrior,@infGaussLik,prior}; hyp = minimize(hyp, @gp, -100, inf, meanfunc, covfunc, likfunc, x, y);
Further examples are provided in usagePrior.
In case the number of training inputs x exceeds a few thousands, exact inference takes too long. We offer the sparse approximations to deal with these cases. The general idea is to use inducing points u and to base the computations on cross-covariances between training, test and inducing points only. See demoSparse for a quick overview over possible options.
Using sparse approximations is very simple, we just have to wrap the covariance function covfunc into apxSparse.m and call gp.m with the inference method infGaussLik.m as demonstrated by the following lines of code.
nu = fix(n/2); u = linspace(-1.3,1.3,nu)'; covfuncF = {@apxSparse, {covfunc}, u}; inf = @(varargin) infGaussLik(varargin{:}, struct('s', 0.0)); [mF s2F] = gp(hyp, inf, meanfunc, covfuncF, likfunc, x, y, z);
In this code, a sparse approximate covariance function is defined by composing the apxSparse function with a covariance function and a set of inducing inputs. Further, an inference method inf is defined by concatenating the struct('s', 0.0) to the infGaussLik inference method. The value of the appended s can be used to chose between s=1 for Fully Independent Training Conditional (FITC) approximation, or s=0 corresponding the Variational Free Energy (VFE) approximation, or intermediate values of 0<s<1 corresponding to Sparse Power Expectation Propagation (SPEP).
We define equispaced inducing points u that are shown in the figure as black circles. Note that the predictive variance is overestimated outside the support of the inducing inputs. In a multivariate example where densely sampled inducing inputs are infeasible, one can simply use a random subset of the training points.
nu = fix(n/2); iu = randperm(n); iu = iu(1:nu); u = x(iu,:);
Another possibility is to specify the inducing inputs as a part of the hyperparmeters using the field hyp.xu
hyp.xu = u;in which case optimization of the hyperparameters will also optimize the inducing inputs (note that, when inducing inputs are given as a field in the hyperparameters, then these take precedence over inducing inputs specified in to the apxSparse function).
A covariance function factorising over coordinate axes evaluated on a rectilinear (not necessarily equispaced) grid of data points leads to a covariance matrix with Kronecker structure. This can be exploited to scale GPs beyond the O(n³) limit. Observations not located on the grid can be interpolated from the grid values. The example below contains the most relevant code from the script demoGrid2d, where we extrapolate a pixel image beyond its boundaries. An instructive example in 1d can be found in demoGrid1d.
For a comprehensive set of examples and more resources, see a website by Andrew Wilson.
We start off by setting up the training data and the GP on a [-2,2]x[-3,3] lattice with 15600 pixels -- a size where a usual dense GP would be computationally infeasible. We use a lattice only for the purpose of visualisation.
x1 = linspace(-2,2,120); x2 = linspace(-3,3,130); x = apxGrid('expand',{x1',x2'}); y = sin(x(:,2)) + x(:,1) + 0.1*gpml_randn(1,[size(x,1),1]);Then, we define the locations where we would like to have the predictions i.e. a [-4,4]x[-6,6] lattice to see the result of the extrapolation.
xs1 = linspace(-4,4,100); xs2 = linspace(-6,6,110); xs = apxGrid('expand',{xs1',xs2'});Next, we construct the grid for KISS/SKI GP using an auxiliary function so that both training data x and the test data xs are properly covered.
xg = apxGrid('create',[x;xs],true,[50,70]);
Now that the data set is well-defined, we specify our GP model along with initial values for the hyperparameter by wrapping the covariance functions into apxGrid, GPML's grid-based covariance approximation method.
cov = {{@covSEiso},{@covSEiso}}; covg = {@apxGrid,cov,xg}; mean = {@meanZero}; lik = {@likGauss}; hyp.cov = zeros(4,1); hyp.mean = []; hyp.lik = log(0.1);As a next step, we perform hyperparameter optimisation as with a usual GP model using the inference method infGaussLik which only supports likGauss. In order to do so, we specify parameters for the LCG: the maximum number of iterations and the convergence threshold via the opt variable.
opt.cg_maxit = 200; opt.cg_tol = 5e-3; infg = @(varargin) infGaussLik(varargin{:},opt); hyp = minimize(hyp,@gp,-50,infg,[],covg,[],x,y);
Finally, we make use of grid interpolation to compute predictions very rapidly with the post.predict utility provided by the infGrid method.
[post,nlZ,dnlZ] = infGrid(hyp,{@meanZero},covg,{@likGauss},x,y,opt); [fm,fs2,ym,ys2] = post.predict(xs);Alternatively, we can use the usual pathway based on gp,
post.L = @(a) zeros(size(a)); ym = gp(hyp,infg,[],covg,[],x,post,xs);where we have switched of the predictive variance computations as they are very demanding to evaluate on an entire lattice. If the are required for a larger set of test points xs, one can resort to sampling-based estimates.
The figure below summarizes what we have done. On the left, we see the training data and on the right the GP predictive mean.
You can either follow the example here on this page, or use the script demoClassification.
The difference between regression and classification isn't of fundamental nature. We can use a Gaussian process latent function in essentially the same way, it is just that the Gaussian likelihood function often used for regression is inappropriate for classification. And since exact inference is only possible for Gaussian likelihood, we also need an alternative, approximate, inference method.
Here, we will demonstrate binary classification, using two partially overlapping Gaussian sources of data in two dimensions. First we generate the data:
clear all, close all n1 = 80; n2 = 40; % number of data points from each class S1 = eye(2); S2 = [1 0.95; 0.95 1]; % the two covariance matrices m1 = [0.75; 0]; m2 = [-0.75; 0]; % the two means x1 = bsxfun(@plus, chol(S1)'*gpml_randn(0.2, 2, n1), m1); x2 = bsxfun(@plus, chol(S2)'*gpml_randn(0.3, 2, n2), m2); x = [x1 x2]'; y = [-ones(1,n1) ones(1,n2)]'; plot(x1(1,:), x1(2,:), 'b+'); hold on; plot(x2(1,:), x2(2,:), 'r+');
120 data points are generated from two Gaussians with different means and covariances. One Gaussian is isotropic and contains 2/3 of the data (blue), the other is highly correlated and contains 1/3 of the points (red). Note, that the labels for the targets are ±1 (and not 0/1).
In the plot, we superimpose the data points with the posterior equi-probability contour lines for the probability of class two given complete information about the generating mechanism
[t1 t2] = meshgrid(-4:0.1:4,-4:0.1:4); t = [t1(:) t2(:)]; n = length(t); % these are the test inputs tmm = bsxfun(@minus, t, m1'); p1 = n1*exp(-sum(tmm*inv(S1).*tmm/2,2))/sqrt(det(S1)); tmm = bsxfun(@minus, t, m2'); p2 = n2*exp(-sum(tmm*inv(S2).*tmm/2,2))/sqrt(det(S2)); contour(t1, t2, reshape(p2./(p1+p2), size(t1)), [0.1:0.1:0.9]);
We specify a Gaussian process model as follows: a constant mean function, with initial parameter set to 0, a squared exponential with automatic relevance determination (ARD) covariance function covSEard. This covariance function has one characteristic length-scale parameter for each dimension of the input space, and a signal magnitude parameter, for a total of 3 parameters (as the input dimension is D=2). ARD with separate length-scales for each input dimension is a very powerful tool to learn which inputs are important for predictions: if length-scales are short, inputs are very important, and when they grow very long (compared to the spread of the data), the corresponding inputs will be largely ignored. Both length-scales and the signal magnitude are initialized to 1 (and represented in the log space). Finally, the likelihood function likErf has the shape of the error-function (or cumulative Gaussian), which doesn't take any hyperparameters (so hyp.lik does not exist).
meanfunc = @meanConst; hyp.mean = 0; covfunc = @covSEard; ell = 1.0; sf = 1.0; hyp.cov = log([ell ell sf]); likfunc = @likErf; hyp = minimize(hyp, @gp, -40, @infEP, meanfunc, covfunc, likfunc, x, y); [a b c d lp] = gp(hyp, @infEP, meanfunc, covfunc, likfunc, x, y, t, ones(n, 1)); plot(x1(1,:), x1(2,:), 'b+'); hold on; plot(x2(1,:), x2(2,:), 'r+') contour(t1, t2, reshape(exp(lp), size(t1)), [0.1:0.1:0.9]);
We train the hyperparameters using minimize, to minimize the negative log marginal likelihood. We allow for 40 function evaluations, and specify that inference should be done with the Expectation Propagation (EP) inference method @infEP, and pass the usual parameters. Training is done using algorithm 3.5 and 5.2 from the gpml book. When computing test probabilities, we call gp with additional test inputs, and as the last argument a vector of targets for which the log probabilities lp should be computed. The fist four output arguments of the function are mean and variance for the targets and corresponding latent variables respectively. The test set predictions are computed using algorithm 3.6 from the GPML book. The contour plot for the predictive distribution is shown below. Note, that the predictive probability is fairly close to the probabilities of the generating process in regions of high data density. Note also, that as you move away from the data, the probability approaches 1/3, the overall class probability.
Examining the two ARD characteristic length-scale parameters after learning, you will find that they are fairly similar, reflecting the fact that for this data set, both inputs important.
In case the number of training inputs x exceeds a few hundreds, approximate inference using infLaplace.m, infEP.m and infVB.m takes too long. As in regression, we offer the FITC approximation based on a low-rank plus diagonal approximation to the exact covariance to deal with these cases. The general idea is to use inducing points u and to base the computations on cross-covariances between training, test and inducing points only.
Using the FITC approximation is very simple, we just have to wrap the covariance function covfunc into apxSparse.m and call gp.m with the inference methods infLaplace.m or infVB.m as demonstrated by the following lines of code.
[u1,u2] = meshgrid(linspace(-2,2,5)); u = [u1(:),u2(:)]; clear u1; clear u2 nu = size(u,1); covfuncF = {@apxSparse, {covfunc}, u}; inffunc = @infLaplace; % or infFITC_EP hyp = minimize(hyp, @gp, -40, inffunc, meanfunc, covfuncF, likfunc, x, y); [a b c d lp] = gp(hyp, inffunc, meanfunc, covfuncF, likfunc, x, y, t, ones(n,1));
We define equispaced inducing points u that are shown in the figure as black circles. Alternatively, a random subset of the training points can be used as inducing points.
Similar to regression using infGaussLik, we can perform approximate inference using infLaplace to scale GPs beyond the O(n³) limit. Please visit the website by Seth Flaxman for an extended example and related datasets.
Innumerable colleagues have helped to improve this software. Some of these are: John Cunningham, Máté Lengyel, Joris Mooij, Iain Murray, David Duvenaud, Andrew McHutchon, Rowan McAllister, Daniel Marthaler, Giampiero Salvi, Mark van der Wilk, Marco Fraccaro, Dali Wei, Ernst Kloppenburg, Ryan Turner, Seth Flaxman and Chris Williams. Especially Ed Snelson helped to improve the code and to include sparse approximations and Roman Garnett and José Vallet helped to include hyperparameter priors. The spectral mixture covariance function and the grid-based inference were contributed by Andrew Gordon Wilson and periodic covariances were added by James Robert Lloyd.


A channel to discuss trading. For useful links and more info click the pinned messages to the right.
100 messages
Before 05-Dec-19 12:00 AM
blackjok3r02-Sep-18 08:20 AM
Deleted User02-Sep-18 08:21 AM
Idk how it works or if you can make it not able to see how much they sent, refund if only 1 person sent in etcetc
Would be a fun idea for a game though :P
Got some harpoonin to do
jl777c02-Sep-18 08:24 AM
it could work even with a non-random matchup using a commitment round
0. match up with someone
1. commit to an amount and post the hash of it (salted)
2. wait for both commits
3. reveal (verify both hashes, noncompliance is automatic loss)
Deleted User02-Sep-18 08:26 AM
Could have 1-10, 11-100, 101-1000 min max buyins so there could be a limit to those who plan to always all in, and if 2 people do go all in itd be rng :P
jl777c02-Sep-18 08:32 AM
if 2 people go all in, wouldnt the one with more just win?
in the event of tie, it should go to the dealer
Deleted User02-Sep-18 08:33 AM
Yeah but if hypothetically someone wanted to make this a game to play for fun like poker blackjack etc, and a megawhale whos always all in, or some people who want to do some 5 10kmd stakes and not risk their whole stack want to play,
then having limits for buyins could make people play it more actively I mean if i only had 500kmd, I wouldnt want to go up against someone with 100,000
Someone with VERY VERY deep pockets is buying right now. If you are awake this is a historic moment in the making. He is literally BEGGING people to margin short into him on @bitfinex right now. MARGIN SHORTS UP 40%+
If maxlimit tables wouldnt it be optimal to always bet max?
 It's a similar version of the game you described here.
Deleted User02-Sep-18 10:09 AM
@PHBA2061 saw it in its early stages, regret not fomoing LOL but nah. Looking for a more quick instant game like blackjack etc
grewalsatinder02-Sep-18 10:51 AM
@Deleted User instead of just one type, make it like a heads or tales type.
not just more amount but also the lesser amount
or just simple as heads or tales
that's from chips games
Deleted User02-Sep-18 10:52 AM
yeah heads or tails alone would be good HAHA
Just wanted to harpoon some cocky people
grewalsatinder02-Sep-18 10:52 AM
nice idea for the simple game
Yassin02-Sep-18 11:43 AM
shit
100btc order
yorklab02-Sep-18 12:01 PM
I saw that. We'll see if it actually stays there.

Looks like bch is working there's a 21.4mb block
4hrs worth of BTC tx's in one block
jl777c02-Sep-18 02:15 PM
actually 1 hr of 4MB segwit blocks
BTC core supports 4MB blocks as long as they are segwit blocks
plz ignore the contradiction of them saying even 2MB blocks are dangerous, it is only dangerous if it isnt segwit, that must b eit
2
BlackJesus02-Sep-18 02:48 PM
Aren't segwit blocks actually like 1.6-1.7mb worth of transactions spread across 3.7mb worth of space
I read something about the change from size to weight was actually a reduction in efficiency
Like 4mb block size is 4mb worth of tx whereas 4mb weight is not 4mb worth of tx due to the extra code needed for segwit
1
ComputerGenie 👴👴👴02-Sep-18 02:50 PM
the other way around
segwit blocks are "bigger" because of the "slight-of-hand" of not counting signatures towards the weight of a block, as such blocks may be larger in total size than pre-segwit
4mb =4mb =4mb
BlackJesus02-Sep-18 02:51 PM
I know they lost efficiency implementing segwit
You cannot tell me the code to implement segwit and rectify signatures on the backend is not extra code
Code = bits bits= space
ComputerGenie 👴👴👴02-Sep-18 02:54 PM
Explain SegWit in 2 lines.
OK
Core needed to pretend they are improving Bitcoin.
Core lied and said that if you don't count signatures then it's safe to bloat the chain, whereas it's unsafe if you do count them.(edited)
2
2
You are not explaining the tech
Since when is "Cups and Balls" considered "tech"?
1
It's too early in the am for me to go on a tirade about how LN isn't Bitcoin and is barely even Bitcoin-adjacent
2
jorian02-Sep-18 03:06 PM
we had a couple
dunno where they went
i remember manfromaus
but he might've gotten lost during the discord migration
BlackJesus02-Sep-18 03:10 PM
Yea manfromaus was big on BTC and hated bitcoin cash for some unbeknownst reason. Like he irrationally hated the product of BCH because of "Roger Ver and Jihan Wu taking over bitcoin". when he didn't realize blockstream had already done that.
Hollowman900002-Sep-18 03:11 PM
Never fails, political shitpost, follower count -1
Those who remain are pretty hardened at this point
Crypto right wing is probably all that’s left
All 12 of em
4
Gordon Komodo02-Sep-18 04:03 PM
500k kmd buy wall @18000 :D on binance(edited)
Hollowman900002-Sep-18 04:04 PM
Blatant manipulation there
3
Sell into chumps above buy wall
Drop buy wall, initiate
Panic dump
Rebuy lower
Wash rinse repeat
Gordon Komodo02-Sep-18 04:06 PM
the same old trick
Hollowman900002-Sep-18 04:07 PM
Let’s see how many chuckleheads get ground up in that bullshit
How much $BTC has been absorbed by hidden buy walls? (apologies if I missed any)
4.3k at 6300.
5.3k at 6387.
2.6k at 6400.
2.5k at 6685.
1.7k at 6500.
3.3k at 6700.
1.8k at 7290.
4.1k at 7300.
3k at 7320.
2.9k at 7330.
Total: 31,500 Bitcoin and counting.
Retweets
155
Likes
360
Interesting
Upvoting all kmd replies in that reddit thread
ryman11202-Sep-18 07:35 PM
It blows my mind that they think that is the fastest txs decentralized coin.  I've got bdex running on a remote machine and another bdex on a local. My order that i place on the remote do not show up on the local but the orders i place on the local show up in the remote. Im looking at both instances on the local machine (remote bdex via ssh tunnel)
its almost like my orders on the remote are not being broadcast
but the advisories indicate my order is being placed
ryman11202-Sep-18 09:17 PM
This place is dead what gives?
polycryptoblog02-Sep-18 09:49 PM
Labor Day weekend in the us
ryman11202-Sep-18 10:36 PM
Im in the U.S. maybe I have a problem? Lol. Happy Labor day folks. I just got off work so I guess it is labor day.


Sorry, your browser does not support CSS Grid.
CSS Grid Gallery
Card overlay (new example - click me!)
brushes
sunglasses mural
wire structure
lights formation
dancer
wire structure
wire structure
sunglasses mural
lights formation
brushes
dancer
brushes
brushes
lights formation


|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Original encoding lost after transformation
The encoding of the source file is interpreted by the XML parser which just reports unicode character positions in an encoding neutral way so xslt doesn't have any record of the original encoding. You can ask that it outputs in latin 1 by going <xsl:output encoding="iso-8859-1"/> Note however that every XML application has to accept utf8 but support for iso-8859-1 is an optional feature so (in theory at least) your resulting document will be less portable. You say you got: Some transformations (depending on the source xml) now fail on the second pass as the first pass returns data with the wrong UTF-8 declaration above. The error message is: java.io.UTFDataFormatException: Invalid byte 2 of 2-byte UTF-8 sequence It's most unlikely that XSLT writes out a file with a bad encoding declaration so this is probably an indication of another error somewhere in your processing chain. Note that if you are doing two transformations back to back from java (or any other similar API) you almost certainly should not be encoding and decoding the intermediate stage at all. Most XSLT processors will allow you to pass the result tree of the first transform directly to the second transform without having to serialise it in some encoding and then re-parse it. David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|


"""Implementing a categorical discrete random variable along the lines of
`scipy.rv_discrete`, which required a bit more effort and finesse than would
generally be considered preferable.
"""
import numpy as np
import scipy.linalg
import scipy.stats
import mdpy
from numbers import Number
[docs]class categorical(scipy.stats._distn_infrastructure.rv_sample):
"""
A class created to express floating point categorical random variables in
terms of `scipy` random variables.
Note
----
For reasons explored below, I am unsure if I've overridden everything that
should be overridden.
The `pmf`, `cdf`, `mean`,`var`, and `entropy` methods appear to work.
Rant
----
The (ab)use of metaprogramming in `scipy.stats` made this substantially more
difficult than it had to be.
If you're ever in the mood for a terrible time, read [the source code](https://github.com/scipy/scipy/blob/v0.18.1/scipy/stats/_distn_infrastructure.py)
for the `rv_discrete` class.
It appears that they have refactored `rv_sample` *into* `rv_discrete`, so
that `rv_discrete` actually determines at class instantiation whether it
will actually be `rv_discrete` or a `rv_sample`, which is a subclass of
`rv_discrete`,
"""
def __init__(self, outcomes, weights=None, **kwargs):
if isinstance(outcomes, Number):
outcomes = np.array([outcomes])
if weights is None:
weights = [1 for i in outcomes]
# Assign probabilities according to weights
probs = weights/np.sum(weights)
# TODO: Check validity
self.weights = np.array(weights)
self.outcomes = np.array(outcomes)
self.probs = np.array(probs)
self.events = list(zip(outcomes, probs))
# Set the 'hidden' random variable mapping states to outcomes and hope
# that scipy doesn't implement things that fail with non-integers
self.__privaterv = scipy.stats.rv_discrete(values=(np.arange(len(probs)), probs))()
super(categorical, self).__init__(values=(outcomes, probs), name='categorical', inc=0.5)
[docs] def rvs(self, *args, **kwargs):
"""Overriding to provide support for non-integer, uh, support."""
choices = self.__privaterv.rvs(*args, **kwargs)
return self.outcomes[choices]
[docs] def pmf(self, k, *args, **kwds):
"""Probability mass function at k of the given RV.
Parameters
----------
k : array_like
Quantiles.
arg1, arg2, arg3,... : array_like
The shape parameter(s) for the distribution (see docstring of the
instance object for more information)
loc : array_like, optional
Location parameter (default=0).

Changed:
```
--- cond1 = (k >= self.a) & (k <= self.b) & self._nonzero(k, *args)
+++ cond1 = (k >= self.a) & (k <= self.b)
--- goodargs = argsreduce(cond, *((k,)+args))
+++ goodargs = (k,) + args
```
+ some misc. comments
Note that `self._nonzero(k, *args)` is exactly equivalent to `floor(k) == k`,
so not only do you have higher overhead from function calls, but it's not even
shorter! And it's only used in TWO places.
Also, a lot of the internal functions appear to exist just to alias (and therefore
slow down) existing `numpy` functions.
"""
args, loc, _ = self._parse_args(*args, **kwds)
k, loc = map(scipy.asarray, (k, loc))
args = tuple(map(scipy.asarray, args))
k = scipy.asarray((k-loc))
cond0 = self._argcheck(*args)
cond1 = (k >= self.a) & (k <= self.b)
cond = cond0 & cond1
output = scipy.zeros(scipy.shape(cond), 'd')
scipy.place(output, (1-cond0) + np.isnan(k), self.badvalue)
if np.any(cond):
# I have no idea what `goodargs` does and I just don't care anymore
goodargs = (k,) + args
scipy.place(output, cond, np.clip(self._pmf(*goodargs), 0, 1))
if output.ndim == 0:
return output[()]
return output
[docs]def drv(*args, **kwargs):
"""A function that creates and returns a `categorical` random variable, but
is shorter to type.
"""
return categorical(*args, **kwargs)


Ben Evans
December 4, 2018
Container Image: A self-contained file(s) needed to run application(s)
Container: A running instance of an image
| Pro | Con |
|---|---|
| Light-weight | Linux best supported |
| Fast start time | Another layer of abstraction |
| Batteries included | Additional development complexity |
| Shareable | Licensed software can be tricky |
| Reproducible |
GPU-enabled IPython w/TensorFlow on a GPU node:
srun --pty -p gpu -c 2 --gres gpu:1 --mem 24G \
singularity exec --nv \
docker://tensorflow/tensorflow:latest-gpu ipython
singularity run image.simg
singularity exec docker://org/image program --option=value
singularity shell -s /bin/bash library://image
singularity run
%runscript
or ENTRYPOINT
specifiessingularity exec
PATH
inside the containersingularity shell
-s/--shell
My application is available as a container image from somewhere.
# 2.6
singularity build my_container.simg \
docker://brevans/my_container:latest
# 3.0
singularity build my_container.sif \
docker://brevans/my_container:latest
* You can only build containers from docker/shub/library on cluster
Use the image
singularity run my_container.simg inputfile.txt \
/gpfs/ysm/project/be59/output_folder
singularity exec my_container.simg python my_script.py
singularity shell -s /bin/bash my_container.simg
Docker links take the form of:
docker://[registry]/[namespace]/<repo_name>:[repo_tag]
You may want to modify the container's environment at runtime
SINGULARITYENV_
PATH
:
SINGULARITYENV_PREPEND_PATH
- prependSINGULARITYENV_APPEND_PATH
- appendSINGULARITYENV_PATH
- override# default is ~/.singularity
export SINGULARITY_CACHEDIR=~/scratch60/.singularity
# or
export SINGULARITY_CACHEDIR=/tmp/${USER}/.singularity
/data
-B/--bind
:singularity run --bind /path/outside:/path/inside \
my_container.simg
set +o history
export SINGULARITY_DOCKER_USERNAME=brevans
export SINGULARITY_DOCKER_PASSWORD=password123
set -o history
Quick way to determine which files are included in image
singularity run/exec/shell --containall ...
Bind GPU drivers properly with CUDA runtime installed inside container
singularity run/exec/shell --nv ...
I want to run the newest RStudio and tidyverse.
see: rocker-project.org
job file:
#!/bin/bash
#SBATCH -c 4 -t 2-00:00:00
mkdir -p /tmp/${USER}
export SINGULARITYENV_DISABLE_AUTH=true
singularity run -B /tmp/${USER}:/tmp \
docker://rocker/geospatial:3.5.1
Reverse ssh
tunnel:
ssh -NL 8787:cxxnxx:8787 grace.hpc.yale.edu
Then connect to http://localhost:8787
/etc/rstudio/rserver.conf
When you have to configure your own
/root
$TMP
or $HOME
ENTRYPOINT
to specify default runtime behaviorldconfig
at the end of your Dockerfile
A half-fix for my RStudio issue
FROM rocker/geospatial:3.5.1
LABEL<EMAIL_ADDRESS>version=0.01
ENV RSTUDIO_PORT=30301
RUN echo "www-port=${RSTUDIO_PORT}" >> /etc/rstudio/rserver.conf
Dockerfile
Sets base image
FROM ubuntu:bionic
FROM ubuntu@sha256:6d0e0c26489e33f5a6f0020edface2727db9489744ecc9b4f50c7fa671f23c49
Annotate your container image with metadata.
LABEL maintainer="ben evans<EMAIL_ADDRESS>LABEL help="help message"
Set environment variables.
ENV PATH=/opt/my_app/bin:$PATH MY_DB=/opt/my_app/db ...
Run commands to build your image.
RUN apt-get update && \
apt-get install openmpi-bin \
openmpi-common \
wget \
vim
RUN
instruction is a separate layer.Copy files from your computer to the image.
COPY <host_src>... <container_dest>
Specify a default action.
ENTRYPOINT ["/opt/conda/bin/ipython", "notebook"]
Use docker inspect to get container image info
docker inspect ubuntu:bionic
docker inspect --format='{{index .RepoDigests 0}}' ubuntu:bionic
How to build locally
cd /path/to/Dockerfile_dir/
docker build -t custom_ubuntu:testing .
How to run Docker locally
# default
docker run --rm /bin/bash custom_ubuntu:testing
# interactive
docker run --rm -ti --entrypoint /bin/bash custom_ubuntu:testing
--rm
to clean up container after it exitsSend your container to Docker Hub for use elsewhere
export DOCKER_ID_USER="username"
docker login
docker tag custom_ubuntu:testing $DOCKER_ID_USER/my_image:v0.1
docker push $DOCKER_ID_USER/my_image
Clean up using Docker prune every now and again.
docker system prune
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- all dangling build cache
Are you sure you want to continue? [y/N]
Install Docker on MacOS, Windows, and Linux
Ubuntu and CentOS Docker Hub pages
Container recipe reference
YCRC abridged Singularity docs


record TVkSwapchainCreateInfoKHR
Unit
vulkan
Declaration
type TVkSwapchainCreateInfoKHR = record
Description
Overview
Fields
Description
Fields
minImageCount:TVkUInt32; |
|
Minimum number of presentation images the application needs
|
imageFormat:TVkFormat; |
|
Format of the presentation images
|
imageExtent:TVkExtent2D; |
|
Dimensions of the presentation images
|
imageArrayLayers:TVkUInt32; |
|
Determines the number of views for multiview/stereo presentation
|
imageSharingMode:TVkSharingMode; |
|
Sharing mode used for the presentation images
|
queueFamilyIndexCount:TVkUInt32; |
|
Number of queue families having access to the images in case of concurrent sharing mode
|
pQueueFamilyIndices:PVkUInt32; |
|
Array of queue family indices having access to the images in case of concurrent sharing mode
|
preTransform:TVkSurfaceTransformFlagBitsKHR; |
|
The transform, relative to the device's natural orientation, applied to the image content prior to presentation
|
presentMode:TVkPresentModeKHR; |
|
Which presentation mode to use for presents on this swap chain
|
clipped:TVkBool32; |
|
Specifies whether presentable images may be affected by window clip regions
|
Generated by PasDoc 0.14.0.
|


Unlimited digital services for the smart entrepreneur, we make your idea real so that you don't have to hire a team to do it
Web and mobile UI
Graphic Design
Branding
Illustration
Icons
Live Prototype
Landing pages
Ecommerce
Mobile App
Web App
Wordpress
Bootstrap
Shopify
Magento
Woocommerce
SEO
SEM
Growth Hacking
Analytics
Conversion Funneling
Inbound Marketing
Facebook Campaign
Google Ads
Content Creation
Our clients trust us, and for a good reason, everything we deliver is top quality
We're all unique (hurrah!). But with the differences in our goals and lifestyles, the idea of a mass-market multivitamin is outdated. The most compelling research on supplements is for specific populations. We'll help find what's right for you.
Fill the brief
We do the job
you are happy
All the revisions you want, they are on us
Our templates are updated regularly so they don't break.
You can use this theme as is, or you can make changes!
We update dependencies to keep things fresh.
You have to make your websites with love these days!
Ready to start your next project with us? That's great! Give us a call or send us an email and we will get back to you as soon as possible!
123-456-6789


En esta sección listamos algunas de librerías de corte científico-ingenieril
más importantes en el entorno Python.
Las indispensables
NumPy is the fundamental package for scientific computing with Python. It contains among other things:
a powerful N-dimensional array object
sophisticated (broadcasting) functions
tools for integrating C/C++ and Fortran code
useful linear algebra, Fourier transform, and random number capabilities
Besides its obvious scientific uses, NumPy can also be used as an efficient multi-dimensional container of generic data. Arbitrary data-types can be defined. This allows NumPy to seamlessly and speedily integrate with a wide variety of databases.
Numpy is licensed under the BSD license, enabling reuse with few restrictions.
SciPy (pronounced “Sigh Pie”) is a Python-based ecosystem of open-source software for mathematics, science, and engineering.
matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. matplotlib can be used in python scripts, the python and ipython shell (ala MATLAB®* or Mathematica®†), web application servers, and six graphical user interface toolkits.
SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python.
Análisis de datos
pandas is an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language.
The Blaze Ecosystem provides Python users high-level access to efficient computation on inconveniently large data. Blaze can refer to both a particular library as well as an ecosystem of related projects that have spun off of Blaze development.
statsmodels is a Python module that provides classes and functions for the estimation of many different statistical models, as well as for conducting statistical tests, and statistical data exploration. An extensive list of result statistics are avalable for each estimator. The results are tested against existing statistical packages to ensure that they are correct. The package is released under the open source Modified BSD (3-clause) license.
Visualización de datos
Bokeh is a Python interactive visualization library that targets modern web browsers for presentation. Its goal is to provide elegant, concise construction of novel graphics in the style of D3.js, and to extend this capability with high-performance interactivity over very large or streaming datasets. Bokeh can help anyone who would like to quickly and easily create interactive plots, dashboards, and data applications.
Plotly's Python graphing library makes interactive, publication-quality graphs online. Examples of how to make line plots, scatter plots, area charts, bar charts, error bars, box plots, histograms, heatmaps, subplots, multiple-axes, polar charts and bubble charts.
Sexy python charting
ggplot is a plotting system for Python based on R's ggplot2 and the Grammar of Graphics. It is built for making profressional looking, plots quickly with minimal code.
PyQtGraph is a pure-python graphics and GUI library built on PyQt4 / PySide and numpy. It is intended for use in mathematics / scientific / engineering applications. Despite being written entirely in python, the library is very fast due to its heavy leverage of numpy for number crunching and Qt's GraphicsView framework for fast display. PyQtGraph is distributed under the MIT open-source license.
Manipulación/Procesamiento de imágenes
scikit-image is a collection of algorithms for image processing. It is available free of charge and free of restriction. We pride ourselves on high-quality, peer-reviewed code, written by an active community of volunteers.
Pillow is the friendly PIL fork by Alex Clark and Contributors. PIL is the Python Imaging Library by Fredrik Lundh and Contributors.
Interfaces gráficas (GUIs)
wxPython is a GUI toolkit for the Python programming language. It allows Python programmers to create programs with a robust, highly functional graphical user interface, simply and easily. It is implemented as a Python extension module (native code) that wraps the popular wxWidgets cross platform GUI library, which is written in C++.
Like Python and wxWidgets, wxPython is Open Source which means that it is free for anyone to use and the source code is available for anyone to look at and modify. Or anyone can contribute fixes or enhancements to the project.
wxPython is a cross-platform toolkit. This means that the same program will run on multiple platforms without modification. Currently supported platforms are 32-bit Microsoft Windows, most Unix or unix-like systems, and Macintosh OS X.
PyQt is one of the two most popular Python bindings for the Qt cross-platform GUI/XML/SQL C++ framework (another binding is PySide). PyQt developed by Riverbank Computing Limited. Qt itself is developed as part of the Qt Project. PyQt provides bindings for Qt 4 and Qt 5. PyQt is distributed under a choice of licences: GPL version 2, GPL version 3, or a commercial license.
The Tkinter module (“Tk interface”) is the standard Python interface to the Tk GUI toolkit. Both Tk and Tkinter are available on most Unix platforms, as well as on Windows systems. (Tk itself is not part of Python; it is maintained at ActiveState.)
PyGTK lets you to easily create programs with a graphical user interface using the Python programming language. The underlying GTK+ library provides all kind of visual elements and utilities for it and, if needed, you can develop full featured applications for the GNOME Desktop.
PyGTK applications are truly multiplatform and they're able to run, unmodified, on Linux, Windows, MacOS X and other platforms.
Other distinctive features of PyGTK are, besides its ease of use and rapid prototyping, its first class accessibility support or the capability to deal with complex multilingual or bidirectional text for fully localized applications.
PyGTK is free software, so you can use, modify, distribute and study it with very few restrictions (LGPL license)


I am a Ph.D. candidate majoring in Information Systems at the University of Texas at Dallas.
MS, The Pennsylvania State University, 2012 ME, Chinese Academy of Sciences, China, 2010 BS, Huazhong University of Science and Technology, China, 2007
Office Address: JSOM 3.226 800 W. Campbell Rd. Richardson, TX 75080


Here are a few tips to help you better enjoy your stay in Webville.
Having problems? you can always find answers at Head First Labs. Still got problems? Relax, Webville's a friendly place, just ask someone for help. And, as a local used to say:
Don't worry. As long as you hit that wire with the connectiong hook at precisely 88mph the instant the lightning steikes the tower... everything will be fine.


Welcome to Social Multiplication
This is your challenge for today:
x
=
Result?
Your alias:
Stats
Attempt ID
Multiplication
You entered
Correct?


You can change the entire look and feel, can able to add button / event / can do anything with it. Read documentation here or more example here
HTML:

CSS:
<link rel="stylesheet" href="path_to/easyeditor.css">
JS:


fndlvl (expr, expr_to_find, lev1, lev2)
Given two gridded variables, expr
and
expr_to_find
, this function finds the first
vertical level at which the expr_to_find
value
occurs in expr
. lev1
and
lev2
specify the range of
levels over which to search. The result is a grid of pressure values.
expr
and
expr_to_find
  must match.
d fndlvl (t, const(t,240), lev=1000, lev=100)
expr_to_find
doesn't have to be a constant;
it can change with location. This example returns the pressure
level of the tropopause, given the variable 'ttrop'
that
contains the temperature at the tropopause:
d fndlvl (t, ttrop, lev=1000, lev=100)
fndlvl
. It returns the level of the surface pressure
variable psfc
in the coordinate system of
lev
, a GrADS pre-defined variable.
d fndlvl (lev, psfc, lev=1000, lev=100)
The display should be exactly the same as psfc
except in
locations where psfc
is greater than 1000 mb, the maximum value of
lev
.


Leaderboard Info
User Search
Enter the
username
of a player to find their position in the
global leaderboard
.


Here in the CSDL lab at KU we have been busy working on quite a few things over the last few months.
One of those is the Active extension to the ChalkBoard language. This extension to the original
ChalkBoard DSL is designed to facilitate the creation of interesting animations in a clean,
mathematical fashion. It also has a number of predefined functions that allow users to get
started quickly in creating their animations. Some of these basic features and functions
are the topic of the following tutorial:
While testing the current features and usability of animation in
ChalkBoard with the Active extension, we decided to recreate an existing animation. This
was done both to see how close we could reasonably get to the
original and also how difficult it would be to do so. The
animation that we chose for this experiment was an animated
proof of the Pythagorean theorem that can be found on wikipedia
here.
This example looked nice, served a useful purpose, and was exactly the
type of animation we would like to be easily created with ChalkBoard.
It also was complicated enough that we felt like it would be a good
test of ChalkBoard's features, without being too complicated as to
require an exorbitant amount of time to create and analyze. In order to
see the construction of this example as we describe it, we would highly
recommend following along with the relatively simple source code provided
here.
In scripting up this and other examples, a general structure for
ChalkBoard animations using the Active language has begun to appear. First, the
individual parts of the animation are built up separately, in a let
clause for instance. This stage consists of constructing all of the Active Boards that will
be used to describe the individual pieces of the final animation. This can be
anything from an object moving across the screen, rotating,
fading into view, changing colors, or a ton of other possibilities.
The Active animation language really provides a lot of opportunities to be creative here.
The second stage of building up an animation is then stringing all of these smaller pieces
together into a coherent whole using functions such as flicker. After the animation
is complete, it can then be played back, saved, or manipulated however the user wishes. While creating
animations using this structure is by no means the only way to do so, it has proven to be effective
for the examples we have built thus far. Therefore, this tutorial will also follow the same structure,
explaining how to complete each stage and some of the functions that that are available for each. A basic
template for creating an animation in this way looks like the following:
let animStep1 = ... animStep2 = ... animObject = ... animStep3 = ... f animObject ... animStep4 = ... g animObject ... let wholeAnim = flicker [ animStep1, animStep2, animStep3, animStep4 ] ... //displaying or saving the animation
In beginning the Pythagorean example, we started creating all of the different parts that would be
used in the animation. The first of these was the animation's background. we decided that in order to match
the background of the wikipedia animation, we wanted a faded yellow background. To do this, we simply
used the color yellow with an alpha value of 0.2. Because ChalkBoard assumes the default
background to be white, this blends the yellow with the default background of white to produce a
faded/light yellow similar to the example. If you're following along in the source code, you may notice
that the function pure is applied to this board. This is simply done to lift the board into
the Active(Board a) space so that it can be composed with the other Active Board objects
we create for the animation. More on this later.
Next, we built up a basic triangle in the middle of the screen. To do this, we first created a nice
3-4-5 triangle by giving the points (-0.2,0.15) (-0.2,-0.15) and (0.2,-0.15) to the
triangle constructor. This created the shape of the triangle, but we also wanted a black
outline around it to match the original animation. To do this, we used the pointsToLine
function, which takes a list of points and a line width and draws a line between the adjacently listed points.
Both parts are then given
their colors by using choose (alpha black) transparent and choose (alpha yellow)
transparent for the lines and triangle shape, respectively. This makes the lines black over
a transparent background (so that we can see the triangle behind them) and the triangle yellow
with a transparent background (so that we can see the background color behind it).
let triangle345 = triangle (-0.2,0.15) (-0.2,-0.15) (0.2,-0.15) triLines = pointsToLine [(-0.2,0.15), (-0.2,-0.15), (0.2,-0.15), (-0.2,0.15)] 0.004 mainTriangle = (choose (alpha black) transparent <$> triLines) `over` (choose (alpha yellow) transparent <$> triangle345)
While this finishes creating a simple triangle, this triangle itself is never actually displayed
in the animation. Instead, this triangle is transformed in different ways to create the triangles
that are actually displayed. For instance, the initial triangle shown in the animation is
achieved by scaling this mainTriangle by the value 1.5. The animation of this triangle
shrinking down into its final position is achieved by adding some Active functions.
First, the triangle is lifted into the Active (applicative functor) world using
pure. This changes a Board a into an
Active(Board a), even though it currently remains constant over time. The next
step is to start applying actions to the board. In this instance, we apply an
activeScale of 2/3 and an activeMove of (0.15, 0.2). These
functions are basically the same as their original affine transformations, except that their
effects are now displayed over time. A video of just this portion of the animation can be seen
to the right.
let movingTriangle = activeMove (0.15,0.2) $ activeScale (2/3) $ pure $ scale 1.5 $ mainTriangle
As a note, all of the font for this animation was actually added in last and is contained within
the second let clause of the source code. In this tutorial, we
will only be covering the creation of the actual animation, and not the insertion of font. This
is predominantly because the only interesting parts that deal with the font are when to make the
font labels appear and disappear. In terms of the timing, this is mostly just done to
mirror the animation on wikipedia. Unfortunately, current ChalkBoard animations using
Active must be explicitly told when parts of an animation should
appear and disappear from the screen. While this will hopefully be taken care of with a couple
new combinators in the near future, the functions that are currently used to tell
Active objects when to be visible are activeAppear and
activeTempAppear. The function activeAppear makes the Active
Board only appear when its action begins, but will keep the board visible after it has
finished. The activeTempAppear function, on the other hand, changes the Active
Board so that it will only be visible while its action is happening, and not before or after
the fact. A video of the first portion of the animation with the fonts now inserted can be seen above.
Moving on the with actual animation, the next step was to create the four identical but rotated
triangles that are displayed in the wikipedia graphic. These were created using the list
comprehension in otherTriangles that simply rotates the moved version of the original
mainTriangle. These triangles are then made to appear using the activeAppear
function as described above. While they could have each been listed separately in the
flicker portion of the program (described later), we instead chose to apply the
actMove function to each of these new triangles. This function simply moves the action
of the given Active Board backwards in time by the given value. Using the list
comprehension in addInOtherTriangles, each new triangle is made to appear a little bit
later in time than the previous. Finally, this list of Active Board objects, each element representing
one new triangle, is compressed into a single Active Board using the overList
function. This function, defined below, just calls over repeatedly to overlay all the elements of the list.
The video to the left shows this portion of the animation (03otherTriangles). The next part
of the animation is just adding in a couple missing pieces to the image so that the full square can
be clearly seen. A yellow square is added to the middle so that the larger square can be seen to
have a size of c x c. This larger square therefore has an area of c², as indicated by the
accompanying text. This small portion of the animation can also be seen above
(04fillSquare).
let otherTriangles = [ rotate (-i*pi/2) $ move (0.15,0.2) $ mainTriangle | i <- [1..3] ] addInOtherTriangles = overList [ actMove i $ activeAppear $ pure $ t | (t,i) <- Prelude.zip otherTriangles [1..] ] ... overList (b:[]) = b overList (b:bs) = b `over` (overList bs)
Next, we need to slide the top triangles down to match up with the lower triangles, as seen in
the animation to the right (05actualSlide). We also want an outline of the old triangles to
remain behind so we can see where they originally came from (like in the original on wikipedia).
This is done in two parts. The first part is to fade the existing triangles to leave behind as
outlines of where they used to be, and the second is to
create two new triangles, which will be the ones that actually move. The first part is done
similarly to how we used rotate to create otherTriangles from mainTriangle. In this instance, however, a
white triangle with an alpha value of 0.6 is placed where these two triangles are
so that they will appear faded. For the second part, we create the first triangle by
moving the original mainTriangle up to the right position and then applying an
activeMove to move it down to its final position over time. We do pretty much the same
thing with the second triangle, but we can instead just grab its original shape/position from the
head of the otherTriangles list, and then activeMove it down to its final
position on the right side. The effects of running just these individual animation parts (without
all of the prior parts) can be seen in the animation above (06slideBoth). You may notice the
white triangles where the originals used to be. Those are the triangles used to fade the existing
triangles (which are left out in this video, so we can see only what's added for this step), while the
new ones simply move down to their new locations.
fadedTris = [rotate (-i*pi/2) $ move (0.15,0.2) $ choose (withAlpha 0.6 white) transparent <$> triangle345 | i<-[0,1]] slideLeft = activeAppear $ (activeMove (-0.3,-0.4) $ pure $ move (0.15,0.2) $ mainTriangle) `over` (pure (head fadedTris)) slideRight = activeAppear $ (activeMove (0.4,-0.3) $ pure $ (head otherTriangles)) `over` (pure (last fadedTris))
The last part of the animation is simply switching the organization of these resulting shapes. Now that
the triangles are in their new positions, two new squares can be drawn that cover the entire
area. These squares have side lengths of a and b, and thus areas of a² and b². This in
effect concludes the proof that a² + b² equals the original area of c². In order
to animate this part, we used the same general strategy as fading out the two original triangles
in the last step. The two main differences are that this time we used yellow squares with alpha
values of 0.8 instead so that the new squares would be a darker yellow instead of a lighter one,
and that we also drew lines around the new squares as well to make them more clear. The squares to
be faded in where just created as shapes in ChalkBoard and moved to the right locations. They
were then faded in over time using the fadeIn function, which takes an alpha and RGB
value of what color the shape should end up, as well as a Board Bool of the shape, and
produces an Active(Board(RGBA->RGBA)). This Active Board consists of the shape
fading in over time as the given color. The lines around the squares are then drawn over the top
of these fading in squares using the same pointsToLine function as we used when drawing
the original mainTriangle above. This final part of the animation is shown in the video.
newSquares = (move (0.15, -0.15) $ scale 0.4 $ square) `over` (move (-0.2, -0.2) $ scale 0.3 $ square) newLines = pointsToLine [(-0.05,-0.35), (0.35,-0.35), (0.35,0.05), (-0.05,0.05), (-0.05,-0.35), (-0.35,-0.35), (-0.35,-0.05), (-0.05,-0.05) ] 0.004 fadeInSquares = (fadeIn 1 black newLines) `over` (fadeIn 0.8 yellow newSquares)
In this example, each part of the animation is created separately and then must be strung
together to create the full animation. The reason we did it this way was simply because, at the
moment, most of the animations we have attempted have been easier to create this way (by
making smaller animations that are then combined together). These smaller animation pieces often
use some of the same basic structures repeatedly and so can be pretty easy to create in this way.
For instance, the originally defined maintriangle, which isn't actually displayed
itself, is rotated and moved around a lot in order to create all of the other triangles in the
scene. While longer animations can definitely be created using the same functions we have used to
build these smaller animations and the actMove function, it seems to be much easier at
the moment to keep these individual animations pretty basic and then string them together using
some combinator such as the flicker function.
Using the flicker function in this way is the second major stage we use for creating
an animation at the moment. Using the flicker function, animations can be strung
together, one after the other, with the newer animations being stacked on top of the
older ones. The length of time each individual animation component takes to be
performed can be specified using the taking function inside the list of
animations given to flicker. This can stretch out certain actions to take longer amounts
of time or compress other actions to take short periods of time. If some parts of the animation
need to appear when they start, or disappear after they are completed, this has to be done using
the activeAppear and activeTempAppear functions as described earlier. We do,
however, hope to implement a slightly easier way to specify when certain boards should appear and/
or disappear soon.
let anim = flicker [ taking 0.5 $ background , taking 1 $ firstABC , taking 1 $ movingTriangle , wait 0.5 , taking 2 $ addInOtherTriangles , taking 1.5 $ fillInSquare `over` secondABC `over` areaEq , taking 1 $ slideLeft , wait 0.5 , taking 1 $ slideRight , taking 1 $ thirdABC , taking 1 $ fadeInSquares `over` thirdABC , taking 3 $ finalABC `over` formula ]
This use of flicker is basically what manages the ordering and timing of the
individual parts of the animation that were created. It returns a single
Active Board that can then be used to display the whole animation (or used in turn
to create an even bigger animation, hierarchically). In terms of displaying the
animation, this will largely be done the same way for most animations. First, the
Active Board must be turned into a Player using either the byFrame
function (which takes a desired frame rate), or the
realTime function. The Player is then passed to the play function to
retrieve the next image of the animation (or Nothing, if the animation is finished).
Finally, this retrieved image can then be used in any way that ChalkBoard can use a
Board. Traditionally, the image will be displayed on the screen using
drawChalkBoard or saved into a movie file with frameChalkBoard (possibly both).
After this, the process of calling play on the Player must be repeated to
extract the next image. This is usually placed into a simple loop that extracts and then displays
or saves the returned frame. An example of this can be seen in the code below. In the future, we will
probably include predefined functions to perform each of these most basic cases automatically, though obviously there are
other actions that can be taken with the returned Board, if the user desires. The full
animation can finally be seen all together, in the video above. It was produced as a video by
simply saving each of the returned boards to a video file using the frameChalkBoard
function after opening a default ChalkBoard write stream.
playObj <- byFrame 29.97 anim let loop = do mbScene <- play playObj case mbScene of Just scene -> do drawChalkBoard cb $ unAlphaBoard (boardOf white) scene loop Nothing -> return () loop


dazl: DA client library for Python¶
Version: |release|
Dependencies¶
You will need Python 3.6 or later and a Digital Asset ledger implementation (DA Sandbox or DA Ledger Server).
Build-time dependencies are handled using Poetry.
Getting Started¶
This section assumes that you already have a running ledger with the standard daml new model loaded, and have imported dazl.
Connect to the ledger and submit a single command:
with dazl.simple_client('http://localhost:6865', 'Alice') as client:
contract = { 'issuer' : 'Alice', 'owner' : 'Alice', 'name' : 'hello world!' }
client.ready()
client.submit_create('Main.Asset', contract)
Connect to the ledger as a single party, print all contracts, and close:
with dazl.simple_client('http://localhost:7600', 'Alice') as client:
# wait for the ACS to be fully read
client.ready()
contract_dict = client.find_active('*')
print(contract_dict)
Connect to the ledger using asynchronous callbacks:
from dazl.model.reading import ReadyEvent
network = dazl.Network()
network.set_config(url='http://localhost:6865')
alice = network.aio_party('Alice')
@alice.ledger_ready()
async def onReady(event: ReadyEvent):
contracts = await event.acs_find_one('Main.Asset')
print(contracts)
network.run_until_complete()


When you're ready, click OK to start the study. 25 numbers will be read out, each of which is between 10 and 99.


Hello, Welcome to my Game,
If there are any issues, like just a single character getting loaded, or not animation, or other issues, then please reload!!!
Player 1 (left character) controls on keyboard:
- k/K: Used to perform Kick action
- p/P: Used to perform Punch action
- b/B: Used to perform Block action
- d/D: Used to move the (left)character to the right (move forward)
- a/A: Used to move the (left)character to the left (move backward action)
Player 2 (right character) controls on keyboard:
- 7: Used to perform Kick action
- 9: Used to perform Punch action
- 5: Used to perform Block action
- Right Arrow →: Used to move the (right)character to the right (move backward action)
- Left Arrow ←: Used to move the (right)character to the left (move forward)


A simple, mobile first, responsive base boilerplate for rapid development based on Kraken.
View the demo and get started - http://cferdinandi.github.com/kraken/
MIT License. http://gomakethings.com/mit/


Menu parent children as a diagram...
Home
Lab
Code
Html
Css
Jquery
Graph
Image
Design
Blog
Category
Code
Graph
About
Vcard
Map