class: center, middle  # Introduction to Machine Learning ### Raphael Cobe ### Advanced Institute for Artificial Intelligence ### June, 2019 --- class: center, middle  # http://advancedinstitute.ai --- class: center, middle, inverse # A little bit more of Machine Learning #### Some of the slides were borrowed from Andrew Ng Coursera Course. --- class: left # Machine Learning ## Some example applications * Database mining + Machine learning has recently become so big party because of the huge amount of data being generated + Sources of data include + Web data (click-stream or click through data) + Mine to understand users better + Medical records + Electronic records -> turn records in knowledges + Biological data + Gene sequences, ML algorithms give a better understanding of human genome + Engineering info + Data from sensors, log reports, photos etc --- class: left # Machine Learning ## Some example applications * Applications that **we cannot program by hand** + Autonomous vehicles + Handwriting recognition + Very inexpensive, and allows algorithms can automatically route envelopes through the post + Natural language processing (NLP) + Computer vision * Self customizing programs + Netflix, Amazon, iTunes + Take users info + Learn based on your behavior * Understand human learning and the brain + If we can build systems that mimic (or try to mimic) how the brain works, this may push our own understanding of the associated neurobiology --- class: left # Machine Learning ## Not a well defined definition * Arthur Samuel (1959) > Field of study that gives computers the ability to learn without being explicitly programmed * Tom Michel (1999) > A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E. * The checkers example: + E = 10000s games + T is playing checkers + P if you win or not ??? * Couple of examples of how people have tried to define it * Samuels wrote a checkers playing program + Had the program play 10000 games against itself + Work out which board positions were good and bad depending on wins/losses --- class: left # Machine Learning ## Kinda how humans evolve by learning The Cassava Leaf in the North of Brazil  ??? * Leaf of the Manioc * Yuca * Cassava roots, peels and leaves should not be consumed raw because they contain; * Used in Brazilians Maniçoba - some kind of stew; * Learning how to cook it: + E = 7h cooking + T is eating Manioc Leafs + P if you live or not --- class: left # Machine Learning ## Several types of learning algorithms * Supervised learning + Teach the computer how to do something, then let it use it;s new found knowledge to do it * Unsupervised learning + Let the computer learn how to do something, and use this to determine structure and patterns in data * Reinforcement learning * Recommender systems --- class: left # Supervised learning - introduction * Probably the most common problem type in machine learning * Starting with an example: * How do we predict housing prices * Collect data regarding housing prices and how they relate to size in feet  Example problem: "Given this data, if I have a house 750 square feet - how much can I expect to get?" --- class: left # Supervised learning - introduction ## What approaches can we use to solve this? * Straight line through data * Maybe $150 000 * Second order polynomial * Maybe $200 000 * One thing we discuss later - how to chose straight or curved line? * Each of these approaches represent a way of doing supervised learning --- class: left # Supervised learning - introduction ## What does this mean? * We gave the algorithm a data set where a "right answer" was provided * So we know actual prices for houses * The idea is we can learn what makes the price a certain value from the training data * The algorithm should then produce more right answers based on new training data where we don't know the price already * i.e. predict the price ## Regression problem * Predict continuous valued output (price) * No real discrete delineation --- class: left # Supervised learning - introduction ## Another Example * Can we definer breast cancer as malignant or benign based on tumour size  Can you estimate prognosis based on tumor size? --- class: left # Supervised learning - introduction ## Another Example continued * This is an example of a **classification problem** * Classify data into one of two discrete classes - no in between, either malignant or not * In classification problems, can have a discrete number of possible values for the output e.g., maybe have four values: * 0 - benign * 1 - type 1 * 2 - type 2 * 3 - type 4 --- class: left # Supervised learning - introduction ## Another Example continued * In other problems may have multiple attributes * We may also, for example, know age and tumor size:  --- class: left # Unsupervised learning - introduction * Second major problem type * In unsupervised learning, we get unlabeled data * Just told - here is a data set, can you structure it * One way of doing this would be to cluster data into to groups * This is a **clustering algorithm** --- class: left # Unsupervised learning - introduction ## Clustering - examples * Google news * Groups news stories into cohesive groups * Genomics * Run algorithm to cluster individuals into types of people * Organize computer clusters * Identify potential weak spots or distribute workload effectively * Social network analysis * Customer data Can you automatically generate structure? Because we don't give it the answer, it's **unsupervised learning** --- class: center, middle, inverse # Linear Regression --- class: left, middle # Get Started ### Regression analysis is used to describe the relationship between: * A single response variable: `\(Y\)` ; and * One or more predictor variables: `\(X_1\)`, `\(X_2\)`,..., `\(X_n\)` + `\(n = 1\)`: Simple Regression + `\(n > 1\)`: Multivariate Regression --- class: left # The cars R dataset: Speed and Stopping Distances of Cars ## Load the dataset into a variable ```r cars.dataset <- cars; ``` -- ## Check the first lines of the dataset: ```r head(cars.dataset); ``` ``` ## speed dist ## 1 4 2 ## 2 4 10 ## 3 7 4 ## 4 7 22 ## 5 8 16 ## 6 9 10 ``` --- # Check the summary of the data ```r summary(cars.dataset); ``` ``` ## speed dist ## Min. : 4.0 Min. : 2.00 ## 1st Qu.:12.0 1st Qu.: 26.00 ## Median :15.0 Median : 36.00 ## Mean :15.4 Mean : 42.98 ## 3rd Qu.:19.0 3rd Qu.: 56.00 ## Max. :25.0 Max. :120.00 ``` --- # Check scatterplot ```r plot(cars.dataset); ```  --- class: left, middle # Linear Regression * Model a continuous variable `\(Y\)` ( `\(y_1, y_2, ..., y_m\)` ) as a function of one or more `\(X^j\)` variable(s); `$$y_i=\theta_0 + \theta_1X_i^1 + \theta_2X_i^2+...+\theta_nX_i^n$$` * Build a model to predict `\(\widehat{y}_i\)` values when the `\(X^j\)` features are known; `$$\widehat{y_i}=\theta_0 + \theta_1X_i^1 + \theta_2X_i^2+...+\theta_nX_i^n + \epsilon_i$$` * Unless an `\(\epsilon\)` error. --- class: middle # Linear Regression ## Matrix Notation `$$\widehat{y_i}=\begin{bmatrix} \theta_0 & \theta_1 &\theta_2 & ... & \theta_n\end{bmatrix} \begin{bmatrix} X_i^0 \\ X_i^1 \\ X_i^2 \\ ... \\ X_i^n\end{bmatrix}+\epsilon_i$$` `$$\widehat{y_i}=\Theta^TX_i + \epsilon_i$$` --- class: middle # Linear Regression ## Matrix Notation `$$\widehat{y_i}=\begin{bmatrix}X_i^0 & X_i^1 & X_i^2 & ... & X_i^n\end{bmatrix} \begin{bmatrix}\theta_0 \\ \theta_1 \\ \theta_2 \\ ... \\ \theta_n\end{bmatrix} +\epsilon_i$$` `$$\widehat{y_i}=[{X_i}]^T\Theta + \epsilon_i$$` --- class: middle # Linear Regression ## Matrix Notation - For all observations: `$$\begin{bmatrix}\widehat{y_1} \\ \widehat{y_2} \\ ... \\ \widehat{y_m}\end{bmatrix} = \begin{bmatrix}X_1^0 & X_1^1 & ... & X_1^n \\ X_2^0 & X_2^1 & ... & X_2^n \\ ...& ... &... & ...\\X_m^0 & X_m^1 & ... & X_m^n \end{bmatrix} \begin{bmatrix}\theta_0 \\ \theta_1 \\ ... \\ \theta_n\end{bmatrix} + \begin{bmatrix}\epsilon_1 \\ \epsilon_1 \\ ... \\ \epsilon_m\end{bmatrix}$$` `$$\widehat{Y}=X\Theta+\epsilon$$` --- class: middle # Simple Linear Regression ### Using a single predictor: $$ \widehat{y_i}=\theta_0 + \theta_1X_i^1+\epsilon_i $$ #### Where: * `\(\theta_0\)` (Intercept): point in which the line intercepts the y-axis; * `\(\theta_1\)` (Slope): increase in Y per unit change in X. --- # Simple Linear Regression ### For the equation: `$$y = 10x+5$$`  --- class:middle # Simple Linear Regression We want to find the equation of the line that *best* fits the data. It means finding `\(\theta_0\)` and `\(\theta_1\)` such that the fitted values of `\(\widehat{y_i}\)`, given by $$ \widehat{y_i} = \theta_0+\theta_1X_i^1+\epsilon_i $$ are as *close as possible* to the observed values `\(y_i\)`, i.e., bring each `\(\epsilon_i\)` to **as close to 0 as possible**. --- class:middle # Simple Linear Regression ## Residuals * The difference between the observed value `\(y_i\)` and the fitted value `\(\widehat{y_i}\)`: $$ e_i = \widehat{y_i} - y_i $$ --- class:middle # Simple Linear Regression ## Residuals * The difference between the observed value `\(y_i\)` and the fitted value `\(\widehat{y_i}\)`  --- class:middle #Simple Linear Regression A usual way of calculating `\(\theta_0\)` and `\(\theta_1\)` is based on the minimization of the **R**esidual **S**um of **S**quares (*RSS*): `$$\begin{eqnarray} RSS &=& \frac{1}{2m}\sum_{i=0}^{m}[\epsilon_i]^2 \\ &=& \frac{1}{2m}\sum_{i=0}^{m}(\widehat{y}_i-y_i)^2\\ &=& \frac{1}{2m}\sum_{i=0}^{m}(\theta_0 + \theta_1X_i^1-y_i)^2 \end{eqnarray}$$` **Also known as our Cost function!** --- # Simple Linear Regression Let's examine the Error `\(\epsilon\)` in terms of the `\(\theta_0\)` and `\(\theta_1\)` params:  --- class: middle # Simple Linear Regression ## The Gradient The gradient of a vector is a generalization of the derivative and is represented by the vector operator `\(\Delta\)`. This operation is used to minimize the our cost function (*RSS*): `$$\begin{eqnarray} \Delta RSS(\Theta)&=&\Delta[\frac{1}{2m}\sum_{i=0}^m(\widehat{y_i}-y_i)^2]\\ &=& \Delta[\frac{1}{2}\sum_{i=0}^{m}(\theta_0 + \theta_1X_i^1 - y_i)^2]\\ &=& [\frac{\partial}{\partial \theta_0}(\frac{1}{2m}\sum_{i=0}^{m}(\theta_0 + \theta_1X_i^1-y_i)^2),\frac{\partial}{\partial \theta_1}(\frac{1}{2m}\sum_{i=0}^{m}(\theta_0 - \theta_1X_i^1-y_i)^2)] \end{eqnarray}$$` --- class: middle # Simple Linear Regression ## The Gradient Continued `$$\begin{eqnarray} \frac{\partial RSS}{\partial \theta_0} &=& \frac{\partial}{\partial \theta_0}(\frac{1}{2m}\sum_{i=0}^{m}(\theta_0 + \theta_1X_i^1-y_i)^2)\\ &=& \frac{1}{m}\sum_{i=0}^{m}(\theta_0X_i^0 + \theta_1X_i^1-y_i)\end{eqnarray}$$` --- class: middle # Simple Linear Regression ## The Gradient Continued `$$\begin{eqnarray} \frac{\partial RSS}{\partial \theta_1} &=& \frac{\partial}{\partial \theta_1}(\frac{1}{2m}\sum_{i=0}^{m}(\theta_0 + \theta_1X_i^1-y_i)^2)\\ &=& \frac{1}{m}\sum_{i=0}^{m}((\theta_0X_i^0 + \theta_1X_i^1-y_i)X_i^1)\end{eqnarray}$$` --- class: middle # Simple Linear Regression ## The Analytical Solution: `$$\begin{eqnarray} \frac{\partial RSS}{\partial \theta_0} &=& 0\\ \theta_0 &=& \frac{\sum_{i=0}^{m}y_i}{m} - \theta_1\frac{\sum_{i=0}^{m}X_i^1}{m}\\ \end{eqnarray}$$` --- class: middle # Simple Linear Regression ## The Analytical Solution `$$\begin{eqnarray} \frac{\partial RSS}{\partial \theta_1} &=& 0\\ 0 &=& \sum_{i=0}^{m}y_iX_i^1 - \sum_{i=0}^{m}\theta_0X_i^1 - \sum_{i=0}^{m}\theta_1(X_i^1)^2 \end{eqnarray}$$` -- Substituting `\(\theta_0\)`... and doing some math: `$$\begin{eqnarray} \theta_1 &=& \frac{\sum_{i=0}^{m}y_iX_i^1-\frac{\sum_{i=0}^{m}y_i\sum_{i=0}^{m}X_i^1}{m}}{\sum_{i=0}^{m}(X_i^1)^2-\frac{(\sum_{i=0}^{m}(X_i^1))^2}{m}} \end{eqnarray}$$` Which is the same as `\(\frac{Cov(X^1,Y)}{Var(X^1)}\)`. --- class: middle # Simple Linear Regression ## The Analytical Solution By transforming the previous equation into its Vectorial form: `$$\Theta = (X^TX)^{-1}X^TY$$` --- class: top # Simple Linear Regression ## Drawbacks of using the Analytical Solution * `\(X^TX\)` is not always invertible; * Complexity of the inverse is of the order `\(O(n^3)\)`: + If the number of features is high, it can become **computationally very expensive**; -- + Consumes a lot of memory: -- Imagine a dataset containing `\(10^5\)` features and `\(10^6\)` observations, in this case `\(X^TX\)` would have `\(10^5\)` floating points, which at 8 bytes per number would give **80 gigabytes**, with the `\(O(n^3)\)` that can get a lot worse; --- class: middle # Simple Linear Regression ## The Gradient Descent Iteratively correct the `\(\Theta\)` weight matrix with: `$$\begin{eqnarray} \theta_0^{(t+1)} &=& \theta_0^{(t)} - \alpha \frac{\partial RSS}{\partial \theta_0}\\ \theta_1^{(t+1)} &=& \theta_1^{(t)} - \alpha \frac{\partial RSS}{\partial \theta_1} \end{eqnarray}$$` Where `\(\alpha\)` is the Learning Rate, i.e. the stepsize torwards the the minimum cost value; --- class: middle # Simple Linear Regression ## The Gradient Descent Algorithm `$$while\ ||\frac{\partial RSS}{\partial \Theta}|| > v \\ \theta_0^{(t+1)} = \theta_0^{(t)} - 2\alpha\sum_{i=0}^{m}(\theta_0X_i^0 + \theta_1X_i^1-y_i)\\ \theta_1^{(t+1)} = \theta_1^{(t)} - 2\alpha(\sum_{i=0}^{m}(\theta_0X_i^0 + \theta_1X_i^1-y_i)X_i^1)$$` Where `\(\left\|\frac{\partial}{\partial \Theta} R S S\left(\Theta^{(t)}\right)\right\|=\sqrt{\frac{\partial}{\partial \theta_0} R S S\left(\theta_{0}^{(t)}\right)^{2}+\frac{\partial}{\partial \theta_1} R S S\left(\theta_{1}^{(t)}\right)^{2}}\)` --- class: middle # Linear Regression ## The general case `$$\begin{eqnarray} \Delta RSS(\Theta) &=& \Delta[\frac{1}{2}(X\Theta-y)^T (X\Theta-y)]\\ &=& X^T(X\Theta-y) \end{eqnarray}$$` Ref.: `\(\frac{d}{d\theta}(x\theta-y)(x\theta-y) = 2x(x\theta-y)\)` --- class: middle # Linear Regression ## The general case Feature by feature update: `$$\frac{\partial RSS(\theta_j)}{\partial \theta_j} = \sum_{i=0}^{m}2(y_i - \theta_0*X_i^0 - \theta_1*X_i^1 -\ ...\ -\ \theta_n*X_i^n) * (-X_i^j)$$` --- class: middle # Assessing the Model quality ## Residual Standard Error - *RSE*: * Derived from the Residual Sum of Squares - RSS; * Associated with each observation is an error term `\(\epsilon\)`: `$$y_i = \theta_0+\theta_1X_i^1+\epsilon_i$$` * Even if we knew the true regression line, we would not be able to perfectly predict `\(Y\)` from `\(X\)`; * The RSE is an estimate of the standard deviation of `\(\epsilon\)`; * **The average amount that the response will deviate from the true regression line** --- class: middle # Assessing the Model quality ## Residual Standard Error - *RSE*: * a measure of the lack of fit of the model to the data; * If the predictions obtained using the model are very close to the true outcome: + RSE will be small, and we can conclude that the model fits the data very well; * If `\(\widehat{y}_i\)` is very far from `\(y_i\)` for one or more observations, then: + The RSE may be quite large, indicating that the model doesn't fit the data well; --- class: middle # Assessing the Model quality ## The `\(R^2\)` * Provides an alternative measure to RSE; * "*Unitless*"; * The proportion of variance explained; * Always takes on a value between 0 and 1; * Independent of the scale of `\(Y\)`; --- class: middle # Assessing the Model quality ## The `\(R^2\)` * Statistic close to 1: + A large proportion of the variability in the response has been explained by the regression. * A value near 0: + Indicates that the regression did not explain much of the variability in the response; * it can still be challenging to determine what is a good `\(R^2\)` value; + depend on the application; --- class: center, middle, inverse # Demo time! --- class: left # The Exercises The barrel calorimeter  --- class: center, middle # Thanks! Slides created via the R package [**xaringan**](https://github.com/yihui/xaringan).


