问:
'Internal space embedding need ...' error when attemping to use spaCy text_categorizer
Hello sirs and madams,

I very much need your help to understand this error:

```<code>Exception has occurred: NotImplementedError
internal spacy embeddings need to be derived from md/lg spacy models not from sm/trf models.
File "/Users/Rune/Sites/smartez-backend/analytics/pipeline.py", line 517, in categorize_new
result = nlp("new_sentence")._.cats
File "/Users/Rune/Sites/smartez-backend/components/feed.py", line 471, in p_get_posts
category = pipeline.categorize_new(post)
File "/Users/Rune/Sites/smartez-backend/queue_.py", line 22, in set_run
categories, lang = feed_source.p_get_posts()
File "/Users/Rune/Sites/smartez-backend/queue_.py", line 44, in <module>
set_run(wait)
</code>```

I get the error when I attempt debugging the code in vs code on mac/ox:

```<code>data = self.load_data(self.language['language'])
nlp = spacy.load('en_core_web_md')
nlp.add_pipe("text_categorizer",
         config={
             "data": data,
             "model": "spacy"
            }
)
</code>```

The code is in the file: 'smartez-backend/analytics/pipeline.py'

When I try similar code in the file: 'smartez-backend/test.py' it works like a charm.

I simply cannot comprehend why this error occurs, and any help will payed back with much gratitude.

Best,
Rune

Body:
Hello sirs and madams,

I very much need your help to understand this error:

Exception has occurred: NotImplementedError
internal spacy embeddings need to be derived from md/lg spacy models not from sm/trf models.
File "/Users/Rune/Sites/smartez-backend/analytics/pipeline.py", line 517, in categorize_new
result = nlp("new_sentence")._.cats
File "/Users/Rune/Sites/smartez-backend/components/feed.py", line 471, in p_get_posts
category = pipeline.categorize_new(post)
File "/Users/Rune/Sites/smartez-backend/queue_.py", line 22, in set_run
categories, lang = feed_source.p_get_posts()
File "/Users/Rune/Sites/smartez-backend/queue_.py", line 44, in <module>
set_run(wait)

I get the error when I attempt debugging the code in vs code on mac/ox:

data = self.load_data(self.language['language'])
nlp = spacy.load('en_core_web_md')
nlp.add_pipe("text_categorizer",
         config={
             "data": data,
             "model": "spacy"
            }
)

The code is in the file: 'smartez-backend/analytics/pipeline.py'

When I try similar code in the file: 'smartez-backend/test.py' it works like a charm.

I simply cannot comprehend why this error occurs, and any help will payed back with much gratitude.

Best,
Rune


来源: stackexchange

问:
telebot register_next_step_handler_by_chat_id not works in celery shared task
I have a small Telegram bot Django project and the bot needs to send a message to users that have been inactive for over an hour and then wait for input from the user using tg_nick_or_phone_input_handler and write it to the TelegramBotClientModel instance, sending more messages to chat.

def tg_nick_or_phone_input_handler(message):
    chat_id = message.chat.id
    bot_client = TelegramBotClientModel.objects.get(chat_id=chat_id)
    bot_client.phone_or_nickname = message.text
    bot_client.request_sent = True
    bot_client.save()

    bot.send_message(
        chat_id=chat_id,
        text='REQUEST SENT'
    )
    bot.send_message(
        chat_id=chat_id,
        text='some message'
    )
```
<pre class="lang-py prettyprint-override"><code>import django.utils.timezone as tz
from celery import shared_task

from tg_funnel_bot.bot import bot
from .views import tg_nick_or_phone_input_handler
from .models import TelegramBotClientModel, BotMessagesSettingsModel

# celery task where should register next step handler
@shared_task(name='send_message_for_interrupted_dialog_after_one_hour')
def send_message_for_interrupted_dialog_after_one_hour():
    bot_messages_settings = BotMessagesSettingsModel.objects.all().first()
    inactive_for_hour_clients = TelegramBotClientModel.objects.filter(
        updated_at__lte=tz.now() - tz.timedelta(minutes=5),
        request_sent=False,
        message_for_one_hour_inactive_sent=False
    )

    for inactive_client in inactive_for_hour_clients:
        chat_id = inactive_client.chat_id
        bot.send_message(
            chat_id=chat_id,
            text=bot_messages_settings.user_inactive_for_hour_message_text_first_part
        )
        bot.send_message(
            chat_id=chat_id,
            text=bot_messages_settings.user_inactive_for_hour_message_text_second_part,
            reply_markup=bot_messages_settings.get_inactive_message_second_part_markup()
        )
        bot.register_next_step_handler_by_chat_id(
            chat_id=chat_id,
            callback=tg_nick_or_phone_input_handler
        )
        inactive_client = TelegramBotClientModel.objects.get(pk=inactive_client.pk)
        inactive_client.message_for_one_hour_inactive_sent = True
        inactive_client.save()
    return tz.now()
</code>```

bot.register_next_step_handler_by_chat_id not register handler and follow input in bot chat not processing.
Maybe I cannot use bot instance in another processes, but I can send messages and register_next_step_handler_by_chat_id works if use it in file with webhook update APIView like this:

from telebot import types
from rest_framework.views import APIView
from rest_framework.response import Response

from tg_funnel_bot.bot import bot
from .models import BotMessagesSettingsModel, TelegramBotClientModel

class UpdatesHandlerBotAPIView(APIView):
    def post(self, request):
        json_data = request.body.decode('UTF-8')
        update_data = types.Update.de_json(json_data)
        bot.process_new_updates([update_data])

        return Response({'code': 200})

def after_loading_questions_data_handler(message):
    chat_id = message.chat.id
    bot_messages_settings = BotMessagesSettingsModel.objects.all().first()
    after_loading_questions_data_text = bot_messages_settings.after_data_loading_text
    bot.send_message(
        chat_id=chat_id,
        text=after_loading_questions_data_text
    )
    bot.register_next_step_handler_by_chat_id(
        chat_id=chat_id,
        callback=tg_nick_or_phone_input_handler
    )

def tg_nick_or_phone_input_handler(message):
    chat_id = message.chat.id
    bot_client = TelegramBotClientModel.objects.get(chat_id=chat_id)
    bot_client.phone_or_nickname = message.text
    bot_client.request_sent = True
    bot_client.save()

    bot.send_message(
        chat_id=chat_id,
        text='REQUEST SENT'
    )
    bot.send_message(
        chat_id=chat_id,
        text='some text'
    )
```
<p>Celery configs</p>
<pre class="lang-py prettyprint-override"><code>CELERY_BROKER_URL = 'redis://localhost:6379/0'
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'

CELERY_BEAT_SCHEDULE = {
    'add-every-10-minutes': {
        'task': 'send_message_for_interrupted_dialog_after_one_hour',
        'schedule': crontab(minute='*/1'),
    }
}
</code>```

This is so strange, Give me a hand, please.

ContentLicense: CC BY-SA 4.0

Body:
I have a small Telegram bot Django project and the bot needs to send a message to users that have been inactive for over an hour and then wait for input from the user using tg_nick_or_phone_input_handler and write it to the TelegramBotClientModel instance, sending more messages to chat.

def tg_nick_or_phone_input_handler(message):
    chat_id = message.chat.id
    bot_client = TelegramBotClientModel.objects.get(chat_id=chat_id)
    bot_client.phone_or_nickname = message.text
    bot_client.request_sent = True
    bot_client.save()

    bot.send_message(
        chat_id=chat_id,
        text='REQUEST SENT'
    )
    bot.send_message(
        chat_id=chat_id,
        text='some message'
    )

import django.utils.timezone as tz
from celery import shared_task

from tg_funnel_bot.bot import bot
from .views import tg_nick_or_phone_input_handler
from .models import TelegramBotClientModel, BotMessagesSettingsModel

# celery task where should register next step handler
@shared_task(name='send_message_for_interrupted_dialog_after_one_hour')
def send_message_for_interrupted_dialog_after_one_hour():
    bot_messages_settings = BotMessagesSettingsModel.objects.all().first()
    inactive_for_hour_clients = TelegramBotClientModel.objects.filter(
        updated_at__lte=tz.now() - tz.timedelta(minutes=5),
        request_sent=False,
        message_for_one_hour_inactive_sent=False
    )

    for inactive_client in inactive_for_hour_clients:
        chat_id = inactive_client.chat_id
        bot.send_message(
            chat_id=chat_id,
            text=bot_messages_settings.user_inactive_for_hour_message_text_first_part
        )
        bot.send_message(
            chat_id=chat_id,
            text=bot_messages_settings.user_inactive_for_hour_message_text_second_part,
            reply_markup=bot_messages_settings.get_inactive_message_second_part_markup()
        )
        bot.register_next_step_handler_by_chat_id(
            chat_id=chat_id,
            callback=tg_nick_or_phone_input_handler
        )
        inactive_client = TelegramBotClientModel.objects.get(pk=inactive_client.pk)
        inactive_client.message_for_one_hour_inactive_sent = True
        inactive_client.save()
    return tz.now()

bot.register_next_step_handler_by_chat_id not register handler and follow input in bot chat not processing.
Maybe I cannot use bot instance in another processes, but I can send messages and register_next_step_handler_by_chat_id works if use it in file with webhook update APIView like this:

from telebot import types
from rest_framework.views import APIView
from rest_framework.response import Response

from tg_funnel_bot.bot import bot
from .models import BotMessagesSettingsModel, TelegramBotClientModel

class UpdatesHandlerBotAPIView(APIView):
    def post(self, request):
        json_data = request.body.decode('UTF-8')
        update_data = types.Update.de_json(json_data)
        bot.process_new_updates([update_data])

        return Response({'code': 200})

