问:
How to pass all mails from one folder to another using imaplib
```<code>import email, imaplib

host= "imap.gmail.com"
username= "abcd@gmail.com"
password= "utnjkshkjsdfs"
mail= imaplib.IMAP4_SSL(host)
mail.login(username, password)
mail.select('[Gmail]/Spam')
type, data = mail.search(None, 'ALL')
mail_ids = data[0]
id_list = mail_ids.split()
print(id_list)
print(mail_ids)
for uid in id_list:
    print(uid)
    mail.uid('STORE', uid, '+X-GM-LABELS', 'BusinessEmails')
    mail.uid('STORE', uid, '-X-GM-LABELS', '[Gmail]/Spam')
</code>```

Is there any solution to send all mails from one folder to another using imaplib. Pass [Gmail]/Spam' to BusinessEmails label folder

Body:
import email, imaplib

host= "imap.gmail.com"
username= "abcd@gmail.com"
password= "utnjkshkjsdfs"
mail= imaplib.IMAP4_SSL(host)
mail.login(username, password)
mail.select('[Gmail]/Spam')
type, data = mail.search(None, 'ALL')
mail_ids = data[0]
id_list = mail_ids.split()
print(id_list)
print(mail_ids)
for uid in id_list:
    print(uid)
    mail.uid('STORE', uid, '+X-GM-LABELS', 'BusinessEmails')
    mail.uid('STORE', uid, '-X-GM-LABELS', '[Gmail]/Spam')

Is there any solution to send all mails from one folder to another using imaplib. Pass [Gmail]/Spam' to BusinessEmails label folder


来源: stackexchange

问:
Pointers in R (pointr package): How do I know how much memory pointers are taking up?
I am using this package https://cran.r-project.org/web/packages/pointr/index.html to create pointers as an alternative to declaring new variables, which would take up more memory.

However, I have not figured out how much memory these pointers are taking up. When a pointer is given as an argument to object.size() function, the object.size() function returns (understandably) the size of the variable at which the pointer is pointing at:

```<code>> library(pointr)
> myvar <- 3
> ptr("mypointer", "myvar")
> myvar
[1] 3
> mypointer
[1] 3
> object.size(mypointer)
56 bytes
> object.size(myvar)
56 bytes
</code>```

Is there a way to see the size of the pointer itself?

ContentLicense: CC BY-SA 4.0

Body:
I am using this package https://cran.r-project.org/web/packages/pointr/index.html to create pointers as an alternative to declaring new variables, which would take up more memory.

However, I have not figured out how much memory these pointers are taking up. When a pointer is given as an argument to object.size() function, the object.size() function returns (understandably) the size of the variable at which the pointer is pointing at:

> library(pointr)
> myvar <- 3
> ptr("mypointer", "myvar")
> myvar
[1] 3
> mypointer
[1] 3
> object.size(mypointer)
56 bytes
> object.size(myvar)
56 bytes

Is there a way to see the size of the pointer itself?


问:
Soccer standing with React and use Reducer
Please help me on a subject,

When I add a goal to a match it adds me 3 points each time, whereas I simply want the winner to have +3 even if I add 10 or more goals.

here is the code: https://codesandbox.io/s/lucid-hill-3tbqh8?file=/src/App.js

Cordially


问:
How to turn off or hide multi touch circles in android emulator
Android Emulator / AVD. Inadvertently activated multi-touch circles. Cannot find any way to remove/hide/cancel. Have tried Settings>Send Keyboard shortcuts to Virtual Device.</p>


问:
how to open 1 modal window with 3 different buttons?
I face the problem of opening the same modal window with different buttons. Unfortunately, my knowledge is not enough to solve the problem correctly. I made several scripts for each button, it works like this, but it's not a solution, there should be one code, but how exactly to write it?

An example of the code for 1 button below, I will be grateful for help in supplementing the opening code for the other 2 buttons.

(() => {
    const refs = {
        openBuyModalBtn: document.querySelector("[data-buy-modal-open]"), open button
        closeBuyModalBtn: document.querySelector("[data-buy-modal-close]"), close button
        buyModal: document.querySelector("[data-buy-modal]"),
        body: document.querySelector("body"),
    };
    refs.openBuyModalBtn.addEventListener("click", toggleModal);
    refs.closeBuyModalBtn.addEventListener("click", toggleModal);
    function toggleModal() {
        refs.buyModal.classList.toggle("is-hidden"); (.is-hidden {opacity: 0; pointer-events: none; transform: scaleX(0);} )
        refs.body.classList.toggle("no-scroll");
    }
})();
```
<pre class="lang-html prettyprint-override"><code><button class="buy-now__button" data-buy-modal-2-open type="button">Buy now
  <svg width="32" height="32" class="buy-now__icon">
    <use href="./images/svg/icons.svg#icon-ep-arrow"></use>
  </svg>
</button>
<button class="header-nav__button" data-buy-modal-open type="button">Buy now
  <svg width="32" height="32" class="header-nav__icon">
    <use href="./images/svg/icons.svg#icon-ep-arrow"></use>
  </svg>
</button>

<div class="buy-modal__container is-hidden" data-buy-modal>
  <div class="buy-modal">
    <button class="buy-modal__button buy-modal__button--close" type="button" data-buy-modal-close>
      <svg width="20" height="20">
        <use href="./images/svg/icons.svg#icon-close"></use>
      </svg>
    </button>
    <h2 class="buy-modal__title">Buy now</h2>
    <ul class="buy-modal__picture-list"></ul>
  </div>
</div>
</code>```

Body:
I face the problem of opening the same modal window with different buttons. Unfortunately, my knowledge is not enough to solve the problem correctly. I made several scripts for each button, it works like this, but it's not a solution, there should be one code, but how exactly to write it?

An example of the code for 1 button below, I will be grateful for help in supplementing the opening code for the other 2 buttons.

(() => {
    const refs = {
        openBuyModalBtn: document.querySelector("[data-buy-modal-open]"), open button
        closeBuyModalBtn: document.querySelector("[data-buy-modal-close]"), close button
        buyModal: document.querySelector("[data-buy-modal]"),
        body: document.querySelector("body"),
    };
    refs.openBuyModalBtn.addEventListener("click", toggleModal);
    refs.closeBuyModalBtn.addEventListener("click", toggleModal);
    function toggleModal() {
        refs.buyModal.classList.toggle("is-hidden"); (.is-hidden {opacity: 0; pointer-events: none; transform: scaleX(0);} )
        refs.body.classList.toggle("no-scroll");
    }
})();

<button class="buy-now__button" data-buy-modal-2-open type="button">Buy now
  <svg width="32" height="32" class="buy-now__icon">
    <use href="./images/svg/icons.svg#icon-ep-arrow"></use>
  </svg>
</button>
<button class="header-nav__button" data-buy-modal-open type="button">Buy now
  <svg width="32" height="32" class="header-nav__icon">
    <use href="./images/svg/icons.svg#icon-ep-arrow"></use>
  </svg>
</button>

    <button class="buy-modal__button buy-modal__button--close" type="button" data-buy-modal-close>
      <svg width="20" height="20">
        <use href="./images/svg/icons.svg#icon-close"></use>
      </svg>
    </button>

Buy now


问:
Hibernate fetches a deleted child entity from the parent entity
TripEntity

```<code>public class TripEntity extends BaseEntity {
.
.
@JsonManagedReference(value = "segment-trip")
@OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name = "TRIP_ID")
private List<SegmentEntity> segmentList = new ArrayList<>();
.
.
.
}
</code>```

SegmentEntity:

```<code>public class SegmentEntity extends BaseEntity {
.
.
.
@JsonBackReference(value = "segment-trip")
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "TRIP_ID")
    private TripEntity trip;
.
.
}
</code>```

With in the same transaction, Deleted one segment that was part of the trip, but when I am fetching the trip using the trip id, getting the deleted segment with other segments as well.

Delete:

```<code>@Modifying
@Transactional
@Query(value = "delete from dis_segment where segment_id in :segmentDTOIds", nativeQuery = true)
void deleteSegmentsBySegmentIds(List<Long> segmentDTOIds);
</code>```

But while fetching the trip :

```<code>TripDTO parentTrip = tripServicePort.getTripByIdAndOrgId(parentTripId);
</code>```

parentTrip shows the deleted segments as well and after updating the trip using save() method, it is giving error : nested exception is javax.persistence.entitynotfoundexception

Please guide about how I can resolve this issue.

Body:
TripEntity

public class TripEntity extends BaseEntity {
.
.
@JsonManagedReference(value = "segment-trip")
@OneToMany(fetch = FetchType.LAZY)
@JoinColumn(name = "TRIP_ID")
private List<SegmentEntity> segmentList = new ArrayList<>();
.
.
.
}

SegmentEntity:

