问:
How can I see every change a pip install makes?
I'm working on an air-gapped PC and I'd like to install xgboost so I can use it in a machine learning model. However, to do so I have to move xgboost over on a thumbdrive.

I've tried downloading it to a similar machine and transferring it over, but it seems like the python _ctypes don't get moved over, and I get the following error when I try and use XGBoost:

```<code>CDLL.__getitem__(self, name_or_ordinal)
    400 def __getitem__(self, name_or_ordinal):
--> 401     func = self._FuncPtr((name_or_ordinal, self))
    402     if not isinstance(name_or_ordinal, int):
    403         func.__name__ = name_or_ordinal

AttributeError: function 'XGBGetLastError' not found
</code>```

I don't understand Python's C based backend, so I'm not sure how to fix this without knowing exactly what changes pip made when installing xgboost.

Is there a way to see all the changes pip makes when installing a package?

Body:
I'm working on an air-gapped PC and I'd like to install xgboost so I can use it in a machine learning model. However, to do so I have to move xgboost over on a thumbdrive.

I've tried downloading it to a similar machine and transferring it over, but it seems like the python _ctypes don't get moved over, and I get the following error when I try and use XGBoost:

CDLL.__getitem__(self, name_or_ordinal)
    400 def __getitem__(self, name_or_ordinal):
--> 401     func = self._FuncPtr((name_or_ordinal, self))
    402     if not isinstance(name_or_ordinal, int):
    403         func.__name__ = name_or_ordinal

AttributeError: function 'XGBGetLastError' not found

I don't understand Python's C based backend, so I'm not sure how to fix this without knowing exactly what changes pip made when installing xgboost.

Is there a way to see all the changes pip makes when installing a package?


来源: stackexchange

问:
Deployment of process archive ‘null’: Cannot deploy process archive ‘null’ to default process: no such process engine exists: processEngine is null
I am getting the below error when I deploy my war file on the tomcat server and it doesn’t deploy it. Please advise.

localhost.log

```<code>19-Dec-2022 11:29:41.718 INFO [Catalina-utility-2] org.apache.catalina.core.ApplicationContext.log 2 Spring WebApplicationInitializers detected on classpath
19-Dec-2022 11:29:42.073 SEVERE [Catalina-utility-2] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.camunda.bpm.platform.example.migration.ExampleProcessApplication]
org.camunda.bpm.engine.ProcessEngineException: ENGINE-08043 Exception while performing ‘Deployment of Process Application camunda-example-migrate-on-deployment-1.0-SNAPSHOT’ => 'Deployment of process archive ‘null’: Cannot deploy process archive ‘null’ to process engine ‘default’ no such process engine exists: processEngine is null
</code>```

I have processes.xml file with the following configurations.

ContentLicense: CC BY-SA 4.0

Body:
I am getting the below error when I deploy my war file on the tomcat server and it doesn’t deploy it. Please advise.

localhost.log

19-Dec-2022 11:29:41.718 INFO [Catalina-utility-2] org.apache.catalina.core.ApplicationContext.log 2 Spring WebApplicationInitializers detected on classpath
19-Dec-2022 11:29:42.073 SEVERE [Catalina-utility-2] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.camunda.bpm.platform.example.migration.ExampleProcessApplication]
org.camunda.bpm.engine.ProcessEngineException: ENGINE-08043 Exception while performing ‘Deployment of Process Application camunda-example-migrate-on-deployment-1.0-SNAPSHOT’ => 'Deployment of process archive ‘null’: Cannot deploy process archive ‘null’ to process engine ‘default’ no such process engine exists: processEngine is null

I have processes.xml file with the following configurations.


问:
Xcode Swift app does not start after changing folder structure
I'm new to swift and trying to create a basic app with Firebase. But when i tried to build and run the app on simulator, i get the following error:

```<code>
Application launch for 'com.example.SnapchatClone' did not return a valid pid nor a launch error.
Domain: NSPOSIXErrorDomain
Code: 3
Failure Reason: No such process
User Info: {
    DVTErrorCreationDateKey = "2022-12-19 18:25:55 +0000";
    IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;
}
</code>```

I'm not sure about the reason but I have relocated some files, like AppDelegate.swift and SceneDelegate.swift to Delegates folder, and View Controller files to ViewControllers folder.
I have tried to changed the DelegateClassName to '$(PRODUCT_MODULE_NAME).Delegate.SceneDelegate', clean and build again, restart the mac, adding a UIWindow definition to AppDelegate class. Nothing changes.
Can someone explain the error message and offer a solution?

Body:
I'm new to swift and trying to create a basic app with Firebase. But when i tried to build and run the app on simulator, i get the following error:

Application launch for 'com.example.SnapchatClone' did not return a valid pid nor a launch error.
Domain: NSPOSIXErrorDomain
Code: 3
Failure Reason: No such process
User Info: {
    DVTErrorCreationDateKey = "2022-12-19 18:25:55 +0000";
    IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;
}

I'm not sure about the reason but I have relocated some files, like AppDelegate.swift and SceneDelegate.swift to Delegates folder, and View Controller files to ViewControllers folder.
I have tried to changed the DelegateClassName to '$(PRODUCT_MODULE_NAME).Delegate.SceneDelegate', clean and build again, restart the mac, adding a UIWindow definition to AppDelegate class. Nothing changes.
Can someone explain the error message and offer a solution?


问:
Is there a way to import my image file from folder to javaScript in array form
I want to make a larger image display when ever the thumbnail is clicked, having problem at the point of importing the pictures from folder into javaScript or selecting it using the DOM tree structure.

I have tried to use jQuery to import it but am not familiar with jQuery, also tried to use the DOM tree structure but couldn't get it.


问:
Microsoft VBA Error - Run time Error - 1004
Run-time error '1004': The PivotTable field name is not valid. To create a PivotTable report you must use data that is organized as a list of labeled columns. If you are changing the name of a PivotTable field, you must type a new name for the field.

Here Is my Code?

Please tell me the mistake so I can understand it. also How Can I Correct it?

```<code>Option Explicit
Public PageName, RowName, ColumnName, DataName As String

Sub ShowForms()

        frmGenerateReports.Show

End Sub

Sub CreatePivot()

Dim Destination, RangeData As Range

        Set Destination = Worksheets("Reports").Range("A1")
        Set RangeData = Range("A1", Range("I1").End(xlDown))

        ActiveWorkbook.PivotCaches.Create _
                    (SourceType:=xlDatabase, SourceData:=RangeData) _
                    .CreatePivotTable TableDestination:=Destination, TableName:="SalesPivot"

End Sub

Sub SetFields()

Dim PvtTable As PivotTable
Set PvtTable = Worksheets("Reports").PivotTables("SalesPivot")

        With PvtTable
                .PivotFields(PageName).Orientation = xlPageField
                .PivotFields(RowName).Orientation = xlRowField
                .PivotFields(ColumnName).Orientation = xlColumnField
                .PivotFields(DataName).Orientation = xlDataField
        End With
ActiveWorkbook.Sheets("Reports").Activate
        If frmGenerateReports.Sales <> "Model" Then
PvtTable.PivotSelect "", xlDataOnly
Selection.NumberFormat = "$#, ##0"
        End If
Range("E1").Select

End Sub

Sub ConsolidateData(ThisMonth)
Dim BeenThere As Boolean
Dim Compare As String
Dim Sheet As Worksheet

BeenThere = False
Sheets.Add
ActiveSheet.Name = "Reports"
        If frmGenerateReports.Period = "Month" Then
                Select Case ThisMonth
                        Case "Jan"
                                ThisMonth = 1
                        Case "Feb"
                                ThisMonth = 2
                        Case "Mar"
                                ThisMonth = 3
                        Case "Apr"
                                ThisMonth = 4
                        Case "May"
                                ThisMonth = 5
                        Case "Jun"
                                ThisMonth = 6
                        Case "Jul"
                                ThisMonth = 7
                        Case "Aug"
                                ThisMonth = 8
                        Case "Sep"
                                ThisMonth = 9
                        Case "Oct"
                                ThisMonth = 10
                        Case "Nov"
                                ThisMonth = 11
                        Case "Dec"
                                ThisMonth = 12
                End Select
        End If

                Select Case frmGenerateReports.Period
                        Case "Month"
                                For Each Sheet In Worksheets
                                        Sheet.Select
                                        Compare = ActiveSheet.Name
                                On Error Resume Next
                                Compare = Month(CDate(Compare))
                                        If Compare = ThisMonth Then
                                                frmGenerateReports.StartDate = Sheet.Name
                                                If BeenThere = False Then
                                                        GrabCells 1
                                                        BeenThere = True
                                                Else
                                                        GrabCells 2
                                                        DoEvents
                                                End If
                                        End If
                                Next
                        Case "All"
                                GrabCells 1
                                Do
                                        frmGenerateReports.StartDate = frmGenerateReports.StartDate + 1
                                        GrabCells 2
                                        DoEvents
                                Loop Until frmGenerateReports.StartDate = frmGenerateReports.EndDate
                        Columns("A:J").EntireColumn.AutoFit
                        Range("A1").Select
                        Case "Other"
                        GrabCells 1
                        Do
                                frmGenerateReports.StartDate = frmGenerateReports.StartDate + 1
                                GrabCells 2
                                DoEvents
                        Loop Until frmGenerateReports.StartDate = frmGenerateReports.EndDate
                        Columns("A:J").EntireColumn.AutoFit
                        Range("A1").Select

        End Select

End Sub

Sub GrabCells(StartingCell)
    Dim CallDate, Where, Where2 As String

    CallDate = Format(frmGenerateReports.StartDate, "d-mmm-yy")
    Sheets(CallDate).Select
        If Range("A2").Value <> Empty Then
                Where = "B" & StartingCell
                Where2 = "J" & StartingCell
                Range(Where, Range(Where2).End(xlDown)).Select
                Application.CutCopyMode = False
                Selection.Copy
                Range("A1").Select
                Sheets("Reports").Select
                ActiveSheet.Paste
                Range("A1").End(xlDown).Offset(1).Select
        Else
                If StartingCell = 1 Then
                        Application.CutCopyMode = False
                        Range("B1:J1").Select
                        Selection.Copy
                        Sheets("Reports").Select
                        ActiveSheet.Paste
                        Range("A2").Select
                End If
        End If

End Sub

Sub FinishReport()
    Dim Sheet As Worksheet
    Workbooks.Open Filename:=ThisWorkbook.Path & "\Reports.xlsx"

        For Each Sheet In Worksheets
                Sheet.Select
                Cells.Select
                Selection.Clear
                Range("A1").Select
        Next
    Workbooks("Sales - Fiscal Year1.xlsm").Activate
    Sheets("Reports").Select
    Cells.Select
    Selection.Copy
    Workbooks("Reports.xlsx").Activate
    ActiveSheet.Paste
    Range("A1").Select
    Windows("Sales - Fiscal Year1.xlsm").Activate
    Application.CutCopyMode = False
    ActiveWindow.SelectedSheets.Delete
    Workbooks("Reports.xlsx").Activate
    CreatePivot
    SetFields

End Sub

</code>```