def after_loading_questions_data_handler(message):
    chat_id = message.chat.id
    bot_messages_settings = BotMessagesSettingsModel.objects.all().first()
    after_loading_questions_data_text = bot_messages_settings.after_data_loading_text
    bot.send_message(
        chat_id=chat_id,
        text=after_loading_questions_data_text
    )
    bot.register_next_step_handler_by_chat_id(
        chat_id=chat_id,
        callback=tg_nick_or_phone_input_handler
    )

def tg_nick_or_phone_input_handler(message):
    chat_id = message.chat.id
    bot_client = TelegramBotClientModel.objects.get(chat_id=chat_id)
    bot_client.phone_or_nickname = message.text
    bot_client.request_sent = True
    bot_client.save()

    bot.send_message(
        chat_id=chat_id,
        text='REQUEST SENT'
    )
    bot.send_message(
        chat_id=chat_id,
        text='some text'
    )

Celery configs

CELERY_BROKER_URL = 'redis://localhost:6379/0'
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'

CELERY_BEAT_SCHEDULE = {
    'add-every-10-minutes': {
        'task': 'send_message_for_interrupted_dialog_after_one_hour',
        'schedule': crontab(minute='*/1'),
    }
}

This is so strange, Give me a hand, please.


问:
How to add and display two different cities with OpenWeather API on a button click using xhr
I am running into a problem of when the user clicks on either the toronto or sudbury button it will only display one city weather temperature, conditions, and sunset information. This occurs because the page loads only one using one city API, i was wondering how i can call mutliple cities on openweather API using xhr

Below is the code i have tried to use to display the toronto weather and sudbury weather after the button click.

```<code>window.onload = function () {
  let our_location = document.getElementById("location");
  let our_temperature = document.getElementById("temperature");
  let our_conditions = document.getElementById("conditions");
  let our_sunset = document.getElementById("sunset");

  let myAPIKey = "6b50d1fca9d05c7084f78a07d8fabaee";

  let url =
    "https://api.openweathermap.org/data/2.5/weather?q=Toronto,Sudbury&appid=" +
    myAPIKey +
    "&units=metric";

  let xhr = new XMLHttpRequest();

  xhr.onreadystatechange = function () {
    if (xhr.readyState === 4) {
      if (xhr.status === 200) {
        const data = xhr.response;
        console.log(xhr);
        let torontoBtn = document.getElementById("Toronto");
        let sudburyBtn = document.getElementById("Sudbury")
        function torontoButton() {
          our_location.innerHTML = data.name;
          our_temperature.innerHTML = data.main.temp;
          our_conditions.innerHTML = data.weather[0].description;
          our_sunset.innerHTML = data.sys.sunset;
          output.style.display = "block";
        }
        torontoBtn.onclick = torontoButton;

        function sudburyButton() {
          our_location.innerHTML = data.name;
          our_temperature.innerHTML = data.main.temp;
          our_conditions.innerHTML = data.weather[0].description;
          our_sunset.innerHTML = data.sys.sunset;
          output.style.display = "block";
        }
        sudburyBtn.onclick = sudburyButton;
      }
    }
  };

  let output = document.getElementById("output");

  xhr.open('GET', url);

  xhr.responseType = "json";

  xhr.send(null);
};
</code>```

Body:
I am running into a problem of when the user clicks on either the toronto or sudbury button it will only display one city weather temperature, conditions, and sunset information. This occurs because the page loads only one using one city API, i was wondering how i can call mutliple cities on openweather API using xhr

Below is the code i have tried to use to display the toronto weather and sudbury weather after the button click.

window.onload = function () {
  let our_location = document.getElementById("location");
  let our_temperature = document.getElementById("temperature");
  let our_conditions = document.getElementById("conditions");
  let our_sunset = document.getElementById("sunset");

  let myAPIKey = "6b50d1fca9d05c7084f78a07d8fabaee";

  let url =
    "https://api.openweathermap.org/data/2.5/weather?q=Toronto,Sudbury&appid=" +
    myAPIKey +
    "&units=metric";

  let xhr = new XMLHttpRequest();

  xhr.onreadystatechange = function () {
    if (xhr.readyState === 4) {
      if (xhr.status === 200) {
        const data = xhr.response;
        console.log(xhr);
        let torontoBtn = document.getElementById("Toronto");
        let sudburyBtn = document.getElementById("Sudbury")
        function torontoButton() {
          our_location.innerHTML = data.name;
          our_temperature.innerHTML = data.main.temp;
          our_conditions.innerHTML = data.weather[0].description;
          our_sunset.innerHTML = data.sys.sunset;
          output.style.display = "block";
        }
        torontoBtn.onclick = torontoButton;

        function sudburyButton() {
          our_location.innerHTML = data.name;
          our_temperature.innerHTML = data.main.temp;
          our_conditions.innerHTML = data.weather[0].description;
          our_sunset.innerHTML = data.sys.sunset;
          output.style.display = "block";
        }
        sudburyBtn.onclick = sudburyButton;
      }
    }
  };

  let output = document.getElementById("output");

  xhr.open('GET', url);

  xhr.responseType = "json";

  xhr.send(null);
};


问:
Get the users and if you have the MFA configured, by API in VTEX
I need to get the users and if they have MFA activated in VTEX, By API because I need to save the info and show in report, in the admin portal I saw the column but i dont get the column with the users API , maybe existe other?

users and 2-Step Verification is active or not


问:
How to stop structured streaming query in spark-shell
I just started a structured streaming from within bin/spark-shell in bash.

```<code>//readstream is from json

result.writeStream.outputMode("complete").format("console").start().awaitTermination()
</code>```

Once I started it Ctrl+C doesn't seem to work anymore. And in spark-ui the Structured streaming tab doesnt contain any 'kill' command.

What I did just closing the bash...

Body:
I just started a structured streaming from within bin/spark-shell in bash.

//readstream is from json

result.writeStream.outputMode("complete").format("console").start().awaitTermination()

Once I started it Ctrl+C doesn't seem to work anymore. And in spark-ui the Structured streaming tab doesnt contain any 'kill' command.

What I did just closing the bash...


问:
Why is wired controler null
I have a wired controller and when I connect it to my phone, it doesn't work. I downloaded an app to help but is says my controller is null. I have a cord addon whatever it's called to help connect it to my phone. Please help. Image of cord addon. (https://i.stack.imgur.com/iV3Fg.jpg)

I tried restarting my phone.

Title: Why is wired controler null


问:
How i can pass all available event listener on v-on with object syntax in vue 3 script setup?
In vuetify you can do something like this

<v-menu
      v-model="showMenu"
      absolute
      offset-y
      style="max-width: 600px"
    >
      <template v-slot:activator="{ on, attrs }">
        <v-card
          class="portrait"
          img="https://cdn.vuetifyjs.com/images/cards/girl.jpg"
          height="300"
          width="600"
          v-bind="attrs"
          v-on="on"
        ></v-card>
      </template>

      <v-list>
        <v-list-item
          v-for="(item, index) in items"
          :key="index"
        >
          <v-list-item-title>{{ item.title }}</v-list-item-title>
        </v-list-item>
      </v-list>
    </v-menu>

```
<p>We can pass <code>on</code> from scoped slot to children component, however what if i want to the <code>on</code> to take all available event handler do i need to manually specify the event handler like this?</p>
<pre class="lang-js prettyprint-override"><code><script setup>
const on = {
  click: doThis
  keyup: doThis
  keydown: doThis
}
<script/>

<template>
  <slot :on="on"/>
</template/>
</code>```

or can i doing something like this?

Body:
In vuetify you can do something like this

<v-menu
      v-model="showMenu"
      absolute
      offset-y
      style="max-width: 600px"
    >
      <template v-slot:activator="{ on, attrs }">
        <v-card
          class="portrait"
          img="https://cdn.vuetifyjs.com/images/cards/girl.jpg"
          height="300"
          width="600"
          v-bind="attrs"
          v-on="on"
        ></v-card>
      </template>

      <v-list>
        <v-list-item
          v-for="(item, index) in items"
          :key="index"
        >
          <v-list-item-title>{{ item.title }}</v-list-item-title>
        </v-list-item>
      </v-list>
    </v-menu>

We can pass on from scoped slot to children component, however what if i want to the on to take all available event handler do i need to manually specify the event handler like this?


问:
node-gyp issues on Windows
```<code>C:\Users\dzold\Downloads\RocketApps>npm i
npm WARN deprecated @types/bson@4.2.0: This is a stub types definition. bson provides its own type definitions, so you do not need this installed.
npm WARN deprecated @discordjs/builders@0.16.0: no longer supported
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated node-crisp-api@1.12.3: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated node-pre-gyp@0.15.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm ERR! code 1
npm ERR! path C:\Users\dzold\Downloads\RocketApps\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\windows\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\dzold\Downloads\RocketApps\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli   'C:\\Users\\dzold\\Downloads\\RocketApps\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.17.0 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "C:\Python310\python.exe" in the PATH
npm ERR! gyp verb `which` succeeded C:\Python310\python.exe C:\Python310\python.exe
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Python310\python.exe -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack   File "<string>", line 1
npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR! gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:400:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1093:16)
npm ERR! gyp ERR! stack     at Socket.<anonymous> (node:internal/child_process:451:11)
npm ERR! gyp ERR! stack     at Socket.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at Pipe.<anonymous> (node:net:757:14)
npm ERR! gyp ERR! System Windows_NT 10.0.19045
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\dzold\\Downloads\\RocketApps\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\Users\dzold\Downloads\RocketApps\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.17.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1
</code>```

Anyone know why this happens when I try installing NPM packages? Its a node-gyp issue it appears to be. I tried fixes online, but nothing seemed to work. If anyone knows the issue, please let me know it'd be a great help

Title: node-gyp issues on Windows

Body:
C:\Users\dzold\Downloads\RocketApps>npm i
npm WARN deprecated @types/bson@4.2.0: This is a stub types definition. bson provides its own type definitions, so you do not need this installed.
npm WARN deprecated @discordjs/builders@0.16.0: no longer supported
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated node-crisp-api@1.12.3: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated node-pre-gyp@0.14.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm WARN deprecated node-pre-gyp@0.15.0: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
npm ERR! code 1
npm ERR! path C:\Users\dzold\Downloads\RocketApps\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\windows\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\dzold\Downloads\RocketApps\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli   'C:\\Users\\dzold\\Downloads\\RocketApps\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.17.0 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "C:\Python310\python.exe" in the PATH
npm ERR! gyp verb `which` succeeded C:\Python310\python.exe C:\Python310\python.exe
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: C:\Python310\python.exe -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack   File "<string>", line 1
npm ERR! gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR! gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:400:12)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1093:16)
npm ERR! gyp ERR! stack     at Socket.<anonymous> (node:internal/child_process:451:11)
npm ERR! gyp ERR! stack     at Socket.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at Pipe.<anonymous> (node:net:757:14)
npm ERR! gyp ERR! System Windows_NT 10.0.19045
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\dzold\\Downloads\\RocketApps\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\Users\dzold\Downloads\RocketApps\node_modules\node-sass
npm ERR! gyp ERR! node -v v16.17.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