public class SegmentEntity extends BaseEntity {
.
.
.
@JsonBackReference(value = "segment-trip")
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "TRIP_ID")
    private TripEntity trip;
.
.
}

With in the same transaction, Deleted one segment that was part of the trip, but when I am fetching the trip using the trip id, getting the deleted segment with other segments as well.

Delete:

@Modifying
@Transactional
@Query(value = "delete from dis_segment where segment_id in :segmentDTOIds", nativeQuery = true)
void deleteSegmentsBySegmentIds(List<Long> segmentDTOIds);

But while fetching the trip :

TripDTO parentTrip = tripServicePort.getTripByIdAndOrgId(parentTripId);

parentTrip shows the deleted segments as well and after updating the trip using save() method, it is giving error : nested exception is javax.persistence.entitynotfoundexception

Please guide about how I can resolve this issue.


问:
Maven: using test code from one module in another one
How can I use code from test class from one module in test class in another module?

For example, I have two modules:

moduleA
srcA
testA

moduleB
srcB
testB

I want to be able to use code from class in testA inside class in testB. I tried to put a dependency on moduleA in moduleB. But the code of test classes is invisible.


问:
ab apache benchmark tool to send post data but not from file
I'm using ab from apache2-utils for benchmarking purposes like:

```<code>ab -c 2 -n 200 -p file.txt -T application/json url
</code>```

. Is there any way to do the same, but not reading the content from a file, but from a parameter? Or environment variable or something? So, to run the benchmark tool, but avoiding the need for an external file.

Body:
I'm using ab from apache2-utils for benchmarking purposes like:

ab -c 2 -n 200 -p file.txt -T application/json url

. Is there any way to do the same, but not reading the content from a file, but from a parameter? Or environment variable or something? So, to run the benchmark tool, but avoiding the need for an external file.


问:
How can i run ShaderToy code in standalone windows web browser
I have question How can i run ShaderToy code  Standalone in windows web browser like firefox or chrome

for example like this code:

```<code>#define PI 3.141592653589793

void mainImage(out vec4 fragColor, in vec2 fragCoord)
{
    vec2 pixel_count = max(floor(iResolution.xy * vec2((cos(iTime) + 1.0) / 2.0)), 1.0);
    vec2 pixel_size = iResolution.xy / pixel_count;
    vec2 pixel = (pixel_size * floor(fragCoord / pixel_size)) + (pixel_size / 2.0);
    vec2 uv = pixel.xy / iResolution.xy;

switch (int((iTime + PI) / (2.0 * PI)) % 4)
{
    case 0:
        fragColor = vec4(texture(iChannel0, uv).xyz, 1.0);
        break;

    case 1:
        fragColor = vec4(texture(iChannel1, uv).xyz, 1.0);
        break;

    case 2:
        fragColor = vec4(texture(iChannel2, uv).xyz, 1.0);
        break;

    case 3:
        fragColor = vec4(texture(iChannel3, uv).xyz, 1.0);
        break;
}
}
</code>```

https://www.shadertoy.com/view/4l2fDz

I know fragColor becomes gl_FragColor and gl_FragCoord, void mainImage becomes voice main() , iTime becomes time iResolution becomes resoluton  and iChannel becomes media
But how i can add multiple images or videos to media , as you see mutiple ichannels in above shadertoy code.

Can anyone give a example of above code to run standalone in web browser.

Body:
I have question How can i run ShaderToy code  Standalone in windows web browser like firefox or chrome

for example like this code:

#define PI 3.141592653589793

void mainImage(out vec4 fragColor, in vec2 fragCoord)
{
    vec2 pixel_count = max(floor(iResolution.xy * vec2((cos(iTime) + 1.0) / 2.0)), 1.0);
    vec2 pixel_size = iResolution.xy / pixel_count;
    vec2 pixel = (pixel_size * floor(fragCoord / pixel_size)) + (pixel_size / 2.0);
    vec2 uv = pixel.xy / iResolution.xy;

switch (int((iTime + PI) / (2.0 * PI)) % 4)
{
    case 0:
        fragColor = vec4(texture(iChannel0, uv).xyz, 1.0);
        break;

    case 1:
        fragColor = vec4(texture(iChannel1, uv).xyz, 1.0);
        break;

    case 2:
        fragColor = vec4(texture(iChannel2, uv).xyz, 1.0);
        break;

    case 3:
        fragColor = vec4(texture(iChannel3, uv).xyz, 1.0);
        break;
}
}

https://www.shadertoy.com/view/4l2fDz

I know fragColor becomes gl_FragColor and gl_FragCoord, void mainImage becomes voice main() , iTime becomes time iResolution becomes resoluton  and iChannel becomes media
But how i can add multiple images or videos to media , as you see mutiple ichannels in above shadertoy code.

Can anyone give a example of above code to run standalone in web browser.


问:
IOS 14 UIButton placeholder
I faced some kind of bug, i have a UIButton with no title & placeholder and with Image in it, created in storyboard. When i set my project target to IOS 15.0 everything looks right, but when i change it to 14.0, by button has Image and placeholder "Button", how can i get rid of this placeholder ? Storyboard] app screenshot]

In button properties in storyboard there is no placeholder set.

Title: IOS 14 UIButton placeholder


问:
How to replace the bootstrapmodule app on the fly
I have want to show a "work-in-progress" page on our angular website, which has a totally different layout than the "upcoming-website".

Objective

I want to create a button on that "work-in-progress" page which is sending me to the upcoming website's main page (same angular application).

If someone clicks that button, how can I replace the current bootstrapModule with the new one upcoming-website's module?

In the future, I will update the app and completely remove the "work-in-progress" page and by default set the "upcoming-website" as default.