I need to understand the logic behind the solution and why it caused?
So that I can prevent it from happening next time.

Body:
Run-time error '1004': The PivotTable field name is not valid. To create a PivotTable report you must use data that is organized as a list of labeled columns. If you are changing the name of a PivotTable field, you must type a new name for the field.

Here Is my Code?

Please tell me the mistake so I can understand it. also How Can I Correct it?

Option Explicit
Public PageName, RowName, ColumnName, DataName As String

Sub ShowForms()

        frmGenerateReports.Show

End Sub

Sub CreatePivot()

Dim Destination, RangeData As Range

        Set Destination = Worksheets("Reports").Range("A1")
        Set RangeData = Range("A1", Range("I1").End(xlDown))

        ActiveWorkbook.PivotCaches.Create _
                    (SourceType:=xlDatabase, SourceData:=RangeData) _
                    .CreatePivotTable TableDestination:=Destination, TableName:="SalesPivot"

End Sub

Sub SetFields()

Dim PvtTable As PivotTable
Set PvtTable = Worksheets("Reports").PivotTables("SalesPivot")

        With PvtTable
                .PivotFields(PageName).Orientation = xlPageField
                .PivotFields(RowName).Orientation = xlRowField
                .PivotFields(ColumnName).Orientation = xlColumnField
                .PivotFields(DataName).Orientation = xlDataField
        End With
ActiveWorkbook.Sheets("Reports").Activate
        If frmGenerateReports.Sales <> "Model" Then
PvtTable.PivotSelect "", xlDataOnly
Selection.NumberFormat = "$#, ##0"
        End If
Range("E1").Select

End Sub

Sub ConsolidateData(ThisMonth)
Dim BeenThere As Boolean
Dim Compare As String
Dim Sheet As Worksheet

BeenThere = False
Sheets.Add
ActiveSheet.Name = "Reports"
        If frmGenerateReports.Period = "Month" Then
                Select Case ThisMonth
                        Case "Jan"
                                ThisMonth = 1
                        Case "Feb"
                                ThisMonth = 2
                        Case "Mar"
                                ThisMonth = 3
                        Case "Apr"
                                ThisMonth = 4
                        Case "May"
                                ThisMonth = 5
                        Case "Jun"
                                ThisMonth = 6
                        Case "Jul"
                                ThisMonth = 7
                        Case "Aug"
                                ThisMonth = 8
                        Case "Sep"
                                ThisMonth = 9
                        Case "Oct"
                                ThisMonth = 10
                        Case "Nov"
                                ThisMonth = 11
                        Case "Dec"
                                ThisMonth = 12
                End Select
        End If

                Select Case frmGenerateReports.Period
                        Case "Month"
                                For Each Sheet In Worksheets
                                        Sheet.Select
                                        Compare = ActiveSheet.Name
                                On Error Resume Next
                                Compare = Month(CDate(Compare))
                                        If Compare = ThisMonth Then
                                                frmGenerateReports.StartDate = Sheet.Name
                                                If BeenThere = False Then
                                                        GrabCells 1
                                                        BeenThere = True
                                                Else
                                                        GrabCells 2
                                                        DoEvents
                                                End If
                                        End If
                                Next
                        Case "All"
                                GrabCells 1
                                Do
                                        frmGenerateReports.StartDate = frmGenerateReports.StartDate + 1
                                        GrabCells 2
                                        DoEvents
                                Loop Until frmGenerateReports.StartDate = frmGenerateReports.EndDate
                        Columns("A:J").EntireColumn.AutoFit
                        Range("A1").Select
                        Case "Other"
                        GrabCells 1
                        Do
                                frmGenerateReports.StartDate = frmGenerateReports.StartDate + 1
                                GrabCells 2
                                DoEvents
                        Loop Until frmGenerateReports.StartDate = frmGenerateReports.EndDate
                        Columns("A:J").EntireColumn.AutoFit
                        Range("A1").Select

        End Select

End Sub

Sub GrabCells(StartingCell)
    Dim CallDate, Where, Where2 As String

    CallDate = Format(frmGenerateReports.StartDate, "d-mmm-yy")
    Sheets(CallDate).Select
        If Range("A2").Value <> Empty Then
                Where = "B" & StartingCell
                Where2 = "J" & StartingCell
                Range(Where, Range(Where2).End(xlDown)).Select
                Application.CutCopyMode = False
                Selection.Copy
                Range("A1").Select
                Sheets("Reports").Select
                ActiveSheet.Paste
                Range("A1").End(xlDown).Offset(1).Select
        Else
                If StartingCell = 1 Then
                        Application.CutCopyMode = False
                        Range("B1:J1").Select
                        Selection.Copy
                        Sheets("Reports").Select
                        ActiveSheet.Paste
                        Range("A2").Select
                End If
        End If

End Sub

Sub FinishReport()
    Dim Sheet As Worksheet
    Workbooks.Open Filename:=ThisWorkbook.Path & "\Reports.xlsx"

        For Each Sheet In Worksheets
                Sheet.Select
                Cells.Select
                Selection.Clear
                Range("A1").Select
        Next
    Workbooks("Sales - Fiscal Year1.xlsm").Activate
    Sheets("Reports").Select
    Cells.Select
    Selection.Copy
    Workbooks("Reports.xlsx").Activate
    ActiveSheet.Paste
    Range("A1").Select
    Windows("Sales - Fiscal Year1.xlsm").Activate
    Application.CutCopyMode = False
    ActiveWindow.SelectedSheets.Delete
    Workbooks("Reports.xlsx").Activate
    CreatePivot
    SetFields

End Sub

I need to understand the logic behind the solution and why it caused?
So that I can prevent it from happening next time.


问:
Microsoft Graph API - Search email using application permission
I want to search email using Graph API in my own developed application. By referring to these threads - Graph Api: Region is required when request with application permission  ,   How to use Graph API Sharepoint Search from console app   ,   Search content with application permissions    ,   I tried to run the search which resulted in Application permission is only supported for the following entity types:site, list, listItem, drive and driveItem.   (Request and response json is below).

Does it mean that using an app like a console application developed in C# will not be able to search the emails (as message is not mentioned in error response - only these are mentioned: site, list, listItem, drive and driveItem) even if it has required secret, auth token and permissions?

Request:
URL : https://graph.microsoft.com/beta/search/query

Request Payload:

```<code>{
  "requests": [
    {
      "entityTypes": [
        "person"
      ],
      "query": {
        "queryString": "contoso"
      },
      "Region" : "NAM",
      "from": 0,
      "size": 25
    }
  ]
}
</code>```

Response:

```<code>{
    "error": {
        "code": "System.UnauthorizedAccessException",
        "message": "Application permission is only supported for the following entity types:site, list, listItem, drive and driveItem.",
        "target": "",
        "httpCode": 403
    },
    "Instrumentation": {
        "TraceId": "7174e417-a2fe-02e5-1523-1fcda7a66886"
    }
}
</code>```

Body:
I want to search email using Graph API in my own developed application. By referring to these threads - Graph Api: Region is required when request with application permission  ,   How to use Graph API Sharepoint Search from console app   ,   Search content with application permissions    ,   I tried to run the search which resulted in Application permission is only supported for the following entity types:site, list, listItem, drive and driveItem.   (Request and response json is below).

Does it mean that using an app like a console application developed in C# will not be able to search the emails (as message is not mentioned in error response - only these are mentioned: site, list, listItem, drive and driveItem) even if it has required secret, auth token and permissions?

Request:
URL : https://graph.microsoft.com/beta/search/query

Request Payload:

{
  "requests": [
    {
      "entityTypes": [
        "person"
      ],
      "query": {
        "queryString": "contoso"
      },
      "Region" : "NAM",
      "from": 0,
      "size": 25
    }
  ]
}

Response:

{
    "error": {
        "code": "System.UnauthorizedAccessException",
        "message": "Application permission is only supported for the following entity types:site, list, listItem, drive and driveItem.",
        "target": "",
        "httpCode": 403
    },
    "Instrumentation": {
        "TraceId": "7174e417-a2fe-02e5-1523-1fcda7a66886"
    }
}


问:
How to add new user in Azure Data Studio Ubuntu 22.04?
I use Azure Data Studio:

Version: 1.39.1
Commit: 7553f799e175f471b7590302dd65c997b838b29b
Date: 2022-08-30T00:59:13.108Z
VS Code: 1.62.0
Electron: 13.6.6
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.15.0-56-generic

From documentation:

Open Object Explorer.

Click Server_instance_name > Security > Logins.

Right-click Logins and select New Login.

But I see just refresh option.

Where am I wrong and what should I do?


问:
iPhone:Google Place API Key & Data problem
I am working with google place api and I tried so much but google place api does not provided Indian Data. Does google place api provided Indian Data? If yes then please send me any link or any idea to develop this functionality. My google api key will expire after 24hours so Is there any way to increase time limit??

I want to develop following type of map application in iPhone.

Thanks in advance

ContentLicense: CC BY-SA 3.0


问:
HTML/CSS: How to vertically align text in textarea
I have the following textarea and CSS:

#map-title {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  flex: 30%;
  height: 100%;
  resize: none;
  border: 0;
  outline: none;
  text-align: center;
}```
<pre class="snippet-code-html lang-html prettyprint-override"><code><textarea id="map-title" type="text" name="title" maxlength="50" wrap="hard" cols="25" rows="2">The text-align property has allowed the text to be centred horizontally, but I want it to also be centered vertically so that, regardless of the number of lines of text, the middle line will always be in the middle of the textarea. I suspect I should use padding, but it would need to adjust based on the size and amount of text on the screen, which I'm not sure how to handle (and I would prefer using only CSS if possible).</textarea></code>```

The text-align property has allowed the text to be centred horizontally, but I want it to also be centered vertically so that, regardless of the number of lines of text, the middle line will always be in the middle of the textarea. I suspect I should use padding, but it would need to adjust based on the size and amount of text on the screen, which I'm not sure how to handle (and I would prefer using only CSS if possible).

Body:
I have the following textarea and CSS:

#map-title {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: bold;
  flex: 30%;
  height: 100%;
  resize: none;
  border: 0;
  outline: none;
  text-align: center;
}

<textarea id="map-title" type="text" name="title" maxlength="50" wrap="hard" cols="25" rows="2">The text-align property has allowed the text to be centred horizontally, but I want it to also be centered vertically so that, regardless of the number of lines of text, the middle line will always be in the middle of the textarea. I suspect I should use padding, but it would need to adjust based on the size and amount of text on the screen, which I'm not sure how to handle (and I would prefer using only CSS if possible).</textarea>