KIRINUKU
Select an image
Type
Circle
Rounded corners
iOS icon
Radius
px
Output area↓
BGDark
BGLight
Download
Clear


{% extends "base.html" %} {% block title %}Delete EVE API Key {{ object.pk }}{% endblock %} {% block content %}
You are about to remove EVE API Key {{ object.pk }} from Auth, once deleted Auth with recheck your permissions and make modifications to your account as required. You may lose access to TEST services if this API key is the only one providing permissions for your account.
{% endblock %}


We are Outline, a creative agency based in Ghent (Belgium).
Ine Gruyaert
creative director
age: 19
speciality:
About:
Wiske Vandendriessche
#
age: 19
speciality: graphic design
about:
Paulien Descamps
#
age: 19
speciality: receiving of international clients
about:


About me
A City and Guilds qualified Piano Tuner/Technician with a diploma in tuning, maintenance and repairs from Newark Technical College.
After gaining valuable experience servicing and tuning new pianos for an extensive clientele at Winchester's own music shop Whitwam’s music as well as in homes across the Hampshire area, I established my own tuning and repair business in 1984.
As well as many domestic, home visit clients, I am pleased to be able to name several public schools, local schools and colleges, churches, theatres, Universities and a Cathedral as long standing clients.
Services Provided
Tuning
Utilizing the 'traditional method' of tuning. This relies on pitching the notes by ear and gauging the playability by touch and feel.
Consultation
Advice is offered on all aspects of piano, including maintenance and care of your piano.
Repairs
Trained for 30+ years in repair and restoration, from fully rebuilding grand pianos to sticking broken keys and squeaky pedals.


--- layout: post title: "Why Windows Vista Content Protection, well, sucks." date: 2008-01-04 18:53:57 +0000 permalink: /2008/01/04/why-windows-vista-content-protection-well-sucks/ category: Misc redirect_from: - /blog/why-windows-vista-content-protection-well-sucks/ ---
Peter Gutmann has done an amazing analysis of the costs and issues involved with the "Content Protection" scheme in Microsoft's Windows Vista (slides). Essentially, if you want to use multimedia, you can only use it how the movie industry says you can. NetFlix has given in to that, producing (along with Microsoft) a tool that effectively strips your fair use rights. It's amazing how we've all become criminals of the information age. I guess it's only the information age for those who are willing to spend the money.


