问:
ARCGIS Javascript Api 4.5 with polygons
I am a newbie with ARCGIS and Javascript but trying hard

ON that article on this page at the end UPDATE Here is the same code with the addition to convert the geometry from WebMercator (wkid 102100 or 3857) to geographics (wkid 4326)

Is there someone who put the information about the polygon in a textarea field so I can put it into the database

I really like that example fit me but missing instead of console to put just the points of a polygon in the field

```<code>console.log(webMercatorUtils.webMercatorToGeographic(event.graphic.geometry).toJSON());
document.getElementById('message').innerHTML = (webMercatorUtils.webMercatorToGeographic(event.graphic.geometry).toJSON());
</code>```

This is not working it says

```<code>Object Object
</code>```

Many thanks to everyone for your support It is nice and appreciated

Mike

```<code>console.log(webMercatorUtils.webMercatorToGeographic(event.graphic.geometry).toJSON());
document.getElementById('message').innerHTML = (webMercatorUtils.webMercatorToGeographic(event.graphic.geometry).toJSON());
</code>```

Not working says [Object][Object]

Title: ARCGIS Javascript Api 4.5 with polygons

Body:
I am a newbie with ARCGIS and Javascript but trying hard

ON that article on this page at the end UPDATE Here is the same code with the addition to convert the geometry from WebMercator (wkid 102100 or 3857) to geographics (wkid 4326)

Is there someone who put the information about the polygon in a textarea field so I can put it into the database

I really like that example fit me but missing instead of console to put just the points of a polygon in the field

console.log(webMercatorUtils.webMercatorToGeographic(event.graphic.geometry).toJSON());
document.getElementById('message').innerHTML = (webMercatorUtils.webMercatorToGeographic(event.graphic.geometry).toJSON());

This is not working it says

Object Object

Many thanks to everyone for your support It is nice and appreciated

Mike

console.log(webMercatorUtils.webMercatorToGeographic(event.graphic.geometry).toJSON());
document.getElementById('message').innerHTML = (webMercatorUtils.webMercatorToGeographic(event.graphic.geometry).toJSON());

Not working says [Object][Object]


来源: stackexchange

问:
print json array value as string using java
I have Array of JSON and wanted to print value of tag 20029 as TEST but getting value as [TEST] in array. I just need a string value.

[{"FixJson":{"11":"1734","12":"REPOFIXUAT","13":"20140402-11:38:34","14":"TR_VENDOR","15":"8","16":"GBP","17":"Price","20029":"TEST","8":"FIXT.1.1","9":"449","10":"AE"}}]

Code:

```<code>public void fixtoJSON() throws SerializeException, JsonProcessingException, ParseException {

        List<HashMap<String,Object>> list = new ArrayList<HashMap<String, Object>>();
        map = new HashMap<String, Object>();
        map1 = new HashMap<String,Object>();

        result = fixmessage.split("\\|");

        // iterate the result and add them to a HashMap
        for (String fixoutcome : result) {

            String[] fix1 = fixoutcome.split("=");
            //System.out.println(" this is fix1 "+fix1);

            String key = fix1[0].trim().toString();
            String value = fix1[1].trim().toString();
            map.put(key, value);

        }
            map1.put("FixJson", map);
            list.add(map1);

            ObjectMapper mapper = new ObjectMapper();
            jsonstring =  mapper.writeValueAsString(list);

            js_ActualFixMessage = new JsonPath(jsonstring);

            System.out.println(js_ActualFixMessage.getString("FixJson.20029"));
</code>```

Expected Outcome
TEST

But getting as [TEST]

any help please !

ContentLicense: CC BY-SA 4.0

Body:
I have Array of JSON and wanted to print value of tag 20029 as TEST but getting value as [TEST] in array. I just need a string value.

[{"FixJson":{"11":"1734","12":"REPOFIXUAT","13":"20140402-11:38:34","14":"TR_VENDOR","15":"8","16":"GBP","17":"Price","20029":"TEST","8":"FIXT.1.1","9":"449","10":"AE"}}]

Code:

public void fixtoJSON() throws SerializeException, JsonProcessingException, ParseException {

        List<HashMap<String,Object>> list = new ArrayList<HashMap<String, Object>>();
        map = new HashMap<String, Object>();
        map1 = new HashMap<String,Object>();

        result = fixmessage.split("\\|");

        // iterate the result and add them to a HashMap
        for (String fixoutcome : result) {

            String[] fix1 = fixoutcome.split("=");
            //System.out.println(" this is fix1 "+fix1);

            String key = fix1[0].trim().toString();
            String value = fix1[1].trim().toString();
            map.put(key, value);

        }
            map1.put("FixJson", map);
            list.add(map1);

            ObjectMapper mapper = new ObjectMapper();
            jsonstring =  mapper.writeValueAsString(list);

            js_ActualFixMessage = new JsonPath(jsonstring);

            System.out.println(js_ActualFixMessage.getString("FixJson.20029"));

Expected Outcome
TEST

But getting as [TEST]

any help please !


问:
Setup WebHDFS authentication
I have setup a WebHDFS server with a self signed SSL certificate for testing. Now I need some kind of authentication on it where the user has to pass some credentials in the WebHDFS rest call. I am reading through https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-hdfs/WebHDFS.html, and it seems like it only allows Kerberos or OAuth2 authentication. This is too complex for my needs. Is there a way I can configure basic authentication? If not, then is there any quick way to get some Kerberos or Oauth2 server up and running?
Any help is appreciated!</p>

Title: Setup WebHDFS authentication


问:
SWRL rule equivalent for IN condition (sql)
I want to add a SWRL rule basis some list of object property values or data property values.
Person(?p)^hasPosition(?p,[CEO,COO,CFO,MD]) -> hasWorkGroup(?p,ExecutiveManagement)
How do I correctly define [CEO,COO,CFO,MD] as list of values as we do in SQL's IN clause?

And how can I achieve similar thing when CEO,COO,CFO,MD values are literals (i.e. hasPosition is a data property)?


问:
Scenejs/Render - How to make use of its Render Module?
I created an animation and wanted to export into video. For which there is Render module that i installed via npm.

https://www.npmjs.com/package/@scenejs/render
Installation
$ npm install @scenejs/render

Usage

basic

$ render -i index.html

It installed without any issues. but when I run the command to export video, it gives following error.

```<code>PS C:\Drive\EXS\Anim> render -i index.html
render : The term 'render' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path
is correct and try again.
At line:1 char:1
+ render -i index.html
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (render:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
</code>```

I don't know when I installed the module, why its command doesn't work. Can anyone please help?

expected result as they say on the profile page should be as following but I'm getting above mentioned error:

```<code>Start Rendering
Start Capture (startTime: 0, endTime: 2, fps: 60, startFrame: 0, endFrame: 171.42857142857144)
Capture frame: 0, time: 0
Capture frame: 1, time: 0.011666666666666665
</code>```

Body:
I created an animation and wanted to export into video. For which there is Render module that i installed via npm.

https://www.npmjs.com/package/@scenejs/render
Installation
$ npm install @scenejs/render

Usage

basic

$ render -i index.html

It installed without any issues. but when I run the command to export video, it gives following error.

PS C:\Drive\EXS\Anim> render -i index.html
render : The term 'render' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path
is correct and try again.
At line:1 char:1
+ render -i index.html
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (render:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I don't know when I installed the module, why its command doesn't work. Can anyone please help?

expected result as they say on the profile page should be as following but I'm getting above mentioned error:

Start Rendering
Start Capture (startTime: 0, endTime: 2, fps: 60, startFrame: 0, endFrame: 171.42857142857144)
Capture frame: 0, time: 0
Capture frame: 1, time: 0.011666666666666665


问:
is there a proper useragent module to import
I want to create a tool that detects intruders in the system or when they attack the it counterattacks or just pulls there information. I have the idea in my head I just dont know how to make it work to where my brains gonna say that's it. Yes I'm a noob I laugh at me all the time. This is what I have started so far. Yes, my code sucks and right now without there being an intruder it returns my ip and hostname. I can't get the useragent block to work. I dont think thats the proper module im importing. Any ideas to make this thing do something better</p>
```<code>
import os
import platform
import socket

def alert_intruder():
    #determine the operating system of the device
    os_name = platform.system()

    #use different commands to send an alert depending on the operating system
    if os_name == "Windows":
        os.system("msg * Intruder detected!")
    elif os_name ==("Linux"):
        os.system("wall Intruder detected!")
    elif os_name == ("Darwin"):
        os.system("say Intruder detected")

        #call the alert_intruder function to send an alert

hostname = socket.gethostname()
ip_address = socket.gethostbyname(hostname)
print(f"Hostnanme: {hostname}")
print(f"IP Adress: {ip_address}")

from getuseragent import UserAgent
useragent = UserAgent()

theuseragent = useragent.Random()
print(theuseragent)
</code>```

Body:
I want to create a tool that detects intruders in the system or when they attack the it counterattacks or just pulls there information. I have the idea in my head I just dont know how to make it work to where my brains gonna say that's it. Yes I'm a noob I laugh at me all the time. This is what I have started so far. Yes, my code sucks and right now without there being an intruder it returns my ip and hostname. I can't get the useragent block to work. I dont think thats the proper module im importing. Any ideas to make this thing do something better

import os
import platform
import socket

def alert_intruder():
    #determine the operating system of the device
    os_name = platform.system()

    #use different commands to send an alert depending on the operating system
    if os_name == "Windows":
        os.system("msg * Intruder detected!")
    elif os_name ==("Linux"):
        os.system("wall Intruder detected!")
    elif os_name == ("Darwin"):
        os.system("say Intruder detected")

        #call the alert_intruder function to send an alert

hostname = socket.gethostname()
ip_address = socket.gethostbyname(hostname)
print(f"Hostnanme: {hostname}")
print(f"IP Adress: {ip_address}")

from getuseragent import UserAgent
useragent = UserAgent()

theuseragent = useragent.Random()
print(theuseragent)


问:
how to check if incoming request to express backend is coming from a firebase authenticated client
I am authenticating my react frontend client with firebase and am also using a custom node express backend.

How can I check, by using firebase-admin SDK on the backend that an incoming request to my backend is coming from a client which is authenticated by firebase auth?


问:
"Cannot load the AnimationClipProvider Service" after respawning
The script works fine when I first hit play but if I die, when I respawn it shows the follow error: "Cannot load the AnimationClipProvider Service". Here is my code:

```<code>local tool = script.Parent
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://11838500955"

local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

track = humanoid:WaitForChild("Animator"):LoadAnimation(anim) --here is where the error is
track.Priority = Enum.AnimationPriority.Action
track.Looped = true

runservice.RenderStepped:Connect(function()

    tool.Equipped:Connect(function()

        track:Play()
    end)

    tool.Unequipped:Connect(function()
        if track then
            track:Stop()
        end
    end)
end)

</code>```

I have tried making the script wait until the player respawns but the same error shows up. My objective is to make it so that the animation clip provider will work on respawn.

Body:
The script works fine when I first hit play but if I die, when I respawn it shows the follow error: "Cannot load the AnimationClipProvider Service". Here is my code:

local tool = script.Parent
local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://11838500955"

local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

track = humanoid:WaitForChild("Animator"):LoadAnimation(anim) --here is where the error is
track.Priority = Enum.AnimationPriority.Action
track.Looped = true

runservice.RenderStepped:Connect(function()

    tool.Equipped:Connect(function()

        track:Play()
    end)

    tool.Unequipped:Connect(function()
        if track then
            track:Stop()
        end
    end)
end)

I have tried making the script wait until the player respawns but the same error shows up. My objective is to make it so that the animation clip provider will work on respawn.


问:
spacyr: spacy_initialize() causes R Session Aborted
I used spacyr without problems through all in the package implemented functions (spacy_install,spacy_initialize) on Windows 10.

The 'R Session Aborted' fatal error appeard after I started to use miniforge to create environments and Visual Studio to work in python. There shouldn't be any conflict with these, but it's the only thing I've changed compared to when spacyr worked.

What I've tried so far:

uninstall and reinstall miniconda and miniforge

uninstall and reinstall spacy and create condaenv: The reinstallation via spacy_install() and the anaconda promp takes forever and was not finishing. BUT through miniforge 'condaenv spacy' could be created.

Run R studio in adminitrative mode

download and install Microsoft Build Tools für C++

started issue on the GitHub repository of spacyr (https://github.com/quanteda/spacyr/issues/235)

This window still appears:

Here is the session info output of R:

```<code>R version 4.1.3 (2022-03-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252    LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                    LC_TIME=German_Germany.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9      R6_2.5.1        lifecycle_1.0.3 DBI_1.1.3       httr_1.4.4      rlang_1.0.6     cli_3.4.1       rstudioapi_0.14 blob_1.2.3      vctrs_0.4.2
[11] ellipsis_0.3.2  RPostgres_1.4.4 tools_4.1.3     bit64_4.0.5     bit_4.0.4       hms_1.1.2       compiler_4.1.3  pkgconfig_2.0.3
</code>```

Here is the session info output of conda:

```<code>active environment : base
    active env location : C:\ProgramData\Anaconda3
            shell level : 1
       user config file : C:\Users\TAC\.condarc
 populated config files : C:\Users\TAC\.condarc
          conda version : 22.9.0
    conda-build version : 3.22.0
         python version : 3.9.13.final.0
       virtual packages : __cuda=10.1=0
                          __win=0=0
                          __archspec=1=x86_64
       base environment : C:\ProgramData\Anaconda3  (read only)
      conda av data dir : C:\ProgramData\Anaconda3\etc\conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\ProgramData\Anaconda3\pkgs
                          C:\Users\TAC\.conda\pkgs
                          C:\Users\TAC\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\TAC\.conda\envs
                          C:\ProgramData\Anaconda3\envs
                          C:\Users\TAC\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/22.9.0 requests/2.28.1 CPython/3.9.13 Windows/10 Windows/10.0.19045
          administrator : False
             netrc file : None
           offline mode : False
</code>```

Which anaconda/python and R information output should I have a look at?

What additional information would you need to figure out the problem?

Thanks for any help!

Body:
I used spacyr without problems through all in the package implemented functions (spacy_install,spacy_initialize) on Windows 10.

The 'R Session Aborted' fatal error appeard after I started to use miniforge to create environments and Visual Studio to work in python. There shouldn't be any conflict with these, but it's the only thing I've changed compared to when spacyr worked.

What I've tried so far:

uninstall and reinstall miniconda and miniforge

uninstall and reinstall spacy and create condaenv: The reinstallation via spacy_install() and the anaconda promp takes forever and was not finishing. BUT through miniforge 'condaenv spacy' could be created.

Run R studio in adminitrative mode

download and install Microsoft Build Tools für C++

started issue on the GitHub repository of spacyr (https://github.com/quanteda/spacyr/issues/235)

This window still appears:

Here is the session info output of R:

R version 4.1.3 (2022-03-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252    LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                    LC_TIME=German_Germany.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9      R6_2.5.1        lifecycle_1.0.3 DBI_1.1.3       httr_1.4.4      rlang_1.0.6     cli_3.4.1       rstudioapi_0.14 blob_1.2.3      vctrs_0.4.2
[11] ellipsis_0.3.2  RPostgres_1.4.4 tools_4.1.3     bit64_4.0.5     bit_4.0.4       hms_1.1.2       compiler_4.1.3  pkgconfig_2.0.3

Here is the session info output of conda:

active environment : base
    active env location : C:\ProgramData\Anaconda3
            shell level : 1
       user config file : C:\Users\TAC\.condarc
 populated config files : C:\Users\TAC\.condarc
          conda version : 22.9.0
    conda-build version : 3.22.0
         python version : 3.9.13.final.0
       virtual packages : __cuda=10.1=0
                          __win=0=0
                          __archspec=1=x86_64
       base environment : C:\ProgramData\Anaconda3  (read only)
      conda av data dir : C:\ProgramData\Anaconda3\etc\conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\ProgramData\Anaconda3\pkgs
                          C:\Users\TAC\.conda\pkgs
                          C:\Users\TAC\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\TAC\.conda\envs
                          C:\ProgramData\Anaconda3\envs
                          C:\Users\TAC\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/22.9.0 requests/2.28.1 CPython/3.9.13 Windows/10 Windows/10.0.19045
          administrator : False
             netrc file : None
           offline mode : False

Which anaconda/python and R information output should I have a look at?

What additional information would you need to figure out the problem?

Thanks for any help!


问:
ngx-quill: Handlers for Toolbar in Different Container
I'm trying to create a custom toolbar using ngx-quill in a different container, but while the toolbar looks right, I'm not sure how to make the buttons maintain default functionality.

This is the editor:

```<code> <quill-editor
[(ngModel)]="test"
[readOnly]="false"
[format]="'object'"
[modules]="{'toolbar': '#toolbar'}"
></quill-editor>
</code>```

The toolbar (for now, I'm just trying one feature to start):

```<code><div id="toolbar" class="ql-toolbar">
    <button class="ql-bold">Bold</button>
</div>
</code>```

The toolbar seems to have only one-way databinding. When I click the button, nothing happens, but if I type ctrl+b, the button will light up. I want the button to call the same callback function the bold button does when it's connected to the editor, but I'm not sure how to set that up. I was able to setup a dummy callback function by adding a handler to the declaration on quill-editor, but I'd rather avoid rewriting the function for each option I add to the toolbar.

Body:
I'm trying to create a custom toolbar using ngx-quill in a different container, but while the toolbar looks right, I'm not sure how to make the buttons maintain default functionality.

This is the editor:

 <quill-editor
[(ngModel)]="test"
[readOnly]="false"
[format]="'object'"
[modules]="{'toolbar': '#toolbar'}"
></quill-editor>

The toolbar (for now, I'm just trying one feature to start):

    <button class="ql-bold">Bold</button>

The toolbar seems to have only one-way databinding. When I click the button, nothing happens, but if I type ctrl+b, the button will light up. I want the button to call the same callback function the bold button does when it's connected to the editor, but I'm not sure how to set that up. I was able to setup a dummy callback function by adding a handler to the declaration on quill-editor, but I'd rather avoid rewriting the function for each option I add to the toolbar.


问:
503 Service Unavailable error in linkedin api
We have used https://api.linkedin.com/v2/industries api to get industries details but this api getting failed and returns status code as 503

```<code>note : random linkedin api returns status code as 503.

like -
  https://api.linkedin.com/v2/organizations
  https://api.linkedin.com/v2/organizationalEntityFollowerStatistics
  https://api.linkedin.com/v2/organizationPageStatistics
</code>```

I have used Access Token, and this error occurred last 24 Hrs only.

Body:
We have used https://api.linkedin.com/v2/industries api to get industries details but this api getting failed and returns status code as 503

note : random linkedin api returns status code as 503.

like -
  https://api.linkedin.com/v2/organizations
  https://api.linkedin.com/v2/organizationalEntityFollowerStatistics
  https://api.linkedin.com/v2/organizationPageStatistics

I have used Access Token, and this error occurred last 24 Hrs only.


问:
On Running Docker-compose up. Getting No such file or directoryecute 'bash nest exited with code 0
I have build the docker image on and on WINDOW OS & on running docker-compose up.

Getting
db-postgres  | 2022-12-17 04:09:07.494 UTC [1] LOG:  database system is ready to accept connections ': No such file or directoryecute 'bash nest exited with code 0 ': No such file or directoryecute 'bash ': No such file or directoryecute 'bash ': No such file or directoryecute 'bash

Attaching Image of docker

Is this because of this

I tried many things but not able to get anything.


问:
How to use vlc to combine multiple videos with different encodings into one complete video
I tried to merge video files using examples from the wiki

https://wiki.videolan.org/VLC_HowTo/Merge_videos_together/

```<code>/Applications/VLC.app/Contents/MacOS/VLC -vv a.flv b.mkv c.mp4 \
--sout-keep \
--sout '#gather:transcode{vcodec="h264",vb="1024",acodec="aac",ab="128"}:standard{mux="mp4",dst="test.mp4",access=file}' vlc://quit
</code>```

But what I found is that if the videos are not identical the encoding doesn't work

Terminal Error

```<code>[0000000131779030] main encoder debug: using encoder module "x264"
[000000013170b910] main mux error: cannot add a new stream (unsupported while muxing to this format). You can try increasing sout-mux-caching value
[000000013171dd80] stream_out_transcode stream out error: cannot add this stream
[0000000132919090] main decoder error: cannot continue streaming due to errors with codec h264
[000000013175c4d0] videotoolbox generic: Raising max DPB to 3
2022-12-17 12:28:25.577 VLC[12119:275251] Can't find app with identifier com.spotify.client
[0000000131707660] macosx interface debug: Continue to use IOKit assertion NoIdleSleepAssertion (39363)
[0000000132904f70] main stream output debug: adding a new sout input for `subt` (sout_input: 0x600001af0c40)
[0000000131721000] gather stream out debug: creating new output
[000000013171dd80] stream_out_transcode stream out debug: not transcoding a stream (fcc=`subt')
[000000013170b910] main mux error: cannot add a new stream (unsupported while muxing to this format). You can try increasing sout-mux-caching value
[0000000132904f70] main stream output warning: new sout input failed (sout_input: 0x600001af0c40)
[0000000132919850] main decoder error: cannot create packetizer output (subt)
[0000000132904f70] main stream output debug: adding a new sout input for `subt` (sout_input: 0x600001af0bd0)
[0000000131721000] gather stream out debug: creating new output
[000000013171dd80] stream_out_transcode stream out debug: not transcoding a stream (fcc=`subt')
[000000013170b910] main mux error: cannot add a new stream (unsupported while muxing to this format). You can try increasing sout-mux-caching value
[0000000132904f70] main stream output warning: new sout input failed (sout_input: 0x600001af0bd0)
[0000000132919c30] main decoder error: cannot create packetizer output (subt)
</code>```

Merging video files after re-encoding is still not possible. How can I use vlc to merge media files in any video encoding format

I’m truly grateful for your help

I may be worried about the inconsistency of encoding parameters, so I set all the configurable parameters of transcode to the same result. There is still no solution to the problem

Body:
I tried to merge video files using examples from the wiki

https://wiki.videolan.org/VLC_HowTo/Merge_videos_together/

/Applications/VLC.app/Contents/MacOS/VLC -vv a.flv b.mkv c.mp4 \
--sout-keep \
--sout '#gather:transcode{vcodec="h264",vb="1024",acodec="aac",ab="128"}:standard{mux="mp4",dst="test.mp4",access=file}' vlc://quit

But what I found is that if the videos are not identical the encoding doesn't work

Terminal Error

[0000000131779030] main encoder debug: using encoder module "x264"
[000000013170b910] main mux error: cannot add a new stream (unsupported while muxing to this format). You can try increasing sout-mux-caching value
[000000013171dd80] stream_out_transcode stream out error: cannot add this stream
[0000000132919090] main decoder error: cannot continue streaming due to errors with codec h264
[000000013175c4d0] videotoolbox generic: Raising max DPB to 3
2022-12-17 12:28:25.577 VLC[12119:275251] Can't find app with identifier com.spotify.client
[0000000131707660] macosx interface debug: Continue to use IOKit assertion NoIdleSleepAssertion (39363)
[0000000132904f70] main stream output debug: adding a new sout input for `subt` (sout_input: 0x600001af0c40)
[0000000131721000] gather stream out debug: creating new output
[000000013171dd80] stream_out_transcode stream out debug: not transcoding a stream (fcc=`subt')
[000000013170b910] main mux error: cannot add a new stream (unsupported while muxing to this format). You can try increasing sout-mux-caching value
[0000000132904f70] main stream output warning: new sout input failed (sout_input: 0x600001af0c40)
[0000000132919850] main decoder error: cannot create packetizer output (subt)
[0000000132904f70] main stream output debug: adding a new sout input for `subt` (sout_input: 0x600001af0bd0)
[0000000131721000] gather stream out debug: creating new output
[000000013171dd80] stream_out_transcode stream out debug: not transcoding a stream (fcc=`subt')
[000000013170b910] main mux error: cannot add a new stream (unsupported while muxing to this format). You can try increasing sout-mux-caching value
[0000000132904f70] main stream output warning: new sout input failed (sout_input: 0x600001af0bd0)
[0000000132919c30] main decoder error: cannot create packetizer output (subt)

Merging video files after re-encoding is still not possible. How can I use vlc to merge media files in any video encoding format

I’m truly grateful for your help

I may be worried about the inconsistency of encoding parameters, so I set all the configurable parameters of transcode to the same result. There is still no solution to the problem


问:
How can I diagnose a printer which has become disconnected?
Well, never mind.  I rebooted the system and now the printer is working fine!

I'm a bit embarrassed, in that it's been years since I asked a "simple" Windows question, and I've forgotten where to ask it.

I have my home computer, a Dell laptop running Windows 10.  Attached is a Epson ET-3760 printer.  Except that the printer is no longer attached.  When I try to print the printer isn't found and Windows instead wants to do a print-to-file of one sort or another.

How can I diagnose this?  Where should I be asking?


问:
How to enable GEOS in Spatialite on Windows 10?
I am installing Spatialite for use in GeoDjango on a Windwos 10 64 bit system. I have already installed GEOS, PROJ, and GDAL from source in my command prompt. As spatialite requires using nmake on windows, I am using the Visual Studio 2017 command prompt to build it, however, in the README for libspatialite 4.2.0 it states that

```<code>> cd c:\libspatialite-3.1.0
> nmake /f makefile.vc
> nmake /f makefile.vc install

Please note: standard definitions in 'makefile.vc' assumes:
- enabling PROJ
- disabling GEOS

If you want to alter the default behaviour then make modifications in
'makefile.vc'. Also note that 'libspatialite-geos.def' contains those external
symbols to be exported from the DLL when you build GEOS.
</code>```

as I am using GeoDjango for geographic queries I think that GEOS will be necessary. How can I enable GEOS in the makefile.vc? It doesn't seem clear to me how to do that. For convenience, here is the full makefile.vc below.

```<code># $Id: $
#
# NMAKE Makefile to build libspatialite on Windows
#
!INCLUDE nmake.opt

LIBOBJ = src\gaiaaux\gg_sqlaux.obj src\gaiaaux\gg_utf8.obj \
    src\gaiaexif\gaia_exif.obj src\gaiageo\gg_advanced.obj \
    src\gaiageo\gg_endian.obj src\gaiageo\gg_ewkt.obj \
    src\gaiageo\gg_geodesic.obj src\gaiageo\gg_geoJSON.obj \
    src\gaiageo\gg_geometries.obj src\gaiageo\gg_geoscvt.obj \
    src\gaiageo\gg_gml.obj src\gaiageo\gg_kml.obj \
    src\gaiageo\gg_relations.obj src\gaiageo\gg_shape.obj \
    src\gaiageo\gg_transform.obj src\gaiageo\gg_vanuatu.obj \
    src\gaiageo\gg_wkb.obj src\gaiageo\gg_wkt.obj \
    src\gaiageo\gg_extras.obj src\gaiageo\gg_xml.obj \
    src\gaiageo\gg_relations_ext.obj src/connection_cache/alloc_cache.obj \
    src\spatialite\mbrcache.obj src\shapefiles\shapefiles.obj \
    src\spatialite\spatialite.obj src\spatialite\virtualdbf.obj \
    src\spatialite\virtualfdo.obj src\spatialite\virtualnetwork.obj \
    src\spatialite\virtualshape.obj src\spatialite\virtualspatialindex.obj \
    src\spatialite\statistics.obj src\spatialite\metatables.obj \
    src\spatialite\virtualXL.obj src\spatialite\extra_tables.obj \
    src\spatialite\virtualxpath.obj src\spatialite\virtualbbox.obj \
    src\spatialite\spatialite_init.obj src\gaiageo\gg_voronoj.obj \
    src\wfs\wfs_in.obj src\srsinit\srs_init.obj \
    src\dxf\dxf_parser.obj src\dxf\dxf_loader.obj src\dxf\dxf_writer.obj \
    src\dxf\dxf_load_distinct.obj src\dxf\dxf_load_mixed.obj \
    src\shapefiles\validator.obj src\md5\md5.obj src\md5\gaia_md5.obj \
    src\srsinit\epsg_inlined_00.obj src\srsinit\epsg_inlined_01.obj \
    src\srsinit\epsg_inlined_02.obj src\srsinit\epsg_inlined_03.obj \
    src\srsinit\epsg_inlined_04.obj src\srsinit\epsg_inlined_05.obj \
    src\srsinit\epsg_inlined_06.obj src\srsinit\epsg_inlined_07.obj \
    src\srsinit\epsg_inlined_08.obj src\srsinit\epsg_inlined_09.obj \
    src\srsinit\epsg_inlined_10.obj src\srsinit\epsg_inlined_11.obj \
    src\srsinit\epsg_inlined_12.obj src\srsinit\epsg_inlined_13.obj \
    src\srsinit\epsg_inlined_14.obj src\srsinit\epsg_inlined_15.obj \
    src\srsinit\epsg_inlined_16.obj src\srsinit\epsg_inlined_17.obj \
    src\srsinit\epsg_inlined_18.obj src\srsinit\epsg_inlined_19.obj \
    src\srsinit\epsg_inlined_20.obj src\srsinit\epsg_inlined_21.obj \
    src\srsinit\epsg_inlined_22.obj src\srsinit\epsg_inlined_23.obj \
    src\srsinit\epsg_inlined_24.obj src\srsinit\epsg_inlined_25.obj \
    src\srsinit\epsg_inlined_26.obj src\srsinit\epsg_inlined_27.obj \
    src\srsinit\epsg_inlined_28.obj src\srsinit\epsg_inlined_29.obj \
    src\srsinit\epsg_inlined_30.obj src\srsinit\epsg_inlined_31.obj \
    src\srsinit\epsg_inlined_32.obj src\srsinit\epsg_inlined_33.obj \
    src\srsinit\epsg_inlined_34.obj src\srsinit\epsg_inlined_35.obj \
    src\srsinit\epsg_inlined_36.obj src\srsinit\epsg_inlined_37.obj \
    src\srsinit\epsg_inlined_38.obj src\srsinit\epsg_inlined_39.obj \
    src\srsinit\epsg_inlined_40.obj src\srsinit\epsg_inlined_41.obj \
    src\srsinit\epsg_inlined_42.obj src\srsinit\epsg_inlined_43.obj \
    src\srsinit\epsg_inlined_44.obj src\srsinit\epsg_inlined_45.obj \
    src\srsinit\epsg_inlined_extra.obj \
    src\srsinit\epsg_inlined_prussian.obj \
    src\srsinit\epsg_inlined_wgs84_00.obj src\srsinit\epsg_inlined_wgs84_01.obj \
    src\versioninfo\version.obj src\virtualtext\virtualtext.obj
SPATIALITE_DLL = spatialite$(VERSION).dll

CFLAGS = /nologo -I.\src\headers -I. -IC:\OSGeo4W\include $(OPTFLAGS)

default:    all

all: spatialite.lib spatialite_i.lib
#$(EXIF_LOADER_EXE)

spatialite.lib: $(LIBOBJ)
    if exist spatialite.lib del spatialite.lib
    lib /out:spatialite.lib $(LIBOBJ)

$(SPATIALITE_DLL):  spatialite_i.lib

spatialite_i.lib:     $(LIBOBJ)
    link /debug /dll /out:$(SPATIALITE_DLL) \
        /implib:spatialite_i.lib $(LIBOBJ) \
        C:\OSGeo4W\lib\proj_i.lib C:\OSGeo4W\lib\geos_c.lib \
        C:\OSGeo4w\lib\freexl_i.lib C:\OSGeo4w\lib\iconv.lib \
        C:\OSGeo4W\lib\sqlite3_i.lib C:\OSGeo4W\lib\zlib.lib \
        C:\OSGeo4W\lib\libxml2.lib
    if exist $(SPATIALITE_DLL).manifest mt -manifest \
        $(SPATIALITE_DLL).manifest -outputresource:$(SPATIALITE_DLL);2

.c.obj:
    $(CC) $(CFLAGS) /c $*.c /Fo$@

clean:
    del *.dll
    del *.exp
    del *.manifest
    del *.lib
    del src\gaiaaux\*.obj
    del src\gaiaexif\*.obj
    del src\gaiageo\*.obj
    del src\spatialite\*.obj
    del src\srsinit\*.obj
    del src\versioninfo\*.obj
    del src\virtualtext\*.obj
    del src\wfs\*.obj
    del src\dxf\*.obj
    del src\md5\*.obj
    del *.pdb

install: all
    -mkdir $(INSTDIR)
    -mkdir $(INSTDIR)\bin
    -mkdir $(INSTDIR)\lib
    -mkdir $(INSTDIR)\include
    -mkdir $(INSTDIR)\include\spatialite
    copy *.dll $(INSTDIR)\bin
    copy *.lib $(INSTDIR)\lib
    copy src\headers\spatialite.h $(INSTDIR)\include
    copy src\headers\spatialite\*.h $(INSTDIR)\include\spatialite

</code>```

Body:
I am installing Spatialite for use in GeoDjango on a Windwos 10 64 bit system. I have already installed GEOS, PROJ, and GDAL from source in my command prompt. As spatialite requires using nmake on windows, I am using the Visual Studio 2017 command prompt to build it, however, in the README for libspatialite 4.2.0 it states that

> cd c:\libspatialite-3.1.0
> nmake /f makefile.vc
> nmake /f makefile.vc install

Please note: standard definitions in 'makefile.vc' assumes:
- enabling PROJ
- disabling GEOS

If you want to alter the default behaviour then make modifications in
'makefile.vc'. Also note that 'libspatialite-geos.def' contains those external
symbols to be exported from the DLL when you build GEOS.

as I am using GeoDjango for geographic queries I think that GEOS will be necessary. How can I enable GEOS in the makefile.vc? It doesn't seem clear to me how to do that. For convenience, here is the full makefile.vc below.

# $Id: $
#
# NMAKE Makefile to build libspatialite on Windows
#
!INCLUDE nmake.opt

LIBOBJ = src\gaiaaux\gg_sqlaux.obj src\gaiaaux\gg_utf8.obj \
    src\gaiaexif\gaia_exif.obj src\gaiageo\gg_advanced.obj \
    src\gaiageo\gg_endian.obj src\gaiageo\gg_ewkt.obj \
    src\gaiageo\gg_geodesic.obj src\gaiageo\gg_geoJSON.obj \
    src\gaiageo\gg_geometries.obj src\gaiageo\gg_geoscvt.obj \
    src\gaiageo\gg_gml.obj src\gaiageo\gg_kml.obj \
    src\gaiageo\gg_relations.obj src\gaiageo\gg_shape.obj \
    src\gaiageo\gg_transform.obj src\gaiageo\gg_vanuatu.obj \
    src\gaiageo\gg_wkb.obj src\gaiageo\gg_wkt.obj \
    src\gaiageo\gg_extras.obj src\gaiageo\gg_xml.obj \
    src\gaiageo\gg_relations_ext.obj src/connection_cache/alloc_cache.obj \
    src\spatialite\mbrcache.obj src\shapefiles\shapefiles.obj \
    src\spatialite\spatialite.obj src\spatialite\virtualdbf.obj \
    src\spatialite\virtualfdo.obj src\spatialite\virtualnetwork.obj \
    src\spatialite\virtualshape.obj src\spatialite\virtualspatialindex.obj \
    src\spatialite\statistics.obj src\spatialite\metatables.obj \
    src\spatialite\virtualXL.obj src\spatialite\extra_tables.obj \
    src\spatialite\virtualxpath.obj src\spatialite\virtualbbox.obj \
    src\spatialite\spatialite_init.obj src\gaiageo\gg_voronoj.obj \
    src\wfs\wfs_in.obj src\srsinit\srs_init.obj \
    src\dxf\dxf_parser.obj src\dxf\dxf_loader.obj src\dxf\dxf_writer.obj \
    src\dxf\dxf_load_distinct.obj src\dxf\dxf_load_mixed.obj \
    src\shapefiles\validator.obj src\md5\md5.obj src\md5\gaia_md5.obj \
    src\srsinit\epsg_inlined_00.obj src\srsinit\epsg_inlined_01.obj \
    src\srsinit\epsg_inlined_02.obj src\srsinit\epsg_inlined_03.obj \
    src\srsinit\epsg_inlined_04.obj src\srsinit\epsg_inlined_05.obj \
    src\srsinit\epsg_inlined_06.obj src\srsinit\epsg_inlined_07.obj \
    src\srsinit\epsg_inlined_08.obj src\srsinit\epsg_inlined_09.obj \
    src\srsinit\epsg_inlined_10.obj src\srsinit\epsg_inlined_11.obj \
    src\srsinit\epsg_inlined_12.obj src\srsinit\epsg_inlined_13.obj \
    src\srsinit\epsg_inlined_14.obj src\srsinit\epsg_inlined_15.obj \
    src\srsinit\epsg_inlined_16.obj src\srsinit\epsg_inlined_17.obj \
    src\srsinit\epsg_inlined_18.obj src\srsinit\epsg_inlined_19.obj \
    src\srsinit\epsg_inlined_20.obj src\srsinit\epsg_inlined_21.obj \
    src\srsinit\epsg_inlined_22.obj src\srsinit\epsg_inlined_23.obj \
    src\srsinit\epsg_inlined_24.obj src\srsinit\epsg_inlined_25.obj \
    src\srsinit\epsg_inlined_26.obj src\srsinit\epsg_inlined_27.obj \
    src\srsinit\epsg_inlined_28.obj src\srsinit\epsg_inlined_29.obj \
    src\srsinit\epsg_inlined_30.obj src\srsinit\epsg_inlined_31.obj \
    src\srsinit\epsg_inlined_32.obj src\srsinit\epsg_inlined_33.obj \
    src\srsinit\epsg_inlined_34.obj src\srsinit\epsg_inlined_35.obj \
    src\srsinit\epsg_inlined_36.obj src\srsinit\epsg_inlined_37.obj \
    src\srsinit\epsg_inlined_38.obj src\srsinit\epsg_inlined_39.obj \
    src\srsinit\epsg_inlined_40.obj src\srsinit\epsg_inlined_41.obj \
    src\srsinit\epsg_inlined_42.obj src\srsinit\epsg_inlined_43.obj \
    src\srsinit\epsg_inlined_44.obj src\srsinit\epsg_inlined_45.obj \
    src\srsinit\epsg_inlined_extra.obj \
    src\srsinit\epsg_inlined_prussian.obj \
    src\srsinit\epsg_inlined_wgs84_00.obj src\srsinit\epsg_inlined_wgs84_01.obj \
    src\versioninfo\version.obj src\virtualtext\virtualtext.obj
SPATIALITE_DLL = spatialite$(VERSION).dll

CFLAGS = /nologo -I.\src\headers -I. -IC:\OSGeo4W\include $(OPTFLAGS)

default:    all

all: spatialite.lib spatialite_i.lib
#$(EXIF_LOADER_EXE)

spatialite.lib: $(LIBOBJ)
    if exist spatialite.lib del spatialite.lib
    lib /out:spatialite.lib $(LIBOBJ)

$(SPATIALITE_DLL):  spatialite_i.lib

spatialite_i.lib:     $(LIBOBJ)
    link /debug /dll /out:$(SPATIALITE_DLL) \
        /implib:spatialite_i.lib $(LIBOBJ) \
        C:\OSGeo4W\lib\proj_i.lib C:\OSGeo4W\lib\geos_c.lib \
        C:\OSGeo4w\lib\freexl_i.lib C:\OSGeo4w\lib\iconv.lib \
        C:\OSGeo4W\lib\sqlite3_i.lib C:\OSGeo4W\lib\zlib.lib \
        C:\OSGeo4W\lib\libxml2.lib
    if exist $(SPATIALITE_DLL).manifest mt -manifest \
        $(SPATIALITE_DLL).manifest -outputresource:$(SPATIALITE_DLL);2

.c.obj:
    $(CC) $(CFLAGS) /c $*.c /Fo$@

clean:
    del *.dll
    del *.exp
    del *.manifest
    del *.lib
    del src\gaiaaux\*.obj
    del src\gaiaexif\*.obj
    del src\gaiageo\*.obj
    del src\spatialite\*.obj
    del src\srsinit\*.obj
    del src\versioninfo\*.obj
    del src\virtualtext\*.obj
    del src\wfs\*.obj
    del src\dxf\*.obj
    del src\md5\*.obj
    del *.pdb

install: all
    -mkdir $(INSTDIR)
    -mkdir $(INSTDIR)\bin
    -mkdir $(INSTDIR)\lib
    -mkdir $(INSTDIR)\include
    -mkdir $(INSTDIR)\include\spatialite
    copy *.dll $(INSTDIR)\bin
    copy *.lib $(INSTDIR)\lib
    copy src\headers\spatialite.h $(INSTDIR)\include
    copy src\headers\spatialite\*.h $(INSTDIR)\include\spatialite


问:
Django+React : CORS policy: Request header field access-control-allow-methods is not allowed by Access-Control-Allow-Headers in preflight response
I am using Django for my backend and React for my Frontend. When I try to send a POST request, I receive :

```<code>Access to XMLHttpRequest at 'http://localhost:8000/package/' from origin 'http://localhost:3000' has been blocked by CORS policy: Request header field access-control-allow-methods is not allowed by Access-Control-Allow-Headers in preflight response.
</code>```

I have combined a lot of answers that I found such as How to use csrf_token in Django RESTful API and React? and Django and React: csrf cookie is not being set in request header but still no luck.

'corsheaders' is in my INSTALLED APPS

Middleware settings

```<code>MIDDLEWARE = [

    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',

    'corsheaders.middleware.CorsMiddleware',

    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',

    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
</code>```

CORS settings:

```<code>CORS_ORIGIN_ALLOW_ALL = True

CORS_ALLOW_METHODS = [
    "DELETE",
    "GET",
    "OPTIONS",
    "PATCH",
    "POST",
    "PUT",
]

CORS_ORIGIN_WHITELIST = (
'http://localhost:3000',
)

CORS_ALLOWED_ORIGINS = [
    'http://localhost:3000',
]

CSRF_TRUSTED_ORIGINS = ['http://localhost:3000']

from corsheaders.defaults import default_headers
CORS_ALLOW_HEADERS = default_headers + ('cache-control',)
</code>```

Django view.py

```<code>from django.shortcuts import render
from django.views.generic.edit import CreateView
from .forms import PackageForm

from django.utils.decorators import method_decorator
from django.views.decorators.csrf import ensure_csrf_cookie

class PackageFormView(CreateView):

    form_class = PackageForm
    initial = {'key': 'value'}
    template_name = 'package_form.html'

    def get(self, request, *args, **kwargs):
        form = self.form_class(initial=self.initial)
        return render(request, self.template_name, {'form': form})

    @method_decorator(ensure_csrf_cookie)
    def post(self, request, *args, **kwargs):

        form = self.form_class(request.POST)
        if form.is_valid():

            form.save()

        return render(request, self.template_name, {'form': form})
</code>```

React call

```<code>var csrftoken = getCookie("csrftoken");

    function getCookie(name) {
      var cookieValue = null;
      if (document.cookie && document.cookie !== "") {
        var cookies = document.cookie.split(";");
        for (var i = 0; i < cookies.length; i++) {
          var cookie = jQuery.trim(cookies[i]);
          if (cookie.substring(0, name.length + 1) === name + "=") {
            cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
            break;
          }
        }
      }
      return cookieValue;
    }

    const cors = {
      "X-CSRFToken": csrftoken,
      "Access-Control-Allow-Origin": "*",
      "Access-Control-Allow-Credentials": "true",
      "Access-Control-Allow-Methods":
        "POST, GET, PUT, DELETE, OPTIONS, HEAD, authorization",
      "Access-Control-Allow-Headers": "*",
      "Content-type": "application/json",
      "withCredentials": "true",
    };

    axios
      .post(
        baseURL,
        {
          title: "title from react",
          description: "description from react",
          "withCredentials": "true",
        },
        {
          headers: cors,
        }
      )
      .then(function (response) {
        console.log(response);
      })
      .catch(function (error) {
        console.log(error);
      });
  };

</code>```

I have already spent about 10 hours on this, I still can't find how to fix it.

Body:
I am using Django for my backend and React for my Frontend. When I try to send a POST request, I receive :

Access to XMLHttpRequest at 'http://localhost:8000/package/' from origin 'http://localhost:3000' has been blocked by CORS policy: Request header field access-control-allow-methods is not allowed by Access-Control-Allow-Headers in preflight response.

I have combined a lot of answers that I found such as How to use csrf_token in Django RESTful API and React? and Django and React: csrf cookie is not being set in request header but still no luck.

'corsheaders' is in my INSTALLED APPS

Middleware settings

MIDDLEWARE = [

    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',

    'corsheaders.middleware.CorsMiddleware',

    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',

    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

CORS settings:

CORS_ORIGIN_ALLOW_ALL = True

CORS_ALLOW_METHODS = [
    "DELETE",
    "GET",
    "OPTIONS",
    "PATCH",
    "POST",
    "PUT",
]

CORS_ORIGIN_WHITELIST = (
'http://localhost:3000',
)

CORS_ALLOWED_ORIGINS = [
    'http://localhost:3000',
]

CSRF_TRUSTED_ORIGINS = ['http://localhost:3000']

from corsheaders.defaults import default_headers
CORS_ALLOW_HEADERS = default_headers + ('cache-control',)

Django view.py

from django.shortcuts import render
from django.views.generic.edit import CreateView
from .forms import PackageForm

from django.utils.decorators import method_decorator
from django.views.decorators.csrf import ensure_csrf_cookie

class PackageFormView(CreateView):

    form_class = PackageForm
    initial = {'key': 'value'}
    template_name = 'package_form.html'

    def get(self, request, *args, **kwargs):
        form = self.form_class(initial=self.initial)
        return render(request, self.template_name, {'form': form})

    @method_decorator(ensure_csrf_cookie)
    def post(self, request, *args, **kwargs):

        form = self.form_class(request.POST)
        if form.is_valid():

            form.save()

        return render(request, self.template_name, {'form': form})

React call

var csrftoken = getCookie("csrftoken");

    function getCookie(name) {
      var cookieValue = null;
      if (document.cookie && document.cookie !== "") {
        var cookies = document.cookie.split(";");
        for (var i = 0; i < cookies.length; i++) {
          var cookie = jQuery.trim(cookies[i]);
          if (cookie.substring(0, name.length + 1) === name + "=") {
            cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
            break;
          }
        }
      }
      return cookieValue;
    }

    const cors = {
      "X-CSRFToken": csrftoken,
      "Access-Control-Allow-Origin": "*",
      "Access-Control-Allow-Credentials": "true",
      "Access-Control-Allow-Methods":
        "POST, GET, PUT, DELETE, OPTIONS, HEAD, authorization",
      "Access-Control-Allow-Headers": "*",
      "Content-type": "application/json",
      "withCredentials": "true",
    };

    axios
      .post(
        baseURL,
        {
          title: "title from react",
          description: "description from react",
          "withCredentials": "true",
        },
        {
          headers: cors,
        }
      )
      .then(function (response) {
        console.log(response);
      })
      .catch(function (error) {
        console.log(error);
      });
  };

I have already spent about 10 hours on this, I still can't find how to fix it.


问:
Expo/React Native : A Continuous Alarm or Sound Notification (like receiving a call ) triggered by remote server
I am using Expo to build an app that will pop up a notification with custom sound and vibration when triggered remotely. The alarm/vibration would play until its dismissed by the user or it times out  (say after 1-2 mins) .
Example use case would be when  a partner needs my immediate help with baby, they can press a button the app and that would send signal to backend server which would then trigger the notification with alarm on the app at the other end. When the notification is dismissed, an acknowledgement message is sent with Yes or No type message. If the notification times out, then another message is sent like "no response".
Key point to note is that when the app is fully closed, the notification should still be able to pop up.

From my limited understanding , expo notification or push notifications in general cannot achieve this as they don't allow us to create notifications that directly open the app. Even a solution which works like phone or video calling apps (which open when someone calls you ) could work.

Any help would be much appreciated.

Many Thanks!

I looked up expo push notifications but they are limited in terms of customising the notifications.


问:
How to screen record with audio?
I am using 2 different assets:

An Audio Recorder: it records audio when started and then it plays it later (Speech Auto Detector).

A Screen Recorder (Android Native Screen Recorder).

When Screen Recorder starts, I want the recorded audio to play along with it. I want to screen record it with the audio but when the screen recorder starts, audio stops because both of the assets are using the same mic to capture the audio. Also, both of the assets work fine separately. Is there any solution?

Thank you.

Someone also had the same problem but with different assets so the solution was little different, also I couldn't understand that solution because I am not that experienced with this topic. So, it will be really helpful if you will simplify your answer.

Title: How to screen record with audio?


问:
"Error in SQL syntax" while getting data from database
I am trying to get data from the database using mysql2  but I am getting an error .

Error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cities as C where C.cityid=F.sourcecity)as source from
flightsdetails as F' at line 1

code:

```<code>router.get('/displayallrecords',function(req,res){
    pool.query('select F.*,(select C.cityname fron cities as C where C.cityid=F.sourcecity)as source from flightsdetails as F ',function(error,result){

        if(error)
        {
            res.render('displayallrecords',{data:[],message:error})
        }
        else
        {
            res.render('displayallrecords',{data:result,message:'success'})
        }
    })

})
</code>```

I have tried,

```<code>router.get('/displayallrecords',function(req,res){
    pool.query('select F.*,(select C.cityname fron cities as C where C.cityid=F.sourcecity)as source from flightsdetails as F ',function(error,result){

        if(error)
        {
            res.render('displayallrecords',{data:[],message:error})
        }
        else
        {
            res.render('displayallrecords',{data:result,message:'success'})
        }
    })

})
</code>```

Body:
I am trying to get data from the database using mysql2  but I am getting an error .

Error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cities as C where C.cityid=F.sourcecity)as source from
flightsdetails as F' at line 1

code:

router.get('/displayallrecords',function(req,res){
    pool.query('select F.*,(select C.cityname fron cities as C where C.cityid=F.sourcecity)as source from flightsdetails as F ',function(error,result){

        if(error)
        {
            res.render('displayallrecords',{data:[],message:error})
        }
        else
        {
            res.render('displayallrecords',{data:result,message:'success'})
        }
    })

})

I have tried,

router.get('/displayallrecords',function(req,res){
    pool.query('select F.*,(select C.cityname fron cities as C where C.cityid=F.sourcecity)as source from flightsdetails as F ',function(error,result){

        if(error)
        {
            res.render('displayallrecords',{data:[],message:error})
        }
        else
        {
            res.render('displayallrecords',{data:result,message:'success'})
        }
    })

})


问:
OCI: Cannot add search domain to resolv.conf using terraform
The documentation for OCI terraform says that I can add a search domain to resolv.conf but I cannot get this working.

https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_dhcp_options

```<code>resource "oci_core_dhcp_options" "dhcp_options" {
  compartment_id = oci_identity_compartment.tf-compartment.id
  options {
    type = "DomainNameServer"
    server_type = "VcnLocalPlusInternet"
  }
  options {
    type = "SearchDomain"
    search_domain_names = [ "mydomain.co.uk" ]
  }
  vcn_id = module.vcn.vcn_id
}
</code>```

My domain is not appearing in the instances' resolv.conf:

```<code>$ cat /etc/resolv.conf
; Any changes made to this file will be overwritten whenever the
; DHCP lease is renewed. To persist changes you must update the
; /etc/oci-hostname.conf file. For more information see
:[https://docs.cloud.oracle.com/iaas/Content/Network/Tasks/managingDHCP.htm#notes]
;
# Generated by NetworkManager
search mydomain.oraclevcn.com public.mydomain.oraclevcn.com
nameserver 169.254.169.254
</code>```

How can I get this working?

Body:
The documentation for OCI terraform says that I can add a search domain to resolv.conf but I cannot get this working.

https://registry.terraform.io/providers/oracle/oci/latest/docs/resources/core_dhcp_options

resource "oci_core_dhcp_options" "dhcp_options" {
  compartment_id = oci_identity_compartment.tf-compartment.id
  options {
    type = "DomainNameServer"
    server_type = "VcnLocalPlusInternet"
  }
  options {
    type = "SearchDomain"
    search_domain_names = [ "mydomain.co.uk" ]
  }
  vcn_id = module.vcn.vcn_id
}

My domain is not appearing in the instances' resolv.conf:

$ cat /etc/resolv.conf
; Any changes made to this file will be overwritten whenever the
; DHCP lease is renewed. To persist changes you must update the
; /etc/oci-hostname.conf file. For more information see
:[https://docs.cloud.oracle.com/iaas/Content/Network/Tasks/managingDHCP.htm#notes]
;
# Generated by NetworkManager
search mydomain.oraclevcn.com public.mydomain.oraclevcn.com
nameserver 169.254.169.254

How can I get this working?


问:
Not getting value in BehaviorSubject angular rxjs
I have a function like one the below in

service.ts:-

```<code>itemList$: BehaviorSubject<any> = new BehaviorSubject([]);
    getItem() {
    this.http
    .get('APIURL Here')
    .subscribe((res: any) => {
    this.itemList$.next(res.data);
    });
    }

</code>```

Below is my component.ts:-

```<code>constructor(private myService: MYService) {
    }
    matchItem(idtomatch:any){
    let matchStatus:boolean=false;
    this.myService.itemList$.subscribe((res: any) => {
    for (let val of res) {
    if(idtomatch === res.id){
    matchStatus = true;
    }
    else{
    matchStatus = false;
    }
    }
    });
    return matchStatus;
    }
</code>```
```<code>this.matchItem(idtomatch)
</code>```

It should return true when idtomatch === res.id else it should return false while it's always returning false.

Body:
I have a function like one the below in

service.ts:-

itemList$: BehaviorSubject<any> = new BehaviorSubject([]);
    getItem() {
    this.http
    .get('APIURL Here')
    .subscribe((res: any) => {
    this.itemList$.next(res.data);
    });
    }

Below is my component.ts:-

constructor(private myService: MYService) {
    }
    matchItem(idtomatch:any){
    let matchStatus:boolean=false;
    this.myService.itemList$.subscribe((res: any) => {
    for (let val of res) {
    if(idtomatch === res.id){
    matchStatus = true;
    }
    else{
    matchStatus = false;
    }
    }
    });
    return matchStatus;
    }

this.matchItem(idtomatch)

It should return true when idtomatch === res.id else it should return false while it's always returning false.


问:
NodeMCU GET request returns nothing
i've create a nodejs server on codespaces, just return your request type (GET or POST). but it works through microsoft edge and postman, on NodeMCU it returns nothing

it should return this:

200 {"data": "get"}
```
<p>but now it dosen't show anything, even error, this is my nodejs server code</p>
<pre class="lang-js prettyprint-override"><code>const http = require("http");

var server = http.createServer((req, res) => {
  if (req.method === 'GET') {
    toGet(req, res);
  }
  if (req.method === 'POST') {
    toPost(req, res);
  }
}).listen(8080);

function toGet(req, res) {
  res.write("{\"method\": \"get\"}");
  res.end();
}

function toPost(req, res) {
  res.write("{\"method\": \"post\"}");
  res.end();
}
</code>```

and this is my NodeMCU init.lua file

-- somecode

http.get(ip, function(code, data)
    if (code < 0) then
        print("failed")
    else
        print(code, data)
    end
end)

print("finished")

-- somecode
```

Title: NodeMCU GET request returns nothing

Body:
i've create a nodejs server on codespaces, just return your request type (GET or POST). but it works through microsoft edge and postman, on NodeMCU it returns nothing

it should return this:

200 {"data": "get"}

but now it dosen't show anything, even error, this is my nodejs server code

const http = require("http");

var server = http.createServer((req, res) => {
  if (req.method === 'GET') {
    toGet(req, res);
  }
  if (req.method === 'POST') {
    toPost(req, res);
  }
}).listen(8080);

function toGet(req, res) {
  res.write("{\"method\": \"get\"}");
  res.end();
}

function toPost(req, res) {
  res.write("{\"method\": \"post\"}");
  res.end();
}

and this is my NodeMCU init.lua file

-- somecode

http.get(ip, function(code, data)
    if (code < 0) then
        print("failed")
    else
        print(code, data)
    end
end)

print("finished")

-- somecode


问:
Server resfuses connection to domain and Web server goes down
hope you all doing great.

I have a little issue with my server network connection. I have been using this ISP for a while now, my set up was by connecting the router to different router then to the switch, it was going great. But I have changed my ISP to new one with faster Internet, however after I did this I connected my switch directly to the ISP router which now gave me an issue. The server keeps on connecting fine but it reach a point where it refuses any traffic and my Web server just gets down.

So I would like to ask of you if you have any clue on why is this happening?

I would like to mention that when this happens, I need to reset my server ip address and router as well and get a new set of ip address connection to set this over again.

Thank you.


问:
Listen to Keyboard Events in Flutter for IOS
I am trying to build logic based on detecting user keyboard events (e.g., when a user presses the backspace in a textfield). This seems to work on my builds for Android devices, but is not working for iOS devices. It seems as if the KeyboardListener that is wrapping my textfield is not being called when the user presses a key.

I have tried both the KeyboardListener and the RawKeyboardListener, and neither seem to work. How can I get this to work on iOS the same as it works for Android?

Here is a snippet of my code:

```<code>import 'package:flutter/material.dart'

class TestComponent extends StatelessWidget {
  const TestComponent({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      child: KeyboardListener(
          onKeyEvent: (key) {
            print(key);
          },
          focusNode: FocusNode(),
          child: TextField()),
    );
  }
}
</code>```

Body:
I am trying to build logic based on detecting user keyboard events (e.g., when a user presses the backspace in a textfield). This seems to work on my builds for Android devices, but is not working for iOS devices. It seems as if the KeyboardListener that is wrapping my textfield is not being called when the user presses a key.

I have tried both the KeyboardListener and the RawKeyboardListener, and neither seem to work. How can I get this to work on iOS the same as it works for Android?

Here is a snippet of my code:

import 'package:flutter/material.dart'

class TestComponent extends StatelessWidget {
  const TestComponent({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      child: KeyboardListener(
          onKeyEvent: (key) {
            print(key);
          },
          focusNode: FocusNode(),
          child: TextField()),
    );
  }
}


问:
Data Visualization issue with matplotlib
I'm a student of Python and I'm trying to visualize some data with matplotlib.

In my Jupyter notebook my chart shows like this:

But I need my chart to be like this:

I have created Google Colab for share the code

Please let me know what I have done wrong here

https://colab.research.google.com/drive/1YG4tmO9v0jEex9kzdAvTKXcdxwLBpWoo?usp=sharing


问:
Question Mark right at the colon in JavaScript
When we creating a class we are putting all commandObject in the below way what does question mark right at the colon autocomplete?: means in JavaScript

```<code>export interface CommandObject {
  ...
  autocomplete?: function
}
</code>```

I'm bit confused about it and
I'm expecting to what does ?: means in JavaScript

Body:
When we creating a class we are putting all commandObject in the below way what does question mark right at the colon autocomplete?: means in JavaScript

export interface CommandObject {
  ...
  autocomplete?: function
}

I'm bit confused about it and
I'm expecting to what does ?: means in JavaScript


问:
How to do server side validation on the given c# code?
I am a beginner and have no idea how to do server side validation on the form fields!
Although I have done the client side validation by JavaScript, but server side validation require!

```<code>public ActionResult New()
{
return View();
}
</code>```

//It is add method in controller

```<code>[HttpPost]
public ActionResult Create(string TeacherFname, string TeacherLname, DateTime HireDate)
{
Teacher NewTeacher = new Teacher();
NewTeacher.TeacherFname= TeacherFname;
NewTeacher.TeacherLname= TeacherLname;
NewTeacher.HireDate= HireDate;
NewTeacher.Salary= Salary;
TeacherDataController controller = new TeacherDataController();
controller.AddTeacher(NewTeacher);
return RedirectToAction("List");
}
</code>```
```<code></code>```

Body:
I am a beginner and have no idea how to do server side validation on the form fields!
Although I have done the client side validation by JavaScript, but server side validation require!

public ActionResult New()
{
return View();
}

//It is add method in controller

[HttpPost]
public ActionResult Create(string TeacherFname, string TeacherLname, DateTime HireDate)
{
Teacher NewTeacher = new Teacher();
NewTeacher.TeacherFname= TeacherFname;
NewTeacher.TeacherLname= TeacherLname;
NewTeacher.HireDate= HireDate;
NewTeacher.Salary= Salary;
TeacherDataController controller = new TeacherDataController();
controller.AddTeacher(NewTeacher);
return RedirectToAction("List");
}


问:
class object definition - programming jargon:
what's the definition of class object that  has more than one version?
what's the name of object like that that has a default and than versions with more parameters?

say you have it like that:

```<code>public class object
{
   public object()
   {
      get sth; do sth;
   }
   public object(k)
   {
      get sth with k; do sth with k;
   }
   public object(k, n)
   {
      get sth with k; do sth with k;
      get sth with n; do sth with n;
   }
}
</code>```

Body:
what's the definition of class object that  has more than one version?
what's the name of object like that that has a default and than versions with more parameters?

say you have it like that:

public class object
{
   public object()
   {
      get sth; do sth;
   }
   public object(k)
   {
      get sth with k; do sth with k;
   }
   public object(k, n)
   {
      get sth with k; do sth with k;
      get sth with n; do sth with n;
   }
}


问:
Exception has occurred: ModuleNotFoundError No module named 'igraph'
```<code>#igraph is the necessary package and matrix A is imported from adjacency.py file
import igraph
from adjacency import A

#Code given in the assignment but not to be considered

g = igraph.Graph()
g.add_vertices(10)
g.add_edges(
    [(0, 1), (1, 2), (2, 3), (3, 4), (4, 0), (0, 5), (1, 6), (2, 7), (3, 8), (4, 9), (5, 7), (6, 8), (7, 9), (8, 5),
     (9, 6)])

#According to step 2 the graph is constructed using Adjacency() function
grph = igraph.Graph.Adjacency(matrix=A)
print(igraph.Graph.count_automorphisms_vf2(grph))
print(igraph.Graph.get_automorphisms_vf2(grph))

</code>```

everything is working fine but importing igraph gives a exception i tried and reinstall the igraph package but it didnt worked.

Body:
#igraph is the necessary package and matrix A is imported from adjacency.py file
import igraph
from adjacency import A

#Code given in the assignment but not to be considered

g = igraph.Graph()
g.add_vertices(10)
g.add_edges(
    [(0, 1), (1, 2), (2, 3), (3, 4), (4, 0), (0, 5), (1, 6), (2, 7), (3, 8), (4, 9), (5, 7), (6, 8), (7, 9), (8, 5),
     (9, 6)])

#According to step 2 the graph is constructed using Adjacency() function
grph = igraph.Graph.Adjacency(matrix=A)
print(igraph.Graph.count_automorphisms_vf2(grph))
print(igraph.Graph.get_automorphisms_vf2(grph))

everything is working fine but importing igraph gives a exception i tried and reinstall the igraph package but it didnt worked.


问:
Simple node app - mongo and local host are connected but page to db is just spinning and not loadin
Simple node app with mongo. Mongo and local host are connected but page to db is just spinning in browser. Inital page is loaded properly, yet the page that goes to the db just spinning and not loading. Mongo community is insatlled via brew + using mongo compass interface - on mac. Terminal output: Server started at port 3000
Successfully connected to database.

db.js

```<code>const mongoose = require("mongoose");

mongoose.connect("mongodb://localhost:27017/StudentDB", {
useNewUrlParser: true,
}, function(error) {
if (error) {
console.log(error.message);
} else {
console.log("Successfully connected to database.");
}
});

require("./student.model");
</code>```
```<code>**index.js**
</code>```

app.listen(3000, () => {   console.log('Server started at port 3000') });

```<code>I wonder what is missing...
</code>```

Body:
Simple node app with mongo. Mongo and local host are connected but page to db is just spinning in browser. Inital page is loaded properly, yet the page that goes to the db just spinning and not loading. Mongo community is insatlled via brew + using mongo compass interface - on mac. Terminal output: Server started at port 3000
Successfully connected to database.

db.js

const mongoose = require("mongoose");

mongoose.connect("mongodb://localhost:27017/StudentDB", {
useNewUrlParser: true,
}, function(error) {
if (error) {
console.log(error.message);
} else {
console.log("Successfully connected to database.");
}
});

require("./student.model");

**index.js**

app.listen(3000, () => {   console.log('Server started at port 3000') });

I wonder what is missing...


问:
Docker Containers cannot communicate with Host Database
I know this question has been asked before, but I haven't managed to solve it from those answers.

System spec: I am running the server on Ubuntu 22.10 docker version is 20.10.16 and docker-compose version is 1.29.2

What I want to achieve: I have nextcloud running as a docker container and have MariaDB installed on the host machine uncontainerized. I want to use a database I created in MariaDB by nextcloud in docker container. But Hostname is always incorrect, and I get the following error.

Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused

Troubleshooting I've tried so far

Option 1: I added an extra host to my docker compose file so it can listen to the host system. Here's how my docker compose file like

```<code>version: '2'

services:
  app:
    image: nextcloud
    restart: always
    ports:
      - 8080:80
    volumes:
      - /home/ritzz/nextcloud:/var/www/html
    extra_hosts:
    - host.docker.internal:host-gateway
</code>```

However, when adding database if I use host.docker.internal as hostname I still get the error mentioned above.

Option2: Using docker host IP as database hostname. I used the following command to find out my host ip which was 172.17.0.1

```<code>ip addr show docker0
</code>```

However, again adding 172.17.0.1 or 172.17.0.1:3306 returns with the same error.

Option 3: I saw an option on the Internet to use network_mode: host to make the container use the same network as host. However, since docker container uses port 80 and on my host I can't use port 80. This method won't work for me I assume.

Additional Troubleshooting

I made sure Mariadb is with command sudo systemctl status mariadb as well as checked that it's listening to port 3306 using command sudo netstat -tlnp I also logged in to the database with the user and pass using command sudo mysql -u<username> -p<password> <database> and I can login successfully.

I am at the edge with this. Hopefully someone else can help me out

Body:
I know this question has been asked before, but I haven't managed to solve it from those answers.

System spec: I am running the server on Ubuntu 22.10 docker version is 20.10.16 and docker-compose version is 1.29.2

What I want to achieve: I have nextcloud running as a docker container and have MariaDB installed on the host machine uncontainerized. I want to use a database I created in MariaDB by nextcloud in docker container. But Hostname is always incorrect, and I get the following error.

Failed to connect to the database: An exception occurred in the driver: SQLSTATE[HY000] [2002] Connection refused

Troubleshooting I've tried so far

Option 1: I added an extra host to my docker compose file so it can listen to the host system. Here's how my docker compose file like

version: '2'

services:
  app:
    image: nextcloud
    restart: always
    ports:
      - 8080:80
    volumes:
      - /home/ritzz/nextcloud:/var/www/html
    extra_hosts:
    - host.docker.internal:host-gateway

However, when adding database if I use host.docker.internal as hostname I still get the error mentioned above.

Option2: Using docker host IP as database hostname. I used the following command to find out my host ip which was 172.17.0.1

ip addr show docker0

However, again adding 172.17.0.1 or 172.17.0.1:3306 returns with the same error.

Option 3: I saw an option on the Internet to use network_mode: host to make the container use the same network as host. However, since docker container uses port 80 and on my host I can't use port 80. This method won't work for me I assume.

Additional Troubleshooting

I made sure Mariadb is with command sudo systemctl status mariadb as well as checked that it's listening to port 3306 using command sudo netstat -tlnp I also logged in to the database with the user and pass using command sudo mysql -u<username> -p<password> <database> and I can login successfully.

I am at the edge with this. Hopefully someone else can help me out


问:
How to solve File (.pdf) path directory doesn't exist error if I select file (.pdf) from mobile download folder in ionic
I want to upload the pdf file on our server using the file-chooser Cordova plugin. I had success in the file selection but after the file selection I tried to upload on the server but received the error "directory doesn't exist".

```<code>var filter = { "mime": "application/pdf" };
      this.fileChooser.open(filter)
      .then(url => {
        console.log('fileChooser:',url);
        this.filePath.resolveNativePath(url)
          .then(filePath => {
              console.log('saif file pathhh',filePath);
              let correctPath = url.substr(0,url.lastIndexOf("/") + 1);
              let currentName = filePath.substring(filePath.lastIndexOf('/') + 1);

              this.file.checkDir(this.file.externalDataDirectory, correctPath).then(_ => console.log('Directory exists')).catch(err =>
                console.log('Directory doesnt exist'));

              let _filePath = filePath;
              let resPath = this.pathForImage(_filePath);

              let newEntry = {
                name: currentName,
                path: resPath,
                filePath: _filePath,
                comparessedPath: _filePath,
              };

              this.startUpload(newEntry, index, field_id);

          })
          .catch(err => console.log('saif file pathhh errorrr',err));
      })
      .catch(e => {
        console.log('saif file pathhh errorrr catchhh',e);
      });
</code>```

I want to real path of selected pdf file by using file-chooser cordova plugin

Body:
I want to upload the pdf file on our server using the file-chooser Cordova plugin. I had success in the file selection but after the file selection I tried to upload on the server but received the error "directory doesn't exist".

var filter = { "mime": "application/pdf" };
      this.fileChooser.open(filter)
      .then(url => {
        console.log('fileChooser:',url);
        this.filePath.resolveNativePath(url)
          .then(filePath => {
              console.log('saif file pathhh',filePath);
              let correctPath = url.substr(0,url.lastIndexOf("/") + 1);
              let currentName = filePath.substring(filePath.lastIndexOf('/') + 1);

              this.file.checkDir(this.file.externalDataDirectory, correctPath).then(_ => console.log('Directory exists')).catch(err =>
                console.log('Directory doesnt exist'));

              let _filePath = filePath;
              let resPath = this.pathForImage(_filePath);

              let newEntry = {
                name: currentName,
                path: resPath,
                filePath: _filePath,
                comparessedPath: _filePath,
              };

              this.startUpload(newEntry, index, field_id);

          })
          .catch(err => console.log('saif file pathhh errorrr',err));
      })
      .catch(e => {
        console.log('saif file pathhh errorrr catchhh',e);
      });

I want to real path of selected pdf file by using file-chooser cordova plugin


问:
Somebody did something like a MindMap with flutter or Dart?
Somebody did something like this image?

I would like to create links like image is showing.

I'm new with flutter and I tried "GraphView" but I can't customize it.

I saw TreeView, but doesn't work for me.


问:
When we click on print, the popup does not come in it, it gets printed directly
When we click on print, the popup does not come in it, it gets printed directly. How can this be done in codeigniter?

We have a p.o.s, in that we need such that when we print an order, popup should not appear in it for print. Print as soon as you click on the print button. (whichever machine is connected)
How to do this in codigniter? please help


问:
Error while updating property 'coordinate' of a view managed by: AIRMapMarker
I am trying to run code which supposed to get my location in maps.
here's my code App.js

```<code>import React, { Component } from "react";
import { Platform, Text, View, StyleSheet } from "react-native";
import Constants from "expo-constants";
import * as Location from "expo-location";
import MapView, { Marker } from "react-native-maps";

export default class Geolocation extends Component {
  state = {
    location: null,
    region: null,
    errorMessage: "",
  };
  UNSAFE_componentWillMount() {
    if (Platform.OS === "android" && !Constants.isDevice) {
      this.setState({
        errorMessage:
          "Oops, this will not work on Sketch in an Android emulator. Try it on your device!",
      });
    } else {
      this._getLocationAsync();
    }
  }
  _getLocationAsync = async () => {
    let { status } = Location.requestPermissionsAsync;
    if (status !== "granted") {
      this.setState({
        errorMessage: "Permission to access location was denied",
      });
    }
    let location = await Location.getCurrentPositionAsync({});
    const region = {
      latitude: location.coords.latitude,
      longitude: location.coords.longitude,
      latitudeDelta: 0.001,
      longitudeDelta: 0.001,
    };
    this.setState({ location, region });
  };
  render() {
    return (
      <MapView
        style={{
          flex: 1,
          alignItems: "center",
          justifyContent: "center",
          paddingTop: Constants.statusBarHeight,
        }}
        initialRegion={this.state.region}
      >
        {" "}
        <Marker coordinate={this.state.region} />{" "}
      </MapView>
    );
  }
}

</code>```

after I run the code, there are errors like this:

and this in my command

Please help me. Thank you

I tried to reinstall dependencies, read documentation in react and still didn't find the solution.

Body:
I am trying to run code which supposed to get my location in maps.
here's my code App.js

import React, { Component } from "react";
import { Platform, Text, View, StyleSheet } from "react-native";
import Constants from "expo-constants";
import * as Location from "expo-location";
import MapView, { Marker } from "react-native-maps";

export default class Geolocation extends Component {
  state = {
    location: null,
    region: null,
    errorMessage: "",
  };
  UNSAFE_componentWillMount() {
    if (Platform.OS === "android" && !Constants.isDevice) {
      this.setState({
        errorMessage:
          "Oops, this will not work on Sketch in an Android emulator. Try it on your device!",
      });
    } else {
      this._getLocationAsync();
    }
  }
  _getLocationAsync = async () => {
    let { status } = Location.requestPermissionsAsync;
    if (status !== "granted") {
      this.setState({
        errorMessage: "Permission to access location was denied",
      });
    }
    let location = await Location.getCurrentPositionAsync({});
    const region = {
      latitude: location.coords.latitude,
      longitude: location.coords.longitude,
      latitudeDelta: 0.001,
      longitudeDelta: 0.001,
    };
    this.setState({ location, region });
  };
  render() {
    return (
      <MapView
        style={{
          flex: 1,
          alignItems: "center",
          justifyContent: "center",
          paddingTop: Constants.statusBarHeight,
        }}
        initialRegion={this.state.region}
      >
        {" "}
        <Marker coordinate={this.state.region} />{" "}
      </MapView>
    );
  }
}

after I run the code, there are errors like this:

and this in my command

Please help me. Thank you

I tried to reinstall dependencies, read documentation in react and still didn't find the solution.


问:
Having issues reading a .csv file present in a directory
I have a following path defined where I have

```<code> label_csv_file = r"C:/Users/username/Downloads/Personal Stuff/Python Directory files/Scripts/CSV Copy Scripts/label.csv"
</code>```

I was trying to read the csv using pandas,

```<code>import pandas as pd
labelpd = pd.read_csv(label_csv_file)
</code>```

I get the following error:
handle = open(
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/username/Downloads/Personal Stuff/Python Directory files/Scripts/CSV Copy Scripts/label.csv', but the file is clearly there

I blacked out my name, instead of username my name is in the path, so I don't understand why I am having the issue, I have changed the label.csv to be just label as well. Its not just pandas, I was having issues opening with even with

open(label_csv_file, 'rb'),

where the label_csv_file path had been set, what is the issue here?

I have tried changing the file name to just label as it is already a .csv file that does not work either, I have changed the file path to just say /label, that doesn't work either

Body:
I have a following path defined where I have

 label_csv_file = r"C:/Users/username/Downloads/Personal Stuff/Python Directory files/Scripts/CSV Copy Scripts/label.csv"

I was trying to read the csv using pandas,

import pandas as pd
labelpd = pd.read_csv(label_csv_file)

I get the following error:
handle = open(
FileNotFoundError: [Errno 2] No such file or directory: 'C:/Users/username/Downloads/Personal Stuff/Python Directory files/Scripts/CSV Copy Scripts/label.csv', but the file is clearly there

I blacked out my name, instead of username my name is in the path, so I don't understand why I am having the issue, I have changed the label.csv to be just label as well. Its not just pandas, I was having issues opening with even with

open(label_csv_file, 'rb'),

where the label_csv_file path had been set, what is the issue here?

I have tried changing the file name to just label as it is already a .csv file that does not work either, I have changed the file path to just say /label, that doesn't work either


问:
I tried flask Python Splinter but is is not working?
I was trying splinter as an alternative of selenium but it's not working correctly.

```<code>Traceback (most recent call last):
  File "C:\scrapper.py", line 14, in <module>
    browser = Browser('flask', app=app)
  File "C:\.env\lib\site-packages\splinter\browser.py", line 121, in Browser
    return get_driver(driver, retry_count=retry_count, *args, **kwargs)
  File "C:.env\lib\site-packages\splinter\browser.py", line 92, in get_driver
    return driver(*args, **kwargs)
TypeError: 'NoneType' object is not callable
</code>```

my program

```<code>from flask import Flask
app = Flask(__name__)

@app.route('/')
def main():
    return 'Hello, World!'

@app.route('/<name>')
def hello_world(name):
    return 'Hello, {name}!'.format(name=name)

# initiate splinter flask client
from splinter import Browser
browser = Browser('flask', app=app)
print(browser.html)
</code>```

Body:
I was trying splinter as an alternative of selenium but it's not working correctly.

Traceback (most recent call last):
  File "C:\scrapper.py", line 14, in <module>
    browser = Browser('flask', app=app)
  File "C:\.env\lib\site-packages\splinter\browser.py", line 121, in Browser
    return get_driver(driver, retry_count=retry_count, *args, **kwargs)
  File "C:.env\lib\site-packages\splinter\browser.py", line 92, in get_driver
    return driver(*args, **kwargs)
TypeError: 'NoneType' object is not callable

my program

from flask import Flask
app = Flask(__name__)

@app.route('/')
def main():
    return 'Hello, World!'

@app.route('/<name>')
def hello_world(name):
    return 'Hello, {name}!'.format(name=name)

# initiate splinter flask client
from splinter import Browser
browser = Browser('flask', app=app)
print(browser.html)


问:
How do I position columns right next to each-other on mobile with Bulma css?
I am using Bulma as my css framework of choice for a project and I am trying to make a 6X5 grid using the columns feature. The sizing and everything is perfect on desktop and tablet but once I resize to mobile the columns stack on top of one another instead of staying side by side.

Can anyone help out with getting these to stay in a single row on mobile?

below is the latest thing I have tried to get this to work:

```<code>
<div className="box">
            <div className='columns'>
                <div className='column is-mobile'>
                    <div className='box has-text-centered' style={{'width': '100px'}}>Hello</div>
                </div>
                <div className='column is-mobile'>
                    <div className='box has-text-centered' style={{'width': '100px'}}>Hello</div>
                </div>
                <div className='column is-mobile'>
                    <div className='box has-text-centered' style={{'width': '100px'}}>Hello</div>
                </div>
                <div className='column is-mobile'>
                    <div className='box has-text-centered' style={{'width': '100px'}}>Hello</div>
                </div>
                <div className='column is-mobile'>
                    <div className='box has-text-centered' style={{'width': '100px'}}>Hello</div>
                </div>
            </div>

        </div>

</code>```

Body:
I am using Bulma as my css framework of choice for a project and I am trying to make a 6X5 grid using the columns feature. The sizing and everything is perfect on desktop and tablet but once I resize to mobile the columns stack on top of one another instead of staying side by side.

Can anyone help out with getting these to stay in a single row on mobile?

below is the latest thing I have tried to get this to work:

Hello

Hello

Hello

Hello

Hello


问:
nodemon: clean exit - waiting for changes before restart
I've been working on this code for a discord bot that tracks a the voice channels of a server until a specific person joins which then the bot joins and then plays an audio. However whenever I start up my file, it keeps on saying

```<code>[nodemon] starting `node index.js`
[nodemon] clean exit - waiting for changes before restart
</code>```

I have no clue why, I've looked online and I haven't seen any other people having the same issue as me, and if they did the answer didn't help.

Here is my code.

```<code>const { Client, GatewayIntentBits } = require('discord.js');
const { Lavalink } = require('discord.js-lavalink');

class MyBot {
  // The Discord.js client object that represents our bot
  client;

  // The ID of the specific person we want to track
  userIdToTrack;

  // The audio file to play when the specific person joins
  audioFile;

  constructor(client, userIdToTrack, audioFile) {
    // Save the client object and user ID and audio file for later use
    this.client = "[bot token]";
    this.userIdToTrack = '[discord id]';
    this.audioFile = '[file name]';
  }

  onGuildVoiceJoin(event) {
    // Get the member who just joined the voice channel
    const member = event.member;

    // If the member is the specific person we want to track...
    if (member.id === this.userIdToTrack) {
      // Get the voice channel that the member joined
      const voiceChannel = event.channel;

      // Join the voice channel with the bot
      voiceChannel.guild.voice.channel.join();

      // Play the audio file using Lavalink
      lavalink.play(voiceChannel, {
        track: '[file name]',
      });

const client = new Client({
  token: 'bot token]',
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent,
    GatewayIntentBits.GuildVoiceStates,
    GatewayIntentBits.GuildPresences,
  ],
});

// Create a new instance of the Lavalink class and connect to the Lavalink nodes
const lavalink = new Lavalink({
  client: client,
  nodes: [
    { host: 'ratio-w', port: 2334, password: 'youshallnotpass' },
  ],
});

lavalink.connect();

client.on('ready', () => {
  console.log('The bot is ready');

  // Create a new instance of the bot, passing in the client object, user ID, and audio file
  const bot = new MyBot("bot token", "user id", "file name");

  // Listen for voice state update events, which are triggered when a user joins or leaves a voice channel
  client.on('voiceStateUpdate', (oldState, newState) => {
    // Check if the user we want to track has just joined a voice channel
    if (newState.member.id === userIdToTrack && newState.channel) {
      // Get the voice channel the user joined
      const voiceChannel = newState.channel;

      // Join the voice channel with the bot
      voiceChannel.join().then(connection => {
        // Play the audio file using Lavalink
        lavalink.play(voiceChannel, {
          track: audioFile,
        });
      });
    }
  });

  client.on('messageCreate', message => {
    if (message.content === 'ping') {
      message.reply('hey <@user id>, you STINK!!!!111!');
    }
  });

  client.on('messageCreate', message => {
    if (message.content === 'shut up [redacted]') {
      message.reply('yeah <@user id> shut up smelly');
    }
  });
  client.on('messageCreate', message => {
    if (message.content === 'stop being a nerd [redacted]') {
      message.reply('<@user id> be like :nerd:');
    }
  });
});
process.on('unhandledRejection', (reason, promise) => {
  console.log('Unhandled Rejection at:', reason.stack || reason)
  // Recommended: send the information to sentry.io
  // or whatever crash reporting service you use
})

client.login('[bot id]');}}}

</code>```

I tried fixing any possible syntax errors, I've tried looking online but no help was found, I've properly started lavalink (I think), I've edited some of the code so that all possible parts are fixed. I've downloaded all possible directories like updating discord.js, node.js, lavalink.js, and more I think.

Body:
I've been working on this code for a discord bot that tracks a the voice channels of a server until a specific person joins which then the bot joins and then plays an audio. However whenever I start up my file, it keeps on saying

[nodemon] starting `node index.js`
[nodemon] clean exit - waiting for changes before restart

I have no clue why, I've looked online and I haven't seen any other people having the same issue as me, and if they did the answer didn't help.

Here is my code.

const { Client, GatewayIntentBits } = require('discord.js');
const { Lavalink } = require('discord.js-lavalink');

class MyBot {
  // The Discord.js client object that represents our bot
  client;

  // The ID of the specific person we want to track
  userIdToTrack;

  // The audio file to play when the specific person joins
  audioFile;

  constructor(client, userIdToTrack, audioFile) {
    // Save the client object and user ID and audio file for later use
    this.client = "[bot token]";
    this.userIdToTrack = '[discord id]';
    this.audioFile = '[file name]';
  }

  onGuildVoiceJoin(event) {
    // Get the member who just joined the voice channel
    const member = event.member;

    // If the member is the specific person we want to track...
    if (member.id === this.userIdToTrack) {
      // Get the voice channel that the member joined
      const voiceChannel = event.channel;

      // Join the voice channel with the bot
      voiceChannel.guild.voice.channel.join();

      // Play the audio file using Lavalink
      lavalink.play(voiceChannel, {
        track: '[file name]',
      });

const client = new Client({
  token: 'bot token]',
  intents: [
    GatewayIntentBits.Guilds,
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent,
    GatewayIntentBits.GuildVoiceStates,
    GatewayIntentBits.GuildPresences,
  ],
});

// Create a new instance of the Lavalink class and connect to the Lavalink nodes
const lavalink = new Lavalink({
  client: client,
  nodes: [
    { host: 'ratio-w', port: 2334, password: 'youshallnotpass' },
  ],
});

lavalink.connect();

client.on('ready', () => {
  console.log('The bot is ready');

  // Create a new instance of the bot, passing in the client object, user ID, and audio file
  const bot = new MyBot("bot token", "user id", "file name");

  // Listen for voice state update events, which are triggered when a user joins or leaves a voice channel
  client.on('voiceStateUpdate', (oldState, newState) => {
    // Check if the user we want to track has just joined a voice channel
    if (newState.member.id === userIdToTrack && newState.channel) {
      // Get the voice channel the user joined
      const voiceChannel = newState.channel;

      // Join the voice channel with the bot
      voiceChannel.join().then(connection => {
        // Play the audio file using Lavalink
        lavalink.play(voiceChannel, {
          track: audioFile,
        });
      });
    }
  });

  client.on('messageCreate', message => {
    if (message.content === 'ping') {
      message.reply('hey <@user id>, you STINK!!!!111!');
    }
  });

  client.on('messageCreate', message => {
    if (message.content === 'shut up [redacted]') {
      message.reply('yeah <@user id> shut up smelly');
    }
  });
  client.on('messageCreate', message => {
    if (message.content === 'stop being a nerd [redacted]') {
      message.reply('<@user id> be like :nerd:');
    }
  });
});
process.on('unhandledRejection', (reason, promise) => {
  console.log('Unhandled Rejection at:', reason.stack || reason)
  // Recommended: send the information to sentry.io
  // or whatever crash reporting service you use
})

client.login('[bot id]');}}}

I tried fixing any possible syntax errors, I've tried looking online but no help was found, I've properly started lavalink (I think), I've edited some of the code so that all possible parts are fixed. I've downloaded all possible directories like updating discord.js, node.js, lavalink.js, and more I think.


问:
How does debugging with breakpoints in VS code work vs commenting out sections?
Example of breakpoints in VS code

I’ve tried to use use this instead of commenting out sections, running it and seeing the difference but it doesn’t seem to apply.

I’ve read this article https://learn.microsoft.com/en-us/visualstudio/debugger/using-breakpoints?view=vs-2022 but if it could be explained in a different way it would be helpful. Thanks.


问:
school management system architecture

What is the suitable architecture for huge project like 'School Management System' ?

I was trying to implement the microservices architecture, but is microservices architecture needed for 'School Management System' or monolith is fine ?

As microservice brings some pros with it like scalability,separate microservices etc but also cons like  complexity, architecture , security and also hosting micoservices are expensive.

Thanks in advance

Title: school management system architecture


问:
How can i change the text color and size of text in container of elemental dropdown?
I have an elemental dropdown.i want to change the fontsize and color of texts in container of dropdown.for customizing the texts in container the library have a property called 'itemTextStyle'.i given the color and fontsize in this property.but nothing is happening and the texts are showing still with default size and color.

```<code>  <Dropdown
    key={item.orderid}
    style={[styles.dropdown,{marginTop : hp('1%'),borderColor : 'black'}]}
    selectedTextStyle={{color : 'black',fontSize :hp('1.4'),maxHeight : hp('2%')}}
    iconColor="black"
    data={pickerData}
    maxHeight={300}
    labelField="label"
    valueField="value"
    labelColor="black"
    fontSize={hp('1')}
    value={item.status}
    dropdownPosition="bottom"
    activeColor="grey"
    itemContainerStyle={{padding : 0,height : hp('5%'),margin : 0,alignItems : 'center',justifyContent : 'center'}}
    itemTextStyle={{color : 'black',fontSize:hp('1.50')}}
    containerStyle={{height : hp('20%'),width : wp('35%')}}
    onChange={(e) => {
     onChangingStatus(item.orderid,e.value)
    }}
  />
 }
</View>
</code>```

In this you can see that i given color and fontsize inside itemTextStyle.but this property is not working.i checked everywhere and didn't found any way to fix this? is this a bug ?anyone know how to fix this?

Body:
I have an elemental dropdown.i want to change the fontsize and color of texts in container of dropdown.for customizing the texts in container the library have a property called 'itemTextStyle'.i given the color and fontsize in this property.but nothing is happening and the texts are showing still with default size and color.

  <Dropdown
    key={item.orderid}
    style={[styles.dropdown,{marginTop : hp('1%'),borderColor : 'black'}]}
    selectedTextStyle={{color : 'black',fontSize :hp('1.4'),maxHeight : hp('2%')}}
    iconColor="black"
    data={pickerData}
    maxHeight={300}
    labelField="label"
    valueField="value"
    labelColor="black"
    fontSize={hp('1')}
    value={item.status}
    dropdownPosition="bottom"
    activeColor="grey"
    itemContainerStyle={{padding : 0,height : hp('5%'),margin : 0,alignItems : 'center',justifyContent : 'center'}}
    itemTextStyle={{color : 'black',fontSize:hp('1.50')}}
    containerStyle={{height : hp('20%'),width : wp('35%')}}
    onChange={(e) => {
     onChangingStatus(item.orderid,e.value)
    }}
  />
 }
</View>

In this you can see that i given color and fontsize inside itemTextStyle.but this property is not working.i checked everywhere and didn't found any way to fix this? is this a bug ?anyone know how to fix this?


问:
Kendo react grid horizontal scroll value
I am using kendo react grid in my application. In the grid there are many columns so there is horizontal scroll bar present now if someone has scrolled the grid to right and performed some actions on the grid now grid will re render and horizontal scroll bar will moved to the right which is not required. I wanted to preserved the value of the kendo react horizontal scroll. How can i get the value of horizontal scroll from the kendo react?</p>