The text-align property has allowed the text to be centred horizontally, but I want it to also be centered vertically so that, regardless of the number of lines of text, the middle line will always be in the middle of the textarea. I suspect I should use padding, but it would need to adjust based on the size and amount of text on the screen, which I'm not sure how to handle (and I would prefer using only CSS if possible).


问:
How can I make a hover that changes the color in the mesh of a group of meshes? react-three-fiber
I'm trying to do something similar to this example https://codesandbox.io/s/svg-maps-with-html-annotations-forked-p8bgbk this is inside a group and I don't know how I can work on the mesh attributes HELP!
`

```<code>import React, { useRef, useState  } from 'react'
import { useGLTF, useCursor } from '@react-three/drei'
import {useSpring} from '@react-spring/three'
import { useSnapshot, useProxy } from "valtio";
import state from './Status';`your text`

export default function Model(props) {
  const { nodes, materials } = useGLTF('models/capital_city.glb')
  const ref = useRef();
  const snap = useSnapshot(state)
  const [hovered, hover] = useState(false)
  useCursor(hovered)
  return (
    <group  ref={ref} {...props} dispose={null} rotateX={Math.PI/2} scale={0.2}
      //onPointerOver={(e) => console.log(e.object.material.name) }
      onPointerOver={(e) => {e.stopPropagation(), hover(e.object.material.name)}}
      onPointerOut={(e) => hover(false)}
    >

      <mesh geometry={nodes.Proyectos_01.geometry } material={materials.lambert49 } />
      <mesh geometry={nodes.Proyectos_02.geometry} material={materials.lambert14}/>
      <mesh geometry={nodes.Proyectos_03.geometry} material={materials.lambert77} />
      <mesh geometry={nodes.Proyectos_04.geometry} material={materials.lambert4} />
      <mesh geometry={nodes.Proyectos_05.geometry} material={materials.lambert38} />
      <mesh geometry={nodes.Proyectos_06.geometry} material={materials.lambert53} />
      <mesh geometry={nodes.Proyectos_07.geometry} material={materials.lambert65} />
      <mesh geometry={nodes.Proyectos_08.geometry} material={materials.lambert73} />
      <mesh geometry={nodes.Proyectos_09.geometry} material={materials.lambert45} />
      <mesh geometry={nodes.Proyectos_10.geometry} material={materials.lambert116} />
      <mesh geometry={nodes.Proyectos_100.geometry} material={materials.lambert59} />

    </group>
  )
}

//useGLTF.preload('/models/capital_city.glb')
</code>```

`

Body:
I'm trying to do something similar to this example https://codesandbox.io/s/svg-maps-with-html-annotations-forked-p8bgbk this is inside a group and I don't know how I can work on the mesh attributes HELP!
`

import React, { useRef, useState  } from 'react'
import { useGLTF, useCursor } from '@react-three/drei'
import {useSpring} from '@react-spring/three'
import { useSnapshot, useProxy } from "valtio";
import state from './Status';`your text`

export default function Model(props) {
  const { nodes, materials } = useGLTF('models/capital_city.glb')
  const ref = useRef();
  const snap = useSnapshot(state)
  const [hovered, hover] = useState(false)
  useCursor(hovered)
  return (
    <group  ref={ref} {...props} dispose={null} rotateX={Math.PI/2} scale={0.2}
      //onPointerOver={(e) => console.log(e.object.material.name) }
      onPointerOver={(e) => {e.stopPropagation(), hover(e.object.material.name)}}
      onPointerOut={(e) => hover(false)}
    >

      <mesh geometry={nodes.Proyectos_01.geometry } material={materials.lambert49 } />
      <mesh geometry={nodes.Proyectos_02.geometry} material={materials.lambert14}/>
      <mesh geometry={nodes.Proyectos_03.geometry} material={materials.lambert77} />
      <mesh geometry={nodes.Proyectos_04.geometry} material={materials.lambert4} />
      <mesh geometry={nodes.Proyectos_05.geometry} material={materials.lambert38} />
      <mesh geometry={nodes.Proyectos_06.geometry} material={materials.lambert53} />
      <mesh geometry={nodes.Proyectos_07.geometry} material={materials.lambert65} />
      <mesh geometry={nodes.Proyectos_08.geometry} material={materials.lambert73} />
      <mesh geometry={nodes.Proyectos_09.geometry} material={materials.lambert45} />
      <mesh geometry={nodes.Proyectos_10.geometry} material={materials.lambert116} />
      <mesh geometry={nodes.Proyectos_100.geometry} material={materials.lambert59} />

    </group>
  )
}

//useGLTF.preload('/models/capital_city.glb')

`


问:
How to change from command line the Bundle identifier of an App extension?
I have an app extension that I want to use in several projects that all have different bundle identifiers. The problem is that App extension bundle identifiers must have a prefix consisting of their containing application's bundle identifier followed by a '.'. Is there a way to change via a command line tool the bundle identifier of the app extension? something similar to what we can do with codesign to change the signature of an app? I'm under Delphi so I do not use xcode to develop my app (but the app extension is made with xcode)</p>


问:
Update one column in every row with a random value SQL
I have a table Lottery with columns:

Name

Ticket_number

I insert x number of names into this table, with the Ticket_number being NULL or 0. Then I want to loop over this table and randomize a number to update Ticket(Ticket_number) with that number.

I've read about cursors but don't really get it. I also saw something like "while SELECT * FROM Lottery exists, do stuff" but it requires you to delete rows, as it otherwise would infinite loop, no?

Anyone got any idea?

Cheers, hope it was somewhat clear.


问:
JWT is successfully generated though it returns empty object{}
I'm generating a JWT and it was successfully generated and saved to my MongoDB document. According to my code, it should render my login page (res.render("login")) but it's not working as planned. Here is my model file. I used middleware here like this:

```<code>const mongoose  = require("mongoose");
const bcrypt = require("bcryptjs")
const jwt = require("jsonwebtoken")
.
.
.
.
.
.

 tokens:[{
        token:{
            type:String,
            required: true
        }
    }]
})

// generating JWT...........

employeeSchema.methods.generateAuthToken = async function(){
    try {
        const generateToken = jwt.sign({_id:this._id}, "hjuytftyghujikhyuijkiuytrftyghuj");

        this.tokens = this.tokens.concat({token:generateToken})

        //console.log(generateToken);

        await this.save();
        return token;
    } catch (error) {
        res.send(`the error is found ${error}`)
        console.log(`the error is found ${error}`)

    }
}

employeeSchema.pre("save", async function(next) {

    if(this.isModified("password")){

    this.password = await bcrypt.hash("this.password", 10)

    this.confirmpassword = await bcrypt.hash("this.password", 10)

    }
    next()
})

// create collection............
const Register = new mongoose.model("Register", employeeSchema);

module.exports = Register;

</code>```

Acording to my app.js it should render my login page once registration is complete--but nothing happens as my code returns an empty object in the DOM but the JWT token is successfully generated.

```<code>const express = require("express")
const app = express();
const path = require("path")
require("./db/connect")
const hbs = require("hbs")
const Register = require("./model/dataschema")
const bcrypt = require("bcryptjs")
const jwt = require("jsonwebtoken")
.
.
.
.
.
.
.
app.post("/register", async(req,res)=>{
    try {
        const password = req.body.password;    // condition if password are matching than save our date either throw error :)
        const cpassword = req.body.confirmpassword;
        if(password == cpassword){
          const registerEmployee = new Register({
            firstname: req.body.firstname,
            lastname: req.body.lastname,
            email: req.body.email,
            gender: req.body.gender,
            phone: req.body.phone,
            age: req.body. age,
            password: req.body.password,
            confirmpassword: req.body.confirmpassword,
          })

          const token = await registerEmployee.generateAuthToken();

          const savingData = await registerEmployee.save();

          res.status(201).render("login")
        }else{
            res.send("password are not match")
        }
    } catch (error) {
        res.status(400).send(error)
    }
})

</code>```

so guys please check out my code and let me know what's wrong.

Body:
I'm generating a JWT and it was successfully generated and saved to my MongoDB document. According to my code, it should render my login page (res.render("login")) but it's not working as planned. Here is my model file. I used middleware here like this:

const mongoose  = require("mongoose");
const bcrypt = require("bcryptjs")
const jwt = require("jsonwebtoken")
.
.
.
.
.
.

 tokens:[{
        token:{
            type:String,
            required: true
        }
    }]
})

// generating JWT...........

employeeSchema.methods.generateAuthToken = async function(){
    try {
        const generateToken = jwt.sign({_id:this._id}, "hjuytftyghujikhyuijkiuytrftyghuj");

        this.tokens = this.tokens.concat({token:generateToken})

        //console.log(generateToken);

        await this.save();
        return token;
    } catch (error) {
        res.send(`the error is found ${error}`)
        console.log(`the error is found ${error}`)

    }
}

employeeSchema.pre("save", async function(next) {

    if(this.isModified("password")){

    this.password = await bcrypt.hash("this.password", 10)

    this.confirmpassword = await bcrypt.hash("this.password", 10)

    }
    next()
})

// create collection............
const Register = new mongoose.model("Register", employeeSchema);

module.exports = Register;

Acording to my app.js it should render my login page once registration is complete--but nothing happens as my code returns an empty object in the DOM but the JWT token is successfully generated.

const express = require("express")
const app = express();
const path = require("path")
require("./db/connect")
const hbs = require("hbs")
const Register = require("./model/dataschema")
const bcrypt = require("bcryptjs")
const jwt = require("jsonwebtoken")
.
.
.
.
.
.
.
app.post("/register", async(req,res)=>{
    try {
        const password = req.body.password;    // condition if password are matching than save our date either throw error :)
        const cpassword = req.body.confirmpassword;
        if(password == cpassword){
          const registerEmployee = new Register({
            firstname: req.body.firstname,
            lastname: req.body.lastname,
            email: req.body.email,
            gender: req.body.gender,
            phone: req.body.phone,
            age: req.body. age,
            password: req.body.password,
            confirmpassword: req.body.confirmpassword,
          })

          const token = await registerEmployee.generateAuthToken();

          const savingData = await registerEmployee.save();

          res.status(201).render("login")
        }else{
            res.send("password are not match")
        }
    } catch (error) {
        res.status(400).send(error)
    }
})

so guys please check out my code and let me know what's wrong.


问:
Adding custom setting in plyr
I'd like to add a custom option to the settings that will set a variable value

For the sake of the argument, let's say it's theme, with the options: light, dark and blue

It will open up the regular settings options with Theme listed and 'Light' as the default value

When the options are opened it shows

Light

Dark

Blue

with the back button.

Then when one of the buttons are clicked, there is an event where I set the variable value, let's say themeValue='dark'

I thought this would be simple to do but can't find any documentation or working examples. Is this possible/documented anywhere? Thanks

Title: Adding custom setting in plyr