Anyone know why this happens when I try installing NPM packages? Its a node-gyp issue it appears to be. I tried fixes online, but nothing seemed to work. If anyone knows the issue, please let me know it'd be a great help


问:
OpenCV v3.4.1 : undefined reference to `ippicvi' from "libopencv_world.a" that compiled by me from Linux
I tried to compile libopencv_world.a(https://opencv.org/opencv-3-4-1/) from Linux system with CMake command below.

```<code>cmake \ -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D WITH_TBB=ON \ -D WITH_IPP=ON \ -D WITH_1394=OFF \ -D BUILD_WITH_DEBUG_INFO=OFF \ -D BUILD_DOCS=OFF \ -D INSTALL_C_EXAMPLES=OFF \ -D INSTALL_PYTHON_EXAMPLES=OFF \ -D BUILD_EXAMPLES=OFF \ -D BUILD_TESTS=OFF \ -D BUILD_PERF_TESTS=OFF \ -D WITH_QT=OFF \ -D WITH_GTK=OFF \ -D WITH_OPENGL=ON \ -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.1/modules \ -D WITH_V4L=ON \ -D WITH_FFMPEG=ON \ -D WITH_XINE=ON \ -D BUILD_NEW_PYTHON_SUPPORT=ON \ -D OPENCV_GENERATE_PKGCONFIG=ON -D BUILD_opencv_world=ON -D BUILD_SHARED_LIBS=OFF -D OpenCV_ARCH=x64 ../
</code>```

but after I checked for result of my compiled file libopencv_world.a, that was like below.

```<code>nm opencv-3.4.1_x64r/build/lib/libopencv_world.a
algorithm.cpp.o:
0000000000000000 V DW.ref.__gxx_personality_v0
                 U _GLOBAL_OFFSET_TABLE_
                 U __gxx_personality_v0
0000000000000000 r .LC0
                 U _Unwind_Resume
                 U _ZdlPv
                 U _ZN2cv11FileStorageC1ERKNS_6StringEiS3_
                 U _ZN2cv11FileStorageD1Ev
                 U _ZN2cv5errorEiRKNS_6StringEPKcS4_i
                 U _ZN2cv5utils5trace7details6Region7destroyEv
                 U _ZN2cv5utils5trace7details6RegionC1ERKNS3_21LocationStaticStorageE
                 U _ZN2cv5writeERNS_11FileStorageERKNS_6StringEi
                 U _ZN2cv6String10deallocateEv
                 U _ZN2cv6String8allocateEm
0000000000000000 W _ZN2cv9Algorithm4readERKNS_8FileNodeE
0000000000000000 W _ZN2cv9Algorithm5clearEv
0000000000000000 T _ZN2cv9AlgorithmC1Ev
0000000000000000 T _ZN2cv9AlgorithmC2Ev
0000000000000000 T _ZN2cv9AlgorithmD0Ev
0000000000000000 T _ZN2cv9AlgorithmD1Ev
0000000000000000 T _ZN2cv9AlgorithmD2Ev
                 U _ZN2cvlsERNS_11FileStorageERKNS_6StringE
0000000000000000 T _ZNK2cv9Algorithm11writeFormatERNS_11FileStorageE
0000000000000000 T _ZNK2cv9Algorithm14getDefaultNameEv
0000000000000000 T _ZNK2cv9Algorithm4saveERKNS_6StringE
0000000000000000 W _ZNK2cv9Algorithm5emptyEv
0000000000000000 T _ZNK2cv9Algorithm5writeERKNS_3PtrINS_11FileStorageEEERKNS_6StringE
0000000000000000 W _ZNK2cv9Algorithm5writeERNS_11FileStorageE
0000000000000000 V _ZTIN2cv9AlgorithmE
0000000000000000 V _ZTSN2cv9AlgorithmE
                 U _ZTVN10__cxxabiv117__class_type_infoE
0000000000000000 V _ZTVN2cv9AlgorithmE
0000000000000000 r _ZZN2cv9AlgorithmC1EvE19__PRETTY_FUNCTION__
0000000000000000 d _ZZN2cv9AlgorithmC1EvE24__cv_trace_location_fn50
0000000000000000 b _ZZN2cv9AlgorithmC1EvE30__cv_trace_location_extra_fn50
0000000000000000 r _ZZN2cv9AlgorithmD1EvE19__PRETTY_FUNCTION__
0000000000000000 d _ZZN2cv9AlgorithmD1EvE24__cv_trace_location_fn55
0000000000000000 b _ZZN2cv9AlgorithmD1EvE30__cv_trace_location_extra_fn55
0000000000000000 r _ZZN2cvlsIiEERNS_11FileStorageES2_RKT_E8__func__
0000000000000000 r _ZZNK2cv9Algorithm11writeFormatERNS_11FileStorageEE19__PRETTY_FUNCTION__
0000000000000000 d _ZZNK2cv9Algorithm11writeFormatERNS_11FileStorageEE24__cv_trace_location_fn88
0000000000000000 b _ZZNK2cv9Algorithm11writeFormatERNS_11FileStorageEE30__cv_trace_location_extra_fn88
0000000000000000 r _ZZNK2cv9Algorithm14getDefaultNameEvE19__PRETTY_FUNCTION__
0000000000000000 d _ZZNK2cv9Algorithm14getDefaultNameEvE24__cv_trace_location_fn82
0000000000000000 b _ZZNK2cv9Algorithm14getDefaultNameEvE30__cv_trace_location_extra_fn82
0000000000000000 r _ZZNK2cv9Algorithm4saveERKNS_6StringEE19__PRETTY_FUNCTION__
0000000000000000 d _ZZNK2cv9Algorithm4saveERKNS_6StringEE24__cv_trace_location_fn73
0000000000000000 b _ZZNK2cv9Algorithm4saveERKNS_6StringEE30__cv_trace_location_extra_fn73
0000000000000000 r _ZZNK2cv9Algorithm5writeERKNS_3PtrINS_11FileStorageEEERKNS_6StringEE19__PRETTY_FUNCTION__
0000000000000000 d _ZZNK2cv9Algorithm5writeERKNS_3PtrINS_11FileStorageEEERKNS_6StringEE24__cv_trace_location_fn60
0000000000000000 b _ZZNK2cv9Algorithm5writeERKNS_3PtrINS_11FileStorageEEERKNS_6StringEE30__cv_trace_location_extra_fn60

alloc.cpp.o:
0000000000000000 T cvAlloc
0000000000000000 T cvFree_
0000000000000000 V DW.ref.__gxx_personality_v0
                 U free
                 U _GLOBAL_OFFSET_TABLE_
                 U __gxx_personality_v0
0000000000000000 r .LC0
0000000000000000 r .LC1
                 U posix_memalign
                 U _Unwind_Resume
0000000000000000 T _ZN2cv10fastMallocEm
                 U _ZN2cv5errorEiRKNS_6StringEPKcS4_i
                 U _ZN2cv6formatEPKcz
                 U _ZN2cv6String10deallocateEv
0000000000000000 T _ZN2cv8fastFreeEPv
0000000000000000 r _ZZN2cvL16OutOfMemoryErrorEmE8__func__

arithm.cpp.o:
0000000000000000 T cvAbsDiff
0000000000000000 T cvAbsDiffS
0000000000000000 T cvAdd
0000000000000000 T cvAddS
0000000000000000 T cvAddWeighted
0000000000000000 T cvAnd
0000000000000000 T cvAndS
0000000000000000 T cvCmp
0000000000000000 T cvCmpS
0000000000000000 T cvDiv
0000000000000000 T cvInRange
0000000000000000 T cvInRangeS
0000000000000000 T cvMax
0000000000000000 T cvMaxS
0000000000000000 T cvMin
0000000000000000 T cvMinS
0000000000000000 T cvMul
0000000000000000 T cvNot
0000000000000000 T cvOr
0000000000000000 T cvOrS
0000000000000000 T cvSub
0000000000000000 T cvSubRS
0000000000000000 T cvXor
0000000000000000 T cvXorS
0000000000000000 V DW.ref.__gxx_personality_v0
                 U _GLOBAL_OFFSET_TABLE_
                 U __gxx_personality_v0
                 U ippicviAbsDiff_16u_C1R
                 U ippicviAbsDiff_32f_C1R
                 U ippicviAbsDiff_8u_C1R
                 U ippicviAdd_16s_C1RSfs
                 U ippicviAdd_16u_C1RSfs
                 U ippicviAdd_32f_C1R
                 U ippicviAdd_8u_C1RSfs
                 U ippicviAnd_8u_C1R
