问:
Why is my function not recognising one particular argument when using future_map?
This code is designed to generate 1000 landscapes according to a poisson Matern cluster distribution algorithm, with the random allocation of points included to create dynamic landscapes.

When running this code, the numerical object "radiusCluster" is not recognised, hence NAs are being produced and the landscapes are not fully realised.

I have tried many simple things to ensure this error is removed such as included the "radiusCluster" in both the function description and the future_map() call; this leads to "radiusCluster" not being recognised as an argument.

What is causing this error? How can I correct it and include "radiusCluster"?

```<code>library("spatstat")
library("furrr")
library("tidyverse")

#create a list for storing the epidemics
numsims<-1000

episet<-as.list(seq(1:numsims))

#function to generate landscape
generate_landscape<-function(radiusCluster=50,
                             lambdaParent,
                             lambdaDaughter,
                             randmod,
                             hosts,
                             dim){
numbparents<-rpois(1,lambdaParent*dim)

xxParent<-runif(numbparents,0+radiusCluster,dim-radiusCluster)
yyParent<-runif(numbparents,0+radiusCluster,dim-radiusCluster)

numbdaughter<-rpois(numbparents,(lambdaDaughter))
sumdaughter<-sum(numbdaughter)

thetaLandscape<-2*pi*runif(sumdaughter)

rho<-radiusCluster*sqrt(runif(sumdaughter))

xx0=rho*cos(thetaLandscape)
yy0=rho*sin(thetaLandscape)

xx<-rep(xxParent,numbdaughter)
yy<-rep(yyParent,numbdaughter)

xx<-xx+xx0

yy<-yy+yy0
cds<-data.frame(xx,yy)
is_outlier<-function(x){
  x > dim| x < 0
}
cds<-cds[!(is_outlier(cds$xx)|is_outlier(cds$yy)),]
while (nrow(cds)<hosts){
  dif<-hosts-nrow(cds)
  extraparentxx<-sample(xxParent,dif,replace = TRUE)
  extraparentyy<-sample(yyParent,dif,replace = TRUE)
  extrathetaLandscape<-2*pi*runif(dif)
  extrarho<-radiusCluster*sqrt(runif(dif))
  newextracoodsxx<-extrarho*cos(extrathetaLandscape)
  newextracoodsyy<-extrarho*sin(extrathetaLandscape)
  extraxx<-extraparentxx+newextracoodsxx
  extrayy<-extraparentyy+newextracoodsyy
  cdsextra<-data.frame(xx=extraxx,yy=extrayy)
  cds<-rbind(cds,cdsextra)
}

sampleselect<-sample(1:nrow(cds),hosts,replace=F)
cds<-cds%>%slice(sampleselect)

randfunction<-function(x){
  x<-runif(length(x),0,dim)
}
randselect<-sample(1:nrow(cds),floor(hosts*randmod),replace=F)
cds[randselect,]<-apply(cds[randselect,],1,randfunction)

landscape<-ppp(x=cds$xx,y=cds$yy,window=owin(xrange=c(0,dim),yrange=c(0,dim)))
landscapestore<-data.frame(landscape)
landscapestore
}

# Use n-2 cores to generate the landscapes in parallel
cores <- availableCores()-2
plan(multisession, workers=cores, seed=TRUE)

# Generate the landscapes in parallel
landscapes <- future_map(episet, generate_landscape,
#when the hashtag is removed from "radiusCluster", it becomes #an unused argument and the code does not run
                         #radiusCluster=50,
                         lambdaParent=.05,
                         lambdaDaughter=25,
                         randmod=0,
                         hosts=1000,
                         dim=1000)

ggplot(landscapes[[1]])+geom_point(aes(x=x,y=y))

</code>```
```<code>In runif(numbparents, 0 + radiusCluster, dim - radiusCluster) : NAs produced
</code>```

Body:
This code is designed to generate 1000 landscapes according to a poisson Matern cluster distribution algorithm, with the random allocation of points included to create dynamic landscapes.

When running this code, the numerical object "radiusCluster" is not recognised, hence NAs are being produced and the landscapes are not fully realised.

I have tried many simple things to ensure this error is removed such as included the "radiusCluster" in both the function description and the future_map() call; this leads to "radiusCluster" not being recognised as an argument.

What is causing this error? How can I correct it and include "radiusCluster"?

library("spatstat")
library("furrr")
library("tidyverse")

#create a list for storing the epidemics
numsims<-1000

episet<-as.list(seq(1:numsims))

#function to generate landscape
generate_landscape<-function(radiusCluster=50,
                             lambdaParent,
                             lambdaDaughter,
                             randmod,
                             hosts,
                             dim){
numbparents<-rpois(1,lambdaParent*dim)

xxParent<-runif(numbparents,0+radiusCluster,dim-radiusCluster)
yyParent<-runif(numbparents,0+radiusCluster,dim-radiusCluster)

numbdaughter<-rpois(numbparents,(lambdaDaughter))
sumdaughter<-sum(numbdaughter)

thetaLandscape<-2*pi*runif(sumdaughter)

rho<-radiusCluster*sqrt(runif(sumdaughter))

xx0=rho*cos(thetaLandscape)
yy0=rho*sin(thetaLandscape)

xx<-rep(xxParent,numbdaughter)
yy<-rep(yyParent,numbdaughter)

xx<-xx+xx0

yy<-yy+yy0
cds<-data.frame(xx,yy)
is_outlier<-function(x){
  x > dim| x < 0
}
cds<-cds[!(is_outlier(cds$xx)|is_outlier(cds$yy)),]
while (nrow(cds)<hosts){
  dif<-hosts-nrow(cds)
  extraparentxx<-sample(xxParent,dif,replace = TRUE)
  extraparentyy<-sample(yyParent,dif,replace = TRUE)
  extrathetaLandscape<-2*pi*runif(dif)
  extrarho<-radiusCluster*sqrt(runif(dif))
  newextracoodsxx<-extrarho*cos(extrathetaLandscape)
  newextracoodsyy<-extrarho*sin(extrathetaLandscape)
  extraxx<-extraparentxx+newextracoodsxx
  extrayy<-extraparentyy+newextracoodsyy
  cdsextra<-data.frame(xx=extraxx,yy=extrayy)
  cds<-rbind(cds,cdsextra)
}

sampleselect<-sample(1:nrow(cds),hosts,replace=F)
cds<-cds%>%slice(sampleselect)

randfunction<-function(x){
  x<-runif(length(x),0,dim)
}
randselect<-sample(1:nrow(cds),floor(hosts*randmod),replace=F)
cds[randselect,]<-apply(cds[randselect,],1,randfunction)

landscape<-ppp(x=cds$xx,y=cds$yy,window=owin(xrange=c(0,dim),yrange=c(0,dim)))
landscapestore<-data.frame(landscape)
landscapestore
}

# Use n-2 cores to generate the landscapes in parallel
cores <- availableCores()-2
plan(multisession, workers=cores, seed=TRUE)

# Generate the landscapes in parallel
landscapes <- future_map(episet, generate_landscape,
#when the hashtag is removed from "radiusCluster", it becomes #an unused argument and the code does not run
                         #radiusCluster=50,
                         lambdaParent=.05,
                         lambdaDaughter=25,
                         randmod=0,
                         hosts=1000,
                         dim=1000)

ggplot(landscapes[[1]])+geom_point(aes(x=x,y=y))

In runif(numbparents, 0 + radiusCluster, dim - radiusCluster) : NAs produced


来源: stackexchange

问:
How to be sure in success uploading file Laravel?
I use a trait to upload files. This trait has two public functions: upload(), store();

```<code>use Upload;

public function uploadAvatar(UploadRequest $request)
{

    $this->upload($request->file('file'), 'useravatars');
    $this->store();

    return response()->json('');
}
</code>```

There are two cases when the first method fails and the second. How to collect the typical result as an error or success and return it?

Exactly I can use try/catch.

ContentLicense: CC BY-SA 4.0

Body:
I use a trait to upload files. This trait has two public functions: upload(), store();

use Upload;

public function uploadAvatar(UploadRequest $request)
{

    $this->upload($request->file('file'), 'useravatars');
    $this->store();

    return response()->json('');
}

There are two cases when the first method fails and the second. How to collect the typical result as an error or success and return it?

Exactly I can use try/catch.


问:
intent to send data to another activity doesn't work
I have a problem with transferring data from one activity to another! I have read everything I can. I did not find a solution to my question anywhere. I do everything as described in official sources, but I do not transfer values. I will be grateful for any help. Thank you.
This is how I send

```<code>        Intent intent = new Intent(this, Osnova.class);
    intent.putExtra("url122", url122.toString());
    startActivity(intent);
</code>```

This is how I try to get

```<code>    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_osnova);
    Intent intent = getIntent();
    String url = intent.getStringExtra("url122");
}
</code>```

As a result, it only outputs null.As a result, it only outputs null.utl122 if that is already a string value. I also tried to send an object by adding .getText().toString(); but still nothing works

Body:
I have a problem with transferring data from one activity to another! I have read everything I can. I did not find a solution to my question anywhere. I do everything as described in official sources, but I do not transfer values. I will be grateful for any help. Thank you.
This is how I send

        Intent intent = new Intent(this, Osnova.class);
    intent.putExtra("url122", url122.toString());
    startActivity(intent);

This is how I try to get

    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_osnova);
    Intent intent = getIntent();
    String url = intent.getStringExtra("url122");
}

As a result, it only outputs null.As a result, it only outputs null.utl122 if that is already a string value. I also tried to send an object by adding .getText().toString(); but still nothing works


问:
Creating a loop in R where each time it adds a new row to an empty data frame
I have a data set with temperatures from 10,000 locations from Jan 1st 1990 to Dec 31st 2015. I have a model for one of these locations and am wanting to use this for local likelihood regression. I have code that chooses one of these locations, selects all the locations around it within 25km and groups all of these into a dataframe with the temperatures, latitudes, longitudes, id numbers,  date etc, then applies my model to this data where i get the intercept value. I have created an empty dataframe of 4 columns(intercept, id, lat, lon) and 10,000 rows, and put the values from this first location into the first row. This has all worked well:

```<code># 25 km radius for 1 location
# choose location
random <- sample(locations[, 1], 1)
# get all locations within 25km into one df
local.likelihood <- spatialrisk::points_in_circle(combined.long, as.numeric(random.df$lon), as.numeric(random.df$lat), radius = 25000)
# create a new column in df for day.number^2
local.likelihood$day.number2 <- local.likelihood$day.number^2
# apply model to this group
model.25k <- lm(temperature ~ day.number + day.number2 + sin(2*pi*day.number / 365) +
     cos(2*pi*day.number / 365) + lag(temperature, k = 2),
   data = local.likelihood)
# create an empty df of id, lon, lat and mean value
estimates.25 <- data.frame(matrix(ncol = 4, nrow = 10000))
columns <- c("mean", "id", "lon", "lat")
colnames(estimates.25) <- columns
# add id, lon, lat and mean into new row of df
estimates.25[1,] <- rbind(c(as.numeric(model.25k$coefficients[1] * 10), random.df))
</code>```

