问:
Flutter: When using the camera package it shows E/BufferQueueProducer ... dequeueBuffer: attempting to exceed the max dequeued buffer count
I'm trying to build a camera app using Flutter using the camera package

But every time I try to initialize the camera it shows me this error continuously filling up my debug console:

E/BufferQueueProducer(17882): [SurfaceTexture-0-17882-0](id:45da00000002,api:4,p:11024,c:17882) dequeueBuffer: attempting to exceed the max dequeued buffer count (4) Screenshot of my debug console

I have tried following the official documentation from Flutter.dev and Pug.dev websites but nothing seems to work.

I also tried following some blog posts by copy-pasting them to see if they worked but all of them gave me the same result. Some of the blogs I followed were

medium.com

blog.logrocket.com

medium.com

Here is my code

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

import '../main.dart';

class CameraScreenTest extends StatefulWidget {
  const CameraScreenTest({super.key});

  @override
  State<CameraScreenTest> createState() => _CameraScreenTestState();
}

class _CameraScreenTestState extends State<CameraScreenTest> with WidgetsBindingObserver {
  CameraController? controller;
  bool _isCameraInitialized = false;

  void onNewCameraSelected(CameraDescription cameraDescription) async {
    final previousCameraController = controller;
    // Instantiating the camera controller
    final CameraController cameraController = CameraController(
      cameraDescription,
      ResolutionPreset.high,
      imageFormatGroup: ImageFormatGroup.jpeg,
    );

    // Dispose the previous controller
    await previousCameraController?.dispose();

    // Replace with the new controller
    if (mounted) {
      setState(() {
        controller = cameraController;
      });
    }

    // Update UI if controller updated
    cameraController.addListener(() {
      if (mounted) setState(() {});
    });

    // Initialize controller
    try {
      await cameraController.initialize();
    } on CameraException catch (e) {
      print('Error initializing camera: $e');
    }

    // Update the Boolean
    if (mounted) {
      setState(() {
        _isCameraInitialized = controller!.value.isInitialized;
      });
    }
  }

  @override
  void initState() {
    onNewCameraSelected(cameras[0]);
    super.initState();
  }

  @override
  void dispose() {
    controller?.dispose();
    super.dispose();
  }

  @override
  void didChangeAppLifecycleState(AppLifecycleState state) {
    final CameraController? cameraController = controller;

    // App state changed before we got the chance to initialize.
    if (cameraController == null || !cameraController.value.isInitialized) {
      return;
    }

    if (state == AppLifecycleState.inactive) {
      // Free up memory when camera not active
      cameraController.dispose();
    } else if (state == AppLifecycleState.resumed) {
      // Reinitialize the camera with same properties
      onNewCameraSelected(cameraController.description);
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: _isCameraInitialized
          ? AspectRatio(
              aspectRatio: 1 / controller!.value.aspectRatio,
              child: controller!.buildPreview(),
            )
          : Container(),
    );
  }
}
</code>```

Hoping to find a solution to the said problem

Body:
I'm trying to build a camera app using Flutter using the camera package

But every time I try to initialize the camera it shows me this error continuously filling up my debug console:

E/BufferQueueProducer(17882): [SurfaceTexture-0-17882-0](id:45da00000002,api:4,p:11024,c:17882) dequeueBuffer: attempting to exceed the max dequeued buffer count (4) Screenshot of my debug console

I have tried following the official documentation from Flutter.dev and Pug.dev websites but nothing seems to work.

I also tried following some blog posts by copy-pasting them to see if they worked but all of them gave me the same result. Some of the blogs I followed were

medium.com

blog.logrocket.com

medium.com

Here is my code

import 'package:camera/camera.dart';
import 'package:flutter/material.dart';

import '../main.dart';

class CameraScreenTest extends StatefulWidget {
  const CameraScreenTest({super.key});

  @override
  State<CameraScreenTest> createState() => _CameraScreenTestState();
}

class _CameraScreenTestState extends State<CameraScreenTest> with WidgetsBindingObserver {
  CameraController? controller;
  bool _isCameraInitialized = false;

  void onNewCameraSelected(CameraDescription cameraDescription) async {
    final previousCameraController = controller;
    // Instantiating the camera controller
    final CameraController cameraController = CameraController(
      cameraDescription,
      ResolutionPreset.high,
      imageFormatGroup: ImageFormatGroup.jpeg,
    );

    // Dispose the previous controller
    await previousCameraController?.dispose();

    // Replace with the new controller
    if (mounted) {
      setState(() {
        controller = cameraController;
      });
    }

    // Update UI if controller updated
    cameraController.addListener(() {
      if (mounted) setState(() {});
    });

    // Initialize controller
    try {
      await cameraController.initialize();
    } on CameraException catch (e) {
      print('Error initializing camera: $e');
    }

    // Update the Boolean
    if (mounted) {
      setState(() {
        _isCameraInitialized = controller!.value.isInitialized;
      });
    }
  }

  @override
  void initState() {
    onNewCameraSelected(cameras[0]);
    super.initState();
  }

  @override
  void dispose() {
    controller?.dispose();
    super.dispose();
  }

  @override
  void didChangeAppLifecycleState(AppLifecycleState state) {
    final CameraController? cameraController = controller;

    // App state changed before we got the chance to initialize.
    if (cameraController == null || !cameraController.value.isInitialized) {
      return;
    }

    if (state == AppLifecycleState.inactive) {
      // Free up memory when camera not active
      cameraController.dispose();
    } else if (state == AppLifecycleState.resumed) {
      // Reinitialize the camera with same properties
      onNewCameraSelected(cameraController.description);
    }
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: _isCameraInitialized
          ? AspectRatio(
              aspectRatio: 1 / controller!.value.aspectRatio,
              child: controller!.buildPreview(),
            )
          : Container(),
    );
  }
}

Hoping to find a solution to the said problem


来源: stackexchange

问:
Pytesting a script that is not a library
I have the following directory structure

```<code>|
|---test
|    |----test1.py
|    |----test2.py
|
|---alibrary
|    |--thelib.py
|
|
|--main.py
</code>```

In test1.py I tested the functions in thelib.py.
To do this, the script started like this

```<code>import alibrary.thelib as thelib

#and in some other part
thelib.some_function()
</code>```

It worked well.
Now I have to write test2.py in which I have to test some functions that are written in main.py

Since main.py is in a level above the testing code which is the correct way I can include main.py so that I can test its functions? (Ideally without altering the sys path)

ContentLicense: CC BY-SA 4.0

Body:
I have the following directory structure

|
|---test
|    |----test1.py
|    |----test2.py
|
|---alibrary
|    |--thelib.py
|
|
|--main.py

In test1.py I tested the functions in thelib.py.
To do this, the script started like this

import alibrary.thelib as thelib

#and in some other part
thelib.some_function()

It worked well.
Now I have to write test2.py in which I have to test some functions that are written in main.py

Since main.py is in a level above the testing code which is the correct way I can include main.py so that I can test its functions? (Ideally without altering the sys path)


问:
Adding timer for asnwer
I would like to add timer to my quiz. Here is an example how I am trying to do that using th.Timer but cannot figure out why is it not working.</p>
```<code>from time import *
import threading as th

if answer == question["prawidlowa_odpowiedz"] and S.is_alive():
        points += 1
        total_points += 1
        print("Brawo, prawidłowa odpowiedź, twój aktualny wynik:", points, "/", total_points, "punktów")
    else:
        total_points += 1
        print("Zła odpowiedź, twój aktualny wynik:", points, "/", total_points, "punktów")

def sctn():
    pass

while True:
     if len(the_filenames) != 0:
         random_section = random.choice(the_filenames)
         print()
         print("Wylosowano dział:", random_section[:-5])
            with open(r"C:\Users\Tymek\PycharmProjects\pythonProject1\quiz!\ematyka\\" + random_section) as file:
                questions = json.load(file)
                the_filenames.remove(random_section)
                i = []
                for i in range(0, len(questions)):
                    S = th.Timer(20, sctn)
                    S.start()
                    show_questions(questions[i])
                    S.cancel()
                    print("Twój aktualny wynik to:", points, "/", total_points)
