|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
| Interface Summary | |
| ExtensionElementFactory | Interface ExtensionElementFactory. |
| Class Summary | |
| AbsentExtensionElement | This element is a surrogate for an extension element (or indeed an xsl element) for which no implementation is available. |
| AttributeValueTemplate | This class represents an attribute value template. |
| DataElement | This element represents a top-level element in a user-defined namespace, or a child/descendant of such an element. |
| ExpressionContext | An ExpressionContext represents the context for an XPath expression written in the stylesheet. |
| LiteralResultElement | This class represents a literal result element in the style sheet (typically an HTML element to be output). |
| Procedure | A procedure represents a top-level element that can contain local variable declarations. |
| SaxonAssign | saxon:assign element in stylesheet. |
| SaxonCallTemplate | A saxon:call-template element in the stylesheet. |
| SaxonCollation | A saxon:collation element in the style sheet: this is a top-level element that defines details of a named collation. |
| SaxonDoctype | A saxon:doctype element in the stylesheet. |
| SaxonEntityRef | A saxon:entity-ref element in the stylesheet. |
| SaxonImportQuery | The class implements a saxon:import-query declaration in a stylesheet. |
| SaxonScript | A saxon:script element in the stylesheet. |
| SaxonWhile | Handler for saxon:while elements in stylesheet. |
| StandardNames | |
| StyleElement | Abstract superclass for all element nodes in the stylesheet. |
| StyleNodeFactory | Class StyleNodeFactory. |
| StylesheetStripper | The StylesheetStripper refines the Stripper class to do stripping of whitespace nodes on a stylesheet. |
| XSLAnalyzeString | An xsl:analyze-string elements in the stylesheet. |
| XSLApplyImports | An xsl:apply-imports element in the stylesheet |
| XSLApplyTemplates | An xsl:apply-templates element in the stylesheet |
| XSLAttribute | xsl:attribute element in stylesheet. |
| XSLAttributeSet | An xsl:attribute-set element in the stylesheet. |
| XSLCallTemplate | An xsl:call-template element in the stylesheet |
| XSLCharacterMap | An xsl:character-map declaration in the stylesheet. |
| XSLChoose | An xsl:choose elements in the stylesheet. |
| XSLComment | An xsl:comment elements in the stylesheet. |
| XSLCopy | Handler for xsl:copy elements in stylesheet. |
| XSLCopyOf | An xsl:copy-of element in the stylesheet. |
| XSLDecimalFormat | Handler for xsl:decimal-format elements in stylesheet. |
| XSLDocument | An xsl:document instruction in the stylesheet. |
| XSLElement | An xsl:element element in the stylesheet. |
| XSLFallback | xsl:fallback element in stylesheet. |
| XSLForEach | Handler for xsl:for-each elements in stylesheet. |
| XSLForEachGroup | Handler for xsl:for-each-group elements in stylesheet. |
| XSLFunction | Handler for xsl:function elements in stylesheet (XSLT 2.0). |
| XSLGeneralIncorporate | Abstract class to represent xsl:include or xsl:import element in the stylesheet. |
| XSLGeneralVariable | This class defines common behaviour across xsl:variable, xsl:param, and xsl:with-param |
| XSLIf | Handler for xsl:if elements in stylesheet. |
| XSLImport | xsl:import element in the stylesheet. |
| XSLImportSchema | Compile-time representation of an xsl:import-schema declaration in a stylesheet |
| XSLInclude | xsl:include element in the stylesheet. |
| XSLKey | Handler for xsl:key elements in stylesheet. |
| XSLMatchingSubstring | Handler for xsl:matching-substring and xsl:non-matching-substring elements in stylesheet. |
| XSLMessage | An xsl:message element in the stylesheet. |
| XSLNamespace | An xsl:namespace element in the stylesheet. |
| XSLNamespaceAlias | An xsl:namespace-alias element in the stylesheet. |
| XSLNextMatch | An xsl:next-match element in the stylesheet |
| XSLNumber | An xsl:number element in the stylesheet. |
| XSLOtherwise | Handler for xsl:otherwise elements in stylesheet. |
| XSLOutput | An xsl:output element in the stylesheet. |
| XSLOutputCharacter | An xsl:output-character element in the stylesheet. |
| XSLParam | An xsl:param element in the stylesheet. |
| XSLPerformSort | Handler for xsl:perform-sort elements in stylesheet (XSLT 2.0). |
| XSLPreserveSpace | An xsl:preserve-space or xsl:strip-space elements in stylesheet. |
| XSLProcessingInstruction | An xsl:processing-instruction element in the stylesheet. |
| XSLResultDocument | An xsl:result-document (formerly saxon:output) element in the stylesheet. |
| XSLSequence | An xsl:sequence element in the stylesheet. |
| XSLSort | An xsl:sort element in the stylesheet. |
| XSLStringConstructor | Common superclass for XSLT elements whose content template produces a text value: xsl:attribute, xsl:comment, and xsl:processing-instruction |
| XSLStyleSheet | An xsl:stylesheet or xsl:transform element in the stylesheet. |
| XSLTemplate | An xsl:template element in the style sheet. |
| XSLText | Handler for xsl:text elements in stylesheet. |
| XSLValueOf | An xsl:value-of element in the stylesheet. |
| XSLVariable | Handler for xsl:variable elements in stylesheet. |
| XSLVariableDeclaration | Generic class for xsl:variable and xsl:param elements. |
| XSLWhen | Handler for xsl:when elements in stylesheet. |
| XSLWithParam | An xsl:with-param element in the stylesheet. |
This package provides classes used during the compilation of an XSLT stylesheet. In general, the instances of these classes are discarded once compilation is complete, and they play no role in executing the transformation at run-time.
The class StyleElement represents an element node on the stylesheet tree. Subclasses
of StyleElement represent individual stylesheet elements, and are generally named according to
the XSLT element name, for example XSLApplyTemplates, XSLChoose. The class XSLStyleSheet
is used for the xsl:stylesheet
element in each stylesheet module, and in particular for the
xsl:stylesheet
element in the principal stylesheet module.
During construction of the stylesheet tree, the class StyleNodeFactory is nominated to the Builder as the factory class responsible for creating element nodes on the tree. It is this class that decides which subclass of StyleElement to use for each element appearing in the stylesheet. For extension elements, the decision is delegated to a user-created ExtensionElementFactory.
Michael H. Kay
12 November 2002
|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |


with torch.no_grad():
old_ll = self._old_policy.log_likelihood(obs, actions)
new_ll = self.policy.log_likelihood(obs, actions)
likelihood_ratio = (new_ll - old_ll).exp()
with torch.no_grad():
old_ll = self._old_policy(obs)[0].log_prob(actions)
new_ll = self.policy(obs)[0].log_prob(actions)
likelihood_ratio = (new_ll - old_ll).exp()
// Calculate surrogate
surrogate = likelihood_ratio * advantages


March 24, 2018
Yetibot.com Launch
Yetibot finally has a site!
Check out the source on GitHub here if you're so inclined. It's powered by Cryogen, the Clojure-based static site generator.
Interactive example
One of the goals with launching the site was to have inline interactive Yetibot examples that uses the GraphQL API on the public Yetibot instance to evaluate!


Panorama
Your browser does not support HTML5 Canvas, try using Google Chrome!
Your browser does not support HTML5 Canvas, try using Google Chrome!


EMBL faculty
Postdocs at EMBL-EBI
PhD Programme
Centre for Therapeutic Target Validation
Sanger/EBI Single-Cell Genomics Centre
Read more about EMBL-EBI


Agents Web Client
Incidents
New Incident
Log out
Incident Submitted
Incident Name:
Description:
Location:
Asignee:
Expiration:
State:
Multimedia:
Tags:
Properties:


### Öffnen
- https://colab.research.google.com/drive/1lnHMwEBROP2fhtTFHSPkBfOGrkrIw-0J?hl=en
- https://www.mentimeter.com/s/5cc1ccdf59161f0989ca79f40d9c70e7/094af1a95d43
## Machine Learning
### ein Programm, das ein Programm schreibt
Oliver Zeigermann
Diese Folien: https://bit.ly/ml-jug-augsburg
### Eine kleine Umfrage
https://www.menti.com/9hq9bmakix
### Roadmap
1. Thesis: Coding
2. Antithesis: Machine Learning
3. Synthesis
### We have some data
![](img/1-risk-data.png)
Can we predict the risk of an accident?
### Roadmap
1. ***Thesis: Coding***
2. Antithesis: Machine Learning
3. Synthesis
## We know something about the real world, let us express this as a set of rules
### Best Model I could come up with
![](img/4-rule-based-model.png)
68% accuracy
### Taking one step back
* did we really just code a few rules we had in our head?
* this was also different from coding rules that have already been worked out, like legislative text
* this was daten driven development
* no formal specification given
* was this test driven?
* test implicitly defined by data?
* if so, why did we not achieve 100%?
* should we?
### This model is close to a perfect score
![](img/knn.png)
96% accuracy, not perfect because of ambiguities
## Should we try to achieve 100% accuracy?
Is the previous model better than ours?
### We really want this to work in production
On data we have not seen before
## Let's simulate production
![](img/generalization.jpg)
Part of the known data has been held back for evaluation
### The other part of our data
![](img/test-data.png)
We actually held back 40% of the data
### Applying the "perfect" model on evaluation data
![](img/knn-test.png)
only 60% accuracy on unknown data
### And now our rule based model
![](img/rules-test.png)
66% accuracy is better and close to original score on known data
### Optimize for the right metric
* if data is unambiguous we can always achieve 100% accuracy on known data
* but we want the model to perform well on real world data
* we need to work with what we have so we hold back some data
* that data is not used for training, but for evaluation
* scores on that data and the difference to training scores is what really matters
### Data and the World
![](img/data-and-the-world.jpg)
even that approach is not ideal, but the best we have
### Overfitting and Underfitting
* if score on training data is better than on test we call this overfitting
* hand written rules tend to not overfit
* when scores are obviously worse than they could be, we call this underfitting
* hand written rules tend to underfit
* other approaches have other tendencies
* you want to avoid both
* depending on approach you need different measures for avoiding overfitting and underfitting
### Where did the "good" model come from?
* the "strong" model was generated by machine learning using a naive nearest neighbor approach
* turned into rules it would have been a nested if then else
* that if-then-else would be 21 levels deep
* we can still turn it back into explicit rules just for the fun of it
Just a fraction and only 5 levels deep
def nested_tree(speed, age):
if age <= 67.5:
if age <= 36.5:
if speed <= 106.5:
if age <= 30.5:
if speed <= 100.5:
return medium
else: # if speed <= 100.5
return medium
else: # if age <= 30.5
if speed <= 91.5:
return medium
else: # if speed <= 91.5
return low
...
Is this good code?
### We have not done any machine learning so far
this was just
* data driven coding
* applying accuracy on a data set we work with and one held back
* could help improve your code in many cases
* of course requires that you have data available
### Roadmap
1. Thesis: Coding
2. ***Antithesis: Machine Learning***
3. Synthesis
### Why not let a machine do the data driven coding?
![](img/ml-prog.png)
classic coding can obviously also benefit from data both for evaluation as well as for generating them
### Decision Trees can learn such rules
![](img/dt-all.png)
### How is the Decision Tree being constructed?
We are using the CART algorithm:
* top-down split the set of examples into two new sets
* choose a variable and a value at each step that best splits our customer example
* terminal node when no further gain possible or regularization kicks in
### What is the best split?
* choose a feature to split on (either random or best)
* assign a category to each node containing a certain set of samples
* use a metric (Gini or Entropy) to decide how good a node would be based on that category
* sum up weighted metric for both child nodes
* optimize the split for that summed metric
https://machinelearningmastery.com/classification-and-regression-trees-for-machine-learning/
### Roadmap
1. Thesis: Coding
2. Antithesis: Machine Learning
3. ***Synthesis***
### You can turn them into each other
* use any classifier (like our code) as a teacher for a machine learning algorithm
* you do this by making predictions on a mesh grid as input
* caveat 1: in high dim code might not longer be comprehensible
* caveat 2: creating a mesh grid for the training has exponential time and space complexity on dim
* so: keep dim low if you want this to be practical
### What are possible applications
* bring ML model into production as code
* enhance hand written rules with training on data (and turn back into code)
* refactor complex into simpler code
* analyse legacy code into something you can understand
* explain hand written code using decision tree tools
Example 1: bring ML model into production as code
def batched_tree(speed, age):
if age <= 35.5 and speed <= 105.5 or \
speed <= 145.5 and age <= 61.5 and speed > 115.5 and age > 52.5 or \
speed <= 145.5 and age > 61.5 and speed > 133.5 or \
speed > 145.5 and age > 42.5:
return medium
if speed <= 145.5 and age <= 35.5 and speed > 105.5 or \
age > 61.5 and speed <= 133.5 or \
speed > 145.5 and age <= 42.5:
return high
if age <= 61.5 and age > 35.5 and speed <= 115.5 or \
age > 35.5 and speed > 115.5 and age <= 52.5 and speed <= 131.5 or \
speed <= 145.5 and age > 35.5 and age <= 52.5 and speed > 131.5:
return low
Choose between different code styles
Example 2: Smart Refactor original code into something simpler
def batched_tree(speed, age):
if age <= 34.5 and speed <= 110.5 or \
age <= 68.5 and age > 34.5 and speed > 140.5 or \
age > 68.5 and speed <= 100.5:
return medium
if age <= 34.5 and speed > 110.5 or \
age > 68.5 and speed > 100.5:
return high
if age <= 68.5 and age > 34.5 and speed <= 140.5:
return low
Goes down to 60% on test data, but more explainable, might perform better in prod
### Example 3: Analyse legacy code
* What is going on in code you no longer understand?
* Objective is not the code itself, but a simpler form you might be able to comprehend
* Train decision tree from output of legacy code
* use tree viz tools to visualize what is going on
**caveat: legacy code needs to be pure (free of side effects)**
### How to visualize decisions
![](img/dt-explain.png)
easy to automatically generate explanation
### Decision Tree is not the only machine learning algorithm
* k-nearest neighbor (we have already seen this)
* Linear/Logistic Regression
* Naive Bayes
* Artificial Neural Networks
* Support Vector Machines


