问:
Implementing smack in android , after obfuscation getting error at runtime from smack library
Obfuscation tags used for Smack lib:

```<code>-dontwarn org.xmlpull.v1.**

-keep class org.jivesoftware.** { *; }
-keep class org.xmlpull.** { *; }
-keep class org.bouncycastle.jcajce.provider.** { *; }

-keep class org.jivesoftware.smack.** { *; }
-keep class org.jivesoftware.smackx.** { *; }
-keepattributes Signature

</code>```

At runtime getting this error

```<code>
2023-01-12 12:28:56.673 32664-377/com.panasonic.promeet.debug E/AndroidRuntime: FATAL EXCEPTION: Thread-17
    Process: com.panasonic.promeet.debug, PID: 32664
    java.util.ServiceConfigurationError: z7.d: Provider a8.b could not be instantiated
        at java.util.ServiceLoader.fail(ServiceLoader.java:233)
        at java.util.ServiceLoader.-$$Nest$smfail(Unknown Source:0)
        at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:392)
        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:416)
        at java.util.ServiceLoader$1.next(ServiceLoader.java:494)
        at z7.a.a(SmackXmlParser.java:44)
        at z7.a.b(SmackXmlParser.java:65)
        at v7.a0.h(PacketParserUtils.java:80)
        at n6.c0.d(SmackInitialization.java:159)
        at n6.c0.c(SmackInitialization.java:154)
        at n6.c0.<clinit>(SmackInitialization.java:103)
        at n6.x.b(Smack.java:38)
        at n6.x.a(Smack.java:64)
        at n6.p.<clinit>(ConnectionConfiguration.java:116)
        at t7.l.z(XMPPTCPConnectionConfiguration.java:64)
        at c4.e.n(XMPPConfigManager.java:189)
        at c4.e.q(XMPPConfigManager.java:292)
        at com.panasonic.promeet.utils.ProMeetApplication$d.run(ProMeetApplication.java:296)
        at java.lang.Thread.run(Thread.java:1012)
     Caused by: java.lang.ExceptionInInitializerError
        at java.lang.Class.newInstance(Native Method)
        at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:388)
        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:416)
        at java.util.ServiceLoader$1.next(ServiceLoader.java:494)
        at z7.a.a(SmackXmlParser.java:44)
        at z7.a.b(SmackXmlParser.java:65)
        at v7.a0.h(PacketParserUtils.java:80)
        at n6.c0.d(SmackInitialization.java:159)
        at n6.c0.c(SmackInitialization.java:154)
        at n6.c0.<clinit>(SmackInitialization.java:103)
        at n6.x.b(Smack.java:38)
        at n6.x.a(Smack.java:64)
        at n6.p.<clinit>(ConnectionConfiguration.java:116)
        at t7.l.z(XMPPTCPConnectionConfiguration.java:64)
        at c4.e.n(XMPPConfigManager.java:189)
        at c4.e.q(XMPPConfigManager.java:292)
        at com.panasonic.promeet.utils.ProMeetApplication$d.run(ProMeetApplication.java:296)
        at java.lang.Thread.run(Thread.java:1012)
     Caused by: org.xmlpull.v1.XmlPullParserException: unsupported feature: http://xmlpull.org/v1/doc/features.html#xml-roundtrip (position:START_DOCUMENT null@1:1)
        at com.android.org.kxml2.io.KXmlParser.setFeature(KXmlParser.java:2102)

</code>```

In this line :
For Initializing Xmpp Tcp Connection

```<code>
    XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder();

</code>```

Internally having issue in this line in smack library:

```<code>com.android.org.kxml2.io.KXmlParser.setFeature(KXmlParser.java:2102)
</code>```

This exception only comes in obfuscated code otherwise its working absolutely fine .

Body:
Obfuscation tags used for Smack lib:

-dontwarn org.xmlpull.v1.**

-keep class org.jivesoftware.** { *; }
-keep class org.xmlpull.** { *; }
-keep class org.bouncycastle.jcajce.provider.** { *; }

-keep class org.jivesoftware.smack.** { *; }
-keep class org.jivesoftware.smackx.** { *; }
-keepattributes Signature

At runtime getting this error

2023-01-12 12:28:56.673 32664-377/com.panasonic.promeet.debug E/AndroidRuntime: FATAL EXCEPTION: Thread-17
    Process: com.panasonic.promeet.debug, PID: 32664
    java.util.ServiceConfigurationError: z7.d: Provider a8.b could not be instantiated
        at java.util.ServiceLoader.fail(ServiceLoader.java:233)
        at java.util.ServiceLoader.-$$Nest$smfail(Unknown Source:0)
        at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:392)
        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:416)
        at java.util.ServiceLoader$1.next(ServiceLoader.java:494)
        at z7.a.a(SmackXmlParser.java:44)
        at z7.a.b(SmackXmlParser.java:65)
        at v7.a0.h(PacketParserUtils.java:80)
        at n6.c0.d(SmackInitialization.java:159)
        at n6.c0.c(SmackInitialization.java:154)
        at n6.c0.<clinit>(SmackInitialization.java:103)
        at n6.x.b(Smack.java:38)
        at n6.x.a(Smack.java:64)
        at n6.p.<clinit>(ConnectionConfiguration.java:116)
        at t7.l.z(XMPPTCPConnectionConfiguration.java:64)
        at c4.e.n(XMPPConfigManager.java:189)
        at c4.e.q(XMPPConfigManager.java:292)
        at com.panasonic.promeet.utils.ProMeetApplication$d.run(ProMeetApplication.java:296)
        at java.lang.Thread.run(Thread.java:1012)
     Caused by: java.lang.ExceptionInInitializerError
        at java.lang.Class.newInstance(Native Method)
        at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:388)
        at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:416)
        at java.util.ServiceLoader$1.next(ServiceLoader.java:494)
        at z7.a.a(SmackXmlParser.java:44)
        at z7.a.b(SmackXmlParser.java:65)
        at v7.a0.h(PacketParserUtils.java:80)
        at n6.c0.d(SmackInitialization.java:159)
        at n6.c0.c(SmackInitialization.java:154)
        at n6.c0.<clinit>(SmackInitialization.java:103)
        at n6.x.b(Smack.java:38)
        at n6.x.a(Smack.java:64)
        at n6.p.<clinit>(ConnectionConfiguration.java:116)
        at t7.l.z(XMPPTCPConnectionConfiguration.java:64)
        at c4.e.n(XMPPConfigManager.java:189)
        at c4.e.q(XMPPConfigManager.java:292)
        at com.panasonic.promeet.utils.ProMeetApplication$d.run(ProMeetApplication.java:296)
        at java.lang.Thread.run(Thread.java:1012)
     Caused by: org.xmlpull.v1.XmlPullParserException: unsupported feature: http://xmlpull.org/v1/doc/features.html#xml-roundtrip (position:START_DOCUMENT null@1:1)
        at com.android.org.kxml2.io.KXmlParser.setFeature(KXmlParser.java:2102)

In this line :
For Initializing Xmpp Tcp Connection

    XMPPTCPConnectionConfiguration.Builder builder = XMPPTCPConnectionConfiguration.builder();

Internally having issue in this line in smack library:

com.android.org.kxml2.io.KXmlParser.setFeature(KXmlParser.java:2102)

This exception only comes in obfuscated code otherwise its working absolutely fine .


来源: stackexchange

问:
attempt to perform a delete and a move from the same index path in tableview
In my application there is some functionality.i want to create logic like Row move to section.means movable row is removed to section and that movable row is conver to section.so first i will try to delete that row in section than after create new section..than app crash in mac-catalyst

2023-01-12 12:41:43.227580+0530 ReorderTableView[4186:142282]
[General] attempt to perform a delete and a move from the same index
path (<NSIndexPath: 0xd380cd7e557f0a2f> {length = 2, path = 0 - 1})

```<code>func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) {
        // tblView.beginUpdates()
        print("Source" , sourceIndexPath)
        print("Destination",destinationIndexPath)
        arrSection[sourceIndexPath.section].group?.remove(at: sourceIndexPath.row - 1)
        self.tblView.beginUpdates()
        self.tblView.deleteRows(at: [sourceIndexPath], with: .fade)
        self.tblView.endUpdates()
    }
</code>```

ContentLicense: CC BY-SA 4.0

Body:
In my application there is some functionality.i want to create logic like Row move to section.means movable row is removed to section and that movable row is conver to section.so first i will try to delete that row in section than after create new section..than app crash in mac-catalyst

2023-01-12 12:41:43.227580+0530 ReorderTableView[4186:142282]
[General] attempt to perform a delete and a move from the same index
path (<NSIndexPath: 0xd380cd7e557f0a2f> {length = 2, path = 0 - 1})

func tableView(_ tableView: UITableView, moveRowAt sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath) {
        // tblView.beginUpdates()
        print("Source" , sourceIndexPath)
        print("Destination",destinationIndexPath)
        arrSection[sourceIndexPath.section].group?.remove(at: sourceIndexPath.row - 1)
        self.tblView.beginUpdates()
        self.tblView.deleteRows(at: [sourceIndexPath], with: .fade)
        self.tblView.endUpdates()
    }


问:
ASP.NET login form using different tables
I just want an ASP.NET login form using different tables so if anyone can help me. Here  is what I am doing.</p>
```<code>try
        {
            SqlConnection con = new SqlConnection(strcon);
            if (con.State == ConnectionState.Closed)
            {
                con.Open();

            }
            SqlCommand cmd = new SqlCommand("SELECT Users.Email, Users.Password ,Admin.Email, Admin.Password FROM Users,Admin WHERE Email ='" + Email.Text.Trim() + "' AND Password='" + password.Text.Trim() + "'", con);
            SqlDataReader dr = cmd.ExecuteReader();
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    Response.Write("<script>alert('Successful login');</script>");
                    Session["status"] = dr["Fullname"].ToString();
                }

            }
            if (DropDownList1.SelectedIndex == 0)
            {
                Response.Redirect("Home.aspx");
            }
            else if (DropDownList1.SelectedIndex == 1)
            {
                Response.Redirect("Users.aspx");
            }
            else
            {
                Response.Write("<script>alert('Invalid credentials');</script>");
            }
        }
</code>```