</code>```
```<code></code>```

Title: Adding timer for asnwer

Body:
I would like to add timer to my quiz. Here is an example how I am trying to do that using th.Timer but cannot figure out why is it not working.

from time import *
import threading as th

if answer == question["prawidlowa_odpowiedz"] and S.is_alive():
        points += 1
        total_points += 1
        print("Brawo, prawidłowa odpowiedź, twój aktualny wynik:", points, "/", total_points, "punktów")
    else:
        total_points += 1
        print("Zła odpowiedź, twój aktualny wynik:", points, "/", total_points, "punktów")

def sctn():
    pass

while True:
     if len(the_filenames) != 0:
         random_section = random.choice(the_filenames)
         print()
         print("Wylosowano dział:", random_section[:-5])
            with open(r"C:\Users\Tymek\PycharmProjects\pythonProject1\quiz!\ematyka\\" + random_section) as file:
                questions = json.load(file)
                the_filenames.remove(random_section)
                i = []
                for i in range(0, len(questions)):
                    S = th.Timer(20, sctn)
                    S.start()
                    show_questions(questions[i])
                    S.cancel()
                    print("Twój aktualny wynik to:", points, "/", total_points)


问:
How to pass execution arguments to exe using PM2?
I am using pm2 to start a .exe but I'm not able to pass argument to it.

The command I am using is pm2 start go-cqhttp_windows_amd64.exe -- -faststart. But it doesn't work.I want to pass the parameter -faststart to this program.Thanks!


问:
Regular expression to rename filenames
I'm looking for a regular expression to customize my Python script.

I want to automate my mp3 collection that I download via youtube-dl. I am downloading Greek music as mp3 and I want the filename to be saved as "Artist - Title.mp3".

I wrote a Python script that does the following.

1.) renames the file name from greek to english only charaters.
2.) recognizes the "artist".
3.) move the file in the "Audio Folder" and create a new folder (if it doesn't already exist) that has the "Artist" as the folder name.

So far so good. now I want it to create the title as described above in this pattern "Artist - Titel.mp3"

My regular expression currently looks like this:

Regular expression for matching the title

```<code>title_pattern = re.compile(r'^.+? - (.*?)[^\w\s-]*\.mp3$')
</code>```

with this input:

Αυγή Τριανταφυλλίδου - Ela na me vries ｜｜ New Song.mp3 Αυγή
Τριανταφυλλίδου - Γύρισε κοντά μου ｜｜ New Song.mp3 Βασίλης Μπατής -
Ζημιά _ Vasilis Mpatis - Zimia _ Official Video Clip HQ 2017.mp3
Σταμάτης Γονίδης - Εσύ Ρωτάς.mp3

I get the following output:

Aygi Triantafyllidoy - Ela na me vries ｜｜ New Song.mp3Aygi
Triantafyllidoy - Gyrise konta moy ｜｜ New Song.mp3 Basilis Mpatis -
Zimia _ Vasilis Mpatis - Zimia _ Official Video Clip HQ 2017.mp3
Stamatis Gonidis - Esy Rotas.mp3

How would I have to adjust the regular expression to get "Artist - Title.mp3" as the output? So without the "｜｜ New Song" etc. Note that not all files have the same pattern. so a general solution is needed.

I thought you could recognize the title as follows "search for a word then space, repeat this until a special character or punctuation mark comes, then remove everything including the punctuation marks up to the .mp3"

or do you have better suggestions?

Title: Regular expression to rename filenames

Body:
I'm looking for a regular expression to customize my Python script.

I want to automate my mp3 collection that I download via youtube-dl. I am downloading Greek music as mp3 and I want the filename to be saved as "Artist - Title.mp3".

I wrote a Python script that does the following.

1.) renames the file name from greek to english only charaters.
2.) recognizes the "artist".
3.) move the file in the "Audio Folder" and create a new folder (if it doesn't already exist) that has the "Artist" as the folder name.

So far so good. now I want it to create the title as described above in this pattern "Artist - Titel.mp3"

My regular expression currently looks like this:

Regular expression for matching the title

title_pattern = re.compile(r'^.+? - (.*?)[^\w\s-]*\.mp3$')

with this input:

Αυγή Τριανταφυλλίδου - Ela na me vries ｜｜ New Song.mp3 Αυγή
Τριανταφυλλίδου - Γύρισε κοντά μου ｜｜ New Song.mp3 Βασίλης Μπατής -
Ζημιά _ Vasilis Mpatis - Zimia _ Official Video Clip HQ 2017.mp3
Σταμάτης Γονίδης - Εσύ Ρωτάς.mp3

I get the following output:

Aygi Triantafyllidoy - Ela na me vries ｜｜ New Song.mp3Aygi
Triantafyllidoy - Gyrise konta moy ｜｜ New Song.mp3 Basilis Mpatis -
Zimia _ Vasilis Mpatis - Zimia _ Official Video Clip HQ 2017.mp3
Stamatis Gonidis - Esy Rotas.mp3

How would I have to adjust the regular expression to get "Artist - Title.mp3" as the output? So without the "｜｜ New Song" etc. Note that not all files have the same pattern. so a general solution is needed.

I thought you could recognize the title as follows "search for a word then space, repeat this until a special character or punctuation mark comes, then remove everything including the punctuation marks up to the .mp3"

or do you have better suggestions?


问:
Java unable to load Tesseract library macOS
I have installed Tesseract library with brew install tesseract. I ab able to run tesseract commands via terminal without any issue but when java application is started it throws an exception.

```<code>Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'tesseract':
dlopen(libtesseract.dylib, 0x0009): tried: '/Users/USERNAME/Library/Java/JavaVirtualMachines/corretto-17.0.5/Contents/Home/bin/./libtesseract.dylib' (no such file), '/Users/USERNAME/Library/Java/JavaVirtualMachines/corretto-17.0.5/Contents/Home/bin/../lib/libtesseract.dylib' (no such file), 'libtesseract.dylib' (no such file), '/usr/lib/libtesseract.dylib' (no such file), '/Users/USERNAME/Desktop/Projects/Twitter Bot Detector/libtesseract.dylib' (no such file)
dlopen(libtesseract.dylib, 0x0009): tried: '/Users/USERNAME/Library/Java/JavaVirtualMachines/corretto-17.0.5/Contents/Home/bin/./libtesseract.dylib' (no such file), '/Users/USERNAME/Library/Java/JavaVirtualMachines/corretto-17.0.5/Contents/Home/bin/../lib/libtesseract.dylib' (no such file), 'libtesseract.dylib' (no such file), '/usr/lib/libtesseract.dylib' (no such file), '/Users/USERNAME/Desktop/Projects/Twitter Bot Detector/libtesseract.dylib' (no such file)
</code>```

Also I checked and the path for libtesseract.dylib is  /usr/local/lib/libtesseract.dylib which is not tried by dlopen command. MacOS Monterey 12.6

Can you show me a way to solve this?

Body:
I have installed Tesseract library with brew install tesseract. I ab able to run tesseract commands via terminal without any issue but when java application is started it throws an exception.

Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'tesseract':
dlopen(libtesseract.dylib, 0x0009): tried: '/Users/USERNAME/Library/Java/JavaVirtualMachines/corretto-17.0.5/Contents/Home/bin/./libtesseract.dylib' (no such file), '/Users/USERNAME/Library/Java/JavaVirtualMachines/corretto-17.0.5/Contents/Home/bin/../lib/libtesseract.dylib' (no such file), 'libtesseract.dylib' (no such file), '/usr/lib/libtesseract.dylib' (no such file), '/Users/USERNAME/Desktop/Projects/Twitter Bot Detector/libtesseract.dylib' (no such file)
dlopen(libtesseract.dylib, 0x0009): tried: '/Users/USERNAME/Library/Java/JavaVirtualMachines/corretto-17.0.5/Contents/Home/bin/./libtesseract.dylib' (no such file), '/Users/USERNAME/Library/Java/JavaVirtualMachines/corretto-17.0.5/Contents/Home/bin/../lib/libtesseract.dylib' (no such file), 'libtesseract.dylib' (no such file), '/usr/lib/libtesseract.dylib' (no such file), '/Users/USERNAME/Desktop/Projects/Twitter Bot Detector/libtesseract.dylib' (no such file)

Also I checked and the path for libtesseract.dylib is  /usr/local/lib/libtesseract.dylib which is not tried by dlopen command. MacOS Monterey 12.6

Can you show me a way to solve this?


问:
JSONField validation based on another model object
Im trying to build an online bicycleauction and i cant seem to figure this one out.

```<code>Class Product(models.Model):
   name_of_bicycle = models.Charfield()

Class Bid(models.Model):
   bid_number = models.PositiveIntegerField()

   name_of_bidder = models.Charfield()

   bid = models.JSONField()
</code>```

The JSONField should contain [name_of_bicycle, bidding amount].

Is this possible? Do i have to use JSON schema?

Body:
Im trying to build an online bicycleauction and i cant seem to figure this one out.

Class Product(models.Model):
   name_of_bicycle = models.Charfield()

Class Bid(models.Model):
   bid_number = models.PositiveIntegerField()

   name_of_bidder = models.Charfield()

   bid = models.JSONField()

The JSONField should contain [name_of_bicycle, bidding amount].

Is this possible? Do i have to use JSON schema?


问:
How to decide if FF instruction is a call instruction or a jmp instruction in X86-64 ELF under linux?
I have such ELF in linux and I disassemble it to do some research. However, I get confused "How to decide if FF instruction is a call instruction or a jmp instruction?

For example, the ff instruction occurs like
`

```<code>  8405de:   48 8b 04 c5 00 81 98    mov    0x988100(,%rax,8),%rax
  8405e5:   00
  8405e6:   ff e0                   jmpq   *%rax
  8405e8:   48 8b 45 e8             mov    -0x18(%rbp),%rax

</code>```

and like

```<code>
  84167f:   48 8b 45 90             mov    -0x70(%rbp),%rax
  841683:   ff d0                   callq  *%rax
  841685:   48 89 45 f0             mov    %rax,-0x10(%rbp)
  841689:   48 8b 45 f0             mov    -0x10(%rbp),%rax
</code>```

`

I read Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume.
CALL
FF /2 CALL r/m16 M N.E. Valid Call near, absolute indirect, address given in r/m16.
FF /2 CALL r/m32 M N.E. Valid Call near, absolute indirect, address given in r/m32.
FF /2 CALL r/m64 M Valid N.E. Call near, absolute indirect, address given in r/m64

and
JMP
FF /4 JMP r/m16 M N.S. Valid Jump near, absolute indirect, address = zeroextended r/m16. Not supported in 64-bit
mode.
FF /4 JMP r/m32 M N.S. Valid Jump near, absolute indirect, address given in
r/m32. Not supported in 64-bit mode.
FF /4 JMP r/m64 M Valid N.E. Jump near, absolute indirect, RIP = 64-Bit
offset from register or memory
FF /5 JMP m16:16 D Valid Valid Jump far, absolute indirect, address given in
m16:16
FF /5 JMP m16:32 D Valid Valid Jump far, absolute indirect, address given in
m16:32.

Since I'm a Rookie, I could tell difference even I read this Manual, could you give me some advice?

Body:
I have such ELF in linux and I disassemble it to do some research. However, I get confused "How to decide if FF instruction is a call instruction or a jmp instruction?

For example, the ff instruction occurs like
`

  8405de:   48 8b 04 c5 00 81 98    mov    0x988100(,%rax,8),%rax
  8405e5:   00
  8405e6:   ff e0                   jmpq   *%rax
  8405e8:   48 8b 45 e8             mov    -0x18(%rbp),%rax