I am trying to create a loop so that it does this for all 10,000 locations and adds a new row to the data frame each time but whenever it runs it only adds to one row and doesn't choose a unique location each time. I am not confident at all with loops so was just seeing if anyone had advice on what would be best to fix this.

I started trying to do the loop for 3 locations first to check that it works as I know for all locations it will take a while:

```<code># 25km for 3 locations
for(i in 1:3) {
  random <- sample(locations[, 1], 1)
  random.df <- random.df <- locations %>% filter(id %in% random)
  local.likelihood <- spatialrisk::points_in_circle(combined.long, as.numeric(random.df$lon), as.numeric(random.df$lat), radius = 25000) # radius in meters
  local.likelihood$day.number2 <- local.likelihood$day.number^2
  model.25k <- lm(temperature ~ day.number + day.number2 + sin(2*pi*day.number / 365) +
                    cos(2*pi*day.number / 365) + lag(temperature, k = 2),
                  data = local.likelihood)
  estimates.25 <- data.frame(matrix(ncol = 4, nrow = 10000))
  columns <- c("mean", "id", "lon", "lat")
  colnames(estimates.25) <- columns
  estimates.25[i,] <- rbind(c(as.numeric(model.25k$coefficients[1] * 10), random.df))
}
</code>```

Each time it runs, it kind of does what I want but only keeps the last run, which I think is due to a new data frame (estimates.25) being made each time, but I have no idea how to fix it

Body:
I have a data set with temperatures from 10,000 locations from Jan 1st 1990 to Dec 31st 2015. I have a model for one of these locations and am wanting to use this for local likelihood regression. I have code that chooses one of these locations, selects all the locations around it within 25km and groups all of these into a dataframe with the temperatures, latitudes, longitudes, id numbers,  date etc, then applies my model to this data where i get the intercept value. I have created an empty dataframe of 4 columns(intercept, id, lat, lon) and 10,000 rows, and put the values from this first location into the first row. This has all worked well:

# 25 km radius for 1 location
# choose location
random <- sample(locations[, 1], 1)
# get all locations within 25km into one df
local.likelihood <- spatialrisk::points_in_circle(combined.long, as.numeric(random.df$lon), as.numeric(random.df$lat), radius = 25000)
# create a new column in df for day.number^2
local.likelihood$day.number2 <- local.likelihood$day.number^2
# apply model to this group
model.25k <- lm(temperature ~ day.number + day.number2 + sin(2*pi*day.number / 365) +
     cos(2*pi*day.number / 365) + lag(temperature, k = 2),
   data = local.likelihood)
# create an empty df of id, lon, lat and mean value
estimates.25 <- data.frame(matrix(ncol = 4, nrow = 10000))
columns <- c("mean", "id", "lon", "lat")
colnames(estimates.25) <- columns
# add id, lon, lat and mean into new row of df
estimates.25[1,] <- rbind(c(as.numeric(model.25k$coefficients[1] * 10), random.df))

I am trying to create a loop so that it does this for all 10,000 locations and adds a new row to the data frame each time but whenever it runs it only adds to one row and doesn't choose a unique location each time. I am not confident at all with loops so was just seeing if anyone had advice on what would be best to fix this.

I started trying to do the loop for 3 locations first to check that it works as I know for all locations it will take a while:

# 25km for 3 locations
for(i in 1:3) {
  random <- sample(locations[, 1], 1)
  random.df <- random.df <- locations %>% filter(id %in% random)
  local.likelihood <- spatialrisk::points_in_circle(combined.long, as.numeric(random.df$lon), as.numeric(random.df$lat), radius = 25000) # radius in meters
  local.likelihood$day.number2 <- local.likelihood$day.number^2
  model.25k <- lm(temperature ~ day.number + day.number2 + sin(2*pi*day.number / 365) +
                    cos(2*pi*day.number / 365) + lag(temperature, k = 2),
                  data = local.likelihood)
  estimates.25 <- data.frame(matrix(ncol = 4, nrow = 10000))
  columns <- c("mean", "id", "lon", "lat")
  colnames(estimates.25) <- columns
  estimates.25[i,] <- rbind(c(as.numeric(model.25k$coefficients[1] * 10), random.df))
}

Each time it runs, it kind of does what I want but only keeps the last run, which I think is due to a new data frame (estimates.25) being made each time, but I have no idea how to fix it


问:
react-pdf canvas dynamic drawer
i am working on project for engineering drawing and I need to take measurement from pdf drawings, I found react-pdf where I can use the Canvas component to draw on top of the PDF.

I can't see in the documents how to use the mouse to draw line on square etc.
i make to draw this shape but it's static:

<Canvas
  style={styles.canvas}
  paint={
    (painterObject) =>
      painterObject
        .save()
        .moveTo(100, 100) //move to position 100,100
        .lineTo(300, 100) //draw a line till 300, 100
        .lineTo(300, 300) //draw another line till 300,300
        .fill("red") //when the diagram is drawn, set the background color to pink
  }
/>```

Title: react-pdf canvas dynamic drawer


问:
Access to XMLHttpRequest at 'https://checkout.url.com/9282' has been blocked by CORS policy: Laravel
I got error when trying to redirect to an external url. I added the fruitcake/laravel-cors package to my project and updated the configuration cors, but nothing worked. I used Jetstream Laravel with inertiajs stack. The following error was thrown:

```<code>Access to XMLHttpRequest at 'https://checkout.paystack.com/cfgbfg335' (redirected from 'http://localhost:8000/distributors/purchase-package') from origin 'http://localhost:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
</code>```

// Config cors

'paths' => ['api/*', 'sanctum/csrf-cookie'],

'allowed_methods' => ['*'],

'allowed_origins' => ['*'],

'allowed_origins_patterns' => ['*'],

'allowed_headers' => ['*'],

'exposed_headers' => [],

'max_age' => 0,

'supports_credentials' => false,

// Code

```<code>return redirect()->away("checkout.url.com/9282");
</code>```

Have been trying to figure out how to fix this error. Any help will be appreciated. Thanks

Body:
I got error when trying to redirect to an external url. I added the fruitcake/laravel-cors package to my project and updated the configuration cors, but nothing worked. I used Jetstream Laravel with inertiajs stack. The following error was thrown:

Access to XMLHttpRequest at 'https://checkout.paystack.com/cfgbfg335' (redirected from 'http://localhost:8000/distributors/purchase-package') from origin 'http://localhost:8000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

// Config cors

'paths' => ['api/*', 'sanctum/csrf-cookie'],

'allowed_methods' => ['*'],

'allowed_origins' => ['*'],

'allowed_origins_patterns' => ['*'],

'allowed_headers' => ['*'],

'exposed_headers' => [],

'max_age' => 0,

'supports_credentials' => false,

// Code

return redirect()->away("checkout.url.com/9282");

Have been trying to figure out how to fix this error. Any help will be appreciated. Thanks


问:
okta/oauth2 how to make both passwordless and email/password account for same user?
I am doing a desktop app with okta using for user authentication
I stick to OTP initial authentication over email/sms with code

So
POST /passwordless/start -> sends code to email/sms
and then
POST /oauth/token  <- code
these work quite good.

The user will be created in the 'email' connection (after code verification) that's ok.
That means - they will't be able to login by email/password (because email/password users are in the 'Username-Password-Authentintication' connection).

I was thinking to force users to create accounts in 'Username-Password-Authentintication' connection, after OTP verification.
And do 'user linking' (that works fine), so they can log in by OTP or email/password.
But as the connections are different, there is a chance that the email will be already busy/created by some malicious user.

is there any way how to make possible both OTP and email/password authentications for users?


问:
Order of conditions in if statement using &&&
When solving a cycle sort problem, I was getting an index error. When I checked the solution, the only error was the order in which I wrote conditions within an if statement.

This worked

```<code>    if nums[i] > 0 and nums[i] <= n and nums[i] != nums[j]:
      nums[i], nums[j] = nums[j], nums[i]
</code>```

This did not

```<code>    if nums[i] > 0 and nums[i] != nums[j] and nums[i] <= n:
      nums[i], nums[j] = nums[j], nums[i]
</code>```

I tried to google but am not understanding why one would work and not the other. It only jumps into the if statement if all are correct, so why would order matter?

I would expect both to do the same. When jumping into the if statement, why would it matter if the second one failed or the third? Either way it should jump into the else statement.

Body:
When solving a cycle sort problem, I was getting an index error. When I checked the solution, the only error was the order in which I wrote conditions within an if statement.

This worked

    if nums[i] > 0 and nums[i] <= n and nums[i] != nums[j]:
      nums[i], nums[j] = nums[j], nums[i]

This did not

    if nums[i] > 0 and nums[i] != nums[j] and nums[i] <= n:
      nums[i], nums[j] = nums[j], nums[i]

I tried to google but am not understanding why one would work and not the other. It only jumps into the if statement if all are correct, so why would order matter?

I would expect both to do the same. When jumping into the if statement, why would it matter if the second one failed or the third? Either way it should jump into the else statement.


问:
Batch File: How to copy a number of files from subfolders and organize them
I tried with /S to copy the files from subdirectory but don't work.
it copies only from the main directory Source ,

Any ideas?

then if I have 10 files to copy and 5 subdirectories,
2 files from each subdirectory will be copied and if one subdirectory get empty the batch file will copy the rest of them that have files in it and make the math.

all files already copied will be added in a .txt file, like a database and will be skipped next run of the batch.

when the files remained to copy are less than MaxLimit  than the .txt file database will be deleted and the batch file will start again.

the .txt will be created again with first files copied ..  and so on.. an infinite number of times

```<code>@echo off

set Source=E:\teste-batch-file\original\
set Target=E:\teste-batch-file\final

set MaxLimit=10

for /F "tokens=1* delims=[]" %%G in ('dir  /A-D  /B  "%Source%\*.mp4" ^| find  /v /n ""') do (
copy /y "%Source%\%%~nxH" "%Target%"
if %%G==%MaxLimit% exit /b 0
 )

