stochastic calculus – Questions on random time change from Oksendal’s SDE textbook

enter image description here

enter image description here

I have two questions related to the random time change introduced in Oksendal’s textbook on SDEs (page 155-156). Specifically, for Lemma 8.5.6., I have no clue as to why we should define $t_j$ in terms of $alpha_t$ in such a strange way. Perhaps the biggest confusion comes from the chain of identities in the proof of Lemma 8.5.6., it seems that the author used $$sum_j int_{alpha_j}^{alpha_{j+1}} f(s,omega),mathrm{d}B_s = int_0^{alpha_t} f(s,omega),mathrm{d}B_s,$$ but this relation is not that obvious in my mind (perhaps it is linked to the weird way that $t_j$ is defined…) My second question concerns a step in the proof of Theorem 8.5.7, in which the author used the relation $Delta tilde{B}_j = sqrt{c(alpha_j,omega)},Delta{B}_{alpha_j}$. However, this relation is not clear to me, as from (8.5.13), we should have $$Delta tilde{B}_j = tilde{B}_{j+1} – tilde{B}_j = int_{alpha_j}^{alpha_{j+1}} sqrt{c(s,omega)},mathrm{d}B_s.$$ So for the claimed identity to hold, we need at least that $alpha_{j+1} – alpha_j$ to be sufficiently small (say of order $mathrm{d}t$). My deepest thanks for any help on these questions.

api – Google credentials and redirect URI for Google OAuth2 in a WordPress plugin, questions

I’m developing a plugin that inserts contacts into a custom table of the WordPress database (name, phone number, email). It is possible to enter data in this table either manually, through a form, or by importing it from WordPress users. I have also developed a feature to import contacts from Google Contacts (Google People). Everything works but I ask you: when I will provide the plugin to my customers how can I do to avoid also providing the client_secret.json file with my credentials for accessing the Google API via OAuth2 together with the plugin?
Furthermore, in order to function correctly, I must also authorize the URI redirect in the Google console but I cannot know in advance the URL of the various sites where the plugin will be installed, is it possible to automate (perhaps always through the Google API) this insertion?

New to socket programming in C#.. Have very basic questions

My current scenario

I need to develop a TCP-IP client-server network such that two programs can communicate with each other. One simulator program receives information and needs to accurately display the same graphically, the other one is basically connected to a large lab apparatus that puts out detailed info about its functioning.. I would like the lab program to send info to the simulator program.


  1. Which of these would be the server and client?

  2. How best to send information from lab to sim? There are numerours objects (50-60) in the lab that need to keep sending on/off state and/or numeric info to the sim. How to send and parse multiple messages..

  3. What are some basic best practices I should adhere to while writing basic sockets?

I’m sorry if my questions seem silly, thank you for your time!

raid – Windows 10 drives pool questions (replace, upgrade)

i have some questions about Windows 10 pool.

Let’s suppose i have 4 disks ot 4TB and i choose the parity option. This means Window will simulate a RAID 6? Because in my test i see 8TB as drive space.
Considering is a Windows 10 pro, can i shutdown the PC without any problem or it must stay running for let pool work?

If one drive fail, i should wait Windows remove the drive from pool, but i need to remove the drive from the case while the PC is running or i can shutdown, replace the drive, turn on the PC?

What happening if i add a new drive with a different size? For example 6TB instead of 4TB?

Thank you for your answers!

interview questions – Square Spiral Matrix in Javascript

I’ve been grinding some Leetcode for an interview coming up and just completed Square Spiral in Javascript.

Looking for feedback on performance. This ranked faster than 58% of submissions, would there be anyway to increase the speed using a similar implementation to what I have here?

enter image description here