and like

  84167f:   48 8b 45 90             mov    -0x70(%rbp),%rax
  841683:   ff d0                   callq  *%rax
  841685:   48 89 45 f0             mov    %rax,-0x10(%rbp)
  841689:   48 8b 45 f0             mov    -0x10(%rbp),%rax

`

I read Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume.
CALL
FF /2 CALL r/m16 M N.E. Valid Call near, absolute indirect, address given in r/m16.
FF /2 CALL r/m32 M N.E. Valid Call near, absolute indirect, address given in r/m32.
FF /2 CALL r/m64 M Valid N.E. Call near, absolute indirect, address given in r/m64

and
JMP
FF /4 JMP r/m16 M N.S. Valid Jump near, absolute indirect, address = zeroextended r/m16. Not supported in 64-bit
mode.
FF /4 JMP r/m32 M N.S. Valid Jump near, absolute indirect, address given in
r/m32. Not supported in 64-bit mode.
FF /4 JMP r/m64 M Valid N.E. Jump near, absolute indirect, RIP = 64-Bit
offset from register or memory
FF /5 JMP m16:16 D Valid Valid Jump far, absolute indirect, address given in
m16:16
FF /5 JMP m16:32 D Valid Valid Jump far, absolute indirect, address given in
m16:32.

Since I'm a Rookie, I could tell difference even I read this Manual, could you give me some advice?


问:
Uplift models or binary classification
I can’t figure out what kind of task it is:  uplift modeling or binary classification. There is a dataset. Data on which of the customers is the one who will not buy without "flg", but will buy with "flg"! There are two features: "flg" - whether the communication was made (сalling, email, sms), "purchased" - whether a purchase was made. Usually in such tasks, they ask to find the uplift metric. But I need to predict "new_target" which is 1 if the purchase is made after communication and if the purchase is not made without communication, 0 otherwise. Metric AUC. What approach can I use?

I tried to use the models uplift. But I get a low metric... It seems to me that here it is necessary to encode these features somehow

Title: Uplift models or binary classification


问:
CSS/HTML/Tailwind/Nuxt: Remove overlapping html element
I am working on a vue3 app together with NuxtJS and Typescript.

So far, I am working on components, that render server data.

I have a Layout, which consists of a navbar with a slot and a footer.
However, for some reason, I always see my 'blank' html at the bottom of the page. How can I hide this? I don't want to assign a color to it, because my app supports light and dark mode. Check the screenshot below - what did I miss?

I am using Tailwind as framework.

Inside the navbar component I render the list with the regarding details:

This is my app.vue:

```<code><script setup lang="ts">
...

</script>
<template>
  <LayoutMenu :last-update="lastUpdate" :online-status="onlineStatus">
    <div
      class="py-12 my-12 mx-auto text-center bg-neutral-400 dark:text-white dark:bg-slate-800"
    >
      <PlayerInfo
        v-for="(server, index) in servers.value"
        :key="server.Name"
        :server-name="server.Name"
        :player-amount="server.UserCount"
        :max-player="server.MaxUsers"
        :connections="server.Connections"
      />
      <LayoutFooter />
    </div>
  </LayoutMenu>
</template>
</code>```

this is my /Player/Info.vue

```<code><script setup lang="ts">
interface PlayerProps {
  serverName: string
  playerAmount: number
  maxPlayer: number
  connections: number
}

const props = defineProps<PlayerProps>()
</script>
<template>
  <div class="mt-12 mb-8">
    <div class="overflow-x-auto relative">
      <table class="w-full text-sm text-left text-gray-500 dark:text-gray-400">
        <thead
          class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"
        >
          <tr>
            <th scope="col" class="py-3 px-6">Server</th>
            <th scope="col" class="py-3 px-6">Status</th>
            <th scope="col" class="py-3 px-6">Player Amount</th>
            <th scope="col" class="py-3 px-6">Max. Player</th>
            <th scope="col" class="py-3 px-6">Current Connections</th>
          </tr>
        </thead>
        <tbody>
          <tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
            <th
              scope="row"
              class="py-4 px-6 font-medium text-gray-900 whitespace-nowrap dark:text-white"
            >
              {{ serverName }}
            </th>
            <td class="py-4 px-6">
              <p v-if="connections > 0" class="text-green-400">Online</p>
              <p v-else class="text-red-600">Offline</p>
            </td>
            <td class="py-4 px-6">{{ playerAmount }}</td>

            <td class="py-4 px-6">{{ maxPlayer }}</td>
            <td class="py-4 px-6">{{ connections }}</td>
          </tr>
          <tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700">
            <th
              scope="row"
              class="py-4 px-6 font-medium text-gray-900 whitespace-nowrap dark:text-white"
            >
              Microsoft Surface Pro
            </th>
            <td class="py-4 px-6">White</td>
            <td class="py-4 px-6">Laptop PC</td>
            <td class="py-4 px-6">$1999</td>
          </tr>
          <tr class="bg-white dark:bg-gray-800">
            <th
              scope="row"
              class="py-4 px-6 font-medium text-gray-900 whitespace-nowrap dark:text-white"
            >
              Magic Mouse 2
            </th>
            <td class="py-4 px-6">Black</td>
            <td class="py-4 px-6">Accessories</td>
            <td class="py-4 px-6">$99</td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</template>
</code>```

Here is the template part of the menu.vue:

```<code><template>
  <nav
    class="bg-slate-500 px-2 sm:px-4 py-3.5 dark:bg-gray-900 fixed w-full z-20 top-0 left-0 border-b border-gray-200 dark:border-gray-600"
  >
    <div class="container flex flex-wrap items-center justify-between mx-auto">
      <a href="https://aq3d.com/" class="flex items-center md:px-12">
        <img
          src="~/assets/images/logo.png"
          class="object-cover scale-150 max-w-full transition-all duration-200 cursor-pointer hover:grayscale h-9 mr-3 md:h-14 sm:h-6"
          alt="Flowbite Logo"
        />

        <span
          class="self-center text-xl font-semibold whitespace-nowrap dark:text-white"
        >
          Server Status</span
        >
      </a>
      <div class="flex md:order-2">
        <button
          type="button"
          :class="[onlineStatus ? serverOnline : serverOffline]"
        >
          {{ onlineStatus ? 'Online' : 'Offline' }}
        </button>

        <button
          id="theme-toggle"
          type="button"
          class="text-white-50 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm md:ml-5"
        >
          <svg
            id="theme-toggle-dark-icon"
            class="w-5 h-5 hidden"
            fill="currentColor"
            viewBox="0 0 20 20"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"
            ></path>
          </svg>
          <svg
            id="theme-toggle-light-icon"
            class="w-5 h-5 hidden"
            fill="currentColor"
            viewBox="0 0 20 20"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z"
              fill-rule="evenodd"
              clip-rule="evenodd"
            ></path>
          </svg>
        </button>
        <button
          data-collapse-toggle="navbar-sticky"
          type="button"
          class="inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600"
          aria-controls="navbar-sticky"
          aria-expanded="false"
        >
          <span class="sr-only">Open main menu</span>
          <svg
            class="w-6 h-6"
            aria-hidden="true"
            fill="currentColor"
            viewBox="0 0 20 20"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              fill-rule="evenodd"
              d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
              clip-rule="evenodd"
            ></path>
          </svg>
        </button>
      </div>
      <div
        id="navbar-sticky"
        class="items-center justify-self-auto hidden w-full md:flex md:w-auto md:order-1"
      >
        <ul
          class="flex flex-col p-4 mt-4 border border-gray-100 rounded-lg bg-gray-50 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium md:border-0 md:bg-white dark:bg-gray-800 md:dark:bg-gray-900 dark:border-gray-700"
        >
          <li>
            <a
              href="#"
              class="block py-2 pl-3 pr-4 text-gray-700 rounded hover:bg-gray-100 md:hover:bg-transparent md:hover:text-blue-700 md:p-0 md:dark:hover:text-white dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700"
            >
              {{ lastUpdate }}</a
            >
          </li>
        </ul>
      </div>
    </div>
  </nav>
  <slot />
