问:
onEdit equivalent for google docs
Im trying to have a function called after any real time edits has occurred on the google doc.
The final objective is to have all subsequent text typed in the document follow a particular format regardless of the contextual format of the new position(s) of the cursor. The following code does apply formatting to the element where the cursor is at when the function is called, but does not do so when cursor position is changed unless the function is called again.

```<code>function formattext() {
  var doc = DocumentApp.getActiveDocument();

  var style = {};

  style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] =
  DocumentApp.HorizontalAlignment.RIGHT;
  style[DocumentApp.Attribute.FONT_FAMILY] = 'Calibri';
  style[DocumentApp.Attribute.FONT_SIZE] = 23;
  style[DocumentApp.Attribute.BOLD] = true;

  // Get the element at the cursor position
  var cursor = doc.getCursor();
  var element = cursor.getElement();

  //set format of the text to be aligned right, font size 23, calibri and bolded
  element.setAttributes(style);
}
</code>```

With a onEdit reserved function name the code should work as I require it to (whenever new text is typed), but onEdit is not available for google docs, only google sheets based on the API.

Thus I need some way to have an onEdit equivalent for google docs that monitors changes in real time.

Attempted workarounds

Installable triggers (API) only has onEdit() available for google spreadsheet not google docs, where

```<code>ScriptApp.newTrigger().forDocument().onEdit().create();
</code>```

does not work but the one below does (note its for spreadsheet but I need for google docs)

```<code>ScriptApp.newTrigger().forSpreadsheet().onEdit().create();
</code>```

Seperately, I tried using while loops so that I can run the function once and hopefully the while block will have the attributes persistently apply wherever the cursor moves. Below is the code I used.

```<code>function formattext() {
  var doc = DocumentApp.getActiveDocument();
  var style = {};

  style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] =
  DocumentApp.HorizontalAlignment.RIGHT;
  style[DocumentApp.Attribute.FONT_FAMILY] = 'Calibri';
  style[DocumentApp.Attribute.FONT_SIZE] = 23;
  style[DocumentApp.Attribute.BOLD] = true;

  var toggle = true;

  while (toggle){
    var cursor = doc.getCursor();

    // Get the element at the cursor position
    var element = cursor.getElement();
    element.setAttributes(style);
  }
}
</code>```

In this case the script only applies the new attributes does not apply unless the script is forcibly stopped. Furthermore, the attributes only apply to the position where the cursor originally was when the function is called. I am not too sure why this is the case but this is less relevant to the question (this just shows workarounds I tried)

I have not tried time based triggers to check changes every so often and execute the function on the changed aspects of the document because it doesnt seem like it would be efficient.

Previously suggested solutions

There was a question many years ago here (Google Docs Add On onEdit), but the answer does not provide a real time update that I require

Other answers also may be outdated (this links to a depreciated API) and not relevant anymore, so I decided to post this question again in hopes that a better solution now exists

Title: onEdit equivalent for google docs

Body:
Im trying to have a function called after any real time edits has occurred on the google doc.
The final objective is to have all subsequent text typed in the document follow a particular format regardless of the contextual format of the new position(s) of the cursor. The following code does apply formatting to the element where the cursor is at when the function is called, but does not do so when cursor position is changed unless the function is called again.

function formattext() {
  var doc = DocumentApp.getActiveDocument();

  var style = {};

  style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] =
  DocumentApp.HorizontalAlignment.RIGHT;
  style[DocumentApp.Attribute.FONT_FAMILY] = 'Calibri';
  style[DocumentApp.Attribute.FONT_SIZE] = 23;
  style[DocumentApp.Attribute.BOLD] = true;

  // Get the element at the cursor position
  var cursor = doc.getCursor();
  var element = cursor.getElement();

  //set format of the text to be aligned right, font size 23, calibri and bolded
  element.setAttributes(style);
}

With a onEdit reserved function name the code should work as I require it to (whenever new text is typed), but onEdit is not available for google docs, only google sheets based on the API.

Thus I need some way to have an onEdit equivalent for google docs that monitors changes in real time.

Attempted workarounds

Installable triggers (API) only has onEdit() available for google spreadsheet not google docs, where

ScriptApp.newTrigger().forDocument().onEdit().create();

does not work but the one below does (note its for spreadsheet but I need for google docs)

ScriptApp.newTrigger().forSpreadsheet().onEdit().create();

Seperately, I tried using while loops so that I can run the function once and hopefully the while block will have the attributes persistently apply wherever the cursor moves. Below is the code I used.

function formattext() {
  var doc = DocumentApp.getActiveDocument();
  var style = {};

  style[DocumentApp.Attribute.HORIZONTAL_ALIGNMENT] =
  DocumentApp.HorizontalAlignment.RIGHT;
  style[DocumentApp.Attribute.FONT_FAMILY] = 'Calibri';
  style[DocumentApp.Attribute.FONT_SIZE] = 23;
  style[DocumentApp.Attribute.BOLD] = true;

  var toggle = true;

  while (toggle){
    var cursor = doc.getCursor();

    // Get the element at the cursor position
    var element = cursor.getElement();
    element.setAttributes(style);
  }
}

In this case the script only applies the new attributes does not apply unless the script is forcibly stopped. Furthermore, the attributes only apply to the position where the cursor originally was when the function is called. I am not too sure why this is the case but this is less relevant to the question (this just shows workarounds I tried)

I have not tried time based triggers to check changes every so often and execute the function on the changed aspects of the document because it doesnt seem like it would be efficient.

Previously suggested solutions

There was a question many years ago here (Google Docs Add On onEdit), but the answer does not provide a real time update that I require

Other answers also may be outdated (this links to a depreciated API) and not relevant anymore, so I decided to post this question again in hopes that a better solution now exists


来源: stackexchange

问:
Refreshing MatTableDataSource causes the selection of the row to be removed
I have angular material table with single selection:

selection = new SelectionModel<Schedule>(false, []);

```<code>this.dataSource = new MatTableDataSource(this.schedules);
</code>```

My problem is that when I do re-assignment (after modifying selected Schedule) to this.dataSource (MatTableDataSourcetype) it causes the selected table row (light-blue background) to be removed (changed back to white background)
How can I retain the selection after assignment?

ContentLicense: CC BY-SA 4.0

Body:
I have angular material table with single selection:

selection = new SelectionModel<Schedule>(false, []);

this.dataSource = new MatTableDataSource(this.schedules);

My problem is that when I do re-assignment (after modifying selected Schedule) to this.dataSource (MatTableDataSourcetype) it causes the selected table row (light-blue background) to be removed (changed back to white background)
How can I retain the selection after assignment?


问:
Unity Mediation - Failed to retrieve game id from Dashboard
I made a simple app in Unity and I'm trying to implement an ad banner. So I installed Advertisement with Mediation package, linked my project with Unity dashboard through the project ID and created game IDs. Mediation window looks good and all the IDs are there, but in console mediation says that it failed to retrieve game id from Dashboard. Because of that I can't acces my Ad units in the editor and the Code generator doesn't work either.

The project is clearly linked to the Dashboard, where advertisement is set to Mediation and all the Ad units are there. Game IDs are displayed in the Mediation window in the editor and the project ID is displayed in the Services window.

enter image description here

I tried a lot of things. I watched a lot of instructional videos online and did everything right, but the message is still there. I relinked the project, made an empty test project, tried different versions of Unity. I've been playing with it the whole day yesterday but no luck.

Is there something I'm missing?


问:
How to add money to stripe account to transfer to connected accounts outside US?
Our situation:

We are a marketplace (in the EU) where coaches offer courses. We use Paypal (just for Paypal payments) and Stripe for everything else.

At the end of the month we pay out money to our coaches. This is currently a very manual job that we want to automate: For this we planned on using Stripe connect.

How: Every coach gets a connected account and we transfer the money using the Transfer API.

Problem:

We have money in a paypal account and in the stripe account. The money in the stripe account is not enough to pay out all coaches.

We thought we could just put money into our stripe account -> BUT apparently this is not possible outside of the US.

Question:

Does anybody had this issue before? Is this possible? Is there a workaround? Am I overlooking something?

Unfortunately Stripe support has not been helpful...

Thank you! Any help is much appreciated!


问:
how I can Inline Embed my calendly into Angular 9 application ? Thanks
Im trying to embed calendly inline to my app with no luck , there is nothing I can find on the web about this topic.
Can someone please explain me how can i insert calendly properly to my Angular app ?
Thanks in advance !

I tried Calendly tutorial with no luck : https://help.calendly.com/hc/en-us/articles/223147027?tab=advanced#4


问:
'killed' error when trying to run inactive Python version (specifically, Python3.6) on M1 Mac?
I'm having trouble getting Python3.6 to run on my Mac M1.

First of all, Python3.6 can't be installed via brew. That's probably because 3.6 is no longer considered an active release. I downloaded the Mac Installer from here. I ran the .pkg file and the installation seemed to have completed successfully.