.
.
.
.
.
.
</code>```

So I'm wonder or I want to know which is correct option for CMake command with opencv-3.4.1 from Linux.

Body:
I tried to compile libopencv_world.a(https://opencv.org/opencv-3-4-1/) from Linux system with CMake command below.

cmake \ -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D WITH_TBB=ON \ -D WITH_IPP=ON \ -D WITH_1394=OFF \ -D BUILD_WITH_DEBUG_INFO=OFF \ -D BUILD_DOCS=OFF \ -D INSTALL_C_EXAMPLES=OFF \ -D INSTALL_PYTHON_EXAMPLES=OFF \ -D BUILD_EXAMPLES=OFF \ -D BUILD_TESTS=OFF \ -D BUILD_PERF_TESTS=OFF \ -D WITH_QT=OFF \ -D WITH_GTK=OFF \ -D WITH_OPENGL=ON \ -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-3.4.1/modules \ -D WITH_V4L=ON \ -D WITH_FFMPEG=ON \ -D WITH_XINE=ON \ -D BUILD_NEW_PYTHON_SUPPORT=ON \ -D OPENCV_GENERATE_PKGCONFIG=ON -D BUILD_opencv_world=ON -D BUILD_SHARED_LIBS=OFF -D OpenCV_ARCH=x64 ../

but after I checked for result of my compiled file libopencv_world.a, that was like below.

nm opencv-3.4.1_x64r/build/lib/libopencv_world.a
algorithm.cpp.o:
0000000000000000 V DW.ref.__gxx_personality_v0
                 U _GLOBAL_OFFSET_TABLE_
                 U __gxx_personality_v0
0000000000000000 r .LC0
                 U _Unwind_Resume
                 U _ZdlPv
                 U _ZN2cv11FileStorageC1ERKNS_6StringEiS3_
                 U _ZN2cv11FileStorageD1Ev
                 U _ZN2cv5errorEiRKNS_6StringEPKcS4_i
                 U _ZN2cv5utils5trace7details6Region7destroyEv
                 U _ZN2cv5utils5trace7details6RegionC1ERKNS3_21LocationStaticStorageE
                 U _ZN2cv5writeERNS_11FileStorageERKNS_6StringEi
                 U _ZN2cv6String10deallocateEv
                 U _ZN2cv6String8allocateEm
0000000000000000 W _ZN2cv9Algorithm4readERKNS_8FileNodeE
0000000000000000 W _ZN2cv9Algorithm5clearEv
0000000000000000 T _ZN2cv9AlgorithmC1Ev
0000000000000000 T _ZN2cv9AlgorithmC2Ev
0000000000000000 T _ZN2cv9AlgorithmD0Ev
0000000000000000 T _ZN2cv9AlgorithmD1Ev
0000000000000000 T _ZN2cv9AlgorithmD2Ev
                 U _ZN2cvlsERNS_11FileStorageERKNS_6StringE
0000000000000000 T _ZNK2cv9Algorithm11writeFormatERNS_11FileStorageE
0000000000000000 T _ZNK2cv9Algorithm14getDefaultNameEv
0000000000000000 T _ZNK2cv9Algorithm4saveERKNS_6StringE
0000000000000000 W _ZNK2cv9Algorithm5emptyEv
0000000000000000 T _ZNK2cv9Algorithm5writeERKNS_3PtrINS_11FileStorageEEERKNS_6StringE
0000000000000000 W _ZNK2cv9Algorithm5writeERNS_11FileStorageE
0000000000000000 V _ZTIN2cv9AlgorithmE
0000000000000000 V _ZTSN2cv9AlgorithmE
                 U _ZTVN10__cxxabiv117__class_type_infoE
0000000000000000 V _ZTVN2cv9AlgorithmE
0000000000000000 r _ZZN2cv9AlgorithmC1EvE19__PRETTY_FUNCTION__
0000000000000000 d _ZZN2cv9AlgorithmC1EvE24__cv_trace_location_fn50
0000000000000000 b _ZZN2cv9AlgorithmC1EvE30__cv_trace_location_extra_fn50
0000000000000000 r _ZZN2cv9AlgorithmD1EvE19__PRETTY_FUNCTION__
0000000000000000 d _ZZN2cv9AlgorithmD1EvE24__cv_trace_location_fn55
0000000000000000 b _ZZN2cv9AlgorithmD1EvE30__cv_trace_location_extra_fn55
0000000000000000 r _ZZN2cvlsIiEERNS_11FileStorageES2_RKT_E8__func__
0000000000000000 r _ZZNK2cv9Algorithm11writeFormatERNS_11FileStorageEE19__PRETTY_FUNCTION__
0000000000000000 d _ZZNK2cv9Algorithm11writeFormatERNS_11FileStorageEE24__cv_trace_location_fn88
0000000000000000 b _ZZNK2cv9Algorithm11writeFormatERNS_11FileStorageEE30__cv_trace_location_extra_fn88
0000000000000000 r _ZZNK2cv9Algorithm14getDefaultNameEvE19__PRETTY_FUNCTION__
0000000000000000 d _ZZNK2cv9Algorithm14getDefaultNameEvE24__cv_trace_location_fn82
0000000000000000 b _ZZNK2cv9Algorithm14getDefaultNameEvE30__cv_trace_location_extra_fn82
0000000000000000 r _ZZNK2cv9Algorithm4saveERKNS_6StringEE19__PRETTY_FUNCTION__
0000000000000000 d _ZZNK2cv9Algorithm4saveERKNS_6StringEE24__cv_trace_location_fn73
0000000000000000 b _ZZNK2cv9Algorithm4saveERKNS_6StringEE30__cv_trace_location_extra_fn73
0000000000000000 r _ZZNK2cv9Algorithm5writeERKNS_3PtrINS_11FileStorageEEERKNS_6StringEE19__PRETTY_FUNCTION__
0000000000000000 d _ZZNK2cv9Algorithm5writeERKNS_3PtrINS_11FileStorageEEERKNS_6StringEE24__cv_trace_location_fn60
0000000000000000 b _ZZNK2cv9Algorithm5writeERKNS_3PtrINS_11FileStorageEEERKNS_6StringEE30__cv_trace_location_extra_fn60

alloc.cpp.o:
0000000000000000 T cvAlloc
0000000000000000 T cvFree_
0000000000000000 V DW.ref.__gxx_personality_v0
                 U free
                 U _GLOBAL_OFFSET_TABLE_
                 U __gxx_personality_v0
0000000000000000 r .LC0
0000000000000000 r .LC1
                 U posix_memalign
                 U _Unwind_Resume
0000000000000000 T _ZN2cv10fastMallocEm
                 U _ZN2cv5errorEiRKNS_6StringEPKcS4_i
                 U _ZN2cv6formatEPKcz
                 U _ZN2cv6String10deallocateEv
0000000000000000 T _ZN2cv8fastFreeEPv
0000000000000000 r _ZZN2cvL16OutOfMemoryErrorEmE8__func__

arithm.cpp.o:
0000000000000000 T cvAbsDiff
0000000000000000 T cvAbsDiffS
0000000000000000 T cvAdd
0000000000000000 T cvAddS
0000000000000000 T cvAddWeighted
0000000000000000 T cvAnd
0000000000000000 T cvAndS
0000000000000000 T cvCmp
0000000000000000 T cvCmpS
0000000000000000 T cvDiv
0000000000000000 T cvInRange
0000000000000000 T cvInRangeS
0000000000000000 T cvMax
0000000000000000 T cvMaxS
0000000000000000 T cvMin
0000000000000000 T cvMinS
0000000000000000 T cvMul
0000000000000000 T cvNot
0000000000000000 T cvOr
0000000000000000 T cvOrS
0000000000000000 T cvSub
0000000000000000 T cvSubRS
0000000000000000 T cvXor
0000000000000000 T cvXorS
0000000000000000 V DW.ref.__gxx_personality_v0
                 U _GLOBAL_OFFSET_TABLE_
                 U __gxx_personality_v0
                 U ippicviAbsDiff_16u_C1R
                 U ippicviAbsDiff_32f_C1R
                 U ippicviAbsDiff_8u_C1R
                 U ippicviAdd_16s_C1RSfs
                 U ippicviAdd_16u_C1RSfs
                 U ippicviAdd_32f_C1R
                 U ippicviAdd_8u_C1RSfs
                 U ippicviAnd_8u_C1R
.
.
.
.
.
.

So I'm wonder or I want to know which is correct option for CMake command with opencv-3.4.1 from Linux.


问:
How can I get the network traffic metrics using puppeteer
How can I get the kB transferred (all network traffic) and MB resources, and Finish time in minutes?


问:
The application does not start on the ios simulator
I'm working on a react native app with firebase, the app works great on android, but everytime I try to start the dev server for ios simulator I get this error.
I initialized my application with Expo bare workflow, and I followed all the configurations for setting up the development environment from the official react native site and I also followed all the firebase configurations from the rnfirebase.io
I need help</p>
```<code>❌  (ios/Pods/FirebaseCoreInternal/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatStorage.swift:109:38)

  107 |   func readAndWriteAsync(using transform: @escaping (HeartbeatsBundle?) -> HeartbeatsBundle?) {
  108 |     queue.async { [self] in
> 109 |       let oldHeartbeatsBundle = try? load(from: storage)
      |                                      ^ call to method 'load' in closure requires explicit 'self.' to make capture semantics explicit
  110 |       let newHeartbeatsBundle = transform(oldHeartbeatsBundle)
  111 |       try? save(newHeartbeatsBundle, to: storage)
  112 |     }

❌  (ios/Pods/FirebaseCoreInternal/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatStorage.swift:109:49)

  107 |   func readAndWriteAsync(using transform: @escaping (HeartbeatsBundle?) -> HeartbeatsBundle?) {
  108 |     queue.async { [self] in
> 109 |       let oldHeartbeatsBundle = try? load(from: storage)
      |                                                 ^ reference to property 'storage' in closure requires explicit 'self.' to make capture semantics explicit
  110 |       let newHeartbeatsBundle = transform(oldHeartbeatsBundle)
  111 |       try? save(newHeartbeatsBundle, to: storage)
  112 |     }

❌  (ios/Pods/FirebaseCoreInternal/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatStorage.swift:111:12)

  109 |       let oldHeartbeatsBundle = try? load(from: storage)
  110 |       let newHeartbeatsBundle = transform(oldHeartbeatsBundle)
> 111 |       try? save(newHeartbeatsBundle, to: storage)
      |            ^ call to method 'save' in closure requires explicit 'self.' to make capture semantics explicit
  112 |     }
  113 |   }
  114 |