</template>
</code>```

Body:
I am working on a vue3 app together with NuxtJS and Typescript.

So far, I am working on components, that render server data.

I have a Layout, which consists of a navbar with a slot and a footer.
However, for some reason, I always see my 'blank' html at the bottom of the page. How can I hide this? I don't want to assign a color to it, because my app supports light and dark mode. Check the screenshot below - what did I miss?

I am using Tailwind as framework.

Inside the navbar component I render the list with the regarding details:

This is my app.vue:

<template>
  <LayoutMenu :last-update="lastUpdate" :online-status="onlineStatus">

      <PlayerInfo
        v-for="(server, index) in servers.value"
        :key="server.Name"
        :server-name="server.Name"
        :player-amount="server.UserCount"
        :max-player="server.MaxUsers"
        :connections="server.Connections"
      />
      <LayoutFooter />

  </LayoutMenu>
</template>

this is my /Player/Info.vue

<template>

            Server
            Status
            Player Amount
            Max. Player
            Current Connections

              {{ serverName }}

 0" class="text-green-400">Online

Offline

            {{ playerAmount }}

            {{ maxPlayer }}
            {{ connections }}

              Microsoft Surface Pro

            White
            Laptop PC
            $1999

              Magic Mouse 2

            Black
            Accessories
            $99

</template>

Here is the template part of the menu.vue:

<template>

          Server Status

        <button
          type="button"
          :class="[onlineStatus ? serverOnline : serverOffline]"
        >
          {{ onlineStatus ? 'Online' : 'Offline' }}
        </button>

        <button
          id="theme-toggle"
          type="button"
          class="text-white-50 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm md:ml-5"
        >
          <svg
            id="theme-toggle-dark-icon"
            class="w-5 h-5 hidden"
            fill="currentColor"
            viewBox="0 0 20 20"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"
            ></path>
          </svg>
          <svg
            id="theme-toggle-light-icon"
            class="w-5 h-5 hidden"
            fill="currentColor"
            viewBox="0 0 20 20"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z"
              fill-rule="evenodd"
              clip-rule="evenodd"
            ></path>
          </svg>
        </button>
        <button
          data-collapse-toggle="navbar-sticky"
          type="button"
          class="inline-flex items-center p-2 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600"
          aria-controls="navbar-sticky"
          aria-expanded="false"
        >
          Open main menu
          <svg
            class="w-6 h-6"
            aria-hidden="true"
            fill="currentColor"
            viewBox="0 0 20 20"
            xmlns="http://www.w3.org/2000/svg"
          >
            <path
              fill-rule="evenodd"
              d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
              clip-rule="evenodd"
            ></path>
          </svg>
        </button>

              {{ lastUpdate }}

  <slot />
</template>


问:
why jQuery animate is not behaving properly
The HTML has a parent-div and inside 2 other div's where the initial one is already visible.

Using the following jQuery code, I need to have on mouseover :

make 'child_initial' invisible

only afterward change position of 'child_onhover' using animation with duration/easing;

on mouseout reverse the same.

```<code>$(document).ready(function() {

  $('.parent').on("mouseover", function() {
    $(this).find(".child_initial").css({"visibility": "hidden"});
    $(this).find(".child_onhover").animate
        (  {top: "1px"}  ,   {duration: 200 , easing: "linear"}  );
    // ???? $(this).find(".child_onhover").dequeue();
  });

  $('.parent').on("mouseout", function() {
    $(this).find(".child_onhover").animate
        (  {top: "100%"}  ,   {duration: 200 , easing: "linear"}  );
    $(this).find(".child_initial").css({"visibility": "visible"});
  });

});

</code>```

I was trying different methods like .delay(xxx) or .dequeue, but did not find a fully working way to have a smooth behaviour. Or it is going in a loop (even mouseout was not triggered).
What I am doing wrong? What should be the best approach?

Body:
The HTML has a parent-div and inside 2 other div's where the initial one is already visible.

Using the following jQuery code, I need to have on mouseover :

make 'child_initial' invisible

only afterward change position of 'child_onhover' using animation with duration/easing;

on mouseout reverse the same.

$(document).ready(function() {

  $('.parent').on("mouseover", function() {
    $(this).find(".child_initial").css({"visibility": "hidden"});
    $(this).find(".child_onhover").animate
        (  {top: "1px"}  ,   {duration: 200 , easing: "linear"}  );
    // ???? $(this).find(".child_onhover").dequeue();
  });

  $('.parent').on("mouseout", function() {
    $(this).find(".child_onhover").animate
        (  {top: "100%"}  ,   {duration: 200 , easing: "linear"}  );
    $(this).find(".child_initial").css({"visibility": "visible"});
  });

});

I was trying different methods like .delay(xxx) or .dequeue, but did not find a fully working way to have a smooth behaviour. Or it is going in a loop (even mouseout was not triggered).
What I am doing wrong? What should be the best approach?


问:
Google Colab (Local Runtime): ValueError: Asked to retrieve element 0, but the Sequence has length 0
I connect google colab to local runtime. I try to train my model. Everything is working good with my data preparation until I enter to model training block code.

```<code>hist = model.fit(train_generator, steps_per_epoch=step_size_train, callbacks=[cp_callback, es_callback], epochs=10)
</code>```

It generate error like this:

ValueError: Asked to retrieve element 0, but the Sequence has length 0
```

enter image description here
enter image description here
enter image description here

What should I do?

It runs well using hosted runtime in google colab. But it turns error if I used local runtime.

I'm doing deep learning for Automated Optical Inspection (AOI)
I use anaconda and connect jupyter lab to google colab.

How to resolve this?

Body:
I connect google colab to local runtime. I try to train my model. Everything is working good with my data preparation until I enter to model training block code.

hist = model.fit(train_generator, steps_per_epoch=step_size_train, callbacks=[cp_callback, es_callback], epochs=10)

It generate error like this:

ValueError: Asked to retrieve element 0, but the Sequence has length 0

enter image description here
enter image description here
enter image description here

What should I do?

It runs well using hosted runtime in google colab. But it turns error if I used local runtime.

I'm doing deep learning for Automated Optical Inspection (AOI)
I use anaconda and connect jupyter lab to google colab.

How to resolve this?


问:
Chrome version in invoking chromedriver
I have to download the same version of chrome to invoke chromedriver and my chrome version is 108.0.5359.124 and there is no version like this to download so i downloaded is 108.0.5359.71 so it gave me error

```<code>package Hala;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class Sellintroduction {

    public static void main(String[] args) {
        //Invoking the browser
        System.setProperty("webdriver.chrome.driver" , "/Users/ahmedelgendy/Downloads/chromedriver");

        WebDriver driver = new ChromeDriver();
    }

}
</code>```

Error occurred during initialization of boot layer
java.lang.module.FindException: Module processed.jcommander not found, required by org.seleniumhq.selenium.remote_driver

Title: Chrome version in invoking chromedriver

Body:
I have to download the same version of chrome to invoke chromedriver and my chrome version is 108.0.5359.124 and there is no version like this to download so i downloaded is 108.0.5359.71 so it gave me error

package Hala;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class Sellintroduction {

    public static void main(String[] args) {
        //Invoking the browser
        System.setProperty("webdriver.chrome.driver" , "/Users/ahmedelgendy/Downloads/chromedriver");

        WebDriver driver = new ChromeDriver();
    }

}

Error occurred during initialization of boot layer
java.lang.module.FindException: Module processed.jcommander not found, required by org.seleniumhq.selenium.remote_driver


问:
R Quarto does not produce correct position
I have created pdf in Quarto Document in R but for example the output of modelssummary() is given below another output. Correct positioning is not possible. I am using R Quarto for the first time and I am not very familiar with the terms. Can you help me?

```<code>---
title: "Homework"
format: pdf
editor: visual
output:
  pdf_document:
    fig_caption: yes
---
</code>```

Body:
I have created pdf in Quarto Document in R but for example the output of modelssummary() is given below another output. Correct positioning is not possible. I am using R Quarto for the first time and I am not very familiar with the terms. Can you help me?

---
title: "Homework"
format: pdf
editor: visual
output:
  pdf_document:
    fig_caption: yes
---


问:
Getting Empty Object in postman
i get empty object and 200 response when i try to get the movies which are bought,
i can buy the movie but can not show it

here is the repository function

```<code>   public async Task<IEnumerable<CartItem>> CartItems(int UserId)
        {
            return await (from cart in this.context.Cart
                          join cartItem in this.context.CartItem
                          on cart.Id equals cartItem.CartId
                          where cart.UserId == UserId
                          select new CartItem
                          {
                              Id = cartItem.Id,
                              MovieId = cartItem.MovieId,
                              mengde = cartItem.mengde,
                              CartId = cartItem.CartId,
                          }).ToListAsync();

        }
</code>```

and the controller

```<code>
        [HttpGet("CurrentUser")]
        public int GetLoggetInUserId()
        {
            int id = Convert.ToInt32(HttpContext.User.FindFirstValue("UserId"));
            return id;
        }

        [HttpGet("GetItems")]

        public async Task<ActionResult<IEnumerable<CartItemDTO>>> CartItems()
        {

            try
            {
                int userId = GetLoggetInUserId();
                // here we returned cartItem object
                var cartItems = await this.shoping.CartItems(userId);

                if (cartItems == null)
                {

                    return NoContent();
                }

                var movies = await this.repository.GetAll();

                if (movies == null)
                {
                    throw new Exception("No products exist in the system");
                }

                var UserCartItems = cartItems.ConvertToDto(movies);

                return Ok(UserCartItems);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "the GET call to /api/user fieled");
                return StatusCode(StatusCodes.Status500InternalServerError,
                    ex.Message);

            }

        }
</code>```

and the interface

```<code> public interface IShoping
    {

        Task<CartItem> AddItem(CartItemToAddDto cartItemToAddDto);
        Task<CartItem> DeleteItem(int Id);
        Task<CartItem> GetItem(int id);
        Task<IEnumerable<CartItem>> CartItems(int UserId);
        Task<CartItem> UpdateItem(int Id, CartItemMengdeUpdate cartItemMengdeUpdate);
</code>```

the buy function works but when i try to get all the bought movies i get an empty object
(https://i.stack.imgur.com/boAYK.png)

Title: Getting Empty Object in postman

Body:
i get empty object and 200 response when i try to get the movies which are bought,
i can buy the movie but can not show it

here is the repository function

   public async Task<IEnumerable<CartItem>> CartItems(int UserId)
        {
            return await (from cart in this.context.Cart
                          join cartItem in this.context.CartItem
                          on cart.Id equals cartItem.CartId
                          where cart.UserId == UserId
                          select new CartItem
                          {
                              Id = cartItem.Id,
                              MovieId = cartItem.MovieId,
                              mengde = cartItem.mengde,
                              CartId = cartItem.CartId,
                          }).ToListAsync();

        }

and the controller

        [HttpGet("CurrentUser")]
        public int GetLoggetInUserId()
        {
            int id = Convert.ToInt32(HttpContext.User.FindFirstValue("UserId"));
            return id;
        }

        [HttpGet("GetItems")]

        public async Task<ActionResult<IEnumerable<CartItemDTO>>> CartItems()
        {

            try
            {
                int userId = GetLoggetInUserId();
                // here we returned cartItem object
                var cartItems = await this.shoping.CartItems(userId);

                if (cartItems == null)
                {

                    return NoContent();
                }

                var movies = await this.repository.GetAll();

                if (movies == null)
                {
                    throw new Exception("No products exist in the system");
                }

                var UserCartItems = cartItems.ConvertToDto(movies);

                return Ok(UserCartItems);
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, "the GET call to /api/user fieled");
                return StatusCode(StatusCodes.Status500InternalServerError,
                    ex.Message);

            }

        }