问:
Using TextKit 2 to display tables in UITextView
UITextView does not support any kind of tables, but I'm trying to create a text view implementation which would be able to show tables alongside normal text.

Basically: My macOS port uses NSTextTable to render some paragraphs next to each other when creating a PDF. I'm trying to come up with a way to achieve this on iOS.

Documentation and real-world implementations of TextKit 2 are still a bit hazy, but I'm interested if it would be possible to create my own content types using NSTextElement and NSTextElementProvider. If I'm reading it correctly, I'd define a range which is governed by my own implementation/layout?

As the documentation is so sparse, I'm very unsure how to actually implement an NSTextElement which would also be rendered as text when saved as a PDF — or if any of this would even be possible.

Any help or hints would be appreciated.


问:
A button or link changing color after visiting and signing up (a:visited does not work in this situation)
I am working on a hostel room booking, and I am designing it in a way that when someone selects a room and registers, the room number should change color so that someone else won't choose the same room. Any help please.

I tried using a:visited but I realised anyone can just tap on a room without actually registering and the change of color here would not be necessary.


问:
Vue transition rendering
Im using <transition> in Vue for traversing between pages, im also using animation for the transition between them but the animation looks like "lagging", how can i change to make it look smooth? I also used will-change but it did not make any changes..

The code:

```<code>    <div v-if="show">
      <div>
        <div class="ahmed-text">
          <!-- <router-link :to="{ name: 'Home' }"> -->
            <img @click="postTransport" class="name" src="https://firebasestorage.googleapis.com/v0/b/projekt-sv.appspot.com/o/documents%2Fnamelog.svg?alt=media&token=92da84bc-4bd1-4f47-b955-06a7b7008e26"/>
            <!-- </router-link> -->
         </div>
        </div>
      </div>
    </transition>

.mainImage-enter-from{
  animation-duration: 2.2s;
  animation-name: slidein;
}
.mainImage-enter-active{
  animation-duration: 2.2s;
  animation-name: slidein;
}
.mainImage-leave-to{
  animation-duration: 2.2s;
  animation-name: slideout;
}
.mainImage-leave-active{
  animation-duration: 2.2s;
  animation-name: slideout;
}

 /**------Key - Main anim------**/

@keyframes slidein {
  0% {
    transform: translateX(130%);
    width: 100%;
  }

  100% {
    transform: translateX(0%);
    width: 100%;
  }
}

@keyframes slideout {
  0% {
    transform: translateX(0%);
    width: 100%;
  }

  100% {
    transform: translateX(68%);
    width: 100%;
  }
}
 .ahmed-text{
     will-change: transform, opacity;
 }```
```

Title: Vue transition rendering

Body:
Im using <transition> in Vue for traversing between pages, im also using animation for the transition between them but the animation looks like "lagging", how can i change to make it look smooth? I also used will-change but it did not make any changes..

The code:

    </transition>

.mainImage-enter-from{
  animation-duration: 2.2s;
  animation-name: slidein;
}
.mainImage-enter-active{
  animation-duration: 2.2s;
  animation-name: slidein;
}
.mainImage-leave-to{
  animation-duration: 2.2s;
  animation-name: slideout;
}
.mainImage-leave-active{
  animation-duration: 2.2s;
  animation-name: slideout;
}

 /**------Key - Main anim------**/

@keyframes slidein {
  0% {
    transform: translateX(130%);
    width: 100%;
  }

  100% {
    transform: translateX(0%);
    width: 100%;
  }
}

@keyframes slideout {
  0% {
    transform: translateX(0%);
    width: 100%;
  }

  100% {
    transform: translateX(68%);
    width: 100%;
  }
}
 .ahmed-text{
     will-change: transform, opacity;
 }```


问:
How to detect when text has been selected in WKWebView?
I use WKWebView and javascript to parse and show text in my app. And I want to detect when text in my webView was selected and show message. How to do this? Im trying something like this but I only get a message when I touch the screen. But not when the text was selected.

```<code>webView.configuration.userContentController.add(self, name: "newSelectionDetected")
let scriptString = """
    function getSelectionAndSendMessage()
    {
        var txt = document.getSelection().toString() ;
        window.webkit.messageHandlers.newSelectionDetected.postMessage(txt);
    }
    document.onmouseup = getSelectionAndSendMessage;
    document.onkeyup = getSelectionAndSendMessage;
    document.oncontextmenu = getSelectionAndSendMessage;
"""
let script = WKUserScript(source: scriptString, injectionTime: .atDocumentEnd, forMainFrameOnly: true)
webView.configuration.userContentController.addUserScript(script)
</code>```
```<code>func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
    // Use message.body here
}
</code>```

Body:
I use WKWebView and javascript to parse and show text in my app. And I want to detect when text in my webView was selected and show message. How to do this? Im trying something like this but I only get a message when I touch the screen. But not when the text was selected.

webView.configuration.userContentController.add(self, name: "newSelectionDetected")
let scriptString = """
    function getSelectionAndSendMessage()
    {
        var txt = document.getSelection().toString() ;
        window.webkit.messageHandlers.newSelectionDetected.postMessage(txt);
    }
    document.onmouseup = getSelectionAndSendMessage;
    document.onkeyup = getSelectionAndSendMessage;
    document.oncontextmenu = getSelectionAndSendMessage;
"""
let script = WKUserScript(source: scriptString, injectionTime: .atDocumentEnd, forMainFrameOnly: true)
webView.configuration.userContentController.addUserScript(script)

func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
    // Use message.body here
}


问:
Heroku out-of-memory errors but never close to the limit
I have a production Node.JS Express API running on Heroku.

I have been receiving H13 (Connection closed without response) and H27 (Client Request Interrupted) errors a few times a day for a while now (several months). I have tried:

tracking down and fixing any obvious big memory leaks that my app could've had

