问:
Virtual DOM implementation which can parse HTML documents

Problem

I really like the concept of a Virtual DOM, described in https://vuejs.org/guide/extras/rendering-mechanism.html, as the amount of data between server and client can be reduced in my case. Also a diff update could be highlighted using css to show the user what has been changed.

I'd like to extend my editor https://github.com/nixcloud/pankat with incremental document updates.

My problem is this, how to get HTML into the virtual dom. Usually this is composed by functions of some sorts and not already existing documents.

Is there a:

```<code>vdom->parseHTML('index.html')
</code>```

Which I missed? I guess I can run the javascript part in https://github.com/nixcloud/pankat

Server to client updates

static html generator using pandoc ->

DOM-server-side: parse output on the server side ->

create a patch ->

update client web UI.

Client to server updates

A user

edits a README.md

for example using the https://github.com/Jeffail/leaps editor.

Each update triggers the static html generator (using pandoc).

If a change is detected, trigger the update to the client as described above.

update

I've been looking at my notes and I discoverd this:

http://fiduswriter.github.io/diffDOM/

Body:
Problem

I really like the concept of a Virtual DOM, described in https://vuejs.org/guide/extras/rendering-mechanism.html, as the amount of data between server and client can be reduced in my case. Also a diff update could be highlighted using css to show the user what has been changed.

I'd like to extend my editor https://github.com/nixcloud/pankat with incremental document updates.

My problem is this, how to get HTML into the virtual dom. Usually this is composed by functions of some sorts and not already existing documents.

Is there a:

vdom->parseHTML('index.html')

Which I missed? I guess I can run the javascript part in https://github.com/nixcloud/pankat

Server to client updates

static html generator using pandoc ->

DOM-server-side: parse output on the server side ->

create a patch ->

update client web UI.

Client to server updates

A user

edits a README.md

for example using the https://github.com/Jeffail/leaps editor.

Each update triggers the static html generator (using pandoc).

If a change is detected, trigger the update to the client as described above.

update

I've been looking at my notes and I discoverd this:

http://fiduswriter.github.io/diffDOM/


来源: stackexchange

问:
Keras function that returns list of neural network results during gradient descent in R
My neural network code is built through keras. I am obtaining very large loss function values, so I want to observe how the neural network output progresses per epoch in hopes of finding out what's wrong with my model.

Does keras have a function that returns the predicted values every iteration during gradient descent?

ContentLicense: CC BY-SA 4.0


问:
pyttsx3 audio output wav file is not saved
Now I tried to save the audio output into wav files (mp3 file cannot play, no sound), but it play the audio but does not save audio files at all. Also this program eventually halted when all files under TTBOD folder are exhausted. I can see the mac wheel spinning when I go to the latest popup window. I suspect the halting might be the reason that mp3 files cannot be save since I can save the .wav file when I only use one document and don't go through all documents. But I am not sure. Can anyone help me to debug the codes? Thank you.

`

```<code>import tkinter as tk
import pyttsx3
import docx2txt
import re
import os
import time

# Create a window
window = tk.Tk()
window.title("Please provide the gender and Name of the subject")
window.geometry("500x300")
window.configure(bg='navyblue')

docx_files = []
os.chdir("/Users/alex/Desktop/TTBOD/M")

for file in os.listdir():
    if file.endswith(".docx"):
        docx_files.append(file)
docx_files.sort()
concatenated_files = []
         #####################################################
def narration(doc, voc, fn):
    engine = pyttsx3.init()
    # Set the volume and rate of the speech
    engine.setProperty('volume', 1.0)
    engine.setProperty('rate', 180)
    # voice_id = "/System/Library/LaunchDaemons/com.apple.locate.plist/com.apple.speech.synthesis.voice.Alex"
    voices = engine.getProperty('voices')
    if voc == 'male':
        engine.setProperty('voice', voices[0].id)
    engine.say(doc)
    engine.runAndWait()

    engine.save_to_file(doc, "{}.wav".format(fn))
    engine.stop()
    time.sleep(2) # pause for 2 seconds before narrating next document

         #####################################################
def submit():
    # documents = []
    gender = gender_var.get()
    name = name_entry.get()
    voice = gender_var2.get()
    # result_label.config(text=f"Narrator's gender is {voice} and your name is {name}.")

    for file in docx_files:
        fname=file
        if gender =='male':
            concatenated_files.append("/Users/alex/Desktop/TTBOD/M/" + file)
        else :
            concatenated_files.append("/Users/alex/Desktop/TTBOD/F/" + file)

    for file in concatenated_files:
        document = docx2txt.process(file)
        # Replace "So-and-so" with the subject's name
        if re.search("So-and-so", document):
            newdoc = re.sub("So-and-so", name, document)
            if re.search("so-and-so", newdoc):
                newdoc = re.sub("so-and-so", name, newdoc)
            document = newdoc

        # Hide the main window
        window.withdraw()

        # Create a new window to display the document
        popup = tk.Tk()
        popup.title("Document")
        popup.geometry("1700x1000")
        popup.configure(bg='black')

        # Create a scrollbar
        scrollbar = tk.Scrollbar(popup)
        # scrollbar.pack()
        scrollbar.pack(side=tk.RIGHT, fill=tk.Y)

        # Create a text widget to display the document
        result_text = tk.Text(popup, font="ariel 20", fg='white', bg='black', yscrollcommand=scrollbar.set, wrap=tk.WORD)
        result_text.pack(expand=True, fill=tk.BOTH)

        # Set the scrollbar to the text widget
        scrollbar.config(command=result_text.yview)

        # Insert the document text into the text widget
        result_text.insert(tk.END, document)

        # Update the window to display the result_text widget
        popup.update()

        # Play the speech
        narration(document, voice, fname)

# Create a variable to store the gender selection
gender_var = tk.StringVar()
gender_var2 = tk.StringVar()

# Create a label for the gender entry
gender_label = tk.Label(window, font="ariel 20 bold", text="Choose the gender of the subject:", fg='white', bg='navyblue')
gender_label.pack()

# Create a dropdown menu for the gender
gender_menu = tk.OptionMenu(window, gender_var, "male", "female")
gender_menu.config(width=5)
gender_menu.pack()

# Create a label for the name entry
name_label = tk.Label(window, font="ariel 20 bold",  text="Please provide the name of the subject:", fg='white', bg='navyblue')
name_label.pack()

# Create a entry for the name
name_entry = tk.Entry(window, fg='white', bg='navyblue')
name_entry.pack()

# Create a label for the gender entry
gender_label2 = tk.Label(window, font="ariel 20 bold", text="Narrator's gender:", fg='white', bg='navyblue')
gender_label2.pack()

# Create a dropdown menu for the gender
gender_menu2 = tk.OptionMenu(window, gender_var2, "male", "female")
gender_menu2.config(width=5)
gender_menu2.pack()

# Create a button to submit the entries
submit_button = tk.Button(window, font="ariel 20 bold",  text="Submit", command=submit, fg='black', bg='navyblue')
submit_button.pack()

# Create a label to show the result
result_label = tk.Label(window, font="ariel 20 bold",  text="", fg='white', bg='navyblue')
result_label.pack()

# Create a function to be called when the button is clicked

# Run the window
window.mainloop()

</code>```

`

I try to save each document's narration into a MP3 file. But it does not work.

Body:
Now I tried to save the audio output into wav files (mp3 file cannot play, no sound), but it play the audio but does not save audio files at all. Also this program eventually halted when all files under TTBOD folder are exhausted. I can see the mac wheel spinning when I go to the latest popup window. I suspect the halting might be the reason that mp3 files cannot be save since I can save the .wav file when I only use one document and don't go through all documents. But I am not sure. Can anyone help me to debug the codes? Thank you.

`

import tkinter as tk
import pyttsx3
import docx2txt
import re
import os
import time

# Create a window
window = tk.Tk()
window.title("Please provide the gender and Name of the subject")
window.geometry("500x300")
window.configure(bg='navyblue')

docx_files = []
os.chdir("/Users/alex/Desktop/TTBOD/M")

for file in os.listdir():
    if file.endswith(".docx"):
        docx_files.append(file)
docx_files.sort()
concatenated_files = []
         #####################################################
def narration(doc, voc, fn):
    engine = pyttsx3.init()
    # Set the volume and rate of the speech
    engine.setProperty('volume', 1.0)
    engine.setProperty('rate', 180)
    # voice_id = "/System/Library/LaunchDaemons/com.apple.locate.plist/com.apple.speech.synthesis.voice.Alex"
    voices = engine.getProperty('voices')
    if voc == 'male':
        engine.setProperty('voice', voices[0].id)
    engine.say(doc)
    engine.runAndWait()

    engine.save_to_file(doc, "{}.wav".format(fn))
    engine.stop()
    time.sleep(2) # pause for 2 seconds before narrating next document

         #####################################################
def submit():
    # documents = []
    gender = gender_var.get()
    name = name_entry.get()
    voice = gender_var2.get()
    # result_label.config(text=f"Narrator's gender is {voice} and your name is {name}.")

    for file in docx_files:
        fname=file
        if gender =='male':
            concatenated_files.append("/Users/alex/Desktop/TTBOD/M/" + file)
        else :
            concatenated_files.append("/Users/alex/Desktop/TTBOD/F/" + file)

    for file in concatenated_files:
        document = docx2txt.process(file)
        # Replace "So-and-so" with the subject's name
        if re.search("So-and-so", document):
            newdoc = re.sub("So-and-so", name, document)
            if re.search("so-and-so", newdoc):
                newdoc = re.sub("so-and-so", name, newdoc)
            document = newdoc

        # Hide the main window
        window.withdraw()

        # Create a new window to display the document
        popup = tk.Tk()
        popup.title("Document")
        popup.geometry("1700x1000")
        popup.configure(bg='black')

        # Create a scrollbar
        scrollbar = tk.Scrollbar(popup)
        # scrollbar.pack()
        scrollbar.pack(side=tk.RIGHT, fill=tk.Y)

        # Create a text widget to display the document
        result_text = tk.Text(popup, font="ariel 20", fg='white', bg='black', yscrollcommand=scrollbar.set, wrap=tk.WORD)
        result_text.pack(expand=True, fill=tk.BOTH)

        # Set the scrollbar to the text widget
        scrollbar.config(command=result_text.yview)

        # Insert the document text into the text widget
        result_text.insert(tk.END, document)

        # Update the window to display the result_text widget
        popup.update()

        # Play the speech
        narration(document, voice, fname)

# Create a variable to store the gender selection
gender_var = tk.StringVar()
gender_var2 = tk.StringVar()

# Create a label for the gender entry
gender_label = tk.Label(window, font="ariel 20 bold", text="Choose the gender of the subject:", fg='white', bg='navyblue')
gender_label.pack()

# Create a dropdown menu for the gender
gender_menu = tk.OptionMenu(window, gender_var, "male", "female")
gender_menu.config(width=5)
gender_menu.pack()

# Create a label for the name entry
name_label = tk.Label(window, font="ariel 20 bold",  text="Please provide the name of the subject:", fg='white', bg='navyblue')
name_label.pack()

# Create a entry for the name
name_entry = tk.Entry(window, fg='white', bg='navyblue')
name_entry.pack()

# Create a label for the gender entry
gender_label2 = tk.Label(window, font="ariel 20 bold", text="Narrator's gender:", fg='white', bg='navyblue')
gender_label2.pack()

# Create a dropdown menu for the gender
gender_menu2 = tk.OptionMenu(window, gender_var2, "male", "female")
gender_menu2.config(width=5)
gender_menu2.pack()

# Create a button to submit the entries
submit_button = tk.Button(window, font="ariel 20 bold",  text="Submit", command=submit, fg='black', bg='navyblue')
submit_button.pack()

# Create a label to show the result
result_label = tk.Label(window, font="ariel 20 bold",  text="", fg='white', bg='navyblue')
result_label.pack()

# Create a function to be called when the button is clicked

# Run the window
window.mainloop()

`