and the interface

 public interface IShoping
    {

        Task<CartItem> AddItem(CartItemToAddDto cartItemToAddDto);
        Task<CartItem> DeleteItem(int Id);
        Task<CartItem> GetItem(int id);
        Task<IEnumerable<CartItem>> CartItems(int UserId);
        Task<CartItem> UpdateItem(int Id, CartItemMengdeUpdate cartItemMengdeUpdate);

the buy function works but when i try to get all the bought movies i get an empty object
(https://i.stack.imgur.com/boAYK.png)


问:
Javascript daily countdown
I want to have a continuous daily countdown where the plan will have 2 schedule/specific time daily.

I am now still troubleshoot at 1 specific time.

The following is modification from this answer https://stackoverflow.com/a/23512971/20903104

```<code><script type="text/javascript">
      function executeAction (target){
          console.log(target);
          //next schedule
      };

      var date;
      var remaining = document.getElementById("remaining");
      var schedule1 = document.getElementById("schedule1").value.split(":");
      var target = schedule1[0];
      setInterval(function () {
        date = new Date();
        var currenthours = date.getHours();
        var hours;
        var minutes;
        var secondes;
        if (currenthours != target) {
          if (currenthours < target) hours = target - 1 - currenthours;
          else hours = target + (24 - currenthours);
          minutes = 60 - date.getMinutes();
          secondes = 60 - date.getSeconds();
          remaining.innerHTML = hours + ":" + minutes + ":" + secondes;
        } else {
            remaining.innerHTML = "LIVE NOW";
            executeAction(target);
            //continue to next schedule
        };
      }, 1000);
    </script>
</code>```

Let say, now is 11:00 (AM) the next schedule is 10:00 (AM) the output is:
enter image description here
it should be 23:00:00 and counting down

I want to add second (or third schedule) and add this code :

```<code>    <input type="time" id="schedule1" value="10:00:00" readonly />
    <div id="remaining"></div>
    <input type="time" id="schedule2" value="22:00:00" readonly />
    <div id="remaining2"></div>
</code>```

How to proceed to next schedule continuously?
complete code : https://jsfiddle.net/kuraba/6or71L90/14/

Title: Javascript daily countdown

Body:
I want to have a continuous daily countdown where the plan will have 2 schedule/specific time daily.

I am now still troubleshoot at 1 specific time.

The following is modification from this answer https://stackoverflow.com/a/23512971/20903104

Let say, now is 11:00 (AM) the next schedule is 10:00 (AM) the output is:
enter image description here
it should be 23:00:00 and counting down

I want to add second (or third schedule) and add this code :

    <input type="time" id="schedule1" value="10:00:00" readonly />

    <input type="time" id="schedule2" value="22:00:00" readonly />

How to proceed to next schedule continuously?
complete code : https://jsfiddle.net/kuraba/6or71L90/14/


问:
Upgrade Angular 13 to 14 and remaining package.json all package versions to latest
I'm trying to migrate from Angular 13 to Angular 14 and I was able to do it by using the command ng update @angular/core@14 @angular/cli@14. I want to update the remaining packages here. version of the json file package that is compatible with Angular 14.

I was looking for information relating to upgrades when I discovered the following command: update all versions to the most recent versions.

ncu Checks for updates from the package.json file

ncu -u Update the package.json file

npm update --save Update your package-lock.json file from the package.json file

The aforementioned methods update Angular to version 15, which is the most recent version, but I do not want to upgrade Angular to version 15. Here, I want Angular 14, and the other package versions are the most recent with Angular 14-compatible versions. Is there a command to manage this kind of circumstance or do I need to manually review and update each package? Please assist me in getting clarification. I'm grateful.


问:
Cplex - the shortest routes
I'm looking for the shortest routes for several shuttles to pick up passengers from the bus station. My coding was still incomplete and it is no value. Does anyone have an idea for my coding? Thank you.</p>
```<code>range point = 1..21;
range vihicle= 1..2;
float d[point]=...;
float c[point][point]=...;
dvar boolean x[point][point][vihicle]; // vihicle k from i to j
dvar float+ h[vihicle]; // total number of passengers of the vihicle k
dvar float+ no[vihicle]; // total number of point of the vihicle k
// objective
dexpr float z = sum(i in point, j in point : i!=j, k in vihicle) x[i][j][k]*c[i][j];
minimize z;
subject to
{
  // Maximum number of passengers of the vehicle k
  forall (k in vihicle) sum(i, j in point : i!=j) x[i][j][k]*d[i] <= 16;
  forall (k in vihicle) sum(i in point, j in point : i!=j) x[i][j][k]*d[i] == h[k];
    // each vihicle has to go from the station
  forall (i,j in point : i!=j, k in vihicle)
    sum(i,j in point : j!=i && i==0) x[i][j][k] == 1;

     // specify the points that are connected to each other
  forall (i in point, k in vihicle)
    sum(j in point : i!=j) x[i][j][k] - sum(j in point : j!=i) x[j][i][k] == 0;
  //
  forall (j in point : j!=0)
    sum(i in point : i!=j, k in vihicle) x[i][j][k] == 1;
     // total number of point of the vihicle k
  forall (k in vihicle)
    sum(i,j in point : j!=i) x[i][j][k] == no[k];
 }
</code>```

Title: Cplex - the shortest routes

Body:
I'm looking for the shortest routes for several shuttles to pick up passengers from the bus station. My coding was still incomplete and it is no value. Does anyone have an idea for my coding? Thank you.

range point = 1..21;
range vihicle= 1..2;
float d[point]=...;
float c[point][point]=...;
dvar boolean x[point][point][vihicle]; // vihicle k from i to j
dvar float+ h[vihicle]; // total number of passengers of the vihicle k
dvar float+ no[vihicle]; // total number of point of the vihicle k
// objective
dexpr float z = sum(i in point, j in point : i!=j, k in vihicle) x[i][j][k]*c[i][j];
minimize z;
subject to
{
  // Maximum number of passengers of the vehicle k
  forall (k in vihicle) sum(i, j in point : i!=j) x[i][j][k]*d[i] <= 16;
  forall (k in vihicle) sum(i in point, j in point : i!=j) x[i][j][k]*d[i] == h[k];
    // each vihicle has to go from the station
  forall (i,j in point : i!=j, k in vihicle)
    sum(i,j in point : j!=i && i==0) x[i][j][k] == 1;

     // specify the points that are connected to each other
  forall (i in point, k in vihicle)
    sum(j in point : i!=j) x[i][j][k] - sum(j in point : j!=i) x[j][i][k] == 0;
  //
  forall (j in point : j!=0)
    sum(i in point : i!=j, k in vihicle) x[i][j][k] == 1;
     // total number of point of the vihicle k
  forall (k in vihicle)
    sum(i,j in point : j!=i) x[i][j][k] == no[k];
 }


问:
NFC not working after changing app package name
I have an NFC TAG scanner application which works fine and scans the tag and i can also read and write into tags without any issues , the only issue is that when i change the  app package name and start the code , the nfc no longer works and scans tags , but when i revert to the other package name it works fine , any reason why and what could be wrong , Thank you in advance</p>
```<code>class ActivateActivity : AppCompatActivity() {
    private lateinit var binding : ActivityActivateScreenBinding
    lateinit var writeTagFilters: Array<IntentFilter>
    var nfcAdapter: NfcAdapter? = null
    var pendingIntent: PendingIntent? = null
    var writeMode = false
    var myTag: Tag? = null
    var actualMsg = ""
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityActivateScreenBinding.inflate(layoutInflater)
        setContentView(binding.root)

        binding.btnActivate.setOnClickListener {
            val organizationId = binding.organizationIdEdit.text.toString()
            val nfcMsg = binding.txtNFCMessage.text.toString()
            actualMsg = DOMAIN + organizationId + ucync + nfcMsg

            try {
                if(myTag == null){
                    Toast.makeText(this, ERROR_DETECTED,Toast.LENGTH_LONG).show()
                } else {
                     write(actualMsg,myTag)
                    Toast.makeText(this, WRITE_SUCCESS,Toast.LENGTH_LONG).show()
                }
            }
            catch (e : IOException){
                Toast.makeText(this, WRITE_ERROR, Toast.LENGTH_LONG).show()
                e.printStackTrace()
            }
            catch (e: FormatException){
                Toast.makeText(this, WRITE_ERROR, Toast.LENGTH_LONG).show()
                e.printStackTrace()
            }

        }

        nfcAdapter = NfcAdapter.getDefaultAdapter(this)
        if (nfcAdapter == null) {
            // Stop here, we definitely need NFC
            Toast.makeText(this, "This device doesn't support NFC.", Toast.LENGTH_LONG).show()
            finish()
        }

        //For when the activity is launched by the intent-filter for android.nfc.action.NDEF_DISCOVERE
        readFromIntent(intent)
        pendingIntent = PendingIntent.getActivity(this, 0, Intent(this, javaClass)
            .addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP),
            PendingIntent.FLAG_IMMUTABLE)
        val tagDetected = IntentFilter(NfcAdapter.ACTION_TAG_DISCOVERED)
        tagDetected.addCategory(Intent.CATEGORY_DEFAULT)
        writeTagFilters = arrayOf(tagDetected)
    }

    /******************************************************************************
     * Read From NFC Tag
     ****************************************************************************/
    private fun readFromIntent(intent: Intent) {
        val action = intent.action
        if (NfcAdapter.ACTION_TAG_DISCOVERED == action || NfcAdapter.ACTION_TECH_DISCOVERED == action || NfcAdapter.ACTION_NDEF_DISCOVERED == action) {
            myTag = intent.getParcelableExtra<Parcelable>(NfcAdapter.EXTRA_TAG) as Tag?
            val rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES)
            val msgs = mutableListOf<NdefMessage>()
            if (rawMsgs != null) {
                for (i in rawMsgs.indices) {
                    msgs.add(i, rawMsgs[i] as NdefMessage)
                }
                buildTagViews(msgs.toTypedArray())
            }
        }
    }
    private fun buildTagViews(msgs: Array<NdefMessage>) {
        if (msgs.isEmpty()) return
        val text: String
        val payload = msgs[0].records[0].payload
        val textEncoding: Charset = if ((payload[0] and 128.toByte()).toInt() == 0) Charsets.UTF_8 else Charsets.UTF_16 // Get the Text Encoding
        val languageCodeLength: Int = (payload[0] and 51).toInt() // Get the Language Code, e.g. "en"
        try {
            // Get the Text
            text = String(payload, languageCodeLength + 1, payload.size - languageCodeLength - 1, textEncoding)
            Log.d("VALUE","VALUE IS " + text)
        } catch (e: UnsupportedEncodingException) {
            Log.e("UnsupportedEncoding", e.toString())
        }
    }

    /******************************************************************************
     * Write to NFC Tag
     ****************************************************************************/
    private fun write(msg : String , tag : Tag?){
        val records = arrayOf(createRecord(msg))
        val message = NdefMessage(records)
        // Get an instance of Ndef for the tag.
        val ndef = Ndef.get(tag)
        // Enable I/O
        ndef.connect()
        // Write the message
        ndef.writeNdefMessage(message)
        // Close the connection
        ndef.close()
    }
    @Throws(UnsupportedEncodingException::class)
    private fun createRecord(text: String): NdefRecord {
        val lang = "en"
        val textBytes = text.toByteArray()
        val langBytes = lang.toByteArray(charset("US-ASCII"))
        val langLength = langBytes.size
        val textLength = textBytes.size
        val payload = ByteArray(1 + langLength + textLength)

        // set status byte (see NDEF spec for actual bits)
        payload[0] = langLength.toByte()

        // copy langbytes and textbytes into payload
        System.arraycopy(langBytes, 0, payload, 1, langLength)
        System.arraycopy(textBytes, 0, payload, 1 + langLength, textLength)
        return NdefRecord(NdefRecord.TNF_WELL_KNOWN, NdefRecord.RTD_TEXT, ByteArray(0), payload)
    }

    /**
     * For reading the NFC when the app is already launched
     */
    override fun onNewIntent(intent: Intent) {
        super.onNewIntent(intent)
        setIntent(intent)
        readFromIntent(intent)
        if (NfcAdapter.ACTION_TAG_DISCOVERED == intent.action) {
            myTag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG)
        }
    }

    public override fun onPause() {
        super.onPause()
        writeModeOff()
    }

    public override fun onResume() {
        super.onResume()
        writeModeOn()
    }

    /******************************************************************************
     * Enable Write and foreground dispatch to prevent intent-filter to launch the app again
     ****************************************************************************/
    private fun writeModeOn() {
        writeMode = true
        nfcAdapter!!.enableForegroundDispatch(this, pendingIntent, writeTagFilters, null)
    }

    /******************************************************************************
     * Disable Write and foreground dispatch to allow intent-filter to launch the app
     ****************************************************************************/
    private fun writeModeOff() {
        writeMode = false
        nfcAdapter!!.disableForegroundDispatch(this)
    }
</code>```
```<code> <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.NFC"/>
    <uses-feature android:name="android.hardware.nfc"
        android:required="true"/>

    <application
        android:name=".BaseApplication"
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.UcyncBusiness"
        tools:targetApi="31">
        <activity
            android:name=".ui.ActivateActivity"
            android:exported="false">
            <meta-data
                android:name="android.app.lib_name"
                android:value="" />
        </activity>
        <activity
            android:name=".ui.HomeActivity"
            android:exported="false">

            <intent-filter>
                <action android:name="android.nfc.action.NDEF_DISCOVERED" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="text/plain" />
            </intent-filter>
            <meta-data
                android:name="android.nfc.action.TECH_DISCOVERED"
                android:resource="@xml/nfc_tech_filter" />

            <meta-data
                android:name="android.app.lib_name"
                android:value="" />
        </activity>
        <activity
            android:name=".ui.SplashActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

            <meta-data
                android:name="android.app.lib_name"
                android:value="" />
        </activity>
        <activity android:name=".MainActivity" />
    </application>

</code>```

Body:
I have an NFC TAG scanner application which works fine and scans the tag and i can also read and write into tags without any issues , the only issue is that when i change the  app package name and start the code , the nfc no longer works and scans tags , but when i revert to the other package name it works fine , any reason why and what could be wrong , Thank you in advance

class ActivateActivity : AppCompatActivity() {
    private lateinit var binding : ActivityActivateScreenBinding
    lateinit var writeTagFilters: Array<IntentFilter>
    var nfcAdapter: NfcAdapter? = null
    var pendingIntent: PendingIntent? = null
    var writeMode = false
    var myTag: Tag? = null
    var actualMsg = ""
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityActivateScreenBinding.inflate(layoutInflater)
        setContentView(binding.root)

        binding.btnActivate.setOnClickListener {
            val organizationId = binding.organizationIdEdit.text.toString()
            val nfcMsg = binding.txtNFCMessage.text.toString()
            actualMsg = DOMAIN + organizationId + ucync + nfcMsg

            try {
                if(myTag == null){
                    Toast.makeText(this, ERROR_DETECTED,Toast.LENGTH_LONG).show()
                } else {
                     write(actualMsg,myTag)
                    Toast.makeText(this, WRITE_SUCCESS,Toast.LENGTH_LONG).show()
                }
            }
            catch (e : IOException){
                Toast.makeText(this, WRITE_ERROR, Toast.LENGTH_LONG).show()
                e.printStackTrace()
            }
            catch (e: FormatException){
                Toast.makeText(this, WRITE_ERROR, Toast.LENGTH_LONG).show()
                e.printStackTrace()
            }

        }

        nfcAdapter = NfcAdapter.getDefaultAdapter(this)
        if (nfcAdapter == null) {
            // Stop here, we definitely need NFC
            Toast.makeText(this, "This device doesn't support NFC.", Toast.LENGTH_LONG).show()
            finish()
        }

        //For when the activity is launched by the intent-filter for android.nfc.action.NDEF_DISCOVERE
        readFromIntent(intent)
        pendingIntent = PendingIntent.getActivity(this, 0, Intent(this, javaClass)
            .addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP),
            PendingIntent.FLAG_IMMUTABLE)
        val tagDetected = IntentFilter(NfcAdapter.ACTION_TAG_DISCOVERED)
        tagDetected.addCategory(Intent.CATEGORY_DEFAULT)
        writeTagFilters = arrayOf(tagDetected)
    }

    /******************************************************************************
     * Read From NFC Tag
     ****************************************************************************/
    private fun readFromIntent(intent: Intent) {
        val action = intent.action
        if (NfcAdapter.ACTION_TAG_DISCOVERED == action || NfcAdapter.ACTION_TECH_DISCOVERED == action || NfcAdapter.ACTION_NDEF_DISCOVERED == action) {
            myTag = intent.getParcelableExtra<Parcelable>(NfcAdapter.EXTRA_TAG) as Tag?
            val rawMsgs = intent.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES)
            val msgs = mutableListOf<NdefMessage>()
            if (rawMsgs != null) {
                for (i in rawMsgs.indices) {
                    msgs.add(i, rawMsgs[i] as NdefMessage)
                }
                buildTagViews(msgs.toTypedArray())
            }
        }
    }
    private fun buildTagViews(msgs: Array<NdefMessage>) {
        if (msgs.isEmpty()) return
        val text: String
        val payload = msgs[0].records[0].payload
        val textEncoding: Charset = if ((payload[0] and 128.toByte()).toInt() == 0) Charsets.UTF_8 else Charsets.UTF_16 // Get the Text Encoding
        val languageCodeLength: Int = (payload[0] and 51).toInt() // Get the Language Code, e.g. "en"
        try {
            // Get the Text
            text = String(payload, languageCodeLength + 1, payload.size - languageCodeLength - 1, textEncoding)
            Log.d("VALUE","VALUE IS " + text)
        } catch (e: UnsupportedEncodingException) {
            Log.e("UnsupportedEncoding", e.toString())
        }
    }

    /******************************************************************************
     * Write to NFC Tag
     ****************************************************************************/
    private fun write(msg : String , tag : Tag?){
        val records = arrayOf(createRecord(msg))
        val message = NdefMessage(records)
        // Get an instance of Ndef for the tag.
        val ndef = Ndef.get(tag)
        // Enable I/O
        ndef.connect()
        // Write the message
        ndef.writeNdefMessage(message)
        // Close the connection
        ndef.close()
    }
    @Throws(UnsupportedEncodingException::class)
    private fun createRecord(text: String): NdefRecord {
        val lang = "en"
        val textBytes = text.toByteArray()
        val langBytes = lang.toByteArray(charset("US-ASCII"))
        val langLength = langBytes.size
        val textLength = textBytes.size
        val payload = ByteArray(1 + langLength + textLength)

        // set status byte (see NDEF spec for actual bits)
        payload[0] = langLength.toByte()

        // copy langbytes and textbytes into payload
        System.arraycopy(langBytes, 0, payload, 1, langLength)
        System.arraycopy(textBytes, 0, payload, 1 + langLength, textLength)
        return NdefRecord(NdefRecord.TNF_WELL_KNOWN, NdefRecord.RTD_TEXT, ByteArray(0), payload)
    }

    /**
     * For reading the NFC when the app is already launched
     */
    override fun onNewIntent(intent: Intent) {
        super.onNewIntent(intent)
        setIntent(intent)
        readFromIntent(intent)
        if (NfcAdapter.ACTION_TAG_DISCOVERED == intent.action) {
            myTag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG)
        }
    }

    public override fun onPause() {
        super.onPause()
        writeModeOff()
    }

    public override fun onResume() {
        super.onResume()
        writeModeOn()
    }

    /******************************************************************************
     * Enable Write and foreground dispatch to prevent intent-filter to launch the app again
     ****************************************************************************/
    private fun writeModeOn() {
        writeMode = true
        nfcAdapter!!.enableForegroundDispatch(this, pendingIntent, writeTagFilters, null)
    }

    /******************************************************************************
     * Disable Write and foreground dispatch to allow intent-filter to launch the app
     ****************************************************************************/
    private fun writeModeOff() {
        writeMode = false
        nfcAdapter!!.disableForegroundDispatch(this)
    }

 <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.NFC"/>
    <uses-feature android:name="android.hardware.nfc"
        android:required="true"/>

    <application
        android:name=".BaseApplication"
        android:allowBackup="true"
        android:dataExtractionRules="@xml/data_extraction_rules"
        android:fullBackupContent="@xml/backup_rules"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.UcyncBusiness"
        tools:targetApi="31">
        <activity
            android:name=".ui.ActivateActivity"
            android:exported="false">
            <meta-data
                android:name="android.app.lib_name"
                android:value="" />
        </activity>
        <activity
            android:name=".ui.HomeActivity"
            android:exported="false">

            <intent-filter>
                <action android:name="android.nfc.action.NDEF_DISCOVERED" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="text/plain" />
            </intent-filter>
            <meta-data
                android:name="android.nfc.action.TECH_DISCOVERED"
                android:resource="@xml/nfc_tech_filter" />

            <meta-data
                android:name="android.app.lib_name"
                android:value="" />
        </activity>
        <activity
            android:name=".ui.SplashActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>

            <meta-data
                android:name="android.app.lib_name"
                android:value="" />
        </activity>
        <activity android:name=".MainActivity" />
    </application>