(I don't want to create 2 Angular apps for some specific reasons. And the 2 "apps" have complete different html layout and css files).


问:
How to quantify color corrected image with ground truth or raw image
I have a color correction algorithm implemented. I have raw image and a color corrected image. Can anyone suggest how can I quantify the color corrected image with respect to ground truth. I have used color chart for color correction.

thanks!

I tried getting mean values of RGB from color chart from both raw and color corrected image to quantify. There was an improvement in RGB colors. However, Are there any other metrics by which i can quantify this.


问:
ArgoCD 2.5.x ha install results in redis pods initializing issue
We are trying to install the ha argocd of verser 2.5.x(current stable version) on Kubernetes: v1.23.13
But the argocd-redis-ha-server-0 pod does not finalize the Initialization because the config-init container fails with

```<code>Start...

Initializing config..

Copying default redis config..

to '/data/conf/redis.conf'

Copying default sentinel config..

to '/data/conf/sentinel.conf'

Identifying redis master (get-master-addr-by-name)..

using sentinel (argocd-redis-ha), sentinel group name (argocd)

Could not connect to Redis at argocd-redis-ha:26379: Try again

Could not connect to Redis at argocd-redis-ha:26379: Try again

Could not connect to Redis at argocd-redis-ha:26379: Try again

Did not find redis master ()

Identify announce ip for this pod..

using (argocd-redis-ha-announce-0) or (argocd-redis-ha-server-0)

identified announce ()

/readonly-config/init.sh: line 239: Error: Could not resolve the announce ip for this pod.: not found

</code>```

Installed ArgoCD resource - https://github.com/argoproj/argo-cd/blob/master/manifests/ha/install.yaml

Does anyone have any idea on how to resolve the above issue?

Body:
We are trying to install the ha argocd of verser 2.5.x(current stable version) on Kubernetes: v1.23.13
But the argocd-redis-ha-server-0 pod does not finalize the Initialization because the config-init container fails with

Start...

Initializing config..

Copying default redis config..

to '/data/conf/redis.conf'

Copying default sentinel config..

to '/data/conf/sentinel.conf'

Identifying redis master (get-master-addr-by-name)..

using sentinel (argocd-redis-ha), sentinel group name (argocd)

Could not connect to Redis at argocd-redis-ha:26379: Try again

Could not connect to Redis at argocd-redis-ha:26379: Try again

Could not connect to Redis at argocd-redis-ha:26379: Try again

Did not find redis master ()

Identify announce ip for this pod..

using (argocd-redis-ha-announce-0) or (argocd-redis-ha-server-0)

identified announce ()

/readonly-config/init.sh: line 239: Error: Could not resolve the announce ip for this pod.: not found

Installed ArgoCD resource - https://github.com/argoproj/argo-cd/blob/master/manifests/ha/install.yaml

Does anyone have any idea on how to resolve the above issue?


问:
Changing the output resolution (hdmi) on Android 9
I would like to change the output resolution (hdmi) programmatically.
I understand that we can change the hdmi resolution by changing the value of the file /sys/class/display/mode.
When connecting to the device with adb shell, I have access to file /sys/class/display/mode. But only the system user can write into it :
-rw-r--r-- 1 system system   4096 2023-01-02 14:53 mode

When I try to write to the file /sys/class/display/mode I have no permission because I need to be system user
command use : [echo 2160p60hz > /sys/class/display/mode]

How can I change the value of the file /sys/class/display/mode ?

ps.

With command [wm size] in the shell I can change the resolution of the screen, but not the resolution of the hdmi


问:
Run custom protocol based on selection box in windows toast notification
I have previosly created a script that launches custom toast notification with buttons launching scripts via custom Classes/Protocols. Now i wanted to make it prettier and included a SelectionBox.
I am unable to run those custom protocols based on Selected item. Please advise</p>
```<code>$ToastTitle = ""
$Signature = ""
$BannerImage = 'C:\Users\anowak\OneDrive - Phlexglobal Ltd\Desktop\Personal\Scripts\Toast\lake.jpg'
$EventTitle = "Testing Title"
$EventText = "This is where there would normally be info. This is just a test though."
$site = "http://google.com/"
$MoreInfoTitle = "More Information"
$Snooze = $true
$CustomHello = "Hello $env:USERNAME"

#Specify Launcher App ID, the App that will claim ownership of the toast notification, doesn't affect functionality.
$LauncherID = '{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\WindowsPowerShell\v1.0\powershell.exe'

#Load Assemblies
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] | Out-Null

#Build XML Template
[xml]$toastTemplate = @"
<toast duration="long" scenario="reminder">
    <visual>
        <binding template="ToastGeneric">
            <text>$CustomHello</text>
            <text>$ToastTitle</text>
            <text placement="attribution">$Signature</text>
            <image placement="hero" src="$BannerImage"/>
            <group>
                <subgroup>
                    <text hint-style="title" hint-wrap="true" >$EventTitle</text>
                </subgroup>
            </group>
            <group>
                <subgroup>
                    <text hint-style="body" hint-wrap="true" >$EventText</text>
                </subgroup>
            </group>
        </binding>
    </visual>
     <actions>
        <input id="MySelection" type="selection" title="Choose:" defaultInput="1">
            <selection id="1" content="Zenek:"/>
            <selection id="2" content="NetExt"/>
            <selection id="3" content="Shorts"/>
            <selection id="4" content="Busy"/>
            <selection id="5" content="Time"/>
        </input>
        <action activationType="protocol" arguments="WHAT DO I PUT HERE" hint-inputId="MySelection" content="RUN"/>
        <action arguments="dismiss" content="" activationType="system"/>
    </actions>
</toast>
"@

#Prepare XML
$ToastXml = [Windows.Data.Xml.Dom.XmlDocument]::New()
$ToastXml.LoadXml($ToastTemplate.OuterXml)
$ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($LauncherID).Show($ToastMessage)
</code>```

Body:
I have previosly created a script that launches custom toast notification with buttons launching scripts via custom Classes/Protocols. Now i wanted to make it prettier and included a SelectionBox.
I am unable to run those custom protocols based on Selected item. Please advise

$ToastTitle = ""
$Signature = ""
$BannerImage = 'C:\Users\anowak\OneDrive - Phlexglobal Ltd\Desktop\Personal\Scripts\Toast\lake.jpg'
$EventTitle = "Testing Title"
$EventText = "This is where there would normally be info. This is just a test though."
$site = "http://google.com/"
$MoreInfoTitle = "More Information"
$Snooze = $true
$CustomHello = "Hello $env:USERNAME"

#Specify Launcher App ID, the App that will claim ownership of the toast notification, doesn't affect functionality.
$LauncherID = '{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\WindowsPowerShell\v1.0\powershell.exe'

#Load Assemblies
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] | Out-Null

#Build XML Template
[xml]$toastTemplate = @"
<toast duration="long" scenario="reminder">
    <visual>
        <binding template="ToastGeneric">
            <text>$CustomHello</text>
            <text>$ToastTitle</text>
            <text placement="attribution">$Signature</text>
            <image placement="hero" src="$BannerImage"/>
            <group>
                <subgroup>
                    <text hint-style="title" hint-wrap="true" >$EventTitle</text>
                </subgroup>
            </group>
            <group>
                <subgroup>
                    <text hint-style="body" hint-wrap="true" >$EventText</text>
                </subgroup>
            </group>
        </binding>
    </visual>
     <actions>
        <input id="MySelection" type="selection" title="Choose:" defaultInput="1">
            <selection id="1" content="Zenek:"/>
            <selection id="2" content="NetExt"/>
            <selection id="3" content="Shorts"/>
            <selection id="4" content="Busy"/>
            <selection id="5" content="Time"/>
        </input>
        <action activationType="protocol" arguments="WHAT DO I PUT HERE" hint-inputId="MySelection" content="RUN"/>
        <action arguments="dismiss" content="" activationType="system"/>
    </actions>
</toast>
"@

#Prepare XML
$ToastXml = [Windows.Data.Xml.Dom.XmlDocument]::New()
$ToastXml.LoadXml($ToastTemplate.OuterXml)
$ToastMessage = [Windows.UI.Notifications.ToastNotification]::New($ToastXML)
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($LauncherID).Show($ToastMessage)


问:
Creating an importable webpack library into Vite
I've stumbled upon an issue with a library that I'm trying to integrate into my project. I've decided to fork it to provide the internal components as exports of the library.

For the consuming project I'm using Vite, while the forked project uses webpack.
I've read a bit about library creation in webpack here
https://webpack.js.org/guides/author-libraries/

I've also create a minimal example via vite.

This is my import statement in a vite react app:

```<code>import "webpack-numbers";
</code>```

This works correctly from the webpack docs:

```<code><html>
<head>
    <meta charset="UTF-8">
    <script src="./dist/webpack-numbers.js"></script>
    <script>
        console.log(webpackNumbers.wordToNum('Five'));
        console.log(window.webpackNumbers.wordToNum('Five'));
    </script>
</head>
<body>

</body>
</html>
</code>```

The webpack config

```<code>module.exports = {
    entry: './src/index.js',
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'webpack-numbers.js',
        globalObject: 'this',
        library: {
            name: 'webpackNumbers',
            type: 'umd',

        },
    },
};
</code>```

I'm getting the following error:

```<code>Uncaught TypeError: n is undefined
    <anonymous> http://localhost:5174/@fs/home/blewandowski/repositories/personal/webpack-numbers/dist/webpack-numbers.js?t=1672834535153:2
    <anonymous> http://localhost:5174/@fs/home/blewandowski/repositories/personal/webpack-numbers/dist/webpack-numbers.js?t=1672834535153:2

</code>```

How does one go about consuming these exports in a vite react app?

Body:
I've stumbled upon an issue with a library that I'm trying to integrate into my project. I've decided to fork it to provide the internal components as exports of the library.

For the consuming project I'm using Vite, while the forked project uses webpack.
I've read a bit about library creation in webpack here
https://webpack.js.org/guides/author-libraries/

I've also create a minimal example via vite.

This is my import statement in a vite react app:

import "webpack-numbers";

This works correctly from the webpack docs:

    <meta charset="UTF-8">

The webpack config

module.exports = {
    entry: './src/index.js',
    output: {
        path: path.resolve(__dirname, 'dist'),
        filename: 'webpack-numbers.js',
        globalObject: 'this',
        library: {
            name: 'webpackNumbers',
            type: 'umd',

        },
    },
};

I'm getting the following error:

Uncaught TypeError: n is undefined
    <anonymous> http://localhost:5174/@fs/home/blewandowski/repositories/personal/webpack-numbers/dist/webpack-numbers.js?t=1672834535153:2
    <anonymous> http://localhost:5174/@fs/home/blewandowski/repositories/personal/webpack-numbers/dist/webpack-numbers.js?t=1672834535153:2

How does one go about consuming these exports in a vite react app?


问:
When we have two Realm DBs (one default (unencrypted) and other encrypted), will changes in one default DB schema impact other encrypted DBs
DB1: default (unencrypted)
DB2: encrypted

Both are independent as they are completely individual DBs.

I'm using deleteRealmIfMigrationNeeded() for both the DBs.

Now, suppose there is a schema change for a table in DB1 for migration purpose I'm using deleteRealmIfMigrationNeeded() which tells that whenever there is a schema change in the DB, it will truncate the tables and reconstruct them.

I have made changes to the schema in DB1 and DB2 is unchanges.

Ideally , DB1 should truncate all its tables and recontruct them since there are schema changes and DB2 shouldn't truncate its tables since it is not affected by the schema changes of DB1.

But in my case, both the DBs are truncating their tables and reconstructing them. Ideally, only DB1(default) should truncate its tables but DB2 shouldn't.

I'm using @RealmClass annotation for both DBs data classes, does it have something to do with the problem I'm facing?

What might be the problem?


问:
How to mute incoming Audio of Embedded Whereby meeting URL in an Iframe?
I have Whereby meeting URL and I am embedding it in an Iframe to use it (can use this URL to reproduce it by embedding it in iframe). I want to mute the incoming audio of an Iframe. how can I do that?

