问:
cv2.VideoWriter results corrupted video file
I'm trying to resize a video input using OpenCV and export it as .avi or .mp4 file. For some unknown reason, the result file outcomes corrupted and refuses to be played.

I have tried several different combinations of video formats and codec types, such as: avi-MJPG, avi-XVID, avi-h264, avi-x264, mp4-mp4v and mp4-avc3. None of them seems to be working correctly.

import cv2

cap = cv2.VideoCapture('input.mp4')

out = cv2.VideoWriter(
    'output.avi',
    cv2.VideoWriter_fourcc(*'XVID'),
    cap.get(cv2.CAP_PROP_FPS),
    (640, 480)
)

while cap.isOpened():
    ret, frame = cap.read()
    if not ret:
        break

    frame = cv2.resize(frame, (640, 480))
    out.write(frame)

    # cv2.imshow("video", frame)
    # cv2.waitKey(1)

cap.release()
out.release()
# cv2.destroyAllWindows()
```

UPD: Running this code on Windows 10 machine with Python 3.11.1, using pre-built opencv-python (4.7.0.68) and opencv-contrib-python (4.7.0.68).

As mentioned below this code works perfectly fine in another runtime environment, so probably this issue is related with OS.

Body:
I'm trying to resize a video input using OpenCV and export it as .avi or .mp4 file. For some unknown reason, the result file outcomes corrupted and refuses to be played.

I have tried several different combinations of video formats and codec types, such as: avi-MJPG, avi-XVID, avi-h264, avi-x264, mp4-mp4v and mp4-avc3. None of them seems to be working correctly.

import cv2

cap = cv2.VideoCapture('input.mp4')

out = cv2.VideoWriter(
    'output.avi',
    cv2.VideoWriter_fourcc(*'XVID'),
    cap.get(cv2.CAP_PROP_FPS),
    (640, 480)
)

while cap.isOpened():
    ret, frame = cap.read()
    if not ret:
        break

    frame = cv2.resize(frame, (640, 480))
    out.write(frame)

    # cv2.imshow("video", frame)
    # cv2.waitKey(1)

cap.release()
out.release()
# cv2.destroyAllWindows()

UPD: Running this code on Windows 10 machine with Python 3.11.1, using pre-built opencv-python (4.7.0.68) and opencv-contrib-python (4.7.0.68).

As mentioned below this code works perfectly fine in another runtime environment, so probably this issue is related with OS.


来源: stackexchange

问:
How to send large chunks of data with fetch HTTP Post in React Native
I've been trying to send some data in React Native with HTTP fetch, but I can't send fairly large chunks of data. It stops sending from about 2200 characters of text.

```<code>export const postServerData = (myURL, myJSONData, callback) => {
  fetch(myURL, {
    method: 'POST', // or 'PUT'
    headers: {
      'Content-Type': 'application/json',
  },
  body: JSON.stringify(myJSONData),
})
  .then(response => response.json())
  .then(myReturnedData => {
      callback(myReturnedData);
  })
  .catch(error => {
  });
};
</code>```

From a few articles, data cap is quite fairly large :

Can HTTP POST be limitless?

The maximum POST request body size is configured on the HTTP server and typically ranges from
1MB to 2GB

How can I send larger chunks in React Native (Android)?

ContentLicense: CC BY-SA 4.0

Body:
I've been trying to send some data in React Native with HTTP fetch, but I can't send fairly large chunks of data. It stops sending from about 2200 characters of text.

export const postServerData = (myURL, myJSONData, callback) => {
  fetch(myURL, {
    method: 'POST', // or 'PUT'
    headers: {
      'Content-Type': 'application/json',
  },
  body: JSON.stringify(myJSONData),
})
  .then(response => response.json())
  .then(myReturnedData => {
      callback(myReturnedData);
  })
  .catch(error => {
  });
};

From a few articles, data cap is quite fairly large :

Can HTTP POST be limitless?

The maximum POST request body size is configured on the HTTP server and typically ranges from
1MB to 2GB

How can I send larger chunks in React Native (Android)?


问:
Laravel error on deployment: The [sqs] queue connection has not been configured
I have a fairly basic laravel site. Everytime Envoyer runs and deploys the site, I get a ton (150+) errors that say this:

```<code>InvalidArgumentException [...redacted project dir...]/current/artisan queue:work sqs --tries=5
The [sqs] queue connection has not been configured.
</code>```

I'm not even using SQS so I have no idea where the error is coming from. Only deployment hooks I have in Envoyer that might be related are these:

My .env looks like this with things regarding the drivers and queue and such:

```<code>BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=database
SESSION_DRIVER=database
SESSION_LIFETIME=120
</code>```

I'm lost here. Any help would be greatly appreciated! If you need to see anything else please let me know.

Body:
I have a fairly basic laravel site. Everytime Envoyer runs and deploys the site, I get a ton (150+) errors that say this:

InvalidArgumentException [...redacted project dir...]/current/artisan queue:work sqs --tries=5
The [sqs] queue connection has not been configured.

I'm not even using SQS so I have no idea where the error is coming from. Only deployment hooks I have in Envoyer that might be related are these:

My .env looks like this with things regarding the drivers and queue and such:

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=database
SESSION_DRIVER=database
SESSION_LIFETIME=120

I'm lost here. Any help would be greatly appreciated! If you need to see anything else please let me know.


问:
Rails Hotwire - How to search within existing form
I have form that has a section that displays a series of checkboxes for what groups a user manages. I want to add a search box at the top of the checkboxes that allows them to search a name and have it filter the results. From there they can check whatever ones they need to and submit the main form.

The only way I have ever done this is by triggering a from submission. It is not working (not doing anything) I assume because it is within another form. Is there a way to get this to work like I have it below, or is there a better way to set up this filter?

cardrequest form:

```<code><%= form_with(model: cardrequest, id: dom_id(cardrequest), class: "contents") do |form| %>

form fields for cardrequest ...

<div class="mb-4 space-y-4">
    <%= form_with url: search_cardrequests_path, method: :get, data: { controller: "search-form", search_form_target: "form", turbo_frame: "cgs" } do |c| %>
        <div>
            <label for="add-guests">Select Cardholder Groups</label>
            <div class="relative">

            <%= c.search_field :search,  data: { action: "input->search-form#search" }, value: params[:search] %>

        </div>
    <% end %>
</div>

<div data-controller="checkbox-select-all">
<label>
    <input type="checkbox"  data-checkbox-select-all-target="checkboxAll" />
    <span class="btn_primary_small">Select All / Deselect All</span>
</label>
<%= turbo_frame_tag "cgs" do %>
    <div class="space-y-3">
        <%= form.collection_check_boxes :cardholdergroup_ids, current_user.cardholdergroups, :id, :friendlyname do |g| %>
        <div class="flex items-center mr-4">
            <%= g.check_box data: { checkbox_select_all_target: 'checkbox' } %>
            <%= g.label %>
        </div>
        <% end %>
    </div>
<% end %>
</div>

<% end %>
</code>```

Stimulus controller:

```<code>import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static targets = [ "form" ]

search() {
  clearTimeout(this.timeout)
  this.timeout = setTimeout(() => {

    this.formTarget.requestSubmit()

  }, 200)

 }
}
</code>```

cardrequests controller search method:

```<code>def search
    cardholdergroups = current_user.cardholdergroups
    @cardholdergroups = cardholdergroups.where("friendlyname LIKE ?", "%#{search}%") if params[:search].present?
    render(partial: 'cgs', locals: { cardholdergroups: @cardholdergroups })
end
</code>```

routes:

```<code>resources :cardrequests do
  collection do
    get 'search'
  end
end
</code>```

Body:
I have form that has a section that displays a series of checkboxes for what groups a user manages. I want to add a search box at the top of the checkboxes that allows them to search a name and have it filter the results. From there they can check whatever ones they need to and submit the main form.

The only way I have ever done this is by triggering a from submission. It is not working (not doing anything) I assume because it is within another form. Is there a way to get this to work like I have it below, or is there a better way to set up this filter?

cardrequest form:

<%= form_with(model: cardrequest, id: dom_id(cardrequest), class: "contents") do |form| %>

form fields for cardrequest ...

    <%= form_with url: search_cardrequests_path, method: :get, data: { controller: "search-form", search_form_target: "form", turbo_frame: "cgs" } do |c| %>

            Select Cardholder Groups

            <%= c.search_field :search,  data: { action: "input->search-form#search" }, value: params[:search] %>

    <% end %>

    <input type="checkbox"  data-checkbox-select-all-target="checkboxAll" />
    Select All / Deselect All

<%= turbo_frame_tag "cgs" do %>

        <%= form.collection_check_boxes :cardholdergroup_ids, current_user.cardholdergroups, :id, :friendlyname do |g| %>

            <%= g.check_box data: { checkbox_select_all_target: 'checkbox' } %>
            <%= g.label %>

        <% end %>

<% end %>

<% end %>

Stimulus controller:

import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
static targets = [ "form" ]

search() {
  clearTimeout(this.timeout)
  this.timeout = setTimeout(() => {

    this.formTarget.requestSubmit()

  }, 200)

 }
}

cardrequests controller search method:

def search
    cardholdergroups = current_user.cardholdergroups
    @cardholdergroups = cardholdergroups.where("friendlyname LIKE ?", "%#{search}%") if params[:search].present?
    render(partial: 'cgs', locals: { cardholdergroups: @cardholdergroups })
end

routes:

resources :cardrequests do
  collection do
    get 'search'
  end
end


问:
Error API Microsoft Graph integrated with MISP
I'm writing this email after the maintainer of the MISP repository answered a question asked by me. I'm integrating MISP with Sentinel using Microsoft Graph API and I came across the error in the image below. According to MISP support, the error is related to the script not being prepared to page and receive the responses in full, as the MISP database that I am importing is very large, it generates an error in the execution of time out. As per MISP support, you will need to edit this file: https://github.com/microsoftgraph/security-api-olutions/blob/master/Samples/MISP/script.py and change the _get_events method to iterate over the responses.

The steps were performed according to the github documentation.


问:
How to do card stacking effect in react-bootstrap?
I am looking for a way to make this card stacking effect in react-bootstrap.

I tried following the code in the link but it is quite different that I cannot implement it in react-bootstrap. I want it to be responsive because I use Container fluid with Row and Col.

It does not have to be pure CSS. Javascript usage or a combination of both is acceptable.


问:
Custom Collapsing Toolbar w/ WebView Very Jittery

Background

I have created a Composable that contains a TopAppBar and a WebView which recreates the enterAlways collapsing-toolbar behavior that Xml has.

The way it works is by applying Modifier.offset {..} to the composables. The offset is calculated whenever the WebView is scrolled.

For example, if I'm at the top of the page, and I scroll towards the bottom of the page (swipe from bottom to top), the Y offset for both the WebView & TopAppBar decreases at the same time.

Problem

The problem is that it is very jittery whenever the TopAppBar is expanding or collapsing. I think this is because the offset for the WebView is changing while I'm still scrolling. In the previous example, the WebView moves up to take the place of the collapsing-toolbar, but my finger is still pressed on the screen while that happens, which may cause the device to interpret that as an upward scroll (swiping from top to bottom).

Basic Outline of Code:

Column {
    TopAppBar(
        Modifier.offset { IntOffset(0, state.toolbarOffsetHeightPx) },
        ...
    )

    WebView(
        Modifier.offset { IntOffset(0, state.toolbarOffsetHeightPx) },

        onWebPageScrolled = /** Update state.toolbarOffsetHeightPx */
        ...
    )
}
```