Body:
I just want an ASP.NET login form using different tables so if anyone can help me. Here  is what I am doing.

try
        {
            SqlConnection con = new SqlConnection(strcon);
            if (con.State == ConnectionState.Closed)
            {
                con.Open();

            }
            SqlCommand cmd = new SqlCommand("SELECT Users.Email, Users.Password ,Admin.Email, Admin.Password FROM Users,Admin WHERE Email ='" + Email.Text.Trim() + "' AND Password='" + password.Text.Trim() + "'", con);
            SqlDataReader dr = cmd.ExecuteReader();
            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    Response.Write("");
                    Session["status"] = dr["Fullname"].ToString();
                }

            }
            if (DropDownList1.SelectedIndex == 0)
            {
                Response.Redirect("Home.aspx");
            }
            else if (DropDownList1.SelectedIndex == 1)
            {
                Response.Redirect("Users.aspx");
            }
            else
            {
                Response.Write("");
            }
        }


问:
How can I abbreviate the relative address using sshfs-win to map network drive?
I tried to connect Windows-10(Client) with Linux(Host).

I successfully mapped network drive with SSHFS-Win(which is the only solution because of my company security), but I got quite long address.

(FolderName)(\\sshfs\(user id)@(ip address)\..\..\mnt\(hdd id)

I want to simplify the address of mapped network drive while connecting with sshfs-win.

Example : (FolderName)(\\sshfs\(user id)@(ip address)\(Random Name))

So I tried alias in Windows as well as Ubuntu, but it didn't work well.

In Windows, run powershell as administrator

```<code>set-alias MyFolder ..\..\mnt\(hdd id)
</code>```

In Ubuntu, write on ~/.bashrc (in my account)

```<code>alias MyFolder='..\..\mnt\(hdd id)'
</code>```

But both ways didn't work when typed as below.

```<code>net use Y: \\sshfs\(user id)@(ip address)\MyFolder
</code>```

How can I simplify the address of mapped network?

Old command :
net use Y: \\sshfs\(user id)@(ip address)\..\..\mnt\(hdd id)

Host : Linux(ubuntu)

Client : Windows-10

Body:
I tried to connect Windows-10(Client) with Linux(Host).

I successfully mapped network drive with SSHFS-Win(which is the only solution because of my company security), but I got quite long address.

(FolderName)(\\sshfs\(user id)@(ip address)\..\..\mnt\(hdd id)

I want to simplify the address of mapped network drive while connecting with sshfs-win.

Example : (FolderName)(\\sshfs\(user id)@(ip address)\(Random Name))

So I tried alias in Windows as well as Ubuntu, but it didn't work well.

In Windows, run powershell as administrator

set-alias MyFolder ..\..\mnt\(hdd id)

In Ubuntu, write on ~/.bashrc (in my account)

alias MyFolder='..\..\mnt\(hdd id)'

But both ways didn't work when typed as below.

net use Y: \\sshfs\(user id)@(ip address)\MyFolder

How can I simplify the address of mapped network?

Old command :
net use Y: \\sshfs\(user id)@(ip address)\..\..\mnt\(hdd id)

Host : Linux(ubuntu)

Client : Windows-10


问:
Get row number of row to be inserted in Postgres trigger that gives no collisions when inserting multiple rows
Given the following (simplified) schema:

CREATE TABLE period (
    id          UUID NOT NULL DEFAULT uuid_generate_v4(),
    name        TEXT
);

CREATE TABLE course (
    id          UUID NOT NULL DEFAULT uuid_generate_v4(),
    name        TEXT
);

CREATE TABLE registration (
    id          UUID NOT NULL DEFAULT uuid_generate_v4(),
    period_id   UUID NOT NULL REFERENCES period(id),
    course_id   UUID NOT NULL REFERENCES course(id),
    inserted_at timestamptz NOT NULL DEFAULT now()
);
```
<p>I now want to add a new column <code>client_ref</code>, which identifies a <code>registration</code> unique within a period, but consists of only a 4-character string. I want to use pg_hashids - which requires a unique integer input - to base the column value on.</p>
<p>I was thinking of setting up a trigger on the <code>registration</code> table that runs on inserting a new row. I came up with the following:</p>
<pre class="lang-sql prettyprint-override"><code>CREATE OR REPLACE FUNCTION set_client_ref()
 RETURNS trigger
 LANGUAGE plpgsql
AS $function$
DECLARE
    next_row_number integer;
BEGIN
        WITH rank AS (
            SELECT
                period.id AS period_id,
                row_number() OVER (PARTITION BY period.id ORDER BY registration.inserted_at)
            FROM
                registration
                JOIN period ON registration.period_id = period.id ORDER BY
                    period.id,
                    row_number
)
SELECT
    COALESCE(rank.row_number, 0) + 1 INTO next_row_number
FROM
    period
    LEFT JOIN rank ON (rank.period_id = period.id)
WHERE
    period.id = NEW.period_id
ORDER BY
    rank.row_number DESC
LIMIT 1;
    NEW.client_ref = id_encode (next_row_number);
    RETURN NEW;
END
$function$
;
</code>```

The trigger is set-up like: CREATE TRIGGER set_client_ref BEFORE INSERT ON registration FOR EACH ROW EXECUTE FUNCTION set_client_ref();

This works as expected when inserting a single row to registration, but if I insert multiple within one statement, they end up having the same client_ref. I can reason about why this happens (the rows don't know about each other's existence, so they assume they're all just next in line when retrieving their row_order), but I am not sure what a way is to prevent this. I tried setting up the trigger as an AFTER trigger, but it resulted in the same (duplicated) behaviour.

What would be a better way to get the lowest possible, unique integer for the rows to be inserted (to base the hash function on) that also works when inserting multiple rows?

Body:
Given the following (simplified) schema:

CREATE TABLE period (
    id          UUID NOT NULL DEFAULT uuid_generate_v4(),
    name        TEXT
);

CREATE TABLE course (
    id          UUID NOT NULL DEFAULT uuid_generate_v4(),
    name        TEXT
);

CREATE TABLE registration (
    id          UUID NOT NULL DEFAULT uuid_generate_v4(),
    period_id   UUID NOT NULL REFERENCES period(id),
    course_id   UUID NOT NULL REFERENCES course(id),
    inserted_at timestamptz NOT NULL DEFAULT now()
);

I now want to add a new column client_ref, which identifies a registration unique within a period, but consists of only a 4-character string. I want to use pg_hashids - which requires a unique integer input - to base the column value on.

I was thinking of setting up a trigger on the registration table that runs on inserting a new row. I came up with the following:

CREATE OR REPLACE FUNCTION set_client_ref()
 RETURNS trigger
 LANGUAGE plpgsql
AS $function$
DECLARE
    next_row_number integer;
BEGIN
        WITH rank AS (
            SELECT
                period.id AS period_id,
                row_number() OVER (PARTITION BY period.id ORDER BY registration.inserted_at)
            FROM
                registration
                JOIN period ON registration.period_id = period.id ORDER BY
                    period.id,
                    row_number
)
SELECT
    COALESCE(rank.row_number, 0) + 1 INTO next_row_number
FROM
    period
    LEFT JOIN rank ON (rank.period_id = period.id)
WHERE
    period.id = NEW.period_id
ORDER BY
    rank.row_number DESC
LIMIT 1;
    NEW.client_ref = id_encode (next_row_number);
    RETURN NEW;
END
$function$
;

The trigger is set-up like: CREATE TRIGGER set_client_ref BEFORE INSERT ON registration FOR EACH ROW EXECUTE FUNCTION set_client_ref();

This works as expected when inserting a single row to registration, but if I insert multiple within one statement, they end up having the same client_ref. I can reason about why this happens (the rows don't know about each other's existence, so they assume they're all just next in line when retrieving their row_order), but I am not sure what a way is to prevent this. I tried setting up the trigger as an AFTER trigger, but it resulted in the same (duplicated) behaviour.

What would be a better way to get the lowest possible, unique integer for the rows to be inserted (to base the hash function on) that also works when inserting multiple rows?


问:
VBA Search and Replace is not working but no error is displayed
I am using Excel to insert Data into an Word Document. Until now I used bookmarks which worked perfectly fine.
But right now I am trying to do a search and replace as seen in the code below. But nothing happens, nothing is replaced and I recieve no error....

```<code>Set Word = GetObject(, "Word.Application")
Set WordDoc = Word.documents.Add(pfad)
With WordDoc.Content.Find
.Text = "replace"
.Replacement.Text = "insert"
.Wrap = wdFindContinue
.Execute Replace:=wdReplaceAll
End With
</code>```

What am I doing wrong that I don't even get an error?

I would appreciate any help :)

Summary:

all Words “replace” should be replaced with “insert”.

But nothing happens, no error nothing. The data I insert via bookmarks is however inserted without a problem

Body:
I am using Excel to insert Data into an Word Document. Until now I used bookmarks which worked perfectly fine.
But right now I am trying to do a search and replace as seen in the code below. But nothing happens, nothing is replaced and I recieve no error....

Set Word = GetObject(, "Word.Application")
Set WordDoc = Word.documents.Add(pfad)
With WordDoc.Content.Find
.Text = "replace"
.Replacement.Text = "insert"
.Wrap = wdFindContinue
.Execute Replace:=wdReplaceAll
End With

What am I doing wrong that I don't even get an error?

I would appreciate any help :)

Summary:

all Words “replace” should be replaced with “insert”.

But nothing happens, no error nothing. The data I insert via bookmarks is however inserted without a problem


问:
How to set a sane minimum fetch interval value for Remote Config without hitting limits?
Suppose I want to set a string field regionName to store a name of an alternative region when the current region goes down. I have around 5 client-side apps and around 10k users.

For a value so crucial like the region, what is the smallest value I could use without hitting the limits and without affecting these apps?


问:
Python-docx space_after attribute defaults to 'Auto' and doesn't take a value assigned
Python-docx space_after attribute defaults to 'Auto' and doesn't take a value assigned (paragraphs are in a header table)

```<code>para.paragraph_format.space_before = Pt(6)
para.paragraph_format.space_after = Pt(0)
</code>```

Screenshot from the document opened after the code run

PS - There are files where both work fine and space_after just doesn't in some other files. What am I missing?

Body:
Python-docx space_after attribute defaults to 'Auto' and doesn't take a value assigned (paragraphs are in a header table)

para.paragraph_format.space_before = Pt(6)
para.paragraph_format.space_after = Pt(0)

Screenshot from the document opened after the code run

PS - There are files where both work fine and space_after just doesn't in some other files. What am I missing?


问:
RTK Query optimistic update returning empty Proxy object
I have two api slices, one is userApiSlice and one is teamsApiSlice. In userApiSlice I'm trying to change a user's team and using optimistic update for better ux in case of slow network or anything. here is my userApiSlice where I'm trying to make optimistic update:

```<code>  changeUsersTeam: builder.mutation({
  query: (data) => ({
    url: `/user/change-team/${data.id}`,
    method: "put",
    body: data.body,
  }),
  invalidatesTags: ["Team"],
  async onQueryStarted(data, { dispatch, queryFulfilled }) {
    const patchResult = dispatch(
      teamsApiSlice.util.updateQueryData(
        // @ts-ignore
        "getTeamById",
        data.id.toString(),
        (draft) => {
          console.log("test from api slice", draft);
          if (data.body.team !== "substitudes") {
            draft.subMembers = [];
            draft.activeMembers.push(draft.studentId);
          } else {
            draft.activeMembers = [];
            draft.subMembers.push(draft.studentId);
          }
        }
      )
    );
    try {
      await queryFulfilled;
    } catch {
      patchResult.undo();
    }
  },
}),
</code>```

but in console log I'm getting this empty proxy object:

```<code>Proxy: { <target>:null,<handler>:null }
</code>```

so the optimistic update is not working

Body:
I have two api slices, one is userApiSlice and one is teamsApiSlice. In userApiSlice I'm trying to change a user's team and using optimistic update for better ux in case of slow network or anything. here is my userApiSlice where I'm trying to make optimistic update:

  changeUsersTeam: builder.mutation({
  query: (data) => ({
    url: `/user/change-team/${data.id}`,
    method: "put",
    body: data.body,
  }),
  invalidatesTags: ["Team"],
  async onQueryStarted(data, { dispatch, queryFulfilled }) {
    const patchResult = dispatch(
      teamsApiSlice.util.updateQueryData(
        // @ts-ignore
        "getTeamById",
        data.id.toString(),
        (draft) => {
          console.log("test from api slice", draft);
          if (data.body.team !== "substitudes") {
            draft.subMembers = [];
            draft.activeMembers.push(draft.studentId);
          } else {
            draft.activeMembers = [];
            draft.subMembers.push(draft.studentId);
          }
        }
      )
    );
    try {
      await queryFulfilled;
    } catch {
      patchResult.undo();
    }
  },
}),

but in console log I'm getting this empty proxy object:

Proxy: { <target>:null,<handler>:null }

so the optimistic update is not working


问:
QWebEngineView issue after page refresh
The problem is solve when i switch the useragent,but somehow it came back when i refresh the page or logout from whatsapp.I have alr implement a useragent printer to check if the useragent is reset back or not,but it isn't.How do i solve this?

code:

```<code>import sys
from PySide6.QtCore import QUrl
from PySide6.QtWidgets import *
from PySide6.QtWebEngineWidgets import QWebEngineView

class Widgets(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        self.setWindowTitle("Simple Web Browser")
        self.widget = QWidget(self)

        self.webview = QWebEngineView()
        self.webview.page().profile().setHttpUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5414.75 Safari/537.36")
        self.webview.load(QUrl("https://web.whatsapp.com/"))

        self.check_button = QPushButton("Refesh")
        self.check_button.clicked.connect(self.button_clicked)

        self.toplayout = QHBoxLayout()
        self.toplayout.addWidget(self.check_button)

        self.layout = QVBoxLayout()
        self.layout.addLayout(self.toplayout)
        self.layout.addWidget(self.webview)

        self.widget.setLayout(self.layout)
        self.setCentralWidget(self.widget)

    def button_clicked(self):
        print(self.webview.page().profile().httpUserAgent()+"\n")

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = Widgets()
    window.show()
    sys.exit(app.exec())```

I hope that the whatsapp view can still be loaded even if i refresh the page or log out
```

Title: QWebEngineView issue after page refresh

Body:
The problem is solve when i switch the useragent,but somehow it came back when i refresh the page or logout from whatsapp.I have alr implement a useragent printer to check if the useragent is reset back or not,but it isn't.How do i solve this?

code:

import sys
from PySide6.QtCore import QUrl
from PySide6.QtWidgets import *
from PySide6.QtWebEngineWidgets import QWebEngineView

class Widgets(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        self.setWindowTitle("Simple Web Browser")
        self.widget = QWidget(self)

        self.webview = QWebEngineView()
        self.webview.page().profile().setHttpUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5414.75 Safari/537.36")
        self.webview.load(QUrl("https://web.whatsapp.com/"))

        self.check_button = QPushButton("Refesh")
        self.check_button.clicked.connect(self.button_clicked)

        self.toplayout = QHBoxLayout()
        self.toplayout.addWidget(self.check_button)

        self.layout = QVBoxLayout()
        self.layout.addLayout(self.toplayout)
        self.layout.addWidget(self.webview)

        self.widget.setLayout(self.layout)
        self.setCentralWidget(self.widget)

    def button_clicked(self):
        print(self.webview.page().profile().httpUserAgent()+"\n")

if __name__ == "__main__":
    app = QApplication(sys.argv)
    window = Widgets()
    window.show()
    sys.exit(app.exec())```

I hope that the whatsapp view can still be loaded even if i refresh the page or log out


问:
how to create OPA contraints and templates for setting a warning message to the client if there is some label present
I would like to know how to create a OPA constraints and templates for having a warning message to the client for kubernetes label present in the kind: helmrelease.

example:

```<code>kustomize.toolkit.fluxcd.io/reconcile: disabled
</code>```

I have tried which is similar to required Lable's but it didn't work.

Body:
I would like to know how to create a OPA constraints and templates for having a warning message to the client for kubernetes label present in the kind: helmrelease.

example:

kustomize.toolkit.fluxcd.io/reconcile: disabled

I have tried which is similar to required Lable's but it didn't work.


问:
How to collide AR objects with real world?
I am using ARCore Android SDK with Kotlin. I'd like to place an object and let the gravitation do its work. So basically if I place something in the air I want them to fall to the ground. I am working with a GLSurfaceView since Sceneform SDK is deprecated. Do you have any solution to make it happen? I imported also the library called 'jbullet' but couldn't make it do what I want.

With 'jbullet' I could only make RigidBody elements which will fall infinitely because they can't collide with the real world.


问:
UI only partially updates when state is changed
Working on a "file explorer" system where the user can browse through directories and select pictures to add to a collection.

The directory system is a map. The current directory (a key in the map) is stored in a UiState object, and the screen shows the list of images belonging to that directory (that key's values). To change the directory, the state is updated, changing currentDirectory to the key of the new directory. In theory, this change causes the list to recompose, now displaying the images in the new directory.

When the directory is changed, the display recomposes into a list of the images in the new directory. The names of the images are all correct.

THE PROBLEM: If there were x images in the previous directory, the first x images of the new directory have the names they are supposed to have, but when you click on them they give you the image of their counterpart in the previous directory, and the checkbox indicating their selection status will have the same value as that of their counterpart.

EXAMPLE: Directory 1 has a picture of a cat. Directory 2 has a picture of an apple and a picture of an orange. When you change directories from Directory 1 to Directory 2, the apple picture will read "apple", but when you click on it it will show a picture of a cat. If the cat picture's checkbox is checked, the apple picture's will be as well. The orange picture will work properly.

Why does the name update, but the checkbox and button do not? The NamedImage is half updating and half being reused?

```<code>//gets the current directory and finds its list of images
@Composable
fun ExplorerScreen(viewModel: ExplorerViewModel) {
    var directory = viewModel.uiState.collectAsState().value.currentDirectory
    ExplorerNamedImageList(MapOfDirectoriesToListsOfImages[directory])
}

//displays namedImages in that list
@Composable
fun ExplorerNamedImageList(namedImages: MutableList<namedImage>) {
    Column() {
        for (namedImage in namedImages) {
            ExplorerNamedImage(namedImage)
        }
    }
}

//displays and manages clicks on each namedImage
@Composable
fun ExplorerNamedImage(namedImage: NamedImage) {
    var checked by remember { mutableStateOf(isImageSelected(namedImage)) }
    Button(
        onClick = {
           showImage(namedImage.bitmap)
           //^THIS SHOWS THE WRONG IMAGE
        }) {
           Text(namedImage.name)
           //^THIS SHOWS THE CORRECT NAME
           Checkbox(checked = checked ...) {...}
           //^THIS HAS THE VALUE OF THE WRONG IMAGE
        }
}

//code that changes the current directory (a function of ExplorerViewModel)
fun changeDirectory(newDirectory: String) {
    _uiState.update { currentState ->
        currentState.copy(currentDirectory = newDirectory)
    }
}
</code>```

Body:
Working on a "file explorer" system where the user can browse through directories and select pictures to add to a collection.

The directory system is a map. The current directory (a key in the map) is stored in a UiState object, and the screen shows the list of images belonging to that directory (that key's values). To change the directory, the state is updated, changing currentDirectory to the key of the new directory. In theory, this change causes the list to recompose, now displaying the images in the new directory.

When the directory is changed, the display recomposes into a list of the images in the new directory. The names of the images are all correct.

THE PROBLEM: If there were x images in the previous directory, the first x images of the new directory have the names they are supposed to have, but when you click on them they give you the image of their counterpart in the previous directory, and the checkbox indicating their selection status will have the same value as that of their counterpart.

EXAMPLE: Directory 1 has a picture of a cat. Directory 2 has a picture of an apple and a picture of an orange. When you change directories from Directory 1 to Directory 2, the apple picture will read "apple", but when you click on it it will show a picture of a cat. If the cat picture's checkbox is checked, the apple picture's will be as well. The orange picture will work properly.

Why does the name update, but the checkbox and button do not? The NamedImage is half updating and half being reused?

//gets the current directory and finds its list of images
@Composable
fun ExplorerScreen(viewModel: ExplorerViewModel) {
    var directory = viewModel.uiState.collectAsState().value.currentDirectory
    ExplorerNamedImageList(MapOfDirectoriesToListsOfImages[directory])
}

//displays namedImages in that list
@Composable
fun ExplorerNamedImageList(namedImages: MutableList<namedImage>) {
    Column() {
        for (namedImage in namedImages) {
            ExplorerNamedImage(namedImage)
        }
    }
}

//displays and manages clicks on each namedImage
@Composable
fun ExplorerNamedImage(namedImage: NamedImage) {
    var checked by remember { mutableStateOf(isImageSelected(namedImage)) }
    Button(
        onClick = {
           showImage(namedImage.bitmap)
           //^THIS SHOWS THE WRONG IMAGE
        }) {
           Text(namedImage.name)
           //^THIS SHOWS THE CORRECT NAME
           Checkbox(checked = checked ...) {...}
           //^THIS HAS THE VALUE OF THE WRONG IMAGE
        }
}

//code that changes the current directory (a function of ExplorerViewModel)
fun changeDirectory(newDirectory: String) {
    _uiState.update { currentState ->
        currentState.copy(currentDirectory = newDirectory)
    }
}


问:
How to setup FCM for secondary Project (Multiproject setup) in iOS App
I want to setup a different firebase on the basis of user's workspace login. Suppose user wants to login to X workspace then on the basis of it we will setup the FCM or Firebase associated to X workspace for the user and we are doing same for other workspaces too.

My app is working completely fine with the single Firebase config. But when I'm trying to setup my app for secondary configuration the app is throwing below error.

```<code>[FirebaseMessaging][I-FCM002022] APNS device token not set before retrieving FCM Token for Sender ID '1098162630058'. Notifications to this FCM Token will not be delivered over APNS.Be sure to re-retrieve the FCM token once the APNS device token is set.
</code>```

Below is my implementation for switching the firebase Configuration

```<code>func switchFirebaseTEMP() {
    let firebaseConfig = FirebaseConfigResp(
            appId: "XXXX",
            projectId: "XXXX",
            apiKey: "XXXXXX",
            messagingSenderId: "XXXXX",
            storageBucket: "XXXX",
            databaseURL: "XXXXX"
    )

    if FirebaseApp.app() != nil {
        FirebaseApp.app()?.delete { response in
            FirebaseService.shared.switchFirebaseAccount(firebaseConfig: firebaseConfig)
        }
    } else {
        FirebaseService.shared.switchFirebaseAccount(firebaseConfig: firebaseConfig)
    }
    FirebaseService.shared.updateFCMToken()
}

func switchFirebaseAccount(firebaseConfig: FirebaseConfigResp) {
    let firebaseOptions = FirebaseOptions(googleAppID: firebaseConfig.appId,
            gcmSenderID: firebaseConfig.messagingSenderId)
    firebaseOptions.apiKey = firebaseConfig.apiKey
    firebaseOptions.projectID = firebaseConfig.projectId
    firebaseOptions.databaseURL = firebaseConfig.databaseURL
    firebaseOptions.storageBucket = firebaseConfig.storageBucket

    print("Switching the Firebase configuration to \(firebaseOptions)")
    FirebaseApp.configure(options: firebaseOptions)
}
</code>```

Body:
I want to setup a different firebase on the basis of user's workspace login. Suppose user wants to login to X workspace then on the basis of it we will setup the FCM or Firebase associated to X workspace for the user and we are doing same for other workspaces too.

My app is working completely fine with the single Firebase config. But when I'm trying to setup my app for secondary configuration the app is throwing below error.

[FirebaseMessaging][I-FCM002022] APNS device token not set before retrieving FCM Token for Sender ID '1098162630058'. Notifications to this FCM Token will not be delivered over APNS.Be sure to re-retrieve the FCM token once the APNS device token is set.

Below is my implementation for switching the firebase Configuration

func switchFirebaseTEMP() {
    let firebaseConfig = FirebaseConfigResp(
            appId: "XXXX",
            projectId: "XXXX",
            apiKey: "XXXXXX",
            messagingSenderId: "XXXXX",
            storageBucket: "XXXX",
            databaseURL: "XXXXX"
    )

    if FirebaseApp.app() != nil {
        FirebaseApp.app()?.delete { response in
            FirebaseService.shared.switchFirebaseAccount(firebaseConfig: firebaseConfig)
        }
    } else {
        FirebaseService.shared.switchFirebaseAccount(firebaseConfig: firebaseConfig)
    }
    FirebaseService.shared.updateFCMToken()
}

func switchFirebaseAccount(firebaseConfig: FirebaseConfigResp) {
    let firebaseOptions = FirebaseOptions(googleAppID: firebaseConfig.appId,
            gcmSenderID: firebaseConfig.messagingSenderId)
    firebaseOptions.apiKey = firebaseConfig.apiKey
    firebaseOptions.projectID = firebaseConfig.projectId
    firebaseOptions.databaseURL = firebaseConfig.databaseURL
    firebaseOptions.storageBucket = firebaseConfig.storageBucket

    print("Switching the Firebase configuration to \(firebaseOptions)")
    FirebaseApp.configure(options: firebaseOptions)
}


问:
Java Aspose Slides find and replace text cannot keep text style
I'm working with: Aspose.Slides lib to read PPT and PPTX files.

When I replace text with another text, the font size is broken.
Origin:

After replace text:

```<code>public void asposeTranslate(String fileName) throws IOException {
        Locale.setDefault(new Locale("en-us"));
        // Load presentation
        Presentation pres = new Presentation(URL + "/" + fileName);

        // Loop through each slide
        for (ISlide slide : pres.getSlides()) {
            // Get all text frames in the slide
            ITextFrame[] tf = SlideUtil.getAllTextBoxes(slide);

            for (int i = 0; i < tf.length; i++) {

                for (IParagraph para : tf[i].getParagraphs()) {

                    for (IPortion port : para.getPortions()) {
                        String originText = port.getText();
                        String newText = translateText(originTexmakes); // method make a new text
                        port.setText(newText); // replace with new text
                    }
                }
            }
        }
        pres.save(URL + "/new_" + fileName, SaveFormat.Pptx);
    }
</code>```

I read from blogs: https://blog.aspose.com/slides/find-and-replace-text-in-powerpoint-using-java/#API-to-Find-and-Replace-Text-in-PowerPoint

After replacing the new text, How can I keep older all styles of the older text?

I used aspose-slides-21.7

Thanks,

Body:
I'm working with: Aspose.Slides lib to read PPT and PPTX files.

When I replace text with another text, the font size is broken.
Origin:

After replace text:

public void asposeTranslate(String fileName) throws IOException {
        Locale.setDefault(new Locale("en-us"));
        // Load presentation
        Presentation pres = new Presentation(URL + "/" + fileName);

        // Loop through each slide
        for (ISlide slide : pres.getSlides()) {
            // Get all text frames in the slide
            ITextFrame[] tf = SlideUtil.getAllTextBoxes(slide);

            for (int i = 0; i < tf.length; i++) {

                for (IParagraph para : tf[i].getParagraphs()) {

                    for (IPortion port : para.getPortions()) {
                        String originText = port.getText();
                        String newText = translateText(originTexmakes); // method make a new text
                        port.setText(newText); // replace with new text
                    }
                }
            }
        }
        pres.save(URL + "/new_" + fileName, SaveFormat.Pptx);
    }

I read from blogs: https://blog.aspose.com/slides/find-and-replace-text-in-powerpoint-using-java/#API-to-Find-and-Replace-Text-in-PowerPoint

After replacing the new text, How can I keep older all styles of the older text?

I used aspose-slides-21.7

Thanks,


问:
Displaying bar Code in PDF file on every page of the PDF, in Laravel

I am Using Imagick to Convert PDF to Images

Uploading PDF to Laravel

```<code>public function uploadPdf( Request $request )
    {
        $model = new Attachment();
        if ( $request->hasFile('pdf_file_from_request') ) {
            Storage::deleteDirectory('3pagerpdf/pdf');
            $pdf      = $request->file('pdf_file_from_request');
            $fileName = time() . '.' . $pdf->getClientOriginalName();
            Storage::putFileAs('3pagerpdf/pdf', $pdf, $fileName);
            $model->pdf_file_name_in_datebase = $fileName;
            $model->save();
            flash()->addSuccess('Pdf Added');
            return back();
        }
    }
</code>```

Converting that PDF to Images

```<code>public function convertpdftoimages()
    {

        $model = Attachment::first();

        set_time_limit(300);
        // Get the PDF file from the storage folder
        $pdfPath = storage_path('app/3pagerpdf/pdf/'.$model->pdf_file_name_in_datebase);

        // Create an Imagick object
        $imagick = new Imagick();

        // Set the resolution and output format
        $imagick->setResolution(300, 300);
        $imagick->setFormat('jpeg');

        // Read the PDF file into the Imagick object
        $imagick->readImage($pdfPath);

        // Convert each page of the PDF to an image
        foreach ( $imagick as $page ) {
            $page->writeImage(public_path("/temp_images/page{$page->getImageIndex()}.jpg"));
        }

        flash()->addSuccess('Convertion Successfull');
        return back();
    }
</code>```

Adding bar code to those images

```<code>public function add_bar_code_to_images2()
    {

        $files = File::files('temp_images');

        foreach ( $files as $file ) {
            // Generate a barcode image for the file
            $barcodeGenerator = new BarcodeGeneratorPNG();
            $data = '';
            for ($i = 0; $i < 10; $i++) {
                $data .= rand(0, 9);
            }
            $barcodeString = $barcodeGenerator->getBarcode($data, $barcodeGenerator::TYPE_CODE_128);

            // Create an image resource from the barcode string
            $barcodeImage = imagecreatefromstring($barcodeString);
            // Load the original image
            $originalImage = imagecreatefromjpeg($file->getPathname());

            // Merge the barcode image with the original image
            imagecopy($originalImage, $barcodeImage, imagesx($originalImage) - imagesx($barcodeImage) - 10, 10, 0, 0, imagesx($barcodeImage), imagesy($barcodeImage));

            // Save the modified image to a new path
            imagejpeg($originalImage, 'modified_images/' . $file->getFilename());
        }

        flash()->addSuccess('Bar Code Added Succesfuully');
        return back();

    }
</code>```

Converting those images Back to pdf

```<code> public function convertimagestopdf(  )
    {
        // Create a new Imagick object
        $imagick = new Imagick();

        // Set the resolution of the PDF
        $imagick->setResolution(300, 300);

        // Iterate over the images in the "modified_images" directory
        foreach (glob("modified_images/*.jpg") as $image) {
            // Read the image file
            $imagick->readImage($image);
        }

        // Set the format of the PDF to "application/pdf"
        $imagick->setImageFormat('pdf');

        // Save the PDF to a file
        $imagick->writeImages('modified_pdf/document.pdf', true);
        flash()->addSuccess('pdf compileed');
        return back();

    }
</code>```

What I want is

I want to add bar code to every single page of a pdf but I dont want to use imagick extenstion it needs to be installed on a system to make it work .

I tried the above code

it is taking too long to execute for small pdf's that code it fine but for the pdf with 60 pages and above it starts to give me time out error

Note I am not generating this pdf

the pdf will be uploaded by random user of my application and it will be already a pdf I just need to add barcode to every single page of the pdf .

I will take any alternative solution

in which i dont have to install any application on my computer
like ghostscript

Body:
I am Using Imagick to Convert PDF to Images

Uploading PDF to Laravel

public function uploadPdf( Request $request )
    {
        $model = new Attachment();
        if ( $request->hasFile('pdf_file_from_request') ) {
            Storage::deleteDirectory('3pagerpdf/pdf');
            $pdf      = $request->file('pdf_file_from_request');
            $fileName = time() . '.' . $pdf->getClientOriginalName();
            Storage::putFileAs('3pagerpdf/pdf', $pdf, $fileName);
            $model->pdf_file_name_in_datebase = $fileName;
            $model->save();
            flash()->addSuccess('Pdf Added');
            return back();
        }
    }

Converting that PDF to Images

public function convertpdftoimages()
    {

        $model = Attachment::first();

        set_time_limit(300);
        // Get the PDF file from the storage folder
        $pdfPath = storage_path('app/3pagerpdf/pdf/'.$model->pdf_file_name_in_datebase);

        // Create an Imagick object
        $imagick = new Imagick();

        // Set the resolution and output format
        $imagick->setResolution(300, 300);
        $imagick->setFormat('jpeg');

        // Read the PDF file into the Imagick object
        $imagick->readImage($pdfPath);

        // Convert each page of the PDF to an image
        foreach ( $imagick as $page ) {
            $page->writeImage(public_path("/temp_images/page{$page->getImageIndex()}.jpg"));
        }

        flash()->addSuccess('Convertion Successfull');
        return back();
    }

Adding bar code to those images

public function add_bar_code_to_images2()
    {

        $files = File::files('temp_images');

        foreach ( $files as $file ) {
            // Generate a barcode image for the file
            $barcodeGenerator = new BarcodeGeneratorPNG();
            $data = '';
            for ($i = 0; $i < 10; $i++) {
                $data .= rand(0, 9);
            }
            $barcodeString = $barcodeGenerator->getBarcode($data, $barcodeGenerator::TYPE_CODE_128);

            // Create an image resource from the barcode string
            $barcodeImage = imagecreatefromstring($barcodeString);
            // Load the original image
            $originalImage = imagecreatefromjpeg($file->getPathname());

            // Merge the barcode image with the original image
            imagecopy($originalImage, $barcodeImage, imagesx($originalImage) - imagesx($barcodeImage) - 10, 10, 0, 0, imagesx($barcodeImage), imagesy($barcodeImage));

            // Save the modified image to a new path
            imagejpeg($originalImage, 'modified_images/' . $file->getFilename());
        }

        flash()->addSuccess('Bar Code Added Succesfuully');
        return back();

    }

Converting those images Back to pdf

 public function convertimagestopdf(  )
    {
        // Create a new Imagick object
        $imagick = new Imagick();

        // Set the resolution of the PDF
        $imagick->setResolution(300, 300);

        // Iterate over the images in the "modified_images" directory
        foreach (glob("modified_images/*.jpg") as $image) {
            // Read the image file
            $imagick->readImage($image);
        }

        // Set the format of the PDF to "application/pdf"
        $imagick->setImageFormat('pdf');

        // Save the PDF to a file
        $imagick->writeImages('modified_pdf/document.pdf', true);
        flash()->addSuccess('pdf compileed');
        return back();

    }

What I want is

I want to add bar code to every single page of a pdf but I dont want to use imagick extenstion it needs to be installed on a system to make it work .

I tried the above code

it is taking too long to execute for small pdf's that code it fine but for the pdf with 60 pages and above it starts to give me time out error

Note I am not generating this pdf

the pdf will be uploaded by random user of my application and it will be already a pdf I just need to add barcode to every single page of the pdf .

I will take any alternative solution

in which i dont have to install any application on my computer
like ghostscript


问:
Does SCOM part of System center product suit license or do we have to pay extra license for SCOM agent?
I am searching for a valid answer whether we have to purchase an extra license for SCOM agent, or is it part of one license (System center suit)?

The intention to ask this question is that we already have a Microsoft System Center product suit license. Now, we want to install SCOM to manage 5000 servers.  Is there any extra license purchase required to manage 5000 SCOM agents?


问:
How to open Google Playstore > account > subscriptions section directly?
I try to open Google Playstore > account > subscriptions section directly in my app.
I know there is an app scheme that starts with market://, but I don't know the detailed address.</p>


问:
Barcode CODE_128 using PrintHTML with Qz Tray
Good Day All,

Right now, i'm trying to print using HTML with Qz-Tray. Can i make a barcode on that template HTML. The Problem is, that HTML template is STRING so it can not be change it using Javascript and I'm Trying to use Libre Font 128 Font Family but still not working.

https://www.w3schools.com/howto/tryit.asp?font=Libre%20Barcode%20128 i  want to use that library, in this

```<code>function printHTML() {
    var config = getUpdatedConfig();

    var colA = '<h2>*  QZ Print Plugin HTML Printing  *</h2>' +
            '<span style="color: #F00;">Version:</span> ' + qzVersion + '<br/>' +
            '<span style="color: #F00;">Visit:</span> https://qz.io/';
    var colB = '<img src="' + getPath() + '/assets/img/image_sample.png">';

    var printData = [
        {
            type: 'html',
            format: 'plain',
            data: '<html>' +
            '   <table style="font-family: monospace; border: 1px;">' +
            '       <tr style="height: 6cm;">' +
            '           <td valign="top">' + colA + '</td>' +
            '           <td valign="top">' + colB + '</td>' +
            '       </tr>' +
            '   </table>' +
            '</html>'
        }
    ];

    qz.print(config, printData).catch(displayError);
}
</code>```

or this https://barcode-coder.com/en/barcode-jquery-plugin-201.html

Body:
Good Day All,

Right now, i'm trying to print using HTML with Qz-Tray. Can i make a barcode on that template HTML. The Problem is, that HTML template is STRING so it can not be change it using Javascript and I'm Trying to use Libre Font 128 Font Family but still not working.

https://www.w3schools.com/howto/tryit.asp?font=Libre%20Barcode%20128 i  want to use that library, in this

function printHTML() {
    var config = getUpdatedConfig();

    var colA = '
*  QZ Print Plugin HTML Printing  *
' +
            'Version: ' + qzVersion + '
' +
            'Visit: https://qz.io/';
    var colB = '';

    var printData = [
        {
            type: 'html',
            format: 'plain',
            data: '' +
            '
' +
            '
' +
            '           ' + colA + '	' +
            '           ' + colB + '	' +
            '
' +
            '
' +
            ''
        }
    ];

    qz.print(config, printData).catch(displayError);
}

or this https://barcode-coder.com/en/barcode-jquery-plugin-201.html


问:
jQuery DatePicker does not hide when click outside
DatePicker does not hide as usual when clicked outside of the input field. The user had to select a date, click on the close button or press the Esc button from the keyboard explicitly to close the Datepicker.

DatePicker version: 5.1.1

As a fix I tried to run the following code segment on the browser console, then it worked. However, when I put the code on the Javascript file, the fix is not working.

$('input').on( 'blur', function () {
    if( $(this).hasClass( 'is-datepick' ) ) {
        console.log( 'Datepicker is closed!' );
        $.datepick.performAction($(this), 'close');
//                plugin.performAction(elem, action);
    }
} );

```

How to solve this issue? Thanks in advance.

Body:
DatePicker does not hide as usual when clicked outside of the input field. The user had to select a date, click on the close button or press the Esc button from the keyboard explicitly to close the Datepicker.

DatePicker version: 5.1.1

As a fix I tried to run the following code segment on the browser console, then it worked. However, when I put the code on the Javascript file, the fix is not working.

$('input').on( 'blur', function () {
    if( $(this).hasClass( 'is-datepick' ) ) {
        console.log( 'Datepicker is closed!' );
        $.datepick.performAction($(this), 'close');
//                plugin.performAction(elem, action);
    }
} );

How to solve this issue? Thanks in advance.


问:
XMLRPC Client Connection Header Keepalive in HTTP 1.1 in Java Application
We are implementing xmlrpc client where HTTP 1.1 is implemented at server end. Server end is with another company and we can not change it.
As HTTP 1.1 RFC Server send us Connection header without Keep-Alive and xmlrpc client should not close it because that's the default behavior standardize in http 1.1. However My client xmlrpc implementation closes the connection after one request and then open new connection for next request, i tried with my own server and forcing server to send me keep-Alive, then xmlrpc client honors the keep-alive and keep the connection open for multiple requests. But as per HTTP 1.1 its not the expected behavior.

I investigated that xmlrpc client relies on different factories and sun15 factory is being used and xmlrpc relies on this factory, but i am still unable to identify why sun15 factory does not honors the standard. Maximum requests I saw on a single connection are 3 then client send TCP FIN to server to close the connection.

Below is my code for client
**
**XMLRPC Client
**

```<code>`package com.example;

import org.apache.xmlrpc.XmlRpcClient;

import java.util.Scanner;
import java.util.Vector;

public class MultithreadingClient extends Thread {
    public void run() {
        try {
            XmlRpcClient client = new XmlRpcClient("http://localhost:5300/");
            Vector params = new Vector();

            String msg = "hi";//sc.nextLine();
            params.addElement(msg);

            // Send message to server with method name
            Object result = client.execute("myServer.getMessage", params);
            params.clear();

            System.out.println("Thread "+Thread.currentThread().getId()+" : "+result);

        } catch (Exception exception) {
            System.err.println("JavaClient: " + exception);
        }

    }
}
</code>```

`

**main class
**

```<code>`package com.example;

public class xmlrpcClient {
    public static void main(String []args) throws InterruptedException {
        int n = 50; // Number of threads
        for (int j = 0; j < 50; j++) {
            for (int i = 0; i < 5; i++) {
                MultithreadingClient thread = new MultithreadingClient();
                thread.start();
            }
            Thread.sleep(5000);
        }
    }
}`
</code>```

Body:
We are implementing xmlrpc client where HTTP 1.1 is implemented at server end. Server end is with another company and we can not change it.
As HTTP 1.1 RFC Server send us Connection header without Keep-Alive and xmlrpc client should not close it because that's the default behavior standardize in http 1.1. However My client xmlrpc implementation closes the connection after one request and then open new connection for next request, i tried with my own server and forcing server to send me keep-Alive, then xmlrpc client honors the keep-alive and keep the connection open for multiple requests. But as per HTTP 1.1 its not the expected behavior.

I investigated that xmlrpc client relies on different factories and sun15 factory is being used and xmlrpc relies on this factory, but i am still unable to identify why sun15 factory does not honors the standard. Maximum requests I saw on a single connection are 3 then client send TCP FIN to server to close the connection.

Below is my code for client
**
**XMLRPC Client
**

`package com.example;

import org.apache.xmlrpc.XmlRpcClient;

import java.util.Scanner;
import java.util.Vector;

public class MultithreadingClient extends Thread {
    public void run() {
        try {
            XmlRpcClient client = new XmlRpcClient("http://localhost:5300/");
            Vector params = new Vector();

            String msg = "hi";//sc.nextLine();
            params.addElement(msg);

            // Send message to server with method name
            Object result = client.execute("myServer.getMessage", params);
            params.clear();

            System.out.println("Thread "+Thread.currentThread().getId()+" : "+result);

        } catch (Exception exception) {
            System.err.println("JavaClient: " + exception);
        }

    }
}

`

**main class
**

`package com.example;

public class xmlrpcClient {
    public static void main(String []args) throws InterruptedException {
        int n = 50; // Number of threads
        for (int j = 0; j < 50; j++) {
            for (int i = 0; i < 5; i++) {
                MultithreadingClient thread = new MultithreadingClient();
                thread.start();
            }
            Thread.sleep(5000);
        }
    }
}`


问:
cannot coerce class ‘"formula"’ to a data.frame
I am trying to use Hotelling test
When I call hotelling.test(.~Number, bottle.df)
everything is OK.

However, when I try to do Hotelling test to only one element,

```<code>```
bottle_elem1<-data.frame(bottle.df$Number,bottle.df$Mn)
hotelling.test(bottle.df.Number, bottle_elem1)
```
</code>```

it gives an error

```<code>> Error in as.data.frame.default(x[[i]], optional = TRUE): cannot coerce class ‘"formula"’ to a data.frame
>Traceback:
>1. data.frame(. ~ Number, bottle.df$Mn)
>2. as.data.frame(x[[i]], optional = TRUE)
>3. as.data.frame.default(x[[i]], optional = TRUE)
>4. stop(gettextf("cannot coerce class %s to a data.frame", sQuote(deparse(class(x))[1L])),
 .     domain = NA)
</code>```

I understand that should do it differently, but don't know how. If I use like previously .~Number, there is an error too
What is correct code to do Hotelling test for a column? Maybe I should extract column differently, but don't know how.
bottle is from Hotelling package

```<code>structure(list(Number = c(1L, 1L, 1L, 1L, 1L, 1L), Mn = c(56.1,
53.8, 58.7, 54.6, 58.6, 56.8), Ba = c(170.7, 166.2, 184.2, 170.5,
185.2, 180.5), Sr = c(145.1, 143.3, 156.5, 158.1, 161.3, 146.7
), Zr = c(77.4, 71.6, 78.2, 75.3, 83.9, 79.2), Ti = c(267.4,
270, 286.4, 273.6, 289.9, 274)), row.names = c(NA, 6L), class = "data.frame")
</code>```

Body:
I am trying to use Hotelling test
When I call hotelling.test(.~Number, bottle.df)
everything is OK.

However, when I try to do Hotelling test to only one element,

```
bottle_elem1<-data.frame(bottle.df$Number,bottle.df$Mn)
hotelling.test(bottle.df.Number, bottle_elem1)
```

it gives an error

> Error in as.data.frame.default(x[[i]], optional = TRUE): cannot coerce class ‘"formula"’ to a data.frame
>Traceback:
>1. data.frame(. ~ Number, bottle.df$Mn)
>2. as.data.frame(x[[i]], optional = TRUE)
>3. as.data.frame.default(x[[i]], optional = TRUE)
>4. stop(gettextf("cannot coerce class %s to a data.frame", sQuote(deparse(class(x))[1L])),
 .     domain = NA)

I understand that should do it differently, but don't know how. If I use like previously .~Number, there is an error too
What is correct code to do Hotelling test for a column? Maybe I should extract column differently, but don't know how.
bottle is from Hotelling package

structure(list(Number = c(1L, 1L, 1L, 1L, 1L, 1L), Mn = c(56.1,
53.8, 58.7, 54.6, 58.6, 56.8), Ba = c(170.7, 166.2, 184.2, 170.5,
185.2, 180.5), Sr = c(145.1, 143.3, 156.5, 158.1, 161.3, 146.7
), Zr = c(77.4, 71.6, 78.2, 75.3, 83.9, 79.2), Ti = c(267.4,
270, 286.4, 273.6, 289.9, 274)), row.names = c(NA, 6L), class = "data.frame")


问:
Data structure list
I couldn`t calculate and print the total profit and quantity from each cluster from the list.

Row 13 is profit and row 14 is quantity.

The results should print the total profit and quantity from each cluster in 3 different lines.

Can someone give a solution to this:)

```<code>

 # create 3 empty lists to store profit and quantity by each cluster
    cluster1 = []
    cluster2 = []
    cluster3 = []

    # append profit and quantity as a list back to each empty list
    for row in reader:

    if row[4] == "Cluster 1":
       cluster1.append([row[13], row[14]])
    elif row[4] == "Cluster 2":
        cluster2.append([row[13], row[14]])
    else:
        cluster3.append([row[13], row[14]])

#need to Calculate the total profit and total quantity using cluster 1,2,3 variables

def profits_list(cluster):
    profit = 0
    quantity = 0
    if cluster == "Cluster 1":
        for numbers in cluster1:
            profit = numbers[0]
        for amount in cluster1:
            quantity = amount[1]
            return f'Cluster 1: {profit}' or f'Cluster 1: {quantity}'

    elif cluster == "Cluster 2":
        for numbers in cluster2:
            profit = numbers[0]
        for amount in cluster2:
            quantity = amount[1]
            return f'Cluster 2:{profit}' or f'Cluster 2:{quantity}'

    elif cluster == "Cluster 3":
        for numbers in cluster2:
            profit = numbers[0]
        for amount in cluster3:
            quantity = amount[1]
            return f'Cluster 3:{profit}' or f'Cluster 3:{quantity}'

print(profits_list("Cluster 1"))
print(profits_list("Cluster 2"))
print(profits_list("Cluster 3"))

</code>```

Title: Data structure list

Body:
I couldn`t calculate and print the total profit and quantity from each cluster from the list.

Row 13 is profit and row 14 is quantity.

The results should print the total profit and quantity from each cluster in 3 different lines.

Can someone give a solution to this:)

 # create 3 empty lists to store profit and quantity by each cluster
    cluster1 = []
    cluster2 = []
    cluster3 = []

    # append profit and quantity as a list back to each empty list
    for row in reader:

    if row[4] == "Cluster 1":
       cluster1.append([row[13], row[14]])
    elif row[4] == "Cluster 2":
        cluster2.append([row[13], row[14]])
    else:
        cluster3.append([row[13], row[14]])

#need to Calculate the total profit and total quantity using cluster 1,2,3 variables

def profits_list(cluster):
    profit = 0
    quantity = 0
    if cluster == "Cluster 1":
        for numbers in cluster1:
            profit = numbers[0]
        for amount in cluster1:
            quantity = amount[1]
            return f'Cluster 1: {profit}' or f'Cluster 1: {quantity}'

    elif cluster == "Cluster 2":
        for numbers in cluster2:
            profit = numbers[0]
        for amount in cluster2:
            quantity = amount[1]
            return f'Cluster 2:{profit}' or f'Cluster 2:{quantity}'

    elif cluster == "Cluster 3":
        for numbers in cluster2:
            profit = numbers[0]
        for amount in cluster3:
            quantity = amount[1]
            return f'Cluster 3:{profit}' or f'Cluster 3:{quantity}'

print(profits_list("Cluster 1"))
print(profits_list("Cluster 2"))
print(profits_list("Cluster 3"))


问:
How to undefine symbol for a C# project
I have a C# project defining a symbol named WIN:

```<code>  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <DefineConstants>$(DefineConstants);WIN</DefineConstants>
  </PropertyGroup>
</code>```

This constant is used in an #if preprocessor directive to conditionally perform some actions, namely, to import some libraries:

```<code>#if WIN
        const string MyExternalLibrary = @"./lib/Win/MyExternalLibrary.dll";
#else
        const string MyExternalLibrary = @"./lib/Linux/MyExternalLibrary.so";
#endif

[...]

  [DllImport(MyExternalLibrary )]
  public static extern IntPtr MyFunction();

</code>```

I'd like the WIN constant to be defined, by default, so that the project can be built on windows machines.

At publish time, however, I'd like it to be undefined, to fall in the #else block.

Is there a way to tell dotnet build to undefine a symbol (that is, the opposite of dotnet build's -p switch)?

Title: How to undefine symbol for a C# project

Body:
I have a C# project defining a symbol named WIN:

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
    <DefineConstants>$(DefineConstants);WIN</DefineConstants>
  </PropertyGroup>

This constant is used in an #if preprocessor directive to conditionally perform some actions, namely, to import some libraries:

#if WIN
        const string MyExternalLibrary = @"./lib/Win/MyExternalLibrary.dll";
#else
        const string MyExternalLibrary = @"./lib/Linux/MyExternalLibrary.so";
#endif

[...]

  [DllImport(MyExternalLibrary )]
  public static extern IntPtr MyFunction();

I'd like the WIN constant to be defined, by default, so that the project can be built on windows machines.

At publish time, however, I'd like it to be undefined, to fall in the #else block.

Is there a way to tell dotnet build to undefine a symbol (that is, the opposite of dotnet build's -p switch)?


问:
Hero Section slider animation problem in react
I added three sliders in my hero section, first slider only animation working, another two slider animation not working what should I do now?

I used https://michalsnik.github.io/aos/ this for animation, and https://www.npmjs.com/package/react-slick-carousel this for carousel.

```<code>  <div data-aos="fade-up"
    data-aos-offset="200"
    data-aos-delay="50"
    data-aos-duration="1000"
    data-aos-mirror="true"
    data-aos-once="true">
      <h2>test</h2>
    </div>
</code>```

Body:
I added three sliders in my hero section, first slider only animation working, another two slider animation not working what should I do now?

I used https://michalsnik.github.io/aos/ this for animation, and https://www.npmjs.com/package/react-slick-carousel this for carousel.

test


问:
CSS i want the above line not to appear i adjust height but it doesn't work

```<code>      _after: {
    width: 'full',
    top: '49%',
    left: '50%',
    // height: '99%',
    height: { base: '90%', sm: '133%' },
    content: '"-"',
    position: 'absolute',
    color: 'transparent',
    backgroundRepeat: 'no-repeat',
    backgroundPosition: 'center',
    transform: 'translate(-50%, -50%)',
    webkitTransform: 'translate(-50%, -50%)'
  },
</code>```

code is here. Can you tell me what should be set in the css? It happens when I give height but it also expands. I don't want it to expand

Body:
      _after: {
    width: 'full',
    top: '49%',
    left: '50%',
    // height: '99%',
    height: { base: '90%', sm: '133%' },
    content: '"-"',
    position: 'absolute',
    color: 'transparent',
    backgroundRepeat: 'no-repeat',
    backgroundPosition: 'center',
    transform: 'translate(-50%, -50%)',
    webkitTransform: 'translate(-50%, -50%)'
  },

code is here. Can you tell me what should be set in the css? It happens when I give height but it also expands. I don't want it to expand


问:
Error after Upgrading consul to 1.8.7 from 0.4.0
I upgraded consul to 1.8.7 when I moved to Ubuntu 22. I am facing the following error,

● consul.service - Consul Agent
Loaded: loaded (/lib/systemd/system/consul.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-01-12 06:00:59 UTC; 22min ago    Main PID: 206769 (consul)
Tasks: 20 (limit: 119416)
Memory: 19.8M
CPU: 3.686s
CGroup: /system.slice/consul.service
└─206769 /usr/bin/consul agent -config-dir /etc/consul

node231 consul[206769]:     2023-01-12T06:22:56.783Z [WARN]  agent:
error getting server health from server: server=node231 error="rpc
error getting client: failed to get conn: dial tcp
10.142.0.39:0->10.142.0.39:8300: i/o timeout"  node231 consul[206769]:     2023-01-12T06:22:56.783Z [WARN]  agent: error getting server health
from server: server=node231 error="rpc error getting client: failed to
get conn: rpc error: lead thread didn't get connection"  node231
consul[206769]:     2023-01-12T06:22:56.783Z [WARN]  agent: error
getting server health from server: server=node231 error="rpc error
getting client: failed to get conn: rpc error: lead thread didn't get
connection"  node231 consul[206769]:     2023-01-12T06:22:56.783Z
[WARN]  agent: error getting server health from server: server=node231
error="rpc error getting client: failed to get conn: rpc error: lead
thread didn't get connection"  node231 consul[206769]:

2023-01-12T06:22:56.783Z [WARN]  agent: error getting server health
from server: server=node231 error="rpc error getting client: failed to
get conn: rpc error: lead thread didn't get connection"  node231
consul[206769]:     2023-01-12T06:22:56.783Z [WARN]  agent: error
getting server health from server: server=node231 error="rpc error
getting client: failed to get conn: rpc error: lead thread didn't get
connection"  node231 consul[206769]:     2023-01-12T06:22:57.782Z
[WARN]  agent: error getting server health from server: server=node231
error="context deadline exceeded"  node231 consul[206769]:

2023-01-12T06:22:59.783Z [WARN]  agent: error getting server health
from server: server=node231 error="context deadline exceeded"  node231
consul[206769]:     2023-01-12T06:23:01.782Z [WARN]  agent: error
getting server health from server: server=node231 error="context
deadline exceeded"  node231 consul[206769]:

2023-01-12T06:23:03.160Z [ERROR] agent.http: Request error: method=GET
url=/v1/agent/check/fail/service:puppet from=127.0.0.1:55702
error="method GET not allowed"

```<code>My server info
agent:
        check_monitors = 0
        check_ttls = 2
        checks = 2
        services = 2
build:
        prerelease =
        revision =
        version = 1.8.7
consul:
        acl = disabled
        bootstrap = true
        known_datacenters = 1
        leader = true
        leader_addr = 10.142.0.39:8300
        server = true
raft:
        applied_index = 51
        commit_index = 51
        fsm_pending = 0
        last_contact = 0
        last_log_index = 51
        last_log_term = 2
        last_snapshot_index = 0
        last_snapshot_term = 0
        latest_configuration = [{Suffrage:Voter ID:c3b23645-fbf1-4a29-3497-d6cccb7d0941 Address:10.142.0.39:8300}]
        latest_configuration_index = 0
        num_peers = 0
        protocol_version = 3
        protocol_version_max = 3
        protocol_version_min = 0
        snapshot_version_max = 1
        snapshot_version_min = 0
        state = Leader
        term = 2
runtime:
        arch = amd64
        cpu_count = 32
        goroutines = 77
        max_procs = 32
        os = linux
        version = go1.17
serf_lan:
        coordinate_resets = 0
        encrypted = true
        event_queue = 1
        event_time = 2
        failed = 0
        health_score = 0
        intent_queue = 0
        left = 0
        member_time = 1
        members = 1
        query_queue = 0
        query_time = 1
serf_wan:
        coordinate_resets = 0
        encrypted = true
        event_queue = 0
        event_time = 1
        failed = 0
        health_score = 0
        intent_queue = 0
        left = 0
        member_time = 1
        members = 1
        query_queue = 0
        query_time = 1
</code>```

Is there anything else I need to take care for new version of consul?

Body:
I upgraded consul to 1.8.7 when I moved to Ubuntu 22. I am facing the following error,

● consul.service - Consul Agent
Loaded: loaded (/lib/systemd/system/consul.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-01-12 06:00:59 UTC; 22min ago    Main PID: 206769 (consul)
Tasks: 20 (limit: 119416)
Memory: 19.8M
CPU: 3.686s
CGroup: /system.slice/consul.service
└─206769 /usr/bin/consul agent -config-dir /etc/consul

node231 consul[206769]:     2023-01-12T06:22:56.783Z [WARN]  agent:
error getting server health from server: server=node231 error="rpc
error getting client: failed to get conn: dial tcp
10.142.0.39:0->10.142.0.39:8300: i/o timeout"  node231 consul[206769]:     2023-01-12T06:22:56.783Z [WARN]  agent: error getting server health
from server: server=node231 error="rpc error getting client: failed to
get conn: rpc error: lead thread didn't get connection"  node231
consul[206769]:     2023-01-12T06:22:56.783Z [WARN]  agent: error
getting server health from server: server=node231 error="rpc error
getting client: failed to get conn: rpc error: lead thread didn't get
connection"  node231 consul[206769]:     2023-01-12T06:22:56.783Z
[WARN]  agent: error getting server health from server: server=node231
error="rpc error getting client: failed to get conn: rpc error: lead
thread didn't get connection"  node231 consul[206769]:

2023-01-12T06:22:56.783Z [WARN]  agent: error getting server health
from server: server=node231 error="rpc error getting client: failed to
get conn: rpc error: lead thread didn't get connection"  node231
consul[206769]:     2023-01-12T06:22:56.783Z [WARN]  agent: error
getting server health from server: server=node231 error="rpc error
getting client: failed to get conn: rpc error: lead thread didn't get
connection"  node231 consul[206769]:     2023-01-12T06:22:57.782Z
[WARN]  agent: error getting server health from server: server=node231
error="context deadline exceeded"  node231 consul[206769]:

2023-01-12T06:22:59.783Z [WARN]  agent: error getting server health
from server: server=node231 error="context deadline exceeded"  node231
consul[206769]:     2023-01-12T06:23:01.782Z [WARN]  agent: error
getting server health from server: server=node231 error="context
deadline exceeded"  node231 consul[206769]:

2023-01-12T06:23:03.160Z [ERROR] agent.http: Request error: method=GET
url=/v1/agent/check/fail/service:puppet from=127.0.0.1:55702
error="method GET not allowed"

My server info
agent:
        check_monitors = 0
        check_ttls = 2
        checks = 2
        services = 2
build:
        prerelease =
        revision =
        version = 1.8.7
consul:
        acl = disabled
        bootstrap = true
        known_datacenters = 1
        leader = true
        leader_addr = 10.142.0.39:8300
        server = true
raft:
        applied_index = 51
        commit_index = 51
        fsm_pending = 0
        last_contact = 0
        last_log_index = 51
        last_log_term = 2
        last_snapshot_index = 0
        last_snapshot_term = 0
        latest_configuration = [{Suffrage:Voter ID:c3b23645-fbf1-4a29-3497-d6cccb7d0941 Address:10.142.0.39:8300}]
        latest_configuration_index = 0
        num_peers = 0
        protocol_version = 3
        protocol_version_max = 3
        protocol_version_min = 0
        snapshot_version_max = 1
        snapshot_version_min = 0
        state = Leader
        term = 2
runtime:
        arch = amd64
        cpu_count = 32
        goroutines = 77
        max_procs = 32
        os = linux
        version = go1.17
serf_lan:
        coordinate_resets = 0
        encrypted = true
        event_queue = 1
        event_time = 2
        failed = 0
        health_score = 0
        intent_queue = 0
        left = 0
        member_time = 1
        members = 1
        query_queue = 0
        query_time = 1
serf_wan:
        coordinate_resets = 0
        encrypted = true
        event_queue = 0
        event_time = 1
        failed = 0
        health_score = 0
        intent_queue = 0
        left = 0
        member_time = 1
        members = 1
        query_queue = 0
        query_time = 1

Is there anything else I need to take care for new version of consul?


问:
git credential fill from powershell is running forever
I need to write a powershell script (.ps1) containing the git credential fill command.

The script will like this

```<code>git credential fill
protocol=https
host=myHost
</code>```

If I save this to a .ps1 file and excecute it, it is running forever because it waits for the enter command.

I tried with backticks like this

```<code>git credential fill `
protocol=https `
host=myHost
</code>```

But then it is not recognizing this as valid command.

Is there any way to run this git command as powershell script?

This is the documentation of the command https://git-scm.com/docs/git-credential#IOFMT

Body:
I need to write a powershell script (.ps1) containing the git credential fill command.

The script will like this

git credential fill
protocol=https
host=myHost

If I save this to a .ps1 file and excecute it, it is running forever because it waits for the enter command.

I tried with backticks like this

git credential fill `
protocol=https `
host=myHost

But then it is not recognizing this as valid command.

Is there any way to run this git command as powershell script?

This is the documentation of the command https://git-scm.com/docs/git-credential#IOFMT


问:
How to render css as style inside shadow dom in react typescript
I have been trying to render my css codes as internal css inside react component in shadow dom boundry.
I have one css file and scss file. I like to render my css inside the app.tsx file as inline css.

```<code> <style>
          // css code here
        </style>
</code>```

From past two days I have tryed different different solution but it doesn't work. I have tryed styled-component package using createGlobalStyle but it's not working. Please help me this is the github repo https://github.com/rejoan121615/Digital_Assistant_Client.git

I am trying to render my css code as internal css.

Body:
I have been trying to render my css codes as internal css inside react component in shadow dom boundry.
I have one css file and scss file. I like to render my css inside the app.tsx file as inline css.

From past two days I have tryed different different solution but it doesn't work. I have tryed styled-component package using createGlobalStyle but it's not working. Please help me this is the github repo https://github.com/rejoan121615/Digital_Assistant_Client.git

I am trying to render my css code as internal css.


问:
How to enable static code analysis in AOSP development
I want to integrate some code style checker(formatter) tools or lint to do static code analysis on AOSP during development. I believe this can be done in the building process. I'm curious is there anything I can integrate into the AOSP building process for those checks?

Or does it already exist in the building process? If so, can I configure the check rules?

Any docs/ wikis or instructions are appreciated.


问:
How to find the cause of a broken wso2mi-dashboard?
Good day everyone.
We have wso2 implemented on three Docker containers. Everything worked fine until after adding the next flow, the entrance to the Micro Integration Dashboard stopped working. Moreover, the system itself continues to work, only you can not enter the panel.

Error image

login failed internal server error

No changes were made to the users or to the container itself.
I've searched and read everything I can, but I can't even grasp where the problem is.
Please push me in the right direction.
Here is the error from the logs:

```<code>[2023-01-12 07:40:08,602] ERROR {LoginDelegate} - Error logging into dashboard server java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
        at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
        at java.base/java.util.Objects.checkIndex(Objects.java:372)
        at java.base/java.util.ArrayList.get(ArrayList.java:459)
        at org.wso2.ei.dashboard.core.rest.delegates.auth.LoginDelegate.getTokenFromMI(LoginDelegate.java:80)
        at org.wso2.ei.dashboard.core.rest.delegates.auth.LoginDelegate.authenticateUser(LoginDelegate.java:51)
        at org.wso2.ei.dashboard.core.rest.api.LoginApi.receiveLogin(LoginApi.java:56)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:148)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:191)
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:200)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:103)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104)
        at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:268)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289)
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256)
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703)
        at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:416)
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229)
        at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.Server.handle(Server.java:516)
        at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
        at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:555)
        at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:410)
        at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:164)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
        at java.base/java.lang.Thread.run(Thread.java:829)