| TOC |
|
Google Wave is a communication and collaboration platform based on hosted conversations, called waves. A wave comprises a set of concurrently editable structured documents and supports real-time sharing between multiple participants. This document is one in a larger set of specifications for Google Wave. This specification describes Google Wave conversation manifest document schema and blip document schema, which together define the Google Wave conversation model. This application model is layered upon the documents, operations and operational transformation defined in the Wave Federation Protocol; see http://www.waveprotocol.org/draft-protocol-specs.
1.
Introduction
1.1.
Document Status
2.
Applicability
3.
Terminology
4.
Editorial Notes
5.
Roadmap
6.
Relationship between specifications
7.
Terminology
8.
Model
8.1.
Document namespace and validation
8.2.
Documents
8.3.
Conversation Manifest Document
8.3.1.
Elements
8.3.2.
Private Replies
8.3.3.
Examples
8.4.
Blip Document
8.4.1.
Schema Design
8.4.2.
Elements
8.4.3.
Annotations
9.
Example Conversations
9.1.
Simple Replies
9.1.1.
In-line Replies
10.
Display
11.
Mechanisms
11.1.
Creating a new blip
11.2.
Creating a reply thread
11.3.
Deleting a blip
12.
References
13.
References
§
Authors' Addresses
| TOC |
A wave can be used to represent a conversation. This specification describes the Google Wave conversation model, which implements the conversation structure within structured documents in a wave.
| TOC |
This document represents work in progress. It omits details that we are unable to capture at this point and we expect parts of the protocol to change. Please also note that while we revise the protocol and white papers, some transient inconsistencies will occur.
This document is one in a larger set of specifications for Google Wave; see http://www.waveprotocol.org/draft-protocol-specs.
| TOC |
The wave documents described in this specification may, in whole or in part, be interchanged between servers via the Google Wave Federation Protocol. The structure within a wave document is reminiscent of XML. A document contains an XML-like tree structure of elements, with attributes, and text. In addition, a document includes stand-off key/value annotations over arbitrary ranges. Documents are subject to constraints expressed in schemas similar to XML schemas.
The use of XML in this specification in no way forces the server implementation to be XML-based. That is, XML is used as a convenient model and implementations are free to implement that model in the manner that is most convenient and performant.
| TOC |
The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119] (Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997.) .
| TOC |
To provide feedback on this draft join the wave-protocol mailing list at http://groups.google.com/group/wave-protocol
| TOC |
Wave is being actively developed and some features of the conversation model have not been documented, or may change in the short term. Currently undocumented are annotations, RTL text, images, and form elements.
Here is a short roadmap of upcoming changes:
| TOC |
The Federation Protocol specifies the form and function of operations that mutate wave documents. While this specification deals only with conversation manifest documents and blip documents, a wavelet may contain documents of other types. Wavelets have metadata that is not stored in document form, including the wave id, wavelet id, and list of named participants for the wavelet. See the Federation Protocol for more details on wavelets and participants.
| TOC |
The following terminology is used by this specification:
| TOC |
A conversation wave is a forest of conversations. Each conversation has a set of participants collaborating on a structured collection of blips. The structure of the conversation is maintained in the conversation manifest document, while the content of the conversational messages is stored in blip documents. Clients participate in the conversation by sending operations which mutate the conversation manifest and blips.
The following assumptions about the wave model and operational transforms should be kept in mind when reading this specification.
| TOC |
Every document in a wavelet has an identifier unique within the wavelet. Ids of documents are structured as a sequence of '+'-separated tokens. The first token of the id is conventionally the document namespace. That wavelet and document namespace determine the type of document (its schema). Different types of documents may have different validity constraints. Operations which violate the schema for a document must be rejected by the server.
The namespaces for the documents described in this specification are:
- b
- Blip document
- conversation
- Conversation Manifest document
An example blip document id:
b+a8w3SD_k
| TOC |
This section describes the two document types that make up the conversation model.As a general principle of data modeling in waves, metadata is embedded in documents where it can be manipulated by operations. The conversation metadata includes the message structure and contributors. Below are examples of a blip document and a conversation manifest document.
Blip document example:
<contributor<EMAIL_ADDRESS><body> <line></line>There is a theory which states that if <line></line>ever anybody discovers exactly what the <line></line>Universe is for and why it <line></line>is here, it will instantly disappear and <line></line>be replaced by something even more bizarre <line></line>and inexplicable. There is another theory <line></line>which states that this has already happened. </body>
Conversation manifest document example:
<conversation sort="m"> <blip id="b+a"> <!-- first message --> <thread id="3Fsd"> <blip id="b+aaa"></blip> <!-- indented reply to "b+a" --> <blip id="b+aab"></blip> <!-- continuation to "b+aaa" --> </thread> <thread id="jjKs"> <blip id="b+aba"></blip> <!-- another reply to "b+a" --> </thread> </blip> <blip id="b+b"> <!-- continuation after "b+a" --> <peer id="chess+4342"></peer> <!-- consistency peer id --> <thread inline="true" id="J362"> <blip id="b+baa"></blip> <!-- inline reply to "b+b" --> <blip id="b+bab"></blip> <!-- continuation to "b+aaa" --> </thread> <thread inline="true" ... > <!-- another inline reply group, possibly at the same location --> ... </thread> <thread id="9dKx"> <!-- non-inline reply to "b+b" --> ... </thread> </blip> </conversation>
| TOC |
A conversation manifest document has the distinguished document id 'conversation', and is the only document in the 'conversation' namespace. There is one conversation manifest document per conversation.
The conversation manifest defines the logical structure of the conversation by describing the relationships between the blips. See the Display section for how the logical structure of conversations is reflected in the user-interface of a wave client.
Blip elements are wrapped in a grouping element 'thread', except for top-level blips which belong to an implicit root thread. A blip may have multiple child 'thread' elements representing replies. Each 'thread' element has an id, unique within the conversation. Thread ids have no semantic meaning.
Here is a very simple conversation manifest that references only a single blip.
<conversation> <blip id="b+a"> <!-- first and only message --> </blip> </conversation>
Here is a more complex conversation manifest that references multiple blips.
<conversation> <blip id="b+a"> <!-- first message --> <thread id="x123"> <blip id="b+aaa"></blip> <!-- indented reply to "b+a" --> </thread> <thread inline="true" id="x983"> <blip id="b+aba"></blip> <!-- another reply to "b+a" --> <blip id="b+abb"></blip> <!-- another reply to "b+a" --> </thread> </blip> </conversation>
| TOC |
These are the allowed elements in a conversation manifest.
| TOC |
The top-level element in a conversation manifest document. It may have anchor attributes ("anchorWavelet", "anchorManifestOffset", "anchorVersion", "anchorBlip", "anchorOffset"), which determine where this conversation is displayed. See the section below on private replies. It also has a "sort" attribute. The value of the sort attribute is used to determine the order of peer conversation elements by sorting on sort values lexicographically. A conversation element has zero or more 'blip' elements as children.
- anchorWavelet
- The id of the wavelet that this conversation is a reply to.
- anchorManifestOffset
- An integer offset into the document sequence for the parent's conversation manifest.
- anchorVersion
- The version of the parent wavelet when the private reply was created.
- anchorBlip
- The id of the blip document in the parent wavelet that anchors the reply.
- anchorOffset
- An integer offset into the replied-to blip document that anchors the private reply.
| TOC |
Represents a message. Every blip element has an 'id' attribute that references a blip document in the conversation. It may also have a 'deleted' attribute whose boolean value determines if that blip has been logically deleted. See the section below on deleting blips. A blip may have zero or more 'thread' and 'peer' elements as children.
| TOC |
Represents a sequence of messages. All sibling blips in a thread element are considered a reply to the parent blip element. A thread element has an "id" and optional boolean "inline" attribute. The "inline" attribute determines whether the thread is anchored inline in the parent blip. The default value for "inline" if false, that is, the inline attribute not being present is the same thing as inline=false. A thread may have zero or more 'blip' elements as children.
| TOC |
A peer element has an "id" attribute. The "id" attribute value is the id of a data document. The identified data document is not a blip or conversation manifest document.
| TOC |
Private replies are represented as distinct wavelets with their own conversation manifest containing a reference to the parent conversation wavelet. Sub-conversations reference the parent conversation's manifest document with a (wavelet-id, blip-id, location, version) tuple referred to as an anchor. This tuple refers to a parent blip by naming the replied-to wavelet and blip. The location and version attributes refer to the corresponding blip element in the replied-to conversation's manifest document at some previous version. This ensures the information is still present if the parent blip is deleted.
An inline private reply also references an anchor point in the replied-to blip at a selected version. A forthcoming mechanism will allow clients to request a server to transform a location to the current version for rendering.
This representation prevents leakage of the existence of the private reply to participants who cannot access it. Note that this structure still leaks the existence of the parent conversation to the private reply.
The anchoring tuple is represented as a set of optional attributes on the conversation tag of the conversation manifest document.
| TOC |
A root wavelet has no anchoring information.
<conversation></conversation>
A non-inline private reply wavelet, referencing a blip in the conversation manifest document. The sort attribute determines sibling wavelet sort order by lexicographic value order.
<conversation sort="p" anchorWavelet="conv+root" anchorBlip="b+123" anchorManifestOffset="45" anchorVersion="7436" > </conversation>
An inline private reply, also has an anchor offset referring to the replied-to blip.
<conversation sort="p" anchorWavelet="conv+root" anchorBlip="b+123" anchorManifestOffset="45" anchorVersion="7436" anchorOffset="784"> </conversation>
| TOC |
A blip document is distinguished by having a document id that begins with the namespace 'b'.
A simple blip document.
<contributor<EMAIL_ADDRESS><contributor<EMAIL_ADDRESS><body> <line></line>The quick brown fox... </body>
A more complex blip document.
<contributor<EMAIL_ADDRESS><contributor<EMAIL_ADDRESS><contributor<EMAIL_ADDRESS><body> <line></line>The quick brown fox <line></line>Jumped over <line></line>the lazy dog. <image attachment="a+sadkfd"> <caption>A lazy dog.</caption> </image> </body>
| TOC |
The documents representing messages (blips) conform to a very simple schema.
The blip document schema expresses a structured representation of the message with little presentation logic, and is mostly not web-specific. For example, most rich-text styling is represented in annotations. This representation behaves in a much more natural way when two clients concurrently edit overlapping regions of text. The document representation may not correspond to the most natural semantic interpretation, but is designed to behave most naturally under operational transformation.
| TOC |
The allowed elements of a blip are:
| TOC |
Each contributor element has a single required attribute 'name' with the id of a participant who has contributed to the blip content. If there are duplicates (which may occur with concurrent editing) then the first is the canonical contributor and the others should be ignored or removed. Individual contributors are responsible for adding themselves to this list. This allows for "trivial" contributors such as annotators to voluntarily omit themselves. Absolute contributor information may be recovered from the operation history if required.
| TOC |
The displayed content of the blip. The body element may contain text and 'line' elements. The first child of the body element must be a line element. If a document contains two body elements then the first is the canonical body and others should be ignored or removed.
| TOC |
The displayed textual content of a blip is broken up into lines. Each line is preceded with a "line" element. The line element must be an empty element, that is, having no other items between the begin element and the end element. The line element may have the following attributes:
- t
- The type of the line. Allowed values are 'h1', 'h2', 'h3', 'h4', 'h5', and 'li', where h[1-5] is a heading and 'li' an item in a list.
- i
- The indentation level (0,1,2,...). This attribute is only meaningful when applied to lines of type t="li".
- a
- The alignment of the text in the line. (a, m, r, j) a = align left = centered = alighted right = justified
- d
- The display direction of the line l = left to right, r = right to left
| TOC |
The image element represents an attached image embedded in the blip. The image element has an 'attachment' attribute that is the id of that attachment's data document. Attachments and attachment documents are described in the Google Wave Attachments whitepaper.
| TOC |
The reply element denotes the location of an inline reply thread. It has an attribute 'id' that contains the id of the thread whose location it marks. Thus an inline reply's inline location is marked with a reply element.
| TOC |
The following are the allowed annotations allowed in blip documents.
| TOC |
Style annotations control the display of the content in the blip. All style annotations have keys that begin with "style/". The allowed values for the style annotations are the same as those of the CSS properties of the same name.
| TOC |
The following annotations refer to a user id and a session id. Each client gets its session id from the server. Session ids, their assignment, and how they are transmitted to a client are out of scope for this document. It should be noted that to avoid name clashes when federating waves the session id should include the domain of the server generating them. Style annotations control the display of the content in the blip.
User annotations contain information that is specific to each user session. All user annotation keys begin with 'user/'.
- user/d/<session id>
- This annotation covers the entire document. The value of the annotation is a comma separated list of (userid, timestamp [,ime composition state]) The timestamp is the last time the cursor was updated. The timestamp may be used by clients to stop dislpaying the users carat after a period of inactivity.
- user/r/<session id>
- This annotation represents the users selection. That is, the range of text with this annotation is text that the user has selected. If the user does not have any text selected then this annotation is not present. Note that the currently implementation only supports a single selection region per user. The value of this annotation is the user id.
- user/e/<session id>
- This annotation represents the user's selection focus (the "blinky bit"). The first point in the range of the annotation is the cursor location for the users session. That is, the cursor is placed before the first item in the annotation range. This annotation always extends from the cursor position to the end of the document. If this annotation is missing then the cursor is placed after the last item in the document. The value of this annotation is the user id.
| TOC |
Link annotations define links to other resources. All link annotations have keys that begin with "link/".
- link/manual
- A manually created link. A URI or IRI? is the only valid value for this annotation.
- link/auto
- A link created automatically by some linkifying process. Such annotations have a lower precedence than manual links. A URI is the only valid value for this annotation.
- link/wave
- A link to another wave. Wave ids are the only valid values for this annotation.
| TOC |
| TOC |
This is an example conversation showing how a conversation is represented by this model. This conversation consists of two blips and a conversation manifest document in one wavelet.
The conversation manifest has an id of "conversation" and is:
<conversation> <blip id="b+a"> <thread id="r1"> <blip id="b+b"></blip> <blip id="b+c"></blip> </thread> </blip> </conversation>
There is a blip with an id of "b+a":
<contributor<EMAIL_ADDRESS><body> <line></line>There is a theory which states <line></line>that if ever anybody <line></line>discovers exactly what the <line></line>Universe is for and why it <line></line>is here, it will instantly <line></line>disappear and be replaced by <line></line>something even more bizarre <line></line>and inexplicable. There is another <line></line>theory which states that this <line></line>has already happened. </body>
A reply blip with an id of "b+b":
<contributor<EMAIL_ADDRESS><body> <line></line>Isn't that a quote from Douglas Adams? </body>
And a reply blip with an id of "b+c":
<contributor<EMAIL_ADDRESS><body> <line></line>Yes it is. </body>
| TOC |
The above shows the conversation with non-inline replies. Here is the same conversation, but the replies are in-line. This conversation will display differently from the above conversation.
The conversation manifest has an id of "conversation" and is:
<conversation> <blip id="b+a"> <thread inline="true" id="r1"> <blip id="b+b"></blip> <blip id="b+c"></blip> </thread> </blip> </conversation>
There is a blip with an id of "b+a":
<contributor<EMAIL_ADDRESS><body> <line></line>There is a theory which states <line></line>that if ever<reply id='aF8j_s'></reply> anybody <line></line>discovers exactly what the <line></line>Universe is for and why it <line></line>is here, it will instantly <line></line>disappear and be replaced by <line></line>something even more bizarre <line></line>and inexplicable. There is another <line></line>theory which states that this <line></line>has already happened. </body>
Note the addition of the reply element which anchors the in-line reply.
A reply blip with an id of "b+b":
<contributor<EMAIL_ADDRESS><body> <line></line>Isn't that a quote from Douglas Adams? </body>
And a reply blip with an id of "b+c":
<contributor<EMAIL_ADDRESS><body> <line></line>Yes it is. </body>
| TOC |
The above shows the conversation with inline replies. Here is the same conversation, but the replies are private in-line. This conversation will display differently from the above two conversations.
The conversation manifest has an id of "conversation" and is an contained in the wavelet with an id of 'wave+a'.
<conversation> <blip id="b+a"></blip> </conversation>
There is a blip with an id of "b+a":
<contributor<EMAIL_ADDRESS><body> <line></line>There is a theory which states <line></line>that if ever anybody <line></line>discovers exactly what the <line></line>Universe is for and why it <line></line>is here, it will instantly <line></line>disappear and be replaced by <line></line>something even more bizarre <line></line>and inexplicable. There is another <line></line>theory which states that this <line></line>has already happened. </body>
The replies are contained in another wavelet with an id of 'wave+b'.
Being a wavelet it has its own conversation manifest:
<conversation sort="r" anchorWavelet="wave+a" anchorBlip="b+a" anchorManifestOffset="1" anchorVersion="12" anchorOffset="10"> <blip id="b+b"></blip> <blip id="b+c"></blip> </conversation>
The reply blips are in the 'wave+b' wavelet. There is the reply blip with an id of "b+b":
<contributor<EMAIL_ADDRESS><body> <line></line>Isn't that a quote from Douglas Adams? </body>
And a reply blip with an id of "b+c":
<contributor<EMAIL_ADDRESS><body> <line></line>Yes it is. </body>
| TOC |
The structure and relationships between wavelets, conversation manifests and blips defines a logical structure for conversations. What follows is a description of how the content and structure defined is presented in a user-interface, fully realizing that implementing wave on different clients will impose different constraints. The below isn't meant to constrain client implementations, but to give guidance on providing a consistent user experience.
A conversation should be displayed as a single unit and may reference more than one wavelet. A wavelet is considered to be in a conversation view if it has a wavelet id in the "conv" namespace and the user has permission to access the wavelet. Wavelets other than the root in a conversation view should reference another via an anchorWavelet attribute.
Blips are displayed in the order that they appear in the conversation manifest, going from top to bottom. Blip documents in a wavelet that are not referenced in the conversation manifest should not be displayed. Threads are indented from the content of their parent blip unless they have a property value of inline=true. The location of private replies is determined by the "anchorWavelet", "anchorManifestOffset", "anchorVersion", "anchorBlip", and "anchorOffset" properties of the conversation element. Note that the anchor position is given for version at which the private reply was created, and is recorded in the "anchorVersion" attribute. The proper display location for the private reply will depend upon keeping track of how that historical position moves as documents are mutated.
The location of non-private inline replies is denoted with a reply element in the thread and should be displayed indented at that location.
The display of private inline replies should include an indication that it is private, such as displaying the participants for that wavelet, along with the content of the sub-conversation.
| TOC |
This section describes some mechanisms for changing the conversation structure. Additional mechanisms remain to be defined. In addition, the interactions of concurrent modifications have yet to be detailed.
| TOC |
To add a new blip to a thread an operation is sent to insert a blip element (with a unique id) to the thread in the conversation manifest. The added blip document may or may not be empty
| TOC |
To add a new thread an operation is sent to insert a thread element (with a unique id) to the replied-to blip element in the conversation manifest. If the thread is an inline reply an anchor element must first be inserted in the replied to blip.
| TOC |
Deleting a blip involves deleting the blip, any inline replies to the blip, and (optionally) any non-inline replies to the blip. This mechanism deletes only inline replies.
A blip is deleted by sending mutations that:
After a blip is deleted, non-inline replies to that blip are still nested within their parent in the conversation manifest. They may be rendered as children of a deleted blip. Future restructure operations may allow the children to be re-parented. If a deleted blip has no remaining replies then the blip entry should be deleted from the conversation manifest document. If the deleted blip was the last in a thread then the thread entry should be removed from the manifest document.
Edits that occur concurrently with a blip deletion are nullified in transform. Concurrently created replies to a deleted blip are deleted if the blip has no replies, but survive if the blip element remains (with "deleted" set to "true").
| TOC |
| TOC |
| [RFC2119] | Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” BCP 14, RFC 2119, March 1997 (TXT, HTML, XML). |
| TOC |
| Joe Gregorio | |
| Google, Inc | |
| Email: |<EMAIL_ADDRESS>|
| Alex North | |
| Google, Inc | |
| Email: |<EMAIL_ADDRESS>|


