问:
What is the most beginner-friendly way to implement a neural network?
I am currently doing research in high energy physics and would like to implement a neural network to determine the best "kinematic cuts" to apply to particles before using those particles for calculation.

Currently, I am using Monte-Carlo simulation to generate 1e5 particle events. An event is defined as two protons colliding with E_cm = 13 TeV. When those protons collide, they chaotically produce many other particles, some stable, some not. Through Monte-Carlo simulation, I am able to ensure that in every event, a specific particle decay occurs. The products of this decay are what I would like to study.

Through an extensive list of particles from each event, it is my goal to collect these specific particles reliably. Since the data is ambiguous (there is no 'for sure' way to know which particles actually came from the decay), we employ kinematic cuts that help to weed out more unlikely candidates. In one case, the particles I am studying tend to have higher transverse momentum (pT) than the rest of the particles so it is helpful to ignore particles with pT below a certain threshold: a particle must have pT greater than (for example) 2 GeV to be considered for calculation. So the 'pT kinematic cut' is 2 GeV. These kinematic cuts can be thought of as filters! Any particle with pT <= 2 will not pass through this filter.

This brings in a problem! If we use a more aggressive filter (ie. particles must have pT > 5 GeV), our output calculations are more precise and accurate! BUT, many events will have correct particles that do not pass the filters. Such events will be lost, hence we lose selection efficiency. On the other hand, a less aggressive filter (ie. particles must have pT > 1 GeV) lets in so many background particles that many wrong combinations end up being collected.

Now, I would like to implement a neural network that tests different values of these kinematic cuts such that accuracy and precision of calculation are optimized as well as selection efficiency.

I am using C++, Pythia8, and my code fully relies on , , and . Usually sorting vector<tuple<##>>

I tried openNN but it simply wouldn't work. A program that allows me to input my code with tweakables and desired output would be ideal.


来源: stackexchange

问:
Using Aspose.Slides For Python With MacOS
I'm utilising aspose.slides for Python successfully on Windows, recently they've added MacOS support. When I try to run ANY aspose.slides script on MacOS I get an error that it can't find libpython dylib in /usr/lib or /usr/local/lib

Simple example

```<code>import aspose.slides as slides

# Instantiate a Presentation object that represents a presentation file
with slides.Presentation() as presentation:
    slide = presentation.slides[0]
    slide.shapes.add_auto_shape(slides.ShapeType.LINE, 50, 150, 300, 0)
    presentation.save("NewPresentation_out.pptx", slides.export.SaveFormat.PPTX)
</code>```

I've added a symbolic link from /usr/lib or /usr/local/lib directory to the libpython file but now I get the error “zsh segmentation fault”

I've googled and tried so many things but always the same result. Can anyone shed any light on where I maybe going wrong please?

ContentLicense: CC BY-SA 4.0

Body:
I'm utilising aspose.slides for Python successfully on Windows, recently they've added MacOS support. When I try to run ANY aspose.slides script on MacOS I get an error that it can't find libpython dylib in /usr/lib or /usr/local/lib

Simple example

import aspose.slides as slides

# Instantiate a Presentation object that represents a presentation file
with slides.Presentation() as presentation:
    slide = presentation.slides[0]
    slide.shapes.add_auto_shape(slides.ShapeType.LINE, 50, 150, 300, 0)
    presentation.save("NewPresentation_out.pptx", slides.export.SaveFormat.PPTX)

I've added a symbolic link from /usr/lib or /usr/local/lib directory to the libpython file but now I get the error “zsh segmentation fault”

I've googled and tried so many things but always the same result. Can anyone shed any light on where I maybe going wrong please?


问:
Why wouldn't my proxy work on a particular site in Python Selenium?
I'm getting this error on a website using Python, Selenium with a proxy. If I substitute example.com with another site, the proxy works, so it must be something with the site. The site works without the proxy. Furthermore, the user agent is the same on my Chromium browser as it is with the Chromium webdriver browser. The proxies are US residential proxies and are rotated.

Error:

```<code>This site can’t be reached. The webpage at https://example.com might be temporarily down or it may have moved permanently to a new web address.
ERR_TUNNEL_CONNECTION_FAILED
</code>```

Here's the code:

```<code>from selenium import webdriver
from random import choice

proxies = [
"my.proxy.com:32322",
"my.other.proxy.com:22222"
]

PROXY = choice(proxies)

webdriver.DesiredCapabilities.CHROME['proxy'] = {
    "httpProxy": PROXY,
    "ftpProxy": PROXY,
    "sslProxy": PROXY,
    "proxyType": "MANUAL",
}

webdriver.DesiredCapabilities.CHROME['acceptSslCerts']=True
driver =webdriver.Chrome(executable_path="/usr/bin/chromedriver")
driver.get("https://example.com")
</code>```

Body:
I'm getting this error on a website using Python, Selenium with a proxy. If I substitute example.com with another site, the proxy works, so it must be something with the site. The site works without the proxy. Furthermore, the user agent is the same on my Chromium browser as it is with the Chromium webdriver browser. The proxies are US residential proxies and are rotated.

Error:

This site can’t be reached. The webpage at https://example.com might be temporarily down or it may have moved permanently to a new web address.
ERR_TUNNEL_CONNECTION_FAILED

Here's the code:

from selenium import webdriver
from random import choice

proxies = [
"my.proxy.com:32322",
"my.other.proxy.com:22222"
]

PROXY = choice(proxies)

webdriver.DesiredCapabilities.CHROME['proxy'] = {
    "httpProxy": PROXY,
    "ftpProxy": PROXY,
    "sslProxy": PROXY,
    "proxyType": "MANUAL",
}

webdriver.DesiredCapabilities.CHROME['acceptSslCerts']=True
driver =webdriver.Chrome(executable_path="/usr/bin/chromedriver")
driver.get("https://example.com")


问:
OSError: [Errno 28] No space left on device when I run a python program
Hello all when I run a python program that makes network requests and downloads a lot of data, I get this error:

```<code>Traceback (most recent call last):
  File "C:\Python311\Lib\site-packages\pandas\io\formats\csvs.py", line 261, in save
    self._save()
  File "C:\Python311\Lib\site-packages\pandas\io\formats\csvs.py", line 266, in _save
    self._save_body()
  File "C:\Python311\Lib\site-packages\pandas\io\formats\csvs.py", line 304, in _save_body
    self._save_chunk(start_i, end_i)
  File "C:\Python311\Lib\site-packages\pandas\io\formats\csvs.py", line 315, in _save_chunk
    libwriters.write_csv_rows(
  File "pandas\_libs\writers.pyx", line 72, in pandas._libs.writers.write_csv_rows
OSError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

OSError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\elena\Desktop\actors.py", line 57, in <module>
    get_popular_movies()
  File "C:\Users\elena\Desktop\actors.py", line 49, in get_popular_movies
    csv_edges.to_csv('edges.csv',index=False,header=True)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\pandas\core\generic.py", line 3720, in to_csv
    return DataFrameRenderer(formatter).to_csv(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\pandas\io\formats\format.py", line 1189, in to_csv
    csv_formatter.save()
  File "C:\Python311\Lib\site-packages\pandas\io\formats\csvs.py", line 241, in save
    with get_handle(
  File "C:\Python311\Lib\site-packages\pandas\io\common.py", line 133, in __exit__
    self.close()
  File "C:\Python311\Lib\site-packages\pandas\io\common.py", line 125, in close
    handle.close()
OSError: [Errno 28] No space left on device
</code>```

From what I understand I don't have enough space on my computer. How can I fix this? I use windows not linux

Body:
Hello all when I run a python program that makes network requests and downloads a lot of data, I get this error:

Traceback (most recent call last):
  File "C:\Python311\Lib\site-packages\pandas\io\formats\csvs.py", line 261, in save
    self._save()
  File "C:\Python311\Lib\site-packages\pandas\io\formats\csvs.py", line 266, in _save
    self._save_body()
  File "C:\Python311\Lib\site-packages\pandas\io\formats\csvs.py", line 304, in _save_body
    self._save_chunk(start_i, end_i)
  File "C:\Python311\Lib\site-packages\pandas\io\formats\csvs.py", line 315, in _save_chunk
    libwriters.write_csv_rows(
  File "pandas\_libs\writers.pyx", line 72, in pandas._libs.writers.write_csv_rows
OSError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

OSError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\elena\Desktop\actors.py", line 57, in <module>
    get_popular_movies()
  File "C:\Users\elena\Desktop\actors.py", line 49, in get_popular_movies
    csv_edges.to_csv('edges.csv',index=False,header=True)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\pandas\core\generic.py", line 3720, in to_csv
    return DataFrameRenderer(formatter).to_csv(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\pandas\util\_decorators.py", line 211, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\pandas\io\formats\format.py", line 1189, in to_csv
    csv_formatter.save()
  File "C:\Python311\Lib\site-packages\pandas\io\formats\csvs.py", line 241, in save
    with get_handle(
  File "C:\Python311\Lib\site-packages\pandas\io\common.py", line 133, in __exit__
    self.close()
  File "C:\Python311\Lib\site-packages\pandas\io\common.py", line 125, in close
    handle.close()
OSError: [Errno 28] No space left on device

From what I understand I don't have enough space on my computer. How can I fix this? I use windows not linux


问:
Is there any way to get the text which is not present in any tag? or is there any way to get the locator? Or am I taking the wrong element?
DOM from where I need to get text which is underlined:

I'm getting following error:

"AttributeError: 'NoneType' object has no attribute 'text'"

My code:

#This my locator in page class
success_msg_css = "div.alert.alert-success.alert-dismissable"

#This is the method defined
def AddCustomerSuccess(self):
    self.driver.find_element(By.CSS_SELECTOR, self.success_msg_css)

#over here I am calling the function and trying to assert.
success_msg = self.ac.AddCustomerSuccess().text()
print("there is success msg", success_msg)

if success_msg == "The new customer has been added successfully.":
    assert True
else:
    assert False

self.logger.info("************************Test Add customer passed*************************")
```

How to get text from tag?

Body:
DOM from where I need to get text which is underlined:

I'm getting following error:

"AttributeError: 'NoneType' object has no attribute 'text'"

My code:

#This my locator in page class
success_msg_css = "div.alert.alert-success.alert-dismissable"

#This is the method defined
def AddCustomerSuccess(self):
    self.driver.find_element(By.CSS_SELECTOR, self.success_msg_css)

#over here I am calling the function and trying to assert.
success_msg = self.ac.AddCustomerSuccess().text()
print("there is success msg", success_msg)

if success_msg == "The new customer has been added successfully.":
    assert True
else:
    assert False

self.logger.info("************************Test Add customer passed*************************")

How to get text from tag?


问:
GitHub Copilot shows only few lines of suggestion
I'm testing GitHub Copilot in Visual Studio 2022, and it shows only a few lines of the code instead the complete code:

If I click tab button it writes only this code lines.

Is this a normal behavior?


问:
How to download pdf from html embed tag without src rendered by javascript in python selenium
I am going to download pdf from html page.

The page structure is following.

index.html:

```<code><!DOCTYPE html>
<html>

    <head>
    </head>
    <body>
        <iframe src="a.html"></iframe>
    </body>
</html>
</code>```

a.html:

```<code><!DOCTYPE html>
<html>

<head>
    <script type='text/javascript'>this.document.location = "pubs/document-238727.PDF";</script>
</head>

</html>
</code>```

inspect view of index.html:

```<code><!DOCTYPE html>
<html>

    <head>
    </head>
    <body>
        <iframe src="a.html">
            #document
            <!DOCTYPE html>
            <html>

            <head>
                <embed
                    name="289740873" style="position:absolute; left: 0; top: 0;" width="100%" height="100%" src="about:blank" type="application/pdf" internalid="182D67B1A56A055A2F879042870BB4E0">
            </head>

            </html>
        </iframe>
    </body>
</html>
</code>```

I am going to download this pdf file of embed tag.

I have tried in several ways but didn't yet.

Body:
I am going to download pdf from html page.

The page structure is following.

index.html:

<!DOCTYPE html>

a.html:

<!DOCTYPE html>

inspect view of index.html:

<!DOCTYPE html>

            #document
            <!DOCTYPE html>

                <embed
                    name="289740873" style="position:absolute; left: 0; top: 0;" width="100%" height="100%" src="about:blank" type="application/pdf" internalid="182D67B1A56A055A2F879042870BB4E0">

I am going to download this pdf file of embed tag.

I have tried in several ways but didn't yet.


问:
Flutter: "Binding has not yet been initialized" when accessing Flutter Secure Storage from an isolate
I'm working on a large Flutter project for Android/iOS/Windows. It will have multiple processor-intensive code segments, such as server data syncing, so to prevent the UI from being slowed down we're running those on separate isolates. One of the packages we're using is Flutter Secure Storage 7.0.0 to store data between sessions. However, whenever I try to access secure storage from within the isolate, I get the following error:

```<code>Binding has not yet been initialized.
The "instance" getter on the ServicesBinding binding mixin is only available once that binding has been initialized.
Typically, this is done by calling "WidgetsFlutterBinding.ensureInitialized()" or "runApp()" (the latter calls the former). Typically this call is done in the "void main()" method. The "ensureInitialized" method is idempotent; calling it multiple times is not harmful. After calling that method, the "instance" getter will return the binding.
In a test, one can call "TestWidgetsFlutterBinding.ensureInitialized()" as the first line in the test's "main()" method to initialize the binding.
If ServicesBinding is a custom binding mixin, there must also be a custom binding class, like WidgetsFlutterBinding, but that mixes in the selected binding, and that is the class that must be constructed before using the "instance" getter.
</code>```

The error suggests calling WidgetsFlutterBinding.ensureInitialized(), however I've added that to the main function of my main isolate, and attempting to call it on the second isolate throws another error about running UI actions on non-root isolates.

One of the possible workarounds I'm aware of is to use send/receive ports to only use secure storage on the main isolate, and transfer data as needed. The problem is, one of the future plans for these isolates is to keep these isolates alive when the user closes the app, to allow us continuous background data syncing. My team has little experience on that kind of isolate usage, so I'm aware I may have a misunderstanding of how that part of our app may work in the future. But until we have a better grasp of that, we're looking to make the isolates as independent from the main isolate as possible.

Here's a minimal code sample needed to reproduce this issue:

```<code>//Run this function from main isolate
void runIsolateStorageTest() async {
  //Create storage and write a value
  const storage = FlutterSecureStorage();
  await storage.write(key: "key", value: "value");

  //Create and run second isolate. Main project uses a send/recieve port system, so I've replicated that here
  var recievePort = ReceivePort();
  await Isolate.spawn(isolateMain, recievePort.sendPort);

  //Await the returned value from second isolate and print to console
  var storageValue = await recievePort.first;
  print(storageValue);
}

//Function to be run on second isolate
void isolateMain(SendPort sendPort) async {
  //Several S.O. posts on similar issues have recommended this line. However, it seems to have no effect on my code
  DartPluginRegistrant.ensureInitialized();

  //Create storage and attempt to access written key
  const storage = FlutterSecureStorage();
  dynamic value = "";
  try {
    //Error is thrown when attempting to read value.
    //Other storage functions such as .write or .containsKey throw the same error when used here
    value = await storage.read(key: "key");
  }
  on Error catch (e) {
    value = e;
  }

  //Return the resulting value to the main isolate
  sendPort.send(value);
}
</code>```

EDIT: After even more searching and digging through the flutter_secure_storage code, I've been able to more accurately identify the problem; This package uses platform channels to handle the platform specific storage implementations. According to the Flutter docs, channel methods must be invoked on the main thread. There may be a way around that using platform specific implementations, but I haven't figured that out yet.

Body:
I'm working on a large Flutter project for Android/iOS/Windows. It will have multiple processor-intensive code segments, such as server data syncing, so to prevent the UI from being slowed down we're running those on separate isolates. One of the packages we're using is Flutter Secure Storage 7.0.0 to store data between sessions. However, whenever I try to access secure storage from within the isolate, I get the following error:

Binding has not yet been initialized.
The "instance" getter on the ServicesBinding binding mixin is only available once that binding has been initialized.
Typically, this is done by calling "WidgetsFlutterBinding.ensureInitialized()" or "runApp()" (the latter calls the former). Typically this call is done in the "void main()" method. The "ensureInitialized" method is idempotent; calling it multiple times is not harmful. After calling that method, the "instance" getter will return the binding.
In a test, one can call "TestWidgetsFlutterBinding.ensureInitialized()" as the first line in the test's "main()" method to initialize the binding.
If ServicesBinding is a custom binding mixin, there must also be a custom binding class, like WidgetsFlutterBinding, but that mixes in the selected binding, and that is the class that must be constructed before using the "instance" getter.

The error suggests calling WidgetsFlutterBinding.ensureInitialized(), however I've added that to the main function of my main isolate, and attempting to call it on the second isolate throws another error about running UI actions on non-root isolates.

One of the possible workarounds I'm aware of is to use send/receive ports to only use secure storage on the main isolate, and transfer data as needed. The problem is, one of the future plans for these isolates is to keep these isolates alive when the user closes the app, to allow us continuous background data syncing. My team has little experience on that kind of isolate usage, so I'm aware I may have a misunderstanding of how that part of our app may work in the future. But until we have a better grasp of that, we're looking to make the isolates as independent from the main isolate as possible.

Here's a minimal code sample needed to reproduce this issue:

//Run this function from main isolate
void runIsolateStorageTest() async {
  //Create storage and write a value
  const storage = FlutterSecureStorage();
  await storage.write(key: "key", value: "value");

  //Create and run second isolate. Main project uses a send/recieve port system, so I've replicated that here
  var recievePort = ReceivePort();
  await Isolate.spawn(isolateMain, recievePort.sendPort);

  //Await the returned value from second isolate and print to console
  var storageValue = await recievePort.first;
  print(storageValue);
}

//Function to be run on second isolate
void isolateMain(SendPort sendPort) async {
  //Several S.O. posts on similar issues have recommended this line. However, it seems to have no effect on my code
  DartPluginRegistrant.ensureInitialized();

  //Create storage and attempt to access written key
  const storage = FlutterSecureStorage();
  dynamic value = "";
  try {
    //Error is thrown when attempting to read value.
    //Other storage functions such as .write or .containsKey throw the same error when used here
    value = await storage.read(key: "key");
  }
  on Error catch (e) {
    value = e;
  }

  //Return the resulting value to the main isolate
  sendPort.send(value);
}

EDIT: After even more searching and digging through the flutter_secure_storage code, I've been able to more accurately identify the problem; This package uses platform channels to handle the platform specific storage implementations. According to the Flutter docs, channel methods must be invoked on the main thread. There may be a way around that using platform specific implementations, but I haven't figured that out yet.


问:
Spring Batch AbstractPagingItemReader stop when result size id less than ITEMS_BY_PAGE
I've add AbstractPagingItemReader to read by packet from api by 100 items

The execution is OK until the size of returned items is less than 100

Here is my code :

```<code>    public static final int ITEMS_BY_PAGE = 10;

@Override
protected void doReadPage() {
    setPageSize(ITEMS_BY_PAGE);
    results = this.documentService.searchRecordsWithAwaitingDocument(getPage(), ITEMS_BY_PAGE);
}

@Override
protected void doJumpToPage(int itemIndex) {

}
</code>```

Is there a way to not stop the execution when the size of returned items is less than ITEMS_BY_PAGE ? i want to stop the execution only when there is no result on return (size 0) ?

Body:
I've add AbstractPagingItemReader to read by packet from api by 100 items

The execution is OK until the size of returned items is less than 100

Here is my code :

    public static final int ITEMS_BY_PAGE = 10;

@Override
protected void doReadPage() {
    setPageSize(ITEMS_BY_PAGE);
    results = this.documentService.searchRecordsWithAwaitingDocument(getPage(), ITEMS_BY_PAGE);
}

@Override
protected void doJumpToPage(int itemIndex) {

}

Is there a way to not stop the execution when the size of returned items is less than ITEMS_BY_PAGE ? i want to stop the execution only when there is no result on return (size 0) ?


问:
How to color Gtk.Treeview
How to color Gtk.Treeview?</p>
```<code>self.liststore = Gtk.ListStore(str, str, str, str, str, str, str)
self.treeview = Gtk.TreeView(model=self.liststore)

renderer_text = Gtk.CellRendererText()
column_1_text = Gtk.TreeViewColumn("Column1:  ", renderer_text, text=0)
column_1_text.set_min_width(165)
self.treeview.append_column(column_1_text)

self.box_total = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
self.box_total.set_homogeneous(True)

self.box_total.pack_start(self.treeview, True, True, 0)
</code>```

Title: How to color Gtk.Treeview

Body:
How to color Gtk.Treeview?

self.liststore = Gtk.ListStore(str, str, str, str, str, str, str)
self.treeview = Gtk.TreeView(model=self.liststore)

renderer_text = Gtk.CellRendererText()
column_1_text = Gtk.TreeViewColumn("Column1:  ", renderer_text, text=0)
column_1_text.set_min_width(165)
self.treeview.append_column(column_1_text)

self.box_total = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
self.box_total.set_homogeneous(True)

self.box_total.pack_start(self.treeview, True, True, 0)


问:
how can i run my project which runs on heroku on my remote server via docker container? What characteristics should my server have for this?
My Procfile - web: gunicorn main:server

how i started my project :

git commit -m "Demo"

git push heroku main

heroku ps:scale web=1

`app = dash.Dash(name, external_stylesheets=[dbc.themes.BOOTSTRAP],
meta_tags=[{'name': 'viewport',
'content': 'width=device-width, initial-scale=1.0'}]
)

server = app.server

some code

if name == 'main':
app.run_server(debug=True)`

this works on heroku but doesn't work on server in docker container

what do i need to write in dockerfile and how to run it?

I tried to write a dockerfile myself, but when I ran it, it immediately stopped


问:
Date picker / calendar control not showing on the Report Viewer page but it is visible on the ssrs report
I have two Date picker controls Start Date and End Date on the report. Datepicker calendar icon showing just fine on the ssrs report on the server like below. Report works just fine if I input the date values in the plain textbox like below
enter image description here

But not showing up on the  reportviewer page like below
enter image description here

Please help as I spent lot of time finding the solution on internet with no progress.
My ReportViewer code in the page as below

 <rsweb:ReportViewer ID="rViewer" Width="100%" ShowPrintButton="false" SizeToReportContent="True"  runat="server"  />

code behind:

```<code>Dim credentials = New ReportServerCredentials(Settings.Current.ReportServerUsername, _
                                                 Settings.Current.ReportServerPassword, _
                                                 Settings.Current.ReportServerDomain)
    rViewer.Visible = True

    If rViewerParameters.ShowParameterPrompts = True Then
        rViewer.ShowParameterPrompts = True
    Else
        rViewer.ShowParameterPrompts = False
    End If

    rViewer.ServerReport.ReportServerCredentials = credentials

    rViewer.PageCountMode = Microsoft.Reporting.WebForms.PageCountMode.Actual

    If (rViewerParameters.ReportOrientation = AppConstants.ReportConstants.Orientation.Landscape) Then
        Dim screenWidth As Int32 = getScreenWidth()

        rViewer.Height = (AppConstants.ReportConstants.ReportLandscapeHeight - 50)
        If (screenWidth < AppConstants.ReportConstants.ReportLandscapeWidth) Then
            rViewer.Width = (screenWidth - 30)
        Else
            rViewer.Width = WebControls.Unit.Percentage(100)
        End If
    Else
        rViewer.Height = (AppConstants.ReportConstants.ReportPortraitHeight - 50)
        rViewer.Width = WebControls.Unit.Percentage(100)
    End If

    If rViewerParameters.LocalReport Then
        rViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local
        rViewer.LocalReport.DataSources.Clear()
        rViewer.LocalReport.EnableExternalImages = True
        If rViewerParameters.ReportDefinitionStream Is Nothing Then
            rViewer.LocalReport.ReportPath = rViewerParameters.ReportPath
        Else
            rViewer.LocalReport.LoadReportDefinition(rViewerParameters.ReportDefinitionStream)
            For Each subreport As String In rViewerParameters.SubReportDefintionStreams.Keys
                Dim path As String = rViewerParameters.SubReportDefintionStreams(subreport)
                Dim stream As New IO.FileStream(path, IO.FileMode.Open)
                rViewer.LocalReport.LoadSubreportDefinition(subreport, stream)
            Next
        End If
        If string.IsNullOrEmpty(rViewer.LocalReport.DisplayName) then
            rViewer.LocalReport.DisplayName = $"Report-{TimeHelper.LocalTime:yyyyMMddhhmmss}"
        end if

        If rViewerParameters.ReportParameters IsNot Nothing Then
            rViewer.LocalReport.SetParameters(rViewerParameters.ReportParameters)
        End If

        For Each reportTable As DataTable In rViewerParameters.LocalDataTable
            rViewer.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource(reportTable.TableName, reportTable))
        Next

        Dim permissions As New PermissionSet(PermissionState.None)
        permissions.AddPermission(New SecurityPermission(PermissionState.Unrestricted))
        permissions.AddPermission(New SecurityPermission(SecurityPermissionFlag.Execution))
        rViewer.LocalReport.SetBasePermissionsForSandboxAppDomain(permissions)

    Else
        rViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote
        rViewer.ServerReport.ReportServerUrl = New Uri(Settings.Current.ReportServerURL)
        rViewer.ServerReport.ReportPath = rViewerParameters.ReportPath

        If rViewerParameters.ReportParameters IsNot Nothing Then
            rViewer.ServerReport.SetParameters(rViewerParameters.ReportParameters)
        End If
    End If
</code>```

`

Body:
I have two Date picker controls Start Date and End Date on the report. Datepicker calendar icon showing just fine on the ssrs report on the server like below. Report works just fine if I input the date values in the plain textbox like below
enter image description here

But not showing up on the  reportviewer page like below
enter image description here

Please help as I spent lot of time finding the solution on internet with no progress.
My ReportViewer code in the page as below

 <rsweb:ReportViewer ID="rViewer" Width="100%" ShowPrintButton="false" SizeToReportContent="True"  runat="server"  />

code behind:

Dim credentials = New ReportServerCredentials(Settings.Current.ReportServerUsername, _
                                                 Settings.Current.ReportServerPassword, _
                                                 Settings.Current.ReportServerDomain)
    rViewer.Visible = True

    If rViewerParameters.ShowParameterPrompts = True Then
        rViewer.ShowParameterPrompts = True
    Else
        rViewer.ShowParameterPrompts = False
    End If

    rViewer.ServerReport.ReportServerCredentials = credentials

    rViewer.PageCountMode = Microsoft.Reporting.WebForms.PageCountMode.Actual

    If (rViewerParameters.ReportOrientation = AppConstants.ReportConstants.Orientation.Landscape) Then
        Dim screenWidth As Int32 = getScreenWidth()

        rViewer.Height = (AppConstants.ReportConstants.ReportLandscapeHeight - 50)
        If (screenWidth < AppConstants.ReportConstants.ReportLandscapeWidth) Then
            rViewer.Width = (screenWidth - 30)
        Else
            rViewer.Width = WebControls.Unit.Percentage(100)
        End If
    Else
        rViewer.Height = (AppConstants.ReportConstants.ReportPortraitHeight - 50)
        rViewer.Width = WebControls.Unit.Percentage(100)
    End If

    If rViewerParameters.LocalReport Then
        rViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Local
        rViewer.LocalReport.DataSources.Clear()
        rViewer.LocalReport.EnableExternalImages = True
        If rViewerParameters.ReportDefinitionStream Is Nothing Then
            rViewer.LocalReport.ReportPath = rViewerParameters.ReportPath
        Else
            rViewer.LocalReport.LoadReportDefinition(rViewerParameters.ReportDefinitionStream)
            For Each subreport As String In rViewerParameters.SubReportDefintionStreams.Keys
                Dim path As String = rViewerParameters.SubReportDefintionStreams(subreport)
                Dim stream As New IO.FileStream(path, IO.FileMode.Open)
                rViewer.LocalReport.LoadSubreportDefinition(subreport, stream)
            Next
        End If
        If string.IsNullOrEmpty(rViewer.LocalReport.DisplayName) then
            rViewer.LocalReport.DisplayName = $"Report-{TimeHelper.LocalTime:yyyyMMddhhmmss}"
        end if

        If rViewerParameters.ReportParameters IsNot Nothing Then
            rViewer.LocalReport.SetParameters(rViewerParameters.ReportParameters)
        End If

        For Each reportTable As DataTable In rViewerParameters.LocalDataTable
            rViewer.LocalReport.DataSources.Add(New Microsoft.Reporting.WebForms.ReportDataSource(reportTable.TableName, reportTable))
        Next

        Dim permissions As New PermissionSet(PermissionState.None)
        permissions.AddPermission(New SecurityPermission(PermissionState.Unrestricted))
        permissions.AddPermission(New SecurityPermission(SecurityPermissionFlag.Execution))
        rViewer.LocalReport.SetBasePermissionsForSandboxAppDomain(permissions)

    Else
        rViewer.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote
        rViewer.ServerReport.ReportServerUrl = New Uri(Settings.Current.ReportServerURL)
        rViewer.ServerReport.ReportPath = rViewerParameters.ReportPath

        If rViewerParameters.ReportParameters IsNot Nothing Then
            rViewer.ServerReport.SetParameters(rViewerParameters.ReportParameters)
        End If
    End If

`


问:
Problem in calling a value through the value property
```<code> **   <input type="number" id="userGuess" />**
</code>```

I have created an input on the line above
And through the line below, I have put it in a variable
const userValue = document.querySelector('#userGuess').value;
But when I enter a value in input the web page. It does not print
console.log(userValue)

I expect, when I enter a value in the generated input. I can get it through console.log or** alert**

Body:
 **   <input type="number" id="userGuess" />**

I have created an input on the line above
And through the line below, I have put it in a variable
const userValue = document.querySelector('#userGuess').value;
But when I enter a value in input the web page. It does not print
console.log(userValue)

I expect, when I enter a value in the generated input. I can get it through console.log or** alert**


问:
did some one know how can i crop face after recognize it using google_mlkit on flutter?
hello i have problem im working in a preoject that recognize face from gallery image and crop the face to return cropped face as new image
i read all questions in stackoverflow but the results very old its not working with the new version of flutter , and google_mlkit

```<code>Future<File> cropImageToFace(File image) async {
 final path = image.path; final FaceDetector _faceDetector =
FaceDetector( options: FaceDetectorOptions(
 enableContours: true, ));
 final imageBytes = await image.readAsBytes();
 final imageList = <int>[];
 imageList.addAll(imageBytes);
final imageData = InputImage.fromFile(image);
 print(imageData.filePath);
print(imageData.inputImageData!.size);
final faces = await _faceDetector.processImage(imageData);
if (faces.isNotEmpty) {
  final face = faces.first;
  final faceRect = face.boundingBox;
  final cropRect = Rect.fromLTRB(
      faceRect.left - (224 - faceRect.width) / 2,
      faceRect.top - (224 - faceRect.height) / 2,
      faceRect.left + (224 + faceRect.width) / 2,
      faceRect.top + (224 + faceRect.height) / 2);
  final croppedFile = await ImageCropper().cropImage(
      sourcePath: image.path,
      cropStyle: CropStyle.rectangle,
      aspectRatio: CropAspectRatio(ratioX: 1, ratioY: 1),
      compressQuality: 100,
      androidUiSettings: AndroidUiSettings(
          toolbarColor: Colors.deepOrange,
          toolbarWidgetColor: Colors.white,
          toolbarTitle: 'Crop It'),
      iosUiSettings: IOSUiSettings(
          minimumAspectRatio: 1.0, aspectRatioLockEnabled: true));
  return croppedFile!;
} else {
  throw Exception('No face found in the image');
}
</code>```

}

Body:
hello i have problem im working in a preoject that recognize face from gallery image and crop the face to return cropped face as new image
i read all questions in stackoverflow but the results very old its not working with the new version of flutter , and google_mlkit

Future<File> cropImageToFace(File image) async {
 final path = image.path; final FaceDetector _faceDetector =
FaceDetector( options: FaceDetectorOptions(
 enableContours: true, ));
 final imageBytes = await image.readAsBytes();
 final imageList = <int>[];
 imageList.addAll(imageBytes);
final imageData = InputImage.fromFile(image);
 print(imageData.filePath);
print(imageData.inputImageData!.size);
final faces = await _faceDetector.processImage(imageData);
if (faces.isNotEmpty) {
  final face = faces.first;
  final faceRect = face.boundingBox;
  final cropRect = Rect.fromLTRB(
      faceRect.left - (224 - faceRect.width) / 2,
      faceRect.top - (224 - faceRect.height) / 2,
      faceRect.left + (224 + faceRect.width) / 2,
      faceRect.top + (224 + faceRect.height) / 2);
  final croppedFile = await ImageCropper().cropImage(
      sourcePath: image.path,
      cropStyle: CropStyle.rectangle,
      aspectRatio: CropAspectRatio(ratioX: 1, ratioY: 1),
      compressQuality: 100,
      androidUiSettings: AndroidUiSettings(
          toolbarColor: Colors.deepOrange,
          toolbarWidgetColor: Colors.white,
          toolbarTitle: 'Crop It'),
      iosUiSettings: IOSUiSettings(
          minimumAspectRatio: 1.0, aspectRatioLockEnabled: true));
  return croppedFile!;
} else {
  throw Exception('No face found in the image');
}

}


问:
SQL Bulk Copy by mapping columns dynamically does not work but works manually
I am trying to do a columnMappings for a bulk insert but i cant get the Columnmapping to work in a for loop but when i do it manually it works just fine.

I get this error when trying a dynamic ColumnMapping even though it adds the ColumnMapping to the "objbulk" with the same columns name as columns in the manual ColumnMapping:

Exception thrown: 'System.InvalidOperationException' in System.Data.SqlClient.dll

using (var objbulk = new SqlBulkCopy(connConfig, SqlBulkCopyOptions.Default, objTrans))
{
    DataColumn colDateTime = new DataColumn("UpdateTimestamp");
    dt.Columns.Add(colDateTime);
    foreach (DataRow row in dt.Rows)
    {
        row.SetField("UpdateTimestamp", DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.fffffff"));
    }
    objbulk.DestinationTableName = tableName;
    foreach (DataColumn column in dt.Columns)
    {
        objbulk.ColumnMappings.Add(column.ColumnName, column.ColumnName);
    }

    /*         objbulk.AutoMapColumns(dt);*/
    /* objbulk.ColumnMappings.Add("ColumnA", "ColumnA");
     objbulk.ColumnMappings.Add("ColumnB", "ColumnB");
     objbulk.ColumnMappings.Add("ColumnC", "ColumnC");
     objbulk.ColumnMappings.Add("ColumnD", "ColumnD");
     objbulk.ColumnMappings.Add("UpdateTimestamp", "UpdateTimestamp");*/
    objbulk.WriteToServer(dt);
}
objTrans.Commit();
return 1;
```

what am I doing wrong? its so strange that its basically the same thing. Could anyone tell me what i am missing here?

Thanks!

Body:
I am trying to do a columnMappings for a bulk insert but i cant get the Columnmapping to work in a for loop but when i do it manually it works just fine.

I get this error when trying a dynamic ColumnMapping even though it adds the ColumnMapping to the "objbulk" with the same columns name as columns in the manual ColumnMapping:

Exception thrown: 'System.InvalidOperationException' in System.Data.SqlClient.dll

using (var objbulk = new SqlBulkCopy(connConfig, SqlBulkCopyOptions.Default, objTrans))
{
    DataColumn colDateTime = new DataColumn("UpdateTimestamp");
    dt.Columns.Add(colDateTime);
    foreach (DataRow row in dt.Rows)
    {
        row.SetField("UpdateTimestamp", DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss.fffffff"));
    }
    objbulk.DestinationTableName = tableName;
    foreach (DataColumn column in dt.Columns)
    {
        objbulk.ColumnMappings.Add(column.ColumnName, column.ColumnName);
    }

    /*         objbulk.AutoMapColumns(dt);*/
    /* objbulk.ColumnMappings.Add("ColumnA", "ColumnA");
     objbulk.ColumnMappings.Add("ColumnB", "ColumnB");
     objbulk.ColumnMappings.Add("ColumnC", "ColumnC");
     objbulk.ColumnMappings.Add("ColumnD", "ColumnD");
     objbulk.ColumnMappings.Add("UpdateTimestamp", "UpdateTimestamp");*/
    objbulk.WriteToServer(dt);
}
objTrans.Commit();
return 1;

what am I doing wrong? its so strange that its basically the same thing. Could anyone tell me what i am missing here?

Thanks!


问:
How to use GSAP with angular and not effects the performance
I need to use GSAP (Green Socks Animation) with angular application and not to affect the application performance or change the life cycle. Still, in the other hand, I need it to start on the component init or on scroll-triggered. So, how can I do that? Should I use something like angular zone or there's something more efficient?

I expect to use it like in a simple HTML CSS Jquery page and access all the components.


问:
Flutter Fatal Exception: Cannot find Facebook CustomTabActivity
I have deployed a Flutter app to the Android PlayStore using Firebase and Firebase Auth dependecies. Occasionally, Crashlytics catches the following error, which I am not able to reproduce on my emulators or test devices:

```<code>Fatal Exception: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{myapp.myapp/com.facebook.CustomTabActivity}: java.lang.ClassNotFoundException: Didn't find class "com.facebook.CustomTabActivity" on path: DexPathList[[zip file "/data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/base.apk", zip file "/data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/split_config.armeabi_v7a.apk", zip file "/data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/split_config.en.apk", zip file "/data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/split_config.mdpi.apk"],nativeLibraryDirectories=[/data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/lib/arm, /data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/base.apk!/lib/armeabi-v7a, /data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/split_config.armeabi_v7a.apk!/lib/armeabi-v7a, /data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/split_config.en.apk!/lib/armeabi-v7a, /data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/split_config.mdpi.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2843)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
   at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
   at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
   at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
   at android.os.Handler.dispatchMessage(Handler.java:106)
   at android.os.Looper.loop(Looper.java:193)
   at android.app.ActivityThread.main(ActivityThread.java:6669)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
</code>```

The error does not seem to be tied to specific devices and I am not aware that I have implemented Facebook Auth. I assume that even though I only allow authentication with Google accounts, Firebase Auth still somehow depends on Facebook because it is part of the package.

Is there any way I can make Firebase Auth find the missing class?

Body:
I have deployed a Flutter app to the Android PlayStore using Firebase and Firebase Auth dependecies. Occasionally, Crashlytics catches the following error, which I am not able to reproduce on my emulators or test devices:

Fatal Exception: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{myapp.myapp/com.facebook.CustomTabActivity}: java.lang.ClassNotFoundException: Didn't find class "com.facebook.CustomTabActivity" on path: DexPathList[[zip file "/data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/base.apk", zip file "/data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/split_config.armeabi_v7a.apk", zip file "/data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/split_config.en.apk", zip file "/data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/split_config.mdpi.apk"],nativeLibraryDirectories=[/data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/lib/arm, /data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/base.apk!/lib/armeabi-v7a, /data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/split_config.armeabi_v7a.apk!/lib/armeabi-v7a, /data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/split_config.en.apk!/lib/armeabi-v7a, /data/app/myapp.myapp-WRz8otpImG-dv6UrzC9laA==/split_config.mdpi.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2843)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
   at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
   at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
   at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
   at android.os.Handler.dispatchMessage(Handler.java:106)
   at android.os.Looper.loop(Looper.java:193)
   at android.app.ActivityThread.main(ActivityThread.java:6669)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

The error does not seem to be tied to specific devices and I am not aware that I have implemented Facebook Auth. I assume that even though I only allow authentication with Google accounts, Firebase Auth still somehow depends on Facebook because it is part of the package.

Is there any way I can make Firebase Auth find the missing class?


问:
Different behavior of movq and leaq x86 assembly instructions
I am new to x86 assembly and I have a question regarding the movq and leaq instruction. In particular, I would like to know the difference between the following:

```<code>1. movq (%rax), %rcx
2. movq %rax, %rcx

3. leaq (%rax), %rcx
4. leaq %rax, %rcx
</code>```

I am assuming that for 1. the value in the %rax register will be interpreted as a memory access and the value at that memory location will be written into the %rcx register.
But what about 2. ? Will the value in the %rax register just directly be written into the %rcx register without accessing memory ?
Regarding 3. and 4. I am clueless and not even sure if there is a difference as I know that lea does not access memory and just calculates an address.

Body:
I am new to x86 assembly and I have a question regarding the movq and leaq instruction. In particular, I would like to know the difference between the following:

1. movq (%rax), %rcx
2. movq %rax, %rcx

3. leaq (%rax), %rcx
4. leaq %rax, %rcx

I am assuming that for 1. the value in the %rax register will be interpreted as a memory access and the value at that memory location will be written into the %rcx register.
But what about 2. ? Will the value in the %rax register just directly be written into the %rcx register without accessing memory ?
Regarding 3. and 4. I am clueless and not even sure if there is a difference as I know that lea does not access memory and just calculates an address.


问:
AlphaStar architecture: Core - deep LSTM
While researching the architecture of the AlphaStar neural network, I came across a description that I am not fully clear on. Despite understanding the majority of the blocks, this specific part have left me with some questions. Knowledge about the context of AI and the game Starcraft 2 are not required for understanding.

From https://github.com/chengyu2/learning_alpha_star/blob/master/detailed-architecture.txt

Core - Deep LSTM

Core:
Inputs: prev_state, embedded_entity, embedded_spatial, embedded_scalar

Outputs: next_state - The LSTM state for the next step, lstm_output - The output of the LSTM

The Core concatenates embedded_entity, embedded_spatial, and embedded_scalar into a single 1D tensor, and feeds that tensor along with prev_state into an LSTM with 3 hidden layers each of size 384. No projection is used. We apply layer norm to the gates. The outputs of the LSTM are the outputs of this module.

When the term "3 hidden layers" is used, is it referring to 3 separate LSTM cells or 3 layers within a single cell? If there is only one input, how would multiple LSTM cells be implemented? Are there any modifications that need to be made to the LSTM cell in this scenario?

I could not find material on the topic.


问:
Custom Combine Publisher materialise extension
Some context is im working with existing code so im having to work with a mixture of Combine and async/await.

I'm attempting to write my own rudimentary materialise function as an extension of Publisher but i cant quite get it working, the closest i've gotten is

```<code>import UIKit
import Combine

extension Future where Failure == Error {
    convenience init(operation: @escaping () async throws -> Output) {
        self.init { promise in
            Task {
                do {
                    let output = try await operation()
                    promise(.success(output))
                } catch {
                    promise(.failure(error))
                }
            }
        }
    }
}

extension Publisher where Self.Failure == Never {
  func asyncResultMap<P>(_ transform: @escaping ((Output) async throws -> P) ) -> Publishers.FlatMap<Future<Result<P, Error>, Error>, Publishers.SetFailureType<Self, P.Failure>> where P : Publisher {
    setFailureType(to: P.Failure.self)
      .flatMap { value in
        Future {
          do {
            return .success(try await transform(value))
          } catch {
            return .failure(error)
          }
        }
      }
  }
}

func doubleInt(_ val: Int) async throws -> Int {
  return val * 2
}

[1,2,3,4].publisher.asyncResultMap {
  doubleInt($0)
}
</code>```

but when I try to use it it says "Instance method 'asyncResultMap' requires that 'Int' conform to 'Publisher'"

Now i figured that the constraints arent quite right but any way i try to wrangle it does not compile, and the Combine Publisher constraints get so long and verbose i can't quite grok it.

For reference I am trying to make this code less verbose

from

```<code>[1,2,3,4].publisher
  .setFailureType(to: Never.self)
  .flatMap { value in
    Future {
      do {
        return Result<Int, Error>.success(try await doubleInt(value))
      } catch {
        return Result<Int, Error>.failure(error)
      }
    }
  }
</code>```

to

```<code>[1,2,3,4].publisher
  .asyncResultMap {
    try await doubleInt($0)
  }
</code>```

and the publisher would be a Result type that instead of ending the Publisher it would just output a Result

Body:
Some context is im working with existing code so im having to work with a mixture of Combine and async/await.

I'm attempting to write my own rudimentary materialise function as an extension of Publisher but i cant quite get it working, the closest i've gotten is

import UIKit
import Combine

extension Future where Failure == Error {
    convenience init(operation: @escaping () async throws -> Output) {
        self.init { promise in
            Task {
                do {
                    let output = try await operation()
                    promise(.success(output))
                } catch {
                    promise(.failure(error))
                }
            }
        }
    }
}

extension Publisher where Self.Failure == Never {
  func asyncResultMap
(_ transform: @escaping ((Output) async throws -> P) ) -> Publishers.FlatMap<Future<Result
, Error>, Publishers.SetFailureType<Self, P.Failure>> where P : Publisher {
    setFailureType(to: P.Failure.self)
      .flatMap { value in
        Future {
          do {
            return .success(try await transform(value))
          } catch {
            return .failure(error)
          }
        }
      }
  }
}

func doubleInt(_ val: Int) async throws -> Int {
  return val * 2
}

[1,2,3,4].publisher.asyncResultMap {
  doubleInt($0)
}

but when I try to use it it says "Instance method 'asyncResultMap' requires that 'Int' conform to 'Publisher'"

Now i figured that the constraints arent quite right but any way i try to wrangle it does not compile, and the Combine Publisher constraints get so long and verbose i can't quite grok it.

For reference I am trying to make this code less verbose

from

[1,2,3,4].publisher
  .setFailureType(to: Never.self)
  .flatMap { value in
    Future {
      do {
        return Result<Int, Error>.success(try await doubleInt(value))
      } catch {
        return Result<Int, Error>.failure(error)
      }
    }
  }

to

[1,2,3,4].publisher
  .asyncResultMap {
    try await doubleInt($0)
  }

and the publisher would be a Result type that instead of ending the Publisher it would just output a Result


问:
I want a similar data Structure as a Redis list which also have maximum limit on length as like Redis Stream
I want a similar data Structure as a Redis list which also have maximum limit on length as like Redis Stream. My usecase  is to consume less space less operation(I can use stream but it is not good for me because of data I am handling and Ltrim on list will increase no of operations) if exceeding the limit new data should be stored and previous one should be evicted.

I tried using Redis Stream but then I have to perform this operation to read the data from Stream

```<code>let signal = await this._redis.xrange(key + '_', '-', '+');
console.log(signal.map((data) =\> data\[1\]\[1\]));
return signal.map((data) =\> data\[1\]\[1\]);
</code>```

this is also costly as compare to list

Body:
I want a similar data Structure as a Redis list which also have maximum limit on length as like Redis Stream. My usecase  is to consume less space less operation(I can use stream but it is not good for me because of data I am handling and Ltrim on list will increase no of operations) if exceeding the limit new data should be stored and previous one should be evicted.

I tried using Redis Stream but then I have to perform this operation to read the data from Stream

let signal = await this._redis.xrange(key + '_', '-', '+');
console.log(signal.map((data) =\> data\[1\]\[1\]));
return signal.map((data) =\> data\[1\]\[1\]);

this is also costly as compare to list


问:
ASP.NET Core API Web Socket error: Failed to start the transport 'WebSockets': Error: WebSocket failed to connect. The connection could not be foun
I have problem with SignalR WebSocket on ASP.NET Core API that is hosted on kestrel.

Full log from console (browser-Chrome)

[2023-01-11T09:05:21.250Z] Debug: Starting HubConnection.
signalr.js:457 [2023-01-11T09:05:21.251Z] Debug: Starting connection with transfer format 'Text'.
signalr.js:457 [2023-01-11T09:05:21.252Z] Debug: Sending negotiation request: https://localhost:60001/PushMessagesHub/negotiate?negotiateVersion=1.
signalr.js:457 [2023-01-11T09:05:21.624Z] Debug: Selecting transport 'WebSockets'.
signalr.js:457 [2023-01-11T09:05:21.624Z] Trace: (WebSockets transport) Connecting.
signalr.js:2287 WebSocket connection to 'wss://localhost:60001/PushMessagesHub?id=srqV9jQe1zpE5cuTdzzcdg&access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJGQ01fVG9rZW4iOiJGQ01fVE9LRU5fRk9SX0NMSUVOVF9BUFBfUkVHSVNUUkFUSU9OIiwiQXBwbGljYXRpb25JZCI6ImZkMmIwNmE5LTA4YmItNDRkMy04MDQxLWUxYTMyOGVkZTk5ZCIsImV4cCI6MTY3Njg4MzkyMCwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdC8iLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0LyJ9.ojHw8RS_ZoB0S8w8nlqnfY4uIsit1yrj8iCBURvf2Hw' failed:
(anonymous) @ signalr.js:2287
signalr.js:453 [2023-01-11T09:05:22.027Z] Information: (WebSockets transport) There was an error with the transport.
signalr.js:447 [2023-01-11T09:05:22.027Z] Error: Failed to start the transport 'WebSockets': Error: WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.
log @ signalr.js:447
signalr.js:457 [2023-01-11T09:05:22.027Z] Debug: Selecting transport 'ServerSentEvents'.
signalr.js:457 [2023-01-11T09:05:22.027Z] Debug: Sending negotiation request: https://localhost:60001/PushMessagesHub/negotiate?negotiateVersion=1.
signalr.js:457 [2023-01-11T09:05:22.040Z] Trace: (SSE transport) Connecting.
:60001/PushMessagesHub?id=2orOj_0FgQIqosu2phE-ow&access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJGQ01fVG9rZW4iOiJGQ01fVE9LRU5fRk9SX0NMSUVOVF9BUFBfUkVHSVNUUkFUSU9OIiwiQXBwbGljYXRpb25JZCI6ImZkMmIwNmE5LTA4YmItNDRkMy04MDQxLWUxYTMyOGVkZTk5ZCIsImV4cCI6MTY3Njg4MzkyMCwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdC8iLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0LyJ9.ojHw8RS_ZoB0S8w8nlqnfY4uIsit1yrj8iCBURvf2Hw:1          Failed to load resource: the server responded with a status of 401 ()
signalr.js:447 [2023-01-11T09:05:22.045Z] Error: Failed to start the transport 'ServerSentEvents': Error: EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled.
log @ signalr.js:447
signalr.js:457 [2023-01-11T09:05:22.045Z] Debug: Selecting transport 'LongPolling'.
signalr.js:457 [2023-01-11T09:05:22.046Z] Debug: Sending negotiation request: https://localhost:60001/PushMessagesHub/negotiate?negotiateVersion=1.
signalr.js:457 [2023-01-11T09:05:22.055Z] Trace: (LongPolling transport) Connecting.
signalr.js:457 [2023-01-11T09:05:22.055Z] Trace: (LongPolling transport) polling: https://localhost:60001/PushMessagesHub?id=k2D5mBMDsZtgjLEbRY2MRg&=1673427922055.
signalr.js:457 [2023-01-11T09:05:22.077Z] Trace: (LongPolling transport) polling: https://localhost:60001/PushMessagesHub?id=k2D5mBMDsZtgjLEbRY2MRg&=1673427922077.
signalr.js:457 [2023-01-11T09:05:22.077Z] Debug: The HttpConnection connected successfully.
signalr.js:457 [2023-01-11T09:05:22.077Z] Debug: Sending handshake request.
signalr.js:457 [2023-01-11T09:05:22.078Z] Trace: (LongPolling transport) sending data. String data of length 32.
signalr.js:457 [2023-01-11T09:05:22.095Z] Trace: (LongPolling transport) request complete. Response status: 200.
signalr.js:453 [2023-01-11T09:05:22.095Z] Information: Using HubProtocol 'json'.
signalr.js:457 [2023-01-11T09:05:22.101Z] Trace: (LongPolling transport) data received. String data of length 3.
signalr.js:457 [2023-01-11T09:05:22.102Z] Debug: Server handshake complete.
signalr.js:457 [2023-01-11T09:05:22.102Z] Trace: (LongPolling transport) polling: https://localhost:60001/PushMessagesHub?id=k2D5mBMDsZtgjLEbRY2MRg&_=1673427922102.
signalr.js:457 [2023-01-11T09:05:22.102Z] Debug: HubConnection connected successfully.
site.js?v=B8WTYmxlo2Bbl0nfTLXLzSFGgNFHTS36I85-T8V3fOA:54 SignalR Connected.

Startup.cs (API)

```<code>    public void ConfigureServices(IServiceCollection services)
    {
        DependencyInjection.ConfigureDIServices(services, Configuration);
        AuthConfig.ConfigureAuth(services, Configuration);

        services.AddSignalR(o =>
        {
            o.EnableDetailedErrors = true;
        });

        SwaggerConfig.ConfigureSwagger(services);

        services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
        services.AddControllers();
        services.AddControllersWithViews();

        services.AddCors(options => options.AddPolicy("CorsPolicy",
               builder =>
               {
                   builder.AllowAnyHeader()
                          .AllowAnyMethod()
                          .SetIsOriginAllowed((host) => true)
                          .AllowCredentials();
               }));
    }

    public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime applicationLifetime, ILogger<Startup> logger)
    {
        //app.UseHttpsRedirection();

        app.UseStaticFiles();

        app.UseCors("CorsPolicy");

        app.UseRouting();

        app.UseWebSockets();

        app.UseAuthentication();
        app.UseAuthorization();

        app.UseEndpoints(endpoints =>
        {
            endpoints.MapControllers();
            endpoints.MapHub<PushMessagesHub>("/PushMessagesHub");
        });

        app.UseSwagger();

        app.UseSwaggerUI(c =>
        {
            c.IndexStream = () => GetType().GetTypeInfo().Assembly.GetManifestResourceStream("Swagger_Custom_index.html");
            c.SwaggerEndpoint("/swagger/v1/swagger.json", "API V1");
        });
    }
</code>```

signalr_client.js (MVC app)

```<code>const connection = new signalR.HubConnectionBuilder()
    .withUrl("https://localhost:60001/PushMessagesHub", {
        //skipNegotiation: false,
        //transport: signalR.HttpTransportType.WebSockets,
        //withCredentials: false,
        accessTokenFactory: () => {
            var bearerToken = $('#bearer_span').text();
            return bearerToken;
        }
    })
    .build();

connection.onclose(async () => {
    await start();
});

connection.on("PreviewImagesStreamStartedNotification", (deviceId) => {
    //StartDownloadingPreviewImagesStream(deviceId);
});

connection.on("PreviewImagesStreamStoppedNotification", (deviceId) => {
    //_PreviewStreamCancellationTokenSource.Cancel();
});

start();
async function start() {
    try {
        await connection.start();
        console.log("SignalR Connected.");
    } catch (err) {
        console.log(err);
        setTimeout(start, 5000);
    }
};
</code>```

Update 11.01.2023.

Added full log from console (browser).

WebSocket works normally when connecting to SignalR Hub from backend code of ASP.NET Core MVC app, but it does not work when connecting from browser(JS/jQuery).
At the end of full console log you can see that SignalR connects to hub but protocol falls to LoongPooling.

Body:
I have problem with SignalR WebSocket on ASP.NET Core API that is hosted on kestrel.

Full log from console (browser-Chrome)

[2023-01-11T09:05:21.250Z] Debug: Starting HubConnection.
signalr.js:457 [2023-01-11T09:05:21.251Z] Debug: Starting connection with transfer format 'Text'.
signalr.js:457 [2023-01-11T09:05:21.252Z] Debug: Sending negotiation request: https://localhost:60001/PushMessagesHub/negotiate?negotiateVersion=1.
signalr.js:457 [2023-01-11T09:05:21.624Z] Debug: Selecting transport 'WebSockets'.
signalr.js:457 [2023-01-11T09:05:21.624Z] Trace: (WebSockets transport) Connecting.
signalr.js:2287 WebSocket connection to 'wss://localhost:60001/PushMessagesHub?id=srqV9jQe1zpE5cuTdzzcdg&access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJGQ01fVG9rZW4iOiJGQ01fVE9LRU5fRk9SX0NMSUVOVF9BUFBfUkVHSVNUUkFUSU9OIiwiQXBwbGljYXRpb25JZCI6ImZkMmIwNmE5LTA4YmItNDRkMy04MDQxLWUxYTMyOGVkZTk5ZCIsImV4cCI6MTY3Njg4MzkyMCwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdC8iLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0LyJ9.ojHw8RS_ZoB0S8w8nlqnfY4uIsit1yrj8iCBURvf2Hw' failed:
(anonymous) @ signalr.js:2287
signalr.js:453 [2023-01-11T09:05:22.027Z] Information: (WebSockets transport) There was an error with the transport.
signalr.js:447 [2023-01-11T09:05:22.027Z] Error: Failed to start the transport 'WebSockets': Error: WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.
log @ signalr.js:447
signalr.js:457 [2023-01-11T09:05:22.027Z] Debug: Selecting transport 'ServerSentEvents'.
signalr.js:457 [2023-01-11T09:05:22.027Z] Debug: Sending negotiation request: https://localhost:60001/PushMessagesHub/negotiate?negotiateVersion=1.
signalr.js:457 [2023-01-11T09:05:22.040Z] Trace: (SSE transport) Connecting.
:60001/PushMessagesHub?id=2orOj_0FgQIqosu2phE-ow&access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJGQ01fVG9rZW4iOiJGQ01fVE9LRU5fRk9SX0NMSUVOVF9BUFBfUkVHSVNUUkFUSU9OIiwiQXBwbGljYXRpb25JZCI6ImZkMmIwNmE5LTA4YmItNDRkMy04MDQxLWUxYTMyOGVkZTk5ZCIsImV4cCI6MTY3Njg4MzkyMCwiaXNzIjoiaHR0cDovL2xvY2FsaG9zdC8iLCJhdWQiOiJodHRwOi8vbG9jYWxob3N0LyJ9.ojHw8RS_ZoB0S8w8nlqnfY4uIsit1yrj8iCBURvf2Hw:1          Failed to load resource: the server responded with a status of 401 ()
signalr.js:447 [2023-01-11T09:05:22.045Z] Error: Failed to start the transport 'ServerSentEvents': Error: EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled.
log @ signalr.js:447
signalr.js:457 [2023-01-11T09:05:22.045Z] Debug: Selecting transport 'LongPolling'.
signalr.js:457 [2023-01-11T09:05:22.046Z] Debug: Sending negotiation request: https://localhost:60001/PushMessagesHub/negotiate?negotiateVersion=1.
signalr.js:457 [2023-01-11T09:05:22.055Z] Trace: (LongPolling transport) Connecting.
signalr.js:457 [2023-01-11T09:05:22.055Z] Trace: (LongPolling transport) polling: https://localhost:60001/PushMessagesHub?id=k2D5mBMDsZtgjLEbRY2MRg&=1673427922055.
signalr.js:457 [2023-01-11T09:05:22.077Z] Trace: (LongPolling transport) polling: https://localhost:60001/PushMessagesHub?id=k2D5mBMDsZtgjLEbRY2MRg&=1673427922077.
signalr.js:457 [2023-01-11T09:05:22.077Z] Debug: The HttpConnection connected successfully.
signalr.js:457 [2023-01-11T09:05:22.077Z] Debug: Sending handshake request.
signalr.js:457 [2023-01-11T09:05:22.078Z] Trace: (LongPolling transport) sending data. String data of length 32.
signalr.js:457 [2023-01-11T09:05:22.095Z] Trace: (LongPolling transport) request complete. Response status: 200.
signalr.js:453 [2023-01-11T09:05:22.095Z] Information: Using HubProtocol 'json'.
signalr.js:457 [2023-01-11T09:05:22.101Z] Trace: (LongPolling transport) data received. String data of length 3.
signalr.js:457 [2023-01-11T09:05:22.102Z] Debug: Server handshake complete.
signalr.js:457 [2023-01-11T09:05:22.102Z] Trace: (LongPolling transport) polling: https://localhost:60001/PushMessagesHub?id=k2D5mBMDsZtgjLEbRY2MRg&_=1673427922102.
signalr.js:457 [2023-01-11T09:05:22.102Z] Debug: HubConnection connected successfully.
site.js?v=B8WTYmxlo2Bbl0nfTLXLzSFGgNFHTS36I85-T8V3fOA:54 SignalR Connected.

Startup.cs (API)

    public void ConfigureServices(IServiceCollection services)
    {
        DependencyInjection.ConfigureDIServices(services, Configuration);
        AuthConfig.ConfigureAuth(services, Configuration);

        services.AddSignalR(o =>
        {
            o.EnableDetailedErrors = true;
        });

        SwaggerConfig.ConfigureSwagger(services);

        services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
        services.AddControllers();
        services.AddControllersWithViews();

        services.AddCors(options => options.AddPolicy("CorsPolicy",
               builder =>
               {
                   builder.AllowAnyHeader()
                          .AllowAnyMethod()
                          .SetIsOriginAllowed((host) => true)
                          .AllowCredentials();
               }));
    }

    public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime applicationLifetime, ILogger<Startup> logger)
    {
        //app.UseHttpsRedirection();

        app.UseStaticFiles();

        app.UseCors("CorsPolicy");

        app.UseRouting();

        app.UseWebSockets();

        app.UseAuthentication();
        app.UseAuthorization();

        app.UseEndpoints(endpoints =>
        {
            endpoints.MapControllers();
            endpoints.MapHub<PushMessagesHub>("/PushMessagesHub");
        });

        app.UseSwagger();

        app.UseSwaggerUI(c =>
        {
            c.IndexStream = () => GetType().GetTypeInfo().Assembly.GetManifestResourceStream("Swagger_Custom_index.html");
            c.SwaggerEndpoint("/swagger/v1/swagger.json", "API V1");
        });
    }

signalr_client.js (MVC app)

const connection = new signalR.HubConnectionBuilder()
    .withUrl("https://localhost:60001/PushMessagesHub", {
        //skipNegotiation: false,
        //transport: signalR.HttpTransportType.WebSockets,
        //withCredentials: false,
        accessTokenFactory: () => {
            var bearerToken = $('#bearer_span').text();
            return bearerToken;
        }
    })
    .build();

connection.onclose(async () => {
    await start();
});

connection.on("PreviewImagesStreamStartedNotification", (deviceId) => {
    //StartDownloadingPreviewImagesStream(deviceId);
});

connection.on("PreviewImagesStreamStoppedNotification", (deviceId) => {
    //_PreviewStreamCancellationTokenSource.Cancel();
});

start();
async function start() {
    try {
        await connection.start();
        console.log("SignalR Connected.");
    } catch (err) {
        console.log(err);
        setTimeout(start, 5000);
    }
};

Update 11.01.2023.

Added full log from console (browser).

WebSocket works normally when connecting to SignalR Hub from backend code of ASP.NET Core MVC app, but it does not work when connecting from browser(JS/jQuery).
At the end of full console log you can see that SignalR connects to hub but protocol falls to LoongPooling.


问:
Add $This Value to Input Text Box
i'm thinking how to complete the code in order to attach each option selection to an input text box. Below in details step by step

Here the code i was able to write

```<code>$(document).on('change','.regionoption',function(){
    var currentRegion = ($(this).find(':selected').text());
    $(".Shipping.cost input").val(currentRegion);
});
</code>```

With code above i'm able to insert a [Select BOX] text to an [Input Text]

Select BOX
Input Text

As you can see after click in "Africa" dropdown i'm able to attach the text "Africa" into the input box

Now what i'm trying to achive is in case of multiple selection like [Multiselect BOX]
to attach each value into the text input and get a result like in following image

Multiselect BOX

Any suggestion to get this?
Thanks

I was able to write the following code

```<code>$(document).on('change','.regionoption',function(){
    var currentRegion = ($(this).find(':selected').text());
    $(".Shipping.cost input").val(currentRegion);
});
</code>```

I'm trying to get following result
Multiselect BOX

Title: Add $This Value to Input Text Box

Body:
i'm thinking how to complete the code in order to attach each option selection to an input text box. Below in details step by step

Here the code i was able to write

$(document).on('change','.regionoption',function(){
    var currentRegion = ($(this).find(':selected').text());
    $(".Shipping.cost input").val(currentRegion);
});

With code above i'm able to insert a [Select BOX] text to an [Input Text]

Select BOX
Input Text

As you can see after click in "Africa" dropdown i'm able to attach the text "Africa" into the input box

Now what i'm trying to achive is in case of multiple selection like [Multiselect BOX]
to attach each value into the text input and get a result like in following image

Multiselect BOX

Any suggestion to get this?
Thanks

I was able to write the following code

$(document).on('change','.regionoption',function(){
    var currentRegion = ($(this).find(':selected').text());
    $(".Shipping.cost input").val(currentRegion);
});

I'm trying to get following result
Multiselect BOX


问:
Addition/deletion of words changing during sentiment analysis task
Hi I am working on an NLP project where the data (~100-200K comments per dataset) are unlabeled. We were working on the sentiment analysis by zero shot learning (nli-deberta-v3-large/bart-large-mnli). After manual inspection we found that, some sentences/comments had typo and due to which the sentiment of that sentence(s) changed.

e.g., Original sentence: I like the new ice-cream flavor from XX company. I think its one of the worst flavor made by XX company. I don't know how XX company is surviving the business.

In the above sentence (its just an example comment, not real data) you can see the whole sentiment is negative, except the first line. Due to this, the sentence is predicted as positive sentiment.

Now if we insert not, in the first line, the prediction will change to negative sentiment, which apparently looks correct.

Manual inspection of 100K or more data is not possible. How can I check the data using an automated/programmatic way to detect such issues in a dataset?


问:
How to group git local changes by repo in PyCharm?
I have multiple repos in my PyCharm project and the "Local Changes" tab in version control show the list of changes files in ALL repos. Is there a way to limit the change list to a certain repo? Or group the changes by different repos?</p>


问:
Automatically print page when window.print() is called or press the print button on print dialog box
I wanted to know if it was possible to automatically print a window when window.print() is called without having to open the print dialog box, and if not than if it was possible to press the print button automatically when the print dialog page opens using JavaScript. It is important that time and hassle for the user is saved and that they do not have to press print every time the script is ran. I have a one local printer connected to my laptop.</p>


问:
Laravel 9 - map collect can't scope outside variable array even using use
why map it's not returning or pushing a values into array i tried to use use function to call my array Emails but its not working here is my logic code

```<code>   $emails = []; //emails array

    $students = User::where('role','student')->get();   //10 students email

    $maps = collect($students)->pluck('email'); //collect 10 students email

    $maps->map(function($map) use($emails){
        return  array_push($emails, $map); //push 10 students email to emails array
    });

    return $emails; //test emails array
</code>```

it is returning empty email array i don't know why its not working

Body:
why map it's not returning or pushing a values into array i tried to use use function to call my array Emails but its not working here is my logic code

   $emails = []; //emails array

    $students = User::where('role','student')->get();   //10 students email

    $maps = collect($students)->pluck('email'); //collect 10 students email

    $maps->map(function($map) use($emails){
        return  array_push($emails, $map); //push 10 students email to emails array
    });

    return $emails; //test emails array

it is returning empty email array i don't know why its not working


问:
Copying cell with hyperlink changes url when pasting
Background:

I have a tracking spreadsheet that I input links to a repository (SharePoint) for persons to follow/find information.  All links can be followed from this sheet by clicking on the cell.  I have not seen any of the links exceed 255 characters (typically about 100 characters).

This is the sole spreadsheet I have the issue with, where it is maintained on SharePoint/Teams.  In attempting to trouble shoot based on storage location, I made a local copy and attempted to copy/paste and the issue was resolved.

The choice to be on SharePoint/Teams is business necessity to reach a large audience; even the use of a network drive is being ruled out as an option.

Issue:

When I copy a cell from this tracking spreadsheet, pasting it into either another spreadsheet, into an Outlook email, etc., the link is changed.

Was:  https://company.sharepoint.com/a/b/c/finalLocation

Becomes:  ../../../../a/b/c/finalLocation

Note that the dot-dot-slash is four times prior to a in all cases.

Questions:

Why does this happen when using the spreadsheet loaded from Teams/SharePoint and how might I fix this that doesn't involve finding another location storage location?


问:
How to use on_member_update in Discord
I write my own code based on the following site.

How to check when a users status has changed on discord?

import discord
client = discord.Client(intents=discord.Intents.all())
@client.event
async def on_member_update(before, after):
    if before.status != after.status:  # to only run on status
        embed = discord.Embed(title=f"Changed status")
        embed.add_field(name='User', value=before.mention)
        embed.add_field(name='Before', value=before.status)
        embed.add_field(name='After', value=after.status)
        # send to admin or channel you choose
        channel = client.get_channel(12345678900000000000)  # notification channel
        await channel.send(embed=embed)
        admin = client.get_user('username#1234')  # admin to notify
        await admin.send(embed=embed)
client.run("ID_HERE")
```

When this code is executed, the console will display the following.

INFO     discord.gateway Shard ID None has connected to Gateway  (Session ID: xxxxx32b06d5bfb4d5f98xxxxxxxx).

The expected behavior is that a message will be displayed on the specified channel when the user's status changes from online to offline.

However, no message was ever sent when the status was actually changed.
Please let me know how to resolve this issue.

Title: How to use on_member_update in Discord

Body:
I write my own code based on the following site.

How to check when a users status has changed on discord?

import discord
client = discord.Client(intents=discord.Intents.all())
@client.event
async def on_member_update(before, after):
    if before.status != after.status:  # to only run on status
        embed = discord.Embed(title=f"Changed status")
        embed.add_field(name='User', value=before.mention)
        embed.add_field(name='Before', value=before.status)
        embed.add_field(name='After', value=after.status)
        # send to admin or channel you choose
        channel = client.get_channel(12345678900000000000)  # notification channel
        await channel.send(embed=embed)
        admin = client.get_user('username#1234')  # admin to notify
        await admin.send(embed=embed)
client.run("ID_HERE")

When this code is executed, the console will display the following.

INFO     discord.gateway Shard ID None has connected to Gateway  (Session ID: xxxxx32b06d5bfb4d5f98xxxxxxxx).

The expected behavior is that a message will be displayed on the specified channel when the user's status changes from online to offline.

However, no message was ever sent when the status was actually changed.
Please let me know how to resolve this issue.


问:
Flutter external URL open fails for AppImage Ubuntu 22.10 - cannot open path of the current working directory
I've built: flutter build linux --release Flutter app on Ubuntu 22.10.
When app is bundled as AppImage, the call to:

```<code># https://pub.dev/packages/url_launcher
if (await canLaunchUrl(url)) {
 launchUrl(url);
}
</code>```

fails with: cannot open path of the current working directory: Permission denied (printed out in the console from which AppImage runs).

Surprisingly when app is executed outside of AppImage, whether from Android Studio or from release build binary, everything works fine.

I believe this has something to do with the AppImage / sandbox, but not entirely sure where to start.

My AppImage config is rather simple.

AppRun

```<code>#!/bin/sh
cd "$(dirname "$0")"
exec ./app_entrypoint
</code>```

Appname.desktop

```<code>[Desktop Entry]
Version=1.1
Type=Application
Terminal=false
Name=App name
Exec=app_entrypoint %u
Icon=icon
Categories=Utility;
</code>```

UPDATE: I've tested the AppImage on Ubuntu 22.04 and everything seems to be working fine.

Body:
I've built: flutter build linux --release Flutter app on Ubuntu 22.10.
When app is bundled as AppImage, the call to:

# https://pub.dev/packages/url_launcher
if (await canLaunchUrl(url)) {
 launchUrl(url);
}

fails with: cannot open path of the current working directory: Permission denied (printed out in the console from which AppImage runs).

Surprisingly when app is executed outside of AppImage, whether from Android Studio or from release build binary, everything works fine.

I believe this has something to do with the AppImage / sandbox, but not entirely sure where to start.

My AppImage config is rather simple.

AppRun

#!/bin/sh
cd "$(dirname "$0")"
exec ./app_entrypoint

Appname.desktop

[Desktop Entry]
Version=1.1
Type=Application
Terminal=false
Name=App name
Exec=app_entrypoint %u
Icon=icon
Categories=Utility;

UPDATE: I've tested the AppImage on Ubuntu 22.04 and everything seems to be working fine.


问:
Why does DataEditR arbitrarily change the class of data variables in R
I am trying to use DataEditR::data_edit() package to either add a row or edit one or two row cells. It's convenient because it acts like excel and I don't have to code these edits. Unfortunately when I press on the synchronize button to update my data frame with the edited data, many of my variable classes are arbitrarily changed which is not helpful at all. I have carefully assigned classes like double, character, or integer to my variables on import with read_csv(df, col_types = list()). Does anyone know how I stop data_edit() from changing my variable classes, any guidance would be helpful.</p>


问:
Azure EventHub, Typescript client in Angular - process is not defined error
Following the Azure documentation, I'm having a very hard time getting this to work in my Angular 14 web application: https://www.npmjs.com/package/@azure/event-hubs

My error in Chrome console is:

```<code>Uncaught ReferenceError: process is not defined
at 66733 (util.js:109:1)
at __webpack_require__ (bootstrap:19:1)
</code>```

As per the npm docs above - "if you are using Webpack v5" - I have installed the following:

```<code>npm install --save-dev buffer os-browserify path-browserify process
</code>```

As per the docs - "then add the following into your webpack.config.js" - which is browser.js located at:

```<code>node_modules\@angular-devkit\build-angular\src\webpack\configs
</code>```

See the extraPlugins array and fallback props below:

"use strict";
/**
 * @license
 * Copyright Google LLC All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBrowserConfig = void 0;
const webpack_subresource_integrity_1 = require("webpack-subresource-integrity");
const plugins_1 = require("../plugins");
const helpers_1 = require("../utils/helpers");
function getBrowserConfig(wco) {
    const { buildOptions } = wco;
    const { crossOrigin = 'none', subresourceIntegrity, vendorChunk, commonChunk, allowedCommonJsDependencies, } = buildOptions;
    const extraPlugins = [];
    const { styles: stylesSourceMap, scripts: scriptsSourceMap, hidden: hiddenSourceMap, } = buildOptions.sourceMap;
    if (subresourceIntegrity) {
        extraPlugins.push(new webpack_subresource_integrity_1.SubresourceIntegrityPlugin({
            hashFuncNames: ['sha384'],
        }));
        extraPlugins.push(new webpack.ProvidePlugin({
            process:  { env: {} },  // or "process/browser" ???
        }));
        extraPlugins.push(new webpack.ProvidePlugin({
            Buffer: ["buffer", "Buffer"],
        }));
    }
    if (scriptsSourceMap || stylesSourceMap) {
        extraPlugins.push((0, helpers_1.getSourceMapDevTool)(scriptsSourceMap, stylesSourceMap, hiddenSourceMap, false));
    }
    let crossOriginLoading = false;
    if (subresourceIntegrity && crossOrigin === 'none') {
        crossOriginLoading = 'anonymous';
    }
    else if (crossOrigin !== 'none') {
        crossOriginLoading = crossOrigin;
    }
    return {
        devtool: false,
        resolve: {
            mainFields: ['es2020', 'es2015', 'browser', 'module', 'main'],
            conditionNames: ['es2020', 'es2015', '...'],
            fallback: {
                "buffer": require.resolve("buffer/"),
                "path": require.resolve("path-browserify"),
                "os": require.resolve("os-browserify"),
            }
        },
        output: {
            crossOriginLoading,
            trustedTypes: 'angular#bundler',
            scriptType: 'module',
        },
        optimization: {
            runtimeChunk: 'single',
            splitChunks: {
                maxAsyncRequests: Infinity,
                cacheGroups: {
                    default: !!commonChunk && {
                        chunks: 'async',
                        minChunks: 2,
                        priority: 10,
                    },
                    common: !!commonChunk && {
                        name: 'common',
                        chunks: 'async',
                        minChunks: 2,
                        enforce: true,
                        priority: 5,
                    },
                    vendors: false,
                    defaultVendors: !!vendorChunk && {
                        name: 'vendor',
                        chunks: (chunk) => chunk.name === 'main',
                        enforce: true,
                        test: /[\\/]node_modules[\\/]/,
                    },
                },
            },
        },
        plugins: [
            new plugins_1.CommonJsUsageWarnPlugin({
                allowedDependencies: allowedCommonJsDependencies,
            }),
            ...extraPlugins,
        ],
        node: false,
    };
}
exports.getBrowserConfig = getBrowserConfig;```

Body:
Following the Azure documentation, I'm having a very hard time getting this to work in my Angular 14 web application: https://www.npmjs.com/package/@azure/event-hubs

My error in Chrome console is:

Uncaught ReferenceError: process is not defined
at 66733 (util.js:109:1)
at __webpack_require__ (bootstrap:19:1)

As per the npm docs above - "if you are using Webpack v5" - I have installed the following:

npm install --save-dev buffer os-browserify path-browserify process

As per the docs - "then add the following into your webpack.config.js" - which is browser.js located at:

node_modules\@angular-devkit\build-angular\src\webpack\configs

See the extraPlugins array and fallback props below:

"use strict";
/**
 * @license
 * Copyright Google LLC All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://angular.io/license
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBrowserConfig = void 0;
const webpack_subresource_integrity_1 = require("webpack-subresource-integrity");
const plugins_1 = require("../plugins");
const helpers_1 = require("../utils/helpers");
function getBrowserConfig(wco) {
    const { buildOptions } = wco;
    const { crossOrigin = 'none', subresourceIntegrity, vendorChunk, commonChunk, allowedCommonJsDependencies, } = buildOptions;
    const extraPlugins = [];
    const { styles: stylesSourceMap, scripts: scriptsSourceMap, hidden: hiddenSourceMap, } = buildOptions.sourceMap;
    if (subresourceIntegrity) {
        extraPlugins.push(new webpack_subresource_integrity_1.SubresourceIntegrityPlugin({
            hashFuncNames: ['sha384'],
        }));
        extraPlugins.push(new webpack.ProvidePlugin({
            process:  { env: {} },  // or "process/browser" ???
        }));
        extraPlugins.push(new webpack.ProvidePlugin({
            Buffer: ["buffer", "Buffer"],
        }));
    }
    if (scriptsSourceMap || stylesSourceMap) {
        extraPlugins.push((0, helpers_1.getSourceMapDevTool)(scriptsSourceMap, stylesSourceMap, hiddenSourceMap, false));
    }
    let crossOriginLoading = false;
    if (subresourceIntegrity && crossOrigin === 'none') {
        crossOriginLoading = 'anonymous';
    }
    else if (crossOrigin !== 'none') {
        crossOriginLoading = crossOrigin;
    }
    return {
        devtool: false,
        resolve: {
            mainFields: ['es2020', 'es2015', 'browser', 'module', 'main'],
            conditionNames: ['es2020', 'es2015', '...'],
            fallback: {
                "buffer": require.resolve("buffer/"),
                "path": require.resolve("path-browserify"),
                "os": require.resolve("os-browserify"),
            }
        },
        output: {
            crossOriginLoading,
            trustedTypes: 'angular#bundler',
            scriptType: 'module',
        },
        optimization: {
            runtimeChunk: 'single',
            splitChunks: {
                maxAsyncRequests: Infinity,
                cacheGroups: {
                    default: !!commonChunk && {
                        chunks: 'async',
                        minChunks: 2,
                        priority: 10,
                    },
                    common: !!commonChunk && {
                        name: 'common',
                        chunks: 'async',
                        minChunks: 2,
                        enforce: true,
                        priority: 5,
                    },
                    vendors: false,
                    defaultVendors: !!vendorChunk && {
                        name: 'vendor',
                        chunks: (chunk) => chunk.name === 'main',
                        enforce: true,
                        test: /[\\/]node_modules[\\/]/,
                    },
                },
            },
        },
        plugins: [
            new plugins_1.CommonJsUsageWarnPlugin({
                allowedDependencies: allowedCommonJsDependencies,
            }),
            ...extraPlugins,
        ],
        node: false,
    };
}
exports.getBrowserConfig = getBrowserConfig;


问:
Selectively overwrite partitions in Delta Live Table pipeline
I have relatively big table and it is overwritten in DLT pipeline. It is partitioned by date and in most cases I change small portion of data (connected to last couple of partitions). Is it possible to selectively overwrite only specified partitions?</p>


问:
Docker volume, source file is being copied as a directory in container, why?
I'm trying to pass the amazon credentials folder (.aws) to to the container's root folder.

docker run -it -v ~/.aws:/root/.aws -p 8000:8000 collection

Inside the .aws folder there is a file named 'credentials' (no extension).

The problem is, when I inspect the root/.aws folder inside the container, the 'credentials' file is a directory, not a file.

```<code>cd /root/.aws
~/.aws # ls -l
total 8
drwxr-xr-x    3 root     root          4096 Jan  9 23:17 credentials

cat credentials
cat: read error: Is a directory
</code>```

Does anybody know what I need to do? Even if I include a text file, eg: test.txt, it is copied as a directory.

Thank you!

Body:
I'm trying to pass the amazon credentials folder (.aws) to to the container's root folder.

docker run -it -v ~/.aws:/root/.aws -p 8000:8000 collection

Inside the .aws folder there is a file named 'credentials' (no extension).

The problem is, when I inspect the root/.aws folder inside the container, the 'credentials' file is a directory, not a file.

cd /root/.aws
~/.aws # ls -l
total 8
drwxr-xr-x    3 root     root          4096 Jan  9 23:17 credentials

cat credentials
cat: read error: Is a directory

Does anybody know what I need to do? Even if I include a text file, eg: test.txt, it is copied as a directory.

Thank you!


问:
What is the equivalent to MenuItemSource in WinUI 3 NavigationView
I'm trying to bind to the NavigationView using the MenuItemSource property, but apparently, that property has gone away in WinUI 3. I searched the documentation, but it seems to only go to 2.8: https://learn.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.navigationview?view=winui-2.8

My navigation view looks like this.

```<code>    <NavigationView x:Name="NavView"
                     Loaded="NavView_Loaded"
                     ItemInvoked="NavView_ItemInvoked"
                     BackRequested="NavView_BackRequested"
                     Grid.Column="0"
                     MenuItemSource = "{x:Bind Categories, Mode=OneWay}">

        <NavigationView.AutoSuggestBox>
            <!-- See AutoSuggestBox documentation for
             more info about how to implement search. -->
            <AutoSuggestBox x:Name="NavViewSearchBox" QueryIcon="Find"/>
        </NavigationView.AutoSuggestBox>

        <ScrollViewer>
            <Frame x:Name="ContentFrame" Padding="12,0,12,24" IsTabStop="True"
               NavigationFailed="ContentFrame_NavigationFailed"/>
        </ScrollViewer>
    </NavigationView>
</code>```

The MenuItemSource throws:

The property 'MenuItemSource' was not found in type 'NavigationView'

How can I bind an ObservableCollection to the NavigationView in WinUi 3?

Body:
I'm trying to bind to the NavigationView using the MenuItemSource property, but apparently, that property has gone away in WinUI 3. I searched the documentation, but it seems to only go to 2.8: https://learn.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.navigationview?view=winui-2.8

My navigation view looks like this.

    <NavigationView x:Name="NavView"
                     Loaded="NavView_Loaded"
                     ItemInvoked="NavView_ItemInvoked"
                     BackRequested="NavView_BackRequested"
                     Grid.Column="0"
                     MenuItemSource = "{x:Bind Categories, Mode=OneWay}">

        <NavigationView.AutoSuggestBox>

            <AutoSuggestBox x:Name="NavViewSearchBox" QueryIcon="Find"/>
        </NavigationView.AutoSuggestBox>

        <ScrollViewer>
            <Frame x:Name="ContentFrame" Padding="12,0,12,24" IsTabStop="True"
               NavigationFailed="ContentFrame_NavigationFailed"/>
        </ScrollViewer>
    </NavigationView>

The MenuItemSource throws:

The property 'MenuItemSource' was not found in type 'NavigationView'

How can I bind an ObservableCollection to the NavigationView in WinUi 3?


问:
KivyMD: Is it possible to control the size of the padding from the MDTextField borders to the text in it?
On the screen, I highlighted in red the indents that I would like to remove or reduce. What property should be set?

Tried setting padding:

```<code>padding: dp(1), dp(1), dp(1), dp(1)
padding_top: dp(1)
padding: 1,1,1,1
padding_top: 1
</code>```

Body:
On the screen, I highlighted in red the indents that I would like to remove or reduce. What property should be set?

Tried setting padding:

padding: dp(1), dp(1), dp(1), dp(1)
padding_top: dp(1)
padding: 1,1,1,1
padding_top: 1


问:
Is it possible to charge for an app's widget?
I want to do a monthly subscription for my apps widget, but I need help finding a way to hide the widget schema based on the in-app purchase. Is it possible?

This is not a widget app - this is an iOS app with a widget extension.

When I go to add a widget, my app's widget is shown to add for free.


问:
PHP Authentication code for Amazon SP-API available?
Looking for raw sample code in PHP to authenticate and generate the credentials to make API calls. This is strictly for the private use of one Amazon Seller.

We would prefer not to use one of the many non-official SDKs.

We have followed the official guides for the various AWS and Developer Central steps.

The actual required PHP code seems onerous (hence the existence of SDKs).

Any help would be appreciated. I have searched but cannot find working code.


问:
Drag and drop to a child iframe using react-dnnd
I cannot drop elements onto iframe that is rendering my own components.

I'm trying to implement drag and drop functionality to a child iframe component.
After passing a dropRef, from a pareent, to a component rendering the iframe, dropping works only on components outside the iframe (IFrame is rendering my own components, not a separate website, so there is no CORS policy problem).

However, dropping does not work on the elements inside the iframe, even after passing the dropRef inside.

I checked this, and some other examples, but nothing seems to be working (Examples below seem to show wrong information in the alert).

https://codesandbox.io/examples/package/react-dnd-multi-iframe-backend

Is there any simple way to drop the draggable elements into the iframe?