e.g. this is an Iframe

```<code><iframe height="100%" width="100%" frameborder='0' audio=off allowfullscreen='true' allow='fullscreen; display-capture; camera *; microphone *;' src="https://momento.whereby.com/6fcb5ead-1f55-43c9-a031-02ebdc373867?chat=off&people=off&locking=off&moreButton=off&pipButton=off&participantCount=off"></iframe>
</code>```

I tried these things

mute=1

```<code>var iframe = document.getElementsByTagName('iframe')[0];
iframe.contentWindow.postMessage('{"method":"setVolume", "value":0}','*');
</code>```

and this as well

```<code>document.querySelector('iframe').contentWindow.document.querySelector('audio').muted = true;
</code>```

but failed to do so.
Faced this error

Body:
I have Whereby meeting URL and I am embedding it in an Iframe to use it (can use this URL to reproduce it by embedding it in iframe). I want to mute the incoming audio of an Iframe. how can I do that?

e.g. this is an Iframe

I tried these things

mute=1

var iframe = document.getElementsByTagName('iframe')[0];
iframe.contentWindow.postMessage('{"method":"setVolume", "value":0}','*');

and this as well

document.querySelector('iframe').contentWindow.document.querySelector('audio').muted = true;

but failed to do so.
Faced this error


问:
custom loader not working when changing ngx translate language
I am trying to fix a bug that is caused by ngx translate language change. Changing language from default to English for the first time doesn't cause any issues, the loader works fine, but after changing from English to Georgian loader doesn't stop loading.

loader.component.html

```<code><div class="progress-bar-container">
      <div class="progress-bar" [ngClass]="{'in-progress': !show, 'fill': show}"></div>
</div>
</code>```

loader.component.ts

```<code>export class ProgressBarComponent {

  show = true;

  constructor(private progressBarService: ProgressBarService) {

    this.progressBarService.progressBarSub()

      .subscribe(status => {

        this.show = status;

      })

  }

}
</code>```

app.component.ts

```<code>export class AppComponent {

  title = 'app';

  constructor(

    private activatedRoute: ActivatedRoute,

    private router: Router,

    private progressBarService: ProgressBarService,

    private prevRoute: PreviousRouteService,

    private locationStrategy: LocationStrategy,

    private translate: TranslateService) {

    translate.addLangs(['en', 'ka']);

    this.activatedRoute.queryParams

      .subscribe(p => {

        const { lang } = p;

        if (!this.checkLang(lang) && lang.match(/en|ka|EN|KA/)) {

          let oldLang = this.translate.currentLang

          if (!oldLang) {

            this.translate.use(lang.toLowerCase());

            sessionStorage.setItem('lang', lang.toLowerCase());

          } else {

            const qParams = { ...p };

            qParams['lang'] = oldLang;

            this.router.navigate([], { relativeTo: this.activatedRoute, queryParams: { ...qParams }, replaceUrl: true })

              .catch(err => console.log(err))

          }

        } else {

          this.translate.setDefaultLang('ka');

          sessionStorage.setItem('lang', 'ka');

        }

      })

    this.router.events

      .subscribe(event => {

        if (event instanceof NavigationStart) {

          if (event.url.includes('result')) {

            history.pushState(null, null, location.href);

            this.locationStrategy.onPopState((l: LocationChangeEvent) => {

              history.pushState(null, null, location.href);

            });

          }

          if (this.prevRoute.prevPath == undefined) {

            this.prevRoute.previousRoutePath.next(event.url);

          }

          this.progressBarService.progressBarProcess(false);

        }

      })

  }

  private checkLang(lang) {

    return lang === undefined || lang === "undefined" || lang === null || lang.length <= 0;

  }

}
</code>```

header.component.ts
where I have dropdown flags for changing languages on click

```<code>this.translate.onDefaultLangChange
      .subscribe(defaultLang => {
        this.currentLang = defaultLang.lang;
        this.languageFlags = this.filterFlags();
      })

    this.translate.onLangChange
      .subscribe(lang => {
        this.currentLang = lang.lang;
        this.languageFlags = this.filterFlags();
      })
  }

  toggleLanguageDropdown() {
    this.languageDropdown = !this.languageDropdown;
  }

  changeLanguage(lang: string) {
    this.languageDropdown = false;
    this.translate.use(lang)
      .subscribe(() => {
        this.languageFlags = this.langs;
        this.currentLang = this.translate.currentLang
        this.languageFlags = this.filterFlags();
        window.sessionStorage.setItem('lang', lang);
        this.activatedRoute.queryParams
          .subscribe(r => {
            this.router.navigate([], { relativeTo: this.activatedRoute, queryParams: { lang: lang, status: r['status'] }, replaceUrl: true })
              .catch(err => console.log(err))
          });
      })
  }

  private filterFlags(): string[] {
    return this.languageFlags.filter(el => el !== this.currentLang)
  }

</code>```

Interceptor

```<code>constructor(private progressBarService: ProgressBarService) {
  }

  intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
    this.progressBarService.progressBarProcess(false);

    const token = window.sessionStorage.getItem('auth_token');
    const lang = window.sessionStorage.getItem('lang') ?? 'ka';
    const newReq = token
      ? req.clone({ headers: req.headers.set("Authorization", `Bearer ${token}`).set("Accept-Language", lang) })
      : req.clone({ headers: req.headers.set("Accept-Language", lang) });
    return next.handle(newReq)
      .pipe(
        catchError((error) => {
          if (error.status === 301) {
            window.location.reload();
          }
          return throwError(error);
        }),
        finalize(() => {
          this.progressBarService.progressBarProcess(true);
        }));
  }

</code>```

Any help would be greatly appreciated

Body:
I am trying to fix a bug that is caused by ngx translate language change. Changing language from default to English for the first time doesn't cause any issues, the loader works fine, but after changing from English to Georgian loader doesn't stop loading.

loader.component.html

loader.component.ts

export class ProgressBarComponent {

  show = true;

  constructor(private progressBarService: ProgressBarService) {

    this.progressBarService.progressBarSub()

      .subscribe(status => {

        this.show = status;

      })

  }

}

app.component.ts

export class AppComponent {

  title = 'app';

  constructor(

    private activatedRoute: ActivatedRoute,

    private router: Router,

    private progressBarService: ProgressBarService,

    private prevRoute: PreviousRouteService,

    private locationStrategy: LocationStrategy,

    private translate: TranslateService) {

    translate.addLangs(['en', 'ka']);

    this.activatedRoute.queryParams

      .subscribe(p => {

        const { lang } = p;

        if (!this.checkLang(lang) && lang.match(/en|ka|EN|KA/)) {

          let oldLang = this.translate.currentLang

          if (!oldLang) {

            this.translate.use(lang.toLowerCase());

            sessionStorage.setItem('lang', lang.toLowerCase());

          } else {

            const qParams = { ...p };

            qParams['lang'] = oldLang;

            this.router.navigate([], { relativeTo: this.activatedRoute, queryParams: { ...qParams }, replaceUrl: true })

              .catch(err => console.log(err))

          }

        } else {

          this.translate.setDefaultLang('ka');

          sessionStorage.setItem('lang', 'ka');

        }

      })

    this.router.events

      .subscribe(event => {

        if (event instanceof NavigationStart) {

          if (event.url.includes('result')) {

            history.pushState(null, null, location.href);

            this.locationStrategy.onPopState((l: LocationChangeEvent) => {

              history.pushState(null, null, location.href);

            });

          }

          if (this.prevRoute.prevPath == undefined) {

            this.prevRoute.previousRoutePath.next(event.url);

          }

          this.progressBarService.progressBarProcess(false);

        }

      })

  }

  private checkLang(lang) {

    return lang === undefined || lang === "undefined" || lang === null || lang.length <= 0;

  }

}

header.component.ts
where I have dropdown flags for changing languages on click

this.translate.onDefaultLangChange
      .subscribe(defaultLang => {
        this.currentLang = defaultLang.lang;
        this.languageFlags = this.filterFlags();
      })

    this.translate.onLangChange
      .subscribe(lang => {
        this.currentLang = lang.lang;
        this.languageFlags = this.filterFlags();
      })
  }

  toggleLanguageDropdown() {
    this.languageDropdown = !this.languageDropdown;
  }

  changeLanguage(lang: string) {
    this.languageDropdown = false;
    this.translate.use(lang)
      .subscribe(() => {
        this.languageFlags = this.langs;
        this.currentLang = this.translate.currentLang
        this.languageFlags = this.filterFlags();
        window.sessionStorage.setItem('lang', lang);
        this.activatedRoute.queryParams
          .subscribe(r => {
            this.router.navigate([], { relativeTo: this.activatedRoute, queryParams: { lang: lang, status: r['status'] }, replaceUrl: true })
              .catch(err => console.log(err))
          });
      })
  }

  private filterFlags(): string[] {
    return this.languageFlags.filter(el => el !== this.currentLang)
  }