A lightweight script to smooth scrolling.
Scroll/Swipe down/up to move between "canvas".
Smooth Scroll on GitHub


Software Engineer Intern at Apple
Summer 2022
- Worked on program analysis and automated test generation with the Apps Test Engineering team
- Created proof-of-concept coverage-guided fuzzing tools in Swift to automatically find product defects
- Designed and implemented property-based testing framework to extend existing tests, improve test resiliency, and increase test coverage
- Contributed to internal testing framework by capturing, parsing, and postprocessing analytics events, enabling migration away from aging test framework
- Collaborated with senior engineers to modify and recompile iOS apps with injected bugs to reproduce test failures
- Presented to internal and cross-functional partners in order to increase adoption of property-based testing
Infrastructure Security Intern at Salesforce
Summer 2021
- Continued work with REDSCAR team.
- Researched and improved Salesforce’s static analysis tooling with regard to XXE and deserialization attacks.
- Presented work Reducing our Risk Debt at Scale with Application Guard Rails via Static Analysis to SVP, Security Assurance
- Wrote and tested 13 Semgrep rules for Java, Python, and Ruby for a tool run on all code reviews across Salesforce.
- Caught 30 new, high-priority bugs in production code.
Summer 2020
- Worked as part of Reference Design, Security Controls, and Architecture (REDSCAR) team focused on assisting other teams through development and maintenance of tools, documentation, and reference frameworks.
- Categorized security bugs filed by Infrastructure Security Advisory team.
- Collaborated with Secrets team to uncover best areas for and create automated support for secret rotation.
- Integrated Vault and GUS APIs with Python script for AWS Lambda and Go program in Docker container.
- Performed design review for security assessment.
Research at Carnegie Mellon University
Spring 2021, Fall 2021
- Worked with Dr. Rohan Padhye on creating mutation analysis-based guidance plugin for fuzzer JQF.
- Programmed mutation analysis functionality using Java bytecode instrumentation based on PIT.
- Presentation at CMU's Meeting of the Minds.
- Presentation and winner, second place at ICSE '22
- Currently working toward testing mutation-guided fuzzing on large benchmarks.
Student Volunteer for SIGGRAPH
Summer 2021
- Performed quality assurance tests for AR/VR pieces submitted to the SIGGRAPH VR Theater.
- Reviewed and edited closed captioning for conference presentations.
Teaching Assistant at Carnegie Mellon University
Spring 2022
- TA for 17-355/17-665/17-819 Program Analysis.
- Designed recitation about working with JVM bytecode to instrument Java code for program analysis and repair.
- Taught weekly recitations, held office hours, and graded student work.
- Helped graduate and undergraduate students understand and apply concepts from class, including dataflow analysis, Hoare logic, and fuzz testing.
Fall 2020, Fall 2021
- TA for 15-151/21-128 Mathematical Concepts and Proofs.
- Taught weekly recitations, held office hours, and graded student work.
- Helped undergraduate students understand and apply concepts from class, including proofs, functions, and combinatorics.
Volunteer at SEARHC
Summer 2020
- Put together more than 1000 COVID-19 testing kits
- Sewed masks for donation
Software Engineering Intern at Cyber Crucible
Spring 2020
- Created Android app with voice recognition software for security authentication.
- Intetgrated AWS and REST APIs with Android app.
Data Analysis Intern at EvaluLogic
Summer 2019
- Analyzed and designed over 100 Excel graphs sorting and depicting information from 2 surveys of high school students regarding usage of and attitudes toward controlled substances (alcohol, tobacco, marijuana, prescription drugs).
- Formal presentation of the data to client Sitka Counseling at monthly meeting.
Volunteer Project Administrator at Raven Radio
2017-2019
- Wrote population and use protocols for Scavenger (online database for cataloging music library) and Music Collector
- Populated over 2000 entries to Scavenger and trained volunteers
Freelance Video Editor at Sitka Fine Arts Camp
2018-2019
- Edited and finalized production videos (Seussical, Oliver, One Acts 2018, and Peter Pan) for distribution and display on the Fine Arts Camp website using Adobe Premiere Pro
Volunteer Course Instructor at Sitka Public Library
Summer 2016, 2017, 2018
- Designed and taught week-long workshops in Scratch, MIT App Inventor, Web Development, and Video Editing
Honors and Awards
- ICSE '22 SRC Winner, placed second
- Carnegie Mellon University Dean's List (Fall 2019, Spring 2021, Fall 2021, Fall 2022)
- MTAC AMV Competition Finalist (2021)
- Control Award (Alaska State FIRST Tech Challenge 2019)
- Technovation Semifinalist (2018)
- National AP Scholar
- National Merit Finalist
- U.S. Presidential Scholar Semifinalist
- Excellence in English Division Award (Stanford Online High School 2019)
- Tora-Con AMV Competition Semifinalist (2018)
Publications
Laybourn, Isabella. "μ2: Using Mutation Analysis to Guide Mutation-Based Fuzzing". 2022 IEEE/ACM 44th International Conference on Software Engineering: Companion Proceedings (ICSE-Companion), 2022, pp. 331-333, doi: 10.1145/3510454.3522682.
Laybourn, Isabella. Transcending Patriarchy: The Construct of Eve and the Feminine in "Paradise Lost" , De Novo 2018