This package (based on Heroku's official guidance on fixing memory leaks): heroku-node-settings

Bumping up my Dyno from 512 RAM to 1GB RAM.

The result is that the Memory Usage section of Metrics no longer shows any exceeding memory usage (max total is around 600MB out of 1GB):

However the errors are still there once or twice a day, and after inspecting the logs from Coralogix, they still seem to be memory-related:

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap

and

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
out of memory

Checking the logs right before (or after) these JS memory allocation errors dont't point to anything helpful.. just some random /GETs..

My question is, how is it possible to have these types of Out of Memory errors whilst the Heroku Metrics graph only shows a maximum of 600-650MB of RAM used? And what other steps could I take to try and fix these types of issues? Thanks.


问:
Uncaught Error: Dropzone already attached reactjs
I am using Creative Tim's material dashboard pro kit. In my React project.

I need to create a dropzone to upload CSV files.

This UI kit already provides a ready-to-use component for dropzone named MDDropzone.

But I am facing one issue: whenever I reload the page, I get an Uncaught Error: Dropzone already attached error on the console and the page went blank.

MDDropzone.js file -

```<code>function MDDropzone({ options }) {
  const [controller] = useMaterialUIController();
  const { darkMode } = controller;

  const dropzoneRef = useRef();

  useEffect(() => {
    Dropzone.autoDiscover = false;

    function createDropzone() {
      return new Dropzone(dropzoneRef.current, { ...options });
    }

    function removeDropzone() {
      if (Dropzone.instances.length > 0) Dropzone.instances.forEach((dz) => dz.destroy());
    }

    createDropzone();

    return () => removeDropzone();
  }, [options]);

  return (
    <MDDropzoneRoot
      component="form"
      action="/file-upload"
      ref={dropzoneRef}
      className="form-control dropzone"
      ownerState={{ darkMode }}
    >
      <MDBox className="fallback" bgColor="transparent">
        <MDBox component="input" name="file" type="file" multiple />
      </MDBox>
    <requiredeRoot>
  );
}

// Typechecking props for the MDDropzone
MDDropzone.propTypes = {
  options: PropTypes.objectOf(PropTypes.any).isRequired,
};

export default MDDropzone;
</code>```

File where I am using this component -

```<code>function Test() {
  return (
    <div>
      Testing Dropzone
      <MDDropzone options={{ addRemoveLinks: true }} />
    </div>
  );
}
</code>```

I believe I am missing something. Anyone can please help me out

Body:
I am using Creative Tim's material dashboard pro kit. In my React project.

I need to create a dropzone to upload CSV files.

This UI kit already provides a ready-to-use component for dropzone named MDDropzone.

But I am facing one issue: whenever I reload the page, I get an Uncaught Error: Dropzone already attached error on the console and the page went blank.

MDDropzone.js file -

function MDDropzone({ options }) {
  const [controller] = useMaterialUIController();
  const { darkMode } = controller;

  const dropzoneRef = useRef();

  useEffect(() => {
    Dropzone.autoDiscover = false;

    function createDropzone() {
      return new Dropzone(dropzoneRef.current, { ...options });
    }

    function removeDropzone() {
      if (Dropzone.instances.length > 0) Dropzone.instances.forEach((dz) => dz.destroy());
    }

    createDropzone();

    return () => removeDropzone();
  }, [options]);

  return (
    <MDDropzoneRoot
      component="form"
      action="/file-upload"
      ref={dropzoneRef}
      className="form-control dropzone"
      ownerState={{ darkMode }}
    >
      <MDBox className="fallback" bgColor="transparent">
        <MDBox component="input" name="file" type="file" multiple />
      </MDBox>
    <requiredeRoot>
  );
}

// Typechecking props for the MDDropzone
MDDropzone.propTypes = {
  options: PropTypes.objectOf(PropTypes.any).isRequired,
};

export default MDDropzone;

File where I am using this component -

function Test() {
  return (

      Testing Dropzone
      <MDDropzone options={{ addRemoveLinks: true }} />

  );
}

I believe I am missing something. Anyone can please help me out


问:
Disable seeking of seekbar , but show current seek position of video in exoplayer
I am using

```<code>StyledPlayerView
</code>```

for showing video in my app , I have customized the

```<code>exo_styled_player_control_view
</code>```

according to my need. I need to show only the play pause button and the seekbar of the video. I have managed to achieve it but the issue is user can click on the seekbar and drag it and seek the video. I want to disable the seeking part, is there any way to do it?

i tried changing the ID from exo_progress_placeholder to exo_buffering but it didn't worked.

Body:
I am using

StyledPlayerView

for showing video in my app , I have customized the

exo_styled_player_control_view

according to my need. I need to show only the play pause button and the seekbar of the video. I have managed to achieve it but the issue is user can click on the seekbar and drag it and seek the video. I want to disable the seeking part, is there any way to do it?

i tried changing the ID from exo_progress_placeholder to exo_buffering but it didn't worked.


问:
Google Analytics Data API V1 (GA4 property) - wrong API report results when including an event-specific conversions count metric
I'm migrating an app from the Reporting API V4 to the new Data API V1 to support GA4 properties.

While the sessions metric aggregation is usually a few sessions off when adding multiple dimensions or requesting multiple days, adding an event-specific conversions count metric to the report request produces a considerable increase in the number of sessions on the result rows - by a factor of ~4x from my empiric observations.

Request JSON with only the sessions metric and the date dimension:

```<code>{"dimensions":[{"name":"date"}],"metrics":[{"name":"sessions"}],"dateRanges":[{"startDate":"2022-12-01","endDate":"2022-12-01"}],"metricAggregations":["TOTAL"]}
</code>```

Results: 612 sessions on the response row | 612 sessions in Metric Aggregations

Request JSON with the additional conversions:purchase metric:

```<code>{"dimensions":[{"name":"date"}],"metrics":[{"name":"sessions"},{"name":"conversions:purchase"}],"dateRanges":[{"startDate":"2022-12-01","endDate":"2022-12-01"}],"metricAggregations":["TOTAL"]}
</code>```

Results: 2527 sessions on the response row | 612 sessions in Metric Aggregations

Note: this behavior is consistent throughout multiple properties, even for those with no conversions:purchase events.

Is this an API bug, or am I missing something? Is there something I can do to get accurate results?

Body:
I'm migrating an app from the Reporting API V4 to the new Data API V1 to support GA4 properties.

While the sessions metric aggregation is usually a few sessions off when adding multiple dimensions or requesting multiple days, adding an event-specific conversions count metric to the report request produces a considerable increase in the number of sessions on the result rows - by a factor of ~4x from my empiric observations.

Request JSON with only the sessions metric and the date dimension:

{"dimensions":[{"name":"date"}],"metrics":[{"name":"sessions"}],"dateRanges":[{"startDate":"2022-12-01","endDate":"2022-12-01"}],"metricAggregations":["TOTAL"]}

Results: 612 sessions on the response row | 612 sessions in Metric Aggregations

Request JSON with the additional conversions:purchase metric:

{"dimensions":[{"name":"date"}],"metrics":[{"name":"sessions"},{"name":"conversions:purchase"}],"dateRanges":[{"startDate":"2022-12-01","endDate":"2022-12-01"}],"metricAggregations":["TOTAL"]}

Results: 2527 sessions on the response row | 612 sessions in Metric Aggregations

Note: this behavior is consistent throughout multiple properties, even for those with no conversions:purchase events.

Is this an API bug, or am I missing something? Is there something I can do to get accurate results?


问:
Representing a set in a Django model
I have a use case when a Django model class can have any of a specified set of values. If it weren't a Django model, I'd do something like:

```<code>attr_list = ['green', 'blue', 'fuzzy', 'smooth']

class my_model:
    def __init__(self, attrs=None):
        self._attrs = set(attrs)

    def quality(self, attr):
        return attr in self._attrs

obj = my_model(['green', 'fuzzy'])

if obj.quality('green'):
    print("It's green")
</code>```

But in Django, the only options seem to be a class that represents the link between the model and the quality, with a class that just has one attribute holding the quality value:

```<code>class QualityLink(models.Model):
    quality = models.CharField(
        choices=[('green', 'Green'), ...]
        ...)
    parent = models.ForeignKey(MyModel, ...)
</code>```

or, if I want to avoid the overhead of a bunch of database accesses, unwinding the values:

```<code>class MyModel(models.Model):
    is_green = models.BooleanField(...)
    is_blue = models.BooleanField(...)
    is_fuzzy = models.BooleanField(...)
    is_smooth = models.BooleanField(...)
</code>```

Neither of these seems like a very good approach. The first seems inefficient and the second way too clunky. Am I missing something?

Title: Representing a set in a Django model

Body:
I have a use case when a Django model class can have any of a specified set of values. If it weren't a Django model, I'd do something like:

attr_list = ['green', 'blue', 'fuzzy', 'smooth']

class my_model:
    def __init__(self, attrs=None):
        self._attrs = set(attrs)

    def quality(self, attr):
        return attr in self._attrs

obj = my_model(['green', 'fuzzy'])

if obj.quality('green'):
    print("It's green")

But in Django, the only options seem to be a class that represents the link between the model and the quality, with a class that just has one attribute holding the quality value:

class QualityLink(models.Model):
    quality = models.CharField(
        choices=[('green', 'Green'), ...]
        ...)
    parent = models.ForeignKey(MyModel, ...)

or, if I want to avoid the overhead of a bunch of database accesses, unwinding the values:

class MyModel(models.Model):
    is_green = models.BooleanField(...)
    is_blue = models.BooleanField(...)
    is_fuzzy = models.BooleanField(...)
    is_smooth = models.BooleanField(...)

Neither of these seems like a very good approach. The first seems inefficient and the second way too clunky. Am I missing something?


问:
Wordpress REST API fails with Python
I've written a simple Python script to upload an image to a WP site:

```<code>import requests
import base64

BASE_URL = "https://example.com/wp-json/wp/v2"

media = {
"file": open("image.png", "rb"),
"caption": "a media file",
"description": "some media file"
}
creds = "wp_admin_user" + ":" + "app password"
token = base64.b64encode(creds.encode())
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko)              Chrome/41.0.2228.0 Safari/537.36",
"Authorization":"Basic " + token.decode("utf-8")
}
r = requests.post(BASE_URL + "/media", headers=header, files=media)

print(r)
</code>```

When using Python 3.9 on Windows, everything works as expected: I get a <Response [201]> reply and I can see the image in my site's media library.

When running the exact same script on a Linux, it fails with a 503 reply from the WP server:

<Response [503]>

The Linux is running Python 3.9.1

I can run the script again on Windows ten times, and it always works. I've searched the internets for the error and it's usually a WP configuration error, which doesn't seem to be the case here as the script works on Windows.

Any help is much appreciated!

I think that the problem is in the ip of the server where it hangs Linux

Title: Wordpress REST API fails with Python

Body:
I've written a simple Python script to upload an image to a WP site:

import requests
import base64

BASE_URL = "https://example.com/wp-json/wp/v2"

media = {
"file": open("image.png", "rb"),
"caption": "a media file",
"description": "some media file"
}
creds = "wp_admin_user" + ":" + "app password"
token = base64.b64encode(creds.encode())
header = {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko)              Chrome/41.0.2228.0 Safari/537.36",
"Authorization":"Basic " + token.decode("utf-8")
}
r = requests.post(BASE_URL + "/media", headers=header, files=media)

print(r)

When using Python 3.9 on Windows, everything works as expected: I get a <Response [201]> reply and I can see the image in my site's media library.

When running the exact same script on a Linux, it fails with a 503 reply from the WP server:

<Response [503]>

The Linux is running Python 3.9.1

I can run the script again on Windows ten times, and it always works. I've searched the internets for the error and it's usually a WP configuration error, which doesn't seem to be the case here as the script works on Windows.

Any help is much appreciated!

I think that the problem is in the ip of the server where it hangs Linux


问:
logback with MDC: Using multiple custom blocks instead of one mdc block for custom key values
I'm using Java and logback in my application, as well as MDC to log custom key-values. i way, to have my logged key-values pairs to be unders two blocks, instead of having them all unders MDC block ?

Example:

```<code>{
  "timestamp" : "2022-12-19 10:17:05.460",
  "level" : "INFO",
  "thread" : "XNIO-1 task-1",
  "logger" : "ca.bnc.cybercriminalite.fraud.service.check.FraudCheckService",
  "message" : "Calling IFM to evaluate request: localhost:9999",
  "server": {
    "url" : "http://example.com",
    "port" : "2310",
  },
  "transactionInfo": {
    "request_Id" : "abcd-1234",
    "EndToEndId" : "1234567"
  },
  "context" : "fraud_check.ifm.request"
}
</code>```

instead of:

```<code>{
  "timestamp" : "2022-12-19 10:17:05.460",
  "level" : "INFO",
  "thread" : "XNIO-1 task-1",
  "logger" : "ca.bnc.cybercriminalite.fraud.service.check.FraudCheckService",
  "message" : "Calling IFM to evaluate request: localhost:9999",
  "mdc": {
    "url" : "http://example.com",
    "port" : "2310",
    "request_Id" : "abcd-1234",
    "EndToEndId" : "1234567"
  },
  "context" : "fraud_check.ifm.request"
}
</code>```

Body:
I'm using Java and logback in my application, as well as MDC to log custom key-values. i way, to have my logged key-values pairs to be unders two blocks, instead of having them all unders MDC block ?

Example:

{
  "timestamp" : "2022-12-19 10:17:05.460",
  "level" : "INFO",
  "thread" : "XNIO-1 task-1",
  "logger" : "ca.bnc.cybercriminalite.fraud.service.check.FraudCheckService",
  "message" : "Calling IFM to evaluate request: localhost:9999",
  "server": {
    "url" : "http://example.com",
    "port" : "2310",
  },
  "transactionInfo": {
    "request_Id" : "abcd-1234",
    "EndToEndId" : "1234567"
  },
  "context" : "fraud_check.ifm.request"
}

instead of:

{
  "timestamp" : "2022-12-19 10:17:05.460",
  "level" : "INFO",
  "thread" : "XNIO-1 task-1",
  "logger" : "ca.bnc.cybercriminalite.fraud.service.check.FraudCheckService",
  "message" : "Calling IFM to evaluate request: localhost:9999",
  "mdc": {
    "url" : "http://example.com",
    "port" : "2310",
    "request_Id" : "abcd-1234",
    "EndToEndId" : "1234567"
  },
  "context" : "fraud_check.ifm.request"
}


问:
Multiprocessing - cannot pickle '_thread.RLock' object
I try to parrallelize a function which predict different ARIMA model in order to have a kind of gridsearch but I get an error when I run my code. The error is : cannot pickle '_thread.RLock' object.

```<code>def forecast_accuracy(Model, forecast, actual):
    mape = np.mean(np.abs(forecast - actual)/np.abs(actual))  # MAPE
    me = np.mean(forecast - actual)             # ME
    mae = np.mean(np.abs(forecast - actual))    # MAE
    mpe = np.mean((forecast - actual)/actual)   # MPE
    rmse = np.mean((forecast - actual)**2)**.5  # RMSE
    corr = np.corrcoef(forecast, actual)[0,1]   # corr
    mins = np.amin(np.hstack([forecast[:,None],
                              actual[:,None]]), axis=1)
    maxs = np.amax(np.hstack([forecast[:,None],
                              actual[:,None]]), axis=1)
    minmax = 1 - np.mean(mins/maxs)             # minmax

    return({'Model':Model,'mape':mape, 'me':me, 'mae': mae, 'mpe': mpe,
            'rmse':rmse, 'corr':corr, 'mins':mins, 'maxs':maxs, 'minmax':minmax})

def metrics_ARIMA(models_ARIMA, train_arima, test_arima):
    dfmetrics_ARIMA = pd.DataFrame(columns=["Model", "mape", "me", "mae", "mpe", "rmse", "corr", "minmax"])
    for i in range(0,6):
        for j in range(0,6):
            dfmetrics_ARIMA = dfmetrics_ARIMA.append(forecast_accuracy(f"ARIMA{i}{d_optimum}{j}", models_ARIMA[f"ARIMA{i}{d_optimum}{j}"].predict(len(train_arima), len(train_arima)+len(test_arima)-1, typ='levels'), test_arima), ignore_index=True)
    return dfmetrics_ARIMA
</code>```