</code>```

Body:
Good day everyone.
We have wso2 implemented on three Docker containers. Everything worked fine until after adding the next flow, the entrance to the Micro Integration Dashboard stopped working. Moreover, the system itself continues to work, only you can not enter the panel.

Error image

login failed internal server error

No changes were made to the users or to the container itself.
I've searched and read everything I can, but I can't even grasp where the problem is.
Please push me in the right direction.
Here is the error from the logs:

[2023-01-12 07:40:08,602] ERROR {LoginDelegate} - Error logging into dashboard server java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
        at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
        at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
        at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
        at java.base/java.util.Objects.checkIndex(Objects.java:372)
        at java.base/java.util.ArrayList.get(ArrayList.java:459)
        at org.wso2.ei.dashboard.core.rest.delegates.auth.LoginDelegate.getTokenFromMI(LoginDelegate.java:80)
        at org.wso2.ei.dashboard.core.rest.delegates.auth.LoginDelegate.authenticateUser(LoginDelegate.java:51)
        at org.wso2.ei.dashboard.core.rest.api.LoginApi.receiveLogin(LoginApi.java:56)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:76)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:148)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:191)
        at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:200)
        at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:103)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:493)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:415)
        at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:104)
        at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:272)
        at org.glassfish.jersey.internal.Errors$1.call(Errors.java:268)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:316)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:298)
        at org.glassfish.jersey.internal.Errors.process(Errors.java:268)
        at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:289)
        at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:256)
        at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:703)
        at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:416)
        at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:370)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:389)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:342)
        at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:229)
        at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1450)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
        at org.eclipse.jetty.server.Server.handle(Server.java:516)
        at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
        at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:555)
        at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:410)
        at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:164)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
        at java.base/java.lang.Thread.run(Thread.java:829)


问:
pyspark dataframe with hbase connector get wrong data
I have a pyspark dataframe with unique uid field, and I write a map partition function to sum the occurrence of users. the map partition code is:

```<code>def get_mark_num(p):
  hbase_util = HappyBaseUtil("localhost", 9090)

  for r in p:
     uid = str(r.uid)
     mark_num_d = hbase_util.get_row("test", row=uid, columns=["info:marks"])

     if len(mark_num_d) == 0:
        hbase_util.put("test", row=uid, data={"info:marks": str(1)})
        yield Row(uid=r.uid, name=r.name, mark_num=1)
     else:
         mark_num = int(mark_num_d.get("info:marks")) + 1
         hbase_util.put("test", row=uid, data={"info:marks": str(mark_num)})
         yield Row(uid=r.uid, name=r.name, mark_num=mark_num)