Interceptor

constructor(private progressBarService: ProgressBarService) {
  }

  intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
    this.progressBarService.progressBarProcess(false);

    const token = window.sessionStorage.getItem('auth_token');
    const lang = window.sessionStorage.getItem('lang') ?? 'ka';
    const newReq = token
      ? req.clone({ headers: req.headers.set("Authorization", `Bearer ${token}`).set("Accept-Language", lang) })
      : req.clone({ headers: req.headers.set("Accept-Language", lang) });
    return next.handle(newReq)
      .pipe(
        catchError((error) => {
          if (error.status === 301) {
            window.location.reload();
          }
          return throwError(error);
        }),
        finalize(() => {
          this.progressBarService.progressBarProcess(true);
        }));
  }

Any help would be greatly appreciated


问:
Union of non-model serializers in Django Rest Framework
Through serializers, I'm trying to describe that a field could be serialized as one of N options (similar to typing.Union). The goal of this is to use DRF Spectacular to generate Union Types. For example:

From the following serializers

```<code>class SerializerA(serializers.BaseSerializer):
    a_field = serializers.CharField()

class SerializerB(serializers.BaseSerializer):
    b_field = serializers.CharField()
</code>```

I want to describe:

```<code>class CombinedSerializer(serializers.BaseSerializer):
    combined_field = <either_serializerA_or_serializerB>
</code>```

Which, through DRF spectacular, I would be able to generate into

```<code>export interface SerializerA = {
    a_field: string;
}

export interface SerializerB = {
    b_field: string;
}

export interface CombinedSerializer = {
    combined_field: SerializerA | SerializerB
}
</code>```

I've looked into https://github.com/denisorehovsky/django-rest-polymorphic but that seems to support model serializers. https://github.com/tfranzel/drf-spectacular/issues/382 also doesn't seem to support this use case - any suggestions?

Body:
Through serializers, I'm trying to describe that a field could be serialized as one of N options (similar to typing.Union). The goal of this is to use DRF Spectacular to generate Union Types. For example:

From the following serializers

class SerializerA(serializers.BaseSerializer):
    a_field = serializers.CharField()

class SerializerB(serializers.BaseSerializer):
    b_field = serializers.CharField()

I want to describe:

class CombinedSerializer(serializers.BaseSerializer):
    combined_field = <either_serializerA_or_serializerB>

Which, through DRF spectacular, I would be able to generate into

export interface SerializerA = {
    a_field: string;
}

export interface SerializerB = {
    b_field: string;
}

export interface CombinedSerializer = {
    combined_field: SerializerA | SerializerB
}

I've looked into https://github.com/denisorehovsky/django-rest-polymorphic but that seems to support model serializers. https://github.com/tfranzel/drf-spectacular/issues/382 also doesn't seem to support this use case - any suggestions?


问:
vercel "npm install" exited with 1
Help! I am trying to deploy a (Next js) project to vercel but keep getting this error.

I have already reinstalled all dependencies several times, but the error still shows.

```<code>npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: next-sanity-image@5.0.0
npm ERR! Found: @sanity/client@4.0.0
npm ERR! node_modules/@sanity/client
npm ERR!   @sanity/client@"^4.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @sanity/client@"^3.0.0" from next-sanity-image@5.0.0
npm ERR! node_modules/next-sanity-image
npm ERR!   next-sanity-image@"^5.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @sanity/client@3.4.1
npm ERR! node_modules/@sanity/client
npm ERR!   peer @sanity/client@"^3.0.0" from next-sanity-image@5.0.0
npm ERR!   node_modules/next-sanity-image
npm ERR!     next-sanity-image@"^5.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /vercel/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR!     /vercel/.npm/_logs/2023-01-04T11_51_59_052Z-debug-0.log
Error: Command "npm install" exited with 1
</code>```

I have tried every available command to resolve dependencies conflict.

Title: vercel "npm install" exited with 1

Body:
Help! I am trying to deploy a (Next js) project to vercel but keep getting this error.

I have already reinstalled all dependencies several times, but the error still shows.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: next-sanity-image@5.0.0
npm ERR! Found: @sanity/client@4.0.0
npm ERR! node_modules/@sanity/client
npm ERR!   @sanity/client@"^4.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @sanity/client@"^3.0.0" from next-sanity-image@5.0.0
npm ERR! node_modules/next-sanity-image
npm ERR!   next-sanity-image@"^5.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @sanity/client@3.4.1
npm ERR! node_modules/@sanity/client
npm ERR!   peer @sanity/client@"^3.0.0" from next-sanity-image@5.0.0
npm ERR!   node_modules/next-sanity-image
npm ERR!     next-sanity-image@"^5.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /vercel/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR!     /vercel/.npm/_logs/2023-01-04T11_51_59_052Z-debug-0.log
Error: Command "npm install" exited with 1

I have tried every available command to resolve dependencies conflict.


问:
Amazon EC2 instance(T2 micro Free Tier) giving 503 Service Unavailable error
We created a Amazon EC2 instance(T2 micro Free Tier) last week. We installed Apache2, PHP and mysql. The site was working fine until today. Suddenly the MySql service and apache2 service stopped working. After restarting the instance and restarting the apache2 service, it started showing 503 Service Unavailable error. There is no load balancer implemented.

What could be the possible reason for this, and how can we fix it?

NOTE: we were testing with audio files, and during testing, downloaded multiple audio files simultaneously using ajax(total of around 200mb). The above issues happened after this.

We have checked the disk space and memory. The server has enough space. The instance also shows no error. We can access the server and mysql through ssh. But the site remains unavailable.

EDIT: CPU utilization


问:
How to open application in front?
I have an application in Net 7 that open a window application, but if there is the file explorer open, for example, the file explorer keeps in front.

In my case I am trying to open the notepad with this code:

```<code>        ProcessStartInfo miProcessStartInfo = new ProcessStartInfo();
        miProcessStartInfo.FileName = "Notepad.exe";
        miProcessStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
        miProcessStartInfo.CreateNoWindow = true;
</code>```

Thanks.

Title: How to open application in front?

Body:
I have an application in Net 7 that open a window application, but if there is the file explorer open, for example, the file explorer keeps in front.

In my case I am trying to open the notepad with this code:

        ProcessStartInfo miProcessStartInfo = new ProcessStartInfo();
        miProcessStartInfo.FileName = "Notepad.exe";
        miProcessStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
        miProcessStartInfo.CreateNoWindow = true;

Thanks.


问:
Error: Interface 'League\CommonMark\Renderer\DocumentRendererInterface' not found (..vendor\mail\html\subcopy.blade.php)
System:

Windows 10

PHP 7.4

Laravel 8

Hello friends, I'm getting this error (Interface 'League\CommonMark\Renderer\DocumentRendererInterface' not found (View: ...vendor\mail\html\subcopy.blade.php)) when I try reset password using markdown\mail. How can I resolve that?

This is my subcopy.blade.php file:

I already tried to run:

php artisan route:clear

php artisan cache:clear

php artisan config:clear

composer require league/commonmark

but I didn't succeed :/

Can someone help me? Thanks!


问:
How to avoid setting an useState in an useEffect to trigger infinite re-renders?
I am new of react, and I understand that there are ways to stop infinite re-renders, but I am not clear how to do it. My objective is to on load page to render only ONCE a change of values in my page if some values exist, and because of that I want to change the useState on where I am storing this data.

I am not clear on how differently I could approach the problem and solve it.

```<code>useEffect(() => {
        const addOrRemoveEquipment = (itemID, action) => {
            if (itemID && action) {
                if (action === "add") {
                    setEquipmentState([...equipmentState, itemID]);
                } else if (action === "remove") {
                    setEquipmentState((current) =>
                        current.filter((item) => {
                            return item !== itemID[0];
                        })
                    );
                }
            }
        };

        const addOrRemoveItem = (val) => {
            if (val instanceof Array) {
                addOrRemoveEquipment(val[1], "add");
                addOrRemoveEquipment(val[0], "remove");
            }
        };

        addOrRemoveItem([myPlace.remove, myPlace.add]);

        return () => {
            addOrRemoveItem([myPlace.remove, myPlace.add]);
        };
    }, [myPlace.remove, myPlace.add, equipmentState, setEquipmentState]);
</code>```

I was expecting to just change the useState, but it looks like useEffect go crazy when paired with setting an useState inside.

Any suggestions? I read many solutions, I tried, but I am not expert enough to get it right.

Body:
I am new of react, and I understand that there are ways to stop infinite re-renders, but I am not clear how to do it. My objective is to on load page to render only ONCE a change of values in my page if some values exist, and because of that I want to change the useState on where I am storing this data.