</code>```

thank you for helping me out

Body:
I tried with /S to copy the files from subdirectory but don't work.
it copies only from the main directory Source ,

Any ideas?

then if I have 10 files to copy and 5 subdirectories,
2 files from each subdirectory will be copied and if one subdirectory get empty the batch file will copy the rest of them that have files in it and make the math.

all files already copied will be added in a .txt file, like a database and will be skipped next run of the batch.

when the files remained to copy are less than MaxLimit  than the .txt file database will be deleted and the batch file will start again.

the .txt will be created again with first files copied ..  and so on.. an infinite number of times

@echo off

set Source=E:\teste-batch-file\original\
set Target=E:\teste-batch-file\final

set MaxLimit=10

for /F "tokens=1* delims=[]" %%G in ('dir  /A-D  /B  "%Source%\*.mp4" ^| find  /v /n ""') do (
copy /y "%Source%\%%~nxH" "%Target%"
if %%G==%MaxLimit% exit /b 0
 )

thank you for helping me out


问:
Strange flickering after manipulating html with JS
I am stuck with a problem and I cannot figure out what the cause is, I have created a small js script that modifies a table element, but every time it does I see flickering of the elements, I checked the HTML elements and there is no white space or whatsoever.

Short video: https://i.imgur.com/86RODJL.mp4

Is it possible an css property that causes this behavior ?

Tried to troubleshoot by inspecting the html elements for white space or similar.

JS function:

```<code>function correctOrderQtyMinus(element) {
var elementTR = element.parentNode.parentNode.parentNode;
var totalExBTW = document.getElementById('totalExBTW');
var totalBtw = document.getElementById('totalBtw');
var btwAmount = document.getElementById('btwAmount');
if(document.getElementById('checkoutForm')) {
if(element.parentNode.querySelector('#productQty').value > 1) {
  var newAmount =+ parseFloat(elementTR.querySelector('#productPriceTotalBtw').innerText) - parseFloat(elementTR.querySelector('#productPriceWithBtw').innerText);
 elementTR.querySelector('#productPriceTotalBtw').innerText =+ newAmount.toFixed(2);
 totalExBTW.innerText =+  (parseFloat(totalExBTW.innerText)- parseFloat(elementTR.querySelector('#productPriceExBtw').innerText)).toFixed(2);
 totalBtw.innerText =+  (parseFloat(totalBtw.innerText) - parseFloat(elementTR.querySelector('#productPriceWithBtw').innerText)).toFixed(2);
 btwAmount.innerText = parseFloat(totalBtw.innerText - totalExBTW.innerText).toFixed(2);
 totalBtw.innerText = parseFloat(totalBtw.innerText).toFixed(2);
 totalExBTW.innerText = parseFloat(totalExBTW.innerText).toFixed(2);
 elementTR.querySelector('#productPriceTotalBtw').innerText  =  parseFloat(elementTR.querySelector('#productPriceTotalBtw').innerText).toFixed(2);
    } else {
        console.log('Cannot go less than 1');
    }

}

event.preventDefault();
}
</code>```

Body:
I am stuck with a problem and I cannot figure out what the cause is, I have created a small js script that modifies a table element, but every time it does I see flickering of the elements, I checked the HTML elements and there is no white space or whatsoever.

Short video: https://i.imgur.com/86RODJL.mp4

Is it possible an css property that causes this behavior ?

Tried to troubleshoot by inspecting the html elements for white space or similar.

JS function:

function correctOrderQtyMinus(element) {
var elementTR = element.parentNode.parentNode.parentNode;
var totalExBTW = document.getElementById('totalExBTW');
var totalBtw = document.getElementById('totalBtw');
var btwAmount = document.getElementById('btwAmount');
if(document.getElementById('checkoutForm')) {
if(element.parentNode.querySelector('#productQty').value > 1) {
  var newAmount =+ parseFloat(elementTR.querySelector('#productPriceTotalBtw').innerText) - parseFloat(elementTR.querySelector('#productPriceWithBtw').innerText);
 elementTR.querySelector('#productPriceTotalBtw').innerText =+ newAmount.toFixed(2);
 totalExBTW.innerText =+  (parseFloat(totalExBTW.innerText)- parseFloat(elementTR.querySelector('#productPriceExBtw').innerText)).toFixed(2);
 totalBtw.innerText =+  (parseFloat(totalBtw.innerText) - parseFloat(elementTR.querySelector('#productPriceWithBtw').innerText)).toFixed(2);
 btwAmount.innerText = parseFloat(totalBtw.innerText - totalExBTW.innerText).toFixed(2);
 totalBtw.innerText = parseFloat(totalBtw.innerText).toFixed(2);
 totalExBTW.innerText = parseFloat(totalExBTW.innerText).toFixed(2);
 elementTR.querySelector('#productPriceTotalBtw').innerText  =  parseFloat(elementTR.querySelector('#productPriceTotalBtw').innerText).toFixed(2);
    } else {
        console.log('Cannot go less than 1');
    }

}

event.preventDefault();
}


问:
Depends on vulnerable versions of json5
I am trying to install new version(8.83.27) of Laravel with breeze.
Did these steps and I got error while installing npm

```<code>    php artisan breeze:install vue

    php artisan migrate
    npm install
</code>```

Output:

```<code>> Will install laravel-mix@0.8.9, which is a breaking change
> node_modules/img-loader/node_modules/json5
> node_modules/vue-style-loader/node_modules/json5   loader-utils
> <=1.4.2   Depends on vulnerable versions of json5
> node_modules/img-loader/node_modules/loader-utils
> node_modules/vue-style-loader/node_modules/loader-utils
>     img-loader  *
>     Depends on vulnerable versions of loader-utils
>     node_modules/img-loader
>       laravel-mix  >=0.9.0
>       Depends on vulnerable versions of img-loader
>       Depends on vulnerable versions of vue-style-loader
>       node_modules/laravel-mix
>     vue-style-loader  *
>     Depends on vulnerable versions of loader-utils
>     node_modules/vue-style-loader
>
> 5 high severity vulnerabilities
</code>```

Title: Depends on vulnerable versions of json5

Body:
I am trying to install new version(8.83.27) of Laravel with breeze.
Did these steps and I got error while installing npm

    php artisan breeze:install vue

    php artisan migrate
    npm install

Output:

> Will install laravel-mix@0.8.9, which is a breaking change
> node_modules/img-loader/node_modules/json5
> node_modules/vue-style-loader/node_modules/json5   loader-utils
> <=1.4.2   Depends on vulnerable versions of json5
> node_modules/img-loader/node_modules/loader-utils
> node_modules/vue-style-loader/node_modules/loader-utils
>     img-loader  *
>     Depends on vulnerable versions of loader-utils
>     node_modules/img-loader
>       laravel-mix  >=0.9.0
>       Depends on vulnerable versions of img-loader
>       Depends on vulnerable versions of vue-style-loader
>       node_modules/laravel-mix
>     vue-style-loader  *
>     Depends on vulnerable versions of loader-utils
>     node_modules/vue-style-loader
>
> 5 high severity vulnerabilities


问:
Sticky not sticking
I can't work out why this isn't sticking. The exact CSS works on other pages I've used it on.

 body {
   min-height: 200vh;
 }
.link {
  background-color: white;
  list-style-type: none;
  text-align: center;
  padding: 0;
  margin: 10;
  position: sticky;
  top: 10px;
}

.link li {
  display: inline-block;
  font-size: 20px;
  padding: 20px;
  position: sticky;
  top: 10px;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><ul class="link">
  <li>Home</li>
  <li>Services</li>
  <li>Contact</li>
</ul></code>```

I've removed the domain as the client doesn't yet want the site publicised at all

Title: Sticky not sticking

Body:
I can't work out why this isn't sticking. The exact CSS works on other pages I've used it on.

 body {
   min-height: 200vh;
 }
.link {
  background-color: white;
  list-style-type: none;
  text-align: center;
  padding: 0;
  margin: 10;
  position: sticky;
  top: 10px;
}

.link li {
  display: inline-block;
  font-size: 20px;
  padding: 20px;
  position: sticky;
  top: 10px;
}

Home

Services

Contact

I've removed the domain as the client doesn't yet want the site publicised at all


问:
Visual Studio Xamarin missing multiplatform library template for NuGet
My goal is to create a multi-platform Xamarin library that is to be used by Xamarin.Forms application for iOS and Android. About 10% of the library code is going to be platform-specific (bluetooth communication). The library is plain C#, it won't use any Xamarin.Forms or platform-specific graphics. In the end I would like to add the library as a NuGet package.

I planned to implement the library using the multiplatform library template for NuGet. The problem is that I don't see the template at all (look at the pictures below). I'm using Visual Studio for Mac 2022 (version 17.4.2).

Templates I should see (according to docs):

Templates I actually see:

Visual Studio Installation:

Questions:

Is the "Multiplatform library" still supported in Visual Studio for Mac? (as of 31.12.2022)

If it is supported, what am I missing?

If it is no longer supported then how would I create the library I described? I'm a bit new to the Xamarin ecosystem.


问:
Enable uwsgi in Dockerfile multi-stage build
i have a Dockerfile like this. i want to dockerize my flask app with uwsgi, nginx.

my directory structure is:

```<code>.
├── Dockerfile
├── api
│   ├── __init__.py
│   ├── db.py
│   ├── ma.py
│   ├── models
│   ├── resources
│   ├── schemas
│   └── utils
├── app.py
├── config
│   ├── __init__.py
│   ├── common.py
│   ├── dev.py
│   ├── prod.py
│   └── test.py
├── deploy
│   ├── entrypoint.sh
│   ├── nginx.conf
│   └── uwsgi.ini
├── dockers
├── flastagram.db
├── migrations
│   ├── README
│   ├── alembic.ini
│   ├── env.py
│   ├── script.py.mako
│   └── versions
├── requirements
│   ├── common.txt
│   ├── dev.txt
│   └── prod.txt
├── requirements.txt
├── static
│   └── images
├── tests
│   ├── __init__.py
│   ├── test_comment.py
│   ├── test_post.py
│   └── test_user.py
└── utils
    └── flask_uploads.py
</code>```

and my dockerfile is like this:

```<code>################
# PYTHON STAGE #
################
FROM python:3.10 AS python-runtime
COPY ./requirements /app/requirements
RUN ls /app/requirements
RUN pip3 install --user --upgrade pip && \
    pip install -r /app/requirements/prod.txt

###############
# FINAL STAGE #
###############
FROM nginx
COPY --from=python-runtime /app /python-runtime
COPY . /app
WORKDIR /app
RUN chmod +x deploy/entrypoint.sh
ENTRYPOINT [ "deploy/entrypoint.sh" ]
</code>```

when i build and run this image, dockerfile container logs have a error message like below:

2022-12-31 21:21:34 deploy/entrypoint.sh: line 7: uwsgi: command not found

and it is sure that my docker image installed uwsgi. (when i build docker image, console shows this)