After that, I run :

```<code>with concurrent.futures.ThreadPoolExecutor() as executor:
    metrics_ARIMA = executor.submit(metrics_ARIMA, models_ARIMA, train_arima, test_arima)
    metrics_ARIMA = metrics_ARIMA.result()
</code>```

Body:
I try to parrallelize a function which predict different ARIMA model in order to have a kind of gridsearch but I get an error when I run my code. The error is : cannot pickle '_thread.RLock' object.

def forecast_accuracy(Model, forecast, actual):
    mape = np.mean(np.abs(forecast - actual)/np.abs(actual))  # MAPE
    me = np.mean(forecast - actual)             # ME
    mae = np.mean(np.abs(forecast - actual))    # MAE
    mpe = np.mean((forecast - actual)/actual)   # MPE
    rmse = np.mean((forecast - actual)**2)**.5  # RMSE
    corr = np.corrcoef(forecast, actual)[0,1]   # corr
    mins = np.amin(np.hstack([forecast[:,None],
                              actual[:,None]]), axis=1)
    maxs = np.amax(np.hstack([forecast[:,None],
                              actual[:,None]]), axis=1)
    minmax = 1 - np.mean(mins/maxs)             # minmax

    return({'Model':Model,'mape':mape, 'me':me, 'mae': mae, 'mpe': mpe,
            'rmse':rmse, 'corr':corr, 'mins':mins, 'maxs':maxs, 'minmax':minmax})

def metrics_ARIMA(models_ARIMA, train_arima, test_arima):
    dfmetrics_ARIMA = pd.DataFrame(columns=["Model", "mape", "me", "mae", "mpe", "rmse", "corr", "minmax"])
    for i in range(0,6):
        for j in range(0,6):
            dfmetrics_ARIMA = dfmetrics_ARIMA.append(forecast_accuracy(f"ARIMA{i}{d_optimum}{j}", models_ARIMA[f"ARIMA{i}{d_optimum}{j}"].predict(len(train_arima), len(train_arima)+len(test_arima)-1, typ='levels'), test_arima), ignore_index=True)
    return dfmetrics_ARIMA

After that, I run :

with concurrent.futures.ThreadPoolExecutor() as executor:
    metrics_ARIMA = executor.submit(metrics_ARIMA, models_ARIMA, train_arima, test_arima)
    metrics_ARIMA = metrics_ARIMA.result()


问:
NET MAUI ,,There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'ios-arm64',,
I am using VS 2022, NET 7.
I am learning NET MAUI.

I created a project where the REST API project and the MAUI projects are in the same solution, so I can share the models between them.

If I put my view models in MAUI project everything works fine, but If I reference the .NET Class library where my models are, I get always the following error on build:

```<code>Severity    Code    Description Project File    Line    Suppression State
Error   NETSDK1082  There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'ios-arm64'.
</code>```

I can provide any code snippet if it helps.

thnx

UPDATE (MAUI csproj file):

```<code><Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFrameworks>net7.0-android;net7.0-maccatalyst;net7.0-ios15.0</TargetFrameworks>
        <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>
        <!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
        <!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> -->
        <OutputType>Exe</OutputType>
        <RootNamespace>Mobile.UI</RootNamespace>
        <UseMaui>true</UseMaui>
        <SingleProject>true</SingleProject>
        <ImplicitUsings>enable</ImplicitUsings>

        <!-- Display name -->
        <ApplicationTitle>Mobile.UI</ApplicationTitle>

        <!-- App Identifier -->
        <ApplicationId>com.companyname.mobile.ui</ApplicationId>
        <ApplicationIdGuid>153a2ae5-5e5c-43b1-88e0-30367a6e48f1</ApplicationIdGuid>

        <!-- Versions -->
        <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
        <ApplicationVersion>1</ApplicationVersion>

        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
        <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
    </PropertyGroup>

    <ItemGroup>
        <!-- App Icon -->
        <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

        <!-- Splash Screen -->
        <MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

        <!-- Images -->
        <MauiImage Include="Resources\Images\*" />
        <MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

        <!-- Custom Fonts -->
        <MauiFont Include="Resources\Fonts\*" />

        <!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
        <MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
    </ItemGroup>

    <ItemGroup>
      <None Remove="Platforms\Android\Resources\xml\network_security_config.xml" />
    </ItemGroup>

    <ItemGroup>
        <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
        <PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
        <PackageReference Include="Microsoft.Extensions.Options" Version="7.0.0" />
        <PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
        <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.1" />
        <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
        <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
        <PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.8" />
    </ItemGroup>

    <ItemGroup>
      <None Update="Resources\Raw\Mobile.UI.Development.json">
        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      </None>
    </ItemGroup>

    <ItemGroup>
      <MauiAsset Update="Resources\Raw\Mobile.UI.Development.json">
        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      </MauiAsset>
    </ItemGroup>

    <ItemGroup>
      <MauiXaml Update="Components\PlayerListComponent.xaml">
        <Generator>MSBuild:Compile</Generator>
      </MauiXaml>
    </ItemGroup>

    <ItemGroup>
      <Folder Include="Pages\" />
    </ItemGroup>

    <ItemGroup>
      <ProjectReference Include="..\Backend.Database\Backend.Database.csproj" />
      <ProjectReference Include="..\Backend.Models\Backend.Models.csproj" />
    </ItemGroup>

    <ProjectExtensions><VisualStudio><UserProperties XamarinHotReloadDebuggerTimeoutExceptionMobileUIHideInfoBar="True" /></VisualStudio></ProjectExtensions>

</Project>
</code>```

REST API csproj:

```<code><Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net7.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <Content Remove="data.json" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
    <PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.4.0" />
    <PackageReference Include="System.Runtime.Caching" Version="7.0.0" />
    <PackageReference Include="System.Text.Json" Version="7.0.1" />
    <PackageReference Include="Z.EntityFramework.Extensions.EFCore" Version="7.18.0" />
    <PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="7.18.0" />
  </ItemGroup>

  <ItemGroup>
    <Folder Include="Controllers\" />
  </ItemGroup>

  <ItemGroup>
    <None Include="data.json">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\Backend.Middleware\Backend.Middleware.csproj" />
    <ProjectReference Include="..\Backend.Services\Backend.Services.csproj" />
    <ProjectReference Include="..\Backend.Validation\Backend.Validation.csproj" />
  </ItemGroup>

</Project>
</code>```

UPDATE: Models.csproj

```<code><Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net7.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="2.2.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\Backend.Database\Backend.Database.csproj" />
  </ItemGroup>

</Project>
</code>```

Body:
I am using VS 2022, NET 7.
I am learning NET MAUI.

I created a project where the REST API project and the MAUI projects are in the same solution, so I can share the models between them.

If I put my view models in MAUI project everything works fine, but If I reference the .NET Class library where my models are, I get always the following error on build:

Severity    Code    Description Project File    Line    Suppression State
Error   NETSDK1082  There was no runtime pack for Microsoft.AspNetCore.App available for the specified RuntimeIdentifier 'ios-arm64'.

I can provide any code snippet if it helps.

thnx

UPDATE (MAUI csproj file):

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFrameworks>net7.0-android;net7.0-maccatalyst;net7.0-ios15.0</TargetFrameworks>
        <TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks>

        <OutputType>Exe</OutputType>
        <RootNamespace>Mobile.UI</RootNamespace>
        <UseMaui>true</UseMaui>
        <SingleProject>true</SingleProject>
        <ImplicitUsings>enable</ImplicitUsings>

        <ApplicationTitle>Mobile.UI</ApplicationTitle>

        <ApplicationId>com.companyname.mobile.ui</ApplicationId>
        <ApplicationIdGuid>153a2ae5-5e5c-43b1-88e0-30367a6e48f1</ApplicationIdGuid>

        <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
        <ApplicationVersion>1</ApplicationVersion>

        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
        <TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
        <SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
    </PropertyGroup>

    <ItemGroup>

        <MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

        <MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

        <MauiImage Include="Resources\Images\*" />
        <MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

        <MauiFont Include="Resources\Fonts\*" />

        <MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
    </ItemGroup>

    <ItemGroup>
      <None Remove="Platforms\Android\Resources\xml\network_security_config.xml" />
    </ItemGroup>

    <ItemGroup>
        <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
        <PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
        <PackageReference Include="Microsoft.Extensions.Options" Version="7.0.0" />
        <PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
        <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.1" />
        <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
        <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
        <PackageReference Include="Microsoft.AspNetCore.App" Version="2.2.8" />
    </ItemGroup>

    <ItemGroup>
      <None Update="Resources\Raw\Mobile.UI.Development.json">
        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      </None>
    </ItemGroup>

    <ItemGroup>
      <MauiAsset Update="Resources\Raw\Mobile.UI.Development.json">
        <CopyToOutputDirectory>Always</CopyToOutputDirectory>
      </MauiAsset>
    </ItemGroup>

    <ItemGroup>
      <MauiXaml Update="Components\PlayerListComponent.xaml">
        <Generator>MSBuild:Compile</Generator>
      </MauiXaml>
    </ItemGroup>

    <ItemGroup>
      <Folder Include="Pages\" />
    </ItemGroup>

    <ItemGroup>
      <ProjectReference Include="..\Backend.Database\Backend.Database.csproj" />
      <ProjectReference Include="..\Backend.Models\Backend.Models.csproj" />
    </ItemGroup>

    <ProjectExtensions><VisualStudio><UserProperties XamarinHotReloadDebuggerTimeoutExceptionMobileUIHideInfoBar="True" /></VisualStudio></ProjectExtensions>

</Project>

REST API csproj:

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net7.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
  </PropertyGroup>

  <ItemGroup>
    <Content Remove="data.json" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
    <PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.4.0" />
    <PackageReference Include="System.Runtime.Caching" Version="7.0.0" />
    <PackageReference Include="System.Text.Json" Version="7.0.1" />
    <PackageReference Include="Z.EntityFramework.Extensions.EFCore" Version="7.18.0" />
    <PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="7.18.0" />
  </ItemGroup>

  <ItemGroup>
    <Folder Include="Controllers\" />
  </ItemGroup>

  <ItemGroup>
    <None Include="data.json">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </None>
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\Backend.Middleware\Backend.Middleware.csproj" />
    <ProjectReference Include="..\Backend.Services\Backend.Services.csproj" />
    <ProjectReference Include="..\Backend.Validation\Backend.Validation.csproj" />
  </ItemGroup>

