## One of the processes keeps sending a keystroke repeatedly in the background, how to identify the culprit?

My system is a MacBook Pro late 2013 running macOS Sierra 10.12.6.

Symptoms:

• Occasionally after the laptop wakes from sleep, the system would behave as if someone is repeatedly pressing a certain key on the keyboard.

• If I click anything (Apple icon, File, Edit…etc) on the menu bar, the item whose name starts with A will be highlighted repeatedly, B if nothing starts with A, and so on. (Therefore, I assume the keystroke being sent is a number.)

• If I press cmd+tab attempting to switch between apps, the focus will automatically scroll all the way to the right-most item.

• This doesn’t affect all apps. I am able to use Chrome as if there’s nothing wrong.

My question:

• Apparently one or more of the processes running on my system is doing this. To find out which process / app is sending the keystroke, I am looking for a way or a tool to monitor who is sending keystroke. Therefore next time this happens I can use this to determine the culprit.

Thanks!

## How to estimate processes using Semaphores – PLEASE HELP! I need help in pointing me in the right direction. How can I solve this? [on hold]

Operating System Question A job is being handled from start to finish by 4 sets of concurrent processes called: a. KEYINs b. VERIFIERs c. COMPUTORs d. STORERs

• The KEYINs input data items into a buffer, called buffer1, large enough to take 750 equal-sized items

• The VERIFIERs accept data item from buffer1, verify them and deposit their output in buffer2 – large enough to take 670 equal-sized data items

• The COMPUTORs take verified data items from buffer2, perform calculation on them and deposit their results in buffer3 – which is large enough to hold 700 equal-sized result items.

• Finally the STORERs, take computed result items from buffer3 and store them in external disk space provided for the purpose.

9 Semaphores are involved as listed below:

• Itava1 – which ensures that a verifier can enter and extract data from buffer1 only when a data item is available

• Itava2 – which behaves similarly as itava1 for a COMPUTOR and buffer2

• Itava3 – which behaves similarly as itava2 for a STORER and buffer 3

• Spave1 – which tells KEYIN that there is a space available in buffer1 to deposit a data item, without which a KEYIN cannot gain entry

• Spave2 – which behaves similarly as spave1 for a VERIFIER and buffer 2

• Spave3 – which behaves similarly as spave2 for a COMPUTRO and buffer 3

• Buma1 – which ensures that only one KEYIN or VERIFIER can be allowed into buffer1 at a time

• Buma2 – which behaves similarly as buma1 for a VERIFIER or COMPUTOR and buffer2

• Buma3 – which behaves similarly as buma2 for COMPUTOR or STORER and buffer 3.

Questions:

1. Write down in order, the initial values of the 9 Semaphores

2. If 3750 data items have been deposited in buffer1, find an expression for the possible number of data items, V, that must‘ve been verified

3. If 2985 result items have been stored in available disk space, find an expression for the possible number of result items, s, that must’ve been deposited in buffer 3

4. Write four(4) concurrent algol-like program for the four sets of processes

5. Give a possible value to the number of processes in each set, and also a possible time-slice in use for performing each sub-task done, then draw a flow chart for the above job.

## C program to add the elements of an array using 4 processes without shared memory and note down the output

Create a C program to add the elements of an array using 4 processes without shared memory and note down the output.

## Outlook 2010 Error “This task could not be updated at this time.” Item still processes properly

I have an approval workflow, which sends and email to the person it is assigned to.

The user opens the email through Outlook 2010 and processes their task (approve, reject or reassign task).

After completing their task Outlook return an error message

This task could not be updated at this time.”

However the item does complete its process on the server side.

Users do have the proper permission to access the task and this issue happens from time to time.

## Conformal mappings and diffusion processes with boundary condition

I have a question on a relation between conformal mappings and diffusion processes with boundary condition.

Let $$D_1$$ be a smooth simply connected domain of $$\mathbb{R}^2 \cong \mathbb{C}$$. This may be unbounded.

We can define the normally reflecting Brownian motion $$X$$ on $$\bar{D_1}$$. We can also describe the Skorohod equation. The generator is the Laplacian $$\Delta$$ on $$D_1$$ with Neumann boundary condition.

Let $$D_2 \subset \mathbb{R}^2$$ be an another smooth simply connected domain. Let $$\Psi:D_1 \to D_2$$ be a conformal mapping. We also assume that $$\Psi$$ is extended to a homeomorphism from $$\bar{D_1} \to \bar{D_2}$$ and $$\Psi(\partial D_1)=\partial D_2$$ (I do not know if this assumption is necessary. Please tell me if it is unnecessary.).