However, when I run python3.6, I get [1]    5537 killed     python3.6. I have other Python versions installed on my system: 3.8, 3.9, 3.10, 3.11. I can run each of those successfully via python3.X.
python3 also throws the "killed" error. python throws "command not found".
file /usr/bin/python3 gives

```<code>/usr/bin/python3: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/usr/bin/python3 (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/python3 (for architecture arm64e): Mach-O 64-bit executable arm64e
</code>```

Running ls /Library/Frameworks/Python.framework/Versions/3.6/bin gives

```<code>2to3              idle3             pydoc3            python3           python3-config    python3.6-32      python3.6m        pyvenv
2to3-3.6          idle3.6           pydoc3.6          python3-32        python3.6         python3.6-config  python3.6m-config pyvenv-3.6
</code>```

Running /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 gives the "killed" error again.

How do I solve this error?

I tried to install Python3.6 on my Mac M1 by downloading it from the official Python website. I expected python3.6 to run Python3.6 successfully. Instead, it throws the following error: [1]    5537 killed     python3.6.

Body:
I'm having trouble getting Python3.6 to run on my Mac M1.

First of all, Python3.6 can't be installed via brew. That's probably because 3.6 is no longer considered an active release. I downloaded the Mac Installer from here. I ran the .pkg file and the installation seemed to have completed successfully.

However, when I run python3.6, I get [1]    5537 killed     python3.6. I have other Python versions installed on my system: 3.8, 3.9, 3.10, 3.11. I can run each of those successfully via python3.X.
python3 also throws the "killed" error. python throws "command not found".
file /usr/bin/python3 gives