</Project>

UPDATE: Models.csproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net7.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="2.2.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\Backend.Database\Backend.Database.csproj" />
  </ItemGroup>

</Project>


问:
Laconic Explanations in OWLAPI
I am using OWLAPI to get all the inferred axioms and their explanations, for some ontologies. For the explanations, I need to get the explanation with the minimal set of axioms for each inferred axiom (laconic explanation), but I can't figure out how to do it, and I don't see any mention of laconic in the owlapi docs (http://owlcs.github.io/owlapi/apidocs_5/index.html).

Is there a way to get the laconic explanations for an inferred axiom in OWLAPI?
If so, is it possible to give me an example of how I can achieve this?

UPDATE: Following the advice given in comments, I changed my code to:

```<code>public static void explain(OWLAxiom entailment, ExplanationGenerator<OWLAxiom> explanation_generator) {
     try {
        Set<Explanation<OWLAxiom>> explanations =
                          explanation_generator.getExplanations(entailment, 1);
        explanations.forEach(System.out::println);
        System.out.println("EndOfExplanation\n");
     } catch (Exception e) {
        System.out.println(e);
     }
};

// This method replicates code existing in the owlexplanation project;
// it's needed because the factories in owlexplanation do not set InitialEntailmentCheckStrategy correctly
public static ExplanationGeneratorFactory<OWLAxiom> createExplanationGeneratorFactory(
       OWLReasonerFactory reasonerFactory, ExplanationProgressMonitor<OWLAxiom> progressMonitor,
            Supplier<OWLOntologyManager> m) {
    EntailmentCheckerFactory<OWLAxiom> checker = new SatisfiabilityEntailmentCheckerFactory(reasonerFactory, m);
    Configuration<OWLAxiom> config = new Configuration<>(checker,
    new StructuralTypePriorityExpansionStrategy<OWLAxiom>(InitialEntailmentCheckStrategy.PERFORM, m),
    new DivideAndConquerContractionStrategy<OWLAxiom>(), progressMonitor, m);
    return new BlackBoxExplanationGeneratorFactory<>(config);
};

public static void main(String[] args) {
    ...
     ExplanationGeneratorFactory<OWLAxiom> genFac =
       ExplanationManager.createLaconicExplanationGeneratorFactory(
                 reasoner_factory, OWLManager::createOWLOntologyManager);
     ExplanationGenerator<OWLAxiom> gen = genFac.createExplanationGenerator(onto);
     inferred_axioms_onto.logicalAxioms().forEach(e -> explain(e, gen));
}
</code>```

but I still get java.lang.NullPointerException which is caused in  the line Set<Explanation<OWLAxiom>> explanations = explanation_generator.getExplanations(entailment, 1);.

The error stack trace is:

```<code>at org.semanticweb.owl.explanation.impl.blackbox.StructuralTypePriorityExpansionStrategy.doExpansion(StructuralTypePriorityExpansionStrategy.java:69)
    at org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2.doExpansion(BlackBoxExplanationGenerator2.java:262)
    at org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2.computeExplanation(BlackBoxExplanationGenerator2.java:183)
    at org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2.generateExplanation(BlackBoxExplanationGenerator2.java:292)
    at org.semanticweb.owl.explanation.impl.blackbox.hst.HittingSetTree.buildHittingSetTree(HittingSetTree.java:110)
    at org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2.getExplanations(BlackBoxExplanationGenerator2.java:118)
    at org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2.getExplanations(BlackBoxExplanationGenerator2.java:94)
    at org.semanticweb.owl.explanation.impl.laconic.LaconicExplanationGenerator.computePreciseJustsOptimised(LaconicExplanationGenerator.java:173)
    at org.semanticweb.owl.explanation.impl.laconic.LaconicExplanationGenerator.getExplanations(LaconicExplanationGenerator.java:386)
    at msc.Explainer.explain(Explainer.java:46)
    at msc.Explainer.lambda$2(Explainer.java:132)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
    at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.Iterator.forEachRemaining(Iterator.java:116)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
    at msc.Explainer.main(Explainer.java:132)
</code>```

I have taken the ExplanationGenerationFactory function from this answer on getting explanations: Explanations in Consistent OWL Ontologies, as without it I couldn't get explanations at all.

Title: Laconic Explanations in OWLAPI

Body:
I am using OWLAPI to get all the inferred axioms and their explanations, for some ontologies. For the explanations, I need to get the explanation with the minimal set of axioms for each inferred axiom (laconic explanation), but I can't figure out how to do it, and I don't see any mention of laconic in the owlapi docs (http://owlcs.github.io/owlapi/apidocs_5/index.html).

Is there a way to get the laconic explanations for an inferred axiom in OWLAPI?
If so, is it possible to give me an example of how I can achieve this?

UPDATE: Following the advice given in comments, I changed my code to:

public static void explain(OWLAxiom entailment, ExplanationGenerator<OWLAxiom> explanation_generator) {
     try {
        Set<Explanation<OWLAxiom>> explanations =
                          explanation_generator.getExplanations(entailment, 1);
        explanations.forEach(System.out::println);
        System.out.println("EndOfExplanation\n");
     } catch (Exception e) {
        System.out.println(e);
     }
};

// This method replicates code existing in the owlexplanation project;
// it's needed because the factories in owlexplanation do not set InitialEntailmentCheckStrategy correctly
public static ExplanationGeneratorFactory<OWLAxiom> createExplanationGeneratorFactory(
       OWLReasonerFactory reasonerFactory, ExplanationProgressMonitor<OWLAxiom> progressMonitor,
            Supplier<OWLOntologyManager> m) {
    EntailmentCheckerFactory<OWLAxiom> checker = new SatisfiabilityEntailmentCheckerFactory(reasonerFactory, m);
    Configuration<OWLAxiom> config = new Configuration<>(checker,
    new StructuralTypePriorityExpansionStrategy<OWLAxiom>(InitialEntailmentCheckStrategy.PERFORM, m),
    new DivideAndConquerContractionStrategy<OWLAxiom>(), progressMonitor, m);
    return new BlackBoxExplanationGeneratorFactory<>(config);
};

public static void main(String[] args) {
    ...
     ExplanationGeneratorFactory<OWLAxiom> genFac =
       ExplanationManager.createLaconicExplanationGeneratorFactory(
                 reasoner_factory, OWLManager::createOWLOntologyManager);
     ExplanationGenerator<OWLAxiom> gen = genFac.createExplanationGenerator(onto);
     inferred_axioms_onto.logicalAxioms().forEach(e -> explain(e, gen));
}

but I still get java.lang.NullPointerException which is caused in  the line Set<Explanation<OWLAxiom>> explanations = explanation_generator.getExplanations(entailment, 1);.

The error stack trace is:

at org.semanticweb.owl.explanation.impl.blackbox.StructuralTypePriorityExpansionStrategy.doExpansion(StructuralTypePriorityExpansionStrategy.java:69)
    at org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2.doExpansion(BlackBoxExplanationGenerator2.java:262)
    at org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2.computeExplanation(BlackBoxExplanationGenerator2.java:183)
    at org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2.generateExplanation(BlackBoxExplanationGenerator2.java:292)
    at org.semanticweb.owl.explanation.impl.blackbox.hst.HittingSetTree.buildHittingSetTree(HittingSetTree.java:110)
    at org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2.getExplanations(BlackBoxExplanationGenerator2.java:118)
    at org.semanticweb.owl.explanation.impl.blackbox.BlackBoxExplanationGenerator2.getExplanations(BlackBoxExplanationGenerator2.java:94)
    at org.semanticweb.owl.explanation.impl.laconic.LaconicExplanationGenerator.computePreciseJustsOptimised(LaconicExplanationGenerator.java:173)
    at org.semanticweb.owl.explanation.impl.laconic.LaconicExplanationGenerator.getExplanations(LaconicExplanationGenerator.java:386)
    at msc.Explainer.explain(Explainer.java:46)
    at msc.Explainer.lambda$2(Explainer.java:132)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
    at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:270)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.Iterator.forEachRemaining(Iterator.java:116)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
    at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
    at msc.Explainer.main(Explainer.java:132)

I have taken the ExplanationGenerationFactory function from this answer on getting explanations: Explanations in Consistent OWL Ontologies, as without it I couldn't get explanations at all.


问:
I am trying to make an a.i music video with 'video killed the radio star' collab book and i get this error:
https://colab.research.google.com/github/dmarx/video-killed-the-radio-star/blob/main/Video_Killed_The_Radio_Star_Defusion.ipynb

I generated the init images fine, but when i try to run the variation generating cell, i get the below error.

https://imgur.com/a/m36MszP

```<code>Fetching variations
1
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-24-12a2c8f0bffb> in <module>
    153         tot_variations -= curr_variation_count  # only generate variations we still need
    154         for _ in range(tot_variations):
--> 155             img = get_variations_w_init(prompt, init_image, start_schedule=(1-image_consistency))[0]
    156             save_frame(
    157                 img,

3 frames
/usr/local/lib/python3.8/dist-packages/torch/autograd/grad_mode.py in decorate_context(*args, **kwargs)
     25         def decorate_context(*args, **kwargs):
     26             with self.clone():
---> 27                 return func(*args, **kwargs)
     28         return cast(F, decorate_context)
     29

TypeError: __call__() missing 1 required positional argument: 'image'
</code>```

I am not a coder, i have no idea how to even begin going about rectifying this.

Body:
https://colab.research.google.com/github/dmarx/video-killed-the-radio-star/blob/main/Video_Killed_The_Radio_Star_Defusion.ipynb

I generated the init images fine, but when i try to run the variation generating cell, i get the below error.

https://imgur.com/a/m36MszP

Fetching variations
1
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-24-12a2c8f0bffb> in <module>
    153         tot_variations -= curr_variation_count  # only generate variations we still need
    154         for _ in range(tot_variations):
--> 155             img = get_variations_w_init(prompt, init_image, start_schedule=(1-image_consistency))[0]
    156             save_frame(
    157                 img,

3 frames
/usr/local/lib/python3.8/dist-packages/torch/autograd/grad_mode.py in decorate_context(*args, **kwargs)
     25         def decorate_context(*args, **kwargs):
     26             with self.clone():
---> 27                 return func(*args, **kwargs)
     28         return cast(F, decorate_context)
     29

TypeError: __call__() missing 1 required positional argument: 'image'

I am not a coder, i have no idea how to even begin going about rectifying this.


问:
Docker and NPM private registry
i use jetbrains space-on-permises on my pc. When i try to build a node docker image with a npm registry set in the npm registry i've a error:

this is my docker file:

```<code># Builder stage
FROM node:18 as builder
WORKDIR /usr/src/app
COPY package.json ./
COPY snkrs-url.json ./
COPY .npmrc ./
COPY . .
RUN npm config delete proxy
RUN npm config set @sneakers-monitor:registry http://packages:8390/npm/p/sneakers-monitor/npm/
RUN npm config set //packages:8390/npm/p/sneakers-monitor/npm/:_authToken=eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiIxbjdENmoxc1Y0ZHQiLCJhdWQiOiJjaXJjbGV0LXdlYi11aSIsIm9yZ0RvbWFpbiI6ImpldGJyYWlucyIsIm5hbWUiOiJhZG1pbiIsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdDo4MDg0IiwicGVybV90b2tlbiI6IjJuWHFuRDRYRTVCTiIsInByaW5jaXBhbF90eXBlIjoiVVNFUiIsImlhdCI6MTY3MDY3Njk1Mn0.g7sOBo7r7SvNuWq7VvKttdusdMf5Vad2Als24xBuGFDBId1oGa6XG61Y6X98mE_lifvtMxydD5DFspe49lH2TyS2hhNUI2vYxMno9jcA3oWGNjXMuK8cpAEterD70aNl_yCT-bS2hTh0jeVUKtLewGvoiXIPOvrCTMnyYpHA_qmixi1Qtw49O5rnB9SzTx6Go_iHUJB1p4ZFhEvY_mH8AVFSTo00YRE-RQEQ0j3p54me9amlC5xUTRg6c3bI5J9ElqVPgKn2arODsITKtYkD3vS6K3MRUtCnrr2eKxw3LtDYH1GfXq-hCw5TlYxWiBB_z21U7tnpOCKM8GkxrH-E3hdlYwt4ychoFveDclQKCC8PsMVOWOI9oaMqVttWMz9HkgvAEB3y--pV54s_pHm6xrH_CrYL2oEZ6rELjyJDaZYB-EPpLOrRRIXOYlitYUpe8nKcz13I7HEChpT0huXiP6IWqdotvtSdnR89irqoDILH7RZbGGjkFYB6Yz04zPwzn91-CBONuTMRLm39iv880l2tU6-7BlM2Jivyx0I_IKJCqJjymE0zfXJqB9I1F1S4T2GHBALHbTXtXa9dgC-unwJN3L_4TEPxaozzzcH8ikld8GOcd3bXJX1d-iD4GjqX9ek8cidwqmRzR3ZobAVKnb7_NC0vrXxG14BTqrvJNBg
RUN npm install
RUN npm run build
RUN npm prune --production
RUN wget https://gobinaries.com/tj/node-prune --output-document - | /bin/sh && node-prune

# Runner stage
FROM node:18-alpine as runner
WORKDIR /usr/src/app
COPY --from=builder /usr/src/app/snkrs-url.json ./
COPY --from=builder /usr/src/app/dist ./dist
COPY --from=builder /usr/src/app/node_modules ./node_modules

EXPOSE 5000
CMD [ "node", "dist/index.js" ]

</code>```

And this is the error:

```<code>
#18 188.0 npm ERR! code ENOTFOUND
#18 188.0 npm ERR! syscall getaddrinfo
#18 188.0 npm ERR! errno ENOTFOUND
#18 188.0 npm ERR! network request to http://packages:8390/npm/p/sneakers-monitor/npm/@sneakers-monitor%2fdiscord-bot failed, reason: getaddrinfo ENOTFOUND packages
#18 188.0 npm ERR! network This is a problem related to network connectivity.
#18 188.0 npm ERR! network In most cases you are behind a proxy or have bad network settings.
#18 188.0 npm ERR! network
#18 188.0 npm ERR! network If you are behind a proxy, please make sure that the
#18 188.0 npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
#18 188.0
</code>```

Can anyone help me?

Title: Docker and NPM private registry

Body:
i use jetbrains space-on-permises on my pc. When i try to build a node docker image with a npm registry set in the npm registry i've a error:

this is my docker file:

# Builder stage
FROM node:18 as builder
WORKDIR /usr/src/app
COPY package.json ./
COPY snkrs-url.json ./
COPY .npmrc ./
COPY . .
RUN npm config delete proxy
RUN npm config set @sneakers-monitor:registry http://packages:8390/npm/p/sneakers-monitor/npm/
RUN npm config set //packages:8390/npm/p/sneakers-monitor/npm/:_authToken=eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiIxbjdENmoxc1Y0ZHQiLCJhdWQiOiJjaXJjbGV0LXdlYi11aSIsIm9yZ0RvbWFpbiI6ImpldGJyYWlucyIsIm5hbWUiOiJhZG1pbiIsImlzcyI6Imh0dHA6XC9cL2xvY2FsaG9zdDo4MDg0IiwicGVybV90b2tlbiI6IjJuWHFuRDRYRTVCTiIsInByaW5jaXBhbF90eXBlIjoiVVNFUiIsImlhdCI6MTY3MDY3Njk1Mn0.g7sOBo7r7SvNuWq7VvKttdusdMf5Vad2Als24xBuGFDBId1oGa6XG61Y6X98mE_lifvtMxydD5DFspe49lH2TyS2hhNUI2vYxMno9jcA3oWGNjXMuK8cpAEterD70aNl_yCT-bS2hTh0jeVUKtLewGvoiXIPOvrCTMnyYpHA_qmixi1Qtw49O5rnB9SzTx6Go_iHUJB1p4ZFhEvY_mH8AVFSTo00YRE-RQEQ0j3p54me9amlC5xUTRg6c3bI5J9ElqVPgKn2arODsITKtYkD3vS6K3MRUtCnrr2eKxw3LtDYH1GfXq-hCw5TlYxWiBB_z21U7tnpOCKM8GkxrH-E3hdlYwt4ychoFveDclQKCC8PsMVOWOI9oaMqVttWMz9HkgvAEB3y--pV54s_pHm6xrH_CrYL2oEZ6rELjyJDaZYB-EPpLOrRRIXOYlitYUpe8nKcz13I7HEChpT0huXiP6IWqdotvtSdnR89irqoDILH7RZbGGjkFYB6Yz04zPwzn91-CBONuTMRLm39iv880l2tU6-7BlM2Jivyx0I_IKJCqJjymE0zfXJqB9I1F1S4T2GHBALHbTXtXa9dgC-unwJN3L_4TEPxaozzzcH8ikld8GOcd3bXJX1d-iD4GjqX9ek8cidwqmRzR3ZobAVKnb7_NC0vrXxG14BTqrvJNBg
RUN npm install
RUN npm run build
RUN npm prune --production
RUN wget https://gobinaries.com/tj/node-prune --output-document - | /bin/sh && node-prune

# Runner stage
FROM node:18-alpine as runner
WORKDIR /usr/src/app
COPY --from=builder /usr/src/app/snkrs-url.json ./
COPY --from=builder /usr/src/app/dist ./dist
COPY --from=builder /usr/src/app/node_modules ./node_modules

EXPOSE 5000
CMD [ "node", "dist/index.js" ]

And this is the error:

#18 188.0 npm ERR! code ENOTFOUND
#18 188.0 npm ERR! syscall getaddrinfo
#18 188.0 npm ERR! errno ENOTFOUND
#18 188.0 npm ERR! network request to http://packages:8390/npm/p/sneakers-monitor/npm/@sneakers-monitor%2fdiscord-bot failed, reason: getaddrinfo ENOTFOUND packages
#18 188.0 npm ERR! network This is a problem related to network connectivity.
#18 188.0 npm ERR! network In most cases you are behind a proxy or have bad network settings.
#18 188.0 npm ERR! network
#18 188.0 npm ERR! network If you are behind a proxy, please make sure that the
#18 188.0 npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
#18 188.0

Can anyone help me?


问:
pg_ctl: directory "C:/Program Files/PostgreSQL/13/data" does not exist The reload command returned an error (1)
When I try to open "pg_hba.conf" file, keep getting the following error:

pg_ctl: directory "C:/Program Files/PostgreSQL/13/data" does not exist
The reload command returned an error (1)

How to get the access to
"pg_hba.conf" file if "C:/Program Files/PostgreSQL/13/data" folder is not present in path?


问:
Cannot find module when trying to import from a JSON file in TypeScript
We are migrating from JS to TypeScript for our Cypress Project. I am getting the error message from my Login.ts:

```<code>Cannot find module '../../fixtures/users/user' or its corresponding type declarations.
Cannot find module '../../fixtures/users/admin' or its corresponding type declarations.
</code>```

Login.ts content:

import user from "../../fixtures/users/user"
import admin from "../../fixtures/users/admin"

class Login {
        // Some code
}
```
<p>Our folder tree is as follows:</p>
<p><img src="https://i.stack.imgur.com/Wiswt.png" alt="enter image description here" /></p>
<p>The content of <em>admin</em> and <em>user.json</em> are just simple identical values:</p>
<pre class="lang-json prettyprint-override"><code>{
    "val": {
        "firstname": "Alex",
        "lastname": "Shepherd"
    }
}
</code>```

Am I missing anything here?

EDIT:

I saw this thread comment that seems to work for this JSON importing situation. I'm not sure though if this is the optimal way to do this. I added the below lines in my tsconfig.json:

"resolveJsonModule": true,
"esModuleInterop": true
```
<p>Also, I added the extension in my import calls:</p>
<pre class="lang-js prettyprint-override"><code>import user from "../../fixtures/users/user.json"
import admin from "../../fixtures/users/admin.json"
</code>```

Body:
We are migrating from JS to TypeScript for our Cypress Project. I am getting the error message from my Login.ts:

Cannot find module '../../fixtures/users/user' or its corresponding type declarations.
Cannot find module '../../fixtures/users/admin' or its corresponding type declarations.

Login.ts content:

import user from "../../fixtures/users/user"
import admin from "../../fixtures/users/admin"

class Login {
        // Some code
}

Our folder tree is as follows:

The content of admin and user.json are just simple identical values:

{
    "val": {
        "firstname": "Alex",
        "lastname": "Shepherd"
    }
}

Am I missing anything here?

EDIT:

I saw this thread comment that seems to work for this JSON importing situation. I'm not sure though if this is the optimal way to do this. I added the below lines in my tsconfig.json:

"resolveJsonModule": true,
"esModuleInterop": true

Also, I added the extension in my import calls:

import user from "../../fixtures/users/user.json"
import admin from "../../fixtures/users/admin.json"


问:
QSortFilterProxyModel how to filter values in range(s)
I created a QTableView and attached a QSortFilterProxyModel to it. I also have two rows (QLineEdit) for each column. I need that when entering numbers in QLineEdit, only values in this range are displayed in the table(min < value < max). And so for each column in the table. It is also necessary that all this works simultaneously with all columns. That is, if I enter two ranges, and only if two conditions are true it shows a row(min1 < col1_Value < max1 && min2 < col2_Value < max2). At the moment there is no implementation of this, since I can't even imagine how to do it. I will be very grateful for advice and recommendations.</p>