By using this map, we can make the change of variable: $$D_1 \ni (\rho,z) \mapsto (r,w) \in D_2$$, where $$r=\text{Re}\Psi(\rho,z)$$ and $$z=\text{Im} \Psi(\rho,z)$$.

In $$(r,w)$$-coordinate, $$\Delta$$ may not take the form $$\frac{\partial^2}{\partial r^2}+\frac{\partial^2}{\partial w^2}$$. In $$(r,w)$$-coordinate, $$\Delta$$ may become a more general diffusion operator. We denote by $$\mathcal{L}$$ the operator.

My questions are as follows:

• Does the diffusion process $$\Psi(X)$$ correspond to the operator $$\mathcal{L}$$?
• Does the operator $$\mathcal{L}$$ satisfy the Neumann boundary condition on $$\partial D_2$$?

You will think that these are trivial. But I do not know how to justify these results.

Should I prove that the diffusion processe determined by $$\mathcal{L}$$ (with Neumann boundary condition) and the diffusion process $$\Psi(X)$$ coincide?

## PayPal All-In-One Payment Solution – Split to multiple options in checkout processes

TLTR: Split “PayPal All-In-One Payment Solution” into 3 different payment options in the checkout process that all go to the same place.

Magento 2 comes with “PayPal All-In-One Payment Solution” that enables user to pay by PayPal but also by credit/debit card through the same payment method.

When this option is enabled, it shows only ONE payment option in the checkout process. This is understandable, however, I would like to offer more than one payment option in the checkout “Payment Method” section such as “Credit Card”, “Debit Card” and “PayPal” which all go to the same place.

To visualise my goal:

Current setup:

PayPal Payment ---- [PayPal Method] 

Desired result:

Credit Card --- Debit Card  ----- [PayPal Method] PayPal      ---  

I don’t even know where to start so any help or directions will be hihgly appropriated.

## Handling negative variances on the derivative of Gaussian processes

The variance of the derivative of a Gaussian process, $$f$$, is given by (9.1):

$$Var(\frac{\partial f}{\partial x}) =\frac {\partial ^2 k(x,x)}{\partial x^2},$$

where $$k(·, ·)$$ is both a positive-definite quantity and the covariance function of $$f$$. But when evaluating the error corresponding to $$\frac{\partial f}{\partial x}$$, we observe that it is not necessarily positive everywhere. Therefore, is the above definition for $$Var(\frac{\partial f}{\partial x})$$ actually correct? Is it valid to simply take the absolute value of this quantity when computing the error or should this variance be handled differently?

As a simple case, if we consider a modified squared exponential kernel centered at $$x_a$$ and $$x_b$$, then $$k(x_i,x_j) = \exp(-(x_i-x_a)^2 – (x_j-x_b)^2)$$. This is positive definite. But $$\frac {\partial k(x_i,x_j)}{\partial x_i} = -2(x_i – x_a) k(x_i, x_j)$$ and $$\frac {\partial k(x_i,x_j)}{\partial x_i \partial x_j} = 4(x_i – x_a)(x_j – x_b) k(x_i, x_j)$$, which can both possibly be negative. Therefore, is (9.1) by itself a valid covariance function? To obtain the variance, is taking the absolute value of values along the diagonal of the covariance matrix appropriate?

## On Riemann integration of stochastic processes of order $p$

Let $$x:[a,b]\times\Omega\rightarrow\mathbb{R}$$ be a stochastic process, where $$\Omega$$ is the sample space from an underlying probability space. Let $$L^p$$ be the Lebesgue space of random variables on $$\Omega$$ with finite absolute moment of order $$p$$, with norm $$\|\cdot\|_p$$.