/usr/bin/python3: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
/usr/bin/python3 (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/python3 (for architecture arm64e): Mach-O 64-bit executable arm64e

Running ls /Library/Frameworks/Python.framework/Versions/3.6/bin gives

2to3              idle3             pydoc3            python3           python3-config    python3.6-32      python3.6m        pyvenv
2to3-3.6          idle3.6           pydoc3.6          python3-32        python3.6         python3.6-config  python3.6m-config pyvenv-3.6

Running /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 gives the "killed" error again.

How do I solve this error?

I tried to install Python3.6 on my Mac M1 by downloading it from the official Python website. I expected python3.6 to run Python3.6 successfully. Instead, it throws the following error: [1]    5537 killed     python3.6.


问:
direct using of tensors in pyomo
I want to use torch (tensorflow) tensor values in pyomo expressions. But, it seems there is no direct way use it, because the pyomo throws an error. for example:

```<code>m = ConcreteModel()
m.x = Var(range(3), range(4))
#  torch
a = torch.randn(3,4)
# pyomo expression
expr = m.x[0,0] - a[0,0]
</code>```

but  the pyomo says:

```<code>File "pyomo\core\expr\numvalue.pyx", line 716, in pyomo.core.expr.numvalue.NumericValue.__sub__
  File "pyomo\core\expr\numeric_expr.pyx", line 1680, in pyomo.core.expr.numeric_expr._generate_sum_expression
AttributeError: 'Tensor' object has no attribute 'is_expression_type'
</code>```

What should I do? There are some indirect methods like numpy and create model, but I want to know is there any easier method available?

Thanks

using numpy as indirect way to calculate expression

Title: direct using of tensors in pyomo

Body:
I want to use torch (tensorflow) tensor values in pyomo expressions. But, it seems there is no direct way use it, because the pyomo throws an error. for example:

m = ConcreteModel()
m.x = Var(range(3), range(4))
#  torch
a = torch.randn(3,4)
# pyomo expression
expr = m.x[0,0] - a[0,0]

but  the pyomo says:

File "pyomo\core\expr\numvalue.pyx", line 716, in pyomo.core.expr.numvalue.NumericValue.__sub__
  File "pyomo\core\expr\numeric_expr.pyx", line 1680, in pyomo.core.expr.numeric_expr._generate_sum_expression
AttributeError: 'Tensor' object has no attribute 'is_expression_type'

What should I do? There are some indirect methods like numpy and create model, but I want to know is there any easier method available?

Thanks

using numpy as indirect way to calculate expression


问:
SSO with OTP for Node.js Mircroservices
Building Microservices in node.js.

User will login to the platform (through Web or mobile) using mobile based OTP only.
Once login user will be valid across different microservices.
Not looking to build user management service (for Authentication and Authorization) from scratch.

Is there any free/open source/(paid SAAS) Oauth2 server (in javascipt world) that will handle this use case without much additional work? It can be extended with OTP generation and verification. Rest should already be there for generating access-token and verifying the same across different services.

This is use case is very widely used. But I am not able to find the solution quickly.
Any pointer in this direction will be very helpful. Thanks in advance.

Title: SSO with OTP for Node.js Mircroservices


问:
PCF - Spring Boot - Instance Index
We have a requirement to identify the instance index number of a Spring Boot application deployed in PCF. This is to create a dynamic subscription to a Pub/Sub topic based on the CF Instance Index. How do we find the index number of the Spring Boot application instance running in PCF?</p>

Title: PCF - Spring Boot - Instance Index


问:
Microsoft Signal R not able to establish connnection in Prodution build with next js
The negotiation URL is not correctly set while initiating Signal R connection in next js PRODUCTION build (using yarn build command). It's works fine with development build (using yarn dev command)

Local build signal R log - Sending negotiation request to given URL while initiating Signalr

Production build Signal R log- Sending negotiation request is missing the actual URL that is passed while initiating Signalr,
Throws error _app-981b32fff10f13a9.js:2 POST http://localhost:3000/register/pre-fetch?negotiateVersion=1 405 (Method Not Allowed)
here negotiation request URL is changed to " http://localhost:3000/register/pre-fetch?negotiateVersion=1" which is a component path from where signal R initiated, this should be: https:/{{SignalrURL}}/negotiate?negotiateVersion=1.

signal.ts file

```<code>import * as signalR from '@microsoft/signalr';
const conn = new signalR.HubConnectionBuilder()
                    .withUrl('SignalrURL',
                        { accessTokenFactory: () => localStorage.getItem('token') })
                    .withAutomaticReconnect()
                    .configureLogging(signalR.LogLevel.Debug)
                    .build()
                    .start();
</code>```

package.json

```<code>"dependencies": {
    "@deere/fuel-react": "^3.0.0",
    "@microsoft/signalr": "^7.0.0",
    "@mui/icons-material": "^5.10.14",
    "@mui/x-data-grid": "^5.17.14",
    "@reduxjs/toolkit": "^1.9.1",
    "@sentry/nextjs": "^7.23.0",
    "applicationinsights": "^2.3.6",
    "axios": "^1.2.0",
    "moment": "^2.29.4",
    "moment-timezone": "^0.5.38",
    "net": "^1.0.2",
    "next": "13.0.4",
    "next-auth": "^4.18.4",
    "nextjs-redirect": "^6.0.1",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-intl": "^6.2.1",
    "react-redux": "^8.0.5",
    "react-test-renderer": "^18.2.0",
    "react-toastify": "^9.1.1",
    "rxjs": "^7.6.0",
    "tls": "^0.0.1",
    "v8": "^0.1.0"
  },
</code>```

Body:
The negotiation URL is not correctly set while initiating Signal R connection in next js PRODUCTION build (using yarn build command). It's works fine with development build (using yarn dev command)

Local build signal R log - Sending negotiation request to given URL while initiating Signalr

Production build Signal R log- Sending negotiation request is missing the actual URL that is passed while initiating Signalr,
Throws error _app-981b32fff10f13a9.js:2 POST http://localhost:3000/register/pre-fetch?negotiateVersion=1 405 (Method Not Allowed)
here negotiation request URL is changed to " http://localhost:3000/register/pre-fetch?negotiateVersion=1" which is a component path from where signal R initiated, this should be: https:/{{SignalrURL}}/negotiate?negotiateVersion=1.

signal.ts file

import * as signalR from '@microsoft/signalr';
const conn = new signalR.HubConnectionBuilder()
                    .withUrl('SignalrURL',
                        { accessTokenFactory: () => localStorage.getItem('token') })
                    .withAutomaticReconnect()
                    .configureLogging(signalR.LogLevel.Debug)
                    .build()
                    .start();

package.json

"dependencies": {
    "@deere/fuel-react": "^3.0.0",
    "@microsoft/signalr": "^7.0.0",
    "@mui/icons-material": "^5.10.14",
    "@mui/x-data-grid": "^5.17.14",
    "@reduxjs/toolkit": "^1.9.1",
    "@sentry/nextjs": "^7.23.0",
    "applicationinsights": "^2.3.6",
    "axios": "^1.2.0",
    "moment": "^2.29.4",
    "moment-timezone": "^0.5.38",
    "net": "^1.0.2",
    "next": "13.0.4",
    "next-auth": "^4.18.4",
    "nextjs-redirect": "^6.0.1",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-intl": "^6.2.1",
    "react-redux": "^8.0.5",
    "react-test-renderer": "^18.2.0",
    "react-toastify": "^9.1.1",
    "rxjs": "^7.6.0",
    "tls": "^0.0.1",
    "v8": "^0.1.0"
  },


问:
WriteAsync error. Cannot write plain text
I have problem with WriteAsync method in asp.net core.

I have code:

```<code>var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.Use(async (HttpContext context, RequestDelegate next) =>
{
    await context.Response.WriteAsync("Hello");
    await next(context);
});

app.Use(async (HttpContext context, RequestDelegate next) =>
{
    await context.Response.WriteAsync("Hello again");
    await next(context);
});

app.Run();
</code>```

It runs into following error:

```<code>fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
      An unhandled exception has occurred while executing the request.
      System.InvalidOperationException: StatusCode cannot be set because the response has already started.
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ThrowResponseAlreadyStartedException(String value)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.set_StatusCode(Int32 value)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.set_StatusCode(Int32 value)
         at Microsoft.AspNetCore.Http.DefaultHttpResponse.set_StatusCode(Int32 value)
         at Microsoft.AspNetCore.Builder.ApplicationBuilder.<>c.<Build>b__18_0(HttpContext context)
         at Program.<>c.<<<Main>$>b__0_1>d.MoveNext() in C:\aspnetApps\WebApplication_test\WebApplication_test\Program.cs:line 13
      --- End of stack trace from previous location ---
         at Program.<>c.<<<Main>$>b__0_0>d.MoveNext() in C:\aspnetApps\WebApplication_test\WebApplication_test\Program.cs:line 7
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
warn: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[2]
      The response has already started, the error page middleware will not be executed.
fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HMN0TEI6NPN9", Request id "0HMN0TEI6NPN9:00000002": An unhandled exception was thrown by the application.
      System.InvalidOperationException: StatusCode cannot be set because the response has already started.
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ThrowResponseAlreadyStartedException(String value)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.set_StatusCode(Int32 value)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.set_StatusCode(Int32 value)
         at Microsoft.AspNetCore.Http.DefaultHttpResponse.set_StatusCode(Int32 value)
         at Microsoft.AspNetCore.Builder.ApplicationBuilder.<>c.<Build>b__18_0(HttpContext context)
         at Program.<>c.<<<Main>$>b__0_1>d.MoveNext() in C:\aspnetApps\WebApplication_test\WebApplication_test\Program.cs:line 13
      --- End of stack trace from previous location ---
         at Program.<>c.<<<Main>$>b__0_0>d.MoveNext() in C:\aspnetApps\WebApplication_test\WebApplication_test\Program.cs:line 7
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
         at Microsoft.WebTools.BrowserLink.Net.BrowserLinkMiddleware.ExecuteWithFilterAsync(IHttpSocketAdapter injectScriptSocket, String requestId, HttpContext httpContext)
         at Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserRefreshMiddleware.InvokeAsync(HttpContext context)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
</code>```

If i add tags to hello messages, the app runs correctly.
Like this:

```<code>await context.Response.WriteAsync("<p>Hello</p>");
</code>```

If i change content-type to 'text/plain' it runs into the same error.
Like this:

```<code>app.Use(async (HttpContext context, RequestDelegate next) =>
{
    context.Response.ContentType = "text/plain";
    await context.Response.WriteAsync("Hello");
    await next(context);
});

</code>```

I have no idea why is it working like this.
I`d like to reply by plain text.

Body:
I have problem with WriteAsync method in asp.net core.

I have code:

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.Use(async (HttpContext context, RequestDelegate next) =>
{
    await context.Response.WriteAsync("Hello");
    await next(context);
});

app.Use(async (HttpContext context, RequestDelegate next) =>
{
    await context.Response.WriteAsync("Hello again");
    await next(context);
});

app.Run();

It runs into following error:

fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
      An unhandled exception has occurred while executing the request.
      System.InvalidOperationException: StatusCode cannot be set because the response has already started.
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ThrowResponseAlreadyStartedException(String value)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.set_StatusCode(Int32 value)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.set_StatusCode(Int32 value)
         at Microsoft.AspNetCore.Http.DefaultHttpResponse.set_StatusCode(Int32 value)
         at Microsoft.AspNetCore.Builder.ApplicationBuilder.<>c.<Build>b__18_0(HttpContext context)
         at Program.<>c.<<$>b__0_1>d.MoveNext() in C:\aspnetApps\WebApplication_test\WebApplication_test\Program.cs:line 13
      --- End of stack trace from previous location ---
         at Program.<>c.<<$>b__0_0>d.MoveNext() in C:\aspnetApps\WebApplication_test\WebApplication_test\Program.cs:line 7
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
warn: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[2]
      The response has already started, the error page middleware will not be executed.
fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HMN0TEI6NPN9", Request id "0HMN0TEI6NPN9:00000002": An unhandled exception was thrown by the application.
      System.InvalidOperationException: StatusCode cannot be set because the response has already started.
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ThrowResponseAlreadyStartedException(String value)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.set_StatusCode(Int32 value)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IHttpResponseFeature.set_StatusCode(Int32 value)
         at Microsoft.AspNetCore.Http.DefaultHttpResponse.set_StatusCode(Int32 value)
         at Microsoft.AspNetCore.Builder.ApplicationBuilder.<>c.<Build>b__18_0(HttpContext context)
         at Program.<>c.<<$>b__0_1>d.MoveNext() in C:\aspnetApps\WebApplication_test\WebApplication_test\Program.cs:line 13
      --- End of stack trace from previous location ---
         at Program.<>c.<<$>b__0_0>d.MoveNext() in C:\aspnetApps\WebApplication_test\WebApplication_test\Program.cs:line 7
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
         at Microsoft.WebTools.BrowserLink.Net.BrowserLinkMiddleware.ExecuteWithFilterAsync(IHttpSocketAdapter injectScriptSocket, String requestId, HttpContext httpContext)
         at Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserRefreshMiddleware.InvokeAsync(HttpContext context)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

If i add tags to hello messages, the app runs correctly.
Like this:

await context.Response.WriteAsync("
Hello
");

If i change content-type to 'text/plain' it runs into the same error.
Like this:

app.Use(async (HttpContext context, RequestDelegate next) =>
{
    context.Response.ContentType = "text/plain";
    await context.Response.WriteAsync("Hello");
    await next(context);
});

I have no idea why is it working like this.
I`d like to reply by plain text.


问:
React Passing Same Prop Twice
I have a SideBar navigation component, that holds an open/close state.
This state is drilled down to childs (SideBarButton) to perform conditional CSS styling.

Strange thing is, that the SideBarButton, despite receiving the prop once, it is shown twice in the rendered tree, and always taking the false value.

Any one any idea why?

NavigationLinksView receives isOpenSideNav:

```<code>  <div className={styles.root}>
      <NavigationLinksView
        isOpenSideNav={isOpenSideNav}
        navigationLinksList={navigationLinksTop}
      />
      <NavigationLinksView
        isOpenSideNav={isOpenSideNav}
        navigationLinksList={navigationLinksBottom}
      />
    </div>
</code>```

NavigationLinksView.js:

```<code>const NavigationLinksView = ({isOpenSideNav, navigationLinksList}) => {
  return (
    <ul
      className={styles.root}
    >
      {_.map(navigationLinksList, (navigationItem, idx) => {
        const {sideMenuContent, name} = navigationItem;
        if (sideMenuContent) {
          return (
            <SideBarButtonWithSubMenu
              key={`${name}_${idx}`}
              isOpensideNav={isOpenSideNav}
              navigationItem={navigationItem}
            />
          );
        }
        return (
          <SideBarButton
            key={`${name}_${idx}`}
            isOpensideNav={isOpenSideNav}
            navigationItem={navigationItem}
          />
        );
      })}
    </ul>
  );
};
</code>```

Yet, each SidebarButton or SideBarButtonWithSubMenu has problems reading that prop:

```<code>const SideBarButton = ({navigationItem, isOpenSideNav}) => {
  const {id, className, withSeparator, disabled, to, name, analytics, icon} = navigationItem;
  console.log({isOpenSideNav, comp: 'SideBarButton'});

  const {icon: iconName, color, hoverColor} = icon;
  const currentPathLink = to || `/${id}`;
  const location = useLocation();
  const activePath = _.split(location.pathname, '/')[1] === id;
  const {translate} = useLocalisationService();

  return (
    <li key={name} className={classNames(styles.root, {[styles.disabled]: disabled})}>
      {withSeparator && <div className={styles.separator}/>}
      <Link
        className={classNames(styles.link, {[styles.link.wideView]: isOpenSideNav, [styles.activePath]: activePath}, className)}
        to={currentPathLink}
        onClick={() => analyticsService.event(analytics)}
      >
        <Hint offset={Hint.offsets.SM} side={Hint.sides.RIGHT} show={!isOpenSideNav} content={translate(name)}>
          <div className={classNames(styles.iconContainer)}>
            <Icon icon={iconName} color={color} hoverColor={hoverColor || Icon.colors.PRIMARY_BRAND_REGULAR}/>
          </div>
        </Hint>
        <div
          className={classNames(className, styles.textContent, {
            [styles.wideView]: isOpenSideNav,
          })}
        >
          {translate(name)}
        </div>
      </Link>
    </li>
  );
};
</code>```

Any help will be welcomed.
Thanks.

I have tried inspecting the prop drilling.
NavigationLInksView gets the right prop value every time it changes.
When drilling to a child, the Childs get it duplicated as shown in the screenshot.
The direct Childs sideBarButton and SideBarButtonWithSideMenu for some reason get it twice.
The value that they always take from the duplicated prop is "false", regardless of some scenarios being true.

Title: React Passing Same Prop Twice

Body:
I have a SideBar navigation component, that holds an open/close state.
This state is drilled down to childs (SideBarButton) to perform conditional CSS styling.

Strange thing is, that the SideBarButton, despite receiving the prop once, it is shown twice in the rendered tree, and always taking the false value.

Any one any idea why?

NavigationLinksView receives isOpenSideNav:

      <NavigationLinksView
        isOpenSideNav={isOpenSideNav}
        navigationLinksList={navigationLinksTop}
      />
      <NavigationLinksView
        isOpenSideNav={isOpenSideNav}
        navigationLinksList={navigationLinksBottom}
      />

NavigationLinksView.js:

const NavigationLinksView = ({isOpenSideNav, navigationLinksList}) => {
  return (

      {_.map(navigationLinksList, (navigationItem, idx) => {
        const {sideMenuContent, name} = navigationItem;
        if (sideMenuContent) {
          return (
            <SideBarButtonWithSubMenu
              key={`${name}_${idx}`}
              isOpensideNav={isOpenSideNav}
              navigationItem={navigationItem}
            />
          );
        }
        return (
          <SideBarButton
            key={`${name}_${idx}`}
            isOpensideNav={isOpenSideNav}
            navigationItem={navigationItem}
          />
        );
      })}

  );
};

Yet, each SidebarButton or SideBarButtonWithSubMenu has problems reading that prop:

const SideBarButton = ({navigationItem, isOpenSideNav}) => {
  const {id, className, withSeparator, disabled, to, name, analytics, icon} = navigationItem;
  console.log({isOpenSideNav, comp: 'SideBarButton'});

  const {icon: iconName, color, hoverColor} = icon;
  const currentPathLink = to || `/${id}`;
  const location = useLocation();
  const activePath = _.split(location.pathname, '/')[1] === id;
  const {translate} = useLocalisationService();

  return (

      {withSeparator &&
}
      <Link
        className={classNames(styles.link, {[styles.link.wideView]: isOpenSideNav, [styles.activePath]: activePath}, className)}
        to={currentPathLink}
        onClick={() => analyticsService.event(analytics)}
      >
        <Hint offset={Hint.offsets.SM} side={Hint.sides.RIGHT} show={!isOpenSideNav} content={translate(name)}>

            <Icon icon={iconName} color={color} hoverColor={hoverColor || Icon.colors.PRIMARY_BRAND_REGULAR}/>

        </Hint>

          {translate(name)}

      </Link>

  );
};

Any help will be welcomed.
Thanks.

I have tried inspecting the prop drilling.
NavigationLInksView gets the right prop value every time it changes.
When drilling to a child, the Childs get it duplicated as shown in the screenshot.
The direct Childs sideBarButton and SideBarButtonWithSideMenu for some reason get it twice.
The value that they always take from the duplicated prop is "false", regardless of some scenarios being true.


问:
Cannot load data url in Worker Thread
My current worker thread which works fine with file path that tries to console log in that JS file:

```<code>console.log("hit here");
</code>```

Now I get the base64 of that file and use Data URL to replace JS file path to get rid of additional file (https://nodejs.org/api/worker_threads.html#new-workerfilename-options):

```<code>const worker = new Worker("data:text/javascript;base64,Y29uc29sZS5sb2coImhpdCBoZXJlIik7Cg==", { workerData: {} });
</code>```

But nothing happens.

Title: Cannot load data url in Worker Thread

Body:
My current worker thread which works fine with file path that tries to console log in that JS file:

console.log("hit here");

Now I get the base64 of that file and use Data URL to replace JS file path to get rid of additional file (https://nodejs.org/api/worker_threads.html#new-workerfilename-options):

const worker = new Worker("data:text/javascript;base64,Y29uc29sZS5sb2coImhpdCBoZXJlIik7Cg==", { workerData: {} });

But nothing happens.


问:
I am getting an exception classnotfounnd error while trying to configure metastore in hive in ubuntu
I am trying install hive in ubuntu. But I am getting this error when i try to create derby metastore

schematool -dbType derby -initSchema

I have configured these things in .bashrc
HIVE_HOME

I configured these things in bin/hive-config.sh
hive-config.sh

What am I doing wrong here? Please help me with this

Thanks in advance

I have tried different versions of hive. Also tried pasting there HIVE_HOME variables in different lines. Hadoop was running while configuring these things.


问:
8086 Processor emulator in Python using QT Creator
I have made an interface of Intel Processor 8086 using Qt Creator.
enter image description here

I am new in Qt Creator and don't know excatly what I change.
But there occur an issue, I can't actually code the commands and I am stuck in one palce. Can someone help me?


问:
flutter.create in VSC
I am trying to create a new flutter project using Visual Studio Code on Windows.

View > Command Palette > Flutter: New Project > Application

I tried to create a project using this order as it was introduced in the flutter document.
However, all I see is a file called "flutter.create" in my folder instead of the flutter related files that I am supposed to see.

May I ask what kind of possible problems I am confronting?

I searched the internet and I rebooted my pc, VSC, etc, but it just did not work.

Title: flutter.create in VSC


问:
how can I place the rtl text next to the ltr text with the same height in flutter?
how can I place the rtl text next to the ltr text with the same height
result:

my code:

```<code> Text(
            widget.myNotes.title,
            maxLines: 1,
            textAlign: TextAlign.start,
            textDirection: TextDirection.ltr,
            overflow: TextOverflow.ellipsis,
          ),
</code>```

Full code

Body:
how can I place the rtl text next to the ltr text with the same height
result:

my code:

 Text(
            widget.myNotes.title,
            maxLines: 1,
            textAlign: TextAlign.start,
            textDirection: TextDirection.ltr,
            overflow: TextOverflow.ellipsis,
          ),

Full code


问:
creating multi sub directories in nodejs
I want to check if a directory not exist in my project, make two directories in my nodejs web api project. I use the following code and it works.

```<code>    const myVar= req.body["specificId"];
    const checkPath =  path.join(__dirname , "../public/media/" + myVar);
    console.log(checkPath);
    if (!fs.existsSync(checkPath)) {
        console.log("not exist!");
         fs.mkdirSync(`${__dirname}../../public/media/`);
         fs.mkdirSync(`${__dirname}../../public/media/${myVar}`);
         fs.mkdirSync(`${__dirname}../../public/media/${myVar}/image`);
         fs.mkdirSync(`${__dirname}../../public/media/${myVar}/video`);
     }
    else{
        console.log("exist!");
    }
</code>```

but as you see I write 4 lines to do so. How may do it just by using something like the two last lines? I should mention that for the first run, just the specified 'public' folder exists and the other sub folders should be created if ${myVar} folder not existed.

Body:
I want to check if a directory not exist in my project, make two directories in my nodejs web api project. I use the following code and it works.

    const myVar= req.body["specificId"];
    const checkPath =  path.join(__dirname , "../public/media/" + myVar);
    console.log(checkPath);
    if (!fs.existsSync(checkPath)) {
        console.log("not exist!");
         fs.mkdirSync(`${__dirname}../../public/media/`);
         fs.mkdirSync(`${__dirname}../../public/media/${myVar}`);
         fs.mkdirSync(`${__dirname}../../public/media/${myVar}/image`);
         fs.mkdirSync(`${__dirname}../../public/media/${myVar}/video`);
     }
    else{
        console.log("exist!");
    }

but as you see I write 4 lines to do so. How may do it just by using something like the two last lines? I should mention that for the first run, just the specified 'public' folder exists and the other sub folders should be created if ${myVar} folder not existed.


问:
how can i set my progress bar differently for each item in recycler view
i have multiple items in my array list and i want to set progress for each of these items but each of them have the same progress please help me with this issue

here is how im setting my progress bar in the recycler viwe

```<code>Thread thread = new Thread(){

    @Override
    public void run() {
        super.run();
        int counter=0;
        for(counter=0;counter<=100;counter++) {
            try {
                sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            holder.progressBar.setProgress(counter);
            counter = counter + 10;
        }
    }
};
thread.start();
</code>```

Body:
i have multiple items in my array list and i want to set progress for each of these items but each of them have the same progress please help me with this issue

here is how im setting my progress bar in the recycler viwe

Thread thread = new Thread(){

    @Override
    public void run() {
        super.run();
        int counter=0;
        for(counter=0;counter<=100;counter++) {
            try {
                sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            holder.progressBar.setProgress(counter);
            counter = counter + 10;
        }
    }
};
thread.start();


问:
how to download a lot image using javascript?
i'm using filesaver as save as in browser...this code works well on any website but there's a problem when i use this script it only download just 9 image...so i wonder what is wrong with this code..

```<code>function down() {
    var loc_gal = document.getElementsByClassName('detail-gallery-list')[0]
    var loc_url = loc_gal.getElementsByClassName('detail-gallery-item');

    var dump_url = [];
    for (let i = 0; i < loc_url.length; i++) {
        var dump = loc_url[0].querySelector('img').src;
        var splitname = dump.split('1.');
        var filename = splitname[0]+[i]+'.webp';
        // store url from filename into the array dump_url
        dump_url.push(filename)
    }
</code>```

i have 2 different method to access array

this method works well to access array and use the index to get link from dump_url but have a same issue it only download 9 image if more then that it just only duplicate each file has been downloaded

```<code>    for (let x in dump_url){
        setTimeout(() => {
            saveAs(dump_url[x],'0.webp');
          }, 2000)
    }
</code>```

same issue only download 9 image

```<code>dump_url.forEach(element => saveAs(element,'0.webp'))
</code>```

i got the same result from 2 different menthod

result of the 2 method

What is wrong with my code ? The page have more than 20 image.

Note : I use Tempermonkey to run my script

Body:
i'm using filesaver as save as in browser...this code works well on any website but there's a problem when i use this script it only download just 9 image...so i wonder what is wrong with this code..

function down() {
    var loc_gal = document.getElementsByClassName('detail-gallery-list')[0]
    var loc_url = loc_gal.getElementsByClassName('detail-gallery-item');

    var dump_url = [];
    for (let i = 0; i < loc_url.length; i++) {
        var dump = loc_url[0].querySelector('img').src;
        var splitname = dump.split('1.');
        var filename = splitname[0]+[i]+'.webp';
        // store url from filename into the array dump_url
        dump_url.push(filename)
    }

i have 2 different method to access array

this method works well to access array and use the index to get link from dump_url but have a same issue it only download 9 image if more then that it just only duplicate each file has been downloaded

    for (let x in dump_url){
        setTimeout(() => {
            saveAs(dump_url[x],'0.webp');
          }, 2000)
    }

same issue only download 9 image

dump_url.forEach(element => saveAs(element,'0.webp'))

i got the same result from 2 different menthod

result of the 2 method

What is wrong with my code ? The page have more than 20 image.

Note : I use Tempermonkey to run my script


问:
How to hide Kivy Tabbedpanel Headers?
I have lots of tabs, and I want to make it a vertical list of buttons to change the tabs. I tried the top_left positioning, but then it rotates the text 90 degrees counter-clockwise.

For my approach to be intuitive, I need to hide the headers. I haven't found anything on this, how can I do this?

Note that I'm not trying to remove the tabs, just hide the headers. I also don't need it to have a button to close it, just hide it on build or on start.

Title: How to hide Kivy Tabbedpanel Headers?


问:
Nestjs prevent cron running 6 times
I have a nestjs cron problem.

I called just one time a cron function but function running 6 times. My code is below.

```<code>  @Cron(CronExpression.EVERY_MINUTE)
   async watcher() {
const now = new Date();
     const openTravelRequests = await this.getOpenTravelRequestsByDate(now);

      if(openTravelRequests.length) {
        openTravelRequests.map(async(otr) => {
         await this.assignNewBoatToOpenTravelRequests(otr._id)
        })
      }
   }
}
</code>```

I have tried counter but not working.

Title: Nestjs prevent cron running 6 times

Body:
I have a nestjs cron problem.

I called just one time a cron function but function running 6 times. My code is below.

  @Cron(CronExpression.EVERY_MINUTE)
   async watcher() {
const now = new Date();
     const openTravelRequests = await this.getOpenTravelRequestsByDate(now);

      if(openTravelRequests.length) {
        openTravelRequests.map(async(otr) => {
         await this.assignNewBoatToOpenTravelRequests(otr._id)
        })
      }
   }
}

I have tried counter but not working.


问:
button.transform.parent = shopPanel; and button.transform.SetParent(shopPanel); not working
I'm attempting to create a new button game object. When I click the button to create the new game objects, it does not assign the game objects to the parent I'm telling it to.

```<code> public void DisplayUpgrades()
    {
        // Get the RectTransform component of the shop panel
        RectTransform shopPanelRectTransform = shopPanel.GetComponent<RectTransform>();

        // Set the initial position of the first button to 0
        float yPos = 0;

        foreach (var upgrade in upgrades)
        {
            // Create a new button game object
            GameObject button = new GameObject();
            button.name = "UpgradeButton";

            // Set the parent of the button to the shop panel
            button.transform.parent = shopPanel;

            // Set the size of the button to 10 units wide and 10 units tall
            button.transform.localScale = new Vector3(10, 10, 1);

            // Add a RectTransform component to the button
            RectTransform rectTransform = button.AddComponent<RectTransform>();

            // Set the position of the button using the RectTransform component
            rectTransform.localPosition = new Vector3(0, yPos, 0);

            rectTransform.sizeDelta = new Vector2(150, 20);

            // Add a Button component to the button
            Button btn = button.AddComponent<Button>();

            btn.transform.SetParent(shopPanel);

            // Add a TextMeshProUGUI component to the button
            TextMeshProUGUI text = button.AddComponent<TextMeshProUGUI>();
            text.transform.SetParent(shopPanel);

            // Set the font size of the text to 20 pixels
            text.fontSize = 8;
            text.alignment = TextAlignmentOptions.Center;

            // Set the text of the button to the name and cost of the upgrade
            text.text = $"{upgrade.Key}: cost: {upgrade.Value.cost}";

            // Add a listener to the button to handle when it is clicked
            btn.onClick.AddListener(() => PurchaseUpgrade(upgrade.Key));

            // Increment the y position by 20 pixels for the next button
            yPos += 90;
        }
    }
</code>```

To give some more info, I have 2 GUI elements, a canvas named 'Canvas' (parent of shopPanel), and 'shopPanel'. When I create new objects, they are being created as children of 'Canvas' rather than 'shopPanel'.  'shopPanel' is a Rect Transform. 'Canvas', also is a Rect Transform. I am needing 'button' to be a child of 'shopPanel' because when I want to add additional GUI elements, I don't want the addtl GUI elements to be destroyed when I attempt to destroy the children of shopPanel.

I have attempted button.transform.parent = shopPanel;, button.transform.SetParent(shopPanel). I have tried to see if 'button' is a child of 'shopPanel', and if it isn't, assign it as the Parent. I have tried creating different canvas's and different shop panels. I've tried restarting the program and my computer. Nothing has worked this far.

Body:
I'm attempting to create a new button game object. When I click the button to create the new game objects, it does not assign the game objects to the parent I'm telling it to.

 public void DisplayUpgrades()
    {
        // Get the RectTransform component of the shop panel
        RectTransform shopPanelRectTransform = shopPanel.GetComponent<RectTransform>();

        // Set the initial position of the first button to 0
        float yPos = 0;

        foreach (var upgrade in upgrades)
        {
            // Create a new button game object
            GameObject button = new GameObject();
            button.name = "UpgradeButton";

            // Set the parent of the button to the shop panel
            button.transform.parent = shopPanel;

            // Set the size of the button to 10 units wide and 10 units tall
            button.transform.localScale = new Vector3(10, 10, 1);

            // Add a RectTransform component to the button
            RectTransform rectTransform = button.AddComponent<RectTransform>();

            // Set the position of the button using the RectTransform component
            rectTransform.localPosition = new Vector3(0, yPos, 0);

            rectTransform.sizeDelta = new Vector2(150, 20);

            // Add a Button component to the button
            Button btn = button.AddComponent<Button>();

            btn.transform.SetParent(shopPanel);

            // Add a TextMeshProUGUI component to the button
            TextMeshProUGUI text = button.AddComponent<TextMeshProUGUI>();
            text.transform.SetParent(shopPanel);

            // Set the font size of the text to 20 pixels
            text.fontSize = 8;
            text.alignment = TextAlignmentOptions.Center;

            // Set the text of the button to the name and cost of the upgrade
            text.text = $"{upgrade.Key}: cost: {upgrade.Value.cost}";

            // Add a listener to the button to handle when it is clicked
            btn.onClick.AddListener(() => PurchaseUpgrade(upgrade.Key));

            // Increment the y position by 20 pixels for the next button
            yPos += 90;
        }
    }

To give some more info, I have 2 GUI elements, a canvas named 'Canvas' (parent of shopPanel), and 'shopPanel'. When I create new objects, they are being created as children of 'Canvas' rather than 'shopPanel'.  'shopPanel' is a Rect Transform. 'Canvas', also is a Rect Transform. I am needing 'button' to be a child of 'shopPanel' because when I want to add additional GUI elements, I don't want the addtl GUI elements to be destroyed when I attempt to destroy the children of shopPanel.

I have attempted button.transform.parent = shopPanel;, button.transform.SetParent(shopPanel). I have tried to see if 'button' is a child of 'shopPanel', and if it isn't, assign it as the Parent. I have tried creating different canvas's and different shop panels. I've tried restarting the program and my computer. Nothing has worked this far.


问:
Plot time series of paired columns
I have an excle file and would like to create time series plots. For a quick view of data for one site, caputred image is give below. I would like to plot two categories of data - one is modelled and the other is monitoring data. For example, "pH" and "pH data" on one plot, "WQ[SO4,Dissolved]" and "WQ data[SO4,Dissolved]" on one plot, as such for all the remaining 30 paires. That means 60 columns of data to plot.
enter image description here</p>
```<code>My approach was:
1) read excel data as DF;
2) creat a list for each category of parameters to plot
3) use the "zip" function to creat a paralle list: parameters_pair = zip(parameters_model,parameters_monitor)
4) plot, some codes shown below.

for i,j in parameters_pair:
    fig = plt.figure(figsize=(10, 7)
    ax.plot(df_Plot['Tstamps'], df_Plot[i],
                label=site, color='blue', linestyle='solid') #fillStyle='none'
    ax.plot(df_Plot['Tstamps'], df_Plot[j],
                label=site, color='orange', marker='s', markersize='4', linestyle='')

My code can plot for i or j individually but if it does not put modelled and monitoring data on one plot and iterate paralelly as expected. Could you please suggest what functions to use to solve this issue? Thank you very much.
</code>```

Title: Plot time series of paired columns

Body:
I have an excle file and would like to create time series plots. For a quick view of data for one site, caputred image is give below. I would like to plot two categories of data - one is modelled and the other is monitoring data. For example, "pH" and "pH data" on one plot, "WQ[SO4,Dissolved]" and "WQ data[SO4,Dissolved]" on one plot, as such for all the remaining 30 paires. That means 60 columns of data to plot.
enter image description here

My approach was:
1) read excel data as DF;
2) creat a list for each category of parameters to plot
3) use the "zip" function to creat a paralle list: parameters_pair = zip(parameters_model,parameters_monitor)
4) plot, some codes shown below.