I am an undergraduate (final year) student majoring in Electrical Engineering at Indian Institute of Technology, Roorkee and am interested in general machine intelligence and learning (along with other things, see below).
Since you are here, you might be interested in checking out my blog posts. A few projects are open sourced here. Contact me via twitter or email me.
I am broadly interested in computational sciences and the way they help in explaining physical and natural phenomena including human intelligence and group behavior. Narrowing down, I am into Machine Learning methods including Deep Learning and Evolutionary heuristics.
I am equally fascinated by data and simulation based exploration of complex systems. Its interesting how tiny interactions generate almost magical behavior. Check out a small exploration in small world networks here.
Many of my programming projects are on github/lepisma. A few explorations can be scrambled from my blog.
Few of the pet projects I have recently been involved in are
-
blackbird
Exploratory music player that uses a vector representation generated from siamese LSTM network capturing listening preferences and acoustic similarities.
-
pipwin
Complements pip on Windows by downloading prebuilt binaries.
I like to use Python, Julia, Emacs (spacemacs highly recommended) and Jupyter Notebooks (check out gotham color scheme) a lot. Also JavaScript, with HTML/CSS, for UI related things and visualizations.
I listen to music religiously and occasionally sketch. Also I try to maintain a list of my recent readings, which are mostly non-fiction, on goodreads. Few of my talks and presentations are on speakerdeck.
Other than these, I am concerned about matters related to Science, Art, Environment, Humans and their interactions. Interested in topics ranging from night sky to ethics.
Reach me via email. If you are freaked out about privacy (which is totally justified given you know your category; chart below), here is a protonmail account. Or just ask for my public key.
My twitter account is @AbhinavTushar. For the sake of completeness, here is my linkedin profile and here is facebook one.


