text:
Institute for applied mathematics

# Oberseminar Analysis Winter 2012/13

## Organizers: B. Zwicknagl, S. Conti, H. Koch, S. Müller, B. Niethammer, M. Rumpf, B. Schlein, C. Thiele, J. López-Velázquez

• Thursday, October 18, 2012, 2:15 p.m., seminar room 2.040
André Schlichting
The Eyring-Kramers formula for Poincaré and logarithmic Sobolev inequalities

We consider a class of Fokker-Planck equations in the regime of low
temperature. The presented technique provides a new proof for the
sharp estimate of the spectral gap of the associated generator,
which has the variational formulation as the optimal constant
in the Poincaré inequality. Moreover, this approach generalises to
the optimal constant in the logarithmic Sobolev inequality, which has
no characterisation by the spectrum of the generator. This sharp
identification is called Eyring-Kramers formula and allows to obtain
fine properties of the relaxation behaviour of the associated diffusion
process. The result follow from two main ingredients: The first one uses
an explicit construction of a Lyapunov function for the dynamics restricted
to a basin of attraction resulting in "good" Poincaré and log-Sobolev constants.
This mimics the fast convergence of the diffusion to metastable states.
The second ingredient is a mean-difference estimate, where we propose a
dynamic interpretation of the negative Sobolev norm as weighted transport
distance. Therewith, we obtain the main contribution to the Poincaré and
logarithmic Sobolev constant, resulting from exponential long waiting times
of jumps between metastable states of the diffusion. (joint work with Georg Menz)

• Thursday, November 15, 2012, 2:15 p.m., seminar room 2.040
Martijn Zaal (Vrije Universiteit Amsterdam)
Gradient flows in metric and non-metric spaces and applications to parabolic free
boundary problems

In this talk, a very simple model for cell swelling by osmosis will be studied.
The problem consists of diffusion in a free domain. The boundary moves by
surface tension and osmotic force. A variational formulation for this problem
will be introduced, and it will be shown that the osmotic force can be thought
of as a Lagrange multiplier. Finally, it appears that the concept of gradient
flow can be stretched a bit further than metric spaces, and that this
generalization is useful to study the variational structure of the mean
curvature flow.

• Thursday, November 22, 2012, 2:15 p.m., Lipschitz-Saal (room 1.016)
Marcello Lucia (City University of New York)
Best constant in some Onofri type inequalities
In 1982 Onofri derived on the two-dimensional sphere an optimal inequality
for a Moser-Trudinger type functional. The aim of this talk is to present
similar results either on closed surfaces, or on a disk within the class of
functions that are invariant under the action of a group of rotations. Those
results can be applied to classify the steady states of a chemotaxis system.

• Thursday, November 29, 2012, 2:15 p.m., seminar room 2.040
Allan Chan
Energyscaling, domain-branching and SO(2)-invariance in solid-solid phase transitions
In the early 90s Kohn and Müller established a model for the formation
of domain pattern in martensitic shape-memory alloys. For a vectorial
generalization of their model for solid-solid phase transitions with SO(2)
invariance, we discuss the cases with one and two rank-1 connections and
derive upper and lower bounds to the infimum energy with domain branching.

• Thursday, December 6, 2012, 2:15 p.m., Lipschitz-Saal (room 1.016)
Yukihiro Seki
Multiple peak aggregations for the Keller-Segel system
We discuss two-dimensinal Keller-Segel system, a classical model of chemotactic
aggregation.
We derive matched asymptotic expansions for a solution whose amount of
mass aggregation is 8N\pi, where N = 1, 2, 3, ...
Previously available asymptotics had been computed only for the case of N = 1.
This talk is based on a joint work with J.J.L. Vela\'{a}zquez and Y. Sugiyama.

• Thursday, December 6, 2012, 3:30 p.m., Lipschitz-Saal (room 1.016)
Manuel Gnann (MPI MIS, Leipzig)
Viscous thin fi lms: towards a regularity theory for the moving contact line
Abstract

• Thursday, January 10, 2013, 2:15 p.m., seminar room 2.040
Cyrill Muratov (New Jersey Institute of Technology)
On shape of charged drops: an isoperimetric problem with a competing non-local term.
In this talk I will give an overview of my recent work with H. Knuepfer
on the analysis of a class of geometric problems in the calculus of variations.
I will discuss the basic questions of existence and non-existence of energy
minimizers for the isoperimetric problem with a competing non-local term.
A complete answer will be given for the case of slowly decaying kernels in
two space dimensions, and qualitative properties of the minimizers will be
established for general Riesz kernels.

• Thursday, January 10, 2013, 3:30 p.m., seminar room 2.040
Dhia Mansour (Tuebingen University)
Variational discretization of linear wave equations on evolving surfaces
We introduce a linear wave equation on a moving surface derived from the
Hamilton's  principle of stationary action. The variational principle is discretized
with functions that are piecewise linear in space and time. This yields a
discretization of the wave equation in space by evolving surface finite elements
and in time by a variational integrator, a version of the leapfrog or
Stoermer--Verlet method. Stability and convergence of the full discretization
in the natural time-dependent norms  are analyzed. Under suitable assumptions,
we obtain optimal-order error estimates. Numerical experiments illustrate the
behavior of the fully discrete method.
The talk is based on joint work with Ch. Lubich (Tuebingen).

• Thursday, January 17, 2013, 2:15 p.m., Lipschitz-Saal (room 1.016)
Michal Wrochna (Georg-August-Universität Göttingen)
Positive-frequency solutions of the Klein-Gordon equation: the case of
overcritical potentials