❌  (ios/Pods/FirebaseCoreInternal/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatStorage.swift:111:42)

  109 |       let oldHeartbeatsBundle = try? load(from: storage)
  110 |       let newHeartbeatsBundle = transform(oldHeartbeatsBundle)
> 111 |       try? save(newHeartbeatsBundle, to: storage)
      |                                          ^ reference to property 'storage' in closure requires explicit 'self.' to make capture semantics explicit
  112 |     }
  113 |   }
  114 |

› Compiling @react-native-firebase/auth Pods/FirebaseCoreInternal » RingBuffer.swift
› Compiling @react-native-firebase/auth Pods/FirebaseCoreInternal » _ObjC_HeartbeatController.swift
› Compiling @react-native-firebase/auth Pods/FirebaseCoreInternal » HeartbeatController.swift
› Compiling @react-native-firebase/auth Pods/FirebaseCoreInternal » HeartbeatsBundle.swift
› Compiling @react-native-firebase/auth Pods/FirebaseCoreInternal » Heartbeat.swift
› Compiling react-native Pods/RCT-Folly » SysUio.cpp
› Compiling react-native Pods/RCT-Folly » FileUtil.cpp
› Compiling react-native Pods/RCT-Folly » NetOps.cpp
› Packaging @react-native-firebase/auth Pods/GoogleDataTransport » libGoogleDataTransport.a
› Packaging react-native Pods/RCT-Folly » libRCT-Folly.a
› Compiling @react-native-firebase/auth Pods/FirebaseCoreDiagnostics » FIRCoreDiagnostics.m
    Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Gocoinet editor. (in target 'Gocoinet' from project 'Gocoinet')

› 4 error(s), and 1 warning(s)

CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.
</code>```

Body:
I'm working on a react native app with firebase, the app works great on android, but everytime I try to start the dev server for ios simulator I get this error.
I initialized my application with Expo bare workflow, and I followed all the configurations for setting up the development environment from the official react native site and I also followed all the firebase configurations from the rnfirebase.io
I need help

❌  (ios/Pods/FirebaseCoreInternal/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatStorage.swift:109:38)

  107 |   func readAndWriteAsync(using transform: @escaping (HeartbeatsBundle?) -> HeartbeatsBundle?) {
  108 |     queue.async { [self] in
> 109 |       let oldHeartbeatsBundle = try? load(from: storage)
      |                                      ^ call to method 'load' in closure requires explicit 'self.' to make capture semantics explicit
  110 |       let newHeartbeatsBundle = transform(oldHeartbeatsBundle)
  111 |       try? save(newHeartbeatsBundle, to: storage)
  112 |     }

❌  (ios/Pods/FirebaseCoreInternal/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatStorage.swift:109:49)

  107 |   func readAndWriteAsync(using transform: @escaping (HeartbeatsBundle?) -> HeartbeatsBundle?) {
  108 |     queue.async { [self] in
> 109 |       let oldHeartbeatsBundle = try? load(from: storage)
      |                                                 ^ reference to property 'storage' in closure requires explicit 'self.' to make capture semantics explicit
  110 |       let newHeartbeatsBundle = transform(oldHeartbeatsBundle)
  111 |       try? save(newHeartbeatsBundle, to: storage)
  112 |     }

❌  (ios/Pods/FirebaseCoreInternal/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatStorage.swift:111:12)

  109 |       let oldHeartbeatsBundle = try? load(from: storage)
  110 |       let newHeartbeatsBundle = transform(oldHeartbeatsBundle)
> 111 |       try? save(newHeartbeatsBundle, to: storage)
      |            ^ call to method 'save' in closure requires explicit 'self.' to make capture semantics explicit
  112 |     }
  113 |   }
  114 |

❌  (ios/Pods/FirebaseCoreInternal/FirebaseCore/Internal/Sources/HeartbeatLogging/HeartbeatStorage.swift:111:42)

  109 |       let oldHeartbeatsBundle = try? load(from: storage)
  110 |       let newHeartbeatsBundle = transform(oldHeartbeatsBundle)
> 111 |       try? save(newHeartbeatsBundle, to: storage)
      |                                          ^ reference to property 'storage' in closure requires explicit 'self.' to make capture semantics explicit
  112 |     }
  113 |   }
  114 |

› Compiling @react-native-firebase/auth Pods/FirebaseCoreInternal » RingBuffer.swift
› Compiling @react-native-firebase/auth Pods/FirebaseCoreInternal » _ObjC_HeartbeatController.swift
› Compiling @react-native-firebase/auth Pods/FirebaseCoreInternal » HeartbeatController.swift
› Compiling @react-native-firebase/auth Pods/FirebaseCoreInternal » HeartbeatsBundle.swift
› Compiling @react-native-firebase/auth Pods/FirebaseCoreInternal » Heartbeat.swift
› Compiling react-native Pods/RCT-Folly » SysUio.cpp
› Compiling react-native Pods/RCT-Folly » FileUtil.cpp
› Compiling react-native Pods/RCT-Folly » NetOps.cpp
› Packaging @react-native-firebase/auth Pods/GoogleDataTransport » libGoogleDataTransport.a
› Packaging react-native Pods/RCT-Folly » libRCT-Folly.a
› Compiling @react-native-firebase/auth Pods/FirebaseCoreDiagnostics » FIRCoreDiagnostics.m
    Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the Gocoinet editor. (in target 'Gocoinet' from project 'Gocoinet')

› 4 error(s), and 1 warning(s)

CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.


问:
How to make the entire annotation(title) callout clickable
How to make the entire annotation(title) callout clickable?I am using MKAnnotation to show the callout.Is it possible without custom callout method?

Need help on this

ContentLicense: CC BY-SA 3.0


问:
Can't Plot Graph from training Model in Multi classification
Help me solve the problem/error the graph could not be plotted, i am a python beginner

ValueError: x and y must have same first dimension, but have shapes (100,) and (938,)

My code is below

```<code>#code

mnist_trainset = datasets.MNIST(root='./data', train=True, download=True, transform=transforms.Compose([transforms.ToTensor()]))
mnist_testset = datasets.MNIST(root='./data', train=False, download=True, transform=transforms.Compose([transforms.ToTensor()]))

mnist_valset, mnist_testset = torch.utils.data.random_split(mnist_testset, [int(0.9 * len(mnist_testset)), int(0.1 * len(mnist_testset))])

train_dataloader = torch.utils.data.DataLoader(mnist_trainset, batch_size=64, shuffle=True)
val_dataloader = torch.utils.data.DataLoader(mnist_valset, batch_size=32, shuffle=False)
test_dataloader = torch.utils.data.DataLoader(mnist_testset, batch_size=32, shuffle=False)

print("Training dataset size: ", len(mnist_trainset))
print("Validation dataset size: ", len(mnist_valset))
print("Testing dataset size: ", len(mnist_testset))

# visualize data
fig=plt.figure(figsize=(20, 10))
for i in range(1, 6):
  img = transforms.ToPILImage(mode='L')(mnist_trainset[i][0])
  fig.add_subplot(1, 6, i)
  plt.title(mnist_trainset[i][1])
  plt.imshow(img, cmap="gray")
plt.show()

#model = Model()
criterion = torch.nn.CrossEntropyLoss()
optimizer = torch.optim.Adam(model.parameters(), lr=0.1)

if (torch.cuda.is_available()):
  model.cuda()

no_epochs = 100
train_loss = list()
val_loss = list()
best_val_loss = 1
for epoch in range(no_epochs):
  total_train_loss = 0
  total_val_loss = 0

  model.train()

  # training
  for itr, (image, label) in enumerate(train_dataloader):

      if (torch.cuda.is_available()):
          image = image.cuda()
          label = label.cuda()

      optimizer.zero_grad()

      pred = model(image)

      loss = criterion(pred, label)
      total_train_loss += loss.item()

      loss.backward()
      optimizer.step()

  total_train_loss = total_train_loss / (itr + 1)
  train_loss.append(total_train_loss)