Improve this Doc
Buttons are an essential way to interact with and navigate through an app, and should clearly communicate what action will occur after the user taps them. Buttons are simple components in Ionic, can consist of text, an icon, or both, and can be enhanced with a wide range of attributes.
Demo Source
```html
```
The `primary` property sets the color of the button. Ionic includes a number of default colors which can be easily overridden:
```html
```
Outline Style
Demo Source
To use the outline style for a button, just add the `outline` property:
```html
```
Clear Style
Demo Source
To use the clear style for a button, just add the `clear` property:
```html
```
Round Buttons
Demo Source
To create a button with rounded corners, just add the `round` property:
```html
```
Block Buttons
Demo Source
Adding `block` to a button will make the button take 100% of its parent's width. It will also add `display: block` to the button:
```html
```
Full Buttons
Demo Source
Adding `full` to a button will also make the button take 100% of its parent's width. However, it will also remove the button's left and right borders. This style is useful when the button should stretch across the entire width of the display.
```html
```
Button Sizes
Demo Source
Add the `large` attribute to make a button larger, or `small` to make it smaller:
```html


Lady Gaga 'ready for big role in film about the killing of Maurizio Gucci'
The singer is reportedly set to sign up to play the "Black Widow, "Gucci's ex-wife Patrizia Reggiani
by Sam Elliott, https://www.mirror.co.uk/authors/sam-elliott/Lady Gaga's next film role looks likely to be a big one - playing Gucci's ex-wife Patrizia Reggiani, who was found guilty of ordering his death.
She will reportedly star in Sir Ridley Scott's upcoming movie.
It is all about the killing of fashion guru Maurizio Gucci and Gaga, real name is Stefani Germanottawill, is to play a leading role.
According to Deadline she is desperate for the chance to sign up and has already agreed.
She was nominated for an Oscar for her role alongside Bradley Cooper in A Star Is Born.
Now she will play the wealthy Italian socialite who had two children with Gucci, before their divorce in 1985.
Reggiani was convicted of hiring a hitman to kill her estranged husband in Milan in 1995.
She served 18 years of a 29-year sentence before being let out of jail in 2016.
Tongues started wagging after A Star Is Born hit screens.
Bradley Cooper and Irina Shayk's romance ended just days after Lady Gaga split from her fiance.
Fans have pointed out both romances disintegrated publicly within hours of each other months after a whirlwind publicity tour with A Star Is Born.
Rumours had been circulating about Bradley, 44, and Irina's four year relationship for months before.
Speculation about Lady Gaga, 33, and the actor spread like wildfire after a steamy Oscar performance of hit song Shallow.


Netherlands back where they belong, says Van Dijk
REUTERS: Defender Virgil van Dijk says the Netherlands are "back where they belong" after sealing automatic qualification for the 2020 European Championship.
The Dutch, who did not qualify for Euro 2016 or the 2018 World Cup, sealed progress to the finals of next year's tournament with a game to spare after Saturday's 0-0 draw against Northern Ireland.
With the finals being held at 12 venues across Europe, the Netherlands could play their group stage matches at the Johan Cruyff Arena in Amsterdam, with the draw being made on Nov. 30.
"I'm very delighted that we are back at the Euros, back where we belong I think," Van Dijk told reporters. "It means a lot to the people. I've heard we're going to probably play all our group games in Amsterdam, it will be massive.
"It was a big thing for us to miss those tournaments, it was tough. .. We have missed two, maybe we have to get used to it again."
Ronald Koeman's side are second in Group C, two points behind leaders Germany - the only side to beat them in the qualifiers.
Van Dijk, who will miss their final qualifier against winless Estonia on Tuesday due to personal reasons, said there was still room for improvement.
"We know we can improve, can do a lot better in certain aspects of the game," he added. "But you know, we qualified after missing two tournaments, so we have to enjoy it."
(Reporting by Rohith Nair in Bengaluru; Editing by Peter Rutherford)


previous
next
contents
properties
index
Appendix H: Has been intentionally left blank
previous
next
contents
properties
index


15+ Girls Who Just Can’t Live Like Everyone Else
There are girls that prefer Cheetos crumbs on their fingers to a highlighter swatch, a shoelace instead of an expensive choker and jammies to a fancy outfit — they just don’t fit all those stereotypes about what a girl should do and what she should look like. And we love it!
Here at Bright Side we are all for diversity and just can’t help sharing these pictures, some of which are actually very relatable.
1.
2. Chilling by the pool can look different.
3. No makeup can replace the taste of spicy Cheetos crumbs on your fingers!
4. There are 2 types of girls on Halloween.
5. No time to stop for a selfie.
6. Normal girl’s choker vs A Nike shoe lace
7. When you’re asked to send a pic:
8. When you ask for a highlighter:
9. Between comfort and other people’s opinions I choose comfort.
10. Hunger is more important than a good photo!
11. Don’t want to be a basic girl? Buy chicken leg stockings!
12. Sometimes I look presentable, but 90% of the time I resemble a dumpling with eyelashes.
13. When you couldn’t decide which mood you were in today:
14. Turns out there are several types of dog filters!
15. It actually takes courage to not hide your true hungry self!
16. There’s no middle ground in this game.
17. Handstands are not for everyone.
18. When it’s cold outside, your true self comes out.
19. Flowers wither, the taste of fried chicken remains forever.
Did you recognize yourself in any of those pics? Do you have anything to add to this list? We’d be happy to see your stories and pics in the comment section below!
Preview photo credit Unknown / reddit


/**
* mindtouch-http.js - A JavaScript library to construct URLs and make HTTP requests using the fetch API
*
* Copyright (c) 2015 MindTouch Inc.
* www.mindtouch.com<EMAIL_ADDRESS>*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Uri } from './uri.js';
function _isRedirectResponse(response) {
if(!response.headers.has('location')) {
return false;
}
const code = response.status;
return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
}
function _handleHttpError(response) {
return new Promise((resolve, reject) => {
const isRedirectResponse = _isRedirectResponse(response);
// a redirect response from fetch when a cookie manager is present is resolved later
if(isRedirectResponse && this._followRedirects && this._cookieManager !== null) {
resolve(response);
return;
}
// a redirect response when follow redirects is false is valid
if(isRedirectResponse && !this._followRedirects) {
resolve(response);
return;
}
// throw for all non-2xx status codes, except for 304
if(!response.ok && response.status !== 304) {
response.text().then((text) => {
reject({
message: response.statusText,
status: response.status,
responseText: text
});
});
} else {
resolve(response);
}
});
}
function _readCookies(request) {
if(this._cookieManager !== null) {
return this._cookieManager.getCookieString(request.url).then((cookieString) => {
if(cookieString !== '') {
request.headers.set('Cookie', cookieString);
}
}).then(() => request);
}
return Promise.resolve(request);
}
function _handleCookies(response) {
if(this._cookieManager !== null) {
// NOTE (@modethirteen, 20170321): Headers.getAll() is obsolete and will be removed: https://developer.mozilla.org/en-US/docs/Web/API/Headers/getAll
// Headers.get() will cease to return first header of a key, and instead take on the same behavior of Headers.getAll()
const cookies = response.headers.getAll ? response.headers.getAll('Set-Cookie') : response.headers.get('Set-Cookie').split(',');
return this._cookieManager.storeCookies(response.url, cookies).then(() => response);
}
return Promise.resolve(response);
}
function _doFetch({ url, method, headers, body = null }) {
const requestData = {
method: method,
headers: new Headers(headers),
credentials: 'include',
// redirect resolution when a cookie manager is set will be handled in plug, not fetch
redirect: this._followRedirects && this._cookieManager === null ? 'follow' : 'manual'
};
if(body !== null) {
requestData.body = body;
}
const request = new Request(url, requestData);
return _readCookies.call(this, request)
.then(this._fetch)
.then(_handleHttpError.bind(this))
.then(_handleCookies.bind(this))
.then((response) => {
if(this._followRedirects && _isRedirectResponse(response)) {
return _doFetch.call(this, {
url: response.headers.get('location'),
// HTTP 307/308 maintain request method
method: (response.status !== 307 && response.status !== 308) ? 'GET' : request.method,
headers: request.headers,
body: request.body
});
}
return response;
});
}
/**
* A class for building URIs and performing HTTP requests.
*/
export class Plug {
/**
* @param {String} [url=/] The initial URL to start the URL building from and to ultimately send HTTP requests to.
* @param {Object} [options] Options to direct the construction of the Plug.
* @param {Object} [options.uriParts] An object representation of additional URI construction parameters.
* @param {Array} [options.uriParts.segments] An array of strings specifying path segments to be added to the URI.
* @param {Object} [options.uriParts.query] A set of key-value pairs that specify query string entries to be added to the URI.
* @param {String} [options.uriParts.excludeQuery] A query string key that will be removed from the URI if it was specified as part of the {@see uri} parameter or as an entry in {@see options.uriParts.query}.
* @param {Object} [options.headers] A set of key-value pairs that specify headers that will be set for every HTTP request sent by this instance.
* @param {Number} [options.timeout=null] The time, in milliseconds, to wait before an HTTP timeout.
* @param {function} [options.beforeRequest] A function that is called before each HTTP request that allows per-request manipulation of the request headers and query parameters.
* @param {Object} [options.cookieManager] An object that implements a cookie management interface. This should provide implementations for the `getCookieString()` and `storeCookies()` functions.
* @param {Boolean} [options.followRedirects] Should HTTP redirects be auto-followed, or should HTTP redirect responses be returned to the caller (default: true)
* @param {function} [options.fetchImpl] whatwg/fetch implementation (default: window.fetch)
*/
constructor(url = '/', {
uriParts = {},
headers = {},
timeout = null,
beforeRequest = (params) => params,
cookieManager = null,
followRedirects = true,
fetchImpl = fetch
} = {}) {
// Initialize the url for this instance
this._url = new Uri(url);
if('segments' in uriParts) {
this._url.addSegments(uriParts.segments);
}
if('query' in uriParts) {
this._url.addQueryParams(uriParts.query);
}
if('excludeQuery' in uriParts) {
this._url.removeQueryParam(uriParts.excludeQuery);
}
this._beforeRequest = beforeRequest;
this._timeout = timeout;
this._headers = headers;
this._cookieManager = cookieManager;
this._followRedirects = followRedirects;
this._fetch = fetchImpl;
}
/**
* Get a string representation of the URL used for HTTP requests.
*/
get url() {
return this._url.toString();
}
/**
* Get a Headers instance as defined by the fetch API.
*/
get headers() {
return new Headers(this._headers);
}
/**
* Get a new Plug, based on the current one, with the specified path segments added.
* @param {...String} segments The segments to be added to the new Plug instance.
* @returns {Plug} The Plug with the segments included.
*/
at(...segments) {
const values = [];
segments.forEach((segment) => {
values.push(segment.toString());
});
return new this.constructor(this._url.toString(), {
headers: this._headers,
timeout: this._timeout,
beforeRequest: this._beforeRequest,
uriParts: { segments: values },
cookieManager: this._cookieManager,
followRedirects: this._followRedirects,
fetchImpl: this._fetch
});
}
/**
* Get a new Plug, based on the current one, with the specified query parameter added.
* @param {String} key The key name of the query parameter.
* @param {String|Number|Boolean} value A value that will be serialized to a string and set as the query parameter value.
* @returns {Plug} A new Plug instance with the query parameter included.
*/
withParam(key, value) {
const params = {};
params[key] = value;
return new this.constructor(this._url.toString(), {
headers: this._headers,
timeout: this._timeout,
beforeRequest: this._beforeRequest,
uriParts: { query: params },
cookieManager: this._cookieManager,
followRedirects: this._followRedirects,
fetchImpl: this._fetch
});
}
/**
* Get a new Plug, based on the current one, with the specified query parameters added.
* @param {Object} values A key-value list of the query parameters to include.
* @returns {Plug} A new Plug instance with the query parameters included.
*/
withParams(values = {}) {
return new this.constructor(this._url.toString(), {
headers: this._headers,
timeout: this._timeout,
beforeRequest: this._beforeRequest,
uriParts: { query: values },
cookieManager: this._cookieManager,
followRedirects: this._followRedirects,
fetchImpl: this._fetch
});
}
/**
* Get a new Plug, based on the current one, with the specified query parameter removed.
* @param {String} key The key name of the query parameter in the current Plug to remove.
* @returns {Plug} A new Plug instance with the query parameter excluded.
*/
withoutParam(key) {
return new this.constructor(this._url.toString(), {
headers: this._headers,
timeout: this._timeout,
beforeRequest: this._beforeRequest,
uriParts: { excludeQuery: key },
cookieManager: this._cookieManager,
followRedirects: this._followRedirects,
fetchImpl: this._fetch
});
}
/**
* Get a new Plug, based on the current one, with the specified header added.
* @param {String} key The name of the header to add.
* @param {String} value The value of the header.
* @returns {Plug} A new Plug instance with the header included.
*/
withHeader(key, value) {
const newHeaders = Object.assign({}, this._headers);
newHeaders[key] = value;
return new this.constructor(this._url.toString(), {
timeout: this._timeout,
beforeRequest: this._beforeRequest,
headers: newHeaders,
cookieManager: this._cookieManager,
followRedirects: this._followRedirects,
fetchImpl: this._fetch
});
}
/**
* Get a new Plug, based on the current one, with the specified headers added.
* @param {Object} values A key-value list of the headers to include.
* @returns {Plug} A new Plug instance with the headers included.
*/
withHeaders(values) {
const newHeaders = Object.assign({}, this._headers);
Object.keys(values).forEach((key) => {
newHeaders[key] = values[key];
});
return new this.constructor(this._url.toString(), {
timeout: this._timeout,
beforeRequest: this._beforeRequest,
headers: newHeaders,
cookieManager: this._cookieManager,
followRedirects: this._followRedirects,
fetchImpl: this._fetch
});
}
/**
* Get a new Plug, based on the current one, with the specified header removed.
* @param {String} key The name of the header in the current Plug to remove.
* @returns {Plug} A new Plug instance with the header excluded.
*/
withoutHeader(key) {
const newHeaders = Object.assign({}, this._headers);
delete newHeaders[key];
return new this.constructor(this._url.toString(), {
timeout: this._timeout,
beforeRequest: this._beforeRequest,
headers: newHeaders,
cookieManager: this._cookieManager,
fetchImpl: this._fetch
});
}
/**
* Get a new Plug, based on the current one, with follow redirects enabled
* @returns {Plug} A new Plug instance with follow redirects enabled
*/
withFollowRedirects() {
return new this.constructor(this._url.toString(), {
timeout: this._timeout,
beforeRequest: this._beforeRequest,
headers: this._headers,
cookieManager: this._cookieManager,
followRedirects: true,
fetchImpl: this._fetch
});
}
/**
* Get a new Plug, based on the current one, with follow redirects disabled
* @returns {Plug} A new Plug instance with follow redirects disabled
*/
withoutFollowRedirects() {
return new this.constructor(this._url.toString(), {
timeout: this._timeout,
beforeRequest: this._beforeRequest,
headers: this._headers,
cookieManager: this._cookieManager,
followRedirects: false,
fetchImpl: this._fetch
});
}
/**
* Perform an HTTP GET Request.
* @param {String} [method=GET] The HTTP method to set as part of the GET logic.
* @returns {Promise} A Promise that, when resolved, yields the {Response} object as defined by the fetch API.
*/
get(method = 'GET') {
const params = this._beforeRequest({
url: this._url.toString(),
method: method,
headers: Object.assign({}, this._headers)
});
return _doFetch.call(this, params);
}
/**
* Perform an HTTP POST request.
* @param {String} body The body of the POST.
* @param {String} mime The mime type of the request, set in the `Content-Type` header.
* @param {String} [method=POST] The HTTP method to use with the POST logic.
* @returns {Promise} A Promise that, when resolved, yields the {Response} object as defined by the fetch API.
*/
post(body, mime, method = 'POST') {
if(mime) {
this._headers['Content-Type'] = mime;
}
const params = this._beforeRequest({
url: this._url.toString(),
method: method,
body: body,
headers: Object.assign({}, this._headers)
});
return _doFetch.call(this, params);
}
/**
* Perform an HTTP PUT request.
* @param {String} body The body of the PUT.
* @param {String} mime The mime type of the request, set in the `Content-Type` header.
* @returns {Promise} A Promise that, when resolved, yields the {Response} object as defined by the fetch API.
*/
put(body, mime) {
return this.post(body, mime, 'PUT');
}
/**
* Perform an HTTP HEAD request.
* @returns {Promise} A Promise that, when resolved, yields the {Response} object as defined by the fetch API.
*/
head() {
return this.get('HEAD');
}
/**
* Perform an HTTP OPTIONS request.
* @returns {Promise} A Promise that, when resolved, yields the {Response} object as defined by the fetch API.
*/
options() {
return this.get('OPTIONS');
}
/**
* Perform an HTTP DELETE request.
* @returns {Promise} A Promise that, when resolved, yields the {Response} object as defined by the fetch API.
*/
delete() {
return this.post(null, null, 'DELETE');
}
}


1 + 2 = {{ 1 + 2 }}
Fast just got faster with Nexus S.
The Next, Next Generation tablet.
Total number of phones: 2


Glory Road; Robert A. Heinlein; Paperback; $9.00;
Glory Road; Robert A. Heinlein; Mass Market Paperback; $5.39;
The Moon Is a Harsh Mistress; Robert A. Heinlein; Hardcover; $21.56;
The Notebooks of Lazarus Long; Robert A. Heinlein, D. F. Vassallo (Illustrator); Paperback; $14.35;
Podkayne of Mars; Robert A. Heinlein; Paperback; $9.00;
Podkayne of Mars; Robert A. Heinlein; Mass Market Paperback; $5.39;
Requiem and Tributes to the Grand Master; Robert A. Heinlein; Mass Market Paperback; $6.29;
Starship Troopers; Robert A. Heinlein; Mass Market Paperback; $5.39;
Take Back Your Government! : A Practical Handbook for the Private Citizen Who Wants Democracy to Work; Robert A. Heinlein; Mass Market Paperback; $5.39
To Sail Beyond the Sunset; Robert A. Heinlein; Mass Market Paperback; $6.29;
Tramp Royale; Robert A. Heinlein; Paperback; $13.50;
The Unpleasant Profession of Jonathan Hoag; Robert A. Heinlein; Mass Market Paperback; $5.39;
William Shatner and Leonard Nimoy Read Four Science Fiction Classics : Foundation : The Psychohistorians/Mimsy Were the Borogoves/the Martian Chronic; Isaac Asimov, et al; Audio Cassette; $22.50;
Assignment in Eternity; Robert A. Heinlein; Paperback;
Beyond This Horizon; Robert A. Heinlein; Paperback
Citizen of the Galaxy; Robert A. Heinlein; Unknown Binding; $11.30;
Farmer in the Sky; Robert A. Heinlein; Unknown Binding; $11.30
Green Hills of Earth; Robert A. Heinlein; Hardcover; $21.95
Methuselah's Children; Robert A. Heinlein; Paperback
Methuselahs Children; Robert A. Heinlein; Hardcover; $21.95
The Moon Is a Harsh Mistress; Robert A. Heinlein; Paperback; $13.45 (Not Yet Published -- On Order);
Red Planet; Robert A. Heinlein; Unknown Binding; $11.30
Silent Thunder/Universe (Tor Science Fiction Double No 35); Dean Ing, Robert A. Heinlein; Paperback
Starman Jones; Robert A. Heinlein; Unknown Binding; $11.30
Starship Troopers; Robert A. Heinlein; Hardcover; $24.95 ;
Stranger in a Strange Land; Robert A. Heinlein; Hardcover; $69.95 ;
Beyond This Horizon; Robert A. Heinlein; Paperback (Hard to Find)
Beyond This Horizon (The Gregg Press Science Fiction Series); Robert A. Heinlein; Textbook Binding (Hard to Find)
The Cat Who Walks Through Walls; Robert A. Heinlein; Hardcover (Hard to Find)
The cat who walks through walls : a comedy of manners; Robert A. Heinlein; Unknown Binding (Hard to Find)
The Cat Who Walks Through Walls : A Comedy of Manners; Robert A. Heinlein; Hardcover (Hard to Find)
Day After Tomorrow; Robert A. Heinlein; Paperback (Hard to Find)
The Door into Summer (The Gregg Press Science Fiction Series); Robert A. Heinlein; Textbook Binding (Hard to Find)
Double Star (The Gregg Press Science Fiction Series); Robert A. Heinlein; Hardcover (Hard to Find)
Farnham's Freehold; Robert A. Heinlein; Hardcover (Hard to Find)
The Green Hills of Earth; Robert A. Heinlein; Paperback (Hard to Find)
Grumbles from the Grave; Robert A. Heinlein; Paperback (Hard to Find)
I Will Fear No Evil (The Gregg Press Science Fiction Series); Robert A. Heinlein; Textbook Binding (Hard to Find)
Job : A Comedy of Justice/2 Audio Cassettes (Audioworks); Robert A. Heinlein; Hardcover (Hard to Find)
The Man Who Sold the Moon; Robert A. Heinlein; Paperback (Hard to Find)
Moon Is a Harsh Mistress; Robert A. Heinlein; Hardcover (Hard to Find)
Moon Is a Harsh Mistress; Robert A. Heinlein; Hardcover (Hard to Find)
Orphans of the Sky; Robert A. Heinlein; Paperback (Hard to Find)
The Past Through Tomorrow; Robert A. Heinlein; Paperback (Hard to Find)
The past through tomorrow; Robert A. Heinlein; Unknown Binding (Hard to Find)
The past through tomorrow; Robert A. Heinlein; Unknown Binding (Hard to Find)
Past Through Tomorrow Future History Stories; Robert A. Heinlein; Hardcover (Hard to Find)
The Puppet Masters (Gregg Press Science Fiction Series); Robert A. Heinlein; Textbook Binding (Hard to Find)
Starship Troopers; Robert A. Heinlein; Hardcover (Hard to Find)
Starship troopers; Robert A. Heinlein; Unknown Binding (Hard to Find)
Stranger in a Strange Land; Robert A. Heinlein; Paperback (Hard to Find)
Stranger in a Strange Land; Robert A. Heinlein; Hardcover (Hard to Find)
Stranger in a Strange Land/30th Anniversary, Uncut Version; Robert A. Heinlein; Hardcover (Hard to Find)
Time Enough for Love : The Lives of Lazarus Long : A Novel; Robert A. Heinlein; Hardcover (Hard to Find)
Time for the Stars; Robert A. Heinlein; School & Library Binding (Hard to Find)
To Sail Beyond the Sunset : The Life and Loves of Maureen Johnson/Being the Memoirs of a Somewhat Irregular Lady; Robert A. Heinlein; Hardcover (Hard to Find)
Tomorrow the Stars; Robert A. Heinlein; Paperback (Hard to Find)
Tramp Royale; Robert A. Heinlein; Hardcover (Hard to Find)
The unpleasant profession of Jonathan Hoag; Robert A. Heinlein; Unknown Binding (Hard to Find)
Waldo and Magic, Inc (The Gregg Press Science Fiction Series); Robert A. Heinlein; Hardcover (Hard to Find)
Waldo, and Magic inc.; Robert A. Heinlein; Unknown Binding (Hard to Find)
This page is maintained by Alexander Chislenko


JimCarry Project
AMAZING PEOPLE ARE MAKING AMAZING DESIGNS IN A FUN ENVIRONMENT.
When you work with us, you are part of a team of committed collaborators. All aspects of our software development process are intergrated, interactive and agile.
Our approach unifies design, development an product management to create exceptional products.
We start each project by understanding your business goals, the user's needs and the the product requirements.
Then we help translate them into effective and elegant solutions.
Before we sign a contract or write a line of code our team will spend the necessary time needed to understand your product vision.
The outcome of the scoping session is proposal or high-level statement of work.
Based on your requirements, we can provide a complete offering or just the pieces you need.
DESIGN
Our design practice offers a full range of services including brand strategy, interaction and visual design and user experience testing.
Throughout your project, our designers create and implement visual design and workflows, solicit user feedback and work with you to make sure what gets built is what is needed.
DESIGN
DEVELOPMENT
All engineers are fluent in the latest enerprise, mobile and web development technologies.
they collaborate with your team to write, and improve code on a daily basis, using proven practices such as test-driven development and pair programming.
DEVELOPMENT
PRODUCT MANAGEMENT
Planning and development is iteravtive. Because we are constantly coding and testing, the products we build are always ready to go live.
This iterative process allows for changes as business requirements evolve.
PRODUCT MANAGEMENT
JimCarry Project
Orange.ltd Project
Ontaro Security Project
Blue ltd Project
Good Day Webpage
Interactive Project
Burned
Giraffe Restaurant Webpage


Upon interrogation of {{ SuspectsFactory.perpetrator.name }} you notice that he seems very nervous. {{ SuspectsFactory.perpetrator.name }} won't make eye contact with you and tries to walk away. He grabs his phone and claims he has a missed call from his mom that he must attend to. However, you notice that there were no missed calls on {{ SuspectsFactory.perpetrator.name }}'s phone...


Milkdown is an editor.
Hello, milkdown nice to
meet you!
There should
be a line break before this.
Of course you can add image!
Your link is here, have a look.
list item 1
is this the real life
is this just fantasy
list item 2
sub list item 1
some explain
sub list item 2
list item 3
const milkdown = new Milkdown();
milkdown.create();
Now you can play!


This page contains an index of all the places in the database, sorted by their title. Clicking on a place’s title will take you to that place’s page.
| Letter | Name | State/ Province | Country | Latitude | Longitude |
|---|---|---|---|---|---|
| 1 | 110 W. Carey Street, Plains PA | ||||
| 3 | 319? River Street Plains PA | ||||
| A | Austria | Austria | |||
| Avoca, Pennsylvania | |||||
| C | Cambridge Portage, Cambria, PA | ||||
| Camp Dix, New Jersey | |||||
| E | East Farmingdale, New York | ||||
| Edward Baron funeral home | |||||
| H | Hazleton State General Hospital | ||||
| L | Lawrence Massachusetts | ||||
| Lawrence Massachusetts General Hospital | |||||
| Luzerne County, Pennsylvania | |||||
| M | Moab Arts and Recreation Center (MARC) | 38°34'30.01"N | 109°32'54.18"W | ||
| P | Plains, Pennsylvania | ||||
| Poland | Poland | ||||
| S | Sanko, Austria Poland | Sanko, Austria Poland | |||
| South Fork, PA | |||||
| St. Mary’s Polish Cemetery, Wyoming Borough Luzerne PA | |||||
| St. Marys Polish Cemetery, Plains PA |


Implement CRF labeling algorithm and run it against given data (2 txt files given last week). You should be able to use the output to automatically generate infobox for each Wikipedia entry.
Data Transfer
Xiao Ai Company Representative
Go to the company some time this week with two 2T hard drives. Then meet with Mr. Xiao to retrieve the data needed in domain knowledge transfer project. Note that this may take a while beacuse of the large volume of data. Leave enough time for this task.
OS Lab2
Zhao Jin Lecturer
Complete all items required in Lab 2 and write a report. Hand in codes and report by deadline. You should remember that this specific lab asks you to use semaphores instead of other approaches.
Statistics Mid-term
Zhang Wei Lecturer
Prepare for the mid-term of Introduction to Statistics. There will be many proofs and you shouldn't expect problems similar to those in the textbooks. With that being said, as long as you've got the fundamentals well enough, you are probably OK.
Cryptography PA2
Zhao Yiming Lecturer
Implement all the necessary components of RSA encryption/decryption. Then combine that with the DES module you completed in PA 1 to demonstrate the use of RSA in encrypting the key used in DES.


I'm a Web Programmer based in Cirebon, Indonesia. I'm passionate about travel, collaboration, and sharing the use of information and communication technology through my activities as an ICT volunteer.
I'm a Web programmer with 2+ years of experience as freelancer.
I like designing website, ID card, and banner using Corel and Photoshop.
I am happy to help others in IT problems as ICT volunteers in Cirebon.
I'm interested in chatting about website, feel free to connect with me on any of the social platforms below.


Home
Lessons
Exercies
## Exercice List Below is an order list of all the exercices we will be doing ### Agenda 1. Create CSS 2. Create Some JSX 3. Import Component 4. Props 5. Import some JSON 6. Classes 7. Changing the state 8. Making an API call --- ## Importing CSS React still uses CSS, it is unmodified from what we are used to. We can import CSS and make it available to our entire project like this: ```JS import './app.css'; ``` All you have to do is make sure an app.css exsists in the same directory, if it is it will be available for your entire application. --- ## Creating JSX For this we are going to be looking at creating a card for our inividual student from your yearbook. You can re-use your HTML and CSS from prevoius work here. ```JS export default function App() { return (
...
...
...
) } ``` --- ## Creating a component We are going to be creating a component and importing into our `app.js`. We should already have the JSX needed to make the component. We should start by making a new file called `Card.js` in our main directory. That file should look like: ```JS import React from 'react'; function Card(props) { return (
...
...
...
); } export default Card; ``` --- ## Creating a component Part 2 Now that we have our component `card.js` we need to import and run it inside the `app.js`, it shold look like: ```JS import React from 'react'; import Card from './Card.js' export default function App() { return (
); } ``` --- ## Creating a component Part 3 Finally we need to make components for the rest of our elements, in my version I had a component for the following: 1. Card (
) 2. Featured Card (
) 3. Header (
) --- ## Import and render JSON Next we will be importing and rendering JSON data. First up we need to download and import a .json file. You can get it [here](https://google.com) Once we have the json file in our directory we will need to import it into our application, so in our `app.js` we need to have something like: ```JS import students from './students.json'; ``` This should give us access to the info in students as an array, we can loop over this and render the `
` component for each iteration --- ## Import and render JSON Part 2 Next we will be creating a map method to loop through the students info, your code inside your `app.js` will look like this: ```JS function App() { return (
{students && students.map(student => (
))}
); } ``` The `students &&` part before the map is a check to make sure students is defined. The `students.map(student => (` is what starts our loop, where `student` is a variable defined containing the current iteration. --- ## Passing Props Next we are going to look at passing props to the `
` component. Right now this component should be used to render all the different students, however we have hard-coded all the values in the card to be the same. We can fix this by passing props to the card. So we need to change our code a bit. In `App.js` we need to change: ```JS import React from 'react'; import Card from './Card.js' export default function App() { return (
); } ``` --- ## Passing Props part 2 Now that we have defined and passed props from the parent component we need to recive and parse those props in the `Card.js` component. So our new code will look like: ```JS import React from 'react'; function Card(props) { return (
{props.name}
{props.degree}
{props.quote}
); } export default Card; ``` As you can see we are defing a new argument in the paramenters of `function Card(props)` if we were to console.log this value we would see something like: ```JS { name: "...", degree: "...", quote: ".." } ``` React automatically wraps all props in an object --- ## React and Classes Sometimes we need to use classes in react, mainly becuase it allows to make use of some of the built in methods of react. Such as: 1. ComponentDidMount 2. ComponentWillUpdate Methods like these are called life-cycle events in react, you can read about them [here](https://blog.bitsrc.io/react-16-lifecycle-methods-how-and-when-to-use-them-f4ad31fb2282). These methods are really helpful when loading dyanmic content, such as api data. So let's look at the differences between the function based component that we have been using and the new class based that we will be using. ``` JS // function export function App() { return ( ... ) } // Class export default class App extends React.Component { render() { return ( ... ) } } ``` --- ## React and Classes part 2 Next up is understanding one of the react life-cycle methods : `componentDidMount`. The react life cycle is a circle of events that fire in order.
``` JS export default class App extends React.Component { componentDidMount() { console.log("did mount"); } render() { console.log("render"); return ( ... ) } } ``` The output here would be `render` then `did mount`. --- ## State For the next few exercices first download the weather App from [here](weather.com), this is a small react app that makes a call to an api then renders the information. I will be referncing the app files several times. To install the weather app simply cd into the directory and run `npm i` and then `npm run start`. Once the app is running we should look at the `app.js` in the main directory. ``` JS class App extends React.Component { state = { temperature: undefined, city: undefined, country: undefined, humidity: undefined, description: undefined, error: undefined } ``` This is refered to as a local state in react, it is technically just an object with key, value pairs. The cool part is, when ever any value inside your state changes the entire react life-cycle with re-fire automatically. --- ## State part 2 Next up is modifing the state, we do this with the `setState` function, which can be explained [here](https://www.freecodecamp.org/news/get-pro-with-react-setstate-in-10-minutes-d38251d1c781/) if you look at line 25 of `app.js` you will see the function that updates the state. The function function that wraps it is called `axios` it is a way of getting information from a service called an API. The basic structure is this: ``` JS axios.get('url') // url == the endpoint of the API .then((response) => { // this is fired once the data has been loaded console.log(response) // this is the response from the endpoint }); ``` Next up is modifing the state, which happens at line 25: ``` JS this.setState({ temperature: response.data.main.temp, city: response.data.name, country: response.data.sys.country, humidity: response.data.main.humidity, description: response.data.weather[0].description, error: "" }) ``` This block is relativity easy to go through, basically we are targeting every key that we setup in the default state and changing it. What is happening behind the scenes, is that react is always watching this state and waiting for it the change. When it does react goes through it's life-cycle with updated information. --- ## State Part 3 In that last step we went over how to modify the state in react, now we need to use those updated values. One peice of the life cycle is the render, so in order of opperations it will look like this: 1. Render 2. ComponentDidMount 3. API Call 4. Update State 5. Render The first time `Render` fires all the values will be blank, but after the state changes React will automatically re-fire. This means that if we were to throw some console.logs in the `render` function like: ``` JS render() { console.log('render', this.state.city); return ( ... ) } ``` the output from this will be : `render undefined` `render Toronto` We can tell from this that the render function does indeed fire twice, once when the App loads and then another time when the state is updated. ---


Kage
December 28, 2017
Kage is a 2D infinite running game where you defile as much of the city as you can.
Loading...
Kage is also available on Android
December 28, 2017
Kage is a 2D infinite running game where you defile as much of the city as you can.
Kage is also available on Android


All classesarrow_drop_down
You have no upcoming assignments.
Use the menu on the top left to navigate.
Great!
{{assignment.klassId.name}}
{{assignment.assignmentId.name}}
{{assignment.assignmentId.description}} DUE {{assignment.assignmentId.due | date:"EEE, MMM dd"}}
{{assignment.assignmentId.numComplete}}
complete
{{assignment.assignmentId.numNotComplete}}
not done
more_vert


Correspondence
Edward Timpson writes to the Coventry Safeguarding Children Board
This was published under the 2010 to 2015 Conservative and Liberal Democrat coalition government
Minister Edward Timpson writes to the Coventry board about their 'Deeper analysis report' of the failures that led to Daniel Pelka's death.
Details
Letter from the Under Secretary of State for Children and Families Edward Timpson, to the Coventry Safeguarding Children Board, about their ‘Deeper analysis report’ into the failures that led to the death of Daniel Pelka.
In the letter the minister states that:
-
the report gives him more confidence that the root causes of any failures are understood
-
he trusts that Coventry Safeguarding Children Board and agencies will be rigorous in implementing the required changes to practice so that vulnerable children are better protected
A copy of the report and further information about the review can be found on the
Coventry Safeguarding Children Board website
.


Though virtual reality technology is new, it is rapidly growing and soon many games and other applications will include VR.
Introduction to the project.
list of stakeholder groups and goals.
Features that must be included.
Hardware, software, and design.
Example scenarios for application use.
Hierorical task analysis for scenarios.
The Team and the project contributions.


Created on 07/08/2012
@author: victor
Bases: object
This class implements functions to get a list of clusterings and return a list of filtered clusterings (hopefully smaller).
Adds a clustering to selected or not_selected arrays depending on if the rejection reasons array is empty or not. @param selected: The ‘clustering info’ dictionary with accepted clusterings. @param not_selected: The ‘clustering info’ dictionary with rejected clusterings. @param clusterings: The ‘clustering info’ dictionary. @param clustering_id: Is the id in a ‘clustering info’ dictionary of the clustering being checked. @param reasons: Rejection reasons array.
Decides if one clustering is inside the defined parameters, and returns the reasons of why not otherwise.
@param clustering: The clustering to be checked.
@return: The reasons of not being selected (if any).
Checks that the clustering is not repeated again in the clustering list. Clusterings are considered equal if their clusters are equal (even if they were generated using different algorithms and / or parameters).
@param clustering: The clustering to be checked.
@param all_clusterings: The array containing all the ‘clustering info’ dictionaries.
@return: A dictionary with the reasons to discard the clustering if any.
Does the noise level check.
@param clustering: The clustering to be checked.
@return: The reasons of not being selected (if any).
Used to see if a clustering has a number of clusters in the range defined by script’s evaluation parameters.
@param clustering: The clustering to be checked.
@return: The reasons of not being selected (if any).
Eliminates the clusters whose parameters are not in the range we have defined in the script evaluation parameters.
@param clusterings: Is a clustering_info dictionary indexed by clustering_id
@return: A tuple containing the clustering_info structures of the selected and not selected clusterings. These last with their reasons for not having been selected.
Checks if the clustering is already inside ‘all_clusterings’, returning a rejection reason in this case.
@param clustering_id: The clustering id to be tested. @param all_clusterings: The array containing all the ‘clustering info’ dictionaries.
@return: The new selected and not selected ‘clustering info’ arrays


Python Program
Load from:
Filename to save:
Load
Save
Editor's theme:
Hide REPLs
Run!
Reset!
Run: ctrl+r
REPLs/Outputs
Clear!
»


Follow these steps to calculate the cost of licensing an Alpha:
- Log in to the Algorithm Lab.
- In the left navigation bar, click Strategies > Strategies.
- On the Strategies page, click an Alpha in the Alphas table.
- On the Alpha page, click License Alpha.
- Enter an allocation and maximum bid price.
The Summary section displays the cost of licensing the Alpha.


Celades focused on the game against Chelsea
by BeSoccerValencia coach, Albert Celades, stated after the defeat against Betis, that "now he is only thinking about the next game that comes, which is in the Champions League against Chelsea, next Wednesday at Mestalla.
Celades stated that his team did not go into the game at Benito Villamarin thinking about the Champions League clash with Chelsea, "because the best way to go into a game is by winning the last".
About Canales' goal from a free kick in the 93rd minute, the coach said that he does not believe that there was "lack of intensity" in his team when defending the launching of the Betis midfielder, and emphasised that "the last minutes became a very open party, with both teams attacking and where everyone's battling for the win".
Featured links
- The latest football transfers news and rumours
- Luis Enrique returns to Spain national team
- Mourinho replaces Pochettino at Tottenham
- Wales, golf, Madrid... in that order
The Valencian coach also valued "the offensive potential of Betis on the wings" and that the rival "has very talented players".


Function Layers
Function Layer Detail JSON
In the detail JSON, each function declares information relevant to setting up a map interface for the layer. Because functions generate tiles dynamically, the system cannot auto-discover things like extent or center. However, the custom parameters and defaults can be read from the function definition and exposed in the detail JSON.
{
"name" : "parcels_in_radius",
"id" : "public.parcels_in_radius",
"schema" : "public",
"description" : "Given the click point (click_lon, click_lat) and radius, returns all the parcels in the radius, clipped to the radius circle.",
"minzoom" : 0,
"arguments" : [
{
"default" : "-123.13",
"name" : "click_lon",
"type" : "double precision"
},
{
"default" : "49.25",
"name" : "click_lat",
"type" : "double precision"
},
{
"default" : "500.0",
"type" : "double precision",
"name" : "radius"
}
],
"maxzoom" : 22,
"tileurl" : "http://localhost:7800/public.parcels_in_radius/{z}/{x}/{y}.pbf"
}
description
can be set usingCOMMENT ON FUNCTION
SQL command.id
,schema
andname
are the fully qualified name, schema and function name, respectively.minzoom
andmaxzoom
are just the defaults, as set in the configuration file.arguments
is a list of argument names, with the data type and default value.
Function Layer Examples
Filtering Example
This simple example returns just a filtered subset of a table (ne_50m_admin_0_countries EPSG:4326). The filter in this case is the first letters of the name. Note that the name_prefix
parameter includes a default value: this is useful for clients (like the preview interface for this server) that read arbitrary function definitions and need a default value to fill into interface fields.
CREATE OR REPLACE
FUNCTION public.countries_name(
z integer, x integer, y integer,
name_prefix text default 'B')
RETURNS bytea
AS $$
WITH
bounds AS (
SELECT ST_TileEnvelope(z, x, y) AS geom
),
mvtgeom AS (
SELECT ST_AsMVTGeom(ST_Transform(t.geom, 3857), bounds.geom) AS geom,
t.name
FROM ne_50m_admin_0_countries t, bounds
WHERE ST_Intersects(t.geom, ST_Transform(bounds.geom, 4326))
AND upper(t.name) LIKE (upper(name_prefix) || '%')
)
SELECT ST_AsMVT(mvtgeom, 'public.countries_name') FROM mvtgeom;
$$
LANGUAGE 'sql'
VOLATILE
PARALLEL SAFE;
COMMENT ON FUNCTION public.countries_name IS 'Filters the countries table by the initial letters of the name using the "name_prefix" parameter.';
Some notes about this function:
- The
ST_AsMVT()
function uses the function name (“public.countries_name”) as the MVT layer name. This is not required, but for clients that self-configure, it allows them to use the function name as the layer source name. - In the filter portion of the query (in the
WHERE
clause) the bounds are transformed to the spatial reference of the table data (4326) so that the spatial index on the table geometry can be used. - In the
ST_AsMVTGeom()
portion of the query, the table geometry is transformed into web mercator (3857) to match the bounds, and the de facto expectation that MVT tiles are delivered in web mercator projection. - The
ST_TileEnvelope()
function used here is a utility function available in PostGIS 3.0 and higher. For earlier versions, you will probably want to add a custom function to emulate the behavior.CREATE OR REPLACE FUNCTION TS_TileEnvelope(z integer, x integer, y integer) RETURNS geometry AS $$ DECLARE size float8; zp integer = pow(2, z); gx float8; gy float8; BEGIN IF y >= zp OR y < 0 OR x >= zp OR x < 0 THEN RAISE EXCEPTION 'invalid tile coordinate (%, %, %)', z, x, y; END IF; size := 40075016.6855784 / zp; gx := (size * x) - (40075016.6855784/2); gy := (40075016.6855784/2) - (size * y); RETURN ST_SetSRID(ST_MakeEnvelope(gx, gy, gx + size, gy - size), 3857); END; $$ LANGUAGE 'plpgsql' IMMUTABLE STRICT PARALLEL SAFE;
- The
LIMIT
is hard-coded in this example. If you want a user-defined limit, you need to add another parameter to your function definition. - The function “volatility” is declared as
STABLE
because within one transaction context, multiple runs with the same inputs will return the same outputs. It is not marked asIMMUTABLE
because changes in the base table can change the outputs over time, even for the same inputs. - The function is declared as
PARALLEL SAFE
because it doesn’t depend on any global state that might get confused by running multiple copies of the function at once.
Spatial Processing Example
This example clips a layer of parcels EPSG:26910 using a radius and center point, returning only the parcels in the radius, with the boundary parcels clipped to the center.
CREATE OR REPLACE
FUNCTION public.parcels_in_radius(
z integer, x integer, y integer,
click_lon float8 default -123.13,
click_lat float8 default 49.25,
radius float8 default 500.0)
RETURNS bytea
AS $$
WITH
args AS (
SELECT
ST_TileEnvelope(z, x, y) AS bounds,
ST_Transform(ST_SetSRID(ST_MakePoint(click_lon, click_lat), 4326), 26910) AS click
),
mvtgeom AS (
SELECT
ST_AsMVTGeom(
ST_Transform(
ST_Intersection(
p.geom,
ST_Buffer(args.click, radius)),
3857),
args.bounds) AS geom,
p.site_id
FROM parcels p, args
WHERE ST_Intersects(p.geom, ST_Transform(args.bounds, 26910))
AND ST_DWithin(p.geom, args.click, radius)
LIMIT 10000
)
SELECT ST_AsMVT(mvtgeom, 'public.parcels_in_radius') FROM mvtgeom
$$
LANGUAGE 'sql'
STABLE
PARALLEL SAFE;
COMMENT ON FUNCTION public.parcels_in_radius IS 'Given the click point (click_lon, click_lat) and radius, returns all the parcels in the radius, clipped to the radius circle.';
Notes:
- The parcels are stored in a table with spatial reference system 3005, a planar projection.
- The click parameters are longitude/latitude, so in building a click geometry (
ST_MakePoint()
) to use for querying, we transform the geometry to the table spatial reference. - To get the parcel boundaries clipped to the radius, we build a circle in the native spatial reference (26910) using the
ST_Buffer()
function on the click point, then intersect that circle with the parcels.


Bacon ipsum dolor amet fatback meatloaf picanha boudin shoulder turkey turducken cow ham hock beef short ribs flank tri-tip. Ground round ham beef shank chicken. Shank landjaeger jerky, hamburger buffalo pork belly swine prosciutto. Drumstick meatloaf rump, burgdoggen tongue turducken fatback.
| Hobby | Year Started | Age |
|---|---|---|
| Gardening | 2010 | 32 years |
| Crocheting | 1988 | 10 years |
| Coding | 2009 | 31 years |


This post is censored by IRMA
I always hoped for better for Ireland; but it seems the thieving hand of “rights” organizations which pretend to represent the artist have struck gold. Being able to cajole and bribe the largest Irish Internet Service Provider (ISP) - Eircom; has worked only too well. Although Eircom has said it will only obey by having a court order - it has agreed never to oppose these - which makes it complicit in the act of censorship. My Letter to Our ISP, Eircom, IRMA, EFF:
Dear [OUR ISP],
We are a loyal customer of yours. We are writing this because we’re concerned about recent news regarding IRMA (Irish Music Rights Ass.) relationship with your company (the recent letters sent out).
It would seem that they are seeking to become self-appointed censors of Irish Internet communications. We do not think that a third-party company should be permitted to arbitrarily decide which Internet sites Eircom users; or more importantly any Irish Internet user should be allowed to visit. Will IRMA want to block sites that merely link to copyrightable material, proxy sites that circumvent the block, blogs that criticize its actions? This is a very slippery slope and should be nipped in the bud.
In the recent high profile case against The Pirate Bay in Sweden; IRMA’s handlers (IFPI, RIAA) have shown their hand: they don’t even understand the underlying technology. John Kennedy, CEO. IFPI:
Kennedy said he qualified as a lawyer since the 70’s but hasn’t practiced recently. He was asked if he understood BitTorrent. Kennedy said he did, but in “very vague terms.” When the defense lawyers asked more detailed questions, about uTorrent for instance, Kennedy said he’d heard of it but had no idea of the details. It was very clear he knew nothing about any remotely technical issues.
This is the the kind of people who wish to regulate the Internet. Questions need to be asked that if you follow IRMA’s requested actions does this open you up to legal action for any other kinds of material which rights holders are protective of (Church of Scientology) ? and can you retain common carrier status like An Post; and need warrants issued instead of some rights organisation sending you a vague letter pretending to represent XY&Z ?
We understand the ‘concern’ about Internet piracy. Artists definitely need to be paid for their hard work. It is an important issue in this day and age, and it must be addressed correctly. Censorship is not the answer. It is avoiding the issue. As has always happened in these cases, it is normal customers who are inconvenienced and have their free speech restricted the most. We need solutions that work, not knee-jerk reactions that are doomed to fail. We recommend you read the EFF’s whitepaper on a better way forward for online music. http://www.eff.org/wp/better-way-forward-voluntary-collective-licensing-music-file-sharingThere are opportunities here that are being missed. I think it would be for the benefit of both artists and music fans if a solution could be found that combines the technologies developed by the pirates with a fair system for paying artists.
**There was a very similar case in Italy where ISPs were forced to block The Pirate Bay’s website after pressure from the music industry (the result was that Italian traffic to the site increased by 5%) . The ban was judged illegal in court under European Directive, 2000/31 CE which is also applicable in Ireland. **
If this ban goes ahead, Eircom and indeed Ireland will have a tarnished image on the world stage as a place where misguided efforts to protect revenue supersede freedom of communication. We would also be strongly considering abandoning our Internet subscription for an ISP who doesn’t cave to these demands, and we imagine many other business’ will too.
Please, make the right choice. The world is watching. Your decision will have an important impact on the future of the Internet in Ireland.Yours faithfully,
[Footer]
I will posting more on this issue as it happens. Stay Tuned! If your Irish and/or in Ireland: please visit: http://blackoutireland.com/


We provide the Ironcoin, the new cryptocurrency that will gather all the fans of Game of Thrones.
We want everyone to be aware and recognize the power of the ironbank. We give the richest queen the same open arms as the poorest boy.
The coins will use the erc20 ethereum blockchain. It is one of the fastest and safest way to store and trade your coins.
During this age the children of the forest are creating and gathering an anthic power. In this early age, great power are sleeping. Early adopters will enjoy Airdrop age. The idea is to gather a community of enthusiastic people that will share our beliefs : Shadows are full of horrors and the Ironbank future is bright.
The Great War is the consequence of gathering such a power in a tiny space. The power only aim to be freed and this potential comes naturally with disasters and unprecedented opportunities. It’s now too late for be newcomers to be called “the First Men”, nevertheless this is the golden age for the Lannister. They founded their fortunes with wise investment they made at that time in the newly created Ironbank. During this age, we will ask all our community to promote a document suggesting George R.R Martin to recognize and accept to promote our coin.
The Great War is over, it left great scars in Westeros. Now that the first men almost disappeared, the territory is divided by the very famous 7 houses that HODL the power. All those houses had what seemed like a never ending conflict and war and the IronBank thanks to its supply of Ironcoin kept the power balanced helping unlucky houses to survive the great war and maintain their influence over their enemies. This conflicts ended because of the arrival of a greatest enemy. The battle of life against death, the battle that started with the moves of the white walkers heading south : Winter is coming. The Ironbank will again need to use it’s influence to unite all the houses to fight this greatest enemy.
The north can’t hold the white-walker anymore. Winter is here, the bank has been betrayed by the Lannisters ( they pretended to have plenty of gold in their mine ), thus couldn’t unify the main houses using the influence of it’s precious ironcoin. They kept fighting. Only one hope remains, gather what is left of the Ancien Power : the children of the forest, the house Strack and the prophecy that claim the rise of a new Queen - The Mother of Dragons - Queen of unsullied - .
Lead Designer
Lead Marketer
Lead Developer
In the Dawn Age of Westeros, before the coming of man and the raising of castles and cities, there were only the Children of the Forest." ―Bran Stark


| Physical Location: J307 Lab: Gunner Lab Department: Physics IP: <IP_ADDRESS> Administrator: Yanjun Wang |
Hestia, MCCE Server at Gunner LabQuick Links: Welcome to the MCCE (Multi-Conformation Continuum Electrostatics) server at Marilyn Gunner's Lab of City College of New York. This server, Hestia, is for scientific research purpuse and dedicated to run MCCE program and other Biophysical simulation programs. It started its service on September 17, 2004. Hestia is a 12-node Linux Cluster with Each node of Hestia is equipped with two 3.06 GHz Xeon processors and 4 GB DDR memory. The storage of this server consists 3 SCSI hard disk drives shared by all nodes. Hestia runs RedHat Linux 9.0. Open source OSCAR is used to cluster the nodes. Parallel programming is supported by MPICH library, and serial jobs can be scheduled by Condor. HTTP, SSH, MYSQL services are enabled. Biophysical simulation programs installed on Hestia include MCCE, Gaussian and CHARMM. Protein structure visualization tools Swiss PDB Viewer and Pymol are installed but remote use of these visualization tools is not recommended. Besides Hestia, Gunner Lab manages two 8-node Linux clusters, sibyl and metis. If you have questions about using computing resources in Gunner Lab, please contact Marilyn Gunner (gunner@sci.ccny.cuny.edu). To new users of Hestia:
|
Home
|
Last Updated: 09/20/2004,Gunner Lab, City College of New York, 2004


HTML Game Creation
A intro to makeing a html canvas.
Here's how you make a HTML 5 game without any frame work: We'll start with the basic components
then work on makeing a tron game. Basic HTML knowlage is required and basic JS/programming knowlage is recommended.
the HTML:
Nothing fancy just a link to Jquery(In case you need it later), your JS, and your canvas. If you're unfamiliar with HTML or need a refresher try http://www.w3schools.com/html
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
canvas.width = 800;
canvas.height = 600;
var i = 0;
This should go at the beginning of your JS file, it gives you control of your canvas, you can now set the high and width and draw on your canvas with ctx.fillwhatevermethod()
window.onload = function() {
var main = function() {
var now = Date.now();
var delta = now - then;
update(delta / 2000);
render();
then = now;
requestAnimationFrame(main);
};
var w = window;
requestAnimationFrame = w.requestAnimationFrame || w.webkitRequestAnimationFrame || w.msRequestAnimationFrame || w.mozRequestAnimationFrame;
var then = Date.now();
main();
};
Next is your basic game loop, update is where you will change variables and there values very frame and render is where you will draw everything based of those varibles. You can also change your game speed by increasing or decreasing FPS. This should always be your last black of code.
var rectX = 200;
var rectY = 200;
var rectSpeed = 128;
ctx.font = "30px Arial";
We're gonna add these global variables next.
var update = function(m) {
i++;
};
var render = function() {
ctx.fillStyle = "#FFFFFF";
ctx.fillRect(0,0,canvas.width,canvas.height);
ctx.fillStyle = "#000000";
ctx.fillText("Number of frames ago you loaded me: " + i,50,50);
ctx.fillRect(300,300,rectX,rectY);
};
The above code is your render and update methods. This is the code that is run every frame. Things should now get draw on your canvas. Don't worry if it looks bad, it should. There should be a number on your screen that counts up every frame.
We new technically have a game, if your familiar with Javascript you can probably make your own after looking at the all the canvas fill methods.
If your still not sure on how to make a real game look at the code for my Tron HTML 5 Game (Not the Java one).
Final Product
HTML:
JavaScript:
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
canvas.width = 800;
canvas.height = 600;
var i = 0;
var rectX = 200;
var rectY = 200;
var rectSpeed = 128;
ctx.font = "30px Arial";
var update = function(m) {
i++;
};
var render = function() {
ctx.fillStyle = "#FFFFFF";
ctx.fillRect(0,0,canvas.width,canvas.height);
ctx.fillStyle = "#000000";
ctx.fillText("Number of frames ago you loaded me: " + i,50,50);
ctx.fillRect(300,300,rectX,rectY);
};
window.onload = function() {
var main = function() {
var now = Date.now();
var delta = now - then;
update(delta / 2000);
render();
then = now;
requestAnimationFrame(main);
};
var w = window;
requestAnimationFrame = w.requestAnimationFrame || w.webkitRequestAnimationFrame || w.msRequestAnimationFrame || w.mozRequestAnimationFrame;
var then = Date.now();
main();
};


Which of the following security investment/trading methods havr you used in the last 12 months? Select all that apply and add approximately what precentage the methods represent of your total invesrments.
Used in the last 12 months
Precentage of your investments
I traded on my own using an (online) brokerage (i.e
Do-It-Yourself Investing)
%
I used an onlone service to automatically invest (i.e a roboadvisor)
%
A bank, advisor or other professional managed my investments for me
%
A famliy member or friend manages my investments for me
%
I did not trade securities and do not intend to trade in the next 12 months
%
I did not trade securities but intend to trade in the next 12 months


If you're not growing you're dying
May 2, 2015
I don't remember exactly when my journey of self-improvement started. I've always been curious about people, goals and why some succeed and others fail.
I got serious about setting goals and moving twoards them around this time last year.
Learning web programming and JavaScript has been on my list of goals forever, but I had only dabbled and played around with it in years past.
But by the end of last year I got serious and it led me to Dev Bootcamp. Quitting my job and entering an intensive course seemed like just the ticket to level up my skills.
I've been telling myself "If you're not growing you're dying" and "You get out what you put in".
These mantras really mean something to me. In my eyes they are the truths of the universe.
Values
DBC asked us to explore our values and think about the times we've been happiest and most satisfied and what key words are associated with those moments.
"Challenge" comes to mind first and foremost. My must satisfied days at work were when I automated some repetitive process. Every time I sat down and chipped away at a problem I was able to make a break through. It's almost like magic.
"Close relationships" are also incredibly important for me. My best memories are laughing with my brother and best friends. When you're having trouble breathing, you know it's funny.
I think it's quite appropriate that the DBC experience will be a mix of these important values. It will be an extreme challenge where I create close relationships with my cochort, and I can't wait!


Tag Picker
click focus blur (on enter), focus (on exit)
click
focus
blur
Append hello Tag Insert hi Tag after the First Tag Reset Values Set Values Get Values
hello
hi


(set: $hp to 10)
(set: $coins to 10)
(set: $days to 0)
(set: $inv to (a:))
(set: $dlevel to 0)
(set: $alevel to 1)
(set: $mstrength to (either: 1,2,3,4))
(set: $monsterHP to (either: 1,2,3,4,5))
(Display: "Main")You've been adventuring for $days days. You have $coins coins and your health is $hp.
[[Take some time out.]]
[[Go on an Adventure.]]
[[Spend your hard-earned cash]](set: $hp to 10) (set: $days to $days + 1)
You have slept, and feel refreshed.
(display:"Main")Pick your wares:
(if: $inv contains "wooden shield") [] (else:)[ [[wooden shield]] FREE ]
(if: $inv contains "wooden sword") [](else:)[ [[wooden sword]] 10 coins ]
[[None of these wares interest you|Main]]A monster appears! (set: $mstrength to $mstrength - $dlevel) (set: $monsterHP to $monsterHP - $alevel)
[[Fight]]
[[Flee!->Main]](if: (either: 0, 1) is 0)[
The monster bites you!
(set: $hp to $hp - $mstrength)
(if: $hp < 1)[ You have [[died]]! ]
(else:)[ Your health is $hp.
[[Fight]]
[[flee|Main]] ]
]
(else:)[ You hit the monster!
(set:$monsterHP = $monsterHP - 1)
(if: $monsterHP < 1)[ The [[monster is dead]]! ]
(else:)[
Its health is $monsterHP.
[[Fight]]
[[Flee|Main]] ]
]You are dead! [[restart?|Startup]](set: $drop to (random: 3,10))
(set: $coins to $coins + $drop)
You collect $drop coins from the monster. You have $coins coins and your health is $hp.
[[continue|Go on an Adventure.]]
[[go home|Main]](set: $inv to $inv + (a: "wooden shield"))
(set: $dlevel to $dlevel +1)
You have acquired a Wooden Shield, this gives +1 defense.
[[Return?|Main]](if: (passage:)'s name is "Inventory") [] (else-if: (passage:)'s tags contains "noinv") []
(else:)
[Check [[Inventory]]].
(if: (passage:)'s name is "Inventory") [] (else-if: (passage:)'s tags contains "nostats") [] (else:)[You have attack strength (print: $alevel), defense (print: $dlevel).]You have (print: $coins) [ coins]
(if: $inv's length > 0)[Your inventory contains a (print: $inv.join(", "))]
(else:)[Your inventory is empty.]
(link-goto: "Return", (history:)'s last)(if: $coins > 9) [
You have bought a wooden sword!
(set: $inv to $inv + (a: "wooden sword"))
(set: $alevel to $alevel+1) [ This gives +1 attack.
(set: $coins to $coins - 10)]
]
(else:) [ You do not have enough money to buy this!]
[[Return?|Main]]


Please note that this is only a sample license; authoritative license terms are included with each software bundle.
© year, Xiph.Org Foundation
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of the Xiph.org Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
This software is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the foundation or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.


{% extends "layout.html" %} {% block title %} {% endblock %} {% block content %}
POST
/format{"string": "this is a list of {}, {}, and {}", "formatter", ["a", "b", "c"]}
using Python 3-style .format() semantics and you'll receive a response like {"result": "this is a list of a, b, and c"}
, or an HTTP 500 on error.


{% extends "base.html" %} {% block title %} ArtFlask {% endblock %} {% block css %}{% endblock %} {% block script %}{% endblock %} {% block page_head %} About {% endblock %} {% block content %}
Look at art. Decide what you think of its form (the structure) and content (the idea).
Art can be puzzling. Having a framework to evaluate art, even a crude one, increases its accessiblity.
Yes. Feel free to use a better one.
All the artwork displayed on this site comes from the Victoria and Albert Musuem in London, UK.
The code is on GitHub.


nmrtools package¶
Submodules¶
nmrtools.nmrmath module¶
Functions for the calculation of NMR spectra.
This version of nmrmath features speed-optimized hamiltonian, simsignals, and transition_matrix functions. Up to at least 8 spins, the new non-sparse Hamilton code is about 10x faster. The overall performance is dramatically better than the original code.
Formulas for simulating two uncoupled spin-1/2 nuclei are derived from: Sandstrom, J. “Dynamic NMR Spectroscopy”. Academic Press, 1982, p. 15.
Formulas for simulating two coupled spin-1/2 nuclei are derived from: Brown, K.C.; Tyson, R. L.; Weil, J. A. _J. Chem. Educ._ 1998, 75, 1632. (NOTE: Hans Reich pointed out that the paper has a sign typo in Equation (2b)! the last term is minus-over-plus, not plus-over-minus.)
-
nmrtools.nmrmath.
AABB
(Vab, Jaa, Jbb, Jab, Jab_prime, Vcentr, normalize_=True, **kwargs)[source]¶ A wrapper for a second-order AA’BB’ calculation, but using the values taken from the WINDNMR-style AA’BB’ bar selected by the Multiplet menu.
-
nmrtools.nmrmath.
AAXX
(Jaa, Jxx, Jax, Jax_prime, Vcentr, normalize_=True, **kwargs)[source]¶ Simulates an AA’XX’ spin system. Frequencies and Js in Hz. Jaa is the JAA’ coupling constant, Jxx the JXX’, Jax the JAX, and JAX2 the JAX’. Vcentr is the frequency for the center of the signal. Wa is width of peak at half-height (not implemented yet) RightHz is the lower frequency limit for the window WdthHz is the width of the window in Hz return: peaklist of (frequency, intensity) tuples
-
nmrtools.nmrmath.
AB
(Jab, Vab, Vcentr, normalize_=True, **kwargs)[source]¶ Reich-style inputs for AB quartet. Jab is the A-B coupling constant (Hz) Vab is the difference in nuclei frequencies in the absence of coupling (Hz) Vcentr is the frequency for the center of the AB quartet Wa is width of peak at half-height (not implemented yet) RightHz is the lower frequency limit for the window WdthHz is the width of the window in Hz return: peaklist of (frequency, intensity) tuples
-
nmrtools.nmrmath.
AB2
(Jab, Vab, Vcentr, normalize_=True, **kwargs)[source]¶ Reich-style inputs for AB2 spin system. J is the A-B coupling constant (Hz) dV is the difference in nuclei frequencies in the absence of coupling (Hz) Vab is the frequency for the center of the AB2 signal Wa is width of peak at half-height (not implemented yet) RightHz is the lower frequency limit for the window (not implemented yet) WdthHz is the width of the window in Hz (not implemented yet) return: peaklist of (frequency, intensity) tuples
-
nmrtools.nmrmath.
ABX
(Jab, Jbx, Jax, Vab, Vcentr, normalize_=True, **kwargs)[source]¶ Reich-style inputs for AB2 spin system. Jab is the A-B coupling constant (Hz) dV is the difference in nuclei frequencies in the absence of coupling (Hz) Vab is the frequency for the center of the AB2 signal Wa is width of peak at half-height (not implemented yet) RightHz is the lower frequency limit for the window (not implemented yet) WdthHz is the width of the window in Hz (not implemented yet) return: peaklist of (frequency, intensity) tuples
-
nmrtools.nmrmath.
ABX3
(Jab, Jax, Jbx, Vab, Vcentr, normalize_=True, **kwargs)[source]¶ Refactoring of Reich’s code for simulating the ABX3 system.
-
class
nmrtools.nmrmath.
TwoSinglets
(va=1, vb=0, k=0.01, wa=0.5, wb=0.5, percent_a=50)[source]¶ Bases:
object
Attempt at using a class instead of separate functions to represent two uncoupled spin-1/2 nuclei undergoing exchange.
-
intensity
(v)[source]¶ Yield a function for the lineshape for TwoSinglets :param v: frequency :return: a frequency-dependent function that returns the intensity of the spectrum at frequency v
-
pi
= 3.141592653589793¶
-
pi_squared
= 9.869604401089358¶
-
-
nmrtools.nmrmath.
add_peaks
(plist)[source]¶ condenses a list of (frequency, intensity) tuples input: a list of (v, i) tuples output: a tuple of (average v, total i)
-
nmrtools.nmrmath.
d2s_func
(va, vb, ka, wa, wb, pa)[source]¶ Create a function that requires only frequency as an argurment, and used to calculate intensities across array of frequencies in the DNMR spectrum for two uncoupled spin-half nuclei.
The idea is to calculate expressions that are independant of frequency only once, and then use them in a new function that depends only on v. This would avoid unneccessarily repeating some of the same operations.
This function-within-a-function should be refactored to function-within-class!
Parameters: - va – The frequency of nucleus ‘a’ at the slow exchange limit. va > vb
- vb – The frequency of nucleus ‘b’ at the slow exchange limit. vb < va
- ka – The rate constant for state a–> state b
- wa – The width at half heigh of the signal for nucleus a (at the slow
exchange limit). :param wb: The width at half heigh of the signal for nucleus b (at the slow exchange limit). :param pa: The fraction of the population in state a. :param pa: fraction of population in state a wa, wb: peak widths at half height (slow exchange), used to calculate T2s
returns: a function that takes v (x coord or numpy linspace) as an argument and returns intensity (y).
-
nmrtools.nmrmath.
dnmr_2spin
(v, va, vb, ka, Wa, Wb, pa)[source]¶ A translation of the equation from Sandström’s Dynamic NMR Spectroscopy, p. 14, for the uncoupled 2-site exchange simulation. v: frequency whose amplitude is to be calculated va, vb: frequencies of a and b singlets (slow exchange limit) (va > vb) ka: rate constant for state A–> state B pa: fraction of population in state Adv: frequency difference (va - vb) between a and b singlets (slow exchange) Wa, Wb: peak widths at half height (slow exchange), used to calculate T2s
-
nmrtools.nmrmath.
dnmr_AB
(v, v1, v2, J, k, W)[source]¶ A translation of the equation from Weil’s JCE paper (NOTE: Reich pointed out that it has a sign typo!). p. 14, for the uncoupled 2-site exchange simulation. v: frequency whose amplitude is to be calculated va, vb: frequencies of a and b nuclei (slow exchange limit, no coupling; va > vb) ka: rate constant for state A–> state B pa: fraction of population in state Adv: frequency difference (va - vb) between a and b singlets (slow exchange) T2a, T2b: T2 (transverse relaxation time) for each nuclei returns: amplitude at frequency v
-
nmrtools.nmrmath.
doublet
(plist, J)[source]¶ plist: a list of (frequency{Hz}, intensity) tuples; J: a coupling constant {Hz} returns: a plist of the result of splitting every peak in plist by J
-
nmrtools.nmrmath.
first_order
(signal, couplings)[source]¶ Uses the above functions to split a signal into a first-order multiplet. Input: -signal: a (frequency, intensity) tuple -Couplings: a list of (J, # of nuclei) tuples. See multiplet docstring for more info. -intensity (optional): the intensity of the signal Output: a plist-style spectrum (list of (frequency, intensity) tuples) Dependencies: doublet, multiplet, reduce_peaks, add_peaks
-
nmrtools.nmrmath.
hamiltonian
(freqlist, couplings)[source]¶ Computes the spin Hamiltonian for spin-1/2 nuclei. inputs for n nuclei:
param freqlist: a list of frequencies in Hz of length n param couplings: an n x n array of coupling constants in Hz Returns: a Hamiltonian array
-
nmrtools.nmrmath.
is_allowed
(m=0, n=0)[source]¶ determines if a transition between two spin states is allowed or forbidden. The transition is allowed if one and only one spin (i.e. bit) changes input: integers whose binary codes for a spin state
param n: param m: output: 1 = allowed, 0 = forbidden
-
nmrtools.nmrmath.
multiplet
(plist, couplings)[source]¶ plist: a list of (frequency{Hz}, intensity) tuples; couplings: one or more (J, # of nuclei) tuples. e.g. to split a signal into a dt, J = 8, 5 Hz, use:
couplings = [(8, 2), (5, 3)]Dependency: doublet function returns: a plist of the multiplet that results from splitting the plist signal(s) by each J. The order of the tuples in couplings does not matter
-
nmrtools.nmrmath.
normalize
(intensities, n=1)[source]¶ Scale a list of intensities so that they sum to the total number of nuclei.
Parameters: - intensities – [float] A list of intensities.
- n – (int) Number of nuclei.
-
nmrtools.nmrmath.
normalize_spectrum
(spectrum, n=1)[source]¶ Normalize the intensities in a spectrum so that total intensity equals value n (nominally the number of nuclei giving rise to the signal).
Parameters: spectrum – [(float, float)…] a list of (frequency, intensity) tuples. :param n: total intensity to normalize to.
-
nmrtools.nmrmath.
nspinspec
(freqs, couplings, normalize=True)[source]¶ Function that calculates a spectrum for n spin-half nuclei. Inputs:
param freqs: a list of n nuclei frequencies in Hz param couplings: an n x n array of couplings in Hz. The order of nuclei in the list corresponds to the column and row order in the matrix, e.g. couplings[0][1] and [1]0] are the J coupling between the nuclei of freqs[0] and freqs [1]. :param normalize: (bool) True if the intensities should be normalized so that total intensity equals the total number of nuclei.
Returns: -spectrum: a list of (frequency, intensity) tuples. Dependencies: hamiltonian, simsignals
-
nmrtools.nmrmath.
popcount
(n=0)[source]¶ Computes the popcount (binary Hamming weight) of integer n input:
param n: an integer - returns:
- popcount of integer (binary Hamming weight)
-
nmrtools.nmrmath.
reduce_peaks
(plist, tolerance=0)[source]¶ Takes an ordered list of (x, y) tuples and adds together tuples whose first values are within a certain tolerance limit. Dependency: add_peaks Input:
plist: a sorted list of (x, y) tuples (sorted by x) tolerance: tuples that differ in x by <= tolerance are combined using add_peaks- Output:
- a list of (x, y) tuples where all x values differ by > tolerance
-
nmrtools.nmrmath.
reich
(v, va, vb, ka, Wa, Wb, pa)[source]¶ A traslation of the actual VB code used in WINDNMR. Was used for error checking. Scheduled for deletion.
-
nmrtools.nmrmath.
simsignals
(H, nspins)[source]¶ Solves the spin Hamiltonian H and returns a list of (frequency, intensity) tuples. Nuclei must be spin-1/2. Inputs:
param H: a Hamiltonian array param nspins: number of nuclei Return spectrum: a list of (frequency, intensity) tuples.
-
nmrtools.nmrmath.
transition_matrix
(n)[source]¶ Creates a matrix of allowed transitions. The integers 0-n, in their binary form, code for a spin state (alpha/beta). The (i,j) cells in the matrix indicate whether a transition from spin state i to spin state j is allowed or forbidden. See the is_allowed function for more information.
- input:
param n: size of the n,n matrix (i.e. number of possible spin states)
Returns: a transition matrix that can be used to compute the intensity of allowed transitions.
nmrtools.nmrplot module¶
Provide functions for creating lineshapes suitable for plotting.
For non-DNMR calculations, inputs are lists of (frequency, intensity) tuples, which then have Lorentzian distributions applied to them.
For DNMR calculations, the lineshapes are directly computed. Currently, non-quantum mechanical formulas for two uncoupled spins and for two coupled spins are used.
-
nmrtools.nmrplot.
add_signals
(linspace, peaklist, w)[source]¶ Given a numpy linspace, a spectrum as a list of (frequency, intensity) tuples, and a linewidth, returns an array of y coordinates for the lineshape.
Parameters: - linspace – a numpy linspace of x coordinates for the lineshape.
- peaklist – a list of (frequency, intensity) tuples
- w – peak width at half maximum intensity
Returns: array of y coordinates for the lineshape
-
nmrtools.nmrplot.
dnmrplot_2spin
(va, vb, ka, Wa, Wb, pa)[source]¶ Create a lineshape for the DNMR spectrum of two uncoupled nuclei undergoing exchange.
Parameters: - va – The frequency of nucleus ‘a’ at the slow exchange limit
- vb – The frequency of nucleus ‘b’ at the slow exchange limit
- ka – The rate of nuclear exchange
- Wa – The width at half heigh of the signal for nucleus a (at the slow
exchange limit). :param Wb: The width at half height of the signal for nucleus b (at the slow exchange limit). :param pa: The fraction of the population in state a (vs. state b)
Returns: a tuple of numpy arrays for frequencies (x coordinate) and corresponding intensities (y coordinate). Hard-coded for 800 data points and a frequency range from vb-50 to va+50.
-
nmrtools.nmrplot.
dnmrplot_AB
(v1, v2, J, k, W)[source]¶ Create a lineshape for the DNMR spectrum of two uncoupled nuclei undergoing exchange.
Parameters: - v1 – The frequency of nucleus ‘a’ at the slow exchange limit
- v2 – The frequency of nucleus ‘b’ at the slow exchange limit
- J – The coupling constant between nuclei a and b
- k – The rate of two-site exchange of nuclei a and b
- W – The line width at the slow exchange limit
Returns: a tuple of numpy arrays for frequencies (x coordinate) and
corresponding intensities (y coordinate). Hard-coded for 800 data points and a frequency range from vb-50 to va+50.
-
nmrtools.nmrplot.
lorentz
(v, v0, I, w)[source]¶ A lorentz function that takes linewidth at half intensity (w) as a parameter. :param v: Array of values at which to evaluate distribution. :param v0: Center of the distribution. :param I: relative intensity of the signal :param w: Peak width at half max intensity
Returns: Distribution evaluated at points in x.
-
nmrtools.nmrplot.
nmrplot
(spectrum, y=1)[source]¶ A no-frills routine that plots spectral simulation data. :param spectrum: A list of (frequency, intensity) tuples :param y: max intensity
-
nmrtools.nmrplot.
tkplot
(spectrum, w=0.5)[source]¶ Generate linspaces of x and y coordinates suitable for plotting on a matplotlib tkinter canvas. :param spectrum: A list of (frequency, intensity) tuples :param w: peak width at half height :param spectrometer_frequency: the frequency of the spectrometer (i.e frequency in MHz that 1H nuclei resonate at) :return: a tuple of x and y numpy.ndarrays
-
nmrtools.nmrplot.
tkplot_nmrmint
(spectrum, w=0.5, spectrometer_frequency=300)[source]¶ Generate linspaces of x and y coordinates suitable for plotting on a matplotlib tkinter canvas.
Hard-coding a -1 to 15 ppm linspace, with resolution such that a 1 GHz spectrometer has 10 points per Hz. :param spectrum: A list of (frequency, intensity) tuples :param w: peak width at half height :param spectrometer_frequency: the frequency of the spectrometer (i.e frequency in MHz that 1H nuclei resonate at) :return: a tuple of x and y numpy.ndarrays