In quantum field theory on curved space-time or in external potentials, a
central problem is to find solutions of the underlying Klein-Gordon equation
with a prescribed singularity structure. I will explain the original motivation
and modern formulations of the problem in terms of the wave front set, and
I will present some recent constructions. This will include the analysis of the
`overcritical case', in which the quantities preserved by the evolution are
non-positive. As an outlook, I will comment on perspectives in systems with
Coulomb potential.
• Thursday, January 17, 2013, 3:30 p.m., Lipschitz-Saal (room 1.016)
Benedikt Wirth (New York University)
A convex approximation of Euler's elastica functional
Euler's elastica energy has often been proposed for curvature regularization
in image processing, however, global minimizers are difficult to obtain due to
the high nonlinearity and nonconvexity. We introduce a convex, lower
semi-continuous, coercive approximation, which is thus very well-suited as a
regularizer in image processing. The approximation is closely related to the
exact convex relaxation (which seems very difficult to understand). Interestingly,
the exact convex relaxation of the elastica energy reduces to constantly zero
if the total variation part of the elastica energy is neglected. The convex
approximation arises via functional lifting of the image gradient into a Radon
measure on the four-dimensional space $\Omega \times S^1 \times \mathbb{R}$,
$\Omega \subset \mathbb{R}^2$, of which the first two coordinates
represent the image domain and the last two the normal and curvature of the
image level lines. It can be expressed as a linear program that can robustly be
solved on the GPU after discretizing the involved Radon measures via a linear
combination of line measures concentrated on curve segments (joint work with
Kristian Bredies and Thomas Pock).
• Thursday, January 24, 2013, 2:15 p.m., seminar room 2.040
Marcello Porta
Many-body interactions in graphene
In this talk I will discuss models for interacting fermions on the honeycomb lattice.
The goal is to understand the thermodynamic properties of graphene, a newly
discovered material which can be considered as the first realization of a
(quasi-) 2d crystal. In the case of weak short range interactions I will present
a theorem proving the universality of the conductivity, in the limit of zero
temperature and zero frequency. Then, I will briefly discuss the effect of long
range electromagnetic interactions; in this case, anomalous (i.e. interaction
dependent) exponents appear in the perturbative expansion of the correlations.
All results are obtained using rigorous Renormalization Group methods.
In both cases, a crucial role is played by gauge symmetry and Ward identities.
This is joint work with A. Giuliani and V. Mastropietro.

• Wednesday, February 2, 2013, 2:00 p.m., seminar room 1.007
Tuesday, March 5, 2013, 2:15 p.m., seminar room 1.007
Wednesday, March 6, 2013, 2:15 p.m., seminar room 1.007
Alexander Volberg (Michigan State)
On a problem of David and Semmes in a co-dimension one case

• Thursday, March 7, 2013, 2:15 p.m., seminar room 1.007
Paco Villarroya, University of Lund (Sweden)
A new T(1) Theorem for multiparameter singular integrals
In this talk, we present a new T(1) Theorem
characterizing the boundedness of singular integral
operators on product spaces. Our different approach avoids
the use of vector-value Calderon-Zygmund theory and so,
it does not require the assumption of boundedness of the
operator when restricted to the lower parameter case. This
represents an improvement of a classical result of J.L. Journe,
which is still regarded as the best extension of Calderon-Zygmund theory
to the product setting. As an application, we obtain a stronger version
of a classical theorem of R. Fefferman and E. Stein about non-isotropic
convolution operators.

• Thursday, March 28, 2013, 2:15 p.m., Lipschitz-Saal (room 1.016)
Alexander Volberg (Michigan State)
Bellman functionals and weighted problems
We show how Bellman functions of infinite number of variables appear
naturally and help to solve some problems concerning the weighted estimates
of Singular Integrals.

## News

Die ehemalige Doktorandin am IAM, Lisa Hartung (aktuell: Courant Institute of Mathematical Sciences, New York), wurde für ihre herausragende Doktorarbeit "Extremal Processes in Branching Brownian Motion and Friends" (Betreuer: Prof. Bovier) mit dem Förderpreis der DMV-Fachgruppe Stochastik ausgezeichnet. Details hier. (14.03.2018)

Prof.  Patrik Ferrari erhält den ersten Alexandros Award zusammen mit Ivan Corwin (Columbia University) und Alexei Borodin (MIT) für den Artikel "Free energy fluctuations for directed polymers in random media in 1+1 dimensions".
Details siehe hier. (12.03.2018)

Frau Dr. Martina Vera Baar erhält den Hausdorff-Gedächtnispreis für die beste Dissertation des akademischen Jahres 2016/17 (Betreuer: Prof. Dr. A. Bovier, IAM). (Pressemitteilung, 24.01.2018)

Contact

Managing Director: Prof. Dr. Anton Bovier
Chief Administrator: Dr. B. Doerffel
geschaeftsfuehrung@iam.uni-bonn.de
Imprint

Mailing address

Institute for Applied Mathematics
University of Bonn
Endenicher Allee 60
D-53115 Bonn / Germany


text:
# Morphisms of Euclidean Geometry

In Euclidean geometry $\mathbb{E}^2(\cong \mathbb{C})$, the group $G=\{z\mapsto raz+b, z\mapsto ra\bar{z}+b\colon a,b\in \mathbb{C},|a|=1, r\in \mathbb{R}^{+} \}$ is precisely the group of similarities of $\mathbb{E}^2$. This group is also a set of bijective maps on $\mathbb{E}^2$, which maps parallel (intersecting) lines to parallel (intersecting) lines.

Question: If we consider $\mathbb{E}^2$ from axiomatic view point, then, is this group precisely the group of bijective morphisms of the geometry?

(My question may not be clear to someone; but what I want to ask is the following: there are points and lines in $\mathbb{E}^2$; and two distinct lines can have either zero or one common point. If we consider the group of bijective maps on $\mathbb{E}^2$ which preserves this coincidence, then is this group precisely the group $G$ mentioned above? If one modifies the question precisely, I will be happy.)

• You're asking if these are all automorphisms of $\mathbf E^2$ as a model for the theory of euclidean geometry? Note that in general, a bijective morphism is not an automorphism. – tomasz Aug 12 '12 at 12:14
• An automorphism should preserve inequalities between angles and lengths as well as incidence, I think... But that may follow from incidence-preserving. – tomasz Aug 12 '12 at 12:28

format: plain


text:
# How to prove that a topological space is non-hausdorff?

Tags: nonhausdorff, prove, space, topological
 P: 320 Is there a method or an algorithm or a theorem or whatever that tells us a topological space is not a Hausdorff space?
 Mentor P: 15,925 This depends on the space in question. I think finding a counterexample to the definition shouldn't be so hard. Another thing you can do is to find a sequence that converges to more than one point (but if such a sequence does not exist, then the space can still be Hausdorff). You have any specific space in mind??
 P: 234 If you don't have enough information to actually exhibit a pair of points that can't be separated by disjoint open neighborhoods, then the only other way I can think of to show non-Hausdorff-ness would be to have a counterexample to one of the properties that Hausdorff spaces have (e.g. that compact subsets are closed).
P: 1,168

## How to prove that a topological space is non-hausdorff?

You can check the above conditions and throw-in metrizability as a sufficient--tho not necessary --condition for Hausdorffness.

Still, I think the question is too broad* ; and you may find a better answer if you know how the space is presented/described to you.

*tho, don't get me wrong, I like broads.
 P: 320 for example Zariski topology, How do we show that it is non-Hausdorff? I'm just interested to know how we could see if a space is Hausdorff or not.
Mentor
P: 15,925
 Quote by AdrianZ for example Zariski topology, How do we show that it is non-Hausdorff? I'm just interested to know how we could see if a space is Hausdorff or not.
What do you mean with the Zariski topology here?? Do you mean the topology consisting of all cofinite sets, or do you mean the topology associated with a commutative ring??

Let's say you mean the former, then we have an infinite set X and a topology

$$\mathcal{T}=\{U\subseteq X~\vert~X\setminus U~\text{is finite}\}\cup \{\emptyset\}$$

Take two arbitrary non-empty open sets U and V. Then $U\cap V$ is nonempty (check this). So the space is Hausdorff because there don't exist disjoint open sets!

 Related Discussions Calculus & Beyond Homework 9 Calculus & Beyond Homework 0 Calculus & Beyond Homework 17 Calculus & Beyond Homework 3 Differential Geometry 2


text:
Holistic comparison of the output of text generation models

# compare-mt

by NeuLab @ CMU LTI, and other contributors

compare-mt (for "compare my text") is a program to compare the output of multiple systems for language generation, including machine translation, summarization, dialog response generation, etc. To use it you need to have, in text format, a "correct" reference, and the output of two different systems. Based on this, compare-mt will run a number of analyses that attempt to pick out salient differences between the systems, which will make it easier for you to figure out what things one system is doing better than another.

## Basic Usage

First, you need to install the package:

# Requirements
pip install -r requirements.txt
# Install the package
python setup.py install

Then, as an example, you can run this over two included system outputs.

compare-mt --output_directory output/ example/ted.ref.eng example/ted.sys1.eng example/ted.sys2.eng

This will output some statistics to the command line, and also write a formatted HTML report to output/. Here, system 1 and system 2 are the baseline phrase-based and neural Slovak-English systems from our EMNLP 2018 paper. This will print out a number of statistics including:

• Aggregate Scores: A report on overall BLEU scores and length ratios
• Word Accuracy Analysis: A report on the F-measure of words by frequency bucket
• Sentence Bucket Analysis: Bucket sentences by various statistics (e.g. sentence BLEU, length difference with the reference, overall length), and calculate statistics by bucket (e.g. number of sentences, BLEU score per bucket)
• N-gram Difference Analysis: Calculate which n-grams one system is consistently translating better
• Sentence Examples: Find sentences where one system is doing better than the other according to sentence BLEU

You can see an example of running this analysis (as well as the more advanced analysis below) either through a generated HTML report here, or in the following narrated video:

To summarize the results that immediately stick out from the basic analysis:

• From the aggregate scores we can see that the BLEU of neural MT is higher, but its sentences are slightly shorter.
• From the word accuracy analysis we can see that phrase-based MT is better at low-frequency words.
• From the sentence bucket analysis we can see that neural seems to be better at translating shorter sentences.
• From the n-gram difference analysis we can see that there are a few words that neural MT is not good at but phrase based MT gets right (e.g. "phantom"), while there are a few long phrases that neural MT does better with (e.g. "going to show you").

If you run on your own data, you might be able to find more interesting things about your own systems. Try comparing your modified system with your baseline and seeing what you find!

## Other Options

There are many options that can be used to do different types of analysis. If you want to find all the different types of analysis supported, the most comprehensive way to do so is by taking a look at compare-mt, which is documented relatively well and should give examples. We do highlight a few particularly useful and common types of analysis below:

### Significance Tests

The script allows you to perform statistical significance tests for scores based on bootstrap resampling. You can set the number of samples manually. Here is an example using the example data:

compare-mt example/ted.ref.eng example/ted.sys1.eng example/ted.sys2.eng --compare_scores score_type=bleu,bootstrap=1000,prob_thresh=0.05

One important thing to note is that bootrap resampling as implemented in compare-mt only tests for variance due to data sampling, approximately answering the question if I ran the same system on a different, similarly sampled dataset, would I be likely to get the same result?''. It does not say anything about whether a system will perform better on another dataset in a different domain, and it does not control for training-time factors such as selection of the random seed, so it cannot say if another training run of the same model would yield the same result.

### Using Training Set Frequency

One useful piece of analysis is the "word accuracy by frequency" analysis. By default this frequency is the frequency in the test set, but arguably it is more informative to know accuracy by frequency in the training set as this demonstrates the models' robustness to words they haven't seen much, or at all, in the training data. To change the corpus used to calculate word frequency and use the training set (or some other set), you can set the freq_corpus_file option to the appropriate corpus.

compare-mt example/ted.ref.eng example/ted.sys1.eng example/ted.sys2.eng
--compare_word_accuracies bucket_type=freq,freq_corpus_file=example/ted.train.eng

In addition, because training sets may be very big, you can also calculate the counts on the file beforehand,

python scripts/count.py < example/ted.train.eng > example/ted.train.counts

and then use these counts directly to improve efficiency.

compare-mt example/ted.ref.eng example/ted.sys1.eng example/ted.sys2.eng
--compare_word_accuracies bucket_type=freq,freq_count_file=example/ted.train.counts

### Incorporating Word/Sentence Labels

If you're interested in performing aggregate analysis over labels for each word/sentence instead of the words/sentences themselves, it is possible to do so. As an example, we've included POS tags for each of the example outputs. You can use these in aggregate analysis, or n-gram-based analysis. The following gives an example:

compare-mt example/ted.ref.eng example/ted.sys1.eng example/ted.sys2.eng
--compare_word_accuracies bucket_type=label,ref_labels=example/ted.ref.eng.tag,out_labels="example/ted.sys1.eng.tag;example/ted.sys2.eng.tag",label_set=CC+DT+IN+JJ+NN+NNP+NNS+PRP+RB+TO+VB+VBP+VBZ
--compare_ngrams compare_type=match,ref_labels=example/ted.ref.eng.tag,out_labels="example/ted.sys1.eng.tag;example/ted.sys2.eng.tag"

This will calculate word accuracies and n-gram matches by POS bucket, and allows you to see things like the fact that the phrase-based MT system is better at translating content words such as nouns and verbs, while neural MT is doing better at translating function words.

We also give an example to perform aggregate analysis when multiple labels per word/sentence, where each group of labels is a string separated by '+'s, are allowed:

compare-mt example/multited.ref.jpn example/multited.sys1.jpn example/multited.sys2.jpn
--compare_word_accuracies bucket_type=multilabel,ref_labels=example/multited.ref.jpn.tag,out_labels="example/multited.sys1.jpn.tag;example/multited.sys2.jpn.tag",label_set=lexical+formality+pronouns+ellipsis

It also is possible to create labels that represent numberical values. For example, scripts/relativepositiontag.py calculates the relative position of words in the sentence, where 0 is the first word in the sentence, 0.5 is the word in the middle, and 1.0 is the word in the end. These numerical values can then be bucketed. Here is an example:

compare-mt example/ted.ref.eng example/ted.sys1.eng example/ted.sys2.eng
--compare_word_accuracies bucket_type=numlabel,ref_labels=example/ted.ref.eng.rptag,out_labels="example/ted.sys1.eng.rptag;example/ted.sys2.eng.rptag"

From this particular analysis we can discover that NMT does worse than PBMT at the end of the sentence, and of course other varieties of numerical labels could be used to measure different properties of words.

You can also perform analysis over labels for sentences. Here is an example:

compare-mt example/ted.ref.eng example/ted.sys1.eng example/ted.sys2.eng
--compare_sentence_buckets 'bucket_type=label,out_labels=example/ted.sys1.eng.senttag;example/ted.sys2.eng.senttag,label_set=0+10+20+30+40+50+60+70+80+90+100,statistic_type=score,score_measure=bleu'

### Analyzing Source Words

If you have a source corpus that is aligned to the target, you can also analyze accuracies according to features of the source language words, which would allow you to examine whether, for example, infrequent words on the source side are hard to output properly. Here is an example using the example data:

compare-mt example/ted.ref.eng example/ted.sys1.eng example/ted.sys2.eng --src_file example/ted.orig.slk --compare_src_word_accuracies ref_align_file=example/ted.ref.align

### Analyzing Word Likelihoods

If you wish to analyze the word log likelihoods by two systems on the target corpus, you can use the following

compare-ll --ref example/ll_test.txt --ll-files example/ll_test.sys1.likelihood example/ll_test.sys2.likelihood --compare-word-likelihoods bucket_type=freq,freq_corpus_file=example/ll_test.txt

You can analyze the word log likelihoods over labels for each word instead of the words themselves:

compare-ll --ref example/ll_test.txt --ll-files example/ll_test.sys1.likelihood example/ll_test.sys2.likelihood --compare-word-likelihoods bucket_type=label,label_corpus=example/ll_test.tag,label_set=CC+DT+IN+JJ+NN+NNP+NNS+PRP+RB+TO+VB+VBP+VBZ

NOTE: You can also use the above to also analyze the word likelihoods produced by two language models.

### Analyzing Other Language Generation Systems

You can also analyze other language generation systems using the script. Here is an example of comparing two text summarization systems.

compare-mt example/sum.ref.eng example/sum.sys1.eng example/sum.sys2.eng --compare_scores 'score_type=rouge1' 'score_type=rouge2' 'score_type=rougeL'

### Evaluating on COMET

It is possible to use the COMET as a metric. To do so, you need to install it first by running

pip install unbabel-comet

To then run, pass the source and select the appropriate score type. Here is an example.

compare-mt example/ted.ref.eng example/ted.sys1.eng example/ted.sys2.eng --src_file example/ted.orig.slk \
--compare_scores score_type=comet \
--compare_sentence_buckets bucket_type=score,score_measure=sentcomet

Note that COMET runs on top of XLM-R, so it's highly recommended you use a GPU with it.

## Citation/References

If you use compare-mt, we'd appreciate if you cite the paper about it!

@article{DBLP:journals/corr/abs-1903-07926,
author    = {Graham Neubig and Zi{-}Yi Dou and Junjie Hu and Paul Michel and Danish Pruthi and Xinyi Wang and John Wieting},
title     = {compare-mt: {A} Tool for Holistic Comparison of Language Generation Systems},
journal   = {CoRR},
volume    = {abs/1903.07926},
year      = {2019},
url       = {http://arxiv.org/abs/1903.07926},
}

There is an extensive literature review included in the paper above, but some key papers that it borrows ideas from are below:

There is also other good software for automatic comparison or error analysis of MT systems:

• MT-ComparEval: Very nice for visualization of individual examples, but not as focused on aggregate analysis as compare-mt. Also has more software dependencies and requires using a web browser, while compare-mt can be used as a command-line tool.

## Project details

Uploaded source
Uploaded py3


text:
Finding the initial day of the week (Calendars)

Number of Tuesdays in five consecutive calendar years taken together is exactly $260$. Which day of the week was $1st$ January of the first of these five years?

On the basis of given information the day will be either Wednesday or Thursday. How? I did not understand the solution of this question

A year has either $365$ or $366$ days, which is $\lfloor 365/7\rfloor = 52$ complete weeks ($364$ days) plus $1$ or $2$ extra days.
Over 5 years, then, we have $5\times 52=260$ complete weeks and $5,6,$ or $7$ extra days, depending on whether the period includes $0,1,$ or $2$ leap years.
Since we are given that the period only includes $260$ Tuesdays we cannot have $7$ extra days (a full week), so $5$ or $6$ extra days would mean that the first year would need to start on a Wednesday or Thursday to avoid including a Tuesday in those extra days.
Note that zero leap years in a $5$-year stretch is unusual to the point that no-one alive today has lived throughout such a period.


text:
# Thread: lengths of sides in a right angled triangle

1. ## lengths of sides in a right angled triangle

"A right angled triangle with hypotenuse of length 6 contains the angle π/4. What are the exact lengths of the remaining two sides?"

my working leads me no where, any suggestions? thanks, any help will be appreciated.

2. Originally Posted by [nuthing]
"A right angled triangle with hypotenuse of length 6 contains the angle π/4. What are the exact lengths of the remaining two sides?"
If a right triangle contains an angle of $\frac{\pi}{4}$ then it is isosceles. So solve this equation: $2s^2=36~.$

3. I'm sorry, I'll will learn the latex editor as soon as I'm done here ... frown.. although Plato is is beyond brillient I wondered if I could offer a different and heavier handed approach. I wondered if your teacher wants you to resolve this with sin and cos functions.. if that is where you are in your book. If this is the case:

hypotenuse = 6
angle = pi/4 is a 45 degree angle
side adjacent is the leg on the x axis
side opposite is the leg perpendicular to the x axis

soooo, to get the side adjacent you use: cos (pi/4) = side adjacent / hypontenuse (this is the identity for a cosine)
rearrange here to get hypotenuse * cos (pi/4) = side adjacent
cos (pi/4) is sqrt(2)/2 and hyp = 6 So: 6*sqrt(2)/2=3*sqrt(2)

for the side opposite same deal, but you use the formula for sin: sin (pi/4)= side opposite / hyp (this is the identity for a sine)
giving: hyp * sin(pi/4)=side opposite
Now sin (pi/4) also equals sqrt(2)/2
so you will get the same answer: 6*sqrt(2)/2=3*sqrt(2)

they ask for exact lengths so you would leave the answers in the square root form.
in the end both legs then are 3*sqrt(2)

once again sorry for not using the editor.


text:
As an exercise I recently wrote an HTML5 game using Easel.js, which is a relatively cool javascript library that helps when working with canvas objects. Although I did find the easel documents a little confusing to begin with, it only took a handful of hours before I had a working Connect Four game!

For those with a short attention span, you can find out what Connect Four is, view the source code, or play the game

The easel.js code is actually a lot simpler than it looks. Basically a spritesheet is used for the graphics and BitmapAnimation objects are used to show the particular image on screen. The animations are set to single frames without repeating.

A Timer is used to call stage.update() at about 60 frames per second, and then some mouse event handlers are added for:

1. Hovering over the top of a row
2. Clicking on the top of a row to place a disc

Finally a function had to be written to determine if there was a winner when a disc was placed. This was done with some basic recursion - have a look at the checkForWinner() function in the source code .


text:
# README.md In DiagrammeR: Graph/Network Visualization

With the DiagrammeR package you can create, modify, analyze, and visualize network graph diagrams. The output can be incorporated into RMarkdown documents, integrated with Shiny web apps, converted to other graph formats, or exported as PNG, PDF, or SVG files.

It's possible to make the above graph diagram using a combination of DiagrammeR functions strung together with the magrittr %>% pipe:

library(DiagrammeR)

create_random_graph(
n = 140, m = 100,
directed = FALSE,
set_seed = 23) %>%
join_node_attrs(
df = get_s_connected_cmpts(.)) %>%
join_node_attrs(
df = get_degree_total(.)) %>%
colorize_node_attrs(
node_attr_from = sc_component,
node_attr_to = fillcolor,
alpha = 80) %>%
rescale_node_attrs(
node_attr_from = total_degree,
to_lower_bound = 0.2,
to_upper_bound = 1.5,
node_attr_to = height) %>%
select_nodes_by_id(
nodes = get_articulation_points(.)) %>%
set_node_attrs_ws(
node_attr = peripheries,
value = 2) %>%
set_node_attrs_ws(
node_attr = penwidth,
value = 3) %>%
clear_selection() %>%
set_node_attr_to_display(
attr = NULL) %>%
render_graph()

DiagrammeR's graph functions allow you to create graph objects, modify those graphs, get information from the graphs, create a series of graphs, and do many other useful things.

This functionality makes it possible to generate a network graph with data available in tabular datasets. Two specialized data frames contain node data and attributes (node data frames) and edges with associated edge attributes (edge data frames). Because the attributes are always kept alongside the node and edge definitions (within the graph object itself), we can easily work with them and specify styling attributes to differentiate nodes and edges by size, color, shape, opacity, length, and more.

## A Network Graph Example

Let's create a property graph that pertains to contributors to three software projects. This graph has nodes representing people and projects. The attributes name, age, join_date, email, follower_count, following_count, and starred_count are specific to the person nodes while the project, start_date, stars, and language attributes apply to the project nodes. The edges represent the relationships between the people and the project.

The example graph file repository.dgr is available in the extdata/example_graphs_dgr/ directory in the DiagrammeR package (currently, only for the Github version). We can load it into memory by using the open_graph() function, with system.file() to provide the location of the file within the package.

library(DiagrammeR)

# Load in a the small repository graph
graph <-
open_graph(
system.file(
"extdata/example_graphs_dgr/repository.dgr",
package = "DiagrammeR"))

We can always view the property graph with the render_graph() function.

render_graph(graph, layout = "kk")

Now that the graph is set up, you can create queries with magrittr pipelines to get specific answers from the graph.

Get the average age of all the contributors. Select all nodes of type person (not project). Each node of that type has non-NA age attribute, so, get that attribute as a vector with get_node_attrs_ws() and then calculate the mean with R's mean() function.

graph %>%
select_nodes(
conditions = type == "person") %>%
get_node_attrs_ws(
node_attr = age) %>%
mean()
#> [1] 33.6

We can get the total number of commits to all projects. We know that all edges contain the numerical commits attribute, so, select all edges (select_edges() by itself selects all edges in the graph). After that, get a numeric vector of commits values and then get its sum() (all commits to all projects).

graph %>%
select_edges() %>%
get_edge_attrs_ws(
edge_attr = commits) %>%
sum()
#> [1] 5182

Single out the one known as Josh and get his total number of commits as a maintainer and as a contributor. Start by selecting the Josh node with select_nodes(conditions = name == "Josh"). In this graph, we know that all people have an edge to a project and that edge can be of the relationship (rel) type of contributor or maintainer. We can migrate our selection from nodes to outbound edges with trav_out_edges() (and we won't provide a condition, just all the outgoing edges from Josh will be selected). Now we have a selection of 2 edges. Get that vector of commits values with get_edge_attrs_ws() and then calculate the sum(). This is the total number of commits.

graph %>%
select_nodes(
conditions = name == "Josh") %>%
trav_out_edge() %>%
get_edge_attrs_ws(
edge_attr = commits) %>%
sum()
#> [1] 227

Get the total number of commits from Louisa, just from the maintainer role though. In this case we'll supply a condition in trav_out_edge(). This acts as a filter for the traversal and this means that the selection will be applied to only those edges where the condition is met. Although there is only a single value, we'll still use sum() after get_edge_attrs_ws() (a good practice because we may not know the vector length, especially in big graphs).

graph %>%
select_nodes(
conditions = name == "Louisa") %>%
trav_out_edge(
conditions = rel == "maintainer") %>%
get_edge_attrs_ws(
edge_attr = commits) %>%
sum()
#> [1] 236

How do we do something more complex, like, get the names of people in graph above age 32? First, select all person nodes with select_nodes(conditions = type == "person"). Then, follow up with another select_nodes() call specifying age > 32. Importantly, have set_op = "intersect" (giving us the intersection of both selections).

Now that we have the starting selection of nodes we want, we need to get all values of these nodes' name attribute as a character vector. We do this with the get_node_attrs_ws() function. After getting that vector, sort the names alphabetically with the R function sort(). Because we get a named vector, we can use unname() to not show us the names of each vector component.

graph %>%
select_nodes(
conditions = type == "person") %>%
select_nodes(
conditions = age > 32,
set_op = "intersect") %>%
get_node_attrs_ws(
node_attr = name) %>%
sort() %>%
unname()
#> [1] "Jack"   "Jon"    "Kim"    "Roger"  "Sheryl"

That supercalc project is progressing quite nicely. Let's get the total number of commits from all people to that most interesting project. Start by selecting that project's node and work backwards. Traverse to the edges leading to it with trav_in_edge(). Those edges are from committers and they all contain the commits attribute with numerical values. Get a vector of commits and then get the sum (there are 1676 commits).

graph %>%
select_nodes(
conditions = project == "supercalc") %>%
trav_in_edge() %>%
get_edge_attrs_ws(
edge_attr = commits) %>%
sum()
#> [1] 1676

Kim is now a contributor to the stringbuildeR project and has made 15 new commits to that project. We can modify the graph to reflect this.

First, add an edge with add_edge(). Note that add_edge() usually relies on node IDs in from and to when creating the new edge. This is almost always inconvenient so we can instead use node labels (we know they are unique in this graph) to compose the edge, setting use_labels = TRUE.

The rel value in add_edge() was set to contributor -- in a property graph we always have values set for all node type and edge rel attributes. We will set another attribute for this edge (commits) by first selecting the edge (it was the last edge made, so we can use select_last_edges_created()), then, use set_edge_attrs_ws() and provide the attribute/value pair. Finally, clear the active selections with clear_selection(). The graph is now changed, have a look.

graph <-
graph %>%
from = "Kim",
to = "stringbuildeR",
rel = "contributor") %>%
select_last_edges_created() %>%
set_edge_attrs_ws(
edge_attr = commits,
value = 15) %>%
clear_selection()

render_graph(graph, layout = "kk")

Get all email addresses for contributors (but not maintainers) of the randomizer and supercalc88 projects. With trav_in_edge() we just want the contributer edges/commits. Once on those edges, hop back unconditionally to the people from which the edges originate with trav_out_node(). Get the email values from those selected individuals as a sorted character vector.

graph %>%
select_nodes(
conditions =
project == "randomizer" |
project == "supercalc") %>%
trav_in_edge(
conditions = rel == "contributor") %>%
trav_out_node() %>%
get_node_attrs_ws(
node_attr = email) %>%
sort() %>%
unname()
#> [1] "[email protected]"      "[email protected]"
#> [3] "[email protected]"      "[email protected]-fun.com"
#> [5] "[email protected]" "[email protected]-q-w-o.net"
#> [7] "[email protected]"

Which people have committed to more than one project? This is a matter of node degree. We know that people have edges outward and projects and edges inward. Thus, anybody having an outdegree (number of edges outward) greater than 1 has committed to more than one project. Globally, select nodes with that condition using select_nodes_by_degree("outdeg > 1"). Once getting the name attribute values from that node selection, we can provide a sorted character vector of names.

graph %>%
select_nodes_by_degree(
expressions = "outdeg > 1") %>%
get_node_attrs_ws(
node_attr = name) %>%
sort() %>%
unname()
#> [1] "Josh"   "Kim"    "Louisa"

## Installation

DiagrammeR is used in an R environment. If you don't have an R installation, it can be obtained from the Comprehensive R Archive Network (CRAN).

You can install the development version of DiagrammeR from GitHub using the devtools package.

devtools::install_github("rich-iannone/DiagrammeR")

Or, get it from CRAN.

install.packages("DiagrammeR")

If you encounter a bug, have usage questions, or want to share ideas to make this package better, feel free to file an issue.

## Code of Conduct

Contributor Code of Conduct. By participating in this project you agree to abide by its terms.


text:
### Atoms and Bonds 2 - ML for Predicting Quantum Mechanical Properties of Organic Molecules

Posted October 8, 2021 by Gowri Shankar ‐ 10 min read

It is enthralling to see machine learning algorithms solve core science problems, It enables us to revisit favorite subjects after years and for few even decades. Like any other field, ML had a humble beginning by detecting cats, dogs, and their respective mothers-in-law. Drug discovery is a prolonged and pricey process, Pharmaceutical firms research with two kinds of molecules to increase the efficacy of the drug in its entirety. One is the source molecule(the drug), the other is the target molecule where the drug has to act upon, also the target molecules have their peripheral molecules to act upon. The quest is to predict the biochemical activity(atomization) between the compounds quantitatively and qualitatively for the cure with no side effects. Machine learning algorithms help in the process of investigating a huge library of chemical compounds and test their biochemical impact on the target molecules.

This is our $4^{th}$ post on Graph Neural Networks and $2^{nd}$ on Message Passing Neural Networks(MPNN), In our earlier post we studied the SMILES representation of the molecular structure and a scheme for converting the molecular structures to graph representations. Further, we created tensors representing the atomic properties, bond properties, and pairing information. In this post, we shall understand the problem statement, quantum chemical properties of the molecules, and the MPNN algorithm to their finer detail. Previous posts can be referred to here.

This post is a walkthrough of Gilmer, Dahl et al’s seminal paper Neural Message Passing for Quantum Chemistry. In my earlier post, I have covered the mathematical foundation of MPNN. This post covers few critical sections of their scholarly work in an unscholarly manner.

### Objective

The key objective of this post is to understand the complexity involved in understanding molecular dynamics of chemical compounds, their properties in detail and study deep learning-based schemes for predicting quantum properties of them. In that process, we shall learn the following,

• Density functional theory (DFT)
• QM9 Dataset
• Quantum chemical properties of molecules
• Input representation of quantum chemical properties
• Message passing neural network design
• Message functions
• Edge Networks
• Pair Messages

## Introduction

In computational chemistry(and physics), properties of electron structures of a certain class of atoms and molecules are modeled using Density Functional Theory(DFT). DFT scheme is a quantum mechanical modeling method, first appeared during the early 70s and constantly evolved/refined through the years. They are state-of-the-art, one of kind modeling techniques that model the exchange and correlation interaction of the atoms and molecules and their energy states.

DFT computational codes are used in practise to investigate the structural, magnatic and electronic properties of molecules, materials and defects.

- James Coomer

The DFT scheme is a compute-intensive one due to the involvement of large-scale quantum mechanical calculations that result in the generation of data at a very high rate. The dataset(QM9, publicly available) we use has 134k molecules with 17 properties for each molecule. These features are approximated via 17 regression tasks. The 17 features cover the geometric, energetic, electronic, and thermodynamic properties of the molecules. The efficacy of the models are evaluated against 2 parameters,

1. DFT Error: The estimated average error of the DFT approximation to nature
2. Chemical Accuracy: Target error that has been established by the chemistry community, measured in $eV$.

The objective is to achieve chemical accuracy and DFT error for all 13 target properties that determine the magnetic interaction between two atoms in a molecule.

### Quantum Machine 9(QM9)

Quantum machine 9 datasets consist of the following chemical compounds

• Hydrogen
• Carbon(C)
• Oxygen(O)
• Nitrogen(N)
• Fluorine(F) and
• 9 Heavy Non-Hydrogen Atoms

Each molecule has the following properties,

• tag: gdb9; string constant to ease extraction via grep
• index: Consecutive, 1-based integer identifier of molecule
• A (GHz): Rotational constant A
• B (GHz): Rotational constant B
• C (GHz): Rotational constant C
• mu (Debye): Dipole moment
• $\alpha$ (Bohr^3): Isotropic polarizability
• homo (Hartree): Energy of Highest occupied molecular orbital (HOMO)
• lumo (Hartree): Energy of Lowest occupied molecular orbital (LUMO)
• gap (Hartree): Gap, the difference between LUMO and HOMO
• $r^2$ (Bohr^2): Electronic spatial extent
• **$zp_{ve}$** (Hartree): Zero-point vibrational energy
• $U_0$ (Hartree): Internal energy at 0 K
• U (Hartree): Internal energy at 298.15 K
• H (Hartree): Enthalpy at 298.15 K
• G (Hartree): Free energy at 298.15 K
• $C_v$ (cal/(mol K)): Heat capacity at 298.15 K

### Quantum Properties Elaborated

The properties discussed above can be grouped into 4 categories as follows,

• By the measure of the energy required to break the molecule
• By the vibrations of the molecule
• By the state of the electrons in the molecule
• By the spatial distribution of electrons in the molecule

#### Measure of Energy

The energy required to break a molecule at various pressure and the temperature level is critical for any reaction. There are 4 properties

• $U_0$ ($eV$, Hartree): Atomization energy at 0 K, Atomization energy is the energy required to break up the molecule into all of its constituents.
• U ($eV$, Hartree): Atomization Energy at room temperature 298.15 K
• H ($eV$, Hartree): Enthalpy atomization at room temperature 298.15 K, Enthalpy means the constituents are held at a fixed pressure
• G ($eV$, Hartree): Free energy of atomization at 298.15 K, Free energy means the energy required for atomization when the temperature and pressure are fixed.

#### Vibration of Molecule

The fundamental vibrations of the molecule,

• $\omega_1$ ($cm^{-1}$): The highest fundamental vibrational frequency, at this frequency the molecule naturally oscillates.
• **$zp_{ve}$** ($eV$): Zero-point vibrational energy. When the temperature is zero, quantum mechanical uncertainty implies that atoms vibrate.

#### State of the Electrons

Following are the properties that denote the state of the electrons in the molecule,

• **$\epsilon_{HOMO}$** ($eV$): Energy of the highest occupied molecular orbital(HOMO). According to Pauli’s exclusion principle, no 2 electrons may occupy the same state and Quantum mechanics states that the allowed state that electrons can occupy in a molecule are discrete. Hence, electrons stack in states from lowest to highest energy levels.
• **$\epsilon_{LUMO}$** ($eV$): Energy of the lowest unoccupied molecular orbital(LUMO)
• **$\Delta_{\epsilon}$** ($eV$): The electron energy gap $\epsilon_{HOMO} - \epsilon_{LUMO}$. It is the lowest energy transition that can occur when an electron is excited from an occupied state to an unoccupied state. It also dictates the longest wavelength of light that the molecule can absorb.

#### Spatial Distribution of the Electrons

3 Measures of spatial distributions of electrons in the molecule,

• $R^2, (Bohr^2)$: Electronic spatial extent. It is the second moment of the charge distribution, $\rho(r)$ $$R^2 = \int drr^2 \rho(r)$$
• $\mu (Debye)$: The norm of the dipole moment. It approximates the electric field far from a molecule.

The norm of the dipole moment is related to how anisotropically
the charge is distributed (and hence the strength of the
field far from the molecule). This degree of anisotropy
is in turn related to a number of material properties
(for example hydrogen bonding in water causes the
dipole moment to be large which has a large effect on
dynamics and surface tension).

- Gilmer, Dahl et al

• $\alpha$, Bohr^3: The norm of static polarizability. It measures the extent to which a molecule can spontaneously incur a dipole moment in response to an external field. It turns to a degree to which Van der Waals interactions play a role in the dynamics of the medium.

## MPNN

Conventional Deep Learning architectures pre-process the input into a tabular or sequence format before feeding it into the network. This process is inefficient and loses information when it comes to graph data, i.e adjacency sparse matrix of graph information far from the actual representation.

GNNs are a combination of an information diffusion mechanism and neural networks,
representing a set of transition functions and a set of output functions. The
information diffusion mechanism is defined by nodes updating their states and
exchanging information by passing “messages” to their neighboring nodes until they
reach a stable equilibrium.

Introduction from the previous post, refer here

The molecules of materials can be represented as Graph structures where atoms are the vertices and bonds are the edges. A MPNN architecture takes an undirected graph with node features $x_v$ and bond feature $e_{vw}$ as input. With these features as input, MPNN operates at 2 phases

• Message Passing Phase and

In the message-passing phase, information is propagated across the graph to build the neural representation of the graph, and the readout phase is when the predictions are made. Wrt molecular graphs, the goal is to predict the quantum molecular properties based on the topology of the molecular graph.

For each vertex $v$, there is an associated hidden state and their messages at every time step $t$. $$\Large m_v^{t+1} = \sum_{w \in N(v)} M_t(h_v^t, h_w^t, e_{vw}) \tag{1. Messages associated to the vertex }$$ $$\Large h_v^{t+1} = U_t(h_v^t, m_v^{t+1}) \tag{2. Hidden state for the vertex}$$

Where,

• $e_{vw}$ is the edge feature
• $M_t$ is message functions
• $U_t$ is vertex update functions
• $N(v)$ us the neighbors of $v$ in the graph

In the readout phase, a readout function is applied to the final hidden states $h_v^T$ to makes the predictions, $$\Large \hat y = R({h_v^T|v \in G}) \tag{3. Predicted Quantum Properties}$$

Where $G$ is the molecular graph.

It would be possible to learn edge features using an MPNN by introducing hidden states for all edges in the graph $h_{e_{vw}}^t$ and updating them as was done with equations 1 and 2.

### Message Functions

MPNN implementation operates on directed graphs where the edge becomes both incoming and outgoing edge with the same label. The core of MPNN architecture is to figure outright

• Message functions,
• Output functions and
• Appropriate input representation

Since we consider it as a directed graph, we have separate message channels for incoming and outgoing edges in which incoming message is the concatenation of outgoing and incoming.

Input representation

• $x_v$: Set of feature vectors for the nodes of graph $G$.
• $A$: An adjacency matrix with vectors indicating different bonds in the molecule and pairwise spatial distance between atoms.

Message Functions

• Message function assumes discrete edge labels of size $k$
• A GRU layer is used for weight tying at each time step $t$, Refer Alexander Kensert’s class MessagePassing here

$$\Large m_{wv} = f(h_w^t, h_v^t, e_{vw}) \tag{4. Pair Message}$$ Where,

• $m_{wv}$ is the message from node $w$ to $v$

### Compute Complexity

A Single step of the message passing phase for a dense graph requires $O(n^2d^2)$ floating point multiplications lead to computationally expensive. Where $n$ is the number of nodes and $d$ is the dimension of the internal hidden representation. $d \rightarrow \ node \ embeddings$ further optimized to $O(n^2\frac{d^2}{k})$, where k temporary embeddings of each node are then mixed together as follows $$\left(h_v^{t, 1}, h_v^{t, 2}, \cdots, h_v^{t, k}\right) = g \left(\tilde h_v^{t, 1}, \tilde h_v^{t, 2}, \cdots, \tilde h_v^{t, k}\right) \tag{5. Mixture of Temporary Embeddings}$$

• $g \rightarrow$ a neural network shared across all nodes in the graphs

This mixing preserves the invariance to permutations of the nodes,
while allowing the different copies of the graph to communicate with
each other during the propagation phase. This can be advantageous
in that it allows larger hidden states for the same number of
parameters, which yields a computational speedup in practice.

- Gilmer, Dahl et al

### Evaluation Metric (MAE)

The efficacy of the model is measured using the ratio of mean absolute error (MAE) with the provided estimate of chemical accuracy for that target. MAE of the model is calculated as follows $$\Large MAE = (Error Ratio) \times (Chemical Accuracy) \tag{6. Evaluation Metric}$$

## Conclusion

In this post, we revisited the concepts of chemical compounds that we have studied during our school days. It is refreshing and nostalgic when we look at something we possess but have forgotten for years. Further, we are evolving from object detection and named entity recognition to complex problems of nature. GNN for drug discovery is a significant breakthrough among the deep learning fraternity, this research work inspires us to see everything as nodes and edges. However, compute the complexity of MPNN comes as a hurdle for exploring further. We are still in the nascent stage of graph-based deep learning algorithms and the bests are yet to come.

I thank Alexandar Kensert for implementing and publishing MPNN using Tensorflow, It simplified the understanding process and inspired me to write this post. Without his work, It would have been quite challenging to realize the class MessagePassing and the class PartitionPadding modules of MPNN architecture.
I believe I will be writing one more post on GNNs as a conclusion note, until then adios amigos!

### References


text:
# First General

The simplest generalization of

x = \sqrt{2 + \sqrt{2 + \sqrt{2 + ...}}}

is

x = \sqrt{a + \sqrt{a + \sqrt{a + ...}}},

for some a \gt 0.

Since the sequence

\sqrt{a}, \sqrt{a + \sqrt{a}}, \sqrt{a + \sqrt{a + \sqrt{a}}}, ...

is obviously monotone increasing, we only need to prove its boundedness to be in a position to apply Monotone Convergence Theorem.


text:
# Difference between class_weight and loss_weights in Keras

Keras has parameters class_weight used in fit() function and loss_weights used in compile() function. From the explanation(Docs) and what I understand, it seems that both are identical, as they are used to indicate the importance of each class. However, what is the difference between the two? And what are the scenarios in which they can be appropriately used?


text:
# Schur Decomposition (G Dataflow)

Version:
Last Modified: January 12, 2018

Performs the Schur decomposition of a square matrix.

## matrix A

A square real matrix.

This input accepts a 2D array of double-precision, floating point numbers or 2D array of complex double-precision, floating point numbers.

## compute Schur vectors?

A Boolean that determines whether this node calculates the orthogonal matrix.

 True Calculates the orthogonal matrix and the block upper triangular matrix in real Schur form. False Calculates only the block upper triangular matrix in real Schur form.

Default: False

## order

Method to order the eigenvalues and the corresponding triangular matrix in real Schur form and the orthogonal matrix.

Name Value Description
No Reorder 0 Does not change the order of the eigenvalues.
Real Ascending 1 Lists the eigenvalues in ascending order according to their real parts.
Real Descending 2 Lists the eigenvalues in descending order according to their real parts.
Magnitude Ascending 3 Lists the eigenvalues in ascending order according to their magnitudes.
Magnitude Descending 4 Lists the eigenvalues in descending order according to their magnitudes.

Default: No Reorder

## error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

## Schur form

The block upper triangular matrix in real Schur form.

## Schur vectors

The orthogonal matrix.

## eigenvalues

A complex vector that contains all the computed eigenvalues of the input matrix.

## error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

## Algorithm for Calculating Schur Decomposition

The following expression defines the Schur decomposition of a square n × n matrix A.

A = QSQH

where S is in Schur form and QH is the conjugate transpose of matrix Q.

For a real matrix A, Q is an n × n orthogonal matrix. S is a block upper triangular matrix in real Schur form, whose elements on the main diagonal are all 1 × 1 or 2 × 2 blocks, as shown in the following matrix.

$S=\left[\begin{array}{cccc}{S}_{11}& {S}_{12}& \dots & {S}_{1m}\\ 0& {S}_{22}& \ddots & {S}_{2m}\\ ⋮& \ddots & \ddots & ⋮\\ 0& 0& \dots & {S}_{mm}\end{array}\right]$

where Sii are square blocks of dimension 1 or 2 and i = 1, 2, ..., m.

For a complex matrix A, Q is an n × n unitary matrix. S is an upper triangular matrix in complex Schur form.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application


text:
# How do you find all the zeros of f(x) = 9x^2 + 6x - 8?

Aug 5, 2016

The zeros of $f \left(x\right)$ are $x = \frac{2}{3}$ and $x = - \frac{4}{3}$

#### Explanation:

$f \left(x\right) = 9 {x}^{2} + 6 x - 8$

Use an AC method to factor $f \left(x\right)$:

Find a pair of factors of $A C = 9 \cdot 8 = 72$ with difference $B = 6$.

The pair $12 , 6$ works.

Use this pair to split the middle term and factor by grouping:

$9 {x}^{2} + 6 x - 8$

$= 9 {x}^{2} + 12 x - 6 x - 8$

$= \left(9 {x}^{2} + 12 x\right) - \left(6 x + 8\right)$

$= 3 x \left(3 x + 4\right) - 2 \left(3 x + 4\right)$

$= \left(3 x - 2\right) \left(3 x + 4\right)$

Hence the zeros of $f \left(x\right)$ are $x = \frac{2}{3}$ and $x = - \frac{4}{3}$


text:
Veronika8Russian
10

# if the equation is h= -2x^2 + 12x -10how do I find the max height?

One other way to solve this question is finding the derivative $h=-2x^2+12x-10$ $h'=-4x+12$ now we have to find when this function will be zero $-4x+12=0$ $\boxed{\boxed{x=3}}$ now we just replace this value at our initial function $h=-2x^2+12x-10$ $h_{max}=-2*(3)^2+12*3-10$ $h_{max}=-18+36-10$ $\boxed{\boxed{h_{max}=8}}$
The maximum height is the ordinate value of the vertex of the parabola, ie: yV Calculating yV: $y_V=\frac{-\Delta}{4a}\\ \\ y_V=-[\frac{12^2-4*(-2)*(-10)]}{4*(-2)}=\frac{-(144-80)}{-8}=\frac{-64}{-8}=8$


text:
# How to get mouse position relative to the map?

I'm creating a game in XNA similar to Minecraft - Minecraft 2D

It looks like this

Here's how it works:

• All blocks are generated once with fixed x,y coordinates and just re-drawn.

    //generate world
for (int i = 0; i < 25; i++)
{
blocks.Add(new Block("top", i * 32, 32 * 7, Color.White));
for (int j = 8; j < 20; j++)
{
blocks.Add(new Block("dirt", i * 32, 32 * j, Color.White));
}
}

• When user clicks on a block, I just browse through all blocks and check whether block exists.

if ((mouseCoordinate.X - (mouseCoordinate.X % 32)) == block.x && (mouseCoordinate.Y - (mouseCoordinate.Y % 32)) == block.y) {
//destroy block
}

• Currently, without any camera movements, everything works. When I move my camera just about 32px to the right, for example, it's all broken. I can't do previous step anymore.

• What I need: I need to get mouse position relative to the map, not to the game window. How can I get mouse position relative to the map? Basically, I want mouse position 0,0 on the point I have circled here

How do I calculate it?

EDIT: here's my camera class (yes, Matrix)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System.Reflection;
namespace MojePrvniHra
{
public class Camera2d
{
protected float _zoom; // Camera Zoom
public Matrix _transform; // Matrix Transform
public Vector2 _pos; // Camera Position
protected float _rotation; // Camera Rotation

public Camera2d()
{
_zoom = 1.0f;
_rotation = 0.0f;
_pos = Vector2.Zero;
}// Sets and gets zoom
public float Zoom
{
get { return _zoom; }
set { _zoom = value; if (_zoom < 0.1f) _zoom = 0.1f; } // Negative zoom will flip image
}

public float Rotation
{
get { return _rotation; }
set { _rotation = value; }
}

// Auxiliary function to move the camera
public void Move(Vector2 amount)
{
_pos += amount;
}
// Get set position
public Vector2 Pos
{
get { return _pos; }
set { _pos = value; }
}

public Matrix get_transformation(GraphicsDevice graphicsDevice)
{
_transform =
Matrix.CreateTranslation(new Vector3(-_pos.X, -_pos.Y, 0)) *
Matrix.CreateRotationZ(_rotation) *
Matrix.CreateScale(new Vector3(Zoom, Zoom, 1)) *
Matrix.CreateTranslation(new Vector3(graphicsDevice.Viewport.Width * 0.5f, graphicsDevice.Viewport.Height * 0.5f, 0));
return _transform;
}

}
}

and here's how I start my spriteBatch

       spriteBatch.Begin(SpriteSortMode.BackToFront,
BlendState.AlphaBlend,
null,
null,
null,
null,
cam.get_transformation(graphics.GraphicsDevice));

• Answered your question below, but noticed something strange on another part of your question: "When user clicks on a block, I just browse through all blocks and check whether block exists". You iterate through all of the blocks just to find which one the user clicked? If that's the case, that's completely unnecessary. Just take the world position, divide it by the block size, and finally round the result down (Math.Floor) on each component. That will give you the clicked block directly. – David Gouveia Dec 31 '11 at 1:59
• @DavidGouveia: yes, I currently do. foreach(Block b in blocks) { //if statement posted }. I'm not sure, how do I get "World position". I bet it's something trivial, but I'm unsure I know what it currently is. Do you mean mouse position on world? – Martin. Dec 31 '11 at 11:01
• Yes I meant the mouse position in the world, i.e. the very same value this question was all about. – David Gouveia Dec 31 '11 at 11:46
• I explained that in my other comment... For instance, on the X axis it would be: int blockX = (int)(mouseWorld.X / tileWidth) and in the Y axis it would be: int blockY = (int)(mouseWorld.Y / tileHeight). – David Gouveia Dec 31 '11 at 11:51
• Well, then you really should. It's the only way you can efficiently index individual tiles from the map. Will also help up a lot with collision detection. – David Gouveia Dec 31 '11 at 12:01

Solution

Is your camera simulated using a view matrix? If so, all you need to do is:

Vector2 worldPosition = Vector2.Transform(mousePosition, Matrix.Invert(viewMatrix));

And if you're not using a view matrix... you should :-)

Explanation

The view matrix transforms coordinates from world space into view space. The inverse of this matrix does the opposite - it transforms coordinates from view space back into world space.

Since your mouse coordinates are defined in view space, all you need to do is transform them with the inverse view matrix to convert them into world space.

• Wow I didn't realize that Vector2 had a Transform method. That makes things much easier. – ClassicThunder Dec 31 '11 at 2:05
• Thank you a lot for this solution! I might take a look at this solution when I'm more better in XNA. For now, I'm not able to modify the Matrix (camera) class to fit needs of this transform. And sorry for not accepting you – Martin. Dec 31 '11 at 11:18
• How are you implementing your camera then? – David Gouveia Dec 31 '11 at 11:48
• @DavidGouveia: Matrix.CreateTranslation passing to the last parameter of spritebatch.Begin() (see my question, I have edited it before some time and described how I implement the camera) – Martin. Dec 31 '11 at 11:51
• Looked at your camera. You don't need to modify anything, it already fits the needs... Use this: Vector2 worldPosition = Vector2.Transform(mousePosition, Matrix.Invert(camera.get_transformation(GraphicsDevice)));. That single line will work no matter how much you move, rotate or zoom the camera. – David Gouveia Dec 31 '11 at 12:03

The concept here is unprojecting a mouse coordinate to eye-space. When dealing with graphics, there are several different coordinate systems used to represent objects. I'll explain all of them, but the way you have set your rendering up cancels the need for the coordinate spaces:

• Everything is generally defined by vertices relative to (0, 0). This is called local space.
• If you want to position an object in the world, you need to convert local space to world space. You do this with what is called a model matrix, which allows for movement, rotation, and scaling of the object. The way you've set up your rendering does this, or a simple version of this by just providing the X and Y location of the Block in the world.
• If you want to move around the world, you need to convert world space to eye space. This is done with a view matrix. You can move, rotate, and scale the camera in any way you want. In your case, you're either using a view matrix or just storing the location of the camera and offsetting everything by that position.
• DirectX uses a default coordinate system of -1 to 1 on the X and Y axes (0 to 1 on the Z, but that's not important). Everything that is rendered must exist within that range, and to convert to that coordinate system, you need one last transformation - the projection matrix. In this case, you've set up your projection matrix to convert pixel coordinates to the default coordinate system. In this case the projection matrix doesn't make a difference when unprojecting, as it'll just give you the same mouse coordinate back.

On to the actual solution, you've removed the need for the model and projection matrices, so you can set up a view matrix from your camera position if you don't already have one. From there you're just using Vector2.Transform as suggested by the previous answer.

If you want the most direct solution that you can implement very quickly and without matrices, you can just offset your mouse coordinates by the camera position before aligning it to the nearest block like this:

Vector2 cameraPos = /*The position of your camera*/;
Vector2 clickCoord = mouseCoordinate + cameraPos;
if ((clickCoord.X - (clickCoord.X % 32)) == block.x && (clickCoord.Y - (clickCoord.Y % 32)) == block.y) {
//destroy block
}

• Using the view matrix directly, it's still just one line of code, and has the definite advantage that it will still work even if he decides to add zoom and rotation to his camera. Or if the camera has an origin different than zero, you'd also need to take that into account, while with the matrix it's all automatic. So I wouldn't look any other way. – David Gouveia Dec 31 '11 at 2:36
• Yeah, that's why I suggested your solution first. It's what I do in all my projects, and it's what I would recommend, but at the same time I wanted to show a very direct solution that solves the issue and nothing more. – Robert Rouhani Dec 31 '11 at 2:41
• You're right. In fact, before I got used to working with transformations, I also did most things this way, but faced the consequences later on... Once zooming gets mixed in, you can still sort of figure it out with a few multiplications. But once you start needing rotation, it becomes a trigonometry mess. Add a variable origin and parallax on top of that and you can imagine what that simple expression would turn into. :-) That's the real beauty of matrices, how they can encapsulate all of this complexity in a single black box that "just works". – David Gouveia Dec 31 '11 at 2:48
• Currently I'm using Matrix.CreateTranslation for moving camera. Currently, without changing anything but just adding your solution, this happens (first point = second (bad) point): i.lulzimg.com/48f9fac1e3.png – Martin. Dec 31 '11 at 10:56
• I think the issue right now is that your camera's origin is at the center of the screen instead of the top left I assumed it would be (Center makes more sense anyways). All you have to do is adjust the clickCoord to be centered: Vector2 clickCoord = mouseCoordinate - halfWindowSize + cameraPos; I'm not too familiar with XNA, so I'll let you figure out how to get the window size. – Robert Rouhani Dec 31 '11 at 11:05


text:
Synopsis

# Quantum walking the line

Physics 2, s91
A trapped ion reveals the difference between a quantum particle executing a random walk and its classical version.

Models of particles randomly moving through some defined space have been invaluable in studying everything from polymer diffusion to the ups and downs of the stock market. Classically, the simplest random walk is given by a walker (or particle that hops from one site to another) who takes one step either to the right or the left, depending on whether a tossed coin reads heads or tails. In a quantum mechanical setting, the particle can be at more than one site simultaneously. Like Grover’s algorithm for quantum database search, this feature leads to a speedup (here in diffusion) over its classical counterpart.

A quantum walk in a trapped ion system was proposed seven years ago. Now, Hector Schmitz and colleagues at the Max-Planck Institute in Garching, Germany, implement the experiment for a three-step quantum walk. The walker is a single trapped $25Mg+$ ion in a linear Paul trap. The coin states, which correspond to heads or tails, are two internal (hyperfine) states of the ion. The position of the walker is represented by a phase-space coherent state. The ion is initially prepared in a state of tails and the motional ground state. A radio-frequency pulse acts as the coin flipper, coupling the ion’s internal states, while laser pulses cause the walker to hop by displacing the coherent state. Because the hopping is conditioned on the result of the coin flip, a superposition of entangled coin and position states is created.

The sequence of coin flipping and hopping is done three times and then the state is read out. Three steps are sufficient to observe the differences between the quantum and classical walks, despite the technical limitations that prevented more steps. The authors suggest a different implementation that shows promise for significantly extending the quantum walk to several hundred steps. – Sonja Grondalski

## Subject Areas

Atomic and Molecular Physics

## Related Articles

Atomic and Molecular Physics

### A Synthetic Lattice in a Cold Atomic Cloud

Defining a fermionic lattice using spin and momentum instead of spatial coordinates opens the door for interacting-fermion simulations with more complex lattice geometries. Read More »

Atomic and Molecular Physics

### A Liquid Method to Prepare Ion Beams

A liquid-metal jet can strip electrons from a high-intensity, accelerator-based ion beam, increasing the beam’s charge and enhancing accelerator performance. Read More »

Atomic and Molecular Physics

### Controlling Single Photons with Rydberg Superatoms

New schemes based on Rydberg superatoms placed in optical cavities can be used to manipulate single photons with high efficiency. Read More »


text:
# Give an example of a set which has exactly 3 limit points and the set is closed.

So the question is,

Give an example of a set of real numbers which has exactly 3 limit points and the set is closed.

I have been trying to solve it by myself, and I know one potential set can be $$A$$, such that, $$A = \{k + \frac{1}{n}\ : n \in \mathbb{N} \}$$ Where $$K$$ is the limit point of $$A$$.

The problem with this set is, this set is not closed, by the definition of a closed set, the set also need to contain it's limit points, but $$k \notin A$$

• Hint: Look at the closure of that set, which just adds $k$. Now do it 3 times
– Alan
Jul 2 at 10:44
• What do you mean by closure of a set? Sorry I am very new in real analysis... Jul 2 at 10:47
• The closure of a set is the smallest closed set it is a subset of, you get it by adding all the limit points
– Alan
Jul 2 at 10:50

Let $$A(k)=\{k+\frac{1}{n}\mid n\in\mathbb{N}\}\cup \{k\}$$, then $$A(k)$$ is closed and has one limit point, ie $$k$$. Now take $$A(0)\cup A(1) \cup A(2)$$. which is a finite union of closed sets, and hence closed. It contains three limit points, ie 0, 1, and 2, and it's easy to check it doesn't contain any others.


text:
# System of Differential Equations

## Homework Statement

dx/dt + dy/dt = 2x + 2y + 1

dx/dt + 2(dy/dt) = y + 3

## The Attempt at a Solution

Dx + Dy = 2x + 2y + 1

Dx + 2Dy = y + 3

--Rearranging----------------------------
Dx - 2x = -Dy + 2y + 1
Dx = -2Dy + y + 3
---Factoring-----------------------------
(D - 2)x = (-D + 2)y + 1
Dx = (-2D + 1)y + 3
--Eliminating x--
(D)(Dx-2x) = ((-D+2)y + 1) (D) <--- multiply by D
-(D-2)(Dx) = ((-2D + 1)y + 3) -(D-2) <---- multiply by -(D-2)

I get to this point and try to cancel out terms but it becomes a mess and attempting to find the solution usually leaves my with polynomials I can't factor, I don't know what to do..

Ray Vickson
Homework Helper
Dearly Missed

## Homework Statement

dx/dt + dy/dt = 2x + 2y + 1

dx/dt + 2(dy/dt) = y + 3

## The Attempt at a Solution

Dx + Dy = 2x + 2y + 1

Dx + 2Dy = y + 3

--Rearranging----------------------------
Dx - 2x = -Dy + 2y + 1
Dx = -2Dy + y + 3
---Factoring-----------------------------
(D - 2)x = (-D + 2)y + 1
Dx = (-2D + 1)y + 3
--Eliminating x--
(D)(Dx-2x) = ((-D+2)y + 1) (D) <--- multiply by D
-(D-2)(Dx) = ((-2D + 1)y + 3) -(D-2) <---- multiply by -(D-2)

I get to this point and try to cancel out terms but it becomes a mess and attempting to find the solution usually leaves my with polynomials I can't factor, I don't know what to do..

Why not do it the easy way? Solve for Dx and Dy in terms of x and y, so you have a standard linear system of the form
$$\pmatrix{x'(t)\\y'(t)} = \pmatrix{a_1 & b_1 \\ a_2 & b_2} \pmatrix{x\\y} + \pmatrix{c_1\\c_2},$$
where the ##a_i, b_i, c_i## are constants. Then use standard methods.

I have very little Linear Algebra knowledge, I don't know if i could set up the
linear system correctly
|Dx| = |-Dy + 2x + 2y|
|Dy| = |-2Dy + y + 3 |

Ray Vickson
Homework Helper
Dearly Missed
I have very little Linear Algebra knowledge, I don't know if i could set up the
linear system correctly
|Dx| = |-Dy + 2x + 2y|
|Dy| = |-2Dy + y + 3 |

I don't understand what you are writing here. Anyway, you do not need to know any linear algebra; you just have two linear equations in the two unknowns Dx and Dy, and you can solve them the way you learned back in school.

I guess i'm confused because I have, derivatives on both sides when solving for Dx and Dy

vela
Staff Emeritus


text:
### Specials!

There's a certain sort of political junky (including me, and, apparently, a large portion of the readership at Daily Kos) who spend most of their Tuesday evenings watching special election results.  And the results have been very good for the Democrats.   Since January of 2017, there have been 124 special elections at the state or federal level (including 5 US House Races and the Alabama Senate).  This is a big freakin' sample and allows us to do some real statistics.  Of the 118 state level races:
• 46 Dem seats stayed Dem
• 3 Dem seats flipped to Rep
• 42 Rep seats stayed Rep
• 17 Rep seats flipped to Dem
The short version of the story is that Democrats flipped fully 29% of the Republican seats up in the last year or so, while Republicans flipped only 6%.  A similar result in the US House would net 58 seats – easily enough to flip the chamber.

And it's not even just the flips.  As I noted in my previous post, the average swing in these elections has been toward the Democrats by about 10-20% (depending on how you do the averaging).  So the real question is:
What, if anything, do the special elections tell us about how the country has shifted, and what's going to happen in November?

There's a big enough sample of special elections, that we can dig in a bit to see how one differs from another.  But we need a clean sample. "Battle Royales" which pit 4 or 5 candidates from different parties are going to have a very skewed dynamics. If they end up in a 2-party runoff, then it makes my list.  Likewise, if the race has been uncontested for the last several cycles (since 2012) then I'm not interested.  After scrubbing all of the data, I'm down to about half the races – 59 out of 124 which fit the bill.

To begin, I simply imagine the the "expected outcome" is just the average of the presidential outcome (all results are the D-R margin). Let's compare the expected outcomes to the actual results of the specials:

The upper left quadrant is, in general, the R->D flips and the lower right is the D->R.  Without even squinting too much, it's quite clear that most points are above the red line, which is to say that the Dems outperformed the historical norms for the vast majority of the district.  Indeed the "Trump Effect" (the amount by which the democrats have improved since November 2016) is roughly:
$$\langle TE\rangle =13\pm 17\%$$
The Trump Effect is large -- enough to flip the House -- but any given election has a large scatter. Hence, a handful of races were actually a little better for Republicans than expected.

We don't need particularly fancy analyses to come to the same conclusions.  This result is consistent with those found over at Daily Kos, 538, and the Washington Post (and many other outlets), which all find a 10 or 15 point overperformance by the Dems at the state level, and an 18 point overperformance for Dems with national races (15 points if you throw out the Alabama Senate race as an anomaly).

Incidentally, one of the weird things almost every outlet does is to compare races to the 2016 presidential race alone, when there was, to put it mildly, clearly something unique about the presidential race. I wanted to test whether the historical results and presidential results predicted each
other, and indeed they do:
Not only are the mean of all of the districts which have had competitive special elections essentially identical (about -8% Republican by both metrics), the correlation coefficient between them is 0.84, meaning that they are (except for noise) essentially proxies for one another.  By taking a simple average, we significantly reduce the underlying "scatter" in each district (basically, our uncertainty in what a neutral year would look like goes from 11.2% to 7.9%).

Now that we've got a clean sample with smaller underlying errors, we can try to get to the heart of what these races mean.

1. Does turnout Matter?

Here's a hypothesis: Maybe the Dems are overperforming because (contrary to history and conventional wisdom) there is a small group of them who would normally only vote in November elections, but are voting now.  If this were the case, special elections mean nothing predictive, because we're not activating any "extra" voters.

We could test this by looking at the Trump Effect (Dem overperformance) as a function of voter turnout. If there's a gap of superenthusiastic voters (but not likely November voters), then we'd expect that the greater the turnout, the smaller the Trump effect.  As total voter registration numbers is tough to come by, I'm going to compare the turnout in the special to the 2016 voter turnout.

The results are... inconclusive, to say the least.  As the red line indicates, the best fit does, indeed, support the idea that at higher turnout, the Dem advantage grows smaller (16% advantage at low turnout, 6% at "full" turnout), but the error is very large.  Including errorbars, the best fit for the slope is $-0.1\pm 0.14$, meaning that the true turnout effect could very well be zero.  Or it could be enough to erase the Trump Effect entirely.

That's how science goes, I'm afraid.

Result: Inconclusive

2. Does National Impact of the Race Matter?

Another Hypothesis: Low impact races, ones that draw national attention, are likelier to have a larger boost, for similar reasons as the turnout hypothesis.  On the face of it, this seems difficult to support. The two highest turnout races were the GA-06 House race which the Republican won by 3.6% and the AL-Sen race, which Democrat Doug Jones won by 1.7%.  The two had a Trump Effect of 8.9% and 29.9%, respectively, slightly below and well above the overall average. But then, both races were special in other ways.  More generally, the US House and Senate races actually had a higher Trump Effect than the state races. But let's look at all of the data:

Despite the noise, this one actually suggests a trend.  The best fit is of the form:
$$TE=m\log_{10}(Votes)+b$$
where the slope, $m=-5\pm 3.3$.  In other words, there seems to be pretty strong evidence that larger are, on the whole, closer to a smaller Trump Effect.  But if we're going to look at the effect on the micro-scale, I think we're likely dominated by a few 40 point shifts in very, very low turnout races. As a case in point, earlier this month, Missouri's HD39 had a swing of 34 points based on fewer than 3500 votes. This may be one of those cases where trying to force a model may not be worth it.

Result: Suggestive, but inconclusive

3. Is there simply a reversion to the mean?

Next hypothesis: Maybe Dems are doing well because, as it happens, most of the contested races are Republican seats.  If that's the case, then we've got nothing but a reversion to the mean.  If that's the case, then the more "Republican" the district, the greater the Trump Effect.
This is unambiguous.  You could do this by eye, if you like.  The more Democratic the district, the smaller the Trump effect:
$$TE=11.5\%-0.22\times Expected$$
For every 10% more Democractic the district, the Trump Effect decreases by 2.2%, and this is a $3\sigma$ result – very robust. The good news for the Dems is that you only need a Trump Effect in moderately Republican districts. Indeed, this means that there are more districts within striking range than you might naively have guessed.

Though the Trump Effect for a neutral district is about 11.5%, for a D-R=-15 district, the effect is 15 points – which means 15 point Republican districts are winnable.  Want to know how many House Districts Trump lost or won by fewer than 15? 285.

Result: Significant, and in a good direction!

4. Is the Trump Effect getting larger or smaller?

There's been a lot of panic lately about the tightening of various polls, so here's a quick hypothesis: The polls are tightening because the enthusiasm gap and the actual preference gap are tightening.

The good news: the Trump Effect seems to be pretty flat over time. Indeed, the best fit to the slope is $2\%/year \pm 7\%$ (which is a fancy way of saying "totally consistent with flat.") But still, you'd rather an upward slope than a downward one.

Result: Likely nothing, but if not flat, then pointed nominally in the right direction.

Conclusions

None. There seems to be no strong long-term trend, and while high turnout races tend to have a lower Trump Effect, the result is small and the errorbars are large.  The biggest single effect (and one cause for optimism) is that Dems seem to be particularly overperforming in highly Republican districts.  This is great, if it holds, because it means that we're actually underestimating the blue wave.


text:
# Unicode Character/Symbol in Lua(La)TeX

I am trying to print a specific unicode character in LuaLaTeX using

\documentclass{article}
\begin{document}
\char"2605 \symbol{"2605"} ^^^^2605
\end{document}

However, none of these prints the black star (unicode 2605). The first two commands show nothing while the last one prints a right double quotation mark. Help.

• The second " in "2605 is wrong. And the log says: There is no ★ (U+2605) in font [lmroman10-regular]. You need a font that contains that glyph. – Phelype Oleinik May 23 at 19:17
• Thank you for the reply. How, then, is $\blackstar$ (amssymb) created? – Troy Henderson May 23 at 19:30
• classic tex math fonts are not in unicode encoding, there are multiple fonts and each character is in the range 0-127 – David Carlisle May 23 at 20:07

Works with one of the fonts from http://www.fileformat.info/info/unicode/char/2605/fontsupport.htm

\usepackage{fontspec}
\setmainfont{DejaVu Sans}

\begin{document}
\char"2605 \symbol{"2605} ^^^^2605
\end{document}

• As I said in the comment above, the second " in "2605" is wrong. – Phelype Oleinik May 23 at 19:23
• @PhelypeOleinik Thank you – muxoveji May 23 at 19:25
• Using fontspec and setting the font to FiraSans-Regular also does not display this character even though the character is showing in the character map. – Troy Henderson May 23 at 19:45
• @TroyHenderson don't trust the character map (if you mean e.g. the windows one) it often fills missing characters with glyphs from other fonts. – Ulrike Fischer May 23 at 20:08
• Thank you for the tip. – Troy Henderson May 23 at 21:33


text:
These are chat archives for SmingHub/Sming

18th
Feb 2016
alon24
@alon24
Feb 18 2016 05:08 UTC
@hreintke i cannot get my code to build, it says there is not enough space for it:
AR out/build/app_app.a
LD out/build/app_0.out
/opt/esp-alt-sdk-v1.3.0-rtos.258-macos-x86_64/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/5.1.0/../../../../xtensa-lx106-elf/bin/ld: out/build/app_0.out section .irom0.text' will not fit in region irom0_0_seg'
/opt/esp-alt-sdk-v1.3.0-rtos.258-macos-x86_64/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/5.1.0/../../../../xtensa-lx106-elf/bin/ld: region irom0_0_seg' overflowed by 4766 bytes
collect2: error: ld returned 1 exit status
make: *** [out/build/app_0.out] Error 1
alon24
@alon24
Feb 18 2016 05:14 UTC
## use rboot build mode
RBOOT_ENABLED ?= 1
## enable big flash support (for multiple roms, each in separate 1mb block of flash)
RBOOT_BIG_FLASH ?= 1
## size of the flash chip
SPI_SIZE        ?= 4M
## size of the spiffs to create
SPIFF_SIZE      ?= 600000
## (spiffs location defaults to the mb after the rom slot on 4mb flash)

//LD file
MEMORY
{
dport0_0_seg :                          org = 0x3FF00000, len = 0x10
dram0_0_seg :                           org = 0x3FFE8000, len = 0x18000
iram1_0_seg :                           org = 0x40100000, len = 0x9000
/*irom0_0_seg :                           org = 0x4020A000, len = 0x52000*/
irom0_0_seg :                           org = 0x40202010, len = 0x52000
}

INCLUDE "../ld/eagle.app.v6.hr.common.ld"

void initSpiff()
{
// mount spiffs
int slot = rboot_get_current_rom();
#ifndef DISABLE_SPIFFS
if (slot == 0)
{
#ifdef RBOOT_SPIFFS_0
debugf("trying to mount spiffs at %x, length %d", RBOOT_SPIFFS_0 , SPIFF_SIZE);
spiffs_mount_manual(RBOOT_SPIFFS_0, SPIFF_SIZE);
#else
debugf("trying to mount spiffs at %x, length %d", 0x100000, SPIFF_SIZE);
spiffs_mount_manual(0x100000, SPIFF_SIZE);
#endif
}
else
{
#ifdef RBOOT_SPIFFS_1
debugf("trying to mount spiffs at %x, length %d", RBOOT_SPIFFS_1 , SPIFF_SIZE);
spiffs_mount_manual(RBOOT_SPIFFS_1, SPIFF_SIZE);
#else
debugf("trying to mount spiffs at %x, length %d", SPIFF_SIZE);
spiffs_mount_manual(0x300000, SPIFF_SIZE);
#endif
}
#else
debugf("spiffs disabled");
#endif
//WifiAccessPoint.enable(false);

Serial.printf("\r\nCurrently running rom %d.\r\n", slot);
Serial.println("Type 'help' and press enter for instructions.");
Serial.println();
}
Ricardo Martínez
@mtzfactory
Feb 18 2016 07:30 UTC
Hi, i would like how can i use the following arduino library in my project... https://github.com/gauravmm/HT1632-for-Arduino
Do i have to change something in the code, what do I have to take into account?
hreintke
@hreintke
Feb 18 2016 07:53 UTC
@alon24 :
The size in the LD file is (like some other values in the makefile) not changed dependent on the value of SPI_SIZE.
For the 4Mb esp (?) you are using, I think the size can go up to 0xF0000.
For now the only way to get that in is to update the LD file accordingly.
BTW : The SPIFFS_SIZE should be a multiple of 4K which is the blocksize of the Flash.
Not sure how spiffy/spiffs_mount/spiifs usage will be with non-aligned values
hreintke
@hreintke
Feb 18 2016 08:00 UTC
BTW2 : If you change the spiffs_mount_manual from spiffs_mount_manual(0x300000, SPIFF_SIZE);
to spiffs_mount_manual(0x300000, 0); The spiffs_mount will detect the size of the spiffs on the flash and use that.
New feature of SmingRTOS :smile:
Alexander V. Ribchansky
@avr39-ripe
Feb 18 2016 08:04 UTC
@dobrishinov about ajax - update sming if old one and no problem with ajax :) just works :)
alon24
@alon24
Feb 18 2016 08:23 UTC
@hreintke which part in ld should now be 0xF0000.
alon24
@alon24
Feb 18 2016 08:47 UTC
@hreintke I am guessing irom0_0_seg : org = 0x40202010, len = 0xF0000 ??
hreintke
@hreintke
Feb 18 2016 09:09 UTC
yes that correct
alon24
@alon24
Feb 18 2016 09:13 UTC
well it now compiles, but i will see later (@work now) about more. thanks for u'r help
zhivko
@zhivko
Feb 18 2016 11:33 UTC
I am missing blankfs.bin ... in sming rtos
IOError: [Errno 2] No such file or directory: '/home/kz/git/Sming_RTOS_POC/sming/compiler/data/blankfs.bin'
/home/kz/git/Sming_RTOS_POC/sming/Makefile-rboot.mk:385: recipe for target 'flashinit' failed
make: *** [flashinit] Error 1
robotiko
@robotiko
Feb 18 2016 11:57 UTC
@crosofg we crossed with the ssl testing
as you just mentioned
compiling
but ssl is failing a
and also resets the device
zhivko
@zhivko
Feb 18 2016 12:16 UTC
IS this ok to be used near nodemcu (esp12) as switching regulator power supply?
http://www.digikey.com/product-detail/en/OKI-78SR-5%2F1.5-W36-C/811-2196-5-ND/2259781
I mean because of the switching emi ? I do not want wireless to be disturbed because of this psu
slaff
@slaff
Feb 18 2016 13:04 UTC
@hreintke Is the HttpClient in RTOS migrated, working and tested ?
hreintke
@hreintke
Feb 18 2016 13:14 UTC
@slaff : yes, all functionality of NONOS is available in RTOS.
There are some differences between the two versions (not HttpClient) see : https://github.com/SmingHub/SmingRTOS
That is for Sming Applications. For Sming Framework the biggest change is the directory layout and the decoupling of changes in Espressif sdk and Sming Framework.
FYI, The LWIP in RTOS has IPv6 support enabled. Only thing I needed to update for that was in the IPAddress class.
slaff
@slaff
Feb 18 2016 13:19 UTC
@hreintke I was thinking about organizing a Hackathon for a day with the goal of testing/ fixing and finishishing / fixing all existing features + libraries.
Would it be possible for you to prepare something like a small migration guide: Tips and Tricks, Things to consider, etc ?
crosofg
@crosofg
Feb 18 2016 13:41 UTC
@robotiko yes its failing ..even mqtt client is throwing error
C:\tools\Sming\samples\MqttClient_Hello>make ENABLE_SSL=1
LD out/build/app.out
c:/tools/sming/sming/compiler/lib/\libaxtls.a(loader.o):(.irom0.literal+0x3c): undefined reference to default_private_key_len'
c:/tools/sming/sming/compiler/lib/\libaxtls.a(loader.o):(.irom0.literal+0x44): undefined reference to default_certificate'
collect2.exe: error: ld returned 1 exit status
make: *** [out/build/app.out] Error 1

C:\tools\Sming\samples\MqttClient_Hello>`
ok jsut add ENABLE_SSL =1 in the makefile-user.mk of Mqtt hello. Then tis working
slaff
@slaff
Feb 18 2016 14:03 UTC
of course - the SSL needs SSL keys and cert.
when you compile the project with ENABLE_SSL=1 then it will work.
crosofg
@crosofg
Feb 18 2016 14:11 UTC
but doesnt the inlcude/ssl contains the key and cert?
hreintke
@hreintke
Feb 18 2016 14:44 UTC
@slaff :
For applications, conversion from NONOS to RTOS is straightforward, There is already the "difference note" in the Readme and maybe I will write a small howto next to it.
For Sming Framework the conversion is done. I don't see the need for a migration guide as new major functionality should be directly based on RTOS and not on NONOS. We will cease support for including major new functionality very soon.
For your ssl implementation, make a start, in RTOS is implementing new functionality is the same as in NONOS.
If you hit issues, ask here or submit an issue in the SmingRTOS and you will get the answers from me and others.
Sébastien
@sle118
Feb 18 2016 14:50 UTC
@slaff I have gone to the bottom of the gdb issue and report that it now works! The alt-sdk on linux is built with an older version of gdb, which confirms my initial suspicions that there was a structure alignment difference or a protocol incompatibility between the gdb stub and the gdb server
@robotiko debugging works well now on linux!
I just need to figure out how to get variable content to show up in debug now (all variables currently seem to be "optimized" out)
and then I'll be ready to resume debugging my stb image library port
hreintke
@hreintke
Feb 18 2016 14:53 UTC
@zhivko : I added blankfs.bin to the SmingRTOS repo.
robotiko
@robotiko
Feb 18 2016 14:56 UTC
@sle118 I'm having similar errors in windows..
I guess the problem is the same
exe used was extracted from esp-alt-sdk for windows (only place I could find it)
Sébastien
@sle118
Feb 18 2016 15:44 UTC
@robotiko have you tried building the open sdk yourself?
I decided to use a linux VM instead of windows cygwin
slaff
@slaff
Feb 18 2016 16:26 UTC