</code>```

I searched all previous issues and could not get through about the solutions

I have posted the code

Body:
Help me solve the problem/error the graph could not be plotted, i am a python beginner

ValueError: x and y must have same first dimension, but have shapes (100,) and (938,)

My code is below

#code

mnist_trainset = datasets.MNIST(root='./data', train=True, download=True, transform=transforms.Compose([transforms.ToTensor()]))
mnist_testset = datasets.MNIST(root='./data', train=False, download=True, transform=transforms.Compose([transforms.ToTensor()]))

mnist_valset, mnist_testset = torch.utils.data.random_split(mnist_testset, [int(0.9 * len(mnist_testset)), int(0.1 * len(mnist_testset))])

train_dataloader = torch.utils.data.DataLoader(mnist_trainset, batch_size=64, shuffle=True)
val_dataloader = torch.utils.data.DataLoader(mnist_valset, batch_size=32, shuffle=False)
test_dataloader = torch.utils.data.DataLoader(mnist_testset, batch_size=32, shuffle=False)

print("Training dataset size: ", len(mnist_trainset))
print("Validation dataset size: ", len(mnist_valset))
print("Testing dataset size: ", len(mnist_testset))

# visualize data
fig=plt.figure(figsize=(20, 10))
for i in range(1, 6):
  img = transforms.ToPILImage(mode='L')(mnist_trainset[i][0])
  fig.add_subplot(1, 6, i)
  plt.title(mnist_trainset[i][1])
  plt.imshow(img, cmap="gray")
plt.show()

#model = Model()
criterion = torch.nn.CrossEntropyLoss()
optimizer = torch.optim.Adam(model.parameters(), lr=0.1)

if (torch.cuda.is_available()):
  model.cuda()

no_epochs = 100
train_loss = list()
val_loss = list()
best_val_loss = 1
for epoch in range(no_epochs):
  total_train_loss = 0
  total_val_loss = 0

  model.train()

  # training
  for itr, (image, label) in enumerate(train_dataloader):

      if (torch.cuda.is_available()):
          image = image.cuda()
          label = label.cuda()

      optimizer.zero_grad()

      pred = model(image)

      loss = criterion(pred, label)
      total_train_loss += loss.item()

      loss.backward()
      optimizer.step()

  total_train_loss = total_train_loss / (itr + 1)
  train_loss.append(total_train_loss)

I searched all previous issues and could not get through about the solutions

I have posted the code


问:
How to specify reporter-options in CLI for specific reporter module being used with cypress-multi-reporters?
I am using the cypress-multi-reporters npm module to generate both a JUnit report and an html report using the mocha-junit-reporter and mochawesome modules respectively. I am trying to specify the mochawesome reportFilename value via the cli to accommodate multiple tests that require specific file names but can't figure out how to achieve this.

At the moment the Cypress tests are run via a shell script containing commands that looks like this:

```<code>cypress-ntlm run --reporter cypress-multi-reporters --reporter-options configFile=reporter-config.json --spec cypress/sometest1.feature

cypress-ntlm run --reporter cypress-multi-reporters --reporter-options configFile=reporter-config.json --spec cypress/sometest2.feature

</code>```

My reporter-config.json file looks like this:

```<code>{
    "reporterEnabled": "mochawesome, mocha-junit-reporter",
        "mochawesomeReporterOptions": {
            "reportDir": "cypress/integration/reports",
            "reportFilename": "Test",
            "overwrite": false,
            "html": true,
            "json": false
        },
        "mochaJunitReporterReporterOptions": {
            "mochaFile": "cypress/results/results-[hash].xml"
        }
}
</code>```

This works fine, but I need the html reports generated by mochawesome to have specific filenames declared in my shell script. This was easily doable before I started using the cypress-multi-reporters module with the following commands:

```<code>cypress-ntlm run --reporter mochawesome --reporter-options reportFilename='specific-filename' --spec cypress/sometest.feature

cypress-ntlm run --reporter mochawesome --reporter-options reportFilename='another-specific-filename' --spec cypress/sometest2.feature
</code>```

Is anyone aware of any way to achieve this using the cypress-multi-reporters module? I've scoured the documentation and am not having much luck. Thanks.

Body:
I am using the cypress-multi-reporters npm module to generate both a JUnit report and an html report using the mocha-junit-reporter and mochawesome modules respectively. I am trying to specify the mochawesome reportFilename value via the cli to accommodate multiple tests that require specific file names but can't figure out how to achieve this.

At the moment the Cypress tests are run via a shell script containing commands that looks like this:

cypress-ntlm run --reporter cypress-multi-reporters --reporter-options configFile=reporter-config.json --spec cypress/sometest1.feature

cypress-ntlm run --reporter cypress-multi-reporters --reporter-options configFile=reporter-config.json --spec cypress/sometest2.feature

My reporter-config.json file looks like this:

{
    "reporterEnabled": "mochawesome, mocha-junit-reporter",
        "mochawesomeReporterOptions": {
            "reportDir": "cypress/integration/reports",
            "reportFilename": "Test",
            "overwrite": false,
            "html": true,
            "json": false
        },
        "mochaJunitReporterReporterOptions": {
            "mochaFile": "cypress/results/results-[hash].xml"
        }
}

This works fine, but I need the html reports generated by mochawesome to have specific filenames declared in my shell script. This was easily doable before I started using the cypress-multi-reporters module with the following commands:

cypress-ntlm run --reporter mochawesome --reporter-options reportFilename='specific-filename' --spec cypress/sometest.feature

cypress-ntlm run --reporter mochawesome --reporter-options reportFilename='another-specific-filename' --spec cypress/sometest2.feature

Is anyone aware of any way to achieve this using the cypress-multi-reporters module? I've scoured the documentation and am not having much luck. Thanks.


问:
Jetbrains DataSpell module can't be find while using nb_conda_kernel
there is a little bug while I using dataspell with conda kernels
here are my conda env info
conda (base) env installed jupyter nb_conda_kernels
conda (audio) env which i create in conda ,installed ipykernel,numpy
conda (base) env without numpy is set as the project python interpreter
conda (audio) env with numpy ,is set as the jupyter kernel

but in dataspell ,it shows that No module named 'numpy'  but the code using numpy can run rightly
bug renport picture

I think its a bug while finding modules ds will looking for them in project python interpreter,while the ipynb code actually run using selected conda kernel.
Though my code can be run ,it is a little annoying.


问:
Which variable type to use when sending an image to frontend? .NET EF 6
I need to send an image along with some other data to my front-end of a web application and am wondering which data type to use. I am using .NET EF Core 6 and React.js for this project.

I tried using Image, byte[], IFormFile, string version of the byte[] but couldn't manage to find a way to retrieve my saved picture in a way to send it to my front-end. Here is the code:

```<code>public class User : IEntity
    {
        //data containing string, int etc.
        public string ProfilePicture { get; set; }
    }