I try to save each document's narration into a MP3 file. But it does not work.


问:
How to get a running normalized column in pandas?
I am trying to make a new column with the proportion of the whole, grouping by the "category" and "conservation_status" column. I am not sure if "normalize" is the correct term because after looking at some other posts, it's not same result that I am trying to achieve.

Here is a screenshot of my current dataset.
enter image description here

In this image I have can explain better the problem I'm trying to solve.
enter image description here

So for each row in the count column, I would like to divide it by the sum of counts for that category.

```<code>#species_df dataframe

{'category': {0: 'Mammal', 1: 'Mammal', 2: 'Mammal', 3: 'Mammal', 4: 'Mammal'},
 'scientific_name': {0: 'Clethrionomys gapperi gapperi',
  1: 'Bos bison',
  2: 'Bos taurus',
  3: 'Ovis aries',
  4: 'Cervus elaphus'},
 'common_names': {0: "Gapper's Red-Backed Vole",
  1: 'American Bison, Bison',
  2: 'Aurochs, Aurochs, Domestic Cattle (Feral), Domesticated Cattle',
  3: 'Domestic Sheep, Mouflon, Red Sheep, Sheep (Feral)',
  4: 'Wapiti Or Elk'},
 'conservation_status': {0: 'None',
  1: 'None',
  2: 'None',
  3: 'None',
  4: 'None'}}
</code>```

For example I am looking to create "new_column" adjacent "count", for the Amphibian "category".

count
new_column

1
.01

73
.91

4
.05

2
.03

I have tried:

```<code>species_df.groupby(['category', 'conservation_status']).scientific_name.count() / species_df.groupby('category').scientific_name.count()
</code>```

It returns:

```<code>TypeError: incompatible index of inserted column with frame index
</code>```

I was thinking something similar to SQL Window functions, but I just can't get around this one. Thanks for any help!

Body:
I am trying to make a new column with the proportion of the whole, grouping by the "category" and "conservation_status" column. I am not sure if "normalize" is the correct term because after looking at some other posts, it's not same result that I am trying to achieve.

Here is a screenshot of my current dataset.
enter image description here

In this image I have can explain better the problem I'm trying to solve.
enter image description here

So for each row in the count column, I would like to divide it by the sum of counts for that category.

#species_df dataframe

{'category': {0: 'Mammal', 1: 'Mammal', 2: 'Mammal', 3: 'Mammal', 4: 'Mammal'},
 'scientific_name': {0: 'Clethrionomys gapperi gapperi',
  1: 'Bos bison',
  2: 'Bos taurus',
  3: 'Ovis aries',
  4: 'Cervus elaphus'},
 'common_names': {0: "Gapper's Red-Backed Vole",
  1: 'American Bison, Bison',
  2: 'Aurochs, Aurochs, Domestic Cattle (Feral), Domesticated Cattle',
  3: 'Domestic Sheep, Mouflon, Red Sheep, Sheep (Feral)',
  4: 'Wapiti Or Elk'},
 'conservation_status': {0: 'None',
  1: 'None',
  2: 'None',
  3: 'None',
  4: 'None'}}

For example I am looking to create "new_column" adjacent "count", for the Amphibian "category".

count
new_column

1
.01

73
.91

4
.05

2
.03

I have tried:

species_df.groupby(['category', 'conservation_status']).scientific_name.count() / species_df.groupby('category').scientific_name.count()

It returns:

TypeError: incompatible index of inserted column with frame index

I was thinking something similar to SQL Window functions, but I just can't get around this one. Thanks for any help!


问:
Macbook pro m1 selenium starting tests in intel chorome driver
I have a macbook pro m1 series macbook.

I'm running selenium tests via Intellij.I found that my tests were very slow when I used the chorome driver while doing my tests.After a long research, the problem is that my macbook with apple slicon processor is running chorome with intel driver.That's why my tests are so slow.how can i fix this problem.

I deleted and installed Chrome, I did a lot of research, but I couldn't find a complete solution.


问:
How do I replace Messages app on Wear OS?
I want to create an app for Wear OS to replace the default Messages app for handling SMS/MMS messages. To start with, my app will get messages from the phone, relying on the phone to communicate with the cellular carrier. What does my replacement app need to do to send and receive SMS/MMS messages from the phone?