@sle118 > which confirms my initial suspicions that there was a structure alignment difference or a protocol incompatibility

Great! That's the type of help I need!

robotiko
@robotiko
Feb 18 2016 16:30 UTC
@sle118 not using linux vm at all
Sébastien
@sle118
Feb 18 2016 16:31 UTC
@robotiko you are on windows, correct?
robotiko
@robotiko
Feb 18 2016 16:33 UTC
pure windows environment
yes
Sébastien
@sle118
Feb 18 2016 16:34 UTC
I think you can try to pull the gdb executable from the open sdk like I did, just to see if it makes a difference
I was getting breaks to execute, but the addresses looked funky
robotiko
@robotiko
Feb 18 2016 16:34 UTC
Sébastien
@sle118
Feb 18 2016 16:34 UTC
and totally not in the range that would have been expected
robotiko
@robotiko
Feb 18 2016 16:35 UTC
ok but questions
that just contains linux and mac info to build
there is no compiled version ready to go
Sébastien
@sle118
Feb 18 2016 16:36 UTC
I am looking at the readme
robotiko
@robotiko
Feb 18 2016 16:36 UTC
isnt that what cherts do?
Sébastien
@sle118
Feb 18 2016 16:36 UTC
from there, I think you can find how to build in windows
Ricardo Martínez
@mtzfactory
Feb 18 2016 18:36 UTC
I would really appreciate a help on this:I would like how can i use the following arduino library in my project... https://github.com/gauravmm/HT1632-for-Arduino
Do i have to change something in the code, what do I have to take into account?
alon24
@alon24
Feb 18 2016 20:02 UTC
@hreintke can u add mqtt sample to rtos?
hreintke
@hreintke
Feb 18 2016 20:34 UTC
@alon24 If there is a NONOS version, can you take the action to convert that to RTOS.
Should be only updating the include files, compile and test.
If done and working please submit a PR and I will include it.
alon24
@alon24
Feb 18 2016 20:36 UTC
k i will look into this :)
hreintke
@hreintke
Feb 18 2016 20:36 UTC
@alonewolfx2 :
Can you check the libraries not yet converted to RTOS.
@alon24 : Thanks. :smile:
alon24
@alon24
Feb 18 2016 21:05 UTC
@hreintke the mqttClient_hello sample calls mqtt.setCompleteDelegate(checkMQTTDisconnect);
its not present in rtos
hreintke
@hreintke
Feb 18 2016 21:47 UTC
@alon24 :
I checked. The mqttclient implementation and sample are updated a couple of days ago.
Also dependent on another patch. Need to see what actions I need to get it in.
alon24
@alon24
Feb 18 2016 21:48 UTC
K