Animated Bar Graphs
Marketing and Public Relations
Consulting
Finance
Human Resources
Other
Accounting and Tax


--- layout: post tags: [AutoFixture, Unit Testing] date: 2012-07-31 16:31:11 UTC title: "The order of AutoFixture Customizations matter" description: "This post answers a FAQ about ordering of AutoFixture Customizations" --- {% include JB/setup %}
{{ page.description }}
With AutoFixture you can encapsulate common Customizations using the Customize method and the ICustomization interface. However, customizations may 'compete' for the same requests in the sense that more than one customization is able to handle a request.
As an example, consider a request for something as basic as IEnumerable<T>. By default, AutoFixture can't create instances of IEnumerable<T>, but more than one customization can.
As previously described the MultipleCustomization handles requests for sequences just fine:
var fixture = new Fixture().Customize(new MultipleCustomization()); var seq = fixture.CreateAnonymous<IEnumerable<int>>();
However, the AutoMoqCustomization can also (sort of) create sequences:
var fixture = new Fixture().Customize(new AutoMoqCustomization()); var seq = fixture.CreateAnonymous<IEnumerable<int>>();
However, in this case, the implementation of IEnumerable<int> is a dynamic proxy, so it's not much of a sequence after all.
Here I need to make a little digression on why that is, because this seems to confuse a lot of people. Consider what a dynamic mock object is: it's a dynamic proxy which implements an interface (or abstract base class). It doesn't have a lot of implemented behavior. Dynamic mocks do what we tell them through their configuration APIs (such as the Setup methods for Moq). If we don't tell them what to do, they must fall back on some sort of default implementation. When the AutoMoqCustomization is used, it sets Mock<T>.DefaultValue to DefaultValue.Mock, which means that the default behavior is to return a new dynamic proxy for reference types.
Here's how an unconfigured dymamic proxy of IEnumerable<T> will behave: the interface only has two (very similar) methods:
public interface IEnumerable<out T> : IEnumerable { IEnumerator<T> GetEnumerator(); }
Via IEnumerable the interface also defines the non-generic GetEnumerator method, but it's so similar to the generic GetEnumerator method that the following discussion applies for both.
When you iterate over IEnumerable<T> using foreach, or when you use LINQ, the first thing that happens is that the GetEnumerator method is called. An unconfigured dynamic mock will respond by returning another dynamic proxy implementing IEnumerator<T>. This interface directly and indirectly defines these methods:
T Current { get; } object IEnumerator.Current { get; } bool MoveNext(); void Reset(); void Dispose();
Iterating over a sequence will typically start by invoking the MoveNext method. Since the dynamic proxy is unconfigured, it has to fall back to default behavior. For booleans the default value is false, so the return value of a call to MoveNext would be false. This means that there are no more elements in the sequence. Iteration stops even before it begins. In effect, such an implementation would look like an empty sequence.
OK, back to AutoFixture.
Frequently I receive questions like this:
"Creating lists with AutoFixture seems inconsistent. When MultipleCustomization comes before AutoMoqCustomization, lists are popuplated, but the other way around they are empty. Is this a bug?"
No, this is by design. By now, you can probably figure out why.
Still, lets look at the symptoms. Both of these tests pass:
[Fact] public void OnlyMultipleResolvingSequence() { var fixture = new Fixture().Customize(new MultipleCustomization()); var seq = fixture.CreateAnonymous<IEnumerable<int>>(); Assert.NotEmpty(seq); } [Fact] public void OnlyAutoMoqResolvingSequence() { var fixture = new Fixture().Customize(new AutoMoqCustomization()); var seq = fixture.CreateAnonymous<IEnumerable<int>>(); Assert.Empty(seq); }
Notice that in the first test, the sequence is not empty, whereas in the second test, the sequence is empty. This is because the MultipleCustomization produces a 'proper' sequence, while the AutoMoqCustomization produces a dynamic proxy of IEnumerable<int> as described above. At this point, this should hardly be surprising.
The same obvervations can be made when both Customizations are in use:
[Fact] public void WrongOrderResolvingSequence() { var fixture = new Fixture().Customize( new CompositeCustomization( new AutoMoqCustomization(), new MultipleCustomization())); var seq = fixture.CreateAnonymous<IEnumerable<int>>(); Assert.Empty(seq); } [Fact] public void CorrectOrderResolvingSequnce() { var fixture = new Fixture().Customize( new CompositeCustomization( new MultipleCustomization(), new AutoMoqCustomization())); var seq = fixture.CreateAnonymous<IEnumerable<int>>(); Assert.NotEmpty(seq); }
Both of these tests also pass. In the first test the sequence is empty, and in the second it contains elements. This is because the first Customization 'wins'.
In general, a Customization may potentially be able to handle a lot of requests. For instance, the AutoMoqCustomization can handle all requests for interfaces and abstract base classes. Thus, multiple Customizations may be able to handle a request, so AutoFixture needs a conflict resolution strategy. That strategy is simply that the first Customization which can handle a request gets to do that, and the other Customizations are never invoked. You can use this feature to put specific Customizations in front of more catch-all Customizations. That's essentially what happens when you put MultipleCustomization in front of AutoMoqCustomization.


No Product in The Cart
$30.00
Wedding Decor
Hoom Decor
Bouquets, Peony, Wedding
Best Sellers, Birthday, Roses, Wedding
Best Sellers, Orchids, Wedding


🕸💍
Discover websites made by Hack Clubbers!
Back in the 90's, webrings once brought the internet together, creating a community for fellow site enthusiasts. We're bringing the concept back over 20 years later to create a community that's more robust and interconnected, refreshing the idea while maintaining the same creative spirit that existed then.
The following webring connects Hack Club members and their personal websites by using a common navigation bar on each members's site. Check them out below or join by submitting a pull request!
Insert the following HTML into your website:

‹

›

Next, add your name (or nickname!) and URL where you placed the above code snippet at the file public/members.json
. Open a pull request (tutorial here!) and we'll review it within the next 48 hours. Cheers!
| Member | Website |
|---|


HOME
[[${subject.name}]]
ALL
[[${subjects.successPercent}]]%
[[${subjects.buildingPercent}]]%
[[${subjects.warningPercent}]]%
[[${subjects.failurePercent}]]%
[[${subjects.waitingPercent}]]%
×
Are you sure you want to remove
from this subject?
Add Job


| Dual-Fisheye | Take multiple or single dual-fisheye images | Discuss | Ichi Hirota |
| HDR2EXR | Create HDR images inside the camera with OpenCV | Discuss | Kasper |
| Long Video | Bypass 25 minute limit on videos. Compress with HEVC | Discuss | .guide |
| TensorFlow Demos | Object detection and classification, speech recognition, artistic style filter | Discuss | Shohara |
| Face Blur | Automatically identify and blur faces inside the camera | Discuss | Ricoh |
| Wireless Live Streaming | Stream live video to YouTube and Facebook with RTMP | Discuss | Ricoh |
| THETA Motion Sensors Demo | Access accelerometer, magnetic field, gyroscope | Discuss | KAZ |
| Meow Shot! | Play cat sounds from internal camera speaker. Record your own sounds with camera microphones. | Discuss | Shiro |
| GPS with USB OTG | Attach GPS module to THETA with USB port. Receive serial data. Attach to images. | Discuss | KA-2 |
| Connect to Arduino with USB | Connect to ESP32 M5Stack Arduino. Show camera info on LCD. Control camera with Arduino buttons | Discuss | KA-2 |
| WebGUI Sample | Uses NanoHTTPD to create web GUI. Control LEDs. Save settings to SharedPreferences | Discuss | @3215 |


Privacy Policy
Last Modified: May 2018
Our services are not intended for anyone under 18. We have checks to ensure that we we do not knowingly collect personal information from anyone under 18.
Introduction
Only Fans is a social network which enables some users to share their content; other users to enjoy others’ content and for some to do both.
Only Fans is the trading name of Fenix International Limited (company number 10354575).
When people use these services they share some information with us. This policy sets out the information we collect, how we use it and who we share it with.
We confirm that the lawful basis for processing your data is that by participating with our social network you have contracted with us and the processing of data set out here is part of that contract. To the extent that we have to monitor and control use of our site the basis for that processing is to fulfil a legal obligation
If you have any questions about anything in our Privacy Policy or wish to complain then please contact<EMAIL_ADDRESS>We hope that we can resolve any query or concern you raise about our use of your information. If not, contact the Information Commissioner at https://ico.org.uk/concerns/ or telephone: 0303 123 1113 for further information about your rights and how to make a formal complaint.
Below we set out our policy but please be aware that:
1. all content is monitored by third parties to ensure that the network is lawful and legal and not brought into disrepute;
2. you will not provide or give financial information to us but to our chosen partners. These entities may or may not be located in the European Economic Area;
3. we will not transfer your person data outside the European Economic Area;
4. we will not profile or make automated decisions which affect you.
Users are either “Creators” or “Fans”. A Creator posts content for Fans to access. Creators determine the monthly subscription fee which Fans pay to view the content. A Fan decides what content to view.
In this policy User or you refers to any Creator or Fan.
Information we collect
Regardless of whether you are a Creator or Fan or both there are three categories of information we collect:
- Information you choose to give us.
- Information we get when you use our services.
- Information we get from third parties.
Information you choose to give us
In order to open an account and use our services you will disclose to us:
1. Your name;
2. postal address;
3. an email address;
4. a username;
5. your date of birth;
6. a copy of your passport.
7. your banking credentials
To make it easier for others to find you, we may also ask you to provide us with some additional information that will be publicly visible on our services, such as profile pictures, a profile name or other useful identifying information.
Be careful when you provide us information about you and others you know (this is likely to be personal data) which will be uploaded onto your pages of our network. Other users maybe able to use that content for their own purposes.
If you have any reason to contact us separately for example to discuss concerns with customer services then we’ll collect whatever information you volunteer.
Information we get when you use our services
When you use our services, we collect information about the content you have viewed or shared. For example:
- Usage information. We collect information about the content that Viewers have accessed. From that we may highlight to that user similar content;
- Content information. We collect content you create on our services, such as custom stickers, photos, videos, text and information about the content you create or provide, such as if the recipient has viewed the content and the metadata that is provided with the content.
- Device information. We collect IP addresses or other identification data from and about the devices you use. For example, we collect:
information about your hardware and software, such as the hardware model, operating system version, device memory, advertising identifiers, unique application identifiers, apps installed, unique device identifiers, browser type, language, battery level and time zone; - Location information. When you use our services, we may collect information about your location. With your consent, we may also collect information about your precise location using methods that include GPS, wireless networks, cell towers, Wi-Fi access points and other sensors such as gyroscopes, accelerometers and compasses.
- Information collected by cookies and other technologies. Like most online services we use cookies. The cookies we use are the usual Google analytics and session cookies
(For your information: most web browsers are set to accept cookies by default. If you prefer, you can usually remove or reject browser cookies through the settings on your browser or device. Keep in mind, though, that removing or rejecting cookies could affect the availability and functionality of our services.) - Log information. We also collect log information when you use our website. That information includes, among other things:
- details about how you’ve used our services.
- device information, such as your web browser type and language.
- access times.
- pages viewed.
- IP address.
- identifiers associated with cookies or other technologies that may uniquely identify your device or browser
How we use information
We use this information to ensure that the content can be enjoyed by everyone. Our objective is to strive to keep the content appropriate, tasteful and lawful. Here are some of the ways we do that:
- develop, operate, improve, deliver, maintain and protect our products and services.
- send you communications, including by email. For example, we may use email to respond to support enquiries or to share information about our site.
- monitor and analyse trends and usage.
- verify your identity and prevent fraud or other unauthorised or illegal activity.
- use information we’ve collected from cookies and other technology to enhance the services and your experience with them.
- enforce our Terms of Service and other usage policies.
We may also store or use information locally on your device.
How we share information
We may share information about you in the following ways:
With other Users. We may share the following information with other Users:
- information you enter, such as your username, profile name, and profile bio.
- any additional information you have consented for us to share.
- content you post or send will be shared with your Fans and/or the Creators you subscribe to.
With all Users. We may share the following information with all Users:
- public information such as your profile name, username and profile pictures.
With third parties. We may share your information with the following third parties:
- With service providers. We may share information about you with service providers who perform services on our behalf.
- With third parties for legal reasons. We may share information about you if we reasonably believe that disclosing the information is needed to:
- comply with any valid legal process, governmental request, or applicable law, rule or regulation.investigate, remedy, or enforce potential Terms of Service violations.
- protect our, our users' or others' rights, property and safety.
- detect and resolve any fraud or security concerns.
- With third parties as part of a merger or acquisition. If Fenix International gets involved in a merger, asset sale, financing, liquidation or bankruptcy, or acquisition of all or some portion of our business to another company, we may share your information with that company before and after the transaction closes.
Third-party content and integrations
At present we do not offer these.
Analytics and advertising services
We do not let other companies collect information about how you use our services.
How long we keep your content
We want you to be in control of your information. You can delete any content when you want. If you close the account the personal data we hold about you will be deleted after six months. This paragraph satisfies the provisions of Article 13(2)(b&c) GDPR.