Consider the following definition of Riemann integrability in the sense of $$L^p$$: we say that $$x$$ is $$L^p$$-Riemann integrable on $$[a,b]$$ if there is a random variable $$I$$ and a sequence of partitions $$\{P_n\}_{n=1}^\infty$$ with mesh tending to $$0$$, $$P_n=\{a=t_0^n, such that, for any choice of interior points $$s_i^n\in [t_{i-1}^n,t_i^n]$$, we have $$\lim_{n\rightarrow\infty} \sum_{i=1}^{r_n} x(s_i^n)(t_i^n-t_{i-1}^n)=I$$ in $$L^p$$. In this case, $$I$$ is denoted as $$\int_a^b x(t)\,dt$$. This approach is defined in (T.T. Soong, Random Differential Equations in Science and Engineering, Academic Press, New York, 1973) and (T.L. Saaty, Modern Nonlinear Equations, Dover Publications Inc., New York, 1981), for instance.

I have not been able to read a full exposition on $$L^p$$-Riemann integration anywhere. I have several questions regarding this definition:

1. Once we know that $$x$$ is $$L^p$$-Riemann integrable and that such a especial sequence of partitions $$\{P_n\}_{n=1}^\infty$$ exists, can we take any other sequence of partitions $$\{P_n’\}_{n=1}^\infty$$? I mean, for any $$\{P_n’\}_{n=1}^\infty$$ with mesh tending to $$0$$ and any choice of interior points, the corresponding Riemann sums tends to $$I$$ in $$L^p$$.

2. Can this definition be related to upper and lower sums, as one does in real integration with the Darboux integral?

3. Equivalence with this statement: there is a random variable $$I$$ such that: for every $$\epsilon>0$$, there is a partition $$P_\epsilon$$ such that, for every partition $$P$$ finer than $$P_\epsilon$$ and for any choice of interior points, the corresponding Riemann sum $$S(P,x)$$ satisfies $$\| S(P,x)-I\|_p<\epsilon$$.

4. Equivalence with this statement: there is a random variable $$I$$ such that: for every $$\epsilon>0$$, there is a $$\delta>0$$ such that for any partition $$P$$ with $$\|P\|<\delta$$ and for any choice of interior points, the corresponding Riemann sum $$S(P,x)$$ satisfies $$\| S(P,x)-I\|_p<\epsilon$$.

And now we move to several variables. Let $$x:[a,b]\times[c,d]\times\Omega\rightarrow\mathbb{R}$$ be a stochastic process. Briefly, we say that $$x$$ is $$L^p$$-Riemann integrable on $$[a,b]\times[c,d]$$ if there is a random variable $$I$$ and a sequence of partitions $$\{P_n\}_{n=1}^\infty$$ with mesh tending to $$0$$ such that, for any choice of interior points, the corresponding Riemann sums tend to $$I$$ in $$L^p$$. In such a case, $$I$$ is denoted $$\iint_{[a,b]\times[c,d]} x(t,s)\,dt\,ds$$. Do the above questions hold for this double integral as well? And another question in this particular setting: consider two partitions $$\{P_n’\}_{n=1}^\infty$$ and $$\{P_m”\}_{m=1}^\infty$$ of $$[a,b]$$ and $$[c,d]$$, respectively, with mesh tending to $$0$$, and let $$P_{n,m}=P_n’\times P_m”$$. Do the Riemann sums corresponding to $$P_{n,m}$$ converge to $$I$$ in $$L^p$$ as $$n,m\rightarrow\infty$$ (in the sense of double sequences)?

## How can I optimize a alert system that processes 1000 request / hour?

I am building a solution where IoT-devices send in measurement-data to a API thats hosted on AWS. For each measurement-type the user can set a threshold value, that when reached will trigger an alert to be sent out.

My design is based on events, so each new measurement thats recieved in the API generates a work item on an AWS SQS-queue. A lambda-function then processes the work-item and reads all the threshold-alerts for that particular device from a database, and checks if any of the recieved data has passed the threshold. If the threshold is passed, it sends out an alert email.

The API processes about 1000 requests each hour and the reading of all threshold-alerts from the database is getting expensive/time consuming.

So my question is if there is a better way to design this alertsystem? I was thinking of adding a cache-layer that will cache all threshold-limits since they dont change that often, but this means I have to use a distributed cache and still make a roundtrip via HTTP.

All suggestions welcome!

## Simulation of Itô integral processes where integrand depends on terminal

I need to simulate a process of the form

$$X_t=\int_0^t f(s,t)\mathop{dW_s}$$

where $$f$$ is deterministic and the integral is an Itô integral. I know I can simply take finite Itô sums of discrete increments of the Brownian motion driver, but I am wondering if there are more sophisticated approaches. Common methods such as the Euler-Maruyama method do not appear to be applicable because the integrand depends on the upper terminal $$t$$ and so $$X_t$$ is not an Itô process.

Are there known approaches for simulating this kind of process?

(Answers to related questions that would help to find relevant literature would also be useful: eg. Does this kind of process have a name? Is there a way of writing it as a SDE? If so, does that class of SDEs have a name?)