问:
WMV scaling in Firefox 3.0.3
I am having problems with my WMV file playing in its original resolution and not scaling to the size of the windows media frame.
 Here is the code:

```<code><p>
  <object height="420" width="585" type="application/x-oleobject"
          standby="Loading Microsoft Windows Media Player components..."
          codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
          classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="mediaPlayer">
    <param value="mms://a1977.v167321.c16732.g.vm.akamaistream.net/7/1977/16732/0/sas-qp.onstreammedia.com/origin/2etrassociates/NSLC/Webinars/Sustaining_Successful_Civic_Engagement_Campus_and_Community_Based_Initiatives-20090409-1804.wmv" name="fileName" />
    <param value="1" name="animationatStart" />
    <param value="1" name="transparentatStart" />
    <param value="1" name="autoStart" />
    <param value="1" name="ShowControls" />
    <param value="0" name="ShowDisplay" />
    <param value="0" name="ShowStatusBar" />
    <param name="AutoSize" value="false" />
    <param value="0" name="loop" />
    <param value="100" name="Volume" />
    <embed height="420" width="585" scale="exactfit" loop="0"
           designtimesp="5311" autostart="1"
           src="mms://a1977.v167321.c16732.g.vm.akamaistream.net/7/1977/16732/0/sas-qp.onstreammedia.com/origin/2etrassociates/NSLC/Webinars/Sustaining_Successful_Civic_Engagement_Campus_and_Community_Based_Initiatives-20090409-1804.wmv"
           videoborder3d="0" showstatusbar="0" showdisplay="0" showtracker="1"
           showcontrols="1" bgcolor="darkblue" autosize="0" displaysize="4"
           name="mediaPlayer" id="mediaPlayer"
           pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
           type="application/x-mplayer2" volume="100">
    </embed>
  </object>
</p>
<p>
  <a href="/sites/default/files/download/webinars/Wagner_College-Staten_Island-New_York-Webinar.ppt">
    <strong>Download the Updated PowerPoint presentation for this webinar</strong>
  </a>. (755K ppt)
</p>
</code>```

