Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle the two signals depending on each other?

I read Deprecating the Observer Pattern with Scala.React and found reactive programming very interesting.

But there is a point I can't figure out: the author described the signals as the nodes in a DAG(Directed acyclic graph). Then what if you have two signals(or event sources, or models, w/e) depending on each other? i.e. the 'two-way binding', like a model and a view in web front-end programming.

Sometimes it's just inevitable because the user can change view, and the back-end(asynchronous request, for example) can change model, and you hope the other side to reflect the change immediately.

like image 863
Lai Yu-Hsuan Avatar asked Jan 27 '14 15:01

Lai Yu-Hsuan


People also ask

How do you compare two different signals?

To measure the similarity of two different signals, we usually apply cross-correlation or normalized cross-correlation, not subtraction or multiplication. Why don't you apply FFT on both signals to compare their frequency spectra? similarity between signals should match either in amplitude/ frequency/ phase.

How do you find the correlation between two signals?

To detect a level of correlation between two signals we use cross-correlation. It is calculated simply by multiplying and summing two-time series together. In the following example, graphs A and B are cross-correlated but graph C is not correlated to either.

What is correlation between two signals?

The Meaning of Correlation In general, correlation describes the mutual relationship which exists between two or more things. The same definition holds good even in the case of signals. That is, correlation between signals indicates the measure up to which the given signal resembles another signal.

What are the 2 signals?

Two main types of signals encountered in practice are analog and digital. The figure shows a digital signal that results from approximating an analog signal by its values at particular time instants. Digital signals are quantized, while analog signals are continuous.


1 Answers

The loop dependencies in a reactive programming language can be handled with a variety of semantics. The one that appears to have been chosen in scala.React is that of synchronous reactive languages and specifically that of Esterel. You can have a good explanation of this semantics and its alternatives in the paper "The synchronous languages 12 years later" by Benveniste, A. ; Caspi, P. ; Edwards, S.A. ; Halbwachs, N. ; Le Guernic, P. ; de Simone, R. and available at http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=1173191&tag=1 or http://virtualhost.cs.columbia.edu/~sedwards/papers/benveniste2003synchronous.pdf.

like image 192
Pierre Boulet Avatar answered Sep 23 '22 05:09

Pierre Boulet