let matrix = (
  (1, 2, 3, 4,  5),
  (6, 7, 8, 9, 10),

var spiralOrder = (matrix) => {
  //make copy
  var dup=JSON.parse(JSON.stringify(matrix));
  //setup variables
  let maxX, maxY, baseX, baseY, x, y, vecX, vecY, nums, totalSquares;

  //Max indexes for array and sub arrays

  //baseX tells x when it has reached the first sub array.
  //baseY tells y when it has reached the first index of a sub array.
  //our indexes
  //our movement vectors
  //the count for keeping track of positions iterated
  //the total amount of squares to be iterated
  //return value array

  //I don't get how subArrays with only a single element could
  //still be considered spiralable, but this if-statement handles
  //those edge cases. Thanks Leetcode.
  if (matrix(0).length===1) {
    for (var i=0;i<matrix.length;i++) {
    return nums
  //While our iterated count is not equal to the total amount of
  //squares to be iterated. When this is true we know we
  //have completed the spiral.
  while(count!==totalSquares) {

    //Our loop iterates around in a spiral. On every turn
    //the loop increases the opposite side baseX, baseY,
    //maxX or maxY to increase the tightness of the spiral
    //as it loops.
    //This handles starting the very first iteration, moving right.
    if (x===0&&y===0) {
    //We've reached the top rightmost square, move down.
    } else if (x===baseX&&y===maxY) {

      //This is a little confusing. We can't increment baseY
      //until after the first iteration through the
      //first sub array is complete. This if statement
      //confirms that we're clear to increment baseY.
      if (baseX>0) {
    //We've reached bottom rightmost square, move left, increment baseX. 
    } else if (x===maxX&&y===maxY) {
    //We've reached bottom leftmost square, move up, decrement maxY.
    } else if (x===maxX&&y===baseY) {
    //We've reached top leftmost square, move right, decrement maxX.
    } else if (x===baseX&&y===baseY) {

    //Increment x or y by the vector.

  return nums


Google Answers Common Questions About Appearing in Google News

Google tries to clear up some challenging questions about inclusion in Google News.

Essential Return-To-Work Survey Questions That Business Should Consider

Are you panicking about covid-19? Look below to find some of the top return to work survey questions that your business must consider.

In the past few months, government authorities are starting to take measures for reopening businesses. However, in the post-covid-19 scenario, there are a few return-to-work survey questions that every business should consider when getting back to work after quarantine. This is because the ongoing pandemic is highly fluid and depends on the sector and jurisdiction-specific consideration. Therefore, employers must take care in bringing their employees back to their workspace.

Which social distancing norms should a business consider?

Employers need to comply with the directives of the local, federals, and state on social distancing when reopening their workplace. They have to consider alternative workdays and limited work hours. Moreover, they must lower the number of employees who are present on-site and avoid overcrowding. The employees require a physical barrier to limit sharing supplies or equipment.

Lastly, there are a few other covid-19 survey questions in terms of social distancing. These include considering the layout of your workspace along with modifying or closing common areas.

When must employers reopen their physical business locations?

Reopening businesses will depend on the employer’s industry and location. States must reopen their companies in phases. Besides, following the CDC guidelines is vital for each business. You have to restrict operations to some critical workers. Moreover, limiting non-essential employees from coming to the workplace is significant. Employers must further take care to minimize contact between employees who return to their workplace.

In addition, some companies must rethink if their community no longer requires much mitigation. Return to work covid-19 survey must take into account sick employees and establish routine and health checks.

How to maintain working in a remote manner?

Employers must consider hybrid working remotely for some months and not rely solely on the availability of normal workplaces. Rolling exits and lockdowns are going to continue in some regions where the covid-19 threat remains higher. It may be disruptive to swing back and forth between remote and central working states. However, a minimal workforce will be able to practice it productively and successfully.

For economic purposes, therefore, organizations need to keep employees working from home. However, some employees have to return to work if someone contracts the virus. This covid-19 questionnaire for employees will reinforce effective communication between employees.

Who can return to the workspace?

Employees must not ask all employees to join together at the same time. They need to ask workers to return gradually and with a low density. This will allow them to work freely without much stress.

Workers who are obese, have chronic heart or lung disease, and those over sixty must work remotely. Employees who do not have access to child care can continue to work from home. Employers also need to conduct return to work survey questions to know whether their employees feel comfortable returning to work.


currencies – Is there a Cryptocurrency Stack site anywhere for non-Bitcoin questions?

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Questions about Lightning Network: Connectivity, Funding, Dealing w Bad Counterparties


Long time buyer, holder, and user of Bitcoin (since 2015). Absolutely zero experience with Lightning Network. I’ve read some entry-level tutorials but still have basic conceptual questions regarding funding, capacity, revocations, etc.

Hypothetical Situation

Let’s say I run a gambling site. All business is conducted in BTC. More and more customers are asking that Lightning Network be made available to facilitate quick and cheap deposit and withdrawal of funds.

Where do I connect for maximum reach?

The tutorials always seem show to show two parties, Bob and Alice. They open a “channel” using a funding transaction. The example then typically adds in a third party (e.g. Festus) and says something along the lines of “and look, Bob can pay Festus through Alice.”

The implication seems to be that the network size could become enormous, to the point where anyone can pay anyone because hey, every Bitcoin user is inevitably connected by only a few degrees of separation on the network.

But this doesn’t really answer the question of to whom I, as a brand new user, should connect. I could connect to you, I guess. But maybe you’re a new user too and have zero other connections. Do I connect to some sort of hub? Guess that would work but doesn’t that make things overly centralized?

As a site owner (see hypothetical above), is it best for me to act as a hub and open a channel with each of my users, which means I’d have thousands of channels open? Or is it better to make a single connection to one really popular, well-connected dude? Seems like the latter, but which dude? How do I find him?

Do I always have to be online looking for cheats?

Ok, so I get that my LN peer can try to cheat me by broadcasting a settlement transaction of a prior balance state that’s more advantageous to him. And I also know that his cheat TX settlement won’t clear for twenty-four hours, giving me time to broadcast a “revocation” TX that settles everything in my favor instead. This is what dissuades my peer from cheating.

But this also implies that my Lightning node needs to be up 24/7, or at least never offline for more than 24 hours and, furthermore, I have to be ever vigilant to make sure no one is cheating, and execute revocations if they are. Are these assumptions correct? Does the Lightning software automate the cheat-detection process for me?

How do I add funds to an existing channel?

It’s still not clear how to add funds to a preexisting channel. I’ve seen some material online indicating that a third party service needs to be paid for this? I can’t imagine that’s correct is it? That doesn’t seem compatible with the whole ethos of LN.

Using my hypothetical example. Let’s say a client opens a channel with me and sends me 1 BTC. He bets on an upcoming UFC fight (Ronda Rousey vs. Oprah Winfrey). A successful bet on Winfrey pays 15x. That means in the unlikely even that he wins, I need to have at least 15 BTC available on that channel to pay him out.

How do I add funds to the channel if he wins? Or does that 15 BTC have to be placed in the channel via the initial funding transaction?

Now, if I’m servicing all users over a single channel, that’s fine. But if each user has his own channel, I’d have to fund each one with an enormous amount of BTC — despite the fact that 99.99% of my users will never even bet on that particular event at all. That would be an inefficient use of funds. I assume there’s a way to add funds to a channel after initial funding, but how?


I’m running on Win 2019 Server and need to be able to create channels, send funds, be notified of incoming funds, etc. using an API. Which wallets support this?

With Bitcoin’s first layer, I have the option of either running a full blown node or leveraging a centralized service like Electrum? Does LN have an analogous situation with two different styles of wallet?

Basic Python Problem, is Reddit a better area for questions like this?

Write a piece of Python code that prints out the string ‘hello world’ if the value of an integer variable, ‘happy’, is strictly greater than 2

This is what I have

happy = int(x)
if x > 2;
print ('hello world')

I have never taken any programming courses, just watching some videos b/c college is too expensive

My thinking on this is, happy is equal to any integer X, if X > 2 print ‘hello world’

obviously this is incorrect, just would be interested in hearing some input from professionals
-this is one of the first few problems on MITs python course, and I just watched the videos leading up to this

Side Note: This isn’t graded or Homework, I’m just doing this on my free time. Current Network/ Linux Admin