I am not clear on how differently I could approach the problem and solve it.

useEffect(() => {
        const addOrRemoveEquipment = (itemID, action) => {
            if (itemID && action) {
                if (action === "add") {
                    setEquipmentState([...equipmentState, itemID]);
                } else if (action === "remove") {
                    setEquipmentState((current) =>
                        current.filter((item) => {
                            return item !== itemID[0];
                        })
                    );
                }
            }
        };

        const addOrRemoveItem = (val) => {
            if (val instanceof Array) {
                addOrRemoveEquipment(val[1], "add");
                addOrRemoveEquipment(val[0], "remove");
            }
        };

        addOrRemoveItem([myPlace.remove, myPlace.add]);

        return () => {
            addOrRemoveItem([myPlace.remove, myPlace.add]);
        };
    }, [myPlace.remove, myPlace.add, equipmentState, setEquipmentState]);

I was expecting to just change the useState, but it looks like useEffect go crazy when paired with setting an useState inside.

Any suggestions? I read many solutions, I tried, but I am not expert enough to get it right.


问:
.NET Bitmap GetPixel from transparent background not working
I am trying to crop an image exacly where the item in the image starts, so I am analyzing the image that is supposed to have a white (or transparent) background. It works perfecly on a white background but doesnt work on transparent, here is my code:

```<code>    public static int GetTopImageStartingPixel(Image image)
        {
            int highestPixelWithColor = image.Height;

            using (Bitmap bmp = new(image))
            {
                for (int j = 0; j < image.Width; j++)
                {
                    for (int i = 0; i < image.Height; i++)
                    {
                        Color color = bmp.GetPixel(j, i);

                        if (color.R < 240 || color.G < 240 || color.B < 240 && color.A > 0)
                        {
                            if (i < highestPixelWithColor)
                            {
                                highestPixelWithColor = i;
                            }

                        }
                    }
                }
            }

            return highestPixelWithColor;
        }
</code>```

In debugger, the "Color color" isnt initialized and doesnt seem to work, if the image is transparent this method will return "0" because it will think that the top color is color.R < 240 || color.G < 240 || color.B < 240 && color.A > 0 == true

I have tried to use Graphics g to fill a rect with white background but no difference..

Body:
I am trying to crop an image exacly where the item in the image starts, so I am analyzing the image that is supposed to have a white (or transparent) background. It works perfecly on a white background but doesnt work on transparent, here is my code:

    public static int GetTopImageStartingPixel(Image image)
        {
            int highestPixelWithColor = image.Height;

            using (Bitmap bmp = new(image))
            {
                for (int j = 0; j < image.Width; j++)
                {
                    for (int i = 0; i < image.Height; i++)
                    {
                        Color color = bmp.GetPixel(j, i);

                        if (color.R < 240 || color.G < 240 || color.B < 240 && color.A > 0)
                        {
                            if (i < highestPixelWithColor)
                            {
                                highestPixelWithColor = i;
                            }

                        }
                    }
                }
            }

            return highestPixelWithColor;
        }

In debugger, the "Color color" isnt initialized and doesnt seem to work, if the image is transparent this method will return "0" because it will think that the top color is color.R < 240 || color.G < 240 || color.B < 240 && color.A > 0 == true

I have tried to use Graphics g to fill a rect with white background but no difference..


问:
I want to be able to separately sort multiple sections of information, and be able to change the column they are sorted by
In my sheet I have four sections of rows and columns I want to keep separate from each other.
I would like to be able to sort the rows of each section by the value in the columns.
I would also like to be able to change which column the section is sorted by. Sometimes I want to sort by column A, sometimes by column B, and so on. Column A contains names, column B-F contains colours (i.e. green, red, white).
A Google Apps Script or a checkbox system might work, but I am far from adept at Google Sheets, so I have no idea where I would even begin with such a system.

Link to a copy of the sheet (with names replaced by letters)

Link to a minimal example

I have tried using the filter setting under Data > Create New Filter, but this limits the filtering to one of four sections at a time.
I looked into the filter function, but it does not seem to be what I was looking for.
I looked into the sort function, but it seems you can not change the column it sorts by unless you change the function manually.


问:
SQL value not available anymore
I'm using SQLite for a query as you see below. Therefore I need the average of the all the interactions. Including the "thankful" interaction as well, I don't get results (n/a) because it doesn't exist anymore since October 2022. What do I have to include into the code, that I don't get this error?

```<code>SELECT
  SUBSTR(facebookOwnPosts.time, 1, 7) AS month,
  ROUND (
     AVG (
      likes + love + wow + haha + sad + angry + comments + shares + thankful
    )
  ) AS enagegementperpost
FROM
  facebookOwnPosts
GROUP BY
  month
</code>```

I believed that if there is no data for one of the parameters it would just leave it out.

Title: SQL value not available anymore

Body:
I'm using SQLite for a query as you see below. Therefore I need the average of the all the interactions. Including the "thankful" interaction as well, I don't get results (n/a) because it doesn't exist anymore since October 2022. What do I have to include into the code, that I don't get this error?

SELECT
  SUBSTR(facebookOwnPosts.time, 1, 7) AS month,
  ROUND (
     AVG (
      likes + love + wow + haha + sad + angry + comments + shares + thankful
    )
  ) AS enagegementperpost
FROM
  facebookOwnPosts
GROUP BY
  month

I believed that if there is no data for one of the parameters it would just leave it out.


问:
How do I scan elements of a 2d array under certain conditions, when using recursion in Java?
I have a two-dimensional array filled with non-negative numbers.
one cell in particular is equal to -1 (for example, the bottom right corner in the array below is -1).

I have to return the minimum number of steps (starting from arr[0][0] only) to get to the -1.

The thing is:
You can think of every number in the array as a height of a rooftop.

The difference between cell values when moving in any direction is either "climbing" or "going down":

For example, moving in any direction from a cell with the value 5, to a cell with the value 3 is considered "going down", and the difference is 2.

For example, moving in any direction from a cell with the value 1, to a cell with the value 2, is considered "climbing", and the difference is -1.

If the difference between cell values while "climbing" is smaller than -1,
and the difference between cell values while " going down" is bigger than 2,
There are no legal options to move inside the array, and the recursive method will return -1.

The only exception is: if the value of the "neighbor" cell from any direction is the -1 we are searching for, we can immediately go there without having to consider the difference between the current cell and the "neighbor" cell.

If there is no valid path that starts in arr[0][0] and can find "-1" in the array, the recursive method should return -1. If there is a valid path the recursive method returns the minimum number of steps.

```<code>        System.out.println("[2,  0,  1,  2,  3]");
        System.out.println("[2,  3,  5,  5,  4]");
        System.out.println("[8,  5, -1,  8,  7]");
        System.out.println("[3,  4,  7,  2,  4]");
        System.out.println("[2,  4,  3,  1, -1]");
</code>```

I didn't manage to solve it without running into "out of bounds" errors, and logic errors.
For example, what shall I do when the difference between any direction while "climbing" or "going down" is the same?

So that's what I have tried:

```<code> public static int prince(int[][]drm, int i, int j){
        return prince(drm, 0,0, 1);
    }

 private static int prince(int[][]drm, int i, int j, int steps)
    {
        if(i> drm.length-1 || j>drm[drm.length-1].length) // out of bounds
        {
            return -1;
        }
        if(drm[i][j] == -1) // is the current cell is "-1"
        {
            return steps;
        }
        if(i< drm.length-1)
        {
            if(drm[i+1][j] == -1) // if the neighbor below the cell is the "-1"
            {
                return steps + 1;
            }
        }
        if(j<drm[drm.length-1].length) // if the right neighbor of the cell is the "-1"
        {
            if(drm[i][j+1] == -1)
            {
                return steps + 1;
            }
        }
        if(i>0) { // if the neighbor above the cell is the "-1"
            if (drm[i - 1][j] == 1) {
                return steps + 1;
            }
        }
        if(j>0) // if the left neighbor of the cell is the "-1"
        {
            if (drm[i][j-1] == 1) {
                return steps + 1;
            }
        }
</code>```

so checking the neighbors to see if they're equal to -1 is ok. but I'm not sure how to construct the next part, that actually contains the recursive call.

I wanted to scan the array horizontally in each row, to the rightmost point, and when it gets there - to make j=0 again, go down a row (if possible) and make the number of steps as same as it would be if we would down initially instead of right.

Something amount those lines:

```<code> if(j == drm[drm.length-1].length) // if we got to the end of the row (rightmost column)
        {
            if(i < drm.length-1){ // and we can go down without going out of bounds
                int downDiff = drm[i][j] - drm[i+1][j];
                if(!(downDiff > 2) && !(downDiff < -1)){ // if the difference when going down is valid
                    i++;
                    j = 0;
                    steps -= drm.length - 2;
                } else{
                    return -1;
                }
            }
        }
        if(j<drm[drm.length-1].length) { // if we didn't get to the end of the row (not in the rightmost column)
            int rightDiff = drm[i][j] - drm[i][j+1];
            if(rightDiff > 2 || rightDiff < -1) // if right difference is not valid
            {
                return -1;
            }
            return prince(drm, i, j+1, steps+1);
        }
        return -1;
    }
}
</code>```

so if you have any ideas, or smarter algorithms/approaches to this question I will be more than glad for any comments.

Body:
I have a two-dimensional array filled with non-negative numbers.
one cell in particular is equal to -1 (for example, the bottom right corner in the array below is -1).

I have to return the minimum number of steps (starting from arr[0][0] only) to get to the -1.

The thing is:
You can think of every number in the array as a height of a rooftop.

The difference between cell values when moving in any direction is either "climbing" or "going down":

For example, moving in any direction from a cell with the value 5, to a cell with the value 3 is considered "going down", and the difference is 2.

For example, moving in any direction from a cell with the value 1, to a cell with the value 2, is considered "climbing", and the difference is -1.

If the difference between cell values while "climbing" is smaller than -1,
and the difference between cell values while " going down" is bigger than 2,
There are no legal options to move inside the array, and the recursive method will return -1.

The only exception is: if the value of the "neighbor" cell from any direction is the -1 we are searching for, we can immediately go there without having to consider the difference between the current cell and the "neighbor" cell.

If there is no valid path that starts in arr[0][0] and can find "-1" in the array, the recursive method should return -1. If there is a valid path the recursive method returns the minimum number of steps.

        System.out.println("[2,  0,  1,  2,  3]");
        System.out.println("[2,  3,  5,  5,  4]");
        System.out.println("[8,  5, -1,  8,  7]");
        System.out.println("[3,  4,  7,  2,  4]");
        System.out.println("[2,  4,  3,  1, -1]");

I didn't manage to solve it without running into "out of bounds" errors, and logic errors.
For example, what shall I do when the difference between any direction while "climbing" or "going down" is the same?

So that's what I have tried:

 public static int prince(int[][]drm, int i, int j){
        return prince(drm, 0,0, 1);
    }

 private static int prince(int[][]drm, int i, int j, int steps)
    {
        if(i> drm.length-1 || j>drm[drm.length-1].length) // out of bounds
        {
            return -1;
        }
        if(drm[i][j] == -1) // is the current cell is "-1"
        {
            return steps;
        }
        if(i< drm.length-1)
        {
            if(drm[i+1][j] == -1) // if the neighbor below the cell is the "-1"
            {
                return steps + 1;
            }
        }
        if(j<drm[drm.length-1].length) // if the right neighbor of the cell is the "-1"
        {
            if(drm[i][j+1] == -1)
            {
                return steps + 1;
            }
        }
        if(i>0) { // if the neighbor above the cell is the "-1"
            if (drm[i - 1][j] == 1) {
                return steps + 1;
            }
        }
        if(j>0) // if the left neighbor of the cell is the "-1"
        {
            if (drm[i][j-1] == 1) {
                return steps + 1;
            }
        }

so checking the neighbors to see if they're equal to -1 is ok. but I'm not sure how to construct the next part, that actually contains the recursive call.

I wanted to scan the array horizontally in each row, to the rightmost point, and when it gets there - to make j=0 again, go down a row (if possible) and make the number of steps as same as it would be if we would down initially instead of right.

Something amount those lines:

 if(j == drm[drm.length-1].length) // if we got to the end of the row (rightmost column)
        {
            if(i < drm.length-1){ // and we can go down without going out of bounds
                int downDiff = drm[i][j] - drm[i+1][j];
                if(!(downDiff > 2) && !(downDiff < -1)){ // if the difference when going down is valid
                    i++;
                    j = 0;
                    steps -= drm.length - 2;
                } else{
                    return -1;
                }
            }
        }
        if(j<drm[drm.length-1].length) { // if we didn't get to the end of the row (not in the rightmost column)
            int rightDiff = drm[i][j] - drm[i][j+1];
            if(rightDiff > 2 || rightDiff < -1) // if right difference is not valid
            {
                return -1;
            }
            return prince(drm, i, j+1, steps+1);
        }
        return -1;
    }
}

so if you have any ideas, or smarter algorithms/approaches to this question I will be more than glad for any comments.


问:
In run "@mdx-js/mdx" Uncaught (in promise) SyntaxError: Unexpected identifier 'Promise' error

import { run } from "@mdx-js/mdx";
import * as runtime from "react/jsx-runtime";

const mdxToJsx = async (value) => {
  const { default: Content } = await run(value, runtime);

  return Content
};

export default mdxToJsx;
```
<p>Here as per mdx library, I want to convert mdx to jsx but I got Uncaught (in promise) SyntaxError: Unexpected identifier 'Promise'
at new AsyncFunction ()
at run (run.js:15:1)
Kindly help me. Thanks Happy coding.</p>
<pre class="lang-js prettyprint-override"><code>import React, { Fragment, useEffect, useState } from "react";
import { run } from "@mdx-js/mdx";
import * as runtime from "react/jsx-runtime";

export default function MdxToJsx({code}) {
  const [mdxModule, setMdxModule] = useState()
  const Content = mdxModule ? mdxModule.default : Fragment

  useEffect(() => {
    (async () => {
      setMdxModule(await run(code, runtime))
    })()
  }, [code])

  return <Content />
}
</code>```

I tried this one also but got the same error.

Body:
import { run } from "@mdx-js/mdx";
import * as runtime from "react/jsx-runtime";

const mdxToJsx = async (value) => {
  const { default: Content } = await run(value, runtime);

  return Content
};

export default mdxToJsx;

Here as per mdx library, I want to convert mdx to jsx but I got Uncaught (in promise) SyntaxError: Unexpected identifier 'Promise'
at new AsyncFunction ()
at run (run.js:15:1)
Kindly help me. Thanks Happy coding.

import React, { Fragment, useEffect, useState } from "react";
import { run } from "@mdx-js/mdx";
import * as runtime from "react/jsx-runtime";

export default function MdxToJsx({code}) {
  const [mdxModule, setMdxModule] = useState()
  const Content = mdxModule ? mdxModule.default : Fragment

  useEffect(() => {
    (async () => {
      setMdxModule(await run(code, runtime))
    })()
  }, [code])

  return <Content />
}

I tried this one also but got the same error.


问:
How to exclude all uart debug traces ( security, code size, release of application )?
I'm looking for official way in Contiki-NG for exclude all debug traces from code (security, code size, release version of application).

I have used  extra definition in my Makefile
-DLOG_CONF_OUTPUT="(void)(0);" -Wno-unused-value
and code size is reduced but I should add -Wno-unused-value for avoid multiple warnings.

What can be better way to replace LOG_CONF_OUTPUT with something else ?

Regards,
Eugene


问:
Is it possible to create table of content page using puppeteer and NodeJS?
https://www.npmjs.com/package/puppeteer
I have created the pdf but i want to dynamically create table of content page based on pages in PDF.

Is it possible or this feature is in futire version of puppeteer?


问:
Git push is not working me: "Can't push refs to remote. Try running 'Pull' first to integrate your changes"
I have made the last changes I needed to finish my program and to push it to the repository, but now when I do a git push it always appears me this error.

I have already tried with git pull and git pull --rebase origin master (there is only 1 branch in my repository: the master branch), but neither this or anything is working.

What do I have to do?

Thank you.

git push error

git push error 2


问:
How to preview vuelidate errors in console.log?
I want to look at the list of errors in the vuelidate to check for what reason my data is not saved, because if I remove the validation function, everything is saved, the problem is that when I print the vuelidate error to the console, it displays undefined.

My function:

```<code>submitHandler(value){
        this.$v.form.$touch()
        console.log(this.$v.form.$errors)
        if(!this.$v.form.$error){
            //this.GET_QUESTIONNAIREFORMSTATE_TO_VUEX(value)
            localStorage.setItem('questionnaire', JSON.stringify(value))
            console.log(localStorage.getItem('questionnaire'))
            this.$router.push('/scoring')
        }
    }
</code>```

Body:
I want to look at the list of errors in the vuelidate to check for what reason my data is not saved, because if I remove the validation function, everything is saved, the problem is that when I print the vuelidate error to the console, it displays undefined.

My function:

submitHandler(value){
        this.$v.form.$touch()
        console.log(this.$v.form.$errors)
        if(!this.$v.form.$error){
            //this.GET_QUESTIONNAIREFORMSTATE_TO_VUEX(value)
            localStorage.setItem('questionnaire', JSON.stringify(value))
            console.log(localStorage.getItem('questionnaire'))
            this.$router.push('/scoring')
        }
    }