```<code>#10 41.96 Successfully installed Flask-2.2.2 Flask-JWT-Extended-4.4.4 Flask-Migrate-3.1.0 Flask-RESTful-0.3.9 Flask-SQLAlchemy-2.5.1 Jinja2-3.1.2 Mako-1.2.4 MarkupSafe-2.1.1 PyJWT-2.4.0 SQLAlchemy-1.4.41 Werkzeug-2.2.2 alembic-1.9.1 aniso8601-9.0.1 click-8.1.3 flask-cors-3.0.10 flask-marshmallow-0.14.0 greenlet-2.0.1 itsdangerous-2.1.2 marshmallow-3.19.0 marshmallow-sqlalchemy-0.28.1 packaging-22.0 psycopg2-binary-2.9.5 python-dotenv-0.21.0 pytz-2022.7 six-1.16.0 uwsgi-2.0.21
</code>```

what i want to do is enable uwsgi in final stage. i used multi-stage build to reduce image volume.

under dockerfile image which i writed first worked fine.. but it is 1.04 GB..isnt this too big?

```<code>FROM python:3.10

RUN apt-get update && apt-get install -y \
    build-essential \
    nginx

COPY . /app
WORKDIR /app

RUN pip3 install --upgrade pip && \
    pip install -r requirements.txt

RUN chmod +x deploy/entrypoint.sh
ENTRYPOINT [ "deploy/entrypoint.sh" ]
</code>```

what's the best solution to dockerize my python app?

i tried install uwsgi in final stage..

Body:
i have a Dockerfile like this. i want to dockerize my flask app with uwsgi, nginx.

my directory structure is:

.
├── Dockerfile
├── api
│   ├── __init__.py
│   ├── db.py
│   ├── ma.py
│   ├── models
│   ├── resources
│   ├── schemas
│   └── utils
├── app.py
├── config
│   ├── __init__.py
│   ├── common.py
│   ├── dev.py
│   ├── prod.py
│   └── test.py
├── deploy
│   ├── entrypoint.sh
│   ├── nginx.conf
│   └── uwsgi.ini
├── dockers
├── flastagram.db
├── migrations
│   ├── README
│   ├── alembic.ini
│   ├── env.py
│   ├── script.py.mako
│   └── versions
├── requirements
│   ├── common.txt
│   ├── dev.txt
│   └── prod.txt
├── requirements.txt
├── static
│   └── images
├── tests
│   ├── __init__.py
│   ├── test_comment.py
│   ├── test_post.py
│   └── test_user.py
└── utils
    └── flask_uploads.py

and my dockerfile is like this:

################
# PYTHON STAGE #
################
FROM python:3.10 AS python-runtime
COPY ./requirements /app/requirements
RUN ls /app/requirements
RUN pip3 install --user --upgrade pip && \
    pip install -r /app/requirements/prod.txt

###############
# FINAL STAGE #
###############
FROM nginx
COPY --from=python-runtime /app /python-runtime
COPY . /app
WORKDIR /app
RUN chmod +x deploy/entrypoint.sh
ENTRYPOINT [ "deploy/entrypoint.sh" ]

when i build and run this image, dockerfile container logs have a error message like below:

2022-12-31 21:21:34 deploy/entrypoint.sh: line 7: uwsgi: command not found

and it is sure that my docker image installed uwsgi. (when i build docker image, console shows this)

#10 41.96 Successfully installed Flask-2.2.2 Flask-JWT-Extended-4.4.4 Flask-Migrate-3.1.0 Flask-RESTful-0.3.9 Flask-SQLAlchemy-2.5.1 Jinja2-3.1.2 Mako-1.2.4 MarkupSafe-2.1.1 PyJWT-2.4.0 SQLAlchemy-1.4.41 Werkzeug-2.2.2 alembic-1.9.1 aniso8601-9.0.1 click-8.1.3 flask-cors-3.0.10 flask-marshmallow-0.14.0 greenlet-2.0.1 itsdangerous-2.1.2 marshmallow-3.19.0 marshmallow-sqlalchemy-0.28.1 packaging-22.0 psycopg2-binary-2.9.5 python-dotenv-0.21.0 pytz-2022.7 six-1.16.0 uwsgi-2.0.21

what i want to do is enable uwsgi in final stage. i used multi-stage build to reduce image volume.

under dockerfile image which i writed first worked fine.. but it is 1.04 GB..isnt this too big?

FROM python:3.10

RUN apt-get update && apt-get install -y \
    build-essential \
    nginx

COPY . /app
WORKDIR /app

RUN pip3 install --upgrade pip && \
    pip install -r requirements.txt

RUN chmod +x deploy/entrypoint.sh
ENTRYPOINT [ "deploy/entrypoint.sh" ]

what's the best solution to dockerize my python app?

i tried install uwsgi in final stage..


问:
Getting error when trying to use fredapi in python
I am trying to simply use the fredapi to pull a series from FRED text but I am getting an error.

I'm guessing the issue is with the API key but not sure.

Here is the code I executed

```<code>import pandas as pd
from fredapi import Fred

# Replace YOUR_API_KEY with your FRED API key
api_key = 'my_key'

# Create a FRED API instance using your API key
fred = Fred(api_key = api_key)

# Extract the series data from FRED
series_data = fred.get_series('SP500')

# Print the series data
print(series_data)
</code>```

Here is the error I got:

/Users/PycharmProjects/Email/venv/bin/python /Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py --multiprocess --qt-support=auto --client 127.0.0.1 --port 49337 --file /Users/PycharmProjects/Email/main.py
Connected to pydev debugger (build 223.8214.51)
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 975, in send
    self.connect()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1454, in connect
    self.sock = self._context.wrap_socket(self.sock,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 517, in wrap_socket
    return self.sslsocket_class._create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 1075, in _create
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 1346, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/PycharmProjects/Email/venv/lib/python3.11/site-packages/fredapi/fred.py", line 64, in __fetch_data
    response = urlopen(url)
               ^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 519, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)>
python-BaseException

Process finished with exit code 1
```

Body:
I am trying to simply use the fredapi to pull a series from FRED text but I am getting an error.

I'm guessing the issue is with the API key but not sure.

Here is the code I executed

import pandas as pd
from fredapi import Fred

# Replace YOUR_API_KEY with your FRED API key
api_key = 'my_key'

# Create a FRED API instance using your API key
fred = Fred(api_key = api_key)

# Extract the series data from FRED
series_data = fred.get_series('SP500')

# Print the series data
print(series_data)

Here is the error I got:

/Users/PycharmProjects/Email/venv/bin/python /Applications/PyCharm CE.app/Contents/plugins/python-ce/helpers/pydev/pydevd.py --multiprocess --qt-support=auto --client 127.0.0.1 --port 49337 --file /Users/PycharmProjects/Email/main.py
Connected to pydev debugger (build 223.8214.51)
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1348, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1282, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1328, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1277, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1037, in _send_output
    self.send(msg)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 975, in send
    self.connect()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1454, in connect
    self.sock = self._context.wrap_socket(self.sock,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 517, in wrap_socket
    return self.sslsocket_class._create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 1075, in _create
    self.do_handshake()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py", line 1346, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/PycharmProjects/Email/venv/lib/python3.11/site-packages/fredapi/fred.py", line 64, in __fetch_data
    response = urlopen(url)
               ^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 519, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1391, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/urllib/request.py", line 1351, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)>
python-BaseException

Process finished with exit code 1


问:
error: package R does not exist after renaming package
I want to upload my app to Google play store. After uploading the signed aab file in play console, I got this error:

You need to use a different package name because "com.example" is restricted.

So, I went to my android studio project and renamed my package. Now I constantly keep on getting the error:

error: package R does not exist

I changed the package name in my manifest file, and also tried cleaning and rebuilding the project. But it's not working. How do I resolve this issue?

Error

If I use com.example.electric_viewing.R then it works. Why?


问:
Why the notepad is close when I run my application as scheduled task but it works when I run it manually?
I have a gRPC service that open the notepad when it receives the command from the client.

This gRPC service is hosted in an ASP Core application.

I have realized that when I run the ASP core application manually and I request the command, the notepad is opened and keep open.

However, if I create a scheduled task that run my ASP application, when I request to open the notepad, the notepad is opened and close it immediately. I can't see the windows, but if I open the task manager, I can see that the process starts and closes.

Why the behavior is different when I run the application directly than when I run the application as scheduled task?

This is  the code that I use to open the notepad:

```<code>    ProcessStartInfo miProcessStartInfo = new ProcessStartInfo();
    miProcessStartInfo.FileName = "notepad.exe";
    miProcessStartInfo.WindowStyle = ProcessWindowStyle.Normal;
    miProcessStartInfo.CreateNoWindow = false;

    using (Process? miProceso = Process.Start(miProcessStartInfo))
    {
        if (miProceso == null)
        {
            throw GetRpcException($"Error indeterminado al interntar ejecutar la acción {paramRequest.NombreAccion} de la aplicación {paramRequest.NombreAplicacion}.");
        }
   }
</code>```

Thanks.

Body:
I have a gRPC service that open the notepad when it receives the command from the client.

This gRPC service is hosted in an ASP Core application.

I have realized that when I run the ASP core application manually and I request the command, the notepad is opened and keep open.

However, if I create a scheduled task that run my ASP application, when I request to open the notepad, the notepad is opened and close it immediately. I can't see the windows, but if I open the task manager, I can see that the process starts and closes.

Why the behavior is different when I run the application directly than when I run the application as scheduled task?

This is  the code that I use to open the notepad:

    ProcessStartInfo miProcessStartInfo = new ProcessStartInfo();
    miProcessStartInfo.FileName = "notepad.exe";
    miProcessStartInfo.WindowStyle = ProcessWindowStyle.Normal;
    miProcessStartInfo.CreateNoWindow = false;

    using (Process? miProceso = Process.Start(miProcessStartInfo))
    {
        if (miProceso == null)
        {
            throw GetRpcException($"Error indeterminado al interntar ejecutar la acción {paramRequest.NombreAccion} de la aplicación {paramRequest.NombreAplicacion}.");
        }
   }

Thanks.


问:
Problem arduino uno sketch and sim 800l modem
The code works ok on the serial monitor and I can ses in the serial monitor that the code makes the AT command for sending a reply by sms but it doesn't send and I can't control the sketch by SMS.

I can't figure out what goes wrong. It's a long sketch so I try to set the parts of the code where the code is for the modem.

```<code>#include <SoftwareSerial.h>
const uint8_t rxPin = 2;
const uint8_t txPin = 3;