What I tried

One potential solution I thought of involves reading the scrolls (like I currently am) and also consuming them.

When the toolbar is collapsing or expanding, I realized that I should probably only adjust the offset during that time, and I should ensure that the WebView does not scroll its content.

Since the WebView's height is the screen height, when the TopAppBar is collapsing, the part of the WebView which was hidden at the bottom of the screen now comes into view, and to the user, the offset of the WebView changing would make it look like they are scrolling. Therefore, I should force the WebView to not scroll during this time.

--

The problem with this approach is that I'm getting the data about WebView scrolls from the onScrollChangedListener, so if I disable WebView scrolling while the TopAppBar is expanding or collapsing, then I also lose the ability to keep expanding/collapsing the TopAppBar...

Some solutions I came up for this are:

Have a wrapper Composable around the WebView which can receive the scrolls.

I could not figure out how to implement this. It looks like there is a nestedScrolling Modifier which allows capturing scrolls, so I wrapped my WebView in a Box which had that Modifier, but even though I was consuming the scrolls in the NestedScrollConnection the WebView was still receiving scrolls normally..

Use onTouchListener to receive scroll events rather than onScrollListener.

This gets a little complicated because onTouchListener is not only called for scrolls. I tried only running my TopAppBar/WebView offset logic if the onTouchListener was called for MotionEvent.ACTION_DOWN, but the results were very strange.

I did manage to replicate the original expanding/collapsing w/ the TopAppBar & WebView, but rather than expanding/collapsing while I'm scrolling, the entire expanding/collapsing would complete before I even started dragging my finger - just pressing my finger and twisting it up or down completely expanded/collapsed the TopAppBar.

The desired behavior is that the expanding/collapsing should happen linearly with the webpage scrolling, so this did not work.

I really appreciate any help. I've created a simple app on a GitHub repo if you would like to test the behavior.

Body:
Background

I have created a Composable that contains a TopAppBar and a WebView which recreates the enterAlways collapsing-toolbar behavior that Xml has.

The way it works is by applying Modifier.offset {..} to the composables. The offset is calculated whenever the WebView is scrolled.

For example, if I'm at the top of the page, and I scroll towards the bottom of the page (swipe from bottom to top), the Y offset for both the WebView & TopAppBar decreases at the same time.

Problem

The problem is that it is very jittery whenever the TopAppBar is expanding or collapsing. I think this is because the offset for the WebView is changing while I'm still scrolling. In the previous example, the WebView moves up to take the place of the collapsing-toolbar, but my finger is still pressed on the screen while that happens, which may cause the device to interpret that as an upward scroll (swiping from top to bottom).

Basic Outline of Code:

Column {
    TopAppBar(
        Modifier.offset { IntOffset(0, state.toolbarOffsetHeightPx) },
        ...
    )

    WebView(
        Modifier.offset { IntOffset(0, state.toolbarOffsetHeightPx) },

        onWebPageScrolled = /** Update state.toolbarOffsetHeightPx */
        ...
    )
}

What I tried

One potential solution I thought of involves reading the scrolls (like I currently am) and also consuming them.

When the toolbar is collapsing or expanding, I realized that I should probably only adjust the offset during that time, and I should ensure that the WebView does not scroll its content.

Since the WebView's height is the screen height, when the TopAppBar is collapsing, the part of the WebView which was hidden at the bottom of the screen now comes into view, and to the user, the offset of the WebView changing would make it look like they are scrolling. Therefore, I should force the WebView to not scroll during this time.

--

The problem with this approach is that I'm getting the data about WebView scrolls from the onScrollChangedListener, so if I disable WebView scrolling while the TopAppBar is expanding or collapsing, then I also lose the ability to keep expanding/collapsing the TopAppBar...

Some solutions I came up for this are:

Have a wrapper Composable around the WebView which can receive the scrolls.

I could not figure out how to implement this. It looks like there is a nestedScrolling Modifier which allows capturing scrolls, so I wrapped my WebView in a Box which had that Modifier, but even though I was consuming the scrolls in the NestedScrollConnection the WebView was still receiving scrolls normally..

Use onTouchListener to receive scroll events rather than onScrollListener.

This gets a little complicated because onTouchListener is not only called for scrolls. I tried only running my TopAppBar/WebView offset logic if the onTouchListener was called for MotionEvent.ACTION_DOWN, but the results were very strange.

I did manage to replicate the original expanding/collapsing w/ the TopAppBar & WebView, but rather than expanding/collapsing while I'm scrolling, the entire expanding/collapsing would complete before I even started dragging my finger - just pressing my finger and twisting it up or down completely expanded/collapsed the TopAppBar.

The desired behavior is that the expanding/collapsing should happen linearly with the webpage scrolling, so this did not work.

I really appreciate any help. I've created a simple app on a GitHub repo if you would like to test the behavior.