</code>```

Part above is the object I am trying to send.

```<code>public IDataResult<User> Add(UserAddDTO userInfo)
        {
            try
            {
                var userAdd = new User
                {
                    //assigning variables
                    ProfilePicture = userInfo.ProfilePicture.FileName,
                };
                if (userInfo.ProfilePicture.Length > 0)
                {
                    using (FileStream filestream = File.Create(/*file location*/)
                    {
                        userInfo.ProfilePicture.CopyTo(filestream);
                        filestream.Flush();
                    }
                }
                _userDao.Add(userAdd);
                return new SuccessDataResult<User>(userAdd, Messages.UserAdded);
            }
            catch (Exception Ex)
            {
                return new ErrorDataResult<User>(Ex.Message);
            }
        }
</code>```

Part above is the business logic part. In this part variables and the picture is being received and the picture is saved into a file. In the database other variables and the name of the file is held.

Up to here there is no problem. What I also want to do is return this newly created User back in SuccessDataResult<User> object. How can I get my saved image in a way that allows me to send it along with other data?

Body:
I need to send an image along with some other data to my front-end of a web application and am wondering which data type to use. I am using .NET EF Core 6 and React.js for this project.

I tried using Image, byte[], IFormFile, string version of the byte[] but couldn't manage to find a way to retrieve my saved picture in a way to send it to my front-end. Here is the code:

public class User : IEntity
    {
        //data containing string, int etc.
        public string ProfilePicture { get; set; }
    }

Part above is the object I am trying to send.

public IDataResult<User> Add(UserAddDTO userInfo)
        {
            try
            {
                var userAdd = new User
                {
                    //assigning variables
                    ProfilePicture = userInfo.ProfilePicture.FileName,
                };
                if (userInfo.ProfilePicture.Length > 0)
                {
                    using (FileStream filestream = File.Create(/*file location*/)
                    {
                        userInfo.ProfilePicture.CopyTo(filestream);
                        filestream.Flush();
                    }
                }
                _userDao.Add(userAdd);
                return new SuccessDataResult<User>(userAdd, Messages.UserAdded);
            }
            catch (Exception Ex)
            {
                return new ErrorDataResult<User>(Ex.Message);
            }
        }

Part above is the business logic part. In this part variables and the picture is being received and the picture is saved into a file. In the database other variables and the name of the file is held.

Up to here there is no problem. What I also want to do is return this newly created User back in SuccessDataResult<User> object. How can I get my saved image in a way that allows me to send it along with other data?


问:
How can I make my player move faster over time when I press the W and S buttons?
I tried making raw numbers into a variable move_speed and then in the render function did move_speed = move_speed / a number

my code:

```<code>const scene = new THREE.Scene();
const w = window.innerWidth;
const h = window.innerHeight;
let ai_skin;
let player_skin;
let move_speed = 0.005;

const camera = new THREE.PerspectiveCamera(60, w / h, 1, 10000);

const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setClearColor("#999999");
document.body.appendChild(renderer.domElement);

ai_skin = new THREE.Mesh(new THREE.BoxGeometry(5, 10, 5), new THREE.MeshLambertMaterial({ color: "#FFFFFF" }));
scene.add(ai_skin);
ai_skin.position.x = 50;

player_skin = new THREE.Mesh(new THREE.BoxGeometry(4, 8, 4), new THREE.MeshLambertMaterial({ color: "#FF0000" }));
scene.add(player_skin);
player_skin.position.x = -50;

const light = new THREE.PointLight("#FFFFFF", 1, 1000);
scene.add(light);
light.position.z = 100;

camera.position.z = 200;
camera.position.y = 50;

function render() {
    move_speed = move_speed / 0.000000000005;
    renderer.render(scene, camera);

    window.addEventListener("keydown", (e) => {
        if (e.key == "w") {
            player_skin.position.x += move_speed;
        }

        if (e.key == "s") {
            player_skin.position.x -= move_speed;
        }
    });
}

let interval = window.setInterval(render, 1);
</code>```

Nothing happened. I expected it to make the player's motion the same even over time.

Body:
I tried making raw numbers into a variable move_speed and then in the render function did move_speed = move_speed / a number

my code:

const scene = new THREE.Scene();
const w = window.innerWidth;
const h = window.innerHeight;
let ai_skin;
let player_skin;
let move_speed = 0.005;

const camera = new THREE.PerspectiveCamera(60, w / h, 1, 10000);

const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setClearColor("#999999");
document.body.appendChild(renderer.domElement);

ai_skin = new THREE.Mesh(new THREE.BoxGeometry(5, 10, 5), new THREE.MeshLambertMaterial({ color: "#FFFFFF" }));
scene.add(ai_skin);
ai_skin.position.x = 50;

player_skin = new THREE.Mesh(new THREE.BoxGeometry(4, 8, 4), new THREE.MeshLambertMaterial({ color: "#FF0000" }));
scene.add(player_skin);
player_skin.position.x = -50;

const light = new THREE.PointLight("#FFFFFF", 1, 1000);
scene.add(light);
light.position.z = 100;

camera.position.z = 200;
camera.position.y = 50;

function render() {
    move_speed = move_speed / 0.000000000005;
    renderer.render(scene, camera);

    window.addEventListener("keydown", (e) => {
        if (e.key == "w") {
            player_skin.position.x += move_speed;
        }

        if (e.key == "s") {
            player_skin.position.x -= move_speed;
        }
    });
}

let interval = window.setInterval(render, 1);

Nothing happened. I expected it to make the player's motion the same even over time.


问:
Understanding Linked Lists
I am encountering some confusion with LinkedLists. I have the following solution for a leetcode question, Palindrome Linked List. Here, we are trying to find if a linked list is a palindrome. I understand the solution, but a few details are confusing.

Here is the code & solution in question: https://leetcode.com/problems/palindrome-linked-list/submissions/860434826/.

# Definition for singly-linked list.
# class ListNode(object):
#     def __init__(self, val=0, next=None):
#         self.val = val
#         self.next = next
class Solution(object):
    def isPalindrome(self, head):
        """
        :type head: ListNode
        :rtype: bool
        """
        print(head, 'first')

        fast, slow = head, head
        while fast and fast.next:
            fast = fast.next.next
            slow = slow.next

        prev, cur = None, slow
        while cur:
            nxt = cur.next
            cur.next = prev
            prev = cur
            cur = nxt

        print(head, 'second')

        left, right = head, prev
        while right:
            if left.val != right.val:
                return False
            left = left.next
            right = right.next
        return True```

The idea for the code is we want to set a pointer to the middle (slow) and end (fast), then reverse the end pointer (fast), creating two split lists. Now, we process the two linked lists node by node and determine if they match, which means they are palindromes (and not if no match).

When I run the two print statements, they print different items (as shown in the screenshot). I imagine they would be the same, as the head object itself is never changing, only the reference. So, why is it different?

Title: Understanding Linked Lists

Body:
I am encountering some confusion with LinkedLists. I have the following solution for a leetcode question, Palindrome Linked List. Here, we are trying to find if a linked list is a palindrome. I understand the solution, but a few details are confusing.

Here is the code & solution in question: https://leetcode.com/problems/palindrome-linked-list/submissions/860434826/.

# Definition for singly-linked list.
# class ListNode(object):
#     def __init__(self, val=0, next=None):
#         self.val = val
#         self.next = next
class Solution(object):
    def isPalindrome(self, head):
        """
        :type head: ListNode
        :rtype: bool
        """
        print(head, 'first')

        fast, slow = head, head
        while fast and fast.next:
            fast = fast.next.next
            slow = slow.next

        prev, cur = None, slow
        while cur:
            nxt = cur.next
            cur.next = prev
            prev = cur
            cur = nxt

        print(head, 'second')

        left, right = head, prev
        while right:
            if left.val != right.val:
                return False
            left = left.next
            right = right.next
        return True

The idea for the code is we want to set a pointer to the middle (slow) and end (fast), then reverse the end pointer (fast), creating two split lists. Now, we process the two linked lists node by node and determine if they match, which means they are palindromes (and not if no match).

When I run the two print statements, they print different items (as shown in the screenshot). I imagine they would be the same, as the head object itself is never changing, only the reference. So, why is it different?


问:
Add video in the image using Elementor in WordPress
I need to add the video within the image(TV screen frame) like this using Elementor in WordPress

How can I do that?

should be added in this empty one exactly like it's shown on the first screen


问:
terraform plan "Reference to undeclared resource" error
I use terraformer to import AWS ALB resources.
But when I try to run terraform plan, this error happened.

```<code>│ Error: Reference to undeclared resource
│
│   on outputs.tf line 914, in output "output_name":
│  914:   value = aws_lb_target_group_attachment.attachment_name.id
│
│ A managed resource "aws_lb_target_group_attachment"
│ "attachment_name"
│ has not been declared in the root module.
</code>```

I find the {resource_type} {resource_name} in my local

```<code>        {
          "mode": "managed",
          "type": "aws_lb_target_group_attachment",
          "name": "attachment_name",
          "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",
</code>```

I don't know why outputs.tf can't reference local resource.

Body:
I use terraformer to import AWS ALB resources.
But when I try to run terraform plan, this error happened.

│ Error: Reference to undeclared resource
│
│   on outputs.tf line 914, in output "output_name":
│  914:   value = aws_lb_target_group_attachment.attachment_name.id
│
│ A managed resource "aws_lb_target_group_attachment"
│ "attachment_name"
│ has not been declared in the root module.

I find the {resource_type} {resource_name} in my local

        {
          "mode": "managed",
          "type": "aws_lb_target_group_attachment",
          "name": "attachment_name",
          "provider": "provider[\"registry.terraform.io/hashicorp/aws\"]",

I don't know why outputs.tf can't reference local resource.


问:
discord webhook sending text in present tense
I have a problem, namely I found a way on the internet to send a text file, image, etc. using discord webhook. Unfortunately, as it turned out, I don't need it and I need to send text in real time. Is there anyone who could help me. Thank you in advance for your help

here is my code snippet

```<code>string Webhook_link = "(your discord webhook)";
string FilePath = @"(file directory)";

using (HttpClient httpClient = new HttpClient())
{
    MultipartFormDataContent form = new MultipartFormDataContent();
    var file_bytes = System.IO.File.ReadAllBytes(FilePath);
    form.Add(new ByteArrayContent(file_bytes, 0, file_bytes.Length), "Document", "file.txt");
    httpClient.PostAsync(Webhook_link, form).Wait();
    httpClient.Dispose();
}

</code>```

Body:
I have a problem, namely I found a way on the internet to send a text file, image, etc. using discord webhook. Unfortunately, as it turned out, I don't need it and I need to send text in real time. Is there anyone who could help me. Thank you in advance for your help

here is my code snippet

string Webhook_link = "(your discord webhook)";
string FilePath = @"(file directory)";

using (HttpClient httpClient = new HttpClient())
{
    MultipartFormDataContent form = new MultipartFormDataContent();
    var file_bytes = System.IO.File.ReadAllBytes(FilePath);
    form.Add(new ByteArrayContent(file_bytes, 0, file_bytes.Length), "Document", "file.txt");
    httpClient.PostAsync(Webhook_link, form).Wait();
    httpClient.Dispose();
}


问:
Looping through JSON
I am trying to loop through game details using the ESPN API. However I am only able to return the first event. I would like it to return all events. The print section also only return the first event info as well.

```<code>        response = requests.get(JSON_URL)
        json_data = response.json()
        game_status = []
        home_team = []
        home_score = []
        away_team = []
        away_score = []

        for event in json_data['events']:
            if event['season']['type'] == 2:
                print(event['season']['type'],
                      event['competitions'][0]['competitors'][0]['team']['abbreviation'],
                      event['competitions'][0]['competitors'][0]['score'],
                      event['competitions'][0]['competitors'][1]['team']['abbreviation'],
                      event['competitions'][0]['competitors'][1]['score'],
                      event['competitions'][0]['status']['type']['shortDetail'])

            for games in json_data['events']:
                    home_team.append(games['competitions'][0]['competitors'][0]['team']['abbreviation'])
                    home_score.append(games['competitions'][0]['competitors'][0]['score'])
                    away_team.append(games['competitions'][0]['competitors'][1]['team']['abbreviation'])
                    away_score.append(games['competitions'][0]['competitors'][1]['score'])
                    game_status.append(games['competitions'][0]['status']['type']['shortDetail'])

            data = {
               #'home_team':home_team,
               #'home_score': home_score,
               #'away_team': away_team,
               #'away_score': away_score,
               #'game_status': game_status,
               'seasontype' : 2,
               'scoreboard' : {'home_team': home_team, 'home_score': home_score, 'away_team': away_team , 'away_score': away_score , 'game_status': game_status}
            }

            return jsonify(data)

if __name__ == "__main__":
    app.run(host='0.0.0.0')
</code>```

The Return:

```<code>18/Dec/2022 23:28:58] "GET / HTTP/1.1" 200 -
[{'name': 'ARI @ DEN', 'date': '2022-12-18T21:05Z', 'hometeam': 'DEN', 'homeid': '7', 'homescore': 24, 'awayteam': 'ARI', 'awayid': '22', 'awayscore': 15, 'down': None, 'spot': None, 'time': '0:00', 'quarter': 4, 'over': True, 'redzone': None, 'possession': None, 'state': 'post'}]
</code>```

I would like the code loop through each event but it’s only returning the first event. The return above on lists the first game in the list.

Title: Looping through JSON

Body:
I am trying to loop through game details using the ESPN API. However I am only able to return the first event. I would like it to return all events. The print section also only return the first event info as well.

        response = requests.get(JSON_URL)
        json_data = response.json()
        game_status = []
        home_team = []
        home_score = []
        away_team = []
        away_score = []

        for event in json_data['events']:
            if event['season']['type'] == 2:
                print(event['season']['type'],
                      event['competitions'][0]['competitors'][0]['team']['abbreviation'],
                      event['competitions'][0]['competitors'][0]['score'],
                      event['competitions'][0]['competitors'][1]['team']['abbreviation'],
                      event['competitions'][0]['competitors'][1]['score'],
                      event['competitions'][0]['status']['type']['shortDetail'])

            for games in json_data['events']:
                    home_team.append(games['competitions'][0]['competitors'][0]['team']['abbreviation'])
                    home_score.append(games['competitions'][0]['competitors'][0]['score'])
                    away_team.append(games['competitions'][0]['competitors'][1]['team']['abbreviation'])
                    away_score.append(games['competitions'][0]['competitors'][1]['score'])
                    game_status.append(games['competitions'][0]['status']['type']['shortDetail'])

            data = {
               #'home_team':home_team,
               #'home_score': home_score,
               #'away_team': away_team,
               #'away_score': away_score,
               #'game_status': game_status,
               'seasontype' : 2,
               'scoreboard' : {'home_team': home_team, 'home_score': home_score, 'away_team': away_team , 'away_score': away_score , 'game_status': game_status}
            }

            return jsonify(data)

if __name__ == "__main__":
    app.run(host='0.0.0.0')

The Return:

18/Dec/2022 23:28:58] "GET / HTTP/1.1" 200 -
[{'name': 'ARI @ DEN', 'date': '2022-12-18T21:05Z', 'hometeam': 'DEN', 'homeid': '7', 'homescore': 24, 'awayteam': 'ARI', 'awayid': '22', 'awayscore': 15, 'down': None, 'spot': None, 'time': '0:00', 'quarter': 4, 'over': True, 'redzone': None, 'possession': None, 'state': 'post'}]

I would like the code loop through each event but it’s only returning the first event. The return above on lists the first game in the list.


问:
Can I change Git Bash default path in Eclipse Terminal?
I already changed GitBash default path in local.

But I failed to change GitBash default path in Eclipse Terminal.

Eclipse Terminal / Git Bash in local

Is there any way to change GitBash default path in Eclipse?
I would be grateful if you let me know if there is a proper solution.


问:
Clicking on React-slick item doesn't redirect to the correct link
I have a carousel component made using react-slick, the problem is that when i click on an image it should redirect me to the specified link, but that is not the case as it keeps sending me to the last link.

I've logged the cards which the unique links before setting them in the href, and they all turned out as expected unique. I tried using next router with an onClick listener so that it redirects me to the correct link but it too didn't work, and so I expect it has something to do with react-slick.

First the data I am passing:

```<code>{
      // Cyperpunk
      link: "/games/27",
      image:
        "/cyberPunk.png",
    },
    {
      // NBA
      link: "/games/41",
      image:
        "/NBA.jpeg",
    },
    {
      // Call of duty
      link: "/games/7",
      image: "/callOfDuty.png",
    }
</code>```

Carousel.jsx

```<code>import { Box, IconButton, useBreakpointValue } from "@chakra-ui/react";
import Slider from "react-slick";
import Link from "next/link";
import { useState } from "react";
import { ChevronLeftIcon, ChevronRightIcon } from "@chakra-ui/icons";
const settings = {
  dots: true,
  arrows: false,
  fade: true,
  infinite: true,
  autoplay: true,
  speed: 500,
  autoplaySpeed: 5000,
  slidesToShow: 3,
  slidesToScroll: 3,
};

export default function Carousel({ cards }) {
  const [slider, setSlider] = useState(null);

  const top = useBreakpointValue({ base: "90%", md: "50%" });
  const side = useBreakpointValue({ base: "30%", md: "40px" });

  return (
    <Box position={"relative"} width={"full"} overflow={"hidden"}>
      {/* CSS files for react-slick */}
      <link
        rel="stylesheet"
        type="text/css"
        charSet="UTF-8"
        href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css"
      />
      <link
        rel="stylesheet"
        type="text/css"
        href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css"
      />
      {/* Left Icon */}
      <IconButton
        top={top}
        zIndex={2}
        left={side}
        variant="ghost"
        bgColor={"white"}
        position="absolute"
        as={ChevronLeftIcon}
        aria-label="left-arrow"
        transform={"translate(0%, -50%)"}
        onClick={() => slider?.slickPrev()}
      />
      {/* Right Icon */}
      <IconButton
        top={top}
        zIndex={2}
        right={side}
        variant="ghost"
        bgColor={"white"}
        position="absolute"
        as={ChevronRightIcon}
        aria-label="right-arrow"
        transform={"translate(0%, -50%)"}
        onClick={() => slider?.slickNext()}
      />
      {/* Slider */}
      <Slider {...settings} ref={(slider) => setSlider(slider)}>
        {cards?.map((card, index) => {
          console.log("%%%%%%%%%%%");
          console.log(cards);
          console.log("%%%%%%%%%%%");
          return (
            <Link key={index} href={card.link}>
              <Box
                height={["65vw", "60vw", "50vw"]}
                position="relative"
                objectFit={"cover"}
                backgroundPosition="center"
                backgroundRepeat="no-repeat"
                backgroundSize="cover"
                backgroundImage={`url(${card.image})`}></Box>
            </Link>
          );
        })}
      </Slider>
    </Box>
  );
}
</code>```

Where I think the problem is:

Here:

```<code>// Carousel.jsx
const settings = {
  dots: true,
  arrows: false,
  fade: true,
  infinite: true,
  autoplay: true,
  speed: 500,
  autoplaySpeed: 5000,
  slidesToShow: 3,
  slidesToScroll: 3,
};
</code>```

OR

```<code><Slider {...settings} ref={(slider) => setSlider(slider)}>
        {cards?.map((card, index) => {
          console.log("%%%%%%%%%%%");
          console.log(cards);
          console.log("%%%%%%%%%%%");
          return (
            <Link key={index} href={card.link}>
              <Box
                height={["65vw", "60vw", "50vw"]}
                position="relative"
                objectFit={"cover"}
                backgroundPosition="center"
                backgroundRepeat="no-repeat"
                backgroundSize="cover"
                backgroundImage={`url(${card.image})`}></Box>
            </Link>
          );
        })}
      </Slider>
</code>```

Body:
I have a carousel component made using react-slick, the problem is that when i click on an image it should redirect me to the specified link, but that is not the case as it keeps sending me to the last link.

I've logged the cards which the unique links before setting them in the href, and they all turned out as expected unique. I tried using next router with an onClick listener so that it redirects me to the correct link but it too didn't work, and so I expect it has something to do with react-slick.

First the data I am passing:

{
      // Cyperpunk
      link: "/games/27",
      image:
        "/cyberPunk.png",
    },
    {
      // NBA
      link: "/games/41",
      image:
        "/NBA.jpeg",
    },
    {
      // Call of duty
      link: "/games/7",
      image: "/callOfDuty.png",
    }

Carousel.jsx

import { Box, IconButton, useBreakpointValue } from "@chakra-ui/react";
import Slider from "react-slick";
import Link from "next/link";
import { useState } from "react";
import { ChevronLeftIcon, ChevronRightIcon } from "@chakra-ui/icons";
const settings = {
  dots: true,
  arrows: false,
  fade: true,
  infinite: true,
  autoplay: true,
  speed: 500,
  autoplaySpeed: 5000,
  slidesToShow: 3,
  slidesToScroll: 3,
};

export default function Carousel({ cards }) {
  const [slider, setSlider] = useState(null);

  const top = useBreakpointValue({ base: "90%", md: "50%" });
  const side = useBreakpointValue({ base: "30%", md: "40px" });

  return (
    <Box position={"relative"} width={"full"} overflow={"hidden"}>
      {/* CSS files for react-slick */}
      <link
        rel="stylesheet"
        type="text/css"
        charSet="UTF-8"
        href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css"
      />
      <link
        rel="stylesheet"
        type="text/css"
        href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css"
      />
      {/* Left Icon */}
      <IconButton
        top={top}
        zIndex={2}
        left={side}
        variant="ghost"
        bgColor={"white"}
        position="absolute"
        as={ChevronLeftIcon}
        aria-label="left-arrow"
        transform={"translate(0%, -50%)"}
        onClick={() => slider?.slickPrev()}
      />
      {/* Right Icon */}
      <IconButton
        top={top}
        zIndex={2}
        right={side}
        variant="ghost"
        bgColor={"white"}
        position="absolute"
        as={ChevronRightIcon}
        aria-label="right-arrow"
        transform={"translate(0%, -50%)"}
        onClick={() => slider?.slickNext()}
      />
      {/* Slider */}
      <Slider {...settings} ref={(slider) => setSlider(slider)}>
        {cards?.map((card, index) => {
          console.log("%%%%%%%%%%%");
          console.log(cards);
          console.log("%%%%%%%%%%%");
          return (
            <Link key={index} href={card.link}>
              <Box
                height={["65vw", "60vw", "50vw"]}
                position="relative"
                objectFit={"cover"}
                backgroundPosition="center"
                backgroundRepeat="no-repeat"
                backgroundSize="cover"
                backgroundImage={`url(${card.image})`}></Box>
            </Link>
          );
        })}
      </Slider>
    </Box>
  );
}

Where I think the problem is:

Here:

// Carousel.jsx
const settings = {
  dots: true,
  arrows: false,
  fade: true,
  infinite: true,
  autoplay: true,
  speed: 500,
  autoplaySpeed: 5000,
  slidesToShow: 3,
  slidesToScroll: 3,
};

OR

<Slider {...settings} ref={(slider) => setSlider(slider)}>
        {cards?.map((card, index) => {
          console.log("%%%%%%%%%%%");
          console.log(cards);
          console.log("%%%%%%%%%%%");
          return (
            <Link key={index} href={card.link}>
              <Box
                height={["65vw", "60vw", "50vw"]}
                position="relative"
                objectFit={"cover"}
                backgroundPosition="center"
                backgroundRepeat="no-repeat"
                backgroundSize="cover"
                backgroundImage={`url(${card.image})`}></Box>
            </Link>
          );
        })}
      </Slider>