df.rdd.mapPartitions(get_mark_num).toDF()
</code>```

The uid is unique in dataframe, and the test table in hbase is empty. When I first run the  code, it get a duplicated user, and in the test table, the mark_num is 2, but it should be 1. I can not find where is wrong with my code.

And I print the data in mapPartition, it got two result of one user(and I'm sure there only one user 391 in the dataframe):

```<code>===========this uid: 391, name: Jr.
==========time:1673509732.8683832. uid:391, mark_num_d: {}

===========this uid: 391, name: Jr.
==========time:1673509735.725803. uid:391, mark_num_d: {'info:marks': '1'}

</code>```

spark version: 2.4.0-cdh6.3.2
hbase version: 2.1.0-cdh6.3.2

Body:
I have a pyspark dataframe with unique uid field, and I write a map partition function to sum the occurrence of users. the map partition code is:

def get_mark_num(p):
  hbase_util = HappyBaseUtil("localhost", 9090)

  for r in p:
     uid = str(r.uid)
     mark_num_d = hbase_util.get_row("test", row=uid, columns=["info:marks"])

     if len(mark_num_d) == 0:
        hbase_util.put("test", row=uid, data={"info:marks": str(1)})
        yield Row(uid=r.uid, name=r.name, mark_num=1)
     else:
         mark_num = int(mark_num_d.get("info:marks")) + 1
         hbase_util.put("test", row=uid, data={"info:marks": str(mark_num)})
         yield Row(uid=r.uid, name=r.name, mark_num=mark_num)

df.rdd.mapPartitions(get_mark_num).toDF()

The uid is unique in dataframe, and the test table in hbase is empty. When I first run the  code, it get a duplicated user, and in the test table, the mark_num is 2, but it should be 1. I can not find where is wrong with my code.

And I print the data in mapPartition, it got two result of one user(and I'm sure there only one user 391 in the dataframe):

===========this uid: 391, name: Jr.
==========time:1673509732.8683832. uid:391, mark_num_d: {}

===========this uid: 391, name: Jr.
==========time:1673509735.725803. uid:391, mark_num_d: {'info:marks': '1'}

spark version: 2.4.0-cdh6.3.2
hbase version: 2.1.0-cdh6.3.2