问:
wrapper.$options.watch.$route.call is not a function , I want to test the function when the route is changes in watch property vue
I am triggering a function when the route is changed in watch property
I used wrapper.vm.$options.watch.$route.call(wrapper.vm,'test1','test2)

It shows error wrapper.vm.$options.watch.$route.call is not a function

can someone please tell me what i'm missing

This is my code:

js file:

```<code> watch: {
     $route() {
          this.eventSearchQueryHandler()
          console.log("hebdhdb")
        },
</code>```

jest file:

```<code> test('watch: $route',  () => {
       const wrapper = getWrapper()
       const spy = jest.spyOn(wrapper.vm, 'eventSearchQueryHandler')
       wrapper.vm.$options.watch.$route.call(wrapper.vm, '/tivo/deals')
       expect(spy).toBeCalled()
     })
</code>```

I want to mock the watcher and check the function to be called.

Is there any other approach that i can trigger this watch and test the function to be called

Body:
I am triggering a function when the route is changed in watch property
I used wrapper.vm.$options.watch.$route.call(wrapper.vm,'test1','test2)

It shows error wrapper.vm.$options.watch.$route.call is not a function

can someone please tell me what i'm missing

This is my code:

js file:

 watch: {
     $route() {
          this.eventSearchQueryHandler()
          console.log("hebdhdb")
        },

jest file:

 test('watch: $route',  () => {
       const wrapper = getWrapper()
       const spy = jest.spyOn(wrapper.vm, 'eventSearchQueryHandler')
       wrapper.vm.$options.watch.$route.call(wrapper.vm, '/tivo/deals')
       expect(spy).toBeCalled()
     })

I want to mock the watcher and check the function to be called.

Is there any other approach that i can trigger this watch and test the function to be called


问:
Python pandas .read_excel return formula not value
Python pandas .read_excel return formula not value

For example, I want "=1+1" not "2".
Many Thanks!


问:
Find max of 2 series with a factor & cumulative sum on group based on condition
Trying my best to explain what I am trying to achieve here. I have 2 series (Annual Volume & Annual Capacity) which I need to compare to allocate a value in the column Allocation & then sum it cumulatively inside a group (L1 / L2 in Lane Column) until the Cum Allocation column matches **Annual Volume **Column.

The table looks like this:

Lane
Carrier SCAC
Annual Volume
Annual Capacity
Allocation
Cum Allocation

25972
L1
BGME
4917.0
2408.0
2408
2408

25973
L1
SCNN
4917.0
3380.0
2459
4867

25974
L1
XPOL
4917.0
4940.0
50
4940

25975
L1
SJRG
4917.0
156.0

25976
L1
MTRK
4917.0
4940.0

26055
L2
JNJR
5604.0
260.0
260
260

26056
L2
WOSQ
5604.0
1300.0
1300
1560

26057
L2
BGME
5604.0
2704.0
2704
4264

26058
L2
ITSB
5604.0
2080.0
1340
5604

26059
L2
UCSB
5604.0
4368.0

The rule of allocation is as such:

```<code>Allocation = min(Annual Volume * 0.5, Annual Capacity) as long as Cum Allocation < Annual Volume
Allocation = (Annual Volume - Cum Allocation.shift(1)) so that Cum Allocation == Annual Volume
Allocation = 0 when Cum Allocation > Annual Volume

Cum Allocation = Cum Allocation.shift(1) + Allocation (initial Cum Allocation = Allocation)
</code>```

I could do it through 2 functions - not quite efficient and the database is very large making it extremely slow & I need to keep changing allocation factor (0.5 above), making it quite painful.

I just have a feeling this can be handled through pandas standard functions itself. Any ideas would be helpful.

Body:
Trying my best to explain what I am trying to achieve here. I have 2 series (Annual Volume & Annual Capacity) which I need to compare to allocate a value in the column Allocation & then sum it cumulatively inside a group (L1 / L2 in Lane Column) until the Cum Allocation column matches **Annual Volume **Column.

The table looks like this:

Lane
Carrier SCAC
Annual Volume
Annual Capacity
Allocation
Cum Allocation

25972
L1
BGME
4917.0
2408.0
2408
2408

25973
L1
SCNN
4917.0
3380.0
2459
4867

25974
L1
XPOL
4917.0
4940.0
50
4940

25975
L1
SJRG
4917.0
156.0

25976
L1
MTRK
4917.0
4940.0

26055
L2
JNJR
5604.0
260.0
260
260

26056
L2
WOSQ
5604.0
1300.0
1300
1560

26057
L2
BGME
5604.0
2704.0
2704
4264

26058
L2
ITSB
5604.0
2080.0
1340
5604

26059
L2
UCSB
5604.0
4368.0

The rule of allocation is as such:

Allocation = min(Annual Volume * 0.5, Annual Capacity) as long as Cum Allocation < Annual Volume
Allocation = (Annual Volume - Cum Allocation.shift(1)) so that Cum Allocation == Annual Volume
Allocation = 0 when Cum Allocation > Annual Volume

Cum Allocation = Cum Allocation.shift(1) + Allocation (initial Cum Allocation = Allocation)

I could do it through 2 functions - not quite efficient and the database is very large making it extremely slow & I need to keep changing allocation factor (0.5 above), making it quite painful.

I just have a feeling this can be handled through pandas standard functions itself. Any ideas would be helpful.


问:
How do I recover lost extensions, after using Settings Sync
I've built a new pc, and I'm trying to transfer all my VS Code settings from my old pc to my new one. And I came across Settings Sync within VS Code. I sign in on both machines using my GitHub account. I click Sync Now, it somewhat works in that only five of my extensions show up on my new PC, I have over 100. But then on my old pc all but those same 5 extensions
for some reason, gets removed.

For a brief moment, I was able to get all my extensions back on my old pc by clicking in the sync activity (remote) tab and restoring to a previous state. The problem is, whenever I open a new window, they're gone again. Now when I try to restore a previous state, it just loads those same 5 extensions only.

I came across this post Recover lost settings + extensions and more?

And I tried JΛYDΞV's suggestion. I can see the backup JSON files which contain info for all my extensions when I view it in Windows explorer. However, when I try to view them in VS Code under the Sync Activity (Local) panel, I get this error:

Cannot read properties of undefined (reading 'id')

Would anyone have any other ideas as to how I can get my extensions back on either machine?

I should also add that before I tried any of this I did actually copy the entire VS Code folder under AppData\Roaming to an external hard drive and for the heck of it overwrote that same folder on my new pc just to see if that would remedy the problem, but then however no extensions show on my new pc.

Would anyone have any more steps I could try? The last thing I would want to do is to have to add all those extensions again


问:
Storing and serving course completion certificates for a small number of participants using Python (FastAPI)
What is the best approach for storing and serving course completion certificates for a small number of participants (80) using Python (FastAPI)? Should I store all the certificates in a database and provide them to users on request, or generate a new specific certificate on each request and store or delete it afterwards? Factors to consider may include performance, security, and maintenance.

As of now, I have stored all the course completion certificates in a database and am providing them to users upon request. However, I was wondering if it would be a better approach to generate a new certificate on each request, rather than generating all the certificates in advance and storing them. This would allow me to generate the certificate for each enrolled user and potentially save on storage space, but I am not sure if it would have any impact on performance or security. I am open to any suggestions or best practices for this type of system.


问:
iOS 16.2 Upgrade -> "A valid provisioning profile for this executable was not found."
After upgrading my iPhone 13 Pro Max to iOS 16.2, I started getting the below error when trying to run my app via Xcode. Not 100% certain that was the cause but there's strong correlation. I'd love any guidance on additional troubleshooting; thank you!

Things I've tried that haven't fixed the problem:

Upgrading Xcode and MacOS

Disabling/enabling my device in Certificates, Identifiers & Profiles

Disabling device in Certificates, Identifiers & Profiles and allowing Xcode to re-enabling it by attempting to Run on device

Creating a new development profile in Certificates, Identifiers & Profiles

Manually installing a development profile on the device via Xcode -> Devices and Simulators -> Connected -> Device -> Show Provisioning Profiles

Unpairing and pairing device

Switching off/on developer mode on device

Restarting the device and computer

Cleaning build folder

Signing in/out of the account in xcode

Switching on/off "Automatically manage signing"

Xcode "Download Manual Profiles"

Delete DerivedData folder

What does work:

Ad Hoc installing app (ad hoc profile does also appear on device)

Error:

Details

Unable to install "[appname]"

Domain: com.apple.dt.MobileDeviceErrorDomain

Code: -402620395

User Info: {

DVTErrorCreationDateKey = "2023-01-06 00:27:00 0000";

IDERunOperationFailingWorker = IDEInstalliPhoneLauncher;

}

--

A valid provisioning profile for this executable was not found.

Domain: com.apple.dt.MobileDeviceErrorDomain

Code: -402620395

User Info: {

DVTRadarComponentKey = 487925;

MobileDeviceErrorCode = "(0xE8008015)";

"com.apple.dtdevicekit.stacktrace" = (

0   DTDeviceKitBase                     0x000000010c696c90
DTDKCreateNSErrorFromAMDErrorCode  235

1   DTDeviceKitBase                     0x000000010c6d32ee
__90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke
155

2   DVTFoundation                       0x00000001020c1e01
DVTInvokeWithStrongOwnership  71

3   DTDeviceKitBase                     0x000000010c6d3016
-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]
1409

4   IDEiOSSupportCore                   0x000000010c5aa7a0
__118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.301
3520

5   DVTFoundation                       0x00000001021f7a09
DVT_CALLING_CLIENT_BLOCK  7

6   DVTFoundation                       0x00000001021f851d
__DVTDispatchAsync_block_invoke  196

7   libdispatch.dylib                   0x00007ff80a3dc7fb
_dispatch_call_block_and_release  12

8   libdispatch.dylib                   0x00007ff80a3dda44
_dispatch_client_callout  8

9   libdispatch.dylib                   0x00007ff80a3e3ac4
_dispatch_lane_serial_drain  694

10  libdispatch.dylib                   0x00007ff80a3e45b4
_dispatch_lane_invoke  366

11  libdispatch.dylib                   0x00007ff80a3eead7
_dispatch_workloop_worker_thread  762

12  libsystem_pthread.dylib             0x00007ff80a559ce3
_pthread_wqthread  326

13  libsystem_pthread.dylib             0x00007ff80a558c67
start_wqthread  15

);

}

--

Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {

"device_model" = "iPhone14,3";

"device_osBuild" = "16.2 (20C65)";

"device_platform" = "com.apple.platform.iphoneos";

"launchSession_schemeCommand" = Run;

"launchSession_state" = 1;

"launchSession_targetArch" = arm64;

"operation_duration_ms" = 5576;

"operation_errorCode" = "-402620395";

"operation_errorDomain" = "com.apple.dt.MobileDeviceErrorDomain";

"operation_errorWorker" = IDEInstalliPhoneLauncher;

"operation_name" = IDEiPhoneRunOperationWorkerGroup;

"param_consoleMode" = 0;

"param_debugger_attachToExtensions" = 0;

"param_debugger_attachToXPC" = 1;

"param_debugger_type" = 5;

"param_destination_isProxy" = 0;

"param_destination_platform" = "com.apple.platform.iphoneos";

"param_diag_MainThreadChecker_stopOnIssue" = 0;

"param_diag_MallocStackLogging_enableDuringAttach" = 0;

"param_diag_MallocStackLogging_enableForXPC" = 1;

"param_diag_allowLocationSimulation" = 1;

"param_diag_checker_tpc_enable" = 1;

"param_diag_gpu_frameCapture_enable" = 0;

"param_diag_gpu_shaderValidation_enable" = 0;

"param_diag_gpu_validation_enable" = 0;

"param_diag_memoryGraphOnResourceException" = 0;

"param_diag_queueDebugging_enable" = 1;

"param_diag_runtimeProfile_generate" = 0;

"param_diag_sanitizer_asan_enable" = 0;

"param_diag_sanitizer_tsan_enable" = 0;

"param_diag_sanitizer_tsan_stopOnIssue" = 0;

"param_diag_sanitizer_ubsan_stopOnIssue" = 0;

"param_diag_showNonLocalizedStrings" = 0;

"param_diag_viewDebugging_enabled" = 1;

"param_diag_viewDebugging_insertDylibOnLaunch" = 1;

"param_install_style" = 0;

"param_launcher_UID" = 2;

"param_launcher_allowDeviceSensorReplayData" = 0;

"param_launcher_kind" = 0;

"param_launcher_style" = 0;

"param_launcher_substyle" = 0;

"param_runnable_appExtensionHostRunMode" = 0;

"param_runnable_productType" = "com.apple.product-type.application";

"param_runnable_type" = 2;

"param_testing_launchedForTesting" = 0;

"param_testing_suppressSimulatorApp" = 0;

"param_testing_usingCLI" = 0;

"sdk_canonicalName" = "iphoneos16.2";

"sdk_osVersion" = "16.2";

"sdk_variant" = iphoneos;

}

--

System Information

macOS Version 13.1 (Build 22C65)

Xcode 14.2 (21534) (Build 14C18)

Timestamp: 2023-01-05T16:27:00-08:00


问:
I am having study error in trading view pine script
I am trying to create a PineScript indicator that plots a horizontal line on the chart at the 9:42 AM price of the asset being charted, during the New York trading session. It does this by first defining the 9:42 AM New York time as a series of integers using the time() function. It then creates a series of true and false values, called period, representing the time period from 9:42 AM to 9:43 AM.

Next, the code uses the ta.valuewhen() function to retrieve the 9:42 AM price. It then uses the line.new() function to draw a line at the 9:42 AM price on the chart, and the label.new() function to create a label with the 9:42 AM price at the end of the line. The appearance and style of the line and label can be customized using the input options i9Style, i9Color, and i9Label. The input option i9History determines whether the line and label will persist on the chart after the current bar (true) or be removed (false).

the issue - everything is working fine there are no error runs perfectly fine but when I add this indicator on chart it showes nothing and says : study error - can not parse resolution '09

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/

// © Bee_Zee

//@version=5

indicator("ICT NEW YORK 9:42 AM OPEN", "ICT SAUCE 9:42 AM OPEN", true, max_lines_count=500)

i9Display = input.bool    (true, "Display", group="New York 9:42 Open")
i9Time    = input.session ('0942-0943:1234567', "Session", group="New York 9:42 Open")

i9Style   = input.string  ("Solid", "Line Style", options=["Solid", "Dotted", "Dashed"], group="New York 9:42 Open")

i9Color   = input.color   (#e43030, "Color", group="New York 9:42 Open")

i9History = input.bool    (true, "History", group="New York 9:42 Open")

i9Label   = input.bool    (true, "Show Label", group="New York 9:42 Open")

// Define the 9:42 AM New York time as a series of integers

t942 = time("09:42:00", "New York")

_9Style   = i9Style ==    "Solid" ? line.style_solid : i9Style == "Dotted" ? line.style_dotted : line.style_dashed

//==== Sauce 9:42 Open  ====
if i9Display

// Create a series of true and false values representing the time period from 9:42 AM to 9:43 AM

```<code>period = time >= t942 and time < t942 + 60
</code>```

// Retrieve the 9:42 AM price using ta.valuewhen

```<code>price942 = ta.valuewhen(period, close, 0)
var label lb3 = na
var line lne3 = na
if price942 != price942[1]
    if barstate.isconfirmed
        line.set_x2(lne3, t942 - 30600000)

        // Draw a line at the 9:42 AM price

        lne3 := line.new(t942, price942, last_bar_time + 14400000/2, price942, xloc.bar_time, extend.none, i9Color, _9Style, 1)

        if i9Label

            // Update the label at the end of the line with the 9:42 AM price

            lb3  := label.new(last_bar_time + 14400000/2, price942, "9:42", xloc.bar_time, yloc.price, na, label.style_none, i9Color, size.normal, text.align_right)

        label.delete(lb3[1])

        if not i9History

            line.delete(lne3[1])
</code>```

Body:
I am trying to create a PineScript indicator that plots a horizontal line on the chart at the 9:42 AM price of the asset being charted, during the New York trading session. It does this by first defining the 9:42 AM New York time as a series of integers using the time() function. It then creates a series of true and false values, called period, representing the time period from 9:42 AM to 9:43 AM.

Next, the code uses the ta.valuewhen() function to retrieve the 9:42 AM price. It then uses the line.new() function to draw a line at the 9:42 AM price on the chart, and the label.new() function to create a label with the 9:42 AM price at the end of the line. The appearance and style of the line and label can be customized using the input options i9Style, i9Color, and i9Label. The input option i9History determines whether the line and label will persist on the chart after the current bar (true) or be removed (false).

the issue - everything is working fine there are no error runs perfectly fine but when I add this indicator on chart it showes nothing and says : study error - can not parse resolution '09

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/

// © Bee_Zee

//@version=5

indicator("ICT NEW YORK 9:42 AM OPEN", "ICT SAUCE 9:42 AM OPEN", true, max_lines_count=500)

i9Display = input.bool    (true, "Display", group="New York 9:42 Open")
i9Time    = input.session ('0942-0943:1234567', "Session", group="New York 9:42 Open")

i9Style   = input.string  ("Solid", "Line Style", options=["Solid", "Dotted", "Dashed"], group="New York 9:42 Open")

i9Color   = input.color   (#e43030, "Color", group="New York 9:42 Open")

i9History = input.bool    (true, "History", group="New York 9:42 Open")

i9Label   = input.bool    (true, "Show Label", group="New York 9:42 Open")

// Define the 9:42 AM New York time as a series of integers

t942 = time("09:42:00", "New York")

_9Style   = i9Style ==    "Solid" ? line.style_solid : i9Style == "Dotted" ? line.style_dotted : line.style_dashed

//==== Sauce 9:42 Open  ====
if i9Display

// Create a series of true and false values representing the time period from 9:42 AM to 9:43 AM

period = time >= t942 and time < t942 + 60

// Retrieve the 9:42 AM price using ta.valuewhen

price942 = ta.valuewhen(period, close, 0)
var label lb3 = na
var line lne3 = na
if price942 != price942[1]
    if barstate.isconfirmed
        line.set_x2(lne3, t942 - 30600000)

        // Draw a line at the 9:42 AM price

        lne3 := line.new(t942, price942, last_bar_time + 14400000/2, price942, xloc.bar_time, extend.none, i9Color, _9Style, 1)

        if i9Label

            // Update the label at the end of the line with the 9:42 AM price

            lb3  := label.new(last_bar_time + 14400000/2, price942, "9:42", xloc.bar_time, yloc.price, na, label.style_none, i9Color, size.normal, text.align_right)

        label.delete(lb3[1])

        if not i9History

            line.delete(lne3[1])


问:
How to get Screen Time (or amount of time spent) on another apps using Flutter?
I am trying to fetch the screen time of other apps in my flutter app. For that I have used the following packages:
device_apps: ^2.2.0
app_usage: ^2.1.1
usage_stats: ^1.2.0

But I couldn't find the screen time in fetched data in my snapshot, so I wanna know how to fetch the screen time (usage time [for example used instagram for 15 mins today]):

```<code>

class ScreenTime extends StatefulWidget {
  final String title;
  const ScreenTime({Key? key, required this.title}) : super(key: key);

  @override
  _ScreenTimeState createState() => _ScreenTimeState();
}

class _ScreenTimeState extends State<ScreenTime> {
  // Future<List<Application>> apps = DeviceApps.getInstalledApplications(includeSystemApps: false);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
          // leading: new IconButton(
          //   icon: new Icon(Icons.menu, color: Colors.white),
          //   onPressed: () {},
          // ),
        ),
        // ),

        body: Container(
            padding: EdgeInsets.all(10),
            child: ListView(children: [
              Table(
                  defaultColumnWidth: FixedColumnWidth(120.0),
                  border: TableBorder.all(
                      color: Colors.white, style: BorderStyle.solid, width: 2),
                  children: [
                    TableRow(children: [
                      Container(
                        height: 65,
                        padding: EdgeInsets.only(top: 17),
                        color: Color(0xff0307f2),
                        child: Column(
                          children: [
                            Text('App Icon',
                                style: TextStyle(
                                    fontSize: 16.0, color: Colors.white))
                          ],
                        ),
                      ),
                      Container(
                        height: 65,
                        padding: EdgeInsets.only(top: 17),
                        color: Color(0xff0307f2),
                        child: Column(children: [
                          Text('App Name',
                              style: TextStyle(
                                  fontSize: 16.0, color: Colors.white))
                        ]),
                      ),
                      Container(
                        height: 65,
                        padding: EdgeInsets.only(top: 17),
                        color: Color(0xff0307f2),
                        child: Column(children: [
                          Text(
                            'Screen Time',
                            style:
                                TextStyle(fontSize: 16.0, color: Colors.white),
                          )
                        ]),
                      ),
                    ])
                  ]),
              FutureBuilder<List>(
                  future: getApps(),
                  builder: (context, AsyncSnapshot snapshot) {
                    if (!snapshot.hasData) {
                      return Center(child: CircularProgressIndicator());
                    } else {
                      return ListView.builder(
                          controller: ScrollController(),
                          shrinkWrap: true,
                          scrollDirection: Axis.vertical,
                          itemCount: snapshot.data.length,
                          itemBuilder: (BuildContext context, int index) {
                            print('${snapshot.data[index]}' + "\n");
                            Uint8List x = snapshot.data[index].icon;
                            double st =
                                ((snapshot.data[index].updateTimeMillis) /
                                    1000);
                            return Container(
                                padding: EdgeInsets.all(5),
                                child: Row(
                                    crossAxisAlignment:
                                        CrossAxisAlignment.center,
                                    mainAxisAlignment: MainAxisAlignment.start,
                                    children: [
                                      Container(
                                          height: 105,
                                          width: 125,
                                          padding: EdgeInsets.only(top: 17),
                                          color: Color(0xff0307f2),
                                          child: Column(
                                            children: [
                                              Image.memory(
                                                x,
                                                height: 50,
                                                width: 50,
                                              )
                                            ],
                                          )),
                                      Flexible(
                                        child: Container(
                                            margin: EdgeInsets.all(3),
                                            color: Color(0xff9799fc),
                                            height: 105,
                                            width: 130,
                                            padding: EdgeInsets.all(20),
                                            child: Text(
                                                '${snapshot.data[index].appName}',
                                                textAlign: TextAlign.center,
                                                style: TextStyle(
                                                    fontSize: 20.0,
                                                    color: Colors.black))),
                                      ),
                                      Flexible(
                                        child: Container(
                                            margin: EdgeInsets.all(3),
                                            color: Color(0xff9799fc),
                                            height: 105,
                                            width: 130,
                                            padding: EdgeInsets.all(20),
                                            child: Text(st.toString(),
                                                textAlign: TextAlign.center,
                                                style: TextStyle(
                                                    fontSize: 20.0,
                                                    color: Colors.black))),
                                      )

                                      //   Container(height: 65,padding:EdgeInsets.only(
                                      //       top:17),color:Color(0xff0307f2), child:Column(children:[Text('Screen Time', style: TextStyle(fontSize: 20.0, color: Colors.white))]),),
                                      // ])

                                      // return Row(
                                      //
                                      //     children:[
                                      //        Image.memory(
                                      //            x,
                                      //          height: 50,
                                      //          width: 50,
                                      //
                                      //        ),
                                      //       Text('${snapshot.data[index]}'),]);
                                      // }
                                    ]));
                          });
                    }
                  }),
            ])));
  }

  Future<List> getApps() async {
    Future<List> x = DeviceApps.getInstalledApplications(
        includeSystemApps: true, includeAppIcons: true);
    return x;
  }
}

</code>```

how can I fetch the data regarding usage time of each app here? Or do I need to use some other packages?

Edit 1: I am not having any errors, I just dont know how can I access the screen time of each app in flutter *currently I am fetching update time.
Edit 2: This app is for Android

Body:
I am trying to fetch the screen time of other apps in my flutter app. For that I have used the following packages:
device_apps: ^2.2.0
app_usage: ^2.1.1
usage_stats: ^1.2.0

But I couldn't find the screen time in fetched data in my snapshot, so I wanna know how to fetch the screen time (usage time [for example used instagram for 15 mins today]):

class ScreenTime extends StatefulWidget {
  final String title;
  const ScreenTime({Key? key, required this.title}) : super(key: key);

  @override
  _ScreenTimeState createState() => _ScreenTimeState();
}

class _ScreenTimeState extends State<ScreenTime> {
  // Future<List<Application>> apps = DeviceApps.getInstalledApplications(includeSystemApps: false);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
          // leading: new IconButton(
          //   icon: new Icon(Icons.menu, color: Colors.white),
          //   onPressed: () {},
          // ),
        ),
        // ),

        body: Container(
            padding: EdgeInsets.all(10),
            child: ListView(children: [
              Table(
                  defaultColumnWidth: FixedColumnWidth(120.0),
                  border: TableBorder.all(
                      color: Colors.white, style: BorderStyle.solid, width: 2),
                  children: [
                    TableRow(children: [
                      Container(
                        height: 65,
                        padding: EdgeInsets.only(top: 17),
                        color: Color(0xff0307f2),
                        child: Column(
                          children: [
                            Text('App Icon',
                                style: TextStyle(
                                    fontSize: 16.0, color: Colors.white))
                          ],
                        ),
                      ),
                      Container(
                        height: 65,
                        padding: EdgeInsets.only(top: 17),
                        color: Color(0xff0307f2),
                        child: Column(children: [
                          Text('App Name',
                              style: TextStyle(
                                  fontSize: 16.0, color: Colors.white))
                        ]),
                      ),
                      Container(
                        height: 65,
                        padding: EdgeInsets.only(top: 17),
                        color: Color(0xff0307f2),
                        child: Column(children: [
                          Text(
                            'Screen Time',
                            style:
                                TextStyle(fontSize: 16.0, color: Colors.white),
                          )
                        ]),
                      ),
                    ])
                  ]),
              FutureBuilder<List>(
                  future: getApps(),
                  builder: (context, AsyncSnapshot snapshot) {
                    if (!snapshot.hasData) {
                      return Center(child: CircularProgressIndicator());
                    } else {
                      return ListView.builder(
                          controller: ScrollController(),
                          shrinkWrap: true,
                          scrollDirection: Axis.vertical,
                          itemCount: snapshot.data.length,
                          itemBuilder: (BuildContext context, int index) {
                            print('${snapshot.data[index]}' + "\n");
                            Uint8List x = snapshot.data[index].icon;
                            double st =
                                ((snapshot.data[index].updateTimeMillis) /
                                    1000);
                            return Container(
                                padding: EdgeInsets.all(5),
                                child: Row(
                                    crossAxisAlignment:
                                        CrossAxisAlignment.center,
                                    mainAxisAlignment: MainAxisAlignment.start,
                                    children: [
                                      Container(
                                          height: 105,
                                          width: 125,
                                          padding: EdgeInsets.only(top: 17),
                                          color: Color(0xff0307f2),
                                          child: Column(
                                            children: [
                                              Image.memory(
                                                x,
                                                height: 50,
                                                width: 50,
                                              )
                                            ],
                                          )),
                                      Flexible(
                                        child: Container(
                                            margin: EdgeInsets.all(3),
                                            color: Color(0xff9799fc),
                                            height: 105,
                                            width: 130,
                                            padding: EdgeInsets.all(20),
                                            child: Text(
                                                '${snapshot.data[index].appName}',
                                                textAlign: TextAlign.center,
                                                style: TextStyle(
                                                    fontSize: 20.0,
                                                    color: Colors.black))),
                                      ),
                                      Flexible(
                                        child: Container(
                                            margin: EdgeInsets.all(3),
                                            color: Color(0xff9799fc),
                                            height: 105,
                                            width: 130,
                                            padding: EdgeInsets.all(20),
                                            child: Text(st.toString(),
                                                textAlign: TextAlign.center,
                                                style: TextStyle(
                                                    fontSize: 20.0,
                                                    color: Colors.black))),
                                      )

                                      //   Container(height: 65,padding:EdgeInsets.only(
                                      //       top:17),color:Color(0xff0307f2), child:Column(children:[Text('Screen Time', style: TextStyle(fontSize: 20.0, color: Colors.white))]),),
                                      // ])

                                      // return Row(
                                      //
                                      //     children:[
                                      //        Image.memory(
                                      //            x,
                                      //          height: 50,
                                      //          width: 50,
                                      //
                                      //        ),
                                      //       Text('${snapshot.data[index]}'),]);
                                      // }
                                    ]));
                          });
                    }
                  }),
            ])));
  }

  Future<List> getApps() async {
    Future<List> x = DeviceApps.getInstalledApplications(
        includeSystemApps: true, includeAppIcons: true);
    return x;
  }
}

how can I fetch the data regarding usage time of each app here? Or do I need to use some other packages?

Edit 1: I am not having any errors, I just dont know how can I access the screen time of each app in flutter *currently I am fetching update time.
Edit 2: This app is for Android


问:
The optimal way to make Flutter application multilingual
There are different ways to make Flutter applications multilingual
For example, putting the translations in the json file and also using the flutter_localizations package, and instead of using json, create an abstract String class for each translation, similar to the code below:

```<code>class LanguageEn extends Languages {

  @override
  String get appName => "Multi-languages";

  @override
  String get labelWelcome => "Welcome";

  @override
  String get labelSelectLanguage => "Select Language";

  @override
  String get labelInfo => "This is multi-languages demo application";

}
</code>```

Which method do you think is optimal and its management is better?

Body:
There are different ways to make Flutter applications multilingual
For example, putting the translations in the json file and also using the flutter_localizations package, and instead of using json, create an abstract String class for each translation, similar to the code below:

class LanguageEn extends Languages {

  @override
  String get appName => "Multi-languages";

  @override
  String get labelWelcome => "Welcome";

  @override
  String get labelSelectLanguage => "Select Language";

  @override
  String get labelInfo => "This is multi-languages demo application";

}

Which method do you think is optimal and its management is better?


问:
Favicon not applied in safari
I'm applying the favicon using React Helmet Async on the Bun js dev server, and I'm trying to apply the favicon file to Safari as an ico file. But safari doesn't work. However, Chrome, Firefox, and Edge work just fine.

However, when I apply the favicon in index.html, it works properly in safari.
Safari not reading React Helmet Async's dynamic favicon changes?

Here is my React Helmet Async application code.

import IcoFavicon from 'assets/favicon.ico';
import SvgFavicon from 'assets/favicon.svg';
import { Helmet } from 'react-helmet-async';

<Helmet>
  <link rel="icon" href={IcoFavicon} />
  <link rel="icon" href={SvgFavicon} />
  ...
</Helmet>
```
<p>I also used favicon.ico in index.html but it didn't work in both chrome and safari.</p>
<p>So I applied it in React Helmet Async.</p>
<p>Here is my old Index.html code.</p>
<pre class="lang-html prettyprint-override"><code>...
<link rel="icon" href="/favicon.ico" /> // I've tried both %PUBLIC_URL%/favicon.ico and ./favicon.ico as well as this path.
...
</code>```

Title: Favicon not applied in safari

Body:
I'm applying the favicon using React Helmet Async on the Bun js dev server, and I'm trying to apply the favicon file to Safari as an ico file. But safari doesn't work. However, Chrome, Firefox, and Edge work just fine.

However, when I apply the favicon in index.html, it works properly in safari.
Safari not reading React Helmet Async's dynamic favicon changes?

Here is my React Helmet Async application code.

import IcoFavicon from 'assets/favicon.ico';
import SvgFavicon from 'assets/favicon.svg';
import { Helmet } from 'react-helmet-async';

<Helmet>
  <link rel="icon" href={IcoFavicon} />
  <link rel="icon" href={SvgFavicon} />
  ...
</Helmet>

I also used favicon.ico in index.html but it didn't work in both chrome and safari.

So I applied it in React Helmet Async.

Here is my old Index.html code.

...
<link rel="icon" href="/favicon.ico" /> // I've tried both %PUBLIC_URL%/favicon.ico and ./favicon.ico as well as this path.
...


问:
Autoregressive Generalised Additive Models (AR GAMs) and their intepretations
Basically I'm modelling tree fruiting patterns using mgcv bams and auto regressive (1) models have much better outcomes using itsadug::compareML(). (bam AR(1) was chosen due to limitations associated with binomial data) Further, this AR is backed up by biological theory. However, the best models when I use AR techniques often don't include terms that are included in the non-AR models. I understand this to be a common occurrence, the AR term explains much of the variance, leaving smaller predictions for the remaining terms.

I've seen discussions on here warning that AR GAMs should be interpreted with care, and Gavin Simposon's AR GAM post (part 1), ends with hinting that there are some serious diagnostic criteria that should be considered, but part 2 never came out, and I'm struggling to find resources on interpretation. Much more common are simple introductory articles.

I guess the fundamental question is thus: the two different types of model will make different statements about the effects of a given predictor, which should be believed?

If the non-AR model finds that month is a useful predictor, but the AR model finds it ultimately superfluous, does month have an effect? Is month relevant due to effects like light patterns, or just because of correlational structure? I guess this is a classic 'no models are true, some are useful' situation.

This problem persists even inside of a predictor. My temperature:vpds tensor product spline will cite a particular region as increasing the probability in non-AR models, but will suggest another region does so in AR models (in addition to the first).

I'm presently leaning towards including both sets of models in my paper, and noting that the AR models provide better predictions, but the non-AR models can provide insight into the effect of variables. Even then I wonder what's more useful? The model that best fits the data without any AR? Or the non-AR version of the AR model (i.e, set the autocorrelation parameter to 0 keeping the same predictors). I'm leaning towards the former, because I feel strange about the models that have almost no predictors.


问:
Django e-commerce checkout page does not want to display products in the HTML page
basket/models.py

```<code>from decimal import Decimal
from django.db import models, migrations
from django.conf import settings
from datetime import datetime
from marketplace.models import prodProduct
from member.models import Person

class Basket(models.Model):

    class Meta:
        db_table = 'basket'
    productqty = models.IntegerField(default=0)
    productid = models.ForeignKey(prodProduct, on_delete=models.CASCADE)
    Person_fk = models.ForeignKey(Person, on_delete=models.CASCADE)

    def save(self):
        super().save()

    def get_subtotal_price(self, fk1):
        product = prodProduct.objects.get(pk=fk1)
        basket = Basket.objects.all()
        return sum(Decimal(product['productPrice']) * basket['productqty'])

    def get_total_price(self, fk1):
        product = prodProduct.objects.get(pk=fk1)
        basket = Basket.objects.all()
        subtotal = sum(Decimal(product['productPrice']) * basket['productqty'])

        if subtotal == 0:
            shipping = Decimal(0.00)
        else:
            shipping = Decimal(3.00)

        total = subtotal + Decimal(shipping)
        return total
</code>```

marketplace/models.py

```<code>class prodProduct(models.Model):
    class Meta:
        db_table = 'prodProduct'
    productid = models.AutoField(primary_key=True)
    productName = models.CharField(max_length=255, blank=True)
    productDesc = models.CharField(max_length=1500,blank=True)
    productCategory = models.CharField(max_length=255, blank=True)
    productPrice = models.DecimalField(max_digits=4, decimal_places=2)
    productStock = models.IntegerField(default=0)
    productPhoto = models.ImageField(upload_to ='images/', null=True)
    productRating = models.IntegerField(default=0)
    timePosted = models.DateTimeField(default=datetime.now, blank=True)
    Person_fk = models.ForeignKey(Person, on_delete=models.CASCADE)

    def save(self):
        super().save()
        return self.productid

    def deleteProduct(self):
        super().delete()

</code>```

basket/summary.html

```<code>{% block content %}
<div class="container">
  <div class="col-12">
    <h1 class="h2">Your Basket</h1>
  </div>
  <div class="col-12">
    <p>Manage your <b>items</b> in your basket</p>
  </div>
  <hr />
</div>
<div class="container">
  <div class="row g-3">
    {% if allBasket.count == 0 %}
    <div class="col-12">Your basket is empty <a href="{% url 'MainMarketplace' %}">Shop</a></div>
    {% else %}
    <div class="col-12 bg-light p-3 d-flex justify-content-between">
      <div class="dropdown">
        <button class="btn btn-success fw-bold" type="button" id="dropdownLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          Shipping options
          <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-down-fill" viewBox="0 0 16 16">
            <path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/>
          </svg>
        </button>
        <div class="dropdown-menu" aria-labelledby="dropdownLink">
          <a class="dropdown-item" href="#">Next day delivery</a>
          <a class="dropdown-item" href="#">Premium delivery</a>
        </div>
      </div>
      <div class="text-end">
        <div class="">Sub Total: <span class="fw-bold">RM</span>
          <div id="subtotal" class="d-inline-flex fw-bold">{{subtotal}}</div>
        </div>
        <div id="">Shipping <span class="small">(Next day delivery)</span>: <span class="fw-bold">RM5.00</span></div>
        <div class="pt-2">Total to pay: <span class="fw-bold">RM</span><span id="total"
            class="fw-bold h5">{{totalprice}}</span></div>
        </div>
      </div>
    <div class="col-md-5 col-lg-4 order-md-last p-0 order-3">
      {% for product in product %}
        <div class="d-grid gap-2 ">
          <a role="button" href="{% url 'basket' product.productid %}" class="btn btn-success fw-bold" type="button">Checkout</a>
        </div>
      {% endfor %}
    </div>
    <div class="col-md-7 col-lg-8 p-0">
      {% for all_basket in all_basket %}
        {% for item in product %}
          {% if all_basket.productid_id == product.productid and all_basket.Person_fk_id.Email == request.session.Email %}
            <div class="card mb-3 border-0 product-item">
              <div class="row g-0">
                <div class="col-md-2 d-none d-md-block">
                  <img class="img-fluid mx-auto d-block" alt="Responsive image" src="{{ item.productPhoto }}" />
                </div>
                <div class="col-md-10 ps-md-3">
                  <div class="card-body p-1">
                    <p class="card-text pb-3">{{ product.productName }}</p>
                    <label for="select">Qty</label>
                    <select id="productqty" style="width:50px;height:31px;">
                      <option value="" selected disabled hidden>1</option>
                      <option value="">1</option>
                      <option value="">2</option>
                      <option value="">3</option>
                      <option value="">4</option>
                    </select>
                    <a type="button" id="update-button" data-index="{{item.productid}}"
                      class="update-button text-decoration-none small ps-3">Update</a>
                    <a type="button" id="delete-button" data-index="{{item.productid}}"
                      class="delete-button text-decoration-none small">Delete</a>
                  </div>
                </div>
              </div>
            </div>
          {% endif %}
        {% endfor %}
      {% endfor %}
</code>```

Here is the screenshot of what is displayed currently

Goal
I want to be able to display the products, subtotal price and total price after shipping that are in the basket but currently it does not want to display any of that.

basket/summary.html

```<code><div class="text-end">
        <div class="">Sub Total: <span class="fw-bold">RM</span>
          <div id="subtotal" class="d-inline-flex fw-bold">{{subtotal}}</div>
        </div>
        <div id="">Shipping <span class="small">(Next day delivery)</span>: <span class="fw-bold">RM5.00</span></div>
        <div class="pt-2">Total to pay: <span class="fw-bold">RM</span><span id="total"
            class="fw-bold h5">{{totalprice}}</span></div>
        </div>
      </div>
</code>```

This part displays perfectly but the other codes does not display anything at all. Can someone help me debug the code, I've been on this for quite a while now. Thanks!

Body:
basket/models.py

from decimal import Decimal
from django.db import models, migrations
from django.conf import settings
from datetime import datetime
from marketplace.models import prodProduct
from member.models import Person

class Basket(models.Model):

    class Meta:
        db_table = 'basket'
    productqty = models.IntegerField(default=0)
    productid = models.ForeignKey(prodProduct, on_delete=models.CASCADE)
    Person_fk = models.ForeignKey(Person, on_delete=models.CASCADE)

    def save(self):
        super().save()

    def get_subtotal_price(self, fk1):
        product = prodProduct.objects.get(pk=fk1)
        basket = Basket.objects.all()
        return sum(Decimal(product['productPrice']) * basket['productqty'])

    def get_total_price(self, fk1):
        product = prodProduct.objects.get(pk=fk1)
        basket = Basket.objects.all()
        subtotal = sum(Decimal(product['productPrice']) * basket['productqty'])

        if subtotal == 0:
            shipping = Decimal(0.00)
        else:
            shipping = Decimal(3.00)

        total = subtotal + Decimal(shipping)
        return total

marketplace/models.py

class prodProduct(models.Model):
    class Meta:
        db_table = 'prodProduct'
    productid = models.AutoField(primary_key=True)
    productName = models.CharField(max_length=255, blank=True)
    productDesc = models.CharField(max_length=1500,blank=True)
    productCategory = models.CharField(max_length=255, blank=True)
    productPrice = models.DecimalField(max_digits=4, decimal_places=2)
    productStock = models.IntegerField(default=0)
    productPhoto = models.ImageField(upload_to ='images/', null=True)
    productRating = models.IntegerField(default=0)
    timePosted = models.DateTimeField(default=datetime.now, blank=True)
    Person_fk = models.ForeignKey(Person, on_delete=models.CASCADE)

    def save(self):
        super().save()
        return self.productid

    def deleteProduct(self):
        super().delete()

basket/summary.html

{% block content %}

Your Basket

Manage your items in your basket

    {% if allBasket.count == 0 %}

Your basket is empty Shop

    {% else %}

        <button class="btn btn-success fw-bold" type="button" id="dropdownLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          Shipping options
          <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-caret-down-fill" viewBox="0 0 16 16">
            <path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z"/>
          </svg>
        </button>

          Next day delivery
          Premium delivery

Sub Total: RM

{{subtotal}}

Shipping (Next day delivery): RM5.00

Total to pay: RM{{totalprice}}

      {% for product in product %}

          Checkout

      {% endfor %}

      {% for all_basket in all_basket %}
        {% for item in product %}
          {% if all_basket.productid_id == product.productid and all_basket.Person_fk_id.Email == request.session.Email %}

{{ product.productName }}

                    Qty
                    <select id="productqty" style="width:50px;height:31px;">
                      <option value="" selected disabled hidden>1</option>
                      <option value="">1</option>
                      <option value="">2</option>
                      <option value="">3</option>
                      <option value="">4</option>
                    </select>
                    Update
                    Delete

          {% endif %}
        {% endfor %}
      {% endfor %}

Here is the screenshot of what is displayed currently

Goal
I want to be able to display the products, subtotal price and total price after shipping that are in the basket but currently it does not want to display any of that.

basket/summary.html

Sub Total: RM

{{subtotal}}

Shipping (Next day delivery): RM5.00

Total to pay: RM{{totalprice}}

This part displays perfectly but the other codes does not display anything at all. Can someone help me debug the code, I've been on this for quite a while now. Thanks!


问:
Python, await ctx.send(response) send doesn't work
```<code># bot.py
import discord
import os
import random

from discord.ext import commands
from dotenv import load_dotenv

load_dotenv()
TOKEN = "token"

intents = discord.Intents.all()
intents.message_content = True

bot = commands.Bot(command_prefix='.', intents=intents)

@bot.event
async def on_ready():
    print(f'{bot.user.name} text')

@bot.command(name='rastgelefilm')
async def rf(ctx):
    with open("movies.txt") as f:
        lines = f.readlines()
        response = random.choice(lines)
        await ctx.send(response)

bot.run(TOKEN)

</code>```

I'm making a Discord bot and I'm trying to run this code but send doesn't work and it's white on Visual Studio Code. Is something wrong with the code?

I tried these two.

async def fn(ctx:discord.ApplicationContext):

ctx.channel.send()

Body:
# bot.py
import discord
import os
import random

from discord.ext import commands
from dotenv import load_dotenv

load_dotenv()
TOKEN = "token"

intents = discord.Intents.all()
intents.message_content = True

bot = commands.Bot(command_prefix='.', intents=intents)

@bot.event
async def on_ready():
    print(f'{bot.user.name} text')

@bot.command(name='rastgelefilm')
async def rf(ctx):
    with open("movies.txt") as f:
        lines = f.readlines()
        response = random.choice(lines)
        await ctx.send(response)

bot.run(TOKEN)

I'm making a Discord bot and I'm trying to run this code but send doesn't work and it's white on Visual Studio Code. Is something wrong with the code?

I tried these two.

async def fn(ctx:discord.ApplicationContext):

ctx.channel.send()


问:
Why do I get this error in DLNM_Meta analyse in R
I have a question regarding dlnm package in R. I am trying to replicate a simple example of DLNM_meta (code below) which connects temperature to morbidity. It is straight-forward but when I try to run the model I get:

```<code>Error in glm.fit(x = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  :
  NA/NaN/Inf in 'x'
</code>```

I am extremely new to R and I am pretty lost. I would appreciate any help!
library(dlnm) ;
library(mvmeta) ;
library(splines);
library(tidyverse)
setwd("D:/Documents/2021-2024/first/subject")

```<code>fujian <- read.csv("20050101_20191231_fujian.csv",row.names=1)
alldata<- subset(fujian, month %in% 8:11)
dim(alldata)
head(alldata)
regions <- as.character(unique(alldata$area))
data <- lapply(regions,function(x) alldata[alldata$area==x,])
names(data) <- regions
m <- length(regions)
ranges <- t(sapply(data, function(x) range(x$tmean,na.rm=T)))
fqaic <- function(model) {
  loglik <- sum(dpois(model$y,model$fitted.values,log=TRUE))
  phi <- summary(model)$dispersion
  qaic <- -2*loglik + 2*summary(model)$df[3]*phi
  return(qaic)
 }
reg <- "A"`your text`
bound <- colMeans(ranges)
varknots <- bound[1] + diff(bound)/3*(1:2)
argvar001 <- list(type="bs",degree=3,knots=varknots,bound=bound,cen=mean(data[[reg]]$tmean))
arglag001 <- list(type="ns",df=3)
suppressWarnings(
  cb001 <- crossbasis(data[[reg]]$tmean,lag=21,argvar=argvar001,arglag=arglag001,group =           data[[reg]]$year)
)
summary(cb001)

model001 <- glm(case ~ cb001 + dow + ns(time,df=6),
         family=quasipoisson(),data[[reg]],maxit = 1000,na.action="na.exclude")
summary(model001)
fqaic001 <- fqaic(model001)`
</code>```

Body:
I have a question regarding dlnm package in R. I am trying to replicate a simple example of DLNM_meta (code below) which connects temperature to morbidity. It is straight-forward but when I try to run the model I get:

Error in glm.fit(x = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  :
  NA/NaN/Inf in 'x'

I am extremely new to R and I am pretty lost. I would appreciate any help!
library(dlnm) ;
library(mvmeta) ;
library(splines);
library(tidyverse)
setwd("D:/Documents/2021-2024/first/subject")

fujian <- read.csv("20050101_20191231_fujian.csv",row.names=1)
alldata<- subset(fujian, month %in% 8:11)
dim(alldata)
head(alldata)
regions <- as.character(unique(alldata$area))
data <- lapply(regions,function(x) alldata[alldata$area==x,])
names(data) <- regions
m <- length(regions)
ranges <- t(sapply(data, function(x) range(x$tmean,na.rm=T)))
fqaic <- function(model) {
  loglik <- sum(dpois(model$y,model$fitted.values,log=TRUE))
  phi <- summary(model)$dispersion
  qaic <- -2*loglik + 2*summary(model)$df[3]*phi
  return(qaic)
 }
reg <- "A"`your text`
bound <- colMeans(ranges)
varknots <- bound[1] + diff(bound)/3*(1:2)
argvar001 <- list(type="bs",degree=3,knots=varknots,bound=bound,cen=mean(data[[reg]]$tmean))
arglag001 <- list(type="ns",df=3)
suppressWarnings(
  cb001 <- crossbasis(data[[reg]]$tmean,lag=21,argvar=argvar001,arglag=arglag001,group =           data[[reg]]$year)
)
summary(cb001)

model001 <- glm(case ~ cb001 + dow + ns(time,df=6),
         family=quasipoisson(),data[[reg]],maxit = 1000,na.action="na.exclude")
summary(model001)
fqaic001 <- fqaic(model001)`


问:
What is the VS Code equivilant of Visual Studio's Ctrl+M Ctrl+O hotkey?
In Visual Studio. When editing a C# file.
If I press Ctrl+M Ctrl+O.

It automatically collapses all the children functions in the current level.

Even when im within a nested class.

It also doesn't recursively collapse all the blocks within the functions.

With VS code. I have to collapse based on a numbered level With Ctrl+K Ctrl+level (1-9).

Is there a hotkey or extension that lets me automatically collapse the current level's children (and not their sub-regions) in VS code?


问:
Why does powershell not support Set-Partition -IsHidden $True?
Here is an example. But when I try it on my computer like this:

(base) PS H:\> Set-Partition -DriveLetter H -IsHidden $True

The result is:

```<code>Set-Partition : Not Supported
Activity ID: {1129ec62-b8d9-40d1-a947-b64dbbf8777a}
Line:1 Char: 1
+ Set-Partition -DriveLetter H -IsHidden $True
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (StorageWMI:ROOT/Microsoft/..._StorageCmdlets) [Set-Partition]，CimExce
    ption
    + FullyQualifiedErrorId : StorageWMI 1,Set-Partition
</code>```

Drive H is a partition of a usb drive. The file system is NTFS, MBR. I run powershell as Administrator.

Thank you for your help.

Body:
Here is an example. But when I try it on my computer like this:

(base) PS H:\> Set-Partition -DriveLetter H -IsHidden $True

The result is:

Set-Partition : Not Supported
Activity ID: {1129ec62-b8d9-40d1-a947-b64dbbf8777a}
Line:1 Char: 1
+ Set-Partition -DriveLetter H -IsHidden $True
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (StorageWMI:ROOT/Microsoft/..._StorageCmdlets) [Set-Partition]，CimExce
    ption
    + FullyQualifiedErrorId : StorageWMI 1,Set-Partition

Drive H is a partition of a usb drive. The file system is NTFS, MBR. I run powershell as Administrator.

Thank you for your help.


问:
Why is custom post type's post link showing something like event/group_5d02956626dd0/ at the end?
I created a custom post type called "event" to create event pages. I used Code Snippet to create it. I expected the link to post to look something like https://andersonadvisorscom.bigscoots-staging.com/event/test-event-page/ instead of https://andersonadvisorscom.bigscoots-staging.com/event/group_5d02956626dd0/

Is there anything that I missed while creating the custom post type that is causing this?

This is how it shows up in the WordPress edit screen https://andersonadvisorscom.bigscoots-staging.com/event/group_5d02956626dd0/


问:
Plotting Wind Barb and Wind Speed for multiple iterations
I have 2 netcdf files: -
uwnd.10m.mon.ltm.nc and vwnd.10m.mon.ltm.nc

I have to do wind barb plot of "Long Term Mean Monthly Mean of Winds".
I also have to plot Wind Speed with contour fill.
The plot is to be carried out 12 times.

I have attached a demo Image of how I need the desired output to look like for one iteration.

enter image description here

I have tried using the barb() along with contourf(), however i am getting the below output: -

enter image description here

I am new to python and maps, so if somebody can help me with the code, it would be highly appreciated.


问:
How do I tell VS intellisense to use C++ 17 in CMake project?
I tried to use std::variant but it cannot find the variant class. I figured out that intellisense doesn't use C++17. I already set CMAKE_CXX_STANDARD to 17

```<code>set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
</code>```

This only work for building the project.

VS2022 17.3.4

I cannot find any solution for it. The VS documentation itself doesn't help much.

Body:
I tried to use std::variant but it cannot find the variant class. I figured out that intellisense doesn't use C++17. I already set CMAKE_CXX_STANDARD to 17

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

This only work for building the project.

VS2022 17.3.4

I cannot find any solution for it. The VS documentation itself doesn't help much.


问:
Can .js, .jsx, .ts and .tsx be used simultaneously in a React project?
I have a React project created using JS only. react-scripts version: 5.0.0.
Now, I want to start using TS in the project (and slowly migrate the project overtime). It's quite a huge project now and everything can't be migrated all at once. Thus I want to start adding new components (or pages) written in typescript and also gradually work on migrating the existing javascript files to typescript.

I googled for solution, and answers suggested to create a new TS project and copy the files to the new project after renaming them to .ts or .tsx. But in our case, it's not very feasible.

Other answers suggested ejecting. But I want to use that if all other ways fail.

Are there any other ways I can do this? If we could somehow allow to have both the type of files and then could disable this in future when all the files have been migrated.

Currently trying to import a .tsx file in .js says module not found. I tried the solution from this post. But still has the same error.


问:
How to get consistent elevation info with MapBox? queryTerrainElevation() returns different values depending on zoom level
I'm running into a problem where I'm finding that queryTerrainElevation() provides different elevation values depending on the zoom level. The difference can vary as much as 50%.

I assume this is because the terrain map is slightly different at different zooms? Presumably because it is more "averaged" the farther you zoom out?

Is there anything I can do to avoid this problem so that users are getting consistent elevation data regardless of what zoom level they happen to be at? I assume it isn't possible by using queryTerrainElevation() as it can only query what is rendered in the viewport. Is there perhaps another(better) way to load this info?

Here is a quick example I tossed together  to show the problem. Simply change the hardcoded zoom and see how the console logged value changes even though it is querying the exact same coordinates.

```<code>    mapboxgl.accessToken = 'pk.eyJ1IjoicmNvb3BlcjEwMiIsImEiOiJjbDRpbDllaWkwdDR5M2RvYjZ4eXFoY3RlIn0.UQ7qfSyHKph7Acbuhb1swA';
    const map = new mapboxgl.Map({
        container: 'map',
        zoom: 15,
        center: [-117.52109099624408, 51.30205367821137],
        style: 'mapbox://styles/mapbox/satellite-streets-v12'
    });

    map.on('style.load', () => {
        map.addSource('mapbox-dem', {
            'type': 'raster-dem',
            'url': 'mapbox://mapbox.mapbox-terrain-dem-v1',
            'tileSize': 512,
            'maxzoom': 20
        });
        map.setTerrain({ 'source': 'mapbox-dem', 'exaggeration': 1 });
    });

    map.on('idle', (e) => {
        const elev = map.queryTerrainElevation({lng: -117.52109099624408, lat: 51.30205367821137, });
        console.log(elev);
    });
</code>```

Results

At zoom level 2 is reports an elevation of 1785.941989487461

At zoom level 2 is reports an elevation of 1785.941989487461

At zoom level 6 it reports an elevation of 1817.0050096897223

At zoom level 10 it reports an elevation of 1314.4484152921011

At zoom level 15 it reports an elevation of 1316.3900277280711

This is pretty wild variance. Especially at lower zoom values. According to geological data the elevation of the area around this particular coordinate is between 1300 and 1400 so it seems the accuracy is decent at higher zoom levels but terrible at lower ones.

Any suggestions/ideas would be greatly appreciated as this could potentially be a showstopper for the app we are working on. Is there another way to query elevation information? (any solution would need to be robust enough to query potentially many points. Our use case is our app builds an elevation graph for a route)

Body:
I'm running into a problem where I'm finding that queryTerrainElevation() provides different elevation values depending on the zoom level. The difference can vary as much as 50%.

I assume this is because the terrain map is slightly different at different zooms? Presumably because it is more "averaged" the farther you zoom out?

Is there anything I can do to avoid this problem so that users are getting consistent elevation data regardless of what zoom level they happen to be at? I assume it isn't possible by using queryTerrainElevation() as it can only query what is rendered in the viewport. Is there perhaps another(better) way to load this info?

Here is a quick example I tossed together  to show the problem. Simply change the hardcoded zoom and see how the console logged value changes even though it is querying the exact same coordinates.

    mapboxgl.accessToken = 'pk.eyJ1IjoicmNvb3BlcjEwMiIsImEiOiJjbDRpbDllaWkwdDR5M2RvYjZ4eXFoY3RlIn0.UQ7qfSyHKph7Acbuhb1swA';
    const map = new mapboxgl.Map({
        container: 'map',
        zoom: 15,
        center: [-117.52109099624408, 51.30205367821137],
        style: 'mapbox://styles/mapbox/satellite-streets-v12'
    });

    map.on('style.load', () => {
        map.addSource('mapbox-dem', {
            'type': 'raster-dem',
            'url': 'mapbox://mapbox.mapbox-terrain-dem-v1',
            'tileSize': 512,
            'maxzoom': 20
        });
        map.setTerrain({ 'source': 'mapbox-dem', 'exaggeration': 1 });
    });

    map.on('idle', (e) => {
        const elev = map.queryTerrainElevation({lng: -117.52109099624408, lat: 51.30205367821137, });
        console.log(elev);
    });

Results

At zoom level 2 is reports an elevation of 1785.941989487461

At zoom level 2 is reports an elevation of 1785.941989487461

At zoom level 6 it reports an elevation of 1817.0050096897223

At zoom level 10 it reports an elevation of 1314.4484152921011

At zoom level 15 it reports an elevation of 1316.3900277280711

This is pretty wild variance. Especially at lower zoom values. According to geological data the elevation of the area around this particular coordinate is between 1300 and 1400 so it seems the accuracy is decent at higher zoom levels but terrible at lower ones.

Any suggestions/ideas would be greatly appreciated as this could potentially be a showstopper for the app we are working on. Is there another way to query elevation information? (any solution would need to be robust enough to query potentially many points. Our use case is our app builds an elevation graph for a route)


问:
Not able to upload jar using mvn:deploy command
I have one jar that I want to upload into mvn artifact using mvn:deploy command.
after executing command, it is creating new jar and bundled the jar which I want to upload in artifact inside it.</p>


问:
How can i retrive images from firebase database into widgets
I am retrive my images from firebase database but when i do this my image doesn't show up i think the images doesn't show up because i am retriveing images into widget provider but i dont know how to fix that.

This is my WidgetProivder class

```<code>

 dabase2.addValueEventListener(object :ValueEventListener{
                override fun onDataChange(snapshot: DataSnapshot) {
                    for (data in snapshot.children){
                          imageuri=data.child("imageUrlForMatch").value.toString()

                    }

                    var parseuri:Uri=Uri.parse(imageuri)
                    try {

                        val bitmap: Bitmap =

                            Glide.with(context)
                                .asBitmap()
                                .load(parseuri)
                                .submit(250, 250)
                                .get()
                        views.setImageViewBitmap(R.id.fullImageWidget,bitmap)

                    } catch (e: Exception) {
                        e.printStackTrace()
                    }

                }

                override fun onCancelled(error: DatabaseError) {

                }

            })
</code>```

Body:
I am retrive my images from firebase database but when i do this my image doesn't show up i think the images doesn't show up because i am retriveing images into widget provider but i dont know how to fix that.

This is my WidgetProivder class

 dabase2.addValueEventListener(object :ValueEventListener{
                override fun onDataChange(snapshot: DataSnapshot) {
                    for (data in snapshot.children){
                          imageuri=data.child("imageUrlForMatch").value.toString()

                    }

                    var parseuri:Uri=Uri.parse(imageuri)
                    try {

                        val bitmap: Bitmap =

                            Glide.with(context)
                                .asBitmap()
                                .load(parseuri)
                                .submit(250, 250)
                                .get()
                        views.setImageViewBitmap(R.id.fullImageWidget,bitmap)

                    } catch (e: Exception) {
                        e.printStackTrace()
                    }

                }

                override fun onCancelled(error: DatabaseError) {

                }

            })


问:
RuntimeError: mat1 and mat2 shapes cannot be multiplied with fc layer of torch.cat()
i have this Model, with fc layers of torch.cat([img, feature], dim=1):

```<code>class Model(nn.Module):
    def __init__(self):
        super(Model, self).__init__()
        self.backbone = timm.create_model(CFG['model'], pretrained=False, num_classes=500, in_chans=13)
        self.mlp = nn.Sequential(
            nn.Linear(18, 120),
            nn.LayerNorm(120),
            nn.ReLU(),
            nn.Dropout(0.1))
        self.fc = nn.Linear(120*2*2, 120)
        self.fc2 = nn.Linear(120, 64)
        self.fc3 = nn.Linear(64, 1)

    def forward(self, img, feature):
        b, c, h, w = img.shape
        img = img.reshape(b*2, c//2, h, w)
        img = self.backbone(img).reshape(b, -1)
        feature = self.mlp(feature)
        y = F.relu(self.fc(torch.cat([img, feature], dim=1)))
        y = F.relu(self.fc2(y))
        y = self.fc3(y)
        return y
</code>```

It shows this ERROR when i loaded:

```<code>/tmp/ipykernel_977/845910059.py in forward(self, img, feature)
     19         img = self.backbone(img).reshape(b, -1)
     20         feature = self.mlp(feature)
---> 21         y = F.relu(self.fc(torch.cat([img, feature], dim=1)))
     22         y = F.relu(self.fc2(y))
     23         y = self.fc3(y)
...
RuntimeError: mat1 and mat2 shapes cannot be multiplied (64x1120 and 480x120)
</code>```

What should i fix?
It don't have error when i just use one fc layer (without fc2 & fc3).

Body:
i have this Model, with fc layers of torch.cat([img, feature], dim=1):

class Model(nn.Module):
    def __init__(self):
        super(Model, self).__init__()
        self.backbone = timm.create_model(CFG['model'], pretrained=False, num_classes=500, in_chans=13)
        self.mlp = nn.Sequential(
            nn.Linear(18, 120),
            nn.LayerNorm(120),
            nn.ReLU(),
            nn.Dropout(0.1))
        self.fc = nn.Linear(120*2*2, 120)
        self.fc2 = nn.Linear(120, 64)
        self.fc3 = nn.Linear(64, 1)

    def forward(self, img, feature):
        b, c, h, w = img.shape
        img = img.reshape(b*2, c//2, h, w)
        img = self.backbone(img).reshape(b, -1)
        feature = self.mlp(feature)
        y = F.relu(self.fc(torch.cat([img, feature], dim=1)))
        y = F.relu(self.fc2(y))
        y = self.fc3(y)
        return y

It shows this ERROR when i loaded:

/tmp/ipykernel_977/845910059.py in forward(self, img, feature)
     19         img = self.backbone(img).reshape(b, -1)
     20         feature = self.mlp(feature)
---> 21         y = F.relu(self.fc(torch.cat([img, feature], dim=1)))
     22         y = F.relu(self.fc2(y))
     23         y = self.fc3(y)
...
RuntimeError: mat1 and mat2 shapes cannot be multiplied (64x1120 and 480x120)

What should i fix?
It don't have error when i just use one fc layer (without fc2 & fc3).