问:
How to optimize coefficients of large 2D filter mask in a non-parametric way?
I have a large M x N 2D matrix of positive coefficients (8bit unsigned) with M,N~10^3.
I want to optimize the parameters (M*N~10^6) such that my error-function (where I put the matrix in) is minimized. Boundary conditions: Neighboring parameters vary slowly/smoothly.

I have already tried to downscale the matrix in order to reduce the number of parameters and then flatten the matrix to feed it into Scipy's Minimize function. This causes memory errors quickly.

Is there a smart approch to optimize this large coefficient matrix in time ranges less than infinity without applying a low-parametric model?


问:
How can I make a JS function which redirects me to another website in an HTML document?
I'm trying to make an HTML document that has a form inside. After completing the form (which was to input the name of a website like google.com, the JS script should redirect you). the website reloaded itself. Is there a simple function that can do this?

```<code><html>
   <body>
      <p>Enter Website link in the field, then click "Submit" to submit the form:</p>
      <form id="frm1" action="">
         Website Link: <input type="text" name="webl"><br>
         <input type="button" onclick="myFunction()" value="Submit">
      </form>
      <script>
         function myFunction() {
           document.getElementById("frm1").submit();
         }
      </script>
   </body>
 </html>
</code>```

After running the script and submitting the link, the same website appeared. By the way guys, I am just getting started with JavaScript, so I could likely have made a simple mistake. Thanks.

Body:
I'm trying to make an HTML document that has a form inside. After completing the form (which was to input the name of a website like google.com, the JS script should redirect you). the website reloaded itself. Is there a simple function that can do this?

Enter Website link in the field, then click "Submit" to submit the form:

      <form id="frm1" action="">
         Website Link: <input type="text" name="webl">

         <input type="button" onclick="myFunction()" value="Submit">
      </form>

After running the script and submitting the link, the same website appeared. By the way guys, I am just getting started with JavaScript, so I could likely have made a simple mistake. Thanks.


问:
Search specific attribute in all entities FetchXML Builder
This question might be silly/not possible. But I am trying to search in XMLBuilder where a specific attribute exists.

For example I have an attribute: mmm_attribute, but I am not sure in what entity it exists. Can I search and find it in XMLBuilder?

Thanks!


问:
Please make sure all XML elements are closed properly.
 XML error message: The reference to entity "l" must end with the ';' delimiter
```<code>\<!-- Google Tag Manager --\>

\<script\>(function(w,d,s,l,i){w\[l\]=w\[l\]||\[\];w\[l\].push({'gtm.start':

new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)\[0\],

j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=

'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);

})(window,document,'script','dataLayer','GTM-T5T7D7R');\</script\>

\<!-- End Google Tag Manager --\>
</code>```

i do not know how to resolve the error,this is google tag manager code to install on blogger

Title: Please make sure all XML elements are closed properly. <br/> XML error message: The reference to entity "l" must end with the ';' delimiter


问:
Wildlfy server slow issue
Suddenly Wildfly server is getting slow. Buffering will be done only if the user calls the URL for the DMS application. Sometimes users call the URL, the front page comes up , then clicking on login with user id and password, it takes a long time to enter the DMS.Then we installed and configured a new wildfly and it work fine 1-2 month and now the same problem started. When wildfly server is getting slow then we checked in DB where every time the attacehd insert query goes to sleeping state,the query is given below.
query:

Please give me a proper solution.

Title: Wildlfy server slow issue


问:
How to increase maximum upload filesize for uploading vidoes using php.ini file in VPS server ubuntu
I built an education website and it provides courses with large videos. And I built a videos uploader. But I Can not even upload a 4-mins videos.

I increased the following three parameters:

upload_max_filesize = 50G

memory_limit = -1

post_max_size = 100G

This is my PHP.INI FILE:

```<code>;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
; http://php.net/file-uploads
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
upload_tmp_dir = /home/programming-ocean/tmp

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 50G

; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20

</code>```

Body:
I built an education website and it provides courses with large videos. And I built a videos uploader. But I Can not even upload a 4-mins videos.

I increased the following three parameters:

upload_max_filesize = 50G

memory_limit = -1

post_max_size = 100G

This is my PHP.INI FILE:

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
; http://php.net/file-uploads
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
upload_tmp_dir = /home/programming-ocean/tmp

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 50G

; Maximum number of files that can be uploaded via a single request
max_file_uploads = 20


问:
C# .NET 7 Blazor WASM App and Server, can't change listening port 5000
I have created my first Blazor application.
The application has an API(Server), Client and a Shared Class Library.

When I publish the app to a local folder and then copy it to IIS it is working but the listening port for the API stays on http://localhost:5000. I am running the app on https://example.com so it won't be able to access http://localhost:5000 because of the mix in http and https.

Where can I change that port so that it can work on https://example.com?


问:
Django throws AttributeError: 'str' object has no attribute '_meta' when trying to migrate
I'm working on a small project on my own, and I have some problems with the migrations. I managed to migrate everything well so far, but I removed a field from my models.py and now there are problems somehow.

I had a field called tags that was referencing to a model from taggit, but I decided to remove this field and do it on my own, so the field tags still exists but its not referencing to the tagablemanager of taggit anymore, but on my own tag model now

Nevermind everytime I excecute python manage.py migrate to make the database, this error is thrown:

```<code>Applying inventory_app.0014_item_tags...Traceback (most recent call last):
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory/manage.py", line 22, in <module>
    main()
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/core/management/base.py", line 89, in wrapped
    res = handle_func(*args, **kwargs)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 244, in handle
    post_migrate_state = executor.migrate(
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/db/migrations/executor.py", line 117, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/db/migrations/executor.py", line 227, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/db/migrations/migration.py", line 126, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/db/migrations/operations/fields.py", line 104, in database_forwards
    schema_editor.add_field(
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/db/backends/sqlite3/schema.py", line 328, in add_field
    if field.many_to_many and field.remote_field.through._meta.auto_created:
AttributeError: 'str' object has no attribute '_meta'
</code>```

It is referencing to a very old migration file, since I have about 30 migrations so far, and this is from migration 14.

The 14th migration file looks like this:

```<code># Generated by Django 4.1 on 2022-09-16 07:34

from django.db import migrations
import taggit.managers

class Migration(migrations.Migration):

    dependencies = [
        ('inventory_app', '0013_item_gelber_kleber'),
    ]

    operations = [
        migrations.AddField(
            model_name='item',
            name='tags',
            field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'),
        ),
    ]
</code>```

And this is my model now:

```<code>class Item(models.Model):

    # Additional Attributes
    name = models.CharField(max_length=150, default="", blank=False, verbose_name=_('Name'))

    tags = models.ManyToManyField("Tag", blank=True)

    def __str__(self):
        return self.name
</code>```

Did anyone of you every had a similar problem?

Body:
I'm working on a small project on my own, and I have some problems with the migrations. I managed to migrate everything well so far, but I removed a field from my models.py and now there are problems somehow.

I had a field called tags that was referencing to a model from taggit, but I decided to remove this field and do it on my own, so the field tags still exists but its not referencing to the tagablemanager of taggit anymore, but on my own tag model now

Nevermind everytime I excecute python manage.py migrate to make the database, this error is thrown:

Applying inventory_app.0014_item_tags...Traceback (most recent call last):
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory/manage.py", line 22, in <module>
    main()
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory/manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/core/management/base.py", line 89, in wrapped
    res = handle_func(*args, **kwargs)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 244, in handle
    post_migrate_state = executor.migrate(
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/db/migrations/executor.py", line 117, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/db/migrations/executor.py", line 227, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/db/migrations/migration.py", line 126, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/db/migrations/operations/fields.py", line 104, in database_forwards
    schema_editor.add_field(
  File "/Users/ilianhaesler/Documents/Work/inventory/inventory-env/lib/python3.10/site-packages/django/db/backends/sqlite3/schema.py", line 328, in add_field
    if field.many_to_many and field.remote_field.through._meta.auto_created:
AttributeError: 'str' object has no attribute '_meta'

It is referencing to a very old migration file, since I have about 30 migrations so far, and this is from migration 14.

The 14th migration file looks like this:

# Generated by Django 4.1 on 2022-09-16 07:34

from django.db import migrations
import taggit.managers

class Migration(migrations.Migration):

    dependencies = [
        ('inventory_app', '0013_item_gelber_kleber'),
    ]

    operations = [
        migrations.AddField(
            model_name='item',
            name='tags',
            field=taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags'),
        ),
    ]

And this is my model now:

class Item(models.Model):

    # Additional Attributes
    name = models.CharField(max_length=150, default="", blank=False, verbose_name=_('Name'))

    tags = models.ManyToManyField("Tag", blank=True)

    def __str__(self):
        return self.name

Did anyone of you every had a similar problem?