And here is the link which
works fine in IE7 and IE8.

OwnerDisplayName: Larry

ContentLicense: CC BY-SA 3.0

Title: WMV scaling in Firefox 3.0.3

Body:
I am having problems with my WMV file playing in its original resolution and not scaling to the size of the windows media frame.
 Here is the code:

  <object height="420" width="585" type="application/x-oleobject"
          standby="Loading Microsoft Windows Media Player components..."
          codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
          classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" id="mediaPlayer">
    <param value="mms://a1977.v167321.c16732.g.vm.akamaistream.net/7/1977/16732/0/sas-qp.onstreammedia.com/origin/2etrassociates/NSLC/Webinars/Sustaining_Successful_Civic_Engagement_Campus_and_Community_Based_Initiatives-20090409-1804.wmv" name="fileName" />
    <param value="1" name="animationatStart" />
    <param value="1" name="transparentatStart" />
    <param value="1" name="autoStart" />
    <param value="1" name="ShowControls" />
    <param value="0" name="ShowDisplay" />
    <param value="0" name="ShowStatusBar" />
    <param name="AutoSize" value="false" />
    <param value="0" name="loop" />
    <param value="100" name="Volume" />
    <embed height="420" width="585" scale="exactfit" loop="0"
           designtimesp="5311" autostart="1"
           src="mms://a1977.v167321.c16732.g.vm.akamaistream.net/7/1977/16732/0/sas-qp.onstreammedia.com/origin/2etrassociates/NSLC/Webinars/Sustaining_Successful_Civic_Engagement_Campus_and_Community_Based_Initiatives-20090409-1804.wmv"
           videoborder3d="0" showstatusbar="0" showdisplay="0" showtracker="1"
           showcontrols="1" bgcolor="darkblue" autosize="0" displaysize="4"
           name="mediaPlayer" id="mediaPlayer"
           pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
           type="application/x-mplayer2" volume="100">
    </embed>
  </object>

    Download the Updated PowerPoint presentation for this webinar
  . (755K ppt)

And here is the link which
works fine in IE7 and IE8.


问:
on Localhost, chrome is redirecting to another project base_url
In my other Next.js project, I have to redirect users from / to /home/base.

```<code>async redirects() {
    return [
      {
        source: "/home",
        destination: "/home/sales",
        permanent: true,
        basePath: false,
      },
      {
        source: "/",
        destination: "/home/sales",
        permanent: true,
        basePath: false,
      },
    ];
  },
</code>```

In my current project, it is doing the same although I have cleared the cache, session, localstorage on developer tools Application.

How can I solve this?

I actually do not want to clear browsing data for all sites because I do not want to get signed out of some other websites.

Body:
In my other Next.js project, I have to redirect users from / to /home/base.

async redirects() {
    return [
      {
        source: "/home",
        destination: "/home/sales",
        permanent: true,
        basePath: false,
      },
      {
        source: "/",
        destination: "/home/sales",
        permanent: true,
        basePath: false,
      },
    ];
  },

In my current project, it is doing the same although I have cleared the cache, session, localstorage on developer tools Application.

How can I solve this?

I actually do not want to clear browsing data for all sites because I do not want to get signed out of some other websites.


问:
Is there an equivalent ::file-selector-button for filename?
Where input[type="file"]::file-selector-button allows you to style the "Browse..." file selector button, is there a similar pseudo-element to allow for styling the selected filename (pseudo-)element?


问:
How to add images in the project Django
My logo doesn't work in Django project:
Code bellow:

index.html:

```<code><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Главная</title>
    {% load static %}
<img src="{% static 'media/logo.svg' %}" alt="My logo">
</head>
<body>

</body>
<footer>

</footer>
</html>

</code>```

settings.py:

```<code>STATIC_URL = 'static/'
</code>```

The structure of project:

When i try yo open yje console it takes: Failed to load resource: the server responded with a status of 404 (Not Found)
Logo is in a static/media/logo.svg

Title: How to add images in the project Django

Body:
My logo doesn't work in Django project:
Code bellow:

index.html:

<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Главная</title>
    {% load static %}

settings.py:

STATIC_URL = 'static/'

The structure of project:

When i try yo open yje console it takes: Failed to load resource: the server responded with a status of 404 (Not Found)
Logo is in a static/media/logo.svg


问:
nextjs install fail, "npm run dev" don't work
I don't know what is going on, npm run dev has no responese, and http://localhost:3000/ is blank page.
enter image description hereenter image description here

enter image description here

I try all day long ,install a lot of time,but still don't work.


问:
Change order in function with fetch
Iam trying to render for Cars from my API. My problem is order in witch this fucntion  is called.

export default function getGarage(arrayGarage) {
    fetch('http://127.0.0.1:3000/garage')
        .then(res => res.json())
        .then(res => {
            arrayGarage = res
            console.log(arrayGarage)
        })
    if (arrayGarage) {
        console.log(arrayGarage)
        return arrayGarage
    }
}
```
<pre class="lang-js prettyprint-override"><code>let arrayGarage = []
        arrayGarage = getGarage(arrayGarage)
        if (arrayGarage) {
            console.log('before while')
            for (let i = 0; i < arrayGarage.length; i++) {
                console.log('in  while')
                createCar(arrayGarage[i])
            }
        }
</code>```