Can my app communicate with the default Google messaging app on the phone (so I don't have to write a phone app too)? Is that protocol/API documented somewhere?

Does my app need to register with the watch to become the default message handler and disable the default app? If so, how do I do that?


问:
pytest a script using stdin from argparse
I have an argparse script using stdin:

$ tree
.
├── go.py
└── mypytest.py
$

$ cat go.py
# echo '[{"k": ["1", "2"]}]' | python go.py -
import argparse, json

parser = argparse.ArgumentParser()
parser.add_argument('json', nargs='?', type=argparse.FileType('r'))
args = parser.parse_args()
with args.json as f:
  obj = json.load(f)
print(obj)
$
```
<p>The script is working well:</p>
```$ echo '[{"k": ["1", "2"]}]' | python go.py -
[{'k': ['1', '2']}]
$
```
<p>I'm using pytest and https://pypi.org/project/pytest-console-scripts/ to test scripts:</p>
<pre class="lang-py prettyprint-override"><code>$ cat mypytest.py
def test_stdin(script_runner, monkeypatch):
    import io
    monkeypatch.setattr('sys.stdin', io.StringIO('[{"k": ["1", "2"]}]'))
    ret = script_runner.run("go.py", "-", print_result=True)
    assert ret.success
    assert "k" in ret.stdout
    assert ret.stderr == ""
$
</code>```

pytest does not succed to forward from stdin the stream to the pipe:

```<code>$ pytest mypytest.py
================================================ test session starts ================================================
platform linux -- Python 3.10.4, pytest-7.2.0, pluggy-1.0.0
rootdir: /tmp/aaaa
plugins: mock-3.10.0, cov-4.0.0, console-scripts-1.3.1
collected 1 item

mypytest.py F                                                                                [100%]

=========================================
 FAILURES ===============================
____________________________________________
test_stdin[inprocess] ____________________________________________

script_runner = <ScriptRunner inprocess>, monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fc74ba75a50>

    def test_stdin(script_runner, monkeypatch):
        import io
        monkeypatch.setattr('sys.stdin', io.StringIO('[{"k": ["1", "2"]}]'))
        ret = script_runner.run("go.py", "-", print_result=True)
>       assert ret.success
E       assert False
E        +  where False = <pytest_console_scripts.RunResult object at 0x7fc74ba75c90>.success

mypytest.py:5: AssertionError
------------------------------------------------------------------------------------ Captured stdout call -------------------------------------------------------------------------------------
# Running console script: go.py -
# Script return code: 1
# Script stdout:

# Script stderr:
Traceback (most recent call last):
  File "/home/luis/.pyenv/versions/3.10.4/envs/doc/lib/python3.10/site-packages/pytest_console_scripts.py", line 196, in exec_script
    exec(compiled, {'__name__': '__main__'})
  File "<_io.TextIOWrapper name='/tmp/aaaa/go.py' mode='rt' encoding='utf-8'>", line 7, in <module>

  File "/home/luis/.pyenv/versions/3.10.4/lib/python3.10/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/home/luis/.pyenv/versions/3.10.4/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)

  File "/home/luis/.pyenv/versions/3.10.4/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/luis/.pyenv/versions/3.10.4/lib/python3.10/json/decoder.py", line 355, in raw_decode

    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

====================================== short test summary info ======================================
FAILED mypytest.py::test_stdin[inprocess] - assert False
======================================= 1 failed in 0.15s =======================================
$
</code>```

the cmd bellow:

```<code>$ python -m pytest mypytest.py
</code>```

give the same result

more debug with -s -v

```<code>$ python -m pytest mypytest.py -v -s
================================= test session starts ==================================
platform linux -- Python 3.10.4, pytest-7.2.0, pluggy-1.0.0 -- /home/luis/.pyenv/versions/doc/bin/python
cachedir: .pytest_cache
rootdir: /tmp/aaaa
plugins: mock-3.10.0, cov-4.0.0, console-scripts-1.3.1
collected 1 item

mypytest.py::test_stdin[inprocess] # Running console script: go.py -
# Script return code: 1
# Script stdout:

# Script stderr:
Traceback (most recent call last):
  File "/home/luis/.pyenv/versions/3.10.4/envs/doc/lib/python3.10/site-packages/pytest_console_scripts.py", line 196, in exec_script
    exec(compiled, {'__name__': '__main__'})
  File "<_io.TextIOWrapper name='/tmp/aaaa/go.py' mode='rt' encoding='utf-8'>", line 7, in <module>
  File "/home/luis/.pyenv/versions/3.10.4/lib/python3.10/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/home/luis/.pyenv/versions/3.10.4/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/home/luis/.pyenv/versions/3.10.4/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/luis/.pyenv/versions/3.10.4/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

FAILED

======================================= FAILURES =======================================
________________________________ test_stdin[inprocess] _________________________________

script_runner = <ScriptRunner inprocess>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7f2b4307d630>

    def test_stdin(script_runner, monkeypatch):
        import io
        monkeypatch.setattr('sys.stdin', io.StringIO('[{"k": ["1", "2"]}]'))
        ret = script_runner.run("go.py", "-", print_result=True)
>       assert ret.success
E       assert False
E        +  where False = <pytest_console_scripts.RunResult object at 0x7f2b430cf610>.success

mypytest.py:5: AssertionError
=============================== short test summary info ================================
FAILED mypytest.py::test_stdin[inprocess] - assert False
================================== 1 failed in 0.14s ===================================
$

</code>```

Body:
I have an argparse script using stdin:

$ tree
.
├── go.py
└── mypytest.py
$

$ cat go.py
# echo '[{"k": ["1", "2"]}]' | python go.py -
import argparse, json

parser = argparse.ArgumentParser()
parser.add_argument('json', nargs='?', type=argparse.FileType('r'))
args = parser.parse_args()
with args.json as f:
  obj = json.load(f)
print(obj)
$

The script is working well:

$ echo '[{"k": ["1", "2"]}]' | python go.py -
[{'k': ['1', '2']}]
$

I'm using pytest and https://pypi.org/project/pytest-console-scripts/ to test scripts:

$ cat mypytest.py
def test_stdin(script_runner, monkeypatch):
    import io
    monkeypatch.setattr('sys.stdin', io.StringIO('[{"k": ["1", "2"]}]'))
    ret = script_runner.run("go.py", "-", print_result=True)
    assert ret.success
    assert "k" in ret.stdout
    assert ret.stderr == ""
$

pytest does not succed to forward from stdin the stream to the pipe:

$ pytest mypytest.py
================================================ test session starts ================================================
platform linux -- Python 3.10.4, pytest-7.2.0, pluggy-1.0.0
rootdir: /tmp/aaaa
plugins: mock-3.10.0, cov-4.0.0, console-scripts-1.3.1
collected 1 item

mypytest.py F                                                                                [100%]

=========================================
 FAILURES ===============================
____________________________________________
test_stdin[inprocess] ____________________________________________

script_runner =


问:
build.gradle: all buildscript {} blocks must appear before any plugins {} blocks in the script
My build.gradle file doesn't compile.
I have the following warning:

Build file 'C:\Users\User\AndroidStudioProjects**\build.gradle' line: 7

Could not compile build file 'C:\Users\User\AndroidStudioProjects**\build.gradle'.

startup failed:
build file 'C:\Users\User\AndroidStudioProjects**\build.gradle': 7: all buildscript {} blocks must appear before any plugins {} blocks in the script

This is my build.gradle code

```<code>// Top-level build file where you can add configuration options common to all sub-
   projects/modules.
plugins {
    id 'com.android.application' version '7.3.1' apply false
    id 'com.android.library' version '7.3.1' apply false
}

buildscript {
    repositories {
        google()
        mavenCentral()
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}
</code>```

Body:
My build.gradle file doesn't compile.
I have the following warning:

Build file 'C:\Users\User\AndroidStudioProjects**\build.gradle' line: 7

Could not compile build file 'C:\Users\User\AndroidStudioProjects**\build.gradle'.

startup failed:
build file 'C:\Users\User\AndroidStudioProjects**\build.gradle': 7: all buildscript {} blocks must appear before any plugins {} blocks in the script

This is my build.gradle code

// Top-level build file where you can add configuration options common to all sub-
   projects/modules.
plugins {
    id 'com.android.application' version '7.3.1' apply false
    id 'com.android.library' version '7.3.1' apply false
}

buildscript {
    repositories {
        google()
        mavenCentral()
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}


问:
React/TypeScript keyboard events : Property 'value' does not exist on 'EventTarget'
I'm trying to figure out how I should type the input event of my handleEnter function.

I have the following TS error : Property 'value' does not exist on type 'EventTarget'. I tried to use ChangeEvent, but then key property does not exist on that type.

const handleEnter = (e: KeyboardEvent<HTMLInputElement>) => {
    if (e.key === 'Enter') {
      emailSetter(newEmail);
      e.target.value = '';
    }
  };
```


问:
Mobile Dropdown Design Next.js (CSS or Tailwind)
I want to make my mobile menu have a dropdown when the main labels are clicked as they do for the regular desktop navigation. The dropdown works for the mobile menu, but it displays it on the left side of the main label. What I want it to do is expand or toggle/show underneath the top label when clicked if that makes sense. An example would be the mobile menu here: https://www.youtube.com/watch?v=JEV7WE0UBiQ&t=2738s, but in my case, I only need to go one dropdown deep.

Here are my Navbar and Dropdown components for review. I also provided the relevant CSS as well.

I know there is much to be improved and there are other small errors I am getting, but if I can get help on this part, that would be great. I've actually been using the help of ChatGPT to assist with some things, but it can only get me so far. Sometimes it's great, and other times I just want to punch it, lol!

```<code>import React, { useState } from "react";
import Link from "next/link";
import Dropdown from "./Dropdown";
import { menuItems, mobileMenuItems } from "./MenuItems";

// Import the FontAwesomeIcon component
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";

// import the icons you need
import {
  faChevronDown,
  faBars,
  faXmark,
} from "@fortawesome/free-solid-svg-icons";

function Navbar() {
  const [click, setClick] = useState(false);
  const [dropdownOpen, setDropdownOpen] = useState({
    dropdown1: false,
    dropdown2: false,
    dropdown3: false,
  });

  const handleClick = () => {
    setClick(!click);
    setDropdownOpen({ dropdown1: false, dropdown2: false, dropdown3: false });
  };

  const closeMobileMenu = () => {
    setClick(false);
    setDropdownOpen({ dropdown1: false, dropdown2: false, dropdown3: false });
  };

  const toggleDropdown = (dropdown) => {
    if (window.innerWidth < 950) {
      setDropdownOpen({ [dropdown]: !dropdownOpen[dropdown] });
    } else {
      setDropdownOpen({ [dropdown]: !dropdownOpen[dropdown] });
    }
  };

  return (
    <nav>
      <div className="container mx-auto px-10 mb-8">
        <div className="relative border-b w-full inline-block border-blue-400 py-8">
          <div className="absolute inset-y-0 left-0 flex items-center sm:hidden">
            {/* Mobile menu button*/}
            <button
              className="inline-flex p-2 rounded-md text-gray-400 hover:text-white hover:bg-violet-700 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white text-3xl md:hidden"
              onClick={() => {
                setClick(!click);
              }}
            >
              <FontAwesomeIcon icon={click ? faXmark : faBars} />
            </button>
          </div>
          <div className="flex-1 flex items-center justify-center sm:items-stretch sm:justify-start">
            <div className="flex-1 flex flex-shrink-0 flex px-12 items-center ">
              <h1 className="font-bold text-4xl cursor-pointer text-white">
                My<span className="text-blue-500">site</span>
              </h1>
            </div>
            <div className="hidden md:float-left md:contents">
              <ul className="nav-menu">
                {menuItems.map((link, index) => (
                  <li
                    key={index}
                    className="nav-item"
                    onMouseEnter={
                      link.dropdownType
                        ? () => toggleDropdown(link.dropdownType)
                        : null
                    }
                    onMouseLeave={
                      link.dropdownType
                        ? () => toggleDropdown(link.dropdownType)
                        : null
                    }
                  >
                    <Link href={link.href}>
                      <a className="menuItems nav-links">
                        {link.icon && (
                          <FontAwesomeIcon
                            className="px-2"
                            icon={link.icon}
                            style={{ fontSize: 20, color: link.color }}
                          />
                        )}
                        {link.label}
                        {link.dropdownType && (
                          <span className="faChevronDown">
                            <FontAwesomeIcon
                              icon={faChevronDown}
                            ></FontAwesomeIcon>
                          </span>
                        )}
                      </a>
                    </Link>
                    {link.dropdownType && dropdownOpen[link.dropdownType] && (
                      <Dropdown type={link.dropdownType} />
                    )}
                  </li>
                ))}
              </ul>
            </div>
          </div>
        </div>
      </div>

      {/* ----------------------Hamburger Menu----------------------- */}

      <ul
        className={click ? "mobileNav-menu active" : "sm:hidden mobileNav-menu"}
      >
        {mobileMenuItems.map((link, index) => (
          <li key={index} className="nav-item">
            <Link href={link.href}>
              <a
                onClick={
                  link.dropdownType
                    ? () => toggleDropdown(link.dropdownType)
                    : closeMobileMenu
                }
                className="menuItems nav-links dropdown-toggle"
              >
                {link.icon && (
                  <FontAwesomeIcon
                    className="px-2"
                    icon={link.icon}
                    style={{ fontSize: 20, color: link.color }}
                  />
                )}
                {link.label}
                {link.dropdownType && (
                  <span className="faChevronDown">
                    <FontAwesomeIcon icon={faChevronDown}></FontAwesomeIcon>
                  </span>
                )}
              </a>
            </Link>
            {link.dropdownType && dropdownOpen[link.dropdownType] && (
              <ul className="dropdown-menu">
                <Dropdown type={link.dropdownType} onClick={closeMobileMenu} />
              </ul>
            )}
          </li>
        ))}
      </ul>
    </nav>
  );
}

export default Navbar;
</code>```

and the Dropdown component

```<code>import React, { useState, useEffect } from "react";
import Link from "next/link";

import {
  getFeaturedArticlesCategories,
  getNewsCategories,
  getReviewsCategories,
} from "../services";

function useCategories() {
  const [categories, setCategories] = useState({
    featured: [],
    news: [],
    reviews: [],
  });

  useEffect(() => {
    let cancel = false;

    const fetchCategories = async () => {
      const featured = await getFeaturedArticlesCategories();
      const news = await getNewsCategories();
      const reviews = await getReviewsCategories();

      if (!cancel) {
        setCategories({ featured, news, reviews });
      }
    };

    fetchCategories();

    return () => {
      cancel = true;
    };
  }, []);

  return categories;
}

function Dropdown({ type, onClick }) {
  const [click, setClick] = useState(false);
  const categories = useCategories();

  const handleClick = () => setClick(!click);

  return (
    <>
      <ul
        onClick={() => {
          handleClick();
          onClick();
        }}
        className={click ? "dropdown-menu clicked" : "dropdown-menu"}
      >
        {categories[type].map((item, { active }) => (
          <Link href={`/${type}/${item.slug}`} key={item.slug}>
            <a
              className={`group flex justify-center items-center px-4 py-2 text-sm font-semibold cursor-pointer ${
                active
                  ? "text-gray-700"
                  : "menuItems hover:bg-indigo-500 transition-all duration-500 ease-in"
              }`}
            >
              {item.name}
            </a>
          </Link>
        ))}
      </ul>
    </>
  );
}
export default Dropdown;
</code>```

and the CSS

```<code>//Nav Menu
.menuItems {
  &:hover {
    color: rgb(255, 0, 0);
  }
}

.navbar {
  width: 90%;
  height: 6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 5rem;
  border-bottom-width: 1px;
  border-color: #60a5fa;
}

.navbar-logo {
  color: #fff;
  justify-self: start;
  margin-left: -1rem;
  cursor: pointer;
  text-decoration: none;
  line-height: 2.5rem;
  font-size: 2.25rem;
  font-weight: 700;
}

.nav-menu {
  display: grid;
  grid-template-columns: repeat(5, auto);
  grid-gap: 1rem;
  list-style: none;
  text-align: center;
  width: 70vw;
  justify-content: end;
  margin-right: 2rem;
}

.nav-item {
  display: flex;
  align-items: center;
  height: 4rem;
}

.nav-links {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  display: inline-flex;
  font-weight: 600;
  justify-content: center;
  width: 100%;
  cursor: pointer;
}

.nav-links:hover {
  background-color: #1888ff;
  border-radius: 4px;
  transition: all 0.2s ease-out;
}

.faBars {
  color: #fff;
}

.nav-links-mobile {
  display: none;
}

.menu-icon {
  display: none;
}

@media screen and (max-width: 950px) {
  .NavbarItems {
    position: relative;
  }

  .mobileNav-menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 90vh;
    position: absolute;
    padding-top: 5rem;
    padding-bottom: 15rem;
    padding-left: 1rem;
    bottom: 0;
    top: 5rem;
    left: -100%;
    opacity: 1;
    transition: all 0.5s ease;
  }

  .mobileNav-menu.active {
    background: #242222;
    left: 0;
    opacity: 1;
    transition: all 0.5s ease;
    z-index: 1;
  }

  .nav-links {
    text-align: center;
    padding: 2rem;
    width: 100%;
    display: table;
  }

  .nav-links:hover {
    background-color: #1888ff;
    border-radius: 0;
  }

  .navbar-logo {
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(25%, 50%);
  }

  .menu-icon {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(-100%, 60%);
    font-size: 1.8rem;
    cursor: pointer;
  }

  .faXmark {
    color: #fff;
    font-size: 2rem;
  }

  .faChevronDown {
    margin-left: 0.5rem;
    padding: 0.5rem;
  }

  .nav-links-mobile {
    display: block;
    text-align: center;
    padding: 1.5rem;
    margin: 2rem auto;
    border-radius: 4px;
    width: 80%;
    background: #1888ff;
    text-decoration: none;
    color: #fff;
    font-size: 1.5rem;
  }

  .nav-links-mobile:hover {
    background: #fff;
    color: #1888ff;
    transition: 250ms;
  }
}

//Dropdown

.dropdown-menu {
  background: rgb(184, 183, 231);
  width: 10rem;
  position: absolute;
  border-radius: 0.375rem;
  top: 6rem;
  list-style: none;
  text-align: start;
  z-index: 10;
}

.dropdown-menu li {
  background: #1888ff;
  cursor: pointer;
}

.dropdown-menu li:hover {
  background: #5cabff;
}

.dropdown-menu.clicked {
  display: none;
}

.dropdown-link {
  display: block;
  height: 100%;
  width: 100%;
  text-decoration: none;
  color: #fff;
  padding: 16px;
}
</code>```

Body:
I want to make my mobile menu have a dropdown when the main labels are clicked as they do for the regular desktop navigation. The dropdown works for the mobile menu, but it displays it on the left side of the main label. What I want it to do is expand or toggle/show underneath the top label when clicked if that makes sense. An example would be the mobile menu here: https://www.youtube.com/watch?v=JEV7WE0UBiQ&t=2738s, but in my case, I only need to go one dropdown deep.

Here are my Navbar and Dropdown components for review. I also provided the relevant CSS as well.

I know there is much to be improved and there are other small errors I am getting, but if I can get help on this part, that would be great. I've actually been using the help of ChatGPT to assist with some things, but it can only get me so far. Sometimes it's great, and other times I just want to punch it, lol!

import React, { useState } from "react";
import Link from "next/link";
import Dropdown from "./Dropdown";
import { menuItems, mobileMenuItems } from "./MenuItems";

// Import the FontAwesomeIcon component
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";

// import the icons you need
import {
  faChevronDown,
  faBars,
  faXmark,
} from "@fortawesome/free-solid-svg-icons";

function Navbar() {
  const [click, setClick] = useState(false);
  const [dropdownOpen, setDropdownOpen] = useState({
    dropdown1: false,
    dropdown2: false,
    dropdown3: false,
  });

  const handleClick = () => {
    setClick(!click);
    setDropdownOpen({ dropdown1: false, dropdown2: false, dropdown3: false });
  };

  const closeMobileMenu = () => {
    setClick(false);
    setDropdownOpen({ dropdown1: false, dropdown2: false, dropdown3: false });
  };

  const toggleDropdown = (dropdown) => {
    if (window.innerWidth < 950) {
      setDropdownOpen({ [dropdown]: !dropdownOpen[dropdown] });
    } else {
      setDropdownOpen({ [dropdown]: !dropdownOpen[dropdown] });
    }
  };

  return (

            {/* Mobile menu button*/}
            <button
              className="inline-flex p-2 rounded-md text-gray-400 hover:text-white hover:bg-violet-700 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white text-3xl md:hidden"
              onClick={() => {
                setClick(!click);
              }}
            >
              <FontAwesomeIcon icon={click ? faXmark : faBars} />
            </button>

                Mysite

                {menuItems.map((link, index) => (

 toggleDropdown(link.dropdownType)
                        : null
                    }
                    onMouseLeave={
                      link.dropdownType
                        ? () => toggleDropdown(link.dropdownType)
                        : null
                    }
                  >
                    <Link href={link.href}>

                        {link.icon && (
                          <FontAwesomeIcon
                            className="px-2"
                            icon={link.icon}
                            style={{ fontSize: 20, color: link.color }}
                          />
                        )}
                        {link.label}
                        {link.dropdownType && (

                            <FontAwesomeIcon
                              icon={faChevronDown}
                            ></FontAwesomeIcon>

                        )}

                    </Link>
                    {link.dropdownType && dropdownOpen[link.dropdownType] && (
                      <Dropdown type={link.dropdownType} />
                    )}

                ))}

      {/* ----------------------Hamburger Menu----------------------- */}

        {mobileMenuItems.map((link, index) => (

            <Link href={link.href}>
               toggleDropdown(link.dropdownType)
                    : closeMobileMenu
                }
                className="menuItems nav-links dropdown-toggle"
              >
                {link.icon && (
                  <FontAwesomeIcon
                    className="px-2"
                    icon={link.icon}
                    style={{ fontSize: 20, color: link.color }}
                  />
                )}
                {link.label}
                {link.dropdownType && (

                    <FontAwesomeIcon icon={faChevronDown}></FontAwesomeIcon>

                )}

            </Link>
            {link.dropdownType && dropdownOpen[link.dropdownType] && (

                <Dropdown type={link.dropdownType} onClick={closeMobileMenu} />

            )}

        ))}

  );
}

export default Navbar;

and the Dropdown component

import React, { useState, useEffect } from "react";
import Link from "next/link";

import {
  getFeaturedArticlesCategories,
  getNewsCategories,
  getReviewsCategories,
} from "../services";

function useCategories() {
  const [categories, setCategories] = useState({
    featured: [],
    news: [],
    reviews: [],
  });

  useEffect(() => {
    let cancel = false;

    const fetchCategories = async () => {
      const featured = await getFeaturedArticlesCategories();
      const news = await getNewsCategories();
      const reviews = await getReviewsCategories();

      if (!cancel) {
        setCategories({ featured, news, reviews });
      }
    };

    fetchCategories();

    return () => {
      cancel = true;
    };
  }, []);

  return categories;
}

function Dropdown({ type, onClick }) {
  const [click, setClick] = useState(false);
  const categories = useCategories();

  const handleClick = () => setClick(!click);

  return (
    <>

 {
          handleClick();
          onClick();
        }}
        className={click ? "dropdown-menu clicked" : "dropdown-menu"}
      >
        {categories[type].map((item, { active }) => (
          <Link href={`/${type}/${item.slug}`} key={item.slug}>

              {item.name}

          </Link>
        ))}

    </>
  );
}
export default Dropdown;

and the CSS

//Nav Menu
.menuItems {
  &:hover {
    color: rgb(255, 0, 0);
  }
}

.navbar {
  width: 90%;
  height: 6rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 5rem;
  border-bottom-width: 1px;
  border-color: #60a5fa;
}

.navbar-logo {
  color: #fff;
  justify-self: start;
  margin-left: -1rem;
  cursor: pointer;
  text-decoration: none;
  line-height: 2.5rem;
  font-size: 2.25rem;
  font-weight: 700;
}

.nav-menu {
  display: grid;
  grid-template-columns: repeat(5, auto);
  grid-gap: 1rem;
  list-style: none;
  text-align: center;
  width: 70vw;
  justify-content: end;
  margin-right: 2rem;
}

.nav-item {
  display: flex;
  align-items: center;
  height: 4rem;
}

.nav-links {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  display: inline-flex;
  font-weight: 600;
  justify-content: center;
  width: 100%;
  cursor: pointer;
}

.nav-links:hover {
  background-color: #1888ff;
  border-radius: 4px;
  transition: all 0.2s ease-out;
}

.faBars {
  color: #fff;
}

.nav-links-mobile {
  display: none;
}

.menu-icon {
  display: none;
}

@media screen and (max-width: 950px) {
  .NavbarItems {
    position: relative;
  }

  .mobileNav-menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 90vh;
    position: absolute;
    padding-top: 5rem;
    padding-bottom: 15rem;
    padding-left: 1rem;
    bottom: 0;
    top: 5rem;
    left: -100%;
    opacity: 1;
    transition: all 0.5s ease;
  }

  .mobileNav-menu.active {
    background: #242222;
    left: 0;
    opacity: 1;
    transition: all 0.5s ease;
    z-index: 1;
  }

  .nav-links {
    text-align: center;
    padding: 2rem;
    width: 100%;
    display: table;
  }

  .nav-links:hover {
    background-color: #1888ff;
    border-radius: 0;
  }

  .navbar-logo {
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(25%, 50%);
  }

  .menu-icon {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(-100%, 60%);
    font-size: 1.8rem;
    cursor: pointer;
  }

  .faXmark {
    color: #fff;
    font-size: 2rem;
  }

  .faChevronDown {
    margin-left: 0.5rem;
    padding: 0.5rem;
  }

  .nav-links-mobile {
    display: block;
    text-align: center;
    padding: 1.5rem;
    margin: 2rem auto;
    border-radius: 4px;
    width: 80%;
    background: #1888ff;
    text-decoration: none;
    color: #fff;
    font-size: 1.5rem;
  }

  .nav-links-mobile:hover {
    background: #fff;
    color: #1888ff;
    transition: 250ms;
  }
}

//Dropdown

.dropdown-menu {
  background: rgb(184, 183, 231);
  width: 10rem;
  position: absolute;
  border-radius: 0.375rem;
  top: 6rem;
  list-style: none;
  text-align: start;
  z-index: 10;
}

.dropdown-menu li {
  background: #1888ff;
  cursor: pointer;
}

.dropdown-menu li:hover {
  background: #5cabff;
}

.dropdown-menu.clicked {
  display: none;
}

.dropdown-link {
  display: block;
  height: 100%;
  width: 100%;
  text-decoration: none;
  color: #fff;
  padding: 16px;
}


问:
How do I debug a exit-code failure for the specific service for my app?
I'm trying to run a Flask app through Apache. When I run

```<code>systemctl list-units --type=service

</code>```

I see that the unit for this specific app, "SITENAME.service" has failed.

When I run

```<code>sudo systemctl status SITENAME.service
I
</code>```

get an error saying:

```<code>Loaded: loaded (/etc/systemd/system/SITENAMEenv.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2023-01-01 21:26:25 UTC; 1min 1s ago
Process: 787 ExecStart=/home/ubuntu/SITENAME/SITENAMEenv/bin/uwsgi --ini SITENAMEenv.ini (code=exited, status=1/FAILURE)
Main PID: 787 (code=exited, status=1/FAILURE) Jan 01 21:26:25 ip-172-31-88-10 systemd[1]:

SITENAME.service: Main process exited, code=exited, status=1/FAILURE Jan 01 21:26:25 ip-172-31-88-10 systemd[1]: SITENAME.service: Failed with result 'exit-code'.
</code>```

Where can I get more information on this failure? I can't tell if this is a python issue in the actual application code, or something else.

The site stopped working a little while ago, but there were no major changes to the code. The service that is not working has the description "uWSGI instance to serve SITENAME"

Body:
I'm trying to run a Flask app through Apache. When I run

systemctl list-units --type=service

I see that the unit for this specific app, "SITENAME.service" has failed.

When I run

sudo systemctl status SITENAME.service
I

get an error saying:

Loaded: loaded (/etc/systemd/system/SITENAMEenv.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2023-01-01 21:26:25 UTC; 1min 1s ago
Process: 787 ExecStart=/home/ubuntu/SITENAME/SITENAMEenv/bin/uwsgi --ini SITENAMEenv.ini (code=exited, status=1/FAILURE)
Main PID: 787 (code=exited, status=1/FAILURE) Jan 01 21:26:25 ip-172-31-88-10 systemd[1]:

SITENAME.service: Main process exited, code=exited, status=1/FAILURE Jan 01 21:26:25 ip-172-31-88-10 systemd[1]: SITENAME.service: Failed with result 'exit-code'.

Where can I get more information on this failure? I can't tell if this is a python issue in the actual application code, or something else.

The site stopped working a little while ago, but there were no major changes to the code. The service that is not working has the description "uWSGI instance to serve SITENAME"


问:
Waiting for service /gazebo/spawn_urdf_model
I am following a tutorial to build a custom robot in Ros. I followed in detail this tutorial: https://www.youtube.com/watch?v=uvPFDQxfm2w&t=70s
I am trying to make my robot called "mrm" spawn in gazebo.
When I launch this spawn.launch file:

```<code><?xml version="1.0" ?>

<launch>
    <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find mrm_description)/urdf/mrm.xacro'"/>

    <arg name="x" default="0"/>
    <arg name="y" default="0"/>
    <arg name="z" default="0.5"/>

    <node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
        args="-param robot_description -urdf -model mrm -x $(arg x) -y $(arg y) -z $(arg z)"/>

</launch>
</code>```

No error messages are appearing but everything is stuck: the robot doesn't appear and Gazebo is not open. I can only see this message in the terminal:

```<code>SUMMARY
========

PARAMETERS
 * /robot_description: <?xml version="1....
 * /rosdistro: noetic
 * /rosversion: 1.15.15

NODES
  /
    mybot_spawn (gazebo_ros/spawn_model)

auto-starting new master
process[master]: started with pid [35299]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to e34362f0-8a2f-11ed-a9b7-ef7c5e0a5b08
process[rosout-1]: started with pid [35309]
started core service [/rosout]
process[mybot_spawn-2]: started with pid [35312]
[INFO] [1672617380.741138]: Loading model XML from ros parameter robot_description
[INFO] [1672617380.745654]: Waiting for service /gazebo/spawn_urdf_model

</code>```

It appears it is searching for the model of the robot as reported by:
https://answers.ros.org/question/383910/generic-question-about-the-error-waiting-for-service-gazebospawn_urdf_model/

I found an old similar question:
Error: gazebo_ros_control plugin is waiting for model URDF in parameter
But I do not think it fits my case.

I tried to create a new simplified model and launched it in a different workspace where I am already working with Franka model in gazebo but when I launch my custom robot the same issue appears.

If someone has some hints about how to solve this problem I would be very grateful.

Lorenzo

Body:
I am following a tutorial to build a custom robot in Ros. I followed in detail this tutorial: https://www.youtube.com/watch?v=uvPFDQxfm2w&t=70s
I am trying to make my robot called "mrm" spawn in gazebo.
When I launch this spawn.launch file:

<?xml version="1.0" ?>

<launch>
    <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find mrm_description)/urdf/mrm.xacro'"/>

    <arg name="x" default="0"/>
    <arg name="y" default="0"/>
    <arg name="z" default="0.5"/>

    <node name="mybot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen"
        args="-param robot_description -urdf -model mrm -x $(arg x) -y $(arg y) -z $(arg z)"/>

</launch>

No error messages are appearing but everything is stuck: the robot doesn't appear and Gazebo is not open. I can only see this message in the terminal:

SUMMARY
========

PARAMETERS
 * /robot_description: <?xml version="1....
 * /rosdistro: noetic
 * /rosversion: 1.15.15

NODES
  /
    mybot_spawn (gazebo_ros/spawn_model)

auto-starting new master
process[master]: started with pid [35299]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to e34362f0-8a2f-11ed-a9b7-ef7c5e0a5b08
process[rosout-1]: started with pid [35309]
started core service [/rosout]
process[mybot_spawn-2]: started with pid [35312]
[INFO] [1672617380.741138]: Loading model XML from ros parameter robot_description
[INFO] [1672617380.745654]: Waiting for service /gazebo/spawn_urdf_model

It appears it is searching for the model of the robot as reported by:
https://answers.ros.org/question/383910/generic-question-about-the-error-waiting-for-service-gazebospawn_urdf_model/

I found an old similar question:
Error: gazebo_ros_control plugin is waiting for model URDF in parameter
But I do not think it fits my case.

I tried to create a new simplified model and launched it in a different workspace where I am already working with Franka model in gazebo but when I launch my custom robot the same issue appears.

If someone has some hints about how to solve this problem I would be very grateful.

Lorenzo


问:
accessing nested objects in mongo using node.js
I'm unable to access a nested object in a mongo doc. None of the online solutions or even mongo documentation has been able to resolve my problem.

```<code>{
 characterName:character.characterName,
 0:{slotName:"", slotCount:0},
 1:{slotName:"", slotCount:0},
 2:{slotName:"", slotCount:0},
 3:{slotName:"", slotCount:0}
}
</code>```

I want to access any of the numbered keys via an api and change the value of slotCount.

I've tried everything I could find online including the below.

```<code>db.Inventories.updateOne(
  {characterName:user.selectedCharacter.CharacterName},
  {$set:{[req.query.slotNumber].0.slotCount:req.query.itemCount}}
);
</code>```

I'm getting syntax errors from VSCode as it's not expecting a period . after the first key on the last line of code.

SOLUTION: create a var that stores a string

```<code>key =`${req.query.slotNumber}.slotCount`
</code>```

and then use square brackets when calling the key

```<code>db.Inventories.updateOne(
 {characterName:user.selectedCharacter.CharacterName},
 {$inc:{[key]:-1}}
</code>```

Body:
I'm unable to access a nested object in a mongo doc. None of the online solutions or even mongo documentation has been able to resolve my problem.

{
 characterName:character.characterName,
 0:{slotName:"", slotCount:0},
 1:{slotName:"", slotCount:0},
 2:{slotName:"", slotCount:0},
 3:{slotName:"", slotCount:0}
}

I want to access any of the numbered keys via an api and change the value of slotCount.

I've tried everything I could find online including the below.

db.Inventories.updateOne(
  {characterName:user.selectedCharacter.CharacterName},
  {$set:{[req.query.slotNumber].0.slotCount:req.query.itemCount}}
);

I'm getting syntax errors from VSCode as it's not expecting a period . after the first key on the last line of code.

SOLUTION: create a var that stores a string

key =`${req.query.slotNumber}.slotCount`

and then use square brackets when calling the key

db.Inventories.updateOne(
 {characterName:user.selectedCharacter.CharacterName},
 {$inc:{[key]:-1}}


问:
build fails on all the online deployment platforms like heroku, render, raliway, cyclic for my nodejs application
I tried deploying my nodejs app on various platform like render, railway and cyclic but all the platform gave me same error build fail. However with the same build and start scripts I don't get any error on my local. I tried changing the scripts as well but all in vain. The logs says there is an issue with the script.

On Cyclic:

```<code>2023-01-01 06:36:21: [CYCLIC] Building...
2023-01-01 06:36:21: Build Configuration:
  Root Path: /api
  Output Path: /client
  Static Site: false
  Runtime: nodejs18.x

[CYCLIC] cloning...
2023-01-01 06:36:22: From https://github.com/nishant-k1/quengenesis-llc
 * branch            520edf6bc9f2985a8dab86fc103237513b5f134e -> FETCH_HEAD
2023-01-01 06:36:22: HEAD is now at 520edf6 playing with deploy script
2023-01-01 06:36:22: [CYCLIC] verifying...
2023-01-01 06:36:23: [CYCLIC] using: node:v18.12.1 npm:8.19.2 runtime:nodejs18.x
[CYCLIC] building from: /api
2023-01-01 06:36:23: [CYCLIC] installing dependencies from: package-lock.json
2023-01-01 06:36:23: npm
2023-01-01 06:36:23:  WARN config production Use `--omit=dev` instead.
2023-01-01 06:41:35: npm
2023-01-01 06:41:35:  ERR! code ERR_SOCKET_TIMEOUT
npm ERR! errno ERR_SOCKET_TIMEOUT
npm ERR! network request to https://npm.onservo.com/yargs-parser/-/yargs-parser-13.1.2.tgz failed, reason: Socket timeout
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
2023-01-01 06:41:35:
2023-01-01 06:41:35: npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/nishant-k1-quengenesis-llc/'/tmp/nishant-k1-quengenesis-llc'/.npm/_logs/2023-01-01T01_02_38_762Z-debug-0.log
2023-01-01 06:41:35: npm
2023-01-01 06:41:35: notice
npm notice New major version of npm available! 8.19.2 -> 9.2.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.2.0>
npm notice Run `npm install -g npm@9.2.0` to update!
npm notice
2023-01-01 06:41:35: [CYCLIC] Build Failed
</code>```

On render:

```<code>Jan 2 06:13:42 AM  ==> Cloning from https://github.com/nishant-k1/quengenesis-llc...
Jan 2 06:13:43 AM  ==> Checking out commit bf9d9d9b6ebda4a28471717efacfc614cd64d2a5 in branch main
Jan 2 06:13:47 AM  ==> Running build command 'npm run build'...
Jan 2 06:13:47 AM
Jan 2 06:13:47 AM  > server@0.0.0 build /opt/render/project/src/api
Jan 2 06:13:47 AM  > npm i && cd ../client && npm i && npm run build
Jan 2 06:13:47 AM
Jan 2 06:13:55 AM  added 150 packages from 213 contributors and audited 152 packages in 7.958s
Jan 2 06:13:55 AM
Jan 2 06:13:55 AM  9 packages are looking for funding
Jan 2 06:13:55 AM    run `npm fund` for details
Jan 2 06:13:55 AM
Jan 2 06:13:55 AM  found 8 vulnerabilities (1 low, 4 high, 3 critical)
Jan 2 06:13:55 AM    run `npm audit fix` to fix them, or `npm audit` for details
Jan 2 06:14:27 AM  npm ERR! code EINTEGRITY
Jan 2 06:14:27 AM  npm ERR! sha512-BeraOoH+EGGUPdujKplcmMjBSgUETZ82C6AinNSPFgBZgsWS8gSZRcGk7mpdftgZn4/7OYbsnMi9WDf7CoIhQA== integrity checksum failed when using sha512: wanted sha512-BeraOoH+EGGUPdujKplcmMjBSgUETZ82C6AinNSPFgBZgsWS8gSZRcGk7mpdftgZn4/7OYbsnMi9WDf7CoIhQA== but got sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==. (1932 bytes)
Jan 2 06:14:27 AM  npm ERR! code EINTEGRITY
Jan 2 06:14:27 AM  npm ERR! sha512-cflXkhRjOOCTvvdA/Bn5xKDaN2dvZwE+62hzazFPrIjC1WlKnIsrhHRK5UT8wID+MapfnDftzaRXNojhQZWvkg== integrity checksum failed when using sha512: wanted sha512-cflXkhRjOOCTvvdA/Bn5xKDaN2dvZwE+62hzazFPrIjC1WlKnIsrhHRK5UT8wID+MapfnDftzaRXNojhQZWvkg== but got sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==. (1516 bytes)
Jan 2 06:14:27 AM  npm ERR! code EINTEGRITY
Jan 2 06:14:27 AM  npm ERR! sha512-f7W8E/uDPEen4vTEImuNmxyeQ7zrNryVC/+9vpORSr9QVnregQUUfSl+5nNBsPMoJich4u9ISa3d79zJFaD9jA== integrity checksum failed when using sha512: wanted sha512-f7W8E/uDPEen4vTEImuNmxyeQ7zrNryVC/+9vpORSr9QVnregQUUfSl+5nNBsPMoJich4u9ISa3d79zJFaD9jA== but got sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==. (1587 bytes)
Jan 2 06:14:30 AM
Jan 2 06:14:30 AM  npm ERR! A complete log of this run can be found in:
Jan 2 06:14:30 AM  npm ERR!     /opt/render/.cache/_logs/2023-01-02T00_44_27_119Z-debug.log
Jan 2 06:14:30 AM  npm ERR! code ELIFECYCLE
Jan 2 06:14:30 AM  npm ERR! errno 1
Jan 2 06:14:30 AM  npm ERR! server@0.0.0 build: `npm i && cd ../client && npm i && npm run build`
Jan 2 06:14:30 AM  npm ERR! Exit status 1
Jan 2 06:14:30 AM  npm ERR!
Jan 2 06:14:30 AM  npm ERR! Failed at the server@0.0.0 build script.
Jan 2 06:14:30 AM  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Jan 2 06:14:30 AM
Jan 2 06:14:30 AM  npm ERR! A complete log of this run can be found in:
Jan 2 06:14:30 AM  npm ERR!     /opt/render/.cache/_logs/2023-01-02T00_44_30_121Z-debug.log
Jan 2 06:14:30 AM  ==> Build failed
Jan 2 06:14:30 AM  ==> Generating container image from build. This may take a few minutes...
</code>```

My folder structure is and on deployment platforms I choose /api as my root

```<code>root
  api
  client
</code>```

You can see the scripts in package.json of my api

package.json for my client

below is a screenshot that gives you a detailed folder structure

Body:
I tried deploying my nodejs app on various platform like render, railway and cyclic but all the platform gave me same error build fail. However with the same build and start scripts I don't get any error on my local. I tried changing the scripts as well but all in vain. The logs says there is an issue with the script.

On Cyclic:

2023-01-01 06:36:21: [CYCLIC] Building...
2023-01-01 06:36:21: Build Configuration:
  Root Path: /api
  Output Path: /client
  Static Site: false
  Runtime: nodejs18.x

[CYCLIC] cloning...
2023-01-01 06:36:22: From https://github.com/nishant-k1/quengenesis-llc
 * branch            520edf6bc9f2985a8dab86fc103237513b5f134e -> FETCH_HEAD
2023-01-01 06:36:22: HEAD is now at 520edf6 playing with deploy script
2023-01-01 06:36:22: [CYCLIC] verifying...
2023-01-01 06:36:23: [CYCLIC] using: node:v18.12.1 npm:8.19.2 runtime:nodejs18.x
[CYCLIC] building from: /api
2023-01-01 06:36:23: [CYCLIC] installing dependencies from: package-lock.json
2023-01-01 06:36:23: npm
2023-01-01 06:36:23:  WARN config production Use `--omit=dev` instead.
2023-01-01 06:41:35: npm
2023-01-01 06:41:35:  ERR! code ERR_SOCKET_TIMEOUT
npm ERR! errno ERR_SOCKET_TIMEOUT
npm ERR! network request to https://npm.onservo.com/yargs-parser/-/yargs-parser-13.1.2.tgz failed, reason: Socket timeout
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'
2023-01-01 06:41:35:
2023-01-01 06:41:35: npm ERR! A complete log of this run can be found in:
npm ERR!     /tmp/nishant-k1-quengenesis-llc/'/tmp/nishant-k1-quengenesis-llc'/.npm/_logs/2023-01-01T01_02_38_762Z-debug-0.log
2023-01-01 06:41:35: npm
2023-01-01 06:41:35: notice
npm notice New major version of npm available! 8.19.2 -> 9.2.0
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.2.0>
npm notice Run `npm install -g npm@9.2.0` to update!
npm notice
2023-01-01 06:41:35: [CYCLIC] Build Failed

On render:

Jan 2 06:13:42 AM  ==> Cloning from https://github.com/nishant-k1/quengenesis-llc...
Jan 2 06:13:43 AM  ==> Checking out commit bf9d9d9b6ebda4a28471717efacfc614cd64d2a5 in branch main
Jan 2 06:13:47 AM  ==> Running build command 'npm run build'...
Jan 2 06:13:47 AM
Jan 2 06:13:47 AM  > server@0.0.0 build /opt/render/project/src/api
Jan 2 06:13:47 AM  > npm i && cd ../client && npm i && npm run build
Jan 2 06:13:47 AM
Jan 2 06:13:55 AM  added 150 packages from 213 contributors and audited 152 packages in 7.958s
Jan 2 06:13:55 AM
Jan 2 06:13:55 AM  9 packages are looking for funding
Jan 2 06:13:55 AM    run `npm fund` for details
Jan 2 06:13:55 AM
Jan 2 06:13:55 AM  found 8 vulnerabilities (1 low, 4 high, 3 critical)
Jan 2 06:13:55 AM    run `npm audit fix` to fix them, or `npm audit` for details
Jan 2 06:14:27 AM  npm ERR! code EINTEGRITY
Jan 2 06:14:27 AM  npm ERR! sha512-BeraOoH+EGGUPdujKplcmMjBSgUETZ82C6AinNSPFgBZgsWS8gSZRcGk7mpdftgZn4/7OYbsnMi9WDf7CoIhQA== integrity checksum failed when using sha512: wanted sha512-BeraOoH+EGGUPdujKplcmMjBSgUETZ82C6AinNSPFgBZgsWS8gSZRcGk7mpdftgZn4/7OYbsnMi9WDf7CoIhQA== but got sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==. (1932 bytes)
Jan 2 06:14:27 AM  npm ERR! code EINTEGRITY
Jan 2 06:14:27 AM  npm ERR! sha512-cflXkhRjOOCTvvdA/Bn5xKDaN2dvZwE+62hzazFPrIjC1WlKnIsrhHRK5UT8wID+MapfnDftzaRXNojhQZWvkg== integrity checksum failed when using sha512: wanted sha512-cflXkhRjOOCTvvdA/Bn5xKDaN2dvZwE+62hzazFPrIjC1WlKnIsrhHRK5UT8wID+MapfnDftzaRXNojhQZWvkg== but got sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==. (1516 bytes)
Jan 2 06:14:27 AM  npm ERR! code EINTEGRITY
Jan 2 06:14:27 AM  npm ERR! sha512-f7W8E/uDPEen4vTEImuNmxyeQ7zrNryVC/+9vpORSr9QVnregQUUfSl+5nNBsPMoJich4u9ISa3d79zJFaD9jA== integrity checksum failed when using sha512: wanted sha512-f7W8E/uDPEen4vTEImuNmxyeQ7zrNryVC/+9vpORSr9QVnregQUUfSl+5nNBsPMoJich4u9ISa3d79zJFaD9jA== but got sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==. (1587 bytes)
Jan 2 06:14:30 AM
Jan 2 06:14:30 AM  npm ERR! A complete log of this run can be found in:
Jan 2 06:14:30 AM  npm ERR!     /opt/render/.cache/_logs/2023-01-02T00_44_27_119Z-debug.log
Jan 2 06:14:30 AM  npm ERR! code ELIFECYCLE
Jan 2 06:14:30 AM  npm ERR! errno 1
Jan 2 06:14:30 AM  npm ERR! server@0.0.0 build: `npm i && cd ../client && npm i && npm run build`
Jan 2 06:14:30 AM  npm ERR! Exit status 1
Jan 2 06:14:30 AM  npm ERR!
Jan 2 06:14:30 AM  npm ERR! Failed at the server@0.0.0 build script.
Jan 2 06:14:30 AM  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Jan 2 06:14:30 AM
Jan 2 06:14:30 AM  npm ERR! A complete log of this run can be found in:
Jan 2 06:14:30 AM  npm ERR!     /opt/render/.cache/_logs/2023-01-02T00_44_30_121Z-debug.log
Jan 2 06:14:30 AM  ==> Build failed
Jan 2 06:14:30 AM  ==> Generating container image from build. This may take a few minutes...

My folder structure is and on deployment platforms I choose /api as my root

root
  api
  client

You can see the scripts in package.json of my api

package.json for my client

below is a screenshot that gives you a detailed folder structure


问:
Any conda command shows this error report
```<code>$ conda info --envs

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1082, in __call__
        return func(*args, **kwargs)
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/main.py", line 87, in _main
        exit_code = do_call(args, p)
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/conda_argparse.py", line 84, in do_call
        return getattr(module, func_name)(args, parser)
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/main_info.py", line 317, in execute
        info_dict = get_info_dict(args.system)
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/main_info.py", line 135, in get_info_dict
        _supplement_index_with_system(virtual_pkg_index)
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/core/index.py", line 164, in _supplement_index_with_system
        dist_name, dist_version = context.os_distribution_name_version
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/auxlib/decorators.py", line 268, in new_fget
        cache[inner_attname] = func(self)
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/base/context.py", line 863, in os_distribution_name_version
        from conda._vendor.distro import id, version
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 1084, in <module>
        _distro = LinuxDistribution()
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 599, in __init__
        self._lsb_release_info = self._get_lsb_release_info() \
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 943, in _get_lsb_release_info
        raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
    subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1.

`$ /home/user/miniconda3/bin/conda info --envs`

An unexpected error has occurred. Conda has prepared the above report.

If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?

[y/N]:  y
Traceback (most recent call last):
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1082, in __call__
    return func(*args, **kwargs)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/main.py", line 87, in _main
    exit_code = do_call(args, p)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/conda_argparse.py", line 84, in do_call
    return getattr(module, func_name)(args, parser)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/main_info.py", line 317, in execute
    info_dict = get_info_dict(args.system)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/main_info.py", line 135, in get_info_dict
    _supplement_index_with_system(virtual_pkg_index)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/core/index.py", line 164, in _supplement_index_with_system
    dist_name, dist_version = context.os_distribution_name_version
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/auxlib/decorators.py", line 268, in new_fget
    cache[inner_attname] = func(self)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/base/context.py", line 863, in os_distribution_name_version
    from conda._vendor.distro import id, version
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 1084, in <module>
    _distro = LinuxDistribution()
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 599, in __init__
    self._lsb_release_info = self._get_lsb_release_info() \
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 943, in _get_lsb_release_info
    raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/miniconda3/bin/conda", line 13, in <module>
    sys.exit(main())
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/main.py", line 155, in main
    return conda_exception_handler(_main, *args, **kwargs)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1374, in conda_exception_handler
    return_value = exception_handler(func, *args, **kwargs)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1085, in __call__
    return self.handle_exception(exc_val, exc_tb)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1129, in handle_exception
    return self.handle_unexpected_exception(exc_val, exc_tb)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1144, in handle_unexpected_exception
    self._execute_upload(error_report)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1306, in _execute_upload
    'User-Agent': self.user_agent,
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1104, in user_agent
    return context.user_agent
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/auxlib/decorators.py", line 268, in new_fget
    cache[inner_attname] = func(self)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/base/context.py", line 805, in user_agent
    builder.append("%s/%s" % self.os_distribution_name_version)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/auxlib/decorators.py", line 268, in new_fget
    cache[inner_attname] = func(self)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/base/context.py", line 863, in os_distribution_name_version
    from conda._vendor.distro import id, version
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 1084, in <module>
    _distro = LinuxDistribution()
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 599, in __init__
    self._lsb_release_info = self._get_lsb_release_info() \
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 943, in _get_lsb_release_info
    raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1.

</code>```

Hi, I keep getting this ERROR REPORT for any conda command (conda info, conda install, conda whatever).

I removed and re-installed anaconda but then I get the same error, so I removed everything and installed miniconda, then I re-installed miniconda, then I also re-installed Ubuntu.

None of the above clearly solved the problem and this ERROR REPORT comes and goes.

Any help would be appreciated.

Body:
$ conda info --envs

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1082, in __call__
        return func(*args, **kwargs)
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/main.py", line 87, in _main
        exit_code = do_call(args, p)
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/conda_argparse.py", line 84, in do_call
        return getattr(module, func_name)(args, parser)
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/main_info.py", line 317, in execute
        info_dict = get_info_dict(args.system)
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/main_info.py", line 135, in get_info_dict
        _supplement_index_with_system(virtual_pkg_index)
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/core/index.py", line 164, in _supplement_index_with_system
        dist_name, dist_version = context.os_distribution_name_version
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/auxlib/decorators.py", line 268, in new_fget
        cache[inner_attname] = func(self)
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/base/context.py", line 863, in os_distribution_name_version
        from conda._vendor.distro import id, version
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 1084, in <module>
        _distro = LinuxDistribution()
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 599, in __init__
        self._lsb_release_info = self._get_lsb_release_info() \
      File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 943, in _get_lsb_release_info
        raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
    subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1.

`$ /home/user/miniconda3/bin/conda info --envs`

An unexpected error has occurred. Conda has prepared the above report.

If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?

[y/N]:  y
Traceback (most recent call last):
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1082, in __call__
    return func(*args, **kwargs)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/main.py", line 87, in _main
    exit_code = do_call(args, p)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/conda_argparse.py", line 84, in do_call
    return getattr(module, func_name)(args, parser)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/main_info.py", line 317, in execute
    info_dict = get_info_dict(args.system)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/main_info.py", line 135, in get_info_dict
    _supplement_index_with_system(virtual_pkg_index)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/core/index.py", line 164, in _supplement_index_with_system
    dist_name, dist_version = context.os_distribution_name_version
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/auxlib/decorators.py", line 268, in new_fget
    cache[inner_attname] = func(self)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/base/context.py", line 863, in os_distribution_name_version
    from conda._vendor.distro import id, version
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 1084, in <module>
    _distro = LinuxDistribution()
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 599, in __init__
    self._lsb_release_info = self._get_lsb_release_info() \
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 943, in _get_lsb_release_info
    raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/miniconda3/bin/conda", line 13, in <module>
    sys.exit(main())
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/cli/main.py", line 155, in main
    return conda_exception_handler(_main, *args, **kwargs)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1374, in conda_exception_handler
    return_value = exception_handler(func, *args, **kwargs)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1085, in __call__
    return self.handle_exception(exc_val, exc_tb)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1129, in handle_exception
    return self.handle_unexpected_exception(exc_val, exc_tb)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1144, in handle_unexpected_exception
    self._execute_upload(error_report)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1306, in _execute_upload
    'User-Agent': self.user_agent,
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/exceptions.py", line 1104, in user_agent
    return context.user_agent
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/auxlib/decorators.py", line 268, in new_fget
    cache[inner_attname] = func(self)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/base/context.py", line 805, in user_agent
    builder.append("%s/%s" % self.os_distribution_name_version)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/auxlib/decorators.py", line 268, in new_fget
    cache[inner_attname] = func(self)
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/base/context.py", line 863, in os_distribution_name_version
    from conda._vendor.distro import id, version
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 1084, in <module>
    _distro = LinuxDistribution()
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 599, in __init__
    self._lsb_release_info = self._get_lsb_release_info() \
  File "/home/user/miniconda3/lib/python3.9/site-packages/conda/_vendor/distro.py", line 943, in _get_lsb_release_info
    raise subprocess.CalledProcessError(code, cmd, stdout, stderr)
subprocess.CalledProcessError: Command 'lsb_release -a' returned non-zero exit status 1.

Hi, I keep getting this ERROR REPORT for any conda command (conda info, conda install, conda whatever).

I removed and re-installed anaconda but then I get the same error, so I removed everything and installed miniconda, then I re-installed miniconda, then I also re-installed Ubuntu.

None of the above clearly solved the problem and this ERROR REPORT comes and goes.

Any help would be appreciated.


问:
How to make objects in std::vector<BaseClass> but of of type ChildClass use ChildClasses overwritten methods
I have a std::vector<BaseClass> which I iterate over to call a update() method which makes use of another class method (isTrue() in the example below). This other method is overwritten by child classes to specify what exactly to do. But it seems that always the method of BaseClass is used.
Is there any way to make use of the overwritten methods in this case?

```<code>/* baseclass.hpp */
#include <iostream>

class BaseClass {
    public:
        const int type;
        BaseClass(int t);

        void update();
        virtual bool isTrue();
};

/* baseclass.cpp */
BaseClass::BaseClass(int t) : type(t) {
}

void BaseClass::update() {
    if (isTrue())
        std::cout << "BaseClass" << std::endl;
    else
        std::cout << "Something else" << std::endl;
}

bool BaseClass::isTrue() {
    std::cout << "isTrue() BaseClass, type " << type << std::endl;
    return true;
}

/* childclass.hpp */
class ChildClass : public BaseClass {
    public:
        ChildClass();
        bool isTrue() override;
};

/* childclass.cpp */
ChildClass::ChildClass() : BaseClass(1) {
}

bool ChildClass::isTrue() {
    std::cout << "isTrue() ChildClass" << std::endl;
    return false;
}

/* somewhereelse.cpp */
#include <vector>
int main() {
    std::vector<BaseClass> list;

    list.push_back(ChildClass());
    list[0].update();
}
</code>```

The output (like most of you expected I guess) is

```<code>isTrue() BaseClass, type 1
BaseClass
</code>```

Is there a possibility that ChildClass::isTrue() is invoked in such a situation? or is there a way around it?
(The filenames are just to indicate that I use different files in the real scenario, but this doesn't seem to make any difference)

I appreciate any help

Body:
I have a std::vector<BaseClass> which I iterate over to call a update() method which makes use of another class method (isTrue() in the example below). This other method is overwritten by child classes to specify what exactly to do. But it seems that always the method of BaseClass is used.
Is there any way to make use of the overwritten methods in this case?

/* baseclass.hpp */
#include <iostream>

class BaseClass {
    public:
        const int type;
        BaseClass(int t);

        void update();
        virtual bool isTrue();
};

/* baseclass.cpp */
BaseClass::BaseClass(int t) : type(t) {
}

void BaseClass::update() {
    if (isTrue())
        std::cout << "BaseClass" << std::endl;
    else
        std::cout << "Something else" << std::endl;
}

bool BaseClass::isTrue() {
    std::cout << "isTrue() BaseClass, type " << type << std::endl;
    return true;
}

/* childclass.hpp */
class ChildClass : public BaseClass {
    public:
        ChildClass();
        bool isTrue() override;
};

/* childclass.cpp */
ChildClass::ChildClass() : BaseClass(1) {
}

bool ChildClass::isTrue() {
    std::cout << "isTrue() ChildClass" << std::endl;
    return false;
}

/* somewhereelse.cpp */
#include <vector>
int main() {
    std::vector<BaseClass> list;

    list.push_back(ChildClass());
    list[0].update();
}

The output (like most of you expected I guess) is

isTrue() BaseClass, type 1
BaseClass

Is there a possibility that ChildClass::isTrue() is invoked in such a situation? or is there a way around it?
(The filenames are just to indicate that I use different files in the real scenario, but this doesn't seem to make any difference)

I appreciate any help


问:
How do I prevent the deletion of rows in a Google spreadsheet that gets values from a different sheet with the IMPORTRANGE formula?
I have a spreadsheet that pulls data from a different sheet using the IMPORTRANGE formula. It gets updated with new values as they are added to the other sheet, but I would like to prevent the deletion of values when they are deleted from the other sheet, and keep the data as is, no matter how the other sheet is edited.

Is there a different formula that does this?


问:
Is there a way to use sql functions after using INSERT ALL from a select statement?
I have multiple tables that I am inserting into, and I would like one of the tables to be partitioned after inserting into it so that I can determine the most updated IDs and label their ACTIVE status. My SQL for one of the tables that already contains my data looks as follows:

```<code>CREATE TABLE IF NOT EXISTS MY_TABLE
(
  LINK_ID BINARY    NOT NULL,
  LOAD         TIMESTAMP NOT NULL,
  SOURCE       STRING    NOT NULL,
  SOURCE_DATE  TIMESTAMP NOT NULL,
  ORDER        BIGINT    NOT NULL,
  ID           BINARY    NOT NULL,
  ATTRIBUTE_ID  BINARY    NOT NULL
);

INSERT ALL
  WHEN HAS_DATA AND ID_SEQ_NUM > 1 AND (SELECT COUNT(1) FROM MY_TABLE WHERE ID = KEY) = 0 THEN
  INTO MY_TABLE VALUES (
        LINK_KEY,
        TIME,
        DATASET_NAME,
        DATASET_DATE,
        ORDER_NUMBER,
        O_KEY,
        OA_KEY
      )
SELECT *
FROM TEST_TABLE;
</code>```

Currently, I am inserting records that show a change in any of the columns to the table. I have extended the table to now include an ACTIVE column and defaulted every record to TRUE for the current records in the table.

```<code>ALTER TABLE MY_TABLE ADD COLUMN ACTIVE BOOLEAN DEFAULT FALSE;
</code>```

When a new record is inserted which indicates a change in one of the column values, I want that ACTIVE value for the new record to be TRUE for that ID group while changing the ACTIVE value for the other records within the ID group to be FALSE (so the previous records would be not considered active/would be FALSE while the most recent record that is inserted indicated by the ORDER value would be active/TRUE)

At first, I tried doing:

```<code>INSERT ALL
  WHEN HAS_DATA AND ID_SEQ_NUM > 1 AND (SELECT COUNT(1) FROM MY_TABLE WHERE ID = KEY) = 0 THEN
  INTO MY_TABLE VALUES (
        LINK_KEY,
        TIME,
        DATASET_NAME,
        DATASET_DATE,
        ORDER_NUMBER,
        O_KEY,
        OA_KEY,
        ACTIVE
      )
SELECT *, OFFSET_NUMBER = MAX(OFFSET_NUMBER) OVER (PARTITION BY O_KEY) AS ACTIVE,
FROM TEST_TABLE;
</code>```

However, this does not seem to change the records for each ID group that already exist in the table to false when a new record is inserted that is considered to be the most recent active record. Is there a way I can run this select statement below after all the new records are inserted, but still have it be in the same statement that contains the insertion process?

```<code>SELECT *, ORDER = MAX(ORDER) OVER (PARTITION BY ID) AS ACTIVE,
FROM MY_TABLE
</code>```

Body:
I have multiple tables that I am inserting into, and I would like one of the tables to be partitioned after inserting into it so that I can determine the most updated IDs and label their ACTIVE status. My SQL for one of the tables that already contains my data looks as follows:

CREATE TABLE IF NOT EXISTS MY_TABLE
(
  LINK_ID BINARY    NOT NULL,
  LOAD         TIMESTAMP NOT NULL,
  SOURCE       STRING    NOT NULL,
  SOURCE_DATE  TIMESTAMP NOT NULL,
  ORDER        BIGINT    NOT NULL,
  ID           BINARY    NOT NULL,
  ATTRIBUTE_ID  BINARY    NOT NULL
);

INSERT ALL
  WHEN HAS_DATA AND ID_SEQ_NUM > 1 AND (SELECT COUNT(1) FROM MY_TABLE WHERE ID = KEY) = 0 THEN
  INTO MY_TABLE VALUES (
        LINK_KEY,
        TIME,
        DATASET_NAME,
        DATASET_DATE,
        ORDER_NUMBER,
        O_KEY,
        OA_KEY
      )
SELECT *
FROM TEST_TABLE;

Currently, I am inserting records that show a change in any of the columns to the table. I have extended the table to now include an ACTIVE column and defaulted every record to TRUE for the current records in the table.

ALTER TABLE MY_TABLE ADD COLUMN ACTIVE BOOLEAN DEFAULT FALSE;

When a new record is inserted which indicates a change in one of the column values, I want that ACTIVE value for the new record to be TRUE for that ID group while changing the ACTIVE value for the other records within the ID group to be FALSE (so the previous records would be not considered active/would be FALSE while the most recent record that is inserted indicated by the ORDER value would be active/TRUE)

At first, I tried doing:

INSERT ALL
  WHEN HAS_DATA AND ID_SEQ_NUM > 1 AND (SELECT COUNT(1) FROM MY_TABLE WHERE ID = KEY) = 0 THEN
  INTO MY_TABLE VALUES (
        LINK_KEY,
        TIME,
        DATASET_NAME,
        DATASET_DATE,
        ORDER_NUMBER,
        O_KEY,
        OA_KEY,
        ACTIVE
      )
SELECT *, OFFSET_NUMBER = MAX(OFFSET_NUMBER) OVER (PARTITION BY O_KEY) AS ACTIVE,
FROM TEST_TABLE;

However, this does not seem to change the records for each ID group that already exist in the table to false when a new record is inserted that is considered to be the most recent active record. Is there a way I can run this select statement below after all the new records are inserted, but still have it be in the same statement that contains the insertion process?

SELECT *, ORDER = MAX(ORDER) OVER (PARTITION BY ID) AS ACTIVE,
FROM MY_TABLE


问:
Why do I get No module named 'sympy.series.approximants' error when importing Sympy with anaconda?
Sympy is downloaded with anaconda. In a Jupyter notebook, I have 'from sympy import divisors' and I get this:

```<code>ModuleNotFoundError                       Traceback (most recent call last)
Cell In[12], line 1
----> 1 from sympy import divisors

File ~/Desktop/anaconda3/lib/python3.9/site-packages/sympy/__init__.py:107
     70 from .assumptions import (AppliedPredicate, Predicate, AssumptionsContext,
     71         assuming, Q, ask, register_handler, remove_handler, refine)
     73 from .polys import (Poly, PurePoly, poly_from_expr, parallel_poly_from_expr,
     74         degree, total_degree, degree_list, LC, LM, LT, pdiv, prem, pquo,
     75         pexquo, div, rem, quo, exquo, half_gcdex, gcdex, invert,
   (...)
    104         laguerre_poly, apart, apart_list, assemble_partfrac_list, Options,
    105         ring, xring, vring, sring, field, xfield, vfield, sfield)
--> 107 from .series import (Order, O, limit, Limit, gruntz, series, approximants,
    108         residue, EmptySequence, SeqPer, SeqFormula, sequence, SeqAdd, SeqMul,
    109         fourier_series, fps, difference_delta, limit_seq)
    111 from .functions import (factorial, factorial2, rf, ff, binomial,
    112         RisingFactorial, FallingFactorial, subfactorial, carmichael,
    113         fibonacci, lucas, motzkin, tribonacci, harmonic, bernoulli, bell, euler,
   (...)
    132         Znm, elliptic_k, elliptic_f, elliptic_e, elliptic_pi, beta, mathieus,
    133         mathieuc, mathieusprime, mathieucprime, riemann_xi, betainc, betainc_regularized)
    135 from .ntheory import (nextprime, prevprime, prime, primepi, primerange,
    136         randprime, Sieve, sieve, primorial, cycle_length, composite,
    137         compositepi, isprime, divisors, proper_divisors, factorint,
   (...)
    148         continued_fraction_iterator, continued_fraction_reduce,
    149         continued_fraction_convergents, continued_fraction, egyptian_fraction)

File ~/Desktop/anaconda3/lib/python3.9/site-packages/sympy/series/__init__.py:7
      5 from .gruntz import gruntz
      6 from .series import series
----> 7 from .approximants import approximants
      8 from .residues import residue
      9 from .sequences import SeqPer, SeqFormula, sequence, SeqAdd, SeqMul

ModuleNotFoundError: No module named 'sympy.series.approximants'

</code>```

Any ideas on what I am doing wrong? Thank you.

Tried using the terminal to update, but I am garbage with anything beyond the basics.

Body:
Sympy is downloaded with anaconda. In a Jupyter notebook, I have 'from sympy import divisors' and I get this:

ModuleNotFoundError                       Traceback (most recent call last)
Cell In[12], line 1
----> 1 from sympy import divisors

File ~/Desktop/anaconda3/lib/python3.9/site-packages/sympy/__init__.py:107
     70 from .assumptions import (AppliedPredicate, Predicate, AssumptionsContext,
     71         assuming, Q, ask, register_handler, remove_handler, refine)
     73 from .polys import (Poly, PurePoly, poly_from_expr, parallel_poly_from_expr,
     74         degree, total_degree, degree_list, LC, LM, LT, pdiv, prem, pquo,
     75         pexquo, div, rem, quo, exquo, half_gcdex, gcdex, invert,
   (...)
    104         laguerre_poly, apart, apart_list, assemble_partfrac_list, Options,
    105         ring, xring, vring, sring, field, xfield, vfield, sfield)
--> 107 from .series import (Order, O, limit, Limit, gruntz, series, approximants,
    108         residue, EmptySequence, SeqPer, SeqFormula, sequence, SeqAdd, SeqMul,
    109         fourier_series, fps, difference_delta, limit_seq)
    111 from .functions import (factorial, factorial2, rf, ff, binomial,
    112         RisingFactorial, FallingFactorial, subfactorial, carmichael,
    113         fibonacci, lucas, motzkin, tribonacci, harmonic, bernoulli, bell, euler,
   (...)
    132         Znm, elliptic_k, elliptic_f, elliptic_e, elliptic_pi, beta, mathieus,
    133         mathieuc, mathieusprime, mathieucprime, riemann_xi, betainc, betainc_regularized)
    135 from .ntheory import (nextprime, prevprime, prime, primepi, primerange,
    136         randprime, Sieve, sieve, primorial, cycle_length, composite,
    137         compositepi, isprime, divisors, proper_divisors, factorint,
   (...)
    148         continued_fraction_iterator, continued_fraction_reduce,
    149         continued_fraction_convergents, continued_fraction, egyptian_fraction)

File ~/Desktop/anaconda3/lib/python3.9/site-packages/sympy/series/__init__.py:7
      5 from .gruntz import gruntz
      6 from .series import series
----> 7 from .approximants import approximants
      8 from .residues import residue
      9 from .sequences import SeqPer, SeqFormula, sequence, SeqAdd, SeqMul

ModuleNotFoundError: No module named 'sympy.series.approximants'

Any ideas on what I am doing wrong? Thank you.

Tried using the terminal to update, but I am garbage with anything beyond the basics.