for i,j in parameters_pair:
    fig = plt.figure(figsize=(10, 7)
    ax.plot(df_Plot['Tstamps'], df_Plot[i],
                label=site, color='blue', linestyle='solid') #fillStyle='none'
    ax.plot(df_Plot['Tstamps'], df_Plot[j],
                label=site, color='orange', marker='s', markersize='4', linestyle='')

My code can plot for i or j individually but if it does not put modelled and monitoring data on one plot and iterate paralelly as expected. Could you please suggest what functions to use to solve this issue? Thank you very much.


问:
Is there a mathematical function to calculate f?
I got this code from a coworker and I need to find out how big f would be at the end. I tried running it but it didn't finish after several hours. Is there a mathematical function/expression to solve this?

One approach I have is using Sum-notations, but I can't seem to figure out how to calculate the sum's bounds.

```<code>
private long f(){
    long a = 1;
    long f = a;
    for (long i = 0; i < a ; i++){
        f++;
        long b = f;

        for (long k = 0; k < b ; k++){
            f++;
            long c = f;

            for (long j = 0; j < c ; j++){
                f++;
                long d = f;

                for (long m = 0; m < d ; m++){
                    f++;
                    long e = f;

                    for (long n = 0; n < e ; n++){
                        f++;
                        long h = f;

                        for (long p = 0; p < h ; p++){
                            f = f+4;
                        }
                    }
                }
            }
        }
    }
return f;
}

</code>```

Body:
I got this code from a coworker and I need to find out how big f would be at the end. I tried running it but it didn't finish after several hours. Is there a mathematical function/expression to solve this?

One approach I have is using Sum-notations, but I can't seem to figure out how to calculate the sum's bounds.

private long f(){
    long a = 1;
    long f = a;
    for (long i = 0; i < a ; i++){
        f++;
        long b = f;

        for (long k = 0; k < b ; k++){
            f++;
            long c = f;

            for (long j = 0; j < c ; j++){
                f++;
                long d = f;

                for (long m = 0; m < d ; m++){
                    f++;
                    long e = f;

                    for (long n = 0; n < e ; n++){
                        f++;
                        long h = f;

                        for (long p = 0; p < h ; p++){
                            f = f+4;
                        }
                    }
                }
            }
        }
    }
return f;
}


问:
Checking the status of a phone call with ADB
I want to check the phone call status with ADB.
the thread Checking the status of a phone call remotely helped, but it only indicate if phone is idle/ringing/active.
I need to get different status code when i dial a call and when next person accepts the call. But above shell command is returning mCallState=2 in both the cases.

Do we have any shell command which return different status when i dial a call and when next person accepts the call ?


问:
How to define globally external plugin with inertiajs + vue in laravel?
I want to use vue-device-detector in my project. in this plugin docs it says to register with Vue.use(device) so how am i supposed to do this with inertiajs createInertiaApp.

App Versions:
Laravel: 9.44.0
Vue: 3.2.31
inertiajs/inertia: 0.11.0
inertiajs/inertia-vue3: 0.6.0

I have tried .use(device) on createApp in app.js. getting this error in console
main.ts:87 Uncaught (in promise) TypeError: Cannot set properties of undefined (setting '$device').

Project is created with laravel jetstream starter kit.

EDIT 1:
Here is my app.js code. i am don't know how i can register plugin here. (Because inertia mount the app here so i suppose global plugin also needs to be registered here!!)

import './bootstrap';
import '../css/app.css';

import { createApp, h } from 'vue';
import { createInertiaApp } from '@inertiajs/inertia-vue3';
import { InertiaProgress } from '@inertiajs/progress';
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m';

const appName = window.document.getElementsByTagName('title')[0]?.innerText || 'Laravel';

createInertiaApp({
    title: (title) => `${title} - ${appName}`,
    resolve: (name) => resolvePageComponent(`./Pages/${name}.vue`, import.meta.glob('./Pages/**/*.vue')),
    setup({ el, app, props, plugin }) {
        return createApp({ render: () => h(app, props) })
            .use(plugin)
            .use(ZiggyVue, Ziggy)
            .mount(el);
    },
});

InertiaProgress.init({ color: '#4B5563' });```

PS: Thank you for reading my question, and please excuse any errors

Body:
I want to use vue-device-detector in my project. in this plugin docs it says to register with Vue.use(device) so how am i supposed to do this with inertiajs createInertiaApp.

App Versions:
Laravel: 9.44.0
Vue: 3.2.31
inertiajs/inertia: 0.11.0
inertiajs/inertia-vue3: 0.6.0

I have tried .use(device) on createApp in app.js. getting this error in console
main.ts:87 Uncaught (in promise) TypeError: Cannot set properties of undefined (setting '$device').

Project is created with laravel jetstream starter kit.

EDIT 1:
Here is my app.js code. i am don't know how i can register plugin here. (Because inertia mount the app here so i suppose global plugin also needs to be registered here!!)

import './bootstrap';
import '../css/app.css';

import { createApp, h } from 'vue';
import { createInertiaApp } from '@inertiajs/inertia-vue3';
import { InertiaProgress } from '@inertiajs/progress';
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m';

const appName = window.document.getElementsByTagName('title')[0]?.innerText || 'Laravel';

createInertiaApp({
    title: (title) => `${title} - ${appName}`,
    resolve: (name) => resolvePageComponent(`./Pages/${name}.vue`, import.meta.glob('./Pages/**/*.vue')),
    setup({ el, app, props, plugin }) {
        return createApp({ render: () => h(app, props) })
            .use(plugin)
            .use(ZiggyVue, Ziggy)
            .mount(el);
    },
});

InertiaProgress.init({ color: '#4B5563' });

PS: Thank you for reading my question, and please excuse any errors


问:
How to partially add data to the array and save the previous state
How to partially add data to an array and display it? The array is reset each time. Is it possible to save the previous state of an array before adding new data?</p>
```<code>const ICONS_PER_PAGE = 5

const IconsList = () => {
    const { iconArray, setIconArray } = useContext(IconArray)

    const [triggerToLoad, setTriggerToLoad] = useState(true)
    const [iconArrayLazy, setIconArrayLazy] = useState([])

    const scrollHandler = (e) => {
        let scrollGalleryValue = document.querySelector('.list__container').getBoundingClientRect().y + document.querySelector('.list__container').clientHeight - window.innerHeight
        if (scrollGalleryValue <= 0 ) {
            setTriggerToLoad(!triggerToLoad)
            console.log(iconArrayLazy); // [] empty array
        }
    }

    useEffect(() => {
        setIconArrayLazy(iconArrayLazy => [...iconArrayLazy, ...iconArray.slice(iconArrayLazy.length, iconArrayLazy.length + ICONS_PER_PAGE)])
    }, [triggerToLoad])

    useEffect(() => {
        setIconArrayLazy(iconArrayLazy => [...iconArrayLazy, ...iconArray.slice(iconArrayLazy.length, iconArrayLazy.length + ICONS_PER_PAGE)])
        document.addEventListener('scroll', scrollHandler)
        return function () {
            document.removeEventListener('scroll', scrollHandler)
        }
    }, [])

    return (
        <>
            <ul className="list__container">

                {iconArrayLazy.map(({id, title, img}) =>

                    <li className="icon_container" key={id}>
                        <Link to={`/icon-${id}`}>
                            <img className="icon_container__image" src={img} alt={title} />
                        </Link>
                    </li>
                )}

            </ul>
        </>
    )
}
export default IconsList
</code>```

Body:
How to partially add data to an array and display it? The array is reset each time. Is it possible to save the previous state of an array before adding new data?

const ICONS_PER_PAGE = 5

const IconsList = () => {
    const { iconArray, setIconArray } = useContext(IconArray)

    const [triggerToLoad, setTriggerToLoad] = useState(true)
    const [iconArrayLazy, setIconArrayLazy] = useState([])

    const scrollHandler = (e) => {
        let scrollGalleryValue = document.querySelector('.list__container').getBoundingClientRect().y + document.querySelector('.list__container').clientHeight - window.innerHeight
        if (scrollGalleryValue <= 0 ) {
            setTriggerToLoad(!triggerToLoad)
            console.log(iconArrayLazy); // [] empty array
        }
    }

    useEffect(() => {
        setIconArrayLazy(iconArrayLazy => [...iconArrayLazy, ...iconArray.slice(iconArrayLazy.length, iconArrayLazy.length + ICONS_PER_PAGE)])
    }, [triggerToLoad])

    useEffect(() => {
        setIconArrayLazy(iconArrayLazy => [...iconArrayLazy, ...iconArray.slice(iconArrayLazy.length, iconArrayLazy.length + ICONS_PER_PAGE)])
        document.addEventListener('scroll', scrollHandler)
        return function () {
            document.removeEventListener('scroll', scrollHandler)
        }
    }, [])

    return (
        <>

                {iconArrayLazy.map(({id, title, img}) =>

                        <Link to={`/icon-${id}`}>

                        </Link>

                )}

        </>
    )
}
export default IconsList


问:
How to print a value from main-process to renderer's devtools in electron
I want to print some object that is only available in main-process but i need to print that object in electron devtools so i can expand and explore it in devtools.

i used console.log() but this only prints object in terminal. Is there any work around like custom function with ipc running myConsole.log("object") in main-process and it prints in devtools?


问:
Python Speechrecognition throws some error
I had this error, when trying to run python speecrecognition
I tried to run a basic speech recognition in python but it didn't work. I have installed pyaudio and pytssx3 and speechrecognition and am running the latest version of pip and python.
It says alsa error. By the way i have connected a bluetooth headphone to the computer since my in-built microphone isn't good enough.</p>
```<code>ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

result2:
{   'alternative': [   {   'confidence': 0.92995483,
                           'transcript': 'hello hello hello'},
                       {'transcript': 'hello hello hello hello'},
                       {'transcript': 'Hallo Hallo hallo'},
                       {'transcript': 'hello hello I love you'},
                       {'transcript': 'hello hello hello hello hello'}],
    'final': True}
Did you say  hello hello hello
Traceback (most recent call last):
  File "/home/inky/.local/lib/python3.10/site-packages/pyttsx3/__init__.py", line 20, in init
    eng = _activeEngines[driverName]
  File "/usr/lib/python3.10/weakref.py", line 137, in __getitem__
    o = self.data[key]()
KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/inky/Desktop/assistant/main.py", line 46, in <module>
    SpeakText(MyText)
  File "/home/inky/Desktop/assistant/main.py", line 16, in SpeakText
    engine = pyttsx3.init()
  File "/home/inky/.local/lib/python3.10/site-packages/pyttsx3/__init__.py", line 22, in init
    eng = Engine(driverName, debug)
  File "/home/inky/.local/lib/python3.10/site-packages/pyttsx3/engine.py", line 30, in __init__
    self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
  File "/home/inky/.local/lib/python3.10/site-packages/pyttsx3/driver.py", line 50, in __init__
    self._module = importlib.import_module(name)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/inky/.local/lib/python3.10/site-packages/pyttsx3/drivers/espeak.py", line 9, in <module>
    from . import _espeak, toUtf8, fromUtf8
  File "/home/inky/.local/lib/python3.10/site-packages/pyttsx3/drivers/_espeak.py", line 18, in <module>
    dll = cdll.LoadLibrary('libespeak.so.1')
  File "/usr/lib/python3.10/ctypes/__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libespeak.so.1: cannot open shared object file: No such file or directory
</code>```

Body:
I had this error, when trying to run python speecrecognition
I tried to run a basic speech recognition in python but it didn't work. I have installed pyaudio and pytssx3 and speechrecognition and am running the latest version of pip and python.
It says alsa error. By the way i have connected a bluetooth headphone to the computer since my in-built microphone isn't good enough.

ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

result2:
{   'alternative': [   {   'confidence': 0.92995483,
                           'transcript': 'hello hello hello'},
                       {'transcript': 'hello hello hello hello'},
                       {'transcript': 'Hallo Hallo hallo'},
                       {'transcript': 'hello hello I love you'},
                       {'transcript': 'hello hello hello hello hello'}],
    'final': True}
Did you say  hello hello hello
Traceback (most recent call last):
  File "/home/inky/.local/lib/python3.10/site-packages/pyttsx3/__init__.py", line 20, in init
    eng = _activeEngines[driverName]
  File "/usr/lib/python3.10/weakref.py", line 137, in __getitem__
    o = self.data[key]()
KeyError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/inky/Desktop/assistant/main.py", line 46, in <module>
    SpeakText(MyText)
  File "/home/inky/Desktop/assistant/main.py", line 16, in SpeakText
    engine = pyttsx3.init()
  File "/home/inky/.local/lib/python3.10/site-packages/pyttsx3/__init__.py", line 22, in init
    eng = Engine(driverName, debug)
  File "/home/inky/.local/lib/python3.10/site-packages/pyttsx3/engine.py", line 30, in __init__
    self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
  File "/home/inky/.local/lib/python3.10/site-packages/pyttsx3/driver.py", line 50, in __init__
    self._module = importlib.import_module(name)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/inky/.local/lib/python3.10/site-packages/pyttsx3/drivers/espeak.py", line 9, in <module>
    from . import _espeak, toUtf8, fromUtf8
  File "/home/inky/.local/lib/python3.10/site-packages/pyttsx3/drivers/_espeak.py", line 18, in <module>
    dll = cdll.LoadLibrary('libespeak.so.1')
  File "/usr/lib/python3.10/ctypes/__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libespeak.so.1: cannot open shared object file: No such file or directory


问:
Azure Policy "SQL Server Integration Services integration runtimes on Azure Data Factory should be joined to a virtual network" returns not compliant
I've assigned the SQL Server Integration Services integration runtimes on Azure Data Factory should be joined to a virtual network Azure Policy to my resource group where I'm deploying a Data Factory instance.

I've VNet injected the SSIS IR using the express method  This worked + confirmed that all the requirements are fulfilled, but the policy evaluation returns a state of not complianet:

Policy condition criteria

ARM template exported for my ADF setup.

Any idea what I’m doing wrong? I suspect this might be an issue with the Policy definition itself (using the built-in policy).


问:
bootstrap-select only creates li elements after the first opening of the dropdown but I need the number of
 elements on load
Using bootstrap-select, I have 4 dropdowns:

```<code><select id="dropdown1">
    <option id="foo_1"></option>
    <option id="foo_2"></option>
</select>

<select id="dropdown2">
    <option class="foo_1"></option>
    <option class="foo_2"></option>
    <option class="foo_2"></option>
    // .. many more options ..
</select>

<select id="dropdown3">
     // .. many options ..
</select>

<select id="dropdown4">
     // .. many options ..
</select>
</code>```

Then in the JS I initialize them as bootstrap-select dropdowns:

```<code>$('#dropdown1').selectpicker();
$('#dropdown2').selectpicker();
$('#dropdown3').selectpicker();
$('#dropdown4').selectpicker();
</code>```

if I select an option in #dropdown1 with id of foo_1 for example, I want to hide all elements that have class foo_1 on #dropdown2.

bootstrap-select hides the actual <option> elements, and creates its own dropdown div with
 elements that have the underlying <option> data.

The problem is that the
 elements that bootstrap-select creates do not exist yet if I never open the dropdown for the first time, so the
 selector can't find it to hide it:

$("li.foo_1").hide();

I tried toggling them twice so that it would open and close them and create the elements:

```<code>$('#dropdown1').selectpicker('toggle');
$('#dropdown1').selectpicker('toggle');
$('#dropdown2').selectpicker('toggle');
$('#dropdown2').selectpicker('toggle');
$('#dropdown3').selectpicker('toggle');
$('#dropdown3').selectpicker('toggle');
$('#dropdown4').selectpicker('toggle');
$('#dropdown4').selectpicker('toggle');
</code>```

And while it does seem to work for some of the dropdowns, and it does create the
 elements, it does not work for all the dropdowns. Can't figure out why, but still, maybe there is a better way to make it work

Title: bootstrap-select only creates li elements after the first opening of the dropdown but I need the number of <li> elements on load

Body:
Using bootstrap-select, I have 4 dropdowns:

<select id="dropdown1">
    <option id="foo_1"></option>
    <option id="foo_2"></option>
</select>

<select id="dropdown2">
    <option class="foo_1"></option>
    <option class="foo_2"></option>
    <option class="foo_2"></option>
    // .. many more options ..
</select>

<select id="dropdown3">
     // .. many options ..
</select>

<select id="dropdown4">
     // .. many options ..
</select>

Then in the JS I initialize them as bootstrap-select dropdowns:

$('#dropdown1').selectpicker();
$('#dropdown2').selectpicker();
$('#dropdown3').selectpicker();
$('#dropdown4').selectpicker();

if I select an option in #dropdown1 with id of foo_1 for example, I want to hide all elements that have class foo_1 on #dropdown2.

bootstrap-select hides the actual <option> elements, and creates its own dropdown div with
 elements that have the underlying <option> data.

The problem is that the
 elements that bootstrap-select creates do not exist yet if I never open the dropdown for the first time, so the
 selector can't find it to hide it:

$("li.foo_1").hide();

I tried toggling them twice so that it would open and close them and create the elements:

$('#dropdown1').selectpicker('toggle');
$('#dropdown1').selectpicker('toggle');
$('#dropdown2').selectpicker('toggle');
$('#dropdown2').selectpicker('toggle');
$('#dropdown3').selectpicker('toggle');
$('#dropdown3').selectpicker('toggle');
$('#dropdown4').selectpicker('toggle');
$('#dropdown4').selectpicker('toggle');

And while it does seem to work for some of the dropdowns, and it does create the
 elements, it does not work for all the dropdowns. Can't figure out why, but still, maybe there is a better way to make it work


问:
Make a preventBack function not work on a certain url
I'm making a webpage and I'm really new to this. I have a preventBack function that works great, but I want a certain page (specifically the name is restart.html) not to be affected by this script.

I have been searching for some time and tried different solutions and but nothing worked.

This is the function:

```<code>function preventBack() {
  window.history.forward();
}
setTimeout("preventBack()", 0);
window.onunload = function () {
  null;
};
</code>```

This function is written on page1.html (for example), and it affects page2.html (because of the window.history.forward, if I'm not mistaken).

I just want it to change its behavior so that if you've clicked the restart button by mistake, you can just go back to the previous page and continue.

I've tried it with if and else, and also changing the number for the timeout, but it doesn't work as I want it to.

Body:
I'm making a webpage and I'm really new to this. I have a preventBack function that works great, but I want a certain page (specifically the name is restart.html) not to be affected by this script.

I have been searching for some time and tried different solutions and but nothing worked.

This is the function:

function preventBack() {
  window.history.forward();
}
setTimeout("preventBack()", 0);
window.onunload = function () {
  null;
};

This function is written on page1.html (for example), and it affects page2.html (because of the window.history.forward, if I'm not mistaken).

I just want it to change its behavior so that if you've clicked the restart button by mistake, you can just go back to the previous page and continue.

I've tried it with if and else, and also changing the number for the timeout, but it doesn't work as I want it to.


问:
Docker standard input
I would like to ask about Docker und SQL. I would like to start SQL in docker. I was able to start this container with name: my_sql_container

The problem comes if i want to enter in container with command:

```<code>docker exec -it my_sql_container bash
</code>```

I cann't use command Copy and Paste.

Title: Docker standard input

Body:
I would like to ask about Docker und SQL. I would like to start SQL in docker. I was able to start this container with name: my_sql_container

The problem comes if i want to enter in container with command:

docker exec -it my_sql_container bash

I cann't use command Copy and Paste.


问:
Use JSON instead of m3u8 in hls.js
I am using hls.js in my project and it works well with .m3u8 playlists. However, in case of short clips, it is time-consuming to generate m3u8 playlists and therefore I want to pass a file, containing .ts paths ideally in a json format. Is this possible at all? Can we feed a hls player with chunks of json data rather than a whole m3u8 playlist?

Title: Use JSON instead of m3u8 in hls.js


问:
Showing line number enabled description of C++ code
```<code>1 int main(){

2 long count = 0;
3 long rd = 0;

4 return 0;
5 }
</code>```

Above is the C++ code and we need to refer this line number using a \ref.
Suppose in my LaTeX article I have to do code explanation using line numbers.
For example, line number 1 is all about int main for the above C++ code. Similarly, line number 2 is all about variable declaration.

```<code>1 int main(){

2 long count = 0;/*@\label{stat-3}*/
3 long rd = 0;/*@\label{stat-4}*/

4 return 0;
5 }
</code>```

Above is the C++ code and we need to refer to this line number using \ref.
Suppose in my LaTeX article I have to do code explanation using line number like \ref{stat-3}. But for me it is not working.

Body:
1 int main(){

2 long count = 0;
3 long rd = 0;

4 return 0;
5 }

Above is the C++ code and we need to refer this line number using a \ref.
Suppose in my LaTeX article I have to do code explanation using line numbers.
For example, line number 1 is all about int main for the above C++ code. Similarly, line number 2 is all about variable declaration.

1 int main(){

2 long count = 0;/*@\label{stat-3}*/
3 long rd = 0;/*@\label{stat-4}*/

4 return 0;
5 }

Above is the C++ code and we need to refer to this line number using \ref.
Suppose in my LaTeX article I have to do code explanation using line number like \ref{stat-3}. But for me it is not working.


问:
strapi - Set roles permissions - delete role automatic onSave
When I set roles permissions it deletes automatically when I hit the save button, only when on the server, when we try it on localhost it works perfectly.
Does somebody know what the problem could be? or have a solution like setting it to default on code or another solution?

before clicking Save

after clicking Save

I tried to set default on code or create another simlar route with a diffrent content.


问:
Validation loss (mae) decreasing but validation metric (mae) not decreasing
Issue that I am facing: the training mae loss, training mae error (metric), validation mae loss are decreasing but the validation mae error fluctuates but it's overall trend is not decreasing.

Model description: consists of two networks(timedistributed CNN and timedistributed Dense layers respectively applied to each temporal slice of input in the sample) the output of which merge into one and then are fed to the first LSTM layer as a sequence in time. The output of this LSTM goes to the second LSTM layer which finally gives the output.

Model loss and metric:

tensorflow model loss in model.compile method = MAE

tensorflow model metric in model.compile method = MAE

Model output: forecast 6 numbers of the target label at a 10 minute interval (i.e. 6 numbers for the next one hour)

Model input: input data for one hour. Images to the CNN branch. Image timestamp specific tabular features to the Dense branch. The interval between the data points in both the images and their respective tabular features is 10 minutes.

Training size: 76,600 samples (from year 2018 to 2021)
Validation size: 13,500 samples (year 2022)

Regularization used: L2 and Dropout in CNN & dense branches and LSTM.

Learning rate used: 2e-4 which decays at a rate of 0.4 after every 5 epochs till 1e-5.

Epochs: 20

eg: input data from 9am to 9.50am will consist of 6 timestamps separated at 10 minute interval. At each of these timestamps we'll have an image and corresponding tabular data features. The output will be 6 numbers at 10am, 10.10am ,10.20am, 10.30am, 10.40am and 10.50am for the target label.

What have I tried: I have played around with learning rate and the number of layers in the model which helped me to decrease everything except for validation mae error. If I apply more regularization then: training mae loss, training mae error, validation mae loss don't decrease as much as with little regularization.

I am not able to understand as to what would it mean if everything except for validation mae is decreasing.

Also, if it's important to know: the training mae loss is decreasing faster than the validation mae loss.

Pasting the links to the relevant images (not allowed to paste inline images by stackoverflow).

The graph of train vs validation metric(mae)

The graph of train vs validation loss(mae)

Thank you for all the help in advance.


问:
Why do i get different mean average precision in YOLOv4 Tiny?
After completing the training process using YOLOv4 Tiny model, I save the weight file of the best mAP for later use. However, when I test that weight file, it gives me different mAP for the same folder of darknet and test, train, cfg, data, names files. Am I doing something wrong anywhere?

I tried to use the best mAP weight file for testing images for later use, but it gives me different mAP from the best mAP, most of the time lower mAP than it showed afte the training process finished as best mAP.