In first step I got an empty Array (from IF console in fetch), in second step I got "before while" and in third step I got array with my Cars(form then console). How to do that my 'while' wait for property from fetch and handle while.

[]            apiFunctions.js:13

before while         garage.js:43

(4) [{…}, {…}, {…}, {…}]   apiFunctions.js:10

Title: Change order in function with fetch

Body:
Iam trying to render for Cars from my API. My problem is order in witch this fucntion  is called.

export default function getGarage(arrayGarage) {
    fetch('http://127.0.0.1:3000/garage')
        .then(res => res.json())
        .then(res => {
            arrayGarage = res
            console.log(arrayGarage)
        })
    if (arrayGarage) {
        console.log(arrayGarage)
        return arrayGarage
    }
}

let arrayGarage = []
        arrayGarage = getGarage(arrayGarage)
        if (arrayGarage) {
            console.log('before while')
            for (let i = 0; i < arrayGarage.length; i++) {
                console.log('in  while')
                createCar(arrayGarage[i])
            }
        }

In first step I got an empty Array (from IF console in fetch), in second step I got "before while" and in third step I got array with my Cars(form then console). How to do that my 'while' wait for property from fetch and handle while.

[]            apiFunctions.js:13

before while         garage.js:43

(4) [{…}, {…}, {…}, {…}]   apiFunctions.js:10


问:
how to create dataset for ASR model
I have 10k of mp3 and text file and I want to create dataset like this

```<code>[
    {
        'path': 'cv-corpus-6.1-2020-12-11/tr/clips/common_voice_tr_17346025.mp3',
        'array': array([0.        , ..., 0.0002867 , 0.00025517, 0.00025791], dtype=float32),
        'sampling_rate': 48000
    },
]
</code>```

the problem is I can't figure that out how to make mp3 file for the 'array' part of dataset

Title: how to create dataset for ASR model

Body:
I have 10k of mp3 and text file and I want to create dataset like this

[
    {
        'path': 'cv-corpus-6.1-2020-12-11/tr/clips/common_voice_tr_17346025.mp3',
        'array': array([0.        , ..., 0.0002867 , 0.00025517, 0.00025791], dtype=float32),
        'sampling_rate': 48000
    },
]

the problem is I can't figure that out how to make mp3 file for the 'array' part of dataset


问:
emoji overflows out of text widget
I am trying to display emoji on screen but it is not working as it should.

Because emoji's size is so small by default, to make it look bigger I'm increasing its font size. It works fine till fontsize of 68,but when I set it to 69 it overflows out of text widget.
behaviour of emoji

on font size 68

vs on font size 69

why is it happening? Is there any alternative to increasing the size of emoji without using fontsize?.

InkWell(
      child: Text(
        "\ud83d\ude1c",
        textAlign: TextAlign.center,
        textScaleFactor: ScaleSize.textScaleFactor(context),
        style: const TextStyle(
          fontSize:68,
        ),
    ),
)
```

Title: emoji overflows out of text widget


问:
Coredata - UI doesn't update after merging in SwiftUI
First of all, sorry for my English :) I found a weird behavior in core data with SwiftUI. After adding a new persistent store to my container, UI doesn't erase erased objects when I generate entities conflict. Merge policy was NSMergeByPropertyObjectTrumpMergePolicy so existing object in the store might be overwritten by new object, but they still appears with 'nil' values. Let's look at my codes.

My core data model looks like:

Core data singleton:

```<code>struct PersistenceController {
    static let shared = PersistenceController()

    let container: NSPersistentContainer

    init() {
        container = NSPersistentContainer(name: "CoredataTest")

        // Adding new stores makes problem!!
        let defaultURL = NSPersistentContainer.defaultDirectoryURL()
        let newURL = defaultURL.appendingPathComponent("MyStore.sqlite")
        container.persistentStoreDescriptions += [NSPersistentStoreDescription(url: newURL)]
        container.loadPersistentStores(completionHandler: { (storeDescription, error) in
            if let error = error as NSError? {
                fatalError("Unresolved error \(error), \(error.userInfo)")
            }
        })

        container.viewContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy
        container.viewContext.automaticallyMergesChangesFromParent = true
    }

    static func testConflict() {
        let newPerson = Person(context: shared.container.viewContext)
        newPerson.id = UUID()
        newPerson.name = "Jack"
        try! shared.container.viewContext.save()

        let conflict = Person(context: shared.container.viewContext)
        // Same id to test conflict
        conflict.id = newPerson.id
        conflict.name = "Another Jack"
        try! shared.container.viewContext.save()
    }
}
</code>```

The new persistent store was never used. It's just for demonstrating core data's weird stuff.

UI:

```<code>struct ContentView: View {
    @Environment(\.managedObjectContext) private var viewContext

    @FetchRequest(
        sortDescriptors: [NSSortDescriptor(keyPath: \Person.name, ascending: true)],
        animation: .default)
    private var people: FetchedResults<Person>

    var body: some View {
        NavigationView {
            List {
                ForEach(people) { person in
                    Text(person.name ?? "nil")
                }
            }
            .toolbar {
                ToolbarItem {
                    Button(action: PersistenceController.testConflict) {
                        Label("Make doppelganger", systemImage: "wand.and.stars")
                    }
                }
            }
        }
    }
}
</code>```

When I tap the wand button to test conflict, that happens I just introduced you.

I tapped twice. There's nil objects which were "Jack" objects that doesn't exist anymore. They disappears when I close the app and launch it again that means they were erased in the store actually but UI still refers them in memory in some reasons.

It doesn't happen if I use only one persistent store. So, I guess using multiple persistent store is related but I have no ideas how to find the reason.

Of course, I can simply filter the nil objects to hide in the UI but I still want to know why this happens and there is any way to fix the fundamental problem.

Body:
First of all, sorry for my English :) I found a weird behavior in core data with SwiftUI. After adding a new persistent store to my container, UI doesn't erase erased objects when I generate entities conflict. Merge policy was NSMergeByPropertyObjectTrumpMergePolicy so existing object in the store might be overwritten by new object, but they still appears with 'nil' values. Let's look at my codes.

My core data model looks like:

Core data singleton:

struct PersistenceController {
    static let shared = PersistenceController()

    let container: NSPersistentContainer

    init() {
        container = NSPersistentContainer(name: "CoredataTest")

        // Adding new stores makes problem!!
        let defaultURL = NSPersistentContainer.defaultDirectoryURL()
        let newURL = defaultURL.appendingPathComponent("MyStore.sqlite")
        container.persistentStoreDescriptions += [NSPersistentStoreDescription(url: newURL)]
        container.loadPersistentStores(completionHandler: { (storeDescription, error) in
            if let error = error as NSError? {
                fatalError("Unresolved error \(error), \(error.userInfo)")
            }
        })

        container.viewContext.mergePolicy = NSMergeByPropertyObjectTrumpMergePolicy
        container.viewContext.automaticallyMergesChangesFromParent = true
    }

    static func testConflict() {
        let newPerson = Person(context: shared.container.viewContext)
        newPerson.id = UUID()
        newPerson.name = "Jack"
        try! shared.container.viewContext.save()

        let conflict = Person(context: shared.container.viewContext)
        // Same id to test conflict
        conflict.id = newPerson.id
        conflict.name = "Another Jack"
        try! shared.container.viewContext.save()
    }
}

The new persistent store was never used. It's just for demonstrating core data's weird stuff.

UI:

struct ContentView: View {
    @Environment(\.managedObjectContext) private var viewContext

    @FetchRequest(
        sortDescriptors: [NSSortDescriptor(keyPath: \Person.name, ascending: true)],
        animation: .default)
    private var people: FetchedResults<Person>

    var body: some View {
        NavigationView {
            List {
                ForEach(people) { person in
                    Text(person.name ?? "nil")
                }
            }
            .toolbar {
                ToolbarItem {
                    Button(action: PersistenceController.testConflict) {
                        Label("Make doppelganger", systemImage: "wand.and.stars")
                    }
                }
            }
        }
    }
}

When I tap the wand button to test conflict, that happens I just introduced you.

I tapped twice. There's nil objects which were "Jack" objects that doesn't exist anymore. They disappears when I close the app and launch it again that means they were erased in the store actually but UI still refers them in memory in some reasons.

It doesn't happen if I use only one persistent store. So, I guess using multiple persistent store is related but I have no ideas how to find the reason.

Of course, I can simply filter the nil objects to hide in the UI but I still want to know why this happens and there is any way to fix the fundamental problem.


问:
Stream files uploaded by client

Background: Stream Consumption

This is how you can consume and read a stream of data-bytes that is received in the client:

Get a Response object (example a fetch response.)

Retrieve the ReadableStream from the body field of it i.e response.body

As body is an instance of ReadableStream, we can do body.getReader()

And use the reader as reader.read()

That is simple enough, we can consume the stream of bytes coming from the server and we can consume it the same way in NodeJS and Browser through the Node Web Stream API.

Stream from path in NodeJS

To create a stream from URLPath in Node JS it is quite easy (you just pass the path to a stream.) You can also switch from NodeStream to WebStream with ease (Stream.toWebStream())

Problem: Stream from user upload action

Can we get a stream right from user file uploads in the browser ? Can you give a simple example ?

The point of it would be to process the files as the user is uploading them, not to use the Blob stream.

Is it possible analyze user data as it is being uploaded i.e is it possible for it to be a stream ?

Title: Stream files uploaded by client


问:
How to close comb0 in colab
When I enter the code using colab, the whole screen vibrates and the comb0 icon appears, how to close itenter image description here

I want to return to the normal state, the input does not vibrate

Title: How to close comb0 in colab