</code>```

SoftwareSerial sim800(2, 3); // SIM800L rx og tx til pin 2 and 3
#define sim800 Serial

```<code>void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ; // Wait for serial monitor to open
  }
  sim800.begin(9600);
  while (!sim800) {
    ;  // Wait for SIM800L module to start
  }
  sim800.println("AT");
  delay(1000);
  // Read response from SIM800L module
  while (sim800.available()) {
    String response = sim800.readString();
    Serial.println(response);
</code>```
```<code>if (sim800.available())
  {
    String message = sim800.readString();
    Serial.println(message);
    message.trim();
    message.toUpperCase();

    if(message.indexOf("ARM") >= 0) // ARM DISARM COMMAND
    {
          if(message.indexOf("DISARM") == 0)
          {
             armed = false;
             send_SMS("DISARMED!");
</code>```
```<code>void send_SMS(const char *message)
{
   sim800.println("AT+CMGF=1");  // Set SMS mode to text
   delay(100);
   sim800.println("AT+CMGS=\"+123456789\""); // telefon nummer
   sim800.println(message);
   sim800.println((char)26); // send SMS
</code>```

I can't figure out where the error is.

Body:
The code works ok on the serial monitor and I can ses in the serial monitor that the code makes the AT command for sending a reply by sms but it doesn't send and I can't control the sketch by SMS.

I can't figure out what goes wrong. It's a long sketch so I try to set the parts of the code where the code is for the modem.

#include <SoftwareSerial.h>
const uint8_t rxPin = 2;
const uint8_t txPin = 3;

SoftwareSerial sim800(2, 3); // SIM800L rx og tx til pin 2 and 3
#define sim800 Serial

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ; // Wait for serial monitor to open
  }
  sim800.begin(9600);
  while (!sim800) {
    ;  // Wait for SIM800L module to start
  }
  sim800.println("AT");
  delay(1000);
  // Read response from SIM800L module
  while (sim800.available()) {
    String response = sim800.readString();
    Serial.println(response);

if (sim800.available())
  {
    String message = sim800.readString();
    Serial.println(message);
    message.trim();
    message.toUpperCase();

    if(message.indexOf("ARM") >= 0) // ARM DISARM COMMAND
    {
          if(message.indexOf("DISARM") == 0)
          {
             armed = false;
             send_SMS("DISARMED!");

void send_SMS(const char *message)
{
   sim800.println("AT+CMGF=1");  // Set SMS mode to text
   delay(100);
   sim800.println("AT+CMGS=\"+123456789\""); // telefon nummer
   sim800.println(message);
   sim800.println((char)26); // send SMS

I can't figure out where the error is.


问:
Syncing multiple videos over network efficiently on iOS
I am trying to play multiple videos together in synchronisation (they are all the same length) on iOS. To make this efficient over internet I have transcoded these videos to HLS, however when I try and synchronise them using AVPlayer it turns out that I cannot control the source clock they use (this only works on local files) and I cannot control the rate (so I can't do minor corrections to bring these videos in sync).

To solve this I have currently downloaded the flat mpg files and then play them in sync using the source clock, however this is very bandwidth intensive. Does anyone know some ways I can achieve better network efficiency while managing to keep these files in sync?


问:
Send e-commerce events in AngularFireAnalytics
Google Analytics has some predefined events for online sales and the syntax is

```<code>gtag("event", "purchase", {
    transaction_id: "T_12345",
    affiliation: "Google Merchandise Store",
    value: 25.42,
    tax: 4.90
})
</code>```

https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag#purchase

However, in the documentation of AngularFireAnalytics, the syntax is similar for logging simple events

https://github.com/angular/angularfire/blob/master/docs/analytics/getting-started.md

```<code>import { AngularFireAnalytics } from '@angular/fire/analytics';
constructor(private analytics: AngularFireAnalytics) {}

this.analytics.logEvent('subscription_created');
</code>```

But how do you log Online Sales events?

This might help: https://firebase.google.com/docs/reference/js/v8/firebase.analytics.Analytics#logevent
https://firebase.google.com/docs/reference/js/v8/firebase.analytics.Analytics#parameters_9

Body:
Google Analytics has some predefined events for online sales and the syntax is

gtag("event", "purchase", {
    transaction_id: "T_12345",
    affiliation: "Google Merchandise Store",
    value: 25.42,
    tax: 4.90
})

https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag#purchase

However, in the documentation of AngularFireAnalytics, the syntax is similar for logging simple events

https://github.com/angular/angularfire/blob/master/docs/analytics/getting-started.md

import { AngularFireAnalytics } from '@angular/fire/analytics';
constructor(private analytics: AngularFireAnalytics) {}

this.analytics.logEvent('subscription_created');

But how do you log Online Sales events?

This might help: https://firebase.google.com/docs/reference/js/v8/firebase.analytics.Analytics#logevent
https://firebase.google.com/docs/reference/js/v8/firebase.analytics.Analytics#parameters_9


问:
Drag and drop list with hierarchy/nested behavior
I only want to do this with vanilla javascript. But if there is some lightweight library I might reconsider. Anyway, I basically want to emulate a file system with a list of elements.

```<code><div class="container" >
   <div class="item draggable" draggable> First </div>
   <div class="children-nodes">
       <div class="container" >
           <div class="item draggable" draggable> First </div>
           <div class="children-nodes">
           </div>
       </div>
   </div>
</div>
</code>```

As you can see in my HTML structure. Each container can be dragged and placed inside another .children-nodes, however the items themselves can also be dragged and moved around in the hierarchy. There are multiple of these containers with items nested inside eachother. I have written several algorithms to try to make this work I just can't seem to make it happen. I get errors like "new child contains parent" and etc.

Here's the latest logic i tried:

```<code>const draggables = document.querySelectorAll('.draggable');

draggables.forEach(draggable => {
    draggable.addEventListener('dragstart', () => {
        draggable.classList.add('is-dragging');
    })

    draggable.addEventListener('dragend', () => {
        draggable.classList.remove('is-dragging');
    })

    draggable.addEventListener('dragover', (event) => {
        event.stopPropagation()
        event.preventDefault();

        if(!draggable.classList.contains('.is-dragging')){
            const item = document.querySelector('.is-dragging');
            const containerOfItem = document.querySelector('.container:has(.is-dragging)');
            const childrenContainer = containerOfItem.querySelector('.children-nodes');
            const children = childrenContainer.querySelectorAll('div');
            if(children.length == 0) {
                const childrenDropContainer = draggable.parentNode.querySelector('.children-nodes');
                childrenDropContainer.appendChild(containerOfItem);
            } else {

            }
        }
    })
})
</code>```

And like I said. I've written it multiple different ways. I changed the markup too and searched around for some information. The kind of help that I would want would be what to consider, in which direction should I move, how do I solve this problem. Any help is gladly received.

Body:
I only want to do this with vanilla javascript. But if there is some lightweight library I might reconsider. Anyway, I basically want to emulate a file system with a list of elements.

 First

 First

As you can see in my HTML structure. Each container can be dragged and placed inside another .children-nodes, however the items themselves can also be dragged and moved around in the hierarchy. There are multiple of these containers with items nested inside eachother. I have written several algorithms to try to make this work I just can't seem to make it happen. I get errors like "new child contains parent" and etc.

Here's the latest logic i tried:

const draggables = document.querySelectorAll('.draggable');

draggables.forEach(draggable => {
    draggable.addEventListener('dragstart', () => {
        draggable.classList.add('is-dragging');
    })

    draggable.addEventListener('dragend', () => {
        draggable.classList.remove('is-dragging');
    })

    draggable.addEventListener('dragover', (event) => {
        event.stopPropagation()
        event.preventDefault();

        if(!draggable.classList.contains('.is-dragging')){
            const item = document.querySelector('.is-dragging');
            const containerOfItem = document.querySelector('.container:has(.is-dragging)');
            const childrenContainer = containerOfItem.querySelector('.children-nodes');
            const children = childrenContainer.querySelectorAll('div');
            if(children.length == 0) {
                const childrenDropContainer = draggable.parentNode.querySelector('.children-nodes');
                childrenDropContainer.appendChild(containerOfItem);
            } else {

            }
        }
    })
})

And like I said. I've written it multiple different ways. I changed the markup too and searched around for some information. The kind of help that I would want would be what to consider, in which direction should I move, how do I solve this problem. Any help is gladly received.


问:
I am getting error while deploying epic Game (pixel streaming app ) on AWS eks . when am applied matchmaker .ymal file
I am getting error while deploying epic game (pixel streaming app) on AWS eks.
When I applied the matchmaker.ymal file I checked that my matchmaker pod was not running.  The current state of the matchmaker pod is in back loop crash-off.  How to solve the issue.
Getting this error-

```<code>kubectl logs matchmaker-68c69f56b8-sc9jm -n ue4
Defaulted container "matchmaker" out of: matchmaker, copy (init)
/app/matchmaker.js:21
var configFile = (typeof argv.configFile != 'undefined') ? argv.configFile.toString() : path.join(__dirname, 'config.json');
                                                                                ^

ReferenceError: Cannot access 'path' before initialization
    at Object.<anonymous> (/app/matchmaker.js:21:89)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (/app/wrapper.js:219:40)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
</code>```

Please anybody help me

Body:
I am getting error while deploying epic game (pixel streaming app) on AWS eks.
When I applied the matchmaker.ymal file I checked that my matchmaker pod was not running.  The current state of the matchmaker pod is in back loop crash-off.  How to solve the issue.
Getting this error-

kubectl logs matchmaker-68c69f56b8-sc9jm -n ue4
Defaulted container "matchmaker" out of: matchmaker, copy (init)
/app/matchmaker.js:21
var configFile = (typeof argv.configFile != 'undefined') ? argv.configFile.toString() : path.join(__dirname, 'config.json');
                                                                                ^

ReferenceError: Cannot access 'path' before initialization
    at Object.<anonymous> (/app/matchmaker.js:21:89)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (/app/wrapper.js:219:40)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)

Please anybody help me


问:
Starting Excel workbook from Python deletes Custom ribbon
I have a custom ribbon in Excel with macros assigned to it. One set of macros does just sheet/column formatting, sort data etc. Normal Excel stuff. Those all works.

Then I have two specific macros that removes the custom ribbon completely when they execute. Well, after the executed the Custom ribbon is gone.
After running these macros the customUI14.xml file is gone completely. The .xml file is just not there using the ‘Office RibbonX Editor’. The reference to the customUI14.xml file is also gone from within the _rels file.

These two macros each call a Python file outside Excel. The one macro calls a exe that automatically imports csv file and the other does all the formala calculation externally. No formulas in this sheet.

These macros runs fine with a custom ribbon that is created using the standard options in Excel. This same ribbon is displayed then on every excel menu.
They run fine when running the Macro directly or through the VB interface when using the standard ribbon with macros assigned to it..

I created a custom ribbon is just for this sheet using ‘Office RibbonX Editor’. Don’t want the same custom ribbon throughout Excel.

No funny ad-ons installed.
The Dir/folder I work from is set as ‘Trusted’ in the ‘Trusted locations’ in Excel.
This is on standalone PC. No network. No permission issues.
Running: Windows10 Pro 21H2 + Office Prof Plus 2019.

I will appreciate some input as to why this happens and how I can resolve this.
This is a serious issue for me for a project I'm working on for myself.

Thank you.

See below my customUI14.xml file and the two macros that destroys it.
Macros: Sub Import_CSV_Data_file + Sub Calculate_Stats.

```<code>> <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
    <ribbon>
        <tabs>
            <tab id="HelpTab" visible="false"/>
            <tab id="c1.15050BD" label="ITTA">
                <group id="c1.151240B" label="DATA" imageMso="RecordsRefreshMenu" autoScale="true">
                    <button id="GTS.xlsm_Import_CSV_Data_file_0_15C570C" label="Import_CSV_Data_file" imageMso="SmartArtLayoutGallery" size="large" onAction="D:\Temp\01-Excel\GTS.xlsm!Import_CSV_Data_file" visible="true"/>
                    <button id="GTS.xlsm_Calculate_Stats_1_15C570C" label="Calculate_Stats" imageMso="OutlineSubtotals" size="large" onAction="D:\Temp\01-Excel\GTS.xlsm!Calculate_Stats" visible="true"/>
                </group>
                <group id="c1.1580F39" label="DATA Sheet" autoScale="true">
                    <button id="GTS.xlsm_Format_Columns_DATA_Sheet_2_15C570C" label="Format Column Layout" imageMso="HorizontalSpacingDecrease" size="large" onAction="D:\Temp\01-Excel\GTS.xlsm!Format_Columns_DATA_Sheet" visible="true"/>
                    <button id="GTS.xlsm_Sort_by_Date_and_ID_3_15C570C" label="Sort Date && ID" imageMso="_3DPerspectiveDecrease" size="large" onAction="D:\Temp\01-Excel\GTS.xlsm!Sort_by_Date_and_ID" visible="true"/>
                    <button id="GTS.xlsm_Sort_by_Seq_Date_4_15C570C" label="Sort Date && Sequence" imageMso="_3DPerspectiveIncrease" size="large" onAction="D:\Temp\01-Excel\GTS.xlsm!Sort_by_Seq_Date" visible="true"/>
                </group>
                <group id="c5.15B8EEA" label="SINGLE Sheet" autoScale="true">
                    <button id="GTS.xlsm_SingleSheet_Format_5_15C570C" label="Format layout && Sort" imageMso="HorizontalSpacingIncrease" size="large" onAction="D:\Temp\01-Excel\GTS.xlsm!SingleSheet_Format" visible="true"/>
                </group>
            </tab>
        </tabs>
    </ribbon>
</customUI>

Sub Import_CSV_Data_file(control As IRibbonControl)

'Imports csv file in to Excel sheet.
'How? Executes an external exe file (python converted to exe) that does the import so I dont have to click that many times.

'call another macro that "cleans-up" the sheet - good to have but not a serious requirement.
    Call ALL_Del_Sort_Format_DATA_Sheet

'Saves the active workbook before closing it.
    ActiveWorkbook.Save

'Waits 2 sec after previous command just in case.
    Application.Wait (Now + TimeValue("0:00:02"))

'Calls external Python file that does the calculations.
    Call Shell("explorer D:\Temp\GTS\03-Code\import_csv.py\import_csv.lnk", vbNormalFocus)

'Closes the workbook so the exe can write to the Excel file.
    ActiveWorkbook.Close

'The Python script opens the same workbook again after it's done it's job.

End Sub

Sub Calculate_Stats(control As IRibbonControl)

'Calls a Python converted to exe file that does all the formula calculations outside Excel.

'call another macro that "cleans-up" the sheet - good to have but not a serious requirement.
    Call ALL_Del_Sort_Format_DATA_Sheet

    ActiveWorkbook.Save
    Application.Wait (Now + TimeValue("0:00:02"))
    Call Shell("explorer D:\Temp\GTS\03-Code\main.dist\main.py", vbNormalFocus)

    ActiveWorkbook.Close

End Sub
</code>```

Body:
I have a custom ribbon in Excel with macros assigned to it. One set of macros does just sheet/column formatting, sort data etc. Normal Excel stuff. Those all works.

Then I have two specific macros that removes the custom ribbon completely when they execute. Well, after the executed the Custom ribbon is gone.
After running these macros the customUI14.xml file is gone completely. The .xml file is just not there using the ‘Office RibbonX Editor’. The reference to the customUI14.xml file is also gone from within the _rels file.

These two macros each call a Python file outside Excel. The one macro calls a exe that automatically imports csv file and the other does all the formala calculation externally. No formulas in this sheet.

These macros runs fine with a custom ribbon that is created using the standard options in Excel. This same ribbon is displayed then on every excel menu.
They run fine when running the Macro directly or through the VB interface when using the standard ribbon with macros assigned to it..

I created a custom ribbon is just for this sheet using ‘Office RibbonX Editor’. Don’t want the same custom ribbon throughout Excel.

No funny ad-ons installed.
The Dir/folder I work from is set as ‘Trusted’ in the ‘Trusted locations’ in Excel.
This is on standalone PC. No network. No permission issues.
Running: Windows10 Pro 21H2 + Office Prof Plus 2019.

I will appreciate some input as to why this happens and how I can resolve this.
This is a serious issue for me for a project I'm working on for myself.

Thank you.

See below my customUI14.xml file and the two macros that destroys it.
Macros: Sub Import_CSV_Data_file + Sub Calculate_Stats.

> <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
    <ribbon>
        <tabs>
            <tab id="HelpTab" visible="false"/>
            <tab id="c1.15050BD" label="ITTA">
                <group id="c1.151240B" label="DATA" imageMso="RecordsRefreshMenu" autoScale="true">
                    <button id="GTS.xlsm_Import_CSV_Data_file_0_15C570C" label="Import_CSV_Data_file" imageMso="SmartArtLayoutGallery" size="large" onAction="D:\Temp\01-Excel\GTS.xlsm!Import_CSV_Data_file" visible="true"/>
                    <button id="GTS.xlsm_Calculate_Stats_1_15C570C" label="Calculate_Stats" imageMso="OutlineSubtotals" size="large" onAction="D:\Temp\01-Excel\GTS.xlsm!Calculate_Stats" visible="true"/>
                </group>
                <group id="c1.1580F39" label="DATA Sheet" autoScale="true">
                    <button id="GTS.xlsm_Format_Columns_DATA_Sheet_2_15C570C" label="Format Column Layout" imageMso="HorizontalSpacingDecrease" size="large" onAction="D:\Temp\01-Excel\GTS.xlsm!Format_Columns_DATA_Sheet" visible="true"/>
                    <button id="GTS.xlsm_Sort_by_Date_and_ID_3_15C570C" label="Sort Date && ID" imageMso="_3DPerspectiveDecrease" size="large" onAction="D:\Temp\01-Excel\GTS.xlsm!Sort_by_Date_and_ID" visible="true"/>
                    <button id="GTS.xlsm_Sort_by_Seq_Date_4_15C570C" label="Sort Date && Sequence" imageMso="_3DPerspectiveIncrease" size="large" onAction="D:\Temp\01-Excel\GTS.xlsm!Sort_by_Seq_Date" visible="true"/>
                </group>
                <group id="c5.15B8EEA" label="SINGLE Sheet" autoScale="true">
                    <button id="GTS.xlsm_SingleSheet_Format_5_15C570C" label="Format layout && Sort" imageMso="HorizontalSpacingIncrease" size="large" onAction="D:\Temp\01-Excel\GTS.xlsm!SingleSheet_Format" visible="true"/>
                </group>
            </tab>
        </tabs>
    </ribbon>
</customUI>

Sub Import_CSV_Data_file(control As IRibbonControl)

'Imports csv file in to Excel sheet.
'How? Executes an external exe file (python converted to exe) that does the import so I dont have to click that many times.

'call another macro that "cleans-up" the sheet - good to have but not a serious requirement.
    Call ALL_Del_Sort_Format_DATA_Sheet

'Saves the active workbook before closing it.
    ActiveWorkbook.Save

'Waits 2 sec after previous command just in case.
    Application.Wait (Now + TimeValue("0:00:02"))

'Calls external Python file that does the calculations.
    Call Shell("explorer D:\Temp\GTS\03-Code\import_csv.py\import_csv.lnk", vbNormalFocus)

'Closes the workbook so the exe can write to the Excel file.
    ActiveWorkbook.Close

'The Python script opens the same workbook again after it's done it's job.

End Sub

Sub Calculate_Stats(control As IRibbonControl)

'Calls a Python converted to exe file that does all the formula calculations outside Excel.

'call another macro that "cleans-up" the sheet - good to have but not a serious requirement.
    Call ALL_Del_Sort_Format_DATA_Sheet

    ActiveWorkbook.Save
    Application.Wait (Now + TimeValue("0:00:02"))
    Call Shell("explorer D:\Temp\GTS\03-Code\main.dist\main.py", vbNormalFocus)

    ActiveWorkbook.Close

End Sub


问:
R runnig in Ubuntu 22.04 on wsl2 cannot communicate with remote ubuntu server after updating to windows11 2022 autumn update
I used to do parallel computing with R, in which I had three computers connected on LAN; two windows 11 computers with wsl2 (ubuntu 22.04), and one ubuntu computer. The main computer runs an R script which controlled other two computers as slaves, each has 16 or 8 logical cores.  Since the main computer has 16 logical cores, I used to run 36 different sets of parameters simultaneously: 14 at the main, 15 and 7 at each slave computer.

The script I used to use was

```<code>   1   │   node1 <- "192.168.1.10" # A-wsl
   2   │   node2 <- "192.168.1.11" # B-wsl
   3   │   node3 <- "192.168.1.12" # C
   4   │   cl <- c(node1, node2, node3)
</code>```
```<code>  9   │   custom_workers <- function() {
  10   │     switch(Sys.info()[["nodename"]],
  11   │       "A" = 14L,
  12   │       "B" = 15L,
  13   │       "C" = 7L,
  14   │     )
</code>```
```<code>  22   │   plan(list(
  23   │     tweak(cluster, workers = cl),
  24   │     tweak(multisession, workers = custom_workers)
  25   │   ))

</code>```

Then I called future_map twice with nested structure, first allocating parameters for each computer, and then called again in each machine to allocate parameters for each node.

This worked just fine until recently.  However, I found the script does not work now, and interestingly, the master machine which runs source R script under wsl2 can control a slave wsl2 machine without a problem, but the master machine seems not communicate to the ubuntu slave machine, and future_map seems not send any data or script to the machine.

I ran the script on the main machine, and the wsl2 slave machine showed all the cores were being used, but the ubuntu machine showed no sign of using cores. As a result the script stops with error message, when the output from ubuntu machine are to be received.

Interestingly, I can control the ubuntu machine with ssh from the main machine.  So, I have no idea about what is happening here.  All I can remember is that this happened after I updated my windows 11 this fall and switched using systemd from genie's version to wsl2's native version, though I am not sure about this.

I need your help.  Any suggestion would be greatly appreciated.
Thank you.

Hiroto

Body:
I used to do parallel computing with R, in which I had three computers connected on LAN; two windows 11 computers with wsl2 (ubuntu 22.04), and one ubuntu computer. The main computer runs an R script which controlled other two computers as slaves, each has 16 or 8 logical cores.  Since the main computer has 16 logical cores, I used to run 36 different sets of parameters simultaneously: 14 at the main, 15 and 7 at each slave computer.

The script I used to use was

   1   │   node1 <- "192.168.1.10" # A-wsl
   2   │   node2 <- "192.168.1.11" # B-wsl
   3   │   node3 <- "192.168.1.12" # C
   4   │   cl <- c(node1, node2, node3)

  9   │   custom_workers <- function() {
  10   │     switch(Sys.info()[["nodename"]],
  11   │       "A" = 14L,
  12   │       "B" = 15L,
  13   │       "C" = 7L,
  14   │     )

  22   │   plan(list(
  23   │     tweak(cluster, workers = cl),
  24   │     tweak(multisession, workers = custom_workers)
  25   │   ))

Then I called future_map twice with nested structure, first allocating parameters for each computer, and then called again in each machine to allocate parameters for each node.

This worked just fine until recently.  However, I found the script does not work now, and interestingly, the master machine which runs source R script under wsl2 can control a slave wsl2 machine without a problem, but the master machine seems not communicate to the ubuntu slave machine, and future_map seems not send any data or script to the machine.

I ran the script on the main machine, and the wsl2 slave machine showed all the cores were being used, but the ubuntu machine showed no sign of using cores. As a result the script stops with error message, when the output from ubuntu machine are to be received.

Interestingly, I can control the ubuntu machine with ssh from the main machine.  So, I have no idea about what is happening here.  All I can remember is that this happened after I updated my windows 11 this fall and switched using systemd from genie's version to wsl2's native version, though I am not sure about this.

I need your help.  Any suggestion would be greatly appreciated.
Thank you.

Hiroto


问:
How to block a Connection with information given by GetExtendedTcpTable with c++?
Is it possible to block/allow a Connection by IP, Port, PID or other information given by the GetExtendedTcpTable function? (TCP, IPV4)

I have been looking all day for something to update existing firewall rules using an API by providing an IP but could not find anything useful.

The closest thing I found is "Restricting Service" which would give me the option to pass the process name of a PID and block it. Issue is, how a process is not always a service and second, most of the time a service/process has different connections running.

Theoretically, Windows Filtering Platform or Windows Firewall Technologies should be either a solution to this, but the examples given are not very helpful and clear to me.


问:
Blob video empty
What I'm doing here is sending 3 seconds of continuous stream to the server as blob. The server combines all blobs stored into a single blob and sends it to the other clients connected. The client then plays the video. Everything works but the video when played is empty. Here's the code I'm using:

Client side:

```<code>//sends to server
const sendBlob = async (data) => {
 //const blobText = await data.text();
 socket.emit("senderBlob", data);
};

//gets user's video
const getUserMedia = () => {
navigator.mediaDevices
  .getUserMedia(constraints)
  .then((stream) => {
    mediaStream = stream.getTracks()[0];
    const mediaRecorder = new MediaRecorder(stream);
    mediaRecorder.start(3000);

    mediaRecorder.ondataavailable = (data) => sendBlob(data.data);
  })
  .catch((e) => console.log(e));
};

//received blob
socket.on("vidBlob", (recievedData) => {
  //const blob = new Blob([recievedData], { type: "video/mp4" });
  setVideoSrc(URL.createObjectURL(recievedData));
  console.log(URL.createObjectURL(recievedData));
});
</code>```

Server side:

```<code>var prevBlobs = [];

const pushandGetBlob = (newBlob) => {
  prevBlobs.push(newBlob);
  const blob = new Blob(prevBlobs, {
    type: "video/mp4",
  });
  //return await blob.text();
  return blob;
};

const app = express();
const httpServer = createServer(app);
const io = new Server(httpServer, {
  cors: {
    origin: "*",
  },
});

io.on("connection", (socket) => {
  socket.on("senderBlob", (data) => {
    //const newBlob = new Blob([data], { type: "video/mp4" });
    const vidBlob = pushandGetBlob(data);
    console.log(vidBlob);
    socket.broadcast.emit("vidBlob", vidBlob);
  });

  socket.on("clearVideos", async (_) => {
    prevBlobs = [];
  });
});
</code>```

httpServer.listen(8080);

Any help is appreciated!

Title: Blob video empty

Body:
What I'm doing here is sending 3 seconds of continuous stream to the server as blob. The server combines all blobs stored into a single blob and sends it to the other clients connected. The client then plays the video. Everything works but the video when played is empty. Here's the code I'm using:

Client side:

//sends to server
const sendBlob = async (data) => {
 //const blobText = await data.text();
 socket.emit("senderBlob", data);
};

//gets user's video
const getUserMedia = () => {
navigator.mediaDevices
  .getUserMedia(constraints)
  .then((stream) => {
    mediaStream = stream.getTracks()[0];
    const mediaRecorder = new MediaRecorder(stream);
    mediaRecorder.start(3000);

    mediaRecorder.ondataavailable = (data) => sendBlob(data.data);
  })
  .catch((e) => console.log(e));
};

//received blob
socket.on("vidBlob", (recievedData) => {
  //const blob = new Blob([recievedData], { type: "video/mp4" });
  setVideoSrc(URL.createObjectURL(recievedData));
  console.log(URL.createObjectURL(recievedData));
});

Server side:

var prevBlobs = [];

const pushandGetBlob = (newBlob) => {
  prevBlobs.push(newBlob);
  const blob = new Blob(prevBlobs, {
    type: "video/mp4",
  });
  //return await blob.text();
  return blob;
};

const app = express();
const httpServer = createServer(app);
const io = new Server(httpServer, {
  cors: {
    origin: "*",
  },
});

io.on("connection", (socket) => {
  socket.on("senderBlob", (data) => {
    //const newBlob = new Blob([data], { type: "video/mp4" });
    const vidBlob = pushandGetBlob(data);
    console.log(vidBlob);
    socket.broadcast.emit("vidBlob", vidBlob);
  });

  socket.on("clearVideos", async (_) => {
    prevBlobs = [];
  });
});

httpServer.listen(8080);

Any help is appreciated!


问:
Show Focus Terminal in VS Code
Recently, I clicked on the hide focus terminal in VS Code and now I don't know how to bring it back. Can someone help me with this?

I tried to find it on google but wasn't able to find so.

Title: Show Focus Terminal in VS Code


问:
Problem to create and run an inteliJ project
I got stucked on following problem:
I use

```<code>IntelliJ IDEA 2022.2.1
Spring 3.0.1
JDK 8.0351
java version "1.8.0_351"
Java(TM) SE Runtime Environment (build 1.8.0_351-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.351-b10, mixed mode)
</code>```

When Creating new project Eclipse Projects is shown up to the left

I select springboot initializer to create the project using
JDK 1.8.0351 and Java 17 then I get this error message ...selected Java version not supported.
selected Java version not supported

I change to Java 8 -> project created but pom file anyway contains

```<code>    <properties>
        <java.version>17</java.version>
    </properties>
</code>```

and I get this error when I run.

```<code>java: warning: source release 17 requires target release 17
Module padelup SDK 1.8 is not compatible with the source version 17.
Upgrade Module SDK in project settings to 17 or higher. Open project settings.
</code>```

I think there is some trash left from old versions of java, intelij, maven dependencies ...
somewhere in the disk, but have no idea how to make a thorough clean up without damaging
used apps/settings

Body:
I got stucked on following problem:
I use

IntelliJ IDEA 2022.2.1
Spring 3.0.1
JDK 8.0351
java version "1.8.0_351"
Java(TM) SE Runtime Environment (build 1.8.0_351-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.351-b10, mixed mode)

When Creating new project Eclipse Projects is shown up to the left

I select springboot initializer to create the project using
JDK 1.8.0351 and Java 17 then I get this error message ...selected Java version not supported.
selected Java version not supported

I change to Java 8 -> project created but pom file anyway contains

    <properties>
        <java.version>17</java.version>
    </properties>

and I get this error when I run.

java: warning: source release 17 requires target release 17
Module padelup SDK 1.8 is not compatible with the source version 17.
Upgrade Module SDK in project settings to 17 or higher. Open project settings.

I think there is some trash left from old versions of java, intelij, maven dependencies ...
somewhere in the disk, but have no idea how to make a thorough clean up without damaging
used apps/settings


问:
How can i remove any allauth page?
I want to remove signup, reset password, and change password page from allauth django app.
what should i do? because I need only login page.</p>

Title: How can i remove any allauth page?


问:
Convert MySQL query to Laravel models
SELECT
clockin.working_day as cdate,
clockin.,
sch_week.,
user.schedule_id,
user.username,
(
SELECT
GROUP_CONCAT(time separator '==')
from
clockin
WHERE
employee_no = user.employee_no
AND working_day = cdate
GROUP by
working_day
) as time
FROM
user_personal as user
JOIN clockin
inner join schedule_week as sch_week on user.schedule_id = sch_week.schedule_id
and week_day = date_format(working_day, '%a')
where
month(working_day) = month(
current_date()
)
GROUP by
user.employee_no,
clockin.working_day
ORDER by
clockin.working_day desc,
user.employee_no;

Title: Convert MySQL query to Laravel models


问:
Visual Studio error - Unknown compiler(s)
Versions:

```<code>jupyter core     : 4.6.3
jupyter-notebook : 6.1.4
qtconsole        : 4.7.7
ipython          : 8.5.0
ipykernel        : 5.3.4
jupyter client   : 6.1.7
jupyter lab      : 2.2.6
nbconvert        : 6.0.7
ipywidgets       : 7.5.1
nbformat         : 5.0.8
traitlets        : 5.0.5
</code>```

pip 22.3.1

I tried installing pmdarima using pip on Jupyter Notebook as well as Anaconda Promt, and encountered the same error as below. Kindly help me in figuring out how shall I get rid of this error.

```<code>!pip install pmdarima
</code>```

Error:

```<code>    Collecting pmdarima
      Using cached pmdarima-2.0.2.tar.gz (630 kB)
      Preparing metadata (setup.py): started
      Preparing metadata (setup.py): finished with status 'done'
    Requirement already satisfied: joblib>=0.11 in c:\users\hp\appdata\roaming\python\python38\site-packages (from pmdarima) (0.17.0)
    Requirement already satisfied: Cython!=0.29.18,!=0.29.31,>=0.29 in c:\users\hp\anaconda3\lib\site-packages (from pmdarima) (0.29.21)
    Requirement already satisfied: numpy>=1.21.2 in c:\users\hp\anaconda3\lib\site-packages (from pmdarima) (1.23.3)
    Requirement already satisfied: pandas>=0.19 in c:\users\hp\anaconda3\lib\site-packages (from pmdarima) (1.5.1)
    Requirement already satisfied: scikit-learn>=0.22 in c:\users\hp\appdata\roaming\python\python38\site-packages (from pmdarima) (0.23.2)
    Requirement already satisfied: scipy>=1.3.2 in c:\users\hp\appdata\roaming\python\python38\site-packages (from pmdarima) (1.5.2)
    Collecting statsmodels>=0.13.2
      Using cached statsmodels-0.13.5.tar.gz (18.4 MB)
      Installing build dependencies: started
      Installing build dependencies: finished with status 'error'

error: subprocess-exited-with-error

  pip subprocess to install build dependencies did not run successfully.
  exit code: 1

  [62 lines of output]
  Ignoring numpy: markers 'python_version == "3.10" and platform_system == "Windows" and platform_python_implementation != "PyPy"' don't match your environment
  Ignoring numpy: markers 'python_version >= "3.11"' don't match your environment
  Ignoring scipy: markers 'python_version == "3.7"' don't match your environment
  Ignoring scipy: markers 'python_version == "3.8" and platform_system == "Windows" and platform_machine == "x86"' don't match your environment
  Ignoring scipy: markers 'python_version == "3.9" and platform_system == "Windows" and platform_machine == "x86"' don't match your environment
  Ignoring scipy: markers 'python_version >= "3.12"' don't match your environment
  Collecting setuptools>=59.2.0
    Using cached setuptools-65.6.3-py3-none-any.whl (1.2 MB)
  Collecting wheel>=0.37.1
    Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
  Collecting cython<3,>=0.29.32
    Using cached Cython-0.29.32-py2.py3-none-any.whl (986 kB)
  Collecting oldest-supported-numpy
    Using cached oldest_supported_numpy-2022.11.19-py3-none-any.whl (4.9 kB)
  Collecting scipy<1.10,>=1.3
    Using cached scipy-1.9.3.tar.gz (42.1 MB)
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Installing backend dependencies: started
    Installing backend dependencies: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'error'
    error: subprocess-exited-with-error

    Preparing metadata (pyproject.toml) did not run successfully.
    exit code: 1

    [21 lines of output]
    + meson setup --prefix=c:\users\hp\anaconda3 C:\Users\hp\AppData\Local\Temp\pip-install-8637tmd9\scipy_a43633ab0f4d4afab54b7f1dfeb52603 C:\Users\hp\AppData\Local\Temp\pip-install-8637tmd9\scipy_a43633ab0f4d4afab54b7f1dfeb52603\.mesonpy-8uh3dh8d\build --native-file=C:\Users\hp\AppData\Local\Temp\pip-install-8637tmd9\scipy_a43633ab0f4d4afab54b7f1dfeb52603\.mesonpy-native-file.ini -Ddebug=false -Doptimization=2
    The Meson build system
    Version: 1.0.0
    Source dir: C:\Users\hp\AppData\Local\Temp\pip-install-8637tmd9\scipy_a43633ab0f4d4afab54b7f1dfeb52603
    Build dir: C:\Users\hp\AppData\Local\Temp\pip-install-8637tmd9\scipy_a43633ab0f4d4afab54b7f1dfeb52603\.mesonpy-8uh3dh8d\build
    Build type: native build
    Project name: SciPy
    Project version: 1.9.3
    WARNING: Failed to activate VS environment: Could not find C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe

    ..\..\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']]
    The following exception(s) were encountered:
    Running `icl ""` gave "[WinError 2] The system cannot find the file specified"
    Running `cl /?` gave "[WinError 2] The system cannot find the file specified"
    Running `cc --version` gave "[WinError 2] The system cannot find the file specified"
    Running `gcc --version` gave "[WinError 2] The system cannot find the file specified"
    Running `clang --version` gave "[WinError 2] The system cannot find the file specified"
    Running `clang-cl /?` gave "[WinError 2] The system cannot find the file specified"
    Running `pgcc --version` gave "[WinError 2] The system cannot find the file specified"

    A full log can be found at C:\Users\hp\AppData\Local\Temp\pip-install-8637tmd9\scipy_a43633ab0f4d4afab54b7f1dfeb52603\.mesonpy-8uh3dh8d\build\meson-logs\meson-log.txt
    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: metadata-generation-failed

  Encountered error while generating package metadata.

  See above for output.

  note: This is an issue with the package mentioned above, not pip.
  hint: See above for details.
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

pip subprocess to install build dependencies did not run successfully.
exit code: 1

See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
</code>```

Body:
Versions:

jupyter core     : 4.6.3
jupyter-notebook : 6.1.4
qtconsole        : 4.7.7
ipython          : 8.5.0
ipykernel        : 5.3.4
jupyter client   : 6.1.7
jupyter lab      : 2.2.6
nbconvert        : 6.0.7
ipywidgets       : 7.5.1
nbformat         : 5.0.8
traitlets        : 5.0.5

pip 22.3.1

I tried installing pmdarima using pip on Jupyter Notebook as well as Anaconda Promt, and encountered the same error as below. Kindly help me in figuring out how shall I get rid of this error.

!pip install pmdarima

Error:

    Collecting pmdarima
      Using cached pmdarima-2.0.2.tar.gz (630 kB)
      Preparing metadata (setup.py): started
      Preparing metadata (setup.py): finished with status 'done'
    Requirement already satisfied: joblib>=0.11 in c:\users\hp\appdata\roaming\python\python38\site-packages (from pmdarima) (0.17.0)
    Requirement already satisfied: Cython!=0.29.18,!=0.29.31,>=0.29 in c:\users\hp\anaconda3\lib\site-packages (from pmdarima) (0.29.21)
    Requirement already satisfied: numpy>=1.21.2 in c:\users\hp\anaconda3\lib\site-packages (from pmdarima) (1.23.3)
    Requirement already satisfied: pandas>=0.19 in c:\users\hp\anaconda3\lib\site-packages (from pmdarima) (1.5.1)
    Requirement already satisfied: scikit-learn>=0.22 in c:\users\hp\appdata\roaming\python\python38\site-packages (from pmdarima) (0.23.2)
    Requirement already satisfied: scipy>=1.3.2 in c:\users\hp\appdata\roaming\python\python38\site-packages (from pmdarima) (1.5.2)
    Collecting statsmodels>=0.13.2
      Using cached statsmodels-0.13.5.tar.gz (18.4 MB)
      Installing build dependencies: started
      Installing build dependencies: finished with status 'error'

error: subprocess-exited-with-error

  pip subprocess to install build dependencies did not run successfully.
  exit code: 1

  [62 lines of output]
  Ignoring numpy: markers 'python_version == "3.10" and platform_system == "Windows" and platform_python_implementation != "PyPy"' don't match your environment
  Ignoring numpy: markers 'python_version >= "3.11"' don't match your environment
  Ignoring scipy: markers 'python_version == "3.7"' don't match your environment
  Ignoring scipy: markers 'python_version == "3.8" and platform_system == "Windows" and platform_machine == "x86"' don't match your environment
  Ignoring scipy: markers 'python_version == "3.9" and platform_system == "Windows" and platform_machine == "x86"' don't match your environment
  Ignoring scipy: markers 'python_version >= "3.12"' don't match your environment
  Collecting setuptools>=59.2.0
    Using cached setuptools-65.6.3-py3-none-any.whl (1.2 MB)
  Collecting wheel>=0.37.1
    Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
  Collecting cython<3,>=0.29.32
    Using cached Cython-0.29.32-py2.py3-none-any.whl (986 kB)
  Collecting oldest-supported-numpy
    Using cached oldest_supported_numpy-2022.11.19-py3-none-any.whl (4.9 kB)
  Collecting scipy<1.10,>=1.3
    Using cached scipy-1.9.3.tar.gz (42.1 MB)
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
    Installing backend dependencies: started
    Installing backend dependencies: finished with status 'done'
    Preparing metadata (pyproject.toml): started
    Preparing metadata (pyproject.toml): finished with status 'error'
    error: subprocess-exited-with-error

    Preparing metadata (pyproject.toml) did not run successfully.
    exit code: 1

    [21 lines of output]
    + meson setup --prefix=c:\users\hp\anaconda3 C:\Users\hp\AppData\Local\Temp\pip-install-8637tmd9\scipy_a43633ab0f4d4afab54b7f1dfeb52603 C:\Users\hp\AppData\Local\Temp\pip-install-8637tmd9\scipy_a43633ab0f4d4afab54b7f1dfeb52603\.mesonpy-8uh3dh8d\build --native-file=C:\Users\hp\AppData\Local\Temp\pip-install-8637tmd9\scipy_a43633ab0f4d4afab54b7f1dfeb52603\.mesonpy-native-file.ini -Ddebug=false -Doptimization=2
    The Meson build system
    Version: 1.0.0
    Source dir: C:\Users\hp\AppData\Local\Temp\pip-install-8637tmd9\scipy_a43633ab0f4d4afab54b7f1dfeb52603
    Build dir: C:\Users\hp\AppData\Local\Temp\pip-install-8637tmd9\scipy_a43633ab0f4d4afab54b7f1dfeb52603\.mesonpy-8uh3dh8d\build
    Build type: native build
    Project name: SciPy
    Project version: 1.9.3
    WARNING: Failed to activate VS environment: Could not find C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe

    ..\..\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']]
    The following exception(s) were encountered:
    Running `icl ""` gave "[WinError 2] The system cannot find the file specified"
    Running `cl /?` gave "[WinError 2] The system cannot find the file specified"
    Running `cc --version` gave "[WinError 2] The system cannot find the file specified"
    Running `gcc --version` gave "[WinError 2] The system cannot find the file specified"
    Running `clang --version` gave "[WinError 2] The system cannot find the file specified"
    Running `clang-cl /?` gave "[WinError 2] The system cannot find the file specified"
    Running `pgcc --version` gave "[WinError 2] The system cannot find the file specified"

    A full log can be found at C:\Users\hp\AppData\Local\Temp\pip-install-8637tmd9\scipy_a43633ab0f4d4afab54b7f1dfeb52603\.mesonpy-8uh3dh8d\build\meson-logs\meson-log.txt
    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: metadata-generation-failed

  Encountered error while generating package metadata.

  See above for output.

  note: This is an issue with the package mentioned above, not pip.
  hint: See above for details.
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

pip subprocess to install build dependencies did not run successfully.
exit code: 1

See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.