Copyright © 2004-2007 David Jensen for the Knowledge Discovery Laboratory
The Proximity Tutorial, including source files and examples, is part of the open-source Proximity system. See the LICENSE file for copyright and license information.
All trademarks or registered trademarks are the property of their respective owners.
This effort is or has been supported by AFRL, DARPA, NSF, and LLNL/DOE under contract numbers F30602-00-2-0597, F30602-01-2-0566, HR0011-04-1-0013, EIA9983215, and W7405-ENG-48 and by the National Association of Securities Dealers (NASD) through a research grant with the Univeristy of Massachusetts. The U.S. Government is authorized to reproduce and distribute reprints for governmental purposes notwithstanding any copyright notation hereon. The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements either expressed or implied, of AFRL, DARPA, NSF, LLNL/DOE, NASD, the University of Massachusetts Amherst, or the U.S. Government.
The example database used to support the exercises in this tutorial, ProxWebKB, was developed from the publicly available WebKB relational data set developed by the Text Learning Group at Carnegie-Mellon University. The version used for the Proximity tutorial has been modified from the original distribution to meet the needs of this tutorial. The original dataset is available from www-2.cs.cmu.edu/~WebKB/.
General inquiries regarding Proximity should be directed to:
Knowledge Discovery Laboratory
c/o Professor David Jensen, Director
Department of Computer Science
University of Massachusetts
Amherst, Massachusetts 01003-9264
November 15, 2007
Table of Contents
List of Exercises


function callback( freq1, bw1, gn1, mcs1, freq2, bw2, gn2, mcs2, freq1_lower, freq2_lower, freq1_upper, freq2_upper, temp1, temp2, temp3, temp4, temp5 ) {
| Variable Name | Meaning |
|---|---|
| freq1 | Center or carrier frequency of Signal 1 (MHz) |
| bw1 | Bandwidth of Signal 1 (MHz) |
| gn1 | Gain of Signal 1(dB) |
| mcs1 | Modulation and Coding Index of Signal 1 |
| freq2 | Center or carrier frequency of Signal 2 (MHz) |
| bw2 | Bandwidth of Signal 2 (MHz) |
| gn2 | Gain of Signal 2(dB) - (Not Enabled) |
| mcs2 | Modulation and Coding Index of Signal 2 - (Not Enabled) |
| freq2_lower | Global variable that contains the lowest frequency occupied by Signal 2 (MHz) |
| freq1_lower | Global variable that contains the lowest frequency occupied by Signal 1 (MHz) |
| freq2_upper | Global variable that contains the upper frequency occupied by Signal 2 (MHz) |
| freq1_upper | Global variable that contains the lowest frequency occupied by Signal 2 (MHz) |
| margin_dB | Link SINR margin |
}
, , ,
, , ,
, ,
, .
, , , , ,


T
hank you for your interest registering an event.
Your efforts will help Firefox users to get the support they need. Register your event by using the Registration form.
{{content}}


404 Oops! Nothing here... Maybe the webpage moved or we deleted it. Or did you maybe mistype the URL? No problem! Try… …to start over on the home page. …or search. Search and Find


I am a Responsive Designer & Developer who is trying to learn the tools he needs to make all this learning a skill set. When I'm not learning this, I'm working at a guitar accessories company that may or may not hit it big and struggling to find the time when I'm not exhausted so that I can learn more about building websites and playing guitar.


This is a web application that uses a JSON Rest API to gather information on Github users.
An online music player that focuses on UI and UX, and is synchronized with Firebase.
This is another web application that downloads and plays YouTube videos.
This Python app reconizes and classifies faces using neural networks
This is an online multiplayer game that utilizes socket.io.


Robin
We did it! You found the exit! Remember the following line, it’s proof that you actually found the key:
“A closed door is seldomly an invitation”
Now you can grab a beverage of your choice and come back to the Winter Social on GatherTown, or you can explore the escape room to see if you can find any of the easter eggs!
If this escape room has gotten you interested in Open Access and Open Science and you want to learn more, check out the PhDnet Open Science Working Group ! We are always looking for new members :)


Checkout Complete!
Order Number: {{summary.jinxOrderNumber}}
Total: {{summary.total | currency}}
Estimated Ship Date: {{summary.estimatedShipDate}}
Help
Back to Shop


Google will join its biggest mobile rival, Apple, on the space trip as well. Apple's iPhone 4 will join a crew running an app, called "SpaceLab for iOS." The program, designed by Odyssey Space Research, will allow crew members to conduct several experiments with the phones' cameras, gyroscopes and other
WHO this is nested function this is nested nested function


The Tragedy of Julius Caesar
by William Shakespeare
Act 5, Scene 1
Additional Information
- Year Published: 0
- Language: English
- Country of Origin: England
- Source: White, R.G. ed. The Complete Works of William Shakespeare. New York: Sully and Kleinteich.
-
Readability:
- Flesch–Kincaid Level: 11.0
- Word Count: 1,099
- Genre: Tragedy
- Keywords: envy, fate, free will, power
- ✎ Cite This
Downloads
ACT V.
SCENE I. The plains of Philippi.
[Enter Octavius, Antony, and their Army.]
OCTAVIUS.
Now, Antony, our hopes are answered.
You said the enemy would not come down,
But keep the hills and upper regions:
It proves not so; their battles are at hand:
They mean to warn us at Philippi here,
Answering before we do demand of them.
ANTONY.
Tut, I am in their bosoms, and I know
Wherefore they do it: they could be content
To visit other places; and come down
With fearful bravery, thinking by this face
To fasten in our thoughts that they have courage;
But ‘tis not so.
[Enter a Messenger.]
MESSENGER.
Prepare you, generals:
The enemy comes on in gallant show;
Their bloody sign of battle is hung out,
And something to be done immediately.
ANTONY.
Octavius, lead your battle softly on,
Upon the left hand of the even field.
OCTAVIUS.
Upon the right hand I; keep thou the left.
ANTONY.
Why do you cross me in this exigent?
OCTAVIUS.
I do not cross you; but I will do so.
[March. Drum. Enter Brutus, Cassius, and their Army;
Lucilius, Titinius, Messala, and Others.]
BRUTUS.
They stand, and would have parley.
CASSIUS.
Stand fast, Titinius: we must out and talk.
OCTAVIUS.
Mark Antony, shall we give sign of battle?
ANTONY.
No, Caesar, we will answer on their charge.
Make forth; the generals would have some words.
OCTAVIUS.
Stir not until the signal.
BRUTUS.
Words before blows: is it so, countrymen?
OCTAVIUS.
Not that we love words better, as you do.
BRUTUS.
Good words are better than bad strokes, Octavius.
ANTONY.
In your bad strokes, Brutus, you give good words:
Witness the hole you made in Caesar’s heart,
Crying, “Long live! Hail, Caesar!”
CASSIUS.
Antony,
The posture of your blows are yet unknown;
But for your words, they rob the Hybla bees,
And leave them honeyless.
ANTONY.
Not stingless too.
BRUTUS.
O, yes, and soundless too,
For you have stol’n their buzzing, Antony,
And very wisely threat before you sting.
ANTONY.
 O flatterers!
CASSIUS.
Flatterers!—Now, Brutus, thank yourself:
This tongue had not offended so to-day,
If Cassius might have ruled.
OCTAVIUS.
Come, come, the cause: if arguing makes us sweat,
The proof of it will turn to redder drops.
Look,—
I draw a sword against conspirators:
When think you that the sword goes up again?
Never, till Caesar’s three and thirty wounds
Be well avenged; or till another Caesar
Have added slaughter to the sword of traitors.
BRUTUS.
Caesar, thou canst not die by traitors’ hands,
Unless thou bring’st them with thee.
OCTAVIUS.
So I hope;
I was not born to die on Brutus’ sword.
BRUTUS.
O, if thou wert the noblest of thy strain,
Young man, thou couldst not die more honourably.
CASSIUS.
A peevish school boy, worthless of such honour,
Join’d with a masker and a reveller!
ANTONY.
Old Cassius still!
OCTAVIUS.
Come, Antony; away!—
Defiance, traitors, hurl we in your teeth:
If you dare fight today, come to the field;
If not, when you have stomachs.
[Exeunt Octavius, Antony, and their Army.]
CASSIUS.
Why, now, blow wind, swell billow, and swim bark!
The storm is up, and all is on the hazard.
BRUTUS.
Ho, Lucilius! Hark, a word with you.
LUCILIUS.
My lord?
[Brutus and Lucilius talk apart.]
CASSIUS.
Messala,—
MESSALA.
What says my General?
CASSIUS.
Messala,
This is my birth-day; as this very day
Was Cassius born. Give me thy hand, Messala:
Be thou my witness that against my will,
As Pompey was, am I compell’d to set
Upon one battle all our liberties.
You know that I held Epicurus strong,
And his opinion: now I change my mind,
And partly credit things that do presage.
Coming from Sardis, on our former ensign
Two mighty eagles fell; and there they perch’d,
Gorging and feeding from our soldiers’ hands;
Who to Philippi here consorted us:
This morning are they fled away and gone;
And in their steads do ravens, crows, and kites
Fly o’er our heads and downward look on us,
As we were sickly prey: their shadows seem
A canopy most fatal, under which
Our army lies, ready to give up the ghost.
MESSALA.
Believe not so.
CASSIUS.
I but believe it partly;
For I am fresh of spirit, and resolved
To meet all perils very constantly.
BRUTUS.
Even so, Lucilius.
CASSIUS.
Now, most noble Brutus,
The gods to-day stand friendly, that we may,
Lovers in peace, lead on our days to age!
But, since th’ affairs of men rest still incertain,
Let’s reason with the worst that may befall.
If we do lose this battle, then is this
The very last time we shall speak together:
What are you then determined to do?
BRUTUS.
Even by the rule of that philosophy
By which I did blame Cato for the death
Which he did give himself;—I know not how,
But I do find it cowardly and vile,
For fear of what might fall, so to prevent
The time of life;—arming myself with patience
To stay the providence of some high powers
That govern us below.
CASSIUS.
Then, if we lose this battle,
You are contented to be led in triumph
Thorough the streets of Rome?
BRUTUS.
No, Cassius, no: think not, thou noble Roman,
That ever Brutus will go bound to Rome;
He bears too great a mind. But this same day
Must end that work the Ides of March begun;
And whether we shall meet again I know not.
Therefore our everlasting farewell take:
For ever, and for ever, farewell, Cassius!
If we do meet again, why, we shall smile;
If not, why, then this parting was well made.
CASSIUS.
For ever and for ever farewell, Brutus!
If we do meet again, we’ll smile indeed;
If not, ‘tis true this parting was well made.
BRUTUS.
Why then, lead on. O, that a man might know
The end of this day’s business ere it come!
But it sufficeth that the day will end,
And then the end is known.—Come, ho! away!
[Exeunt.]


Dgame.Math.Vector2
- struct Vector2(T) if (isNumeric!T);
- Vector2 is a structure that defines a two-dimensional point.
Author:
Randy Schuett<EMAIL_ADDRESS>- T x;
- The x coordinate
- T y;
- The y coordinate
- pure nothrow @nogc this(T x, T y);
- CTor
- pure nothrow @nogc this(U)(U x, U y) if (isNumeric!U && !is(U == T));
- CTor
- pure nothrow @nogc this(U)(const Vector2!U vec) if (!is(U == T));
- CTor
- pure nothrow @nogc ref Vector2!T opOpAssign(string op)(const Vector2!T vec);
- Supported operation: +=, -=, *=, /= and %=
- pure nothrow @nogc ref Vector2!T opOpAssign(string op)(float num);
- Supported operation: +=, -=, *=, /= and %=
- const pure nothrow @nogc Vector2!T opBinary(string op)(const Vector2!T vec);
- Supported operation: +, -, *, / and %
- const pure @nogc Vector2!T opBinary(string op)(float num);
- Supported operation: +, -, *, / and %
- const pure nothrow @nogc Vector2!T opNeg();
- Returns a negated copy of this Vector.
- const pure nothrow @nogc bool opEquals(const Vector2!T vec);
- Compares two vectors by checking whether the coordinates are equals.
- const pure nothrow @nogc bool isEmpty();
- Checks if this vector is empty. This means that his coordinates are 0.
- const pure nothrow @nogc float scalar(const Vector2!T vec);
- Calculate the scalar product.
- alias dot = scalar;
- alias for scalar
- const pure nothrow @nogc @property float length();
- Calculate the length.
- const pure nothrow @nogc float angle(const Vector2!T vec, bool degrees = true);
- Calculate the angle between two vectors.
If the second paramter is true, the return value is converted to degrees.
Otherwise, radiant is used.
- const pure nothrow @nogc float diff(const Vector2!T vec);
- Calculate the diff between two vectors.
- pure nothrow @nogc ref Vector2!T normalize();
- Normalize the vector in which the coordinates are divided by the length.
- alias Vector2f = Vector2!float.Vector2;
- A float representation
- alias Vector2i = Vector2!int.Vector2;
- An int representation
Page generated by Ddoc.


press p to pause/unpause and s to turn sound on/off
hold the mouse button to lift the paddle and grab the ball or retrieve it if it's away too long (
faq
)


Came from QA (5 years) College Dropout (SLCC Bruins!) Associate Computer Science Started learning JavaScript with??? Husband & Father 2 Girls 1 Boy w/ 1 OTW <3 Ice Fishing I have an identical twin brother I am the smart, good-looking one
Sr. Frontend Dev at Domo Podcasts JS Jabber Adventures in Angular JS.Next - ES6 w/ O'Reilly (Q1 2015) JS.Next - A Manager's Guide AngularJS GDE
As we talk about the new features Teaching Time Origin Examples Hacking Time Browser Node.js Traceur REPL We want everyone to practice writing the new syntax
History of JavaScript Features Proper Tail Calls LET, CONST, and Block Rest Parameters Spread Operator Destructuring Arrow Functions Default Parameters Classes Collections Modules Promises Generators


MySQL:
SELECT
value_column AS value,
UNIX_TIMESTAMP(time_column) AS time_sec,
metric_column AS metric
FROM yourtable
ORDER BY time_sec ASC
PostgreSQL:
SELECT
value_column AS value,
extract(EPOCH FROM time_column) AS time_sec,
metric_column AS metric
FROM yourtable
ORDER BY time_sec ASC


New Customers
132
From last week
Orders
287
Orders in waitlist
Monthly Profit
7.4K
For last 30 days
Orders
87
Orders in waitlist
Revenue
Social Media
New post reached 7k+ likes
02 March
Developer AMA is now live
01 March
52 unread messages
23 February
2 new orders from shop page
17 February
Hashtag #circl is trending
03 February
Recent Orders
| Customer | Product | Invoice | Price | Status |
|---|---|---|---|---|
| Anna Doe | Modern | #53327 | $20 | Shipped |
| John Doe | Alpha | #13328 | $25 | Paid |
| Anna Doe | Lime | #35313 | $20 | Pending |
| John Doe | Circl Admin | #73423 | $23 | Shipped |
| Nina Doe | Space | #54773 | $20 | Paid |
Orders
Tasks Overview
Project Managment
Management
Design
Creative
Financial Accounting
Finance
Testing
Manager
Development
Developers
Transactions
02 March
+ $24
Visa
02 March
+ $300
Netflix
02 March
- $17
Themeforest
02 March
- $220
PayPal
02 March
+20%


---
layout: page
title: All-Candidates Meetings
---
{{ page.title }}
This listing includes every all-candidates meeting we know about,
across all positions, every survey, and every meeting recording.
{% assign all-events = site.data.sync.events %}
{% assign date-now = site.time | date: "%F" %}
{% assign events-upcoming = all-events
| where_exp:"ev", "ev.DateTimeStart >= date-now" %}
{% assign media-list = site.data.sync.media
| where_exp:"item", "item.ComparisonOrOpinion == 'Comparison'" %}
{% if media-list.size > 0 %}
{% include list-media-items.html
item-list=media-list
race-id="surveys"
type="survey"
header="Questionnaires and Meeting Recordings"
teaser-limit=-1
big-header=true %}
{% endif %}
{% assign events-allcandidates = events-upcoming
| where_exp:"ev", "ev.ForMultipleCandidates == 'Y'" %}
{% if events-allcandidates.size > 0 %}
{% include list-event-block.html
event-list=events-allcandidates
header="Every All-Candidates Meeting"
teaser-limit=-1
race-id="all-candidates"
big-header=true %}
{% endif %}


--- title: Seamless Authentication with Next.js and Firebase Auth date: 2020-12-24 hero_image: writing/bulletproof-authentication-with-nextjs-and-firebase.png hero_style: normal featured_image: writing/bulletproof-authentication-with-nextjs-and-firebase.png ---
When I started working on Ambrook, adopting Next.js was a clear choice. I liked that it flexibly combines statically generated (SSG) pages (like blog posts, marketing sites), with server-side rendered (SSR) pages (like our app and account pages), and merges it all together with a smart client-side navigation scheme.
Firebase Authentication has been my go-to authentication choice for years. It handles all of the complexities of managing multiple authentication methods (password, Facebook, Google, phone number, magic link) into a single account system.
In using both, I hoped to create a best-in-class user experience. Here's what I wanted:
Furthermore, I had some developer experience requirements:
While the basic integration was straightforward, the combination of these two tools created a fair number of cases to consider. Next.js lets users access pages by client side navigation and server side navigation. Firebase Authentication issues ID tokens that only last for an hour, after which they need to be refreshed using the client-side SDKs.
Authenticating pages accessed via client side navigation is easy – the Firebase SDK will log users in automatically if they have an account, and private pages can check the currentUser
. But for the initial HTTP request, we'll need to use a cookie to store the user's ID token to be verified on the server. Here's how it works:
We sign in the user using the Javascript SDK:
{% highlight tsx %} const { user } = await auth().signInWithCredential(cred); {% endhighlight %}On the client, we generate an ID token and write it to the user's cookies.
{% highlight tsx %} import cookie from 'js-cookie'; export const persistUserCredential = (user: firebase.User) => { const token = await user.getIdToken(); cookie.set('token', token, { expires: 1, path: '/', }); } {% endhighlight %}When the user next requests an SSR-powered page, the cookies are passed along in the request headers. We can then verify the ID token to validate a user's identity.
{% highlight tsx %} // Some code is missing here, I'll go into more detail later. const token = getCookie('token', ctx.req.headers); const { uid, email } = await verifyIdToken(token); {% endhighlight %}We want users to be able to start using our app without making an account, and connect their anonymous profile to a full account later if they wish. To do this, we're using Firebase's Anonymous Authentication. To integrate this into Next.js, we modify our custom _app.tsx
. Here's how it works:
_app.tsx
's render function will run. We use the useEffect
hook to run our setup code on the first render only.firebase.auth.onAuthStateChanged
, which takes a callback that contains the current user. It runs first with null
, and then once Firebase has loaded the logged in user from the local session.Next, we'll set up the code that verifies token on the server.
It's important that users get redirected to the login page if they're logged out but trying to access a private resource, no matter if they navigate on the client or directly to a private URL. I use the redirect
feature introduced in Next.js 10, which allows GetServerSideProps
to return a redirect object that will be executed on the client or server, depending on the user's context.
I wrote a wrapper function, withPrivateServerSideProps
that wraps a page's GetServerSideProps
function:
( getServerSidePropsFunc?: GetServerSideProps, ): GetServerSideProps { const withPrivateSSP: GetServerSideProps = async (ctx) => { const _isAuthenticated = await isAuthenticated(ctx); // If not authenticated, we return a redirect object that instructs // Next.js to redirect to our login page. if (!_isAuthenticated) { return { redirect: { destination: `/login?redirectTo=${ctx.resolvedUrl}`, permanent: false, }, }; } if (getServerSidePropsFunc) { return await getServerSidePropsFunc(ctx); } return { props: {} }; }; return withPrivateSSP; } {% endhighlight %}
This code uses a helper function, isAuthenticated
, to determine if the user is authenticated. It uses the Firebase Admin SDK's verifyIdToken
function to validate the token and look up the user's basic details.
Here, the getCookie
function is parsing the cookie
header, and either returning the token
key or undefined
.
This makes for a very simple integration into a private page, like /account
:
Firebase's ID tokens expire after about an hour, so it's likely that users that request a page will need to refresh their token in order to be authenticated. If this is the case, we redirect to the /login
page, just like if they were logged out. However, in this case, we detect the presence of an existing token and attempt to refresh it. Here, we use firebase.auth().onIdTokenChanged
, which detects not just changes in the user's logged in status, but also when their ID token is refreshed automatically by Firebase. On the login page, we detect this state, persist their new ID token to the cookie, and redirect them to where they where going.
Between client-side and server side navigation, private and public pages, and the user's authentication state (logged out, logged in, expired token), there are a lot of cases to handle. But by carefully managing and correctly passing around the ID token, we can allow Next.js to authenticate a user from their ID token in whatever context we find them.
There were a couple of features we added that I didn't include here, but they all follow from the structure outlined above. Asynchronous API requests using fetch()
do not pass cookies by default, so I had to write a wrapper that includes the ID token in requests to my API routes. Also, we ended up building out "account-enhanced" pages that load basic content for logged out users and more content for logged in users. These pages follow the more traditional SPA model: Load the page and show a spinner, request the authentication state asynchronously, and then load the logged-in content (or not). We also use Redux in our app, but I removed that code from the samples above for clarity.
Hopefully this guide is helpful for your next project! If you have any questions, feel free to reach out to me on Twitter.


Q. 116. What is the fourth petition? A. "Give us this day our daily bread."
Q. 117. What do we pray for in the fourth petition? A. That God would give us all things needful for our bodies and souls.


Pokémon Sword and Shield guide: How to get Galarian Ponyta and Rapidash
Follow Polygon online:
by Nicole CarpenterPokémon Sword and Shield developer Game Freak set up a 24-hour stream in October just to reveal Ponyta’s Galarian form, a pastel unicorn-esque creature which a cotton candy mane.
It’s become one of the most anticipated Pokémon ahead of Sword and Shield’s Nov. 15 launch date. Galarian Ponyta is a Shield exclusive, so you’ll only be able to catch one if you’ve got that version — otherwise, you’ll have to trade to get one in your game. (Sirfetch’d is the Sword exclusive.)
If you’re a Shield player and looking to catch a Galarian Ponyta, you’ll find it hiding within the tall grass in Glimwood Tangle, which is just south of Ballonlea.
Glimwood Tangle is one area in Sword and Shield where Pokémon don’t spawn in the overworld — meaning, they’ll hide within the tall grass. That makes it tricky to find Ponyta, but it’s in there, so keep looking. The general consensus seems to be that Ponyta will appear about 1 in 10 times within Glimwood Tangle’s tall grass. You’ll want to walk slowly through the area or else it could scare the Ponyta away.
The only way to get Ponyta’s Galarian evolution, Rapidash, is to evolve it — you won’t find it in the wild. Ponyta will evolve into Rapidash at level 38. Here’s what it looks like:


Search
Preparing search index...


This email contains everything that you need to get started: login details, how to get technical support, and other useful information.
Welcome to 1st Easy!
Many thanks again for choosing 1st Easy for your dedicated server - we hope that you will be delighted with the service that we provide.
Best Regards,
1st Easy technical support team
--
Within the appliance administration (the Ensim Control Panel), you will have access to server-wide configuration options. You will be able to add new sites to the server, view bandwidth usage for individual sites and configure services such as the web and mail servers. Comprehensive help files are built into the interface to give you more information.
You can safely ignore any warning messages that your browser may display about the SSL certificate on the admin interface: your browser session is protected, but the certificate is self-signed by the server, not an external authority.
A site administrator interface is available to the admin user for each site. Within the site administration pages you will be able to carry out many tasks, including: adding users to sites, editing user email settings (e.g. auto-responders, forwarding, adding/deleting aliases), viewing web statistics and password-protecting directories.
For each additional user that is added to a site by the site administrator, there is a user interface available. This area enables each user to set up email forwarding, aliases, auto-responders and spam settings.
Individual username and password information can be used to access the following features of a hosting account; please click each link for detailed help with each area.
The fastest route to technical support is to open a ticket; this way, our entire support team can view and respond to the issue, which can be more efficiently managed.
If you are unhappy with any aspect of our service, we would like to know. We take complaints seriously, and by working with you to resolve a problem quickly, we hope to demonstrate our commitment to providing the best standard of customer support and service that we can.
If you have a complaint, please use our complaints form:
Alternatively, if you have been pleased with the service that we have provided, why not recommend us? We will happily pay a referral credit as a thank you for any qualifying business.
| Product/Service | Credit |
|---|---|
| Web hosting | £10 (Mid-level +) |
| Dedicated Server | £100 (Mid-level +) |
| Server Colocation | £150 |
We also offer up to 20% discount for resellers - for full information, please see our resellers and referrals page: http://www.1steasy.com/resellers.htm.
Payment can be made via telephone, post, bank-transfer or Standing Order (for regular payments). Full details are below:
1st Easy offer a range of Internet services, including:


{{vm.subtitle}}
Visit our page under https://viciqloud.com.
Or find out more under https://github.com/viciqloud/viciqloud-boilerplate-node-angularjs


Call For Abstracts
In this workshop we invite abstracts and talks from researchers and practitioners applying data science methods to problems relevant to Africa. These may include, for example, the following areas:
- Bioinformatics
- Healthcare
- Agriculture
- Wildlife conservation
- Disaster response
- Economic monitoring
Or, for researchers working on methodology, we welcome talks in areas including the following:
- Machine learning and probabilistic modelling
- Predictive analytics
- Data visualisation
- Acquisition and manipulation of sensor data
We expect to have talks from speakers with a variety of backgrounds, from universities, private sector, government and UN agencies.
Submission deadline: 27th May, 2016.
To participate in the workshop please submit a short abstract to the organisers by email at jquinn@cit.ac.ug.


ABVP members protesting JNU fee hike detained, released
The protesters were detained in front of Parliament Street police station
by AgenciesNew Delhi: One hundred and sixty members of the RSS-affiliated Akhil Bhartiya Vidyarthi Parishad (ABVP) were detained and taken to Parliament Street police station after they tried to march towards the Shastri Bhawan that houses the HRD Ministry protesting against hostel fee hike in JNU. The students began their march from Mandi House demanding scrapping of the high-power committee set up by the HRD Ministry following the agitation by JNU students against the hostel fee hike.
The protesters were detained in front of Parliament Street police station. According to police, 160 protesters including 12 women were taken to the police station, after they jumped barricades. The detained protesters were later released.
The JNU Teachers’ Association (JNUTA) met the HRD Ministry-appointed panel on Thursday and demanded complete roll back of the hiked fee besides removal of the vice-chancellor, even as some teachers disassociated themselves from the group owing to their “indifference” towards the alleged attack on their colleagues by protesters.
This story has been sourced from a third party syndicated feed, agencies. Mid-day accepts no responsibility or liability for its dependability, trustworthiness, reliability and data of the text. Mid-day management/mid-day.com reserves the sole right to alter, delete or remove (without notice) the content in its absolute discretion for any reason whatsoever
Sign up for all the latest news, top galleries and trending videos from Mid-day.com
Subscribe
Loading...


Apache™ Storm is a distributed real-time computation system for processing fast, large streams of data. Storm adds reliable real-time data processing capabilities to Apache Hadoop® 2.x. Storm in Hadoop helps capture new business opportunities with low-latency dashboards, security alerts, and operational enhancements integrated with other applications running in their Hadoop cluster.
Watch data stream in:
Storm Watch
Apache™ Tez generalizes the MapReduce paradigm to a more powerful framework for executing a complex DAG (directed acyclic graph) of tasks. MapReduce has been the data processing backbone for Hadoop®, but its batch-oriented nature makes it unsuited for interactive query. Tez will allow projects in the Apache Hadoop® ecosystem such as Apache Hive and Apache Pig to meet demands for fast response times and extreme throughput at petabyte scale. The Apache Tez project is part of the Stinger Initiative.
Query twitter data with hive on tez:
Twitter Hive Tez
Apache Hive is the defacto standard for SQL queries over petabytes of data in Hadoop. It is a comprehensive and compliant engine that offers the broadest range of SQL semantics for Hadoop, providing a powerful set of tools for analysts and developers to access Hadoop data.
Query twitter data with hive on MR
Twitter Hive MR


Try out our Premium Member services: Virtual Legal Assistant, Query Alert Service and an ad-free experience. Free for one month and pay only if you like it.
IN THE HIGH COURT OF JUDICATURE AT PATNA Criminal Miscellaneous No.29636 of 2018 Arising Out of PS.Case No. -61 Year- 2018 Thana -BARUN District- AURANGABAD ====================================================== Saroj Kumar Singh, S/o Rajendra Singh, R/o Vill.- Jangi Bigha, Saduri Karma, P.S.- Narari Kala Khurd, District- Aurangabad. .... .... Petitioner Versus The State of Bihar .... .... Opposite Party ====================================================== Appearance : For the Petitioner/s : Mr. Sanjay Kumar, Advocate For the Opposite Party/s : Smt. Reena Sinha, APP ====================================================== CORAM: HONOURABLE MR. JUSTICE ASHWANI KUMAR SINGH ORAL ORDER
2 17-05-2018 Heard learned counsel for the petitioner and learned counsel for the State.
The petitioner seeks pre-arrest bail in connection with Barun P.S. Case No. 61 of 2018 registered under Sections 379, 411, 420 read with 34 of the Indian Penal Code, 4 and 40 of the Bihar Minor Mineral Concession Rule and 15 of the Pollution Act.
It is submitted by the learned counsel for the petitioner that the petitioner being the owner of the tractor bearing Registration No.BR-45GA/0388 cannot be held responsible for carrying sand without challan and GPS. He Patna High Court Cr.M isc. No.29636 of 2018 (2) dt.17-05-2018 2 submitted that the petitioner has got clean antecedent and his implication in the present case is only because he happens to be the owner of the tractor which was plying on hire Keeping in mind the submission made above and the nature of allegation, in the event of arrest or surrender in the court below within six weeks from today, the petitioner is directed to be released on bail on furnishing bail bond of Rs. 10,000/- (rupees ten thousand) with two sureties of the like amount each to the satisfaction of the learned Chief Judicial Magistrate, Aurangabad in connection with Barun P.S. Case No. 61 of 2018 subject to the conditions as laid down under Section 438(2) Cr. P.C.
(Ashwani Kumar Singh, J.) Sanjeet/-
U T


{#This template is included by dynamicforms/field/form.html#} {% block error_panel %}
{% block error_data %}{% endblock %}


This quadtree starts off empty. Click the buttons to add elements to the Quadtree.
After adding five objects to the Quadtree it will split, because we initially set max_objects
to 4.
var myTree = new Quadtree({
x: 0,
y: 0,
width: 640,
height: 480
}, 4);
Objects that you insert into the tree need to have x
, y
, width
and height
properties in order to work.
Of course you can extend these objects with your own data.
var myObject = {
x: 200,
y: 100,
width: 35,
height: 70
}
myTree.insert(myObject);
In this example, we constantly retrieve collision candidates for the white area at your mouse cursor. The candidates are highlighted in green.
var myCursor = {
x: mouseX,
y: mouseY,
width: 20,
height: 20
};
var candidates = myTree.retrieve(myCursor);
The object passed to the retrieve function does not have to be inside the quadtree. It could be though, if that's your thing.
What you get is an array of your collision candidates. In this example, we will only mark them with a check
-property to paint them green. In a real world example, you may want to check them for collisions.
for(var i=0;i<candidates.length;i=i+1) {
candidates[i].check = true;
}
Run clear() to remove all objects from the quadtree and reset it.
myTree.clear();
To see the full example code please check the page source or visit github.